From 7aa9a6fce611cfaf79b9c8f1934942f58ce4f7c6 Mon Sep 17 00:00:00 2001 From: Lee Saferite Date: Sun, 5 Feb 2012 13:44:44 -0500 Subject: [PATCH 1/4] Import Magento Release 1.7.0.0-alpha1 --- RELEASE_NOTES.txt | 627 + app/Mage.php | 25 +- app/code/core/Mage/Admin/Model/Observer.php | 6 +- app/code/core/Mage/Admin/Model/Roles.php | 60 +- app/code/core/Mage/Admin/Model/Session.php | 16 +- app/code/core/Mage/Admin/Model/User.php | 8 +- app/code/core/Mage/Admin/etc/config.xml | 2 +- .../Admin/sql/admin_setup/install-1.6.0.0.php | 12 +- .../Mage/AdminNotification/Helper/Data.php | 2 + .../Mage/AdminNotification/Model/Survey.php | 2 + .../Adminhtml/Block/Api/Tab/Rolesedit.php | 4 +- app/code/core/Mage/Adminhtml/Block/Backup.php | 64 +- .../Mage/Adminhtml/Block/Backup/Dialogs.php | 53 + .../core/Mage/Adminhtml/Block/Backup/Grid.php | 58 +- .../Form/Renderer/Fieldset/Element.php | 27 +- .../Product/Attribute/Set/Main/Formset.php | 39 +- .../Edit/Action/Attribute/Tab/Attributes.php | 1 + .../Catalog/Product/Edit/Tab/Attributes.php | 84 +- .../Catalog/Product/Edit/Tab/Categories.php | 96 +- .../Catalog/Product/Edit/Tab/Price/Group.php | 96 + .../Product/Edit/Tab/Price/Group/Abstract.php | 347 + .../Catalog/Product/Edit/Tab/Price/Tier.php | 300 +- .../Catalog/Product/Edit/Tab/Super/Config.php | 23 +- .../Product/Edit/Tab/Super/Config/Simple.php | 18 +- .../Adminhtml/Block/Catalog/Product/Grid.php | 46 +- .../Catalog/Product/Helper/Form/Gallery.php | 14 +- .../Catalog/Product/Helper/Form/Weight.php | 45 + .../Block/Catalog/Product/Widget/Chooser.php | 4 +- .../Block/Catalog/Search/Edit/Form.php | 51 +- .../Adminhtml/Block/Checkout/Agreement.php | 2 +- .../Block/Checkout/Agreement/Edit.php | 2 +- .../Mage/Adminhtml/Block/Cms/Page/Edit.php | 27 +- .../Edit/Renderer/Attribute/Group.php | 105 + .../Block/Customer/Edit/Tab/Account.php | 72 +- .../Block/Customer/Edit/Tab/Cart.php | 12 +- .../Block/Customer/Edit/Tab/Newsletter.php | 11 +- .../Block/Customer/Edit/Tab/View.php | 20 +- .../Customer/Edit/Tab/View/Accordion.php | 4 +- .../Block/Customer/Group/Edit/Form.php | 3 +- .../Address/Form/Billing/Renderer/Vat.php | 97 + .../Customer/System/Config/Validatevat.php | 79 + .../Mage/Adminhtml/Block/Media/Uploader.php | 7 +- .../Block/Promo/Quote/Edit/Tab/Coupons.php | 88 + .../Promo/Quote/Edit/Tab/Coupons/Form.php | 143 + .../Promo/Quote/Edit/Tab/Coupons/Grid.php | 144 + .../Tab/Coupons/Grid/Column/Renderer/Used.php | 42 + .../Block/Promo/Quote/Edit/Tab/Main.php | 30 +- .../Quote/Edit/Tab/Main/Renderer/Checkbox.php | 59 + .../Adminhtml/Block/Promo/Widget/Chooser.php | 4 + .../Block/Report/Customer/Totals/Grid.php | 7 +- .../core/Mage/Adminhtml/Block/Report/Grid.php | 16 +- .../Adminhtml/Block/Report/Grid/Abstract.php | 55 +- .../Adminhtml/Block/Report/Grid/Shopcart.php | 84 + .../Block/Report/Product/Ordered/Grid.php | 13 +- .../Adminhtml/Block/Report/Product/Viewed.php | 16 + .../Block/Report/Product/Viewed/Grid.php | 97 +- .../Block/Report/Refresh/Statistics/Grid.php | 8 +- .../Block/Report/Sales/Bestsellers/Grid.php | 3 +- .../Block/Report/Sales/Coupons/Grid.php | 45 +- .../Block/Report/Sales/Invoiced/Grid.php | 10 +- .../Block/Report/Sales/Refunded/Grid.php | 10 +- .../Block/Report/Sales/Sales/Grid.php | 112 +- .../Block/Report/Sales/Shipping/Grid.php | 13 +- .../Adminhtml/Block/Report/Sales/Tax/Grid.php | 6 +- .../Block/Report/Shopcart/Abandoned/Grid.php | 43 +- .../Block/Report/Shopcart/Customer/Grid.php | 10 +- .../Block/Report/Shopcart/Product/Grid.php | 9 +- .../Mage/Adminhtml/Block/Review/Edit/Form.php | 10 +- .../Block/Sales/Items/Column/Name.php | 17 + .../Adminhtml/Block/Sales/Order/Create.php | 26 +- .../Sales/Order/Create/Billing/Address.php | 1 + .../Block/Sales/Order/Create/Form/Address.php | 9 + .../Block/Sales/Order/Create/Sidebar/Cart.php | 22 +- .../Block/Sales/Order/Creditmemo/Create.php | 14 +- .../Block/Sales/Order/View/Tab/History.php | 128 +- .../Block/Sales/Transactions/Detail.php | 5 +- .../Block/Sales/Transactions/Detail/Grid.php | 3 +- .../Block/System/Config/Form/Fieldset.php | 19 +- .../Email/Template/Grid/Filter/Type.php | 17 +- .../Email/Template/Grid/Renderer/Type.php | 7 +- .../Block/System/Email/Template/Preview.php | 15 +- .../Mage/Adminhtml/Block/Tag/Edit/Form.php | 14 +- .../core/Mage/Adminhtml/Block/Widget/Form.php | 1 + .../Widget/Form/Renderer/Fieldset/Element.php | 3 +- .../core/Mage/Adminhtml/Block/Widget/Grid.php | 4 +- .../Adminhtml/Controller/Report/Abstract.php | 124 + .../core/Mage/Adminhtml/Model/Sales/Order.php | 4 +- .../Adminhtml/Model/Sales/Order/Create.php | 98 +- .../Admin/Password/Link/Expirationperiod.php | 3 +- .../Backend/Customer/GroupAutoAssign.php | 57 + .../Password/Link/Expirationperiod.php | 3 +- .../Model/System/Config/Backend/Filename.php | 37 + .../Model/System/Config/Backend/Locale.php | 9 +- .../System/Config/Source/Dev/Dbautoup.php | 7 +- .../Mage/Adminhtml/Model/System/Store.php | 2 +- .../Catalog/CategoryController.php | 2 +- .../Product/Action/AttributeController.php | 14 +- .../Catalog/Product/AttributeController.php | 23 +- .../controllers/Catalog/ProductController.php | 29 +- .../controllers/Catalog/SearchController.php | 4 +- .../Checkout/AgreementController.php | 8 +- .../System/Config/ValidatevatController.php | 85 + .../controllers/CustomerController.php | 145 +- .../controllers/DashboardController.php | 21 +- .../Adminhtml/controllers/IndexController.php | 66 +- .../Newsletter/SubscriberController.php | 8 +- .../Permissions/RoleController.php | 17 +- .../controllers/Promo/CatalogController.php | 12 +- .../controllers/Promo/QuoteController.php | 141 +- .../controllers/Report/ProductController.php | 48 +- .../controllers/Report/SalesController.php | 73 +- .../Report/StatisticsController.php | 13 +- .../Sales/Order/CreateController.php | 3 +- .../Sales/Order/ShipmentController.php | 23 +- .../controllers/Sales/OrderController.php | 11 +- .../Sales/TransactionsController.php | 10 +- .../controllers/System/BackupController.php | 248 +- .../controllers/System/VariableController.php | 6 +- .../Adminhtml/controllers/TagController.php | 16 +- .../core/Mage/Authorizenet/etc/system.xml | 1 + app/code/core/Mage/Backup/Helper/Data.php | 240 + app/code/core/Mage/Backup/Model/Backup.php | 62 +- .../Mage/Backup/Model/Config/Backend/Cron.php | 89 + .../Mage/Backup/Model/Config/Source/Type.php | 52 + .../core/Mage/Backup/Model/Fs/Collection.php | 10 +- app/code/core/Mage/Backup/Model/Observer.php | 95 + .../core/Mage/Backup/Model/Resource/Db.php | 47 +- .../Backup/Model/Resource/Helper/Mysql4.php | 51 +- app/code/core/Mage/Backup/etc/adminhtml.xml | 5 + app/code/core/Mage/Backup/etc/config.xml | 9 + app/code/core/Mage/Backup/etc/system.xml | 95 + .../Catalog/Product/Edit/Tab/Attributes.php | 21 +- .../Catalog/Product/View/Type/Bundle.php | 54 +- .../core/Mage/Bundle/Model/Product/Price.php | 189 +- .../Bundle/Model/Resource/Indexer/Price.php | 185 +- .../Bundle/Model/Resource/Indexer/Stock.php | 12 - app/code/core/Mage/Bundle/etc/config.xml | 2 +- .../mysql4-upgrade-1.6.0.0-1.6.0.0.1.php | 44 + .../upgrade-1.6.0.0-1.6.0.0.1.php | 84 + app/code/core/Mage/Captcha/Block/Captcha.php | 48 + .../core/Mage/Captcha/Block/Captcha/Zend.php | 87 + app/code/core/Mage/Captcha/Helper/Data.php | 138 + app/code/core/Mage/Captcha/Model/Captcha.php | 149 + .../core/Mage/Captcha/Model/Config/Font.php | 49 + .../Captcha/Model/Config/Form/Abstract.php | 61 + .../Captcha/Model/Config/Form/Backend.php | 40 + .../Captcha/Model/Config/Form/Frontend.php | 40 + .../core/Mage/Captcha/Model/Config/Mode.php | 54 + .../core/Mage/Captcha/Model/Interface.php | 60 + app/code/core/Mage/Captcha/Model/Observer.php | 282 + .../core/Mage/Captcha/Model/Resource/Log.php | 157 + .../Captcha/Model/Resource/LoginAttempt.php | 160 + .../Resource/LoginAttempt/Collection.php | 45 + app/code/core/Mage/Captcha/Model/Zend.php | 496 + .../Adminhtml/RefreshController.php | 50 + .../Captcha/controllers/RefreshController.php | 50 + app/code/core/Mage/Captcha/etc/config.xml | 262 + app/code/core/Mage/Captcha/etc/system.xml | 250 + .../sql/captcha_setup/install-1.7.0.0.0.php | 51 + .../Mage/Catalog/Block/Product/Abstract.php | 15 +- .../core/Mage/Catalog/Block/Product/New.php | 13 +- .../core/Mage/Catalog/Block/Product/Price.php | 17 +- .../core/Mage/Catalog/Block/Product/View.php | 41 +- .../Mage/Catalog/Block/Product/View/Media.php | 28 +- .../Catalog/Block/Product/View/Options.php | 6 +- app/code/core/Mage/Catalog/Helper/Image.php | 199 +- app/code/core/Mage/Catalog/Helper/Product.php | 33 +- .../core/Mage/Catalog/Model/Category/Api.php | 2 +- .../Catalog/Model/Category/Indexer/Flat.php | 35 +- .../Model/Category/Indexer/Product.php | 22 +- .../Catalog/Model/Convert/Adapter/Product.php | 32 +- .../core/Mage/Catalog/Model/Indexer/Url.php | 36 +- .../Catalog/Model/Layer/Filter/Attribute.php | 4 +- .../Mage/Catalog/Model/Layer/Filter/Price.php | 151 +- .../Model/Layer/Filter/Price/Algorithm.php | 420 + app/code/core/Mage/Catalog/Model/Observer.php | 13 + app/code/core/Mage/Catalog/Model/Product.php | 183 +- .../Product/Attribute/Backend/Groupprice.php | 57 + .../Attribute/Backend/Groupprice/Abstract.php | 369 + .../Product/Attribute/Backend/Tierprice.php | 277 +- .../Attribute/Source/Countryofmanufacture.php | 8 +- .../Catalog/Model/Product/Flat/Indexer.php | 44 +- .../Catalog/Model/Product/Indexer/Flat.php | 77 +- .../Catalog/Model/Product/Indexer/Price.php | 31 +- .../Model/Product/Option/Type/File.php | 16 +- .../Mage/Catalog/Model/Product/Type/Price.php | 76 +- .../Mage/Catalog/Model/Resource/Abstract.php | 2 +- .../Catalog/Model/Resource/Category/Flat.php | 57 +- .../Resource/Category/Indexer/Product.php | 307 +- .../Eav/Mysql4/Product/Indexer/Abstract.php | 2 +- .../Mysql4/Product/Indexer/Eav/Abstract.php | 2 +- .../Product/Indexer/Price/Interface.php | 2 +- .../Model/Resource/Layer/Filter/Price.php | 89 +- .../Product/Attribute/Backend/Groupprice.php | 46 + .../Attribute/Backend/Groupprice/Abstract.php | 147 + .../Product/Attribute/Backend/Tierprice.php | 90 +- .../Resource/Product/Attribute/Collection.php | 6 +- .../Model/Resource/Product/Collection.php | 6 +- .../Model/Resource/Product/Flat/Indexer.php | 40 +- .../Resource/Product/Indexer/Eav/Abstract.php | 25 +- .../Model/Resource/Product/Indexer/Price.php | 90 +- .../Product/Indexer/Price/Configurable.php | 56 +- .../Product/Indexer/Price/Default.php | 101 +- .../Product/Indexer/Price/Grouped.php | 23 +- .../Catalog/Model/Resource/Product/Option.php | 14 +- .../Mage/Catalog/Model/Resource/Setup.php | 13 +- .../core/Mage/Catalog/Model/Resource/Url.php | 30 +- app/code/core/Mage/Catalog/Model/Url.php | 94 +- .../data-upgrade-1.6.0.0.4-1.6.0.0.5.php | 27 +- .../data-upgrade-1.6.0.0.8-1.6.0.0.9.php | 36 + app/code/core/Mage/Catalog/etc/config.xml | 11 +- app/code/core/Mage/Catalog/etc/system.xml | 16 + .../sql/catalog_setup/install-1.6.0.0.php | 40 +- .../mysql4-upgrade-1.6.0.0.8-1.6.0.0.9.php | 53 + .../upgrade-1.6.0.0.6-1.6.0.0.7.php | 39 + .../upgrade-1.6.0.0.7-1.6.0.0.8.php | 97 + .../upgrade-1.6.0.0.9-1.6.0.0.10.php | 214 + .../CatalogInventory/Model/Indexer/Stock.php | 21 +- .../Model/Mysql4/Indexer/Stock/Interface.php | 2 +- .../Mage/CatalogInventory/Model/Observer.php | 21 +- .../Model/Resource/Indexer/Stock.php | 19 +- .../Resource/Indexer/Stock/Configurable.php | 12 - .../Model/Resource/Indexer/Stock/Default.php | 9 +- .../Model/Resource/Indexer/Stock/Grouped.php | 12 - .../CatalogInventory/Model/Stock/Item.php | 62 +- .../Model/System/Config/Backend/Minqty.php | 48 + .../core/Mage/CatalogInventory/etc/config.xml | 28 +- .../core/Mage/CatalogInventory/etc/system.xml | 4 +- .../mysql4-upgrade-1.6.0.0-1.6.0.0.1.php | 34 + app/code/core/Mage/CatalogRule/Model/Rule.php | 6 +- .../core/Mage/CatalogSearch/Helper/Data.php | 5 +- .../Mage/CatalogSearch/Model/Fulltext.php | 21 +- .../CatalogSearch/Model/Indexer/Fulltext.php | 84 +- .../CatalogSearch/Model/Resource/Fulltext.php | 35 +- .../Centinel/Block/Adminhtml/Validation.php | 6 +- .../Mage/Checkout/Block/Cart/Shipping.php | 88 +- app/code/core/Mage/Checkout/Block/Onepage.php | 13 +- .../Mage/Checkout/Block/Onepage/Abstract.php | 11 + .../Mage/Checkout/Block/Onepage/Progress.php | 24 + app/code/core/Mage/Checkout/Helper/Data.php | 13 +- app/code/core/Mage/Checkout/Helper/Url.php | 10 + app/code/core/Mage/Checkout/Model/Cart.php | 10 +- .../Checkout/Model/Type/Multishipping.php | 21 +- .../core/Mage/Checkout/Model/Type/Onepage.php | 42 +- .../Checkout/controllers/CartController.php | 41 +- .../controllers/OnepageController.php | 19 + app/code/core/Mage/Checkout/etc/config.xml | 1 + app/code/core/Mage/Checkout/etc/system.xml | 10 + app/code/core/Mage/Cms/Helper/Page.php | 10 +- .../Cms/sql/cms_setup/install-1.6.0.0.php | 4 +- .../Extension/Custom/Edit/Tab/Abstract.php | 4 +- .../core/Mage/Connect/Model/Extension.php | 10 +- .../Adminhtml/Extension/CustomController.php | 2 - app/code/core/Mage/Core/Block/Html/Select.php | 103 +- .../Mage/Core/Controller/Varien/Action.php | 33 +- app/code/core/Mage/Core/Helper/Data.php | 104 +- app/code/core/Mage/Core/Helper/Translate.php | 34 +- app/code/core/Mage/Core/Model/App.php | 24 + app/code/core/Mage/Core/Model/Calculator.php | 87 + app/code/core/Mage/Core/Model/Config.php | 10 +- app/code/core/Mage/Core/Model/Cookie.php | 1 + .../File/Validator/NotProtectedExtension.php | 5 +- app/code/core/Mage/Core/Model/Locale.php | 17 +- .../Mage/Core/Model/Resource/Abstract.php | 2 +- .../Model/Resource/Db/Collection/Abstract.php | 13 +- .../Core/Model/Resource/Design/Collection.php | 2 +- .../Mage/Core/Model/Resource/Url/Rewrite.php | 3 + .../Mage/Core/Model/Resource/Variable.php | 9 +- .../core/Mage/Core/Model/Session/Abstract.php | 11 + .../Core/Model/Source/Email/Variables.php | 27 +- app/code/core/Mage/Core/Model/Store.php | 10 +- .../core/Mage/Core/Model/Translate/Inline.php | 55 +- app/code/core/Mage/Core/Model/Url.php | 32 + .../Mage/Core/controllers/AjaxController.php | 5 +- app/code/core/Mage/Core/etc/config.xml | 3 + app/code/core/Mage/Core/etc/system.xml | 31 + .../core/Mage/Customer/Block/Widget/Name.php | 11 +- .../core/Mage/Customer/Helper/Address.php | 39 + app/code/core/Mage/Customer/Helper/Data.php | 256 + app/code/core/Mage/Customer/Model/Address.php | 4 +- .../Mage/Customer/Model/Address/Abstract.php | 36 +- .../Model/Attribute/Backend/Data/Boolean.php | 52 + .../core/Mage/Customer/Model/Customer.php | 48 +- app/code/core/Mage/Customer/Model/Form.php | 11 + .../core/Mage/Customer/Model/Observer.php | 172 +- .../Mage/Customer/Model/Resource/Customer.php | 2 +- .../Model/Resource/Customer/Collection.php | 13 +- .../Mage/Customer/Model/Resource/Group.php | 3 +- app/code/core/Mage/Customer/Model/Session.php | 40 +- .../controllers/AccountController.php | 22 +- app/code/core/Mage/Customer/etc/config.xml | 124 +- app/code/core/Mage/Customer/etc/system.xml | 113 +- .../upgrade-1.6.1.0-1.6.2.0.php | 94 + .../upgrade-1.6.2.0-1.6.2.0.1.php | 36 + .../Model/Convert/Adapter/Http/Curl.php | 4 +- .../Model/Convert/Validator/Column.php | 4 +- .../Dataflow/Model/Mysql4/Batch/Abstract.php | 2 +- app/code/core/Mage/Dataflow/Model/Profile.php | 4 +- .../sql/directory_setup/install-1.6.0.0.php | 34 +- .../core/Mage/Downloadable/Model/Observer.php | 6 + .../Model/Resource/Indexer/Price.php | 30 +- .../Adminhtml/Downloadable/FileController.php | 6 + .../controllers/DownloadController.php | 5 +- .../core/Mage/Downloadable/etc/config.xml | 2 +- .../mysql4-upgrade-1.6.0.0.1-1.6.0.0.2.php | 39 + .../upgrade-1.6.0.0.1-1.6.0.0.2.php | 34 + .../Attribute/Edit/Main/Abstract.php | 3 +- .../Mage/Eav/Model/Attribute/Data/Date.php | 16 +- .../core/Mage/Eav/Model/Entity/Abstract.php | 6 +- .../Entity/Attribute/Backend/Abstract.php | 46 +- .../Entity/Attribute/Backend/Interface.php | 15 + app/code/core/Mage/Eav/Model/Entity/Setup.php | 22 +- .../Eav/sql/eav_setup/install-1.6.0.0.php | 30 +- .../core/Mage/GoogleAnalytics/Block/Ga.php | 32 +- .../core/Mage/GoogleBase/Model/Observer.php | 6 +- .../GoogleCheckout/Model/Api/Xml/Abstract.php | 15 +- .../GoogleCheckout/Model/Api/Xml/Checkout.php | 5 +- .../Mage/GoogleCheckout/Model/Payment.php | 36 +- .../Model/Source/Shipping/Carrier.php | 43 +- .../Model/Source/Shipping/Category.php | 5 +- .../Model/Source/Shipping/Units.php | 3 +- .../Model/Source/Shipping/Virtual/Method.php | 7 +- .../Source/Shipping/Virtual/Schedule.php | 5 +- .../Model/Export/Entity/Abstract.php | 10 +- .../core/Mage/ImportExport/Model/Import.php | 3 +- .../Model/Import/Entity/Abstract.php | 4 +- .../Model/Import/Entity/Product.php | 109 +- .../Import/Entity/Product/Type/Abstract.php | 2 + .../Index/Block/Adminhtml/Notifications.php | 7 +- .../Index/Block/Adminhtml/Process/Grid.php | 70 +- .../Adminhtml/Process/Grid/Massaction.php | 54 + app/code/core/Mage/Index/Model/Event.php | 102 +- app/code/core/Mage/Index/Model/Indexer.php | 176 +- .../Mage/Index/Model/Indexer/Abstract.php | 30 +- app/code/core/Mage/Index/Model/Observer.php | 2 +- app/code/core/Mage/Index/Model/Process.php | 210 +- .../Mage/Index/Model/Resource/Abstract.php | 26 +- .../core/Mage/Index/Model/Resource/Event.php | 55 +- .../Index/Model/Resource/Event/Collection.php | 9 +- .../Mage/Index/Model/Resource/Process.php | 52 +- .../Model/Resource/Process/Collection.php | 23 + .../core/Mage/Install/Model/Installer/Db.php | 22 +- .../core/Mage/Log/Model/Resource/Visitor.php | 20 + .../Log/sql/log_setup/install-1.6.0.0.php | 12 +- .../mysql4-upgrade-1.5.9.9-1.6.0.0.php | 4 +- .../Model/Resource/Problem/Collection.php | 1 + .../Model/Resource/Queue/Collection.php | 33 +- .../data-upgrade-1.6.0.0-1.6.0.1.php | 43 + app/code/core/Mage/Newsletter/etc/config.xml | 2 +- .../sql/newsletter_setup/install-1.6.0.0.php | 10 +- app/code/core/Mage/Paygate/Helper/Data.php | 45 +- .../core/Mage/Paygate/Model/Authorizenet.php | 44 + .../Mage/Payment/Block/Form/Container.php | 2 +- app/code/core/Mage/Payment/Block/Info/Cc.php | 10 + .../Mage/Payment/Model/Method/Abstract.php | 91 +- .../core/Mage/Payment/Model/Method/Cc.php | 50 +- .../core/Mage/Payment/Model/Method/Free.php | 1 - app/code/core/Mage/Payment/etc/system.xml | 4 + .../System/Config/Payflowlink/Advanced.php | 43 + app/code/core/Mage/Paypal/Block/Iframe.php | 3 +- .../Paypal/Block/Payflow/Advanced/Form.php | 56 + .../Paypal/Block/Payflow/Advanced/Iframe.php | 67 + .../Paypal/Block/Payflow/Advanced/Info.php | 37 + .../Paypal/Block/Payflow/Advanced/Review.php | 38 + .../Mage/Paypal/Block/Payflow/Link/Form.php | 2 +- .../Mage/Paypal/Block/Payflow/Link/Iframe.php | 27 +- .../Mage/Paypal/Block/Payflow/Link/Review.php | 47 + .../Paypal/Controller/Express/Abstract.php | 2 +- app/code/core/Mage/Paypal/Helper/Hss.php | 4 +- app/code/core/Mage/Paypal/Model/Api/Nvp.php | 10 +- app/code/core/Mage/Paypal/Model/Cart.php | 14 +- app/code/core/Mage/Paypal/Model/Config.php | 21 +- app/code/core/Mage/Paypal/Model/Ipn.php | 9 +- app/code/core/Mage/Paypal/Model/Observer.php | 27 +- .../Mage/Paypal/Model/Payflowadvanced.php | 57 + .../core/Mage/Paypal/Model/Payflowlink.php | 491 +- .../core/Mage/Paypal/Model/Payflowpro.php | 7 +- .../Mage/Paypal/Model/Report/Settlement.php | 142 +- .../Model/Resource/Payment/Transaction.php | 1 + .../Payment/Transaction/Collection.php | 1 + .../Config/Source/AuthorizationAmounts.php | 9 +- .../Paypal/controllers/PayflowController.php | 103 +- .../controllers/PayflowadvancedController.php | 170 + app/code/core/Mage/Paypal/etc/config.xml | 23 +- app/code/core/Mage/Paypal/etc/system.xml | 200 +- .../paypal_setup/upgrade-1.6.0.1-1.6.0.2.php | 35 + app/code/core/Mage/Poll/Model/Poll/Answer.php | 4 +- app/code/core/Mage/Reports/Model/Flag.php | 1 + .../Model/Mysql4/Product/Index/Abstract.php | 3 +- .../Product/Index/Collection/Abstract.php | 2 +- .../Reports/Model/Mysql4/Report/Abstract.php | 2 +- .../Model/Resource/Helper/Interface.php | 52 + .../Reports/Model/Resource/Helper/Mysql4.php | 68 + .../Resource/Product/Viewed/Collection.php | 46 + .../Model/Resource/Quote/Collection.php | 4 +- .../Model/Resource/Report/Abstract.php | 12 +- .../Resource/Report/Collection/Abstract.php | 287 + .../Model/Resource/Report/Product/Viewed.php | 212 + .../Report/Product/Viewed/Collection.php | 367 + .../Reports/Model/Resource/Tag/Collection.php | 3 +- app/code/core/Mage/Reports/etc/config.xml | 11 +- .../upgrade-1.6.0.0-1.6.0.0.1.php | 99 + app/code/core/Mage/Review/Model/Review.php | 8 +- .../Review/controllers/ProductController.php | 8 +- app/code/core/Mage/Rss/Block/Catalog/New.php | 27 +- .../Mage/Rss/Block/Catalog/NotifyStock.php | 6 +- .../core/Mage/Rss/Block/Catalog/Review.php | 6 +- app/code/core/Mage/Rss/Block/Wishlist.php | 25 +- app/code/core/Mage/Rss/etc/config.xml | 10 +- app/code/core/Mage/Rule/Block/Editable.php | 38 +- .../Mage/Rule/Model/Condition/Combine.php | 52 +- .../Adminhtml/Report/Filter/Form/Coupon.php | 89 + .../Address/Attribute/Frontend/Discount.php | 5 +- .../core/Mage/Sales/Model/Mysql4/Abstract.php | 2 +- .../Sales/Model/Mysql4/Report/Abstract.php | 2 +- app/code/core/Mage/Sales/Model/Observer.php | 110 +- .../core/Mage/Sales/Model/Order/Config.php | 6 +- .../Mage/Sales/Model/Order/Creditmemo.php | 46 +- .../Sales/Model/Order/Creditmemo/Item.php | 58 +- .../Model/Order/Creditmemo/Total/Discount.php | 28 +- .../Model/Order/Creditmemo/Total/Subtotal.php | 4 +- .../Model/Order/Creditmemo/Total/Tax.php | 65 +- .../core/Mage/Sales/Model/Order/Invoice.php | 26 + .../Mage/Sales/Model/Order/Invoice/Item.php | 25 +- .../Model/Order/Invoice/Total/Discount.php | 17 +- .../Model/Order/Invoice/Total/Subtotal.php | 29 +- .../Sales/Model/Order/Invoice/Total/Tax.php | 31 +- app/code/core/Mage/Sales/Model/Order/Item.php | 8 +- .../core/Mage/Sales/Model/Order/Payment.php | 7 +- .../Mage/Sales/Model/Order/Pdf/Abstract.php | 6 +- .../Sales/Model/Order/Pdf/Items/Abstract.php | 2 +- app/code/core/Mage/Sales/Model/Quote.php | 56 +- .../core/Mage/Sales/Model/Quote/Address.php | 2 + .../Model/Quote/Address/Total/Discount.php | 3 +- .../Mage/Sales/Model/Quote/Item/Abstract.php | 5 +- .../Sales/Model/Resource/Helper/Interface.php | 49 + .../Sales/Model/Resource/Helper/Mysql4.php | 54 +- .../Address/Attribute/Frontend/Discount.php | 5 +- .../Report/Bestsellers/Collection.php | 5 +- .../Resource/Report/Collection/Abstract.php | 240 +- .../core/Mage/Sales/Model/Service/Order.php | 13 +- .../core/Mage/Sales/Model/Service/Quote.php | 9 +- .../data-upgrade-1.6.0.4-1.6.0.5.php | 76 + app/code/core/Mage/Sales/etc/config.xml | 20 +- .../sales_setup/upgrade-1.6.0.4-1.6.0.5.php | 49 + .../sales_setup/upgrade-1.6.0.5-1.6.0.6.php | 47 + .../sales_setup/upgrade-1.6.0.6-1.6.0.7.php | 36 + .../core/Mage/SalesRule/Helper/Coupon.php | 147 + app/code/core/Mage/SalesRule/Model/Coupon.php | 17 +- .../SalesRule/Model/Coupon/Massgenerator.php | 188 + .../core/Mage/SalesRule/Model/Observer.php | 38 + .../Mage/SalesRule/Model/Quote/Discount.php | 2 +- .../Mage/SalesRule/Model/Resource/Coupon.php | 67 +- .../Model/Resource/Coupon/Collection.php | 36 +- .../Model/Resource/Report/Collection.php | 57 + .../SalesRule/Model/Resource/Report/Rule.php | 29 + .../Model/Resource/Report/Rule/Createdat.php | 7 + .../Mage/SalesRule/Model/Resource/Rule.php | 4 +- .../Model/Resource/Rule/Collection.php | 25 +- app/code/core/Mage/SalesRule/Model/Rule.php | 93 +- .../Model/Rule/Condition/Product/Found.php | 10 +- .../Rule/Condition/Product/Subselect.php | 35 +- .../System/Config/Source/Coupon/Format.php | 54 + .../core/Mage/SalesRule/Model/Validator.php | 29 +- app/code/core/Mage/SalesRule/etc/config.xml | 28 +- app/code/core/Mage/SalesRule/etc/system.xml | 95 + .../upgrade-1.6.0.1-1.6.0.2.php | 145 + app/code/core/Mage/Sendfriend/etc/system.xml | 2 + .../Mage/Shipping/Model/Carrier/Abstract.php | 85 +- .../Shipping/Model/Carrier/Freeshipping.php | 8 +- .../Model/Resource/Carrier/Tablerate.php | 21 +- .../core/Mage/Shipping/Model/Shipping.php | 13 +- .../Tag/Model/Resource/Indexer/Summary.php | 12 +- app/code/core/Mage/Tag/Model/Resource/Tag.php | 6 +- .../Mage/Tag/controllers/IndexController.php | 19 +- app/code/core/Mage/Tag/etc/config.xml | 2 +- app/code/core/Mage/Tax/Helper/Data.php | 4 +- app/code/core/Mage/Tax/Model/Calculation.php | 2 +- .../core/Mage/Tax/Model/Resource/Class.php | 2 +- .../Tax/Model/Sales/Total/Quote/Subtotal.php | 18 +- .../Mage/Tax/Model/Sales/Total/Quote/Tax.php | 12 +- .../Usa/Block/Adminhtml/Dhl/Unitofmeasure.php | 82 + .../Usa/Model/Shipping/Carrier/Abstract.php | 19 +- .../Mage/Usa/Model/Shipping/Carrier/Dhl.php | 31 +- .../Shipping/Carrier/Dhl/International.php | 1490 ++ .../Dhl/International/Source/Contenttype.php | 50 + .../Dhl/International/Source/Freemethod.php | 41 + .../Dhl/International/Source/Method.php | 43 + .../International/Source/Method/Abstract.php | 72 + .../Dhl/International/Source/Method/All.php | 46 + .../Dhl/International/Source/Method/Doc.php | 43 + .../International/Source/Method/Freedoc.php | 50 + .../Source/Method/Freenondoc.php | 50 + .../International/Source/Method/Nondoc.php | 43 + .../Dhl/International/Source/Method/Size.php | 51 + .../Source/Method/Unitofmeasure.php | 51 + .../Mage/Usa/Model/Shipping/Carrier/Fedex.php | 37 +- .../Mage/Usa/Model/Shipping/Carrier/Ups.php | 42 +- .../Mage/Usa/Model/Shipping/Carrier/Usps.php | 2 + app/code/core/Mage/Usa/etc/config.xml | 24 +- .../Usa/etc/dhl/international/countries.xml | 1553 ++ app/code/core/Mage/Usa/etc/system.xml | 289 +- app/code/core/Mage/Weee/Helper/Data.php | 75 +- app/code/core/Mage/Weee/Model/Observer.php | 2 +- .../Widget/Block/Adminhtml/Widget/Chooser.php | 24 +- .../Widget/Instance/Edit/Chooser/Layout.php | 7 +- .../Widget/Instance/Edit/Tab/Main/Layout.php | 20 +- .../Resource/Widget/Instance/Collection.php | 8 + .../Adminhtml/Widget/InstanceController.php | 2 +- .../Mage/Wishlist/Block/Share/Email/Items.php | 15 + .../Wishlist/controllers/IndexController.php | 7 +- app/code/core/Mage/XmlConnect/Block/Cart.php | 14 +- .../Mage/XmlConnect/Block/Cart/Crosssell.php | 7 +- .../XmlConnect/Block/Cart/Item/Renderer.php | 15 +- .../Mage/XmlConnect/Block/Cart/Totals.php | 4 +- .../core/Mage/XmlConnect/Block/Catalog.php | 2 +- .../XmlConnect/Block/Catalog/Category.php | 2 +- .../Block/Catalog/Category/Info.php | 2 +- .../Mage/XmlConnect/Block/Catalog/Filters.php | 8 +- .../Mage/XmlConnect/Block/Catalog/Product.php | 7 +- .../Block/Catalog/Product/Options.php | 4 +- .../Block/Catalog/Product/Options/Bundle.php | 4 +- .../Catalog/Product/Options/Configurable.php | 6 +- .../Block/Catalog/Product/Options/Grouped.php | 2 +- .../Block/Catalog/Product/Price/Bundle.php | 16 +- .../Block/Catalog/Product/Price/Default.php | 18 +- .../Block/Catalog/Product/Review.php | 6 +- .../Mage/XmlConnect/Block/Catalog/Search.php | 6 +- .../Block/Catalog/Search/Suggest.php | 2 +- .../Block/Checkout/Address/Billing.php | 2 +- .../Block/Checkout/Address/Shipping.php | 2 +- .../XmlConnect/Block/Checkout/Agreements.php | 9 +- .../Block/Checkout/Order/Review/Info.php | 11 +- .../Block/Checkout/Payment/Method/List.php | 2 +- .../Checkout/Shipping/Method/Available.php | 6 +- .../Block/Customer/Address/Form.php | 10 +- .../Block/Customer/Address/List.php | 8 +- .../Mage/XmlConnect/Block/Customer/Form.php | 30 +- .../XmlConnect/Block/Customer/Order/List.php | 2 +- .../XmlConnect/Block/Customer/Storecredit.php | 14 +- app/code/core/Mage/XmlConnect/Block/Home.php | 2 +- .../Mage/XmlConnect/Block/Review/Form.php | 2 +- .../core/Mage/XmlConnect/Block/Wishlist.php | 11 +- .../Helper/Customer/Form/Renderer.php | 4 +- .../Mage/XmlConnect/Helper/Customer/Order.php | 12 +- app/code/core/Mage/XmlConnect/Helper/Data.php | 59 +- .../core/Mage/XmlConnect/Model/Observer.php | 1 - .../XmlConnect/Model/Simplexml/Element.php | 39 +- .../Model/Simplexml/Form/Abstract.php | 2 +- .../Form/Element/Validator/Abstract.php | 29 +- .../Adminhtml/MobileController.php | 38 +- .../controllers/CatalogController.php | 9 +- .../controllers/CheckoutController.php | 6 +- .../controllers/CustomerController.php | 1 - .../controllers/PbridgeController.php | 4 +- app/code/core/Mage/XmlConnect/etc/config.xml | 3 +- app/code/core/Zend/Date.php | 5008 ++++++ .../default/default/layout/captcha.xml | 48 + .../default/default/layout/customer.xml | 66 + .../adminhtml/default/default/layout/main.xml | 35 +- .../default/default/layout/promo.xml | 11 + .../default/default/layout/report.xml | 20 + .../default/default/layout/sales.xml | 2 +- .../adminhtml/default/default/layout/tag.xml | 36 + .../default/template/backup/dialogs.phtml | 125 + .../default/template/backup/list.phtml | 7 +- .../default/template/captcha/zend.phtml | 57 + .../catalog/product/attribute/js.phtml | 41 +- .../catalog/product/attribute/set/main.phtml | 14 +- .../product/edit/action/inventory.phtml | 22 +- .../product/edit/options/type/file.phtml | 2 +- .../catalog/product/edit/price/group.phtml | 169 + .../catalog/product/edit/price/tier.phtml | 6 +- .../catalog/product/edit/super/config.phtml | 8 +- .../template/catalog/product/price.phtml | 14 +- .../catalog/product/tab/inventory.phtml | 22 +- .../tab/account/form/renderer/group.phtml | 52 + .../create/billing/form/renderer/vat.phtml | 52 + .../customer/system/config/validatevat.phtml | 65 + .../template/customer/tab/addresses.phtml | 6 +- .../default/template/customer/tab/cart.phtml | 4 +- .../product/edit/downloadable.phtml | 2 +- .../product/edit/downloadable/links.phtml | 4 +- .../product/edit/downloadable/samples.phtml | 2 +- .../default/template/forgotpassword.phtml | 36 +- .../default/default/template/login.phtml | 2 + .../template/notification/toolbar.phtml | 12 +- .../default/default/template/page/head.phtml | 1 - .../default/template/page/js/translate.phtml | 14 +- .../default/template/page/notices.phtml | 2 +- .../system/config/fieldset/global.phtml | 63 +- .../system/config/payflowlink/advanced.phtml | 102 + .../system/config/payflowlink/info.phtml | 145 +- .../default/template/poll/answers/list.phtml | 2 +- .../default/default/template/promo/js.phtml | 18 +- .../default/template/promo/salesrulejs.phtml | 113 + .../order/create/billing/method/form.phtml | 2 +- .../sales/order/create/sidebar/items.phtml | 3 + .../default/template/sales/order/totals.phtml | 6 +- .../sales/order/view/tab/history.phtml | 11 +- .../default/template/system/config/js.phtml | 7 +- .../template/usa/dhl/unitofmeasure.phtml | 53 + .../widget/instance/edit/layout.phtml | 80 +- .../default/template/widget/instance/js.phtml | 2 +- .../frontend/base/default/layout/captcha.xml | 106 + .../frontend/base/default/layout/checkout.xml | 4 +- .../frontend/base/default/layout/customer.xml | 4 +- .../base/default/layout/googleanalytics.xml | 2 +- .../frontend/base/default/layout/paypal.xml | 5 +- .../base/default/template/captcha/zend.phtml | 53 + .../catalog/product/compare/list.phtml | 4 +- .../template/catalog/product/price.phtml | 14 +- .../catalog/product/view/options.phtml | 21 +- .../catalog/product/view/tierprices.phtml | 4 +- .../template/catalog/seo/sitemap.phtml | 4 +- .../template/catalogsearch/form.mini.phtml | 9 +- .../base/default/template/checkout/cart.phtml | 3 +- .../template/checkout/onepage/billing.phtml | 9 +- .../template/checkout/onepage/login.phtml | 1 + .../template/checkout/onepage/progress.phtml | 21 +- .../template/checkout/total/default.phtml | 2 +- .../template/customer/address/edit.phtml | 6 + .../customer/form/forgotpassword.phtml | 1 + .../template/customer/form/login.phtml | 1 + .../template/customer/form/register.phtml | 1 + .../default/template/giftmessage/inline.phtml | 2 +- .../default/template/googleanalytics/ga.phtml | 43 + .../default/template/page/html/notices.phtml | 2 +- .../template/paypal/express/review.phtml | 49 +- .../base/default/template/paypal/hss/js.phtml | 2 +- .../template/paypal/hss/redirect.phtml | 3 + .../paypal/payflowadvanced/form.phtml | 45 + .../paypal/payflowadvanced/iframe.phtml | 48 + .../paypal/payflowadvanced/info.phtml | 22 +- .../paypal/payflowadvanced/redirect.phtml | 71 + .../template/paypal/payflowlink/iframe.phtml | 97 +- .../template/paypal/payflowlink/info.phtml | 18 +- .../paypal/payflowlink/redirect.phtml | 74 +- .../persistent/checkout/onepage/billing.phtml | 11 +- .../persistent/checkout/onepage/login.phtml | 3 + .../persistent/customer/form/login.phtml | 1 + .../persistent/customer/form/register.phtml | 1 + .../template/wishlist/email/items.phtml | 11 +- .../default/template/wishlist/shared.phtml | 4 +- .../default/iphone/layout/catalog.xml | 42 +- .../default/iphone/layout/catalogsearch.xml | 155 + .../default/iphone/layout/checkout.xml | 17 +- .../frontend/default/iphone/layout/cms.xml | 32 +- .../default/iphone/layout/contacts.xml | 62 + .../default/iphone/layout/customer.xml | 14 +- .../frontend/default/iphone/layout/page.xml | 80 +- .../default/iphone/layout/persistent.xml | 12 + .../frontend/default/iphone/layout/review.xml | 7 +- .../default/iphone/layout/sendfriend.xml | 41 + .../frontend/default/iphone/layout/tag.xml | 10 - .../default/iphone/locale/en_US/translate.csv | 1 - .../bundle/sales/order/items/renderer.phtml | 385 + .../iphone/template/catalog/layer/view.phtml | 54 + .../template/catalog/navigation/top.phtml | 54 + .../catalog/product/compare/list.phtml | 258 + .../catalog/product/compare/sidebar.phtml | 68 + .../template/catalog/product/gallery.phtml | 56 + .../template/catalog/product/list.phtml | 209 + .../catalog/product/list/toolbar.phtml | 62 +- .../catalog/product/list/upsell.phtml | 53 + .../template/catalog/product/price.phtml | 407 + .../template/catalog/product/view.phtml | 156 + .../template/catalog/product/view/addto.phtml | 43 + .../catalog/product/view/addtocart.phtml | 38 + .../template/catalog/product/view/media.phtml | 55 + .../catalog/product/view/type/grouped.phtml | 43 + .../product/view/type/grouped_grid.phtml | 76 + .../template/catalogsearch/form.mini.phtml | 23 +- .../template/catalogsearch/result.phtml | 79 + .../iphone/template/checkout/cart.phtml | 102 +- .../template/checkout/cart/item/default.phtml | 94 +- .../cart/noItemsHeader.phtml} | 26 +- .../template/checkout/cart/sidebar.phtml | 79 + .../iphone/template/checkout/cartheader.phtml | 102 + .../template/checkout/onepage/login.phtml | 121 + .../iphone/template/customer/form/edit.phtml | 127 + .../customer/form/forgotpassword.phtml | 20 +- .../iphone/template/customer/form/login.phtml | 51 +- .../template/customer/form/register.phtml | 178 + .../iphone/template/page/1column.phtml | 41 +- .../iphone/template/page/html/footer.phtml | 8 +- .../iphone/template/page/html/head.phtml | 22 +- .../iphone/template/page/html/header.phtml | 51 +- .../iphone/template/page/html/pager.phtml | 113 + .../template/page/switch/languages.phtml | 46 + .../iphone/template/page/switch/stores.phtml | 46 + .../persistent/checkout/onepage/login.phtml | 154 + .../persistent/customer/form/login.phtml | 53 +- .../persistent/customer/form/register.phtml | 189 + .../iphone/template/sales/order/items.phtml | 73 + .../iphone/template/sales/order/totals.phtml | 52 + .../iphone/template/sendfriend/send.phtml | 148 + .../default/iphone/template/tag/list.phtml | 35 + .../iphone/template/wishlist/view.phtml | 110 +- .../default/modern/layout/checkout.xml | 2 +- .../default/modern/layout/customer.xml | 6 +- .../template/catalogsearch/form.mini.phtml | 9 +- .../modern/template/checkout/cart.phtml | 3 +- .../default/template/install/config.phtml | 3 - app/etc/local.xml.additional | 14 + app/etc/modules/Mage_Captcha.xml | 39 + app/locale/en_US/Mage_Adminhtml.csv | 83 +- app/locale/en_US/Mage_Backup.csv | 32 +- app/locale/en_US/Mage_Captcha.csv | 22 + app/locale/en_US/Mage_Catalog.csv | 25 +- app/locale/en_US/Mage_CatalogInventory.csv | 9 + app/locale/en_US/Mage_CatalogSearch.csv | 1 + app/locale/en_US/Mage_Checkout.csv | 22 +- app/locale/en_US/Mage_Core.csv | 17 + app/locale/en_US/Mage_Customer.csv | 57 + app/locale/en_US/Mage_Dataflow.csv | 2 + app/locale/en_US/Mage_Directory.csv | 1 + app/locale/en_US/Mage_Downloadable.csv | 2 + app/locale/en_US/Mage_Eav.csv | 1 + app/locale/en_US/Mage_GoogleBase.csv | 1 + app/locale/en_US/Mage_GoogleCheckout.csv | 31 + app/locale/en_US/Mage_Index.csv | 6 +- app/locale/en_US/Mage_Install.csv | 5 + app/locale/en_US/Mage_Page.csv | 2 +- app/locale/en_US/Mage_Paygate.csv | 1 - app/locale/en_US/Mage_Payment.csv | 13 + app/locale/en_US/Mage_Paypal.csv | 14 +- app/locale/en_US/Mage_Persistent.csv | 1 + app/locale/en_US/Mage_Reports.csv | 2 +- app/locale/en_US/Mage_Review.csv | 4 + app/locale/en_US/Mage_Rss.csv | 2 + app/locale/en_US/Mage_Rule.csv | 4 - app/locale/en_US/Mage_Sales.csv | 11 + app/locale/en_US/Mage_SalesRule.csv | 37 +- app/locale/en_US/Mage_Shipping.csv | 7 + app/locale/en_US/Mage_Tag.csv | 2 + app/locale/en_US/Mage_Tax.csv | 2 +- app/locale/en_US/Mage_Usa.csv | 47 +- app/locale/en_US/Mage_Widget.csv | 2 + app/locale/en_US/Mage_XmlConnect.csv | 28 +- downloader/Maged/Connect.php | 260 +- downloader/Maged/Controller.php | 101 +- downloader/lib/Mage/Archive.php | 8 +- downloader/lib/Mage/Archive/Abstract.php | 9 +- downloader/lib/Mage/Archive/Bz.php | 38 +- downloader/lib/Mage/Archive/Gz.php | 38 +- downloader/lib/Mage/Archive/Helper/File.php | 271 + .../lib/Mage/Archive/Helper/File/Bz.php | 92 + .../lib/Mage/Archive/Helper/File/Gz.php | 83 + downloader/lib/Mage/Archive/Tar.php | 399 +- downloader/lib/Mage/Backup.php | 59 + downloader/lib/Mage/Backup/Abstract.php | 222 + downloader/lib/Mage/Backup/Archive/Tar.php | 82 + downloader/lib/Mage/Backup/Db.php | 128 + downloader/lib/Mage/Backup/Exception.php | 36 + .../Backup/Exception/CantLoadSnapshot.php | 36 + .../Backup/Exception/FtpConnectionFailed.php | 36 + .../Backup/Exception/FtpValidationFailed.php | 36 + .../Backup/Exception/NotEnoughFreeSpace.php | 36 + .../Backup/Exception/NotEnoughPermissions.php | 36 + downloader/lib/Mage/Backup/Filesystem.php | 284 + .../lib/Mage/Backup/Filesystem/Helper.php | 137 + .../Backup/Filesystem/Iterator/Filter.php | 77 + .../Backup/Filesystem/Rollback/Abstract.php | 57 + .../Mage/Backup/Filesystem/Rollback/Fs.php | 78 + .../Mage/Backup/Filesystem/Rollback/Ftp.php | 194 + downloader/lib/Mage/Backup/Interface.php | 88 + downloader/lib/Mage/Backup/Media.php | 99 + downloader/lib/Mage/Backup/Snapshot.php | 140 + downloader/lib/Mage/Connect/Command.php | 115 +- .../lib/Mage/Connect/Command/Config.php | 21 +- .../lib/Mage/Connect/Command/Install.php | 227 +- downloader/lib/Mage/Connect/Config.php | 179 +- downloader/lib/Mage/Connect/Frontend.php | 58 +- downloader/lib/Mage/Connect/Ftp.php | 104 +- downloader/lib/Mage/Connect/Loader.php | 7 +- downloader/lib/Mage/Connect/Packager.php | 305 +- downloader/lib/Mage/Connect/Rest.php | 144 +- downloader/lib/Mage/Connect/Singleconfig.php | 313 +- downloader/lib/Mage/Connect/Validator.php | 169 +- downloader/lib/Mage/HTTP/Client.php | 20 +- downloader/lib/Mage/System/Args.php | 4 +- downloader/lib/Mage/System/Dirs.php | 30 +- downloader/lib/Mage/System/Ftp.php | 509 + downloader/template/connect/iframe.phtml | 5 +- downloader/template/connect/packages.phtml | 26 +- index.php | 13 +- js/extjs/fix-defer-before.js | 37 + js/extjs/fix-defer.js | 2 +- js/mage/adminhtml/backup.js | 174 + js/mage/adminhtml/flexuploader.js | 16 +- js/mage/adminhtml/loader.js | 7 +- js/mage/adminhtml/sales.js | 72 +- js/mage/adminhtml/wysiwyg/tiny_mce/setup.js | 13 +- js/mage/adminhtml/wysiwyg/widget.js | 11 + js/mage/captcha.js | 87 + js/mage/translate_inline.js | 22 +- js/prototype/validation.js | 27 +- js/tiny_mce/classes/AddOnManager.js | 467 +- js/tiny_mce/classes/CommandManager.js | 57 - js/tiny_mce/classes/ControlManager.js | 31 +- js/tiny_mce/classes/Developer.js | 94 - js/tiny_mce/classes/Editor.js | 5986 ++++--- js/tiny_mce/classes/EditorCommands.js | 188 +- js/tiny_mce/classes/EditorManager.js | 50 + js/tiny_mce/classes/ForceBlocks.js | 340 +- js/tiny_mce/classes/Formatter.js | 3544 ++-- js/tiny_mce/classes/LegacyInput.js | 12 +- js/tiny_mce/classes/Popup.js | 24 +- js/tiny_mce/classes/UndoManager.js | 73 +- js/tiny_mce/classes/WindowManager.js | 48 + js/tiny_mce/classes/adapter/jquery/adapter.js | 25 +- .../classes/adapter/jquery/jquery.tinymce.js | 20 +- js/tiny_mce/classes/dom/DOMUtils.js | 827 +- js/tiny_mce/classes/dom/Element.js | 6 + js/tiny_mce/classes/dom/EventUtils.js | 22 +- js/tiny_mce/classes/dom/Range.js | 23 +- js/tiny_mce/classes/dom/RangeUtils.js | 85 +- js/tiny_mce/classes/dom/Schema.js | 185 - js/tiny_mce/classes/dom/ScriptLoader.js | 72 +- js/tiny_mce/classes/dom/Selection.js | 1869 +- js/tiny_mce/classes/dom/Serializer.js | 1194 +- js/tiny_mce/classes/dom/StringWriter.js | 212 - js/tiny_mce/classes/dom/TreeWalker.js | 2 +- js/tiny_mce/classes/dom/TridentSelection.js | 626 +- js/tiny_mce/classes/dom/XMLWriter.js | 165 - js/tiny_mce/classes/firebug/FIREBUG.LICENSE | 30 + js/tiny_mce/classes/html/DomParser.js | 577 + js/tiny_mce/classes/html/Entities.js | 253 + js/tiny_mce/classes/html/Node.js | 474 + js/tiny_mce/classes/html/SaxParser.js | 355 + js/tiny_mce/classes/html/Schema.js | 663 + js/tiny_mce/classes/html/Serializer.js | 152 + js/tiny_mce/classes/html/Styles.js | 279 + js/tiny_mce/classes/html/Writer.js | 186 + js/tiny_mce/classes/tinymce.js | 1533 +- js/tiny_mce/classes/ui/Button.js | 16 +- js/tiny_mce/classes/ui/ColorSplitButton.js | 84 +- js/tiny_mce/classes/ui/Container.js | 4 +- js/tiny_mce/classes/ui/Control.js | 28 +- js/tiny_mce/classes/ui/DropMenu.js | 137 +- js/tiny_mce/classes/ui/KeyboardNavigation.js | 183 + js/tiny_mce/classes/ui/ListBox.js | 116 +- js/tiny_mce/classes/ui/MenuButton.js | 40 +- js/tiny_mce/classes/ui/MenuItem.js | 1 + js/tiny_mce/classes/ui/NativeListBox.js | 17 +- js/tiny_mce/classes/ui/Separator.js | 3 +- js/tiny_mce/classes/ui/SplitButton.js | 80 +- js/tiny_mce/classes/ui/Toolbar.js | 8 +- js/tiny_mce/classes/ui/ToolbarGroup.js | 81 + js/tiny_mce/classes/util/Cookie.js | 9 + js/tiny_mce/classes/util/Dispatcher.js | 6 + js/tiny_mce/classes/util/JSON.js | 88 +- js/tiny_mce/classes/util/JSONRequest.js | 25 +- js/tiny_mce/classes/util/Quirks.js | 229 + js/tiny_mce/classes/util/URI.js | 19 +- js/tiny_mce/classes/util/VK.js | 15 + js/tiny_mce/classes/util/XHR.js | 8 + js/tiny_mce/jquery.tinymce.js | 2 +- js/tiny_mce/langs/en.js | 171 +- js/tiny_mce/plugins/advhr/langs/en_dlg.js | 6 +- js/tiny_mce/plugins/advhr/rule.htm | 59 +- js/tiny_mce/plugins/advimage/editor_plugin.js | 2 +- .../plugins/advimage/editor_plugin_src.js | 2 +- js/tiny_mce/plugins/advimage/image.htm | 65 +- js/tiny_mce/plugins/advimage/js/image.js | 45 +- js/tiny_mce/plugins/advimage/langs/en_dlg.js | 44 +- js/tiny_mce/plugins/advlink/js/advlink.js | 38 +- js/tiny_mce/plugins/advlink/langs/en_dlg.js | 53 +- js/tiny_mce/plugins/advlink/link.htm | 65 +- js/tiny_mce/plugins/advlist/editor_plugin.js | 2 +- .../plugins/advlist/editor_plugin_src.js | 40 +- js/tiny_mce/plugins/autolink/editor_plugin.js | 1 + .../plugins/autolink/editor_plugin_src.js | 172 + .../plugins/autoresize/editor_plugin.js | 2 +- .../plugins/autoresize/editor_plugin_src.js | 28 +- js/tiny_mce/plugins/autosave/editor_plugin.js | 2 +- .../plugins/autosave/editor_plugin_src.js | 23 +- js/tiny_mce/plugins/bbcode/editor_plugin.js | 2 +- .../plugins/bbcode/editor_plugin_src.js | 2 +- .../plugins/contextmenu/editor_plugin.js | 2 +- .../plugins/contextmenu/editor_plugin_src.js | 55 +- js/tiny_mce/plugins/emotions/emotions.htm | 62 +- .../emotions/img/smiley-foot-in-mouth.gif | Bin 344 -> 342 bytes .../plugins/emotions/img/smiley-laughing.gif | Bin 344 -> 343 bytes .../plugins/emotions/img/smiley-sealed.gif | Bin 325 -> 323 bytes .../plugins/emotions/img/smiley-smile.gif | Bin 345 -> 344 bytes .../plugins/emotions/img/smiley-surprised.gif | Bin 342 -> 338 bytes .../plugins/emotions/img/smiley-wink.gif | Bin 351 -> 350 bytes js/tiny_mce/plugins/emotions/js/emotions.js | 21 + js/tiny_mce/plugins/emotions/langs/en_dlg.js | 21 +- .../example_dependency/editor_plugin.js | 1 + .../example_dependency/editor_plugin_src.js | 50 + js/tiny_mce/plugins/fullpage/css/fullpage.css | 45 +- js/tiny_mce/plugins/fullpage/editor_plugin.js | 2 +- .../plugins/fullpage/editor_plugin_src.js | 378 +- js/tiny_mce/plugins/fullpage/fullpage.htm | 348 +- js/tiny_mce/plugins/fullpage/js/fullpage.js | 637 +- js/tiny_mce/plugins/fullpage/langs/en_dlg.js | 86 +- .../plugins/fullscreen/editor_plugin.js | 2 +- .../plugins/fullscreen/editor_plugin_src.js | 16 +- js/tiny_mce/plugins/fullscreen/fullscreen.htm | 3 +- .../plugins/inlinepopups/editor_plugin.js | 2 +- .../plugins/inlinepopups/editor_plugin_src.js | 96 +- .../skins/clearlooks2/img/alert.gif | Bin 818 -> 810 bytes .../skins/clearlooks2/img/button.gif | Bin 280 -> 272 bytes .../skins/clearlooks2/img/confirm.gif | Bin 915 -> 907 bytes .../skins/clearlooks2/img/corners.gif | Bin 911 -> 909 bytes .../skins/clearlooks2/img/vertical.gif | Bin 92 -> 84 bytes .../inlinepopups/skins/clearlooks2/window.css | 2 +- js/tiny_mce/plugins/layer/editor_plugin.js | 2 +- .../plugins/layer/editor_plugin_src.js | 60 +- .../plugins/legacyoutput/editor_plugin.js | 2 +- .../plugins/legacyoutput/editor_plugin_src.js | 59 +- js/tiny_mce/plugins/lists/editor_plugin.js | 1 + .../plugins/lists/editor_plugin_src.js | 925 + js/tiny_mce/plugins/media/css/content.css | 6 - js/tiny_mce/plugins/media/css/media.css | 9 +- js/tiny_mce/plugins/media/editor_plugin.js | 2 +- .../plugins/media/editor_plugin_src.js | 1068 +- js/tiny_mce/plugins/media/js/media.js | 1012 +- js/tiny_mce/plugins/media/langs/en_dlg.js | 104 +- js/tiny_mce/plugins/media/media.htm | 677 +- js/tiny_mce/plugins/media/moxieplayer.swf | Bin 0 -> 19980 bytes .../plugins/nonbreaking/editor_plugin.js | 2 +- .../plugins/nonbreaking/editor_plugin_src.js | 7 +- .../plugins/noneditable/editor_plugin.js | 2 +- .../plugins/noneditable/editor_plugin_src.js | 9 +- .../plugins/pagebreak/editor_plugin.js | 2 +- .../plugins/pagebreak/editor_plugin_src.js | 5 +- js/tiny_mce/plugins/paste/editor_plugin.js | 2 +- .../plugins/paste/editor_plugin_src.js | 393 +- js/tiny_mce/plugins/paste/langs/en_dlg.js | 6 +- .../plugins/searchreplace/editor_plugin.js | 2 +- .../searchreplace/editor_plugin_src.js | 4 + .../plugins/searchreplace/js/searchreplace.js | 24 +- .../plugins/searchreplace/langs/en_dlg.js | 17 +- .../plugins/searchreplace/searchreplace.htm | 33 +- .../plugins/spellchecker/editor_plugin.js | 2 +- .../plugins/spellchecker/editor_plugin_src.js | 153 +- js/tiny_mce/plugins/style/js/props.js | 12 +- js/tiny_mce/plugins/style/langs/en_dlg.js | 64 +- js/tiny_mce/plugins/style/props.htm | 913 +- js/tiny_mce/plugins/tabfocus/editor_plugin.js | 2 +- .../plugins/tabfocus/editor_plugin_src.js | 234 +- js/tiny_mce/plugins/table/cell.htm | 30 +- js/tiny_mce/plugins/table/editor_plugin.js | 2 +- .../plugins/table/editor_plugin_src.js | 2533 +-- js/tiny_mce/plugins/table/js/cell.js | 55 +- js/tiny_mce/plugins/table/js/row.js | 36 +- js/tiny_mce/plugins/table/js/table.js | 79 +- js/tiny_mce/plugins/table/langs/en_dlg.js | 75 +- js/tiny_mce/plugins/table/merge_cells.htm | 22 +- js/tiny_mce/plugins/table/row.htm | 21 +- js/tiny_mce/plugins/table/table.htm | 107 +- js/tiny_mce/plugins/template/js/template.js | 2 +- js/tiny_mce/plugins/template/langs/en_dlg.js | 16 +- .../plugins/visualchars/editor_plugin.js | 2 +- .../plugins/visualchars/editor_plugin_src.js | 33 +- .../plugins/wordcount/editor_plugin.js | 2 +- .../plugins/wordcount/editor_plugin_src.js | 56 +- js/tiny_mce/plugins/xhtmlxtras/abbr.htm | 11 +- js/tiny_mce/plugins/xhtmlxtras/acronym.htm | 11 +- js/tiny_mce/plugins/xhtmlxtras/attributes.htm | 11 +- js/tiny_mce/plugins/xhtmlxtras/cite.htm | 9 +- js/tiny_mce/plugins/xhtmlxtras/del.htm | 17 +- .../plugins/xhtmlxtras/editor_plugin.js | 2 +- .../plugins/xhtmlxtras/editor_plugin_src.js | 24 +- js/tiny_mce/plugins/xhtmlxtras/ins.htm | 21 +- .../plugins/xhtmlxtras/js/attributes.js | 17 +- js/tiny_mce/plugins/xhtmlxtras/js/del.js | 14 +- .../plugins/xhtmlxtras/js/element_common.js | 8 +- js/tiny_mce/plugins/xhtmlxtras/js/ins.js | 17 +- .../plugins/xhtmlxtras/langs/en_dlg.js | 33 +- js/tiny_mce/themes/advanced/about.htm | 8 +- js/tiny_mce/themes/advanced/anchor.htm | 10 +- js/tiny_mce/themes/advanced/charmap.htm | 85 +- js/tiny_mce/themes/advanced/color_picker.htm | 19 +- .../themes/advanced/editor_template.js | 2 +- .../themes/advanced/editor_template_src.js | 292 +- js/tiny_mce/themes/advanced/image.htm | 102 +- .../themes/advanced/img/colorpicker.jpg | Bin 3189 -> 2584 bytes js/tiny_mce/themes/advanced/img/flash.gif | Bin 0 -> 239 bytes js/tiny_mce/themes/advanced/img/icons.gif | Bin 11794 -> 11790 bytes js/tiny_mce/themes/advanced/img/iframe.gif | Bin 0 -> 600 bytes js/tiny_mce/themes/advanced/img/pagebreak.gif | Bin 0 -> 325 bytes js/tiny_mce/themes/advanced/img/quicktime.gif | Bin 0 -> 301 bytes js/tiny_mce/themes/advanced/img/realmedia.gif | Bin 0 -> 439 bytes js/tiny_mce/themes/advanced/img/shockwave.gif | Bin 0 -> 384 bytes js/tiny_mce/themes/advanced/img/trans.gif | Bin 0 -> 43 bytes js/tiny_mce/themes/advanced/img/video.gif | Bin 0 -> 597 bytes .../themes/advanced/img/windowsmedia.gif | Bin 0 -> 415 bytes js/tiny_mce/themes/advanced/js/about.js | 1 + js/tiny_mce/themes/advanced/js/anchor.js | 10 +- js/tiny_mce/themes/advanced/js/charmap.js | 40 +- .../themes/advanced/js/color_picker.js | 144 +- js/tiny_mce/themes/advanced/js/image.js | 18 +- js/tiny_mce/themes/advanced/js/link.js | 11 +- .../themes/advanced/js/source_editor.js | 18 +- js/tiny_mce/themes/advanced/langs/en.js | 63 +- js/tiny_mce/themes/advanced/langs/en_dlg.js | 52 +- js/tiny_mce/themes/advanced/link.htm | 55 +- js/tiny_mce/themes/advanced/shortcuts.htm | 47 + .../themes/advanced/skins/default/content.css | 19 +- .../advanced/skins/default/img/buttons.png | Bin 3274 -> 3133 bytes .../advanced/skins/default/img/items.gif | Bin 70 -> 64 bytes .../advanced/skins/default/img/tabs.gif | Bin 1326 -> 1322 bytes .../themes/advanced/skins/default/ui.css | 9 +- .../advanced/skins/highcontrast/content.css | 24 + .../advanced/skins/highcontrast/dialog.css | 105 + .../themes/advanced/skins/highcontrast/ui.css | 102 + .../themes/advanced/skins/o2k7/content.css | 15 +- .../themes/advanced/skins/o2k7/dialog.css | 1 + .../advanced/skins/o2k7/img/button_bg.png | Bin 5859 -> 2766 bytes .../skins/o2k7/img/button_bg_black.png | Bin 3736 -> 651 bytes .../skins/o2k7/img/button_bg_silver.png | Bin 5358 -> 2084 bytes js/tiny_mce/themes/advanced/skins/o2k7/ui.css | 14 +- .../themes/advanced/skins/o2k7/ui_black.css | 2 +- .../themes/advanced/skins/o2k7/ui_silver.css | 2 +- js/tiny_mce/themes/advanced/source_editor.htm | 6 +- js/tiny_mce/themes/simple/editor_template.js | 2 +- .../themes/simple/editor_template_src.js | 3 +- js/tiny_mce/themes/simple/img/icons.gif | Bin 1440 -> 806 bytes js/tiny_mce/themes/simple/langs/en.js | 12 +- js/tiny_mce/tiny_mce.js | 2 +- js/tiny_mce/tiny_mce_dev.js | 253 +- js/tiny_mce/tiny_mce_jquery.js | 2 +- js/tiny_mce/tiny_mce_jquery_src.js | 12399 ++++++++------ js/tiny_mce/tiny_mce_popup.js | 2 +- js/tiny_mce/tiny_mce_prototype.js | 2 +- js/tiny_mce/tiny_mce_prototype_src.js | 14200 +++++++++------- js/tiny_mce/tiny_mce_src.js | 14200 +++++++++------- js/tiny_mce/utils/editable_selects.js | 2 +- js/tiny_mce/utils/form_utils.js | 18 +- js/tiny_mce/utils/mctabs.js | 105 +- js/tiny_mce/utils/validate.js | 38 +- js/varien/js.js | 21 +- js/varien/product.js | 26 + .../LinLibertine_Re-4.4.1.ttf | Bin 0 -> 1693712 bytes lib/Mage/Archive.php | 11 +- lib/Mage/Archive/Abstract.php | 13 +- lib/Mage/Archive/Bz.php | 42 +- lib/Mage/Archive/Gz.php | 42 +- lib/Mage/Archive/Helper/File.php | 271 + lib/Mage/Archive/Helper/File/Bz.php | 92 + lib/Mage/Archive/Helper/File/Gz.php | 83 + lib/Mage/Archive/Interface.php | 4 +- lib/Mage/Archive/Tar.php | 401 +- lib/Mage/Backup.php | 59 + lib/Mage/Backup/Abstract.php | 250 + lib/Mage/Backup/Archive/Tar.php | 82 + lib/Mage/Backup/Db.php | 128 + lib/Mage/Backup/Exception.php | 36 + .../Backup/Exception/CantLoadSnapshot.php | 36 + .../Backup/Exception/FtpConnectionFailed.php | 36 + .../Backup/Exception/FtpValidationFailed.php | 36 + .../Backup/Exception/NotEnoughFreeSpace.php | 36 + .../Backup/Exception/NotEnoughPermissions.php | 36 + lib/Mage/Backup/Filesystem.php | 284 + lib/Mage/Backup/Filesystem/Helper.php | 137 + .../Backup/Filesystem/Iterator/Filter.php | 77 + .../Backup/Filesystem/Rollback/Abstract.php | 57 + lib/Mage/Backup/Filesystem/Rollback/Fs.php | 78 + lib/Mage/Backup/Filesystem/Rollback/Ftp.php | 194 + lib/Mage/Backup/Interface.php | 88 + lib/Mage/Backup/Media.php | 99 + lib/Mage/Backup/Snapshot.php | 140 + lib/Mage/Connect/Ftp.php | 462 +- lib/Mage/Exception.php | 5 +- lib/Mage/System/Args.php | 8 +- lib/Mage/System/Dirs.php | 2 +- lib/Mage/System/Ftp.php | 509 + lib/Varien/Autoload.php | 4 +- lib/Varien/Convert/Adapter/Http/Curl.php | 2 + lib/Varien/Convert/Parser/Xml/Excel.php | 4 +- lib/Varien/Data/Collection/Filesystem.php | 2 +- lib/Varien/Data/Form/Abstract.php | 15 +- lib/Varien/Data/Form/Element/Collection.php | 7 +- lib/Varien/Data/Form/Element/Label.php | 25 +- lib/Varien/Date.php | 2 +- lib/Varien/Db/Adapter/Pdo/Mysql.php | 11 +- lib/Varien/Db/Select.php | 16 +- lib/Varien/File/Object.php | 13 +- lib/Varien/Http/Adapter/Curl.php | 78 +- lib/Zend/Captcha/Word.php | 16 +- skin/adminhtml/default/default/boxes.css | 45 +- .../default/default/images/btn_gr_bg.gif | Bin 0 -> 148 bytes .../default/default/images/btn_gr_on.gif | Bin 0 -> 137 bytes .../default/default/images/btn_gr_over.gif | Bin 0 -> 147 bytes .../default/default/images/reload.png | Bin 0 -> 1538 bytes skin/frontend/base/default/images/reload.png | Bin 0 -> 1538 bytes skin/frontend/base/default/js/opcheckout.js | 41 +- skin/frontend/default/blank/css/styles.css | 28 +- skin/frontend/default/blue/css/styles.css | 26 +- skin/frontend/default/default/css/styles.css | 30 +- skin/frontend/default/iphone/css/iphone.css | 3330 +++- .../default/iphone/images/bg_breadcrumb.png | Bin 0 -> 2864 bytes .../iphone/images/bg_breadcrumb_active.png | Bin 0 -> 2840 bytes .../default/iphone/images/bg_checkbox.png | Bin 0 -> 489 bytes .../iphone/images/bg_checkout_step_passed.png | Bin 0 -> 1098 bytes .../default/iphone/images/bg_drop.jpg | Bin 0 -> 12907 bytes .../default/iphone/images/bg_nav_brd.png | Bin 0 -> 259 bytes .../iphone/images/bg_nav_brd_inactive.png | Bin 0 -> 869 bytes .../frontend/default/iphone/images/bg_qty.png | Bin 0 -> 283 bytes .../default/iphone/images/bg_rating_star.png | Bin 0 -> 1081 bytes .../default/iphone/images/bkg_rating.gif | Bin 404 -> 0 bytes .../iphone/images/btn_google_checkout.gif | Bin 2940 -> 0 bytes .../iphone/images/btn_paypal_checkout.gif | Bin 3062 -> 0 bytes .../default/iphone/images/btn_place_order.gif | Bin 2929 -> 0 bytes .../iphone/images/btn_proceed_to_checkout.gif | Bin 3048 -> 0 bytes .../iphone/images/btn_proceed_to_checkout.png | Bin 2777 -> 0 bytes .../images/btn_proceed_to_checkout_bg.gif | Bin 2474 -> 0 bytes .../images/btn_proceed_to_checkout_rad.gif | Bin 1126 -> 0 bytes .../default/iphone/images/btn_trash.gif | Bin 643 -> 1353 bytes .../default/iphone/images/btn_trash.png | Bin 0 -> 1227 bytes .../iphone/images/btn_window_close.gif | Bin 226 -> 0 bytes .../default/iphone/images/chart_remove.gif | Bin 531 -> 0 bytes .../default/iphone/images/error_msg_icon.gif | Bin 1013 -> 0 bytes .../frontend/default/iphone/images/fabric.jpg | Bin 0 -> 57452 bytes skin/frontend/default/iphone/images/flip.png | Bin 0 -> 3124 bytes .../default/iphone/images/footer-bg.gif | Bin 153 -> 0 bytes .../iphone/images/free_shipping_callout.jpg | Bin 14639 -> 0 bytes .../default/iphone/images/front_banner.png | Bin 0 -> 7355 bytes .../iphone/images/gift-message-close.gif | Bin 122 -> 0 bytes skin/frontend/default/iphone/images/grid.png | Bin 0 -> 946 bytes .../default/iphone/images/header-bg.gif | Bin 144 -> 0 bytes .../default/iphone/images/i_add_to_cart.png | Bin 0 -> 1345 bytes .../iphone/images/i_add_to_wishlist.png | Bin 0 -> 1240 bytes .../default/iphone/images/i_arrow.png | Bin 0 -> 240 bytes .../default/iphone/images/i_arrow_small.png | Bin 0 -> 1304 bytes .../default/iphone/images/i_arrow_white.png | Bin 0 -> 1134 bytes .../default/iphone/images/i_dropdown.png | Bin 0 -> 1081 bytes .../default/iphone/images/i_gallery.png | Bin 0 -> 1129 bytes .../default/iphone/images/i_menu_arrow.png | Bin 0 -> 1036 bytes .../default/iphone/images/i_menu_cart.png | Bin 0 -> 1155 bytes .../default/iphone/images/i_menu_search.png | Bin 0 -> 1602 bytes .../default/iphone/images/i_notice.gif | Bin 802 -> 0 bytes .../default/iphone/images/i_search.png | Bin 0 -> 408 bytes .../frontend/default/iphone/images/i_star.png | Bin 0 -> 4117 bytes .../default/iphone/images/i_star_black.png | Bin 0 -> 3540 bytes .../default/iphone/images/i_tell_a_friend.png | Bin 0 -> 1865 bytes .../default/iphone/images/i_view_details.png | Bin 0 -> 1694 bytes .../default/iphone/images/link_separator.gif | Bin 44 -> 0 bytes skin/frontend/default/iphone/images/list.png | Bin 0 -> 946 bytes .../default/iphone/images/list_remove_btn.gif | Bin 204 -> 0 bytes .../frontend/default/iphone/images/loader.gif | Bin 0 -> 10107 bytes skin/frontend/default/iphone/images/logo.gif | Bin 2493 -> 2603 bytes skin/frontend/default/iphone/images/logo.png | Bin 0 -> 3660 bytes .../default/iphone/images/logo_email.gif | Bin 3407 -> 0 bytes .../default/iphone/images/logo_print.gif | Bin 3407 -> 0 bytes .../default/iphone/images/menu-arrow.gif | Bin 167 -> 0 bytes .../default/iphone/images/menu-bg.gif | Bin 153 -> 0 bytes .../frontend/default/iphone/images/nav_bg.png | Bin 0 -> 958 bytes .../default/iphone/images/nextlabel.png | Bin 0 -> 1374 bytes .../default/iphone/images/np_cart_thumb.gif | Bin 1372 -> 0 bytes .../default/iphone/images/np_more_img.gif | Bin 908 -> 0 bytes .../default/iphone/images/np_product_main.gif | Bin 4683 -> 0 bytes .../default/iphone/images/np_thumb.gif | Bin 1945 -> 0 bytes .../default/iphone/images/np_thumb2.gif | Bin 1779 -> 0 bytes .../default/iphone/images/opc-ajax-loader.gif | Bin 1849 -> 1737 bytes .../default/iphone/images/opc_off_head_bg.gif | Bin 49 -> 0 bytes .../default/iphone/images/opc_on_box_bg.gif | Bin 63 -> 0 bytes .../default/iphone/images/page-bg.gif | Bin 152 -> 0 bytes .../iphone/images/pager_arrow_left.gif | Bin 155 -> 0 bytes .../iphone/images/pager_arrow_right.gif | Bin 155 -> 0 bytes .../default/iphone/images/pager_bg.gif | Bin 150 -> 0 bytes skin/frontend/default/iphone/images/ph.gif | Bin 43 -> 0 bytes .../images/place_order_container_bg.gif | Bin 1503 -> 0 bytes .../default/iphone/images/prevlabel.png | Bin 0 -> 1241 bytes .../images/product_rating_blank_star.gif | Bin 304 -> 0 bytes .../images/product_rating_full_star.gif | Bin 306 -> 0 bytes .../default/iphone/images/search-bg.gif | Bin 273 -> 0 bytes .../iphone/images/search-close-but.gif | Bin 682 -> 0 bytes .../default/iphone/images/search-end.gif | Bin 690 -> 0 bytes .../default/iphone/images/search-go-but.gif | Bin 669 -> 0 bytes .../default/iphone/images/search-md.gif | Bin 165 -> 0 bytes .../default/iphone/images/search-st.gif | Bin 842 -> 0 bytes .../default/iphone/images/search_criteria.gif | Bin 268 -> 0 bytes .../default/iphone/images/search_icon.png | Bin 0 -> 1663 bytes .../iphone/images/shipping_method_pointer.gif | Bin 1144 -> 0 bytes .../default/iphone/images/sort_asc_arrow.gif | Bin 115 -> 0 bytes .../default/iphone/images/sort_desc_arrow.gif | Bin 114 -> 0 bytes .../iphone/images/success_msg_icon.gif | Bin 1024 -> 0 bytes .../iphone/images/validation_advice_bg.gif | Bin 134 -> 0 bytes skin/frontend/default/iphone/js/dnd.js | 688 + skin/frontend/default/iphone/js/iphone.js | 1044 ++ skin/frontend/default/iphone/js/opcheckout.js | 872 - skin/frontend/default/modern/css/styles.css | 27 +- .../Interface_Adminhtml_Default-1.6.1.0.xml | 18 - ...rface_Adminhtml_Default-1.7.0.0-alpha1.xml | 18 + ...nterface_Frontend_Base_Default-1.6.1.0.xml | 18 - ...e_Frontend_Base_Default-1.7.0.0-alpha1.xml | 18 + ...rface_Frontend_Default-1.7.0.0-alpha1.xml} | 14 +- ...erface_Install_Default-1.7.0.0-alpha1.xml} | 14 +- var/package/Lib_Google_Checkout-1.5.0.0.xml | 4 +- var/package/Lib_Js_Calendar-1.51.1.xml | 4 +- var/package/Lib_Js_Ext-1.6.0.0.xml | 18 - var/package/Lib_Js_Ext-1.7.0.0-alpha1.xml | 18 + ...1.0.xml => Lib_Js_Mage-1.7.0.0-alpha1.xml} | 14 +- ... => Lib_Js_Prototype-1.7.0.0.3-alpha1.xml} | 12 +- var/package/Lib_Js_TinyMCE-3.3.7.0.xml | 18 - var/package/Lib_Js_TinyMCE-3.4.7.0-alpha1.xml | 18 + ... Lib_LinLibertineFont-2.8.14.1-alpha1.xml} | 12 +- var/package/Lib_Mage-1.6.1.0.xml | 18 - var/package/Lib_Mage-1.7.0.0-alpha1.xml | 18 + var/package/Lib_Phpseclib-1.5.0.0.xml | 4 +- ....1.0.xml => Lib_Varien-1.7.0.0-alpha1.xml} | 12 +- var/package/Lib_ZF-1.11.1.0.xml | 4 +- var/package/Lib_ZF_Locale-1.11.1.0.xml | 4 +- var/package/Mage_All_Latest-1.6.1.0.xml | 18 - .../Mage_All_Latest-1.7.0.0-alpha1.xml | 18 + ...0.xml => Mage_Centinel-1.7.0.0-alpha1.xml} | 14 +- ...0.xml => Mage_Compiler-1.7.0.0-alpha1.xml} | 12 +- var/package/Mage_Core_Adminhtml-1.6.1.0.xml | 18 - .../Mage_Core_Adminhtml-1.7.0.0-alpha1.xml | 18 + var/package/Mage_Core_Modules-1.6.1.0.xml | 18 - .../Mage_Core_Modules-1.7.0.0-alpha1.xml | 18 + var/package/Mage_Downloader-1.6.1.0.xml | 18 - .../Mage_Downloader-1.7.0.0-alpha1.xml | 18 + var/package/Mage_Locale_en_US-1.6.1.0.xml | 18 - .../Mage_Locale_en_US-1.7.0.0-alpha1.xml | 18 + ....0.xml => Magento_Mobile-1.6.0.0.22.1.xml} | 12 +- ... => Phoenix_Moneybookers-1.3.1-alpha1.xml} | 12 +- 1223 files changed, 93395 insertions(+), 39655 deletions(-) create mode 100644 app/code/core/Mage/Adminhtml/Block/Backup/Dialogs.php create mode 100644 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Group.php create mode 100644 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Group/Abstract.php create mode 100644 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Weight.php create mode 100644 app/code/core/Mage/Adminhtml/Block/Customer/Edit/Renderer/Attribute/Group.php create mode 100644 app/code/core/Mage/Adminhtml/Block/Customer/Sales/Order/Address/Form/Billing/Renderer/Vat.php create mode 100644 app/code/core/Mage/Adminhtml/Block/Customer/System/Config/Validatevat.php create mode 100644 app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons.php create mode 100644 app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons/Form.php create mode 100644 app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons/Grid.php create mode 100644 app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons/Grid/Column/Renderer/Used.php create mode 100644 app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Main/Renderer/Checkbox.php create mode 100644 app/code/core/Mage/Adminhtml/Block/Report/Grid/Shopcart.php create mode 100644 app/code/core/Mage/Adminhtml/Controller/Report/Abstract.php create mode 100644 app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Customer/GroupAutoAssign.php create mode 100644 app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Filename.php create mode 100644 app/code/core/Mage/Adminhtml/controllers/Customer/System/Config/ValidatevatController.php create mode 100644 app/code/core/Mage/Backup/Model/Config/Backend/Cron.php create mode 100644 app/code/core/Mage/Backup/Model/Config/Source/Type.php create mode 100644 app/code/core/Mage/Backup/Model/Observer.php create mode 100644 app/code/core/Mage/Backup/etc/system.xml create mode 100644 app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-1.6.0.0-1.6.0.0.1.php create mode 100644 app/code/core/Mage/Bundle/sql/bundle_setup/upgrade-1.6.0.0-1.6.0.0.1.php create mode 100755 app/code/core/Mage/Captcha/Block/Captcha.php create mode 100755 app/code/core/Mage/Captcha/Block/Captcha/Zend.php create mode 100755 app/code/core/Mage/Captcha/Helper/Data.php create mode 100755 app/code/core/Mage/Captcha/Model/Captcha.php create mode 100755 app/code/core/Mage/Captcha/Model/Config/Font.php create mode 100755 app/code/core/Mage/Captcha/Model/Config/Form/Abstract.php create mode 100755 app/code/core/Mage/Captcha/Model/Config/Form/Backend.php create mode 100755 app/code/core/Mage/Captcha/Model/Config/Form/Frontend.php create mode 100755 app/code/core/Mage/Captcha/Model/Config/Mode.php create mode 100755 app/code/core/Mage/Captcha/Model/Interface.php create mode 100755 app/code/core/Mage/Captcha/Model/Observer.php create mode 100755 app/code/core/Mage/Captcha/Model/Resource/Log.php create mode 100755 app/code/core/Mage/Captcha/Model/Resource/LoginAttempt.php create mode 100755 app/code/core/Mage/Captcha/Model/Resource/LoginAttempt/Collection.php create mode 100755 app/code/core/Mage/Captcha/Model/Zend.php create mode 100755 app/code/core/Mage/Captcha/controllers/Adminhtml/RefreshController.php create mode 100755 app/code/core/Mage/Captcha/controllers/RefreshController.php create mode 100755 app/code/core/Mage/Captcha/etc/config.xml create mode 100755 app/code/core/Mage/Captcha/etc/system.xml create mode 100644 app/code/core/Mage/Captcha/sql/captcha_setup/install-1.7.0.0.0.php create mode 100644 app/code/core/Mage/Catalog/Model/Layer/Filter/Price/Algorithm.php create mode 100644 app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Groupprice.php create mode 100644 app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Groupprice/Abstract.php create mode 100644 app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Groupprice.php create mode 100644 app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Groupprice/Abstract.php create mode 100644 app/code/core/Mage/Catalog/data/catalog_setup/data-upgrade-1.6.0.0.8-1.6.0.0.9.php create mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.6.0.0.8-1.6.0.0.9.php create mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.6-1.6.0.0.7.php create mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.7-1.6.0.0.8.php create mode 100644 app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.9-1.6.0.0.10.php create mode 100644 app/code/core/Mage/CatalogInventory/Model/System/Config/Backend/Minqty.php create mode 100644 app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-1.6.0.0-1.6.0.0.1.php create mode 100644 app/code/core/Mage/Core/Model/Calculator.php create mode 100644 app/code/core/Mage/Customer/Model/Attribute/Backend/Data/Boolean.php create mode 100644 app/code/core/Mage/Customer/sql/customer_setup/upgrade-1.6.1.0-1.6.2.0.php create mode 100644 app/code/core/Mage/Customer/sql/customer_setup/upgrade-1.6.2.0-1.6.2.0.1.php create mode 100644 app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-1.6.0.0.1-1.6.0.0.2.php create mode 100644 app/code/core/Mage/Downloadable/sql/downloadable_setup/upgrade-1.6.0.0.1-1.6.0.0.2.php create mode 100644 app/code/core/Mage/Index/Block/Adminhtml/Process/Grid/Massaction.php create mode 100644 app/code/core/Mage/Newsletter/data/newsletter_setup/data-upgrade-1.6.0.0-1.6.0.1.php create mode 100644 app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/Payflowlink/Advanced.php create mode 100644 app/code/core/Mage/Paypal/Block/Payflow/Advanced/Form.php create mode 100644 app/code/core/Mage/Paypal/Block/Payflow/Advanced/Iframe.php create mode 100644 app/code/core/Mage/Paypal/Block/Payflow/Advanced/Info.php create mode 100644 app/code/core/Mage/Paypal/Block/Payflow/Advanced/Review.php create mode 100644 app/code/core/Mage/Paypal/Block/Payflow/Link/Review.php create mode 100644 app/code/core/Mage/Paypal/Model/Payflowadvanced.php create mode 100644 app/code/core/Mage/Paypal/controllers/PayflowadvancedController.php create mode 100644 app/code/core/Mage/Paypal/sql/paypal_setup/upgrade-1.6.0.1-1.6.0.2.php create mode 100644 app/code/core/Mage/Reports/Model/Resource/Helper/Interface.php create mode 100644 app/code/core/Mage/Reports/Model/Resource/Report/Collection/Abstract.php create mode 100644 app/code/core/Mage/Reports/Model/Resource/Report/Product/Viewed.php create mode 100644 app/code/core/Mage/Reports/Model/Resource/Report/Product/Viewed/Collection.php create mode 100644 app/code/core/Mage/Reports/sql/reports_setup/upgrade-1.6.0.0-1.6.0.0.1.php create mode 100644 app/code/core/Mage/Sales/Block/Adminhtml/Report/Filter/Form/Coupon.php create mode 100644 app/code/core/Mage/Sales/Model/Resource/Helper/Interface.php create mode 100644 app/code/core/Mage/Sales/data/sales_setup/data-upgrade-1.6.0.4-1.6.0.5.php create mode 100644 app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.4-1.6.0.5.php create mode 100644 app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.5-1.6.0.6.php create mode 100644 app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.6-1.6.0.7.php create mode 100644 app/code/core/Mage/SalesRule/Helper/Coupon.php create mode 100644 app/code/core/Mage/SalesRule/Model/Coupon/Massgenerator.php create mode 100644 app/code/core/Mage/SalesRule/Model/System/Config/Source/Coupon/Format.php create mode 100644 app/code/core/Mage/SalesRule/etc/system.xml create mode 100644 app/code/core/Mage/SalesRule/sql/salesrule_setup/upgrade-1.6.0.1-1.6.0.2.php create mode 100644 app/code/core/Mage/Usa/Block/Adminhtml/Dhl/Unitofmeasure.php create mode 100644 app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International.php create mode 100644 app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Contenttype.php create mode 100644 app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Freemethod.php create mode 100644 app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method.php create mode 100644 app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Abstract.php create mode 100644 app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/All.php create mode 100644 app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Doc.php create mode 100644 app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Freedoc.php create mode 100644 app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Freenondoc.php create mode 100644 app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Nondoc.php create mode 100644 app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Size.php create mode 100644 app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Unitofmeasure.php create mode 100644 app/code/core/Mage/Usa/etc/dhl/international/countries.xml create mode 100644 app/code/core/Zend/Date.php create mode 100755 app/design/adminhtml/default/default/layout/captcha.xml create mode 100644 app/design/adminhtml/default/default/template/backup/dialogs.phtml create mode 100644 app/design/adminhtml/default/default/template/captcha/zend.phtml create mode 100644 app/design/adminhtml/default/default/template/catalog/product/edit/price/group.phtml create mode 100644 app/design/adminhtml/default/default/template/customer/edit/tab/account/form/renderer/group.phtml create mode 100644 app/design/adminhtml/default/default/template/customer/sales/order/create/billing/form/renderer/vat.phtml create mode 100644 app/design/adminhtml/default/default/template/customer/system/config/validatevat.phtml create mode 100644 app/design/adminhtml/default/default/template/paypal/system/config/payflowlink/advanced.phtml create mode 100644 app/design/adminhtml/default/default/template/promo/salesrulejs.phtml create mode 100644 app/design/adminhtml/default/default/template/usa/dhl/unitofmeasure.phtml create mode 100755 app/design/frontend/base/default/layout/captcha.xml create mode 100644 app/design/frontend/base/default/template/captcha/zend.phtml create mode 100644 app/design/frontend/base/default/template/googleanalytics/ga.phtml create mode 100644 app/design/frontend/base/default/template/paypal/payflowadvanced/form.phtml create mode 100644 app/design/frontend/base/default/template/paypal/payflowadvanced/iframe.phtml rename skin/frontend/default/iphone/js/search.js => app/design/frontend/base/default/template/paypal/payflowadvanced/info.phtml (73%) create mode 100644 app/design/frontend/base/default/template/paypal/payflowadvanced/redirect.phtml create mode 100644 app/design/frontend/default/iphone/layout/catalogsearch.xml create mode 100644 app/design/frontend/default/iphone/layout/contacts.xml create mode 100644 app/design/frontend/default/iphone/layout/sendfriend.xml create mode 100644 app/design/frontend/default/iphone/template/bundle/sales/order/items/renderer.phtml create mode 100644 app/design/frontend/default/iphone/template/catalog/layer/view.phtml create mode 100644 app/design/frontend/default/iphone/template/catalog/navigation/top.phtml create mode 100644 app/design/frontend/default/iphone/template/catalog/product/compare/list.phtml create mode 100644 app/design/frontend/default/iphone/template/catalog/product/compare/sidebar.phtml create mode 100644 app/design/frontend/default/iphone/template/catalog/product/gallery.phtml create mode 100644 app/design/frontend/default/iphone/template/catalog/product/list.phtml create mode 100644 app/design/frontend/default/iphone/template/catalog/product/list/upsell.phtml create mode 100644 app/design/frontend/default/iphone/template/catalog/product/price.phtml create mode 100644 app/design/frontend/default/iphone/template/catalog/product/view.phtml create mode 100644 app/design/frontend/default/iphone/template/catalog/product/view/addto.phtml create mode 100644 app/design/frontend/default/iphone/template/catalog/product/view/addtocart.phtml create mode 100644 app/design/frontend/default/iphone/template/catalog/product/view/media.phtml create mode 100644 app/design/frontend/default/iphone/template/catalog/product/view/type/grouped.phtml create mode 100644 app/design/frontend/default/iphone/template/catalog/product/view/type/grouped_grid.phtml create mode 100644 app/design/frontend/default/iphone/template/catalogsearch/result.phtml rename app/design/frontend/default/iphone/template/{page/one-column.phtml => checkout/cart/noItemsHeader.phtml} (59%) create mode 100644 app/design/frontend/default/iphone/template/checkout/cart/sidebar.phtml create mode 100644 app/design/frontend/default/iphone/template/checkout/cartheader.phtml create mode 100644 app/design/frontend/default/iphone/template/checkout/onepage/login.phtml create mode 100644 app/design/frontend/default/iphone/template/customer/form/edit.phtml create mode 100644 app/design/frontend/default/iphone/template/customer/form/register.phtml create mode 100644 app/design/frontend/default/iphone/template/page/html/pager.phtml create mode 100644 app/design/frontend/default/iphone/template/page/switch/languages.phtml create mode 100644 app/design/frontend/default/iphone/template/page/switch/stores.phtml create mode 100644 app/design/frontend/default/iphone/template/persistent/checkout/onepage/login.phtml create mode 100644 app/design/frontend/default/iphone/template/persistent/customer/form/register.phtml create mode 100644 app/design/frontend/default/iphone/template/sales/order/items.phtml create mode 100644 app/design/frontend/default/iphone/template/sales/order/totals.phtml create mode 100644 app/design/frontend/default/iphone/template/sendfriend/send.phtml create mode 100644 app/design/frontend/default/iphone/template/tag/list.phtml create mode 100755 app/etc/modules/Mage_Captcha.xml create mode 100644 app/locale/en_US/Mage_Captcha.csv create mode 100755 downloader/lib/Mage/Archive/Helper/File.php create mode 100755 downloader/lib/Mage/Archive/Helper/File/Bz.php create mode 100755 downloader/lib/Mage/Archive/Helper/File/Gz.php create mode 100755 downloader/lib/Mage/Backup.php create mode 100755 downloader/lib/Mage/Backup/Abstract.php create mode 100644 downloader/lib/Mage/Backup/Archive/Tar.php create mode 100755 downloader/lib/Mage/Backup/Db.php create mode 100755 downloader/lib/Mage/Backup/Exception.php create mode 100755 downloader/lib/Mage/Backup/Exception/CantLoadSnapshot.php create mode 100755 downloader/lib/Mage/Backup/Exception/FtpConnectionFailed.php create mode 100755 downloader/lib/Mage/Backup/Exception/FtpValidationFailed.php create mode 100755 downloader/lib/Mage/Backup/Exception/NotEnoughFreeSpace.php create mode 100755 downloader/lib/Mage/Backup/Exception/NotEnoughPermissions.php create mode 100755 downloader/lib/Mage/Backup/Filesystem.php create mode 100755 downloader/lib/Mage/Backup/Filesystem/Helper.php create mode 100755 downloader/lib/Mage/Backup/Filesystem/Iterator/Filter.php create mode 100755 downloader/lib/Mage/Backup/Filesystem/Rollback/Abstract.php create mode 100755 downloader/lib/Mage/Backup/Filesystem/Rollback/Fs.php create mode 100755 downloader/lib/Mage/Backup/Filesystem/Rollback/Ftp.php create mode 100755 downloader/lib/Mage/Backup/Interface.php create mode 100644 downloader/lib/Mage/Backup/Media.php create mode 100755 downloader/lib/Mage/Backup/Snapshot.php create mode 100755 downloader/lib/Mage/System/Ftp.php create mode 100644 js/extjs/fix-defer-before.js create mode 100644 js/mage/adminhtml/backup.js create mode 100644 js/mage/captcha.js delete mode 100644 js/tiny_mce/classes/CommandManager.js delete mode 100644 js/tiny_mce/classes/Developer.js delete mode 100644 js/tiny_mce/classes/dom/Schema.js delete mode 100644 js/tiny_mce/classes/dom/StringWriter.js delete mode 100644 js/tiny_mce/classes/dom/XMLWriter.js create mode 100644 js/tiny_mce/classes/firebug/FIREBUG.LICENSE create mode 100644 js/tiny_mce/classes/html/DomParser.js create mode 100644 js/tiny_mce/classes/html/Entities.js create mode 100644 js/tiny_mce/classes/html/Node.js create mode 100644 js/tiny_mce/classes/html/SaxParser.js create mode 100644 js/tiny_mce/classes/html/Schema.js create mode 100644 js/tiny_mce/classes/html/Serializer.js create mode 100644 js/tiny_mce/classes/html/Styles.js create mode 100644 js/tiny_mce/classes/html/Writer.js create mode 100644 js/tiny_mce/classes/ui/KeyboardNavigation.js create mode 100644 js/tiny_mce/classes/ui/ToolbarGroup.js create mode 100644 js/tiny_mce/classes/util/Quirks.js create mode 100644 js/tiny_mce/classes/util/VK.js create mode 100644 js/tiny_mce/plugins/autolink/editor_plugin.js create mode 100644 js/tiny_mce/plugins/autolink/editor_plugin_src.js create mode 100644 js/tiny_mce/plugins/example_dependency/editor_plugin.js create mode 100644 js/tiny_mce/plugins/example_dependency/editor_plugin_src.js create mode 100644 js/tiny_mce/plugins/lists/editor_plugin.js create mode 100644 js/tiny_mce/plugins/lists/editor_plugin_src.js delete mode 100644 js/tiny_mce/plugins/media/css/content.css create mode 100644 js/tiny_mce/plugins/media/moxieplayer.swf create mode 100644 js/tiny_mce/themes/advanced/img/flash.gif create mode 100644 js/tiny_mce/themes/advanced/img/iframe.gif create mode 100644 js/tiny_mce/themes/advanced/img/pagebreak.gif create mode 100644 js/tiny_mce/themes/advanced/img/quicktime.gif create mode 100644 js/tiny_mce/themes/advanced/img/realmedia.gif create mode 100644 js/tiny_mce/themes/advanced/img/shockwave.gif create mode 100644 js/tiny_mce/themes/advanced/img/trans.gif create mode 100644 js/tiny_mce/themes/advanced/img/video.gif create mode 100644 js/tiny_mce/themes/advanced/img/windowsmedia.gif create mode 100644 js/tiny_mce/themes/advanced/shortcuts.htm create mode 100644 js/tiny_mce/themes/advanced/skins/highcontrast/content.css create mode 100644 js/tiny_mce/themes/advanced/skins/highcontrast/dialog.css create mode 100644 js/tiny_mce/themes/advanced/skins/highcontrast/ui.css create mode 100644 lib/LinLibertineFont/LinLibertine_Re-4.4.1.ttf create mode 100644 lib/Mage/Archive/Helper/File.php create mode 100644 lib/Mage/Archive/Helper/File/Bz.php create mode 100644 lib/Mage/Archive/Helper/File/Gz.php create mode 100644 lib/Mage/Backup.php create mode 100644 lib/Mage/Backup/Abstract.php create mode 100644 lib/Mage/Backup/Archive/Tar.php create mode 100644 lib/Mage/Backup/Db.php create mode 100644 lib/Mage/Backup/Exception.php create mode 100644 lib/Mage/Backup/Exception/CantLoadSnapshot.php create mode 100644 lib/Mage/Backup/Exception/FtpConnectionFailed.php create mode 100644 lib/Mage/Backup/Exception/FtpValidationFailed.php create mode 100644 lib/Mage/Backup/Exception/NotEnoughFreeSpace.php create mode 100644 lib/Mage/Backup/Exception/NotEnoughPermissions.php create mode 100644 lib/Mage/Backup/Filesystem.php create mode 100644 lib/Mage/Backup/Filesystem/Helper.php create mode 100644 lib/Mage/Backup/Filesystem/Iterator/Filter.php create mode 100644 lib/Mage/Backup/Filesystem/Rollback/Abstract.php create mode 100644 lib/Mage/Backup/Filesystem/Rollback/Fs.php create mode 100644 lib/Mage/Backup/Filesystem/Rollback/Ftp.php create mode 100644 lib/Mage/Backup/Interface.php create mode 100644 lib/Mage/Backup/Media.php create mode 100644 lib/Mage/Backup/Snapshot.php create mode 100644 lib/Mage/System/Ftp.php create mode 100644 skin/adminhtml/default/default/images/btn_gr_bg.gif create mode 100644 skin/adminhtml/default/default/images/btn_gr_on.gif create mode 100644 skin/adminhtml/default/default/images/btn_gr_over.gif create mode 100644 skin/adminhtml/default/default/images/reload.png create mode 100644 skin/frontend/base/default/images/reload.png create mode 100644 skin/frontend/default/iphone/images/bg_breadcrumb.png create mode 100644 skin/frontend/default/iphone/images/bg_breadcrumb_active.png create mode 100644 skin/frontend/default/iphone/images/bg_checkbox.png create mode 100644 skin/frontend/default/iphone/images/bg_checkout_step_passed.png create mode 100644 skin/frontend/default/iphone/images/bg_drop.jpg create mode 100644 skin/frontend/default/iphone/images/bg_nav_brd.png create mode 100644 skin/frontend/default/iphone/images/bg_nav_brd_inactive.png create mode 100644 skin/frontend/default/iphone/images/bg_qty.png create mode 100644 skin/frontend/default/iphone/images/bg_rating_star.png delete mode 100644 skin/frontend/default/iphone/images/bkg_rating.gif delete mode 100644 skin/frontend/default/iphone/images/btn_google_checkout.gif delete mode 100644 skin/frontend/default/iphone/images/btn_paypal_checkout.gif delete mode 100644 skin/frontend/default/iphone/images/btn_place_order.gif delete mode 100644 skin/frontend/default/iphone/images/btn_proceed_to_checkout.gif delete mode 100644 skin/frontend/default/iphone/images/btn_proceed_to_checkout.png delete mode 100644 skin/frontend/default/iphone/images/btn_proceed_to_checkout_bg.gif delete mode 100644 skin/frontend/default/iphone/images/btn_proceed_to_checkout_rad.gif create mode 100644 skin/frontend/default/iphone/images/btn_trash.png delete mode 100644 skin/frontend/default/iphone/images/btn_window_close.gif delete mode 100644 skin/frontend/default/iphone/images/chart_remove.gif delete mode 100644 skin/frontend/default/iphone/images/error_msg_icon.gif create mode 100644 skin/frontend/default/iphone/images/fabric.jpg create mode 100644 skin/frontend/default/iphone/images/flip.png delete mode 100644 skin/frontend/default/iphone/images/footer-bg.gif delete mode 100644 skin/frontend/default/iphone/images/free_shipping_callout.jpg create mode 100644 skin/frontend/default/iphone/images/front_banner.png delete mode 100644 skin/frontend/default/iphone/images/gift-message-close.gif create mode 100644 skin/frontend/default/iphone/images/grid.png delete mode 100644 skin/frontend/default/iphone/images/header-bg.gif create mode 100644 skin/frontend/default/iphone/images/i_add_to_cart.png create mode 100644 skin/frontend/default/iphone/images/i_add_to_wishlist.png create mode 100644 skin/frontend/default/iphone/images/i_arrow.png create mode 100644 skin/frontend/default/iphone/images/i_arrow_small.png create mode 100644 skin/frontend/default/iphone/images/i_arrow_white.png create mode 100644 skin/frontend/default/iphone/images/i_dropdown.png create mode 100644 skin/frontend/default/iphone/images/i_gallery.png create mode 100644 skin/frontend/default/iphone/images/i_menu_arrow.png create mode 100644 skin/frontend/default/iphone/images/i_menu_cart.png create mode 100644 skin/frontend/default/iphone/images/i_menu_search.png delete mode 100644 skin/frontend/default/iphone/images/i_notice.gif create mode 100644 skin/frontend/default/iphone/images/i_search.png create mode 100644 skin/frontend/default/iphone/images/i_star.png create mode 100644 skin/frontend/default/iphone/images/i_star_black.png create mode 100644 skin/frontend/default/iphone/images/i_tell_a_friend.png create mode 100644 skin/frontend/default/iphone/images/i_view_details.png delete mode 100644 skin/frontend/default/iphone/images/link_separator.gif create mode 100644 skin/frontend/default/iphone/images/list.png delete mode 100644 skin/frontend/default/iphone/images/list_remove_btn.gif create mode 100644 skin/frontend/default/iphone/images/loader.gif create mode 100644 skin/frontend/default/iphone/images/logo.png delete mode 100644 skin/frontend/default/iphone/images/logo_email.gif delete mode 100644 skin/frontend/default/iphone/images/logo_print.gif delete mode 100644 skin/frontend/default/iphone/images/menu-arrow.gif delete mode 100644 skin/frontend/default/iphone/images/menu-bg.gif create mode 100644 skin/frontend/default/iphone/images/nav_bg.png create mode 100644 skin/frontend/default/iphone/images/nextlabel.png delete mode 100644 skin/frontend/default/iphone/images/np_cart_thumb.gif delete mode 100644 skin/frontend/default/iphone/images/np_more_img.gif delete mode 100644 skin/frontend/default/iphone/images/np_product_main.gif delete mode 100644 skin/frontend/default/iphone/images/np_thumb.gif delete mode 100644 skin/frontend/default/iphone/images/np_thumb2.gif delete mode 100644 skin/frontend/default/iphone/images/opc_off_head_bg.gif delete mode 100644 skin/frontend/default/iphone/images/opc_on_box_bg.gif delete mode 100644 skin/frontend/default/iphone/images/page-bg.gif delete mode 100644 skin/frontend/default/iphone/images/pager_arrow_left.gif delete mode 100644 skin/frontend/default/iphone/images/pager_arrow_right.gif delete mode 100644 skin/frontend/default/iphone/images/pager_bg.gif delete mode 100644 skin/frontend/default/iphone/images/ph.gif delete mode 100644 skin/frontend/default/iphone/images/place_order_container_bg.gif create mode 100644 skin/frontend/default/iphone/images/prevlabel.png delete mode 100644 skin/frontend/default/iphone/images/product_rating_blank_star.gif delete mode 100644 skin/frontend/default/iphone/images/product_rating_full_star.gif delete mode 100644 skin/frontend/default/iphone/images/search-bg.gif delete mode 100755 skin/frontend/default/iphone/images/search-close-but.gif delete mode 100644 skin/frontend/default/iphone/images/search-end.gif delete mode 100755 skin/frontend/default/iphone/images/search-go-but.gif delete mode 100644 skin/frontend/default/iphone/images/search-md.gif delete mode 100644 skin/frontend/default/iphone/images/search-st.gif delete mode 100644 skin/frontend/default/iphone/images/search_criteria.gif create mode 100644 skin/frontend/default/iphone/images/search_icon.png delete mode 100644 skin/frontend/default/iphone/images/shipping_method_pointer.gif delete mode 100644 skin/frontend/default/iphone/images/sort_asc_arrow.gif delete mode 100644 skin/frontend/default/iphone/images/sort_desc_arrow.gif delete mode 100644 skin/frontend/default/iphone/images/success_msg_icon.gif delete mode 100644 skin/frontend/default/iphone/images/validation_advice_bg.gif create mode 100644 skin/frontend/default/iphone/js/dnd.js create mode 100644 skin/frontend/default/iphone/js/iphone.js delete mode 100644 skin/frontend/default/iphone/js/opcheckout.js delete mode 100644 var/package/Interface_Adminhtml_Default-1.6.1.0.xml create mode 100644 var/package/Interface_Adminhtml_Default-1.7.0.0-alpha1.xml delete mode 100644 var/package/Interface_Frontend_Base_Default-1.6.1.0.xml create mode 100644 var/package/Interface_Frontend_Base_Default-1.7.0.0-alpha1.xml rename var/package/{Interface_Frontend_Default-1.6.0.0.xml => Interface_Frontend_Default-1.7.0.0-alpha1.xml} (97%) rename var/package/{Interface_Install_Default-1.6.1.0.xml => Interface_Install_Default-1.7.0.0-alpha1.xml} (91%) delete mode 100644 var/package/Lib_Js_Ext-1.6.0.0.xml create mode 100644 var/package/Lib_Js_Ext-1.7.0.0-alpha1.xml rename var/package/{Lib_Js_Mage-1.6.1.0.xml => Lib_Js_Mage-1.7.0.0-alpha1.xml} (58%) rename var/package/{Lib_Js_Prototype-1.7.0.0.2.xml => Lib_Js_Prototype-1.7.0.0.3-alpha1.xml} (98%) delete mode 100644 var/package/Lib_Js_TinyMCE-3.3.7.0.xml create mode 100644 var/package/Lib_Js_TinyMCE-3.4.7.0-alpha1.xml rename var/package/{Lib_LinLibertineFont-2.8.14.0.xml => Lib_LinLibertineFont-2.8.14.1-alpha1.xml} (68%) delete mode 100644 var/package/Lib_Mage-1.6.1.0.xml create mode 100644 var/package/Lib_Mage-1.7.0.0-alpha1.xml rename var/package/{Lib_Varien-1.6.1.0.xml => Lib_Varien-1.7.0.0-alpha1.xml} (92%) delete mode 100644 var/package/Mage_All_Latest-1.6.1.0.xml create mode 100644 var/package/Mage_All_Latest-1.7.0.0-alpha1.xml rename var/package/{Mage_Centinel-1.6.1.0.xml => Mage_Centinel-1.7.0.0-alpha1.xml} (92%) rename var/package/{Mage_Compiler-1.6.0.0.xml => Mage_Compiler-1.7.0.0-alpha1.xml} (86%) delete mode 100644 var/package/Mage_Core_Adminhtml-1.6.1.0.xml create mode 100644 var/package/Mage_Core_Adminhtml-1.7.0.0-alpha1.xml delete mode 100644 var/package/Mage_Core_Modules-1.6.1.0.xml create mode 100644 var/package/Mage_Core_Modules-1.7.0.0-alpha1.xml delete mode 100644 var/package/Mage_Downloader-1.6.1.0.xml create mode 100644 var/package/Mage_Downloader-1.7.0.0-alpha1.xml delete mode 100644 var/package/Mage_Locale_en_US-1.6.1.0.xml create mode 100644 var/package/Mage_Locale_en_US-1.7.0.0-alpha1.xml rename var/package/{Magento_Mobile-1.6.0.0.22.0.xml => Magento_Mobile-1.6.0.0.22.1.xml} (89%) rename var/package/{Phoenix_Moneybookers-1.3.0.xml => Phoenix_Moneybookers-1.3.1-alpha1.xml} (97%) diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt index b09f515d9a..14aaee5514 100644 --- a/RELEASE_NOTES.txt +++ b/RELEASE_NOTES.txt @@ -1,3 +1,630 @@ +==== 1.7.0.0-alpha1 ==== + +=== Major Highlights === +New Layered Navigation price bucket algorithm +Added captcha functionality +Implemented different base prices for customer groups +Added auto generation of coupon codes +Backup and Rollback functionality +VAT ID Validation added +Implemented DHL for Europe + +=== Improvements === +XmlConnect package release v22.1 +Upgraded TinyMCE to v3.4.7 +Indexers refactoring +Theme for iPhone was redesigned + +=== Changes === +Implemented localized PayPal settings for Japan +Added PayPal Advanced payment method + +=== Fixes === +Fixed Incorrect translation messages definitions +Fixed Error message isn't displayed if currency exchange rate not found (in case with DHL Int) +Fixed Handling Fee doesn't applied Per Package +Fixed User role with partial access can't edit attributes of configurable products +Fixed Letter "n" missed in the word "handling" +Fixed Buttons don't react for pressing on the "Widget Options" section in Insert Widget window +Fixed Regular price displays incorrect +Fixed {{base_url}} in (un)secure_url doesn't work since 1.6.1 +Fixed Product selection field gets cleared out with recently added products from latest page +Fixed "Change" button while checkout doesn't work +Fixed MySQL BIGINT field type is wrongly casted to integer +Fixed Magento Connect Manager proceed with installation of extension if error appears on database backup +Fixed "Set product as New from/to Date" works excluding selected dates +Fixed Function fireEvent from lib/varien/js.js does not work in IE9 +Fixed Searching with first and last name has no results +Fixed CMS Pages: Error in IE7 when select CMS page +Fixed White screen appears instead of 404 Error Page when going to review a product which doesn't exist +Fixed "Maximum Package Weight" option works incorrect in case with decimal Qty in shopping Cart +Fixed Unable to create tables for new EAV entity via SQL upgrade script +Fixed Customer group isn't revalidated on checkout if Enable Automatic Assignment to Customer Group = Yes +Fixed Mistake in PayPal Payments Advanced fieldset title +Fixed Zero Subtotal Checkout payment method is used, when it is disabled in settings +Fixed Some info lost from address when customer sets this address as default for shipping +Fixed Incorrect calculation logic during distribution products between several pieces (in case with DHL) +Fixed No ability to get shipping rates from US to another country (in case with DHL) +Fixed Incorrect calculation of pieces weight (in case with Bundle Product) +Fixed Product Flat Data index causes replication lag on MySQL master/slave model +Fixed Exception is shown, when admin user provides filtration of Newsletter problem reports by Subscriber +Fixed Typo in JavaScript error message +Fixed Unable to do mass action update for products +Fixed Error Message isn't displayed if currency exchange rate not found (in case with DHL) +Fixed Weight field is absent during Quick simple product creation +Fixed Fixed correct helper resolving +Fixed Shipping methods are shown twice in DHLs shipping quote +Fixed Unable to translate shipping and billing forms on the order creation page +Fixed Drop-down attribute with layered navigation filter doesn't work with value is set to 0 +Fixed Free Shipping options doesn't work (in case with DHL) +Fixed Handling Fee doesn't applied Per Package +Fixed Free Shipping options works incorrect +Fixed WYSIWYG Editor: It's impossible insert Widget to CMS page content +Fixed Customer's group is not changed if his billing address modified within backend +Fixed Wrong behaviour and exception while using invalid image +Fixed Layered navigation for prices displays incorrect price ranges in manual mode +Fixed Uninformative error message during saving two nodes with the same parameter URL Key +Fixed Unable to change order addresses in the admin panel +Fixed PayPal Express always uses default billing address from customer account +Fixed Unable to place order if customer selects Register on checkout +Fixed Performance Issue: Most Viewed product reports on large amount of items +Fixed In "Customer Addresses" block before and after of State name is located symbols "," +Fixed Lightbox 2.5 with IE7 returns JS error on the page +Fixed Unable to change customer status (confirmed/not confirmed) when customer logged in +Fixed Incorrect notification for empty field during creation catalog price rules +Fixed Unable to save product with non-checked multiple select attribute +Fixed "Ship Bundle Items" for bundle product works incorrect +Fixed Package Size setting for DHL +Fixed No Input Validation for Catalog Fields +Fixed Row Total Calculation in Refund +Fixed "Maximum number of price intervals" should be written with capital letters +Fixed Divide Order Weight options for DHL +Fixed Incorrect Row Total Calculation in Refund +Fixed Impossible to create new customer in the backend +Fixed Catalog data-upgrade-1.6.0.0.4-1.6.0.0.5.php is exteremly slow +Fixed Free Shipping options doesn't work (in case with DHL International) +Fixed Mage_Catalog_Helper_Product::getProduct() doesn't load product by its SKU +Fixed Preview Template doesn't work correctly +Fixed Some options of Bundle Product disappeared from the Invoice PDF +Fixed "Allow Countries" affects on "Country of Manufacture" attribute +Fixed Some phrases are not translated +Fixed Incorrect Ordered Qty in Order (in case with decimal qty) +Fixed Trademark character isn't being displayed properly in the PDF invoice +Fixed Can't search transactions by order_id in manager.paypal.com +Fixed Inline Translation: Grid headers are displayed incorrect on the Tag Edit page +Fixed "Create Extension Package" page becomes broken after compilation +Fixed Price including tax isn't displayed for some kinds of bundle products +Fixed Layered navigation for prices displays incorrect price ranges in manual mode +Fixed Pager works wrong with float page number +Fixed Incorrect foreign key for EAV entity tables +Fixed Misprint in downloader/lib/Mage/Connect/Command/Install.php +Fixed URL Rewrites must be case-sensitive +Fixed Unable to install package via uploader if author name contains dash +Fixed Fixed invoice subtotals for cases with partial invoice and discount +Fixed Catalog URL Rewrites works incorrectly on creating categories +Fixed New Oder Status setting, specified for payment method works incorrectly when only virtual products are present in Order +Fixed Rounding issue in catalog and product view if price includes tax +Fixed Wrong status of catalog event is displayed by editing catalog event +Fixed Role Resources are not saved +Fixed "Qty for Item's Status to Become Out of Stock" option works incorrect +Fixed XML parser works incorrect +Fixed Mage_Reports_Model_Mysql4_Product_Index_Abstract must be declared abstract +Fixed "Date & Time" and "Time" custom options becomes required when editing product +Fixed Unable to cancel an order for an expired Authorize.net auth +Fixed Custom options are not stored when downloadable product is duplicated +Fixed "Cannot initialize the indexer process" error during Mass "Reindex Data" Action +Fixed Search by new attribute fails, attribute is not shown in layered navigation +Fixed Exception when "Price Navigation Step Calculation" set to "Manual" mode and FPT enabled +Fixed WPPHS: Cancel URL doesn't work as should be +Fixed Error about insufficient permissions is not appears on database backup creation +Fixed After rollback admin doesn't redirected to the Log in to Admin Panel page +Fixed Database Backup must not include indexer table data +Fixed Scheduled Backup creation/failure isn't logged +Fixed Deleting backup while it is used by another process +Fixed Opening *.tar files causes an error "There are no trailing zero-filled records" +Fixed Unable to search by "Time" and "No" in Backups table +Fixed Backups are deleted without confirmation +Fixed Reports must be excluded from database snapshot backup +Fixed There are no products in filtering results, if step calculation in automatic mode +Fixed No validation for "Default Price Navigation Step" +Fixed "Back" button doesn't work on the Create New Order page +Fixed Incorrect logic of Token expiration in Two Step Password Reset flow +Fixed Tag
is present in tool-tip for field "Number of results (For the last time placed)" on the Edit Search page +Fixed Unnecessary hard code in Magento Extension +Fixed Wrong logic in Mage_Core_Model_Resource_Db_Collection_Abstract::join() +Fixed Description and Short Description are displayed incorrectly for products added with WYSIWYG +Fixed Adding product to the cart from the product review page leads to 404 page +Fixed Special symbols in Sort Order field +Fixed Text is wrong displayed with enabled Inline translation for Admin on back-end +Fixed Inline Translation: Unable to translate some customer information +Fixed Useless colon on front-end login page +Fixed Unable to continue checkout for product with zero price and non-zero shipping price +Fixed Import news_from_date field is configured poorly. It is not accepting the data from file +Fixed When updating product data through import, attributes that have a value cannot be assigned a new value that is empty +Fixed Unable to replace non-complex data for products with empty values during import +Fixed "Wrong order ID" exception in PayPal Express module under heavy load +Fixed Tax is applying on the order when creating it in the admin panel for a Customer Group with no taxes +Fixed Issue with retrieving order statuses for array of states +Fixed Wrong calculation product price with custom option type = Field and Fixed price +Fixed Back ordered downloadable product is not available even when it is set to be be accessible when order status is Pending +Fixed Missing column "position" at table catalog_category_anc_products_index_tmp +Fixed Incorrect behavior of "Save in address book" option during admin Order creation for a new customer +- refactored Mage_Adminhtml_Model_Sales_Order_Create::_prepareCustomer() +Fixed Terms and Conditions is named differently on different pages +Fixed "Apply" and "Discount Amount" fields appear twice in the Catalog Price Rule +Fixed Poll shows incorrect percentage +Fixed Added validation ability for admin configuration forms +Fixed UPS XML misprint +Fixed Misprint in uploading files form +Fixed Unnecessary check boxes for gift options +Fixed Wrong resource section declaration in Mage_Tag module +Fixed "Customers Submitted this Tag" section doesn't update when customer has deleted tag from his account +Fixed Correct product in category position +Fixed Unable to create folder in Media Storage +Fixed Translation with single quotes breaks JavaScript +Fixed Out of memory error with hundreds of thousands of coupons attached to a single sales rule +Fixed Unable to translate buttons and tabs on the "Manage Category" page +Fixed Product Categories Tree doesn't expand in Manage Products page +Fixed Incorrect products qty returns to stock after refund for configurable product +Fixed Swf Uploader problems with cross domain Flash Player Policy +Fixed Unable to translate "Layout Updates" block on create/edit widget page +Fixed IE7: "Remember Me" checkbox visible on billing information step +Fixed CMS WYSIWYG Editor - widget is inserted as new while editing in IE8 +Fixed Currency code doesn't correspond to the amount in reports +Fixed Mage_Adminhtml_Block_Sales_Order_View_Tab_History::getFullHistory() doesn't use unique keys for each message +Fixed Scope labels are shown without translate wrapper +Fixed Wrong parameters handling in Core Helper formatDate() +Fixed Apostrophe in store name breaks Google Analytics tracking +Fixed Customer attribute prefix is not shown on frontend +Fixed Incorrect rounding for product with custom options (percent price) +Fixed Invoicing only part of products results in wrong totals calculation +Fixed Incorrect Row Total Calculation in Refund +- fixed rounding issues for partial Invoice and Refund +- refactored delta rounding +Fixed Filter by "Allow Countries" not working for Customer Address Form in the Backend +- checking added for set country to be in available list +Fixed There are sql-installs with empty string used as defaults for table columns, while column is not null able +Fixed Unable to translate "Note" in "Product Stock Options" +Fixed Various warning are displayed after creating shipment for 0 items +Fixed Invalid content in Content-header in the top of page during scrolling during order creation +Fixed "Online invoice" button present in backend when using Zero Subtotal Checkout +Fixed String cast type in in_array function +Fixed Newsletter template content should not disappear when "Show" / "Hide Editor" button was clicked +Fixed Import feature doesn't validate whether super_products_sku is existing or not +Fixed Cannot place order with downloadable product and discount code using Paypal Express payment method +Fixed Product still out of stock after Stock Status reindex +Fixed No ability to reindex Catalog URL Rewrites, error is shown +Fixed Automatic reindexing based on matched events doesn't change "Status" and "Last Run" columns at process list grid +Fixed Save catalog price rule gives trace if full reindex has already started +Fixed Reindex requires notification is not shown for Stock Status when stock is updated for several products using Mass Action +Fixed Incorrect FedEx's shipping rates (in case with non-US country origin) +Fixed After partial reindex MSRP value is not applied (not viewed) in catalog during mass update action +Fixed Wrong stock reindex on catalog if partial reindex done after full reindex started +Fixed In error message string "already exists." written twice, when trying to save Product Tax Class with the same name +Fixed Slow checkout with non-flushed cache +Fixed Bundle product total is incorrect in Customization block +Fixed Special price isn't considered for bundle dynamic products in "Your Customization" block +Fixed Situation when any amount of duplicate reindex process can be running at one time +Fixed Error with Advanced Search (in case with Date Attribute) +Fixed Product Flat Data index isn't marked as "Reindex Required" after importing products when Flat Catalog is enabled +Fixed User can't change root category for the store +Fixed JS error causes the overwrite of Title field in PayPal Advanced configuration +Fixed Mass action doesn't partially reindex catalog for product name/description +Fixed Remove hint about $1 auth amount from informational message text (PayflowLink configuration) +Fixed Mass action doesn't partially reindex catalog for product prices +Fixed PayPal Payments Advanced works with $0 Auth instead of Full Auth +Fixed Impossible to place Order using "Pay with PayPal" button from PayPal Payments Advanced iframe +Fixed Mass action doesn't partially reindex catalog search for product if searchable attribute was updated +Fixed "Please wait" AJAX screen doesn't appear in the middle of the page +Fixed Checkout link on frontend is always referenced as http +Fixed GET request is incorrectly formed during category creation +- adjusted assertion to determine last viewed store +Fixed Display of Tier Pricing with Configurable Products +- added functionality to dynamically update tier prices accordingly to chosen product configuration +Fixed Google Analytics e-commerce tracking not working +Fixed URL key isn't used while product save +Fixed Added validation class to 'Qty increments' +Fixed Entered from admin customer date 1970 (or less) is saved as 2070 (or less) +Fixed cUrl resource must be closed after checking it for errors, not before +Fixed Exception while products mass update attributes in backend +Fixed No ability to reindex Catalog URL Rewrites, error is shown +Fixed Package with Core dependency +Fixed Stock Availability isn't updated if 1: Run Price Reindex 2: Update Stock Availability on product with mass action/single product +Fixed Blank page instead shopping cart page when compilation and PSC are enabled +Fixed Unable to save redirect URL with special characters in search terms +Fixed Attribute Set field should have client-side validation and appropriate information message +Fixed "Localhost" isn't a valid domain name for installation +Fixed Iframe for PayPal Payments Advanced is not loaded +Fixed Retain the selected tab on editing CMS page +Fixed Payflow Link Express Checkout (pay with PayPal button) payment +Fixed Wrong number of reindex options is displayed +Fixed Wrong phpDocs for Varien_Db_Select +Fixed JavaScript calendar date range +- fixed JS calendar behavior to use 4-digits year format +Fixed Performance issue connected with sales rules on adding product to cart +Fixed DHL same error message appears several times +Fixed Item Status says "Mixed" when an order has been completed, should say "Shipped" +Fixed Product option title is absent in backend order page +Fixed Incorrect items number during multi shipping checkout +Fixed User name displays differently in the unsuccessful message and in the text field label (log in form) +Fixed If one or more indexers have Update Required = Yes and all Status = READY for all indexers than there is no notification for user to do reindex action +Fixed No space between Address line 1 and line 2 in Shipping Label (in case with FedEx) +Fixed JS works depends on the position attributes of the product +Fixed Char set encoding is out-of-date in Settlement reports +Fixed Settlement reports can't be downloaded if in merchant's account 'Settlement file' is set to 6.0 version +Fixed Unable to login when secure and unsecure urls are different +Fixed Customer session lost when using different domain/subdomain names for secure and unsecure urls +Fixed "Most Viewed" reports ignore Store View switcher +Fixed Long FPT name (and product name) doesn't fit into "My cart" block +Fixed Paypal IPN post back failure +Fixed Customer was unable to receive newsletters when it was created via backend +Fixed Wrong Comments History in notification of order creation/cancellation +Fixed Non escaped string causes javascript error +Fixed Unable to view pictures during product editing +Fixed Ampersand is saved incorrect in attribute label +Fixed IE8: JS error appears after pressing 'Add new rule' in catalog price rules menu +Fixed Exception after sorting newsletter queue +Fixed Customer is not able to log in from URL without "www" in some cases +Fixed SQL error on category view with enabled and configured FPT +Fixed Automatic reindexing based on matched events doesn't change "Status" and "Last Run" columns at process list grid +Fixed Performance issue with Magento Compiler + APC results in too many I/O calls +Fixed Website Administrator is able to change default values +Fixed Some of wishlist blocks and templates still treat the collection of wishlist items as collection of products +Fixed Unnecessary comments in "Share Wishlist" email + + + +==== 1.6.x-devel-139014 ==== + +=== Major Highlights === +Implemented different base prices for customer groups +Added auto generation of coupon codes + +=== Fixes === +Fixed Incorrect translation messages definitions +Fixed Error message isn't displayed if currency exchange rate not found (in case with DHL Int) +Fixed Handling Fee doesn't applied Per Package +Fixed User role with partial access can't edit attributes of configurable products +Fixed Letter "n" missed in the word "handling" +Fixed Buttons don't react for pressing on the "Widget Options" section in Insert Widget window +Fixed Regular price displays incorrect +Fixed {{base_url}} in (un)secure_url doesn't work since 1.6.1 +Fixed Product selection field gets cleared out with recently added products from latest page +Fixed "Change" button while checkout doesn't work +Fixed MySQL BIGINT field type is wrongly casted to integer +Fixed Magento Connect Manager proceed with installation of extension if error appears on database backup +Fixed "Set product as New from/to Date" works excluding selected dates +Fixed Function fireEvent from lib/varien/js.js does not work in IE9 +Fixed Searching with first and last name has no results +Fixed CMS Pages: Error in IE7 when select CMS page +Fixed White screen appears instead of 404 Error Page when going to review a product which doesn't exist +Fixed "Maximum Package Weight" option works incorrect in case with decimal Qty in shopping Cart + + + +==== 1.6.x-devel-138051 ==== +Fixed Unable to create tables for new EAV entity via SQL upgrade script +Fixed Customer group isn't revalidated on checkout if Enable Automatic Assignment to Customer Group = Yes +Fixed VAT ID validation must not run if added address is outside EU +Fixed Mistake in PayPal Payments Advanced fieldset title +Fixed Zero Subtotal Checkout payment method is used, when it is disabled in settings +Fixed Some info lost from address when customer sets this address as default for shipping +Fixed Incorrect calculation logic during distribution products between several pieces (in case with DHL) +Fixed No ability to get shipping rates from US to another country (in case with DHL) +Fixed Incorrect calculation of pieces weight (in case with Bundle Product) +Fixed Divide Order Weight options for new DHL +Fixed Product Flat Data index causes replication lag on MySQL master/slave model +Fixed Exception is shown, when admin user provides filtration of Newsletter problem reports by Subscriber +Fixed Gap in the section background appears on the Login page when CAPTCHA is enabled +Fixed Typo in JavaScript error message +Fixed Unable to do mass action update for products +Fixed Error Message isn't displayed if currency exchange rate not found (in case with DHL) +Fixed Weight field is absent during Quick simple product creation +Fixed Fixed correct helper resolving +Fixed Shipping methods are shown twice in DHLs shipping quote +Fixed Unable to translate shipping and billing forms on the order creation page +Fixed Drop-down attribute with layered navigation filter doesn't work with value is set to 0 +Fixed Free Shipping options doesn't work (in case with DHL) +Fixed Handling Fee doesn't applied Per Package + + + +==== 1.6.x-devel-136760 ==== +Fixed Free Shipping options works incorrect +Fixed Wrong massage appears if VAT ID is invalid +Fixed WYSIWYG Editor: It's impossible insert Widget to CMS page content +Fixed After removing VAT Number, customer continues to be assigned to "Valid VAT ID Domestic" group +Fixed Customer's group is not changed if his billing address modified within backend +Fixed Wrong behaviour and exception while using invalid image +Fixed Layered navigation for prices displays incorrect price ranges in manual mode +Fixed Uninformative error message during saving two nodes with the same parameter URL Key +Fixed Unable to change order addresses in the admin panel +Fixed PayPal Express always uses default billing address from customer account +Fixed Unable to place order if customer selects Register on checkout +Fixed Performance Issue: Most Viewed product reports on large amount of items +Fixed In "Customer Addresses" block before and after of State name is located symbols "," +Fixed Lightbox 2.5 with IE7 returns JS error on the page +Fixed Unable to change customer status (confirmed/not confirmed) when customer logged in +Fixed Incorrect notification for empty field during creation catalog price rules +Fixed Unable to save product with non-checked multiple select attribute +Fixed "Ship Bundle Items" for bundle product works incorrect +Fixed Package Size setting for DHL +Fixed No Input Validation for Catalog Fields +Fixed Row Total Calculation in Refund +Fixed "Maximum number of price intervals" should be written with capital letters +Fixed Divide Order Weight options for DHL + + + +==== 1.6.x-devel-135464 ==== +Fixed Incorrect Row Total Calculation in Refund +Fixed Impossible to create new customer in the backend +Fixed Catalog data-upgrade-1.6.0.0.4-1.6.0.0.5.php is exteremly slow +Fixed Free Shipping options doesn't work (in case with DHL International) +Fixed Mage_Catalog_Helper_Product::getProduct() doesn't load product by its SKU +Fixed Preview Template doesn't work correctly +Fixed Some options of Bundle Product disappeared from the Invoice PDF +Fixed "Allow Countries" affects on "Country of Manufacture" attribute +Fixed Some phrases are not translated +Fixed Incorrect Ordered Qty in Order (in case with decimal qty) +Fixed Trademark character isn't being displayed properly in the PDF invoice +Fixed Can't search transactions by order_id in manager.paypal.com +Fixed Inline Translation: Grid headers are displayed incorrect on the Tag Edit page +Fixed Scheduled Backup creation/failure isn't logged +Fixed "Create Extension Package" page becomes broken after compilation +Fixed Price including tax isn't displayed for some kinds of bundle products +Fixed Layered navigation for prices displays incorrect price ranges in manual mode +Fixed Pager works wrong with float page number +Fixed VAT Number for country that isn't selected in "European Union Countries" validated +Fixed Incorrect foreign key for EAV entity tables +Fixed VAT ID: Warning message about not-valid VAT Number displayed in green frame +Fixed Misprint in downloader/lib/Mage/Connect/Command/Install.php +Fixed URL Rewrites must be case-sensitive +Fixed Incorrect notification when customer's billing address updated with VAT ID within frontend +Fixed Unable to install package via uploader if author name contains dash +Fixed Fixed invoice subtotals for cases with partial invoice and discount +Fixed Incorrect work of "Disable Automatic Group Changes Based on VAT ID Default Value" option +Fixed Catalog URL Rewrites works incorrectly on creating categories + + + +==== 1.6.x-devel-134386 ==== + +=== Major Highlights === +Added VAT ID Validation +Implemented DHL for Europe + +=== Improvements === +Theme for iPhone was redesigned + +=== Fixes === +Fixed New Oder Status setting, specified for payment method works incorrectly when only virtual products are present in Order +Fixed Rounding issue in catalog and product view if price includes tax +Fixed Wrong status of catalog event is displayed by editing catalog event +Fixed Role Resources are not saved +Fixed "Qty for Item's Status to Become Out of Stock" option works incorrect +Fixed XML parser works incorrect +Fixed Mage_Reports_Model_Mysql4_Product_Index_Abstract must be declared abstract +Fixed "Date & Time" and "Time" custom options becomes required when editing product +Fixed Unable to cancel an order for an expired Authorize.net auth +Fixed Custom options are not stored when downloadable product is duplicated +Fixed "Cannot initialize the indexer process" error during Mass "Reindex Data" Action +Fixed Search by new attribute fails, attribute is not shown in layered navigation +Fixed Exception when "Price Navigation Step Calculation" set to "Manual" mode and FPT enabled +Fixed WPPHS: Cancel URL doesn't work as should be +Fixed Error about insufficient permissions is not appears on database backup creation +Fixed After rollback admin doesn't redirected to the Log in to Admin Panel page +Fixed Database Backup must not include indexer table data +Fixed Scheduled Backup creation/failure isn't logged +Fixed Deleting backup while it is used by another process +Fixed Opening *.tar files causes an error "There are no trailing zero-filled records" +Fixed Unable to search by "Time" and "No" in Backups table +Fixed Backups are deleted without confirmation +Fixed Reports must be excluded from database snapshot backup +Fixed There are no products in filtering results, if step calculation in automatic mode +Fixed No validation for "Default Price Navigation Step" +Fixed "Back" button doesn't work on the Create New Order page +Fixed Incorrect logic of Token expiration in Two Step Password Reset flow +Fixed Tag
is present in tool-tip for field "Number of results (For the last time placed)" on the Edit Search page +Fixed Impossible to use CAPTCHA that longer than 12 symbols +Fixed CAPTCHA with space symbol in it works incorrectly +Fixed System backup doesn't complete +Fixed Unnecessary hard code in Magento Extension +Fixed It's impossible specify form where CAPTCHA could be used +Fixed Wrong logic in Mage_Core_Model_Resource_Db_Collection_Abstract::join() +Fixed Description and Short Description are displayed incorrectly for products added with WYSIWYG +Fixed Adding product to the cart from the product review page leads to 404 page +Fixed Special symbols in Sort Order field +Fixed Text is wrong displayed with enabled Inline translation for Admin on back-end +Fixed Inline Translation: Unable to translate some customer information +Fixed Useless colon on front-end login page +Fixed Unable to continue checkout for product with zero price and non-zero shipping price +Fixed Import news_from_date field is configured poorly. It is not accepting the data from file +Fixed When updating product data through import, attributes that have a value cannot be assigned a new value that is empty +Fixed Unable to replace non-complex data for products with empty values during import +Fixed Customer can't understand is CAPTCHA case sensitive or not +Fixed Incorrect CAPTCHA's default configuration values +Fixed "Wrong order ID" exception in PayPal Express module under heavy load +Fixed Tax is applying on the order when creating it in the admin panel for a Customer Group with no taxes +Fixed Issue with retrieving order statuses for array of states +Fixed Wrong calculation product price with custom option type = Field and Fixed price +Fixed Back ordered downloadable product is not available even when it is set to be be accessible when order status is Pending + + + +==== 1.6.x-devel-133001 ==== + +=== Major Highlights === +Implemented Backup and Rollback functionality + +=== Fixes === +Fixed Full Product Price reindex started instead of partial if prices updated with mass action +Fixed Missing column "position" at table catalog_category_anc_products_index_tmp +Fixed Incorrect behavior of "Save in address book" option during admin Order creation for a new customer +- refactored Mage_Adminhtml_Model_Sales_Order_Create::_prepareCustomer() +Fixed Terms and Conditions is named differently on different pages +Fixed "Apply" and "Discount Amount" fields appear twice in the Catalog Price Rule +Fixed Poll shows incorrect percentage +Fixed Added validation ability for admin configuration forms +Fixed UPS XML misprint +Fixed Misprint in uploading files form +Fixed Unnecessary check boxes for gift options +Fixed Wrong resource section declaration in Mage_Tag module +Fixed "Customers Submitted this Tag" section doesn't update when customer has deleted tag from his account +Fixed Correct product in category position +Fixed Unable to create folder in Media Storage +Fixed Translation with single quotes breaks JavaScript +Fixed Out of memory error with hundreds of thousands of coupons attached to a single sales rule +Fixed Unable to translate buttons and tabs on the "Manage Category" page +Fixed Product Categories Tree doesn't expand in Manage Products page +Fixed Incorrect products qty returns to stock after refund for configurable product +Fixed Swf Uploader problems with cross domain Flash Player Policy +Fixed Unable to translate "Layout Updates" block on create/edit widget page +Fixed IE7: "Remember Me" checkbox visible on billing information step +Fixed CMS WYSIWYG Editor - widget is inserted as new while editing in IE8 +Fixed Currency code doesn't correspond to the amount in reports +Fixed Mage_Adminhtml_Block_Sales_Order_View_Tab_History::getFullHistory() doesn't use unique keys for each message +Fixed Scope labels are shown without translate wrapper +Fixed Wrong parameters handling in Core Helper formatDate() +Fixed Apostrophe in store name breaks Google Analytics tracking +Fixed Customer attribute prefix is not shown on frontend +Fixed Incorrect rounding for product with custom options (percent price) +Fixed Invoicing only part of products results in wrong totals calculation +Fixed Incorrect Row Total Calculation in Refund +- fixed rounding issues for partial Invoice and Refund +- refactored delta rounding +Fixed Filter by "Allow Countries" not working for Customer Address Form in the Backend +- checking added for set country to be in available list +Fixed There are sql-installs with empty string used as defaults for table columns, while column is not null able +Fixed Unable to translate "Note" in "Product Stock Options" +Fixed Various warning are displayed after creating shipment for 0 items +Fixed Invalid content in Content-header in the top of page during scrolling during order creation +Fixed "Online invoice" button present in backend when using Zero Subtotal Checkout +Fixed String cast type in in_array function +Fixed Newsletter template content should not disappear when "Show" / "Hide Editor" button was clicked +Fixed Import feature doesn't validate whether super_products_sku is existing or not + + + + +==== 1.6.x-devel-131783 ==== + +=== Major Highlights === +Implemented new Layered Navigation price bucket algorithm +Added captcha functionality + +=== Improvements === +XmlConnect package release v22.1 +Upgraded TinyMCE to v3.4.7 + +=== Fixes === +Fixed Cannot place order with downloadable product and discount code using Paypal Express payment method +Fixed Product still out of stock after Stock Status reindex +Fixed No ability to reindex Catalog URL Rewrites, error is shown +Fixed Automatic reindexing based on matched events doesn't change "Status" and "Last Run" columns at process list grid +Fixed Save catalog price rule gives trace if full reindex has already started +Fixed Reindex requires notification is not shown for Stock Status when stock is updated for several products using Mass Action +Fixed Incorrect FedEx's shipping rates (in case with non-US country origin) +Fixed After partial reindex MSRP value is not applied (not viewed) in catalog during mass update action +Fixed Wrong stock reindex on catalog if partial reindex done after full reindex started +Fixed In error message string "already exists." written twice, when trying to save Product Tax Class with the same name +Fixed Wrong stock reindex on catalog if partial reindex done after full reindex started +Fixed Slow checkout with non-flushed cache + + + +==== 1.6.x-devel-130478 ==== +Fixed Bundle product total is incorrect in Customization block +Fixed Special price isn't considered for bundle dynamic products in "Your Customization" block +Fixed Situation when any amount of duplicate reindex process can be running at one time +Fixed Error with Advanced Search (in case with Date Attribute) +Fixed Product Flat Data index isn't marked as "Reindex Required" after importing products when Flat Catalog is enabled +Fixed User can't change root category for the store +Fixed JS error causes the overwrite of Title field in PayPal Advanced configuration +Fixed Mass action doesn't partially reindex catalog for product name/description +Fixed Remove hint about $1 auth amount from informational message text (PayflowLink configuration) +Fixed Mass action doesn't partially reindex catalog for product prices +Fixed PayPal Payments Advanced works with $0 Auth instead of Full Auth +Fixed Impossible to place Order using "Pay with PayPal" button from PayPal Payments Advanced iframe +Fixed Mass action doesn't partially reindex catalog search for product if searchable attribute was updated +Fixed "Please wait" AJAX screen doesn't appear in the middle of the page +Fixed Checkout link on frontend is always referenced as http +Fixed GET request is incorrectly formed during category creation +- adjusted assertion to determine last viewed store +Fixed Display of Tier Pricing with Configurable Products +- added functionality to dynamically update tier prices accordingly to chosen product configuration +Fixed Google Analytics e-commerce tracking not working +Fixed URL key isn't used while product save +Fixed Added validation class to 'Qty increments' +Fixed Entered from admin customer date 1970 (or less) is saved as 2070 (or less) +Fixed cUrl resource must be closed after checking it for errors, not before +Fixed Exception while products mass update attributes in backend +Fixed Impossible to place Order using Pay with PayPal button from PayflowLink iframe, when Payment Action is Sale +Fixed No ability to reindex Catalog URL Rewrites, error is shown +Fixed Package with Core dependency + + + +==== 1.6.x-devel-129596 ==== +Fixed Stock Availability isn't updated if 1: Run Price Reindex 2: Update Stock Availability on product with mass action/single product +Fixed PayPal Payments Advanced update descriptions +Fixed Blank page instead shopping cart page when compilation and PSC are enabled +Fixed Unable to save redirect URL with special characters in search terms +Fixed Attribute Set field should have client-side validation and appropriate information message +Fixed "Localhost" isn't a valid domain name for installation +Fixed Iframe for PayPal Payments Advanced is not loaded +Fixed Retain the selected tab on editing CMS page +Fixed Payflow Link Express Checkout (pay with PayPal button) payment +Fixed Wrong number of reindex options is displayed +Fixed Wrong phpDocs for Varien_Db_Select +Fixed JavaScript calendar date range +- fixed JS calendar behavior to use 4-digits year format +Fixed Performance issue connected with sales rules on adding product to cart +Fixed DHL same error message appears several times +Fixed Item Status says "Mixed" when an order has been completed, should say "Shipped" +Fixed Product option title is absent in backend order page +Fixed Incorrect items number during multi shipping checkout +Fixed User name displays differently in the unsuccessful message and in the text field label (log in form) +Fixed If one or more indexers have Update Required = Yes and all Status = READY for all indexers than there is no notification for user to do reindex action +Fixed No space between Address line 1 and line 2 in Shipping Label (in case with FedEx) + + + +==== 1.6.x-devel-128838 ==== + +=== Improvements === +Indexers refactoring + +=== Changes === +Implemented localized PayPal settings for Japan +Added PayPal Payments Advanced + +=== Fixes === +Fixed JS works depends on the position attributes of the product +Fixed Char set encoding is out-of-date in Settlement reports +Fixed Settlement reports can't be downloaded if in merchant's account 'Settlement file' is set to 6.0 version +Fixed Unable to login when secure and unsecure urls are different +Fixed Customer session lost when using different domain/subdomain names for secure and unsecure urls +Fixed "Most Viewed" reports ignore Store View switcher +Fixed Long FPT name (and product name) doesn't fit into "My cart" block +Fixed Paypal IPN post back failure +Fixed Customer was unable to receive newsletters when it was created via backend +Fixed Wrong Comments History in notification of order creation/cancellation +Fixed Non escaped string causes javascript error +Fixed Unable to view pictures during product editing +Fixed Ampersand is saved incorrect in attribute label +Fixed IE8: JS error appears after pressing 'Add new rule' in catalog price rules menu +Fixed Exception after sorting newsletter queue +Fixed Customer is not able to log in from URL without "www" in some cases +Fixed SQL error on category view with enabled and configured FPT +Fixed Automatic reindexing based on matched events doesn't change "Status" and "Last Run" columns at process list grid +Fixed Performance issue with Magento Compiler + APC results in too many I/O calls +Fixed Website Administrator is able to change default values +Fixed Some of wishlist blocks and templates still treat the collection of wishlist items as collection of products +Fixed Unnecessary comments in "Share Wishlist" email + + + ==== 1.6.1.0 ==== === Major Highlights === diff --git a/app/Mage.php b/app/Mage.php index 4d50995d90..f5b1b716f7 100644 --- a/app/Mage.php +++ b/app/Mage.php @@ -33,8 +33,8 @@ if (defined('COMPILER_INCLUDE_PATH')) { $appPath = COMPILER_INCLUDE_PATH; set_include_path($appPath . PS . Mage::registry('original_include_path')); - include_once "Mage_Core_functions.php"; - include_once "Varien_Autoload.php"; + include_once COMPILER_INCLUDE_PATH . DS . "Mage_Core_functions.php"; + include_once COMPILER_INCLUDE_PATH . DS . "Varien_Autoload.php"; } else { /** * Set include path @@ -138,7 +138,8 @@ final class Mage public static function getVersion() { $i = self::getVersionInfo(); - return trim("{$i['major']}.{$i['minor']}.{$i['revision']}" . ($i['patch'] != '' ? ".{$i['patch']}" : "") . "-{$i['stability']}{$i['number']}", '.-'); + return trim("{$i['major']}.{$i['minor']}.{$i['revision']}" . ($i['patch'] != '' ? ".{$i['patch']}" : "") + . "-{$i['stability']}{$i['number']}", '.-'); } /** @@ -151,11 +152,11 @@ public static function getVersionInfo() { return array( 'major' => '1', - 'minor' => '6', - 'revision' => '1', + 'minor' => '7', + 'revision' => '0', 'patch' => '0', - 'stability' => '', - 'number' => '', + 'stability' => 'alpha', + 'number' => '1', ); } @@ -166,12 +167,14 @@ public static function getVersionInfo() public static function reset() { self::$_registry = array(); + self::$_appRoot = null; self::$_app = null; self::$_config = null; self::$_events = null; self::$_objects = null; self::$_isDownloader = false; self::$_isDeveloperMode = false; + self::$_isInstalled = null; // do not reset $headersSentThrowsException } @@ -424,7 +427,7 @@ public static function dispatchEvent($name, array $data = array()) * * @link Mage_Core_Model_Config::getModelInstance * @param string $modelClass - * @param array $arguments + * @param array|object $arguments * @return Mage_Core_Model_Abstract */ public static function getModel($modelClass = '', $arguments = array()) @@ -631,6 +634,12 @@ public static function run($code = '', $type = 'store', $options = array()) Varien_Profiler::start('mage'); self::setRoot(); self::$_app = new Mage_Core_Model_App(); + if (isset($options['request'])) { + self::$_app->setRequest($options['request']); + } + if (isset($options['response'])) { + self::$_app->setResponse($options['response']); + } self::$_events = new Varien_Event_Collection(); self::$_config = new Mage_Core_Model_Config($options); self::$_app->run(array( diff --git a/app/code/core/Mage/Admin/Model/Observer.php b/app/code/core/Mage/Admin/Model/Observer.php index c685beb3c0..0d7816be5e 100644 --- a/app/code/core/Mage/Admin/Model/Observer.php +++ b/app/code/core/Mage/Admin/Model/Observer.php @@ -33,6 +33,7 @@ */ class Mage_Admin_Model_Observer { + const FLAG_NO_LOGIN = 'no-login'; /** * Handler for controller_action_predispatch event * @@ -51,7 +52,8 @@ public function actionPreDispatchAdmin($observer) 'forgotpassword', 'resetpassword', 'resetpasswordpost', - 'logout' + 'logout', + 'refresh' // captcha refresh ); if (in_array($requestedActionName, $openActions)) { $request->setDispatched(true); @@ -64,7 +66,7 @@ public function actionPreDispatchAdmin($observer) $postLogin = $request->getPost('login'); $username = isset($postLogin['username']) ? $postLogin['username'] : ''; $password = isset($postLogin['password']) ? $postLogin['password'] : ''; - $user = $session->login($username, $password, $request); + $session->login($username, $password, $request); $request->setPost('login', null); } if (!$request->getParam('forwarded')) { diff --git a/app/code/core/Mage/Admin/Model/Roles.php b/app/code/core/Mage/Admin/Model/Roles.php index 0d5db92e88..7110ed9a5d 100644 --- a/app/code/core/Mage/Admin/Model/Roles.php +++ b/app/code/core/Mage/Admin/Model/Roles.php @@ -53,42 +53,86 @@ class Mage_Admin_Model_Roles extends Mage_Core_Model_Abstract */ protected $_eventPrefix = 'admin_roles'; + /** + * Constructor + */ protected function _construct() { $this->_init('admin/roles'); } + /** + * Update object into database + * + * @return Mage_Admin_Model_Roles + */ public function update() { $this->getResource()->update($this); return $this; } + /** + * Retrieve users collection + * + * @return Mage_Admin_Model_Resource_Roles_User_Collection + */ public function getUsersCollection() { return Mage::getResourceModel('admin/roles_user_collection'); } + /** + * Return tree of acl resources + * + * @return array|null|Varien_Simplexml_Element + */ public function getResourcesTree() { return $this->_buildResourcesArray(null, null, null, null, true); } + /** + * Return list of acl resources + * + * @return array|null|Varien_Simplexml_Element + */ public function getResourcesList() { return $this->_buildResourcesArray(); } + /** + * Return list of acl resources in 2D format + * + * @return array|null|Varien_Simplexml_Element + */ public function getResourcesList2D() { return $this->_buildResourcesArray(null, null, null, true); } + /** + * Return users for role + * + * @return array|false + */ public function getRoleUsers() { return $this->getResource()->getRoleUsers($this); } + /** + * Build resources array process + * + * @param null|Varien_Simplexml_Element $resource + * @param null $parentName + * @param int $level + * @param null $represent2Darray + * @param bool $rawNodes + * @param string $module + * @return array|null|Varien_Simplexml_Element + */ protected function _buildResourcesArray(Varien_Simplexml_Element $resource = null, $parentName = null, $level = 0, $represent2Darray = null, $rawNodes = false, $module = 'adminhtml') { @@ -99,7 +143,7 @@ protected function _buildResourcesArray(Varien_Simplexml_Element $resource = nul $level = -1; } else { $resourceName = $parentName; - if ($resource->getName() != 'title' && $resource->getName() != 'sort_order' && $resource->getName() != 'children') { + if (!in_array($resource->getName(), array('title', 'sort_order', 'children', 'disabled'))) { $resourceName = (is_null($parentName) ? '' : $parentName . '/') . $resource->getName(); //assigning module for its' children nodes @@ -121,22 +165,20 @@ protected function _buildResourcesArray(Varien_Simplexml_Element $resource = nul } } + //check children and run recursion if they exists $children = $resource->children(); - if (empty($children)) { - if ($rawNodes) { - return $resource; - } else { - return $result; + foreach ($children as $key => $child) { + if (1 == $child->disabled) { + $resource->{$key} = null; + continue; } - } - foreach ($children as $child) { $this->_buildResourcesArray($child, $resourceName, $level + 1, $represent2Darray, $rawNodes, $module); } + if ($rawNodes) { return $resource; } else { return $result; } } - } diff --git a/app/code/core/Mage/Admin/Model/Session.php b/app/code/core/Mage/Admin/Model/Session.php index 3f5cecba66..7f30aca610 100644 --- a/app/code/core/Mage/Admin/Model/Session.php +++ b/app/code/core/Mage/Admin/Model/Session.php @@ -86,7 +86,7 @@ public function login($username, $password, $request = null) } try { - /* @var $user Mage_Admin_Model_User */ + /** @var $user Mage_Admin_Model_User */ $user = Mage::getModel('admin/user'); $user->login($username, $password); if ($user->getId()) { @@ -98,19 +98,19 @@ public function login($username, $password, $request = null) $this->setIsFirstPageAfterLogin(true); $this->setUser($user); $this->setAcl(Mage::getResourceModel('admin/acl')->loadAcl()); - if ($requestUri = $this->_getRequestUri($request)) { + + $requestUri = $this->_getRequestUri($request); + if ($requestUri) { Mage::dispatchEvent('admin_session_user_login_success', array('user' => $user)); header('Location: ' . $requestUri); exit; } + } else { + Mage::throwException(Mage::helper('adminhtml')->__('Invalid User Name or Password.')); } - else { - Mage::throwException(Mage::helper('adminhtml')->__('Invalid Username or Password.')); - } - } - catch (Mage_Core_Exception $e) { + } catch (Mage_Core_Exception $e) { Mage::dispatchEvent('admin_session_user_login_failed', - array('user_name' => $username, 'exception' => $e)); + array('user_name' => $username, 'exception' => $e)); if ($request && !$request->getParam('messageSent')) { Mage::getSingleton('adminhtml/session')->addError($e->getMessage()); $request->setParam('messageSent', true); diff --git a/app/code/core/Mage/Admin/Model/User.php b/app/code/core/Mage/Admin/Model/User.php index f9b37bebcd..d3e56d0097 100644 --- a/app/code/core/Mage/Admin/Model/User.php +++ b/app/code/core/Mage/Admin/Model/User.php @@ -328,6 +328,10 @@ public function authenticate($username, $password) $result = false; try { + Mage::dispatchEvent('admin_user_authenticate_before', array( + 'username' => $username, + 'user' => $this + )); $this->loadByUsername($username); $sensitive = ($config) ? $username == $this->getUsername() : true; @@ -556,7 +560,7 @@ public function changeResetPasswordLinkToken($newResetPasswordLinkToken) { throw Mage::exception('Mage_Core', Mage::helper('adminhtml')->__('Invalid password reset token.')); } $this->setRpToken($newResetPasswordLinkToken); - $currentDate = Varien_Date::now(true); + $currentDate = Varien_Date::now(); $this->setRpTokenCreatedAt($currentDate); return $this; @@ -578,7 +582,7 @@ public function isResetPasswordLinkTokenExpired() $tokenExpirationPeriod = Mage::helper('admin')->getResetPasswordLinkExpirationPeriod(); - $currentDate = Varien_Date::now(true); + $currentDate = Varien_Date::now(); $currentTimestamp = Varien_Date::toTimestamp($currentDate); $tokenTimestamp = Varien_Date::toTimestamp($resetPasswordLinkTokenCreatedAt); if ($tokenTimestamp > $currentTimestamp) { diff --git a/app/code/core/Mage/Admin/etc/config.xml b/app/code/core/Mage/Admin/etc/config.xml index 8446743297..651f398f2b 100644 --- a/app/code/core/Mage/Admin/etc/config.xml +++ b/app/code/core/Mage/Admin/etc/config.xml @@ -79,7 +79,7 @@ admin_emails_forgot_email_template general - 3 + 1 diff --git a/app/code/core/Mage/Admin/sql/admin_setup/install-1.6.0.0.php b/app/code/core/Mage/Admin/sql/admin_setup/install-1.6.0.0.php index fd167fd6f3..f222ff2398 100644 --- a/app/code/core/Mage/Admin/sql/admin_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Admin/sql/admin_setup/install-1.6.0.0.php @@ -41,8 +41,8 @@ 'primary' => true, ), 'Assert ID') ->addColumn('assert_type', Varien_Db_Ddl_Table::TYPE_TEXT, 20, array( - 'nullable' => false, - 'default' => '', + 'nullable' => true, + 'default' => null, ), 'Assert Type') ->addColumn('assert_data', Varien_Db_Ddl_Table::TYPE_TEXT, '64k', array( ), 'Assert Data') @@ -85,8 +85,8 @@ 'default' => '0', ), 'User ID') ->addColumn('role_name', Varien_Db_Ddl_Table::TYPE_TEXT, 50, array( - 'nullable' => false, - 'default' => '', + 'nullable' => true, + 'default' => null, ), 'Role Name') ->addIndex($installer->getIdxName('admin/role', array('parent_id', 'sort_order')), array('parent_id', 'sort_order')) @@ -112,8 +112,8 @@ 'default' => '0', ), 'Role ID') ->addColumn('resource_id', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array( - 'nullable' => false, - 'default' => '', + 'nullable' => true, + 'default' => null, ), 'Resource ID') ->addColumn('privileges', Varien_Db_Ddl_Table::TYPE_TEXT, 20, array( 'nullable' => true, diff --git a/app/code/core/Mage/AdminNotification/Helper/Data.php b/app/code/core/Mage/AdminNotification/Helper/Data.php index d7214748bd..a1b7b9a8e8 100644 --- a/app/code/core/Mage/AdminNotification/Helper/Data.php +++ b/app/code/core/Mage/AdminNotification/Helper/Data.php @@ -129,6 +129,8 @@ public function isReadablePopupObject() $this->_popupReadable = true; } } + + $curl->close(); } return $this->_popupReadable; } diff --git a/app/code/core/Mage/AdminNotification/Model/Survey.php b/app/code/core/Mage/AdminNotification/Model/Survey.php index b9bb7431b1..14c43fda6c 100644 --- a/app/code/core/Mage/AdminNotification/Model/Survey.php +++ b/app/code/core/Mage/AdminNotification/Model/Survey.php @@ -50,6 +50,8 @@ public static function isSurveyUrlValid() $curl->setConfig(array('timeout' => 5)) ->write(Zend_Http_Client::GET, self::getSurveyUrl(), '1.0'); $response = $curl->read(); + $curl->close(); + if (Zend_Http_Response::extractCode($response) == 200) { return true; } diff --git a/app/code/core/Mage/Adminhtml/Block/Api/Tab/Rolesedit.php b/app/code/core/Mage/Adminhtml/Block/Api/Tab/Rolesedit.php index d38cc618be..478f257fa7 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/Tab/Rolesedit.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/Tab/Rolesedit.php @@ -38,7 +38,9 @@ public function __construct() { $selrids = array(); foreach ($rules_set->getItems() as $item) { - if (array_key_exists(strtolower($item->getResource_id()), $resources) && $item->getPermission() == 'allow') { + if (array_key_exists(strtolower($item->getResource_id()), $resources) + && $item->getApiPermission() == 'allow') + { $resources[$item->getResource_id()]['checked'] = true; array_push($selrids, $item->getResource_id()); } diff --git a/app/code/core/Mage/Adminhtml/Block/Backup.php b/app/code/core/Mage/Adminhtml/Block/Backup.php index 25b0a7ea9d..9e3b484244 100644 --- a/app/code/core/Mage/Adminhtml/Block/Backup.php +++ b/app/code/core/Mage/Adminhtml/Block/Backup.php @@ -31,14 +31,14 @@ * @package Mage_Adminhtml * @author Magento Core Team */ - class Mage_Adminhtml_Block_Backup extends Mage_Adminhtml_Block_Template { - public function __construct() - { - parent::__construct(); - $this->setTemplate('backup/list.phtml'); - } + /** + * Block's template + * + * @var string + */ + protected $_template = 'backup/list.phtml'; protected function _prepareLayout() { @@ -46,14 +46,32 @@ protected function _prepareLayout() $this->setChild('createButton', $this->getLayout()->createBlock('adminhtml/widget_button') ->setData(array( - 'label' => Mage::helper('backup')->__('Create Backup'), - 'onclick' => "window.location.href='" . $this->getUrl('*/*/create') . "'", + 'label' => Mage::helper('backup')->__('Database Backup'), + 'onclick' => "return backup.backup('" . Mage_Backup_Helper_Data::TYPE_DB . "')", 'class' => 'task' )) ); + $this->setChild('createSnapshotButton', + $this->getLayout()->createBlock('adminhtml/widget_button') + ->setData(array( + 'label' => Mage::helper('backup')->__('System Backup'), + 'onclick' => "return backup.backup('" . Mage_Backup_Helper_Data::TYPE_SYSTEM_SNAPSHOT . "')", + 'class' => '' + )) + ); + $this->setChild('createMediaBackupButton', + $this->getLayout()->createBlock('adminhtml/widget_button') + ->setData(array( + 'label' => Mage::helper('backup')->__('Database and Media Backup'), + 'onclick' => "return backup.backup('" . Mage_Backup_Helper_Data::TYPE_MEDIA . "')", + 'class' => '' + )) + ); $this->setChild('backupsGrid', $this->getLayout()->createBlock('adminhtml/backup_grid') ); + + $this->setChild('dialogs', $this->getLayout()->createBlock('adminhtml/backup_dialogs')); } public function getCreateButtonHtml() @@ -61,8 +79,38 @@ public function getCreateButtonHtml() return $this->getChildHtml('createButton'); } + /** + * Generate html code for "Create System Snapshot" button + * + * @return string + */ + public function getCreateSnapshotButtonHtml() + { + return $this->getChildHtml('createSnapshotButton'); + } + + /** + * Generate html code for "Create Media Backup" button + * + * @return string + */ + public function getCreateMediaBackupButtonHtml() + { + return $this->getChildHtml('createMediaBackupButton'); + } + public function getGridHtml() { return $this->getChildHtml('backupsGrid'); } + + /** + * Generate html code for pop-up messages that will appear when user click on "Rollback" link + * + * @return string + */ + public function getDialogsHtml() + { + return $this->getChildHtml('dialogs'); + } } diff --git a/app/code/core/Mage/Adminhtml/Block/Backup/Dialogs.php b/app/code/core/Mage/Adminhtml/Block/Backup/Dialogs.php new file mode 100644 index 0000000000..21f57799e5 --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Block/Backup/Dialogs.php @@ -0,0 +1,53 @@ + + */ +class Mage_Adminhtml_Block_Backup_Dialogs extends Mage_Adminhtml_Block_Template +{ + /** + * Block's template + * + * @var string + */ + protected $_template = 'backup/dialogs.phtml'; + + /** + * Include backup.js file in page before rendering + * + * @see Mage_Core_Block_Abstract::_prepareLayout() + */ + protected function _prepareLayout() + { + $this->getLayout()->getBlock('head')->addJs('mage/adminhtml/backup.js'); + parent::_prepareLayout(); + } +} diff --git a/app/code/core/Mage/Adminhtml/Block/Backup/Grid.php b/app/code/core/Mage/Adminhtml/Block/Backup/Grid.php index 8b8308aa7a..bdb381c38e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Backup/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Backup/Grid.php @@ -51,8 +51,29 @@ protected function _prepareCollection() return parent::_prepareCollection(); } + /** + * Prepare mass action controls + * + * @return Mage_Adminhtml_Block_Backup_Grid + */ + protected function _prepareMassaction() + { + $this->setMassactionIdField('id'); + $this->getMassactionBlock()->setFormFieldName('ids'); + + $this->getMassactionBlock()->addItem('delete', array( + 'label'=> Mage::helper('adminhtml')->__('Delete'), + 'url' => $this->getUrl('*/*/massDelete'), + 'confirm' => Mage::helper('backup')->__('Are you sure you want to delete the selected backup(s)?') + )); + + return $this; + } + /** * Configuration of grid + * + * @return Mage_Adminhtml_Block_Backup_Grid */ protected function _prepareColumns() { @@ -68,39 +89,42 @@ protected function _prepareColumns() 'header' => Mage::helper('backup')->__('Size, Bytes'), 'index' => 'size', 'type' => 'number', - 'sortable' => false, + 'sortable' => true, 'filter' => false )); $this->addColumn('type', array( 'header' => Mage::helper('backup')->__('Type'), 'type' => 'options', - 'options' => array('db' => Mage::helper('backup')->__('DB')), + 'options' => Mage::helper('backup')->getBackupTypes(), 'index' =>'type' )); $this->addColumn('download', array( 'header' => Mage::helper('backup')->__('Download'), - 'format' => 'gz   ('.$url7zip.')', + 'format' => '$extension   ('.$url7zip.')', 'index' => 'type', 'sortable' => false, 'filter' => false )); - $this->addColumn('action', array( - 'header' => Mage::helper('backup')->__('Action'), - 'type' => 'action', - 'width' => '80px', - 'filter' => false, - 'sortable' => false, - 'actions' => array(array( - 'url' => $this->getUrl('*/*/delete', array('time' => '$time', 'type' => '$type')), - 'caption' => Mage::helper('adminhtml')->__('Delete'), - 'confirm' => Mage::helper('adminhtml')->__('Are you sure you want to do this?') - )), - 'index' => 'type', - 'sortable' => false - )); + if (Mage::helper('backup')->isRollbackAllowed()){ + $this->addColumn('action', array( + 'header' => Mage::helper('backup')->__('Action'), + 'type' => 'action', + 'width' => '80px', + 'filter' => false, + 'sortable' => false, + 'actions' => array(array( + 'url' => '#', + 'caption' => Mage::helper('backup')->__('Rollback'), + 'onclick' => 'return backup.rollback(\'$type\', \'$time\');' + )), + 'index' => 'type', + 'sortable' => false + )); + } return $this; } diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Form/Renderer/Fieldset/Element.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Form/Renderer/Fieldset/Element.php index 2fe8576125..c1f07d1a4b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Form/Renderer/Fieldset/Element.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Form/Renderer/Fieldset/Element.php @@ -31,7 +31,8 @@ * @package Mage_Adminhtml * @author Magento Core Team */ -class Mage_Adminhtml_Block_Catalog_Form_Renderer_Fieldset_Element extends Mage_Adminhtml_Block_Widget_Form_Renderer_Fieldset_Element +class Mage_Adminhtml_Block_Catalog_Form_Renderer_Fieldset_Element + extends Mage_Adminhtml_Block_Widget_Form_Renderer_Fieldset_Element { /** * Initialize block template @@ -101,8 +102,9 @@ public function usedDefault() if (!$this->getDataObject()->getExistsStoreValueFlag($attributeCode)) { return true; - } else if ($this->getElement()->getValue() == $defaultValue && - $this->getDataObject()->getStoreId() != $this->_getDefaultStoreId()) { + } else if ($this->getElement()->getValue() == $defaultValue && + $this->getDataObject()->getStoreId() != $this->_getDefaultStoreId() + ) { return false; } if ($defaultValue === false && !$this->getAttribute()->getIsRequired() && $this->getElement()->getValue()) { @@ -139,13 +141,11 @@ public function getScopeLabel() return $html; } if ($attribute->isScopeGlobal()) { - $html.= '[GLOBAL]'; - } - elseif ($attribute->isScopeWebsite()) { - $html.= '[WEBSITE]'; - } - elseif ($attribute->isScopeStore()) { - $html.= '[STORE VIEW]'; + $html .= Mage::helper('adminhtml')->__('[GLOBAL]'); + } elseif ($attribute->isScopeWebsite()) { + $html .= Mage::helper('adminhtml')->__('[WEBSITE]'); + } elseif ($attribute->isScopeStore()) { + $html .= Mage::helper('adminhtml')->__('[STORE VIEW]'); } return $html; @@ -158,7 +158,12 @@ public function getScopeLabel() */ public function getElementLabelHtml() { - return $this->getElement()->getLabelHtml(); + $element = $this->getElement(); + $label = $element->getLabel(); + if (empty($label)) { + $element->setLabel($this->__($label)); + } + return $element->getLabelHtml(); } /** diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Formset.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Formset.php index 2e2fb38f5f..5c1f274a0d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Formset.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Formset.php @@ -37,6 +37,10 @@ public function __construct() parent::__construct(); } + /** + * Prepares attribute set form + * + */ protected function _prepareForm() { $data = Mage::getModel('eav/entity_attribute_set') @@ -44,21 +48,19 @@ protected function _prepareForm() $form = new Varien_Data_Form(); $fieldset = $form->addFieldset('set_name', array('legend'=> Mage::helper('catalog')->__('Edit Set Name'))); - $fieldset->addField('attribute_set_name', 'text', - array( - 'label' => Mage::helper('catalog')->__('Name'), - 'note' => Mage::helper('catalog')->__('For internal use.'), - 'name' => 'attribute_set_name', - 'required' => true, - 'class' => 'required-entry', - 'value' => $data->getAttributeSetName() + $fieldset->addField('attribute_set_name', 'text', array( + 'label' => Mage::helper('catalog')->__('Name'), + 'note' => Mage::helper('catalog')->__('For internal use.'), + 'name' => 'attribute_set_name', + 'required' => true, + 'class' => 'required-entry validate-no-html-tags', + 'value' => $data->getAttributeSetName() )); if( !$this->getRequest()->getParam('id', false) ) { - $fieldset->addField('gotoEdit', 'hidden', - array( - 'name' => 'gotoEdit', - 'value' => '1' + $fieldset->addField('gotoEdit', 'hidden', array( + 'name' => 'gotoEdit', + 'value' => '1' )); $sets = Mage::getModel('eav/entity_attribute_set') @@ -67,13 +69,12 @@ protected function _prepareForm() ->load() ->toOptionArray(); - $fieldset->addField('skeleton_set', 'select', - array( - 'label' => Mage::helper('catalog')->__('Based On'), - 'name' => 'skeleton_set', - 'required' => true, - 'class' => 'required-entry', - 'values' => $sets, + $fieldset->addField('skeleton_set', 'select', array( + 'label' => Mage::helper('catalog')->__('Based On'), + 'name' => 'skeleton_set', + 'required' => true, + 'class' => 'required-entry', + 'values' => $sets, )); } diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Action/Attribute/Tab/Attributes.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Action/Attribute/Tab/Attributes.php index 90d3312bc6..f10283945a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Action/Attribute/Tab/Attributes.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Action/Attribute/Tab/Attributes.php @@ -79,6 +79,7 @@ protected function _getAdditionalElementTypes() { return array( 'price' => Mage::getConfig()->getBlockClassName('adminhtml/catalog_product_helper_form_price'), + 'weight' => Mage::getConfig()->getBlockClassName('adminhtml/catalog_product_helper_form_weight'), 'image' => Mage::getConfig()->getBlockClassName('adminhtml/catalog_product_helper_form_image'), 'boolean' => Mage::getConfig()->getBlockClassName('adminhtml/catalog_product_helper_form_boolean') ); diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Attributes.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Attributes.php index 603e5e4549..1d22ca2ff8 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Attributes.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Attributes.php @@ -29,69 +29,79 @@ * * @category Mage * @package Mage_Adminhtml - * @author Magento Core Team + * @author Magento Core Team */ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Attributes extends Mage_Adminhtml_Block_Catalog_Form { /** - * Load Wysiwyg on demand and Prepare layout + * Load Wysiwyg on demand and prepare layout */ protected function _prepareLayout() { parent::_prepareLayout(); - if (Mage::helper('catalog')->isModuleEnabled('Mage_Cms')) { - if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) { - $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true); - } + if (Mage::helper('catalog')->isModuleEnabled('Mage_Cms') + && Mage::getSingleton('cms/wysiwyg_config')->isEnabled() + ) { + $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true); } } + /** + * Prepare attributes form + * + * @return null + */ protected function _prepareForm() { - if ($group = $this->getGroup()) { + $group = $this->getGroup(); + if ($group) { $form = new Varien_Data_Form(); - /** - * Initialize product object as form property - * for using it in elements generation - */ + + // Initialize product object as form property to use it during elements generation $form->setDataObject(Mage::registry('product')); - $fieldset = $form->addFieldset('group_fields'.$group->getId(), - array( - 'legend'=>Mage::helper('catalog')->__($group->getAttributeGroupName()), - 'class'=>'fieldset-wide', + $fieldset = $form->addFieldset('group_fields' . $group->getId(), array( + 'legend' => Mage::helper('catalog')->__($group->getAttributeGroupName()), + 'class' => 'fieldset-wide' )); $attributes = $this->getGroupAttributes(); $this->_setFieldset($attributes, $fieldset, array('gallery')); - if ($urlKey = $form->getElement('url_key')) { + $urlKey = $form->getElement('url_key'); + if ($urlKey) { $urlKey->setRenderer( $this->getLayout()->createBlock('adminhtml/catalog_form_renderer_attribute_urlkey') ); } - if ($tierPrice = $form->getElement('tier_price')) { + $tierPrice = $form->getElement('tier_price'); + if ($tierPrice) { $tierPrice->setRenderer( $this->getLayout()->createBlock('adminhtml/catalog_product_edit_tab_price_tier') ); } - if ($recurringProfile = $form->getElement('recurring_profile')) { + $groupPrice = $form->getElement('group_price'); + if ($groupPrice) { + $groupPrice->setRenderer( + $this->getLayout()->createBlock('adminhtml/catalog_product_edit_tab_price_group') + ); + } + + $recurringProfile = $form->getElement('recurring_profile'); + if ($recurringProfile) { $recurringProfile->setRenderer( $this->getLayout()->createBlock('adminhtml/catalog_product_edit_tab_price_recurring') ); } - /** - * Add new attribute button if not image tab - */ + // Add new attribute button if it is not an image tab if (!$form->getElement('media_gallery') - && Mage::getSingleton('admin/session')->isAllowed('catalog/attributes/attributes')) { - $headerBar = $this->getLayout()->createBlock( - 'adminhtml/catalog_product_edit_tab_attributes_create' - ); + && Mage::getSingleton('admin/session')->isAllowed('catalog/attributes/attributes') + ) { + $headerBar = $this->getLayout()->createBlock('adminhtml/catalog_product_edit_tab_attributes_create'); $headerBar->getConfig() ->setTabId('group_' . $group->getId()) @@ -101,9 +111,7 @@ protected function _prepareForm() ->setTypeId($form->getDataObject()->getTypeId()) ->setProductId($form->getDataObject()->getId()); - $fieldset->setHeaderBar( - $headerBar->toHtml() - ); + $fieldset->setHeaderBar($headerBar->toHtml()); } if ($form->getElement('meta_description')) { @@ -111,9 +119,8 @@ protected function _prepareForm() } $values = Mage::registry('product')->getData(); - /** - * Set attribute default values for new product - */ + + // Set default attribute values for new product if (!Mage::registry('product')->getId()) { foreach ($attributes as $attribute) { if (!isset($values[$attribute->getAttributeCode()])) { @@ -124,7 +131,8 @@ protected function _prepareForm() if (Mage::registry('product')->hasLockedAttributes()) { foreach (Mage::registry('product')->getLockedAttributes() as $attribute) { - if ($element = $form->getElement($attribute)) { + $element = $form->getElement($attribute); + if ($element) { $element->setReadonly(true, true); } } @@ -132,16 +140,22 @@ protected function _prepareForm() $form->addValues($values); $form->setFieldNameSuffix('product'); - Mage::dispatchEvent('adminhtml_catalog_product_edit_prepare_form', array('form'=>$form)); + Mage::dispatchEvent('adminhtml_catalog_product_edit_prepare_form', array('form' => $form)); $this->setForm($form); } } + /** + * Retrieve additional element types + * + * @return array + */ protected function _getAdditionalElementTypes() { $result = array( 'price' => Mage::getConfig()->getBlockClassName('adminhtml/catalog_product_helper_form_price'), + 'weight' => Mage::getConfig()->getBlockClassName('adminhtml/catalog_product_helper_form_weight'), 'gallery' => Mage::getConfig()->getBlockClassName('adminhtml/catalog_product_helper_form_gallery'), 'image' => Mage::getConfig()->getBlockClassName('adminhtml/catalog_product_helper_form_image'), 'boolean' => Mage::getConfig()->getBlockClassName('adminhtml/catalog_product_helper_form_boolean'), @@ -150,9 +164,9 @@ protected function _getAdditionalElementTypes() $response = new Varien_Object(); $response->setTypes(array()); - Mage::dispatchEvent('adminhtml_catalog_product_edit_element_types', array('response'=>$response)); + Mage::dispatchEvent('adminhtml_catalog_product_edit_element_types', array('response' => $response)); - foreach ($response->getTypes() as $typeName=>$typeClass) { + foreach ($response->getTypes() as $typeName => $typeClass) { $result[$typeName] = $typeClass; } diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Categories.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Categories.php index 8047c61e42..f10e04f1c9 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Categories.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Categories.php @@ -29,13 +29,16 @@ * * @category Mage * @package Mage_Adminhtml - * @author Magento Core Team + * @author Magento Core Team */ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Categories extends Mage_Adminhtml_Block_Catalog_Category_Tree { protected $_categoryIds; protected $_selectedNodes = null; + /** + * Specify template to use + */ public function __construct() { parent::__construct(); @@ -62,19 +65,33 @@ public function isReadonly() return $this->getProduct()->getCategoriesReadonly(); } + /** + * Return array with category IDs which the product is assigned to + * + * @return array + */ protected function getCategoryIds() { return $this->getProduct()->getCategoryIds(); } + /** + * Forms string out of getCategoryIds() + * + * @return string + */ public function getIdsString() { return implode(',', $this->getCategoryIds()); } + /** + * Returns root node and sets 'checked' flag (if necessary) + * + * @return Varien_Data_Tree_Node + */ public function getRootNode() { -// $root = parent::getRoot(); $root = $this->getRoot(); if ($root && in_array($root->getId(), $this->getCategoryIds())) { $root->setChecked(true); @@ -82,7 +99,14 @@ public function getRootNode() return $root; } - public function getRoot($parentNodeCategory=null, $recursionLevel=3) + /** + * Returns root node + * + * @param Mage_Catalog_Model_Category|null $parentNodeCategory + * @param int $recursionLevel + * @return Varien_Data_Tree_Node + */ + public function getRoot($parentNodeCategory = null, $recursionLevel = 3) { if (!is_null($parentNodeCategory) && $parentNodeCategory->getId()) { return $this->getNode($parentNodeCategory, $recursionLevel); @@ -127,21 +151,21 @@ public function getRoot($parentNodeCategory=null, $recursionLevel=3) return $root; } - protected function _getNodeJson($node, $level=1) + /** + * Returns array with configuration of current node + * + * @param Varien_Data_Tree_Node $node + * @param int $level How deep is the node in the tree + * @return array + */ + protected function _getNodeJson($node, $level = 1) { $item = parent::_getNodeJson($node, $level); - $isParent = $this->_isParentSelectedCategory($node); - - if ($isParent) { + if ($this->_isParentSelectedCategory($node)) { $item['expanded'] = true; } -// if ($node->getLevel() > 1 && !$isParent && isset($item['children'])) { -// $item['children'] = array(); -// } - - if (in_array($node->getId(), $this->getCategoryIds())) { $item['checked'] = true; } @@ -149,23 +173,41 @@ protected function _getNodeJson($node, $level=1) if ($this->isReadonly()) { $item['disabled'] = true; } + return $item; } + /** + * Returns whether $node is a parent (not exactly direct) of a selected node + * + * @param Varien_Data_Tree_Node $node + * @return bool + */ protected function _isParentSelectedCategory($node) { - foreach ($this->_getSelectedNodes() as $selected) { - if ($selected) { - $pathIds = explode('/', $selected->getPathId()); - if (in_array($node->getId(), $pathIds)) { - return true; + $result = false; + // Contains string with all category IDs of children (not exactly direct) of the node + $allChildren = $node->getAllChildren(); + if ($allChildren) { + $selectedCategoryIds = $this->getCategoryIds(); + $allChildrenArr = explode(',', $allChildren); + for ($i = 0, $cnt = count($selectedCategoryIds); $i < $cnt; $i++) { + $isSelf = $node->getId() == $selectedCategoryIds[$i]; + if (!$isSelf && in_array($selectedCategoryIds[$i], $allChildrenArr)) { + $result = true; + break; } } } - return false; + return $result; } + /** + * Returns array with nodes those are selected (contain current product) + * + * @return array + */ protected function _getSelectedNodes() { if ($this->_selectedNodes === null) { @@ -181,6 +223,12 @@ protected function _getSelectedNodes() return $this->_selectedNodes; } + /** + * Returns JSON-encoded array of category children + * + * @param int $categoryId + * @return string + */ public function getCategoryChildrenJson($categoryId) { $category = Mage::getModel('catalog/category')->load($categoryId); @@ -198,15 +246,21 @@ public function getCategoryChildrenJson($categoryId) return Mage::helper('core')->jsonEncode($children); } - public function getLoadTreeUrl($expanded=null) + /** + * Returns URL for loading tree + * + * @param null $expanded + * @return string + */ + public function getLoadTreeUrl($expanded = null) { - return $this->getUrl('*/*/categoriesJson', array('_current'=>true)); + return $this->getUrl('*/*/categoriesJson', array('_current' => true)); } /** * Return distinct path ids of selected categories * - * @param int $rootId Root category Id for context + * @param mixed $rootId Root category Id for context * @return array */ public function getSelectedCategoriesPathIds($rootId = false) diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Group.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Group.php new file mode 100644 index 0000000000..f305e78046 --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Group.php @@ -0,0 +1,96 @@ + + */ +class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Price_Group + extends Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Price_Group_Abstract +{ + /** + * Initialize block + */ + public function __construct() + { + $this->setTemplate('catalog/product/edit/price/group.phtml'); + } + + /** + * Sort values + * + * @param array $data + * @return array + */ + protected function _sortValues($data) + { + usort($data, array($this, '_sortGroupPrices')); + return $data; + } + + /** + * Sort group price values callback method + * + * @param array $a + * @param array $b + * @return int + */ + protected function _sortGroupPrices($a, $b) + { + if ($a['website_id'] != $b['website_id']) { + return $a['website_id'] < $b['website_id'] ? -1 : 1; + } + if ($a['cust_group'] != $b['cust_group']) { + return $this->getCustomerGroups($a['cust_group']) < $this->getCustomerGroups($b['cust_group']) ? -1 : 1; + } + return 0; + } + + /** + * Prepare global layout + * + * Add "Add Group Price" button to layout + * + * @return Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Price_Group + */ + protected function _prepareLayout() + { + $button = $this->getLayout()->createBlock('adminhtml/widget_button') + ->setData(array( + 'label' => Mage::helper('catalog')->__('Add Group Price'), + 'onclick' => 'return groupPriceControl.addItem()', + 'class' => 'add' + )); + $button->setName('add_group_price_item_button'); + + $this->setChild('add_button', $button); + return parent::_prepareLayout(); + } + +} diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Group/Abstract.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Group/Abstract.php new file mode 100644 index 0000000000..89cfbe4488 --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Group/Abstract.php @@ -0,0 +1,347 @@ + + */ +abstract class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Price_Group_Abstract + extends Mage_Adminhtml_Block_Widget + implements Varien_Data_Form_Element_Renderer_Interface +{ + /** + * Form element instance + * + * @var Varien_Data_Form_Element_Abstract + */ + protected $_element; + + /** + * Customer groups cache + * + * @var array + */ + protected $_customerGroups; + + /** + * Websites cache + * + * @var array + */ + protected $_websites; + + /** + * Retrieve current product instance + * + * @return Mage_Catalog_Model_Product + */ + public function getProduct() + { + return Mage::registry('product'); + } + + /** + * Render HTML + * + * @param Varien_Data_Form_Element_Abstract $element + * @return string + */ + public function render(Varien_Data_Form_Element_Abstract $element) + { + $this->setElement($element); + return $this->toHtml(); + } + + /** + * Set form element instance + * + * @param Varien_Data_Form_Element_Abstract $element + * @return Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Price_Group_Abstract + */ + public function setElement(Varien_Data_Form_Element_Abstract $element) + { + $this->_element = $element; + return $this; + } + + /** + * Retrieve form element instance + * + * @return Varien_Data_Form_Element_Abstract + */ + public function getElement() + { + return $this->_element; + } + + /** + * Prepare group price values + * + * @return array + */ + public function getValues() + { + $values = array(); + $data = $this->getElement()->getValue(); + + if (is_array($data)) { + $values = $this->_sortValues($data); + } + + foreach ($values as &$value) { + $value['readonly'] = ($value['website_id'] == 0) + && $this->isShowWebsiteColumn() + && !$this->isAllowChangeWebsite(); + } + + return $values; + } + + /** + * Sort values + * + * @param array $data + * @return array + */ + protected function _sortValues($data) + { + return $data; + } + + /** + * Retrieve allowed customer groups + * + * @param int|null $groupId return name by customer group id + * @return array|string + */ + public function getCustomerGroups($groupId = null) + { + if ($this->_customerGroups === null) { + if (!Mage::helper('catalog')->isModuleEnabled('Mage_Customer')) { + return array(); + } + $collection = Mage::getModel('customer/group')->getCollection(); + $this->_customerGroups = $this->_getInitialCustomerGroups(); + + foreach ($collection as $item) { + /** @var $item Mage_Customer_Model_Group */ + $this->_customerGroups[$item->getId()] = $item->getCustomerGroupCode(); + } + } + + if ($groupId !== null) { + return isset($this->_customerGroups[$groupId]) ? $this->_customerGroups[$groupId] : array(); + } + + return $this->_customerGroups; + } + + /** + * Retrieve list of initial customer groups + * + * @return array + */ + protected function _getInitialCustomerGroups() + { + return array(); + } + + /** + * Retrieve number of websites + * + * @return int + */ + public function getWebsiteCount() + { + return count($this->getWebsites()); + } + + /** + * Show website column and switcher for group price table + * + * @return bool + */ + public function isMultiWebsites() + { + return !Mage::app()->isSingleStoreMode(); + } + + /** + * Retrieve allowed for edit websites + * + * @return array + */ + public function getWebsites() + { + if (!is_null($this->_websites)) { + return $this->_websites; + } + + $this->_websites = array( + 0 => array( + 'name' => Mage::helper('catalog')->__('All Websites'), + 'currency' => Mage::app()->getBaseCurrencyCode() + ) + ); + + if (!$this->isScopeGlobal() && $this->getProduct()->getStoreId()) { + /** @var $website Mage_Core_Model_Website */ + $website = Mage::app()->getStore($this->getProduct()->getStoreId())->getWebsite(); + + $this->_websites[$website->getId()] = array( + 'name' => $website->getName(), + 'currency' => $website->getBaseCurrencyCode() + ); + } elseif (!$this->isScopeGlobal()) { + $websites = Mage::app()->getWebsites(false); + $productWebsiteIds = $this->getProduct()->getWebsiteIds(); + foreach ($websites as $website) { + /** @var $website Mage_Core_Model_Website */ + if (!in_array($website->getId(), $productWebsiteIds)) { + continue; + } + $this->_websites[$website->getId()] = array( + 'name' => $website->getName(), + 'currency' => $website->getBaseCurrencyCode() + ); + } + } + + return $this->_websites; + } + + /** + * Retrieve default value for customer group + * + * @return int + */ + public function getDefaultCustomerGroup() + { + return Mage_Customer_Model_Group::CUST_GROUP_ALL; + } + + /** + * Retrieve default value for website + * + * @return int + */ + public function getDefaultWebsite() + { + if ($this->isShowWebsiteColumn() && !$this->isAllowChangeWebsite()) { + return Mage::app()->getStore($this->getProduct()->getStoreId())->getWebsiteId(); + } + return 0; + } + + /** + * Retrieve 'add group price item' button HTML + * + * @return string + */ + public function getAddButtonHtml() + { + return $this->getChildHtml('add_button'); + } + + /** + * Retrieve customized price column header + * + * @param string $default + * @return string + */ + public function getPriceColumnHeader($default) + { + if ($this->hasData('price_column_header')) { + return $this->getData('price_column_header'); + } else { + return $default; + } + } + + /** + * Retrieve customized price column header + * + * @param string $default + * @return string + */ + public function getPriceValidation($default) + { + if ($this->hasData('price_validation')) { + return $this->getData('price_validation'); + } else { + return $default; + } + } + + /** + * Retrieve Group Price entity attribute + * + * @return Mage_Catalog_Model_Resource_Eav_Attribute + */ + public function getAttribute() + { + return $this->getElement()->getEntityAttribute(); + } + + /** + * Check group price attribute scope is global + * + * @return bool + */ + public function isScopeGlobal() + { + return $this->getAttribute()->isScopeGlobal(); + } + + /** + * Show group prices grid website column + * + * @return bool + */ + public function isShowWebsiteColumn() + { + if ($this->isScopeGlobal() || Mage::app()->isSingleStoreMode()) { + return false; + } + return true; + } + + /** + * Check is allow change website value for combination + * + * @return bool + */ + public function isAllowChangeWebsite() + { + if (!$this->isShowWebsiteColumn() || $this->getProduct()->getStoreId()) { + return false; + } + return true; + } +} diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Tier.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Tier.php index bc048fc300..084b703704 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Tier.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Tier.php @@ -32,33 +32,11 @@ * @author Magento Core Team */ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Price_Tier - extends Mage_Adminhtml_Block_Widget - implements Varien_Data_Form_Element_Renderer_Interface + extends Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Price_Group_Abstract { - /** - * Form element instance - * - * @var Varien_Data_Form_Element - */ - protected $_element; /** - * Customer Groups cache - * - * @var array - */ - protected $_customerGroups; - - /** - * Websites cache - * - * @var array - */ - protected $_websites; - - /** - * Define tier price template file - * + * Initialize block */ public function __construct() { @@ -66,69 +44,25 @@ public function __construct() } /** - * Retrieve current edit product instance - * - * @return Mage_Catalog_Model_Product - */ - public function getProduct() - { - return Mage::registry('product'); - } - - /** - * Render HTML + * Retrieve list of initial customer groups * - * @param Varien_Data_Form_Element_Abstract $element - * @return string - */ - public function render(Varien_Data_Form_Element_Abstract $element) - { - $this->setElement($element); - return $this->toHtml(); - } - - /** - * Set form element instance - * - * @param Varien_Data_Form_Element_Abstract $element - * @return Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Price_Tier - */ - public function setElement(Varien_Data_Form_Element_Abstract $element) - { - $this->_element = $element; - return $this; - } - - /** - * Retrieve form element instance - * - * @return Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Price_Tier + * @return array */ - public function getElement() + protected function _getInitialCustomerGroups() { - return $this->_element; + return array(Mage_Customer_Model_Group::CUST_GROUP_ALL => Mage::helper('catalog')->__('ALL GROUPS')); } /** - * Prepare Tier Price values + * Sort values * + * @param array $data * @return array */ - public function getValues() + protected function _sortValues($data) { - $values = array(); - $data = $this->getElement()->getValue(); - - if (is_array($data)) { - usort($data, array($this, '_sortTierPrices')); - $values = $data; - } - - foreach ($values as &$v) { - $v['readonly'] = $v['website_id'] == 0 && $this->isShowWebsiteColumn() && !$this->isAllowChangeWebsite(); - } - - return $values; + usort($data, array($this, '_sortTierPrices')); + return $data; } /** @@ -153,123 +87,6 @@ protected function _sortTierPrices($a, $b) return 0; } - /** - * Retrieve allowed customer groups - * - * @param int $groupId return name by customer group id - * @return array|string - */ - public function getCustomerGroups($groupId = null) - { - if ($this->_customerGroups === null) { - if (!Mage::helper('catalog')->isModuleEnabled('Mage_Customer')) { - return array(); - } - $collection = Mage::getModel('customer/group')->getCollection(); - $this->_customerGroups = array( - Mage_Customer_Model_Group::CUST_GROUP_ALL => Mage::helper('catalog')->__('ALL GROUPS') - ); - - foreach ($collection as $item) { - /* @var $item Mage_Customer_Model_Group */ - $this->_customerGroups[$item->getId()] = $item->getCustomerGroupCode(); - } - } - - if ($groupId !== null) { - return isset($this->_customerGroups[$groupId]) ? $this->_customerGroups[$groupId] : array(); - } - - return $this->_customerGroups; - } - - /** - * Retrieve count of websites - * - * @return int - */ - public function getWebsiteCount() - { - return count($this->getWebsites()); - } - - /** - * Show Website column and switcher for tier price table - * - * @return bool - */ - public function isMultiWebsites() - { - return !Mage::app()->isSingleStoreMode(); - } - - /** - * Retrieve allowed for edit websites - * - * @return array - */ - public function getWebsites() - { - if (!is_null($this->_websites)) { - return $this->_websites; - } - - $this->_websites = array( - 0 => array( - 'name' => Mage::helper('catalog')->__('All Websites'), - 'currency' => Mage::app()->getBaseCurrencyCode() - ) - ); - - if (!$this->isScopeGlobal() && $this->getProduct()->getStoreId()) { - /* @var $website Mage_Core_Model_Website */ - $website = Mage::app()->getStore($this->getProduct()->getStoreId())->getWebsite(); - - $this->_websites[$website->getId()] = array( - 'name' => $website->getName(), - 'currency' => $website->getBaseCurrencyCode() - ); - } else if (!$this->isScopeGlobal()) { - $websites = Mage::app()->getWebsites(false); - $productWebsiteIds = $this->getProduct()->getWebsiteIds(); - foreach ($websites as $website) { - /* @var $website Mage_Core_Model_Website */ - if (!in_array($website->getId(), $productWebsiteIds)) { - continue; - } - $this->_websites[$website->getId()] = array( - 'name' => $website->getName(), - 'currency' => $website->getBaseCurrencyCode() - ); - } - } - - return $this->_websites; - } - - /** - * Retrieve default value for customer group - * - * @return int - */ - public function getDefaultCustomerGroup() - { - return Mage_Customer_Model_Group::CUST_GROUP_ALL; - } - - /** - * Retrieve default value for website - * - * @return int - */ - public function getDefaultWebsite() - { - if ($this->isShowWebsiteColumn() && !$this->isAllowChangeWebsite()) { - return Mage::app()->getStore($this->getProduct()->getStoreId())->getWebsiteId(); - } - return 0; - } - /** * Prepare global layout * Add "Add tier" button to layout @@ -280,9 +97,9 @@ protected function _prepareLayout() { $button = $this->getLayout()->createBlock('adminhtml/widget_button') ->setData(array( - 'label' => Mage::helper('catalog')->__('Add Tier'), - 'onclick' => 'return tierPriceControl.addItem()', - 'class' => 'add' + 'label' => Mage::helper('catalog')->__('Add Tier'), + 'onclick' => 'return tierPriceControl.addItem()', + 'class' => 'add' )); $button->setName('add_tier_price_item_button'); @@ -290,93 +107,4 @@ protected function _prepareLayout() return parent::_prepareLayout(); } - /** - * Retrieve Add Tier Price Item button HTML - * - * @return string - */ - public function getAddButtonHtml() - { - return $this->getChildHtml('add_button'); - } - - /** - * Returns customized price column header - * that was seted through set... - * - * @param string $default - * @return string - */ - public function getPriceColumnHeader($default) - { - if ($this->hasData('price_column_header')) { - return $this->getData('price_column_header'); - } else { - return $default; - } - } - - /** - * Returns customized price column header - * that was seted through set... - * - * @param string $default - * @return string - */ - public function getPriceValidation($default) - { - if ($this->hasData('price_validation')) { - return $this->getData('price_validation'); - } else { - return $default; - } - } - - /** - * Retrieve Tier Price entity attribute - * - * @return Mage_Catalog_Model_Resource_Eav_Attribute - */ - public function getAttribute() - { - return $this->getElement()->getEntityAttribute(); - } - - /** - * Check tier price attribute scope is global - * - * @return bool - */ - public function isScopeGlobal() - { - return $this->getAttribute()->isScopeGlobal(); - } - - /** - * Show tier prices grid website column - * - * @return bool - */ - public function isShowWebsiteColumn() - { - if ($this->isScopeGlobal()) { - return false; - } else if (Mage::app()->isSingleStoreMode()) { - return false; - } - return true; - } - - /** - * Check is allow change website value for combination - * - * @return bool - */ - public function isAllowChangeWebsite() - { - if (!$this->isShowWebsiteColumn() || $this->getProduct()->getStoreId()) { - return false; - } - return true; - } } diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config.php index 31a6a229ee..19a5dd01a8 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config.php @@ -66,7 +66,28 @@ public function getTabClass() */ public function isReadonly() { - return $this->_getProduct()->getCompositeReadonly(); + return (bool) $this->_getProduct()->getCompositeReadonly(); + } + + /** + * Check whether attributes of configurable products can be editable + * + * @return boolean + */ + public function isAttributesConfigurationReadonly() + { + return (bool) $this->_getProduct()->getAttributesConfigurationReadonly(); + } + + /** + * Check whether prices of configurable products can be editable + * + * @return boolean + */ + public function isAttributesPricesReadonly() + { + return $this->_getProduct()->getAttributesConfigurationReadonly() || + (Mage::helper('catalog')->isPriceGlobal() && $this->isReadonly()); } /** diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Simple.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Simple.php index f37f5ed297..e9bc8ac3ff 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Simple.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Simple.php @@ -31,7 +31,8 @@ * @package Mage_Adminhtml * @author Magento Core Team */ -class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Config_Simple extends Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Attributes +class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Config_Simple + extends Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Attributes { /** * Link to currently editing product @@ -56,7 +57,7 @@ protected function _prepareForm() 'additional' => array('name', 'sku', 'visibility', 'status') ); - $availableTypes = array('text', 'select', 'multiselect', 'textarea', 'price'); + $availableTypes = array('text', 'select', 'multiselect', 'textarea', 'price', 'weight'); $attributes = Mage::getModel('catalog/product') ->setTypeId(Mage_Catalog_Model_Product_Type::TYPE_SIMPLE) @@ -70,10 +71,12 @@ protected function _prepareForm() // If not applied to configurable && !in_array(Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE, $attribute->getApplyTo()) // If not used in configurable - && !in_array($attribute->getId(),$this->_getProduct()->getTypeInstance(true)->getUsedProductAttributeIds($this->_getProduct()))) + && !in_array($attribute->getId(), + $this->_getProduct()->getTypeInstance(true)->getUsedProductAttributeIds($this->_getProduct())) + ) // Or in additional - || in_array($attribute->getAttributeCode(), $attributesConfig['additional'])) { - + || in_array($attribute->getAttributeCode(), $attributesConfig['additional']) + ) { $inputType = $attribute->getFrontend()->getInputType(); if (!in_array($inputType, $availableTypes)) { continue; @@ -112,7 +115,8 @@ protected function _prepareForm() } /* Configurable attributes */ - foreach ($this->_getProduct()->getTypeInstance(true)->getUsedProductAttributes($this->_getProduct()) as $attribute) { + $usedAttributes = $this->_getProduct()->getTypeInstance(true)->getUsedProductAttributes($this->_getProduct()); + foreach ($usedAttributes as $attribute) { $attributeCode = $attribute->getAttributeCode(); $fieldset->addField( 'simple_product_' . $attributeCode, 'select', array( 'label' => $attribute->getFrontend()->getLabel(), @@ -176,8 +180,6 @@ protected function _prepareForm() ) )); - - $this->setForm($form); } diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Grid.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Grid.php index 29699db2ab..25cb6473e5 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Grid.php @@ -73,11 +73,46 @@ protected function _prepareCollection() //$collection->setStoreId($store->getId()); $adminStore = Mage_Core_Model_App::ADMIN_STORE_ID; $collection->addStoreFilter($store); - $collection->joinAttribute('name', 'catalog_product/name', 'entity_id', null, 'inner', $adminStore); - $collection->joinAttribute('custom_name', 'catalog_product/name', 'entity_id', null, 'inner', $store->getId()); - $collection->joinAttribute('status', 'catalog_product/status', 'entity_id', null, 'inner', $store->getId()); - $collection->joinAttribute('visibility', 'catalog_product/visibility', 'entity_id', null, 'inner', $store->getId()); - $collection->joinAttribute('price', 'catalog_product/price', 'entity_id', null, 'left', $store->getId()); + $collection->joinAttribute( + 'name', + 'catalog_product/name', + 'entity_id', + null, + 'inner', + $adminStore + ); + $collection->joinAttribute( + 'custom_name', + 'catalog_product/name', + 'entity_id', + null, + 'inner', + $store->getId() + ); + $collection->joinAttribute( + 'status', + 'catalog_product/status', + 'entity_id', + null, + 'inner', + $store->getId() + ); + $collection->joinAttribute( + 'visibility', + 'catalog_product/visibility', + 'entity_id', + null, + 'inner', + $store->getId() + ); + $collection->joinAttribute( + 'price', + 'catalog_product/price', + 'entity_id', + null, + 'left', + $store->getId() + ); } else { $collection->addAttributeToSelect('price'); @@ -273,6 +308,7 @@ protected function _prepareMassaction() )); } + Mage::dispatchEvent('adminhtml_catalog_product_grid_prepare_massaction', array('block' => $this)); return $this; } diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Gallery.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Gallery.php index 117ff858aa..f3a0a6d8bb 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Gallery.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Gallery.php @@ -92,7 +92,7 @@ public function usedDefault($attribute) if (!$this->getDataObject()->getExistsStoreValueFlag($attributeCode)) { return true; - } else if ($this->getValue() == $defaultValue && + } else if ($this->getValue() == $defaultValue && $this->getDataObject()->getStoreId() != $this->_getDefaultStoreId()) { return false; } @@ -118,13 +118,11 @@ public function getScopeLabel($attribute) } if ($attribute->isScopeGlobal()) { - $html.= '
[GLOBAL]'; - } - elseif ($attribute->isScopeWebsite()) { - $html.= '
[WEBSITE]'; - } - elseif ($attribute->isScopeStore()) { - $html.= '
[STORE VIEW]'; + $html .= '
' . Mage::helper('adminhtml')->__('[GLOBAL]'); + } elseif ($attribute->isScopeWebsite()) { + $html .= '
' . Mage::helper('adminhtml')->__('[WEBSITE]'); + } elseif ($attribute->isScopeStore()) { + $html .= '
' . Mage::helper('adminhtml')->__('[STORE VIEW]'); } return $html; } diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Weight.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Weight.php new file mode 100644 index 0000000000..cd2819c8b8 --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Weight.php @@ -0,0 +1,45 @@ + + */ +class Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Weight extends Varien_Data_Form_Element_Text +{ + /* + * Add validate-zero-or-greater css class to weigh field + * for input validation + */ + public function __construct($attributes=array()) + { + parent::__construct($attributes); + $this->addClass('validate-zero-or-greater'); + } +} diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Widget/Chooser.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Widget/Chooser.php index b986a9d212..37e25698a3 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Widget/Chooser.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Widget/Chooser.php @@ -100,8 +100,8 @@ public function prepareElementHtml(Varien_Data_Form_Element_Abstract $element) public function getCheckboxCheckCallback() { if ($this->getUseMassaction()) { - return "function (grid, event) { - $(grid.containerId).fire('product:changed', {}); + return "function (grid, element) { + $(grid.containerId).fire('product:changed', {element: element}); }"; } } diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Search/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Search/Edit/Form.php index 74d01c7022..bec9f801df 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Search/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Search/Edit/Form.php @@ -104,48 +104,41 @@ protected function _prepareForm() if ($model->getId()) { $fieldset->addField('num_results', 'text', array( - 'name' => 'num_results', - 'label' => Mage::helper('catalog')->__('Number of results
(For the last time placed)'), - 'title' => Mage::helper('catalog')->__('Number of results
(For the last time placed)'), - 'required' => true, + 'name' => 'num_results', + 'label' => Mage::helper('catalog')->__('Number of results'), + 'title' => Mage::helper('catalog')->__('Number of results (For the last time placed)'), + 'note' => Mage::helper('catalog')->__('For the last time placed.'), + 'required' => true, )); $fieldset->addField('popularity', 'text', array( - 'name' => 'popularity', - 'label' => Mage::helper('catalog')->__('Number of Uses'), - 'title' => Mage::helper('catalog')->__('Number of Uses'), - 'required' => true, + 'name' => 'popularity', + 'label' => Mage::helper('catalog')->__('Number of Uses'), + 'title' => Mage::helper('catalog')->__('Number of Uses'), + 'required' => true, )); } - $afterElementHtml = '

' - . Mage::helper('catalog')->__('(Will make search for the query above return results for this search.)') - . '

'; - $fieldset->addField('synonym_for', 'text', array( - 'name' => 'synonym_for', - 'label' => Mage::helper('catalog')->__('Synonym For'), - 'title' => Mage::helper('catalog')->__('Synonym For'), - 'after_element_html' => $afterElementHtml, + 'name' => 'synonym_for', + 'label' => Mage::helper('catalog')->__('Synonym For'), + 'title' => Mage::helper('catalog')->__('Synonym For'), + 'note' => Mage::helper('catalog')->__('Will make search for the query above return results for this search.'), )); - $afterElementHtml = '

' - . Mage::helper('catalog')->__('ex. http://domain.com') - . '

'; - $fieldset->addField('redirect', 'text', array( - 'name' => 'redirect', - 'label' => Mage::helper('catalog')->__('Redirect URL'), - 'title' => Mage::helper('catalog')->__('Redirect URL'), - 'class' => 'validate-url', - 'after_element_html' => $afterElementHtml, + 'name' => 'redirect', + 'label' => Mage::helper('catalog')->__('Redirect URL'), + 'title' => Mage::helper('catalog')->__('Redirect URL'), + 'class' => 'validate-url', + 'note' => Mage::helper('catalog')->__('ex. http://domain.com'), )); $fieldset->addField('display_in_terms', 'select', array( - 'name' => 'display_in_terms', - 'label' => Mage::helper('catalog')->__('Display in Suggested Terms'), - 'title' => Mage::helper('catalog')->__('Display in Suggested Terms'), - 'values' => $yesno, + 'name' => 'display_in_terms', + 'label' => Mage::helper('catalog')->__('Display in Suggested Terms'), + 'title' => Mage::helper('catalog')->__('Display in Suggested Terms'), + 'values' => $yesno, )); $form->setValues($model->getData()); diff --git a/app/code/core/Mage/Adminhtml/Block/Checkout/Agreement.php b/app/code/core/Mage/Adminhtml/Block/Checkout/Agreement.php index 8e27585e2e..ec788e8e95 100644 --- a/app/code/core/Mage/Adminhtml/Block/Checkout/Agreement.php +++ b/app/code/core/Mage/Adminhtml/Block/Checkout/Agreement.php @@ -37,7 +37,7 @@ class Mage_Adminhtml_Block_Checkout_Agreement extends Mage_Adminhtml_Block_Widge public function __construct() { $this->_controller = 'checkout_agreement'; - $this->_headerText = Mage::helper('checkout')->__('Manage Checkout Terms and Conditions'); + $this->_headerText = Mage::helper('checkout')->__('Manage Terms and Conditions'); $this->_addButtonLabel = Mage::helper('checkout')->__('Add New Condition'); parent::__construct(); } diff --git a/app/code/core/Mage/Adminhtml/Block/Checkout/Agreement/Edit.php b/app/code/core/Mage/Adminhtml/Block/Checkout/Agreement/Edit.php index b433304825..216c4490d1 100644 --- a/app/code/core/Mage/Adminhtml/Block/Checkout/Agreement/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Checkout/Agreement/Edit.php @@ -60,7 +60,7 @@ public function getHeaderText() return Mage::helper('checkout')->__('Edit Terms and Conditions'); } else { - return Mage::helper('checkout')->__('New Condition'); + return Mage::helper('checkout')->__('New Terms and Conditions'); } } } diff --git a/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit.php b/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit.php index 89f40cc9e7..3f592c1585 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit.php @@ -29,14 +29,18 @@ * * @category Mage * @package Mage_Adminhtml - * @author Magento Core Team + * @author Magento Core Team */ class Mage_Adminhtml_Block_Cms_Page_Edit extends Mage_Adminhtml_Block_Widget_Form_Container { - + /** + * Initialize cms page edit block + * + * @return void + */ public function __construct() { - $this->_objectId = 'page_id'; + $this->_objectId = 'page_id'; $this->_controller = 'cms_page'; parent::__construct(); @@ -57,7 +61,6 @@ public function __construct() } else { $this->_removeButton('delete'); } - } /** @@ -95,24 +98,26 @@ protected function _isAllowedAction($action) protected function _getSaveAndContinueUrl() { return $this->getUrl('*/*/save', array( - '_current' => true, - 'back' => 'edit', - 'active_tab' => '{{tab_id}}' + '_current' => true, + 'back' => 'edit', + 'active_tab' => '{{tab_id}}' )); } /** - * @see Mage_Adminhtml_Block_Widget_Container::_prepareLayout() + * Prepare layout + * + * @return Mage_Core_Block_Abstract */ protected function _prepareLayout() { $tabsBlock = $this->getLayout()->getBlock('cms_page_edit_tabs'); if ($tabsBlock) { $tabsBlockJsObject = $tabsBlock->getJsObjectName(); - $tabsBlockPrefix = $tabsBlock->getId() . '_'; + $tabsBlockPrefix = $tabsBlock->getId() . '_'; } else { $tabsBlockJsObject = 'page_tabsJsTabs'; - $tabsBlockPrefix = 'page_tabs_'; + $tabsBlockPrefix = 'page_tabs_'; } $this->_formScripts[] = " @@ -137,6 +142,4 @@ function saveAndContinueEdit(urlTemplate) { "; return parent::_prepareLayout(); } - - } diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Renderer/Attribute/Group.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Renderer/Attribute/Group.php new file mode 100644 index 0000000000..bd6a631514 --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Renderer/Attribute/Group.php @@ -0,0 +1,105 @@ + + */ +class Mage_Adminhtml_Block_Customer_Edit_Renderer_Attribute_Group + extends Mage_Adminhtml_Block_Widget_Form_Renderer_Fieldset_Element +{ + /** + * Override parent constructor just for setting custom template + */ + protected function _construct() + { + parent::_construct(); + $this->setTemplate('customer/edit/tab/account/form/renderer/group.phtml'); + } + + /** + * Retrieve disable auto group change element HTML ID + * + * @return string + */ + protected function _getDisableAutoGroupChangeElementHtmlId() + { + return $this->getDisableAutoGroupChangeAttribute()->getAttributeCode(); + } + + /** + * Retrieve disable auto group change checkbox label text + * + * @return string + */ + public function getDisableAutoGroupChangeCheckboxLabel() + { + return Mage::helper('customer')->__($this->getDisableAutoGroupChangeAttribute()->getFrontend()->getLabel()); + } + + /** + * Retrieve disable auto group change checkbox state + * + * @return string + */ + public function getDisableAutoGroupChangeCheckboxState() + { + $customer = Mage::registry('current_customer'); + $checkedByDefault = ($customer && $customer->getId()) + ? false : Mage::helper('customer/address')->getDisableAutoGroupAssignDefaultValue(); + + $value = $this->getDisableAutoGroupChangeAttributeValue(); + $state = ''; + if (!empty($value) || $checkedByDefault) { + $state = 'checked'; + } + return $state; + } + + /** + * Retrieve disable auto group change checkbox element HTML NAME + * + * @return string + */ + public function getDisableAutoGroupChangeCheckboxElementName() + { + return $this->getElement()->getForm()->getFieldNameSuffix() + . '[' . $this->_getDisableAutoGroupChangeElementHtmlId() . ']'; + } + + /** + * Retrieve disable auto group change checkbox element HTML ID + * + * @return string + */ + public function getDisableAutoGroupChangeCheckboxElementId() + { + return $this->_getDisableAutoGroupChangeElementHtmlId(); + } +} diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Account.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Account.php index 0776993c84..8e33cc0ffd 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Account.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Account.php @@ -33,11 +33,19 @@ */ class Mage_Adminhtml_Block_Customer_Edit_Tab_Account extends Mage_Adminhtml_Block_Widget_Form { + /** + * Initialize block + */ public function __construct() { parent::__construct(); } + /** + * Initialize form + * + * @return Mage_Adminhtml_Block_Customer_Edit_Tab_Account + */ public function initForm() { $form = new Varien_Data_Form(); @@ -46,36 +54,60 @@ public function initForm() $customer = Mage::registry('current_customer'); - /* @var $customerForm Mage_Customer_Model_Form */ + /** @var $customerForm Mage_Customer_Model_Form */ $customerForm = Mage::getModel('customer/form'); $customerForm->setEntity($customer) ->setFormCode('adminhtml_customer') ->initDefaultValues(); - $fieldset = $form->addFieldset('base_fieldset', - array('legend'=>Mage::helper('customer')->__('Account Information')) - ); + $fieldset = $form->addFieldset('base_fieldset', array( + 'legend' => Mage::helper('customer')->__('Account Information') + )); $attributes = $customerForm->getAttributes(); foreach ($attributes as $attribute) { $attribute->unsIsVisible(); } - $this->_setFieldset($attributes, $fieldset); + + $disableAutoGroupChangeAttributeName = 'disable_auto_group_change'; + $this->_setFieldset($attributes, $fieldset, array($disableAutoGroupChangeAttributeName)); + + $form->getElement('group_id')->setRenderer($this->getLayout() + ->createBlock('adminhtml/customer_edit_renderer_attribute_group') + ->setDisableAutoGroupChangeAttribute($customerForm->getAttribute($disableAutoGroupChangeAttributeName)) + ->setDisableAutoGroupChangeAttributeValue($customer->getData($disableAutoGroupChangeAttributeName))); if ($customer->getId()) { $form->getElement('website_id')->setDisabled('disabled'); $form->getElement('created_in')->setDisabled('disabled'); } else { $fieldset->removeField('created_in'); - } + $form->getElement('website_id')->addClass('validate-website-has-store'); -// if (Mage::app()->isSingleStoreMode()) { -// $fieldset->removeField('website_id'); -// $fieldset->addField('website_id', 'hidden', array( -// 'name' => 'website_id' -// )); -// $customer->setWebsiteId(Mage::app()->getStore(true)->getWebsiteId()); -// } + $websites = array(); + foreach (Mage::app()->getWebsites(true) as $website) { + $websites[$website->getId()] = !is_null($website->getDefaultStore()); + } + $prefix = $form->getHtmlIdPrefix(); + + $form->getElement('website_id')->setAfterElementHtml( + '' + ); + } $customerStoreId = null; if ($customer->getId()) { @@ -119,10 +151,10 @@ public function initForm() if ($customer->getId()) { if (!$customer->isReadonly()) { - // add password management fieldset + // Add password management fieldset $newFieldset = $form->addFieldset( 'password_fieldset', - array('legend'=>Mage::helper('customer')->__('Password Management')) + array('legend' => Mage::helper('customer')->__('Password Management')) ); // New customer password $field = $newFieldset->addField('new_password', 'text', @@ -134,7 +166,7 @@ public function initForm() ); $field->setRenderer($this->getLayout()->createBlock('adminhtml/customer_edit_renderer_newpass')); - // prepare customer confirmation control (only for existing customers) + // Prepare customer confirmation control (only for existing customers) $confirmationKey = $customer->getConfirmation(); if ($confirmationKey || $customer->isConfirmationRequired()) { $confirmationAttribute = $customer->getAttribute('confirmation'); @@ -147,8 +179,8 @@ public function initForm() ))->setEntityAttribute($confirmationAttribute) ->setValues(array('' => 'Confirmed', $confirmationKey => 'Not confirmed')); - // prepare send welcome email checkbox, if customer is not confirmed - // no need to add it, if website id is empty + // Prepare send welcome email checkbox if customer is not confirmed + // no need to add it, if website ID is empty if ($customer->getConfirmation() && $customer->getWebsiteId()) { $fieldset->addField('sendemail', 'checkbox', array( 'name' => 'sendemail', @@ -173,7 +205,7 @@ public function initForm() ); $field->setRenderer($this->getLayout()->createBlock('adminhtml/customer_edit_renderer_newpass')); - // prepare send welcome email checkbox + // Prepare send welcome email checkbox $fieldset->addField('sendemail', 'checkbox', array( 'label' => Mage::helper('customer')->__('Send Welcome Email'), 'name' => 'sendemail', @@ -189,7 +221,7 @@ public function initForm() } } - // make sendemail and sendmail_store_id disabled, if website_id has empty value + // Make sendemail and sendmail_store_id disabled if website_id has empty value $isSingleMode = Mage::app()->isSingleStoreMode(); $sendEmailId = $isSingleMode ? 'sendemail' : 'sendemail_store_id'; $sendEmail = $form->getElement($sendEmailId); diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Cart.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Cart.php index a1aa43d28f..82830f1d57 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Cart.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Cart.php @@ -37,12 +37,22 @@ class Mage_Adminhtml_Block_Customer_Edit_Tab_Cart extends Mage_Adminhtml_Block_W public function __construct($attributes=array()) { parent::__construct($attributes); - $this->setId('customer_cart_grid'.$this->getWebsiteId()); $this->setUseAjax(true); $this->_parentTemplate = $this->getTemplate(); $this->setTemplate('customer/tab/cart.phtml'); } + /** + * Prepare grid + * + * @return void + */ + protected function _prepareGrid() + { + $this->setId('customer_cart_grid' . $this->getWebsiteId()); + parent::_prepareGrid(); + } + protected function _prepareCollection() { $customer = Mage::registry('current_customer'); diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter.php index cc33cc14a6..286fcbeadd 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter.php @@ -48,6 +48,11 @@ public function initForm() $subscriber = Mage::getModel('newsletter/subscriber')->loadByCustomer($customer); Mage::register('subscriber', $subscriber); + if ($customer->getWebsiteId() == 0) { + $this->setForm($form); + return $this; + } + $fieldset = $form->addFieldset('base_fieldset', array('legend'=>Mage::helper('customer')->__('Newsletter Information'))); $fieldset->addField('subscription', 'checkbox', @@ -73,7 +78,6 @@ public function initForm() ); } - $this->setForm($form); return $this; } @@ -82,7 +86,10 @@ public function getStatusChangedDate() { $subscriber = Mage::registry('subscriber'); if($subscriber->getChangeStatusAt()) { - return $this->formatDate($subscriber->getChangeStatusAt(), Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM, true); + return $this->formatDate( + $subscriber->getChangeStatusAt(), + Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM, true + ); } return null; diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View.php index 2ceb1f3892..298d3c347b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View.php @@ -71,10 +71,15 @@ public function getCustomerLog() return $this->_customerLog; } + /** + * Get customer creation date + * + * @return string + */ public function getCreateDate() { - $date = Mage::app()->getLocale()->date($this->getCustomer()->getCreatedAtTimestamp()); - return $this->formatDate($date, Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM, true); + return Mage::helper('core')->formatDate($this->getCustomer()->getCreatedAtTimestamp(), + Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM, true); } public function getStoreCreateDate() @@ -93,11 +98,16 @@ public function getStoreCreateDateTimezone() ->getConfig(Mage_Core_Model_Locale::XML_PATH_DEFAULT_TIMEZONE); } + /** + * Get customer last login date + * + * @return string + */ public function getLastLoginDate() { - if ($date = $this->getCustomerLog()->getLoginAtTimestamp()) { - $date = Mage::app()->getLocale()->date($date); - return $this->formatDate($date, Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM, true); + $date = $this->getCustomerLog()->getLoginAtTimestamp(); + if ($date) { + return Mage::helper('core')->formatDate($date, Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM, true); } return Mage::helper('customer')->__('Never'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Accordion.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Accordion.php index a8cd1356c5..7e1d587644 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Accordion.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Accordion.php @@ -58,9 +58,7 @@ protected function _prepareLayout() // prepare title for cart $title = Mage::helper('customer')->__('Shopping Cart - %d item(s)', $cartItemsCount); if (count($customer->getSharedWebsiteIds()) > 1) { - $title = Mage::helper('customer')->__('Shopping Cart of %1$s - %2$d item(s)', - $website->getName(), $cartItemsCount - ); + $title = Mage::helper('customer')->__('Shopping Cart of %1$s - %2$d item(s)', $website->getName(), $cartItemsCount); } // add cart ajax accordion diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Group/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Customer/Group/Edit/Form.php index 5466380aec..7373461523 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Group/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Group/Edit/Form.php @@ -51,8 +51,7 @@ protected function _prepareLayout() 'name' => 'code', 'label' => Mage::helper('customer')->__('Group Name'), 'title' => Mage::helper('customer')->__('Group Name'), - 'note' => Mage::helper('customer')->__('Maximum length must be less then %s symbols', - Mage_Customer_Model_Group::GROUP_CODE_MAX_LENGTH), + 'note' => Mage::helper('customer')->__('Maximum length must be less then %s symbols', Mage_Customer_Model_Group::GROUP_CODE_MAX_LENGTH), 'class' => $validateClass, 'required' => true, ) diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Sales/Order/Address/Form/Billing/Renderer/Vat.php b/app/code/core/Mage/Adminhtml/Block/Customer/Sales/Order/Address/Form/Billing/Renderer/Vat.php new file mode 100644 index 0000000000..607a1fe9af --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Sales/Order/Address/Form/Billing/Renderer/Vat.php @@ -0,0 +1,97 @@ + + */ +class Mage_Adminhtml_Block_Customer_Sales_Order_Address_Form_Billing_Renderer_Vat + extends Mage_Adminhtml_Block_Widget_Form_Renderer_Fieldset_Element +{ + /** + * Validate button block + * + * @var null|Mage_Adminhtml_Block_Widget_Button + */ + protected $_validateButton = null; + + /** + * Set custom template for 'VAT number' + */ + protected function _construct() + { + $this->setTemplate('customer/sales/order/create/billing/form/renderer/vat.phtml'); + } + + /** + * Retrieve validate button block + * + * @return Mage_Adminhtml_Block_Widget_Button + */ + public function getValidateButton() + { + if (is_null($this->_validateButton)) { + /** @var $form Varien_Data_Form */ + $form = $this->_element->getForm(); + + $vatElementId = $this->_element->getHtmlId(); + + /** @var $formAccountBlock Mage_Adminhtml_Block_Sales_Order_Create_Form_Account */ + $formAccountBlock = $this->getLayout()->getBlock('form_account'); + $groupIdHtmlId = $formAccountBlock->getForm()->getElement('group_id')->getHtmlId(); + + $countryElementId = $form->getElement('country_id')->getHtmlId(); + $validateUrl = Mage::getSingleton('adminhtml/url') + ->getUrl('*/customer_system_config_validatevat/validateAdvanced'); + + $vatValidateOptions = Mage::helper('core')->jsonEncode(array( + 'vatElementId' => $vatElementId, + 'countryElementId' => $countryElementId, + 'groupIdHtmlId' => $groupIdHtmlId, + 'validateUrl' => $validateUrl, + 'vatValidMessage' => Mage::helper('customer')->__('The VAT ID is valid. The current Customer Group will be used.'), + 'vatValidAndGroupChangeMessage' => + Mage::helper('customer')->__('Based on the VAT ID, the customer would belong to Customer Group %s.') . "\n" + . Mage::helper('customer')->__('The customer is currently assigned to Customer Group %s.') . ' ' + . Mage::helper('customer')->__('Would you like to change the Customer Group for this order?'), + 'vatInvalidMessage' => Mage::helper('customer')->__('The VAT ID entered (%s) is not valid VAT ID.'), + 'vatValidationFailedMessage' => Mage::helper('customer')->__('There was an error validating the VAT ID. Please try again later.'), + )); + + $beforeHtml = ''; + $this->_validateButton = $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array( + 'label' => Mage::helper('customer')->__('Validate VAT Number'), + 'before_html' => $beforeHtml, + 'onclick' => "order.validateVat(vatValidateOptions)" + )); + } + return $this->_validateButton; + } +} diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/System/Config/Validatevat.php b/app/code/core/Mage/Adminhtml/Block/Customer/System/Config/Validatevat.php new file mode 100644 index 0000000000..43d675169a --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Block/Customer/System/Config/Validatevat.php @@ -0,0 +1,79 @@ + + */ +class Mage_Adminhtml_Block_Customer_System_Config_Validatevat extends Mage_Adminhtml_Block_System_Config_Form_Field +{ + /** + * Set template to itself + * + * @return Mage_Adminhtml_Block_Customer_System_Config_Validatevat + */ + protected function _prepareLayout() + { + parent::_prepareLayout(); + if (!$this->getTemplate()) { + $this->setTemplate('customer/system/config/validatevat.phtml'); + } + return $this; + } + + /** + * Unset some non-related element parameters + * + * @param Varien_Data_Form_Element_Abstract $element + * @return string + */ + public function render(Varien_Data_Form_Element_Abstract $element) + { + $element->unsScope()->unsCanUseWebsiteValue()->unsCanUseDefaultValue(); + return parent::render($element); + } + + /** + * Get the button and scripts contents + * + * @param Varien_Data_Form_Element_Abstract $element + * @return string + */ + protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element) + { + $originalData = $element->getOriginalData(); + $this->addData(array( + 'button_label' => Mage::helper('customer')->__($originalData['button_label']), + 'html_id' => $element->getHtmlId(), + 'ajax_url' => Mage::getSingleton('adminhtml/url')->getUrl('*/customer_system_config_validatevat/validate') + )); + + return $this->_toHtml(); + } +} diff --git a/app/code/core/Mage/Adminhtml/Block/Media/Uploader.php b/app/code/core/Mage/Adminhtml/Block/Media/Uploader.php index 1eff3369e0..177f6ec3c0 100644 --- a/app/code/core/Mage/Adminhtml/Block/Media/Uploader.php +++ b/app/code/core/Mage/Adminhtml/Block/Media/Uploader.php @@ -195,11 +195,12 @@ public function getDataMaxSizeInBytes() } /** - * Retrive full uploader SWF's file URL + * Retrieve full uploader SWF's file URL * Implemented to solve problem with cross domain SWFs * Now uploader can be only in the same URL where backend located * - * @param string url to uploader in current theme + * @param string $url url to uploader in current theme + * * @return string full URL */ public function getUploaderUrl($url) @@ -212,7 +213,7 @@ public function getUploaderUrl($url) if (empty($url) || !$design->validateFile($url, array('_type' => 'skin', '_theme' => $theme))) { $theme = $design->getDefaultTheme(); } - return Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN) . + return Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB) . 'skin/' . $design->getArea() . '/' . $design->getPackageName() . '/' . $theme . '/' . $url; } } diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons.php b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons.php new file mode 100644 index 0000000000..2511c15374 --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons.php @@ -0,0 +1,88 @@ + + */ +class Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Coupons + extends Mage_Adminhtml_Block_Text_List + implements Mage_Adminhtml_Block_Widget_Tab_Interface +{ + /** + * Prepare content for tab + * + * @return string + */ + public function getTabLabel() + { + return Mage::helper('salesrule')->__('Manage Coupons Codes'); + } + + /** + * Prepare title for tab + * + * @return string + */ + public function getTabTitle() + { + return Mage::helper('salesrule')->__('Manage Coupons Codes'); + } + + /** + * Returns status flag about this tab can be shown or not + * + * @return bool + */ + public function canShowTab() + { + return $this->_isEditing(); + } + + /** + * Returns status flag about this tab hidden or not + * + * @return bool + */ + public function isHidden() + { + return !$this->_isEditing(); + } + + /** + * Check whether we edit existing rule or adding new one + * + * @return bool + */ + protected function _isEditing() + { + $priceRule = Mage::registry('current_promo_quote_rule'); + return !is_null($priceRule->getRuleId()); + } +} diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons/Form.php b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons/Form.php new file mode 100644 index 0000000000..99c8fc8a3e --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons/Form.php @@ -0,0 +1,143 @@ + + */ +class Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Coupons_Form + extends Mage_Adminhtml_Block_Widget_Form +{ + /** + * Prepare coupon codes generation parameters form + * + * @return Mage_Adminhtml_Block_Widget_Form + */ + protected function _prepareForm() + { + $form = new Varien_Data_Form(); + + /** + * @var Mage_SalesRule_Helper_Coupon $couponHelper + */ + $couponHelper = Mage::helper('salesrule/coupon'); + + $model = Mage::registry('current_promo_quote_rule'); + $ruleId = $model->getId(); + + $form->setHtmlIdPrefix('coupons_'); + + $gridBlock = $this->getLayout()->getBlock('promo_quote_edit_tab_coupons_grid'); + $gridBlockJsObject = ''; + if ($gridBlock) { + $gridBlockJsObject = $gridBlock->getJsObjectName(); + } + + $fieldset = $form->addFieldset('information_fieldset', array('legend'=>Mage::helper('salesrule')->__('Coupons Information'))); + $fieldset->addClass('ignore-validate'); + + $fieldset->addField('rule_id', 'hidden', array( + 'name' => 'rule_id', + 'value' => $ruleId + )); + + $fieldset->addField('qty', 'text', array( + 'name' => 'qty', + 'label' => Mage::helper('salesrule')->__('Coupon Qty'), + 'title' => Mage::helper('salesrule')->__('Coupon Qty'), + 'required' => true + )); + + $fieldset->addField('length', 'text', array( + 'name' => 'length', + 'label' => Mage::helper('salesrule')->__('Code Length'), + 'title' => Mage::helper('salesrule')->__('Code Length'), + 'required' => true, + 'note' => Mage::helper('salesrule')->__('Excluding prefix, suffix and separators.'), + 'value' => $couponHelper->getDefaultLength() + )); + + $fieldset->addField('format', 'select', array( + 'label' => Mage::helper('salesrule')->__('Code Format'), + 'name' => 'format', + 'options' => $couponHelper->getFormatsList(), + 'required' => true, + 'value' => $couponHelper->getDefaultFormat() + )); + + $fieldset->addField('prefix', 'text', array( + 'name' => 'prefix', + 'label' => Mage::helper('salesrule')->__('Code Prefix'), + 'title' => Mage::helper('salesrule')->__('Code Prefix'), + 'value' => $couponHelper->getDefaultPrefix() + )); + + $fieldset->addField('suffix', 'text', array( + 'name' => 'suffix', + 'label' => Mage::helper('salesrule')->__('Code Suffix'), + 'title' => Mage::helper('salesrule')->__('Code Suffix'), + 'value' => $couponHelper->getDefaultSuffix() + )); + + $fieldset->addField('dash', 'text', array( + 'name' => 'dash', + 'label' => Mage::helper('salesrule')->__('Dash Every X Characters'), + 'title' => Mage::helper('salesrule')->__('Dash Every X Characters'), + 'note' => Mage::helper('salesrule')->__('If empty no separation.'), + 'value' => $couponHelper->getDefaultDashInterval() + )); + + $idPrefix = $form->getHtmlIdPrefix(); + $generateUrl = $this->getGenerateUrl(); + + $fieldset->addField('generate_button', 'note', array( + 'text' => $this->getButtonHtml( + Mage::helper('salesrule')->__('Generate'), + "generateCouponCodes('{$idPrefix}' ,'{$generateUrl}', '{$gridBlockJsObject}')", + 'generate' + ) + )); + + $this->setForm($form); + + Mage::dispatchEvent('adminhtml_promo_quote_edit_tab_coupons_form_prepare_form', array('form' => $form)); + + return parent::_prepareForm(); + } + + /** + * Retrieve URL to Generate Action + * + * @return string + */ + public function getGenerateUrl() + { + return $this->getUrl('*/*/generate'); + } +} diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons/Grid.php b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons/Grid.php new file mode 100644 index 0000000000..8e8288b88a --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons/Grid.php @@ -0,0 +1,144 @@ + + */ +class Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Coupons_Grid extends Mage_Adminhtml_Block_Widget_Grid +{ + /** + * Constructor + */ + public function __construct() + { + parent::__construct(); + $this->setId('couponCodesGrid'); + $this->setUseAjax(true); + } + + /** + * Prepare collection for grid + * + * @return Mage_Adminhtml_Block_Widget_Grid + */ + protected function _prepareCollection() + { + $priceRule = Mage::registry('current_promo_quote_rule'); + + /** + * @var Mage_SalesRule_Model_Resource_Coupon_Collection $collection + */ + $collection = Mage::getResourceModel('salesrule/coupon_collection') + ->addRuleToFilter($priceRule) + ->addGeneratedCouponsFilter(); + + $this->setCollection($collection); + + return parent::_prepareCollection(); + } + + /** + * Define grid columns + * + * @return Mage_Adminhtml_Block_Widget_Grid + */ + protected function _prepareColumns() + { + $this->addColumn('code', array( + 'header' => Mage::helper('salesrule')->__('Coupon Code'), + 'index' => 'code' + )); + + $this->addColumn('created_at', array( + 'header' => Mage::helper('salesrule')->__('Created On'), + 'index' => 'created_at', + 'type' => 'datetime', + 'align' => 'center', + 'width' => '160' + )); + + $this->addColumn('used', array( + 'header' => Mage::helper('salesrule')->__('Used'), + 'index' => 'times_used', + 'width' => '100', + 'type' => 'options', + 'options' => array( + Mage::helper('adminhtml')->__('No'), + Mage::helper('adminhtml')->__('Yes') + ), + 'renderer' => 'adminhtml/promo_quote_edit_tab_coupons_grid_column_renderer_used', + 'filter_condition_callback' => array( + Mage::getResourceModel('salesrule/coupon_collection'), 'addIsUsedFilterCallback' + ) + )); + + $this->addColumn('times_used', array( + 'header' => Mage::helper('salesrule')->__('Times Used'), + 'index' => 'times_used', + 'width' => '50', + 'type' => 'number', + )); + + $this->addExportType('*/*/exportCouponsCsv', Mage::helper('customer')->__('CSV')); + $this->addExportType('*/*/exportCouponsXml', Mage::helper('customer')->__('Excel XML')); + return parent::_prepareColumns(); + } + + /** + * Configure grid mass actions + * + * @return Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Coupons_Grid + */ + protected function _prepareMassaction() + { + $this->setMassactionIdField('coupon_id'); + $this->getMassactionBlock()->setFormFieldName('ids'); + $this->getMassactionBlock()->setUseAjax(true); + + $this->getMassactionBlock()->addItem('delete', array( + 'label'=> Mage::helper('adminhtml')->__('Delete'), + 'url' => $this->getUrl('*/*/couponsMassDelete', array('_current' => true)), + 'confirm' => Mage::helper('salesrule')->__('Are you sure you want to delete the selected coupon(s)?'), + 'complete' => 'refreshCouponCodesGrid' + )); + + return $this; + } + + /** + * Get grid url + * + * @return string + */ + public function getGridUrl() + { + return $this->getUrl('*/*/couponsGrid', array('_current'=> true)); + } +} diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons/Grid/Column/Renderer/Used.php b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons/Grid/Column/Renderer/Used.php new file mode 100644 index 0000000000..b289d54adf --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons/Grid/Column/Renderer/Used.php @@ -0,0 +1,42 @@ + + */ +class Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Coupons_Grid_Column_Renderer_Used + extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Text +{ + public function render(Varien_Object $row) + { + $value = (int)$row->getData($this->getColumn()->getIndex()); + return empty($value) ? Mage::helper('adminhtml')->__('No') : Mage::helper('adminhtml')->__('Yes'); + } +} diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Main.php b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Main.php index d455aeec95..d474d831f0 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Main.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Main.php @@ -80,12 +80,12 @@ protected function _prepareForm() { $model = Mage::registry('current_promo_quote_rule'); - //$form = new Varien_Data_Form(array('id' => 'edit_form1', 'action' => $this->getData('action'), 'method' => 'post')); $form = new Varien_Data_Form(); - $form->setHtmlIdPrefix('rule_'); - $fieldset = $form->addFieldset('base_fieldset', array('legend'=>Mage::helper('salesrule')->__('General Information'))); + $fieldset = $form->addFieldset('base_fieldset', + array('legend' => Mage::helper('salesrule')->__('General Information')) + ); if ($model->getId()) { $fieldset->addField('rule_id', 'hidden', array( @@ -153,7 +153,10 @@ protected function _prepareForm() } } if (!$found) { - array_unshift($customerGroups, array('value'=>0, 'label'=>Mage::helper('salesrule')->__('NOT LOGGED IN'))); + array_unshift($customerGroups, array( + 'value' => 0, + 'label' => Mage::helper('salesrule')->__('NOT LOGGED IN')) + ); } $fieldset->addField('customer_group_ids', 'multiselect', array( @@ -177,6 +180,18 @@ protected function _prepareForm() 'required' => true, )); + $autoGenerationCheckbox = $fieldset->addField('use_auto_generation', 'checkbox', array( + 'name' => 'use_auto_generation', + 'label' => Mage::helper('salesrule')->__('Use Auto Generation'), + 'note' => Mage::helper('salesrule')->__('If you select and save the rule you will be able to generate multiple coupon codes'), + 'onclick' => 'handleCouponsTabContentActivity()', + 'checked' => (int)$model->getUseAutoGeneration() > 0 ? 'checked' : '' + )); + + $autoGenerationCheckbox->setRenderer( + $this->getLayout()->createBlock('adminhtml/promo_quote_edit_tab_main_renderer_checkbox') + ); + $usesPerCouponFiled = $fieldset->addField('uses_per_coupon', 'text', array( 'name' => 'uses_per_coupon', 'label' => Mage::helper('salesrule')->__('Uses per Coupon'), @@ -227,6 +242,8 @@ protected function _prepareForm() $form->setValues($model->getData()); + $autoGenerationCheckbox->setValue(1); + if ($model->isReadonly()) { foreach ($fieldset->getElements() as $element) { $element->setReadonly(true, true); @@ -241,11 +258,16 @@ protected function _prepareForm() $this->setChild('form_after', $this->getLayout()->createBlock('adminhtml/widget_form_element_dependence') ->addFieldMap($couponTypeFiled->getHtmlId(), $couponTypeFiled->getName()) ->addFieldMap($couponCodeFiled->getHtmlId(), $couponCodeFiled->getName()) + ->addFieldMap($autoGenerationCheckbox->getHtmlId(), $autoGenerationCheckbox->getName()) ->addFieldMap($usesPerCouponFiled->getHtmlId(), $usesPerCouponFiled->getName()) ->addFieldDependence( $couponCodeFiled->getName(), $couponTypeFiled->getName(), Mage_SalesRule_Model_Rule::COUPON_TYPE_SPECIFIC) + ->addFieldDependence( + $autoGenerationCheckbox->getName(), + $couponTypeFiled->getName(), + Mage_SalesRule_Model_Rule::COUPON_TYPE_SPECIFIC) ->addFieldDependence( $usesPerCouponFiled->getName(), $couponTypeFiled->getName(), diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Main/Renderer/Checkbox.php b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Main/Renderer/Checkbox.php new file mode 100644 index 0000000000..d6ffbbe3de --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Main/Renderer/Checkbox.php @@ -0,0 +1,59 @@ + + */ +class Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Main_Renderer_Checkbox + extends Mage_Adminhtml_Block_Abstract + implements Varien_Data_Form_Element_Renderer_Interface +{ + /** + * Checkbox render function + * + * @param Varien_Data_Form_Element_Abstract $element + * @return string + */ + public function render(Varien_Data_Form_Element_Abstract $element) + { + $checkbox = new Varien_Data_Form_Element_Checkbox($element->getData()); + $checkbox->setForm($element->getForm()); + + $elementHtml = $checkbox->getElementHtml() . sprintf( + '

%s

', + $element->getHtmlId(), $element->getLabel(), $element->getNote() + ); + $html = ' '; + $html .= '' . $elementHtml . ''; + + return $html; + } + +} diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Widget/Chooser.php b/app/code/core/Mage/Adminhtml/Block/Promo/Widget/Chooser.php index 098611debf..871aec3c72 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Widget/Chooser.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Widget/Chooser.php @@ -103,6 +103,10 @@ protected function _prepareCollection() $collection = Mage::getModel('salesrule/rule')->getResourceCollection(); $this->setCollection($collection); + Mage::dispatchEvent('adminhtml_block_promo_widget_chooser_prepare_collection', array( + 'collection' => $collection + )); + return parent::_prepareCollection(); } diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Customer/Totals/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Customer/Totals/Grid.php index a7eea5f854..277f1f9175 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Customer/Totals/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Customer/Totals/Grid.php @@ -64,6 +64,7 @@ protected function _prepareColumns() )); $baseCurrencyCode = $this->getCurrentCurrencyCode(); + $rate = $this->getRate($baseCurrencyCode); $this->addColumn('orders_avg_amount', array( 'header' => $this->__('Average Order Amount'), @@ -74,7 +75,8 @@ protected function _prepareColumns() 'currency_code' => $baseCurrencyCode, 'index' => 'orders_avg_amount', 'total' => 'orders_sum_amount/orders_count', - 'renderer' => 'adminhtml/report_grid_column_renderer_currency' + 'renderer' => 'adminhtml/report_grid_column_renderer_currency', + 'rate' => $rate, )); $this->addColumn('orders_sum_amount', array( @@ -86,7 +88,8 @@ protected function _prepareColumns() 'currency_code' => $baseCurrencyCode, 'index' => 'orders_sum_amount', 'total' => 'sum', - 'renderer' => 'adminhtml/report_grid_column_renderer_currency' + 'renderer' => 'adminhtml/report_grid_column_renderer_currency', + 'rate' => $rate, )); $this->addExportType('*/*/exportTotalsCsv', Mage::helper('reports')->__('CSV')); diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Grid.php index 5ff312f714..6d9720f780 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Grid.php @@ -461,7 +461,9 @@ public function getCsv() foreach ($this->_columns as $column) { $j++; if (!$column->getIsSystem()) { - $data[] = ($j==1)?'"'.$this->__('Subtotal').'"':'"'.str_replace('"', '""', $column->getRowField($this->getTotals())).'"'; + $data[] = ($j == 1) ? + '"' . $this->__('Subtotal') . '"' : + '"'.str_replace('"', '""', $column->getRowField($this->getTotals())).'"'; } } $csv.= implode(',', $data)."\n"; @@ -577,7 +579,6 @@ public function getCountTotals() public function getRefreshButtonCallback() { return "{$this->getJsObjectName()}.doFilter();"; - return "if ($('period_date_to').value == '' && $('period_date_from').value == '') {alert('".$this->__('Please specify at least start or end date.')."'); return false;}else {$this->getJsObjectName()}.doFilter();"; } /** @@ -613,4 +614,15 @@ public function getCurrentCurrencyCode() } return $this->_currentCurrencyCode; } + + /** + * Get currency rate (base to given currency) + * + * @param string|Mage_Directory_Model_Currency $currencyCode + * @return double + */ + public function getRate($toCurrency) + { + return Mage::app()->getStore()->getBaseCurrency()->getRate($toCurrency); + } } diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Grid/Abstract.php b/app/code/core/Mage/Adminhtml/Block/Report/Grid/Abstract.php index e538faa9ac..53ca31c398 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Grid/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Grid/Abstract.php @@ -41,7 +41,7 @@ public function __construct() if (isset($this->_columnGroupBy)) { $this->isColumnGrouped($this->_columnGroupBy, true); } - $this->setEmptyCellLabel(Mage::helper('reports')->__('No records found for this period.')); + $this->setEmptyCellLabel(Mage::helper('adminhtml')->__('No records found for this period.')); } public function getResourceCollectionName() @@ -159,9 +159,11 @@ protected function _prepareCollection() ->setPeriod($filterData->getData('period_type')) ->setDateRange($filterData->getData('from', null), $filterData->getData('to', null)) ->addStoreFilter($storeIds) - ->addOrderStatusFilter($filterData->getData('order_statuses')) ->setAggregatedColumns($this->_getAggregatedColumns()); + $this->_addOrderStatusFilter($resourceCollection, $filterData); + $this->_addCustomFilter($resourceCollection, $filterData); + if ($this->_isExport) { $this->setCollection($resourceCollection); return $this; @@ -185,9 +187,11 @@ protected function _prepareCollection() ->setPeriod($filterData->getData('period_type')) ->setDateRange($filterData->getData('from', null), $filterData->getData('to', null)) ->addStoreFilter($storeIds) - ->addOrderStatusFilter($filterData->getData('order_statuses')) ->setAggregatedColumns($this->_getAggregatedColumns()) ->isTotals(true); + + $this->_addOrderStatusFilter($totalsCollection, $filterData); + foreach ($totalsCollection as $item) { $this->setTotals($item); break; @@ -208,9 +212,11 @@ public function getCountTotals() ->setPeriod($filterData->getData('period_type')) ->setDateRange($filterData->getData('from', null), $filterData->getData('to', null)) ->addStoreFilter($this->_getStoreIds()) - ->addOrderStatusFilter($filterData->getData('order_statuses')) ->setAggregatedColumns($this->_getAggregatedColumns()) ->isTotals(true); + + $this->_addOrderStatusFilter($totalsCollection, $filterData); + if (count($totalsCollection->getItems()) < 1 || !$filterData->getData('from')) { $this->setTotals(new Varien_Object()); } else { @@ -230,9 +236,11 @@ public function getSubTotals() ->setPeriod($filterData->getData('period_type')) ->setDateRange($filterData->getData('from', null), $filterData->getData('to', null)) ->addStoreFilter($this->_getStoreIds()) - ->addOrderStatusFilter($filterData->getData('order_statuses')) ->setAggregatedColumns($this->_getAggregatedColumns()) ->isSubTotals(true); + + $this->_addOrderStatusFilter($subTotalsCollection, $filterData); + $this->setSubTotals($subTotalsCollection->getItems()); return parent::getSubTotals(); } @@ -252,4 +260,41 @@ public function getCurrentCurrencyCode() } return $this->_currentCurrencyCode; } + + /** + * Get currency rate (base to given currency) + * + * @param string|Mage_Directory_Model_Currency $currencyCode + * @return double + */ + public function getRate($toCurrency) + { + return Mage::app()->getStore()->getBaseCurrency()->getRate($toCurrency); + } + + /** + * Add order status filter + * + * @param Mage_Reports_Model_Resource_Report_Collection_Abstract $collection + * @param Varien_Object $filterData + * @return Mage_Adminhtml_Block_Report_Grid_Abstract + */ + protected function _addOrderStatusFilter($collection, $filterData) + { + $collection->addOrderStatusFilter($filterData->getData('order_statuses')); + return $this; + } + + /** + * Adds custom filter to resource collection + * Can be overridden in child classes if custom filter needed + * + * @param Mage_Reports_Model_Resource_Report_Collection_Abstract $collection + * @param Varien_Object $filterData + * @return Mage_Adminhtml_Block_Report_Grid_Abstract + */ + protected function _addCustomFilter($collection, $filterData) + { + return $this; + } } diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Grid/Shopcart.php b/app/code/core/Mage/Adminhtml/Block/Report/Grid/Shopcart.php new file mode 100644 index 0000000000..ad56636771 --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Block/Report/Grid/Shopcart.php @@ -0,0 +1,84 @@ + + */ +class Mage_Adminhtml_Block_Report_Grid_Shopcart extends Mage_Adminhtml_Block_Widget_Grid +{ + /** + * stores current currency code + */ + protected $_currentCurrencyCode = null; + + /** + * ids of current stores + */ + protected $_storeIds = array(); + + /** + * storeIds setter + * + * @param array $storeIds + * @return Mage_Adminhtml_Block_Report_Grid_Shopcart_Abstract + */ + public function setStoreIds($storeIds) + { + $this->_storeIds = $storeIds; + return $this; + } + + /** + * Retrieve currency code based on selected store + * + * @return string + */ + public function getCurrentCurrencyCode() + { + if (is_null($this->_currentCurrencyCode)) { + reset($this->_storeIds); + $this->_currentCurrencyCode = (count($this->_storeIds) > 0) + ? Mage::app()->getStore(current($this->_storeIds))->getBaseCurrencyCode() + : Mage::app()->getStore()->getBaseCurrencyCode(); + } + return $this->_currentCurrencyCode; + } + + /** + * Get currency rate (base to given currency) + * + * @param string|Mage_Directory_Model_Currency $currencyCode + * @return double + */ + public function getRate($toCurrency) + { + return Mage::app()->getStore()->getBaseCurrency()->getRate($toCurrency); + } +} diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Product/Ordered/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Product/Ordered/Grid.php index 0fef9ee102..d70b696e34 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Product/Ordered/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Product/Ordered/Grid.php @@ -51,12 +51,15 @@ protected function _prepareColumns() 'index' =>'name' )); + $baseCurrencyCode = $this->getCurrentCurrencyCode(); + $this->addColumn('price', array( - 'header' =>Mage::helper('reports')->__('Price'), - 'width' =>'120px', - 'type' =>'currency', - 'currency_code' => $this->getCurrentCurrencyCode(), - 'index' =>'price' + 'header' => Mage::helper('reports')->__('Price'), + 'width' => '120px', + 'type' => 'currency', + 'currency_code' => $baseCurrencyCode, + 'index' => 'price', + 'rate' => $this->getRate($baseCurrencyCode), )); $this->addColumn('ordered_qty', array( diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Product/Viewed.php b/app/code/core/Mage/Adminhtml/Block/Report/Product/Viewed.php index 849f69b9fa..b7ae0c1b2c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Product/Viewed.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Product/Viewed.php @@ -39,6 +39,22 @@ public function __construct() $this->_controller = 'report_product_viewed'; $this->_headerText = Mage::helper('reports')->__('Most Viewed'); parent::__construct(); + $this->setTemplate('report/grid/container.phtml'); $this->_removeButton('add'); + $this->addButton('filter_form_submit', array( + 'label' => Mage::helper('reports')->__('Show Report'), + 'onclick' => 'filterFormSubmit()' + )); + } + + /** + * Get filter url + * + * @return string + */ + public function getFilterUrl() + { + $this->getRequest()->setParam('filter', null); + return $this->getUrl('*/*/viewed', array('_current' => true)); } } diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Product/Viewed/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Product/Viewed/Grid.php index 11a85d8d2e..786cb2e776 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Product/Viewed/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Product/Viewed/Grid.php @@ -31,49 +31,94 @@ * @package Mage_Adminhtml * @author Magento Core Team */ -class Mage_Adminhtml_Block_Report_Product_Viewed_Grid extends Mage_Adminhtml_Block_Report_Grid +class Mage_Adminhtml_Block_Report_Product_Viewed_Grid extends Mage_Adminhtml_Block_Report_Grid_Abstract { + /** + * Column for grid to be grouped by + * + * @var string + */ + protected $_columnGroupBy = 'period'; + /** + * Grid resource collection name + * + * @var string + */ + protected $_resourceCollectionName = 'reports/report_product_viewed_collection'; + + /** + * Init grid parameters + */ public function __construct() { parent::__construct(); - $this->setId('gridViewedProducts'); - } - - protected function _prepareCollection() - { - parent::_prepareCollection(); - $this->getCollection()->initReport('reports/product_viewed_collection'); + $this->setCountTotals(true); } + /** + * Custom columns preparation + * + * @return Mage_Adminhtml_Block_Widget_Grid + */ protected function _prepareColumns() { - $this->addColumn('name', array( - 'header' =>Mage::helper('reports')->__('Product Name'), - 'index' =>'name', - 'total' =>Mage::helper('reports')->__('Subtotal') + $this->addColumn('period', array( + 'header' => Mage::helper('adminhtml')->__('Period'), + 'index' => 'period', + 'width' => 100, + 'sortable' => false, + 'period_type' => $this->getPeriodType(), + 'renderer' => 'adminhtml/report_sales_grid_column_renderer_date', + 'totals_label' => Mage::helper('adminhtml')->__('Total'), + 'html_decorators' => array('nobr'), + )); + + $this->addColumn('product_name', array( + 'header' => Mage::helper('adminhtml')->__('Product Name'), + 'index' => 'product_name', + 'type' => 'string', + 'sortable' => false )); - $this->addColumn('price', array( - 'header' =>Mage::helper('reports')->__('Price'), - 'width' =>'120px', - 'type' =>'currency', - 'currency_code' => $this->getCurrentCurrencyCode(), - 'index' =>'price' + if ($this->getFilterData()->getStoreIds()) { + $this->setStoreIds(explode(',', $this->getFilterData()->getStoreIds())); + } + $currencyCode = $this->getCurrentCurrencyCode(); + + $this->addColumn('product_price', array( + 'header' => Mage::helper('adminhtml')->__('Price'), + 'type' => 'currency', + 'currency_code' => $currencyCode, + 'index' => 'product_price', + 'sortable' => false, + 'rate' => $this->getRate($currencyCode), )); - $this->addColumn('views', array( - 'header' =>Mage::helper('reports')->__('Number of Views'), - 'width' =>'120px', - 'align' =>'right', - 'index' =>'views', - 'total' =>'sum' + $this->addColumn('views_num', array( + 'header' => Mage::helper('adminhtml')->__('Number of Views'), + 'index' => 'views_num', + 'type' => 'number', + 'total' => 'sum', + 'sortable' => false )); - $this->addExportType('*/*/exportViewedCsv', Mage::helper('reports')->__('CSV')); - $this->addExportType('*/*/exportViewedExcel', Mage::helper('reports')->__('Excel XML')); + + $this->addExportType('*/*/exportViewedCsv', Mage::helper('adminhtml')->__('CSV')); + $this->addExportType('*/*/exportViewedExcel', Mage::helper('adminhtml')->__('Excel XML')); return parent::_prepareColumns(); } + /** + * Don't use orders in collection + * + * @param Mage_Reports_Model_Resource_Report_Collection_Abstract $collection + * @param Varien_Object $filterData + * @return Mage_Adminhtml_Block_Report_Grid_Abstract + */ + protected function _addOrderStatusFilter($collection, $filterData) + { + return $this; + } } diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Refresh/Statistics/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Refresh/Statistics/Grid.php index d93da70851..da8e0f2da7 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Refresh/Statistics/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Refresh/Statistics/Grid.php @@ -97,7 +97,13 @@ protected function _prepareCollection() 'report' => Mage::helper('sales')->__('Bestsellers'), 'comment' => Mage::helper('sales')->__('Products Bestsellers Report'), 'updated_at' => $this->_getUpdatedAt(Mage_Reports_Model_Flag::REPORT_BESTSELLERS_FLAG_CODE) - ) + ), + array( + 'id' => 'viewed', + 'report' => Mage::helper('sales')->__('Most Viewed'), + 'comment' => Mage::helper('sales')->__('Most Viewed Products Report'), + 'updated_at' => $this->_getUpdatedAt(Mage_Reports_Model_Flag::REPORT_PRODUCT_VIEWED_FLAG_CODE) + ), ); foreach ($data as $value) { diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Bestsellers/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Bestsellers/Grid.php index 47d624efdc..2dbc84d965 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Bestsellers/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Bestsellers/Grid.php @@ -76,7 +76,8 @@ protected function _prepareColumns() 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'product_price', - 'sortable' => false + 'sortable' => false, + 'rate' => $this->getRate($currencyCode), )); $this->addColumn('qty_ordered', array( diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Coupons/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Coupons/Grid.php index 8395552ab3..6052969aee 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Coupons/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Coupons/Grid.php @@ -71,6 +71,12 @@ protected function _prepareColumns() 'index' => 'coupon_code' )); + $this->addColumn('rule_name', array( + 'header' => Mage::helper('salesrule')->__('Shopping Cart Price Rule'), + 'sortable' => false, + 'index' => 'rule_name' + )); + $this->addColumn('coupon_uses', array( 'header' => Mage::helper('salesrule')->__('Number of Uses'), 'sortable' => false, @@ -83,6 +89,7 @@ protected function _prepareColumns() $this->setStoreIds(explode(',', $this->getFilterData()->getStoreIds())); } $currencyCode = $this->getCurrentCurrencyCode(); + $rate = $this->getRate($currencyCode); $this->addColumn('subtotal_amount', array( 'header' => Mage::helper('salesrule')->__('Sales Subtotal Amount'), @@ -90,7 +97,8 @@ protected function _prepareColumns() 'type' => 'currency', 'currency_code' => $currencyCode, 'total' => 'sum', - 'index' => 'subtotal_amount' + 'index' => 'subtotal_amount', + 'rate' => $rate, )); $this->addColumn('discount_amount', array( @@ -99,7 +107,8 @@ protected function _prepareColumns() 'type' => 'currency', 'currency_code' => $currencyCode, 'total' => 'sum', - 'index' => 'discount_amount' + 'index' => 'discount_amount', + 'rate' => $rate, )); $this->addColumn('total_amount', array( @@ -108,7 +117,8 @@ protected function _prepareColumns() 'type' => 'currency', 'currency_code' => $currencyCode, 'total' => 'sum', - 'index' => 'total_amount' + 'index' => 'total_amount', + 'rate' => $rate, )); $this->addColumn('subtotal_amount_actual', array( @@ -117,7 +127,8 @@ protected function _prepareColumns() 'type' => 'currency', 'currency_code' => $currencyCode, 'total' => 'sum', - 'index' => 'subtotal_amount_actual' + 'index' => 'subtotal_amount_actual', + 'rate' => $rate, )); $this->addColumn('discount_amount_actual', array( @@ -126,7 +137,8 @@ protected function _prepareColumns() 'type' => 'currency', 'currency_code' => $currencyCode, 'total' => 'sum', - 'index' => 'discount_amount_actual' + 'index' => 'discount_amount_actual', + 'rate' => $rate, )); $this->addColumn('total_amount_actual', array( @@ -135,7 +147,8 @@ protected function _prepareColumns() 'type' => 'currency', 'currency_code' => $currencyCode, 'total' => 'sum', - 'index' => 'total_amount_actual' + 'index' => 'total_amount_actual', + 'rate' => $rate, )); $this->addExportType('*/*/exportCouponsCsv', Mage::helper('adminhtml')->__('CSV')); @@ -143,4 +156,24 @@ protected function _prepareColumns() return parent::_prepareColumns(); } + + /** + * Add price rule filter + * + * @param Mage_Reports_Model_Resource_Report_Collection_Abstract $collection + * @param Varien_Object $filterData + * @return Mage_Adminhtml_Block_Report_Grid_Abstract + */ + protected function _addCustomFilter($collection, $filterData) + { + if ($filterData->getPriceRuleType()) { + $rulesList = $filterData->getData('rules_list'); + if (isset($rulesList[0])) { + $rulesIds = explode(',', $rulesList[0]); + $collection->addRuleFilter($rulesIds); + } + } + + return parent::_addCustomFilter($filterData, $collection); + } } diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Invoiced/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Invoiced/Grid.php index 5576ddb4b7..96e94e9c56 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Invoiced/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Invoiced/Grid.php @@ -81,6 +81,7 @@ protected function _prepareColumns() $this->setStoreIds(explode(',', $this->getFilterData()->getStoreIds())); } $currencyCode = $this->getCurrentCurrencyCode(); + $rate = $this->getRate($currencyCode); $this->addColumn('invoiced', array( 'header' => Mage::helper('sales')->__('Total Invoiced'), @@ -88,7 +89,8 @@ protected function _prepareColumns() 'currency_code' => $currencyCode, 'index' => 'invoiced', 'total' => 'sum', - 'sortable' => false + 'sortable' => false, + 'rate' => $rate, )); $this->addColumn('invoiced_captured', array( @@ -97,7 +99,8 @@ protected function _prepareColumns() 'currency_code' => $currencyCode, 'index' => 'invoiced_captured', 'total' => 'sum', - 'sortable' => false + 'sortable' => false, + 'rate' => $rate, )); $this->addColumn('invoiced_not_captured', array( @@ -106,7 +109,8 @@ protected function _prepareColumns() 'currency_code' => $currencyCode, 'index' => 'invoiced_not_captured', 'total' => 'sum', - 'sortable' => false + 'sortable' => false, + 'rate' => $rate, )); $this->addExportType('*/*/exportInvoicedCsv', Mage::helper('adminhtml')->__('CSV')); diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Refunded/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Refunded/Grid.php index 4396f61189..837881e39f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Refunded/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Refunded/Grid.php @@ -73,6 +73,7 @@ protected function _prepareColumns() $this->setStoreIds(explode(',', $this->getFilterData()->getStoreIds())); } $currencyCode = $this->getCurrentCurrencyCode(); + $rate = $this->getRate($currencyCode); $this->addColumn('refunded', array( 'header' => Mage::helper('sales')->__('Total Refunded'), @@ -80,7 +81,8 @@ protected function _prepareColumns() 'currency_code' => $currencyCode, 'index' => 'refunded', 'total' => 'sum', - 'sortable' => false + 'sortable' => false, + 'rate' => $rate, )); $this->addColumn('online_refunded', array( @@ -89,7 +91,8 @@ protected function _prepareColumns() 'currency_code' => $currencyCode, 'index' => 'online_refunded', 'total' => 'sum', - 'sortable' => false + 'sortable' => false, + 'rate' => $rate, )); $this->addColumn('offline_refunded', array( @@ -98,7 +101,8 @@ protected function _prepareColumns() 'currency_code' => $currencyCode, 'index' => 'offline_refunded', 'total' => 'sum', - 'sortable' => false + 'sortable' => false, + 'rate' => $rate, )); $this->addExportType('*/*/exportRefundedCsv', Mage::helper('adminhtml')->__('CSV')); diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Sales/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Sales/Grid.php index 9e9a77fc64..f887cb4756 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Sales/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Sales/Grid.php @@ -90,6 +90,7 @@ protected function _prepareColumns() $this->setStoreIds(explode(',', $this->getFilterData()->getStoreIds())); } $currencyCode = $this->getCurrentCurrencyCode(); + $rate = $this->getRate($currencyCode); $this->addColumn('total_income_amount', array( 'header' => Mage::helper('sales')->__('Sales Total'), @@ -97,27 +98,30 @@ protected function _prepareColumns() 'currency_code' => $currencyCode, 'index' => 'total_income_amount', 'total' => 'sum', - 'sortable' => false + 'sortable' => false, + 'rate' => $rate, )); $this->addColumn('total_revenue_amount', array( - 'header' => Mage::helper('sales')->__('Revenue'), - 'type' => 'currency', - 'currency_code' => $currencyCode, - 'index' => 'total_revenue_amount', - 'total' => 'sum', - 'sortable' => false, - 'visibility_filter' => array('show_actual_columns') + 'header' => Mage::helper('sales')->__('Revenue'), + 'type' => 'currency', + 'currency_code' => $currencyCode, + 'index' => 'total_revenue_amount', + 'total' => 'sum', + 'sortable' => false, + 'visibility_filter' => array('show_actual_columns'), + 'rate' => $rate, )); $this->addColumn('total_profit_amount', array( - 'header' => Mage::helper('sales')->__('Profit'), - 'type' => 'currency', - 'currency_code' => $currencyCode, - 'index' => 'total_profit_amount', - 'total' => 'sum', - 'sortable' => false, - 'visibility_filter' => array('show_actual_columns') + 'header' => Mage::helper('sales')->__('Profit'), + 'type' => 'currency', + 'currency_code' => $currencyCode, + 'index' => 'total_profit_amount', + 'total' => 'sum', + 'sortable' => false, + 'visibility_filter' => array('show_actual_columns'), + 'rate' => $rate, )); $this->addColumn('total_invoiced_amount', array( @@ -126,17 +130,19 @@ protected function _prepareColumns() 'currency_code' => $currencyCode, 'index' => 'total_invoiced_amount', 'total' => 'sum', - 'sortable' => false + 'sortable' => false, + 'rate' => $rate, )); $this->addColumn('total_paid_amount', array( - 'header' => Mage::helper('sales')->__('Paid'), - 'type' => 'currency', - 'currency_code' => $currencyCode, - 'index' => 'total_paid_amount', - 'total' => 'sum', - 'sortable' => false, - 'visibility_filter' => array('show_actual_columns') + 'header' => Mage::helper('sales')->__('Paid'), + 'type' => 'currency', + 'currency_code' => $currencyCode, + 'index' => 'total_paid_amount', + 'total' => 'sum', + 'sortable' => false, + 'visibility_filter' => array('show_actual_columns'), + 'rate' => $rate, )); $this->addColumn('total_refunded_amount', array( @@ -145,7 +151,8 @@ protected function _prepareColumns() 'currency_code' => $currencyCode, 'index' => 'total_refunded_amount', 'total' => 'sum', - 'sortable' => false + 'sortable' => false, + 'rate' => $rate, )); $this->addColumn('total_tax_amount', array( @@ -154,17 +161,19 @@ protected function _prepareColumns() 'currency_code' => $currencyCode, 'index' => 'total_tax_amount', 'total' => 'sum', - 'sortable' => false + 'sortable' => false, + 'rate' => $rate, )); $this->addColumn('total_tax_amount_actual', array( - 'header' => Mage::helper('sales')->__('Tax'), - 'type' => 'currency', - 'currency_code' => $currencyCode, - 'index' => 'total_tax_amount_actual', - 'total' => 'sum', - 'sortable' => false, - 'visibility_filter' => array('show_actual_columns') + 'header' => Mage::helper('sales')->__('Tax'), + 'type' => 'currency', + 'currency_code' => $currencyCode, + 'index' => 'total_tax_amount_actual', + 'total' => 'sum', + 'sortable' => false, + 'visibility_filter' => array('show_actual_columns'), + 'rate' => $rate, )); $this->addColumn('total_shipping_amount', array( @@ -173,17 +182,19 @@ protected function _prepareColumns() 'currency_code' => $currencyCode, 'index' => 'total_shipping_amount', 'total' => 'sum', - 'sortable' => false + 'sortable' => false, + 'rate' => $rate, )); $this->addColumn('total_shipping_amount_actual', array( - 'header' => Mage::helper('sales')->__('Shipping'), - 'type' => 'currency', - 'currency_code' => $currencyCode, - 'index' => 'total_shipping_amount_actual', - 'total' => 'sum', - 'sortable' => false, - 'visibility_filter' => array('show_actual_columns') + 'header' => Mage::helper('sales')->__('Shipping'), + 'type' => 'currency', + 'currency_code' => $currencyCode, + 'index' => 'total_shipping_amount_actual', + 'total' => 'sum', + 'sortable' => false, + 'visibility_filter' => array('show_actual_columns'), + 'rate' => $rate, )); $this->addColumn('total_discount_amount', array( @@ -192,17 +203,19 @@ protected function _prepareColumns() 'currency_code' => $currencyCode, 'index' => 'total_discount_amount', 'total' => 'sum', - 'sortable' => false + 'sortable' => false, + 'rate' => $rate, )); $this->addColumn('total_discount_amount_actual', array( - 'header' => Mage::helper('sales')->__('Discount'), - 'type' => 'currency', - 'currency_code' => $currencyCode, - 'index' => 'total_discount_amount_actual', - 'total' => 'sum', - 'sortable' => false, - 'visibility_filter' => array('show_actual_columns') + 'header' => Mage::helper('sales')->__('Discount'), + 'type' => 'currency', + 'currency_code' => $currencyCode, + 'index' => 'total_discount_amount_actual', + 'total' => 'sum', + 'sortable' => false, + 'visibility_filter' => array('show_actual_columns'), + 'rate' => $rate, )); $this->addColumn('total_canceled_amount', array( @@ -211,7 +224,8 @@ protected function _prepareColumns() 'currency_code' => $currencyCode, 'index' => 'total_canceled_amount', 'total' => 'sum', - 'sortable' => false + 'sortable' => false, + 'rate' => $rate, )); diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Shipping/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Shipping/Grid.php index 340706fdea..d9a0703ced 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Shipping/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Shipping/Grid.php @@ -82,22 +82,27 @@ protected function _prepareColumns() $this->setStoreIds(explode(',', $this->getFilterData()->getStoreIds())); } + $currencyCode = $this->getCurrentCurrencyCode(); + $rate = $this->getRate($currencyCode); + $this->addColumn('total_shipping', array( 'header' => Mage::helper('sales')->__('Total Sales Shipping'), 'type' => 'currency', - 'currency_code' => $this->getCurrentCurrencyCode(), + 'currency_code' => $currencyCode, 'index' => 'total_shipping', 'total' => 'sum', - 'sortable' => false + 'sortable' => false, + 'rate' => $rate, )); $this->addColumn('total_shipping_actual', array( 'header' => Mage::helper('sales')->__('Total Shipping'), 'type' => 'currency', - 'currency_code' => $this->getCurrentCurrencyCode(), + 'currency_code' => $currencyCode, 'index' => 'total_shipping_actual', 'total' => 'sum', - 'sortable' => false + 'sortable' => false, + 'rate' => $rate, )); $this->addExportType('*/*/exportShippingCsv', Mage::helper('adminhtml')->__('CSV')); diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Tax/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Tax/Grid.php index 874715ff1f..bee1385f01 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Tax/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Tax/Grid.php @@ -90,14 +90,16 @@ protected function _prepareColumns() if ($this->getFilterData()->getStoreIds()) { $this->setStoreIds(explode(',', $this->getFilterData()->getStoreIds())); } + $currencyCode = $this->getCurrentCurrencyCode(); $this->addColumn('tax_base_amount_sum', array( 'header' => Mage::helper('sales')->__('Tax Amount'), 'type' => 'currency', - 'currency_code' => $this->getCurrentCurrencyCode(), + 'currency_code' => $currencyCode, 'index' => 'tax_base_amount_sum', 'total' => 'sum', - 'sortable' => false + 'sortable' => false, + 'rate' => $this->getRate($currencyCode), )); $this->addExportType('*/*/exportTaxCsv', Mage::helper('adminhtml')->__('CSV')); diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Abandoned/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Abandoned/Grid.php index 77ae5f118c..7725ae799a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Abandoned/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Abandoned/Grid.php @@ -31,7 +31,7 @@ * @package Mage_Adminhtml * @author Magento Core Team */ -class Mage_Adminhtml_Block_Report_Shopcart_Abandoned_Grid extends Mage_Adminhtml_Block_Widget_Grid +class Mage_Adminhtml_Block_Report_Shopcart_Abandoned_Grid extends Mage_Adminhtml_Block_Report_Grid_Shopcart { public function __construct() @@ -42,16 +42,6 @@ public function __construct() protected function _prepareCollection() { - if ($this->getRequest()->getParam('website')) { - $storeIds = Mage::app()->getWebsite($this->getRequest()->getParam('website'))->getStoreIds(); - } else if ($this->getRequest()->getParam('group')) { - $storeIds = Mage::app()->getGroup($this->getRequest()->getParam('group'))->getStoreIds(); - } else if ($this->getRequest()->getParam('store')) { - $storeIds = array((int)$this->getRequest()->getParam('store')); - } else { - $storeIds = ''; - } - /** @var $collection Mage_Reports_Model_Resource_Quote_Collection */ $collection = Mage::getResourceModel('reports/quote_collection'); @@ -62,9 +52,9 @@ protected function _prepareCollection() } if (!empty($data)) { - $collection->prepareForAbandonedReport($storeIds, $data); + $collection->prepareForAbandonedReport($this->_storeIds, $data); } else { - $collection->prepareForAbandonedReport($storeIds); + $collection->prepareForAbandonedReport($this->_storeIds); } $this->setCollection($collection); @@ -116,14 +106,27 @@ protected function _prepareColumns() 'type' =>'number' )); + if ($this->getRequest()->getParam('website')) { + $storeIds = Mage::app()->getWebsite($this->getRequest()->getParam('website'))->getStoreIds(); + } else if ($this->getRequest()->getParam('group')) { + $storeIds = Mage::app()->getGroup($this->getRequest()->getParam('group'))->getStoreIds(); + } else if ($this->getRequest()->getParam('store')) { + $storeIds = array((int)$this->getRequest()->getParam('store')); + } else { + $storeIds = array(); + } + $this->setStoreIds($storeIds); + $currencyCode = $this->getCurrentCurrencyCode(); + $this->addColumn('subtotal', array( - 'header' =>Mage::helper('reports')->__('Subtotal'), - 'width' =>'80px', - 'type' =>'currency', - 'currency_code' => $this->getCurrentCurrencyCode(), - 'index' =>'subtotal', - 'sortable' =>false, - 'renderer' =>'adminhtml/report_grid_column_renderer_currency' + 'header' => Mage::helper('reports')->__('Subtotal'), + 'width' => '80px', + 'type' => 'currency', + 'currency_code' => $currencyCode, + 'index' => 'subtotal', + 'sortable' => false, + 'renderer' => 'adminhtml/report_grid_column_renderer_currency', + 'rate' => $this->getRate($currencyCode), )); $this->addColumn('coupon_code', array( diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Customer/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Customer/Grid.php index 5ee05b2502..a4ffa4e6d3 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Customer/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Customer/Grid.php @@ -31,7 +31,7 @@ * @package Mage_Adminhtml * @author Magento Core Team */ -class Mage_Adminhtml_Block_Report_Shopcart_Customer_Grid extends Mage_Adminhtml_Block_Widget_Grid +class Mage_Adminhtml_Block_Report_Shopcart_Customer_Grid extends Mage_Adminhtml_Block_Report_Grid_Shopcart { public function __construct() @@ -83,15 +83,18 @@ protected function _prepareColumns() 'index' =>'items' )); + $currencyCode = $this->getCurrentCurrencyCode(); + $this->addColumn('total', array( 'header' =>Mage::helper('reports')->__('Total'), 'width' =>'70px', 'sortable' =>false, 'type' =>'currency', 'align' =>'right', - 'currency_code' => $this->getCurrentCurrencyCode(), + 'currency_code' => $currencyCode, 'index' =>'total', - 'renderer' =>'adminhtml/report_grid_column_renderer_currency' + 'renderer' =>'adminhtml/report_grid_column_renderer_currency', + 'rate' => $this->getRate($currencyCode), )); $this->setFilterVisibility(false); @@ -103,4 +106,3 @@ protected function _prepareColumns() } } - diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Product/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Product/Grid.php index b57898b6b4..526f13e3df 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Product/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Product/Grid.php @@ -31,7 +31,7 @@ * @package Mage_Adminhtml * @author Magento Core Team */ -class Mage_Adminhtml_Block_Report_Shopcart_Product_Grid extends Mage_Adminhtml_Block_Widget_Grid +class Mage_Adminhtml_Block_Report_Shopcart_Product_Grid extends Mage_Adminhtml_Block_Report_Grid_Shopcart { public function __construct() @@ -64,13 +64,16 @@ protected function _prepareColumns() 'index' =>'name' )); + $currencyCode = $this->getCurrentCurrencyCode(); + $this->addColumn('price', array( 'header' =>Mage::helper('reports')->__('Price'), 'width' =>'80px', 'type' =>'currency', - 'currency_code' => $this->getCurrentCurrencyCode(), + 'currency_code' => $currencyCode, 'index' =>'price', - 'renderer' =>'adminhtml/report_grid_column_renderer_currency' + 'renderer' =>'adminhtml/report_grid_column_renderer_currency', + 'rate' => $this->getRate($currencyCode), )); $this->addColumn('carts', array( diff --git a/app/code/core/Mage/Adminhtml/Block/Review/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Review/Edit/Form.php index 40df93c846..9d316785e1 100644 --- a/app/code/core/Mage/Adminhtml/Block/Review/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Review/Edit/Form.php @@ -58,11 +58,7 @@ protected function _prepareForm() )); if ($customer->getId()) { - $customerText = Mage::helper('review')->__('%2$s %3$s (%4$s)', - $this->getUrl('*/customer/edit', array('id' => $customer->getId(), 'active_tab'=>'review')), - $this->htmlEscape($customer->getFirstname()), - $this->htmlEscape($customer->getLastname()), - $this->htmlEscape($customer->getEmail())); + $customerText = Mage::helper('review')->__('%2$s %3$s (%4$s)', $this->getUrl('*/customer/edit', array('id' => $customer->getId(), 'active_tab'=>'review')), $this->escapeHtml($customer->getFirstname()), $this->escapeHtml($customer->getLastname()), $this->escapeHtml($customer->getEmail())); } else { if (is_null($review->getCustomerId())) { $customerText = Mage::helper('review')->__('Guest'); @@ -84,7 +80,9 @@ protected function _prepareForm() $fieldset->addField('detailed_rating', 'note', array( 'label' => Mage::helper('review')->__('Detailed Rating'), 'required' => true, - 'text' => '
' . $this->getLayout()->createBlock('adminhtml/review_rating_detailed')->toHtml() . '
', + 'text' => '
' + . $this->getLayout()->createBlock('adminhtml/review_rating_detailed')->toHtml() + . '
', )); $fieldset->addField('status_id', 'select', array( diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Items/Column/Name.php b/app/code/core/Mage/Adminhtml/Block/Sales/Items/Column/Name.php index 28d240c68d..7de3d48584 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Items/Column/Name.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Items/Column/Name.php @@ -34,5 +34,22 @@ */ class Mage_Adminhtml_Block_Sales_Items_Column_Name extends Mage_Adminhtml_Block_Sales_Items_Column_Default { + /** + * Add line breaks and truncate value + * + * @param string $value + * @return array + */ + public function getFormattedOption($value) + { + $_remainder = ''; + $value = Mage::helper('core/string')->truncate($value, 55, '', $_remainder); + $result = array( + 'value' => nl2br($value), + 'remainder' => nl2br($_remainder) + ); + + return $result; + } } ?> diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create.php index 9c54b053a7..78aaa25cbb 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create.php @@ -56,6 +56,8 @@ public function __construct() } $this->_updateButton('back', 'id', 'back_order_top_button'); + $this->_updateButton('back', 'onclick', 'setLocation(\'' . $this->getBackUrl() . '\')'); + $this->_updateButton('reset', 'id', 'reset_order_top_button'); if (is_null($customerId)) { @@ -64,14 +66,10 @@ public function __construct() $this->_updateButton('back', 'style', 'display:none'); } - //$this->_removeButton('back'); - $this->_updateButton('back', 'onclick', 'setLocation(\'' . $this->getUrl('*/sales_order/') . '\');'); - $confirm = Mage::helper('sales')->__('Are you sure you want to cancel this order?'); $this->_updateButton('reset', 'label', Mage::helper('sales')->__('Cancel')); $this->_updateButton('reset', 'class', 'cancel'); $this->_updateButton('reset', 'onclick', 'deleteConfirm(\''.$confirm.'\', \'' . $this->getCancelUrl() . '\')'); - } /** @@ -81,9 +79,9 @@ public function __construct() */ public function getHeaderHtml() { - $out = '
'; - $out.= $this->getLayout()->createBlock('adminhtml/sales_order_create_header')->toHtml(); - $out.= '
'; + $out = '
' + . $this->getLayout()->createBlock('adminhtml/sales_order_create_header')->toHtml() + . '
'; return $out; } @@ -118,14 +116,22 @@ public function getCancelUrl() { if ($this->_getSession()->getOrder()->getId()) { $url = $this->getUrl('*/sales_order/view', array( - 'order_id'=>Mage::getSingleton('adminhtml/session_quote')->getOrder()->getId() + 'order_id' => Mage::getSingleton('adminhtml/session_quote')->getOrder()->getId() )); - } - else { + } else { $url = $this->getUrl('*/*/cancel'); } return $url; } + /** + * Get URL for back (reset) button + * + * @return string + */ + public function getBackUrl() + { + return $this->getUrl('*/' . $this->_controller . '/'); + } } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Billing/Address.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Billing/Address.php index a49ff5fa45..6e265807c2 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Billing/Address.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Billing/Address.php @@ -68,6 +68,7 @@ protected function _prepareForm() $this->_form->setHtmlNamePrefix('order[billing_address]'); $this->_form->setHtmlIdPrefix('order-billing_address_'); + Mage::dispatchEvent('adminhtml_sales_order_billing_address_prepare_form_after', array('form' => $this)); return $this; } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form/Address.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form/Address.php index 9daeae6fe2..5d0b2b432f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form/Address.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form/Address.php @@ -154,6 +154,15 @@ protected function _prepareForm() $this->_form->setValues($this->getFormValues()); + if ($this->_form->getElement('country_id')->getValue()) { + $countryId = $this->_form->getElement('country_id')->getValue(); + $this->_form->getElement('country_id')->setValue(null); + foreach ($this->_form->getElement('country_id')->getValues() as $country) { + if ($country['value'] == $countryId) { + $this->_form->getElement('country_id')->setValue($countryId); + } + } + } if (!$this->_form->getElement('country_id')->getValue()) { $this->_form->getElement('country_id')->setValue( Mage::helper('core')->getDefaultCountry($this->getStore()) diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Cart.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Cart.php index 10e88d1ca7..7d5f718c60 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Cart.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Cart.php @@ -31,7 +31,8 @@ * @package Mage_Adminhtml * @author Magento Core Team */ -class Mage_Adminhtml_Block_Sales_Order_Create_Sidebar_Cart extends Mage_Adminhtml_Block_Sales_Order_Create_Sidebar_Abstract +class Mage_Adminhtml_Block_Sales_Order_Create_Sidebar_Cart + extends Mage_Adminhtml_Block_Sales_Order_Create_Sidebar_Abstract { /** * Storage action on selected item @@ -93,4 +94,23 @@ public function getProductId($item) { return $item->getProduct()->getId(); } + + /** + * Prepare layout + * + * Add button that clears customer's shopping cart + * + * @return Mage_Adminhtml_Block_Sales_Order_Create_Sidebar_Cart + */ + protected function _prepareLayout() + { + $button = $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array( + 'label' => Mage::helper('sales')->__('Clear Shopping Cart'), + 'onclick' => 'order.sidebarApplyChanges({\'sidebar[empty_customer_cart]\': 1})', + 'style' => 'float: right;' + )); + $this->setChild('empty_customer_cart_button', $button); + + return parent::_prepareLayout(); + } } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Create.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Create.php index 7a530e58b7..c27b6e8650 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Create.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Create.php @@ -67,20 +67,12 @@ public function getCreditmemo() public function getHeaderText() { if ($this->getCreditmemo()->getInvoice()) { - $header = Mage::helper('sales')->__('New Credit Memo for Invoice #%s', - $this->getCreditmemo()->getInvoice()->getIncrementId() - ); + $header = Mage::helper('sales')->__('New Credit Memo for Invoice #%s', $this->getCreditmemo()->getInvoice()->getIncrementId()); } else { - $header = Mage::helper('sales')->__('New Credit Memo for Order #%s', - $this->getCreditmemo()->getOrder()->getRealOrderId() - ); + $header = Mage::helper('sales')->__('New Credit Memo for Order #%s', $this->getCreditmemo()->getOrder()->getRealOrderId()); } - /*$header = Mage::helper('sales')->__('New Credit Memo for Order #%s | Order Date: %s | Customer Name: %s', - $this->getCreditmemo()->getOrder()->getRealOrderId(), - $this->formatDate($this->getCreditmemo()->getOrder()->getCreatedAt(), 'medium', true), - $this->getCreditmemo()->getOrder()->getCustomerName() - );*/ + return $header; } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/History.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/History.php index 2d62888132..dc42deee2d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/History.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/History.php @@ -54,6 +54,7 @@ public function getOrder() /** * Compose and get order full history. * Consists of the status history comments as well as of invoices, shipments and creditmemos creations + * * @return array */ public function getFullHistory() @@ -62,7 +63,7 @@ public function getFullHistory() $history = array(); foreach ($order->getAllStatusHistory() as $orderComment){ - $history[$orderComment->getEntityId()] = $this->_prepareHistoryItem( + $history[] = $this->_prepareHistoryItem( $orderComment->getStatusLabel(), $orderComment->getIsCustomerNotified(), $orderComment->getCreatedAtDate(), @@ -71,54 +72,74 @@ public function getFullHistory() } foreach ($order->getCreditmemosCollection() as $_memo){ - $history[$_memo->getEntityId()] = - $this->_prepareHistoryItem($this->__('Credit memo #%s created', $_memo->getIncrementId()), - $_memo->getEmailSent(), $_memo->getCreatedAtDate()); + $history[] = $this->_prepareHistoryItem( + $this->__('Credit memo #%s created', $_memo->getIncrementId()), + $_memo->getEmailSent(), + $_memo->getCreatedAtDate() + ); foreach ($_memo->getCommentsCollection() as $_comment){ - $history[$_comment->getEntityId()] = - $this->_prepareHistoryItem($this->__('Credit memo #%s comment added', $_memo->getIncrementId()), - $_comment->getIsCustomerNotified(), $_comment->getCreatedAtDate(), $_comment->getComment()); + $history[] = $this->_prepareHistoryItem( + $this->__('Credit memo #%s comment added', $_memo->getIncrementId()), + $_comment->getIsCustomerNotified(), + $_comment->getCreatedAtDate(), + $_comment->getComment() + ); } } foreach ($order->getShipmentsCollection() as $_shipment){ - $history[$_shipment->getEntityId()] = - $this->_prepareHistoryItem($this->__('Shipment #%s created', $_shipment->getIncrementId()), - $_shipment->getEmailSent(), $_shipment->getCreatedAtDate()); + $history[] = $this->_prepareHistoryItem( + $this->__('Shipment #%s created', $_shipment->getIncrementId()), + $_shipment->getEmailSent(), + $_shipment->getCreatedAtDate() + ); foreach ($_shipment->getCommentsCollection() as $_comment){ - $history[$_comment->getEntityId()] = - $this->_prepareHistoryItem($this->__('Shipment #%s comment added', $_shipment->getIncrementId()), - $_comment->getIsCustomerNotified(), $_comment->getCreatedAtDate(), $_comment->getComment()); + $history[] = $this->_prepareHistoryItem( + $this->__('Shipment #%s comment added', $_shipment->getIncrementId()), + $_comment->getIsCustomerNotified(), + $_comment->getCreatedAtDate(), + $_comment->getComment() + ); } } foreach ($order->getInvoiceCollection() as $_invoice){ - $history[$_invoice->getEntityId()] = - $this->_prepareHistoryItem($this->__('Invoice #%s created', $_invoice->getIncrementId()), - $_invoice->getEmailSent(), $_invoice->getCreatedAtDate()); + $history[] = $this->_prepareHistoryItem( + $this->__('Invoice #%s created', $_invoice->getIncrementId()), + $_invoice->getEmailSent(), + $_invoice->getCreatedAtDate() + ); foreach ($_invoice->getCommentsCollection() as $_comment){ - $history[$_comment->getEntityId()] = - $this->_prepareHistoryItem($this->__('Invoice #%s comment added', $_invoice->getIncrementId()), - $_comment->getIsCustomerNotified(), $_comment->getCreatedAtDate(), $_comment->getComment()); + $history[] = $this->_prepareHistoryItem( + $this->__('Invoice #%s comment added', $_invoice->getIncrementId()), + $_comment->getIsCustomerNotified(), + $_comment->getCreatedAtDate(), + $_comment->getComment() + ); } } foreach ($order->getTracksCollection() as $_track){ - $history[$_track->getEntityId()] = - $this->_prepareHistoryItem($this->__('Tracking number %s for %s assigned', $_track->getNumber(), $_track->getTitle()), - false, $_track->getCreatedAtDate()); + $history[] = $this->_prepareHistoryItem( + $this->__('Tracking number %s for %s assigned', $_track->getNumber(), $_track->getTitle()), + false, + $_track->getCreatedAtDate() + ); } - krsort($history); + usort($history, array(__CLASS__, "_sortHistoryByTimestamp")); return $history; } /** * Status history date/datetime getter + * * @param array $item + * @param string $dateType + * @param string $format * @return string */ public function getItemCreatedAt(array $item, $dateType = 'date', $format = 'medium') @@ -134,6 +155,7 @@ public function getItemCreatedAt(array $item, $dateType = 'date', $format = 'med /** * Status history item title getter + * * @param array $item * @return string */ @@ -144,7 +166,9 @@ public function getItemTitle(array $item) /** * Check whether status history comment is with customer notification + * * @param array $item + * @param boolean $isSimpleCheck * @return bool */ public function isItemNotified(array $item, $isSimpleCheck = true) @@ -157,6 +181,7 @@ public function isItemNotified(array $item, $isSimpleCheck = true) /** * Status history item comment getter + * * @param array $item * @return string */ @@ -168,10 +193,12 @@ public function getItemComment(array $item) /** * Map history items as array + * * @param string $label * @param bool $notified * @param Zend_Date $created * @param string $comment + * @return array */ protected function _prepareHistoryItem($label, $notified, $created, $comment = '') { @@ -184,38 +211,70 @@ protected function _prepareHistoryItem($label, $notified, $created, $comment = ' } /** - * ######################## TAB settings ################################# + * Get Tab Label + * + * @return string */ public function getTabLabel() { return Mage::helper('sales')->__('Comments History'); } + /** + * Get Tab Title + * + * @return string + */ public function getTabTitle() { return Mage::helper('sales')->__('Order History'); } + /** + * Get Tab Class + * + * @return string + */ public function getTabClass() { return 'ajax only'; } + /** + * Get Class + * + * @return string + */ public function getClass() { return $this->getTabClass(); } + /** + * Get Tab Url + * + * @return string + */ public function getTabUrl() { return $this->getUrl('*/*/commentsHistory', array('_current' => true)); } + /** + * Can Show Tab + * + * @return boolean + */ public function canShowTab() { return true; } + /** + * Is Hidden + * + * @return boolean + */ public function isHidden() { return false; @@ -224,11 +283,30 @@ public function isHidden() /** * Customer Notification Applicable check method * - * @param array $history + * @param array $historyItem * @return boolean */ public function isCustomerNotificationNotApplicable($historyItem) { return $historyItem['notified'] == Mage_Sales_Model_Order_Status_History::CUSTOMER_NOTIFICATION_NOT_APPLICABLE; } + + /** + * Comparison For Sorting History By Timestamp + * + * @param mixed $a + * @param mixed $b + * @return int + */ + private static function _sortHistoryByTimestamp($a, $b) + { + $createdAtA = $a['created_at']; + $createdAtB = $b['created_at']; + + /** @var $createdAta Zend_Date */ + if ($createdAtA->getTimestamp() == $createdAtB->getTimestamp()) { + return 0; + } + return ($createdAtA->getTimestamp() < $createdAtB->getTimestamp()) ? -1 : 1; + } } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Detail.php b/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Detail.php index 5a3d0b7386..2a6041227d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Detail.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Detail.php @@ -75,10 +75,7 @@ public function __construct() */ public function getHeaderText() { - return Mage::helper('sales')->__("Transaction # %s | %s", - $this->_txn->getTxnId(), - $this->formatDate($this->_txn->getCreatedAt(), Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM, true) - ); + return Mage::helper('sales')->__("Transaction # %s | %s", $this->_txn->getTxnId(), $this->formatDate($this->_txn->getCreatedAt(), Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM, true)); } protected function _toHtml() diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Detail/Grid.php b/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Detail/Grid.php index 14c18a45a8..98e8e72b02 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Detail/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Detail/Grid.php @@ -79,7 +79,8 @@ protected function _prepareColumns() 'header' => Mage::helper('sales')->__('Value'), 'index' => 'value', 'sortable' => false, - 'type' => 'text' + 'type' => 'text', + 'escape' => true )); return parent::_prepareColumns(); diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Fieldset.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Fieldset.php index e09e6e0f36..c363fca180 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Fieldset.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Fieldset.php @@ -66,20 +66,23 @@ protected function _getHeaderHtml($element) { $default = !$this->getRequest()->getParam('website') && !$this->getRequest()->getParam('store'); - $html = '
'.$element->getLegend().'
'; - $html.= ''; - $html.= '
'; - $html.= ''.$element->getLegend().''; + $html = '
' . $element->getLegend() . '
'; + $html .= ''; + $html .= '
'; + $html .= '' . $element->getLegend() . ''; if ($element->getComment()) { - $html .= '
'.$element->getComment().'
'; + $html .= '' . $element->getComment() . ''; } // field label column - $html.= ''; + $html .= '
'; if (!$default) { - $html.= ''; + $html .= ''; } - $html.= ''; + $html .= ''; return $html; } diff --git a/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Grid/Filter/Type.php b/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Grid/Filter/Type.php index b7b1aeb9cb..8b7109b313 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Grid/Filter/Type.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Grid/Filter/Type.php @@ -32,19 +32,20 @@ * @author Magento Core Team */ -class Mage_Adminhtml_Block_System_Email_Template_Grid_Filter_Type extends Mage_Adminhtml_Block_Widget_Grid_Column_Filter_Select +class Mage_Adminhtml_Block_System_Email_Template_Grid_Filter_Type + extends Mage_Adminhtml_Block_Widget_Grid_Column_Filter_Select { protected static $_types = array( - null => null, + null => null, Mage_Newsletter_Model_Template::TYPE_HTML => 'HTML', - Mage_Newsletter_Model_Template::TYPE_TEXT => 'Text', + Mage_Newsletter_Model_Template::TYPE_TEXT => 'Text', ); protected function _getOptions() { $result = array(); - foreach (self::$_types as $code=>$label) { - $result[] = array('value'=>$code, 'label'=>Mage::helper('adminhtml')->__($label)); + foreach (self::$_types as $code => $label) { + $result[] = array('value' => $code, 'label' => Mage::helper('adminhtml')->__($label)); } return $result; @@ -57,8 +58,6 @@ public function getCondition() return null; } - return array('eq'=>$this->getValue()); + return array('eq' => $this->getValue()); } - - -}// Class Mage_Adminhtml_Block_Newsletter_Queue_Grid_Filter_Status END +} diff --git a/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Grid/Renderer/Type.php b/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Grid/Renderer/Type.php index ff77ac5efb..8973b34142 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Grid/Renderer/Type.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Grid/Renderer/Type.php @@ -32,11 +32,12 @@ * @author Magento Core Team */ -class Mage_Adminhtml_Block_System_Email_Template_Grid_Renderer_Type extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract +class Mage_Adminhtml_Block_System_Email_Template_Grid_Renderer_Type + extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract { protected static $_types = array( - Mage_Newsletter_Model_Template::TYPE_HTML => 'HTML', - Mage_Newsletter_Model_Template::TYPE_TEXT => 'Text', + Mage_Newsletter_Model_Template::TYPE_HTML => 'HTML', + Mage_Newsletter_Model_Template::TYPE_TEXT => 'Text', ); public function render(Varien_Object $row) { diff --git a/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Preview.php b/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Preview.php index 7048b3d6f2..418688e4f3 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Preview.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Preview.php @@ -29,23 +29,27 @@ * * @category Mage * @package Mage_Adminhtml - * @author Magento Core Team + * @author Magento Core Team */ class Mage_Adminhtml_Block_System_Email_Template_Preview extends Mage_Adminhtml_Block_Widget { - protected function _toHtml() { + /* @var $template Mage_Core_Model_Email_Template */ $template = Mage::getModel('core/email_template'); - if($id = (int)$this->getRequest()->getParam('id')) { + if ($id = (int)$this->getRequest()->getParam('id')) { $template->load($id); } else { $template->setTemplateType($this->getRequest()->getParam('type')); $template->setTemplateText($this->getRequest()->getParam('text')); $template->setTemplateStyles($this->getRequest()->getParam('styles')); } + + /* @var $filter Mage_Core_Model_Input_Filter_MaliciousCode */ + $filter = Mage::getSingleton('core/input_filter_maliciousCode'); + $template->setTemplateText( - $this->escapeHtml($template->getTemplateText()) + $filter->filter($template->getTemplateText()) ); Varien_Profiler::start("email_template_proccessing"); @@ -53,7 +57,7 @@ protected function _toHtml() $templateProcessed = $template->getProcessedTemplate($vars, true); - if($template->isPlain()) { + if ($template->isPlain()) { $templateProcessed = "
" . htmlspecialchars($templateProcessed) . "
"; } @@ -61,5 +65,4 @@ protected function _toHtml() return $templateProcessed; } - } diff --git a/app/code/core/Mage/Adminhtml/Block/Tag/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Tag/Edit/Form.php index 420574694e..7d14ac5d60 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tag/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Tag/Edit/Form.php @@ -42,6 +42,11 @@ public function __construct() $this->setTitle(Mage::helper('tag')->__('Block Information')); } + /** + * Prepare form + * + * @return Mage_Adminhtml_Block_Widget_Form + */ protected function _prepareForm() { $model = Mage::registry('tag_tag'); @@ -50,7 +55,8 @@ protected function _prepareForm() array('id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post') ); - $fieldset = $form->addFieldset('base_fieldset', array('legend'=>Mage::helper('tag')->__('General Information'))); + $fieldset = $form->addFieldset('base_fieldset', + array('legend'=>Mage::helper('tag')->__('General Information'))); if ($model->getTagId()) { $fieldset->addField('tag_id', 'hidden', array( @@ -73,7 +79,7 @@ protected function _prepareForm() 'label' => Mage::helper('tag')->__('Tag Name'), 'title' => Mage::helper('tag')->__('Tag Name'), 'required' => true, - 'after_element_html' => ' [GLOBAL]', + 'after_element_html' => ' ' . Mage::helper('adminhtml')->__('[GLOBAL]'), )); $fieldset->addField('status', 'select', array( @@ -86,14 +92,14 @@ protected function _prepareForm() Mage_Tag_Model_Tag::STATUS_PENDING => Mage::helper('tag')->__('Pending'), Mage_Tag_Model_Tag::STATUS_APPROVED => Mage::helper('tag')->__('Approved'), ), - 'after_element_html' => ' [GLOBAL]', + 'after_element_html' => ' ' . Mage::helper('adminhtml')->__('[GLOBAL]'), )); $fieldset->addField('base_popularity', 'text', array( 'name' => 'base_popularity', 'label' => Mage::helper('tag')->__('Base Popularity'), 'title' => Mage::helper('tag')->__('Base Popularity'), - 'after_element_html' => ' [STORE VIEW]', + 'after_element_html' => ' ' . Mage::helper('tag')->__('[STORE VIEW]'), )); if (!$model->getId() && !Mage::getSingleton('adminhtml/session')->getTagData() ) { diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Form.php b/app/code/core/Mage/Adminhtml/Block/Widget/Form.php index 8ffb587e94..f70f3f04f8 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Form.php @@ -201,6 +201,7 @@ protected function _setFieldset($attributes, $fieldset, $exclude=array()) $element->setValues($attribute->getSource()->getAllOptions(true, true)); } else if ($inputType == 'multiselect') { $element->setValues($attribute->getSource()->getAllOptions(false, true)); + $element->setCanBeEmpty(true); } else if ($inputType == 'date') { $element->setImage($this->getSkinUrl('images/grid-cal.gif')); $element->setFormat( diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Form/Renderer/Fieldset/Element.php b/app/code/core/Mage/Adminhtml/Block/Widget/Form/Renderer/Fieldset/Element.php index 18037260f2..b1bd89841a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Form/Renderer/Fieldset/Element.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Form/Renderer/Fieldset/Element.php @@ -31,7 +31,8 @@ * @package Mage_Adminhtml * @author Magento Core Team */ -class Mage_Adminhtml_Block_Widget_Form_Renderer_Fieldset_Element extends Mage_Adminhtml_Block_Template implements Varien_Data_Form_Element_Renderer_Interface +class Mage_Adminhtml_Block_Widget_Form_Renderer_Fieldset_Element extends Mage_Adminhtml_Block_Template + implements Varien_Data_Form_Element_Renderer_Interface { protected $_element; diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php index 607f1720d8..7c58ced2f1 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php @@ -543,8 +543,8 @@ protected function _decodeFilter(&$value) protected function _preparePage() { - $this->getCollection()->setPageSize($this->getParam($this->getVarNameLimit(), $this->_defaultLimit)); - $this->getCollection()->setCurPage($this->getParam($this->getVarNamePage(), $this->_defaultPage)); + $this->getCollection()->setPageSize((int) $this->getParam($this->getVarNameLimit(), $this->_defaultLimit)); + $this->getCollection()->setCurPage((int) $this->getParam($this->getVarNamePage(), $this->_defaultPage)); } protected function _prepareColumns() diff --git a/app/code/core/Mage/Adminhtml/Controller/Report/Abstract.php b/app/code/core/Mage/Adminhtml/Controller/Report/Abstract.php new file mode 100644 index 0000000000..598a5f5512 --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Controller/Report/Abstract.php @@ -0,0 +1,124 @@ + + */ +abstract class Mage_Adminhtml_Controller_Report_Abstract extends Mage_Adminhtml_Controller_Action +{ + /** + * Admin session model + * + * @var null|Mage_Admin_Model_Session + */ + protected $_adminSession = null; + + /** + * Retrieve admin session model + * + * @return Mage_Admin_Model_Session + */ + protected function _getSession() + { + if (is_null($this->_adminSession)) { + $this->_adminSession = Mage::getSingleton('admin/session'); + } + return $this->_adminSession; + } + + /** + * Add report breadcrumbs + * + * @return Mage_Adminhtml_Controller_Report_Abstract + */ + public function _initAction() + { + $this->loadLayout() + ->_addBreadcrumb(Mage::helper('reports')->__('Reports'), Mage::helper('reports')->__('Reports')); + return $this; + } + + /** + * Report action init operations + * + * @param array|Varien_Object $blocks + * @return Mage_Adminhtml_Controller_Report_Abstract + */ + public function _initReportAction($blocks) + { + if (!is_array($blocks)) { + $blocks = array($blocks); + } + + $requestData = Mage::helper('adminhtml')->prepareFilterString($this->getRequest()->getParam('filter')); + $requestData = $this->_filterDates($requestData, array('from', 'to')); + $requestData['store_ids'] = $this->getRequest()->getParam('store_ids'); + $params = new Varien_Object(); + + foreach ($requestData as $key => $value) { + if (!empty($value)) { + $params->setData($key, $value); + } + } + + foreach ($blocks as $block) { + if ($block) { + $block->setPeriodType($params->getData('period_type')); + $block->setFilterData($params); + } + } + + return $this; + } + + /** + * Add refresh statistics links + * + * @param string $flagCode + * @param string $refreshCode + * @return Mage_Adminhtml_Controller_Report_Abstract + */ + protected function _showLastExecutionTime($flagCode, $refreshCode) + { + $flag = Mage::getModel('reports/flag')->setReportFlagCode($flagCode)->loadSelf(); + $updatedAt = ($flag->hasData()) + ? Mage::app()->getLocale()->storeDate( + 0, new Zend_Date($flag->getLastUpdate(), Varien_Date::DATETIME_INTERNAL_FORMAT), true + ) + : 'undefined'; + + $refreshStatsLink = $this->getUrl('*/report_statistics'); + $directRefreshLink = $this->getUrl('*/report_statistics/refreshRecent', array('code' => $refreshCode)); + + Mage::getSingleton('adminhtml/session')->addNotice(Mage::helper('adminhtml')->__('Last updated: %s. To refresh last day\'s statistics, click here.', $updatedAt, $refreshStatsLink, $directRefreshLink)); + return $this; + } +} diff --git a/app/code/core/Mage/Adminhtml/Model/Sales/Order.php b/app/code/core/Mage/Adminhtml/Model/Sales/Order.php index d079bc1e61..194d99415c 100644 --- a/app/code/core/Mage/Adminhtml/Model/Sales/Order.php +++ b/app/code/core/Mage/Adminhtml/Model/Sales/Order.php @@ -71,9 +71,7 @@ public function checkRelation(Mage_Sales_Model_Order $order) foreach ($order->getAllItems() as $item) { if (!$productCollection->getItemById($item->getProductId())) { $this->_getSession()->addError( - Mage::helper('adminhtml')->__('The item %s (SKU %s) does not exist in the catalog anymore.', - $item->getName(), - $item->getSku() + Mage::helper('adminhtml')->__('The item %s (SKU %s) does not exist in the catalog anymore.', $item->getName(), $item->getSku() )); $hasBadItems = true; } diff --git a/app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php b/app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php index f8b15930a9..f34da5e269 100644 --- a/app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php +++ b/app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php @@ -633,6 +633,9 @@ public function applySidebarData($data) $this->removeItem($itemId, $from); } } + if (isset($data['empty_customer_cart']) && (int)$data['empty_customer_cart'] == 1) { + $this->getCustomerCart()->removeAllItems()->collectTotals()->save(); + } return $this; } @@ -716,6 +719,8 @@ public function addProduct($product, $config = 1) $stockItem = $product->getStockItem(); if ($stockItem && $stockItem->getIsQtyDecimal()) { $product->setIsQtyDecimal(1); + } else { + $config->setQty((int) $config->getQty()); } $product->setCartQty($config->getQty()); @@ -1305,21 +1310,28 @@ protected function _setCustomerData(Mage_Customer_Model_Customer $customer) /** * Prepare quote customer + * + * @return Mage_Adminhtml_Model_Sales_Order_Create */ public function _prepareCustomer() { + /** @var $quote Mage_Sales_Model_Quote */ $quote = $this->getQuote(); if ($quote->getCustomerIsGuest()) { return $this; } - $customer = $this->getSession()->getCustomer(); - $store = $this->getSession()->getStore(); - $customerIsInStore = $this->_customerIsInStore($store); - $billingAddress = null; - $shippingAddress = null; + /** @var $customer Mage_Customer_Model_Customer */ + $customer = $this->getSession()->getCustomer(); + /** @var $store Mage_Core_Model_Store */ + $store = $this->getSession()->getStore(); + + $customerIsInStore = $this->_customerIsInStore($store); + $customerBillingAddress = null; + $customerShippingAddress = null; if ($customer->getId()) { + // Create new customer if customer is not registered in specified store if (!$customerIsInStore) { $customer->setId(null) ->setStore($store) @@ -1328,70 +1340,82 @@ public function _prepareCustomer() ->setPassword($customer->generatePassword()); $this->_setCustomerData($customer); } - if ($this->getBillingAddress()->getSaveInAddressBook() || !$customerIsInStore) { - $billingAddress = $this->getBillingAddress()->exportCustomerAddress(); + + if ($this->getBillingAddress()->getSaveInAddressBook()) { + /** @var $customerBillingAddress Mage_Customer_Model_Address */ + $customerBillingAddress = $this->getBillingAddress()->exportCustomerAddress(); $customerAddressId = $this->getBillingAddress()->getCustomerAddressId(); if ($customerAddressId && $customer->getId()) { - $customer->getAddressItemById($customerAddressId)->addData($billingAddress->getData()); + $customer->getAddressItemById($customerAddressId)->addData($customerBillingAddress->getData()); } else { - $customer->addAddress($billingAddress); + $customer->addAddress($customerBillingAddress); } } - if (!$this->getQuote()->isVirtual() && ($this->getShippingAddress()->getSaveInAddressBook() - || !$customerIsInStore) - ) { - $shippingAddress = $this->getShippingAddress()->exportCustomerAddress(); + + if (!$this->getQuote()->isVirtual() && $this->getShippingAddress()->getSaveInAddressBook()) { + /** @var $customerShippingAddress Mage_Customer_Model_Address */ + $customerShippingAddress = $this->getShippingAddress()->exportCustomerAddress(); $customerAddressId = $this->getShippingAddress()->getCustomerAddressId(); if ($customerAddressId && $customer->getId()) { - $customer->getAddressItemById($customerAddressId)->addData($shippingAddress->getData()); + $customer->getAddressItemById($customerAddressId)->addData($customerShippingAddress->getData()); } elseif (!empty($customerAddressId) - && $billingAddress !== null + && $customerBillingAddress !== null && $this->getBillingAddress()->getCustomerAddressId() == $customerAddressId ) { - $billingAddress->setIsDefaultShipping(true); + $customerBillingAddress->setIsDefaultShipping(true); } else { - $customer->addAddress($shippingAddress); + $customer->addAddress($customerShippingAddress); } } - if (is_null($customer->getDefaultBilling()) && $billingAddress) { - $billingAddress->setIsDefaultBilling(true); + if (is_null($customer->getDefaultBilling()) && $customerBillingAddress) { + $customerBillingAddress->setIsDefaultBilling(true); } + if (is_null($customer->getDefaultShipping())) { - if ($this->getShippingAddress()->getSameAsBilling() && $billingAddress) { - $billingAddress->setIsDefaultShipping(true); - } elseif ($shippingAddress) { - $shippingAddress->setIsDefaultShipping(true); + if ($this->getShippingAddress()->getSameAsBilling() && $customerBillingAddress) { + $customerBillingAddress->setIsDefaultShipping(true); + } elseif ($customerShippingAddress) { + $customerShippingAddress->setIsDefaultShipping(true); } } } else { - $customer->addData($this->getBillingAddress()->exportCustomerAddress()->getData()) + // Prepare new customer + /** @var $customerBillingAddress Mage_Customer_Model_Address */ + $customerBillingAddress = $this->getBillingAddress()->exportCustomerAddress(); + $customer->addData($customerBillingAddress->getData()) ->setPassword($customer->generatePassword()) ->setStore($store); $customer->setEmail($this->_getNewCustomerEmail($customer)); $this->_setCustomerData($customer); - $customerBilling = $this->getBillingAddress()->exportCustomerAddress(); - $customerBilling->setIsDefaultBilling(true); - $customer->addAddress($customerBilling); + if ($this->getBillingAddress()->getSaveInAddressBook()) { + $customerBillingAddress->setIsDefaultBilling(true); + $customer->addAddress($customerBillingAddress); + } - $shipping = $this->getShippingAddress(); - if (!$this->getQuote()->isVirtual() && !$shipping->getSameAsBilling()) { - $customerShipping = $shipping->exportCustomerAddress(); - $customerShipping->setIsDefaultShipping(true); - $customer->addAddress($customerShipping); + /** @var $shippingAddress Mage_Sales_Model_Quote_Address */ + $shippingAddress = $this->getShippingAddress(); + if (!$this->getQuote()->isVirtual() + && !$shippingAddress->getSameAsBilling() + && $shippingAddress->getSaveInAddressBook() + ) { + /** @var $customerShippingAddress Mage_Customer_Model_Address */ + $customerShippingAddress = $shippingAddress->exportCustomerAddress(); + $customerShippingAddress->setIsDefaultShipping(true); + $customer->addAddress($customerShippingAddress); } else { - $customerBilling->setIsDefaultShipping(true); + $customerBillingAddress->setIsDefaultShipping(true); } } - // set quote customer data to customer + // Set quote customer data to customer $this->_setCustomerData($customer); - // set customer to quote and convert customer data to quote + // Set customer to quote and convert customer data to quote $quote->setCustomer($customer); - // add user defined attributes to quote + // Add user defined attributes to quote $form = $this->_getCustomerForm()->setEntity($customer); foreach ($form->getUserAttributes() as $attribute) { $quoteCode = sprintf('customer_%s', $attribute->getAttributeCode()); @@ -1399,7 +1423,7 @@ public function _prepareCustomer() } if ($customer->getId()) { - // we should not change account data for existing customer, so restore it + // Restore account data for existing customer $this->_getCustomerForm() ->setEntity($customer) ->resetEntityData(); diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Password/Link/Expirationperiod.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Password/Link/Expirationperiod.php index 28ccc7562b..c0b48d180a 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Password/Link/Expirationperiod.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Password/Link/Expirationperiod.php @@ -43,7 +43,8 @@ protected function _beforeSave() { parent::_beforeSave(); $resetPasswordLinkExpirationPeriod = (int) $this->getValue(); - if ($resetPasswordLinkExpirationPeriod < 0) { + // This value must be greater than 0 + if ($resetPasswordLinkExpirationPeriod < 1) { $resetPasswordLinkExpirationPeriod = (int) $this->getOldValue(); } $this->setValue((string) $resetPasswordLinkExpirationPeriod); diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Customer/GroupAutoAssign.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Customer/GroupAutoAssign.php new file mode 100644 index 0000000000..b2c7c22d26 --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Customer/GroupAutoAssign.php @@ -0,0 +1,57 @@ + + */ +class Mage_Adminhtml_Model_System_Config_Backend_Customer_GroupAutoAssign extends Mage_Core_Model_Config_Data +{ + /** + * If merchant country is not in EU, VAT Validation should be disabled + * + * @return Mage_Core_Model_Abstract + */ + protected function _beforeSave() + { + $storeId = $this->getScopeId(); + $merchantCountry = Mage::getStoreConfig('general/store_information/merchant_country', $storeId); + + if (!Mage::helper('core')->isCountryInEU($merchantCountry, $storeId)) { + Mage::getConfig()->saveConfig( + Mage_Customer_Helper_Address::XML_PATH_VAT_VALIDATION_ENABLED, + 0, + $this->getScope(), + $storeId + ); + } + + return parent::_beforeSave(); + } +} diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Customer/Password/Link/Expirationperiod.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Customer/Password/Link/Expirationperiod.php index 90dbb07a12..c64ddee4d1 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Customer/Password/Link/Expirationperiod.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Customer/Password/Link/Expirationperiod.php @@ -44,7 +44,8 @@ protected function _beforeSave() { parent::_beforeSave(); $resetPasswordLinkExpirationPeriod = (int) $this->getValue(); - if ($resetPasswordLinkExpirationPeriod < 0) { + // This value must be greater than 0 + if ($resetPasswordLinkExpirationPeriod < 1) { $resetPasswordLinkExpirationPeriod = (int) $this->getOldValue(); } $this->setValue((string) $resetPasswordLinkExpirationPeriod); diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Filename.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Filename.php new file mode 100644 index 0000000000..95a11f853a --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Filename.php @@ -0,0 +1,37 @@ +getValue(); + $value = basename($value); + $this->setValue($value); + return $this; + } +} diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Locale.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Locale.php index 4fa95f2b34..bf230e8af3 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Locale.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Locale.php @@ -48,8 +48,11 @@ protected function _afterSave() $values = explode(',', $this->getValue()); $exceptions = array(); + foreach ($collection as $data) { $match = false; + $scopeName = Mage::helper('adminhtml')->__('Default scope'); + if (preg_match('/(base|default)$/', $data->getPath(), $match)) { if (!in_array($data->getValue(), $values)) { $currencyName = Mage::app()->getLocale()->currency($data->getValue())->getName(); @@ -76,11 +79,7 @@ protected function _afterSave() break; } - $exceptions[] = Mage::helper('adminhtml')->__('Currency "%s" is used as %s in %s.', - $currencyName, - $fieldName, - $scopeName - ); + $exceptions[] = Mage::helper('adminhtml')->__('Currency "%s" is used as %s in %s.', $currencyName, $fieldName, $scopeName); } } } diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Dev/Dbautoup.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Dev/Dbautoup.php index a1ef51b6ae..c30d1cba54 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Dev/Dbautoup.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Dev/Dbautoup.php @@ -27,11 +27,10 @@ class Mage_Adminhtml_Model_System_Config_Source_Dev_Dbautoup { public function toOptionArray() { - $hlp = Mage::helper('adminhtml'); return array( - array('value'=>Mage_Core_Model_Resource::AUTO_UPDATE_ALWAYS, 'label'=>$hlp->__('Always (during development)')), - array('value'=>Mage_Core_Model_Resource::AUTO_UPDATE_ONCE, 'label'=>$hlp->__('Only Once (version upgrade)')), - array('value'=>Mage_Core_Model_Resource::AUTO_UPDATE_NEVER, 'label'=>$hlp->__('Never (production)')), + array('value'=>Mage_Core_Model_Resource::AUTO_UPDATE_ALWAYS, 'label' => Mage::helper('adminhtml')->__('Always (during development)')), + array('value'=>Mage_Core_Model_Resource::AUTO_UPDATE_ONCE, 'label' => Mage::helper('adminhtml')->__('Only Once (version upgrade)')), + array('value'=>Mage_Core_Model_Resource::AUTO_UPDATE_NEVER, 'label' => Mage::helper('adminhtml')->__('Never (production)')), ); } diff --git a/app/code/core/Mage/Adminhtml/Model/System/Store.php b/app/code/core/Mage/Adminhtml/Model/System/Store.php index e35d179e08..2e36c7ad1b 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Store.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Store.php @@ -488,7 +488,7 @@ public function getStoreNamePath($storeId) if (isset($this->_storeCollection[$storeId])) { $data = $this->_storeCollection[$storeId]; $name .= $this->getWebsiteName($data->getWebsiteId()); - $name .= ($name ? '/' : '').$this->getGroupName($data->getGroupId()); + $name .= ($name ? '/' : '') . $this->getGroupName($data->getGroupId()); } } return $name; diff --git a/app/code/core/Mage/Adminhtml/controllers/Catalog/CategoryController.php b/app/code/core/Mage/Adminhtml/controllers/Catalog/CategoryController.php index 01d729a522..0d040515fb 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Catalog/CategoryController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Catalog/CategoryController.php @@ -107,7 +107,7 @@ public function editAction() $_prevStoreId = Mage::getSingleton('admin/session') ->getLastViewedStore(true); - if ($_prevStoreId != null && !$this->getRequest()->getQuery('isAjax')) { + if (!empty($_prevStoreId) && !$this->getRequest()->getQuery('isAjax')) { $params['store'] = $_prevStoreId; $redirect = true; } diff --git a/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/Action/AttributeController.php b/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/Action/AttributeController.php index 5767b7ab67..45bdca7127 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/Action/AttributeController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/Action/AttributeController.php @@ -107,7 +107,10 @@ public function saveAction() ->updateAttributes($this->_getHelper()->getProductIds(), $attributesData, $storeId); } if ($inventoryData) { + /** @var $stockItem Mage_CatalogInventory_Model_Stock_Item */ $stockItem = Mage::getModel('cataloginventory/stock_item'); + $stockItem->setProcessIndexEvents(false); + $stockItemSaved = false; foreach ($this->_getHelper()->getProductIds() as $productId) { $stockItem->setData(array()); @@ -123,8 +126,16 @@ public function saveAction() } if ($stockDataChanged) { $stockItem->save(); + $stockItemSaved = true; } } + + if ($stockItemSaved) { + Mage::getSingleton('index/indexer')->indexEvents( + Mage_CatalogInventory_Model_Stock_Item::ENTITY, + Mage_Index_Model_Event::TYPE_SAVE + ); + } } if ($websiteAddData || $websiteRemoveData) { @@ -152,8 +163,7 @@ public function saveAction() } $this->_getSession()->addSuccess( - $this->__('Total of %d record(s) were updated', - count($this->_getHelper()->getProductIds())) + $this->__('Total of %d record(s) were updated', count($this->_getHelper()->getProductIds())) ); } catch (Mage_Core_Exception $e) { diff --git a/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/AttributeController.php b/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/AttributeController.php index 90af67c2d1..fe4ee451e1 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/AttributeController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/AttributeController.php @@ -158,27 +158,9 @@ protected function _filterPostData($data) //labels foreach ($data['frontend_label'] as & $value) { if ($value) { - $value = $helperCatalog->escapeHtml($value); + $value = $helperCatalog->stripTags($value); } } - //options - if (!empty($data['option']['value'])) { - foreach ($data['option']['value'] as &$options) { - foreach ($options as &$label) { - $label = $helperCatalog->escapeHtml($label); - } - } - } - //default value - if (!empty($data['default_value'])) { - $data['default_value'] = $helperCatalog->escapeHtml($data['default_value']); - } - if (!empty($data['default_value_text'])) { - $data['default_value_text'] = $helperCatalog->escapeHtml($data['default_value_text']); - } - if (!empty($data['default_value_textarea'])) { - $data['default_value_textarea'] = $helperCatalog->escapeHtml($data['default_value_textarea']); - } } return $data; } @@ -203,7 +185,8 @@ public function saveAction() $validatorAttrCode = new Zend_Validate_Regex(array('pattern' => '/^[a-z][a-z_0-9]{1,254}$/')); if (!$validatorAttrCode->isValid($data['attribute_code'])) { $session->addError( - $helper->__('Attribute code is invalid. Please use only letters (a-z), numbers (0-9) or underscore(_) in this field, first character should be a letter.')); + Mage::helper('catalog')->__('Attribute code is invalid. Please use only letters (a-z), numbers (0-9) or underscore(_) in this field, first character should be a letter.') + ); $this->_redirect('*/*/edit', array('attribute_id' => $id, '_current' => true)); return; } diff --git a/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php b/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php index 5370900190..4917332e54 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php @@ -552,12 +552,7 @@ protected function _initProductSave() $product = $this->_initProduct(); $productData = $this->getRequest()->getPost('product'); if ($productData) { - if (!isset($productData['stock_data']['use_config_manage_stock'])) { - $productData['stock_data']['use_config_manage_stock'] = 0; - } - if (isset($productData['stock_data']['qty']) && (float)$productData['stock_data']['qty'] > self::MAX_QTY_VALUE) { - $productData['stock_data']['qty'] = self::MAX_QTY_VALUE; - } + $this->_filterStockData($productData['stock_data']); } /** @@ -669,6 +664,23 @@ protected function _initProductSave() return $product; } + /** + * Filter product stock data + * + * @param array $stockData + */ + protected function _filterStockData(&$stockData) { + if (!isset($stockData['use_config_manage_stock'])) { + $stockData['use_config_manage_stock'] = 0; + } + if (isset($stockData['qty']) && (float)$stockData['qty'] > self::MAX_QTY_VALUE) { + $stockData['qty'] = self::MAX_QTY_VALUE; + } + if (isset($stockData['min_qty']) && (int)$stockData['min_qty'] < 0) { + $stockData['min_qty'] = 0; + } + } + public function categoriesJsonAction() { $product = $this->_initProduct(); @@ -691,9 +703,8 @@ public function saveAction() $data = $this->getRequest()->getPost(); if ($data) { - if (!isset($data['product']['stock_data']['use_config_manage_stock'])) { - $data['product']['stock_data']['use_config_manage_stock'] = 0; - } + $this->_filterStockData($data['product']['stock_data']); + $product = $this->_initProductSave(); try { diff --git a/app/code/core/Mage/Adminhtml/controllers/Catalog/SearchController.php b/app/code/core/Mage/Adminhtml/controllers/Catalog/SearchController.php index fe1cf4ffc2..62a413db3b 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Catalog/SearchController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Catalog/SearchController.php @@ -178,9 +178,7 @@ public function massDeleteAction() $model->delete(); } Mage::getSingleton('adminhtml/session')->addSuccess( - Mage::helper('adminhtml')->__( - 'Total of %d record(s) were deleted', count($searchIds) - ) + Mage::helper('adminhtml')->__('Total of %d record(s) were deleted', count($searchIds)) ); } catch (Exception $e) { Mage::getSingleton('adminhtml/session')->addError($e->getMessage()); diff --git a/app/code/core/Mage/Adminhtml/controllers/Checkout/AgreementController.php b/app/code/core/Mage/Adminhtml/controllers/Checkout/AgreementController.php index f55eb7ffef..a92e91c0be 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Checkout/AgreementController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Checkout/AgreementController.php @@ -54,11 +54,13 @@ public function editAction() $id = $this->getRequest()->getParam('id'); $agreementModel = Mage::getModel('checkout/agreement'); - $hlp = Mage::helper('checkout'); + if ($id) { $agreementModel->load($id); if (!$agreementModel->getId()) { - Mage::getSingleton('adminhtml/session')->addError($hlp->__('This condition no longer exists.')); + Mage::getSingleton('adminhtml/session')->addError( + Mage::helper('checkout')->__('This condition no longer exists.') + ); $this->_redirect('*/*/'); return; } @@ -74,7 +76,7 @@ public function editAction() Mage::register('checkout_agreement', $agreementModel); $this->_initAction() - ->_addBreadcrumb($id ? $hlp->__('Edit Condition') : $hlp->__('New Condition'), $id ? $hlp->__('Edit Condition') : $hlp->__('New Condition')) + ->_addBreadcrumb($id ? Mage::helper('checkout')->__('Edit Condition') : Mage::helper('checkout')->__('New Condition'), $id ? Mage::helper('checkout')->__('Edit Condition') : Mage::helper('checkout')->__('New Condition')) ->_addContent($this->getLayout()->createBlock('adminhtml/checkout_agreement_edit')->setData('action', $this->getUrl('*/*/save'))) ->renderLayout(); } diff --git a/app/code/core/Mage/Adminhtml/controllers/Customer/System/Config/ValidatevatController.php b/app/code/core/Mage/Adminhtml/controllers/Customer/System/Config/ValidatevatController.php new file mode 100644 index 0000000000..75be29f450 --- /dev/null +++ b/app/code/core/Mage/Adminhtml/controllers/Customer/System/Config/ValidatevatController.php @@ -0,0 +1,85 @@ + + */ +class Mage_Adminhtml_Customer_System_Config_ValidatevatController extends Mage_Adminhtml_Controller_Action +{ + /** + * Perform customer VAT ID validation + * + * @return Varien_Object + */ + protected function _validate() + { + return Mage::helper('customer')->checkVatNumber( + $this->getRequest()->getParam('country'), + $this->getRequest()->getParam('vat') + ); + } + + /** + * Check whether vat is valid + * + * @return void + */ + public function validateAction() + { + $result = $this->_validate(); + $this->getResponse()->setBody((int)$result->getIsValid()); + } + + /** + * Retrieve validation result as JSON + * + * @return void + */ + public function validateAdvancedAction() + { + /** @var $coreHelper Mage_Core_Helper_Data */ + $coreHelper = Mage::helper('core'); + + $result = $this->_validate(); + $valid = $result->getIsValid(); + $success = $result->getRequestSuccess(); + + $groupId = Mage::helper('customer')->getCustomerGroupIdBasedOnVatNumber( + $this->getRequest()->getParam('country'), $result + ); + + $body = $coreHelper->jsonEncode(array( + 'valid' => $valid, + 'group' => $groupId, + 'success' => $success + )); + $this->getResponse()->setBody($body); + } +} diff --git a/app/code/core/Mage/Adminhtml/controllers/CustomerController.php b/app/code/core/Mage/Adminhtml/controllers/CustomerController.php index 7e43cb9ab6..c5296bbb9c 100644 --- a/app/code/core/Mage/Adminhtml/controllers/CustomerController.php +++ b/app/code/core/Mage/Adminhtml/controllers/CustomerController.php @@ -86,7 +86,7 @@ public function indexAction() public function gridAction() { $this->loadLayout(); - $this->getResponse()->setBody($this->getLayout()->createBlock('adminhtml/customer_grid')->toHtml()); + $this->renderLayout(); } /** @@ -186,21 +186,27 @@ public function saveAction() { $data = $this->getRequest()->getPost(); if ($data) { - $redirectBack = $this->getRequest()->getParam('back', false); + $redirectBack = $this->getRequest()->getParam('back', false); $this->_initCustomer('customer_id'); - /* @var $customer Mage_Customer_Model_Customer */ + /** @var $customer Mage_Customer_Model_Customer */ $customer = Mage::registry('current_customer'); - /* @var $customerForm Mage_Customer_Model_Form */ + /** @var $customerForm Mage_Customer_Model_Form */ $customerForm = Mage::getModel('customer/form'); $customerForm->setEntity($customer) ->setFormCode('adminhtml_customer') ->ignoreInvisible(false) ; - $formData = $customerForm->extractData($this->getRequest(), 'account'); - $errors = $customerForm->validateData($formData); + $formData = $customerForm->extractData($this->getRequest(), 'account'); + + // Handle 'disable auto_group_change' attribute + if (isset($formData['disable_auto_group_change'])) { + $formData['disable_auto_group_change'] = empty($formData['disable_auto_group_change']) ? '0' : '1'; + } + + $errors = $customerForm->validateData($formData); if ($errors !== true) { foreach ($errors as $error) { $this->_getSession()->addError($error); @@ -212,14 +218,14 @@ public function saveAction() $customerForm->compactData($formData); - // unset template data + // Unset template data if (isset($data['address']['_template_'])) { unset($data['address']['_template_']); } $modifiedAddresses = array(); if (!empty($data['address'])) { - /* @var $addressForm Mage_Customer_Model_Form */ + /** @var $addressForm Mage_Customer_Model_Form */ $addressForm = Mage::getModel('customer/form'); $addressForm->setFormCode('adminhtml_customer_address')->ignoreInvisible(false); @@ -232,7 +238,10 @@ public function saveAction() $requestScope = sprintf('address/%s', $index); $formData = $addressForm->setEntity($address) ->extractData($this->getRequest(), $requestScope); - $errors = $addressForm->validateData($formData); + + $address->setIsDefaultBilling($data['account']['default_billing'] == $index); + + $errors = $addressForm->validateData($formData); if ($errors !== true) { foreach ($errors as $error) { $this->_getSession()->addError($error); @@ -257,7 +266,7 @@ public function saveAction() } } - // default billing and shipping + // Default billing and shipping if (isset($data['account']['default_billing'])) { $customer->setData('default_billing', $data['account']['default_billing']); } @@ -268,17 +277,15 @@ public function saveAction() $customer->setData('confirmation', $data['account']['confirmation']); } - // not modified customer addresses mark for delete + // Mark not modified customer addresses for delete foreach ($customer->getAddressesCollection() as $customerAddress) { if ($customerAddress->getId() && !in_array($customerAddress->getId(), $modifiedAddresses)) { $customerAddress->setData('_deleted', true); } } - if (isset($data['subscription'])) { - $customer->setIsSubscribed(true); - } else { - $customer->setIsSubscribed(false); + if (Mage::getSingleton('admin/session')->isAllowed('customer/newsletter')) { + $customer->setIsSubscribed(isset($data['subscription'])); } if (isset($data['account']['sendemail_store_id'])) { @@ -288,7 +295,7 @@ public function saveAction() $isNewCustomer = $customer->isObjectNew(); try { $sendPassToEmail = false; - // force new customer active + // Force new customer confirmation if ($isNewCustomer) { $customer->setPassword($data['account']['password']); $customer->setForceConfirmed(true); @@ -305,14 +312,13 @@ public function saveAction() $customer->save(); - // send welcome email + // Send welcome email if ($customer->getWebsiteId() && (isset($data['account']['sendemail']) || $sendPassToEmail)) { $storeId = $customer->getSendemailStoreId(); if ($isNewCustomer) { $customer->sendNewAccountEmail('registered', '', $storeId); - } - // confirm not confirmed customer - else if ((!$customer->getConfirmation())) { + } elseif ((!$customer->getConfirmation())) { + // Confirm not confirmed customer $customer->sendNewAccountEmail('confirmed', '', $storeId); } } @@ -336,8 +342,8 @@ public function saveAction() if ($redirectBack) { $this->_redirect('*/*/edit', array( - 'id' => $customer->getId(), - '_current'=>true + 'id' => $customer->getId(), + '_current' => true )); return; } @@ -401,7 +407,8 @@ protected function _sendUploadResponse($fileName, $content, $contentType='applic */ public function ordersAction() { $this->_initCustomer(); - $this->getResponse()->setBody($this->getLayout()->createBlock('adminhtml/customer_edit_tab_orders')->toHtml()); + $this->loadLayout(); + $this->renderLayout(); } /** @@ -410,8 +417,8 @@ public function ordersAction() { */ public function lastOrdersAction() { $this->_initCustomer(); - $this->getResponse()->setBody( - $this->getLayout()->createBlock('adminhtml/customer_edit_tab_view_orders')->toHtml()); + $this->loadLayout(); + $this->renderLayout(); } /** @@ -425,8 +432,8 @@ public function newsletterAction() ->loadByCustomer(Mage::registry('current_customer')); Mage::register('subscriber', $subscriber); - $this->getResponse()->setBody( - $this->getLayout()->createBlock('adminhtml/customer_edit_tab_newsletter_grid')->toHtml()); + $this->loadLayout(); + $this->renderLayout(); } public function wishlistAction() @@ -459,8 +466,8 @@ public function wishlistAction() public function viewWishlistAction() { $this->_initCustomer(); - $this->getResponse()->setBody( - $this->getLayout()->createBlock('adminhtml/customer_edit_tab_view_wishlist')->toHtml()); + $this->loadLayout(); + $this->renderLayout(); } /** @@ -486,10 +493,9 @@ public function cartAction() } } - $this->getResponse()->setBody( - $this->getLayout()->createBlock('adminhtml/customer_edit_tab_cart', 'admin.customer.view.cart', - array('website_id'=>$websiteId))->toHtml() - ); + $this->loadLayout(); + $this->getLayout()->getBlock('admin.customer.view.edit.cart')->setWebsiteId($websiteId); + $this->renderLayout(); } /** @@ -499,57 +505,62 @@ public function cartAction() public function viewCartAction() { $this->_initCustomer(); - - $this->getResponse()->setBody( - $this->getLayout()->createBlock('adminhtml/customer_edit_tab_view_cart', 'admin.customer.view.cart') - ->setWebsiteId($this->getRequest()->getParam('website_id')) - ->toHtml() - ); + $layout = $this->loadLayout() + ->getLayout() + ->getBlock('admin.customer.view.cart') + ->setWebsiteId(); + $this->renderLayout(); } /** * Get shopping carts from all websites for specified client * - * @return string */ public function cartsAction() { $this->_initCustomer(); - $this->getResponse()->setBody( - $this->getLayout()->createBlock('adminhtml/customer_edit_tab_carts', 'admin.customer.carts')->toHtml() - ); + $this->loadLayout(); + $this->renderLayout(); } + /** + * Get customer's product reviews list + * + */ public function productReviewsAction() { $this->_initCustomer(); - $this->getResponse()->setBody( - $this->getLayout()->createBlock('adminhtml/customer_edit_tab_reviews', 'admin.customer.reviews') - ->setCustomerId(Mage::registry('current_customer')->getId()) - ->setUseAjax(true) - ->toHtml() - ); + $this->loadLayout() + ->getLayout() + ->getBlock('admin.customer.reviews') + ->setCustomerId(Mage::registry('current_customer')->getId()) + ->setUseAjax(true); + $this->renderLayout(); } + /** + * Get customer's tags list + * + */ public function productTagsAction() { $this->_initCustomer(); - $this->getResponse()->setBody( - $this->getLayout()->createBlock('adminhtml/customer_edit_tab_tag', 'admin.customer.tags') - ->setCustomerId(Mage::registry('current_customer')->getId()) - ->setUseAjax(true) - ->toHtml() - ); + $this->loadLayout() + ->getLayout() + ->getBlock('admin.customer.tags') + ->setCustomerId(Mage::registry('current_customer')->getId()) + ->setUseAjax(true); + $this->renderLayout(); } public function tagGridAction() { $this->_initCustomer(); - $this->getResponse()->setBody( - $this->getLayout()->createBlock('adminhtml/customer_edit_tab_tag', 'admin.customer.tags') - ->setCustomerId(Mage::registry('current_customer')) - ->toHtml() + $this->loadLayout(); + $this->getLayout()->getBlock('admin.customer.tags')->setCustomerId( + Mage::registry('current_customer') ); + $this->renderLayout(); } public function validateAction() @@ -650,9 +661,7 @@ public function massSubscribeAction() $customer->save(); } Mage::getSingleton('adminhtml/session')->addSuccess( - Mage::helper('adminhtml')->__( - 'Total of %d record(s) were updated.', count($customersIds) - ) + Mage::helper('adminhtml')->__('Total of %d record(s) were updated.', count($customersIds)) ); } catch (Exception $e) { Mage::getSingleton('adminhtml/session')->addError($e->getMessage()); @@ -674,9 +683,7 @@ public function massUnsubscribeAction() $customer->save(); } Mage::getSingleton('adminhtml/session')->addSuccess( - Mage::helper('adminhtml')->__( - 'Total of %d record(s) were updated.', count($customersIds) - ) + Mage::helper('adminhtml')->__('Total of %d record(s) were updated.', count($customersIds)) ); } catch (Exception $e) { Mage::getSingleton('adminhtml/session')->addError($e->getMessage()); @@ -700,9 +707,7 @@ public function massDeleteAction() ->delete(); } Mage::getSingleton('adminhtml/session')->addSuccess( - Mage::helper('adminhtml')->__( - 'Total of %d record(s) were deleted.', count($customersIds) - ) + Mage::helper('adminhtml')->__('Total of %d record(s) were deleted.', count($customersIds)) ); } catch (Exception $e) { Mage::getSingleton('adminhtml/session')->addError($e->getMessage()); @@ -725,9 +730,7 @@ public function massAssignGroupAction() $customer->save(); } Mage::getSingleton('adminhtml/session')->addSuccess( - Mage::helper('adminhtml')->__( - 'Total of %d record(s) were updated.', count($customersIds) - ) + Mage::helper('adminhtml')->__('Total of %d record(s) were updated.', count($customersIds)) ); } catch (Exception $e) { Mage::getSingleton('adminhtml/session')->addError($e->getMessage()); diff --git a/app/code/core/Mage/Adminhtml/controllers/DashboardController.php b/app/code/core/Mage/Adminhtml/controllers/DashboardController.php index 5edfd5d892..709d5095a2 100644 --- a/app/code/core/Mage/Adminhtml/controllers/DashboardController.php +++ b/app/code/core/Mage/Adminhtml/controllers/DashboardController.php @@ -43,19 +43,34 @@ public function indexAction() $this->renderLayout(); } + /** + * Gets most viewed products list + * + */ public function productsViewedAction() { - $this->getResponse()->setBody($this->getLayout()->createBlock('adminhtml/dashboard_tab_products_viewed')->toHtml()); + $this->loadLayout(); + $this->renderLayout(); } + /** + * Gets latest customers list + * + */ public function customersNewestAction() { - $this->getResponse()->setBody($this->getLayout()->createBlock('adminhtml/dashboard_tab_customers_newest')->toHtml()); + $this->loadLayout(); + $this->renderLayout(); } + /** + * Gets the list of most active customers + * + */ public function customersMostAction() { - $this->getResponse()->setBody($this->getLayout()->createBlock('adminhtml/dashboard_tab_customers_most')->toHtml()); + $this->loadLayout(); + $this->renderLayout(); } public function ajaxBlockAction() diff --git a/app/code/core/Mage/Adminhtml/controllers/IndexController.php b/app/code/core/Mage/Adminhtml/controllers/IndexController.php index 20960f7537..7bf1be892f 100644 --- a/app/code/core/Mage/Adminhtml/controllers/IndexController.php +++ b/app/code/core/Mage/Adminhtml/controllers/IndexController.php @@ -76,15 +76,10 @@ public function loginAction() return; } $loginData = $this->getRequest()->getParam('login'); - $data = array(); + $username = (is_array($loginData) && array_key_exists('username', $loginData)) ? $loginData['username'] : null; - if(is_array($loginData) && array_key_exists('username', $loginData)) { - $data['username'] = $loginData['username']; - } else { - $data['username'] = null; - } - - $this->_outTemplate('login', $data); + $this->loadLayout(); + $this->renderLayout(); } /** @@ -229,36 +224,41 @@ protected function _getDeniedIframe() */ public function forgotpasswordAction() { - $email = $this->getRequest()->getParam('email'); + $email = (string) $this->getRequest()->getParam('email'); $params = $this->getRequest()->getParams(); + if (!empty($email) && !empty($params)) { - $collection = Mage::getResourceModel('admin/user_collection'); - /** @var $collection Mage_Admin_Model_Mysql4_User_Collection */ - $collection->addFieldToFilter('email', $email); - $collection->load(false); - - if ($collection->getSize() > 0) { - foreach ($collection as $item) { - $user = Mage::getModel('admin/user')->load($item->getId()); - if ($user->getId()) { - $newResetPasswordLinkToken = Mage::helper('admin')->generateResetPasswordLinkToken(); - $user->changeResetPasswordLinkToken($newResetPasswordLinkToken); - $user->save(); - $user->sendPasswordResetConfirmationEmail(); + // Validate received data to be an email address + if (Zend_Validate::is($email, 'EmailAddress')) { + $collection = Mage::getResourceModel('admin/user_collection'); + /** @var $collection Mage_Admin_Model_Resource_User_Collection */ + $collection->addFieldToFilter('email', $email); + $collection->load(false); + + if ($collection->getSize() > 0) { + foreach ($collection as $item) { + $user = Mage::getModel('admin/user')->load($item->getId()); + if ($user->getId()) { + $newResetPasswordLinkToken = Mage::helper('admin')->generateResetPasswordLinkToken(); + $user->changeResetPasswordLinkToken($newResetPasswordLinkToken); + $user->save(); + $user->sendPasswordResetConfirmationEmail(); + } + break; } - break; } + $this->_getSession() + ->addSuccess(Mage::helper('adminhtml')->__('If there is an account associated with %s you will receive an email with a link to reset your password.', Mage::helper('adminhtml')->escapeHtml($email))); + $this->_redirect('*/*/login'); + return; + } else { + $this->_getSession()->addError($this->__('Invalid email address.')); } - $this->_getSession() - ->addSuccess(Mage::helper('adminhtml')->__('If there is an account associated with %s you will receive an email with a link to reset your password.', Mage::helper('adminhtml')->htmlEscape($email))); } elseif (!empty($params)) { $this->_getSession()->addError(Mage::helper('adminhtml')->__('The email address is empty.')); } - - $data = array( - 'email' => $email - ); - $this->_outTemplate('forgotpassword', $data); + $this->loadLayout(); + $this->renderLayout(); } /** @@ -279,7 +279,7 @@ public function resetPasswordAction() $this->_outTemplate('resetforgottenpassword', $data); } catch (Exception $exception) { $this->_getSession()->addError(Mage::helper('adminhtml')->__('Your password reset link has expired.')); - $this->_redirect('*/*/'); + $this->_redirect('*/*/forgotpassword', array('_nosecret' => true)); } } @@ -334,13 +334,11 @@ public function resetPasswordPostAction() $user->setRpToken(null); $user->setRpTokenCreatedAt(null); $user->setPasswordConfirmation(null); - // Force password change - $user->setForceNewPassword(true); $user->save(); $this->_getSession()->addSuccess(Mage::helper('adminhtml')->__('Your password has been updated.')); $this->_redirect('*/*/login'); } catch (Exception $exception) { - $this->_getSession()->addException($exception, $this->__('Cannot save a new password.')); + $this->_getSession()->addError($exception->getMessage()); $data = array( 'userId' => $userId, 'resetPasswordLinkToken' => $resetPasswordLinkToken diff --git a/app/code/core/Mage/Adminhtml/controllers/Newsletter/SubscriberController.php b/app/code/core/Mage/Adminhtml/controllers/Newsletter/SubscriberController.php index cf95f21cd9..580512668f 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Newsletter/SubscriberController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Newsletter/SubscriberController.php @@ -117,9 +117,7 @@ public function massUnsubscribeAction() $subscriber->unsubscribe(); } Mage::getSingleton('adminhtml/session')->addSuccess( - Mage::helper('adminhtml')->__( - 'Total of %d record(s) were updated', count($subscribersIds) - ) + Mage::helper('adminhtml')->__('Total of %d record(s) were updated', count($subscribersIds)) ); } catch (Exception $e) { Mage::getSingleton('adminhtml/session')->addError($e->getMessage()); @@ -142,9 +140,7 @@ public function massDeleteAction() $subscriber->delete(); } Mage::getSingleton('adminhtml/session')->addSuccess( - Mage::helper('adminhtml')->__( - 'Total of %d record(s) were deleted', count($subscribersIds) - ) + Mage::helper('adminhtml')->__('Total of %d record(s) were deleted', count($subscribersIds)) ); } catch (Exception $e) { Mage::getSingleton('adminhtml/session')->addError($e->getMessage()); diff --git a/app/code/core/Mage/Adminhtml/controllers/Permissions/RoleController.php b/app/code/core/Mage/Adminhtml/controllers/Permissions/RoleController.php index b4cdbe5533..7e8efef410 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Permissions/RoleController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Permissions/RoleController.php @@ -124,7 +124,9 @@ public function editRoleAction() ->setRoleInfo($role) ->setTemplate('permissions/roleinfo.phtml') ); - $this->_addJs($this->getLayout()->createBlock('adminhtml/template')->setTemplate('permissions/role_users_grid_js.phtml')); + $this->_addJs( + $this->getLayout()->createBlock('adminhtml/template')->setTemplate('permissions/role_users_grid_js.phtml') + ); $this->renderLayout(); } @@ -183,10 +185,15 @@ public function saveRoleAction() } try { - $role->setName($this->getRequest()->getParam('rolename', false)) + $roleName = Mage::helper('adminhtml')->stripTags($this->getRequest()->getParam('rolename', false)); + + $role->setName($roleName) ->setPid($this->getRequest()->getParam('parent_id', false)) ->setRoleType('G'); - Mage::dispatchEvent('admin_permissions_role_prepare_save', array('object' => $role, 'request' => $this->getRequest())); + Mage::dispatchEvent( + 'admin_permissions_role_prepare_save', + array('object' => $role, 'request' => $this->getRequest()) + ); $role->save(); Mage::getModel("admin/rules") @@ -221,7 +228,9 @@ public function saveRoleAction() */ public function editrolegridAction() { - $this->getResponse()->setBody($this->getLayout()->createBlock('adminhtml/permissions_role_grid_user')->toHtml()); + $this->getResponse()->setBody( + $this->getLayout()->createBlock('adminhtml/permissions_role_grid_user')->toHtml() + ); } /** diff --git a/app/code/core/Mage/Adminhtml/controllers/Promo/CatalogController.php b/app/code/core/Mage/Adminhtml/controllers/Promo/CatalogController.php index 9723ccb3df..1141958a1e 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Promo/CatalogController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Promo/CatalogController.php @@ -283,17 +283,15 @@ public function newActionHtmlAction() */ public function applyRulesAction() { + $errorMessage = Mage::helper('catalogrule')->__('Unable to apply rules.'); try { Mage::getModel('catalogrule/rule')->applyAll(); Mage::app()->removeCache('catalog_rules_dirty'); - Mage::getSingleton('adminhtml/session')->addSuccess( - Mage::helper('catalogrule')->__('The rules have been applied.') - ); + $this->_getSession()->addSuccess(Mage::helper('catalogrule')->__('The rules have been applied.')); + } catch (Mage_Core_Exception $e) { + $this->_getSession()->addError($errorMessage . ' ' . $e->getMessage()); } catch (Exception $e) { - Mage::getSingleton('adminhtml/session')->addError( - Mage::helper('catalogrule')->__('Unable to apply rules.') - ); - throw $e; + $this->_getSession()->addError($errorMessage); } $this->_redirect('*/*'); } diff --git a/app/code/core/Mage/Adminhtml/controllers/Promo/QuoteController.php b/app/code/core/Mage/Adminhtml/controllers/Promo/QuoteController.php index d2d16501ca..f222b22566 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Promo/QuoteController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Promo/QuoteController.php @@ -32,9 +32,14 @@ protected function _initRule() $this->_title($this->__('Promotions'))->_title($this->__('Shopping Cart Price Rules')); Mage::register('current_promo_quote_rule', Mage::getModel('salesrule/rule')); - if ($id = (int) $this->getRequest()->getParam('id')) { - Mage::registry('current_promo_quote_rule') - ->load($id); + $id = (int)$this->getRequest()->getParam('id'); + + if (!$id && $this->getRequest()->getParam('rule_id')) { + $id = (int)$this->getRequest()->getParam('rule_id'); + } + + if ($id) { + Mage::registry('current_promo_quote_rule')->load($id); } } @@ -110,6 +115,7 @@ public function saveAction() { if ($this->getRequest()->getPost()) { try { + /** @var $model Mage_SalesRule_Model_Rule */ $model = Mage::getModel('salesrule/rule'); Mage::dispatchEvent( 'adminhtml_controller_salesrule_prepare_save', @@ -159,6 +165,9 @@ public function saveAction() unset($data['rule']); $model->loadPost($data); + $useAutoGeneration = (int)!empty($data['use_auto_generation']); + $model->setUseAutoGeneration($useAutoGeneration); + $session->setPageData($model->getData()); $model->save(); @@ -269,6 +278,128 @@ public function gridAction() $this->_initRule()->loadLayout()->renderLayout(); } + /** + * Coupon codes grid + */ + public function couponsGridAction() + { + $this->_initRule(); + $this->loadLayout()->renderLayout(); + } + + /** + * Export coupon codes as excel xml file + * + * @return void + */ + public function exportCouponsXmlAction() + { + $this->_initRule(); + $rule = Mage::registry('current_promo_quote_rule'); + if ($rule->getId()) { + $fileName = 'coupon_codes.xml'; + $content = $this->getLayout() + ->createBlock('adminhtml/promo_quote_edit_tab_coupons_grid') + ->getExcelFile($fileName); + $this->_prepareDownloadResponse($fileName, $content); + } else { + $this->_redirect('*/*/detail', array('_current' => true)); + return; + } + } + + /** + * Export coupon codes as CSV file + * + * @return void + */ + public function exportCouponsCsvAction() + { + $this->_initRule(); + $rule = Mage::registry('current_promo_quote_rule'); + if ($rule->getId()) { + $fileName = 'coupon_codes.csv'; + $content = $this->getLayout() + ->createBlock('adminhtml/promo_quote_edit_tab_coupons_grid') + ->getCsvFile(); + $this->_prepareDownloadResponse($fileName, $content); + } else { + $this->_redirect('*/*/detail', array('_current' => true)); + return; + } + } + + /** + * Coupons mass delete action + */ + public function couponsMassDeleteAction() + { + $this->_initRule(); + $rule = Mage::registry('current_promo_quote_rule'); + + if (!$rule->getId()) { + $this->_forward('noRoute'); + } + + $codesIds = $this->getRequest()->getParam('ids'); + + if (is_array($codesIds)) { + + $couponsCollection = Mage::getResourceModel('salesrule/coupon_collection') + ->addFieldToFilter('coupon_id', array('in' => $codesIds)); + + foreach ($couponsCollection as $coupon) { + $coupon->delete(); + } + } + } + + /** + * Generate Coupons action + */ + public function generateAction() + { + if (!$this->getRequest()->isAjax()) { + $this->_forward('noRoute'); + return; + } + $result = array(); + $this->_initRule(); + + /** @var $rule Mage_SalesRule_Model_Rule */ + $rule = Mage::registry('current_promo_quote_rule'); + + if (!$rule->getId()) { + $result['error'] = Mage::helper('salesrule')->__('Rule is not defined'); + } else { + try { + $data = $this->getRequest()->getParams(); + if (!empty($data['to_date'])) { + $data = array_merge($data, $this->_filterDates($data, array('to_date'))); + } + + /** @var $generator Mage_SalesRule_Model_Coupon_Massgenerator */ + $generator = $rule->getCouponMassGenerator(); + if (!$generator->validateData($data)) { + $result['error'] = Mage::helper('salesrule')->__('Not valid data provided'); + } else { + $generator->setData($data); + $generator->generatePool(); + $generated = $generator->getGeneratedCount(); + $this->_getSession()->addSuccess(Mage::helper('salesrule')->__('%s Coupon(s) generated successfully', $generated)); + $this->_initLayoutMessages('adminhtml/session'); + $result['messages'] = $this->getLayout()->getMessagesBlock()->getGroupedHtml(); + } + } catch (Mage_Core_Exception $e) { + $result['error'] = $e->getMessage(); + } catch (Exception $e) { + $result['error'] = Mage::helper('salesrule')->__('An error occurred while generating coupons. Please review the log and try again.'); + Mage::logException($e); + } + } + $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result)); + } + /** * Chooser source action */ @@ -281,6 +412,10 @@ public function chooserAction() $this->getResponse()->setBody($chooserBlock->toHtml()); } + /** + * Returns result of current user permission check on resource and privilege + * @return boolean + */ protected function _isAllowed() { return Mage::getSingleton('admin/session')->isAllowed('promo/quote'); diff --git a/app/code/core/Mage/Adminhtml/controllers/Report/ProductController.php b/app/code/core/Mage/Adminhtml/controllers/Report/ProductController.php index 4d0586eda8..80d56c5518 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Report/ProductController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Report/ProductController.php @@ -32,21 +32,17 @@ * @package Mage_Adminhtml * @author Magento Core Team */ -class Mage_Adminhtml_Report_ProductController extends Mage_Adminhtml_Controller_Action +class Mage_Adminhtml_Report_ProductController extends Mage_Adminhtml_Controller_Report_Abstract { /** - * init + * Add report/products breadcrumbs * * @return Mage_Adminhtml_Report_ProductController */ public function _initAction() { - $act = $this->getRequest()->getActionName(); - if(!$act) - $act = 'default'; - $this->loadLayout() - ->_addBreadcrumb(Mage::helper('reports')->__('Reports'), Mage::helper('reports')->__('Reports')) - ->_addBreadcrumb(Mage::helper('reports')->__('Products'), Mage::helper('reports')->__('Products')); + parent::_initAction(); + $this->_addBreadcrumb(Mage::helper('reports')->__('Products'), Mage::helper('reports')->__('Products')); return $this; } @@ -131,15 +127,23 @@ public function exportSoldExcelAction() */ public function viewedAction() { - $this->_title($this->__('Reports')) - ->_title($this->__('Products')) - ->_title($this->__('Most Viewed')); + $this->_title($this->__('Reports'))->_title($this->__('Products'))->_title($this->__('Most Viewed')); + + $this->_showLastExecutionTime(Mage_Reports_Model_Flag::REPORT_PRODUCT_VIEWED_FLAG_CODE, 'viewed'); $this->_initAction() - ->_setActiveMenu('report/product/viewed') - ->_addBreadcrumb(Mage::helper('reports')->__('Most Viewed'), Mage::helper('reports')->__('Most Viewed')) - ->_addContent($this->getLayout()->createBlock('adminhtml/report_product_viewed')) - ->renderLayout(); + ->_setActiveMenu('report/products/viewed') + ->_addBreadcrumb(Mage::helper('adminhtml')->__('Products Most Viewed Report'), Mage::helper('adminhtml')->__('Products Most Viewed Report')); + + $gridBlock = $this->getLayout()->getBlock('report_product_viewed.grid'); + $filterFormBlock = $this->getLayout()->getBlock('grid.filter.form'); + + $this->_initReportAction(array( + $gridBlock, + $filterFormBlock + )); + + $this->renderLayout(); } /** @@ -149,10 +153,9 @@ public function viewedAction() public function exportViewedCsvAction() { $fileName = 'products_mostviewed.csv'; - $content = $this->getLayout()->createBlock('adminhtml/report_product_viewed_grid') - ->getCsv(); - - $this->_prepareDownloadResponse($fileName, $content); + $grid = $this->getLayout()->createBlock('adminhtml/report_product_viewed_grid'); + $this->_initReportAction($grid); + $this->_prepareDownloadResponse($fileName, $grid->getCsvFile()); } /** @@ -162,10 +165,9 @@ public function exportViewedCsvAction() public function exportViewedExcelAction() { $fileName = 'products_mostviewed.xml'; - $content = $this->getLayout()->createBlock('adminhtml/report_product_viewed_grid') - ->getExcel($fileName); - - $this->_prepareDownloadResponse($fileName, $content); + $grid = $this->getLayout()->createBlock('adminhtml/report_product_viewed_grid'); + $this->_initReportAction($grid); + $this->_prepareDownloadResponse($fileName, $grid->getExcelFile($fileName)); } /** diff --git a/app/code/core/Mage/Adminhtml/controllers/Report/SalesController.php b/app/code/core/Mage/Adminhtml/controllers/Report/SalesController.php index 8a5b56332a..ab97eb8df7 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Report/SalesController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Report/SalesController.php @@ -29,49 +29,19 @@ * * @category Mage * @package Mage_Adminhtml - * @author Magento Core Team + * @author Magento Core Team */ -class Mage_Adminhtml_Report_SalesController extends Mage_Adminhtml_Controller_Action +class Mage_Adminhtml_Report_SalesController extends Mage_Adminhtml_Controller_Report_Abstract { /** - * Admin session model + * Add report/sales breadcrumbs * - * @var null|Mage_Admin_Model_Session + * @return Mage_Adminhtml_Report_SalesController */ - protected $_adminSession = null; - public function _initAction() { - $this->loadLayout() - ->_addBreadcrumb(Mage::helper('reports')->__('Reports'), Mage::helper('reports')->__('Reports')) - ->_addBreadcrumb(Mage::helper('reports')->__('Sales'), Mage::helper('reports')->__('Sales')); - return $this; - } - - public function _initReportAction($blocks) - { - if (!is_array($blocks)) { - $blocks = array($blocks); - } - - $requestData = Mage::helper('adminhtml')->prepareFilterString($this->getRequest()->getParam('filter')); - $requestData = $this->_filterDates($requestData, array('from', 'to')); - $requestData['store_ids'] = $this->getRequest()->getParam('store_ids'); - $params = new Varien_Object(); - - foreach ($requestData as $key => $value) { - if (!empty($value)) { - $params->setData($key, $value); - } - } - - foreach ($blocks as $block) { - if ($block) { - $block->setPeriodType($params->getData('period_type')); - $block->setFilterData($params); - } - } - + parent::_initAction(); + $this->_addBreadcrumb(Mage::helper('reports')->__('Sales'), Mage::helper('reports')->__('Sales')); return $this; } @@ -103,7 +73,7 @@ public function bestsellersAction() $this->_showLastExecutionTime(Mage_Reports_Model_Flag::REPORT_BESTSELLERS_FLAG_CODE, 'bestsellers'); $this->_initAction() - ->_setActiveMenu('report/sales/bestsellers') + ->_setActiveMenu('report/products/bestsellers') ->_addBreadcrumb(Mage::helper('adminhtml')->__('Products Bestsellers Report'), Mage::helper('adminhtml')->__('Products Bestsellers Report')); $gridBlock = $this->getLayout()->getBlock('report_sales_bestsellers.grid'); @@ -150,22 +120,6 @@ protected function _getCollectionNames() return array(); } - protected function _showLastExecutionTime($flagCode, $refreshCode) - { - $flag = Mage::getModel('reports/flag')->setReportFlagCode($flagCode)->loadSelf(); - $updatedAt = ($flag->hasData()) - ? Mage::app()->getLocale()->storeDate( - 0, new Zend_Date($flag->getLastUpdate(), Varien_Date::DATETIME_INTERNAL_FORMAT), true - ) - : 'undefined'; - - $refreshStatsLink = $this->getUrl('*/*/refreshstatistics'); - $directRefreshLink = $this->getUrl('*/*/refreshRecent', array('code' => $refreshCode)); - - Mage::getSingleton('adminhtml/session')->addNotice(Mage::helper('adminhtml')->__('Last updated: %s. To refresh last day\'s statistics, click here.', $updatedAt, $refreshStatsLink, $directRefreshLink)); - return $this; - } - /** * Refresh statistics for last 25 hours * @@ -465,17 +419,4 @@ protected function _isAllowed() break; } } - - /** - * Retrieve admin session model - * - * @return Mage_Admin_Model_Session - */ - protected function _getSession() - { - if (is_null($this->_adminSession)) { - $this->_adminSession = Mage::getSingleton('admin/session'); - } - return $this->_adminSession; - } } diff --git a/app/code/core/Mage/Adminhtml/controllers/Report/StatisticsController.php b/app/code/core/Mage/Adminhtml/controllers/Report/StatisticsController.php index 08764ff459..0ae974edc6 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Report/StatisticsController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Report/StatisticsController.php @@ -100,13 +100,14 @@ protected function _getCollectionNames() } $aliases = array( - 'sales' => 'sales/report_order', - 'tax' => 'tax/report_tax', - 'shipping' => 'sales/report_shipping', - 'invoiced' => 'sales/report_invoiced', - 'refunded' => 'sales/report_refunded', - 'coupons' => 'salesrule/report_rule', + 'sales' => 'sales/report_order', + 'tax' => 'tax/report_tax', + 'shipping' => 'sales/report_shipping', + 'invoiced' => 'sales/report_invoiced', + 'refunded' => 'sales/report_refunded', + 'coupons' => 'salesrule/report_rule', 'bestsellers' => 'sales/report_bestsellers', + 'viewed' => 'reports/report_product_viewed', ); $out = array(); foreach ($codes as $code) { diff --git a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/CreateController.php b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/CreateController.php index 78fe6831fa..5420a578b2 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/CreateController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/CreateController.php @@ -279,7 +279,8 @@ protected function _processActionData($action = null) $data = $this->getRequest()->getPost('order'); if (!empty($data['coupon']['code'])) { if ($this->_getQuote()->getCouponCode() !== $data['coupon']['code']) { - $this->_getSession()->addError($this->__('"%s" coupon code is not valid.', $data['coupon']['code'])); + $this->_getSession()->addError( + $this->__('"%s" coupon code is not valid.', $this->_getHelper()->escapeHtml($data['coupon']['code']))); } else { $this->_getSession()->addSuccess($this->__('The coupon code has been accepted.')); } diff --git a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/ShipmentController.php b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/ShipmentController.php index 77916fa02b..dc9a37f663 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/ShipmentController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/ShipmentController.php @@ -212,18 +212,20 @@ public function saveAction() $shipment->getOrder()->setCustomerNoteNotify(!empty($data['send_email'])); $responseAjax = new Varien_Object(); $isNeedCreateLabel = isset($data['create_shipping_label']) && $data['create_shipping_label']; - if ($isNeedCreateLabel) { - if ($this->_createShippingLabel($shipment)) { - $this->_getSession() - ->addSuccess($this->__('The shipment has been created. The shipping label has been created.')); - $responseAjax->setOk(true); - } - } else { - $this->_getSession() - ->addSuccess($this->__('The shipment has been created.')); + + if ($isNeedCreateLabel && $this->_createShippingLabel($shipment)) { + $responseAjax->setOk(true); } + $this->_saveShipment($shipment); + $shipment->sendEmail(!empty($data['send_email']), $comment); + + $shipmentCreatedMessage = $this->__('The shipment has been created.'); + $labelCreatedMessage = $this->__('The shipping label has been created.'); + + $this->_getSession()->addSuccess($isNeedCreateLabel ? $shipmentCreatedMessage . ' ' . $labelCreatedMessage + : $shipmentCreatedMessage); Mage::getSingleton('adminhtml/session')->getCommentText(true); } catch (Mage_Core_Exception $e) { if ($isNeedCreateLabel) { @@ -237,7 +239,8 @@ public function saveAction() Mage::logException($e); if ($isNeedCreateLabel) { $responseAjax->setError(true); - $responseAjax->setMessage(Mage::helper('sales')->__('An error occurred while creating shipping label.')); + $responseAjax->setMessage( + Mage::helper('sales')->__('An error occurred while creating shipping label.')); } else { $this->_getSession()->addError($this->__('Cannot save shipment.')); $this->_redirect('*/*/new', array('order_id' => $this->getRequest()->getParam('order_id'))); diff --git a/app/code/core/Mage/Adminhtml/controllers/Sales/OrderController.php b/app/code/core/Mage/Adminhtml/controllers/Sales/OrderController.php index e4455ebe9a..e9f934f96d 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Sales/OrderController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Sales/OrderController.php @@ -336,9 +336,13 @@ public function creditmemosAction() public function commentsHistoryAction() { $this->_initOrder(); - $this->getResponse()->setBody( - $this->getLayout()->createBlock('adminhtml/sales_order_view_tab_history')->toHtml() - ); + $html = $this->getLayout()->createBlock('adminhtml/sales_order_view_tab_history')->toHtml(); + /* @var $translate Mage_Core_Model_Translate_Inline */ + $translate = Mage::getModel('core/translate_inline'); + if ($translate->isAllowed()) { + $translate->processResponseBody($html); + } + $this->getResponse()->setBody($html); } /** @@ -718,6 +722,7 @@ public function addressAction() $addressId = $this->getRequest()->getParam('address_id'); $address = Mage::getModel('sales/order_address') ->getCollection() + ->addFilter('entity_id', $addressId) ->getItemById($addressId); if ($address) { Mage::register('order_address', $address); diff --git a/app/code/core/Mage/Adminhtml/controllers/Sales/TransactionsController.php b/app/code/core/Mage/Adminhtml/controllers/Sales/TransactionsController.php index 769c153480..c565cdaa1b 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Sales/TransactionsController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Sales/TransactionsController.php @@ -110,13 +110,15 @@ public function fetchAction() ->setOrder($txn->getOrder()) ->importTransactionInfo($txn); $txn->save(); - Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml') - ->__('The transaction details have been updated.')); + Mage::getSingleton('adminhtml/session')->addSuccess( + Mage::helper('adminhtml')->__('The transaction details have been updated.') + ); } catch (Mage_Core_Exception $e) { Mage::getSingleton('adminhtml/session')->addError($e->getMessage()); } catch (Exception $e) { - Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml') - ->__('Unable to update transaction details.')); + Mage::getSingleton('adminhtml/session')->addError( + Mage::helper('adminhtml')->__('Unable to update transaction details.') + ); Mage::logException($e); } $this->_redirect('*/sales_transactions/view', array('_current' => true)); diff --git a/app/code/core/Mage/Adminhtml/controllers/System/BackupController.php b/app/code/core/Mage/Adminhtml/controllers/System/BackupController.php index 77678814c0..d7b46e2d4c 100644 --- a/app/code/core/Mage/Adminhtml/controllers/System/BackupController.php +++ b/app/code/core/Mage/Adminhtml/controllers/System/BackupController.php @@ -66,43 +66,93 @@ public function gridAction() /** * Create backup action + * + * @return Mage_Adminhtml_Controller_Action */ public function createAction() { + if (!$this->getRequest()->isAjax()) { + return $this->getUrl('*/*/index'); + } + + $response = new Varien_Object(); + $helper = Mage::helper('backup'); + try { - $backupDb = Mage::getModel('backup/db'); - $backup = Mage::getModel('backup/backup') + $type = $this->getRequest()->getParam('type'); + + $backupManager = Mage_Backup::getBackupInstance($type) + ->setBackupExtension($helper->getExtensionByType($type)) ->setTime(time()) - ->setType('db') - ->setPath(Mage::getBaseDir("var") . DS . "backups"); + ->setBackupsDir($helper->getBackupsDir()); + + Mage::register('backup_manager', $backupManager); + + if ($this->getRequest()->getParam('maintenance_mode')) { + $turnedOn = $helper->turnOnMaintenanceMode(); - Mage::register('backup_model', $backup); + if (!$turnedOn) { + $response->setError( + Mage::helper('backup')->__("Warning! System couldn't put store on the maintenance mode.") . ' ' + . Mage::helper('backup')->__("Please deselect the sufficient check-box, if you want to continue backup's creation") + ); + $backupManager->setErrorMessage(Mage::helper('backup')->__("System couldn't put store on the maintenance mode")); + return $this->getResponse()->setBody($response->toJson()); + } + } - $backupDb->createBackup($backup); - $this->_getSession()->addSuccess(Mage::helper('adminhtml')->__('The backup has been created.')); + if ($type != Mage_Backup_Helper_Data::TYPE_DB) { + $backupManager->setRootDir(Mage::getBaseDir()) + ->addIgnorePaths($helper->getBackupIgnorePaths()); + } + + $successMessage = $helper->getCreateSuccessMessageByType($type); + + $backupManager->create(); + + $this->_getSession()->addSuccess($successMessage); + + if ($this->getRequest()->getParam('maintenance_mode')) { + $helper->turnOffMaintenanceMode(); + } + + $response->setRedirectUrl($this->getUrl('*/*/index')); + } catch (Mage_Backup_Exception_NotEnoughFreeSpace $e) { + $errorMessage = Mage::helper('backup')->__('Not enough free space to create backup.'); + } catch (Mage_Backup_Exception_NotEnoughPermissions $e) { + Mage::log($e->getMessage()); + $errorMessage = Mage::helper('backup')->__('Not enough permissions to create backup.'); + } catch (Exception $e) { + Mage::log($e->getMessage()); + $errorMessage = Mage::helper('backup')->__('An error occurred while creating the backup.'); } - catch (Exception $e) { - $this->_getSession()->addException($e, Mage::helper('adminhtml')->__('An error occurred while creating the backup.')); + + if (!empty($errorMessage)) { + $response->setError($errorMessage); + $backupManager->setErrorMessage($errorMessage); } - $this->_redirect('*/*'); + + $this->getResponse()->setBody($response->toJson()); } /** * Download backup action + * + * @return Mage_Adminhtml_Controller_Action */ public function downloadAction() { $backup = Mage::getModel('backup/backup') ->setTime((int)$this->getRequest()->getParam('time')) ->setType($this->getRequest()->getParam('type')) - ->setPath(Mage::getBaseDir("var") . DS . "backups"); + ->setPath(Mage::helper('backup')->getBackupsDir()); /* @var $backup Mage_Backup_Model_Backup */ if (!$backup->exists()) { - $this->_redirect('*/*'); + return $this->_redirect('*/*'); } - $fileName = 'backup-' . date('YmdHis', $backup->getTime()) . '.sql.gz'; + $fileName = Mage::helper('backup')->generateBackupDownloadName($backup); $this->_prepareDownloadResponse($fileName, null, 'application/octet-stream', $backup->getSize()); @@ -113,32 +163,178 @@ public function downloadAction() } /** - * Delete backup action + * Rollback Action + * + * @return Mage_Adminhtml_Controller_Action */ - public function deleteAction() + public function rollbackAction() { + if (!Mage::helper('backup')->isRollbackAllowed()){ + return $this->_forward('denied'); + } + + if (!$this->getRequest()->isAjax()) { + return $this->getUrl('*/*/index'); + } + + $helper = Mage::helper('backup'); + $response = new Varien_Object(); + try { - $backup = Mage::getModel('backup/backup') - ->setTime((int)$this->getRequest()->getParam('time')) - ->setType($this->getRequest()->getParam('type')) - ->setPath(Mage::getBaseDir("var") . DS . "backups") - ->deleteFile(); + $type = $this->getRequest()->getParam('type'); + + $backupManager = Mage_Backup::getBackupInstance($type) + ->setBackupExtension($helper->getExtensionByType($type)) + ->setTime($this->getRequest()->getParam('time')) + ->setBackupsDir($helper->getBackupsDir()) + ->setResourceModel(Mage::getResourceModel('backup/db')); + + Mage::register('backup_manager', $backupManager); + + $passwordValid = Mage::getModel('backup/backup')->validateUserPassword( + $this->getRequest()->getParam('password') + ); + + if (!$passwordValid) { + $response->setError(Mage::helper('backup')->__('Invalid Password.')); + $backupManager->setErrorMessage(Mage::helper('backup')->__('Invalid Password.')); + return $this->getResponse()->setBody($response->toJson()); + } + + if ($this->getRequest()->getParam('maintenance_mode')) { + $turnedOn = $helper->turnOnMaintenanceMode(); + + if (!$turnedOn) { + $response->setError( + Mage::helper('backup')->__("Warning! System couldn't put store on the maintenance mode.") . ' ' + . Mage::helper('backup')->__("Please deselect the sufficient check-box, if you want to continue rollback processing") + ); + $backupManager->setErrorMessage(Mage::helper('backup')->__("System couldn't put store on the maintenance mode")); + return $this->getResponse()->setBody($response->toJson()); + } + } + + if ($type != Mage_Backup_Helper_Data::TYPE_DB) { - Mage::register('backup_model', $backup); + $backupManager->setRootDir(Mage::getBaseDir()) + ->addIgnorePaths($helper->getRollbackIgnorePaths()); - $this->_getSession()->addSuccess(Mage::helper('adminhtml')->__('Backup record was deleted.')); + if ($this->getRequest()->getParam('use_ftp', false)) { + $backupManager->setUseFtp( + $this->getRequest()->getParam('ftp_host', ''), + $this->getRequest()->getParam('ftp_user', ''), + $this->getRequest()->getParam('ftp_pass', ''), + $this->getRequest()->getParam('ftp_path', '') + ); + } + } + + $backupManager->rollback(); + + $helper->invalidateCache()->invalidateIndexer(); + + $adminSession = $this->_getSession(); + $adminSession->unsetAll(); + $adminSession->getCookie()->delete($adminSession->getSessionName()); + + if ($this->getRequest()->getParam('maintenance_mode')) { + $helper->turnOffMaintenanceMode(); + } + + $response->setRedirectUrl($this->getUrl('*')); + + } catch (Mage_Backup_Exception_CantLoadSnapshot $e) { + $errorMsg = Mage::helper('backup')->__('Backup file not found'); + } catch (Mage_Backup_Exception_FtpConnectionFailed $e) { + $errorMsg = Mage::helper('backup')->__('Failed to connect to FTP'); + } catch (Mage_Backup_Exception_FtpValidationFailed $e) { + $errorMsg = Mage::helper('backup')->__('Failed to validate FTP'); + } catch (Mage_Backup_Exception_NotEnoughPermissions $e) { + Mage::log($e->getMessage()); + $errorMsg = Mage::helper('backup')->__('Not enough permissions to perform rollback'); + } catch (Exception $e) { + Mage::log($e->getMessage()); + $errorMsg = Mage::helper('backup')->__('Failed to rollback'); + } + + if (!empty($errorMsg)) { + $response->setError($errorMsg); + $backupManager->setErrorMessage($errorMsg); } - catch (Exception $e) { - // Nothing + + $this->getResponse()->setBody($response->toJson()); + } + + /** + * Delete backups mass action + * + * @return Mage_Adminhtml_Controller_Action + */ + public function massDeleteAction() + { + $backupIds = $this->getRequest()->getParam('ids', array()); + + if (!is_array($backupIds) || !count($backupIds)) { + return $this->_redirect('*/*/index'); } - $this->_redirect('*/*/'); + /** @var $backupModel Mage_Backup_Model_Backup */ + $backupModel = Mage::getModel('backup/backup'); + $resultData = new Varien_Object(); + $resultData->setIsSuccess(false); + $resultData->setDeleteResult(array()); + Mage::register('backup_manager', $resultData); + + $deleteFailMessage = Mage::helper('backup')->__('Failed to delete one or several backups.'); + + try { + $allBackupsDeleted = true; + + foreach ($backupIds as $id) { + list($time, $type) = explode('_', $id); + + $backupModel->setTime((int)$time) + ->setType($type) + ->setPath(Mage::helper('backup')->getBackupsDir()) + ->deleteFile(); + if ($backupModel->exists()) { + $allBackupsDeleted = false; + $result = Mage::helper('adminhtml')->__('failed'); + } else { + $result = Mage::helper('adminhtml')->__('successful'); + } + + $resultData->setDeleteResult( + array_merge($resultData->getDeleteResult(), array($backupModel->getFileName() . ' ' . $result)) + ); + } + + $resultData->setIsSuccess(true); + if ($allBackupsDeleted) { + $this->_getSession()->addSuccess( + Mage::helper('backup')->__('The selected backup(s) has been deleted.') + ); + } + else { + throw new Exception($deleteFailMessage); + } + } catch (Exception $e) { + $resultData->setIsSuccess(false); + $this->_getSession()->addError($deleteFailMessage); + } + + return $this->_redirect('*/*/index'); } + /** + * Check Permissions for all actions + * + * @return bool + */ protected function _isAllowed() { - return Mage::getSingleton('admin/session')->isAllowed('system/tools/backup'); + return Mage::getSingleton('admin/session')->isAllowed('system/tools/backup' ); } /** diff --git a/app/code/core/Mage/Adminhtml/controllers/System/VariableController.php b/app/code/core/Mage/Adminhtml/controllers/System/VariableController.php index 4e8d743b4c..85b1bfdf7b 100644 --- a/app/code/core/Mage/Adminhtml/controllers/System/VariableController.php +++ b/app/code/core/Mage/Adminhtml/controllers/System/VariableController.php @@ -56,7 +56,7 @@ protected function _initVariable() $this->_title($this->__('System'))->_title($this->__('Custom Variables')); $variableId = $this->getRequest()->getParam('variable_id', null); - $storeId = $this->getRequest()->getParam('store', 0); + $storeId = (int)$this->getRequest()->getParam('store', 0); /* @var $emailVariable Mage_Core_Model_Variable */ $variable = Mage::getModel('core/variable'); if ($variableId) { @@ -101,7 +101,9 @@ public function editAction() $this->_initLayout() ->_addContent($this->getLayout()->createBlock('adminhtml/system_variable_edit')) - ->_addJs($this->getLayout()->createBlock('core/template', '', array('template' => 'system/variable/js.phtml'))) + ->_addJs($this->getLayout()->createBlock('core/template', '', array( + 'template' => 'system/variable/js.phtml' + ))) ->renderLayout(); } diff --git a/app/code/core/Mage/Adminhtml/controllers/TagController.php b/app/code/core/Mage/Adminhtml/controllers/TagController.php index a6be40dcfb..5fff4c6eed 100644 --- a/app/code/core/Mage/Adminhtml/controllers/TagController.php +++ b/app/code/core/Mage/Adminhtml/controllers/TagController.php @@ -82,7 +82,6 @@ public function indexAction() $this->_initAction() ->_addBreadcrumb(Mage::helper('adminhtml')->__('All Tags'), Mage::helper('adminhtml')->__('All Tags')) ->_setActiveMenu('catalog/tag/all') - ->_addContent($this->getLayout()->createBlock('adminhtml/tag_tag')) ->renderLayout(); } @@ -93,7 +92,7 @@ public function indexAction() public function ajaxGridAction() { $this->loadLayout(); - $this->getResponse()->setBody($this->getLayout()->createBlock('adminhtml/tag_tag_grid')->toHtml()); + $this->renderLayout(); } /** @@ -103,7 +102,7 @@ public function ajaxGridAction() public function ajaxPendingGridAction() { $this->loadLayout(); - $this->getResponse()->setBody($this->getLayout()->createBlock('adminhtml/tag_grid_pending')->toHtml()); + $this->renderLayout(); } /** @@ -170,7 +169,9 @@ public function saveAction() $model->addData($data); if (isset($postData['tag_assigned_products'])) { - $productIds = Mage::helper('adminhtml/js')->decodeGridSerializedInput($postData['tag_assigned_products']); + $productIds = Mage::helper('adminhtml/js')->decodeGridSerializedInput( + $postData['tag_assigned_products'] + ); $tagRelationModel = Mage::getModel('tag/tag_relation'); $tagRelationModel->addRelations($model, $productIds); } @@ -234,7 +235,6 @@ public function pendingAction() $this->_initAction() ->_addBreadcrumb(Mage::helper('adminhtml')->__('Pending Tags'), Mage::helper('adminhtml')->__('Pending Tags')) ->_setActiveMenu('catalog/tag/pending') - ->_addContent($this->getLayout()->createBlock('adminhtml/tag_pending')) ->renderLayout(); } @@ -269,7 +269,8 @@ public function assignedGridOnlyAction() public function productAction() { $this->_initTag(); - $this->getResponse()->setBody($this->getLayout()->createBlock('adminhtml/tag_product_grid')->toHtml()); + $this->loadLayout(); + $this->renderLayout(); } /** @@ -279,7 +280,8 @@ public function productAction() public function customerAction() { $this->_initTag(); - $this->getResponse()->setBody($this->getLayout()->createBlock('adminhtml/tag_customer_grid')->toHtml()); + $this->loadLayout(); + $this->renderLayout(); } /** diff --git a/app/code/core/Mage/Authorizenet/etc/system.xml b/app/code/core/Mage/Authorizenet/etc/system.xml index b160eead43..951b1e4a06 100755 --- a/app/code/core/Mage/Authorizenet/etc/system.xml +++ b/app/code/core/Mage/Authorizenet/etc/system.xml @@ -210,6 +210,7 @@ 1 1 0 + validate-number diff --git a/app/code/core/Mage/Backup/Helper/Data.php b/app/code/core/Mage/Backup/Helper/Data.php index c9540e00e1..c937758309 100644 --- a/app/code/core/Mage/Backup/Helper/Data.php +++ b/app/code/core/Mage/Backup/Helper/Data.php @@ -29,5 +29,245 @@ */ class Mage_Backup_Helper_Data extends Mage_Core_Helper_Abstract { + /** + * Backup type constant for database backup + * + * @const string + */ + const TYPE_DB = 'db'; + /** + * Backup type constant for filesystem backup + * + * @const string + */ + const TYPE_FILESYSTEM = 'filesystem'; + + /** + * Backup type constant for full system backup(database + filesystem) + * + * @const string + */ + const TYPE_SYSTEM_SNAPSHOT = 'snapshot'; + + /** + * Backup type constant for media and database backup + * + * @const string + */ + const TYPE_MEDIA = 'media'; + + /** + * Get all possible backup type values with descriptive title + * + * @return array + */ + public function getBackupTypes() + { + return array( + self::TYPE_DB => self::__('Database'), + self::TYPE_MEDIA => self::__('Database and Media'), + self::TYPE_SYSTEM_SNAPSHOT => self::__('System') + ); + } + + /** + * Get all possible backup type values + * + * @return array + */ + public function getBackupTypesList() + { + return array( + self::TYPE_DB, + self::TYPE_SYSTEM_SNAPSHOT, + self::TYPE_MEDIA + ); + } + + /** + * Get default backup type value + * + * @return string + */ + public function getDefaultBackupType() + { + return self::TYPE_DB; + } + + /** + * Get directory path where backups stored + * + * @return string + */ + public function getBackupsDir() + { + return Mage::getBaseDir('var') . DS . 'backups'; + } + + /** + * Get backup file extension by backup type + * + * @param string $type + * @return string + */ + public function getExtensionByType($type) + { + $extensions = $this->getExtensions(); + return isset($extensions[$type]) ? $extensions[$type] : ''; + } + + /** + * Get all types to extensions map + * + * @return array + */ + public function getExtensions() + { + return array( + self::TYPE_SYSTEM_SNAPSHOT => 'tgz', + self::TYPE_MEDIA => 'tgz', + self::TYPE_DB => 'gz' + ); + } + + /** + * Generate backup download name + * + * @param Mage_Backup_Model_Backup $backup + * @return string + */ + public function generateBackupDownloadName(Mage_Backup_Model_Backup $backup) + { + $additionalExtension = $backup->getType() == self::TYPE_DB ? '.sql' : ''; + return $backup->getType() . '-' . date('YmdHis', $backup->getTime()) . $additionalExtension . '.' + . $this->getExtensionByType($backup->getType()); + } + + /** + * Check Permission for Rollback + * + * @return boolean + */ + public function isRollbackAllowed(){ + return Mage::getSingleton('admin/session')->isAllowed('system/tools/backup/rollback' ); + } + + /** + * Get paths that should be ignored when creating system snapshots + * + * @return array + */ + public function getBackupIgnorePaths() + { + return array( + '.svn', + 'maintenance.flag', + Mage::getBaseDir('var') . DS . 'session', + Mage::getBaseDir('var') . DS . 'cache', + Mage::getBaseDir('var') . DS . 'full_page_cache', + Mage::getBaseDir('var') . DS . 'locks', + Mage::getBaseDir('var') . DS . 'log', + Mage::getBaseDir('var') . DS . 'report' + ); + } + + /** + * Get paths that should be ignored when rolling back system snapshots + * + * @return array + */ + public function getRollbackIgnorePaths() + { + return array( + '.svn', + 'maintenance.flag', + Mage::getBaseDir('var') . DS . 'session', + Mage::getBaseDir('var') . DS . 'locks', + Mage::getBaseDir('var') . DS . 'log', + Mage::getBaseDir('var') . DS . 'report', + Mage::getBaseDir('app') . DS . 'Mage.php', + Mage::getBaseDir() . DS . 'errors', + Mage::getBaseDir() . DS . 'index.php' + ); + } + + /** + * Put store into maintenance mode + * + * @return bool + */ + public function turnOnMaintenanceMode() + { + $maintenanceFlagFile = $this->getMaintenanceFlagFilePath(); + $result = file_put_contents($maintenanceFlagFile, 'maintenance'); + + return $result !== false; + } + + /** + * Turn off store maintenance mode + */ + public function turnOffMaintenanceMode() + { + $maintenanceFlagFile = $this->getMaintenanceFlagFilePath(); + @unlink($maintenanceFlagFile); + } + + /** + * Get backup create success message by backup type + * + * @param string $type + * @return string + */ + public function getCreateSuccessMessageByType($type) + { + $messagesMap = array( + self::TYPE_SYSTEM_SNAPSHOT => $this->__('The system backup has been created.'), + self::TYPE_MEDIA => $this->__('The database and media backup has been created.'), + self::TYPE_DB => $this->__('The database backup has been created.') + ); + + if (!isset($messagesMap[$type])) { + return; + } + + return $messagesMap[$type]; + } + + /** + * Get path to maintenance flag file + * + * @return string + */ + protected function getMaintenanceFlagFilePath() + { + return Mage::getBaseDir() . DS . 'maintenance.flag'; + } + + /** + * Invalidate Cache + * @return Mage_Backup_Helper_Data + */ + public function invalidateCache() + { + if ($cacheTypesNode = Mage::getConfig()->getNode(Mage_Core_Model_Cache::XML_PATH_TYPES)) { + $cacheTypesList = array_keys($cacheTypesNode->asArray()); + Mage::app()->getCacheInstance()->invalidateType($cacheTypesList); + } + return $this; + } + + /** + * Invalidate Indexer + * + * @return Mage_Backup_Helper_Data + */ + public function invalidateIndexer() + { + foreach (Mage::getResourceModel('index/process_collection') as $process){ + $process->changeStatus(Mage_Index_Model_Process::STATUS_REQUIRE_REINDEX); + } + return $this; + } } diff --git a/app/code/core/Mage/Backup/Model/Backup.php b/app/code/core/Mage/Backup/Model/Backup.php index a2c6664ab0..84cf07818c 100644 --- a/app/code/core/Mage/Backup/Model/Backup.php +++ b/app/code/core/Mage/Backup/Model/Backup.php @@ -29,23 +29,17 @@ * * @category Mage * @package Mage_Backup - * @author Magento Core Team + * @author Magento Core Team */ class Mage_Backup_Model_Backup extends Varien_Object { - /* backup types */ - const BACKUP_DB = 'db'; - const BACKUP_VIEW = 'view'; - const BACKUP_MEDIA = 'media'; - /* internal constants */ - const BACKUP_EXTENSION = 'gz'; const COMPRESS_RATE = 9; /** * Type of backup file * - * @var string db|media|view + * @var string */ private $_type = 'db'; @@ -65,12 +59,26 @@ class Mage_Backup_Model_Backup extends Varien_Object */ public function load($fileName, $filePath) { - list ($time, $type) = explode("_", substr($fileName, 0, strrpos($fileName, "."))); + $extensions = Mage::helper('backup')->getExtensions(); + + $fileNameWithoutExtension = $fileName; + + foreach ($extensions as $extension) { + $fileNameWithoutExtension = preg_replace('/' . preg_quote($extension, '/') . '$/', '', + $fileNameWithoutExtension + ); + } + + list ($time, $type) = explode("_", substr($fileNameWithoutExtension, 0, + strrpos($fileNameWithoutExtension, ".") + )); + $this->addData(array( 'id' => $filePath . DS . $fileName, 'time' => (int)$time, 'path' => $filePath, - 'date_object' => new Zend_Date((int)$time) + 'extension' => Mage::helper('backup')->getExtensionByType($type), + 'date_object' => new Zend_Date((int)$time, Mage::app()->getLocale()->getLocaleCode()) )); $this->setType($type); return $this; @@ -94,18 +102,19 @@ public function exists() public function getFileName() { return $this->getTime() . "_" . $this->getType() - . "." . self::BACKUP_EXTENSION; + . "." . Mage::helper('backup')->getExtensionByType($this->getType()); } /** * Sets type of file * - * @param string $value db|media|view + * @param string $value */ public function setType($value='db') { - if(!in_array($value, array('db','media','view'))) { - $value = 'db'; + $possibleTypes = Mage::helper('backup')->getBackupTypesList(); + if(!in_array($value, $possibleTypes)) { + $value = Mage::helper('backup')->getDefaultBackupType(); } $this->_type = $value; @@ -117,7 +126,7 @@ public function setType($value='db') /** * Returns type of backup file * - * @return string db|media|view + * @return string */ public function getType() { @@ -249,11 +258,12 @@ public function open($write = false) $mode = $write ? 'wb' . self::COMPRESS_RATE : 'rb'; - try { - $this->_handler = gzopen($filePath, $mode); - } - catch (Exception $e) { - Mage::exception('Mage_Backup', Mage::helper('backup')->__('Backup file "%s" cannot be read from or written to.', $this->getFileName())); + $this->_handler = @gzopen($filePath, $mode); + + if (!$this->_handler) { + throw new Mage_Backup_Exception_NotEnoughPermissions( + Mage::helper('backup')->__('Backup file "%s" cannot be read from or written to.', $this->getFileName()) + ); } return $this; @@ -351,4 +361,16 @@ public function getSize() return 0; } + + /** + * Validate user password + * + * @param string $password + * @return bool + */ + public function validateUserPassword($password) + { + $userPasswordHash = Mage::getModel('admin/session')->getUser()->getPassword(); + return Mage::helper('core')->validateHash($password, $userPasswordHash); + } } diff --git a/app/code/core/Mage/Backup/Model/Config/Backend/Cron.php b/app/code/core/Mage/Backup/Model/Config/Backend/Cron.php new file mode 100644 index 0000000000..34dbf9d066 --- /dev/null +++ b/app/code/core/Mage/Backup/Model/Config/Backend/Cron.php @@ -0,0 +1,89 @@ + + */ +class Mage_Backup_Model_Config_Backend_Cron extends Mage_Core_Model_Config_Data +{ + const CRON_STRING_PATH = 'crontab/jobs/system_backup/schedule/cron_expr'; + const CRON_MODEL_PATH = 'crontab/jobs/system_backup/run/model'; + + const XML_PATH_BACKUP_ENABLED = 'groups/backup/fields/enabled/value'; + const XML_PATH_BACKUP_TIME = 'groups/backup/fields/time/value'; + const XML_PATH_BACKUP_FREQUENCY = 'groups/backup/fields/frequency/value'; + + /** + * Cron settings after save + * + * @return Mage_Adminhtml_Model_System_Config_Backend_Log_Cron + */ + protected function _afterSave() + { + $enabled = $this->getData(self::XML_PATH_BACKUP_ENABLED); + $time = $this->getData(self::XML_PATH_BACKUP_TIME); + $frequency = $this->getData(self::XML_PATH_BACKUP_FREQUENCY); + + $frequencyWeekly = Mage_Adminhtml_Model_System_Config_Source_Cron_Frequency::CRON_WEEKLY; + $frequencyMonthly = Mage_Adminhtml_Model_System_Config_Source_Cron_Frequency::CRON_MONTHLY; + + if ($enabled) { + $cronExprArray = array( + intval($time[1]), # Minute + intval($time[0]), # Hour + ($frequency == $frequencyMonthly) ? '1' : '*', # Day of the Month + '*', # Month of the Year + ($frequency == $frequencyWeekly) ? '1' : '*', # Day of the Week + ); + $cronExprString = join(' ', $cronExprArray); + } + else { + $cronExprString = ''; + } + + try { + Mage::getModel('core/config_data') + ->load(self::CRON_STRING_PATH, 'path') + ->setValue($cronExprString) + ->setPath(self::CRON_STRING_PATH) + ->save(); + + Mage::getModel('core/config_data') + ->load(self::CRON_MODEL_PATH, 'path') + ->setValue((string) Mage::getConfig()->getNode(self::CRON_MODEL_PATH)) + ->setPath(self::CRON_MODEL_PATH) + ->save(); + } + catch (Exception $e) { + Mage::throwException(Mage::helper('backup')->__('Unable to save the cron expression.')); + } + } +} diff --git a/app/code/core/Mage/Backup/Model/Config/Source/Type.php b/app/code/core/Mage/Backup/Model/Config/Source/Type.php new file mode 100644 index 0000000000..75234eeb14 --- /dev/null +++ b/app/code/core/Mage/Backup/Model/Config/Source/Type.php @@ -0,0 +1,52 @@ + + */ +class Mage_Backup_Model_Config_Source_Type +{ + /** + * return possible options + * + * @return array + */ + public function toOptionArray() + { + $backupTypes = array(); + foreach(Mage::helper('backup')->getBackupTypes() as $type => $label) { + $backupTypes[] = array( + 'label' => $label, + 'value' => $type, + ); + } + return $backupTypes; + } +} diff --git a/app/code/core/Mage/Backup/Model/Fs/Collection.php b/app/code/core/Mage/Backup/Model/Fs/Collection.php index 897a0ade97..c95398fbde 100644 --- a/app/code/core/Mage/Backup/Model/Fs/Collection.php +++ b/app/code/core/Mage/Backup/Model/Fs/Collection.php @@ -58,10 +58,17 @@ public function __construct() } // set collection specific params + $extensions = Mage::helper('backup')->getExtensions(); + + foreach ($extensions as $key => $value) { + $extensions[] = '(' . preg_quote($value, '/') . ')'; + } + $extensions = implode('|', $extensions); + $this ->setOrder('time', self::SORT_ORDER_DESC) ->addTargetDir($this->_baseDir) - ->setFilesFilter('/^[a-z0-9\-\_]+\.' . preg_quote(Mage_Backup_Model_Backup::BACKUP_EXTENSION, '/') . '$/') + ->setFilesFilter('/^[a-z0-9\-\_]+\.' . $extensions . '$/') ->setCollectRecursively(false) ; } @@ -80,6 +87,7 @@ protected function _generateRow($filename) $row[$key] = $value; } $row['size'] = filesize($filename); + $row['id'] = $row['time'] . '_' . $row['type']; return $row; } } diff --git a/app/code/core/Mage/Backup/Model/Observer.php b/app/code/core/Mage/Backup/Model/Observer.php new file mode 100644 index 0000000000..ff773d637e --- /dev/null +++ b/app/code/core/Mage/Backup/Model/Observer.php @@ -0,0 +1,95 @@ + + */ +class Mage_Backup_Model_Observer +{ + const XML_PATH_BACKUP_ENABLED = 'system/backup/enabled'; + const XML_PATH_BACKUP_TYPE = 'system/backup/type'; + const XML_PATH_BACKUP_MAINTENANCE_MODE = 'system/backup/maintenance'; + + /** + * Error messages + * + * @var array + */ + protected $_errors = array(); + + /** + * Create Backup + * + * @return Mage_Log_Model_Cron + */ + public function scheduledBackup() + { + if (!Mage::getStoreConfigFlag(self::XML_PATH_BACKUP_ENABLED)) { + return $this; + } + + if (Mage::getStoreConfigFlag(self::XML_PATH_BACKUP_MAINTENANCE_MODE)) { + Mage::helper('backup')->turnOnMaintenanceMode(); + } + + $type = Mage::getStoreConfig(self::XML_PATH_BACKUP_TYPE); + + $this->_errors = array(); + try { + $backupManager = Mage_Backup::getBackupInstance($type) + ->setBackupExtension(Mage::helper('backup')->getExtensionByType($type)) + ->setTime(time()) + ->setBackupsDir(Mage::helper('backup')->getBackupsDir()); + + Mage::register('backup_manager', $backupManager); + + if ($type != Mage_Backup_Helper_Data::TYPE_DB) { + $backupManager->setRootDir(Mage::getBaseDir()) + ->addIgnorePaths(Mage::helper('backup')->getBackupIgnorePaths()); + } + + $backupManager->create(); + Mage::log(Mage::helper('backup')->getCreateSuccessMessageByType($type)); + } + catch (Exception $e) { + $this->_errors[] = $e->getMessage(); + $this->_errors[] = $e->getTrace(); + Mage::log($e->getMessage(), Zend_Log::ERR); + Mage::logException($e); + } + + if (Mage::getStoreConfigFlag(self::XML_PATH_BACKUP_MAINTENANCE_MODE)) { + Mage::helper('backup')->turnOffMaintenanceMode(); + } + + return $this; + } +} diff --git a/app/code/core/Mage/Backup/Model/Resource/Db.php b/app/code/core/Mage/Backup/Model/Resource/Db.php index 885107c7e0..bf2a9ce325 100755 --- a/app/code/core/Mage/Backup/Model/Resource/Db.php +++ b/app/code/core/Mage/Backup/Model/Resource/Db.php @@ -35,11 +35,11 @@ class Mage_Backup_Model_Resource_Db { /** - * Read connection + * Database connection adapter * * @var Varien_Db_Adapter_Pdo_Mysql */ - protected $_read; + protected $_write; /** * tables Foreign key data array @@ -55,7 +55,7 @@ class Mage_Backup_Model_Resource_Db */ public function __construct() { - $this->_read = Mage::getSingleton('core/resource')->getConnection('backup_read'); + $this->_write = Mage::getSingleton('core/resource')->getConnection('backup_write'); } /** @@ -85,7 +85,7 @@ public function clear() */ public function getTables() { - return $this->_read->listTables(); + return $this->_write->listTables(); } /** @@ -123,7 +123,10 @@ public function getTableForeignKeysSql($tableName = null) if (!$tableName) { $tables = $this->getTables(); foreach($tables as $table) { - $fkScript = $fkScript . Mage::getResourceHelper('backup')->getTableForeignKeysSql($table); + $tableFkScript = Mage::getResourceHelper('backup')->getTableForeignKeysSql($table); + if (!empty($tableFkScript)) { + $fkScript .= "\n" . $tableFkScript; + } } } else { $fkScript = $this->getTableForeignKeysSql($tableName); @@ -139,7 +142,7 @@ public function getTableForeignKeysSql($tableName = null) */ public function getTableStatus($tableName) { - $row = $this->_read->showTableStatus($tableName); + $row = $this->_write->showTableStatus($tableName); if ($row) { $statusObject = new Varien_Object(); @@ -148,8 +151,8 @@ public function getTableStatus($tableName) $statusObject->setData(strtolower($field), $value); } - $cntRow = $this->_read->fetchRow( - $this->_read->select()->from($tableName, 'COUNT(1) as rows')); + $cntRow = $this->_write->fetchRow( + $this->_write->select()->from($tableName, 'COUNT(1) as rows')); $statusObject->setRows($cntRow['rows']); return $statusObject; @@ -161,7 +164,7 @@ public function getTableStatus($tableName) /** * Quote Table Row * - * @deprecated + * @deprecated * * @param string $tableName * @param array $row @@ -169,7 +172,7 @@ public function getTableStatus($tableName) */ protected function _quoteRow($tableName, array $row) { - return $row; + return $row; } /** @@ -182,8 +185,7 @@ protected function _quoteRow($tableName, array $row) */ public function getTableDataSql($tableName, $count = null, $offset = null) { - return Mage::getResourceHelper('backup')->getInsertSql($tableName); - + return Mage::getResourceHelper('backup')->getPartInsertSql($tableName, $count, $offset); } /** @@ -206,7 +208,7 @@ public function getTableCreateScript($tableName, $addDropIfExists = false) */ public function getTableHeader($tableName) { - $quotedTableName = $this->_read->quoteIdentifier($tableName); + $quotedTableName = $this->_write->quoteIdentifier($tableName); return "\n--\n" . "-- Table structure for table {$quotedTableName}\n" . "--\n\n"; @@ -241,7 +243,7 @@ public function getHeader() */ public function getFooter() { - return Mage::getResourceHelper('backup')->getFooter(); + return Mage::getResourceHelper('backup')->getFooter(); } /** @@ -274,7 +276,7 @@ public function getTableDataAfterSql($tableName) public function beginTransaction() { Mage::getResourceHelper('backup')->turnOnSerializableMode(); - $this->_read->beginTransaction(); + $this->_write->beginTransaction(); return $this; } @@ -285,7 +287,7 @@ public function beginTransaction() */ public function commitTransaction() { - $this->_read->commit(); + $this->_write->commit(); Mage::getResourceHelper('backup')->turnOnReadCommittedMode(); return $this; } @@ -297,7 +299,18 @@ public function commitTransaction() */ public function rollBackTransaction() { - $this->_read->rollBack(); + $this->_write->rollBack(); + return $this; + } + + /** + * Run sql code + * + * @param $command + * @return Mage_Backup_Model_Resource_Db + */ + public function runCommand($command){ + $this->_write->query($command); return $this; } } diff --git a/app/code/core/Mage/Backup/Model/Resource/Helper/Mysql4.php b/app/code/core/Mage/Backup/Model/Resource/Helper/Mysql4.php index bcb54f9e87..1693b188b3 100644 --- a/app/code/core/Mage/Backup/Model/Resource/Helper/Mysql4.php +++ b/app/code/core/Mage/Backup/Model/Resource/Helper/Mysql4.php @@ -54,19 +54,40 @@ public function getTableDropSql($tableName) */ public function getTableForeignKeysSql($tableName = null) { + $sql = false; + if ($tableName === null) { $sql = ''; foreach ($this->_foreignKeys as $table => $foreignKeys) { - $sql .= sprintf("ALTER TABLE %s\n %s;\n", - $this->_getReadAdapter()->quoteIdentifier($table), - join(",\n ", $foreignKeys) - ); + $sql .= $this->_buildForeignKeysAlterTableSql($table, $foreignKeys); } - return $sql; + } else if (isset($this->_foreignKeys[$tableName])) { + $foreignKeys = $this->_foreignKeys[$tableName]; + $sql = $this->_buildForeignKeysAlterTableSql($tableName, $foreignKeys); + } + + return $sql; + } + + /** + * Build sql that will add foreign keys to it + * + * @param string $tableName + * @param array $foreignKeys + * @return string + */ + protected function _buildForeignKeysAlterTableSql($tableName, $foreignKeys) + { + if (!is_array($foreignKeys) || empty($foreignKeys)) { + return ''; } - return false; + return sprintf("ALTER TABLE %s\n %s;\n", + $this->_getReadAdapter()->quoteIdentifier($tableName), + join(",\n ", $foreignKeys) + ); } + /** * Get create script for table * @@ -217,14 +238,17 @@ public function getTableDataAfterSql($tableName) * Return table part data SQL insert * * @param string $tableName + * @param int $count + * @param int $offset * @return string */ - public function getInsertSql($tableName) + public function getPartInsertSql($tableName, $count = null, $offset = null) { $sql = null; $adapter = $this->_getWriteAdapter(); $select = $adapter->select() - ->from($tableName); + ->from($tableName) + ->limit($count, $offset); $query = $adapter->query($select); while ($row = $query->fetch()) { @@ -243,7 +267,16 @@ public function getInsertSql($tableName) return $sql; } - + /** + * Return table data SQL insert + * + * @param string $tableName + * @return string + */ + public function getInsertSql($tableName) + { + return $this->getPartInsertSql($tableName); + } /** * Quote Table Row * diff --git a/app/code/core/Mage/Backup/etc/adminhtml.xml b/app/code/core/Mage/Backup/etc/adminhtml.xml index ac212733c4..51481326a1 100644 --- a/app/code/core/Mage/Backup/etc/adminhtml.xml +++ b/app/code/core/Mage/Backup/etc/adminhtml.xml @@ -50,6 +50,11 @@ Backups + + + Rollback + + diff --git a/app/code/core/Mage/Backup/etc/config.xml b/app/code/core/Mage/Backup/etc/config.xml index 1fe7c44131..295c8a35cd 100644 --- a/app/code/core/Mage/Backup/etc/config.xml +++ b/app/code/core/Mage/Backup/etc/config.xml @@ -61,4 +61,13 @@ + + + + + backup/observer::scheduledBackup + + + + diff --git a/app/code/core/Mage/Backup/etc/system.xml b/app/code/core/Mage/Backup/etc/system.xml new file mode 100644 index 0000000000..29cf2beedf --- /dev/null +++ b/app/code/core/Mage/Backup/etc/system.xml @@ -0,0 +1,95 @@ + + + + + + + + + text + 500 + 1 + 0 + 0 + + + + select + adminhtml/system_config_source_yesno + 10 + 1 + 0 + 0 + + + + select + 1 + backup/config_source_type + 20 + 1 + 0 + 0 + + + + + select + 1 + adminhtml/system_config_source_cron_frequency + backup/config_backend_cron + 40 + 1 + 0 + 0 + + + + Put store on the maintenance mode while backup's creation + select + 1 + adminhtml/system_config_source_yesno + 50 + 1 + 0 + 0 + + + + + + + diff --git a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes.php b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes.php index 710a939bc7..a01f8992bd 100644 --- a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes.php +++ b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes.php @@ -72,6 +72,7 @@ protected function _prepareForm() $tax->setAfterElementHtml( '' ); @@ -112,6 +116,15 @@ function changeTaxClassId() { ); } + $groupPrice = $this->getForm()->getElement('group_price'); + if ($groupPrice) { + $groupPrice->setRenderer( + $this->getLayout()->createBlock('adminhtml/catalog_product_edit_tab_price_group') + ->setPriceColumnHeader(Mage::helper('bundle')->__('Percent Discount')) + ->setPriceValidation('validate-greater-than-zero validate-percents') + ); + } + $mapEnabled = $this->getForm()->getElement('msrp_enabled'); if ($mapEnabled && $this->getCanEditPrice() !== false) { $mapEnabled->setAfterElementHtml( diff --git a/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle.php b/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle.php index d8e5daef87..0043282b9c 100644 --- a/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle.php +++ b/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle.php @@ -73,6 +73,11 @@ public function hasOptions() return true; } + /** + * Returns JSON encoded config to be used in JS scripts + * + * @return string + */ public function getJsonConfig() { Mage::app()->getLocale()->getJsPriceFormat(); @@ -80,15 +85,18 @@ public function getJsonConfig() $options = array(); $selected = array(); $currentProduct = $this->getProduct(); + /* @var $coreHelper Mage_Core_Helper_Data */ $coreHelper = Mage::helper('core'); + /* @var $bundlePriceModel Mage_Bundle_Model_Product_Price */ $bundlePriceModel = Mage::getModel('bundle/product_price'); - if ($preconfiguredFlag = $currentProduct->hasPreconfiguredValues()) { - $preconfiguredValues = $currentProduct->getPreconfiguredValues(); + if ($preConfiguredFlag = $currentProduct->hasPreconfiguredValues()) { + $preConfiguredValues = $currentProduct->getPreconfiguredValues(); $defaultValues = array(); } foreach ($optionsArray as $_option) { + /* @var $_option Mage_Bundle_Model_Option */ if (!$_option->getSelections()) { continue; } @@ -103,8 +111,9 @@ public function getJsonConfig() $selectionCount = count($_option->getSelections()); foreach ($_option->getSelections() as $_selection) { + /* @var $_selection Mage_Catalog_Model_Product */ $selectionId = $_selection->getSelectionId(); - $_qty = !($_selection->getSelectionQty()*1) ? '1' : $_selection->getSelectionQty()*1; + $_qty = !($_selection->getSelectionQty() * 1) ? '1' : $_selection->getSelectionQty() * 1; // recalculate currency $tierPrices = $_selection->getTierPrice(); foreach ($tierPrices as &$tierPriceInfo) { @@ -112,17 +121,8 @@ public function getJsonConfig() } unset($tierPriceInfo); // break the reference with the last element - $taxPercent = 0; - $taxClassId = $_selection->getTaxClassId(); - if ($taxClassId) { - $request = Mage::getSingleton('tax/calculation')->getRateRequest(); - $taxPercent = Mage::getSingleton('tax/calculation')->getRate( - $request->setProductClassId($taxClassId) - ); - } - $itemPrice = $bundlePriceModel->getSelectionFinalTotalPrice($currentProduct, $_selection, - $currentProduct->getQty(), $_selection->getQty()); + $currentProduct->getQty(), $_selection->getQty(), false); $canApplyMAP = false; @@ -138,16 +138,16 @@ public function getJsonConfig() } $selection = array ( - 'qty' => $_qty, - 'customQty' => $_selection->getSelectionCanChangeQty(), - 'price' => $coreHelper->currency($_selection->getFinalPrice(), false, false), - 'priceInclTax' => $coreHelper->currency($_priceInclTax, false, false), - 'priceExclTax' => $coreHelper->currency($_priceExclTax, false, false), - 'priceValue' => $coreHelper->currency($_selection->getSelectionPriceValue(), false, false), - 'priceType' => $_selection->getSelectionPriceType(), - 'tierPrice' => $tierPrices, - 'name' => $_selection->getName(), - 'plusDisposition' => 0, + 'qty' => $_qty, + 'customQty' => $_selection->getSelectionCanChangeQty(), + 'price' => $coreHelper->currency($_selection->getFinalPrice(), false, false), + 'priceInclTax' => $coreHelper->currency($_priceInclTax, false, false), + 'priceExclTax' => $coreHelper->currency($_priceExclTax, false, false), + 'priceValue' => $coreHelper->currency($_selection->getSelectionPriceValue(), false, false), + 'priceType' => $_selection->getSelectionPriceType(), + 'tierPrice' => $tierPrices, + 'name' => $_selection->getName(), + 'plusDisposition' => 0, 'minusDisposition' => 0, 'canApplyMAP' => $canApplyMAP ); @@ -156,7 +156,7 @@ public function getJsonConfig() $args = array('response_object' => $responseObject, 'selection' => $_selection); Mage::dispatchEvent('bundle_product_view_config', $args); if (is_array($responseObject->getAdditionalOptions())) { - foreach ($responseObject->getAdditionalOptions() as $o=>$v) { + foreach ($responseObject->getAdditionalOptions() as $o => $v) { $selection[$o] = $v; } } @@ -171,8 +171,8 @@ public function getJsonConfig() $options[$optionId] = $option; // Add attribute default value (if set) - if ($preconfiguredFlag) { - $configValue = $preconfiguredValues->getData('bundle_option/' . $optionId); + if ($preConfiguredFlag) { + $configValue = $preConfiguredValues->getData('bundle_option/' . $optionId); if ($configValue) { $defaultValues[$optionId] = $configValue; } @@ -192,7 +192,7 @@ public function getJsonConfig() 'isMAPAppliedDirectly' => Mage::helper('catalog')->canApplyMsrp($this->getProduct(), null, false) ); - if ($preconfiguredFlag && !empty($defaultValues)) { + if ($preConfiguredFlag && !empty($defaultValues)) { $config['defaultValues'] = $defaultValues; } diff --git a/app/code/core/Mage/Bundle/Model/Product/Price.php b/app/code/core/Mage/Bundle/Model/Product/Price.php index 748e771322..f296ce8437 100644 --- a/app/code/core/Mage/Bundle/Model/Product/Price.php +++ b/app/code/core/Mage/Bundle/Model/Product/Price.php @@ -27,9 +27,9 @@ /** * Bundle Price Model * - * @category Mage - * @package Mage_Bundle - * @author Magento Core Team + * @category Mage + * @package Mage_Bundle + * @author Magento Core Team */ class Mage_Bundle_Model_Product_Price extends Mage_Catalog_Model_Product_Type_Price { @@ -37,7 +37,7 @@ class Mage_Bundle_Model_Product_Price extends Mage_Catalog_Model_Product_Type_Pr const PRICE_TYPE_DYNAMIC = 0; /** - * Flag wich indicates - is min/max prices have been calculated by index + * Flag which indicates - is min/max prices have been calculated by index * * @var bool */ @@ -56,6 +56,7 @@ public function getIsPricesCalculatedByIndex() /** * Return product base price * + * @param Mage_Catalog_Model_Product $product * @return string */ public function getPrice($product) @@ -70,11 +71,11 @@ public function getPrice($product) /** * Get product final price * - * @param double $qty + * @param double $qty * @param Mage_Catalog_Model_Product $product * @return double */ - public function getFinalPrice($qty=null, $product) + public function getFinalPrice($qty = null, $product) { if (is_null($qty) && !is_null($product->getCalculatedFinalPrice())) { return $product->getCalculatedFinalPrice(); @@ -86,12 +87,13 @@ public function getFinalPrice($qty=null, $product) * Just product with fixed price calculation has price */ if ($finalPrice) { - $tierPrice = $this->_applyTierPrice($product, $qty, $finalPrice); - $specialPrice = $this->_applySpecialPrice($product, $finalPrice); - $finalPrice = min(array($tierPrice, $specialPrice)); + $groupPrice = $this->_applyGroupPrice($product, $finalPrice); + $tierPrice = $this->_applyTierPrice($product, $qty, $finalPrice); + $specialPrice = $this->_applySpecialPrice($product, $finalPrice); + $finalPrice = min(array($groupPrice, $tierPrice, $specialPrice)); $product->setFinalPrice($finalPrice); - Mage::dispatchEvent('catalog_product_get_final_price', array('product'=>$product)); + Mage::dispatchEvent('catalog_product_get_final_price', array('product' => $product)); $finalPrice = $product->getData('final_price'); } $basePrice = $finalPrice; @@ -122,6 +124,15 @@ public function getFinalPrice($qty=null, $product) return max(0, $product->getData('final_price')); } + /** + * Returns final price of a child product + * + * @param Mage_Catalog_Model_Product $product + * @param float $productQty + * @param Mage_Catalog_Model_Product $childProduct + * @param float $childProductQty + * @return decimal + */ public function getChildFinalPrice($product, $productQty, $childProduct, $childProductQty) { return $this->getSelectionFinalPrice($product, $childProduct, $productQty, $childProductQty, false); @@ -134,7 +145,7 @@ public function getChildFinalPrice($product, $productQty, $childProduct, $childP * @see Mage_Bundle_Model_Product_Price::getTotalPrices() * * @param Mage_Catalog_Model_Product $product - * @param string $which + * @param string $which * @return decimal|array */ public function getPrices($product, $which = null) @@ -149,8 +160,8 @@ public function getPrices($product, $which = null) * @see Mage_Bundle_Model_Product_Price::getTotalPrices() * * @param Mage_Catalog_Model_Product $product - * @param string $which - * @param bool|null $includeTax + * @param string $which + * @param bool|null $includeTax * @return decimal|array */ public function getPricesDependingOnTax($product, $which = null, $includeTax = null) @@ -159,21 +170,23 @@ public function getPricesDependingOnTax($product, $which = null, $includeTax = n } /** - * Retrieve Price with take into account tier price + * Retrieve Price considering tier price * * @param Mage_Catalog_Model_Product $product - * @param string|null $which - * @param bool|null $includeTax - * @param bool $takeTierPrice + * @param string|null $which + * @param bool|null $includeTax + * @param bool $takeTierPrice * @return decimal|array */ public function getTotalPrices($product, $which = null, $includeTax = null, $takeTierPrice = true) { + // check if required price is stored in product data + $forceRecalculation = $includeTax xor Mage::helper('tax')->priceIncludesTax(Mage::app()->getStore()); // check calculated price index - if ($product->getData('min_price') && $product->getData('max_price')) { - $minimalPrice = Mage::helper('tax')->getPrice($product, $product->getData('min_price'), $includeTax); - $maximalPrice = Mage::helper('tax')->getPrice($product, $product->getData('max_price'), $includeTax); - $this->_isPricesCalculatedByIndex = true; + if ($product->getData('min_price') && $product->getData('max_price') && !$forceRecalculation) { + $minimalPrice = Mage::helper('tax')->getPrice($product, $product->getData('min_price'), $includeTax); + $maximalPrice = Mage::helper('tax')->getPrice($product, $product->getData('max_price'), $includeTax); + $this->_isPricesCalculatedByIndex = true; } else { /** * Check if product price is fixed @@ -206,9 +219,6 @@ public function getTotalPrices($product, $which = null, $includeTax = null, $tak } $qty = $selection->getSelectionQty(); - if ($selection->getSelectionCanChangeQty() && !$option->isMultiSelection()) { - $qty = min(1, $qty); - } $item = $product->getPriceType() == self::PRICE_TYPE_FIXED ? $product : $selection; @@ -296,7 +306,7 @@ public function getTotalPrices($product, $which = null, $includeTax = null, $tak if ($which == 'max') { return $maximalPrice; - } else if ($which == 'min') { + } elseif ($which == 'min') { return $minimalPrice; } @@ -353,8 +363,9 @@ public function getOptions($product) * * @param Mage_Catalog_Model_Product $bundleProduct * @param Mage_Catalog_Model_Product $selectionProduct - * @param decimal $selectionQty - * @return decimal + * @param float|null $selectionQty + * @param null|bool $multiplyQty Whether to multiply selection's price by its quantity + * @return float */ public function getSelectionPrice($bundleProduct, $selectionProduct, $selectionQty = null, $multiplyQty = true) { @@ -370,10 +381,14 @@ public function getSelectionPrice($bundleProduct, $selectionProduct, $selectionQ } } else { if ($selectionProduct->getSelectionPriceType()) { // percent - return $bundleProduct->getPrice() * ($selectionProduct->getSelectionPriceValue() / 100) * $selectionQty; + $price = $bundleProduct->getPrice() * ($selectionProduct->getSelectionPriceValue() / 100); } else { // fixed - return $selectionProduct->getSelectionPriceValue() * $selectionQty; + $price = $selectionProduct->getSelectionPriceValue(); + } + if ($multiplyQty) { + $price *= $selectionQty; } + return $price; } } @@ -382,15 +397,15 @@ public function getSelectionPrice($bundleProduct, $selectionProduct, $selectionQ * * @param Mage_Catalog_Model_Product $bundleProduct * @param Mage_Catalog_Model_Product $selectionProduct - * @param decimal + * @param decimal $qty * @return decimal */ public function getSelectionPreFinalPrice($bundleProduct, $selectionProduct, $qty = null) { - return $this->_applySpecialPrice( - $bundleProduct, - $this->getSelectionPrice($bundleProduct, $selectionProduct, $qty) - ); + $selectionPrice = $this->getSelectionPrice($bundleProduct, $selectionProduct, $qty); + $specialPrice = $this->_applySpecialPrice($bundleProduct, $selectionPrice); + $groupPrice = $this->_applyGroupPrice($bundleProduct, $selectionPrice); + return min($specialPrice, $groupPrice); } /** @@ -401,9 +416,9 @@ public function getSelectionPreFinalPrice($bundleProduct, $selectionProduct, $qt * * @param Mage_Catalog_Model_Product $bundleProduct * @param Mage_Catalog_Model_Product $selectionProduct - * @param decimal $bundleQty - * @param decimal $selectionQty - * @param bool $multiplyQty + * @param decimal $bundleQty + * @param decimal $selectionQty + * @param bool $multiplyQty * @return decimal */ public function getSelectionFinalPrice($bundleProduct, $selectionProduct, $bundleQty, $selectionQty = null, @@ -419,10 +434,10 @@ public function getSelectionFinalPrice($bundleProduct, $selectionProduct, $bundl * * @param Mage_Catalog_Model_Product $bundleProduct * @param Mage_Catalog_Model_Product $selectionProduct - * @param decimal $bundleQty - * @param decimal $selectionQty - * @param bool $multiplyQty - * @param bool $takeTierPrice + * @param decimal $bundleQty + * @param decimal $selectionQty + * @param bool $multiplyQty + * @param bool $takeTierPrice * @return decimal */ public function getSelectionFinalTotalPrice($bundleProduct, $selectionProduct, $bundleQty, $selectionQty, @@ -432,22 +447,80 @@ public function getSelectionFinalTotalPrice($bundleProduct, $selectionProduct, $ // apply bundle special price $specialPrice = $this->_applySpecialPrice($bundleProduct, $selectionPrice); + // apply bundle group price + $groupPrice = $this->_applyGroupPrice($bundleProduct, $selectionPrice); if ($takeTierPrice) { // apply bundle tier price $tierPrice = $this->_applyTierPrice($bundleProduct, $bundleQty, $selectionPrice); - return min(array($tierPrice, $specialPrice)); + return min(array($groupPrice, $tierPrice, $specialPrice)); } else { - return $specialPrice; + return min(array($groupPrice, $specialPrice)); } } + /** + * Apply group price for bundle product + * + * @param Mage_Catalog_Model_Product $product + * @param float $finalPrice + * @return float + */ + protected function _applyGroupPrice($product, $finalPrice) + { + $result = $finalPrice; + $groupPrice = $product->getGroupPrice(); + + if (is_numeric($groupPrice)) { + $groupPrice = $finalPrice - ($finalPrice * ($groupPrice / 100)); + $result = min($finalPrice, $groupPrice); + } + + return $result; + } + + /** + * Get product group price + * + * @param Mage_Catalog_Model_Product $product + * @return float|null + */ + public function getGroupPrice($product) + { + $groupPrices = $product->getData('group_price'); + + if (is_null($groupPrices)) { + $attribute = $product->getResource()->getAttribute('group_price'); + if ($attribute) { + $attribute->getBackend()->afterLoad($product); + $groupPrices = $product->getData('group_price'); + } + } + + if (is_null($groupPrices) || !is_array($groupPrices)) { + return null; + } + + $customerGroup = $this->_getCustomerGroupId($product); + + $matchedPrice = 0; + + foreach ($groupPrices as $groupPrice) { + if ($groupPrice['cust_group'] == $customerGroup && $groupPrice['website_price'] > $matchedPrice) { + $matchedPrice = $groupPrice['website_price']; + break; + } + } + + return $matchedPrice; + } + /** * Apply tier price for bundle * * @param Mage_Catalog_Model_Product $product - * @param decimal $qty - * @param decimal $finalPrice + * @param decimal $qty + * @param decimal $finalPrice * @return decimal */ protected function _applyTierPrice($product, $qty, $finalPrice) @@ -469,7 +542,7 @@ protected function _applyTierPrice($product, $qty, $finalPrice) /** * Get product tier price by qty * - * @param decimal $qty + * @param decimal $qty * @param Mage_Catalog_Model_Product $product * @return decimal */ @@ -554,14 +627,14 @@ public function getTierPrice($qty=null, $product) /** * Calculate product price based on special price data and price rules * - * @param float $basePrice - * @param float $specialPrice - * @param string $specialPriceFrom - * @param string $specialPriceTo + * @param float $basePrice + * @param float $specialPrice + * @param string $specialPriceFrom + * @param string $specialPriceTo * @param float|null|false $rulePrice - * @param mixed $wId - * @param mixed $gId - * @param null|int $productId + * @param mixed $wId + * @param mixed $gId + * @param null|int $productId * @return float */ public static function calculatePrice($basePrice, $specialPrice, $specialPriceFrom, $specialPriceTo, @@ -698,11 +771,11 @@ public static function calculatePrice($basePrice, $specialPrice, $specialPriceFr /** * Calculate and apply special price * - * @param float $finalPrice - * @param float $specialPrice + * @param float $finalPrice + * @param float $specialPrice * @param string $specialPriceFrom * @param string $specialPriceTo - * @param mixed $store + * @param mixed $store * @return float */ public static function calculateSpecialPrice($finalPrice, $specialPrice, $specialPriceFrom, $specialPriceTo, @@ -719,11 +792,11 @@ public static function calculateSpecialPrice($finalPrice, $specialPrice, $specia } /** - * Check is tier price value fixed or percent of original price + * Check is group price value fixed or percent of original price * * @return bool */ - public function isTierPriceFixed() + public function isGroupPriceFixed() { return false; } diff --git a/app/code/core/Mage/Bundle/Model/Resource/Indexer/Price.php b/app/code/core/Mage/Bundle/Model/Resource/Indexer/Price.php index 96a97e2512..b04b26ef70 100755 --- a/app/code/core/Mage/Bundle/Model/Resource/Indexer/Price.php +++ b/app/code/core/Mage/Bundle/Model/Resource/Indexer/Price.php @@ -42,7 +42,15 @@ class Mage_Bundle_Model_Resource_Indexer_Price extends Mage_Catalog_Model_Resour public function reindexAll() { $this->useIdxTable(true); - $this->_prepareBundlePrice(); + + $this->beginTransaction(); + try { + $this->_prepareBundlePrice(); + $this->commit(); + } catch (Exception $e) { + $this->rollBack(); + throw $e; + } return $this; } @@ -162,7 +170,13 @@ protected function _prepareBundlePriceByType($priceType, $entityIds = null) ->joinLeft( array('tp' => $this->_getTierPriceIndexTable()), 'tp.entity_id = e.entity_id AND tp.website_id = cw.website_id' - . ' AND tp.customer_group_id = cg.customer_group_id', + . ' AND tp.customer_group_id = cg.customer_group_id', + array() + ) + ->joinLeft( + array('gp' => $this->_getGroupPriceIndexTable()), + 'gp.entity_id = e.entity_id AND gp.website_id = cw.website_id' + . ' AND gp.customer_group_id = cg.customer_group_id', array() ) ->where('e.type_id=?', $this->getTypeId()); @@ -179,7 +193,9 @@ protected function _prepareBundlePriceByType($priceType, $entityIds = null) if ($priceType == Mage_Bundle_Model_Product_Price::PRICE_TYPE_DYNAMIC) { $select->columns(array('tax_class_id' => new Zend_Db_Expr('0'))); } else { - $select->columns(array('tax_class_id' => $write->getCheckSql($taxClassId . ' IS NOT NULL', $taxClassId, 0))); + $select->columns( + array('tax_class_id' => $write->getCheckSql($taxClassId . ' IS NOT NULL', $taxClassId, 0)) + ); } $priceTypeCond = $write->quoteInto('=?', $priceType); @@ -191,7 +207,6 @@ protected function _prepareBundlePriceByType($priceType, $entityIds = null) $specialTo = $this->_addAttributeToSelect($select, 'special_to_date', 'e.entity_id', 'cs.store_id'); $curentDate = new Zend_Db_Expr('cwd.website_date'); - $specialExpr = $write->getCheckSql( $write->getCheckSql( $specialFrom . ' IS NULL', @@ -215,6 +230,13 @@ protected function _prepareBundlePriceByType($priceType, $entityIds = null) $specialPrice, '0' ); + + $groupPriceExpr = $write->getCheckSql( + 'gp.price IS NOT NULL AND gp.price > 0 AND gp.price < 100', + 'gp.price', + '0' + ); + $tierExpr = new Zend_Db_Expr("tp.min_price"); if ($priceType == Mage_Bundle_Model_Product_Price::PRICE_TYPE_FIXED) { @@ -225,24 +247,38 @@ protected function _prepareBundlePriceByType($priceType, $entityIds = null) ); $tierPrice = $write->getCheckSql( $tierExpr . ' IS NOT NULL', - 'ROUND(' . $price .' - ' . '(' . $price . ' * (' . $tierExpr . ' / 100)), 4)', + 'ROUND(' . $price . ' - ' . '(' . $price . ' * (' . $tierExpr . ' / 100)), 4)', 'NULL' ); + $groupPrice = $write->getCheckSql( + $groupPriceExpr . ' > 0', + 'ROUND(' . $price . ' - ' . '(' . $price . ' * (' . $groupPriceExpr . ' / 100)), 4)', + 'NULL' + ); + $finalPrice = $write->getCheckSql( + "{$groupPrice} IS NOT NULL AND {$groupPrice} < {$finalPrice}", + $groupPrice, + $finalPrice + ); } else { $finalPrice = new Zend_Db_Expr("0"); $tierPrice = $write->getCheckSql($tierExpr . ' IS NOT NULL', '0', 'NULL'); + $groupPrice = $write->getCheckSql($groupPriceExpr . ' > 0', $groupPriceExpr, 'NULL'); } $select->columns(array( - 'price_type' => new Zend_Db_Expr($priceType), - 'special_price' => $specialExpr, - 'tier_percent' => $tierExpr, - 'orig_price' => $write->getCheckSql($price . ' IS NULL', '0', $price), - 'price' => $finalPrice, - 'min_price' => $finalPrice, - 'max_price' => $finalPrice, - 'tier_price' => $tierPrice, - 'base_tier' => $tierPrice, + 'price_type' => new Zend_Db_Expr($priceType), + 'special_price' => $specialExpr, + 'tier_percent' => $tierExpr, + 'orig_price' => $write->getCheckSql($price . ' IS NULL', '0', $price), + 'price' => $finalPrice, + 'min_price' => $finalPrice, + 'max_price' => $finalPrice, + 'tier_price' => $tierPrice, + 'base_tier' => $tierPrice, + 'group_price' => $groupPrice, + 'base_group_price' => $groupPrice, + 'group_price_percent' => new Zend_Db_Expr('gp.price'), )); if (!is_null($entityIds)) { @@ -292,6 +328,8 @@ protected function _calculateBundleOptionPrice() 'max_price' => $write->getCheckSql('i.group_type = 1', 'SUM(i.price)', 'MAX(i.price)'), 'tier_price' => $write->getCheckSql('i.is_required = 1', 'MIN(i.tier_price)', '0'), 'alt_tier_price' => $write->getCheckSql('i.is_required = 0', 'MIN(i.tier_price)', '0'), + 'group_price' => $write->getCheckSql('i.is_required = 1', 'MIN(i.group_price)', '0'), + 'alt_group_price' => $write->getCheckSql('i.is_required = 0', 'MIN(i.group_price)', '0'), )); $query = $select->insertFromSelect($this->_getBundleOptionTable()); @@ -314,6 +352,15 @@ protected function _calculateBundleOptionPrice() ) . ' + MIN(i.tier_price)', 'NULL' ); + $groupPrice = $write->getCheckSql( + 'MIN(i.group_price_percent) IS NOT NULL', + $write->getCheckSql( + 'SUM(io.group_price) = 0', + 'SUM(io.alt_group_price)', + 'SUM(io.group_price)' + ) . ' + MIN(i.group_price)', + 'NULL' + ); $select = $write->select() ->from( @@ -329,12 +376,14 @@ protected function _calculateBundleOptionPrice() ->group(array('io.entity_id', 'io.customer_group_id', 'io.website_id', 'i.tax_class_id', 'i.orig_price', 'i.price')) ->columns(array('i.tax_class_id', - 'orig_price' => 'i.orig_price', - 'price' => 'i.price', - 'min_price' => $minPrice, - 'max_price' => $maxPrice, - 'tier_price' => $tierPrice, - 'base_tier' => 'MIN(i.base_tier)' + 'orig_price' => 'i.orig_price', + 'price' => 'i.price', + 'min_price' => $minPrice, + 'max_price' => $maxPrice, + 'tier_price' => $tierPrice, + 'base_tier' => 'MIN(i.base_tier)', + 'group_price' => $groupPrice, + 'base_group_price' => 'MIN(i.base_group_price)', )); $query = $select->insertFromSelect($this->_getDefaultFinalPriceTable()); @@ -377,7 +426,6 @@ protected function _calculateBundleSelectionPrice($priceType) ) . '* bs.selection_qty' ); - $tierExpr = $write->getCheckSql( 'i.base_tier IS NOT NULL', $write->getCheckSql( @@ -392,6 +440,24 @@ protected function _calculateBundleSelectionPrice($priceType) ) . ' * bs.selection_qty', 'NULL' ); + + $groupExpr = $write->getCheckSql( + 'i.base_group_price IS NOT NULL', + $write->getCheckSql( + $selectionPriceType .' = 1', + $priceExpr, + $write->getCheckSql( + 'i.group_price_percent > 0', + 'ROUND(' . $selectionPriceValue + . ' - (' . $selectionPriceValue . ' * (i.group_price_percent / 100)),4)', + $selectionPriceValue + ) + ) . ' * bs.selection_qty', + 'NULL' + ); + $priceExpr = new Zend_Db_Expr( + $write->getCheckSql("{$groupExpr} < {$priceExpr}", $groupExpr, $priceExpr) + ); } else { $priceExpr = new Zend_Db_Expr( $write->getCheckSql( @@ -405,7 +471,21 @@ protected function _calculateBundleSelectionPrice($priceType) 'ROUND(idx.min_price * (i.base_tier / 100), 4)* bs.selection_qty', 'NULL' ); - + $groupExpr = $write->getCheckSql( + 'i.base_group_price IS NOT NULL', + 'ROUND(idx.min_price * (i.base_group_price / 100), 4)* bs.selection_qty', + 'NULL' + ); + $groupPriceExpr = new Zend_Db_Expr( + $write->getCheckSql( + 'i.base_group_price IS NOT NULL AND i.base_group_price > 0 AND i.base_group_price < 100', + 'ROUND(idx.min_price - idx.min_price * (i.base_group_price / 100), 4)', + 'idx.min_price' + ) . ' * bs.selection_qty' + ); + $priceExpr = new Zend_Db_Expr( + $write->getCheckSql("{$groupPriceExpr} < {$priceExpr}", $groupPriceExpr, $priceExpr) + ); } $select = $write->select() @@ -449,6 +529,7 @@ protected function _calculateBundleSelectionPrice($priceType) 'is_required' => 'bo.required', 'price' => $priceExpr, 'tier_price' => $tierExpr, + 'group_price' => $groupExpr, )); $query = $select->insertFromSelect($this->_getBundleSelectionTable()); @@ -466,6 +547,7 @@ protected function _calculateBundleSelectionPrice($priceType) protected function _prepareBundlePrice($entityIds = null) { $this->_prepareTierPriceIndex($entityIds); + $this->_prepareGroupPriceIndex($entityIds); $this->_prepareBundlePriceTable(); $this->_prepareBundlePriceByType(Mage_Bundle_Model_Product_Price::PRICE_TYPE_FIXED, $entityIds); $this->_prepareBundlePriceByType(Mage_Bundle_Model_Product_Price::PRICE_TYPE_DYNAMIC, $entityIds); @@ -554,4 +636,63 @@ protected function _prepareTierPriceIndex($entityIds = null) return $this; } + + /** + * Prepare percentage group price for bundle products + * + * @see Mage_Catalog_Model_Resource_Product_Indexer_Price::_prepareGroupPriceIndex + * + * @param int|array $entityIds + * @return Mage_Bundle_Model_Resource_Indexer_Price + */ + protected function _prepareGroupPriceIndex($entityIds = null) + { + $adapter = $this->_getWriteAdapter(); + + // remove index by bundle products + $select = $adapter->select() + ->from(array('i' => $this->_getGroupPriceIndexTable()), null) + ->join( + array('e' => $this->getTable('catalog/product')), + 'i.entity_id=e.entity_id', + array() + ) + ->where('e.type_id=?', $this->getTypeId()); + $query = $select->deleteFromSelect('i'); + $adapter->query($query); + + $select = $adapter->select() + ->from( + array('gp' => $this->getValueTable('catalog/product', 'group_price')), + array('entity_id') + ) + ->join( + array('e' => $this->getTable('catalog/product')), + 'gp.entity_id=e.entity_id', + array() + ) + ->join( + array('cg' => $this->getTable('customer/customer_group')), + 'gp.all_groups = 1 OR (gp.all_groups = 0 AND gp.customer_group_id = cg.customer_group_id)', + array('customer_group_id') + ) + ->join( + array('cw' => $this->getTable('core/website')), + 'gp.website_id = 0 OR gp.website_id = cw.website_id', + array('website_id') + ) + ->where('cw.website_id != 0') + ->where('e.type_id=?', $this->getTypeId()) + ->columns(new Zend_Db_Expr('MIN(gp.value)')) + ->group(array('gp.entity_id', 'cg.customer_group_id', 'cw.website_id')); + + if (!empty($entityIds)) { + $select->where('gp.entity_id IN(?)', $entityIds); + } + + $query = $select->insertFromSelect($this->_getGroupPriceIndexTable()); + $adapter->query($query); + + return $this; + } } diff --git a/app/code/core/Mage/Bundle/Model/Resource/Indexer/Stock.php b/app/code/core/Mage/Bundle/Model/Resource/Indexer/Stock.php index 094d1d0a4e..b2d3e03169 100755 --- a/app/code/core/Mage/Bundle/Model/Resource/Indexer/Stock.php +++ b/app/code/core/Mage/Bundle/Model/Resource/Indexer/Stock.php @@ -34,18 +34,6 @@ */ class Mage_Bundle_Model_Resource_Indexer_Stock extends Mage_CatalogInventory_Model_Resource_Indexer_Stock_Default { - /** - * Reindex temporary (price result data) for all products - * - * @return Mage_Bundle_Model_Resource_Indexer_Stock - */ - public function reindexAll() - { - $this->useIdxTable(true); - $this->_prepareIndexTable(); - return $this; - } - /** * Reindex temporary (price result data) for defined product(s) * diff --git a/app/code/core/Mage/Bundle/etc/config.xml b/app/code/core/Mage/Bundle/etc/config.xml index e2c943b0c9..9c9d35d843 100644 --- a/app/code/core/Mage/Bundle/etc/config.xml +++ b/app/code/core/Mage/Bundle/etc/config.xml @@ -28,7 +28,7 @@ - 1.6.0.0 + 1.6.0.0.1 diff --git a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-1.6.0.0-1.6.0.0.1.php b/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-1.6.0.0-1.6.0.0.1.php new file mode 100644 index 0000000000..b56fc79f5c --- /dev/null +++ b/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-1.6.0.0-1.6.0.0.1.php @@ -0,0 +1,44 @@ +getConnection(); +$memoryTables = array( + 'bundle/option_indexer_tmp', + 'bundle/selection_indexer_tmp', + 'bundle/price_indexer_tmp', +); + +foreach ($memoryTables as $table) { + $connection->changeTableEngine($installer->getTable($table), Varien_Db_Adapter_Pdo_Mysql::ENGINE_MEMORY); +} diff --git a/app/code/core/Mage/Bundle/sql/bundle_setup/upgrade-1.6.0.0-1.6.0.0.1.php b/app/code/core/Mage/Bundle/sql/bundle_setup/upgrade-1.6.0.0-1.6.0.0.1.php new file mode 100644 index 0000000000..c715cca8d4 --- /dev/null +++ b/app/code/core/Mage/Bundle/sql/bundle_setup/upgrade-1.6.0.0-1.6.0.0.1.php @@ -0,0 +1,84 @@ +getConnection(); + +$priceIndexerTables = array( + 'bundle/price_indexer_idx', + 'bundle/price_indexer_tmp', +); + +$optionsPriceIndexerTables = array( + 'bundle/option_indexer_idx', + 'bundle/option_indexer_tmp', +); + +$selectionPriceIndexerTables = array( + 'bundle/selection_indexer_idx', + 'bundle/selection_indexer_tmp', +); + +foreach ($priceIndexerTables as $table) { + $connection->addColumn($installer->getTable($table), 'group_price', array( + 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, + 'length' => '12,4', + 'comment' => 'Group price', + )); + $connection->addColumn($installer->getTable($table), 'base_group_price', array( + 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, + 'length' => '12,4', + 'comment' => 'Base Group Price', + )); + $connection->addColumn($installer->getTable($table), 'group_price_percent', array( + 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, + 'length' => '12,4', + 'comment' => 'Group Price Percent', + )); +} + +foreach (array_merge($optionsPriceIndexerTables, $selectionPriceIndexerTables) as $table) { + $connection->addColumn($installer->getTable($table), 'group_price', array( + 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, + 'length' => '12,4', + 'comment' => 'Group price', + )); +} + +foreach ($optionsPriceIndexerTables as $table) { + $connection->addColumn($installer->getTable($table), 'alt_group_price', array( + 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, + 'length' => '12,4', + 'comment' => 'Alt Group Price', + )); +} + +$applyTo = explode(',', $installer->getAttribute(Mage_Catalog_Model_Product::ENTITY, 'group_price', 'apply_to')); +if (!in_array('bundle', $applyTo)) { + $applyTo[] = 'bundle'; + $installer->updateAttribute(Mage_Catalog_Model_Product::ENTITY, 'group_price', 'apply_to', implode(',', $applyTo)); +} diff --git a/app/code/core/Mage/Captcha/Block/Captcha.php b/app/code/core/Mage/Captcha/Block/Captcha.php new file mode 100755 index 0000000000..b934ed1dca --- /dev/null +++ b/app/code/core/Mage/Captcha/Block/Captcha.php @@ -0,0 +1,48 @@ + + */ +class Mage_Captcha_Block_Captcha extends Mage_Core_Block_Template +{ + /** + * Renders captcha HTML (if required) + * + * @return string + */ + protected function _toHtml() + { + $blockPath = Mage::helper('captcha')->getCaptcha($this->getFormId())->getBlockName(); + $block = $this->getLayout()->createBlock($blockPath); + $block->setData($this->getData()); + return $block->toHtml(); + } +} diff --git a/app/code/core/Mage/Captcha/Block/Captcha/Zend.php b/app/code/core/Mage/Captcha/Block/Captcha/Zend.php new file mode 100755 index 0000000000..02e1c78cf5 --- /dev/null +++ b/app/code/core/Mage/Captcha/Block/Captcha/Zend.php @@ -0,0 +1,87 @@ + + */ +class Mage_Captcha_Block_Captcha_Zend extends Mage_Core_Block_Template +{ + protected $_template = 'captcha/zend.phtml'; + + /** + * @var string + */ + protected $_captcha; + + /** + * Returns template path + * + * @return string + */ + public function getTemplate() + { + return $this->getIsAjax() ? '' : $this->_template; + } + + /** + * Returns URL to controller action which returns new captcha image + * + * @return string + */ + public function getRefreshUrl() + { + $url = Mage::app()->getStore()->isAdmin() ? "adminhtml/refresh/refresh" : "captcha/refresh"; + return Mage::getUrl($url, array('_secure' => Mage::app()->getRequest()->isSecure())); + } + + /** + * Renders captcha HTML (if required) + * + * @return string + */ + protected function _toHtml() + { + if ($this->getCaptchaModel()->isRequired()) { + $this->getCaptchaModel()->generate(); + return parent::_toHtml(); + } + return ''; + } + + /** + * Returns captcha model + * + * @return Mage_Captcha_Model_Abstract + */ + public function getCaptchaModel() + { + return Mage::helper('captcha')->getCaptcha($this->getFormId()); + } +} diff --git a/app/code/core/Mage/Captcha/Helper/Data.php b/app/code/core/Mage/Captcha/Helper/Data.php new file mode 100755 index 0000000000..ff9f08bb3b --- /dev/null +++ b/app/code/core/Mage/Captcha/Helper/Data.php @@ -0,0 +1,138 @@ + + */ +class Mage_Captcha_Helper_Data extends Mage_Core_Helper_Abstract +{ + /** + * Used for "name" attribute of captcha's input field + */ + const INPUT_NAME_FIELD_VALUE = 'captcha'; + + /** + * Always show captcha + */ + const MODE_ALWAYS = 'always'; + + /** + * Show captcha only after certain number of unsuccessful attempts + */ + const MODE_AFTER_FAIL = 'after_fail'; + + /** + * Captcha fonts path + */ + const XML_PATH_CAPTCHA_FONTS = 'default/captcha/fonts'; + + /** + * List uses Models of Captcha + * @var array + */ + protected $_captcha = array(); + + /** + * Get Captcha + * + * @param string $formId + * @return Mage_Captcha_Model_Interface + */ + public function getCaptcha($formId) + { + if (!array_key_exists($formId, $this->_captcha)) { + $type = $this->getConfigNode('type'); + $this->_captcha[$formId] = Mage::getModel('captcha/' . $type, array('formId' => $formId)); + } + return $this->_captcha[$formId]; + } + + /** + * Returns value of the node with respect to current area (frontend or backend) + * + * @param string $id The last part of XML_PATH_$area_CAPTCHA_ constant (case insensitive) + * @param Mage_Core_Model_Store $store + * @return Mage_Core_Model_Config_Element + */ + public function getConfigNode($id, $store = null) + { + $areaCode = Mage::app()->getStore($store)->isAdmin() ? 'admin' : 'customer'; + return Mage::getStoreConfig( $areaCode . '/captcha/' . $id, $store); + } + + /** + * Get list of available fonts + * Return format: + * [['arial'] => ['label' => 'Arial', 'path' => '/www/magento/fonts/arial.ttf']] + * + * @return array + */ + public function getFonts() + { + $node = Mage::getConfig()->getNode(Mage_Captcha_Helper_Data::XML_PATH_CAPTCHA_FONTS); + $fonts = array(); + if ($node) { + foreach ($node->children() as $fontName => $fontNode) { + $fonts[$fontName] = array( + 'label' => (string)$fontNode->label, + 'path' => Mage::getBaseDir('base') . DS . $fontNode->path + ); + } + } + return $fonts; + } + + /** + * Get captcha image directory + * + * @param mixed $website + * @return string + */ + public function getImgDir($website = null) + { + $websiteCode = Mage::app()->getWebsite($website)->getCode(); + $captchaDir = Mage::getBaseDir('media') . DS . 'captcha' . DS . $websiteCode . DS; + $io = new Varien_Io_File(); + $io->checkAndCreateFolder($captchaDir, 0755); + return $captchaDir; + } + + /** + * Get captcha image base URL + * + * @param mixed $website + * @return string + */ + public function getImgUrl($website = null) + { + $websiteCode = Mage::app()->getWebsite($website)->getCode(); + return Mage::getBaseUrl('media') . 'captcha' . '/' . $websiteCode . '/'; + } +} diff --git a/app/code/core/Mage/Captcha/Model/Captcha.php b/app/code/core/Mage/Captcha/Model/Captcha.php new file mode 100755 index 0000000000..2cfb2031b7 --- /dev/null +++ b/app/code/core/Mage/Captcha/Model/Captcha.php @@ -0,0 +1,149 @@ + + */ +class Mage_Captcha_Model_Captcha implements Mage_Captcha_Model_Interface +{ + protected $_model; + + /** + * Zend captcha constructor + * + * @param array $params + */ + public function __construct($params) + { + $type = Mage::helper('captcha')->getConfigNode('type'); + $this->_model = Mage::getModel('captcha/' . $type, $params); + } + + /** + * Whether to respect case while checking the answer + * + * @return bool + */ + public function isCaseSensitive() + { + return $this->_model->isCaseSensitive(); + } + + /** + * Generates captcha + * + */ + public function generate() + { + $this->_model->generate(); + } + + /** + * Checks whether word entered by user corresponds to the one generated by generate() + * + * @param string $word + * @return void + */ + public function isCorrect($word) + { + return $this->_model->isCorrect($word); + } + + /** + * Get captcha image base URL + * + * @return string + */ + public function getImgUrl() + { + return $this->_model->getImgUrl(); + } + + /** + * Return full URL to captcha image + * + * @return string + */ + public function getImgSrc() + { + return $this->_model->getImgSrc(); + } + + + /** + * Returns session instance + * + * @return Captcha_Zend_Model_Session + */ + public function getSession() + { + return $this->_model->getSession(); + } + + /** + * Returns Captcha Width + * + * @return string + */ + public function getWidth() + { + return $this->_model->getWidth(); + } + + /** + * Returns Captcha Height + * + * @return string + */ + public function getHeight() + { + return $this->_model->getHeight(); + } + + /** + * Returns Captcha Height + * + * @return string + */ + public function getImgAlt() + { + return $this->_model->getImgAlt(); + } + + /** + * Returns Template Path + * + * @return string + */ + public function getTemplatePath() + { + return $this->_model->getTemplatePath(); + } +} diff --git a/app/code/core/Mage/Captcha/Model/Config/Font.php b/app/code/core/Mage/Captcha/Model/Config/Font.php new file mode 100755 index 0000000000..cbba443fc9 --- /dev/null +++ b/app/code/core/Mage/Captcha/Model/Config/Font.php @@ -0,0 +1,49 @@ + + */ +class Mage_Captcha_Model_Config_Font +{ + /** + * Get options for font selection field + * + * @return array + */ + public function toOptionArray() + { + $optionArray = array(); + foreach (Mage::helper('captcha')->getFonts() as $fontName => $fontData) { + $optionArray[] = array('label' => $fontData['label'], 'value' => $fontName); + } + return $optionArray; + } +} diff --git a/app/code/core/Mage/Captcha/Model/Config/Form/Abstract.php b/app/code/core/Mage/Captcha/Model/Config/Form/Abstract.php new file mode 100755 index 0000000000..0a12ed2908 --- /dev/null +++ b/app/code/core/Mage/Captcha/Model/Config/Form/Abstract.php @@ -0,0 +1,61 @@ + + */ +abstract class Mage_Captcha_Model_Config_Form_Abstract extends Mage_Core_Model_Config_Data +{ + /** + * @var string + */ + protected $_configPath; + + /** + * Returns options for form multiselect + * + * @return array + */ + public function toOptionArray() + { + $optionArray = array(); + /* @var $backendNode Mage_Core_Model_Config_Element */ + $backendNode = Mage::getConfig()->getNode($this->_configPath); + if ($backendNode) { + foreach ($backendNode->children() as $formNode) { + /* @var $formNode Mage_Core_Model_Config_Element */ + if (!empty($formNode->label)) { + $optionArray[] = array('label' => (string)$formNode->label, 'value' => $formNode->getName()); + } + } + } + return $optionArray; + } +} diff --git a/app/code/core/Mage/Captcha/Model/Config/Form/Backend.php b/app/code/core/Mage/Captcha/Model/Config/Form/Backend.php new file mode 100755 index 0000000000..e469ee9ef3 --- /dev/null +++ b/app/code/core/Mage/Captcha/Model/Config/Form/Backend.php @@ -0,0 +1,40 @@ + + */ +class Mage_Captcha_Model_Config_Form_Backend extends Mage_Captcha_Model_Config_Form_Abstract +{ + /** + * @var string + */ + protected $_configPath = 'default/captcha/backend/areas'; +} diff --git a/app/code/core/Mage/Captcha/Model/Config/Form/Frontend.php b/app/code/core/Mage/Captcha/Model/Config/Form/Frontend.php new file mode 100755 index 0000000000..131402e323 --- /dev/null +++ b/app/code/core/Mage/Captcha/Model/Config/Form/Frontend.php @@ -0,0 +1,40 @@ + + */ +class Mage_Captcha_Model_Config_Form_Frontend extends Mage_Captcha_Model_Config_Form_Abstract +{ + /** + * @var string + */ + protected $_configPath = 'default/captcha/frontend/areas'; +} diff --git a/app/code/core/Mage/Captcha/Model/Config/Mode.php b/app/code/core/Mage/Captcha/Model/Config/Mode.php new file mode 100755 index 0000000000..4bfe1a409f --- /dev/null +++ b/app/code/core/Mage/Captcha/Model/Config/Mode.php @@ -0,0 +1,54 @@ + + */ +class Mage_Captcha_Model_Config_Mode +{ + /** + * Get options for captcha mode selection field + * + * @return array + */ + public function toOptionArray() + { + return array( + array( + 'label' => Mage::helper('captcha')->__('Always'), + 'value' => Mage_Captcha_Helper_Data::MODE_ALWAYS + ), + array( + 'label' => Mage::helper('captcha')->__('After number of attempts to login'), + 'value' => Mage_Captcha_Helper_Data::MODE_AFTER_FAIL + ), + ); + } +} diff --git a/app/code/core/Mage/Captcha/Model/Interface.php b/app/code/core/Mage/Captcha/Model/Interface.php new file mode 100755 index 0000000000..90b2290bc2 --- /dev/null +++ b/app/code/core/Mage/Captcha/Model/Interface.php @@ -0,0 +1,60 @@ + + */ +interface Mage_Captcha_Model_Interface +{ + /** + * Generates captcha + * + * @abstract + * @return void + */ + public function generate(); + + /** + * Checks whether word entered by user corresponds to the one generated by generate() + * + * @abstract + * @param string $word + * @return void + */ + public function isCorrect($word); + + + /** + * Get Block Name + * + * @return string + */ + public function getBlockName(); +} diff --git a/app/code/core/Mage/Captcha/Model/Observer.php b/app/code/core/Mage/Captcha/Model/Observer.php new file mode 100755 index 0000000000..ebaf827b18 --- /dev/null +++ b/app/code/core/Mage/Captcha/Model/Observer.php @@ -0,0 +1,282 @@ + + */ +class Mage_Captcha_Model_Observer +{ + /** + * Check Captcha On Forgot Password Page + * + * @param Varien_Event_Observer $observer + * @return Mage_Captcha_Model_Observer + */ + public function checkForgotpassword($observer) + { + $formId = 'user_forgotpassword'; + $captchaModel = Mage::helper('captcha')->getCaptcha($formId); + if ($captchaModel->isRequired()) { + $controller = $observer->getControllerAction(); + if (!$captchaModel->isCorrect($this->_getCaptchaString($controller->getRequest(), $formId))) { + Mage::getSingleton('customer/session')->addError(Mage::helper('captcha')->__('Incorrect CAPTCHA.')); + $controller->setFlag('', Mage_Core_Controller_Varien_Action::FLAG_NO_DISPATCH, true); + $controller->getResponse()->setRedirect(Mage::getUrl('*/*/forgotpassword')); + } + } + return $this; + } + + /** + * Check Captcha On User Login Page + * + * @param Varien_Event_Observer $observer + * @return Mage_Captcha_Model_Observer + */ + public function checkUserLogin($observer) + { + $formId = 'user_login'; + $captchaModel = Mage::helper('captcha')->getCaptcha($formId); + $controller = $observer->getControllerAction(); + $loginParams = $controller->getRequest()->getPost('login'); + $login = array_key_exists('username', $loginParams) ? $loginParams['username'] : null; + if ($captchaModel->isRequired($login)) { + $word = $this->_getCaptchaString($controller->getRequest(), $formId); + if (!$captchaModel->isCorrect($word)) { + Mage::getSingleton('customer/session')->addError(Mage::helper('captcha')->__('Incorrect CAPTCHA.')); + $controller->setFlag('', Mage_Core_Controller_Varien_Action::FLAG_NO_DISPATCH, true); + Mage::getSingleton('customer/session')->setUsername($login); + $beforeUrl = Mage::getSingleton('customer/session')->getBeforeAuthUrl(); + $url = $beforeUrl ? $beforeUrl : Mage::helper('customer')->getLoginUrl(); + $controller->getResponse()->setRedirect($url); + } + } + $captchaModel->logAttempt($login); + return $this; + } + + /** + * Check Captcha On Register User Page + * + * @param Varien_Event_Observer $observer + * @return Mage_Captcha_Model_Observer + */ + public function checkUserCreate($observer) + { + $formId = 'user_create'; + $captchaModel = Mage::helper('captcha')->getCaptcha($formId); + if ($captchaModel->isRequired()) { + $controller = $observer->getControllerAction(); + if (!$captchaModel->isCorrect($this->_getCaptchaString($controller->getRequest(), $formId))) { + Mage::getSingleton('customer/session')->addError(Mage::helper('captcha')->__('Incorrect CAPTCHA.')); + $controller->setFlag('', Mage_Core_Controller_Varien_Action::FLAG_NO_DISPATCH, true); + Mage::getSingleton('customer/session')->setCustomerFormData($controller->getRequest()->getPost()); + $controller->getResponse()->setRedirect(Mage::getUrl('*/*/create')); + } + } + return $this; + } + + /** + * Check Captcha On Checkout as Guest Page + * + * @param Varien_Event_Observer $observer + * @return Mage_Captcha_Model_Observer + */ + public function checkGuestCheckout($observer) + { + $formId = 'guest_checkout'; + $captchaModel = Mage::helper('captcha')->getCaptcha($formId); + $checkoutMethod = Mage::getSingleton('checkout/type_onepage')->getQuote()->getCheckoutMethod(); + if ($checkoutMethod == Mage_Checkout_Model_Type_Onepage::METHOD_GUEST) { + if ($captchaModel->isRequired()) { + $controller = $observer->getControllerAction(); + if (!$captchaModel->isCorrect($this->_getCaptchaString($controller->getRequest(), $formId))) { + $controller->setFlag('', Mage_Core_Controller_Varien_Action::FLAG_NO_DISPATCH, true); + $result = array('error' => 1, 'message' => Mage::helper('captcha')->__('Incorrect CAPTCHA.')); + $controller->getResponse()->setBody(Mage::helper('core')->jsonEncode($result)); + } + } + } + return $this; + } + + /** + * Check Captcha On Checkout Register Page + * + * @param Varien_Event_Observer $observer + * @return Mage_Captcha_Model_Observer + */ + public function checkRegisterCheckout($observer) + { + $formId = 'register_during_checkout'; + $captchaModel = Mage::helper('captcha')->getCaptcha($formId); + $checkoutMethod = Mage::getSingleton('checkout/type_onepage')->getQuote()->getCheckoutMethod(); + if ($checkoutMethod == Mage_Checkout_Model_Type_Onepage::METHOD_REGISTER) { + if ($captchaModel->isRequired()) { + $controller = $observer->getControllerAction(); + if (!$captchaModel->isCorrect($this->_getCaptchaString($controller->getRequest(), $formId))) { + $controller->setFlag('', Mage_Core_Controller_Varien_Action::FLAG_NO_DISPATCH, true); + $result = array('error' => 1, 'message' => Mage::helper('captcha')->__('Incorrect CAPTCHA.')); + $controller->getResponse()->setBody(Mage::helper('core')->jsonEncode($result)); + } + } + } + return $this; + } + + /** + * Check Captcha On User Login Backend Page + * + * @param Varien_Event_Observer $observer + * @return Mage_Captcha_Model_Observer + */ + public function checkUserLoginBackend($observer) + { + $formId = 'backend_login'; + $captchaModel = Mage::helper('captcha')->getCaptcha($formId); + $loginParams = Mage::app()->getRequest()->getPost('login'); + $login = array_key_exists('username', $loginParams) ? $loginParams['username'] : null; + if ($captchaModel->isRequired($login)) { + if (!$captchaModel->isCorrect($this->_getCaptchaString(Mage::app()->getRequest(), $formId))) { + $captchaModel->logAttempt($login); + Mage::throwException(Mage::helper('captcha')->__('Incorrect CAPTCHA.')); + } + } + $captchaModel->logAttempt($login); + return $this; + } + + /** + * Check Captcha On User Login Backend Page + * + * @param Varien_Event_Observer $observer + * @return Mage_Captcha_Model_Observer + */ + public function checkUserForgotPasswordBackend($observer) + { + $formId = 'backend_forgotpassword'; + $captchaModel = Mage::helper('captcha')->getCaptcha($formId); + $controller = $observer->getControllerAction(); + $email = (string) $observer->getControllerAction()->getRequest()->getParam('email'); + $params = $observer->getControllerAction()->getRequest()->getParams(); + + if (!empty($email) && !empty($params)){ + if ($captchaModel->isRequired()){ + if (!$captchaModel->isCorrect($this->_getCaptchaString($controller->getRequest(), $formId))) { + $this->_getSession()->setEmail((string) $controller->getRequest()->getPost('email')); + $controller->setFlag('', Mage_Core_Controller_Varien_Action::FLAG_NO_DISPATCH, true); + $this->_getSession()->addError(Mage::helper('captcha')->__('Incorrect CAPTCHA.')); + $controller->getResponse()->setRedirect(Mage::getUrl('*/*/forgotpassword')); + } + } + } + return $this; + } + + /** + * Reset Attempts For Frontend + * + * @param Varien_Event_Observer $observer + * @return Mage_Captcha_Model_Observer + */ + public function resetAttemptForFrontend($observer) + { + return $this->_resetAttempt($observer->getModel()->getEmail()); + } + + /** + * Reset Attempts For Backend + * + * @param Varien_Event_Observer $observer + * @return Mage_Captcha_Model_Observer + */ + public function resetAttemptForBackend($observer) + { + return $this->_resetAttempt($observer->getUser()->getUsername()); + } + + /** + * Delete Unnecessary logged attempts + * + * @return Mage_Captcha_Model_Observer + */ + public function deleteOldAttempts() + { + Mage::getResourceModel('captcha/log')->deleteOldAttempts(); + return $this; + } + + /** + * Delete Expired Captcha Images + * + * @return Mage_Captcha_Model_Observer + */ + public function deleteExpiredImages() + { + foreach (Mage::app()->getWebsites(true) as $website){ + $expire = time() - Mage::helper('captcha')->getConfigNode('timeout', $website->getDefaultStore())*60; + $imageDirectory = Mage::helper('captcha')->getImgDir($website); + foreach (new DirectoryIterator($imageDirectory) as $file) { + if ($file->isFile() && pathinfo($file->getFilename(), PATHINFO_EXTENSION) == 'png') { + if ($file->getMTime() < $expire) { + unlink($file->getPathname()); + } + } + } + } + return $this; + } + + /** + * Reset Attempts + * + * @param string $login + * @return Mage_Captcha_Model_Observer + */ + protected function _resetAttempt($login) + { + Mage::getResourceModel('captcha/log')->deleteUserAttempts($login); + return $this; + } + + /** + * Get Captcha String + * + * @param Varien_Object $request + * @param string $formId + * @return string + */ + protected function _getCaptchaString($request, $formId) + { + $captchaParams = $request->getPost(Mage_Captcha_Helper_Data::INPUT_NAME_FIELD_VALUE); + return $captchaParams[$formId]; + } +} diff --git a/app/code/core/Mage/Captcha/Model/Resource/Log.php b/app/code/core/Mage/Captcha/Model/Resource/Log.php new file mode 100755 index 0000000000..beef4f1884 --- /dev/null +++ b/app/code/core/Mage/Captcha/Model/Resource/Log.php @@ -0,0 +1,157 @@ + + */ +class Mage_Captcha_Model_Resource_Log extends Mage_Core_Model_Resource_Db_Abstract +{ + /** + * Type Remote Address + */ + const TYPE_REMOTE_ADDRESS = 1; + /** + * Type User Login Name + */ + const TYPE_LOGIN = 2; + + /** + * Define main table + * + */ + protected function _construct() + { + $this->_init('captcha/log', array('type','value')); + } + + /** + * Save or Update count Attempts + * + * @param string|null $login + * @return Mage_Captcha_Model_Resource_Log + */ + public function logAttempt($login) + { + if ($login != null){ + $this->_getWriteAdapter()->insertOnDuplicate( + $this->getMainTable(), + array( + 'type' => self::TYPE_LOGIN, 'value' => $login, 'count' => 1, + 'updated_at' => Mage::getSingleton('core/date')->gmtDate() + ), + array('count' => new Zend_Db_Expr('count+1'), 'updated_at') + ); + } + $ip = Mage::helper('core/http')->getRemoteAddr(); + if ($ip != null) { + $this->_getWriteAdapter()->insertOnDuplicate( + $this->getMainTable(), + array( + 'type' => self::TYPE_REMOTE_ADDRESS, 'value' => $ip, 'count' => 1, + 'updated_at' => Mage::getSingleton('core/date')->gmtDate() + ), + array('count' => new Zend_Db_Expr('count+1'), 'updated_at') + ); + } + return $this; + } + + /** + * Delete User attempts by login + * + * @param string $login + * @return Mage_Captcha_Model_Resource_Log + */ + public function deleteUserAttempts($login) + { + if ($login != null) { + $this->_getWriteAdapter()->delete( + $this->getMainTable(), + array('type = ?' => self::TYPE_LOGIN, 'value = ?' => $login) + ); + } + $ip = Mage::helper('core/http')->getRemoteAddr(); + if ($ip != null) { + $this->_getWriteAdapter()->delete( + $this->getMainTable(), array('type = ?' => self::TYPE_REMOTE_ADDRESS, 'value = ?' => $ip) + ); + } + + return $this; + } + + /** + * Get count attempts by ip + * + * @return null|int + */ + public function countAttemptsByRemoteAddress() + { + $ip = Mage::helper('core/http')->getRemoteAddr(); + if (!$ip) { + return 0; + } + $read = $this->_getReadAdapter(); + $select = $read->select()->from($this->getMainTable(), 'count')->where('type = ?', self::TYPE_REMOTE_ADDRESS) + ->where('value = ?', $ip); + return $read->fetchOne($select); + } + + /** + * Get count attempts by user login + * + * @param string $login + * @return null|int + */ + public function countAttemptsByUserLogin($login) + { + if (!$login) { + return 0; + } + $read = $this->_getReadAdapter(); + $select = $read->select()->from($this->getMainTable(), 'count')->where('type = ?', self::TYPE_LOGIN) + ->where('value = ?', $login); + return $read->fetchOne($select); + } + + /** + * Delete attempts with expired in update_at time + * + * @return void + */ + public function deleteOldAttempts() + { + $this->_getWriteAdapter()->delete( + $this->getMainTable(), + array('updated_at < ?' => Mage::getSingleton('core/date')->gmtDate(null, time() - 60*30)) + ); + } +} diff --git a/app/code/core/Mage/Captcha/Model/Resource/LoginAttempt.php b/app/code/core/Mage/Captcha/Model/Resource/LoginAttempt.php new file mode 100755 index 0000000000..3771a3953f --- /dev/null +++ b/app/code/core/Mage/Captcha/Model/Resource/LoginAttempt.php @@ -0,0 +1,160 @@ + + */ +class Mage_Captcha_Model_Resource_LoginAttempt extends Mage_Core_Model_Resource_Db_Abstract +{ + /** + * Define main table + * + */ + protected function _construct() + { + $this->_init('captcha/login_attempt', array('type','value')); + } + + /** + * Log Login + * + * @param string|null $login + * @return Mage_Captcha_Model_Resource_LoginAttempt + */ + public function logUserLogin($login){ + if ($login != null){ + + $this->_getWriteAdapter()->insertOnDuplicate( + $this->getMainTable(), + array( + 'type' => Mage_Captcha_Model_LoginAttempt::TYPE_LOGIN, + 'value' => md5($login), 'count' => 1, 'updated_at' => Mage::getSingleton('core/date')->gmtDate() + ), + array('count' => new Zend_Db_Expr('count+1'), 'updated_at') + ); + } + return $this; + } + + /** + * Log Ip + * + * @param string|null $ip + * @return Mage_Captcha_Model_Resource_LoginAttempt + */ + public function logRemoteAddress($ip){ + if ($ip != null) { + $this->_getWriteAdapter()->insertOnDuplicate( + $this->getMainTable(), + array( + 'type' => Mage_Captcha_Model_LoginAttempt::TYPE_REMOTE_ADDRESS, + 'value' => md5($ip), 'count' => 1, 'updated_at' => Mage::getSingleton('core/date')->gmtDate() + ), + array('count' => new Zend_Db_Expr('count+1'), 'updated_at') + ); + } + return $this; + } + + /** + * Delete attempts by remote address + * @param $ip + * @return Mage_Captcha_Model_Resource_LoginAttempt + */ + public function deleteByRemoteAddress($ip){ + if ($ip != null) { + $this->_getWriteAdapter()->delete( + $this->getMainTable(), + array('type = ?' => Mage_Captcha_Model_LoginAttempt::TYPE_REMOTE_ADDRESS, 'value = ?' => md5($ip)) + ); + } + return $this; + } + + /** + * Delete attempts by login + * + * @param $login + * @return Mage_Captcha_Model_Resource_LoginAttempt + */ + public function deleteByUserName($login){ + if ($login != null) { + $this->_getWriteAdapter()->delete( + $this->getMainTable(), + array('type = ?' => Mage_Captcha_Model_LoginAttempt::TYPE_LOGIN, 'value = ?' => md5($login)) + ); + } + return $this; + } + + /** + * Get count attempts by ip + * + * @param string $ip + * @return null|Mage_Captcha_Model_LoginAttempt + */ + public function countAttemptsByRemoteAddress($ip){ + if (!$ip) { + return 0; + } + $read = $this->_getReadAdapter(); + $select = $read->select() + ->from($this->getMainTable(), 'count') + ->where('type = ?', Mage_Captcha_Model_LoginAttempt::TYPE_REMOTE_ADDRESS) + ->where('value = ?', md5($ip)); + return $read->fetchOne($select); + } + + /** + * Get count attempts by user login + * + * @param string $login + * @return null|Mage_Captcha_Model_LoginAttempt + */ + public function countAttemptsByUserLogin($login){ + if (!$login) { + return 0; + } + $read = $this->_getReadAdapter(); + $select = $read->select() + ->from($this->getMainTable(), 'count') + ->where('type = ?', Mage_Captcha_Model_LoginAttempt::TYPE_LOGIN) + ->where('value = ?', md5($login)); + return $read->fetchOne($select); + } + + public function deleteOldAttempts(){ + $this->_getWriteAdapter()->delete( + $this->getMainTable(), + array('updated_at < ?' => Mage::getSingleton('core/date')->gmtDate(null, time() - 60*30)) + ); + } +} diff --git a/app/code/core/Mage/Captcha/Model/Resource/LoginAttempt/Collection.php b/app/code/core/Mage/Captcha/Model/Resource/LoginAttempt/Collection.php new file mode 100755 index 0000000000..2486e741cf --- /dev/null +++ b/app/code/core/Mage/Captcha/Model/Resource/LoginAttempt/Collection.php @@ -0,0 +1,45 @@ + + */ + +class Mage_Captcha_Model_Resource_LoginAttempt_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract +{ + /** + * Collection resource initialization + */ + protected function _construct() + { + $this->_init('captcha/loginAttempt'); + } +} diff --git a/app/code/core/Mage/Captcha/Model/Zend.php b/app/code/core/Mage/Captcha/Model/Zend.php new file mode 100755 index 0000000000..26cdfe2b48 --- /dev/null +++ b/app/code/core/Mage/Captcha/Model/Zend.php @@ -0,0 +1,496 @@ + + */ +class Mage_Captcha_Model_Zend extends Zend_Captcha_Image implements Mage_Captcha_Model_Interface +{ + /** + * Key in session for captcha code + */ + const SESSION_WORD = 'word'; + + /** + * Min captcha lengths default value + */ + const DEFAULT_WORD_LENGTH_FROM = 3; + + /** + * Max captcha lengths default value + */ + const DEFAULT_WORD_LENGTH_TO = 5; + + /** + * Key in session for keeping captcha attempts + */ + const SESSION_FAILED_ATTEMPTS = 'failed_attempts'; + + /** + * Helper Instance + * @var Mage_Captcha_Helper_Data + */ + protected $_helper = null; + + /** + * Captcha expire time + * @var int + */ + protected $_expiration; + + /** + * Override default value to prevent a captcha cut off + * @var int + * @see Zend_Captcha_Image::$_fsize + */ + protected $_fsize = 22; + + /** + * Captcha form id + * @var string + */ + protected $_formId; + + /** + * Zend captcha constructor + * + * @param array $params + */ + public function __construct($params) + { + if (!isset($params['formId'])) { + throw new Exception('formId is mandatory'); + } + $this->_formId = $params['formId']; + $this->setExpiration($this->getTimeout()); + } + + /** + * Get Block Name + * + * @return string + */ + public function getBlockName() + { + return 'captcha/captcha_zend'; + } + + + /** + * Whether captcha is required to be inserted to this form + * + * @param null|string $login + * @return bool + */ + public function isRequired($login = null) + { + if ($this->_isUserAuth() || !$this->_isEnabled() || !in_array($this->_formId, $this->_getTargetForms())) { + return false; + } + + return ($this->_isShowAlways() || $this->_isOverLimitAttempts($login)); + } + + /** + * Check is overlimit attempts + * + * @param string $login + * @return bool + */ + protected function _isOverLimitAttempts($login) + { + return ($this->_isOverLimitSessionAttempt() || $this->_isOverLimitIpAttempt() + || $this->_isOverLimitLoginAttempts($login)); + } + + /** + * Check is overlimit saved in session attempts + * + * @return bool + */ + protected function _isOverLimitSessionAttempt() + { + $key = $this->_formId . '_' . self::SESSION_FAILED_ATTEMPTS; + return $this->getSession()->getData($key) >= $this->_getHelper()->getConfigNode('failed_attempts'); + } + + /** + * Check is overlimit saved attempts from one ip + * + * @return bool + */ + protected function _isOverLimitIpAttempt() + { + $countAttemptsByIp = Mage::getResourceModel('captcha/log')->countAttemptsByRemoteAddress(); + if ($countAttemptsByIp >= $this->_getHelper()->getConfigNode('failed_attempts')) { + return true; + } + return false; + } + + /** + * Is Over Limit Login Attempts + * + * @param string $login + * @return bool + */ + protected function _isOverLimitLoginAttempts($login) + { + if ($login != false) { + $countAttemptsByLogin = Mage::getResourceModel('captcha/log')->countAttemptsByUserLogin($login); + if ($countAttemptsByLogin >= $this->_getHelper()->getConfigNode('failed_attempts')) { + $this->getSession()->setData( + $this->_formId . '_' . self::SESSION_FAILED_ATTEMPTS, $countAttemptsByLogin + ); + return true; + } + } + return false; + } + + /** + * Check is user auth + * + * @return bool + */ + protected function _isUserAuth() + { + return Mage::app()->getStore()->isAdmin() + ? Mage::getSingleton('admin/session')->isLoggedIn() + : Mage::getSingleton('customer/session')->isLoggedIn(); + } + + /** + * Whether to respect case while checking the answer + * + * @return bool + */ + public function isCaseSensitive() + { + return (string)$this->_getHelper()->getConfigNode('case_sensitive'); + } + + /** + * Get font to use when generating captcha + * + * @return string + */ + public function getFont() + { + return $this->_getFontPath(); + } + + /** + * After this time isCorrect() is going to return FALSE even if word was guessed correctly + * + * @return int + */ + public function getTimeout() + { + if (!$this->_expiration) { + /** + * as "timeout" configuration parameter specifies timeout in minutes - we multiply it on 60 to set + * expiration in seconds + */ + $this->_expiration = (int)$this->_getHelper()->getConfigNode('timeout') * 60; + } + return $this->_expiration; + } + + /** + * Get captcha image directory + * + * @return string + */ + public function getImgDir() + { + return $this->_helper->getImgDir(); + } + + /** + * Get captcha image base URL + * + * @return string + */ + public function getImgUrl() + { + return $this->_helper->getImgUrl(); + } + + /** + * Checks whether captcha was guessed correctly by user + * + * @param string $word + * @return bool + */ + public function isCorrect($word) + { + $storedWord = $this->getWord(); + $this->_clearWord(); + + if (!$word || !$storedWord){ + return false; + } + + if (!$this->isCaseSensitive()) { + $storedWord = strtolower($storedWord); + $word = strtolower($word); + } + return $word == $storedWord; + } + + /** + * Returns session instance + * + * @return Mage_Captcha_Model_Session + */ + public function getSession() + { + return Mage::getSingleton('customer/session'); + } + + /** + * Return full URL to captcha image + * + * @return string + */ + public function getImgSrc() + { + return $this->getImgUrl() . $this->getId() . $this->getSuffix(); + } + + /** + * log Attempt + * + * @param string $login + * @return Mage_Captcha_Model_Zend + */ + public function logAttempt($login) + { + if ($this->_isEnabled() && in_array($this->_formId, $this->_getTargetForms())) { + $attemptCount = (int)$this->getSession()->getData($this->_formId . '_' . self::SESSION_FAILED_ATTEMPTS); + $attemptCount++; + $this->getSession()->setData($this->_formId . '_' . self::SESSION_FAILED_ATTEMPTS, $attemptCount); + Mage::getResourceModel('captcha/log')->logAttempt($login); + } + return $this; + } + + /** + * Returns path for the font file, chosen to generate captcha + * + * @return string + */ + protected function _getFontPath() + { + $font = (string)$this->_getHelper()->getConfigNode('font'); + $fonts = $this->_getHelper()->getFonts(); + + if (isset($fonts[$font])) { + $fontPath = $fonts[$font]['path']; + } else { + $fontData = array_shift($fonts); + $fontPath = $fontData['path']; + } + + return $fontPath; + } + + /** + * Returns captcha helper + * + * @return Mage_Captcha_Helper_Interface + */ + protected function _getHelper() + { + if (empty($this->_helper)) { + $this->_helper = Mage::helper('captcha'); + } + return $this->_helper; + } + + /** + * Generate word used for captcha render + * + * @return string + */ + protected function _generateWord() + { + $word = ''; + $symbols = $this->_getSymbols(); + $wordLen = $this->_getWordLen(); + for ($i = 0; $i < $wordLen; $i++) { + $word .= $symbols[array_rand($symbols)]; + } + return $word; + } + + /** + * Get symbols array to use for word generation + * + * @return array + */ + protected function _getSymbols() + { + return str_split((string)$this->_getHelper()->getConfigNode('symbols')); + } + + /** + * Returns length for generating captcha word. This value may be dynamic. + * + * @return int + */ + protected function _getWordLen() + { + $from = 0; + $to = 0; + $length = (string)$this->_getHelper()->getConfigNode('length'); + if (!is_numeric($length)) { + if (preg_match('/(\d+)-(\d+)/', $length, $matches)) { + $from = (int)$matches[1]; + $to = (int)$matches[2]; + } + } else { + $from = (int)$length; + $to = (int)$length; + } + + if (($to < $from) || ($from < 1) || ($to < 1)) { + $from = self::DEFAULT_WORD_LENGTH_FROM; + $to = self::DEFAULT_WORD_LENGTH_TO; + } + + return mt_rand($from, $to); + } + + /** + * Whether to show captcha for this form every time + * + * @return bool + */ + protected function _isShowAlways() + { + if ((string)$this->_getHelper()->getConfigNode('mode') == Mage_Captcha_Helper_Data::MODE_ALWAYS){ + return true; + } + + $alwaysFor = $this->_getHelper()->getConfigNode('always_for'); + foreach ($alwaysFor as $nodeFormId => $isAlwaysFor) { + if ($isAlwaysFor && $this->_formId == $nodeFormId) { + return true; + } + } + + return false; + } + + /** + * Whether captcha is enabled at this area + * + * @return bool + */ + protected function _isEnabled() + { + return (string)$this->_getHelper()->getConfigNode('enable'); + } + + /** + * Retrieve list of forms where captcha must be shown + * + * For frontend this list is based on current website + * + * @return array + */ + protected function _getTargetForms() + { + $formsString = (string) $this->_getHelper()->getConfigNode('forms'); + return explode(',', $formsString); + } + + /** + * Get captcha word + * + * @return string + */ + public function getWord() + { + $sessionData = $this->getSession()->getData($this->_formId . '_' . self::SESSION_WORD); + return time() < $sessionData['expires'] ? $sessionData['data'] : null; + } + + /** + * Set captcha word + * + * @param string $word + * @return Zend_Captcha_Word + */ + protected function _setWord($word) + { + $this->getSession()->setData($this->_formId . '_' . self::SESSION_WORD, + array('data' => $word, 'expires' => time() + $this->getTimeout()) + ); + $this->_word = $word; + return $this; + } + + /** + * Set captcha word + * + * @return Mage_Captcha_Model_Zend + */ + protected function _clearWord() + { + $this->getSession()->unsetData($this->_formId . '_' . self::SESSION_WORD); + $this->_word = null; + return $this; + } + + /** + * Override function to generate less curly captcha that will not cut off + * + * @see Zend_Captcha_Image::_randomSize() + * @return int + */ + protected function _randomSize() + { + return mt_rand(280, 300) / 100; + } + + /** + * Overlap of the parent method + * + * Now deleting old captcha images make crontab script + * @see Mage_Captcha_Model_Observer::deleteExpiredImages + */ + protected function _gc() + { + //do nothing + } +} diff --git a/app/code/core/Mage/Captcha/controllers/Adminhtml/RefreshController.php b/app/code/core/Mage/Captcha/controllers/Adminhtml/RefreshController.php new file mode 100755 index 0000000000..1184e1af0d --- /dev/null +++ b/app/code/core/Mage/Captcha/controllers/Adminhtml/RefreshController.php @@ -0,0 +1,50 @@ + + */ +class Mage_Captcha_Adminhtml_RefreshController extends Mage_Adminhtml_Controller_Action +{ + /** + * Refreshes captcha and returns JSON encoded URL to image (AJAX action) + * Example: {'imgSrc': 'http://example.com/media/captcha/67842gh187612ngf8s.png'} + * + * @return null + */ + public function refreshAction() + { + $formId = $this->getRequest()->getPost('formId'); + $captchaModel = Mage::helper('captcha')->getCaptcha($formId); + $this->getLayout()->createBlock($captchaModel->getBlockName())->setFormId($formId)->setIsAjax(true)->toHtml(); + $this->getResponse()->setBody(json_encode(array('imgSrc' => $captchaModel->getImgSrc()))); + $this->setFlag('', self::FLAG_NO_POST_DISPATCH, true); + } +} diff --git a/app/code/core/Mage/Captcha/controllers/RefreshController.php b/app/code/core/Mage/Captcha/controllers/RefreshController.php new file mode 100755 index 0000000000..476c80baa9 --- /dev/null +++ b/app/code/core/Mage/Captcha/controllers/RefreshController.php @@ -0,0 +1,50 @@ + + */ +class Mage_Captcha_RefreshController extends Mage_Core_Controller_Front_Action +{ + /** + * Refreshes captcha and returns JSON encoded URL to image (AJAX action) + * Example: {'imgSrc': 'http://example.com/media/captcha/67842gh187612ngf8s.png'} + * + * @return null + */ + public function indexAction() + { + $formId = $this->getRequest()->getPost('formId'); + $captchaModel = Mage::helper('captcha')->getCaptcha($formId); + $this->getLayout()->createBlock($captchaModel->getBlockName())->setFormId($formId)->setIsAjax(true)->toHtml(); + $this->getResponse()->setBody(json_encode(array('imgSrc' => $captchaModel->getImgSrc()))); + $this->setFlag('', self::FLAG_NO_POST_DISPATCH, true); + } +} diff --git a/app/code/core/Mage/Captcha/etc/config.xml b/app/code/core/Mage/Captcha/etc/config.xml new file mode 100755 index 0000000000..9151e538f5 --- /dev/null +++ b/app/code/core/Mage/Captcha/etc/config.xml @@ -0,0 +1,262 @@ + + + + + + 1.7.0.0.0 + + + + + + + Mage_Captcha + + + + + + Mage_Captcha_Model + captcha_resource + + + Mage_Captcha_Model_Resource + + +
captcha_log
+ + + + + + + + + captcha/observer + checkUserLogin + + + + + + + captcha/observer + checkForgotPassword + + + + + + + captcha/observer + createUser + + + + + + + captcha/observer + checkUserForgotPasswordBackend + + + + + + + captcha/observer + checkUserLoginBackend + + + + + + + captcha/observer + checkGuestCheckout + + + captcha/observer + checkRegisterCheckout + + + + + + + captcha/observer + resetAttemptForFrontend + + + + + + + captcha/observer + resetAttemptForBackend + + + + + + + + + standard + + Mage_Captcha + captcha + + + + + + + captcha.xml + + + + + + + + + + Mage_Captcha_Adminhtml + + + + + + + + + + captcha.xml + + + + + + + + zend + 0 + linlibertine + after_fail + backend_forgotpassword + 3 + 7 + 4-5 + ABCDEFGHJKMnpqrstuvwxyz23456789 + 0 + + 1 + + + + + + zend + 0 + linlibertine + after_fail + user_forgotpassword + 3 + 7 + 4-5 + ABCDEFGHJKMnpqrstuvwxyz23456789 + 0 + + 1 + 1 + 1 + 1 + + + + + + + + lib/LinLibertineFont/LinLibertine_Bd-2.8.1.ttf + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */30 * * * * + + + captcha/observer::deleteOldAttempts + + + + + */10 * * * * + + + captcha/observer::deleteExpiredImages + + + + + + diff --git a/app/code/core/Mage/Captcha/etc/system.xml b/app/code/core/Mage/Captcha/etc/system.xml new file mode 100755 index 0000000000..b0e5851655 --- /dev/null +++ b/app/code/core/Mage/Captcha/etc/system.xml @@ -0,0 +1,250 @@ + + + + + + + + + text + 50 + 1 + 1 + 0 + + + + select + adminhtml/system_config_source_yesno + 1 + 1 + 0 + 0 + + + + select + captcha/config_font + 2 + 1 + 0 + 0 + 1 + + + + multiselect + captcha/config_form_backend + 3 + 1 + 0 + 0 + 1 + + + + select + captcha/config_mode + 4 + 1 + 0 + 0 + 1 + + + + text + If 0 is specified, CAPTCHA on the Login form will be always available. + 5 + 1 + 0 + 0 + + after_fail + 1 + + required-entry validate-digits + + + + text + 6 + 1 + 0 + 0 + 1 + required-entry validate-digits + + + + text + Please specify 8 symbols at the most. Range allowed (e.g. 3-5) + 7 + 1 + 0 + 0 + 1 + required-entry + + + + text + Similar looking characters (e.g. "i", "l", "1") decrease chance of correct recognition by customer.]]> + 8 + 1 + 0 + 0 + 1 + required-entry validate-alphanum + + + + select + adminhtml/system_config_source_yesno + 9 + 1 + 0 + 0 + 1 + + + + + + + + + + text + 110 + 1 + 1 + 0 + + + + select + adminhtml/system_config_source_yesno + 1 + 1 + 1 + 0 + + + + select + captcha/config_font + 2 + 1 + 1 + 0 + 1 + + + + multiselect + captcha/config_form_frontend + CAPTCHA for "Create user" and "Forgot password" forms is always enabled if chosen + 3 + 1 + 1 + 0 + 1 + + + + select + captcha/config_mode + 4 + 1 + 1 + 0 + 1 + + + + text + If 0 is specified, CAPTCHA on the Login form will be always available. + 5 + 1 + 1 + 0 + + 1 + after_fail + + required-entry validate-digits + + + + text + 6 + 1 + 1 + 0 + 1 + required-entry validate-digits + + + + text + Please specify 8 symbols at the most. Range allowed (e.g. 3-5) + 7 + 1 + 1 + 0 + 1 + required-entry + + + + text + Similar looking characters (e.g. "i", "l", "1") decrease chance of correct recognition by customer.]]> + 8 + 1 + 1 + 0 + 1 + required-entry validate-alphanum + + + + select + adminhtml/system_config_source_yesno + 9 + 1 + 1 + 0 + 1 + + + + + + + diff --git a/app/code/core/Mage/Captcha/sql/captcha_setup/install-1.7.0.0.0.php b/app/code/core/Mage/Captcha/sql/captcha_setup/install-1.7.0.0.0.php new file mode 100644 index 0000000000..966630c917 --- /dev/null +++ b/app/code/core/Mage/Captcha/sql/captcha_setup/install-1.7.0.0.0.php @@ -0,0 +1,51 @@ +startSetup(); + +$table = $installer->getConnection() + ->newTable($installer->getTable('captcha/log')) + ->addColumn('type', Varien_Db_Ddl_Table::TYPE_TEXT, 32, array( + 'nullable' => false, + 'primary' => true, + ), 'Type') + ->addColumn('value', Varien_Db_Ddl_Table::TYPE_TEXT, 32, array( + 'nullable' => false, + 'unsigned' => true, + 'primary' => true, + ), 'Value') + ->addColumn('count', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array( + 'unsigned' => true, + 'nullable' => false, + 'default' => '0', + ), 'Count') + ->addColumn('updated_at', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null, array(), 'Update Time') + ->setComment('Count Login Attempts'); +$installer->getConnection()->createTable($table); + +$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/Block/Product/Abstract.php b/app/code/core/Mage/Catalog/Block/Product/Abstract.php index e573a5163e..edecb0d2c2 100644 --- a/app/code/core/Mage/Catalog/Block/Product/Abstract.php +++ b/app/code/core/Mage/Catalog/Block/Product/Abstract.php @@ -344,12 +344,19 @@ public function getTierPrices($product = null) $res = array(); if (is_array($prices)) { foreach ($prices as $price) { - $price['price_qty'] = $price['price_qty']*1; - if ($product->getPrice() != $product->getFinalPrice()) { + $price['price_qty'] = $price['price_qty'] * 1; + + $_productPrice = $product->getPrice(); + if ($_productPrice != $product->getFinalPrice()) { $_productPrice = $product->getFinalPrice(); - } else { - $_productPrice = $product->getPrice(); } + + // Group price must be used for percent calculation if it is lower + $groupPrice = $product->getGroupPrice(); + if ($_productPrice > $groupPrice) { + $_productPrice = $groupPrice; + } + if ($price['price'] < $_productPrice) { $price['savePercent'] = ceil(100 - ((100 / $_productPrice) * $price['price'])); diff --git a/app/code/core/Mage/Catalog/Block/Product/New.php b/app/code/core/Mage/Catalog/Block/Product/New.php index 007386fef3..98503c8b4a 100644 --- a/app/code/core/Mage/Catalog/Block/Product/New.php +++ b/app/code/core/Mage/Catalog/Block/Product/New.php @@ -81,19 +81,26 @@ public function getCacheKeyInfo() */ protected function _beforeToHtml() { - $todayDate = Mage::app()->getLocale()->date()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT); + $todayStartOfDayDate = Mage::app()->getLocale()->date() + ->setTime('00:00:00') + ->toString(Varien_Date::DATETIME_INTERNAL_FORMAT); + + $todayEndOfDayDate = Mage::app()->getLocale()->date() + ->setTime('23:59:59') + ->toString(Varien_Date::DATETIME_INTERNAL_FORMAT); $collection = Mage::getResourceModel('catalog/product_collection'); $collection->setVisibility(Mage::getSingleton('catalog/product_visibility')->getVisibleInCatalogIds()); + $collection = $this->_addProductAttributesAndPrices($collection) ->addStoreFilter() ->addAttributeToFilter('news_from_date', array('or'=> array( - 0 => array('date' => true, 'to' => $todayDate), + 0 => array('date' => true, 'to' => $todayEndOfDayDate), 1 => array('is' => new Zend_Db_Expr('null'))) ), 'left') ->addAttributeToFilter('news_to_date', array('or'=> array( - 0 => array('date' => true, 'from' => $todayDate), + 0 => array('date' => true, 'from' => $todayStartOfDayDate), 1 => array('is' => new Zend_Db_Expr('null'))) ), 'left') ->addAttributeToFilter( diff --git a/app/code/core/Mage/Catalog/Block/Product/Price.php b/app/code/core/Mage/Catalog/Block/Product/Price.php index 67b9d91e88..44521c711a 100644 --- a/app/code/core/Mage/Catalog/Block/Product/Price.php +++ b/app/code/core/Mage/Catalog/Block/Product/Price.php @@ -72,21 +72,26 @@ public function getTierPrices($product = null) if (is_null($product)) { $product = $this->getProduct(); } - $prices = $product->getFormatedTierPrice(); + $prices = $product->getFormatedTierPrice(); $res = array(); if (is_array($prices)) { foreach ($prices as $price) { - $price['price_qty'] = $price['price_qty']*1; + $price['price_qty'] = $price['price_qty'] * 1; + $productPrice = $product->getPrice(); if ($product->getPrice() != $product->getFinalPrice()) { $productPrice = $product->getFinalPrice(); - } else { - $productPrice = $product->getPrice(); } - if ($price['price']<$productPrice) { - $price['savePercent'] = ceil(100 - (( 100/$productPrice ) * $price['price'] )); + // Group price must be used for percent calculation if it is lower + $groupPrice = $product->getGroupPrice(); + if ($productPrice > $groupPrice) { + $productPrice = $groupPrice; + } + + if ($price['price'] < $productPrice) { + $price['savePercent'] = ceil(100 - ((100 / $productPrice) * $price['price'])); $tierPrice = Mage::app()->getStore()->convertPrice( Mage::helper('tax')->getPrice($product, $price['website_price']) diff --git a/app/code/core/Mage/Catalog/Block/Product/View.php b/app/code/core/Mage/Catalog/Block/Product/View.php index b83bece1db..337f43224c 100644 --- a/app/code/core/Mage/Catalog/Block/Product/View.php +++ b/app/code/core/Mage/Catalog/Block/Product/View.php @@ -28,9 +28,10 @@ /** * Product View block * - * @category Mage - * @package Mage_Catalog - * @module Catalog + * @category Mage + * @package Mage_Catalog + * @module Catalog + * @author Magento Core Team */ class Mage_Catalog_Block_Product_View extends Mage_Catalog_Block_Product_Abstract { @@ -121,14 +122,14 @@ public function getAddToCartUrl($product, $additional = array()) } $addUrlKey = Mage_Core_Controller_Front_Action::PARAM_NAME_URL_ENCODED; - $addUrlValue = Mage::getUrl('*/*/*', array('_use_rewrite' => true, '_current' => false)); + $addUrlValue = Mage::getUrl('*/*/*', array('_use_rewrite' => true, '_current' => true)); $additional[$addUrlKey] = Mage::helper('core')->urlEncode($addUrlValue); return $this->helper('checkout/cart')->getAddUrl($product, $additional); } /** - * Get JSON encripted configuration array which can be used for JS dynamic + * Get JSON encoded configuration array which can be used for JS dynamic * price calculation depending on product options * * @return string @@ -141,20 +142,29 @@ public function getJsonConfig() } $_request = Mage::getSingleton('tax/calculation')->getRateRequest(false, false, false); - $_request->setProductClassId($this->getProduct()->getTaxClassId()); + /* @var $product Mage_Catalog_Model_Product */ + $product = $this->getProduct(); + $_request->setProductClassId($product->getTaxClassId()); $defaultTax = Mage::getSingleton('tax/calculation')->getRate($_request); $_request = Mage::getSingleton('tax/calculation')->getRateRequest(); - $_request->setProductClassId($this->getProduct()->getTaxClassId()); + $_request->setProductClassId($product->getTaxClassId()); $currentTax = Mage::getSingleton('tax/calculation')->getRate($_request); - $_regularPrice = $this->getProduct()->getPrice(); - $_finalPrice = $this->getProduct()->getFinalPrice(); - $_priceInclTax = Mage::helper('tax')->getPrice($this->getProduct(), $_finalPrice, true); - $_priceExclTax = Mage::helper('tax')->getPrice($this->getProduct(), $_finalPrice); - + $_regularPrice = $product->getPrice(); + $_finalPrice = $product->getFinalPrice(); + $_priceInclTax = Mage::helper('tax')->getPrice($product, $_finalPrice, true); + $_priceExclTax = Mage::helper('tax')->getPrice($product, $_finalPrice); + $_tierPrices = array(); + $_tierPricesInclTax = array(); + foreach ($product->getTierPrice() as $tierPrice) { + $_tierPrices[] = Mage::helper('core')->currency($tierPrice['website_price'], false, false); + $_tierPricesInclTax[] = Mage::helper('core')->currency( + Mage::helper('tax')->getPrice($product, (int)$tierPrice['website_price'], true), + false, false); + } $config = array( - 'productId' => $this->getProduct()->getId(), + 'productId' => $product->getId(), 'priceFormat' => Mage::app()->getLocale()->getJsPriceFormat(), 'includeTax' => Mage::helper('tax')->priceIncludesTax() ? 'true' : 'false', 'showIncludeTax' => Mage::helper('tax')->displayPriceIncludingTax(), @@ -175,6 +185,8 @@ public function getJsonConfig() 'plusDisposition' => 0, 'oldMinusDisposition' => 0, 'minusDisposition' => 0, + 'tierPrices' => $_tierPrices, + 'tierPricesInclTax' => $_tierPricesInclTax, ); $responseObject = new Varien_Object(); @@ -228,8 +240,7 @@ public function isStartCustomization() * Get default qty - either as preconfigured, or as 1. * Also restricts it by minimal qty. * - * @param null|Mage_Catalog_Model_Product - * + * @param null|Mage_Catalog_Model_Product $product * @return int|float */ public function getProductDefaultQty($product = null) diff --git a/app/code/core/Mage/Catalog/Block/Product/View/Media.php b/app/code/core/Mage/Catalog/Block/Product/View/Media.php index 71e3ca0963..93456f5ee3 100644 --- a/app/code/core/Mage/Catalog/Block/Product/View/Media.php +++ b/app/code/core/Mage/Catalog/Block/Product/View/Media.php @@ -29,12 +29,22 @@ * * @category Mage * @package Mage_Catalog - * @author Magento Core Team + * @author Magento Core Team */ class Mage_Catalog_Block_Product_View_Media extends Mage_Catalog_Block_Product_View_Abstract { + /** + * Flag, that defines whether gallery is disabled + * + * @var boolean + */ protected $_isGalleryDisabled; + /** + * Retrieve list of gallery images + * + * @return array|Varien_Data_Collection + */ public function getGalleryImages() { if ($this->_isGalleryDisabled) { @@ -44,16 +54,24 @@ public function getGalleryImages() return $collection; } - public function getGalleryUrl($image=null) + /** + * Retrieve gallery url + * + * @param null|Varien_Object $image + * @return string + */ + public function getGalleryUrl($image = null) { - $params = array('id'=>$this->getProduct()->getId()); + $params = array('id' => $this->getProduct()->getId()); if ($image) { $params['image'] = $image->getValueId(); - return $this->getUrl('*/*/gallery', $params); } - return $this->getUrl('*/*/gallery', $params); + return $this->getUrl('catalog/product/gallery', $params); } + /** + * Disable gallery + */ public function disableGallery() { $this->_isGalleryDisabled = true; diff --git a/app/code/core/Mage/Catalog/Block/Product/View/Options.php b/app/code/core/Mage/Catalog/Block/Product/View/Options.php index e593ef85f2..29b32cf71b 100644 --- a/app/code/core/Mage/Catalog/Block/Product/View/Options.php +++ b/app/code/core/Mage/Catalog/Block/Product/View/Options.php @@ -146,7 +146,11 @@ public function getJsonConfig() $_tmpPriceValues = array(); foreach ($option->getValues() as $value) { /* @var $value Mage_Catalog_Model_Product_Option_Value */ - $_tmpPriceValues[$value->getId()] = Mage::helper('core')->currency($value->getPrice(true), false, false); + $id = $value->getId(); + $_tmpPriceValues[$id]['price'] = Mage::helper('core')->currency($value->getPrice(true), false, + false); + $_tmpPriceValues[$id]['oldPrice'] = Mage::helper('core')->currency($value->getPrice(false), false, + false); } $priceValue = $_tmpPriceValues; } else { diff --git a/app/code/core/Mage/Catalog/Helper/Image.php b/app/code/core/Mage/Catalog/Helper/Image.php index f7ec3693b7..345da6abd3 100644 --- a/app/code/core/Mage/Catalog/Helper/Image.php +++ b/app/code/core/Mage/Catalog/Helper/Image.php @@ -31,22 +31,87 @@ */ class Mage_Catalog_Helper_Image extends Mage_Core_Helper_Abstract { + /** + * Current model + * + * @var Mage_Catalog_Model_Product_Image + */ protected $_model; + + /** + * Scheduled for resize image + * + * @var bool + */ protected $_scheduleResize = false; + + /** + * Scheduled for rotate image + * + * @var bool + */ protected $_scheduleRotate = false; + + /** + * Angle + * + * @var int + */ protected $_angle; + /** + * Watermark file name + * + * @var string + */ protected $_watermark; + + /** + * Watermark Position + * + * @var string + */ protected $_watermarkPosition; + + /** + * Watermark Size + * + * @var string + */ protected $_watermarkSize; + + /** + * Watermark Image opacity + * + * @var int + */ protected $_watermarkImageOpacity; + /** + * Current Product + * + * @var Mage_Catalog_Model_Product + */ protected $_product; + + /** + * Image File + * + * @var string + */ protected $_imageFile; + + /** + * Image Placeholder + * + * @var string + */ protected $_placeholder; /** - * Reset all previos data + * Reset all previous data + * + * @return Mage_Catalog_Helper_Image */ protected function _reset() { @@ -63,6 +128,14 @@ protected function _reset() return $this; } + /** + * Initialize Helper to work with Image + * + * @param Mage_Catalog_Model_Product $product + * @param string $attributeName + * @param mixed $imageFile + * @return Mage_Catalog_Helper_Image + */ public function init(Mage_Catalog_Model_Product $product, $attributeName, $imageFile=null) { $this->_reset(); @@ -70,17 +143,24 @@ public function init(Mage_Catalog_Model_Product $product, $attributeName, $image $this->_getModel()->setDestinationSubdir($attributeName); $this->setProduct($product); - $this->setWatermark(Mage::getStoreConfig("design/watermark/{$this->_getModel()->getDestinationSubdir()}_image")); - $this->setWatermarkImageOpacity(Mage::getStoreConfig("design/watermark/{$this->_getModel()->getDestinationSubdir()}_imageOpacity")); - $this->setWatermarkPosition(Mage::getStoreConfig("design/watermark/{$this->_getModel()->getDestinationSubdir()}_position")); - $this->setWatermarkSize(Mage::getStoreConfig("design/watermark/{$this->_getModel()->getDestinationSubdir()}_size")); + $this->setWatermark( + Mage::getStoreConfig("design/watermark/{$this->_getModel()->getDestinationSubdir()}_image") + ); + $this->setWatermarkImageOpacity( + Mage::getStoreConfig("design/watermark/{$this->_getModel()->getDestinationSubdir()}_imageOpacity") + ); + $this->setWatermarkPosition( + Mage::getStoreConfig("design/watermark/{$this->_getModel()->getDestinationSubdir()}_position") + ); + $this->setWatermarkSize( + Mage::getStoreConfig("design/watermark/{$this->_getModel()->getDestinationSubdir()}_size") + ); if ($imageFile) { $this->setImageFile($imageFile); - } - else { + } else { // add for work original size - $this->_getModel()->setBaseFile( $this->getProduct()->getData($this->_getModel()->getDestinationSubdir()) ); + $this->_getModel()->setBaseFile($this->getProduct()->getData($this->_getModel()->getDestinationSubdir())); } return $this; } @@ -198,6 +278,12 @@ public function backgroundColor($colorRGB) return $this; } + /** + * Rotate image into specified angle + * + * @param int $angle + * @return Mage_Catalog_Helper_Image + */ public function rotate($angle) { $this->setAngle($angle); @@ -225,11 +311,22 @@ public function watermark($fileName, $position, $size=null, $imageOpacity=null) return $this; } + /** + * Set placeholder + * + * @param string $fileName + * @return void + */ public function placeholder($fileName) { $this->_placeholder = $fileName; } + /** + * Get Placeholder + * + * @return string + */ public function getPlaceholder() { if (!$this->_placeholder) { @@ -239,41 +336,49 @@ public function getPlaceholder() return $this->_placeholder; } + /** + * Return Image URL + * + * @return string + */ public function __toString() { try { - if( $this->getImageFile() ) { - $this->_getModel()->setBaseFile( $this->getImageFile() ); + $model = $this->_getModel(); + + if ($this->getImageFile()) { + $model->setBaseFile($this->getImageFile()); } else { - $this->_getModel()->setBaseFile( $this->getProduct()->getData($this->_getModel()->getDestinationSubdir()) ); + $model->setBaseFile($this->getProduct()->getData($model->getDestinationSubdir())); } - if( $this->_getModel()->isCached() ) { - return $this->_getModel()->getUrl(); + if ($model->isCached()) { + return $model->getUrl(); } else { - if( $this->_scheduleRotate ) { - $this->_getModel()->rotate( $this->getAngle() ); + if ($this->_scheduleRotate) { + $model->rotate($this->getAngle()); } if ($this->_scheduleResize) { - $this->_getModel()->resize(); + $model->resize(); } - if( $this->getWatermark() ) { - $this->_getModel()->setWatermark($this->getWatermark()); + if ($this->getWatermark()) { + $model->setWatermark($this->getWatermark()); } - $url = $this->_getModel()->saveFile()->getUrl(); + $url = $model->saveFile()->getUrl(); } - } catch( Exception $e ) { + } catch (Exception $e) { $url = Mage::getDesign()->getSkinUrl($this->getPlaceholder()); } return $url; } /** - * Enter description here... + * Set current Image model * + * @param Mage_Catalog_Model_Product_Image $model * @return Mage_Catalog_Helper_Image */ protected function _setModel($model) @@ -283,7 +388,7 @@ protected function _setModel($model) } /** - * Enter description here... + * Get current Image model * * @return Mage_Catalog_Model_Product_Image */ @@ -292,12 +397,23 @@ protected function _getModel() return $this->_model; } + /** + * Set Rotation Angle + * + * @param int $angle + * @return Mage_Catalog_Helper_Image + */ protected function setAngle($angle) { $this->_angle = $angle; return $this; } + /** + * Get Rotation Angle + * + * @return int + */ protected function getAngle() { return $this->_angle; @@ -393,44 +509,67 @@ public function setWatermarkImageOpacity($imageOpacity) */ protected function getWatermarkImageOpacity() { - if( $this->_watermarkImageOpacity ) { + if ($this->_watermarkImageOpacity) { return $this->_watermarkImageOpacity; } return $this->_getModel()->getWatermarkImageOpacity(); } + /** + * Set current Product + * + * @param Mage_Catalog_Model_Product $product + * @return Mage_Catalog_Helper_Image + */ protected function setProduct($product) { $this->_product = $product; return $this; } + /** + * Get current Product + * + * @return Mage_Catalog_Model_Product + */ protected function getProduct() { return $this->_product; } + /** + * Set Image file + * + * @param string $file + * @return Mage_Catalog_Helper_Image + */ protected function setImageFile($file) { $this->_imageFile = $file; return $this; } + /** + * Get Image file + * + * @return string + */ protected function getImageFile() { return $this->_imageFile; } /** - * Enter description here... + * Retrieve size from string * - * @return array + * @param string $string + * @return array|bool */ protected function parseSize($string) { $size = explode('x', strtolower($string)); - if( sizeof($size) == 2 ) { + if (sizeof($size) == 2) { return array( 'width' => ($size[0] > 0) ? $size[0] : null, 'heigth' => ($size[1] > 0) ? $size[1] : null, @@ -485,17 +624,19 @@ public function getOriginalSizeArray() } /** - * Check - is this file an image + * Check - is this file an image * * @param string $filePath * @return bool - * @throw Mage_Core_Exception + * @throws Mage_Core_Exception */ public function validateUploadFile($filePath) { if (!getimagesize($filePath)) { Mage::throwException($this->__('Disallowed file type.')); } - return true; + + $_processor = new Varien_Image($filePath); + return $_processor->getMimeType() !== null; } } diff --git a/app/code/core/Mage/Catalog/Helper/Product.php b/app/code/core/Mage/Catalog/Helper/Product.php index bf9b7c26c1..14130e20b1 100644 --- a/app/code/core/Mage/Catalog/Helper/Product.php +++ b/app/code/core/Mage/Catalog/Helper/Product.php @@ -407,35 +407,30 @@ public function addParamsToBuyRequest($buyRequest, $params) * @param string $identifierType * @return Mage_Catalog_Model_Product */ - public function getProduct($productId, $store, $identifierType = null) { - $loadByIdOnFalse = false; - if ($identifierType == null) { + public function getProduct($productId, $store, $identifierType = null) + { + /** @var $product Mage_Catalog_Model_Product */ + $product = Mage::getModel('catalog/product')->setStoreId(Mage::app()->getStore($store)->getId()); + + $expectedIdType = false; + if ($identifierType === null) { if (is_string($productId) && !preg_match("/^[+-]?[1-9][0-9]*$|^0$/", $productId)) { - $identifierType = 'sku'; - $loadByIdOnFalse = true; - } else { - $identifierType = 'id'; + $expectedIdType = 'sku'; } } - /** @var $product Mage_Catalog_Model_Product */ - $product = Mage::getModel('catalog/product'); - if ($store !== null) { - $product->setStoreId($store); - } - if ($identifierType == 'sku') { + if ($identifierType == 'sku' || $expectedIdType == 'sku') { $idBySku = $product->getIdBySku($productId); if ($idBySku) { $productId = $idBySku; - } - if ($loadByIdOnFalse) { - $identifierType = 'id'; + } else if ($identifierType == 'sku') { + // Return empty product because it was not found by originally specified SKU identifier + return $product; } } - if ($identifierType == 'id' && is_numeric($productId)) { - $productId = !is_float($productId) ? (int) $productId : 0; - $product->load($productId); + if ($productId && is_numeric($productId)) { + $product->load((int) $productId); } return $product; diff --git a/app/code/core/Mage/Catalog/Model/Category/Api.php b/app/code/core/Mage/Catalog/Model/Category/Api.php index 3b51f812f4..1aaddbbb35 100644 --- a/app/code/core/Mage/Catalog/Model/Category/Api.php +++ b/app/code/core/Mage/Catalog/Model/Category/Api.php @@ -444,7 +444,7 @@ public function assignedProducts($categoryId, $store = null) 'type' => $product->getTypeId(), 'set' => $product->getAttributeSetId(), 'sku' => $product->getSku(), - 'position' => $product->getPosition() + 'position' => $product->getCatIndexPosition() ); } diff --git a/app/code/core/Mage/Catalog/Model/Category/Indexer/Flat.php b/app/code/core/Mage/Catalog/Model/Category/Indexer/Flat.php index 23e11b754c..9a3e140caa 100644 --- a/app/code/core/Mage/Catalog/Model/Category/Indexer/Flat.php +++ b/app/code/core/Mage/Catalog/Model/Category/Indexer/Flat.php @@ -34,6 +34,11 @@ */ class Mage_Catalog_Model_Category_Indexer_Flat extends Mage_Index_Model_Indexer_Abstract { + /** + * Data key for matching result to be saved in + */ + const EVENT_MATCH_RESULT_KEY = 'catalog_category_flat_match_result'; + /** * Matched entity events * @@ -96,21 +101,22 @@ public function matchEvent(Mage_Index_Model_Event $event) return false; } - $data = $event->getNewData(); - $resultKey = 'catalog_category_flat_match_result'; - if (isset($data[$resultKey])) { - return $data[$resultKey]; + $data = $event->getNewData(); + if (isset($data[self::EVENT_MATCH_RESULT_KEY])) { + return $data[self::EVENT_MATCH_RESULT_KEY]; } - $result = null; $entity = $event->getEntity(); if ($entity == Mage_Core_Model_Store::ENTITY) { if ($event->getType() == Mage_Index_Model_Event::TYPE_DELETE) { $result = true; - } else if ($event->getType() == Mage_Index_Model_Event::TYPE_SAVE) { - /* @var $store Mage_Core_Model_Store */ + } elseif ($event->getType() == Mage_Index_Model_Event::TYPE_SAVE) { + /** @var $store Mage_Core_Model_Store */ $store = $event->getDataObject(); - if ($store->isObjectNew() || $store->dataHasChangedFor('group_id') || $store->dataHasChangedFor('root_catefory_id')) { + if ($store && ($store->isObjectNew() + || $store->dataHasChangedFor('group_id') + || $store->dataHasChangedFor('root_category_id') + )) { $result = true; } else { $result = false; @@ -118,10 +124,12 @@ public function matchEvent(Mage_Index_Model_Event $event) } else { $result = false; } - } else if ($entity == Mage_Core_Model_Store_Group::ENTITY) { - /* @var $storeGroup Mage_Core_Model_Store_Group */ + } elseif ($entity == Mage_Core_Model_Store_Group::ENTITY) { + /** @var $storeGroup Mage_Core_Model_Store_Group */ $storeGroup = $event->getDataObject(); - if ($storeGroup->dataHasChangedFor('website_id')) { + if ($storeGroup + && ($storeGroup->dataHasChangedFor('website_id') || $storeGroup->dataHasChangedFor('root_category_id')) + ) { $result = true; } else { $result = false; @@ -130,7 +138,7 @@ public function matchEvent(Mage_Index_Model_Event $event) $result = parent::matchEvent($event); } - $event->addNewData($resultKey, $result); + $event->addNewData(self::EVENT_MATCH_RESULT_KEY, $result); return $result; } @@ -142,6 +150,7 @@ public function matchEvent(Mage_Index_Model_Event $event) */ protected function _registerEvent(Mage_Index_Model_Event $event) { + $event->addNewData(self::EVENT_MATCH_RESULT_KEY, true); switch ($event->getEntity()) { case Mage_Catalog_Model_Category::ENTITY: $this->_registerCatalogCategoryEvent($event); @@ -234,6 +243,6 @@ protected function _processEvent(Mage_Index_Model_Event $event) */ public function reindexAll() { - $this->_getIndexer()->rebuild(); + $this->_getIndexer()->reindexAll(); } } diff --git a/app/code/core/Mage/Catalog/Model/Category/Indexer/Product.php b/app/code/core/Mage/Catalog/Model/Category/Indexer/Product.php index 36b560d7b3..1c84e4541a 100644 --- a/app/code/core/Mage/Catalog/Model/Category/Indexer/Product.php +++ b/app/code/core/Mage/Catalog/Model/Category/Indexer/Product.php @@ -53,6 +53,11 @@ */ class Mage_Catalog_Model_Category_Indexer_Product extends Mage_Index_Model_Indexer_Abstract { + /** + * Data key for matching result to be saved in + */ + const EVENT_MATCH_RESULT_KEY = 'catalog_category_product_match_result'; + /** * @var array */ @@ -113,25 +118,23 @@ public function getDescription() public function matchEvent(Mage_Index_Model_Event $event) { $data = $event->getNewData(); - $resultKey = 'catalog_category_product_match_result'; - if (isset($data[$resultKey])) { - return $data[$resultKey]; + if (isset($data[self::EVENT_MATCH_RESULT_KEY])) { + return $data[self::EVENT_MATCH_RESULT_KEY]; } - $result = null; $entity = $event->getEntity(); if ($entity == Mage_Core_Model_Store::ENTITY) { $store = $event->getDataObject(); - if ($store->isObjectNew() || $store->dataHasChangedFor('group_id')) { + if ($store && ($store->isObjectNew() || $store->dataHasChangedFor('group_id'))) { $result = true; } else { $result = false; } } elseif ($entity == Mage_Core_Model_Store_Group::ENTITY) { $storeGroup = $event->getDataObject(); - $hasDataChanges = $storeGroup->dataHasChangedFor('root_category_id') - || $storeGroup->dataHasChangedFor('website_id'); - if (!$storeGroup->isObjectNew() && $hasDataChanges) { + $hasDataChanges = $storeGroup && ($storeGroup->dataHasChangedFor('root_category_id') + || $storeGroup->dataHasChangedFor('website_id')); + if ($storeGroup && !$storeGroup->isObjectNew() && $hasDataChanges) { $result = true; } else { $result = false; @@ -140,7 +143,7 @@ public function matchEvent(Mage_Index_Model_Event $event) $result = parent::matchEvent($event); } - $event->addNewData($resultKey, $result); + $event->addNewData(self::EVENT_MATCH_RESULT_KEY, $result); return $result; } @@ -154,6 +157,7 @@ public function matchEvent(Mage_Index_Model_Event $event) */ protected function _registerEvent(Mage_Index_Model_Event $event) { + $event->addNewData(self::EVENT_MATCH_RESULT_KEY, true); $entity = $event->getEntity(); switch ($entity) { case Mage_Catalog_Model_Product::ENTITY: diff --git a/app/code/core/Mage/Catalog/Model/Convert/Adapter/Product.php b/app/code/core/Mage/Catalog/Model/Convert/Adapter/Product.php index 4d55942957..2af60b468d 100644 --- a/app/code/core/Mage/Catalog/Model/Convert/Adapter/Product.php +++ b/app/code/core/Mage/Catalog/Model/Convert/Adapter/Product.php @@ -563,10 +563,7 @@ public function save() } catch (Exception $e) { if (!$e instanceof Mage_Dataflow_Model_Convert_Exception) { $this->addException( - Mage::helper('catalog')->__( - 'An error occurred while saving the collection, aborting. Error message: %s', - $e->getMessage() - ), + Mage::helper('catalog')->__('An error occurred while saving the collection, aborting. Error message: %s', $e->getMessage()), Mage_Dataflow_Model_Convert_Exception::FATAL ); } @@ -593,10 +590,7 @@ public function saveRow(array $importData) if (!is_null($this->getBatchParams('store'))) { $store = $this->getStoreById($this->getBatchParams('store')); } else { - $message = Mage::helper('catalog')->__( - 'Skipping import row, required field "%s" is not defined.', - 'store' - ); + $message = Mage::helper('catalog')->__('Skipping import row, required field "%s" is not defined.', 'store'); Mage::throwException($message); } } else { @@ -604,10 +598,7 @@ public function saveRow(array $importData) } if ($store === false) { - $message = Mage::helper('catalog')->__( - 'Skipping import row, store "%s" field does not exist.', - $importData['store'] - ); + $message = Mage::helper('catalog')->__('Skipping import row, store "%s" field does not exist.', $importData['store']); Mage::throwException($message); } @@ -629,11 +620,7 @@ public function saveRow(array $importData) */ if (empty($importData['type']) || !isset($productTypes[strtolower($importData['type'])])) { $value = isset($importData['type']) ? $importData['type'] : ''; - $message = Mage::helper('catalog')->__( - 'Skip import row, is not valid value "%s" for field "%s"', - $value, - 'type' - ); + $message = Mage::helper('catalog')->__('Skip import row, is not valid value "%s" for field "%s"', $value, 'type'); Mage::throwException($message); } $product->setTypeId($productTypes[strtolower($importData['type'])]); @@ -642,11 +629,7 @@ public function saveRow(array $importData) */ if (empty($importData['attribute_set']) || !isset($productAttributeSets[$importData['attribute_set']])) { $value = isset($importData['attribute_set']) ? $importData['attribute_set'] : ''; - $message = Mage::helper('catalog')->__( - 'Skip import row, the value "%s" is invalid for field "%s"', - $value, - 'attribute_set' - ); + $message = Mage::helper('catalog')->__('Skip import row, the value "%s" is invalid for field "%s"', $value, 'attribute_set'); Mage::throwException($message); } $product->setAttributeSetId($productAttributeSets[$importData['attribute_set']]); @@ -654,10 +637,7 @@ public function saveRow(array $importData) foreach ($this->_requiredFields as $field) { $attribute = $this->getAttribute($field); if (!isset($importData[$field]) && $attribute && $attribute->getIsRequired()) { - $message = Mage::helper('catalog')->__( - 'Skipping import row, required field "%s" for new products is not defined.', - $field - ); + $message = Mage::helper('catalog')->__('Skipping import row, required field "%s" for new products is not defined.', $field); Mage::throwException($message); } } diff --git a/app/code/core/Mage/Catalog/Model/Indexer/Url.php b/app/code/core/Mage/Catalog/Model/Indexer/Url.php index aa7ab758df..d84aef427a 100644 --- a/app/code/core/Mage/Catalog/Model/Indexer/Url.php +++ b/app/code/core/Mage/Catalog/Model/Indexer/Url.php @@ -35,6 +35,11 @@ */ class Mage_Catalog_Model_Indexer_Url extends Mage_Index_Model_Indexer_Abstract { + /** + * Data key for matching result to be saved in + */ + const EVENT_MATCH_RESULT_KEY = 'catalog_url_match_result'; + /** * Index math: product save, category save, store save * store group save, config save @@ -98,33 +103,30 @@ public function getDescription() public function matchEvent(Mage_Index_Model_Event $event) { $data = $event->getNewData(); - $resultKey = 'catalog_url_match_result'; - if (isset($data[$resultKey])) { - return $data[$resultKey]; + if (isset($data[self::EVENT_MATCH_RESULT_KEY])) { + return $data[self::EVENT_MATCH_RESULT_KEY]; } - $result = null; $entity = $event->getEntity(); if ($entity == Mage_Core_Model_Store::ENTITY) { $store = $event->getDataObject(); - if ($store->isObjectNew() || $store->dataHasChangedFor('group_id')) { + if ($store && ($store->isObjectNew() || $store->dataHasChangedFor('group_id'))) { $result = true; } else { $result = false; } } else if ($entity == Mage_Core_Model_Store_Group::ENTITY) { $storeGroup = $event->getDataObject(); - $hasDataChanges = $storeGroup->dataHasChangedFor('root_category_id') - || $storeGroup->dataHasChangedFor('website_id'); - if (!$storeGroup->isObjectNew() && $hasDataChanges) { + $hasDataChanges = $storeGroup && ($storeGroup->dataHasChangedFor('root_category_id') + || $storeGroup->dataHasChangedFor('website_id')); + if ($storeGroup && !$storeGroup->isObjectNew() && $hasDataChanges) { $result = true; } else { $result = false; } } else if ($entity == Mage_Core_Model_Config_Data::ENTITY) { $configData = $event->getDataObject(); - $path = $configData->getPath(); - if (in_array($path, $this->_relatedConfigSettings)) { + if ($configData && in_array($configData->getPath(), $this->_relatedConfigSettings)) { $result = $configData->isValueChanged(); } else { $result = false; @@ -133,7 +135,7 @@ public function matchEvent(Mage_Index_Model_Event $event) $result = parent::matchEvent($event); } - $event->addNewData($resultKey, $result); + $event->addNewData(self::EVENT_MATCH_RESULT_KEY, $result); return $result; } @@ -145,6 +147,7 @@ public function matchEvent(Mage_Index_Model_Event $event) */ protected function _registerEvent(Mage_Index_Model_Event $event) { + $event->addNewData(self::EVENT_MATCH_RESULT_KEY, true); $entity = $event->getEntity(); switch ($entity) { case Mage_Catalog_Model_Product::ENTITY: @@ -246,6 +249,15 @@ protected function _processEvent(Mage_Index_Model_Event $event) */ public function reindexAll() { - Mage::getSingleton('catalog/url')->refreshRewrites(); + /** @var $resourceModel Mage_Catalog_Model_Resource_Url */ + $resourceModel = Mage::getResourceSingleton('catalog/url'); + $resourceModel->beginTransaction(); + try { + Mage::getSingleton('catalog/url')->refreshRewrites(); + $resourceModel->commit(); + } catch (Exception $e) { + $resourceModel->rollBack(); + throw $e; + } } } diff --git a/app/code/core/Mage/Catalog/Model/Layer/Filter/Attribute.php b/app/code/core/Mage/Catalog/Model/Layer/Filter/Attribute.php index 534eafb6de..8f5be3c794 100644 --- a/app/code/core/Mage/Catalog/Model/Layer/Filter/Attribute.php +++ b/app/code/core/Mage/Catalog/Model/Layer/Filter/Attribute.php @@ -69,7 +69,7 @@ protected function _getResource() * Get option text from frontend model by option id * * @param int $optionId - * @return unknown + * @return string|bool */ protected function _getOptionText($optionId) { @@ -90,7 +90,7 @@ public function apply(Zend_Controller_Request_Abstract $request, $filterBlock) return $this; } $text = $this->_getOptionText($filter); - if ($filter && $text) { + if ($filter && strlen($text)) { $this->_getResource()->applyFilterToCollection($this, $filter); $this->getLayer()->getState()->addFilter($this->_createItem($text, $filter)); $this->_items = array(); diff --git a/app/code/core/Mage/Catalog/Model/Layer/Filter/Price.php b/app/code/core/Mage/Catalog/Model/Layer/Filter/Price.php index b697ef264f..90c36aa453 100644 --- a/app/code/core/Mage/Catalog/Model/Layer/Filter/Price.php +++ b/app/code/core/Mage/Catalog/Model/Layer/Filter/Price.php @@ -31,10 +31,16 @@ * @package Mage_Catalog * @author Magento Core Team */ + +/** + * @method Mage_Catalog_Model_Layer_Filter_Price setInterval(array) + * @method array getInterval() + */ class Mage_Catalog_Model_Layer_Filter_Price extends Mage_Catalog_Model_Layer_Filter_Abstract { const XML_PATH_RANGE_CALCULATION = 'catalog/layered_navigation/price_range_calculation'; const XML_PATH_RANGE_STEP = 'catalog/layered_navigation/price_range_step'; + const XML_PATH_RANGE_MAX_INTERVALS = 'catalog/layered_navigation/price_range_max_intervals'; const RANGE_CALCULATION_AUTO = 'auto'; const RANGE_CALCULATION_MANUAL = 'manual'; @@ -102,10 +108,6 @@ public function getPriceRange() } } - while (ceil($maxPrice / $range) > 25) { - $range *= 10; - } - $this->setData('price_range', $range); } @@ -141,6 +143,19 @@ public function getRangeItemCounts($range) $items = $this->getData($rangeKey); if (is_null($items)) { $items = $this->_getResource()->getCount($this, $range); + // checking max number of intervals + $i = 0; + $lastIndex = null; + $maxIntervalsNumber = $this->getMaxIntervalsNumber(); + foreach ($items as $k => $v) { + ++$i; + if ($i > 1 && $i > $maxIntervalsNumber) { + $items[$lastIndex] += $v; + unset($items[$k]); + } else { + $lastIndex = $k; + } + } $this->setData($rangeKey, $items); } @@ -150,6 +165,7 @@ public function getRangeItemCounts($range) /** * Prepare text of item label * + * @deprecated since 1.7.0.0 * @param int $range * @param float $value * @return string @@ -157,12 +173,32 @@ public function getRangeItemCounts($range) protected function _renderItemLabel($range, $value) { $store = Mage::app()->getStore(); - $fromPrice = $store->formatPrice(($value-1)*$range); + $fromPrice = $store->formatPrice(($value - 1) * $range); $toPrice = $store->formatPrice($value*$range); return Mage::helper('catalog')->__('%s - %s', $fromPrice, $toPrice); } + /** + * Prepare text of range label + * + * @param float|string $fromPrice + * @param float|string $toPrice + * @return string + */ + protected function _renderRangeLabel($fromPrice, $toPrice) + { + $store = Mage::app()->getStore(); + $formattedFromPrice = $store->formatPrice($fromPrice); + if (empty($toPrice)) { + return Mage::helper('catalog')->__('%s and above', $formattedFromPrice); + } elseif ($fromPrice == $toPrice) { + return $formattedFromPrice; + } else { + return Mage::helper('catalog')->__('%s - %s', $formattedFromPrice, $store->formatPrice($toPrice - .01)); + } + } + /** * Get price aggreagation data cache key * @deprecated after 1.4 @@ -182,6 +218,34 @@ protected function _getCacheKey() return $key; } + /** + * Get data generated by algorithm for build price filter items + * + * @return array + */ + protected function _getCalculatedItemsData() + { + $appliedInterval = $this->getInterval(); + if ($appliedInterval) { + return array(); + } + + /** @var $algorithmModel Mage_Catalog_Model_Layer_Filter_Price_Algorithm */ + $algorithmModel = Mage::getSingleton('catalog/layer_filter_price_algorithm'); + $this->_getResource()->loadAllPrices($algorithmModel, $this); + + $items = array(); + foreach ($algorithmModel->calculateSeparators() as $separator) { + $items[] = array( + 'label' => $this->_renderRangeLabel($separator['from'], $separator['to']), + 'value' => (($separator['from'] == 0) ? '' : $separator['from']) . '-' . $separator['to'], + 'count' => $separator['count'], + ); + } + + return $items; + } + /** * Get data for build price filter items * @@ -189,16 +253,33 @@ protected function _getCacheKey() */ protected function _getItemsData() { + // check if filter is already applied + if ($this->getInterval()) { + return array(); + } + + if (Mage::app()->getStore()->getConfig(self::XML_PATH_RANGE_CALCULATION) == self::RANGE_CALCULATION_AUTO) { + return $this->_getCalculatedItemsData(); + } + $range = $this->getPriceRange(); $dbRanges = $this->getRangeItemCounts($range); $data = array(); - foreach ($dbRanges as $index=>$count) { - $data[] = array( - 'label' => $this->_renderItemLabel($range, $index), - 'value' => $index . ',' . $range, - 'count' => $count, - ); + if (!empty($dbRanges)) { + $lastIndex = array_keys($dbRanges); + $lastIndex = $lastIndex[count($lastIndex) - 1]; + + foreach ($dbRanges as $index => $count) { + $fromPrice = ($index == 1) ? '' : (($index - 1) * $range); + $toPrice = ($index == $lastIndex) ? '' : ($index * $range); + + $data[] = array( + 'label' => $this->_renderRangeLabel($fromPrice, $toPrice), + 'value' => $fromPrice . '-' . $toPrice, + 'count' => $count, + ); + } } return $data; @@ -207,6 +288,17 @@ protected function _getItemsData() /** * Apply price range filter to collection * + * @return Mage_Catalog_Model_Layer_Filter_Price + */ + protected function _applyPriceRange() + { + $this->_getResource()->applyPriceRange($this); + return $this; + } + + /** + * Apply price range filter + * * @param Zend_Controller_Request_Abstract $request * @param $filterBlock * @@ -215,36 +307,41 @@ protected function _getItemsData() public function apply(Zend_Controller_Request_Abstract $request, $filterBlock) { /** - * Filter must be string: $index,$range + * Filter must be string: $fromPrice-$toPrice */ $filter = $request->getParam($this->getRequestVar()); if (!$filter) { return $this; } - $filter = explode(',', $filter); + //validate filter + $filter = explode('-', $filter); if (count($filter) != 2) { return $this; } + foreach ($filter as $v) { + if ($v !== '' && (float)$v <= 0) { + return $this; + } + } - list($index, $range) = $filter; + list($from, $to) = $filter; - if ((int)$index && (int)$range) { - $this->setPriceRange((int)$range); + $this->setInterval(array($from, $to)); - $this->_applyToCollection($range, $index); - $this->getLayer()->getState()->addFilter( - $this->_createItem($this->_renderItemLabel($range, $index), $filter) - ); + $this->_applyPriceRange(); + $this->getLayer()->getState()->addFilter($this->_createItem( + $this->_renderRangeLabel(empty($from) ? 0 : $from, $to), + $filter + )); - $this->_items = array(); - } return $this; } /** * Apply filter value to product collection based on filter range and selected value * + * @deprecated since 1.7.0.0 * @param int $range * @param int $index * @return Mage_Catalog_Model_Layer_Filter_Price @@ -307,4 +404,14 @@ public function setCurrencyRate($rate) { return $this->setData('currency_rate', $rate); } + + /** + * Get maximum number of intervals + * + * @return int + */ + public function getMaxIntervalsNumber() + { + return (int)Mage::app()->getStore()->getConfig(self::XML_PATH_RANGE_MAX_INTERVALS); + } } diff --git a/app/code/core/Mage/Catalog/Model/Layer/Filter/Price/Algorithm.php b/app/code/core/Mage/Catalog/Model/Layer/Filter/Price/Algorithm.php new file mode 100644 index 0000000000..0a060376df --- /dev/null +++ b/app/code/core/Mage/Catalog/Model/Layer/Filter/Price/Algorithm.php @@ -0,0 +1,420 @@ + + */ +class Mage_Catalog_Model_Layer_Filter_Price_Algorithm +{ + const MIN_POSSIBLE_PRICE = .01; + const TEN_POWER_ROUNDING_FACTOR = 4; + + /** + * Sorted array of all products prices + * + * @var array + */ + protected $_prices = null; + + /** + * Number of segmentation intervals + * + * @var null|int + */ + protected $_intervalsNumber = null; + + /** + * Upper limits of skipped quantiles + * + * @var array + */ + protected $_skippedQuantilesUpperLimits = array(); + + /** + * Set products prices + * + * @param array $prices + * @return Mage_Catalog_Model_Layer_Filter_Price_Algorithm + */ + public function setPrices(array $prices) + { + $this->_prices = $prices; + sort($this->_prices); + $this->_intervalsNumber = null; + $this->_skippedQuantilesUpperLimits = array(); + + return $this; + } + + /** + * Get min price + * + * @return float + */ + public function getMinPrice() + { + return empty($this->_prices) ? 0 : $this->_prices[0]; + } + + /** + * Get max price + * + * @return float + */ + public function getMaxPrice() + { + return (empty($this->_prices)) ? 0 : $this->_prices[count($this->_prices) - 1]; + } + + /** + * Get amount of segmentation intervals + * + * @return int + */ + public function getIntervalsNumber() + { + if (!is_null($this->_intervalsNumber)) { + return $this->_intervalsNumber; + } + + $pricesCount = count($this->_prices); + if ($pricesCount < 2 || ($this->getMaxPrice() - $this->getMinPrice() == 0)) { + //Same price couldn't be separated with several intervals + $this->_intervalsNumber = 1; + return $this->_intervalsNumber; + } + + $sum = 0; + $sumSquares = 0; + foreach ($this->_prices as $price) { + $sum += $price; + $sumSquares += $price * $price; + } + + if ($pricesCount * $sumSquares - $sum * $sum <= 0) { + $intervalsNumber = 1000; + } else { + $intervalsNumber = ($this->getMaxPrice() - $this->getMinPrice()) * pow($pricesCount, 5 / 6) + * sqrt(($pricesCount - 1) / ($pricesCount * $sumSquares - $sum * $sum)) / 3.5; + } + $this->_intervalsNumber = min(max(ceil($intervalsNumber), 2), 10); + + return $this->_intervalsNumber; + } + + /** + * Get quantile + * + * @param int $quantileNumber should be from 1 to n-1 where n is number of intervals + * @return float|null + */ + protected function _getQuantile($quantileNumber) + { + if ($quantileNumber < 1 || $quantileNumber >= $this->getIntervalsNumber()) { + return 0; + } + + return $quantileNumber * count($this->_prices) / $this->getIntervalsNumber() - .5; + } + + /** + * Get quantile interval + * + * @param int $quantileNumber should be from 1 to n-1 where n is number of intervals + * @return null|array [floatMin,floatMax] + */ + protected function _getQuantileInterval($quantileNumber) + { + if ($quantileNumber < 1 || $quantileNumber >= $this->getIntervalsNumber()) { + return null; + } + $pricesCount = count($this->_prices); + $quantile = $this->_getQuantile($quantileNumber); + $deflectionLimit = floor($pricesCount / 2 / $this->getIntervalsNumber()); + $limits = array( + min(floor($quantile - $deflectionLimit), floor($quantile)), + max(ceil($quantile + $deflectionLimit - 1), ceil($quantile)), + ); + + $deflection = $this->_getStandardNormalDistribution() + * sqrt($pricesCount * $quantileNumber * ($this->getIntervalsNumber() - $quantileNumber)) + / $this->getIntervalsNumber(); + $left = max(floor($quantile - $deflection - 1), $limits[0], 0); + if (array_key_exists($quantileNumber - 1, $this->_skippedQuantilesUpperLimits) + && $left > $this->_skippedQuantilesUpperLimits[$quantileNumber - 1] + ) { + $left = $this->_skippedQuantilesUpperLimits[$quantileNumber - 1]; + } + $right = min(ceil($quantile + $deflection), $limits[1], $pricesCount - 1); + return array($left, $right); + } + + /** + * Get standard normal distribution + * + * @return float + */ + protected function _getStandardNormalDistribution() + { + return 1.96; + } + + /** + * Find max rounding factor with given price range + * + * @param float $lowerPrice + * @param float $upperPrice + * @param bool $returnEmpty whether empty result is acceptable + * @param null|float $roundingFactor if given, checks for range to contain the factor + * @return false|array + */ + protected function _findRoundPrice($lowerPrice, $upperPrice, $returnEmpty = true, $roundingFactor = null) + { + $lowerPrice = round($lowerPrice, 3); + $upperPrice = round($upperPrice, 3); + + if (!is_null($roundingFactor)) { + // Can't separate if prices are equal + if ($lowerPrice >= $upperPrice) { + if ($lowerPrice > $upperPrice || $returnEmpty) { + return false; + } + } + // round is used for such examples: (1194.32 / 0.02) or (5 / 100000) + $lowerDivision = ceil(round($lowerPrice / $roundingFactor, self::TEN_POWER_ROUNDING_FACTOR + 3)); + $upperDivision = floor(round($upperPrice / $roundingFactor, self::TEN_POWER_ROUNDING_FACTOR + 3)); + if ($lowerDivision > $upperDivision) { + return false; + } + $averageDivision = ($lowerDivision + $upperDivision) / 2; + $lowerAverageDivision = floor($averageDivision); + $result = array(round($lowerAverageDivision * $roundingFactor, 2)); + if ($averageDivision != $lowerAverageDivision) { + $upperAverageDivision = ceil($averageDivision); + $result[] = round($upperAverageDivision * $roundingFactor, 2); + } + return $result; + } + + $tenPower = pow(10, self::TEN_POWER_ROUNDING_FACTOR); + $roundingFactorCoefficients = array(10, 5, 2); + while ($tenPower >= self::MIN_POSSIBLE_PRICE) { + if ($tenPower == self::MIN_POSSIBLE_PRICE) { + $roundingFactorCoefficients[] = 1; + } + foreach ($roundingFactorCoefficients as $roundingFactorCoefficient) { + $roundingFactorCoefficient *= $tenPower; + $roundPrices = $this->_findRoundPrice( + $lowerPrice, $upperPrice, $returnEmpty, $roundingFactorCoefficient + ); + if ($roundPrices) { + return array($roundingFactorCoefficient, $roundPrices); + } + } + $tenPower /= 10; + } + + return array(self::MIN_POSSIBLE_PRICE, array()); + } + + /** + * Find price separator for the quantile + * + * @param int $quantileNumber should be from 1 to n-1 where n is number of intervals + * @return array|null + */ + protected function _findPriceSeparator($quantileNumber) + { + if ($quantileNumber < 1 || $quantileNumber >= $this->getIntervalsNumber()) { + return null; + } + $quantile = $this->_getQuantile($quantileNumber); + $lowerQuantile = floor($quantile); + $upperQuantile = ceil($quantile); + + $quantileInterval = $this->_getQuantileInterval($quantileNumber); + $quantileDeflection = 0; + $maxRoundingFactor = self::MIN_POSSIBLE_PRICE; + $bestRoundPrice = array(); + + if ($this->_prices[$quantileInterval[0]] == $this->_prices[$quantileInterval[1]]) { + if ($quantileNumber == 1) { + $i = $quantileInterval[0]; + while ($i >= 0 && ($this->_prices[$i] == $this->_prices[$quantileInterval[1]])) { + --$i; + } + if ($i >= 0) { + list($roundingFactor, $bestRoundPrice) = $this->_findRoundPrice( + $this->_prices[$i] + self::MIN_POSSIBLE_PRICE / 10, + $this->_prices[$quantileInterval[1]], + false + ); + } + } + if ($quantileNumber == $this->getIntervalsNumber() - 1) { + $pricesCount = count($this->_prices); + $i = $quantileInterval[1]; + while ($i < $pricesCount && ($this->_prices[$quantileInterval[0]] == $this->_prices[$i])) { + ++$i; + } + if ($i < $pricesCount) { + list($upperRoundingFactor, $upperBestRoundPrice) = $this->_findRoundPrice( + $this->_prices[$quantileInterval[0]] + self::MIN_POSSIBLE_PRICE / 10, + $this->_prices[$i], + false + ); + if (!empty($bestRoundPrice)) { + if ($upperRoundingFactor >= $roundingFactor) { + if ($upperRoundingFactor > $roundingFactor) { + $bestRoundPrice = $upperBestRoundPrice; + } else { + $bestRoundPrice = array_merge($bestRoundPrice, $upperBestRoundPrice); + } + } + } else { + $bestRoundPrice = $upperBestRoundPrice; + } + } + } + } else { + while ($lowerQuantile - $quantileDeflection >= $quantileInterval[0] + || $upperQuantile + $quantileDeflection <= $quantileInterval[1] + ) { + $leftIndex = max($quantileInterval[0], $lowerQuantile - $quantileDeflection); + $rightIndex = min($quantileInterval[1], $upperQuantile + $quantileDeflection); + + list($roundingFactor, $roundPrice) = $this->_findRoundPrice( + $this->_prices[$leftIndex] + self::MIN_POSSIBLE_PRICE / 10, + $this->_prices[$rightIndex] + ); + + if ($roundingFactor >= $maxRoundingFactor) { + if ($roundingFactor == $maxRoundingFactor) { + $bestRoundPrice = array_unique(array_merge($bestRoundPrice, $roundPrice)); + } else { + $bestRoundPrice = $roundPrice; + $maxRoundingFactor = $roundingFactor; + } + } + ++$quantileDeflection; + } + } + + if (empty($bestRoundPrice)) { + $this->_skippedQuantilesUpperLimits[$quantileNumber] = $quantileInterval[1]; + return $bestRoundPrice; + } + + sort($bestRoundPrice); + return $bestRoundPrice; + } + + /** + * Calculate separators, each contains 'from', 'to' and 'count' + * + * @return array + */ + public function calculateSeparators() + { + $separators = array(); + for ($i = 1; $i < $this->getIntervalsNumber(); ++$i) { + $separators[] = $this->_findPriceSeparator($i); + } + $pricesCount = count($this->_prices); + + $i = 0; + $result = array(); + $lastSeparator = 0; + $quantile = 0; + while (!empty($separators) && ($i < $pricesCount)) { + while (!empty($separators) && empty($separators[0])) { + array_shift($separators); + } + if (empty($separators)) { + break; + } + if ($this->_prices[$i] < $separators[0][0]) { + ++$i; + } else { + $separator = array_shift($separators[0]); + $separatorData = array( + 'from' => $lastSeparator, + 'to' => $separator, + 'count' => $i, + ); + + $deflection = abs(($quantile + 1) / $this->getIntervalsNumber() - $i / $pricesCount); + if (!array_key_exists($quantile, $result)) { + $result[$quantile] = array($deflection, $separatorData); + } elseif ($deflection < $result[$quantile][0]) { + $result[$quantile] = array($deflection, $separatorData); + } + + if (empty($separators[0])) { + array_shift($separators); + if (!array_key_exists($quantile - 1, $result) + || $result[$quantile - 1][1]['count'] < $result[$quantile][1]['count'] + ) { + $lastSeparator = $result[$quantile][1]['to']; + } + ++$quantile; + } + } + } + if ($i < $pricesCount || empty($result)) { + $result[$quantile] = array(0, array( + 'from' => $lastSeparator, + 'to' => '', + 'count' => $pricesCount, + )); + } + + for ($i = count($result) - 1; $i >= 0; --$i) { + $rangeCount = ($i == 0) ? $result[$i][1]['count'] : ($result[$i][1]['count'] - $result[$i-1][1]['count']); + if ($rangeCount > 0) { + $result[$i] = $result[$i][1]; + $firstPriceInRange = $this->_prices[$result[$i]['count'] - $rangeCount]; + if ($this->_prices[$result[$i]['count'] - 1] == $firstPriceInRange) { + $result[$i]['from'] = $firstPriceInRange; + $result[$i]['to'] = $firstPriceInRange; + } + $result[$i]['from'] = round($result[$i]['from'], 2); + if (!empty($result[$i]['to'])) { + $result[$i]['to'] = round($result[$i]['to'], 2); + } + $result[$i]['count'] = $rangeCount; + } else { + unset($result[$i]); + } + } + + return array_values($result); + } +} diff --git a/app/code/core/Mage/Catalog/Model/Observer.php b/app/code/core/Mage/Catalog/Model/Observer.php index 4a3adc3237..5551a354a9 100644 --- a/app/code/core/Mage/Catalog/Model/Observer.php +++ b/app/code/core/Mage/Catalog/Model/Observer.php @@ -231,4 +231,17 @@ public function catalogCheckIsUsingStaticUrlsAllowed(Varien_Event_Observer $obse $result = $observer->getEvent()->getData('result'); $result->isAllowed = Mage::helper('catalog')->setStoreId($storeId)->isUsingStaticUrlsAllowed(); } + + /** + * Cron job method for product prices to reindex + * + * @param Mage_Cron_Model_Schedule $schedule + */ + public function reindexProductPrices(Mage_Cron_Model_Schedule $schedule) + { + $indexProcess = Mage::getSingleton('index/indexer')->getProcessByCode('catalog_product_price'); + if ($indexProcess) { + $indexProcess->reindexAll(); + } + } } diff --git a/app/code/core/Mage/Catalog/Model/Product.php b/app/code/core/Mage/Catalog/Model/Product.php index 1470ccbfdf..e0620dfb69 100644 --- a/app/code/core/Mage/Catalog/Model/Product.php +++ b/app/code/core/Mage/Catalog/Model/Product.php @@ -276,8 +276,8 @@ public function getTypeInstance($singleton = false) /** * Set type instance for external * - * @param Mage_Catalog_Model_Product_Type_Abstract $singleton - * @param bool $singleton + * @param Mage_Catalog_Model_Product_Type_Abstract $instance Product type instance + * @param bool $singleton Whether instance is singleton * @return Mage_Catalog_Model_Product */ public function setTypeInstance($instance, $singleton = false) @@ -434,13 +434,13 @@ public function getStoreIds() /** * Retrieve product attributes - * * if $groupId is null - retrieve all product attributes * - * @param int $groupId - * @return array + * @param int $groupId Retrieve attributes of the specified group + * @param bool $skipSuper Not used + * @return array */ - public function getAttributes($groupId = null, $skipSuper=false) + public function getAttributes($groupId = null, $skipSuper = false) { $productAttributes = $this->getTypeInstance(true)->getEditableAttributes($this); if ($groupId) { @@ -641,6 +641,16 @@ public function getPriceModel() return Mage::getSingleton('catalog/product_type')->priceFactory($this->getTypeId()); } + /** + * Get product group price + * + * @return float + */ + public function getGroupPrice() + { + return $this->getPriceModel()->getGroupPrice($this); + } + /** * Get product tier price by qty * @@ -690,6 +700,7 @@ public function getFormatedPrice() * products it's called very often in Item->getProduct(). So removing chain of magic with more cpu consuming * algorithms gives nice optimization boost. * + * @param float $price Price amount * @return Mage_Catalog_Model_Product */ public function setFinalPrice($price) @@ -713,26 +724,51 @@ public function getFinalPrice($qty=null) return $this->getPriceModel()->getFinalPrice($qty, $this); } + /** + * Returns calculated final price + * + * @return float + */ public function getCalculatedFinalPrice() { return $this->_getData('calculated_final_price'); } + /** + * Returns minimal price + * + * @return float + */ public function getMinimalPrice() { return max($this->_getData('minimal_price'), 0); } + /** + * Returns special price + * + * @return float + */ public function getSpecialPrice() { return $this->_getData('special_price'); } + /** + * Returns starting date of the special price + * + * @return mixed + */ public function getSpecialFromDate() { return $this->_getData('special_from_date'); } + /** + * Returns end date of the special price + * + * @return mixed + */ public function getSpecialToDate() { return $this->_getData('special_to_date'); @@ -779,6 +815,8 @@ public function getRelatedProductIds() /** * Retrieve collection related product + * + * @return Mage_Catalog_Model_Resource_Product_Link_Product_Collection */ public function getRelatedProductCollection() { @@ -791,6 +829,8 @@ public function getRelatedProductCollection() /** * Retrieve collection related link + * + * @return Mage_Catalog_Model_Resource_Product_Link_Collection */ public function getRelatedLinkCollection() { @@ -839,6 +879,8 @@ public function getUpSellProductIds() /** * Retrieve collection up sell product + * + * @return Mage_Catalog_Model_Resource_Product_Link_Product_Collection */ public function getUpSellProductCollection() { @@ -851,6 +893,8 @@ public function getUpSellProductCollection() /** * Retrieve collection up sell link + * + * @return Mage_Catalog_Model_Resource_Product_Link_Collection */ public function getUpSellLinkCollection() { @@ -913,6 +957,8 @@ public function getCrossSellProductCollection() /** * Retrieve collection cross sell link + * + * @return Mage_Catalog_Model_Resource_Product_Link_Collection */ public function getCrossSellLinkCollection() { @@ -927,6 +973,8 @@ public function getCrossSellLinkCollection() /** * Retrieve collection grouped link + * + * @return Mage_Catalog_Model_Resource_Product_Link_Collection */ public function getGroupedLinkCollection() { @@ -990,9 +1038,10 @@ public function getMediaGalleryImages() * * @param string $file file path of image in file system * @param string|array $mediaAttribute code of attribute with type 'media_image', - * leave blank if image should be only in gallery + * leave blank if image should be only in gallery * @param boolean $move if true, it will move source file * @param boolean $exclude mark image as disabled in product page view + * @return Mage_Catalog_Model_Product */ public function addImageToMediaGallery($file, $mediaAttribute=null, $move=false, $exclude=true) { @@ -1038,18 +1087,18 @@ public function duplicate() Mage::dispatchEvent( 'catalog_model_product_duplicate', - array('current_product'=>$this, 'new_product'=>$newProduct) + array('current_product' => $this, 'new_product' => $newProduct) ); /* @var $newProduct Mage_Catalog_Model_Product */ -// $newOptionsArray = array(); -// $newProduct->setCanSaveCustomOptions(true); -// foreach ($this->getOptions() as $_option) { -// /* @var $_option Mage_Catalog_Model_Product_Option */ -// $newOptionsArray[] = $_option->prepareOptionForDuplicate(); -// } -// $newProduct->setProductOptions($newOptionsArray); + $newOptionsArray = array(); + $newProduct->setCanSaveCustomOptions(true); + foreach ($this->getOptions() as $_option) { + /* @var $_option Mage_Catalog_Model_Product_Option */ + $newOptionsArray[] = $_option->prepareOptionForDuplicate(); + } + $newProduct->setProductOptions($newOptionsArray); /* Prepare Related*/ $data = array(); @@ -1057,7 +1106,7 @@ public function duplicate() $attributes = array(); foreach ($this->getLinkInstance()->getAttributes() as $_attribute) { if (isset($_attribute['code'])) { - $attributes[]=$_attribute['code']; + $attributes[] = $_attribute['code']; } } foreach ($this->getRelatedLinkCollection() as $_link) { @@ -1071,7 +1120,7 @@ public function duplicate() $attributes = array(); foreach ($this->getLinkInstance()->getAttributes() as $_attribute) { if (isset($_attribute['code'])) { - $attributes[]=$_attribute['code']; + $attributes[] = $_attribute['code']; } } foreach ($this->getUpSellLinkCollection() as $_link) { @@ -1085,7 +1134,7 @@ public function duplicate() $attributes = array(); foreach ($this->getLinkInstance()->getAttributes() as $_attribute) { if (isset($_attribute['code'])) { - $attributes[]=$_attribute['code']; + $attributes[] = $_attribute['code']; } } foreach ($this->getCrossSellLinkCollection() as $_link) { @@ -1099,7 +1148,7 @@ public function duplicate() $attributes = array(); foreach ($this->getLinkInstance()->getAttributes() as $_attribute) { if (isset($_attribute['code'])) { - $attributes[]=$_attribute['code']; + $attributes[] = $_attribute['code']; } } foreach ($this->getGroupedLinkCollection() as $_link) { @@ -1128,11 +1177,21 @@ public function duplicate() return $newProduct; } + /** + * Is product grouped + * + * @return bool + */ public function isSuperGroup() { return $this->getTypeId() == Mage_Catalog_Model_Product_Type::TYPE_GROUPED; } + /** + * Alias for isConfigurable() + * + * @return bool + */ public function isSuperConfig() { return $this->isConfigurable(); @@ -1157,11 +1216,21 @@ public function isConfigurable() return $this->getTypeId() == Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE; } + /** + * Whether product configurable or grouped + * + * @return bool + */ public function isSuper() { return $this->isConfigurable() || $this->isGrouped(); } + /** + * Returns visible status IDs in catalog + * + * @return array + */ public function getVisibleInCatalogStatuses() { return Mage::getSingleton('catalog/product_status')->getVisibleStatusIds(); @@ -1303,16 +1372,32 @@ public function isRecurring() return $this->getIsRecurring() == '1'; } + /** + * Alias for isSalable() + * + * @return bool + */ public function isSaleable() { return $this->isSalable(); } + /** + * Whether product available in stock + * + * @return bool + */ public function isInStock() { return $this->getStatus() == Mage_Catalog_Model_Product_Status::STATUS_ENABLED; } + /** + * Get attribute text by its code + * + * @param $attributeCode Code of the attribute + * @return string + */ public function getAttributeText($attributeCode) { return $this->getResource() @@ -1321,6 +1406,11 @@ public function getAttributeText($attributeCode) ->getOptionText($this->getData($attributeCode)); } + /** + * Returns array with dates for custom design + * + * @return array + */ public function getCustomDesignDate() { $result = array(); @@ -1352,6 +1442,12 @@ public function getUrlInStore($params = array()) return $this->getUrlModel()->getUrlInStore($this, $params); } + /** + * Formats URL key + * + * @param $str URL + * @return string + */ public function formatUrlKey($str) { return $this->getUrlModel()->formatUrlKey($str); @@ -1368,6 +1464,14 @@ public function getUrlPath($category=null) return $this->getUrlModel()->getUrlPath($this, $category); } + /** + * Save current attribute with code $code and assign new value + * + * @param string $code Attribute code + * @param mixed $value New attribute value + * @param int $store Store ID + * @return void + */ public function addAttributeUpdate($code, $value, $store) { $oldValue = $this->getData($code); @@ -1381,6 +1485,12 @@ public function addAttributeUpdate($code, $value, $store) $this->setStoreId($oldStore); } + /** + * Renders the object to array + * + * @param array $arrAttributes Attribute array + * @return array + */ public function toArray(array $arrAttributes=array()) { $data = parent::toArray($arrAttributes); @@ -1391,6 +1501,12 @@ public function toArray(array $arrAttributes=array()) return $data; } + /** + * Same as setData(), but also initiates the stock item (if it is there) + * + * @param array $data Array to form the object from + * @return Mage_Catalog_Model_Product + */ public function fromArray($data) { if (isset($data['stock_item'])) { @@ -1415,6 +1531,11 @@ public function loadParentProductIds() return $this->setParentProductIds(array()); } + /** + * Delete product + * + * @return Mage_Catalog_Model_Product + */ public function delete() { parent::delete(); @@ -1422,6 +1543,11 @@ public function delete() return $this; } + /** + * Returns request path + * + * @return string + */ public function getRequestPath() { return $this->_getData('request_path'); @@ -1429,6 +1555,7 @@ public function getRequestPath() /** * Custom function for other modules + * @return string */ public function getGiftMessageAvailable() @@ -1436,6 +1563,11 @@ public function getGiftMessageAvailable() return $this->_getData('gift_message_available'); } + /** + * Returns rating summary + * + * @return mixed + */ public function getRatingSummary() { return $this->_getData('rating_summary'); @@ -1558,9 +1690,9 @@ public function getIsVirtual() /** * Add custom option information to product * - * @param string $code - * @param mixed $value - * @param int $productId + * @param string $code Option code + * @param mixed $value Value of the option + * @param int $product Product ID * @return Mage_Catalog_Model_Product */ public function addCustomOption($code, $value, $product=null) @@ -1577,6 +1709,12 @@ public function addCustomOption($code, $value, $product=null) return $this; } + /** + * Sets custom options for the product + * + * @param array $options Array of options + * @return void + */ public function setCustomOptions(array $options) { $this->_customOptions = $options; @@ -1917,6 +2055,7 @@ protected function _clearOptionReferences() /** * Retrieve product entities info as array * + * @param string|array $columns One or several columns * @return array */ public function getProductEntitiesInfo($columns = null) diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Groupprice.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Groupprice.php new file mode 100644 index 0000000000..437bf449a6 --- /dev/null +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Groupprice.php @@ -0,0 +1,57 @@ + + */ +class Mage_Catalog_Model_Product_Attribute_Backend_Groupprice + extends Mage_Catalog_Model_Product_Attribute_Backend_Groupprice_Abstract +{ + /** + * Retrieve resource instance + * + * @return Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Attribute_Backend_Tierprice + */ + protected function _getResource() + { + return Mage::getResourceSingleton('catalog/product_attribute_backend_groupprice'); + } + + /** + * Error message when duplicates + * + * @return string + */ + protected function _getDuplicateErrorMessage() + { + return Mage::helper('catalog')->__('Duplicate website group price customer group.'); + } +} diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Groupprice/Abstract.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Groupprice/Abstract.php new file mode 100644 index 0000000000..b6ce55439b --- /dev/null +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Groupprice/Abstract.php @@ -0,0 +1,369 @@ + + */ +abstract class Mage_Catalog_Model_Product_Attribute_Backend_Groupprice_Abstract + extends Mage_Catalog_Model_Product_Attribute_Backend_Price +{ + /** + * Website currency codes and rates + * + * @var array + */ + protected $_rates; + + /** + * Error message when duplicates + * + * @abstract + * @return string + */ + abstract protected function _getDuplicateErrorMessage(); + + /** + * Retrieve websites currency rates and base currency codes + * + * @return array + */ + protected function _getWebsiteCurrencyRates() + { + if (is_null($this->_rates)) { + $this->_rates = array(); + $baseCurrency = Mage::app()->getBaseCurrencyCode(); + foreach (Mage::app()->getWebsites() as $website) { + /* @var $website Mage_Core_Model_Website */ + if ($website->getBaseCurrencyCode() != $baseCurrency) { + $rate = Mage::getModel('directory/currency') + ->load($baseCurrency) + ->getRate($website->getBaseCurrencyCode()); + if (!$rate) { + $rate = 1; + } + $this->_rates[$website->getId()] = array( + 'code' => $website->getBaseCurrencyCode(), + 'rate' => $rate + ); + } else { + $this->_rates[$website->getId()] = array( + 'code' => $baseCurrency, + 'rate' => 1 + ); + } + } + } + return $this->_rates; + } + + /** + * Get additional unique fields + * + * @param array $objectArray + * @return array + */ + protected function _getAdditionalUniqueFields($objectArray) + { + return array(); + } + + /** + * Whether group price value fixed or percent of original price + * + * @param Mage_Catalog_Model_Product_Type_Price $priceObject + * @return bool + */ + protected function _isPriceFixed($priceObject) + { + return $priceObject->isGroupPriceFixed(); + } + + /** + * Validate group price data + * + * @param Mage_Catalog_Model_Product $object + * @throws Mage_Core_Exception + * @return bool + */ + public function validate($object) + { + $attribute = $this->getAttribute(); + $priceRows = $object->getData($attribute->getName()); + if (empty($priceRows)) { + return true; + } + + // validate per website + $duplicates = array(); + foreach ($priceRows as $priceRow) { + if (!empty($priceRow['delete'])) { + continue; + } + $compare = join('-', array_merge( + array($priceRow['website_id'], $priceRow['cust_group']), + $this->_getAdditionalUniqueFields($priceRow) + )); + if (isset($duplicates[$compare])) { + Mage::throwException($this->_getDuplicateErrorMessage()); + } + $duplicates[$compare] = true; + } + + // if attribute scope is website and edit in store view scope + // add global group prices for duplicates find + if (!$attribute->isScopeGlobal() && $object->getStoreId()) { + $origGroupPrices = $object->getOrigData($attribute->getName()); + foreach ($origGroupPrices as $price) { + if ($price['website_id'] == 0) { + $compare = join('-', array_merge( + array($price['website_id'], $price['cust_group']), + $this->_getAdditionalUniqueFields($price) + )); + $duplicates[$compare] = true; + } + } + } + + // validate currency + $baseCurrency = Mage::app()->getBaseCurrencyCode(); + $rates = $this->_getWebsiteCurrencyRates(); + foreach ($priceRows as $priceRow) { + if (!empty($priceRow['delete'])) { + continue; + } + if ($priceRow['website_id'] == 0) { + continue; + } + + $globalCompare = join('-', array_merge( + array(0, $priceRow['cust_group']), + $this->_getAdditionalUniqueFields($priceRow) + )); + $websiteCurrency = $rates[$priceRow['website_id']]['code']; + + if ($baseCurrency == $websiteCurrency && isset($duplicates[$globalCompare])) { + Mage::throwException($this->_getDuplicateErrorMessage()); + } + } + + return true; + } + + /** + * Prepare group prices data for website + * + * @param array $priceData + * @param string $productTypeId + * @param int $websiteId + * @return array + */ + public function preparePriceData(array $priceData, $productTypeId, $websiteId) + { + $rates = $this->_getWebsiteCurrencyRates(); + $data = array(); + $price = Mage::getSingleton('catalog/product_type')->priceFactory($productTypeId); + foreach ($priceData as $v) { + $key = join('-', array_merge(array($v['cust_group']), $this->_getAdditionalUniqueFields($v))); + if ($v['website_id'] == $websiteId) { + $data[$key] = $v; + $data[$key]['website_price'] = $v['price']; + } else if ($v['website_id'] == 0 && !isset($data[$key])) { + $data[$key] = $v; + $data[$key]['website_id'] = $websiteId; + if ($this->_isPriceFixed($price)) { + $data[$key]['price'] = $v['price'] * $rates[$websiteId]['rate']; + $data[$key]['website_price'] = $v['price'] * $rates[$websiteId]['rate']; + } + } + } + + return $data; + } + + /** + * Assign group prices to product data + * + * @param Mage_Catalog_Model_Product $object + * @return Mage_Catalog_Model_Product_Attribute_Backend_Groupprice_Abstract + */ + public function afterLoad($object) + { + $storeId = $object->getStoreId(); + $websiteId = null; + if ($this->getAttribute()->isScopeGlobal()) { + $websiteId = 0; + } else if ($storeId) { + $websiteId = Mage::app()->getStore($storeId)->getWebsiteId(); + } + + $data = $this->_getResource()->loadPriceData($object->getId(), $websiteId); + foreach ($data as $k => $v) { + $data[$k]['website_price'] = $v['price']; + if ($v['all_groups']) { + $data[$k]['cust_group'] = Mage_Customer_Model_Group::CUST_GROUP_ALL; + } + } + + if (!$object->getData('_edit_mode') && $websiteId) { + $data = $this->preparePriceData($data, $object->getTypeId(), $websiteId); + } + + $object->setData($this->getAttribute()->getName(), $data); + $object->setOrigData($this->getAttribute()->getName(), $data); + + $valueChangedKey = $this->getAttribute()->getName() . '_changed'; + $object->setOrigData($valueChangedKey, 0); + $object->setData($valueChangedKey, 0); + + return $this; + } + + /** + * After Save Attribute manipulation + * + * @param Mage_Catalog_Model_Product $object + * @return Mage_Catalog_Model_Product_Attribute_Backend_Groupprice_Abstract + */ + public function afterSave($object) + { + $websiteId = Mage::app()->getStore($object->getStoreId())->getWebsiteId(); + $isGlobal = $this->getAttribute()->isScopeGlobal() || $websiteId == 0; + + $priceRows = $object->getData($this->getAttribute()->getName()); + if (empty($priceRows)) { + if ($isGlobal) { + $this->_getResource()->deletePriceData($object->getId()); + } else { + $this->_getResource()->deletePriceData($object->getId(), $websiteId); + } + return $this; + } + + $old = array(); + $new = array(); + + // prepare original data for compare + $origGroupPrices = $object->getOrigData($this->getAttribute()->getName()); + if (!is_array($origGroupPrices)) { + $origGroupPrices = array(); + } + foreach ($origGroupPrices as $data) { + if ($data['website_id'] > 0 || ($data['website_id'] == '0' && $isGlobal)) { + $key = join('-', array_merge( + array($data['website_id'], $data['cust_group']), + $this->_getAdditionalUniqueFields($data) + )); + $old[$key] = $data; + } + } + + // prepare data for save + foreach ($priceRows as $data) { + $hasEmptyData = false; + foreach ($this->_getAdditionalUniqueFields($data) as $field) { + if (empty($field)) { + $hasEmptyData = true; + break; + } + } + + if ($hasEmptyData || !isset($data['cust_group']) || !empty($data['delete'])) { + continue; + } + if ($this->getAttribute()->isScopeGlobal() && $data['website_id'] > 0) { + continue; + } + if (!$isGlobal && (int)$data['website_id'] == 0) { + continue; + } + + $key = join('-', array_merge( + array($data['website_id'], $data['cust_group']), + $this->_getAdditionalUniqueFields($data) + )); + + $useForAllGroups = $data['cust_group'] == Mage_Customer_Model_Group::CUST_GROUP_ALL; + $customerGroupId = !$useForAllGroups ? $data['cust_group'] : 0; + + $new[$key] = array_merge(array( + 'website_id' => $data['website_id'], + 'all_groups' => $useForAllGroups ? 1 : 0, + 'customer_group_id' => $customerGroupId, + 'value' => $data['price'], + ), $this->_getAdditionalUniqueFields($data)); + } + + $delete = array_diff_key($old, $new); + $insert = array_diff_key($new, $old); + $update = array_intersect_key($new, $old); + + $isChanged = false; + $productId = $object->getId(); + + if (!empty($delete)) { + foreach ($delete as $data) { + $this->_getResource()->deletePriceData($productId, null, $data['price_id']); + $isChanged = true; + } + } + + if (!empty($insert)) { + foreach ($insert as $data) { + $price = new Varien_Object($data); + $price->setEntityId($productId); + $this->_getResource()->savePriceData($price); + + $isChanged = true; + } + } + + if (!empty($update)) { + foreach ($update as $k => $v) { + if ($old[$k]['price'] != $v['value']) { + $price = new Varien_Object(array( + 'value_id' => $old[$k]['price_id'], + 'value' => $v['value'] + )); + $this->_getResource()->savePriceData($price); + + $isChanged = true; + } + } + } + + if ($isChanged) { + $valueChangedKey = $this->getAttribute()->getName() . '_changed'; + $object->setData($valueChangedKey, 1); + } + + return $this; + } +} diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Tierprice.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Tierprice.php index 6d1ac5d71e..aa0b2b0e4a 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Tierprice.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Tierprice.php @@ -32,15 +32,9 @@ * @package Mage_Catalog * @author Magento Core Team */ -class Mage_Catalog_Model_Product_Attribute_Backend_Tierprice extends Mage_Catalog_Model_Product_Attribute_Backend_Price +class Mage_Catalog_Model_Product_Attribute_Backend_Tierprice + extends Mage_Catalog_Model_Product_Attribute_Backend_Groupprice_Abstract { - /** - * Website currency codes and rates - * - * @var array - */ - protected $_rates; - /** * Retrieve resource instance * @@ -54,278 +48,45 @@ protected function _getResource() /** * Retrieve websites rates and base currency codes * + * @deprecated since 1.12.0.0 * @return array */ public function _getWebsiteRates() { - if (is_null($this->_rates)) { - $this->_rates = array(); - $baseCurrency = Mage::app()->getBaseCurrencyCode(); - foreach (Mage::app()->getWebsites() as $website) { - /* @var $website Mage_Core_Model_Website */ - if ($website->getBaseCurrencyCode() != $baseCurrency) { - $rate = Mage::getModel('directory/currency') - ->load($baseCurrency) - ->getRate($website->getBaseCurrencyCode()); - if (!$rate) { - $rate = 1; - } - $this->_rates[$website->getId()] = array( - 'code' => $website->getBaseCurrencyCode(), - 'rate' => $rate - ); - } else { - $this->_rates[$website->getId()] = array( - 'code' => $baseCurrency, - 'rate' => 1 - ); - } - } - } - return $this->_rates; - } - - /** - * Validate tier price data - * - * @param Mage_Catalog_Model_Product $object - * @throws Mage_Core_Exception - * @return bool - */ - public function validate($object) - { - $attribute = $this->getAttribute(); - $tiers = $object->getData($attribute->getName()); - if (empty($tiers)) { - return true; - } - - // validate per website - $duplicates = array(); - foreach ($tiers as $tier) { - if (!empty($tier['delete'])) { - continue; - } - $compare = join('-', array($tier['website_id'], $tier['cust_group'], $tier['price_qty'] * 1)); - if (isset($duplicates[$compare])) { - Mage::throwException( - Mage::helper('catalog')->__('Duplicate website tier price customer group and quantity.') - ); - } - $duplicates[$compare] = true; - } - - // if attribute scope is website and edit in store view scope - // add global tier prices for duplicates find - if (!$attribute->isScopeGlobal() && $object->getStoreId()) { - $origTierPrices = $object->getOrigData($attribute->getName()); - foreach ($origTierPrices as $tier) { - if ($tier['website_id'] == 0) { - $compare = join('-', array($tier['website_id'], $tier['cust_group'], $tier['price_qty'] * 1)); - $duplicates[$compare] = true; - } - } - } - - // validate currency - $baseCurrency = Mage::app()->getBaseCurrencyCode(); - $rates = $this->_getWebsiteRates(); - foreach ($tiers as $tier) { - if (!empty($tier['delete'])) { - continue; - } - if ($tier['website_id'] == 0) { - continue; - } - - $compare = join('-', array($tier['website_id'], $tier['cust_group'], $tier['price_qty'])); - $globalCompare = join('-', array(0, $tier['cust_group'], $tier['price_qty'] * 1)); - $websiteCurrency = $rates[$tier['website_id']]['code']; - - if ($baseCurrency == $websiteCurrency && isset($duplicates[$globalCompare])) { - Mage::throwException( - Mage::helper('catalog')->__('Duplicate website tier price customer group and quantity.') - ); - } - } - - return true; + return $this->_getWebsiteCurrencyRates(); } /** - * Prepare tier prices data for website + * Add price qty to unique fields * - * @param array $priceData - * @param string $productTypeId - * @param int $websiteId + * @param array $objectArray * @return array */ - public function preparePriceData(array $priceData, $productTypeId, $websiteId) + protected function _getAdditionalUniqueFields($objectArray) { - $rates = $this->_getWebsiteRates(); - $data = array(); - $price = Mage::getSingleton('catalog/product_type')->priceFactory($productTypeId); - foreach ($priceData as $v) { - $key = join('-', array($v['cust_group'], $v['price_qty'])); - if ($v['website_id'] == $websiteId) { - $data[$key] = $v; - $data[$key]['website_price'] = $v['price']; - } else if ($v['website_id'] == 0 && !isset($data[$key])) { - $data[$key] = $v; - $data[$key]['website_id'] = $websiteId; - if ($price->isTierPriceFixed()) { - $data[$key]['price'] = $v['price'] * $rates[$websiteId]['rate']; - $data[$key]['website_price'] = $v['price'] * $rates[$websiteId]['rate']; - } - } - } - - return $data; + $uniqueFields = parent::_getAdditionalUniqueFields($objectArray); + $uniqueFields['qty'] = $objectArray['price_qty'] * 1; + return $uniqueFields; } /** - * Assign tier prices to product data + * Error message when duplicates * - * @param Mage_Catalog_Model_Product $object - * @return Mage_Catalog_Model_Product_Attribute_Backend_Tierprice + * @return string */ - public function afterLoad($object) + protected function _getDuplicateErrorMessage() { - $storeId = $object->getStoreId(); - $websiteId = null; - if ($this->getAttribute()->isScopeGlobal()) { - $websiteId = 0; - } else if ($storeId) { - $websiteId = Mage::app()->getStore($storeId)->getWebsiteId(); - } - - $data = $this->_getResource()->loadPriceData($object->getId(), $websiteId); - foreach ($data as $k => $v) { - $data[$k]['website_price'] = $v['price']; - if ($v['all_groups']) { - $data[$k]['cust_group'] = Mage_Customer_Model_Group::CUST_GROUP_ALL; - } - } - - if (!$object->getData('_edit_mode') && $websiteId) { - $data = $this->preparePriceData($data, $object->getTypeId(), $websiteId); - } - - $object->setData($this->getAttribute()->getName(), $data); - $object->setOrigData($this->getAttribute()->getName(), $data); - - $valueChangedKey = $this->getAttribute()->getName() . '_changed'; - $object->setOrigData($valueChangedKey, 0); - $object->setData($valueChangedKey, 0); - - return $this; + return Mage::helper('catalog')->__('Duplicate website tier price customer group and quantity.'); } /** - * After Save Attribute manipulation + * Whether tier price value fixed or percent of original price * - * @param Mage_Catalog_Model_Product $object - * @return Mage_Catalog_Model_Product_Attribute_Backend_Tierprice + * @param Mage_Catalog_Model_Product_Type_Price $priceObject + * @return bool */ - public function afterSave($object) + protected function _isPriceFixed($priceObject) { - $websiteId = Mage::app()->getStore($object->getStoreId())->getWebsiteId(); - $isGlobal = $this->getAttribute()->isScopeGlobal() || $websiteId == 0; - - $tierPrices = $object->getData($this->getAttribute()->getName()); - if (empty($tierPrices)) { - if ($isGlobal) { - $this->_getResource()->deletePriceData($object->getId()); - } else { - $this->_getResource()->deletePriceData($object->getId(), $websiteId); - } - return $this; - } - - $old = array(); - $new = array(); - - // prepare original data for compare - $origTierPrices = $object->getOrigData($this->getAttribute()->getName()); - if (!is_array($origTierPrices)) { - $origTierPrices = array(); - } - foreach ($origTierPrices as $data) { - if ($data['website_id'] > 0 || ($data['website_id'] == '0' && $isGlobal)) { - $key = join('-', array($data['website_id'], $data['cust_group'], $data['price_qty'] * 1)); - $old[$key] = $data; - } - } - - // prepare data for save - foreach ($tierPrices as $data) { - if (empty($data['price_qty']) || !isset($data['cust_group']) || !empty($data['delete'])) { - continue; - } - if ($this->getAttribute()->isScopeGlobal() && $data['website_id'] > 0) { - continue; - } - if (!$isGlobal && (int)$data['website_id'] == 0) { - continue; - } - - $key = join('-', array($data['website_id'], $data['cust_group'], $data['price_qty'] * 1)); - - $useForAllGroups = $data['cust_group'] == Mage_Customer_Model_Group::CUST_GROUP_ALL; - $customerGroupId = !$useForAllGroups ? $data['cust_group'] : 0; - - $new[$key] = array( - 'website_id' => $data['website_id'], - 'all_groups' => $useForAllGroups ? 1 : 0, - 'customer_group_id' => $customerGroupId, - 'qty' => $data['price_qty'], - 'value' => $data['price'], - ); - } - - $delete = array_diff_key($old, $new); - $insert = array_diff_key($new, $old); - $update = array_intersect_key($new, $old); - - $isChanged = false; - $productId = $object->getId(); - - if (!empty($delete)) { - foreach ($delete as $data) { - $this->_getResource()->deletePriceData($productId, null, $data['price_id']); - $isChanged = true; - } - } - - if (!empty($insert)) { - foreach ($insert as $data) { - $price = new Varien_Object($data); - $price->setEntityId($productId); - $this->_getResource()->savePriceData($price); - - $isChanged = true; - } - } - - if (!empty($update)) { - foreach ($update as $k => $v) { - if ($old[$k]['price'] != $v['value']) { - $price = new Varien_Object(array( - 'value_id' => $old[$k]['price_id'], - 'value' => $v['value'] - )); - $this->_getResource()->savePriceData($price); - - $isChanged = true; - } - } - } - - if ($isChanged) { - $valueChangedKey = $this->getAttribute()->getName() . '_changed'; - $object->setData($valueChangedKey, 1); - } - - return $this; + return $priceObject->isTierPriceFixed(); } } diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Countryofmanufacture.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Countryofmanufacture.php index 54f19c66c2..2efb512a13 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Countryofmanufacture.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Countryofmanufacture.php @@ -41,13 +41,11 @@ class Mage_Catalog_Model_Product_Attribute_Source_Countryofmanufacture */ public function getAllOptions() { - $cacheKey = 'DIRECTORY_COUNTRY_SELECT_STORE_'.Mage::app()->getStore()->getCode(); + $cacheKey = 'DIRECTORY_COUNTRY_SELECT_STORE_' . Mage::app()->getStore()->getCode(); if (Mage::app()->useCache('config') && $cache = Mage::app()->loadCache($cacheKey)) { $options = unserialize($cache); - } - else { - $collection = Mage::getModel('directory/country')->getResourceCollection() - ->loadByStore(); + } else { + $collection = Mage::getModel('directory/country')->getResourceCollection(); $options = $collection->toOptionArray(); if (Mage::app()->useCache('config')) { Mage::app()->saveCache(serialize($options), $cacheKey, array('config')); diff --git a/app/code/core/Mage/Catalog/Model/Product/Flat/Indexer.php b/app/code/core/Mage/Catalog/Model/Product/Flat/Indexer.php index b2f9ffdd7a..2221908129 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Flat/Indexer.php +++ b/app/code/core/Mage/Catalog/Model/Product/Flat/Indexer.php @@ -53,6 +53,16 @@ */ class Mage_Catalog_Model_Product_Flat_Indexer extends Mage_Core_Model_Abstract { + /** + * Catalog product flat entity for indexers + */ + const ENTITY = 'catalog_product_flat'; + + /** + * Indexers rebuild event type + */ + const EVENT_TYPE_REBUILD = 'catalog_product_flat_rebuild'; + /** * Standart model resource initialization * @@ -70,7 +80,16 @@ protected function _construct() */ public function rebuild($store = null) { - $this->_getResource()->rebuild($store); + if (is_null($store)) { + $this->_getResource()->prepareFlatTables(); + } else { + $this->_getResource()->prepareFlatTable($store); + } + Mage::getSingleton('index/indexer')->processEntityAction( + new Varien_Object(array('id' => $store)), + self::ENTITY, + self::EVENT_TYPE_REBUILD + ); return $this; } @@ -218,7 +237,7 @@ public function saveProduct($productIds, $store = null) } return $this; } - + $resource = $this->_getResource(); $resource->beginTransaction(); try { @@ -266,4 +285,25 @@ public function deleteStore($store) $this->_getResource()->deleteFlatTable($store); return $this; } + + /** + * Rebuild Catalog Product Flat Data for all stores + * + * @return Mage_Catalog_Model_Product_Flat_Indexer + */ + public function reindexAll() + { + $this->_getResource()->reindexAll(); + return $this; + } + + /** + * Retrieve list of attribute codes for flat + * + * @return array + */ + public function getAttributeCodes() + { + return $this->_getResource()->getAttributeCodes(); + } } diff --git a/app/code/core/Mage/Catalog/Model/Product/Indexer/Flat.php b/app/code/core/Mage/Catalog/Model/Product/Indexer/Flat.php index fe0a10176a..6d0665a4db 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Indexer/Flat.php +++ b/app/code/core/Mage/Catalog/Model/Product/Indexer/Flat.php @@ -25,6 +25,11 @@ */ class Mage_Catalog_Model_Product_Indexer_Flat extends Mage_Index_Model_Indexer_Abstract { + /** + * Data key for matching result to be saved in + */ + const EVENT_MATCH_RESULT_KEY = 'catalog_product_flat_match_result'; + /** * Index math Entities array * @@ -48,7 +53,10 @@ class Mage_Catalog_Model_Product_Indexer_Flat extends Mage_Index_Model_Indexer_A ), Mage_Catalog_Model_Convert_Adapter_Product::ENTITY => array( Mage_Index_Model_Event::TYPE_SAVE - ) + ), + Mage_Catalog_Model_Product_Flat_Indexer::ENTITY => array( + Mage_Catalog_Model_Product_Flat_Indexer::EVENT_TYPE_REBUILD, + ), ); /** @@ -95,34 +103,32 @@ public function matchEvent(Mage_Index_Model_Event $event) return false; } - $data = $event->getNewData(); - $resultKey = 'catalog_product_flat_match_result'; - if (isset($data[$resultKey])) { - return $data[$resultKey]; + $data = $event->getNewData(); + if (isset($data[self::EVENT_MATCH_RESULT_KEY])) { + return $data[self::EVENT_MATCH_RESULT_KEY]; } - $result = null; $entity = $event->getEntity(); if ($entity == Mage_Catalog_Model_Resource_Eav_Attribute::ENTITY) { /* @var $attribute Mage_Catalog_Model_Resource_Eav_Attribute */ $attribute = $event->getDataObject(); $addFilterable = Mage::helper('catalog/product_flat')->isAddFilterableAttributes(); - $enableBefore = ($attribute->getOrigData('backend_type') == 'static') + $enableBefore = $attribute && (($attribute->getOrigData('backend_type') == 'static') || ($addFilterable && $attribute->getOrigData('is_filterable') > 0) || ($attribute->getOrigData('used_in_product_listing') == 1) || ($attribute->getOrigData('is_used_for_promo_rules') == 1) - || ($attribute->getOrigData('used_for_sort_by') == 1); + || ($attribute->getOrigData('used_for_sort_by') == 1)); - $enableAfter = ($attribute->getData('backend_type') == 'static') + $enableAfter = $attribute && (($attribute->getData('backend_type') == 'static') || ($addFilterable && $attribute->getData('is_filterable') > 0) || ($attribute->getData('used_in_product_listing') == 1) || ($attribute->getData('is_used_for_promo_rules') == 1) - || ($attribute->getData('used_for_sort_by') == 1); + || ($attribute->getData('used_for_sort_by') == 1)); - if ($event->getType() == Mage_Index_Model_Event::TYPE_DELETE) { + if ($attribute && $event->getType() == Mage_Index_Model_Event::TYPE_DELETE) { $result = $enableBefore; - } else if ($event->getType() == Mage_Index_Model_Event::TYPE_SAVE) { + } elseif ($attribute && $event->getType() == Mage_Index_Model_Event::TYPE_SAVE) { if ($enableAfter || $enableBefore) { $result = true; } else { @@ -137,7 +143,7 @@ public function matchEvent(Mage_Index_Model_Event $event) } else { /* @var $store Mage_Core_Model_Store */ $store = $event->getDataObject(); - if ($store->isObjectNew()) { + if ($store && $store->isObjectNew()) { $result = true; } else { $result = false; @@ -146,7 +152,7 @@ public function matchEvent(Mage_Index_Model_Event $event) } else if ($entity == Mage_Core_Model_Store_Group::ENTITY) { /* @var $storeGroup Mage_Core_Model_Store_Group */ $storeGroup = $event->getDataObject(); - if ($storeGroup->dataHasChangedFor('website_id')) { + if ($storeGroup && $storeGroup->dataHasChangedFor('website_id')) { $result = true; } else { $result = false; @@ -155,7 +161,7 @@ public function matchEvent(Mage_Index_Model_Event $event) $result = parent::matchEvent($event); } - $event->addNewData($resultKey, $result); + $event->addNewData(self::EVENT_MATCH_RESULT_KEY, $result); return $result; } @@ -167,6 +173,7 @@ public function matchEvent(Mage_Index_Model_Event $event) */ protected function _registerEvent(Mage_Index_Model_Event $event) { + $event->addNewData(self::EVENT_MATCH_RESULT_KEY, true); switch ($event->getEntity()) { case Mage_Catalog_Model_Product::ENTITY: $this->_registerCatalogProductEvent($event); @@ -185,6 +192,12 @@ protected function _registerEvent(Mage_Index_Model_Event $event) $process = $event->getProcess(); $process->changeStatus(Mage_Index_Model_Process::STATUS_REQUIRE_REINDEX); break; + case Mage_Catalog_Model_Product_Flat_Indexer::ENTITY: + switch ($event->getType()) { + case Mage_Catalog_Model_Product_Flat_Indexer::EVENT_TYPE_REBUILD: + $event->addNewData('id', $event->getDataObject()->getId()); + } + break; } } @@ -192,7 +205,7 @@ protected function _registerEvent(Mage_Index_Model_Event $event) * Register data required by catalog product process in event object * * @param Mage_Index_Model_Event $event - * @return Mage_CatalogSearch_Model_Indexer_Search + * @return Mage_Catalog_Model_Product_Indexer_Flat */ protected function _registerCatalogProductEvent(Mage_Index_Model_Event $event) { @@ -224,6 +237,16 @@ protected function _registerCatalogProductEvent(Mage_Index_Model_Event $event) $reindexData['catalog_product_flat_action_type'] = $actionObject->getActionType(); } + $flatAttributes = array(); + if (is_array($attrData)) { + $flatAttributes = array_intersect($this->_getFlatAttributes(), array_keys($attrData)); + } + + if (count($flatAttributes) > 0) { + $reindexFlat = true; + $reindexData['catalog_product_flat_force_update'] = true; + } + // register affected products if ($reindexFlat) { $reindexData['catalog_product_flat_product_ids'] = $actionObject->getProductIds(); @@ -261,6 +284,12 @@ protected function _registerCoreStoreEvent(Mage_Index_Model_Event $event) protected function _processEvent(Mage_Index_Model_Event $event) { $data = $event->getNewData(); + if ($event->getType() == Mage_Catalog_Model_Product_Flat_Indexer::EVENT_TYPE_REBUILD) { + $this->_getIndexer()->getResource()->rebuild($data['id']); + return; + } + + if (!empty($data['catalog_product_flat_reindex_all'])) { $this->reindexAll(); } else if (!empty($data['catalog_product_flat_product_id'])) { @@ -289,6 +318,10 @@ protected function _processEvent(Mage_Index_Model_Event $event) $status = $data['catalog_product_flat_status']; $this->_getIndexer()->updateProductStatus($productIds, $status); } + + if (isset($data['catalog_product_flat_force_update'])) { + $this->_getIndexer()->updateProduct($productIds); + } } else if (!empty($data['catalog_product_flat_delete_store_id'])) { $this->_getIndexer()->deleteStore($data['catalog_product_flat_delete_store_id']); } @@ -300,6 +333,16 @@ protected function _processEvent(Mage_Index_Model_Event $event) */ public function reindexAll() { - $this->_getIndexer()->rebuild(); + $this->_getIndexer()->reindexAll(); + } + + /** + * Retrieve list of attribute codes, that are used in flat + * + * @return array + */ + protected function _getFlatAttributes() + { + return Mage::getModel('catalog/product_flat_indexer')->getAttributeCodes(); } } diff --git a/app/code/core/Mage/Catalog/Model/Product/Indexer/Price.php b/app/code/core/Mage/Catalog/Model/Product/Indexer/Price.php index 15a11bf922..95f726c236 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Indexer/Price.php +++ b/app/code/core/Mage/Catalog/Model/Product/Indexer/Price.php @@ -52,6 +52,16 @@ */ class Mage_Catalog_Model_Product_Indexer_Price extends Mage_Index_Model_Indexer_Abstract { + /** + * Data key for matching result to be saved in + */ + const EVENT_MATCH_RESULT_KEY = 'catalog_product_price_match_result'; + + /** + * Reindex price event type + */ + const EVENT_TYPE_REINDEX_PRICE = 'catalog_reindex_price'; + /** * Matched Entities instruction array * @@ -62,6 +72,7 @@ class Mage_Catalog_Model_Product_Indexer_Price extends Mage_Index_Model_Indexer_ Mage_Index_Model_Event::TYPE_SAVE, Mage_Index_Model_Event::TYPE_DELETE, Mage_Index_Model_Event::TYPE_MASS_ACTION, + self::EVENT_TYPE_REINDEX_PRICE, ), Mage_Core_Model_Config_Data::ENTITY => array( Mage_Index_Model_Event::TYPE_SAVE @@ -137,26 +148,24 @@ protected function _getDependentAttributes() public function matchEvent(Mage_Index_Model_Event $event) { $data = $event->getNewData(); - $resultKey = 'catalog_product_price_match_result'; - if (isset($data[$resultKey])) { - return $data[$resultKey]; + if (isset($data[self::EVENT_MATCH_RESULT_KEY])) { + return $data[self::EVENT_MATCH_RESULT_KEY]; } - $result = null; if ($event->getEntity() == Mage_Core_Model_Config_Data::ENTITY) { $data = $event->getDataObject(); - if (in_array($data->getPath(), $this->_relatedConfigSettings)) { + if ($data && in_array($data->getPath(), $this->_relatedConfigSettings)) { $result = $data->isValueChanged(); } else { $result = false; } } elseif ($event->getEntity() == Mage_Customer_Model_Group::ENTITY) { - $result = $event->getDataObject()->isObjectNew(); + $result = $event->getDataObject() && $event->getDataObject()->isObjectNew(); } else { $result = parent::matchEvent($event); } - $event->addNewData($resultKey, $result); + $event->addNewData(self::EVENT_MATCH_RESULT_KEY, $result); return $result; } @@ -238,6 +247,7 @@ protected function _registerCatalogProductMassActionEvent(Mage_Index_Model_Event */ protected function _registerEvent(Mage_Index_Model_Event $event) { + $event->addNewData(self::EVENT_MATCH_RESULT_KEY, true); $entity = $event->getEntity(); if ($entity == Mage_Core_Model_Config_Data::ENTITY || $entity == Mage_Customer_Model_Group::ENTITY) { @@ -258,6 +268,9 @@ protected function _registerEvent(Mage_Index_Model_Event $event) case Mage_Index_Model_Event::TYPE_MASS_ACTION: $this->_registerCatalogProductMassActionEvent($event); break; + case self::EVENT_TYPE_REINDEX_PRICE: + $event->addNewData('id', $event->getDataObject()->getId()); + break; } // call product type indexers registerEvent @@ -276,6 +289,10 @@ protected function _registerEvent(Mage_Index_Model_Event $event) protected function _processEvent(Mage_Index_Model_Event $event) { $data = $event->getNewData(); + if ($event->getType() == self::EVENT_TYPE_REINDEX_PRICE) { + $this->_getResource()->reindexProductIds($data['id']); + return; + } if (!empty($data['catalog_product_price_reindex_all'])) { $this->reindexAll(); } diff --git a/app/code/core/Mage/Catalog/Model/Product/Option/Type/File.php b/app/code/core/Mage/Catalog/Model/Product/Option/Type/File.php index 0e45a3aa44..2ce93af2ac 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Option/Type/File.php +++ b/app/code/core/Mage/Catalog/Model/Product/Option/Type/File.php @@ -415,19 +415,15 @@ protected function _getValidatorErrors($errors, $fileInfo) $result = array(); foreach ($errors as $errorCode) { if ($errorCode == Zend_Validate_File_ExcludeExtension::FALSE_EXTENSION) { - $result[] = Mage::helper('catalog')->__("The file '%s' for '%s' has an invalid extension", - $fileInfo['title'], $option->getTitle()); + $result[] = Mage::helper('catalog')->__("The file '%s' for '%s' has an invalid extension", $fileInfo['title'], $option->getTitle()); } elseif ($errorCode == Zend_Validate_File_Extension::FALSE_EXTENSION) { - $result[] = Mage::helper('catalog')->__("The file '%s' for '%s' has an invalid extension", - $fileInfo['title'], $option->getTitle()); + $result[] = Mage::helper('catalog')->__("The file '%s' for '%s' has an invalid extension", $fileInfo['title'], $option->getTitle()); } elseif ($errorCode == Zend_Validate_File_ImageSize::WIDTH_TOO_BIG || $errorCode == Zend_Validate_File_ImageSize::HEIGHT_TOO_BIG) { - $result[] = Mage::helper('catalog')->__("Maximum allowed image size for '%s' is %sx%s px.", - $option->getTitle(), $option->getImageSizeX(), $option->getImageSizeY()); + $result[] = Mage::helper('catalog')->__("Maximum allowed image size for '%s' is %sx%s px.", $option->getTitle(), $option->getImageSizeX(), $option->getImageSizeY()); } elseif ($errorCode == Zend_Validate_File_FilesSize::TOO_BIG) { - $result[] = Mage::helper('catalog')->__("The file '%s' you uploaded is larger than %s Megabytes allowed by server", - $fileInfo['title'], $this->_bytesToMbytes($this->_getUploadMaxFilesize())); + $result[] = Mage::helper('catalog')->__("The file '%s' you uploaded is larger than %s Megabytes allowed by server", $fileInfo['title'], $this->_bytesToMbytes($this->_getUploadMaxFilesize())); } } return $result; @@ -513,7 +509,9 @@ protected function _getOptionHtml($optionValue) { $value = $this->_unserializeValue($optionValue); try { - if (isset($value) && isset($value['width']) && isset($value['height']) && $value['width'] > 0 && $value['height'] > 0) { + if (isset($value) && isset($value['width']) && isset($value['height']) + && $value['width'] > 0 && $value['height'] > 0 + ) { $sizes = $value['width'] . ' x ' . $value['height'] . ' ' . Mage::helper('catalog')->__('px.'); } else { $sizes = ''; diff --git a/app/code/core/Mage/Catalog/Model/Product/Type/Price.php b/app/code/core/Mage/Catalog/Model/Product/Type/Price.php index 830e76ee84..147a63e3c2 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Type/Price.php +++ b/app/code/core/Mage/Catalog/Model/Product/Type/Price.php @@ -48,24 +48,26 @@ public function getPrice($product) } /** - * Get product final price + * Retrieve product final price * - * @param double $qty - * @param Mage_Catalog_Model_Product $product - * @return double + * @param float|null $qty + * @param Mage_Catalog_Model_Product $product + * @return float */ - public function getFinalPrice($qty=null, $product) + public function getFinalPrice($qty = null, $product) { if (is_null($qty) && !is_null($product->getCalculatedFinalPrice())) { return $product->getCalculatedFinalPrice(); } $finalPrice = $product->getPrice(); + + $finalPrice = $this->_applyGroupPrice($product, $finalPrice); $finalPrice = $this->_applyTierPrice($product, $qty, $finalPrice); $finalPrice = $this->_applySpecialPrice($product, $finalPrice); $product->setFinalPrice($finalPrice); - Mage::dispatchEvent('catalog_product_get_final_price', array('product'=>$product, 'qty' => $qty)); + Mage::dispatchEvent('catalog_product_get_final_price', array('product' => $product, 'qty' => $qty)); $finalPrice = $product->getData('final_price'); $finalPrice = $this->_applyOptionsPrice($product, $qty, $finalPrice); @@ -78,6 +80,58 @@ public function getChildFinalPrice($product, $productQty, $childProduct, $childP return $this->getFinalPrice($childProductQty, $childProduct); } + /** + * Apply group price for product + * + * @param Mage_Catalog_Model_Product $product + * @param float $finalPrice + * @return float + */ + protected function _applyGroupPrice($product, $finalPrice) + { + $groupPrice = $product->getGroupPrice(); + if (is_numeric($groupPrice)) { + $finalPrice = min($finalPrice, $groupPrice); + } + return $finalPrice; + } + + /** + * Get product group price + * + * @param Mage_Catalog_Model_Product $product + * @return float + */ + public function getGroupPrice($product) + { + + $groupPrices = $product->getData('group_price'); + + if (is_null($groupPrices)) { + $attribute = $product->getResource()->getAttribute('group_price'); + if ($attribute) { + $attribute->getBackend()->afterLoad($product); + $groupPrices = $product->getData('group_price'); + } + } + + if (is_null($groupPrices) || !is_array($groupPrices)) { + return $product->getPrice(); + } + + $customerGroup = $this->_getCustomerGroupId($product); + + $matchedPrice = $product->getPrice(); + foreach ($groupPrices as $groupPrice) { + if ($groupPrice['cust_group'] == $customerGroup && $groupPrice['website_price'] < $matchedPrice) { + $matchedPrice = $groupPrice['website_price']; + break; + } + } + + return $matchedPrice; + } + /** * Apply tier price for product if not return price that was before * @@ -347,6 +401,16 @@ public static function calculateSpecialPrice($finalPrice, $specialPrice, $specia * @return bool */ public function isTierPriceFixed() + { + return $this->isGroupPriceFixed(); + } + + /** + * Check is group price value fixed or percent of original price + * + * @return bool + */ + public function isGroupPriceFixed() { return true; } diff --git a/app/code/core/Mage/Catalog/Model/Resource/Abstract.php b/app/code/core/Mage/Catalog/Model/Resource/Abstract.php index 75c9eabf17..0152ccb744 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Abstract.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Abstract.php @@ -202,7 +202,7 @@ protected function _setAttributeValue($object, $valueRow) if (!$isDefaultStore) { $object->setExistsStoreValueFlag($attributeCode); } - $attribute->getBackend()->setValueId($valueId); + $attribute->getBackend()->setEntityValueId($object, $valueId); } return $this; diff --git a/app/code/core/Mage/Catalog/Model/Resource/Category/Flat.php b/app/code/core/Mage/Catalog/Model/Resource/Category/Flat.php index fa15c8abca..06ac767fbf 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Category/Flat.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Category/Flat.php @@ -32,7 +32,7 @@ * @package Mage_Catalog * @author Magento Core Team */ -class Mage_Catalog_Model_Resource_Category_Flat extends Mage_Core_Model_Resource_Db_Abstract +class Mage_Catalog_Model_Resource_Category_Flat extends Mage_Index_Model_Resource_Abstract { /** * Store id @@ -97,6 +97,13 @@ class Mage_Catalog_Model_Resource_Category_Flat extends Mage_Core_Model_Resource */ protected $_storesRootCategories; + /** + * Whether table changes are allowed + * + * @var bool + */ + protected $_allowTableChanges = true; + /** * Resource initializations * @@ -462,7 +469,9 @@ public function rebuild($stores = null) $categoriesIds = array(); /* @var $store Mage_Core_Model_Store */ foreach ($stores as $store) { - $this->_createTable($store->getId()); + if ($this->_allowTableChanges) { + $this->_createTable($store->getId()); + } if (!isset($categories[$store->getRootCategoryId()])) { $select = $this->_getWriteAdapter()->select() @@ -1389,4 +1398,48 @@ public function getStoresRootCategories($storeIds = null) return $this->_storesRootCategories; } + + /** + * Creating table and adding attributes as fields to table for all stores + * + * @return Mage_Catalog_Model_Resource_Category_Flat + */ + protected function _createTables() + { + if ($this->_allowTableChanges) { + foreach (Mage::app()->getStores() as $store) { + $this->_createTable($store->getId()); + } + } + return $this; + } + + /** + * Transactional rebuild flat data from eav + * + * @return Mage_Catalog_Model_Resource_Category_Flat + */ + public function reindexAll() + { + $this->_createTables(); + $allowTableChanges = $this->_allowTableChanges; + if ($allowTableChanges) { + $this->_allowTableChanges = false; + } + $this->beginTransaction(); + try { + $this->rebuild(); + $this->commit(); + if ($allowTableChanges) { + $this->_allowTableChanges = true; + } + } catch (Exception $e) { + $this->rollBack(); + if ($allowTableChanges) { + $this->_allowTableChanges = true; + } + throw $e; + } + return $this; + } } diff --git a/app/code/core/Mage/Catalog/Model/Resource/Category/Indexer/Product.php b/app/code/core/Mage/Catalog/Model/Resource/Category/Indexer/Product.php index 5f7a5df146..621494629e 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Category/Indexer/Product.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Category/Indexer/Product.php @@ -773,168 +773,179 @@ protected function _getStatusAttributeInfo() public function reindexAll() { $this->useIdxTable(true); - $this->clearTemporaryIndexTable(); - $idxTable = $this->getIdxTable(); - $idxAdapter = $this->_getIndexAdapter(); - $stores = $this->_getStoresInfo(); - /** - * Build index for each store - */ - foreach ($stores as $storeData) { - $storeId = $storeData['store_id']; - $websiteId = $storeData['website_id']; - $rootPath = $storeData['root_path']; - $rootId = $storeData['root_id']; + $this->beginTransaction(); + try { + $this->clearTemporaryIndexTable(); + $idxTable = $this->getIdxTable(); + $idxAdapter = $this->_getIndexAdapter(); + $stores = $this->_getStoresInfo(); /** - * Prepare visibility for all enabled store products + * Build index for each store */ - $enabledTable = $this->_prepareEnabledProductsVisibility($websiteId, $storeId); - /** - * Select information about anchor categories - */ - $anchorTable = $this->_prepareAnchorCategories($storeId, $rootPath); - /** - * Add relations between not anchor categories and products - */ - $select = $idxAdapter->select(); - /** @var $select Varien_Db_Select */ - $select->from( - array('cp' => $this->_categoryProductTable), - array('category_id', 'product_id', 'position', 'is_parent' => new Zend_Db_Expr('1'), - 'store_id' => new Zend_Db_Expr($storeId)) - ) - ->joinInner(array('pv' => $enabledTable), 'pv.product_id=cp.product_id', array('visibility')) - ->joinLeft(array('ac' => $anchorTable), 'ac.category_id=cp.category_id', array()) - ->where('ac.category_id IS NULL'); - - $query = $select->insertFromSelect( - $idxTable, - array('category_id', 'product_id', 'position', 'is_parent', 'store_id', 'visibility'), - false - ); - $idxAdapter->query($query); + foreach ($stores as $storeData) { + $storeId = $storeData['store_id']; + $websiteId = $storeData['website_id']; + $rootPath = $storeData['root_path']; + $rootId = $storeData['root_id']; + /** + * Prepare visibility for all enabled store products + */ + $enabledTable = $this->_prepareEnabledProductsVisibility($websiteId, $storeId); + /** + * Select information about anchor categories + */ + $anchorTable = $this->_prepareAnchorCategories($storeId, $rootPath); + /** + * Add relations between not anchor categories and products + */ + $select = $idxAdapter->select(); + /** @var $select Varien_Db_Select */ + $select->from( + array('cp' => $this->_categoryProductTable), + array('category_id', 'product_id', 'position', 'is_parent' => new Zend_Db_Expr('1'), + 'store_id' => new Zend_Db_Expr($storeId)) + ) + ->joinInner(array('pv' => $enabledTable), 'pv.product_id=cp.product_id', array('visibility')) + ->joinLeft(array('ac' => $anchorTable), 'ac.category_id=cp.category_id', array()) + ->where('ac.category_id IS NULL'); + + $query = $select->insertFromSelect( + $idxTable, + array('category_id', 'product_id', 'position', 'is_parent', 'store_id', 'visibility'), + false + ); + $idxAdapter->query($query); - /** - * Assign products not associated to any category to root category in index - */ + /** + * Assign products not associated to any category to root category in index + */ - $select = $idxAdapter->select(); - $select->from( - array('pv' => $enabledTable), - array(new Zend_Db_Expr($rootId), 'product_id', new Zend_Db_Expr('0'), new Zend_Db_Expr('1'), - new Zend_Db_Expr($storeId), 'visibility') - ) - ->joinLeft(array('cp' => $this->_categoryProductTable), 'pv.product_id=cp.product_id', array()) - ->where('cp.product_id IS NULL'); + $select = $idxAdapter->select(); + $select->from( + array('pv' => $enabledTable), + array(new Zend_Db_Expr($rootId), 'product_id', new Zend_Db_Expr('0'), new Zend_Db_Expr('1'), + new Zend_Db_Expr($storeId), 'visibility') + ) + ->joinLeft(array('cp' => $this->_categoryProductTable), 'pv.product_id=cp.product_id', array()) + ->where('cp.product_id IS NULL'); - $query = $select->insertFromSelect( - $idxTable, - array('category_id', 'product_id', 'position', 'is_parent', 'store_id', 'visibility'), - false - ); - $idxAdapter->query($query); + $query = $select->insertFromSelect( + $idxTable, + array('category_id', 'product_id', 'position', 'is_parent', 'store_id', 'visibility'), + false + ); + $idxAdapter->query($query); + + /** + * Prepare anchor categories products + */ + $anchorProductsTable = $this->_getAnchorCategoriesProductsTemporaryTable(); + $idxAdapter->delete($anchorProductsTable); + + $position = 'MIN('. + $idxAdapter->getCheckSql( + 'ca.category_id = ce.entity_id', + $idxAdapter->quoteIdentifier('cp.position'), + '('.$idxAdapter->quoteIdentifier('ce.position').' + 1) * ' + .'('.$idxAdapter->quoteIdentifier('ce.level').' + 1 * 10000)' + .' + '.$idxAdapter->quoteIdentifier('cp.position') + ) + .')'; - /** - * Prepare anchor categories products - */ - $anchorProductsTable = $this->_getAnchorCategoriesProductsTemporaryTable(); - $idxAdapter->delete($anchorProductsTable); - $position = 'MIN('. - $idxAdapter->getCheckSql( - 'ca.category_id = ce.entity_id', - $idxAdapter->quoteIdentifier('cp.position'), - '('.$idxAdapter->quoteIdentifier('ce.position').' + 1) * ' - .'('.$idxAdapter->quoteIdentifier('ce.level').' + 1 * 10000)' - .' + '.$idxAdapter->quoteIdentifier('cp.position') + $select = $idxAdapter->select() + ->useStraightJoin(true) + ->distinct(true) + ->from(array('ca' => $anchorTable), array('category_id')) + ->joinInner( + array('ce' => $this->_categoryTable), + $idxAdapter->quoteIdentifier('ce.path') . ' LIKE ' . + $idxAdapter->quoteIdentifier('ca.path') . ' OR ce.entity_id = ca.category_id', + array() ) - .')'; + ->joinInner( + array('cp' => $this->_categoryProductTable), + 'cp.category_id = ce.entity_id', + array('product_id') + ) + ->joinInner( + array('pv' => $enabledTable), + 'pv.product_id = cp.product_id', + array('position' => $position) + ) + ->group(array('ca.category_id', 'cp.product_id')); + $query = $select->insertFromSelect($anchorProductsTable, + array('category_id', 'product_id', 'position'), false); + $idxAdapter->query($query); + + /** + * Add anchor categories products to index + */ + $select = $idxAdapter->select() + ->from( + array('ap' => $anchorProductsTable), + array('category_id', 'product_id', + 'position', // => new Zend_Db_Expr('MIN('. $idxAdapter->quoteIdentifier('ap.position').')'), + 'is_parent' => $idxAdapter->getCheckSql('cp.product_id > 0', 1, 0), + 'store_id' => new Zend_Db_Expr($storeId)) + ) + ->joinLeft( + array('cp' => $this->_categoryProductTable), + 'cp.category_id=ap.category_id AND cp.product_id=ap.product_id', + array() + ) + ->joinInner(array('pv' => $enabledTable), 'pv.product_id = ap.product_id', array('visibility')); + $query = $select->insertFromSelect( + $idxTable, + array('category_id', 'product_id', 'position', 'is_parent', 'store_id', 'visibility'), + false + ); + $idxAdapter->query($query); + + $select = $idxAdapter->select() + ->from(array('e' => $this->getTable('catalog/product')), null) + ->join( + array('ei' => $enabledTable), + 'ei.product_id = e.entity_id', + array()) + ->joinLeft( + array('i' => $idxTable), + 'i.product_id = e.entity_id AND i.category_id = :category_id AND i.store_id = :store_id', + array()) + ->where('i.product_id IS NULL') + ->columns(array( + 'category_id' => new Zend_Db_Expr($rootId), + 'product_id' => 'e.entity_id', + 'position' => new Zend_Db_Expr('0'), + 'is_parent' => new Zend_Db_Expr('1'), + 'store_id' => new Zend_Db_Expr($storeId), + 'visibility' => 'ei.visibility' + )); + + $query = $select->insertFromSelect( + $idxTable, + array('category_id', 'product_id', 'position', 'is_parent', 'store_id', 'visibility'), + false + ); - $select = $idxAdapter->select() - ->useStraightJoin(true) - ->distinct(true) - ->from(array('ca' => $anchorTable), array('category_id')) - ->joinInner( - array('ce' => $this->_categoryTable), - $idxAdapter->quoteIdentifier('ce.path') . ' LIKE ' . - $idxAdapter->quoteIdentifier('ca.path') . ' OR ce.entity_id = ca.category_id', - array() - ) - ->joinInner( - array('cp' => $this->_categoryProductTable), - 'cp.category_id = ce.entity_id', - array('product_id') - ) - ->joinInner(array('pv' => $enabledTable), 'pv.product_id = cp.product_id', array('position' => $position)) - ->group(array('ca.category_id', 'cp.product_id')); - $query = $select->insertFromSelect($anchorProductsTable, - array('category_id', 'product_id', 'position'), false); - $idxAdapter->query($query); + $idxAdapter->query($query, array('store_id' => $storeId, 'category_id' => $rootId)); + } + + $this->syncData(); /** - * Add anchor categories products to index + * Clean up temporary tables */ - $select = $idxAdapter->select() - ->from( - array('ap' => $anchorProductsTable), - array('category_id', 'product_id', - 'position', // => new Zend_Db_Expr('MIN('. $idxAdapter->quoteIdentifier('ap.position').')'), - 'is_parent' => $idxAdapter->getCheckSql('cp.product_id > 0', 1, 0), - 'store_id' => new Zend_Db_Expr($storeId)) - ) - ->joinLeft( - array('cp' => $this->_categoryProductTable), - 'cp.category_id=ap.category_id AND cp.product_id=ap.product_id', - array() - ) - ->joinInner(array('pv' => $enabledTable), 'pv.product_id = ap.product_id', array('visibility')); - - $query = $select->insertFromSelect( - $idxTable, - array('category_id', 'product_id', 'position', 'is_parent', 'store_id', 'visibility'), - false - ); - $idxAdapter->query($query); - - $select = $idxAdapter->select() - ->from(array('e' => $this->getTable('catalog/product')), null) - ->join( - array('ei' => $enabledTable), - 'ei.product_id = e.entity_id', - array()) - ->joinLeft( - array('i' => $idxTable), - 'i.product_id = e.entity_id AND i.category_id = :category_id AND i.store_id = :store_id', - array()) - ->where('i.product_id IS NULL') - ->columns(array( - 'category_id' => new Zend_Db_Expr($rootId), - 'product_id' => 'e.entity_id', - 'position' => new Zend_Db_Expr('0'), - 'is_parent' => new Zend_Db_Expr('1'), - 'store_id' => new Zend_Db_Expr($storeId), - 'visibility' => 'ei.visibility' - )); - - $query = $select->insertFromSelect( - $idxTable, - array('category_id', 'product_id', 'position', 'is_parent', 'store_id', 'visibility'), - false - ); - - $idxAdapter->query($query, array('store_id' => $storeId, 'category_id' => $rootId)); + $this->clearTemporaryIndexTable(); + $idxAdapter->delete($enabledTable); + $idxAdapter->delete($anchorTable); + $idxAdapter->delete($anchorProductsTable); + $this->commit(); + } catch (Exception $e) { + $this->rollBack(); + throw $e; } - - $this->syncData(); - - /** - * Clean up temporary tables - */ - $this->clearTemporaryIndexTable(); - $idxAdapter->delete($enabledTable); - $idxAdapter->delete($anchorTable); - $idxAdapter->delete($anchorProductsTable); return $this; } diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Abstract.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Abstract.php index 111cf69723..e42f750385 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Abstract.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Abstract.php @@ -32,7 +32,7 @@ * @package Mage_Catalog * @author Magento Core Team */ -class Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Indexer_Abstract +abstract class Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Indexer_Abstract extends Mage_Catalog_Model_Resource_Product_Indexer_Abstract { } diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Eav/Abstract.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Eav/Abstract.php index e3853c0e9b..268c6b6861 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Eav/Abstract.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Eav/Abstract.php @@ -32,7 +32,7 @@ * @package Mage_Catalog * @author Magento Core Team */ -class Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Indexer_Eav_Abstract +abstract class Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Indexer_Eav_Abstract extends Mage_Catalog_Model_Resource_Product_Indexer_Eav_Abstract { } diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price/Interface.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price/Interface.php index 304605a2f5..458f3cbada 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price/Interface.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price/Interface.php @@ -32,7 +32,7 @@ * @package Mage_Catalog * @author Magento Core Team */ -class Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Indexer_Price_Interface +interface Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Indexer_Price_Interface extends Mage_Catalog_Model_Resource_Product_Indexer_Price_Interface { } diff --git a/app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Price.php b/app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Price.php index 3842effaec..a964c2af26 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Price.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Price.php @@ -164,20 +164,18 @@ public function getCount($filter, $range) 'range' => $rangeExpr, 'count' => $countExpr )); - $select->group($rangeExpr); + $select->group($rangeExpr)->order("$rangeExpr ASC"); return $connection->fetchPairs($select); } /** - * Apply attribute filter to product collection + * Prepare filter apply * * @param Mage_Catalog_Model_Layer_Filter_Price $filter - * @param int $range - * @param int $index the range factor - * @return Mage_Catalog_Model_Resource_Layer_Filter_Price + * @return array */ - public function applyFilterToCollection($filter, $range, $index) + protected function _prepareApply($filter) { $collection = $filter->getLayer()->getProductCollection(); $collection->addPriceData($filter->getCustomerGroupId(), $filter->getWebsiteId()); @@ -188,12 +186,89 @@ public function applyFilterToCollection($filter, $range, $index) $table = $this->_getIndexTableAlias(); $additional = join('', $response->getAdditionalCalculations()); $rate = $filter->getCurrencyRate(); - $priceExpr = new Zend_Db_Expr("(({$table}.min_price {$additional}) * {$rate})"); + $priceExpr = new Zend_Db_Expr("ROUND(({$table}.min_price {$additional}) * {$rate}, 2)"); + + return array($select, $priceExpr); + } + /** + * Apply attribute filter to product collection + * + * @param Mage_Catalog_Model_Layer_Filter_Price $filter + * @param int $range + * @param int $index the range factor + * @return Mage_Catalog_Model_Resource_Layer_Filter_Price + */ + public function applyFilterToCollection($filter, $range, $index) + { + list($select, $priceExpr) = $this->_prepareApply($filter); $select ->where($priceExpr . ' >= ?', ($range * ($index - 1))) ->where($priceExpr . ' < ?', ($range * $index)); return $this; } + + /** + * Load all product prices to algorithm model + * + * @param Mage_Catalog_Model_Layer_Filter_Price_Algorithm $algorithm + * @param Mage_Catalog_Model_Layer_Filter_Price $filter + * @return array + */ + public function loadAllPrices($algorithm, $filter) + { + $select = $this->_getSelect($filter); + $connection = $this->_getReadAdapter(); + $response = $this->_dispatchPreparePriceEvent($filter, $select); + + $table = $this->_getIndexTableAlias(); + + $additional = join('', $response->getAdditionalCalculations()); + $maxPriceExpr = new Zend_Db_Expr( + "ROUND(({$table}.min_price {$additional}) * " . $connection->quote($filter->getCurrencyRate()) . ", 2)" + ); + + $select->columns(array($maxPriceExpr)); + + $prices = $connection->fetchCol($select); + $algorithm->setPrices($prices); + + return $prices; + } + + /** + * Apply price range filter to product collection + * + * @param Mage_Catalog_Model_Layer_Filter_Price $filter + * @return Mage_Catalog_Model_Resource_Layer_Filter_Price + */ + public function applyPriceRange($filter) + { + $interval = $filter->getInterval(); + if (!$interval) { + return $this; + } + + list($from, $to) = $interval; + if ($from === '' && $to === '') { + return $this; + } + + list($select, $priceExpr) = $this->_prepareApply($filter); + + if ($from == $to && !empty($to)) { + $select->where($priceExpr . ' = ?', $from); + } else { + if ($from !== '') { + $select->where($priceExpr . ' >= ?', $from); + } + if ($to !== '') { + $select->where($priceExpr . ' < ?', $to); + } + } + + return $this; + + } } diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Groupprice.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Groupprice.php new file mode 100644 index 0000000000..06a2c3f593 --- /dev/null +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Groupprice.php @@ -0,0 +1,46 @@ + + */ +class Mage_Catalog_Model_Resource_Product_Attribute_Backend_Groupprice + extends Mage_Catalog_Model_Resource_Product_Attribute_Backend_Groupprice_Abstract +{ + /** + * Initialize connection and define main table + * + */ + protected function _construct() + { + $this->_init('catalog/product_attribute_group_price', 'value_id'); + } +} diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Groupprice/Abstract.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Groupprice/Abstract.php new file mode 100644 index 0000000000..3498c02774 --- /dev/null +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Groupprice/Abstract.php @@ -0,0 +1,147 @@ + + */ +abstract class Mage_Catalog_Model_Resource_Product_Attribute_Backend_Groupprice_Abstract + extends Mage_Core_Model_Resource_Db_Abstract +{ + /** + * Load Tier Prices for product + * + * @param int $productId + * @param int $websiteId + * @return Mage_Catalog_Model_Resource_Product_Attribute_Backend_Tierprice + */ + public function loadPriceData($productId, $websiteId = null) + { + $adapter = $this->_getReadAdapter(); + + $columns = array( + 'price_id' => $this->getIdFieldName(), + 'website_id' => 'website_id', + 'all_groups' => 'all_groups', + 'cust_group' => 'customer_group_id', + 'price' => 'value', + ); + + $columns = $this->_loadPriceDataColumns($columns); + + $select = $adapter->select() + ->from($this->getMainTable(), $columns) + ->where('entity_id=?', $productId); + + $this->_loadPriceDataSelect($select); + + if (!is_null($websiteId)) { + if ($websiteId == '0') { + $select->where('website_id = ?', $websiteId); + } else { + $select->where('website_id IN(?)', array(0, $websiteId)); + } + } + + return $adapter->fetchAll($select); + } + + /** + * Load specific sql columns + * + * @param array $columns + * @return array + */ + protected function _loadPriceDataColumns($columns) + { + return $columns; + } + + /** + * Load specific db-select data + * + * @param Varien_Db_Select $select + * @return Varien_Db_Select + */ + protected function _loadPriceDataSelect($select) + { + return $select; + } + + /** + * Delete Tier Prices for product + * + * @param int $productId + * @param int $websiteId + * @param int $priceId + * @return int The number of affected rows + */ + public function deletePriceData($productId, $websiteId = null, $priceId = null) + { + $adapter = $this->_getWriteAdapter(); + + $conds = array( + $adapter->quoteInto('entity_id = ?', $productId) + ); + + if (!is_null($websiteId)) { + $conds[] = $adapter->quoteInto('website_id = ?', $websiteId); + } + + if (!is_null($priceId)) { + $conds[] = $adapter->quoteInto($this->getIdFieldName() . ' = ?', $priceId); + } + + $where = implode(' AND ', $conds); + + return $adapter->delete($this->getMainTable(), $where); + } + + /** + * Save tier price object + * + * @param Varien_Object $priceObject + * @return Mage_Catalog_Model_Resource_Product_Attribute_Backend_Tierprice + */ + public function savePriceData(Varien_Object $priceObject) + { + $adapter = $this->_getWriteAdapter(); + $data = $this->_prepareDataForTable($priceObject, $this->getMainTable()); + + if (!empty($data[$this->getIdFieldName()])) { + $where = $adapter->quoteInto($this->getIdFieldName() . ' = ?', $data[$this->getIdFieldName()]); + unset($data[$this->getIdFieldName()]); + $adapter->update($this->getMainTable(), $data, $where); + } else { + $adapter->insert($this->getMainTable(), $data); + } + return $this; + } +} diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Tierprice.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Tierprice.php index 023668a3c5..b86300c7d7 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Tierprice.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Tierprice.php @@ -32,7 +32,8 @@ * @package Mage_Catalog * @author Magento Core Team */ -class Mage_Catalog_Model_Resource_Product_Attribute_Backend_Tierprice extends Mage_Core_Model_Resource_Db_Abstract +class Mage_Catalog_Model_Resource_Product_Attribute_Backend_Tierprice + extends Mage_Catalog_Model_Resource_Product_Attribute_Backend_Groupprice_Abstract { /** * Initialize connection and define main table @@ -44,89 +45,28 @@ protected function _construct() } /** - * Load Tier Prices for product + * Add qty column * - * @param int $productId - * @param int $websiteId - * @return Mage_Catalog_Model_Resource_Product_Attribute_Backend_Tierprice - */ - public function loadPriceData($productId, $websiteId = null) - { - $adapter = $this->_getReadAdapter(); - - $columns = array( - 'price_id' => $this->getIdFieldName(), - 'website_id' => 'website_id', - 'all_groups' => 'all_groups', - 'cust_group' => 'customer_group_id', - 'price_qty' => 'qty', - 'price' => 'value', - ); - - $select = $adapter->select() - ->from($this->getMainTable(), $columns) - ->where('entity_id=?', $productId) - ->order('qty'); - - if (!is_null($websiteId)) { - if ($websiteId == '0') { - $select->where('website_id = ?', $websiteId); - } else { - $select->where('website_id IN(?)', array(0, $websiteId)); - } - } - - return $adapter->fetchAll($select); - } - - /** - * Delete Tier Prices for product - * - * @param int $productId - * @param int $websiteId - * @param int $priceId - * @return int The number of affected rows + * @param array $columns + * @return array */ - public function deletePriceData($productId, $websiteId = null, $priceId = null) + protected function _loadPriceDataColumns($columns) { - $adapter = $this->_getWriteAdapter(); - - $conds = array( - $adapter->quoteInto('entity_id = ?', $productId) - ); - - if (!is_null($websiteId)) { - $conds[] = $adapter->quoteInto('website_id = ?', $websiteId); - } - - if (!is_null($priceId)) { - $conds[] = $adapter->quoteInto($this->getIdFieldName() . ' = ?', $priceId); - } - - $where = implode(' AND ', $conds); - - return $adapter->delete($this->getMainTable(), $where); + $columns = parent::_loadPriceDataColumns($columns); + $columns['price_qty'] = 'qty'; + return $columns; } /** - * Save tier price object + * Order by qty * - * @param Varien_Object $priceObject - * @return Mage_Catalog_Model_Resource_Product_Attribute_Backend_Tierprice + * @param Varien_Db_Select $select + * @return Varien_Db_Select */ - public function savePriceData(Varien_Object $priceObject) + protected function _loadPriceDataSelect($select) { - $adapter = $this->_getWriteAdapter(); - $data = $this->_prepareDataForTable($priceObject, $this->getMainTable()); - - if (!empty($data[$this->getIdFieldName()])) { - $where = $adapter->quoteInto($this->getIdFieldName() . ' = ?', $data[$this->getIdFieldName()]); - unset($data[$this->getIdFieldName()]); - $adapter->update($this->getMainTable(), $data, $where); - } else { - $adapter->insert($this->getMainTable(), $data); - } - return $this; + $select->order('qty'); + return $select; } /** diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Collection.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Collection.php index cad040e4d2..9e83df6ba7 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Collection.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Collection.php @@ -173,11 +173,13 @@ public function addToIndexFilter($addRequiredCodes = false) 'additional_table.is_searchable = 1', 'additional_table.is_visible_in_advanced_search = 1', 'additional_table.is_filterable > 0', - 'additional_table.is_filterable_in_search = 1' + 'additional_table.is_filterable_in_search = 1', + 'used_for_sort_by = 1' ); if ($addRequiredCodes) { - $conditions[] = $this->getConnection()->quoteInto('main_table.attribute_code IN (?)', array('status', 'visibility')); + $conditions[] = $this->getConnection()->quoteInto('main_table.attribute_code IN (?)', + array('status', 'visibility')); } $this->getSelect()->where(sprintf('(%s)', implode(' OR ', $conditions))); diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Collection.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Collection.php index 81aa8a6bd9..df5ed002a2 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Collection.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Collection.php @@ -1332,7 +1332,7 @@ public function addAttributeToSort($attribute, $dir = self::SORT_ORDER_ASC) { if ($attribute == 'position') { if (isset($this->_joinFields[$attribute])) { - $this->getSelect()->order("{$attribute} {$dir}"); + $this->getSelect()->order($this->_getAttributeFieldName($attribute) . ' ' . $dir); return $this; } if ($this->isEnabledFlat()) { @@ -1685,6 +1685,10 @@ protected function _applyZeroStoreProductLimitations() array('cat_index_position' => 'position') ); } + $this->_joinFields['position'] = array( + 'table' => 'cat_pro', + 'field' => 'position', + ); return $this; } diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Flat/Indexer.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Flat/Indexer.php index 5842734835..c09d5d48dc 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Flat/Indexer.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Flat/Indexer.php @@ -32,7 +32,7 @@ * @package Mage_Catalog * @author Magento Core Team */ -class Mage_Catalog_Model_Resource_Product_Flat_Indexer extends Mage_Core_Model_Resource_Db_Abstract +class Mage_Catalog_Model_Resource_Product_Flat_Indexer extends Mage_Index_Model_Resource_Abstract { const XML_NODE_MAX_INDEX_COUNT = 'global/catalog/product/flat/max_index_count'; const XML_NODE_ATTRIBUTE_NODES = 'global/catalog/product/flat/attribute_nodes'; @@ -93,6 +93,13 @@ class Mage_Catalog_Model_Resource_Product_Flat_Indexer extends Mage_Core_Model_R */ protected $_existsFlatTables = array(); + /** + * Flat tables which were prepared + * + * @var array + */ + protected $_preparedFlatTables = array(); + /** * Initialize connection * @@ -608,6 +615,9 @@ public function getFkName($priTableName, $priColumnName, $refTableName, $refColu */ public function prepareFlatTable($storeId) { + if (isset($this->_preparedFlatTables[$storeId])) { + return $this; + } $adapter = $this->_getWriteAdapter(); $tableName = $this->getFlatTableName($storeId); @@ -743,7 +753,7 @@ public function prepareFlatTable($storeId) $adapter->dropForeignKey($tableName, $foreignChildKey); } if ($isAddChildData && !isset($describe['is_child'])) { - $adapter->truncateTable($tableName); + $adapter->delete($tableName); $dropIndexes['PRIMARY'] = $indexesNow['PRIMARY']; $addIndexes['PRIMARY'] = $indexesNeed['PRIMARY']; @@ -807,6 +817,8 @@ public function prepareFlatTable($storeId) } } + $this->_preparedFlatTables[$storeId] = true; + return $this; } @@ -1366,4 +1378,28 @@ protected function _arrayNextKey(array $array, $key) } return false; } + + /** + * Transactional rebuild Catalog Product Flat Data + * + * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer + */ + public function reindexAll() + { + foreach (Mage::app()->getStores() as $storeId => $store) { + $this->prepareFlatTable($storeId); + $this->beginTransaction(); + try { + $this->rebuild($store); + $this->commit(); + } catch (Exception $e) { + $this->rollBack(); + throw $e; + } + } + $flag = $this->getFlatHelper()->getFlag(); + $flag->setIsBuild(true)->save(); + + return $this; + } } diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav/Abstract.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav/Abstract.php index 63ec5f66a4..aeb9ad7dd1 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav/Abstract.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav/Abstract.php @@ -44,12 +44,19 @@ abstract class Mage_Catalog_Model_Resource_Product_Indexer_Eav_Abstract public function reindexAll() { $this->useIdxTable(true); - $this->clearTemporaryIndexTable(); - $this->_prepareIndex(); - $this->_prepareRelationIndex(); - $this->_removeNotVisibleEntityFromIndex(); + $this->beginTransaction(); + try { + $this->clearTemporaryIndexTable(); + $this->_prepareIndex(); + $this->_prepareRelationIndex(); + $this->_removeNotVisibleEntityFromIndex(); - $this->syncData(); + $this->syncData(); + $this->commit(); + } catch (Exception $e) { + $this->rollBack(); + throw $e; + } return $this; } @@ -153,7 +160,13 @@ protected function _removeNotVisibleEntityFromIndex() ->from($idxTable, null); $condition = $write->quoteInto('=?',Mage_Catalog_Model_Product_Visibility::VISIBILITY_NOT_VISIBLE); - $this->_addAttributeToSelect($select, 'visibility', $idxTable . '.entity_id', $idxTable . '.store_id', $condition); + $this->_addAttributeToSelect( + $select, + 'visibility', + $idxTable . '.entity_id', + $idxTable . '.store_id', + $condition + ); $query = $select->deleteFromSelect($idxTable); $write->query($query); diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price.php index 099a1a1393..101a364745 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price.php @@ -120,7 +120,7 @@ public function catalogProductDelete(Mage_Index_Model_Event $event) protected function _copyIndexDataToMainTable($processIds) { $write = $this->_getWriteAdapter(); - $write->beginTransaction(); + $this->beginTransaction(); try { // remove old index $where = $write->quoteInto('entity_id IN(?)', $processIds); @@ -172,6 +172,7 @@ public function catalogProductSave(Mage_Index_Model_Event $event) if ($indexer->getIsComposite()) { $this->_copyRelationIndexData($productId); $this->_prepareTierPriceIndex($productId); + $this->_prepareGroupPriceIndex($productId); $indexer->reindexEntity($productId); } else { $parentIds = $this->getProductParentsByChild($productId); @@ -180,6 +181,7 @@ public function catalogProductSave(Mage_Index_Model_Event $event) $processIds = array_merge($processIds, array_keys($parentIds)); $this->_copyRelationIndexData(array_keys($parentIds), $productId); $this->_prepareTierPriceIndex($processIds); + $this->_prepareGroupPriceIndex($processIds); $indexer->reindexEntity($productId); $parentByType = array(); @@ -192,6 +194,7 @@ public function catalogProductSave(Mage_Index_Model_Event $event) } } else { $this->_prepareTierPriceIndex($productId); + $this->_prepareGroupPriceIndex($productId); $indexer->reindexEntity($productId); } } @@ -369,23 +372,25 @@ public function getTypeIndexers() public function reindexAll() { $this->useIdxTable(true); - $this->clearTemporaryIndexTable(); - $this->_prepareWebsiteDateTable(); - $this->_prepareTierPriceIndex(); - - $indexers = $this->getTypeIndexers(); - foreach ($indexers as $indexer) { - /** @var $indexer Mage_Catalog_Model_Resource_Product_Indexer_Price_Interface */ - if (!$this->_allowTableChanges && is_callable(array($indexer, 'setAllowTableChanges'))) { - $indexer->setAllowTableChanges(false); - } - $indexer->reindexAll(); - if (!$this->_allowTableChanges && is_callable(array($indexer, 'setAllowTableChanges'))) { - $indexer->setAllowTableChanges(true); + $this->beginTransaction(); + try { + $this->clearTemporaryIndexTable(); + $this->_prepareWebsiteDateTable(); + $this->_prepareTierPriceIndex(); + $this->_prepareGroupPriceIndex(); + + $indexers = $this->getTypeIndexers(); + foreach ($indexers as $indexer) { + /** @var $indexer Mage_Catalog_Model_Resource_Product_Indexer_Price_Interface */ + $indexer->reindexAll(); } - } - $this->syncData(); + $this->syncData(); + $this->commit(); + } catch (Exception $e) { + $this->rollBack(); + throw $e; + } return $this; } @@ -399,6 +404,16 @@ protected function _getTierPriceIndexTable() return $this->getTable('catalog/product_index_tier_price'); } + /** + * Retrieve table name for product group price index + * + * @return string + */ + protected function _getGroupPriceIndexTable() + { + return $this->getTable('catalog/product_index_group_price'); + } + /** * Prepare tier price index table * @@ -442,6 +457,49 @@ protected function _prepareTierPriceIndex($entityIds = null) return $this; } + /** + * Prepare group price index table + * + * @param int|array $entityIds the entity ids limitation + * @return Mage_Catalog_Model_Resource_Product_Indexer_Price + */ + protected function _prepareGroupPriceIndex($entityIds = null) + { + $write = $this->_getWriteAdapter(); + $table = $this->_getGroupPriceIndexTable(); + $write->delete($table); + + $websiteExpression = $write->getCheckSql('gp.website_id = 0', 'ROUND(gp.value * cwd.rate, 4)', 'gp.value'); + $select = $write->select() + ->from( + array('gp' => $this->getValueTable('catalog/product', 'group_price')), + array('entity_id')) + ->join( + array('cg' => $this->getTable('customer/customer_group')), + 'gp.all_groups = 1 OR (gp.all_groups = 0 AND gp.customer_group_id = cg.customer_group_id)', + array('customer_group_id')) + ->join( + array('cw' => $this->getTable('core/website')), + 'gp.website_id = 0 OR gp.website_id = cw.website_id', + array('website_id')) + ->join( + array('cwd' => $this->_getWebsiteDateTable()), + 'cw.website_id = cwd.website_id', + array()) + ->where('cw.website_id != 0') + ->columns(new Zend_Db_Expr("MIN({$websiteExpression})")) + ->group(array('gp.entity_id', 'cg.customer_group_id', 'cw.website_id')); + + if (!empty($entityIds)) { + $select->where('gp.entity_id IN(?)', $entityIds); + } + + $query = $select->insertFromSelect($table); + $write->query($query); + + return $this; + } + /** * Copy relations product index from primary index to temporary index table by parent entity * diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Configurable.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Configurable.php index b3f8208617..964b149865 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Configurable.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Configurable.php @@ -43,11 +43,17 @@ class Mage_Catalog_Model_Resource_Product_Indexer_Price_Configurable public function reindexAll() { $this->useIdxTable(true); - $this->_prepareFinalPriceData(); - $this->_applyCustomOption(); - $this->_applyConfigurableOption(); - $this->_movePriceDataToIndexTable(); - + $this->beginTransaction(); + try { + $this->_prepareFinalPriceData(); + $this->_applyCustomOption(); + $this->_applyConfigurableOption(); + $this->_movePriceDataToIndexTable(); + $this->commit(); + } catch (Exception $e) { + $this->rollBack(); + throw $e; + } return $this; } @@ -164,20 +170,26 @@ protected function _applyConfigurableOption() ->group(array('l.parent_id', 'i.customer_group_id', 'i.website_id', 'l.product_id')); $priceExpression = $write->getCheckSql('apw.value_id IS NOT NULL', 'apw.pricing_value', 'apd.pricing_value'); - $percenExpr = $write->getCheckSql('apw.value_id IS NOT NULL', 'apw.is_percent', 'apd.is_percent'); + $percentExpr = $write->getCheckSql('apw.value_id IS NOT NULL', 'apw.is_percent', 'apd.is_percent'); $roundExpr = "ROUND(i.price * ({$priceExpression} / 100), 4)"; - $roundPriceExpr = $write->getCheckSql("{$percenExpr} = 1", $roundExpr, $priceExpression); + $roundPriceExpr = $write->getCheckSql("{$percentExpr} = 1", $roundExpr, $priceExpression); $priceColumn = $write->getCheckSql("{$priceExpression} IS NULL", '0', $roundPriceExpr); $priceColumn = new Zend_Db_Expr("SUM({$priceColumn})"); $tierPrice = $priceExpression; - $tierRoundPriceExp = $write->getCheckSql("{$percenExpr} = 1", $roundExpr, $tierPrice); + $tierRoundPriceExp = $write->getCheckSql("{$percentExpr} = 1", $roundExpr, $tierPrice); $tierPriceExp = $write->getCheckSql("{$tierPrice} IS NULL", '0', $tierRoundPriceExp); $tierPriceColumn = $write->getCheckSql("MIN(i.tier_price) IS NOT NULL", "SUM({$tierPriceExp})", 'NULL'); + $groupPrice = $priceExpression; + $groupRoundPriceExp = $write->getCheckSql("{$percentExpr} = 1", $roundExpr, $groupPrice); + $groupPriceExp = $write->getCheckSql("{$groupPrice} IS NULL", '0', $groupRoundPriceExp); + $groupPriceColumn = $write->getCheckSql("MIN(i.group_price) IS NOT NULL", "SUM({$groupPriceExp})", 'NULL'); + $select->columns(array( - 'price' => $priceColumn, - 'tier_price' => $tierPriceColumn + 'price' => $priceColumn, + 'tier_price' => $tierPriceColumn, + 'group_price' => $groupPriceColumn, )); $query = $select->insertFromSelect($coaTable); @@ -186,7 +198,10 @@ protected function _applyConfigurableOption() $select = $write->select() ->from( array($coaTable), - array('parent_id', 'customer_group_id', 'website_id', 'MIN(price)', 'MAX(price)', 'MIN(tier_price)')) + array( + 'parent_id', 'customer_group_id', 'website_id', + 'MIN(price)', 'MAX(price)', 'MIN(tier_price)', 'MIN(group_price)' + )) ->group(array('parent_id', 'customer_group_id', 'website_id')); $query = $select->insertFromSelect($copTable); @@ -200,21 +215,20 @@ protected function _applyConfigurableOption() .' AND i.website_id = io.website_id', array()); $select->columns(array( - 'min_price' => new Zend_Db_Expr('i.min_price + io.min_price'), - 'max_price' => new Zend_Db_Expr('i.max_price + io.max_price'), - 'tier_price' => $write->getCheckSql('i.tier_price IS NOT NULL', 'i.tier_price + io.tier_price', 'NULL'), + 'min_price' => new Zend_Db_Expr('i.min_price + io.min_price'), + 'max_price' => new Zend_Db_Expr('i.max_price + io.max_price'), + 'tier_price' => $write->getCheckSql('i.tier_price IS NOT NULL', 'i.tier_price + io.tier_price', 'NULL'), + 'group_price' => $write->getCheckSql( + 'i.group_price IS NOT NULL', + 'i.group_price + io.group_price', 'NULL' + ), )); $query = $select->crossUpdateFromSelect($table); $write->query($query); - if ($this->useIdxTable() && $this->_allowTableChanges) { - $write->truncateTable($coaTable); - $write->truncateTable($copTable); - } else { - $write->delete($coaTable); - $write->delete($copTable); - } + $write->delete($coaTable); + $write->delete($copTable); return $this; } diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Default.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Default.php index 542b0fa6b8..2684566b53 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Default.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Default.php @@ -115,9 +115,16 @@ public function getIsComposite() public function reindexAll() { $this->useIdxTable(true); - $this->_prepareFinalPriceData(); - $this->_applyCustomOption(); - $this->_movePriceDataToIndexTable(); + $this->beginTransaction(); + try { + $this->_prepareFinalPriceData(); + $this->_applyCustomOption(); + $this->_movePriceDataToIndexTable(); + $this->commit(); + } catch (Exception $e) { + $this->rollBack(); + throw $e; + } return $this; } @@ -216,6 +223,11 @@ protected function _prepareFinalPriceData($entityIds = null) 'tp.entity_id = e.entity_id AND tp.website_id = cw.website_id' . ' AND tp.customer_group_id = cg.customer_group_id', array()) + ->joinLeft( + array('gp' => $this->_getGroupPriceIndexTable()), + 'gp.entity_id = e.entity_id AND gp.website_id = cw.website_id' + . ' AND gp.customer_group_id = cg.customer_group_id', + array()) ->where('e.type_id = ?', $this->getTypeId()); // add enable products limitation @@ -233,6 +245,7 @@ protected function _prepareFinalPriceData($entityIds = null) $specialFrom = $this->_addAttributeToSelect($select, 'special_from_date', 'e.entity_id', 'cs.store_id'); $specialTo = $this->_addAttributeToSelect($select, 'special_to_date', 'e.entity_id', 'cs.store_id'); $currentDate = $write->getDatePartSql('cwd.website_date'); + $groupPrice = $write->getCheckSql('gp.price IS NULL', "{$price}", 'gp.price'); $specialFromDate = $write->getDatePartSql($specialFrom); $specialToDate = $write->getDatePartSql($specialTo); @@ -243,14 +256,17 @@ protected function _prepareFinalPriceData($entityIds = null) $specialToHas = $write->getCheckSql("{$specialTo} IS NULL", '1', "{$specialToUse}"); $finalPrice = $write->getCheckSql("{$specialFromHas} > 0 AND {$specialToHas} > 0" . " AND {$specialPrice} < {$price}", $specialPrice, $price); + $finalPrice = $write->getCheckSql("{$groupPrice} < {$finalPrice}", $groupPrice, $finalPrice); $select->columns(array( - 'orig_price' => $price, - 'price' => $finalPrice, - 'min_price' => $finalPrice, - 'max_price' => $finalPrice, - 'tier_price' => new Zend_Db_Expr('tp.min_price'), - 'base_tier' => new Zend_Db_Expr('tp.min_price'), + 'orig_price' => $price, + 'price' => $finalPrice, + 'min_price' => $finalPrice, + 'max_price' => $finalPrice, + 'tier_price' => new Zend_Db_Expr('tp.min_price'), + 'base_tier' => new Zend_Db_Expr('tp.min_price'), + 'group_price' => new Zend_Db_Expr('gp.price'), + 'base_group_price' => new Zend_Db_Expr('gp.price'), )); if (!is_null($entityIds)) { @@ -300,7 +316,7 @@ protected function _getCustomOptionAggregateTable() if ($this->useIdxTable()) { return $this->getTable('catalog/product_price_indexer_option_aggregate_idx'); } - return $this->getTable('catalog/product_price_indexer_option_aggregate_idx'); + return $this->getTable('catalog/product_price_indexer_option_aggregate_tmp'); } /** @@ -399,16 +415,22 @@ protected function _applyCustomOption() $tierPriceValue = $write->getCheckSql("MIN(o.is_require) > 0", $tierPriceMin, 0); $tierPrice = $write->getCheckSql("MIN(i.base_tier) IS NOT NULL", $tierPriceValue, "NULL"); + $groupPriceRound = new Zend_Db_Expr("ROUND(i.base_group_price * ({$optPriceValue} / 100), 4)"); + $groupPriceExpr = $write->getCheckSql("{$optPriceType} = 'fixed'", $optPriceValue, $groupPriceRound); + $groupPriceMin = new Zend_Db_Expr("MIN($groupPriceExpr)"); + $groupPriceValue = $write->getCheckSql("MIN(o.is_require) > 0", $groupPriceMin, 0); + $groupPrice = $write->getCheckSql("MIN(i.base_group_price) IS NOT NULL", $groupPriceValue, "NULL"); + $maxPriceRound = new Zend_Db_Expr("ROUND(i.price * ({$optPriceValue} / 100), 4)"); $maxPriceExpr = $write->getCheckSql("{$optPriceType} = 'fixed'", $optPriceValue, $maxPriceRound); - //$tierPriceMin = new Zend_Db_Expr("MIN($tierPriceExpr)"); $maxPrice = $write->getCheckSql("(MIN(o.type)='radio' OR MIN(o.type)='drop_down')", "MAX($maxPriceExpr)", "SUM($maxPriceExpr)"); $select->columns(array( - 'min_price' => $minPrice, - 'max_price' => $maxPrice, - 'tier_price' => $tierPrice + 'min_price' => $minPrice, + 'max_price' => $maxPrice, + 'tier_price' => $tierPrice, + 'group_price' => $groupPrice, )); $query = $select->insertFromSelect($coaTable); @@ -457,10 +479,16 @@ protected function _applyCustomOption() $tierPriceValue = $write->getCheckSql("{$tierPriceExpr} > 0 AND o.is_require > 0", $tierPriceExpr, 0); $tierPrice = $write->getCheckSql("i.base_tier IS NOT NULL", $tierPriceValue, "NULL"); + $groupPriceRound = new Zend_Db_Expr("ROUND(i.base_group_price * ({$optPriceValue} / 100), 4)"); + $groupPriceExpr = $write->getCheckSql("{$optPriceType} = 'fixed'", $optPriceValue, $groupPriceRound); + $groupPriceValue = $write->getCheckSql("{$groupPriceExpr} > 0 AND o.is_require > 0", $groupPriceExpr, 0); + $groupPrice = $write->getCheckSql("i.base_group_price IS NOT NULL", $groupPriceValue, "NULL"); + $select->columns(array( - 'min_price' => $minPrice, - 'max_price' => $maxPrice, - 'tier_price' => $tierPrice + 'min_price' => $minPrice, + 'max_price' => $maxPrice, + 'tier_price' => $tierPrice, + 'group_price' => $groupPrice, )); $query = $select->insertFromSelect($coaTable); @@ -476,6 +504,7 @@ protected function _applyCustomOption() 'min_price' => 'SUM(min_price)', 'max_price' => 'SUM(max_price)', 'tier_price' => 'SUM(tier_price)', + 'group_price' => 'SUM(group_price)', )) ->group(array('entity_id', 'customer_group_id', 'website_id')); $query = $select->insertFromSelect($copTable); @@ -489,20 +518,19 @@ protected function _applyCustomOption() .' AND i.website_id = io.website_id', array()); $select->columns(array( - 'min_price' => new Zend_Db_Expr('i.min_price + io.min_price'), - 'max_price' => new Zend_Db_Expr('i.max_price + io.max_price'), - 'tier_price' => $write->getCheckSql('i.tier_price IS NOT NULL', 'i.tier_price + io.tier_price', 'NULL'), + 'min_price' => new Zend_Db_Expr('i.min_price + io.min_price'), + 'max_price' => new Zend_Db_Expr('i.max_price + io.max_price'), + 'tier_price' => $write->getCheckSql('i.tier_price IS NOT NULL', 'i.tier_price + io.tier_price', 'NULL'), + 'group_price' => $write->getCheckSql( + 'i.group_price IS NOT NULL', + 'i.group_price + io.group_price', 'NULL' + ), )); $query = $select->crossUpdateFromSelect($table); $write->query($query); - if ($this->useIdxTable() && $this->_allowTableChanges) { - $write->truncateTable($coaTable); - $write->truncateTable($copTable); - } else { - $write->delete($coaTable); - $write->delete($copTable); - } + $write->delete($coaTable); + $write->delete($copTable); return $this; } @@ -523,7 +551,8 @@ protected function _movePriceDataToIndexTable() 'final_price' => 'price', 'min_price' => 'min_price', 'max_price' => 'max_price', - 'tier_price' => 'tier_price' + 'tier_price' => 'tier_price', + 'group_price' => 'group_price', ); $write = $this->_getWriteAdapter(); @@ -534,11 +563,7 @@ protected function _movePriceDataToIndexTable() $query = $select->insertFromSelect($this->getIdxTable(), array(), false); $write->query($query); - if ($this->useIdxTable() && $this->_allowTableChanges) { - $write->truncateTable($table); - } else { - $write->delete($table); - } + $write->delete($table); return $this; } @@ -553,6 +578,16 @@ protected function _getTierPriceIndexTable() return $this->getTable('catalog/product_index_tier_price'); } + /** + * Retrieve table name for product group price index + * + * @return string + */ + protected function _getGroupPriceIndexTable() + { + return $this->getTable('catalog/product_index_group_price'); + } + /** * Register data required by product type process in event object * diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Grouped.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Grouped.php index 484947ec9a..a5f9754f81 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Grouped.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Grouped.php @@ -43,7 +43,14 @@ class Mage_Catalog_Model_Resource_Product_Indexer_Price_Grouped public function reindexAll() { $this->useIdxTable(true); - $this->_prepareGroupedProductPriceData(); + $this->beginTransaction(); + try { + $this->_prepareGroupedProductPriceData(); + $this->commit(); + } catch (Exception $e) { + $this->rollBack(); + throw $e; + } return $this; } @@ -96,12 +103,14 @@ protected function _prepareGroupedProductPriceData($entityIds = null) 'i.entity_id = l.linked_product_id AND i.website_id = cw.website_id' . ' AND i.customer_group_id = cg.customer_group_id', array( - 'tax_class_id'=> $this->_getReadAdapter()->getCheckSql('MIN(i.tax_class_id) IS NULL', '0', 'MIN(i.tax_class_id)'), - 'price' => new Zend_Db_Expr('NULL'), - 'final_price' => new Zend_Db_Expr('NULL'), - 'min_price' => new Zend_Db_Expr('MIN(' . $minCheckSql . ')'), - 'max_price' => new Zend_Db_Expr('MAX(' . $maxCheckSql . ')'), - 'tier_price' => new Zend_Db_Expr('NULL') + 'tax_class_id' => $this->_getReadAdapter() + ->getCheckSql('MIN(i.tax_class_id) IS NULL', '0', 'MIN(i.tax_class_id)'), + 'price' => new Zend_Db_Expr('NULL'), + 'final_price' => new Zend_Db_Expr('NULL'), + 'min_price' => new Zend_Db_Expr('MIN(' . $minCheckSql . ')'), + 'max_price' => new Zend_Db_Expr('MAX(' . $maxCheckSql . ')'), + 'tier_price' => new Zend_Db_Expr('NULL'), + 'group_price' => new Zend_Db_Expr('NULL'), )) ->group(array('e.entity_id', 'cg.customer_group_id', 'cw.website_id')) ->where('e.type_id=?', $this->getTypeId()); diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Option.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Option.php index 1d1fc3e160..8d39f643e4 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Option.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Option.php @@ -440,19 +440,19 @@ public function getSearchableData($productId, $storeId) $defaultOptionJoin = implode( ' AND ', - array('option_title_default.option_id=option.option_id', + array('option_title_default.option_id=product_option.option_id', $adapter->quoteInto('option_title_default.store_id = ?', Mage_Catalog_Model_Abstract::DEFAULT_STORE_ID)) ); $storeOptionJoin = implode( ' AND ', array( - 'option_title_store.option_id=option.option_id', + 'option_title_store.option_id=product_option.option_id', $adapter->quoteInto('option_title_store.store_id = ?', (int) $storeId)) ); $select = $adapter->select() - ->from(array('option' => $this->getMainTable()), null) + ->from(array('product_option' => $this->getMainTable()), null) ->join( array('option_title_default' => $this->getTable('catalog/product_option_title')), $defaultOptionJoin, @@ -463,7 +463,7 @@ public function getSearchableData($productId, $storeId) $storeOptionJoin, array('title' => $titleCheckSql) ) - ->where('option.product_id = ?', $productId); + ->where('product_option.product_id = ?', $productId); if ($titles = $adapter->fetchCol($select)) { $searchData = array_merge($searchData, $titles); @@ -484,10 +484,10 @@ public function getSearchableData($productId, $storeId) ); $select = $adapter->select() - ->from(array('option' => $this->getMainTable()), null) + ->from(array('product_option' => $this->getMainTable()), null) ->join( array('option_type' => $this->getTable('catalog/product_option_type_value')), - 'option_type.option_id=option.option_id', + 'option_type.option_id=product_option.option_id', array() ) ->join( @@ -500,7 +500,7 @@ public function getSearchableData($productId, $storeId) $storeOptionJoin, array('title' => $titleCheckSql) ) - ->where('option.product_id = ?', $productId); + ->where('product_option.product_id = ?', $productId); if ($titles = $adapter->fetchCol($select)) { $searchData = array_merge($searchData, $titles); diff --git a/app/code/core/Mage/Catalog/Model/Resource/Setup.php b/app/code/core/Mage/Catalog/Model/Resource/Setup.php index 450f8a2198..86938e6f6a 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Setup.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Setup.php @@ -484,7 +484,7 @@ public function getDefaultEntities() 'weight' => array( 'type' => 'decimal', 'label' => 'Weight', - 'input' => 'text', + 'input' => 'weight', 'sort_order' => 5, 'apply_to' => Mage_Catalog_Model_Product_Type::TYPE_SIMPLE, ), @@ -576,6 +576,17 @@ public function getDefaultEntities() 'sort_order' => 6, 'visible' => false, ), + 'group_price' => array( + 'type' => 'decimal', + 'label' => 'Group Price', + 'input' => 'text', + 'backend' => 'catalog/product_attribute_backend_groupprice', + 'required' => false, + 'sort_order' => 6, + 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_WEBSITE, + 'apply_to' => 'simple,configurable,virtual', + 'group' => 'Prices', + ), 'tier_price' => array( 'type' => 'decimal', 'label' => 'Tier Price', diff --git a/app/code/core/Mage/Catalog/Model/Resource/Url.php b/app/code/core/Mage/Catalog/Model/Resource/Url.php index 89dbe8e639..0e81fa03dc 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Url.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Url.php @@ -153,7 +153,7 @@ public function getRewriteByIdPath($idPath, $storeId) */ public function getRewriteByRequestPath($requestPath, $storeId) { - $adapter = $this->_getReadAdapter(); + $adapter = $this->_getWriteAdapter(); $select = $adapter->select() ->from($this->getMainTable()) ->where('store_id = :store_id') @@ -182,7 +182,7 @@ public function getRewriteByRequestPath($requestPath, $storeId) */ public function checkRequestPaths($paths, $storeId) { - $adapter = $this->_getReadAdapter(); + $adapter = $this->_getWriteAdapter(); $select = $adapter->select() ->from($this->getMainTable(), 'request_path') ->where('store_id = :store_id') @@ -1310,12 +1310,26 @@ public function findFinalTargetPath($requestPath, $storeId, &$_checkedPaths = ar */ public function deleteRewrite($requestPath, $storeId) { - $this->_getWriteAdapter()->delete( - $this->getMainTable(), - array( - 'store_id = ?' => $storeId, - 'request_path = ?' => $requestPath - ) + $this->deleteRewriteRecord($requestPath, $storeId); + } + + /** + * Delete rewrite path record from the database with RP checking. + * + * @param string $requestPath + * @param int $storeId + * @param bool $rp whether check rewrite option to be "Redirect = Permanent" + * @return void + */ + public function deleteRewriteRecord($requestPath, $storeId, $rp = false) + { + $conditions = array( + 'store_id = ?' => $storeId, + 'request_path = ?' => $requestPath, ); + if ($rp) { + $conditions['options = ?'] = 'RP'; + } + $this->_getWriteAdapter()->delete($this->getMainTable(), $conditions); } } diff --git a/app/code/core/Mage/Catalog/Model/Url.php b/app/code/core/Mage/Catalog/Model/Url.php index 179148716e..39cfc4b643 100644 --- a/app/code/core/Mage/Catalog/Model/Url.php +++ b/app/code/core/Mage/Catalog/Model/Url.php @@ -191,6 +191,7 @@ public function getProductModel() /** * Returns store root category, uses caching for it * + * @param int $storeId * @return Varien_Object */ public function getStoreRootCategory($storeId) { @@ -210,6 +211,7 @@ public function getStoreRootCategory($storeId) { * Setter for $_saveRewritesHistory * Force Rewrites History save bypass config settings * + * @param bool $flag * @return Mage_Catalog_Model_Url */ public function setShouldSaveRewritesHistory($flag) @@ -261,6 +263,7 @@ public function refreshRewrites($storeId = null) * * @param Varien_Object $category * @param string $parentPath + * @param bool $refreshProducts * @return Mage_Catalog_Model_Url */ protected function _refreshCategoryRewrites(Varien_Object $category, $parentPath = null, $refreshProducts = true) @@ -275,7 +278,7 @@ protected function _refreshCategoryRewrites(Varien_Object $category, $parentPath $idPath = $this->generatePath('id', null, $category); $targetPath = $this->generatePath('target', null, $category); - $requestPath = $this->generatePath('request', null, $category, $parentPath); + $requestPath = $this->getCategoryRequestPath($category, $parentPath); $rewriteData = array( 'store_id' => $category->getStoreId(), @@ -675,6 +678,74 @@ public function getCategoryUrlSuffix($storeId) return Mage::helper('catalog/category')->getCategoryUrlSuffix($storeId); } + /** + * Get unique category request path + * + * @param Varien_Object $category + * @param string $parentPath + * @return string + */ + public function getCategoryRequestPath($category, $parentPath) + { + $storeId = $category->getStoreId(); + $idPath = $this->generatePath('id', null, $category); + $suffix = $this->getCategoryUrlSuffix($storeId); + + if (isset($this->_rewrites[$idPath])) { + $this->_rewrite = $this->_rewrites[$idPath]; + $existingRequestPath = $this->_rewrites[$idPath]->getRequestPath(); + } + + if ($category->getUrlKey() == '') { + $urlKey = $this->getCategoryModel()->formatUrlKey($category->getName()); + } + else { + $urlKey = $this->getCategoryModel()->formatUrlKey($category->getUrlKey()); + } + + $categoryUrlSuffix = $this->getCategoryUrlSuffix($category->getStoreId()); + if (null === $parentPath) { + $parentPath = $this->getResource()->getCategoryParentPath($category); + } + elseif ($parentPath == '/') { + $parentPath = ''; + } + $parentPath = Mage::helper('catalog/category')->getCategoryUrlPath($parentPath, + true, $category->getStoreId()); + + $requestPath = $parentPath . $urlKey . $categoryUrlSuffix; + if (isset($existingRequestPath) && $existingRequestPath == $requestPath . $suffix) { + return $existingRequestPath; + } + + if ($this->_deleteOldTargetPath($requestPath, $idPath, $storeId)) { + return $requestPath; + } + + return $this->getUnusedPath($category->getStoreId(), $requestPath, + $this->generatePath('id', null, $category) + ); + } + + /** + * Check if current generated request path is one of the old paths + * + * @param string $requestPath + * @param string $idPath + * @param int $storeId + * @return bool + */ + protected function _deleteOldTargetPath($requestPath, $idPath, $storeId) + { + $finalOldTargetPath = $this->getResource()->findFinalTargetPath($requestPath, $storeId); + if ($finalOldTargetPath && $finalOldTargetPath == $idPath) { + $this->getResource()->deleteRewriteRecord($requestPath, $storeId, true); + return true; + } + + return false; + } + /** * Get unique product request path * @@ -716,29 +787,28 @@ public function getProductRequestPath($product, $category) if (isset($this->_rewrites[$idPath])) { $this->_rewrite = $this->_rewrites[$idPath]; $existingRequestPath = $this->_rewrites[$idPath]->getRequestPath(); - $existingRequestPath = str_replace($suffix, '', $existingRequestPath); - if ($existingRequestPath == $requestPath) { - return $requestPath.$suffix; + if ($existingRequestPath == $requestPath . $suffix) { + return $existingRequestPath; } + + $existingRequestPath = preg_replace('/' . preg_quote($suffix, '/') . '$/', '', $existingRequestPath); /** * Check if existing request past can be used */ if ($product->getUrlKey() == '' && !empty($requestPath) - && strpos($existingRequestPath, $requestPath) !== false + && strpos($existingRequestPath, $requestPath) === 0 ) { - $existingRequestPath = str_replace($requestPath, '', $existingRequestPath); + $existingRequestPath = preg_replace( + '/^' . preg_quote($requestPath, '/') . '/', '', $existingRequestPath + ); if (preg_match('#^-([0-9]+)$#i', $existingRequestPath)) { return $this->_rewrites[$idPath]->getRequestPath(); } } - /** - * check if current generated request path is one of the old paths - */ + $fullPath = $requestPath.$suffix; - $finalOldTargetPath = $this->getResource()->findFinalTargetPath($fullPath, $storeId); - if ($finalOldTargetPath && $finalOldTargetPath == $idPath) { - $this->getResource()->deleteRewrite($fullPath, $storeId); + if ($this->_deleteOldTargetPath($fullPath, $idPath, $storeId)) { return $fullPath; } } diff --git a/app/code/core/Mage/Catalog/data/catalog_setup/data-upgrade-1.6.0.0.4-1.6.0.0.5.php b/app/code/core/Mage/Catalog/data/catalog_setup/data-upgrade-1.6.0.0.4-1.6.0.0.5.php index 2c442be07f..9baaf4198c 100644 --- a/app/code/core/Mage/Catalog/data/catalog_setup/data-upgrade-1.6.0.0.4-1.6.0.0.5.php +++ b/app/code/core/Mage/Catalog/data/catalog_setup/data-upgrade-1.6.0.0.4-1.6.0.0.5.php @@ -34,26 +34,25 @@ foreach($multiSelectAttributeCodes as $attributeCode) { /** @var $attribute Mage_Catalog_Model_Resource_Eav_Attribute */ - if ($attribute = $installer->getAttribute('catalog_product', $attributeCode)) { + $attribute = $installer->getAttribute('catalog_product', $attributeCode); + if ($attribute) { $attributeTable = $installer->getAttributeTable('catalog_product', $attributeCode); $select = $installer->getConnection()->select() ->from(array('e' => $attributeTable)) - ->where("e.attribute_id=?", $attribute['attribute_id']); + ->where("e.attribute_id=?", $attribute['attribute_id']) + ->where('e.value LIKE "%,,%"'); + $result = $installer->getConnection()->fetchAll($select); - if ($result = $installer->getConnection()->fetchAll($select)) { + if ($result) { foreach ($result as $row) { - $value = explode(',', $row['value']); - if (is_array($value) && count($value) > 1) { - foreach ($value as $optionKey => $optionValue) { - if ($optionValue === '') { - unset($value[$optionKey]); - } + if (isset($row['value']) && !empty($row['value'])) { + // 1,2,,,3,5 --> 1,2,3,5 + $row['value'] = preg_replace('/,{2,}/', ',', $row['value'], -1, $replaceCnt); + + if ($replaceCnt) { + $installer->getConnection() + ->update($attributeTable, array('value' => $row['value']), "value_id=" . $row['value_id']); } - $value = implode(',', $value); - $installer->getConnection() - ->update($attributeTable, array('value'=>$value), "value_id=" . $row['value_id']); - } else { - unset($value); } } } diff --git a/app/code/core/Mage/Catalog/data/catalog_setup/data-upgrade-1.6.0.0.8-1.6.0.0.9.php b/app/code/core/Mage/Catalog/data/catalog_setup/data-upgrade-1.6.0.0.8-1.6.0.0.9.php new file mode 100644 index 0000000000..50802de0de --- /dev/null +++ b/app/code/core/Mage/Catalog/data/catalog_setup/data-upgrade-1.6.0.0.8-1.6.0.0.9.php @@ -0,0 +1,36 @@ +getAttribute('catalog_product', 'weight'); + +if ($attribute) { + $installer->updateAttribute($attribute['entity_type_id'], $attribute['attribute_id'], + 'frontend_input', $attribute['attribute_code']); +} diff --git a/app/code/core/Mage/Catalog/etc/config.xml b/app/code/core/Mage/Catalog/etc/config.xml index a14d2b2c02..d7cda0baa2 100644 --- a/app/code/core/Mage/Catalog/etc/config.xml +++ b/app/code/core/Mage/Catalog/etc/config.xml @@ -28,7 +28,7 @@ - 1.6.0.0.6 + 1.6.0.0.10 @@ -276,6 +276,9 @@ catalog_product_entity_tier_price
+ + catalog_product_entity_group_price
+
catalog_product_entity_media_gallery
@@ -324,6 +327,9 @@ catalog_product_index_tier_price
+ + catalog_product_index_group_price
+
catalog_product_index_website
@@ -767,6 +773,7 @@ auto 100 + 10 @@ -794,7 +801,7 @@ 0 2 * * * - catalog/product_indexer_price::reindexAll + catalog/observer::reindexProductPrices diff --git a/app/code/core/Mage/Catalog/etc/system.xml b/app/code/core/Mage/Catalog/etc/system.xml index 4cbacb4a7d..795301ec57 100644 --- a/app/code/core/Mage/Catalog/etc/system.xml +++ b/app/code/core/Mage/Catalog/etc/system.xml @@ -64,6 +64,7 @@ Comma-separated. text + validate-per-page-value-list 2 1 @@ -74,6 +75,7 @@ Must be in the allowed values list. text + validate-per-page-value 3 1 @@ -84,6 +86,7 @@ Comma-separated. text + validate-per-page-value-list 4 1 @@ -94,6 +97,7 @@ Must be in the allowed values list. text + validate-per-page-value 5 1 @@ -320,12 +324,24 @@ text + validate-number validate-number-range number-range-0.01-1000000000 2 1 1 1 manual + + + Maximum number of price intervals is 100 + text + validate-digits validate-digits-range digits-range-2-100 + 3 + 1 + 1 + 1 + manual + diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/install-1.6.0.0.php b/app/code/core/Mage/Catalog/sql/catalog_setup/install-1.6.0.0.php index bb63b86ec6..ab6cdbd098 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/install-1.6.0.0.php @@ -470,8 +470,8 @@ 'default' => '0', ), 'Position') ->addColumn('value', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array( - 'nullable' => false, - 'default' => '', + 'nullable' => true, + 'default' => null, ), 'Value') ->addIndex( $installer->getIdxName( @@ -1074,8 +1074,8 @@ 'primary' => true, ), 'Link Type ID') ->addColumn('code', Varien_Db_Ddl_Table::TYPE_TEXT, 32, array( - 'nullable' => false, - 'default' => '', + 'nullable' => true, + 'default' => null, ), 'Code') ->setComment('Catalog Product Link Type Table'); $installer->getConnection()->createTable($table); @@ -1152,12 +1152,12 @@ 'default' => '0', ), 'Link Type ID') ->addColumn('product_link_attribute_code', Varien_Db_Ddl_Table::TYPE_TEXT, 32, array( - 'nullable' => false, - 'default' => '', + 'nullable' => true, + 'default' => null, ), 'Product Link Attribute Code') ->addColumn('data_type', Varien_Db_Ddl_Table::TYPE_TEXT, 32, array( - 'nullable' => false, - 'default' => '', + 'nullable' => true, + 'default' => null, ), 'Data Type') ->addIndex($installer->getIdxName('catalog/product_link_attribute', array('link_type_id')), array('link_type_id')) @@ -1449,8 +1449,8 @@ 'default' => '0', ), 'Product Super Attribute ID') ->addColumn('value_index', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array( - 'nullable' => false, - 'default' => '', + 'nullable' => true, + 'default' => null, ), 'Value Index') ->addColumn('is_percent', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array( 'unsigned' => true, @@ -1720,8 +1720,8 @@ 'default' => '0', ), 'Product ID') ->addColumn('type', Varien_Db_Ddl_Table::TYPE_TEXT, 50, array( - 'nullable' => false, - 'default' => '', + 'nullable' => true, + 'default' => null, ), 'Type') ->addColumn('is_require', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array( 'nullable' => false, @@ -1836,8 +1836,8 @@ 'default' => '0', ), 'Store ID') ->addColumn('title', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array( - 'nullable' => false, - 'default' => '', + 'nullable' => true, + 'default' => null, ), 'Title') ->addIndex( $installer->getIdxName( @@ -1991,8 +1991,8 @@ 'default' => '0', ), 'Store ID') ->addColumn('title', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array( - 'nullable' => false, - 'default' => '', + 'nullable' => true, + 'default' => null, ), 'Title') ->addIndex( $installer->getIdxName( @@ -3093,8 +3093,8 @@ 'default' => '0', ), 'Category ID') ->addColumn('path', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array( - 'nullable' => false, - 'default' => '', + 'nullable' => true, + 'default' => null, ), 'Path') ->addIndex($installer->getIdxName('catalog/category_anchor_indexer_idx', array('category_id')), array('category_id')) @@ -3112,8 +3112,8 @@ 'default' => '0', ), 'Category ID') ->addColumn('path', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array( - 'nullable' => false, - 'default' => '', + 'nullable' => true, + 'default' => null, ), 'Path') ->addIndex($installer->getIdxName('catalog/category_anchor_indexer_tmp', array('category_id')), array('category_id')) diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.6.0.0.8-1.6.0.0.9.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.6.0.0.8-1.6.0.0.9.php new file mode 100644 index 0000000000..3a89478cb0 --- /dev/null +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.6.0.0.8-1.6.0.0.9.php @@ -0,0 +1,53 @@ +getConnection(); +$memoryTables = array( + 'catalog/category_anchor_indexer_tmp', + 'catalog/category_anchor_products_indexer_tmp', + 'catalog/category_product_enabled_indexer_tmp', + 'catalog/category_product_indexer_tmp', + 'catalog/product_eav_decimal_indexer_tmp', + 'catalog/product_eav_indexer_tmp', + 'catalog/product_price_indexer_cfg_option_aggregate_tmp', + 'catalog/product_price_indexer_cfg_option_tmp', + 'catalog/product_price_indexer_final_tmp', + 'catalog/product_price_indexer_option_aggregate_tmp', + 'catalog/product_price_indexer_option_tmp', + 'catalog/product_price_indexer_tmp', +); + +foreach ($memoryTables as $table) { + $connection->changeTableEngine($installer->getTable($table), Varien_Db_Adapter_Pdo_Mysql::ENGINE_MEMORY); +} diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.6-1.6.0.0.7.php b/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.6-1.6.0.0.7.php new file mode 100644 index 0000000000..9410d26110 --- /dev/null +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.6-1.6.0.0.7.php @@ -0,0 +1,39 @@ +getConnection()->addColumn( + $installer->getTable('catalog/category_anchor_products_indexer_tmp'), + 'position', + array( + 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, + 'unsigned' => true, + 'nullable' => true, + 'comment' => 'Position' + ) +); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.7-1.6.0.0.8.php b/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.7-1.6.0.0.8.php new file mode 100644 index 0000000000..0cb3b8af9f --- /dev/null +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.7-1.6.0.0.8.php @@ -0,0 +1,97 @@ +getConnection(); + +$connection->addIndex( + $installer->getTable('catalog/category_product_indexer_tmp'), + $installer->getIdxName('catalog/category_product_indexer_tmp', array('product_id', 'category_id', 'store_id')), + array('product_id', 'category_id', 'store_id') +); + +$table = $installer->getTable('catalog/category_product_enabled_indexer_idx'); +$connection->dropIndex($table, 'IDX_CATALOG_CATEGORY_PRODUCT_INDEX_ENBL_IDX_PRODUCT_ID'); +$connection->addIndex( + $table, + $installer->getIdxName('catalog/category_product_enabled_indexer_idx', array('product_id', 'visibility')), + array('product_id', 'visibility') +); + + +$table = $installer->getTable('catalog/category_product_enabled_indexer_tmp'); +$connection->dropIndex($table, 'IDX_CATALOG_CATEGORY_PRODUCT_INDEX_ENBL_TMP_PRODUCT_ID'); +$connection->addIndex( + $table, + $installer->getIdxName('catalog/category_product_enabled_indexer_tmp', array('product_id', 'visibility')), + array('product_id', 'visibility') +); + +$connection->addIndex( + $installer->getTable('catalog/category_anchor_products_indexer_idx'), + $installer->getIdxName( + 'catalog/category_anchor_products_indexer_idx', + array('category_id', 'product_id', 'position') + ), + array('category_id', 'product_id', 'position') +); + +$connection->addIndex( + $installer->getTable('catalog/category_anchor_products_indexer_tmp'), + $installer->getIdxName( + 'catalog/category_anchor_products_indexer_tmp', + array('category_id', 'product_id', 'position') + ), + array('category_id', 'product_id', 'position') +); + +$connection->addIndex( + $installer->getTable('catalog/category_anchor_indexer_idx'), + $installer->getIdxName( + 'catalog/category_anchor_indexer_idx', + array('path', 'category_id') + ), + array('path', 'category_id') +); + +$connection->addIndex( + $installer->getTable('catalog/category_anchor_indexer_tmp'), + $installer->getIdxName( + 'catalog/category_anchor_indexer_tmp', + array('path', 'category_id') + ), + array('path', 'category_id') +); + +$connection->addIndex( + $installer->getTable('catalog/category'), + $installer->getIdxName( + 'catalog/category', + array('path', 'entity_id') + ), + array('path', 'entity_id') +); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.9-1.6.0.0.10.php b/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.9-1.6.0.0.10.php new file mode 100644 index 0000000000..3d9b6b45bd --- /dev/null +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.9-1.6.0.0.10.php @@ -0,0 +1,214 @@ +getConnection(); + +/** + * Create table 'catalog/product_attribute_group_price' + */ +$table = $installer->getConnection() + ->newTable($installer->getTable('catalog/product_attribute_group_price')) + ->addColumn('value_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array( + 'identity' => true, + 'nullable' => false, + 'primary' => true, + ), 'Value ID') + ->addColumn('entity_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array( + 'unsigned' => true, + 'nullable' => false, + 'default' => '0', + ), 'Entity ID') + ->addColumn('all_groups', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array( + 'unsigned' => true, + 'nullable' => false, + 'default' => '1', + ), 'Is Applicable To All Customer Groups') + ->addColumn('customer_group_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array( + 'unsigned' => true, + 'nullable' => false, + 'default' => '0', + ), 'Customer Group ID') + ->addColumn('value', Varien_Db_Ddl_Table::TYPE_DECIMAL, '12,4', array( + 'nullable' => false, + 'default' => '0.0000', + ), 'Value') + ->addColumn('website_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array( + 'unsigned' => true, + 'nullable' => false, + ), 'Website ID') + ->addIndex( + $installer->getIdxName( + 'catalog/product_attribute_group_price', + array('entity_id', 'all_groups', 'customer_group_id', 'website_id'), + Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE + ), + array('entity_id', 'all_groups', 'customer_group_id', 'website_id'), + array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE)) + ->addIndex($installer->getIdxName('catalog/product_attribute_group_price', array('entity_id')), + array('entity_id')) + ->addIndex($installer->getIdxName('catalog/product_attribute_group_price', array('customer_group_id')), + array('customer_group_id')) + ->addIndex($installer->getIdxName('catalog/product_attribute_group_price', array('website_id')), + array('website_id')) + ->addForeignKey( + $installer->getFkName( + 'catalog/product_attribute_group_price', + 'customer_group_id', + 'customer/customer_group', + 'customer_group_id' + ), + 'customer_group_id', $installer->getTable('customer/customer_group'), 'customer_group_id', + Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE) + ->addForeignKey( + $installer->getFkName( + 'catalog/product_attribute_group_price', + 'entity_id', + 'catalog/product', + 'entity_id' + ), + 'entity_id', $installer->getTable('catalog/product'), 'entity_id', + Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE) + ->addForeignKey( + $installer->getFkName( + 'catalog/product_attribute_group_price', + 'website_id', + 'core/website', + 'website_id' + ), + 'website_id', $installer->getTable('core/website'), 'website_id', + Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE) + ->setComment('Catalog Product Group Price Attribute Backend Table'); +$installer->getConnection()->createTable($table); + +$installer->addAttribute('catalog_product', 'group_price', array( + 'type' => 'decimal', + 'label' => 'Group Price', + 'input' => 'text', + 'backend' => 'catalog/product_attribute_backend_groupprice', + 'required' => false, + 'sort_order' => 6, + 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_WEBSITE, + 'apply_to' => 'simple,configurable,virtual', + 'group' => 'Prices', +)); + +/** + * Create table 'catalog/product_index_group_price' + */ +$table = $connection + ->newTable($installer->getTable('catalog/product_index_group_price')) + ->addColumn('entity_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array( + 'unsigned' => true, + 'nullable' => false, + 'primary' => true, + ), 'Entity ID') + ->addColumn('customer_group_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array( + 'unsigned' => true, + 'nullable' => false, + 'primary' => true, + ), 'Customer Group ID') + ->addColumn('website_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array( + 'unsigned' => true, + 'nullable' => false, + 'primary' => true, + ), 'Website ID') + ->addColumn('price', Varien_Db_Ddl_Table::TYPE_DECIMAL, '12,4', array( + ), 'Min Price') + ->addIndex($installer->getIdxName('catalog/product_index_group_price', array('customer_group_id')), + array('customer_group_id')) + ->addIndex($installer->getIdxName('catalog/product_index_group_price', array('website_id')), + array('website_id')) + ->addForeignKey( + $installer->getFkName( + 'catalog/product_index_group_price', + 'customer_group_id', + 'customer/customer_group', + 'customer_group_id' + ), + 'customer_group_id', $installer->getTable('customer/customer_group'), 'customer_group_id', + Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE) + ->addForeignKey( + $installer->getFkName( + 'catalog/product_index_group_price', + 'entity_id', + 'catalog/product', + 'entity_id' + ), + 'entity_id', $installer->getTable('catalog/product'), 'entity_id', + Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE) + ->addForeignKey( + $installer->getFkName( + 'catalog/product_index_group_price', + 'website_id', + 'core/website', + 'website_id' + ), + 'website_id', $installer->getTable('core/website'), 'website_id', + Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE) + ->setComment('Catalog Product Group Price Index Table'); +$connection->createTable($table); + +$finalPriceIndexerTables = array( + 'catalog/product_price_indexer_final_idx', + 'catalog/product_price_indexer_final_tmp', +); + +$priceIndexerTables = array( + 'catalog/product_price_indexer_option_aggregate_idx', + 'catalog/product_price_indexer_option_aggregate_tmp', + 'catalog/product_price_indexer_option_idx', + 'catalog/product_price_indexer_option_tmp', + 'catalog/product_price_indexer_idx', + 'catalog/product_price_indexer_tmp', + 'catalog/product_price_indexer_cfg_option_aggregate_idx', + 'catalog/product_price_indexer_cfg_option_aggregate_tmp', + 'catalog/product_price_indexer_cfg_option_idx', + 'catalog/product_price_indexer_cfg_option_tmp', + 'catalog/product_index_price', +); + +foreach ($finalPriceIndexerTables as $table) { + $connection->addColumn($installer->getTable($table), 'group_price', array( + 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, + 'length' => '12,4', + 'comment' => 'Group price', + )); + $connection->addColumn($installer->getTable($table), 'base_group_price', array( + 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, + 'length' => '12,4', + 'comment' => 'Base Group Price', + )); +} + +foreach ($priceIndexerTables as $table) { + $connection->addColumn($installer->getTable($table), 'group_price', array( + 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, + 'length' => '12,4', + 'comment' => 'Group price', + )); +} diff --git a/app/code/core/Mage/CatalogInventory/Model/Indexer/Stock.php b/app/code/core/Mage/CatalogInventory/Model/Indexer/Stock.php index b3774f91c3..67e69eeba0 100644 --- a/app/code/core/Mage/CatalogInventory/Model/Indexer/Stock.php +++ b/app/code/core/Mage/CatalogInventory/Model/Indexer/Stock.php @@ -47,6 +47,11 @@ */ class Mage_CatalogInventory_Model_Indexer_Stock extends Mage_Index_Model_Indexer_Abstract { + /** + * Data key for matching result to be saved in + */ + const EVENT_MATCH_RESULT_KEY = 'cataloginventory_stock_match_result'; + /** * @var array */ @@ -132,17 +137,15 @@ public function getDescription() public function matchEvent(Mage_Index_Model_Event $event) { $data = $event->getNewData(); - $resultKey = 'cataloginventory_stock_match_result'; - if (isset($data[$resultKey])) { - return $data[$resultKey]; + if (isset($data[self::EVENT_MATCH_RESULT_KEY])) { + return $data[self::EVENT_MATCH_RESULT_KEY]; } - $result = null; $entity = $event->getEntity(); if ($entity == Mage_Core_Model_Store::ENTITY) { /* @var $store Mage_Core_Model_Store */ $store = $event->getDataObject(); - if ($store->isObjectNew()) { + if ($store && $store->isObjectNew()) { $result = true; } else { $result = false; @@ -150,15 +153,14 @@ public function matchEvent(Mage_Index_Model_Event $event) } else if ($entity == Mage_Core_Model_Store_Group::ENTITY) { /* @var $storeGroup Mage_Core_Model_Store_Group */ $storeGroup = $event->getDataObject(); - if ($storeGroup->dataHasChangedFor('website_id')) { + if ($storeGroup && $storeGroup->dataHasChangedFor('website_id')) { $result = true; } else { $result = false; } } else if ($entity == Mage_Core_Model_Config_Data::ENTITY) { $configData = $event->getDataObject(); - $path = $configData->getPath(); - if (in_array($path, $this->_relatedConfigSettings)) { + if ($configData && in_array($configData->getPath(), $this->_relatedConfigSettings)) { $result = $configData->isValueChanged(); } else { $result = false; @@ -167,7 +169,7 @@ public function matchEvent(Mage_Index_Model_Event $event) $result = parent::matchEvent($event); } - $event->addNewData($resultKey, $result); + $event->addNewData(self::EVENT_MATCH_RESULT_KEY, $result); return $result; } @@ -179,6 +181,7 @@ public function matchEvent(Mage_Index_Model_Event $event) */ protected function _registerEvent(Mage_Index_Model_Event $event) { + $event->addNewData(self::EVENT_MATCH_RESULT_KEY, true); switch ($event->getEntity()) { case Mage_CatalogInventory_Model_Stock_Item::ENTITY: $this->_registerCatalogInventoryStockItemEvent($event); diff --git a/app/code/core/Mage/CatalogInventory/Model/Mysql4/Indexer/Stock/Interface.php b/app/code/core/Mage/CatalogInventory/Model/Mysql4/Indexer/Stock/Interface.php index cf91ab2b2d..fdd6ec2d85 100644 --- a/app/code/core/Mage/CatalogInventory/Model/Mysql4/Indexer/Stock/Interface.php +++ b/app/code/core/Mage/CatalogInventory/Model/Mysql4/Indexer/Stock/Interface.php @@ -32,7 +32,7 @@ * @package Mage_CatalogInventory * @author Magento Core Team */ -class Mage_CatalogInventory_Model_Mysql4_Indexer_Stock_Interface +interface Mage_CatalogInventory_Model_Mysql4_Indexer_Stock_Interface extends Mage_CatalogInventory_Model_Resource_Indexer_Stock_Interface { } diff --git a/app/code/core/Mage/CatalogInventory/Model/Observer.php b/app/code/core/Mage/CatalogInventory/Model/Observer.php index 028db33176..9e34f05ae1 100644 --- a/app/code/core/Mage/CatalogInventory/Model/Observer.php +++ b/app/code/core/Mage/CatalogInventory/Model/Observer.php @@ -700,9 +700,11 @@ public function reindexQuoteInventory($observer) */ public function refundOrderInventory($observer) { + /* @var $creditmemo Mage_Sales_Model_Order_Creditmemo */ $creditmemo = $observer->getEvent()->getCreditmemo(); $items = array(); foreach ($creditmemo->getAllItems() as $item) { + /* @var $item Mage_Sales_Model_Order_Creditmemo_Item */ $return = false; if ($item->hasBackToStock()) { if ($item->getBackToStock() && $item->getQty()) { @@ -712,11 +714,15 @@ public function refundOrderInventory($observer) $return = true; } if ($return) { + $parentOrderId = $item->getOrderItem()->getParentItemId(); + /* @var $parentItem Mage_Sales_Model_Order_Creditmemo_Item */ + $parentItem = $parentOrderId ? $creditmemo->getItemByOrderId($parentOrderId) : false; + $qty = $parentItem ? ($parentItem->getQty() * $item->getQty()) : $item->getQty(); if (isset($items[$item->getProductId()])) { - $items[$item->getProductId()]['qty'] += $item->getQty(); + $items[$item->getProductId()]['qty'] += $qty; } else { $items[$item->getProductId()] = array( - 'qty' => $item->getQty(), + 'qty' => $qty, 'item'=> null, ); } @@ -904,4 +910,15 @@ public function refundOrderItem($observer) return $this; } + /** + * Reindex all events of product-massAction type + * + * @param Varien_Event_Observer $observer + */ + public function reindexProductsMassAction($observer) + { + Mage::getSingleton('index/indexer')->indexEvents( + Mage_Catalog_Model_Product::ENTITY, Mage_Index_Model_Event::TYPE_MASS_ACTION + ); + } } diff --git a/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock.php b/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock.php index 548439ad73..2c57c16314 100755 --- a/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock.php +++ b/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock.php @@ -80,7 +80,7 @@ public function cataloginventoryStockItemSave(Mage_Index_Model_Event $event) 'force_reindex_required' => 1 )); $massObject->setProductIds(array($productId)); - Mage::getSingleton('index/indexer')->processEntityAction( + Mage::getSingleton('index/indexer')->logEvent( $massObject, Mage_Catalog_Model_Product::ENTITY, Mage_Index_Model_Event::TYPE_MASS_ACTION ); } @@ -251,13 +251,20 @@ public function catalogProductMassAction(Mage_Index_Model_Event $event) public function reindexAll() { $this->useIdxTable(true); - $this->clearTemporaryIndexTable(); + $this->beginTransaction(); + try { + $this->clearTemporaryIndexTable(); - foreach ($this->_getTypeIndexers() as $indexer) { - $indexer->reindexAll(); - } + foreach ($this->_getTypeIndexers() as $indexer) { + $indexer->reindexAll(); + } - $this->syncData(); + $this->syncData(); + $this->commit(); + } catch (Exception $e) { + $this->rollBack(); + throw $e; + } return $this; } diff --git a/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock/Configurable.php b/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock/Configurable.php index b1d282a283..8737af64d6 100755 --- a/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock/Configurable.php +++ b/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock/Configurable.php @@ -35,18 +35,6 @@ class Mage_CatalogInventory_Model_Resource_Indexer_Stock_Configurable extends Mage_CatalogInventory_Model_Resource_Indexer_Stock_Default { - /** - * Reindex all stock status data for configurable products - * - * @return Mage_CatalogInventory_Model_Resource_Indexer_Stock_Configurable - */ - public function reindexAll() - { - $this->useIdxTable(true); - $this->_prepareIndexTable(); - return $this; - } - /** * Reindex stock data for defined configurable product ids * diff --git a/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock/Default.php b/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock/Default.php index 6688e3f5dc..85a5c5f456 100755 --- a/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock/Default.php +++ b/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock/Default.php @@ -67,7 +67,14 @@ protected function _construct() public function reindexAll() { $this->useIdxTable(true); - $this->_prepareIndexTable(); + $this->beginTransaction(); + try { + $this->_prepareIndexTable(); + $this->commit(); + } catch (Exception $e) { + $this->rollBack(); + throw $e; + } return $this; } diff --git a/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock/Grouped.php b/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock/Grouped.php index 076fd280c3..b3f8c38008 100755 --- a/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock/Grouped.php +++ b/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock/Grouped.php @@ -35,18 +35,6 @@ class Mage_CatalogInventory_Model_Resource_Indexer_Stock_Grouped extends Mage_CatalogInventory_Model_Resource_Indexer_Stock_Default { - /** - * Reindex all stock status data for configurable products - * - * @return Mage_CatalogInventory_Model_Resource_Indexer_Stock_Grouped - */ - public function reindexAll() - { - $this->useIdxTable(true); - $this->_prepareIndexTable(); - return $this; - } - /** * Reindex stock data for defined configurable product ids * diff --git a/app/code/core/Mage/CatalogInventory/Model/Stock/Item.php b/app/code/core/Mage/CatalogInventory/Model/Stock/Item.php index 8088314f3a..0113ae920d 100644 --- a/app/code/core/Mage/CatalogInventory/Model/Stock/Item.php +++ b/app/code/core/Mage/CatalogInventory/Model/Stock/Item.php @@ -128,6 +128,13 @@ class Mage_CatalogInventory_Model_Stock_Item extends Mage_Core_Model_Abstract */ protected $_customerGroupId; + /** + * Whether index events should be processed immediately + * + * @var bool + */ + protected $_processIndexEvents = true; + /** * Initialize resource model * @@ -454,7 +461,8 @@ public function checkQty($qty) if (!$this->getManageStock() || Mage::app()->getStore()->isAdmin()) { return true; } - if ($this->getQty() - $qty < 0) { + + if ($this->getQty() - $this->getMinQty() - $qty < 0) { switch ($this->getBackorders()) { case Mage_CatalogInventory_Model_Stock::BACKORDERS_YES_NONOTIFY: case Mage_CatalogInventory_Model_Stock::BACKORDERS_YES_NOTIFY: @@ -529,9 +537,6 @@ public function checkQuoteItemQty($qty, $summaryQty, $origQty = 0) $result = new Varien_Object(); $result->setHasError(false); - /** @var $_helper Mage_CatalogInventory_Helper_Data */ - $_helper = Mage::helper('cataloginventory'); - if (!is_numeric($qty)) { $qty = Mage::app()->getLocale()->getNumber($qty); } @@ -560,9 +565,9 @@ public function checkQuoteItemQty($qty, $summaryQty, $origQty = 0) if ($this->getMinSaleQty() && ($qty) < $this->getMinSaleQty()) { $result->setHasError(true) ->setMessage( - $_helper->__('The minimum quantity allowed for purchase is %s.', $this->getMinSaleQty() * 1) + Mage::helper('cataloginventory')->__('The minimum quantity allowed for purchase is %s.', $this->getMinSaleQty() * 1) ) - ->setQuoteMessage($_helper->__('Some of the products cannot be ordered in requested quantity.')) + ->setQuoteMessage(Mage::helper('cataloginventory')->__('Some of the products cannot be ordered in requested quantity.')) ->setQuoteMessageIndex('qty'); return $result; } @@ -570,9 +575,9 @@ public function checkQuoteItemQty($qty, $summaryQty, $origQty = 0) if ($this->getMaxSaleQty() && ($qty) > $this->getMaxSaleQty()) { $result->setHasError(true) ->setMessage( - $_helper->__('The maximum quantity allowed for purchase is %s.', $this->getMaxSaleQty() * 1) + Mage::helper('cataloginventory')->__('The maximum quantity allowed for purchase is %s.', $this->getMaxSaleQty() * 1) ) - ->setQuoteMessage($_helper->__('Some of the products cannot be ordered in requested quantity.')) + ->setQuoteMessage(Mage::helper('cataloginventory')->__('Some of the products cannot be ordered in requested quantity.')) ->setQuoteMessageIndex('qty'); return $result; } @@ -589,15 +594,15 @@ public function checkQuoteItemQty($qty, $summaryQty, $origQty = 0) if (!$this->getIsInStock()) { $result->setHasError(true) - ->setMessage($_helper->__('This product is currently out of stock.')) - ->setQuoteMessage($_helper->__('Some of the products are currently out of stock')) + ->setMessage(Mage::helper('cataloginventory')->__('This product is currently out of stock.')) + ->setQuoteMessage(Mage::helper('cataloginventory')->__('Some of the products are currently out of stock')) ->setQuoteMessageIndex('stock'); $result->setItemUseOldQty(true); return $result; } if (!$this->checkQty($summaryQty) || !$this->checkQty($qty)) { - $message = $_helper->__('The requested quantity for "%s" is not available.', $this->getProductName()); + $message = Mage::helper('cataloginventory')->__('The requested quantity for "%s" is not available.', $this->getProductName()); $result->setHasError(true) ->setMessage($message) ->setQuoteMessage($message) @@ -627,16 +632,16 @@ public function checkQuoteItemQty($qty, $summaryQty, $origQty = 0) if ($this->getBackorders() == Mage_CatalogInventory_Model_Stock::BACKORDERS_YES_NOTIFY) { if (!$this->getIsChildItem()) { $result->setMessage( - $_helper->__('This product is not available in the requested quantity. %s of the items will be backordered.', ($backorderQty * 1)) + Mage::helper('cataloginventory')->__('This product is not available in the requested quantity. %s of the items will be backordered.', ($backorderQty * 1)) ); } else { $result->setMessage( - $_helper->__('"%s" is not available in the requested quantity. %s of the items will be backordered.', $this->getProductName(), ($backorderQty * 1)) + Mage::helper('cataloginventory')->__('"%s" is not available in the requested quantity. %s of the items will be backordered.', $this->getProductName(), ($backorderQty * 1)) ); } } elseif (Mage::app()->getStore()->isAdmin()) { $result->setMessage( - $_helper->__('The requested quantity for "%s" is not available.', $this->getProductName()) + Mage::helper('cataloginventory')->__('The requested quantity for "%s" is not available.', $this->getProductName()) ); } } @@ -792,16 +797,21 @@ public function verifyNotification($qty = null) } /** - * Process stock status index on item after commit + * Reindex CatalogInventory save event * * @return Mage_CatalogInventory_Model_Stock_Item */ - public function afterCommitCallback() + protected function _afterSave() { - parent::afterCommitCallback(); - Mage::getSingleton('index/indexer')->processEntityAction( - $this, self::ENTITY, Mage_Index_Model_Event::TYPE_SAVE - ); + parent::_afterSave(); + + /** @var $indexer Mage_Index_Model_Indexer */ + $indexer = Mage::getSingleton('index/indexer'); + if ($this->_processIndexEvents) { + $indexer->processEntityAction($this, self::ENTITY, Mage_Index_Model_Event::TYPE_SAVE); + } else { + $indexer->logEvent($this, self::ENTITY, Mage_Index_Model_Event::TYPE_SAVE); + } return $this; } @@ -899,4 +909,16 @@ public function reset() } return $this; } + + /** + * Set whether index events should be processed immediately + * + * @param bool $process + * @return Mage_CatalogInventory_Model_Stock_Item + */ + public function setProcessIndexEvents($process = true) + { + $this->_processIndexEvents = $process; + return $this; + } } diff --git a/app/code/core/Mage/CatalogInventory/Model/System/Config/Backend/Minqty.php b/app/code/core/Mage/CatalogInventory/Model/System/Config/Backend/Minqty.php new file mode 100644 index 0000000000..e4c5b0e3c2 --- /dev/null +++ b/app/code/core/Mage/CatalogInventory/Model/System/Config/Backend/Minqty.php @@ -0,0 +1,48 @@ + + */ +class Mage_CatalogInventory_Model_System_Config_Backend_Minqty extends Mage_Core_Model_Config_Data +{ + /** + * Validate minimum product qty value + * + * @return Mage_CatalogInventory_Model_System_Config_Backend_Minqty + */ + protected function _beforeSave() + { + parent::_beforeSave(); + $minQty = (int)$this->getValue() >= 0 ? (int)$this->getValue() : (int)$this->getOldValue(); + $this->setValue((string) $minQty); + return $this; + } +} diff --git a/app/code/core/Mage/CatalogInventory/etc/config.xml b/app/code/core/Mage/CatalogInventory/etc/config.xml index 60cd6ca9cf..1e7354899e 100644 --- a/app/code/core/Mage/CatalogInventory/etc/config.xml +++ b/app/code/core/Mage/CatalogInventory/etc/config.xml @@ -28,7 +28,7 @@ - 1.6.0.0 + 1.6.0.0.1 @@ -206,6 +206,22 @@ + + + + cataloginventory/observer + reindexProductsMassAction + + + + + + + cataloginventory/observer + reindexProductsMassAction + + + @@ -271,6 +287,16 @@ + + + + + cataloginventory/observer + reindexProductsMassAction + + + + diff --git a/app/code/core/Mage/CatalogInventory/etc/system.xml b/app/code/core/Mage/CatalogInventory/etc/system.xml index 80e11f659a..a2422844c8 100644 --- a/app/code/core/Mage/CatalogInventory/etc/system.xml +++ b/app/code/core/Mage/CatalogInventory/etc/system.xml @@ -62,7 +62,7 @@ 1 1 - + select adminhtml/system_config_source_yesno @@ -120,6 +120,7 @@ text + cataloginventory/system_config_backend_minqty 5 1 0 @@ -168,6 +169,7 @@ 1 0 0 + validate-per-page-value-list 1 diff --git a/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-1.6.0.0-1.6.0.0.1.php b/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-1.6.0.0-1.6.0.0.1.php new file mode 100644 index 0000000000..8c34a13788 --- /dev/null +++ b/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-1.6.0.0-1.6.0.0.1.php @@ -0,0 +1,34 @@ +getConnection(); +$connection->changeTableEngine( + $installer->getTable('cataloginventory/stock_status_indexer_tmp'), + Varien_Db_Adapter_Pdo_Mysql::ENGINE_MEMORY +); diff --git a/app/code/core/Mage/CatalogRule/Model/Rule.php b/app/code/core/Mage/CatalogRule/Model/Rule.php index 0301f02702..99f2cb4073 100644 --- a/app/code/core/Mage/CatalogRule/Model/Rule.php +++ b/app/code/core/Mage/CatalogRule/Model/Rule.php @@ -343,7 +343,11 @@ public function applyAllRulesToProduct($product) } if ($productId) { - Mage::getResourceSingleton('catalog/product_indexer_price')->reindexProductIds(array($productId)); + Mage::getSingleton('index/indexer')->processEntityAction( + new Varien_Object(array('id' => $productId)), + Mage_Catalog_Model_Product::ENTITY, + Mage_Catalog_Model_Product_Indexer_Price::EVENT_TYPE_REINDEX_PRICE + ); } } diff --git a/app/code/core/Mage/CatalogSearch/Helper/Data.php b/app/code/core/Mage/CatalogSearch/Helper/Data.php index e4f0584ba6..3e0e962e0a 100644 --- a/app/code/core/Mage/CatalogSearch/Helper/Data.php +++ b/app/code/core/Mage/CatalogSearch/Helper/Data.php @@ -301,10 +301,7 @@ public function checkNotes($store = null) $wordsCut = array_map(array($this, 'htmlEscape'), $wordsCut); $this->addNoteMessage( - $this->__('Maximum words count is %1$s. In your search query was cut next part: %2$s.', - $this->getMaxQueryWords(), - join(' ', $wordsCut) - ) + $this->__('Maximum words count is %1$s. In your search query was cut next part: %2$s.', $this->getMaxQueryWords(), join(' ', $wordsCut)) ); } } diff --git a/app/code/core/Mage/CatalogSearch/Model/Fulltext.php b/app/code/core/Mage/CatalogSearch/Model/Fulltext.php index 12e3d7370c..34f79921c4 100644 --- a/app/code/core/Mage/CatalogSearch/Model/Fulltext.php +++ b/app/code/core/Mage/CatalogSearch/Model/Fulltext.php @@ -50,6 +50,7 @@ class Mage_CatalogSearch_Model_Fulltext extends Mage_Core_Model_Abstract /** * Whether table changes are allowed * + * @deprecated after 1.6.1.0 * @var bool */ protected $_allowTableChanges = true; @@ -79,14 +80,7 @@ public function rebuildIndex($storeId = null, $productIds = null) 'product_ids' => $productIds )); - $resourceModel = $this->getResource(); - if (!$this->_allowTableChanges && is_callable(array($resourceModel, 'setAllowTableChanges'))) { - $resourceModel->setAllowTableChanges(false); - } - $resourceModel->rebuildIndex($storeId, $productIds); - if (!$this->_allowTableChanges && is_callable(array($resourceModel, 'setAllowTableChanges'))) { - $resourceModel->setAllowTableChanges(true); - } + $this->getResource()->rebuildIndex($storeId, $productIds); Mage::dispatchEvent('catalogsearch_index_process_complete', array()); @@ -119,15 +113,7 @@ public function cleanIndex($storeId = null, $productId = null) */ public function resetSearchResults() { - $resourceModel = $this->getResource(); - if (!$this->_allowTableChanges && is_callable(array($resourceModel, 'setAllowTableChanges'))) { - $resourceModel->setAllowTableChanges(false); - } - $resourceModel->resetSearchResults(); - if (!$this->_allowTableChanges && is_callable(array($resourceModel, 'setAllowTableChanges'))) { - $resourceModel->setAllowTableChanges(true); - } - + $this->getResource()->resetSearchResults(); return $this; } @@ -177,6 +163,7 @@ public function updateCategoryIndex($productIds, $categoryIds) /** * Set whether table changes are allowed * + * @deprecated after 1.6.1.0 * @param bool $value * @return Mage_CatalogSearch_Model_Fulltext */ diff --git a/app/code/core/Mage/CatalogSearch/Model/Indexer/Fulltext.php b/app/code/core/Mage/CatalogSearch/Model/Indexer/Fulltext.php index f7c813257d..fc19b63bc1 100644 --- a/app/code/core/Mage/CatalogSearch/Model/Indexer/Fulltext.php +++ b/app/code/core/Mage/CatalogSearch/Model/Indexer/Fulltext.php @@ -34,6 +34,18 @@ */ class Mage_CatalogSearch_Model_Indexer_Fulltext extends Mage_Index_Model_Indexer_Abstract { + /** + * Data key for matching result to be saved in + */ + const EVENT_MATCH_RESULT_KEY = 'catalogsearch_fulltext_match_result'; + + /** + * List of searchable attributes + * + * @var null|array + */ + protected $_searchableAttributes = null; + /** * Retrieve resource instance * @@ -127,20 +139,20 @@ public function getDescription() public function matchEvent(Mage_Index_Model_Event $event) { $data = $event->getNewData(); - $resultKey = 'catalogsearch_fulltext_match_result'; - if (isset($data[$resultKey])) { - return $data[$resultKey]; + if (isset($data[self::EVENT_MATCH_RESULT_KEY])) { + return $data[self::EVENT_MATCH_RESULT_KEY]; } - $result = null; $entity = $event->getEntity(); if ($entity == Mage_Catalog_Model_Resource_Eav_Attribute::ENTITY) { /* @var $attribute Mage_Catalog_Model_Resource_Eav_Attribute */ $attribute = $event->getDataObject(); - if ($event->getType() == Mage_Index_Model_Event::TYPE_SAVE) { + if (!$attribute) { + $result = false; + } elseif ($event->getType() == Mage_Index_Model_Event::TYPE_SAVE) { $result = $attribute->dataHasChangedFor('is_searchable'); - } else if ($event->getType() == Mage_Index_Model_Event::TYPE_DELETE) { + } elseif ($event->getType() == Mage_Index_Model_Event::TYPE_DELETE) { $result = $attribute->getIsSearchable(); } else { $result = false; @@ -151,7 +163,7 @@ public function matchEvent(Mage_Index_Model_Event $event) } else { /* @var $store Mage_Core_Model_Store */ $store = $event->getDataObject(); - if ($store->isObjectNew()) { + if ($store && $store->isObjectNew()) { $result = true; } else { $result = false; @@ -160,14 +172,14 @@ public function matchEvent(Mage_Index_Model_Event $event) } else if ($entity == Mage_Core_Model_Store_Group::ENTITY) { /* @var $storeGroup Mage_Core_Model_Store_Group */ $storeGroup = $event->getDataObject(); - if ($storeGroup->dataHasChangedFor('website_id')) { + if ($storeGroup && $storeGroup->dataHasChangedFor('website_id')) { $result = true; } else { $result = false; } } else if ($entity == Mage_Core_Model_Config_Data::ENTITY) { $data = $event->getDataObject(); - if (in_array($data->getPath(), $this->_relatedConfigSettings)) { + if ($data && in_array($data->getPath(), $this->_relatedConfigSettings)) { $result = $data->isValueChanged(); } else { $result = false; @@ -176,7 +188,7 @@ public function matchEvent(Mage_Index_Model_Event $event) $result = parent::matchEvent($event); } - $event->addNewData($resultKey, $result); + $event->addNewData(self::EVENT_MATCH_RESULT_KEY, $result); return $result; } @@ -188,6 +200,7 @@ public function matchEvent(Mage_Index_Model_Event $event) */ protected function _registerEvent(Mage_Index_Model_Event $event) { + $event->addNewData(self::EVENT_MATCH_RESULT_KEY, true); switch ($event->getEntity()) { case Mage_Catalog_Model_Product::ENTITY: $this->_registerCatalogProductEvent($event); @@ -282,6 +295,16 @@ protected function _registerCatalogProductEvent(Mage_Index_Model_Event $event) $reindexData['catalogsearch_action_type'] = $actionObject->getActionType(); } + $searchableAttributes = array(); + if (is_array($attrData)) { + $searchableAttributes = array_intersect($this->_getSearchableAttributes(), array_keys($attrData)); + } + + if (count($searchableAttributes) > 0) { + $rebuildIndex = true; + $reindexData['catalogsearch_force_reindex'] = true; + } + // register affected products if ($rebuildIndex) { $reindexData['catalogsearch_product_ids'] = $actionObject->getProductIds(); @@ -295,6 +318,26 @@ protected function _registerCatalogProductEvent(Mage_Index_Model_Event $event) return $this; } + /** + * Retrieve searchable attributes list + * + * @return array + */ + protected function _getSearchableAttributes() + { + if (is_null($this->_searchableAttributes)) { + /** @var $attributeCollection Mage_Catalog_Model_Resource_Product_Attribute_Collection */ + $attributeCollection = Mage::getResourceModel('catalog/product_attribute_collection'); + $attributeCollection->addIsSearchableFilter(); + + foreach ($attributeCollection as $attribute) { + $this->_searchableAttributes[] = $attribute->getAttributeCode(); + } + } + + return $this->_searchableAttributes; + } + /** * Check if product is composite * @@ -314,9 +357,6 @@ protected function _isProductComposite($productId) */ protected function _processEvent(Mage_Index_Model_Event $event) { - if (!$this->_allowTableChanges && is_callable(array($this->_getIndexer(), 'setAllowTableChanges'))) { - $this->_getIndexer()->setAllowTableChanges(false); - } $data = $event->getNewData(); if (!empty($data['catalogsearch_fulltext_reindex_all'])) { @@ -380,6 +420,11 @@ protected function _processEvent(Mage_Index_Model_Event $event) ->resetSearchResults(); } } + if (isset($data['catalogsearch_force_reindex'])) { + $this->_getIndexer() + ->rebuildIndex(null, $productIds) + ->resetSearchResults(); + } } else if (isset($data['catalogsearch_category_update_product_ids'])) { $productIds = $data['catalogsearch_category_update_product_ids']; $categoryIds = $data['catalogsearch_category_update_category_ids']; @@ -387,9 +432,6 @@ protected function _processEvent(Mage_Index_Model_Event $event) $this->_getIndexer() ->updateCategoryIndex($productIds, $categoryIds); } - if (!$this->_allowTableChanges && is_callable(array($this->_getIndexer(), 'setAllowTableChanges'))) { - $this->_getIndexer()->setAllowTableChanges(true); - } } /** @@ -398,6 +440,14 @@ protected function _processEvent(Mage_Index_Model_Event $event) */ public function reindexAll() { - $this->_getIndexer()->rebuildIndex(); + $resourceModel = $this->_getIndexer()->getResource(); + $resourceModel->beginTransaction(); + try { + $this->_getIndexer()->rebuildIndex(); + $resourceModel->commit(); + } catch (Exception $e) { + $resourceModel->rollBack(); + throw $e; + } } } diff --git a/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php b/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php index 01f27a0c6d..80ce6cf8a4 100755 --- a/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php +++ b/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php @@ -72,6 +72,7 @@ class Mage_CatalogSearch_Model_Resource_Fulltext extends Mage_Core_Model_Resourc /** * Whether table changes are allowed * + * @deprecated after 1.6.1.0 * @var bool */ protected $_allowTableChanges = true; @@ -117,7 +118,7 @@ public function updateCategoryIndex($productIds, $categoryIds) * * @param int|null $storeId * @param int|array|null $productIds - * @return Mage_CatalogSearch_Model_Mysql4_Fulltext + * @return Mage_CatalogSearch_Model_Resource_Fulltext */ public function rebuildIndex($storeId = null, $productIds = null) { @@ -301,11 +302,7 @@ public function resetSearchResults() { $adapter = $this->_getWriteAdapter(); $adapter->update($this->getTable('catalogsearch/search_query'), array('is_processed' => 0)); - if ($this->_allowTableChanges) { - $adapter->truncateTable($this->getTable('catalogsearch/result')); - } else { - $adapter->delete($this->getTable('catalogsearch/result')); - } + $adapter->delete($this->getTable('catalogsearch/result')); Mage::dispatchEvent('catalogsearch_reset_search_result'); @@ -632,21 +629,16 @@ protected function _prepareProductIndex($indexData, $productData, $storeId) } } - foreach ($indexData as $attributeData) { + foreach ($indexData as $entityId => $attributeData) { foreach ($attributeData as $attributeId => $attributeValue) { $value = $this->_getAttributeValue($attributeId, $attributeValue, $storeId); if (!is_null($value) && $value !== false) { $code = $this->_getSearchableAttribute($attributeId)->getAttributeCode(); - //For grouped products + if (isset($index[$code])) { - if (!is_array($index[$code])) { - $index[$code] = array($index[$code]); - } - $index[$code][] = $value; - } - //For other types of products - else { - $index[$code] = $value; + $index[$code][$entityId] = $value; + } else { + $index[$code] = array($entityId => $value); } } } @@ -687,10 +679,12 @@ protected function _prepareProductIndex($indexData, $productData, $storeId) protected function _getAttributeValue($attributeId, $value, $storeId) { $attribute = $this->_getSearchableAttribute($attributeId); - if (!($attribute->getIsSearchable() || - $attribute->getIsVisibleInAdvancedSearch() || - $attribute->getIsFilterable() || - $attribute->getIsFilterableInSearch())) { + if (!($attribute->getIsSearchable() + || $attribute->getIsVisibleInAdvancedSearch() + || $attribute->getIsFilterable() + || $attribute->getIsFilterableInSearch() + || $attribute->getUsedForSortBy()) + ) { return null; } @@ -779,6 +773,7 @@ protected function _getStoreDate($storeId, $date = null) /** * Set whether table changes are allowed * + * @deprecated after 1.6.1.0 * @param bool $value * @return Mage_CatalogSearch_Model_Resource_Fulltext */ diff --git a/app/code/core/Mage/Centinel/Block/Adminhtml/Validation.php b/app/code/core/Mage/Centinel/Block/Adminhtml/Validation.php index cc90f6e083..15b009031b 100644 --- a/app/code/core/Mage/Centinel/Block/Adminhtml/Validation.php +++ b/app/code/core/Mage/Centinel/Block/Adminhtml/Validation.php @@ -66,7 +66,11 @@ public function getHeaderCssClass() protected function _toHtml() { $payment = $this->getQuote()->getPayment(); - if (!$payment->getMethod() || !$payment->getMethodInstance() || !$payment->getMethodInstance()->getIsCentinelValidationEnabled()) { + if (!$payment->getMethod() + || !$payment->getMethodInstance() + || $payment->getMethodInstance()->getIsDummy() + || !$payment->getMethodInstance()->getIsCentinelValidationEnabled()) + { return ''; } return parent::_toHtml(); diff --git a/app/code/core/Mage/Checkout/Block/Cart/Shipping.php b/app/code/core/Mage/Checkout/Block/Cart/Shipping.php index 26fac6ccd5..67c5ddc1d0 100644 --- a/app/code/core/Mage/Checkout/Block/Cart/Shipping.php +++ b/app/code/core/Mage/Checkout/Block/Cart/Shipping.php @@ -27,10 +27,30 @@ class Mage_Checkout_Block_Cart_Shipping extends Mage_Checkout_Block_Cart_Abstract { + /** + * Available Carriers Instances + * @var null|array + */ protected $_carriers = null; + + /** + * Estimate Rates + * @var array + */ protected $_rates = array(); + + /** + * Address Model + * + * @var array + */ protected $_address = array(); + /** + * Get Estimate Rates + * + * @return array + */ public function getEstimateRates() { if (empty($this->_rates)) { @@ -41,7 +61,7 @@ public function getEstimateRates() } /** - * Get address model + * Get Address Model * * @return Mage_Sales_Model_Quote_Address */ @@ -53,6 +73,12 @@ public function getAddress() return $this->_address; } + /** + * Get Carrier Name + * + * @param string $carrierCode + * @return mixed + */ public function getCarrierName($carrierCode) { if ($name = Mage::getStoreConfig('carriers/'.$carrierCode.'/title')) { @@ -61,51 +87,107 @@ public function getCarrierName($carrierCode) return $carrierCode; } + /** + * Get Shipping Method + * + * @return string + */ public function getAddressShippingMethod() { return $this->getAddress()->getShippingMethod(); } + /** + * Get Estimate Country Id + * + * @return string + */ public function getEstimateCountryId() { return $this->getAddress()->getCountryId(); } + /** + * Get Estimate Postcode + * + * @return string + */ public function getEstimatePostcode() { return $this->getAddress()->getPostcode(); } + /** + * Get Estimate City + * + * @return string + */ public function getEstimateCity() { return $this->getAddress()->getCity(); } + /** + * Get Estimate Region Id + * + * @return mixed + */ public function getEstimateRegionId() { return $this->getAddress()->getRegionId(); } + /** + * Get Estimate Region + * + * @return string + */ public function getEstimateRegion() { return $this->getAddress()->getRegion(); } + /** + * Show City in Shipping Estimation + * + * @return bool + */ public function getCityActive() { - return (bool)Mage::getStoreConfig('carriers/dhl/active'); + return (bool)Mage::getStoreConfig('carriers/dhl/active') + || (bool)Mage::getStoreConfig('carriers/dhlint/active'); } + /** + * Show State in Shipping Estimation + * + * @return bool + */ public function getStateActive() { - return (bool)Mage::getStoreConfig('carriers/dhl/active') || (bool)Mage::getStoreConfig('carriers/tablerate/active'); + return (bool)Mage::getStoreConfig('carriers/dhl/active') + || (bool)Mage::getStoreConfig('carriers/tablerate/active') + || (bool)Mage::getStoreConfig('carriers/dhlint/active'); } + /** + * Convert price from default currency to current currency + * + * @param float $price + * @return float + */ public function formatPrice($price) { return $this->getQuote()->getStore()->convertPrice($price, true); } + /** + * Get Shipping Price + * + * @param float $price + * @param bool $flag + * @return float + */ public function getShippingPrice($price, $flag) { return $this->formatPrice($this->helper('tax')->getShippingPrice( diff --git a/app/code/core/Mage/Checkout/Block/Onepage.php b/app/code/core/Mage/Checkout/Block/Onepage.php index 7b9abee9ee..40bc4c76a9 100644 --- a/app/code/core/Mage/Checkout/Block/Onepage.php +++ b/app/code/core/Mage/Checkout/Block/Onepage.php @@ -33,19 +33,24 @@ */ class Mage_Checkout_Block_Onepage extends Mage_Checkout_Block_Onepage_Abstract { + /** + * Get 'one step checkout' step data + * + * @return array + */ public function getSteps() { $steps = array(); + $stepCodes = $this->_getStepCodes(); - if (!$this->isCustomerLoggedIn()) { - $steps['login'] = $this->getCheckout()->getStepData('login'); + if ($this->isCustomerLoggedIn()) { + $stepCodes = array_diff($stepCodes, array('login')); } - $stepCodes = array('billing', 'shipping', 'shipping_method', 'payment', 'review'); - foreach ($stepCodes as $step) { $steps[$step] = $this->getCheckout()->getStepData($step); } + return $steps; } diff --git a/app/code/core/Mage/Checkout/Block/Onepage/Abstract.php b/app/code/core/Mage/Checkout/Block/Onepage/Abstract.php index 50bd5e871f..50b7018dd4 100644 --- a/app/code/core/Mage/Checkout/Block/Onepage/Abstract.php +++ b/app/code/core/Mage/Checkout/Block/Onepage/Abstract.php @@ -200,6 +200,17 @@ public function getCountryOptions() return $options; } + /** + * Get checkout steps codes + * + * @return array + */ + protected function _getStepCodes() + { + return array('login', 'billing', 'shipping', 'shipping_method', 'payment', 'review'); + } + + /** * Retrieve is allow and show block * diff --git a/app/code/core/Mage/Checkout/Block/Onepage/Progress.php b/app/code/core/Mage/Checkout/Block/Onepage/Progress.php index ebc9845adb..653359f3e7 100644 --- a/app/code/core/Mage/Checkout/Block/Onepage/Progress.php +++ b/app/code/core/Mage/Checkout/Block/Onepage/Progress.php @@ -69,6 +69,30 @@ public function getPaymentHtml() return $this->getChildHtml('payment_info'); } + /** + * Get is step completed. if is set 'toStep' then all steps after him is not completed. + * + * @param string $currentStep + * @see: Mage_Checkout_Block_Onepage_Abstract::_getStepCodes() for allowed values + * @return bool + */ + public function isStepComplete($currentStep) + { + $stepsRevertIndex = array_flip($this->_getStepCodes()); + + $toStep = $this->getRequest()->getParam('toStep'); + + if (empty($toStep) || !isset($stepsRevertIndex[$currentStep])) { + return $this->getCheckout()->getStepData($currentStep, 'complete'); + } + + if ($stepsRevertIndex[$currentStep] > $stepsRevertIndex[$toStep]) { + return false; + } + + return $this->getCheckout()->getStepData($currentStep, 'complete'); + } + /** * Get quote shipping price including tax * @return float diff --git a/app/code/core/Mage/Checkout/Helper/Data.php b/app/code/core/Mage/Checkout/Helper/Data.php index 6e18cbdfce..f4bf8344ff 100644 --- a/app/code/core/Mage/Checkout/Helper/Data.php +++ b/app/code/core/Mage/Checkout/Helper/Data.php @@ -31,7 +31,8 @@ */ class Mage_Checkout_Helper_Data extends Mage_Core_Helper_Abstract { - const XML_PATH_GUEST_CHECKOUT = 'checkout/options/guest_checkout'; + const XML_PATH_GUEST_CHECKOUT = 'checkout/options/guest_checkout'; + const XML_PATH_CUSTOMER_MUST_BE_LOGGED = 'checkout/options/customer_must_be_logged'; protected $_agreements = null; @@ -294,4 +295,14 @@ public function isContextCheckout() { return (Mage::app()->getRequest()->getParam('context') == 'checkout'); } + + /** + * Check if user must be logged during checkout process + * + * @return boolean + */ + public function isCustomerMustBeLogged() + { + return Mage::getStoreConfigFlag(self::XML_PATH_CUSTOMER_MUST_BE_LOGGED); + } } diff --git a/app/code/core/Mage/Checkout/Helper/Url.php b/app/code/core/Mage/Checkout/Helper/Url.php index 06dc5e8d22..a85d45fc1e 100644 --- a/app/code/core/Mage/Checkout/Helper/Url.php +++ b/app/code/core/Mage/Checkout/Helper/Url.php @@ -92,4 +92,14 @@ public function getOPCheckoutUrl() { return $this->_getUrl('checkout/onepage'); } + + /** + * Url to Registration Page + * + * @return string + */ + public function getRegistrationUrl() + { + return $this->_getUrl('customer/account/create'); + } } diff --git a/app/code/core/Mage/Checkout/Model/Cart.php b/app/code/core/Mage/Checkout/Model/Cart.php index eef86350c9..03730e3a62 100644 --- a/app/code/core/Mage/Checkout/Model/Cart.php +++ b/app/code/core/Mage/Checkout/Model/Cart.php @@ -436,11 +436,15 @@ public function save() return $this; } + /** + * Mark all quote items as deleted (empty shopping cart) + * + * @return Mage_Checkout_Model_Cart + */ public function truncate() { - foreach ($this->getQuote()->getItemsCollection() as $item) { - $item->isDeleted(true); - } + $this->getQuote()->removeAllItems(); + return $this; } public function getProductIds() diff --git a/app/code/core/Mage/Checkout/Model/Type/Multishipping.php b/app/code/core/Mage/Checkout/Model/Type/Multishipping.php index 93edf95e48..49b70b0a9c 100644 --- a/app/code/core/Mage/Checkout/Model/Type/Multishipping.php +++ b/app/code/core/Mage/Checkout/Model/Type/Multishipping.php @@ -245,7 +245,7 @@ public function setShippingItemsInformation($info) !$_item->getParentItem() && !$_item->getMultishippingQty() ) { - $_item->delete(); + $quote->removeItem($_item->getId()); } } @@ -268,7 +268,7 @@ public function setShippingItemsInformation($info) $quote->getBillingAddress()->addItem($_item); } else { $_item->setQty(0); - $_item->delete(); + $quote->removeItem($_item->getId()); } } @@ -296,13 +296,9 @@ protected function _addShippingItem($quoteItemId, $data) if ($addressId && $quoteItem) { /** - * Decrease quote item QTY if address item has QTY 0 and skip this item processing + * Skip item processing if qty 0 */ if ($qty === 0) { - $quoteItemQty = $quoteItem->getQty(); - if ($quoteItemQty > 0) { - $quoteItem->setQty($quoteItemQty-1); - } return $this; } $quoteItem->setMultishippingQty((int)$quoteItem->getMultishippingQty()+$qty); @@ -464,33 +460,32 @@ protected function _prepareOrder(Mage_Sales_Model_Quote_Address $address) */ protected function _validate() { - $helper = Mage::helper('checkout'); $quote = $this->getQuote(); if (!$quote->getIsMultiShipping()) { - Mage::throwException($helper->__('Invalid checkout type.')); + Mage::throwException(Mage::helper('checkout')->__('Invalid checkout type.')); } /** @var $paymentMethod Mage_Payment_Model_Method_Abstract */ $paymentMethod = $quote->getPayment()->getMethodInstance(); if (!empty($paymentMethod) && !$paymentMethod->isAvailable($quote)) { - Mage::throwException($helper->__('Please specify payment method.')); + Mage::throwException(Mage::helper('checkout')->__('Please specify payment method.')); } $addresses = $quote->getAllShippingAddresses(); foreach ($addresses as $address) { $addressValidation = $address->validate(); if ($addressValidation !== true) { - Mage::throwException($helper->__('Please check shipping addresses information.')); + Mage::throwException(Mage::helper('checkout')->__('Please check shipping addresses information.')); } $method= $address->getShippingMethod(); $rate = $address->getShippingRateByCode($method); if (!$method || !$rate) { - Mage::throwException($helper->__('Please specify shipping methods for all addresses.')); + Mage::throwException(Mage::helper('checkout')->__('Please specify shipping methods for all addresses.')); } } $addressValidation = $quote->getBillingAddress()->validate(); if ($addressValidation !== true) { - Mage::throwException($helper->__('Please check billing address information.')); + Mage::throwException(Mage::helper('checkout')->__('Please check billing address information.')); } return $this; } diff --git a/app/code/core/Mage/Checkout/Model/Type/Onepage.php b/app/code/core/Mage/Checkout/Model/Type/Onepage.php index 7ad0cca693..50be9c13b1 100644 --- a/app/code/core/Mage/Checkout/Model/Type/Onepage.php +++ b/app/code/core/Mage/Checkout/Model/Type/Onepage.php @@ -70,7 +70,7 @@ class Mage_Checkout_Model_Type_Onepage public function __construct() { $this->_helper = Mage::helper('checkout'); - $this->_customerEmailExistsMessage = $this->_helper->__('There is already a customer registered using this email address. Please login using this email address or enter a different email address to register your account.'); + $this->_customerEmailExistsMessage = Mage::helper('checkout')->__('There is already a customer registered using this email address. Please login using this email address or enter a different email address to register your account.'); $this->_checkoutSession = Mage::getSingleton('checkout/session'); $this->_customerSession = Mage::getSingleton('customer/session'); } @@ -196,7 +196,7 @@ public function getCheckoutMehod() public function saveCheckoutMethod($method) { if (empty($method)) { - return array('error' => -1, 'message' => $this->_helper->__('Invalid data.')); + return array('error' => -1, 'message' => Mage::helper('checkout')->__('Invalid data.')); } $this->getQuote()->setCheckoutMethod($method)->save(); @@ -231,7 +231,7 @@ public function getAddress($addressId) public function saveBilling($data, $customerAddressId) { if (empty($data)) { - return array('error' => -1, 'message' => $this->_helper->__('Invalid data.')); + return array('error' => -1, 'message' => Mage::helper('checkout')->__('Invalid data.')); } $address = $this->getQuote()->getBillingAddress(); @@ -246,7 +246,7 @@ public function saveBilling($data, $customerAddressId) if ($customerAddress->getId()) { if ($customerAddress->getCustomerId() != $this->getQuote()->getCustomerId()) { return array('error' => 1, - 'message' => $this->_helper->__('Customer Address is not valid.') + 'message' => Mage::helper('checkout')->__('Customer Address is not valid.') ); } @@ -272,7 +272,7 @@ public function saveBilling($data, $customerAddressId) $address->setData($attribute->getAttributeCode(), NULL); } } - + $address->setCustomerAddressId(null); // Additional form data, not fetched by extractData (as it fetches only attributes) $address->setSaveInAddressBook(empty($data['save_in_address_book']) ? 0 : 1); } @@ -479,7 +479,7 @@ protected function _processValidateCustomer(Mage_Sales_Model_Quote_Address $addr if (!Zend_Validate::is($email, 'EmailAddress')) { return array( 'error' => -1, - 'message' => $this->_helper->__('Invalid email address "%s"', $email) + 'message' => Mage::helper('checkout')->__('Invalid email address "%s"', $email) ); } } @@ -497,7 +497,7 @@ protected function _processValidateCustomer(Mage_Sales_Model_Quote_Address $addr public function saveShipping($data, $customerAddressId) { if (empty($data)) { - return array('error' => -1, 'message' => $this->_helper->__('Invalid data.')); + return array('error' => -1, 'message' => Mage::helper('checkout')->__('Invalid data.')); } $address = $this->getQuote()->getShippingAddress(); @@ -512,7 +512,7 @@ public function saveShipping($data, $customerAddressId) if ($customerAddress->getId()) { if ($customerAddress->getCustomerId() != $this->getQuote()->getCustomerId()) { return array('error' => 1, - 'message' => $this->_helper->__('Customer Address is not valid.') + 'message' => Mage::helper('checkout')->__('Customer Address is not valid.') ); } @@ -569,11 +569,11 @@ public function saveShipping($data, $customerAddressId) public function saveShippingMethod($shippingMethod) { if (empty($shippingMethod)) { - return array('error' => -1, 'message' => $this->_helper->__('Invalid shipping method.')); + return array('error' => -1, 'message' => Mage::helper('checkout')->__('Invalid shipping method.')); } $rate = $this->getQuote()->getShippingAddress()->getShippingRateByCode($shippingMethod); if (!$rate) { - return array('error' => -1, 'message' => $this->_helper->__('Invalid shipping method.')); + return array('error' => -1, 'message' => Mage::helper('checkout')->__('Invalid shipping method.')); } $this->getQuote()->getShippingAddress() ->setShippingMethod($shippingMethod); @@ -594,7 +594,7 @@ public function saveShippingMethod($shippingMethod) public function savePayment($data) { if (empty($data)) { - return array('error' => -1, 'message' => $this->_helper->__('Invalid data.')); + return array('error' => -1, 'message' => Mage::helper('checkout')->__('Invalid data.')); } $quote = $this->getQuote(); if ($quote->isVirtual()) { @@ -625,14 +625,13 @@ public function savePayment($data) */ public function validate() { - $helper = Mage::helper('checkout'); $quote = $this->getQuote(); if ($quote->getIsMultiShipping()) { - Mage::throwException($helper->__('Invalid checkout type.')); + Mage::throwException(Mage::helper('checkout')->__('Invalid checkout type.')); } if ($quote->getCheckoutMethod() == self::METHOD_GUEST && !$quote->isAllowedGuestCheckout()) { - Mage::throwException($this->_helper->__('Sorry, guest checkout is not enabled. Please try again or contact store owner.')); + Mage::throwException(Mage::helper('checkout')->__('Sorry, guest checkout is not enabled. Please try again or contact store owner.')); } } @@ -838,31 +837,30 @@ public function saveOrder() */ protected function validateOrder() { - $helper = Mage::helper('checkout'); if ($this->getQuote()->getIsMultiShipping()) { - Mage::throwException($helper->__('Invalid checkout type.')); + Mage::throwException(Mage::helper('checkout')->__('Invalid checkout type.')); } if (!$this->getQuote()->isVirtual()) { $address = $this->getQuote()->getShippingAddress(); $addressValidation = $address->validate(); if ($addressValidation !== true) { - Mage::throwException($helper->__('Please check shipping address information.')); + Mage::throwException(Mage::helper('checkout')->__('Please check shipping address information.')); } $method= $address->getShippingMethod(); $rate = $address->getShippingRateByCode($method); if (!$this->getQuote()->isVirtual() && (!$method || !$rate)) { - Mage::throwException($helper->__('Please specify shipping method.')); + Mage::throwException(Mage::helper('checkout')->__('Please specify shipping method.')); } } $addressValidation = $this->getQuote()->getBillingAddress()->validate(); if ($addressValidation !== true) { - Mage::throwException($helper->__('Please check billing address information.')); + Mage::throwException(Mage::helper('checkout')->__('Please check billing address information.')); } if (!($this->getQuote()->getPayment()->getMethod())) { - Mage::throwException($helper->__('Please select valid payment method.')); + Mage::throwException(Mage::helper('checkout')->__('Please select valid payment method.')); } } @@ -922,7 +920,7 @@ public function getLastOrderId() // * Related to issue with some browsers when checkout method was not saved during first step. // */ // if (!$this->getQuote()->getCheckoutMethod()) { -// if ($this->_helper->isAllowedGuestCheckout($this->getQuote(), $this->getQuote()->getStore())) { +// if (Mage::helper('checkout')->isAllowedGuestCheckout($this->getQuote(), $this->getQuote()->getStore())) { // $this->getQuote()->setCheckoutMethod(Mage_Sales_Model_Quote::CHECKOUT_METHOD_GUEST); // } else { // $this->getQuote()->setCheckoutMethod(Mage_Sales_Model_Quote::CHECKOUT_METHOD_REGISTER); @@ -932,7 +930,7 @@ public function getLastOrderId() // switch ($this->getQuote()->getCheckoutMethod()) { // case Mage_Sales_Model_Quote::CHECKOUT_METHOD_GUEST: // if (!$this->getQuote()->isAllowedGuestCheckout()) { -// Mage::throwException($this->_helper->__('Sorry, guest checkout is not enabled. Please try again or contact the store owner.')); +// Mage::throwException(Mage::helper('checkout')->__('Sorry, guest checkout is not enabled. Please try again or contact the store owner.')); // } // $this->getQuote()->setCustomerId(null) // ->setCustomerEmail($billing->getEmail()) diff --git a/app/code/core/Mage/Checkout/controllers/CartController.php b/app/code/core/Mage/Checkout/controllers/CartController.php index 35903de569..f925eb3e7d 100644 --- a/app/code/core/Mage/Checkout/controllers/CartController.php +++ b/app/code/core/Mage/Checkout/controllers/CartController.php @@ -368,9 +368,30 @@ public function updateItemOptionsAction() } /** - * Update shoping cart data action + * Update shopping cart data action */ public function updatePostAction() + { + $updateAction = (string)$this->getRequest()->getParam('update_cart_action'); + + switch ($updateAction) { + case 'empty_cart': + $this->_emptyShoppingCart(); + break; + case 'update_qty': + $this->_updateShoppingCart(); + break; + default: + $this->_updateShoppingCart(); + } + + $this->_goBack(); + } + + /** + * Update customer's shopping cart + */ + protected function _updateShoppingCart() { try { $cartData = $this->getRequest()->getParam('cart'); @@ -399,7 +420,21 @@ public function updatePostAction() $this->_getSession()->addException($e, $this->__('Cannot update shopping cart.')); Mage::logException($e); } - $this->_goBack(); + } + + /** + * Empty customer's shopping cart + */ + protected function _emptyShoppingCart() + { + try { + $this->_getCart()->truncate()->save(); + $this->_getSession()->setCartWasUpdated(true); + } catch (Mage_Core_Exception $exception) { + $this->_getSession()->addError($exception->getMessage()); + } catch (Exception $exception) { + $this->_getSession()->addException($exception, $this->__('Cannot update shopping cart.')); + } } /** @@ -481,7 +516,7 @@ public function couponPostAction() ->collectTotals() ->save(); - if ($couponCode) { + if (strlen($couponCode)) { if ($couponCode == $this->_getQuote()->getCouponCode()) { $this->_getSession()->addSuccess( $this->__('Coupon code "%s" was applied.', Mage::helper('core')->htmlEscape($couponCode)) diff --git a/app/code/core/Mage/Checkout/controllers/OnepageController.php b/app/code/core/Mage/Checkout/controllers/OnepageController.php index 536530122f..88ca7e9e50 100644 --- a/app/code/core/Mage/Checkout/controllers/OnepageController.php +++ b/app/code/core/Mage/Checkout/controllers/OnepageController.php @@ -47,6 +47,12 @@ public function preDispatch() $checkoutSessionQuote->removeAllAddresses(); } + if(!$this->_canShowForUnregisteredUsers()){ + $this->norouteAction(); + $this->setFlag('',self::FLAG_NO_DISPATCH,true); + return; + } + return $this; } @@ -580,4 +586,17 @@ protected function _filterPostData($data) $data = $this->_filterDates($data, array('dob')); return $data; } + + /** + * Check can page show for unregistered users + * + * @return boolean + */ + protected function _canShowForUnregisteredUsers() + { + return Mage::getSingleton('customer/session')->isLoggedIn() + || $this->getRequest()->getActionName() == 'index' + || Mage::helper('checkout')->isAllowedGuestCheckout($this->getOnepage()->getQuote()) + || !Mage::helper('checkout')->isCustomerMustBeLogged(); + } } diff --git a/app/code/core/Mage/Checkout/etc/config.xml b/app/code/core/Mage/Checkout/etc/config.xml index 6f1a381831..bc13fa2e1e 100644 --- a/app/code/core/Mage/Checkout/etc/config.xml +++ b/app/code/core/Mage/Checkout/etc/config.xml @@ -170,6 +170,7 @@ + /checkout/cart /checkout/onepage /checkout/multishipping diff --git a/app/code/core/Mage/Checkout/etc/system.xml b/app/code/core/Mage/Checkout/etc/system.xml index 499ddd004a..801c2ec288 100644 --- a/app/code/core/Mage/Checkout/etc/system.xml +++ b/app/code/core/Mage/Checkout/etc/system.xml @@ -62,6 +62,16 @@ 1 1 + + + select + adminhtml/system_config_source_yesno + 0 + 15 + 1 + 1 + 0 + select diff --git a/app/code/core/Mage/Cms/Helper/Page.php b/app/code/core/Mage/Cms/Helper/Page.php index af9d4ecb5d..86f95dfd1f 100644 --- a/app/code/core/Mage/Cms/Helper/Page.php +++ b/app/code/core/Mage/Cms/Helper/Page.php @@ -80,7 +80,8 @@ protected function _renderPage(Mage_Core_Controller_Varien_Action $action, $pag return false; } - $inRange = Mage::app()->getLocale()->isStoreDateInInterval(null, $page->getCustomThemeFrom(), $page->getCustomThemeTo()); + $inRange = Mage::app()->getLocale() + ->isStoreDateInInterval(null, $page->getCustomThemeFrom(), $page->getCustomThemeTo()); if ($page->getCustomTheme()) { if ($inRange) { @@ -105,15 +106,16 @@ protected function _renderPage(Mage_Core_Controller_Varien_Action $action, $pag Mage::dispatchEvent('cms_page_render', array('page' => $page, 'controller_action' => $action)); - $action->loadLayoutUpdates(); - $layoutUpdate = ($page->getCustomLayoutUpdateXml() && $inRange) ? $page->getCustomLayoutUpdateXml() : $page->getLayoutUpdateXml(); + $layoutUpdate = ($page->getCustomLayoutUpdateXml() && $inRange) + ? $page->getCustomLayoutUpdateXml() : $page->getLayoutUpdateXml(); $action->getLayout()->getUpdate()->addUpdate($layoutUpdate); $action->generateLayoutXml()->generateLayoutBlocks(); $contentHeadingBlock = $action->getLayout()->getBlock('page_content_heading'); if ($contentHeadingBlock) { - $contentHeadingBlock->setContentHeading($page->getContentHeading()); + $contentHeading = $this->escapeHtml($page->getContentHeading()); + $contentHeadingBlock->setContentHeading($contentHeading); } if ($page->getRootTemplate()) { diff --git a/app/code/core/Mage/Cms/sql/cms_setup/install-1.6.0.0.php b/app/code/core/Mage/Cms/sql/cms_setup/install-1.6.0.0.php index 3f80bfc8d9..b9829ca711 100644 --- a/app/code/core/Mage/Cms/sql/cms_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Cms/sql/cms_setup/install-1.6.0.0.php @@ -107,8 +107,8 @@ 'nullable' => true, ), 'Page Meta Description') ->addColumn('identifier', Varien_Db_Ddl_Table::TYPE_TEXT, 100, array( - 'nullable' => false, - 'default' => '', + 'nullable' => true, + 'default' => null, ), 'Page String Identifier') ->addColumn('content_heading', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array( 'nullable' => true, diff --git a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Abstract.php b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Abstract.php index 02c5a84942..a87c0f4cdc 100644 --- a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Abstract.php +++ b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Abstract.php @@ -148,7 +148,7 @@ public function getAddFileDepsRowButtonHtml($selector='span', $filesClass='files */ public function getTabLabel() { - return Mage::helper('connect')->__(''); + return ''; } /** @@ -158,7 +158,7 @@ public function getTabLabel() */ public function getTabTitle() { - return Mage::helper('connect')->__(''); + return ''; } public function canShowTab() diff --git a/app/code/core/Mage/Connect/Model/Extension.php b/app/code/core/Mage/Connect/Model/Extension.php index 6ffb621e54..f5a8750771 100644 --- a/app/code/core/Mage/Connect/Model/Extension.php +++ b/app/code/core/Mage/Connect/Model/Extension.php @@ -24,7 +24,6 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -require_once 'Mage/Connect/Package.php'; // TODO /** * Extension model @@ -158,8 +157,9 @@ protected function packageFilesToArray($filesString) */ protected function _setDependencies() { - $this->getPackage()->clearDependencies(); - $this->getPackage()->setDependencyPhpVersion($this->getData('depends_php_min'), $this->getData('depends_php_max')); + $this->getPackage() + ->clearDependencies() + ->setDependencyPhpVersion($this->getData('depends_php_min'), $this->getData('depends_php_max')); foreach ($this->getData('depends') as $deptype=>$deps) { foreach ($deps['name'] as $i=>$type) { @@ -174,7 +174,9 @@ protected function _setDependencies() $packageFiles = $this->packageFilesToArray($files); if ($deptype !== 'extension') { - $channel = !empty($deps['channel'][$i]) ? $deps['channel'][$i] : 'connect.magentocommerce.com/core'; + $channel = !empty($deps['channel'][$i]) + ? $deps['channel'][$i] + : 'connect.magentocommerce.com/core'; } switch ($deptype) { case 'package': diff --git a/app/code/core/Mage/Connect/controllers/Adminhtml/Extension/CustomController.php b/app/code/core/Mage/Connect/controllers/Adminhtml/Extension/CustomController.php index 3c9237cd21..897dc6b01b 100644 --- a/app/code/core/Mage/Connect/controllers/Adminhtml/Extension/CustomController.php +++ b/app/code/core/Mage/Connect/controllers/Adminhtml/Extension/CustomController.php @@ -43,7 +43,6 @@ public function indexAction() ->_title($this->__('Magento Connect')) ->_title($this->__('Package Extensions')); - Mage::app()->getStore()->setStoreId(1); $this->_forward('edit'); } @@ -131,7 +130,6 @@ public function saveAction() if (empty($create)) { $this->_redirect('*/*/edit'); } else { - Mage::app()->getStore()->setStoreId(1); $this->_forward('create'); } } catch (Mage_Core_Exception $e){ diff --git a/app/code/core/Mage/Core/Block/Html/Select.php b/app/code/core/Mage/Core/Block/Html/Select.php index 61248dc419..5e57f5a337 100644 --- a/app/code/core/Mage/Core/Block/Html/Select.php +++ b/app/code/core/Mage/Core/Block/Html/Select.php @@ -30,71 +30,128 @@ * * @category Mage * @package Mage_Core - * @author Magento Core Team + * @author Magento Core Team */ class Mage_Core_Block_Html_Select extends Mage_Core_Block_Abstract { protected $_options = array(); + /** + * Get options of the element + * + * @return array + */ public function getOptions() { return $this->_options; } + /** + * Set options for the HTML select + * + * @param array $options + * @return Mage_Core_Block_Html_Select + */ public function setOptions($options) { $this->_options = $options; return $this; } + /** + * Add an option to HTML select + * + * @param string $value HTML value + * @param string $label HTML label + * @param array $params HTML attributes + * @return Mage_Core_Block_Html_Select + */ public function addOption($value, $label, $params=array()) { $this->_options[] = array('value' => $value, 'label' => $label, 'params' => $params); return $this; } + /** + * Set element's HTML ID + * + * @param string $id ID + * @return Mage_Core_Block_Html_Select + */ public function setId($id) { $this->setData('id', $id); return $this; } + /** + * Set element's CSS class + * + * @param string $class Class + * @return Mage_Core_Block_Html_Select + */ public function setClass($class) { $this->setData('class', $class); return $this; } + /** + * Set element's HTML title + * + * @param string $title Title + * @return Mage_Core_Block_Html_Select + */ public function setTitle($title) { $this->setData('title', $title); return $this; } + /** + * HTML ID of the element + * + * @return string + */ public function getId() { return $this->getData('id'); } + /** + * CSS class of the element + * + * @return string + */ public function getClass() { return $this->getData('class'); } + /** + * Returns HTML title of the element + * + * @return string + */ public function getTitle() { return $this->getData('title'); } + /** + * Render HTML + * + * @return string + */ protected function _toHtml() { if (!$this->_beforeToHtml()) { return ''; } - $html = 'getExtraParams() . '>'; $values = $this->getValue(); if (!is_array($values)){ @@ -109,17 +166,17 @@ protected function _toHtml() foreach ($this->getOptions() as $key => $option) { if ($isArrayOption && is_array($option)) { $value = $option['value']; - $label = $option['label']; + $label = (string)$option['label']; $params = (!empty($option['params'])) ? $option['params'] : array(); } else { - $value = $key; - $label = $option; + $value = (string)$key; + $label = (string)$option; $isArrayOption = false; $params = array(); } if (is_array($value)) { - $html.= ''; + $html .= ''; foreach ($value as $keyGroup => $optionGroup) { if (!is_array($optionGroup)) { $optionGroup = array( @@ -127,23 +184,24 @@ protected function _toHtml() 'label' => $optionGroup ); } - $html.= $this->_optionToHtml( + $html .= $this->_optionToHtml( $optionGroup, in_array($optionGroup['value'], $values) ); } - $html.= ''; + $html .= ''; } else { - $html.= $this->_optionToHtml(array( - 'value' => $value, - 'label' => $label, - 'params' => $params - ), + $html .= $this->_optionToHtml( + array( + 'value' => $value, + 'label' => $label, + 'params' => $params + ), in_array($value, $values) ); } } - $html.= ''; + $html .= ''; return $html; } @@ -175,17 +233,28 @@ protected function _optionToHtml($option, $selected = false) } return sprintf('', - $this->htmlEscape($option['value']), + $this->escapeHtml($option['value']), $selectedHtml, $params, - $this->htmlEscape($option['label'])); + $this->escapeHtml($option['label'])); } + /** + * Alias for toHtml() + * + * @return string + */ public function getHtml() { return $this->toHtml(); } + /** + * Calculate CRC32 hash for option value + * + * @param string $optionValue Value of the option + * @return string + */ public function calcOptionHash($optionValue) { return sprintf('%u', crc32($this->getName() . $this->getId() . $optionValue)); diff --git a/app/code/core/Mage/Core/Controller/Varien/Action.php b/app/code/core/Mage/Core/Controller/Varien/Action.php index 805864ec54..ff21e8be0b 100644 --- a/app/code/core/Mage/Core/Controller/Varien/Action.php +++ b/app/code/core/Mage/Core/Controller/Varien/Action.php @@ -452,14 +452,21 @@ public function dispatch($action) } } + /** + * Retrieve action method name + * + * @param string $action + * @return string + */ public function getActionMethodName($action) { - $method = $action.'Action'; - return $method; + return $action . 'Action'; } /** - * Dispatches event before action + * Dispatch event before action + * + * @return null */ public function preDispatch() { @@ -493,7 +500,8 @@ public function preDispatch() Mage::app()->loadArea($this->getLayout()->getArea()); if ($this->getFlag('', self::FLAG_NO_COOKIES_REDIRECT) - && Mage::getStoreConfig('web/browser_capabilities/cookies')) { + && Mage::getStoreConfig('web/browser_capabilities/cookies') + ) { $this->_forward('noCookies', 'index', 'core'); return; } @@ -502,16 +510,13 @@ public function preDispatch() return; } - Mage::dispatchEvent('controller_action_predispatch', array('controller_action'=>$this)); - Mage::dispatchEvent( - 'controller_action_predispatch_'.$this->getRequest()->getRouteName(), - array('controller_action'=>$this) - ); Varien_Autoload::registerScope($this->getRequest()->getRouteName()); - Mage::dispatchEvent( - 'controller_action_predispatch_'.$this->getFullActionName(), - array('controller_action'=>$this) - ); + + Mage::dispatchEvent('controller_action_predispatch', array('controller_action' => $this)); + Mage::dispatchEvent('controller_action_predispatch_' . $this->getRequest()->getRouteName(), + array('controller_action' => $this)); + Mage::dispatchEvent('controller_action_predispatch_' . $this->getFullActionName(), + array('controller_action' => $this)); } /** @@ -745,6 +750,8 @@ protected function _getRefererUrl() $refererUrl = Mage::helper('core')->urlDecode($url); } + $refererUrl = Mage::helper('core')->escapeUrl($refererUrl); + if (!$this->_isUrlInternal($refererUrl)) { $refererUrl = Mage::app()->getStore()->getBaseUrl(); } diff --git a/app/code/core/Mage/Core/Helper/Data.php b/app/code/core/Mage/Core/Helper/Data.php index 6b602365df..2e907117cc 100644 --- a/app/code/core/Mage/Core/Helper/Data.php +++ b/app/code/core/Mage/Core/Helper/Data.php @@ -39,11 +39,35 @@ class Mage_Core_Helper_Data extends Mage_Core_Helper_Abstract const XML_PATH_CACHE_BETA_TYPES = 'global/cache/betatypes'; const XML_PATH_CONNECTION_TYPE = 'global/resources/default_setup/connection/type'; + const CHARS_LOWERS = 'abcdefghijklmnopqrstuvwxyz'; + const CHARS_UPPERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; + const CHARS_DIGITS = '0123456789'; + const CHARS_SPECIALS = '!$*+-.=?@^_|~'; + const CHARS_PASSWORD_LOWERS = 'abcdefghjkmnpqrstuvwxyz'; + const CHARS_PASSWORD_UPPERS = 'ABCDEFGHJKLMNPQRSTUVWXYZ'; + const CHARS_PASSWORD_DIGITS = '23456789'; + const CHARS_PASSWORD_SPECIALS = '!$*-.=?@_'; + + /** + * Config pathes to merchant country code and merchant VAT number + */ + const XML_PATH_MERCHANT_COUNTRY_CODE = 'general/store_information/merchant_country'; + const XML_PATH_MERCHANT_VAT_NUMBER = 'general/store_information/merchant_vat_number'; + const XML_PATH_EU_COUNTRIES_LIST = 'general/country/eu_countries'; + /** * @var Mage_Core_Model_Encryption */ protected $_encryptor = null; + protected $_allowedFormats = array( + Mage_Core_Model_Locale::FORMAT_TYPE_FULL, + Mage_Core_Model_Locale::FORMAT_TYPE_LONG, + Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM, + Mage_Core_Model_Locale::FORMAT_TYPE_SHORT + ); + + /** * @return Mage_Core_Model_Encryption */ @@ -125,19 +149,16 @@ public function formatPrice($price, $includeContainer = true) } /** - * Format date using current locale options + * Format date using current locale options and time zone. * - * @param date|Zend_Date|null $date in GMT timezone - * @param string $format - * @param bool $showTime + * @param date|Zend_Date|null $date + * @param string $format See Mage_Core_Model_Locale::FORMAT_TYPE_* constants + * @param bool $showTime Whether to include time * @return string */ - public function formatDate($date=null, $format='short', $showTime=false) + public function formatDate($date = null, $format = Mage_Core_Model_Locale::FORMAT_TYPE_SHORT, $showTime = false) { - if (Mage_Core_Model_Locale::FORMAT_TYPE_FULL !==$format && - Mage_Core_Model_Locale::FORMAT_TYPE_LONG !==$format && - Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM !==$format && - Mage_Core_Model_Locale::FORMAT_TYPE_SHORT !==$format) { + if (!in_array($format, $this->_allowedFormats, true)) { return $date; } if (!($date instanceof Zend_Date) && $date && !strtotime($date)) { @@ -145,15 +166,13 @@ public function formatDate($date=null, $format='short', $showTime=false) } if (is_null($date)) { $date = Mage::app()->getLocale()->date(Mage::getSingleton('core/date')->gmtTimestamp(), null, null); - } - elseif (!$date instanceof Zend_Date) { - $date = Mage::app()->getLocale()->date(strtotime($date), null, null, $showTime); + } else if (!$date instanceof Zend_Date) { + $date = Mage::app()->getLocale()->date(strtotime($date), null, null); } if ($showTime) { $format = Mage::app()->getLocale()->getDateTimeFormat($format); - } - else { + } else { $format = Mage::app()->getLocale()->getDateFormat($format); } @@ -164,33 +183,27 @@ public function formatDate($date=null, $format='short', $showTime=false) * Format time using current locale options * * @param date|Zend_Date|null $time - * @param string $format - * @param bool $showTime + * @param string $format + * @param bool $showDate * @return string */ - public function formatTime($time=null, $format='short', $showDate=false) + public function formatTime($time = null, $format = Mage_Core_Model_Locale::FORMAT_TYPE_SHORT, $showDate = false) { - if (Mage_Core_Model_Locale::FORMAT_TYPE_FULL !==$format && - Mage_Core_Model_Locale::FORMAT_TYPE_LONG !==$format && - Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM !==$format && - Mage_Core_Model_Locale::FORMAT_TYPE_SHORT !==$format) { + if (!in_array($format, $this->_allowedFormats, true)) { return $time; } if (is_null($time)) { $date = Mage::app()->getLocale()->date(time()); - } - elseif ($time instanceof Zend_Date) { + } else if ($time instanceof Zend_Date) { $date = $time; - } - else { + } else { $date = Mage::app()->getLocale()->date(strtotime($time)); } if ($showDate) { $format = Mage::app()->getLocale()->getDateTimeFormat($format); - } - else { + } else { $format = Mage::app()->getLocale()->getTimeFormat($format); } @@ -230,10 +243,10 @@ public function validateKey($key) return $this->getEncryptor()->validateKey($key); } - public function getRandomString($len, $chars=null) + public function getRandomString($len, $chars = null) { if (is_null($chars)) { - $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; + $chars = self::CHARS_LOWERS . self::CHARS_UPPERS . self::CHARS_DIGITS; } mt_srand(10000000*(double)microtime()); for ($i = 0, $str = '', $lc = strlen($chars)-1; $i < $len; $i++) { @@ -805,4 +818,37 @@ public function useDbCompatibleMode() $value = (string) Mage::getConfig()->getNode($path); return (bool) $value; } + + /** + * Retrieve merchant country code + * + * @return string + */ + public function getMerchantCountryCode() + { + return (string) Mage::getStoreConfig(self::XML_PATH_MERCHANT_COUNTRY_CODE); + } + + /** + * Retrieve merchant VAT number + * + * @return string + */ + public function getMerchantVatNumber() + { + return (string) Mage::getStoreConfig(self::XML_PATH_MERCHANT_VAT_NUMBER); + } + + /** + * Check whether specified country is in EU countries list + * + * @param string $countryCode + * @param null|int $storeId + * @return bool + */ + public function isCountryInEU($countryCode, $storeId = null) + { + $euCountries = explode(',', Mage::getStoreConfig(self::XML_PATH_EU_COUNTRIES_LIST, $storeId)); + return in_array($countryCode, $euCountries); + } } diff --git a/app/code/core/Mage/Core/Helper/Translate.php b/app/code/core/Mage/Core/Helper/Translate.php index 9dfa1bd768..3ef098e98d 100644 --- a/app/code/core/Mage/Core/Helper/Translate.php +++ b/app/code/core/Mage/Core/Helper/Translate.php @@ -32,11 +32,11 @@ class Mage_Core_Helper_Translate extends Mage_Core_Helper_Abstract { /** - * Save transalation data to database for specific area - * - * @param array $translate + * Save translation data to database for specific area + * + * @param array $translate * @param string $area - * @param string $return_type + * @param string $returnType * @return string */ public function apply($translate, $area, $returnType = 'json') @@ -49,6 +49,30 @@ public function apply($translate, $area, $returnType = 'json') return $returnType == 'json' ? "{success:true}" : true; } catch (Exception $e) { return $returnType == 'json' ? "{error:true,message:'" . $e->getMessage() . "'}" : false; - } + } + } + + /** + * Sets escaping start marker which then processed by inline translation model + * + * @see Mage_Core_Model_Translate_Inline::_escapeInline() + * @param string $escapeChar Char to escape (default = ') + * @return string + */ + public function inlineEscapeStartMarker($escapeChar = "'") + { + $escapeChar = str_replace('"', '\"', $escapeChar); + return "{{escape={$escapeChar}}}"; + } + + /** + * Sets escaping end marker which then processed by inline translation model + * + * @see Mage_Core_Model_Translate_Inline::_escapeInline() + * @return string + */ + public function inlineEscapeEndMarker() + { + return '{{escape}}'; } } diff --git a/app/code/core/Mage/Core/Model/App.php b/app/code/core/Mage/Core/Model/App.php index 0c8556c68f..d80706d1b3 100644 --- a/app/code/core/Mage/Core/Model/App.php +++ b/app/code/core/Mage/Core/Model/App.php @@ -1213,6 +1213,18 @@ public function getRequest() return $this->_request; } + /** + * Request setter + * + * @param Mage_Core_Controller_Request_Http $request + * @return Mage_Core_Model_App + */ + public function setRequest(Mage_Core_Controller_Request_Http $request) + { + $this->_request = $request; + return $this; + } + /** * Retrieve response object * @@ -1228,6 +1240,18 @@ public function getResponse() return $this->_response; } + /** + * Response setter + * + * @param Mage_Core_Controller_Response_Http $response + * @return Mage_Core_Model_App + */ + public function setResponse(Mage_Core_Controller_Response_Http $response) + { + $this->_response = $response; + return $this; + } + public function addEventArea($area) { if (!isset($this->_events[$area])) { diff --git a/app/code/core/Mage/Core/Model/Calculator.php b/app/code/core/Mage/Core/Model/Calculator.php new file mode 100644 index 0000000000..119dfb8f0d --- /dev/null +++ b/app/code/core/Mage/Core/Model/Calculator.php @@ -0,0 +1,87 @@ + + */ +class Mage_Core_Model_Calculator +{ + /** + * Delta collected during rounding steps + * + * @var float + */ + protected $_delta = 0.0; + + /** + * Store instance + * + * @var Mage_Core_Model_Store|null + */ + protected $_store = null; + + /** + * Initialize calculator + * + * @param Mage_Core_Model_Store|int $store + */ + public function __construct($store) + { + if (!($store instanceof Mage_Core_Model_Store)) { + $store = Mage::app()->getStore($store); + } + $this->_store = $store; + } + + /** + * Round price considering delta + * + * @param float $price + * @param bool $negative Indicates if we perform addition (true) or subtraction (false) of rounded value + * @return float + */ + public function deltaRound($price, $negative = false) + { + $roundedPrice = $price; + if ($roundedPrice) { + if ($negative) { + $this->_delta = -$this->_delta; + } + $price += $this->_delta; + $roundedPrice = $this->_store->roundPrice($price); + $this->_delta = $price - $roundedPrice; + if ($negative) { + $this->_delta = -$this->_delta; + } + } + return $roundedPrice; + } +} diff --git a/app/code/core/Mage/Core/Model/Config.php b/app/code/core/Mage/Core/Model/Config.php index ee9fd31808..959250cdfe 100644 --- a/app/code/core/Mage/Core/Model/Config.php +++ b/app/code/core/Mage/Core/Model/Config.php @@ -593,8 +593,8 @@ protected function _getSectionConfig($path) if (!isset($this->_cacheSections[$section])) { return false; } - $sectioPath = array_slice($path, 0, $this->_cacheSections[$section]+1); - $sectionKey = implode('_', $sectioPath); + $sectionPath = array_slice($path, 0, $this->_cacheSections[$section]+1); + $sectionKey = implode('_', $sectionPath); if (!isset($this->_cacheLoadedSections[$sectionKey])) { Varien_Profiler::start('init_config_section:' . $sectionKey); @@ -618,7 +618,7 @@ public function getSectionNode($path) { $section = $path[0]; $config = $this->_getSectionConfig($path); - $path = array_slice($path, $this->_cacheSections[$section]+1); + $path = array_slice($path, $this->_cacheSections[$section] + 1); if ($config) { return $config->descend($path); } @@ -870,9 +870,7 @@ protected function _sortModuleDepends($modules) foreach ($moduleProp['depends'] as $dependModule => $true) { if (!isset($definedModules[$dependModule])) { Mage::throwException( - Mage::helper('core')->__( - 'Module "%1$s" cannot depend on "%2$s".', $moduleProp['module'], $dependModule - ) + Mage::helper('core')->__('Module "%1$s" cannot depend on "%2$s".', $moduleProp['module'], $dependModule) ); } } diff --git a/app/code/core/Mage/Core/Model/Cookie.php b/app/code/core/Mage/Core/Model/Cookie.php index e949ef9267..7577a3116b 100644 --- a/app/code/core/Mage/Core/Model/Cookie.php +++ b/app/code/core/Mage/Core/Model/Cookie.php @@ -198,6 +198,7 @@ public function isSecure() * @param string $path * @param string $domain * @param int|bool $secure + * @param bool $httponly * @return Mage_Core_Model_Cookie */ public function set($name, $value, $period = null, $path = null, $domain = null, $secure = null, $httponly = null) diff --git a/app/code/core/Mage/Core/Model/File/Validator/NotProtectedExtension.php b/app/code/core/Mage/Core/Model/File/Validator/NotProtectedExtension.php index fef7b2f252..5072451208 100644 --- a/app/code/core/Mage/Core/Model/File/Validator/NotProtectedExtension.php +++ b/app/code/core/Mage/Core/Model/File/Validator/NotProtectedExtension.php @@ -67,11 +67,8 @@ public function __construct() protected function _initMessageTemplates() { if (!$this->_messageTemplates) { - /** @var $helper Mage_Core_Helper_Data */ - $helper = Mage::helper('core'); $this->_messageTemplates = array( - self::PROTECTED_EXTENSION => - $helper->__('File with an extension "%value%" is protected and cannot be uploaded'), + self::PROTECTED_EXTENSION => Mage::helper('core')->__('File with an extension "%value%" is protected and cannot be uploaded'), ); } return $this; diff --git a/app/code/core/Mage/Core/Model/Locale.php b/app/code/core/Mage/Core/Model/Locale.php index eead5758a3..cb4d1cc09c 100644 --- a/app/code/core/Mage/Core/Model/Locale.php +++ b/app/code/core/Mage/Core/Model/Locale.php @@ -463,25 +463,28 @@ public function getTimeStrFormat($type) /** * Create Zend_Date object for current locale * - * @param mixed $date - * @param string $part - * @return Zend_Date - * @exception Zend_Date_Exception + * @param mixed $date + * @param string $part + * @param string|Zend_Locale $locale + * @param bool $useTimezone + * @return Zend_Date */ - public function date($date=null, $part=null, $locale=null, $useTimezone=true) + public function date($date = null, $part = null, $locale = null, $useTimezone = true) { if (is_null($locale)) { $locale = $this->getLocale(); } - // try-catch block was here + if (empty($date)) { + // $date may be false, but Zend_Date uses strict compare + $date = null; + } $date = new Zend_Date($date, $part, $locale); if ($useTimezone) { if ($timezone = Mage::app()->getStore()->getConfig(self::XML_PATH_DEFAULT_TIMEZONE)) { $date->setTimezone($timezone); } } - //$date->add(-(substr($date->get(Zend_Date::GMT_DIFF), 0,3)), Zend_Date::HOUR); return $date; } diff --git a/app/code/core/Mage/Core/Model/Resource/Abstract.php b/app/code/core/Mage/Core/Model/Resource/Abstract.php index 3ca2de8c29..21aacc295f 100644 --- a/app/code/core/Mage/Core/Model/Resource/Abstract.php +++ b/app/code/core/Mage/Core/Model/Resource/Abstract.php @@ -145,7 +145,7 @@ public function formatDate($date, $includeTime=true) */ public function mktime($str) { - return Varien_Date::formatDate($str); + return Varien_Date::toTimestamp($str); } /** diff --git a/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php b/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php index 8db14c1277..0660a708c9 100644 --- a/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php +++ b/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php @@ -244,7 +244,8 @@ protected function _initSelectFields() $column = $field; } - if (($alias !== null && in_array($alias, $columnsToSelect)) || // If field already joined from another table + if (($alias !== null && in_array($alias, $columnsToSelect)) || + // If field already joined from another table ($alias === null && isset($alias, $columnsToSelect))) { continue; } @@ -507,8 +508,8 @@ public function getAllIds() public function getData() { if ($this->_data === null) { - - + + $this->_renderFilters() ->_renderOrders() ->_renderLimit(); @@ -525,7 +526,7 @@ public function getData() /** * Prepare select for load - * + * * @return string */ protected function _prepareSelect(Varien_Db_Select $select) @@ -563,13 +564,13 @@ public function join($table, $cond, $cols = '*') $alias = $table; } - if (!isset($this->_joinedTables[$alias])) { + if (!isset($this->_joinedTables[$table])) { $this->getSelect()->join( array($alias => $this->getTable($table)), $cond, $cols ); - $this->_joinedTables[$table] = true; + $this->_joinedTables[$alias] = true; } return $this; } diff --git a/app/code/core/Mage/Core/Model/Resource/Design/Collection.php b/app/code/core/Mage/Core/Model/Resource/Design/Collection.php index e97cb40a7a..a243b61f50 100644 --- a/app/code/core/Mage/Core/Model/Resource/Design/Collection.php +++ b/app/code/core/Mage/Core/Model/Resource/Design/Collection.php @@ -51,7 +51,7 @@ protected function _construct() public function joinStore() { return $this->join( - array('cs' => $this->getTable('core/store')), + array('cs' => 'core/store'), 'cs.store_id = main_table.store_id', array('cs.name')); } diff --git a/app/code/core/Mage/Core/Model/Resource/Url/Rewrite.php b/app/code/core/Mage/Core/Model/Resource/Url/Rewrite.php index e6e22d8b3f..4fdef622aa 100644 --- a/app/code/core/Mage/Core/Model/Resource/Url/Rewrite.php +++ b/app/code/core/Mage/Core/Model/Resource/Url/Rewrite.php @@ -155,6 +155,9 @@ public function loadByRequestPath(Mage_Core_Model_Url_Rewrite $object, $path) $currentPenalty = null; $foundItem = null; foreach ($items as $item) { + if (!array_key_exists($item['request_path'], $mapPenalty)) { + continue; + } $penalty = $mapPenalty[$item['request_path']] << 1 + ($item['store_id'] ? 0 : 1); if (!$foundItem || $currentPenalty > $penalty) { $foundItem = $item; diff --git a/app/code/core/Mage/Core/Model/Resource/Variable.php b/app/code/core/Mage/Core/Model/Resource/Variable.php index 845d987e51..0826809cc7 100644 --- a/app/code/core/Mage/Core/Model/Resource/Variable.php +++ b/app/code/core/Mage/Core/Model/Resource/Variable.php @@ -136,10 +136,9 @@ protected function _getLoadSelect($field, $value, $object) */ protected function _addValueToSelect(Zend_Db_Select $select, $storeId = Mage_Core_Model_App::ADMIN_STORE_ID) { - $ifNullPlainValue = $this->_getReadAdapter() - ->getCheckSql('store.plain_value IS NULL', 'def.plain_value', 'store.plain_value'); - $ifNullHtmlValue = $this->_getReadAdapter() - ->getCheckSql('store.html_value IS NULL', 'def.html_value', 'store.html_value'); + $adapter = $this->_getReadAdapter(); + $ifNullPlainValue = $adapter->getCheckSql('store.plain_value IS NULL', 'def.plain_value', 'store.plain_value'); + $ifNullHtmlValue = $adapter->getCheckSql('store.html_value IS NULL', 'def.html_value', 'store.html_value'); $select->joinLeft( array('def' => $this->getTable('core/variable_value')), @@ -147,7 +146,7 @@ protected function _addValueToSelect(Zend_Db_Select $select, $storeId = Mage_Cor array()) ->joinLeft( array('store' => $this->getTable('core/variable_value')), - 'store.variable_id = def.variable_id AND store.store_id = ' . $storeId, + 'store.variable_id = def.variable_id AND store.store_id = ' . $adapter->quote($storeId), array()) ->columns(array( 'plain_value' => $ifNullPlainValue, diff --git a/app/code/core/Mage/Core/Model/Session/Abstract.php b/app/code/core/Mage/Core/Model/Session/Abstract.php index d705cb1aae..0f617b50b8 100644 --- a/app/code/core/Mage/Core/Model/Session/Abstract.php +++ b/app/code/core/Mage/Core/Model/Session/Abstract.php @@ -561,6 +561,17 @@ public function renewSession() $this->getCookie()->delete($this->getSessionName()); $this->regenerateSessionId(); + $sessionHosts = $this->getSessionHosts(); + $currentCookieDomain = $this->getCookie()->getDomain(); + if (is_array($sessionHosts)) { + foreach (array_keys($sessionHosts) as $host) { + // Delete cookies with the same name for parent domains + if (strpos($currentCookieDomain, $host) > 0) { + $this->getCookie()->delete($this->getSessionName(), null, $host); + } + } + } + return $this; } diff --git a/app/code/core/Mage/Core/Model/Source/Email/Variables.php b/app/code/core/Mage/Core/Model/Source/Email/Variables.php index de9b35cb59..65480ce5a5 100644 --- a/app/code/core/Mage/Core/Model/Source/Email/Variables.php +++ b/app/code/core/Mage/Core/Model/Source/Email/Variables.php @@ -47,59 +47,58 @@ class Mage_Core_Model_Source_Email_Variables */ public function __construct() { - $helper = Mage::helper('core'); $this->_configVariables = array( array( 'value' => Mage_Core_Model_Url::XML_PATH_UNSECURE_URL, - 'label' => $helper->__('Base Unsecure URL') + 'label' => Mage::helper('core')->__('Base Unsecure URL') ), array( 'value' => Mage_Core_Model_Url::XML_PATH_SECURE_URL, - 'label' => $helper->__('Base Secure URL') + 'label' => Mage::helper('core')->__('Base Secure URL') ), array( 'value' => 'trans_email/ident_general/name', - 'label' => $helper->__('General Contact Name') + 'label' => Mage::helper('core')->__('General Contact Name') ), array( 'value' => 'trans_email/ident_general/email', - 'label' => $helper->__('General Contact Email') + 'label' => Mage::helper('core')->__('General Contact Email') ), array( 'value' => 'trans_email/ident_sales/name', - 'label' => $helper->__('Sales Representative Contact Name') + 'label' => Mage::helper('core')->__('Sales Representative Contact Name') ), array( 'value' => 'trans_email/ident_sales/email', - 'label' => $helper->__('Sales Representative Contact Email') + 'label' => Mage::helper('core')->__('Sales Representative Contact Email') ), array( 'value' => 'trans_email/ident_custom1/name', - 'label' => $helper->__('Custom1 Contact Name') + 'label' => Mage::helper('core')->__('Custom1 Contact Name') ), array( 'value' => 'trans_email/ident_custom1/email', - 'label' => $helper->__('Custom1 Contact Email') + 'label' => Mage::helper('core')->__('Custom1 Contact Email') ), array( 'value' => 'trans_email/ident_custom2/name', - 'label' => $helper->__('Custom2 Contact Name') + 'label' => Mage::helper('core')->__('Custom2 Contact Name') ), array( 'value' => 'trans_email/ident_custom2/email', - 'label' => $helper->__('Custom2 Contact Email') + 'label' => Mage::helper('core')->__('Custom2 Contact Email') ), array( 'value' => 'general/store_information/name', - 'label' => $helper->__('Store Name') + 'label' => Mage::helper('core')->__('Store Name') ), array( 'value' => 'general/store_information/phone', - 'label' => $helper->__('Store Contact Telephone') + 'label' => Mage::helper('core')->__('Store Contact Telephone') ), array( 'value' => 'general/store_information/address', - 'label' => $helper->__('Store Contact Address') + 'label' => Mage::helper('core')->__('Store Contact Address') ) ); } diff --git a/app/code/core/Mage/Core/Model/Store.php b/app/code/core/Mage/Core/Model/Store.php index 4c1279123b..b939d56153 100644 --- a/app/code/core/Mage/Core/Model/Store.php +++ b/app/code/core/Mage/Core/Model/Store.php @@ -445,7 +445,7 @@ protected function _processConfigValue($fullPath, $path, $node) } elseif (strpos($sValue, '{{secure_base_url}}') !== false) { $secureBaseUrl = $this->getConfig(self::XML_PATH_SECURE_BASE_URL); $sValue = str_replace('{{secure_base_url}}', $secureBaseUrl, $sValue); - } elseif (strpos($sValue, '{{base_url}}') === false) { + } elseif (strpos($sValue, '{{base_url}}') !== false) { $sValue = Mage::getConfig()->substDistroServerVars($sValue); } } @@ -697,13 +697,7 @@ public function isCurrentlySecure() } if (Mage::isInstalled()) { - $secureBaseUrl = ''; - if (!$this->isAdmin()) { - $secureBaseUrl = Mage::getStoreConfig(Mage_Core_Model_Url::XML_PATH_SECURE_URL); - } else { - $secureBaseUrl = (string) Mage::getConfig() - ->getNode(Mage_Core_Model_Url::XML_PATH_SECURE_URL, 'default'); - } + $secureBaseUrl = Mage::getStoreConfig(Mage_Core_Model_Url::XML_PATH_SECURE_URL); if (!$secureBaseUrl) { return false; diff --git a/app/code/core/Mage/Core/Model/Translate/Inline.php b/app/code/core/Mage/Core/Model/Translate/Inline.php index b3869df656..6db6a05f52 100644 --- a/app/code/core/Mage/Core/Model/Translate/Inline.php +++ b/app/code/core/Mage/Core/Model/Translate/Inline.php @@ -202,6 +202,7 @@ public function stripInlineTranslations(&$body) } } else if (is_string($body)) { $body = preg_replace('#'.$this->_tokenRegex.'#', '$1', $body); + $body = preg_replace('/{{escape.*?}}/', '', $body); } return $this; } @@ -232,7 +233,7 @@ public function processResponseBody(&$body) $this->_specialTags(); $this->_otherText(); $this->_insertInlineScriptsHtml(); - + $this->_escapeInline(); $body = $this->_content; } @@ -247,7 +248,8 @@ protected function _insertInlineScriptsHtml() $baseJsUrl = Mage::getBaseUrl('js'); $url_prefix = Mage::app()->getStore()->isAdmin() ? 'adminhtml' : 'core'; - $ajaxUrl = Mage::getUrl($url_prefix.'/ajax/translate', array('_secure'=>Mage::app()->getStore()->isCurrentlySecure())); + $ajaxUrl = Mage::getUrl($url_prefix . '/ajax/translate', + array('_secure'=>Mage::app()->getStore()->isCurrentlySecure())); $trigImg = Mage::getDesign()->getSkinUrl('images/fam_book_open.png'); ob_start(); @@ -262,7 +264,8 @@ protected function _insertInlineScriptsHtml()
[TR]
_content, $matches)) { + // escape double quote character to make it possible to use it inside "" + $charToEscape = str_replace('"', '\\"', $matches[1]); + // preg_replace() used to avoid escaping already escaped quotes + $part = preg_replace("/[^\\\\]{$charToEscape}/", "\\{$charToEscape}", $matches[2]); + // Replace markers+string with the string itself + $this->_content = str_replace($matches[0], $part, $this->_content); + } + return $this; + } + /** * Prepare tags inline translates * @@ -292,27 +315,29 @@ protected function _tagAttributes() if ($this->getIsJson()) { $quotePatern = '\\\\"'; $quoteHtml = '\"'; + $tagEndRegexp = '(\\\\/)?' . '>$'; } else { $quotePatern = '"'; $quoteHtml = '"'; + $tagEndRegexp = '/?>$'; } $tagMatch = array(); $nextTag = 0; - $tagRegExp = '#<([a-z]+)\s*?[^>]+?(('.$this->_tokenRegex.')[^/>]*?)+(/?(>))#i'; + $tagRegExp = '#<([a-z]+)\s*?[^>]+?((' . $this->_tokenRegex . ')[^/>]*?)+(/?(>))#i'; while (preg_match($tagRegExp, $this->_content, $tagMatch, PREG_OFFSET_CAPTURE, $nextTag)) { $next = 0; $tagHtml = $tagMatch[0][0]; $trArr = array(); $m = array(); - $attrRegExp = '#'.$this->_tokenRegex.'#'; + $attrRegExp = '#' . $this->_tokenRegex . '#'; while (preg_match($attrRegExp, $tagHtml, $m, PREG_OFFSET_CAPTURE, $next)) { - $trArr[] = '{shown:\''.$this->_escape($m[1][0]).'\',' - . 'translated:\''.$this->_escape($m[2][0]).'\',' - . 'original:\''.$this->_escape($m[3][0]).'\',' + $trArr[] = '{shown:\''.$this->_escape($m[1][0]) . '\',' + . 'translated:\''.$this->_escape($m[2][0]) . '\',' + . 'original:\''.$this->_escape($m[3][0]) . '\',' . 'location:\'Tag attribute (ALT, TITLE, etc.)\',' - . 'scope:\''.$this->_escape($m[4][0]).'\'}'; + . 'scope:\''.$this->_escape($m[4][0]) . '\'}'; $tagHtml = substr_replace($tagHtml, $m[1][0], $m[0][1], strlen($m[0][0])); $next = $m[0][1]; } @@ -327,9 +352,8 @@ protected function _tagAttributes() array_unshift($trArr, $m[1][0]); $tagHtml = substr_replace($tagHtml, '', $m[0][1], strlen($m[0][0])); } - - $trAttr = ' translate='.$quoteHtml.'['.join(',', $trArr).']'.$quoteHtml; - $tagHtml = preg_replace('#/?>$#', $trAttr . '$0', $tagHtml); + $trAttr = ' translate=' . $quoteHtml . '[' . join(',', $trArr) . ']' . $quoteHtml; + $tagHtml = preg_replace('#' . $tagEndRegexp . '#', $trAttr . '$0', $tagHtml); $this->_content = substr_replace($this->_content, $tagHtml, $tagMatch[0][1], $tagMatch[9][1]+1-$tagMatch[0][1]); @@ -354,7 +378,8 @@ protected function _specialTags() $nextTag = 0; $location = array_merge($this->_allowedTagsGlobal, $this->_allowedTagsSimple); - $tags = implode('|', array_merge(array_keys($this->_allowedTagsGlobal), array_keys($this->_allowedTagsSimple))); + $tags = implode('|', array_merge(array_keys($this->_allowedTagsGlobal), + array_keys($this->_allowedTagsSimple))); $tagRegExp = '#<(' . $tags . ')(\s+[^>]*|)(>)#i'; $tagMatch = array(); @@ -392,7 +417,9 @@ protected function _specialTags() $this->_content = substr_replace($this->_content, $tagHtml, $tagMatch[0][1], $tagLength); if (in_array($tag, array_keys($this->_allowedTagsSimple))) { - if (preg_match('# translate='.$quotePatern.'\[(.+?)\]'.$quotePatern.'#i', $tagMatch[0][0], $m, PREG_OFFSET_CAPTURE)) { + if (preg_match('# translate='.$quotePatern.'\[(.+?)\]'.$quotePatern.'#i', + $tagMatch[0][0], $m, PREG_OFFSET_CAPTURE) + ) { foreach ($trArr as $i=>$tr) { if (strpos($m[1][0], $tr)!==false) { unset($trArr[$i]); diff --git a/app/code/core/Mage/Core/Model/Url.php b/app/code/core/Mage/Core/Model/Url.php index 63bd855343..c51874fe9f 100644 --- a/app/code/core/Mage/Core/Model/Url.php +++ b/app/code/core/Mage/Core/Model/Url.php @@ -1035,6 +1035,38 @@ protected function _prepareSessionUrl($url) return $this; } + /** + * Rebuild URL to handle the case when session ID was changed + * + * @param string $url + * @return string + */ + public function getRebuiltUrl($url) + { + $this->parseUrl($url); + $port = $this->getPort(); + if ($port) { + $port = ':' . $port; + } else { + $port = ''; + } + $url = $this->getScheme() . '://' . $this->getHost() . $port . $this->getPath(); + + $this->_prepareSessionUrl($url); + + $query = $this->getQuery(); + if ($query) { + $url .= '?' . $query; + } + + $fragment = $this->getFragment(); + if ($fragment) { + $url .= '#' . $fragment; + } + + return $this->escape($url); + } + /** * Escape (enclosure) URL string * diff --git a/app/code/core/Mage/Core/controllers/AjaxController.php b/app/code/core/Mage/Core/controllers/AjaxController.php index 8d3bce5afa..368ed11769 100644 --- a/app/code/core/Mage/Core/controllers/AjaxController.php +++ b/app/code/core/Mage/Core/controllers/AjaxController.php @@ -49,7 +49,8 @@ public function translateAction () $item['custom'] = $filter->filter($item['custom']); } - echo Mage::helper('core/translate')->apply($translation, $area); - exit(); + $response = Mage::helper('core/translate')->apply($translation, $area); + $this->getResponse()->setBody($response); + $this->setFlag('', self::FLAG_NO_POST_DISPATCH, true); } } diff --git a/app/code/core/Mage/Core/etc/config.xml b/app/code/core/Mage/Core/etc/config.xml index 68e241fb98..af1cf91ab5 100644 --- a/app/code/core/Mage/Core/etc/config.xml +++ b/app/code/core/Mage/Core/etc/config.xml @@ -364,6 +364,9 @@
+ + AT,BE,BG,CY,CZ,DK,EE,FI,FR,DE,GR,HU,IE,IT,LV,LT,LU,MT,NL,PL,PT,RO,SK,SI,ES,SE,GB + 0 0,6 diff --git a/app/code/core/Mage/Core/etc/system.xml b/app/code/core/Mage/Core/etc/system.xml index 685194aab3..9675f9e97d 100644 --- a/app/code/core/Mage/Core/etc/system.xml +++ b/app/code/core/Mage/Core/etc/system.xml @@ -571,6 +571,7 @@ text + adminhtml/system_config_backend_filename 2 1 1 @@ -580,6 +581,7 @@ text + adminhtml/system_config_backend_filename 3 1 1 @@ -664,6 +666,15 @@ 1 1 + + + multiselect + adminhtml/system_config_source_country + 30 + 1 + 0 + 0 + @@ -738,6 +749,25 @@ 1 1 + + + select + adminhtml/system_config_source_country + 25 + 1 + 1 + 1 + 1 + + + + text + 27 + 1 + 1 + 1 + 1 +
textarea @@ -932,6 +962,7 @@ + This value must be greater than 0. text adminhtml/system_config_backend_admin_password_link_expirationperiod 30 diff --git a/app/code/core/Mage/Customer/Block/Widget/Name.php b/app/code/core/Mage/Customer/Block/Widget/Name.php index bd951eeb99..189c0ac97e 100644 --- a/app/code/core/Mage/Customer/Block/Widget/Name.php +++ b/app/code/core/Mage/Customer/Block/Widget/Name.php @@ -169,7 +169,16 @@ protected function _getAttribute($attributeCode) return parent::_getAttribute($attributeCode); } - return Mage::getSingleton('eav/config')->getAttribute('customer_address', $attributeCode); + $_attribute = Mage::getSingleton('eav/config')->getAttribute('customer_address', $attributeCode); + + if ($this->getForceUseCustomerRequiredAttributes() && !$_attribute->getIsRequired()) { + $customerAttribute = parent::_getAttribute($attributeCode); + if ($customerAttribute && $customerAttribute->getIsRequired()) { + $_attribute = $customerAttribute; + } + } + + return $_attribute; } /** diff --git a/app/code/core/Mage/Customer/Helper/Address.php b/app/code/core/Mage/Customer/Helper/Address.php index 9ff7d337e4..9ada743ed8 100644 --- a/app/code/core/Mage/Customer/Helper/Address.php +++ b/app/code/core/Mage/Customer/Helper/Address.php @@ -31,6 +31,13 @@ */ class Mage_Customer_Helper_Address extends Mage_Core_Helper_Abstract { + /** + * VAT Validation parameters XML paths + */ + const XML_PATH_VIV_DISABLE_AUTO_ASSIGN_DEFAULT = 'customer/create_account/viv_disable_auto_group_assign_default'; + const XML_PATH_VIV_ON_EACH_TRANSACTION = 'customer/create_account/viv_on_each_transaction'; + const XML_PATH_VAT_VALIDATION_ENABLED = 'customer/create_account/auto_group_assign'; + /** * Array of Customer Address Attributes * @@ -200,4 +207,36 @@ public function convertStreetLines($origStreets, $toCount) return $lines; } + + /** + * Check whether VAT ID validation is enabled + * + * @param Mage_Core_Model_Store|string|int $store + * @return bool + */ + public function isVatValidationEnabled($store = null) + { + return (bool)Mage::getStoreConfig(self::XML_PATH_VAT_VALIDATION_ENABLED, $store); + } + + /** + * Retrieve disable auto group assign default value + * + * @return bool + */ + public function getDisableAutoGroupAssignDefaultValue() + { + return (bool)Mage::getStoreConfig(self::XML_PATH_VIV_DISABLE_AUTO_ASSIGN_DEFAULT); + } + + /** + * Retrieve 'validate on each transaction' value + * + * @param Mage_Core_Model_Store|string|int $store + * @return bool + */ + public function getValidateOnEachTransaction($store = null) + { + return (bool)Mage::getStoreConfig(self::XML_PATH_VIV_ON_EACH_TRANSACTION, $store); + } } diff --git a/app/code/core/Mage/Customer/Helper/Data.php b/app/code/core/Mage/Customer/Helper/Data.php index 541e726a60..6dd82f6d37 100644 --- a/app/code/core/Mage/Customer/Helper/Data.php +++ b/app/code/core/Mage/Customer/Helper/Data.php @@ -44,12 +44,44 @@ class Mage_Customer_Helper_Data extends Mage_Core_Helper_Abstract */ const XML_PATH_CUSTOMER_STARTUP_REDIRECT_TO_DASHBOARD = 'customer/startup/redirect_dashboard'; + /** + * Config pathes to VAT related customer groups + */ + const XML_PATH_CUSTOMER_VIV_INTRA_UNION_GROUP = 'customer/create_account/viv_intra_union_group'; + const XML_PATH_CUSTOMER_VIV_DOMESTIC_GROUP = 'customer/create_account/viv_domestic_group'; + const XML_PATH_CUSTOMER_VIV_INVALID_GROUP = 'customer/create_account/viv_invalid_group'; + const XML_PATH_CUSTOMER_VIV_ERROR_GROUP = 'customer/create_account/viv_error_group'; + + /** + * Config path to option that enables/disables automatic group assignment based on VAT + */ + const XML_PATH_CUSTOMER_VIV_GROUP_AUTO_ASSIGN = 'customer/create_account/viv_disable_auto_group_assign_default'; + + /** + * Config path to support email + */ + const XML_PATH_SUPPORT_EMAIL = 'trans_email/ident_support/email'; + + /** + * WSDL of VAT validation service + * + */ + const VAT_VALIDATION_WSDL_URL = 'http://ec.europa.eu/taxation_customs/vies/services/checkVatService?wsdl'; + /** * Configuration path to expiration period of reset password link */ const XML_PATH_CUSTOMER_RESET_PASSWORD_LINK_EXPIRATION_PERIOD = 'default/customer/password/reset_link_expiration_period'; + /** + * VAT class constants + */ + const VAT_CLASS_DOMESTIC = 'domestic'; + const VAT_CLASS_INTRA_UNION = 'intra_union'; + const VAT_CLASS_INVALID = 'invalid'; + const VAT_CLASS_ERROR = 'error'; + /** * Customer groups collection * @@ -346,4 +378,228 @@ public function getResetPasswordLinkExpirationPeriod() { return (int) Mage::getConfig()->getNode(self::XML_PATH_CUSTOMER_RESET_PASSWORD_LINK_EXPIRATION_PERIOD); } + + /** + * Get default customer group id + * + * @param Mage_Core_Model_Store|string|int $store + * @return int + */ + public function getDefaultCustomerGroupId($store = null) + { + return (int)Mage::getStoreConfig(Mage_Customer_Model_Group::XML_PATH_DEFAULT_ID, $store); + } + + /** + * Retrieve customer group ID based on his VAT number + * + * @param string $customerCountryCode + * @param Varien_Object $vatValidationResult + * @param Mage_Core_Model_Store|string|int $store + * + * @return null|int + */ + public function getCustomerGroupIdBasedOnVatNumber($customerCountryCode, $vatValidationResult, $store = null) + { + $groupId = null; + + $vatClass = $this->getCustomerVatClass($customerCountryCode, $vatValidationResult); + + $vatClassToGroupXmlPathMap = array( + self::VAT_CLASS_DOMESTIC => self::XML_PATH_CUSTOMER_VIV_DOMESTIC_GROUP, + self::VAT_CLASS_INTRA_UNION => self::XML_PATH_CUSTOMER_VIV_INTRA_UNION_GROUP, + self::VAT_CLASS_INVALID => self::XML_PATH_CUSTOMER_VIV_INVALID_GROUP, + self::VAT_CLASS_ERROR => self::XML_PATH_CUSTOMER_VIV_ERROR_GROUP + ); + + if (isset($vatClassToGroupXmlPathMap[$vatClass])) { + $groupId = (int)Mage::getStoreConfig($vatClassToGroupXmlPathMap[$vatClass], $store); + } + + return $groupId; + } + + /** + * Send request to VAT validation service and return validation result + * + * @param string $countryCode + * @param string $vatNumber + * @param string $requesterCountryCode + * @param string $requesterVatNumber + * + * @return Varien_Object + */ + public function checkVatNumber($countryCode, $vatNumber, $requesterCountryCode = '', $requesterVatNumber = '') + { + // Default response + $gatewayResponse = new Varien_Object(array( + 'is_valid' => false, + 'request_date' => '', + 'request_identifier' => '', + 'request_success' => false + )); + + if (!extension_loaded('soap')) { + Mage::logException(Mage::exception('Mage_Core', + Mage::helper('core')->__('PHP SOAP extension is required.'))); + return $gatewayResponse; + } + + if (!$this->canCheckVatNumber($countryCode, $vatNumber, $requesterCountryCode, $requesterVatNumber)) { + return $gatewayResponse; + } + + try { + $soapClient = $this->_createVatNumberValidationSoapClient(); + + $requestParams = array(); + $requestParams['countryCode'] = $countryCode; + $requestParams['vatNumber'] = $vatNumber; + $requestParams['requesterCountryCode'] = $requesterCountryCode; + $requestParams['requesterVatNumber'] = $requesterVatNumber; + + // Send request to service + $result = $soapClient->checkVatApprox($requestParams); + + $gatewayResponse->setIsValid((boolean) $result->valid); + $gatewayResponse->setRequestDate((string) $result->requestDate); + $gatewayResponse->setRequestIdentifier((string) $result->requestIdentifier); + $gatewayResponse->setRequestSuccess(true); + } catch (Exception $exception) { + $gatewayResponse->setIsValid(false); + $gatewayResponse->setRequestDate(''); + $gatewayResponse->setRequestIdentifier(''); + } + + return $gatewayResponse; + } + + /** + * Check if parameters are valid to send to VAT validation service + * + * @param string $countryCode + * @param string $vatNumber + * @param string $requesterCountryCode + * @param string $requesterVatNumber + * + * @return boolean + */ + public function canCheckVatNumber($countryCode, $vatNumber, $requesterCountryCode, $requesterVatNumber) + { + $result = true; + /** @var $coreHelper Mage_Core_Helper_Data */ + $coreHelper = Mage::helper('core'); + + if (!is_string($countryCode) + || !is_string($vatNumber) + || !is_string($requesterCountryCode) + || !is_string($requesterVatNumber) + || empty($countryCode) + || !$coreHelper->isCountryInEU($countryCode) + || empty($vatNumber) + || (empty($requesterCountryCode) && !empty($requesterVatNumber)) + || (!empty($requesterCountryCode) && empty($requesterVatNumber)) + || (!empty($requesterCountryCode) && !$coreHelper->isCountryInEU($requesterCountryCode)) + ) { + $result = false; + } + + return $result; + } + + /** + * Get VAT class + * + * @param string $customerCountryCode + * @param Varien_Object $vatValidationResult + * @return null|string + */ + public function getCustomerVatClass($customerCountryCode, $vatValidationResult) + { + $vatClass = null; + + $isVatNumberValid = $vatValidationResult->getIsValid(); + + if (is_string($customerCountryCode) + && !empty($customerCountryCode) + && $customerCountryCode === Mage::helper('core')->getMerchantCountryCode() + && $isVatNumberValid + ) { + $vatClass = self::VAT_CLASS_DOMESTIC; + } elseif ($isVatNumberValid) { + $vatClass = self::VAT_CLASS_INTRA_UNION; + } else { + $vatClass = self::VAT_CLASS_INVALID; + } + + if (!$vatValidationResult->getRequestSuccess()) { + $vatClass = self::VAT_CLASS_ERROR; + } + + return $vatClass; + } + + /** + * Get validation message that will be displayed to user by VAT validation result object + * + * @param Mage_Customer_Model_Address $customerAddress + * @param bool $customerGroupAutoAssignDisabled + * @param Varien_Object $validationResult + * @return Varien_Object + */ + public function getVatValidationUserMessage($customerAddress, $customerGroupAutoAssignDisabled, $validationResult) + { + $message = ''; + $isError = true; + $customerVatClass = $this->getCustomerVatClass($customerAddress->getCountryId(), $validationResult); + $groupAutoAssignDisabled = Mage::getStoreConfigFlag(self::XML_PATH_CUSTOMER_VIV_GROUP_AUTO_ASSIGN); + + $willChargeTaxMessage = $this->__('You will be charged tax.'); + $willNotChargeTaxMessage = $this->__('You will not be charged tax.'); + + if ($validationResult->getIsValid()) { + $message = $this->__('Your VAT ID was successfully validated.'); + $isError = false; + + if (!$groupAutoAssignDisabled && !$customerGroupAutoAssignDisabled) { + $message .= ' ' . ($customerVatClass == self::VAT_CLASS_DOMESTIC + ? $willChargeTaxMessage + : $willNotChargeTaxMessage); + } + } else if ($validationResult->getRequestSuccess()) { + $message = sprintf( + $this->__('The VAT ID entered (%s) is not a valid VAT ID.') . ' ', + $this->escapeHtml($customerAddress->getVatId()) + ); + if (!$groupAutoAssignDisabled && !$customerGroupAutoAssignDisabled) { + $message .= $willChargeTaxMessage; + } + } + else { + $contactUsMessage = sprintf($this->__('If you believe this is an error, please contact us at %s'), + Mage::getStoreConfig(self::XML_PATH_SUPPORT_EMAIL)); + + $message = $this->__('Your Tax ID cannot be validated.') . ' ' + . (!$groupAutoAssignDisabled && !$customerGroupAutoAssignDisabled + ? $willChargeTaxMessage . ' ' : '') + . $contactUsMessage; + } + + $validationMessageEnvelope = new Varien_Object(); + $validationMessageEnvelope->setMessage($message); + $validationMessageEnvelope->setIsError($isError); + + return $validationMessageEnvelope; + } + + /** + * Create SOAP client based on VAT validation service WSDL + * + * @param boolean $trace + * @return SoapClient + */ + protected function _createVatNumberValidationSoapClient($trace = false) + { + return new SoapClient(self::VAT_VALIDATION_WSDL_URL, array('trace' => $trace)); + } } diff --git a/app/code/core/Mage/Customer/Model/Address.php b/app/code/core/Mage/Customer/Model/Address.php index 20697c933a..0576f82731 100644 --- a/app/code/core/Mage/Customer/Model/Address.php +++ b/app/code/core/Mage/Customer/Model/Address.php @@ -150,7 +150,7 @@ public function getEntityTypeId() } return $entityTypeId; } - + /** * Return Region ID * @@ -160,7 +160,7 @@ public function getRegionId() { return (int)$this->getData('region_id'); } - + /** * Set Region ID. $regionId is automatically converted to integer * diff --git a/app/code/core/Mage/Customer/Model/Address/Abstract.php b/app/code/core/Mage/Customer/Model/Address/Abstract.php index 4c85d49281..426fcbf428 100644 --- a/app/code/core/Mage/Customer/Model/Address/Abstract.php +++ b/app/code/core/Mage/Customer/Model/Address/Abstract.php @@ -231,7 +231,10 @@ public function getRegionId() $this->setData('region_id', $region); $this->unsRegion(); } else { - $regionModel = Mage::getModel('directory/region')->loadByCode($this->getRegionCode(), $this->getCountryId()); + $regionModel = Mage::getModel('directory/region')->loadByCode( + $this->getRegionCode(), + $this->getCountryId() + ); $this->setData('region_id', $regionModel->getId()); } } @@ -240,10 +243,6 @@ public function getRegionId() public function getCountry() { - /*if ($this->getData('country_id') && !$this->getData('country')) { - $this->setData('country', Mage::getModel('directory/country')->load($this->getData('country_id'))->getIso2Code()); - } - return $this->getData('country');*/ $country = $this->getCountryId(); return $country ? $country : $this->getData('country'); } @@ -256,7 +255,9 @@ public function getCountry() public function getCountryModel() { if(!isset(self::$_countryModels[$this->getCountryId()])) { - self::$_countryModels[$this->getCountryId()] = Mage::getModel('directory/country')->load($this->getCountryId()); + self::$_countryModels[$this->getCountryId()] = Mage::getModel('directory/country')->load( + $this->getCountryId() + ); } return self::$_countryModels[$this->getCountryId()]; @@ -293,7 +294,7 @@ public function getHtmlFormat() */ public function getFormated($html=false) { - return $this->format($html ? 'html' : 'text');//Mage::getModel('directory/country')->load($this->getCountryId())->formatAddress($this, $html); + return $this->format($html ? 'html' : 'text'); } public function format($type) @@ -331,40 +332,41 @@ protected function _beforeSave() public function validate() { $errors = array(); - $helper = Mage::helper('customer'); $this->implodeStreetAddress(); if (!Zend_Validate::is($this->getFirstname(), 'NotEmpty')) { - $errors[] = $helper->__('Please enter the first name.'); + $errors[] = Mage::helper('customer')->__('Please enter the first name.'); } if (!Zend_Validate::is($this->getLastname(), 'NotEmpty')) { - $errors[] = $helper->__('Please enter the last name.'); + $errors[] = Mage::helper('customer')->__('Please enter the last name.'); } if (!Zend_Validate::is($this->getStreet(1), 'NotEmpty')) { - $errors[] = $helper->__('Please enter the street.'); + $errors[] = Mage::helper('customer')->__('Please enter the street.'); } if (!Zend_Validate::is($this->getCity(), 'NotEmpty')) { - $errors[] = $helper->__('Please enter the city.'); + $errors[] = Mage::helper('customer')->__('Please enter the city.'); } if (!Zend_Validate::is($this->getTelephone(), 'NotEmpty')) { - $errors[] = $helper->__('Please enter the telephone number.'); + $errors[] = Mage::helper('customer')->__('Please enter the telephone number.'); } $_havingOptionalZip = Mage::helper('directory')->getCountriesWithOptionalZip(); - if (!in_array($this->getCountryId(), $_havingOptionalZip) && !Zend_Validate::is($this->getPostcode(), 'NotEmpty')) { - $errors[] = $helper->__('Please enter the zip/postal code.'); + if (!in_array($this->getCountryId(), $_havingOptionalZip) + && !Zend_Validate::is($this->getPostcode(), 'NotEmpty') + ) { + $errors[] = Mage::helper('customer')->__('Please enter the zip/postal code.'); } if (!Zend_Validate::is($this->getCountryId(), 'NotEmpty')) { - $errors[] = $helper->__('Please enter the country.'); + $errors[] = Mage::helper('customer')->__('Please enter the country.'); } if ($this->getCountryModel()->getRegionCollection()->getSize() && !Zend_Validate::is($this->getRegionId(), 'NotEmpty')) { - $errors[] = $helper->__('Please enter the state/province.'); + $errors[] = Mage::helper('customer')->__('Please enter the state/province.'); } if (empty($errors) || $this->getShouldIgnoreValidation()) { diff --git a/app/code/core/Mage/Customer/Model/Attribute/Backend/Data/Boolean.php b/app/code/core/Mage/Customer/Model/Attribute/Backend/Data/Boolean.php new file mode 100644 index 0000000000..fe439b8d7d --- /dev/null +++ b/app/code/core/Mage/Customer/Model/Attribute/Backend/Data/Boolean.php @@ -0,0 +1,52 @@ + + */ +class Mage_Customer_Model_Attribute_Backend_Data_Boolean + extends Mage_Eav_Model_Entity_Attribute_Backend_Abstract +{ + /** + * Prepare data before attribute save + * + * @param Mage_Customer_Model_Customer $customer + * @return Mage_Customer_Model_Attribute_Backend_Data_Boolean + */ + public function beforeSave($customer) + { + $attributeName = $this->getAttribute()->getName(); + $inputValue = $customer->getData($attributeName); + $sanitizedValue = (!empty($inputValue)) ? '1' : '0'; + $customer->setData($attributeName, $sanitizedValue); + return $this; + } +} diff --git a/app/code/core/Mage/Customer/Model/Customer.php b/app/code/core/Mage/Customer/Model/Customer.php index ba2ac0ec1c..e0017c0596 100644 --- a/app/code/core/Mage/Customer/Model/Customer.php +++ b/app/code/core/Mage/Customer/Model/Customer.php @@ -375,9 +375,13 @@ public function hashPassword($password, $salt = null) * @param int $length * @return string */ - public function generatePassword($length = 6) + public function generatePassword($length = 8) { - return Mage::helper('core')->getRandomString($length); + $chars = Mage_Core_Helper_Data::CHARS_PASSWORD_LOWERS + . Mage_Core_Helper_Data::CHARS_PASSWORD_UPPERS + . Mage_Core_Helper_Data::CHARS_PASSWORD_DIGITS + . Mage_Core_Helper_Data::CHARS_PASSWORD_SPECIALS; + return Mage::helper('core')->getRandomString($length, $chars); } /** @@ -788,43 +792,42 @@ public function setStore(Mage_Core_Model_Store $store) public function validate() { $errors = array(); - $customerHelper = Mage::helper('customer'); if (!Zend_Validate::is( trim($this->getFirstname()) , 'NotEmpty')) { - $errors[] = $customerHelper->__('The first name cannot be empty.'); + $errors[] = Mage::helper('customer')->__('The first name cannot be empty.'); } if (!Zend_Validate::is( trim($this->getLastname()) , 'NotEmpty')) { - $errors[] = $customerHelper->__('The last name cannot be empty.'); + $errors[] = Mage::helper('customer')->__('The last name cannot be empty.'); } if (!Zend_Validate::is($this->getEmail(), 'EmailAddress')) { - $errors[] = $customerHelper->__('Invalid email address "%s".', $this->getEmail()); + $errors[] = Mage::helper('customer')->__('Invalid email address "%s".', $this->getEmail()); } $password = $this->getPassword(); if (!$this->getId() && !Zend_Validate::is($password , 'NotEmpty')) { - $errors[] = $customerHelper->__('The password cannot be empty.'); + $errors[] = Mage::helper('customer')->__('The password cannot be empty.'); } if (strlen($password) && !Zend_Validate::is($password, 'StringLength', array(6))) { - $errors[] = $customerHelper->__('The minimum password length is %s', 6); + $errors[] = Mage::helper('customer')->__('The minimum password length is %s', 6); } $confirmation = $this->getConfirmation(); if ($password != $confirmation) { - $errors[] = $customerHelper->__('Please make sure your passwords match.'); + $errors[] = Mage::helper('customer')->__('Please make sure your passwords match.'); } $entityType = Mage::getSingleton('eav/config')->getEntityType('customer'); $attribute = Mage::getModel('customer/attribute')->loadByCode($entityType, 'dob'); if ($attribute->getIsRequired() && '' == trim($this->getDob())) { - $errors[] = $customerHelper->__('The Date of Birth is required.'); + $errors[] = Mage::helper('customer')->__('The Date of Birth is required.'); } $attribute = Mage::getModel('customer/attribute')->loadByCode($entityType, 'taxvat'); if ($attribute->getIsRequired() && '' == trim($this->getTaxvat())) { - $errors[] = $customerHelper->__('The TAX/VAT number is required.'); + $errors[] = Mage::helper('customer')->__('The TAX/VAT number is required.'); } $attribute = Mage::getModel('customer/attribute')->loadByCode($entityType, 'gender'); if ($attribute->getIsRequired() && '' == trim($this->getGender())) { - $errors[] = $customerHelper->__('Gender is required.'); + $errors[] = Mage::helper('customer')->__('Gender is required.'); } if (empty($errors)) { @@ -842,7 +845,6 @@ public function validate() public function importFromTextArray(array $row) { $this->resetErrors(); - $hlp = Mage::helper('customer'); $line = $row['i']; $row = $row['row']; @@ -851,7 +853,7 @@ public function importFromTextArray(array $row) $website = Mage::getModel('core/website')->load($row['website_code'], 'code'); if (!$website->getId()) { - $this->addError($hlp->__('Invalid website, skipping the record, line: %s', $line)); + $this->addError(Mage::helper('customer')->__('Invalid website, skipping the record, line: %s', $line)); } else { $row['website_id'] = $website->getWebsiteId(); @@ -860,18 +862,18 @@ public function importFromTextArray(array $row) // Validate Email if (empty($row['email'])) { - $this->addError($hlp->__('Missing email, skipping the record, line: %s', $line)); + $this->addError(Mage::helper('customer')->__('Missing email, skipping the record, line: %s', $line)); } else { $this->loadByEmail($row['email']); } if (empty($row['entity_id'])) { if ($this->getData('entity_id')) { - $this->addError($hlp->__('The customer email (%s) already exists, skipping the record, line: %s', $row['email'], $line)); + $this->addError(Mage::helper('customer')->__('The customer email (%s) already exists, skipping the record, line: %s', $row['email'], $line)); } } else { if ($row['entity_id'] != $this->getData('entity_id')) { - $this->addError($hlp->__('The customer ID and email did not match, skipping the record, line: %s', $line)); + $this->addError(Mage::helper('customer')->__('The customer ID and email did not match, skipping the record, line: %s', $line)); } else { $this->unsetData(); $this->load($row['entity_id']); @@ -883,7 +885,7 @@ public function importFromTextArray(array $row) } if (empty($row['website_code'])) { - $this->addError($hlp->__('Missing website, skipping the record, line: %s', $line)); + $this->addError(Mage::helper('customer')->__('Missing website, skipping the record, line: %s', $line)); } if (empty($row['group'])) { @@ -891,10 +893,10 @@ public function importFromTextArray(array $row) } if (empty($row['firstname'])) { - $this->addError($hlp->__('Missing first name, skipping the record, line: %s', $line)); + $this->addError(Mage::helper('customer')->__('Missing first name, skipping the record, line: %s', $line)); } if (empty($row['lastname'])) { - $this->addError($hlp->__('Missing last name, skipping the record, line: %s', $line)); + $this->addError(Mage::helper('customer')->__('Missing last name, skipping the record, line: %s', $line)); } if (!empty($row['password_new'])) { @@ -915,7 +917,7 @@ public function importFromTextArray(array $row) } if (!$this->validateAddress($row, 'billing')) { - $this->printError($hlp->__('Invalid billing address for (%s)', $row['email']), $line); + $this->printError(Mage::helper('customer')->__('Invalid billing address for (%s)', $row['email']), $line); } else { // Handling billing address $billingAddress = $this->getPrimaryBillingAddress(); @@ -956,7 +958,7 @@ public function importFromTextArray(array $row) } if (!$this->validateAddress($row, 'shipping')) { - $this->printError($hlp->__('Invalid shipping address for (%s)', $row['email']), $line); + $this->printError(Mage::helper('customer')->__('Invalid shipping address for (%s)', $row['email']), $line); } else { // Handling shipping address $shippingAddress = $this->getPrimaryShippingAddress(); @@ -1300,7 +1302,7 @@ public function isResetPasswordLinkTokenExpired() $tokenExpirationPeriod = Mage::helper('customer')->getResetPasswordLinkExpirationPeriod(); - $currentDate = Varien_Date::now(true); + $currentDate = Varien_Date::now(); $currentTimestamp = Varien_Date::toTimestamp($currentDate); $tokenTimestamp = Varien_Date::toTimestamp($resetPasswordLinkTokenCreatedAt); if ($tokenTimestamp > $currentTimestamp) { diff --git a/app/code/core/Mage/Customer/Model/Form.php b/app/code/core/Mage/Customer/Model/Form.php index 4670d7a1d2..71d8fd332a 100644 --- a/app/code/core/Mage/Customer/Model/Form.php +++ b/app/code/core/Mage/Customer/Model/Form.php @@ -48,4 +48,15 @@ class Mage_Customer_Model_Form extends Mage_Eav_Model_Form */ protected $_entityTypeCode = 'customer'; + /** + * Get EAV Entity Form Attribute Collection for Customer + * exclude 'created_at' + * + * @return Mage_Customer_Model_Resource_Form_Attribute_Collection + */ + protected function _getFormAttributeCollection() + { + return parent::_getFormAttributeCollection() + ->addFieldToFilter('attribute_code', array('neq' => 'created_at')); + } } diff --git a/app/code/core/Mage/Customer/Model/Observer.php b/app/code/core/Mage/Customer/Model/Observer.php index 65cadcab54..d5c56f333f 100644 --- a/app/code/core/Mage/Customer/Model/Observer.php +++ b/app/code/core/Mage/Customer/Model/Observer.php @@ -31,11 +31,181 @@ */ class Mage_Customer_Model_Observer { + /** + * VAT ID validation processed flag code + */ + const VIV_PROCESSED_FLAG = 'viv_after_address_save_processed'; + + /** + * VAT ID validation currently saved address flag + */ + const VIV_CURRENTLY_SAVED_ADDRESS = 'currently_saved_address'; + + /** + * Check whether specified billing address is default for its customer + * + * @param Mage_Customer_Model_Address $address + * @return bool + */ + protected function _isDefaultBilling($address) + { + return $address->getId() && $address->getId() == $address->getCustomer()->getDefaultBilling(); + } + + /** + * Check whether specified address should be processed in after_save event handler + * + * @param Mage_Customer_Model_Address $address + * @return bool + */ + protected function _canProcessAddress($address) + { + if ($address->getForceProcess()) { + return true; + } + + if (Mage::registry(self::VIV_CURRENTLY_SAVED_ADDRESS) != $address->getId()) { + return false; + } + + return $this->_isDefaultBilling($address); + } + + /** + * Before load layout event handler + * + * @param Varien_Event_Observer $observer + */ public function beforeLoadLayout($observer) { $loggedIn = Mage::getSingleton('customer/session')->isLoggedIn(); $observer->getEvent()->getLayout()->getUpdate() - ->addHandle('customer_logged_'.($loggedIn?'in':'out')); + ->addHandle('customer_logged_' . ($loggedIn ? 'in' : 'out')); + } + + /** + * Address before save event handler + * + * @param Varien_Event_Observer $observer + */ + public function beforeAddressSave($observer) + { + if (Mage::registry(self::VIV_CURRENTLY_SAVED_ADDRESS)) { + Mage::unregister(self::VIV_CURRENTLY_SAVED_ADDRESS); + } + + /** @var $customerAddress Mage_Customer_Model_Address */ + $customerAddress = $observer->getCustomerAddress(); + if ($customerAddress->getId()) { + Mage::register(self::VIV_CURRENTLY_SAVED_ADDRESS, $customerAddress->getId()); + } elseif ($customerAddress->getIsDefaultBilling()) { + $customerAddress->setForceProcess(true); + } else { + Mage::register(self::VIV_CURRENTLY_SAVED_ADDRESS, 'new_address'); + } + } + + /** + * Address after save event handler + * + * @param Varien_Event_Observer $observer + */ + public function afterAddressSave($observer) + { + /** @var $customerAddress Mage_Customer_Model_Address */ + $customerAddress = $observer->getCustomerAddress(); + $customer = $customerAddress->getCustomer(); + + if (!Mage::helper('customer/address')->isVatValidationEnabled($customer->getStore()) + || Mage::registry(self::VIV_PROCESSED_FLAG) + || !$this->_canProcessAddress($customerAddress) + ) { + return; + } + + try { + Mage::register(self::VIV_PROCESSED_FLAG, true); + + /** @var $customerHelper Mage_Customer_Helper_Data */ + $customerHelper = Mage::helper('customer'); + + if ($customerAddress->getVatId() == '' + || !Mage::helper('core')->isCountryInEU($customerAddress->getCountry())) + { + $defaultGroupId = $customerHelper->getDefaultCustomerGroupId($customer->getStore()); + + if (!$customer->getDisableAutoGroupChange() && $customer->getGroupId() != $defaultGroupId) { + $customer->setGroupId($defaultGroupId); + $customer->save(); + } + } else { + + $result = $customerHelper->checkVatNumber( + $customerAddress->getCountryId(), + $customerAddress->getVatId() + ); + + $newGroupId = $customerHelper->getCustomerGroupIdBasedOnVatNumber( + $customerAddress->getCountryId(), $result, $customer->getStore() + ); + + if (!$customer->getDisableAutoGroupChange() && $customer->getGroupId() != $newGroupId) { + $customer->setGroupId($newGroupId); + $customer->save(); + } + + if (!Mage::app()->getStore()->isAdmin()) { + $validationMessage = Mage::helper('customer')->getVatValidationUserMessage($customerAddress, + $customer->getDisableAutoGroupChange(), $result); + + if (!$validationMessage->getIsError()) { + Mage::getSingleton('customer/session')->addSuccess($validationMessage->getMessage()); + } else { + Mage::getSingleton('customer/session')->addError($validationMessage->getMessage()); + } + } + } + } catch (Exception $e) { + Mage::register(self::VIV_PROCESSED_FLAG, false, true); + } + } + + /** + * Assign custom renderer for VAT ID field in billing address form + * + * @param Varien_Event_Observer $observer + */ + public function prepareFormAfter($observer) + { + /** @var $formBlock Mage_Adminhtml_Block_Sales_Order_Create_Billing_Address */ + $formBlock = $observer->getForm(); + $formBlock->getForm()->getElement('vat_id')->setRenderer( + $formBlock->getLayout()->createBlock('adminhtml/customer_sales_order_address_form_billing_renderer_vat') + ); + } + + /** + * Revert emulated customer group_id + * + * @param Varien_Event_Observer $observer + */ + public function quoteSubmitAfter($observer) + { + /** @var $customer Mage_Customer_Model_Customer */ + $customer = $observer->getQuote()->getCustomer(); + + if (!Mage::helper('customer/address')->isVatValidationEnabled($customer->getStore())) { + return; + } + + if (!$customer->getId()) { + return; + } + + $customer->setGroupId( + $customer->getOrigData('group_id') + ); + $customer->save(); } } diff --git a/app/code/core/Mage/Customer/Model/Resource/Customer.php b/app/code/core/Mage/Customer/Model/Resource/Customer.php index c4e0622b67..34ef426497 100755 --- a/app/code/core/Mage/Customer/Model/Resource/Customer.php +++ b/app/code/core/Mage/Customer/Model/Resource/Customer.php @@ -325,7 +325,7 @@ public function setNewIncrementId(Varien_Object $object) public function changeResetPasswordLinkToken(Mage_Customer_Model_Customer $customer, $newResetPasswordLinkToken) { if (is_string($newResetPasswordLinkToken) && !empty($newResetPasswordLinkToken)) { $customer->setRpToken($newResetPasswordLinkToken); - $currentDate = Varien_Date::now(true); + $currentDate = Varien_Date::now(); $customer->setRpTokenCreatedAt($currentDate); $this->saveAttribute($customer, 'rp_token'); $this->saveAttribute($customer, 'rp_token_created_at'); diff --git a/app/code/core/Mage/Customer/Model/Resource/Customer/Collection.php b/app/code/core/Mage/Customer/Model/Resource/Customer/Collection.php index ae35c9481f..ddf1e9d9d2 100755 --- a/app/code/core/Mage/Customer/Model/Resource/Customer/Collection.php +++ b/app/code/core/Mage/Customer/Model/Resource/Customer/Collection.php @@ -80,26 +80,29 @@ public function addNameToSelect() if (isset($fields['prefix'])) { $concatenate[] = $adapter->getCheckSql( '{{prefix}} IS NOT NULL AND {{prefix}} != \'\'', - 'LTRIM(RTRIM({{prefix}}))', + $adapter->getConcatSql(array('LTRIM(RTRIM({{prefix}}))', '\' \'')), '\'\''); } $concatenate[] = 'LTRIM(RTRIM({{firstname}}))'; + $concatenate[] = '\' \''; if (isset($fields['middlename'])) { $concatenate[] = $adapter->getCheckSql( '{{middlename}} IS NOT NULL AND {{middlename}} != \'\'', - 'LTRIM(RTRIM({{middlename}}))', + $adapter->getConcatSql(array('LTRIM(RTRIM({{middlename}}))', '\' \'')), '\'\''); } $concatenate[] = 'LTRIM(RTRIM({{lastname}}))'; if (isset($fields['suffix'])) { $concatenate[] = $adapter - ->getCheckSql('{{suffix}} IS NOT NULL AND {{suffix}} != \'\'', "LTRIM(RTRIM({{suffix}}))", "''"); + ->getCheckSql('{{suffix}} IS NOT NULL AND {{suffix}} != \'\'', + $adapter->getConcatSql(array('\' \'', 'LTRIM(RTRIM({{suffix}}))')), + '\'\''); } - $nameExpr = $adapter->getConcatSql($concatenate, ' '); + $nameExpr = $adapter->getConcatSql($concatenate); $this->addExpressionAttributeToSelect('name', $nameExpr, $fields); - + return $this; } diff --git a/app/code/core/Mage/Customer/Model/Resource/Group.php b/app/code/core/Mage/Customer/Model/Resource/Group.php index 1c624157fd..0764df6847 100755 --- a/app/code/core/Mage/Customer/Model/Resource/Group.php +++ b/app/code/core/Mage/Customer/Model/Resource/Group.php @@ -85,8 +85,7 @@ protected function _afterDelete(Mage_Core_Model_Abstract $group) ->addAttributeToFilter('group_id', $group->getId()) ->load(); foreach ($customerCollection as $customer) { - $defaultGroupId = Mage::getStoreConfig(Mage_Customer_Model_Group::XML_PATH_DEFAULT_ID, - $customer->getStoreId()); + $defaultGroupId = Mage::helper('customer')->getDefaultCustomerGroupId($customer->getStoreId()); $customer->setGroupId($defaultGroupId); $customer->save(); } diff --git a/app/code/core/Mage/Customer/Model/Session.php b/app/code/core/Mage/Customer/Model/Session.php index 07e81b47d9..9903e42f15 100644 --- a/app/code/core/Mage/Customer/Model/Session.php +++ b/app/code/core/Mage/Customer/Model/Session.php @@ -86,9 +86,7 @@ public function setCustomer(Mage_Customer_Model_Customer $customer) // check if customer is not confirmed if ($customer->isConfirmationRequired()) { if ($customer->getConfirmation()) { - throw new Exception('This customer is not confirmed and cannot log in.', - Mage_Customer_Model_Customer::EXCEPTION_EMAIL_NOT_CONFIRMED - ); + return $this->_logout(); } } $this->_customer = $customer; @@ -170,7 +168,10 @@ public function getCustomerGroupId() if ($this->getData('customer_group_id')) { return $this->getData('customer_group_id'); } - return ($this->isLoggedIn()) ? $this->getCustomer()->getGroupId() : Mage_Customer_Model_Group::NOT_LOGGED_IN_ID; + if ($this->isLoggedIn() && $this->getCustomer()) { + return $this->getCustomer()->getGroupId(); + } + return Mage_Customer_Model_Group::NOT_LOGGED_IN_ID; } /** @@ -250,8 +251,7 @@ public function logout() { if ($this->isLoggedIn()) { Mage::dispatchEvent('customer_logout', array('customer' => $this->getCustomer()) ); - $this->setId(null); - $this->getCookie()->delete($this->getSessionName()); + $this->_logout(); } return $this; } @@ -286,9 +286,24 @@ protected function _setAuthUrl($key, $url) { $url = Mage::helper('core/url') ->removeRequestParam($url, Mage::getSingleton('core/session')->getSessionIdQueryParam()); + // Add correct session ID to URL if needed + $url = Mage::getModel('core/url')->getRebuiltUrl($url); return $this->setData($key, $url); } + /** + * Logout without dispatching event + * + * @return Mage_Customer_Model_Session + */ + protected function _logout() + { + $this->setId(null); + $this->setCustomerGroupId(Mage_Customer_Model_Group::NOT_LOGGED_IN_ID); + $this->getCookie()->delete($this->getSessionName()); + return $this; + } + /** * Set Before auth url * @@ -310,4 +325,17 @@ public function setAfterAuthUrl($url) { return $this->_setAuthUrl('after_auth_url', $url); } + + /** + * Reset core session hosts after reseting session ID + * + * @return Mage_Customer_Model_Session + */ + public function renewSession() + { + parent::renewSession(); + Mage::getSingleton('core/session')->unsSessionHosts(); + + return $this; + } } diff --git a/app/code/core/Mage/Customer/controllers/AccountController.php b/app/code/core/Mage/Customer/controllers/AccountController.php index f3a69f39f0..473774680f 100644 --- a/app/code/core/Mage/Customer/controllers/AccountController.php +++ b/app/code/core/Mage/Customer/controllers/AccountController.php @@ -193,7 +193,9 @@ protected function _loginPostRedirect() )) { $referer = $this->getRequest()->getParam(Mage_Customer_Helper_Data::REFERER_QUERY_PARAM_NAME); if ($referer) { - $referer = Mage::helper('core')->urlDecode($referer); + // Rebuild referer URL to handle the case when SID was changed + $referer = Mage::getModel('core/url') + ->getRebuiltUrl(Mage::helper('core')->urlDecode($referer)); if ($this->_isUrlInternal($referer)) { $session->setBeforeAuthUrl($referer); } @@ -392,6 +394,11 @@ protected function _welcomeCustomer(Mage_Customer_Model_Customer $customer, $isJ $this->_getSession()->addSuccess( $this->__('Thank you for registering with %s.', Mage::app()->getStore()->getFrontendName()) ); + if ($this->_isVatValidationEnabled()) { + $this->_getSession()->addSuccess( + $this->__('If you are a registered VAT customer, please click here to enter you billing address to see proper VAT calculated', Mage::getUrl('customer/address/edit')) + ); + } $customer->sendNewAccountEmail( $isJustConfirmed ? 'confirmed' : 'registered', @@ -589,7 +596,7 @@ public function resetPasswordAction() $this->renderLayout(); } catch (Exception $exception) { $this->_getSession()->addError(Mage::helper('customer')->__('Your password reset link has expired.')); - $this->_redirect('*/*/'); + $this->_redirect('*/*/forgotpassword'); } } @@ -819,4 +826,15 @@ protected function _filterPostData($data) $data = $this->_filterDates($data, array('dob')); return $data; } + + /** + * Check whether VAT ID validation is enabled + * + * @param Mage_Core_Model_Store|string|int $store + * @return bool + */ + protected function _isVatValidationEnabled($store = null) + { + return Mage::helper('customer/address')->isVatValidationEnabled($store); + } } diff --git a/app/code/core/Mage/Customer/etc/config.xml b/app/code/core/Mage/Customer/etc/config.xml index 603e424b96..5f6d020ecc 100644 --- a/app/code/core/Mage/Customer/etc/config.xml +++ b/app/code/core/Mage/Customer/etc/config.xml @@ -28,7 +28,7 @@ - 1.6.1.0 + 1.6.2.0.1 @@ -247,6 +247,79 @@ 1 + + + * + + + * + + + * + + + * + + + * + + + + + * + + + * + + + * + + + * + + + * + + + + + * + * + + + * + * + + + * + * + + + * + * + + + * + * + + + + + * + + + * + + + * + + + * + + + * + +
@@ -345,6 +418,24 @@ + + + + + customer/observer + beforeAddressSave + + + + + + + customer/observer + afterAddressSave + + + + @@ -356,6 +447,16 @@ + + + + + customer/observer + prepareFormAfter + + + + @@ -370,6 +471,14 @@ + + + + customer/observer + quoteSubmitAfter + + + @@ -418,7 +527,7 @@ support customer_password_forgot_email_template customer_password_remind_email_template - 3 + 1
2 @@ -444,7 +553,8 @@ {{if city}}{{var city}}, {{/if}}{{if region}}{{var region}}, {{/if}}{{if postcode}}{{var postcode}}{{/if}} {{var country}} T: {{var telephone}} -{{depend fax}}F: {{var fax}}{{/depend}} +{{depend fax}}F: {{var fax}}{{/depend}} +{{depend vat_id}}VAT: {{var vat_id}}{{/depend}} {{depend prefix}}{{var prefix}} {{/depend}}{{var firstname}} {{depend middlename}}{{var middlename}} {{/depend}}{{var lastname}}{{depend suffix}} {{var suffix}}{{/depend}}, {{var street}}, {{var city}}, {{var region}} {{var postcode}}, {{var country}} {{depend prefix}}{{var prefix}} {{/depend}}{{var firstname}} {{depend middlename}}{{var middlename}} {{/depend}}{{var lastname}}{{depend suffix}} {{var suffix}}{{/depend}}<br/> {{depend company}}{{var company}}<br />{{/depend}} @@ -455,7 +565,8 @@ T: {{var telephone}} {{if city}}{{var city}}, {{/if}}{{if region}}{{var region}}, {{/if}}{{if postcode}}{{var postcode}}{{/if}}<br/> {{var country}}<br/> {{depend telephone}}T: {{var telephone}}{{/depend}} -{{depend fax}}<br/>F: {{var fax}}{{/depend}} +{{depend fax}}<br/>F: {{var fax}}{{/depend}} +{{depend vat_id}}<br/>VAT: {{var vat_id}}{{/depend}} {{depend prefix}}{{var prefix}} {{/depend}}{{var firstname}} {{depend middlename}}{{var middlename}} {{/depend}}{{var lastname}}{{depend suffix}} {{var suffix}}{{/depend}}| {{depend company}}{{var company}}|{{/depend}} {{if street1}}{{var street1}} @@ -467,8 +578,9 @@ T: {{var telephone}} {{if region}}{{var region}}, {{/if}}{{if postcode}}{{var postcode}}{{/if}}| {{var country}}| {{depend telephone}}T: {{var telephone}}{{/depend}}| -{{depend fax}}<br/>F: {{var fax}}{{/depend}}| - #{prefix} #{firstname} #{middlename} #{lastname} #{suffix}<br/>#{company}<br/>#{street0}<br/>#{street1}<br/>#{street2}<br/>#{street3}<br/>#{city}, #{region}, #{postcode}<br/>#{country_id}<br/>T: #{telephone}<br/>F: #{fax} +{{depend fax}}<br/>F: {{var fax}}{{/depend}}| +{{depend vat_id}}<br/>VAT: {{var vat_id}}{{/depend}}| + #{prefix} #{firstname} #{middlename} #{lastname} #{suffix}<br/>#{company}<br/>#{street0}<br/>#{street1}<br/>#{street2}<br/>#{street3}<br/>#{city}, #{region}, #{postcode}<br/>#{country_id}<br/>T: #{telephone}<br/>F: #{fax}<br/>VAT: #{vat_id} diff --git a/app/code/core/Mage/Customer/etc/system.xml b/app/code/core/Mage/Customer/etc/system.xml index 66746b7e46..65987d4176 100644 --- a/app/code/core/Mage/Customer/etc/system.xml +++ b/app/code/core/Mage/Customer/etc/system.xml @@ -88,19 +88,88 @@ 1 1 + + + select + adminhtml/system_config_source_yesno + 10 + 1 + 1 + 1 + select adminhtml/system_config_source_customer_group - 1 + 20 1 1 1 + + + select + adminhtml/system_config_source_customer_group + 30 + 1 + 1 + 1 + 1 + + + + select + adminhtml/system_config_source_customer_group + 40 + 1 + 1 + 1 + 1 + + + + select + adminhtml/system_config_source_customer_group + 50 + 1 + 1 + 1 + 1 + + + + select + adminhtml/system_config_source_customer_group + 55 + 1 + 1 + 1 + 1 + + + + select + adminhtml/system_config_source_yesno + 56 + 1 + 1 + 1 + 1 + + + + select + adminhtml/system_config_source_yesno + 57 + 1 + 0 + 0 + 1 + text - 2 + 60 1 1 1 @@ -109,7 +178,7 @@ select adminhtml/system_config_source_email_template - 3 + 70 1 1 1 @@ -118,7 +187,7 @@ select adminhtml/system_config_source_email_identity - 4 + 80 1 1 1 @@ -127,7 +196,7 @@ select adminhtml/system_config_source_yesno - 5 + 90 1 1 0 @@ -136,7 +205,7 @@ select adminhtml/system_config_source_email_template - 6 + 100 1 1 1 @@ -146,7 +215,7 @@ This email will be sent instead of default welcome email, after account confirmation. select adminhtml/system_config_source_email_template - 7 + 110 1 1 1 @@ -155,7 +224,7 @@ select adminhtml/system_config_source_yesno - 8 + 120 1 0 0 @@ -199,6 +268,7 @@ + This value must be greater than 0. text adminhtml/system_config_backend_customer_password_link_expirationperiod 40 @@ -376,5 +446,32 @@ + + + + + + adminhtml/system_config_backend_customer_groupAutoAssign + + + + + + + adminhtml/system_config_backend_customer_groupAutoAssign + + + + Validate VAT Number + adminhtml/customer_system_config_validatevat + 28 + 1 + 1 + 1 + + + + + diff --git a/app/code/core/Mage/Customer/sql/customer_setup/upgrade-1.6.1.0-1.6.2.0.php b/app/code/core/Mage/Customer/sql/customer_setup/upgrade-1.6.1.0-1.6.2.0.php new file mode 100644 index 0000000000..0c39c37e37 --- /dev/null +++ b/app/code/core/Mage/Customer/sql/customer_setup/upgrade-1.6.1.0-1.6.2.0.php @@ -0,0 +1,94 @@ +addAttribute('customer', $disableAGCAttributeCode, array( + 'type' => 'static', + 'label' => 'Disable automatic group change', + 'input' => 'boolean', + 'backend' => 'customer/attribute_backend_data_boolean', + 'position' => 28, + 'required' => false +)); + +$disableAGCAttribute = Mage::getSingleton('eav/config') + ->getAttribute('customer', $disableAGCAttributeCode); +$disableAGCAttribute->setData('used_in_forms', array( + 'adminhtml_customer' +)); +$disableAGCAttribute->save(); + + +$attributesInfo = array( + 'vat_id' => array( + 'label' => 'VAT number', + 'type' => 'varchar', + 'input' => 'text', + 'position' => 140, + 'visible' => true, + 'required' => false + ), + 'vat_is_valid' => array( + 'label' => 'VAT number validity', + 'visible' => false, + 'required' => false, + 'type' => 'int' + ), + 'vat_request_id' => array( + 'label' => 'VAT number validation request ID', + 'type' => 'varchar', + 'visible' => false, + 'required' => false + ), + 'vat_request_date' => array( + 'label' => 'VAT number validation request date', + 'type' => 'varchar', + 'visible' => false, + 'required' => false + ), + 'vat_request_success' => array( + 'label' => 'VAT number validation request success', + 'visible' => false, + 'required' => false, + 'type' => 'int' + ) +); + +foreach ($attributesInfo as $attributeCode => $attributeParams) { + $installer->addAttribute('customer_address', $attributeCode, $attributeParams); +} + +$vatAttribute = Mage::getSingleton('eav/config')->getAttribute('customer_address', 'vat_id'); +$vatAttribute->setData('used_in_forms', array( + 'adminhtml_customer_address', + 'customer_address_edit', + 'customer_register_address' +)); +$vatAttribute->save(); diff --git a/app/code/core/Mage/Customer/sql/customer_setup/upgrade-1.6.2.0-1.6.2.0.1.php b/app/code/core/Mage/Customer/sql/customer_setup/upgrade-1.6.2.0-1.6.2.0.1.php new file mode 100644 index 0000000000..0d655bf475 --- /dev/null +++ b/app/code/core/Mage/Customer/sql/customer_setup/upgrade-1.6.2.0-1.6.2.0.1.php @@ -0,0 +1,36 @@ +getConnection()->addColumn($installer->getTable('customer/entity'), 'disable_auto_group_change', array( + 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, + 'unsigned' => true, + 'nullable' => false, + 'default' => '0', + 'comment' => 'Disable automatic group change' +)); diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Http/Curl.php b/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Http/Curl.php index da6787c284..a9475f2efc 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Http/Curl.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Http/Curl.php @@ -47,7 +47,7 @@ public function load() } // use Varien curl adapter - $http = new Varien_Http_Adapter_Curl; + $http = new Varien_Http_Adapter_Curl(); // send GET request $http->write('GET', $uri); @@ -55,6 +55,8 @@ public function load() // read the remote file $data = $http->read(); + $http->close(); + $data = preg_split('/^\r?$/m', $data, 2); $data = trim($data[1]); diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Validator/Column.php b/app/code/core/Mage/Dataflow/Model/Convert/Validator/Column.php index 1078be75fc..8ae9b7aba7 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Validator/Column.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Validator/Column.php @@ -34,5 +34,7 @@ */ class Mage_Dataflow_Model_Convert_Validator_Column extends Mage_Dataflow_Model_Convert_Validator_Abstract { - + public function validate() + { + } } diff --git a/app/code/core/Mage/Dataflow/Model/Mysql4/Batch/Abstract.php b/app/code/core/Mage/Dataflow/Model/Mysql4/Batch/Abstract.php index e2664a1031..9b26e509d5 100644 --- a/app/code/core/Mage/Dataflow/Model/Mysql4/Batch/Abstract.php +++ b/app/code/core/Mage/Dataflow/Model/Mysql4/Batch/Abstract.php @@ -32,6 +32,6 @@ * @package Mage_Dataflow * @author Magento Core Team */ -class Mage_Dataflow_Model_Mysql4_Batch_Abstract extends Mage_Dataflow_Model_Resource_Batch_Abstract +abstract class Mage_Dataflow_Model_Mysql4_Batch_Abstract extends Mage_Dataflow_Model_Resource_Batch_Abstract { } diff --git a/app/code/core/Mage/Dataflow/Model/Profile.php b/app/code/core/Mage/Dataflow/Model/Profile.php index 4a13a6d47a..e37b1cb894 100644 --- a/app/code/core/Mage/Dataflow/Model/Profile.php +++ b/app/code/core/Mage/Dataflow/Model/Profile.php @@ -80,7 +80,7 @@ protected function _beforeSave() $actionsXML = $this->getData('actions_xml'); if (strlen($actionsXML) < 0 && @simplexml_load_string('' . $actionsXML . '', null, LIBXML_NOERROR) === false) { - Mage::throwException(Mage::helper("dataflow")->__("Actions XML is not valid.")); + Mage::throwException(Mage::helper('dataflow')->__("Actions XML is not valid.")); } if (is_array($this->getGuiData())) { @@ -120,7 +120,7 @@ protected function _beforeSave() } if ($this->_getResource()->isProfileExists($this->getName(), $this->getId())) { - Mage::throwException(Mage::helper("dataflow")->__("Profile with the same name already exists.")); + Mage::throwException(Mage::helper('dataflow')->__("Profile with the same name already exists.")); } } diff --git a/app/code/core/Mage/Directory/sql/directory_setup/install-1.6.0.0.php b/app/code/core/Mage/Directory/sql/directory_setup/install-1.6.0.0.php index 8c0730a9c6..cc623d2772 100644 --- a/app/code/core/Mage/Directory/sql/directory_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Directory/sql/directory_setup/install-1.6.0.0.php @@ -40,12 +40,12 @@ 'default' => '', ), 'Country Id in ISO-2') ->addColumn('iso2_code', Varien_Db_Ddl_Table::TYPE_TEXT, 2, array( - 'nullable' => false, - 'default' => '', + 'nullable' => true, + 'default' => null, ), 'Country ISO-2 format') ->addColumn('iso3_code', Varien_Db_Ddl_Table::TYPE_TEXT, 3, array( - 'nullable' => false, - 'default' => '', + 'nullable' => true, + 'default' => null, ), 'Country ISO-3') ->setComment('Directory Country'); $installer->getConnection()->createTable($table); @@ -62,17 +62,22 @@ 'primary' => true, ), 'Country Format Id') ->addColumn('country_id', Varien_Db_Ddl_Table::TYPE_TEXT, 2, array( - 'nullable' => false, - 'default' => '', + 'nullable' => true, + 'default' => null, ), 'Country Id in ISO-2') ->addColumn('type', Varien_Db_Ddl_Table::TYPE_TEXT, 30, array( - 'nullable' => false, - 'default' => '', + 'nullable' => true, + 'default' => null, ), 'Country Format Type') ->addColumn('format', Varien_Db_Ddl_Table::TYPE_TEXT, '64k', array( 'nullable' => false, ), 'Country Format') - ->addIndex($installer->getIdxName('directory/country_format', array('country_id', 'type'), Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE), + ->addIndex( + $installer->getIdxName( + 'directory/country_format', + array('country_id', 'type'), + Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE + ), array('country_id', 'type'), array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE)) ->setComment('Directory Country Format'); $installer->getConnection()->createTable($table); @@ -93,8 +98,8 @@ 'default' => '0', ), 'Country Id in ISO-2') ->addColumn('code', Varien_Db_Ddl_Table::TYPE_TEXT, 32, array( - 'nullable' => false, - 'default' => '', + 'nullable' => true, + 'default' => null, ), 'Region code') ->addColumn('default_name', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array( ), 'Region Name') @@ -120,12 +125,13 @@ 'default' => '0', ), 'Region Id') ->addColumn('name', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array( - 'nullable' => false, - 'default' => '', + 'nullable' => true, + 'default' => null, ), 'Region Name') ->addIndex($installer->getIdxName('directory/country_region_name', array('region_id')), array('region_id')) - ->addForeignKey($installer->getFkName('directory/country_region_name', 'region_id', 'directory/country_region', 'region_id'), + ->addForeignKey( + $installer->getFkName('directory/country_region_name', 'region_id', 'directory/country_region', 'region_id'), 'region_id', $installer->getTable('directory/country_region'), 'region_id', Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE) ->setComment('Directory Country Region Name'); diff --git a/app/code/core/Mage/Downloadable/Model/Observer.php b/app/code/core/Mage/Downloadable/Model/Observer.php index caa86f0e52..de7d35f396 100644 --- a/app/code/core/Mage/Downloadable/Model/Observer.php +++ b/app/code/core/Mage/Downloadable/Model/Observer.php @@ -215,6 +215,12 @@ public function setLinkStatus($observer) if ($item->getProductType() == Mage_Downloadable_Model_Product_Type::TYPE_DOWNLOADABLE || $item->getRealProductType() == Mage_Downloadable_Model_Product_Type::TYPE_DOWNLOADABLE ) { + if ($item->getStatusId() == Mage_Sales_Model_Order_Item::STATUS_BACKORDERED && + $orderItemStatusToEnable == Mage_Sales_Model_Order_Item::STATUS_PENDING && + !in_array(Mage_Sales_Model_Order_Item::STATUS_BACKORDERED, $availableStatuses, true) ) { + $availableStatuses[] = Mage_Sales_Model_Order_Item::STATUS_BACKORDERED; + } + if (in_array($item->getStatusId(), $availableStatuses)) { $downloadableItemsStatuses[$item->getId()] = $linkStatuses['avail']; } diff --git a/app/code/core/Mage/Downloadable/Model/Resource/Indexer/Price.php b/app/code/core/Mage/Downloadable/Model/Resource/Indexer/Price.php index 53cbc0ef08..a040fdaff8 100755 --- a/app/code/core/Mage/Downloadable/Model/Resource/Indexer/Price.php +++ b/app/code/core/Mage/Downloadable/Model/Resource/Indexer/Price.php @@ -42,11 +42,17 @@ class Mage_Downloadable_Model_Resource_Indexer_Price extends Mage_Catalog_Model_ public function reindexAll() { $this->useIdxTable(true); - $this->_prepareFinalPriceData(); - $this->_applyCustomOption(); - $this->_applyDownloadableLink(); - $this->_movePriceDataToIndexTable(); - + $this->beginTransaction(); + try { + $this->_prepareFinalPriceData(); + $this->_applyCustomOption(); + $this->_applyDownloadableLink(); + $this->_movePriceDataToIndexTable(); + $this->commit(); + } catch (Exception $e) { + $this->rollBack(); + throw $e; + } return $this; } @@ -140,6 +146,7 @@ protected function _applyDownloadableLink() $write->query($query); $ifTierPrice = $write->getCheckSql('i.tier_price IS NOT NULL', '(i.tier_price + id.min_price)', 'NULL'); + $ifGroupPrice = $write->getCheckSql('i.group_price IS NOT NULL', '(i.group_price + id.min_price)', 'NULL'); $select = $write->select() ->join( @@ -148,19 +155,16 @@ protected function _applyDownloadableLink() .' AND i.website_id = id.website_id', array()) ->columns(array( - 'min_price' => new Zend_Db_Expr('i.min_price + id.min_price'), - 'max_price' => new Zend_Db_Expr('i.max_price + id.max_price'), - 'tier_price' => new Zend_Db_Expr($ifTierPrice) + 'min_price' => new Zend_Db_Expr('i.min_price + id.min_price'), + 'max_price' => new Zend_Db_Expr('i.max_price + id.max_price'), + 'tier_price' => new Zend_Db_Expr($ifTierPrice), + 'group_price' => new Zend_Db_Expr($ifGroupPrice), )); $query = $select->crossUpdateFromSelect(array('i' => $this->_getDefaultFinalPriceTable())); $write->query($query); - if ($this->useIdxTable() && $this->_allowTableChanges) { - $write->truncateTable($table); - } else { - $write->delete($table); - } + $write->delete($table); return $this; } diff --git a/app/code/core/Mage/Downloadable/controllers/Adminhtml/Downloadable/FileController.php b/app/code/core/Mage/Downloadable/controllers/Adminhtml/Downloadable/FileController.php index 6e4f8bd96f..1d87939d8f 100644 --- a/app/code/core/Mage/Downloadable/controllers/Adminhtml/Downloadable/FileController.php +++ b/app/code/core/Mage/Downloadable/controllers/Adminhtml/Downloadable/FileController.php @@ -55,6 +55,12 @@ public function uploadAction() $uploader->setFilesDispersion(true); $result = $uploader->save($tmpPath); + /** + * Workaround for prototype 1.7 methods "isJSON", "evalJSON" on Windows OS + */ + $result['tmp_name'] = str_replace(DS, "/", $result['tmp_name']); + $result['path'] = str_replace(DS, "/", $result['path']); + if (isset($result['file'])) { $fullPath = rtrim($tmpPath, DS) . DS . ltrim($result['file'], DS); Mage::helper('core/file_storage_database')->saveFile($fullPath); diff --git a/app/code/core/Mage/Downloadable/controllers/DownloadController.php b/app/code/core/Mage/Downloadable/controllers/DownloadController.php index 0a5b905854..57fc8776e1 100644 --- a/app/code/core/Mage/Downloadable/controllers/DownloadController.php +++ b/app/code/core/Mage/Downloadable/controllers/DownloadController.php @@ -164,10 +164,7 @@ public function linkAction() if (!$customerId) { $product = Mage::getModel('catalog/product')->load($linkPurchasedItem->getProductId()); if ($product->getId()) { - $notice = Mage::helper('downloadable')->__( - 'Please log in to download your product or purchase %s.', - $product->getProductUrl(), $product->getName() - ); + $notice = Mage::helper('downloadable')->__('Please log in to download your product or purchase %s.', $product->getProductUrl(), $product->getName()); } else { $notice = Mage::helper('downloadable')->__('Please log in to download your product.'); } diff --git a/app/code/core/Mage/Downloadable/etc/config.xml b/app/code/core/Mage/Downloadable/etc/config.xml index 735b0a600b..22e7dc29f6 100644 --- a/app/code/core/Mage/Downloadable/etc/config.xml +++ b/app/code/core/Mage/Downloadable/etc/config.xml @@ -28,7 +28,7 @@ - 1.6.0.0.1 + 1.6.0.0.2 diff --git a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-1.6.0.0.1-1.6.0.0.2.php b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-1.6.0.0.1-1.6.0.0.2.php new file mode 100644 index 0000000000..a24f7f3ec3 --- /dev/null +++ b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-1.6.0.0.1-1.6.0.0.2.php @@ -0,0 +1,39 @@ +getConnection(); +$connection->changeTableEngine( + $installer->getTable('downloadable/product_price_indexer_tmp'), + Varien_Db_Adapter_Pdo_Mysql::ENGINE_MEMORY +); diff --git a/app/code/core/Mage/Downloadable/sql/downloadable_setup/upgrade-1.6.0.0.1-1.6.0.0.2.php b/app/code/core/Mage/Downloadable/sql/downloadable_setup/upgrade-1.6.0.0.1-1.6.0.0.2.php new file mode 100644 index 0000000000..5d7e8f5384 --- /dev/null +++ b/app/code/core/Mage/Downloadable/sql/downloadable_setup/upgrade-1.6.0.0.1-1.6.0.0.2.php @@ -0,0 +1,34 @@ +getAttribute(Mage_Catalog_Model_Product::ENTITY, 'group_price', 'apply_to')); +if (!in_array(Mage_Downloadable_Model_Product_Type::TYPE_DOWNLOADABLE, $applyTo)) { + $applyTo[] = Mage_Downloadable_Model_Product_Type::TYPE_DOWNLOADABLE; + $installer->updateAttribute(Mage_Catalog_Model_Product::ENTITY, 'group_price', 'apply_to', implode(',', $applyTo)); +} diff --git a/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Main/Abstract.php b/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Main/Abstract.php index b2b77455c6..c3dedc3c71 100644 --- a/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Main/Abstract.php +++ b/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Main/Abstract.php @@ -84,8 +84,7 @@ protected function _prepareForm() 'name' => 'attribute_code', 'label' => Mage::helper('eav')->__('Attribute Code'), 'title' => Mage::helper('eav')->__('Attribute Code'), - 'note' => Mage::helper('eav')->__('For internal use. Must be unique with no spaces. Maximum length of attribute code must be less then %s symbols', - Mage_Eav_Model_Entity_Attribute::ATTRIBUTE_CODE_MAX_LENGTH), + 'note' => Mage::helper('eav')->__('For internal use. Must be unique with no spaces. Maximum length of attribute code must be less then %s symbols', Mage_Eav_Model_Entity_Attribute::ATTRIBUTE_CODE_MAX_LENGTH), 'class' => $validateClass, 'required' => true, )); diff --git a/app/code/core/Mage/Eav/Model/Attribute/Data/Date.php b/app/code/core/Mage/Eav/Model/Attribute/Data/Date.php index 1041f410ea..309c4aca04 100644 --- a/app/code/core/Mage/Eav/Model/Attribute/Data/Date.php +++ b/app/code/core/Mage/Eav/Model/Attribute/Data/Date.php @@ -83,21 +83,11 @@ public function validateValue($value) || (!empty($validateRules['date_range_max']) && (strtotime($value) > $validateRules['date_range_max'])) ) { if (!empty($validateRules['date_range_min']) && !empty($validateRules['date_range_max'])) { - $errors[] = Mage::helper('customer')->__('Please enter a valid date between %s and %s at %s.', - date('d/m/Y', $validateRules['date_range_min']), - date('d/m/Y', $validateRules['date_range_max']), - $label - ); + $errors[] = Mage::helper('customer')->__('Please enter a valid date between %s and %s at %s.', date('d/m/Y', $validateRules['date_range_min']), date('d/m/Y', $validateRules['date_range_max']), $label); } elseif (!empty($validateRules['date_range_min'])) { - $errors[] = Mage::helper('customer')->__('Please enter a valid date equal to or greater than %s at %s.', - date('d/m/Y', $validateRules['date_range_min']), - $label - ); + $errors[] = Mage::helper('customer')->__('Please enter a valid date equal to or greater than %s at %s.', date('d/m/Y', $validateRules['date_range_min']), $label); } elseif (!empty($validateRules['date_range_max'])) { - $errors[] = Mage::helper('customer')->__('Please enter a valid date less than or equal to %s at %s.', - date('d/m/Y', $validateRules['date_range_max']), - $label - ); + $errors[] = Mage::helper('customer')->__('Please enter a valid date less than or equal to %s at %s.', date('d/m/Y', $validateRules['date_range_max']), $label); } } diff --git a/app/code/core/Mage/Eav/Model/Entity/Abstract.php b/app/code/core/Mage/Eav/Model/Entity/Abstract.php index 1a1d7babd8..267ca194f5 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Abstract.php +++ b/app/code/core/Mage/Eav/Model/Entity/Abstract.php @@ -1091,7 +1091,7 @@ protected function _setAttributeValue($object, $valueRow) if ($attribute) { $attributeCode = $attribute->getAttributeCode(); $object->setData($attributeCode, $valueRow['value']); - $attribute->getBackend()->setValueId($valueRow['value_id']); + $attribute->getBackend()->setEntityValueId($object, $valueRow['value_id']); } return $this; @@ -1226,11 +1226,11 @@ protected function _collectSaveData($newObject) if ($this->_isAttributeValueEmpty($attribute, $v)) { $delete[$attribute->getBackend()->getTable()][] = array( 'attribute_id' => $attrId, - 'value_id' => $attribute->getBackend()->getValueId() + 'value_id' => $attribute->getBackend()->getEntityValueId($newObject) ); } elseif ($v !== $origData[$k]) { $update[$attrId] = array( - 'value_id' => $attribute->getBackend()->getValueId(), + 'value_id' => $attribute->getBackend()->getEntityValueId($newObject), 'value' => $v, ); } diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Abstract.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Abstract.php index ffd89913a8..162c036c5c 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Abstract.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Abstract.php @@ -32,7 +32,8 @@ * @package Mage_Eav * @author Magento Core Team */ -abstract class Mage_Eav_Model_Entity_Attribute_Backend_Abstract implements Mage_Eav_Model_Entity_Attribute_Backend_Interface +abstract class Mage_Eav_Model_Entity_Attribute_Backend_Abstract + implements Mage_Eav_Model_Entity_Attribute_Backend_Interface { /** * Reference to the attribute instance @@ -48,6 +49,13 @@ abstract class Mage_Eav_Model_Entity_Attribute_Backend_Abstract implements Mage_ */ protected $_valueId; + /** + * PK value_ids for each loaded entity + * + * @var array + */ + protected $_valueIds = array(); + /** * Table name for this attribute * @@ -164,7 +172,24 @@ public function setValueId($valueId) } /** - * Retreive value id + * Set entity value id + * + * @param Varien_Object $entity + * @param int $valueId + * @return Mage_Eav_Model_Entity_Attribute_Backend_Abstract + */ + public function setEntityValueId($entity, $valueId) + { + if (!$entity || !$entity->getId()) { + return $this->setValueId($valueId); + } + + $this->_valueIds[$entity->getId()] = $valueId; + return $this; + } + + /** + * Retrieve value id * * @return int */ @@ -174,7 +199,22 @@ public function getValueId() } /** - * Retreive default value + * Get entity value id + * + * @param Varien_Object $entity + * @return int + */ + public function getEntityValueId($entity) + { + if (!$entity || !$entity->getId() || !array_key_exists($entity->getId(), $this->_valueIds)) { + return $this->getValueId(); + } + + return $this->_valueIds[$entity->getId()]; + } + + /** + * Retrieve default value * * @return mixed */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Interface.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Interface.php index 32f2863c18..d0a063dfb6 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Interface.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Interface.php @@ -45,4 +45,19 @@ public function beforeSave($object); public function afterSave($object); public function beforeDelete($object); public function afterDelete($object); + + /** + * Get entity value id + * + * @param Varien_Object $entity + */ + public function getEntityValueId($entity); + + /** + * Set entity value id + * + * @param Varien_Object $entity + * @param int $valueId + */ + public function setEntityValueId($entity, $valueId); } diff --git a/app/code/core/Mage/Eav/Model/Entity/Setup.php b/app/code/core/Mage/Eav/Model/Entity/Setup.php index 7740fe0a1b..cae1249026 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Setup.php +++ b/app/code/core/Mage/Eav/Model/Entity/Setup.php @@ -1296,8 +1296,8 @@ public function createEntityTables($baseTableName, array $options = array()) foreach ($types as $type => $fieldType) { $eavTableName = array($baseTableName, $type); - $eavTable = $connection - ->newTable($this->getTable($eavTableName)) + $eavTable = $connection->newTable($this->getTable($eavTableName)); + $eavTable ->addColumn('value_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array( 'identity' => true, 'nullable' => false, @@ -1333,13 +1333,17 @@ public function createEntityTables($baseTableName, array $options = array()) ->addIndex($this->getIdxName($eavTableName, array('store_id')), array('store_id')) ->addIndex($this->getIdxName($eavTableName, array('entity_id')), - array('entity_id')) - ->addIndex($this->getIdxName($eavTableName, array('attribute_id', 'value')), - array('attribute_id', 'value')) - ->addIndex($this->getIdxName($eavTableName, array('entity_type_id', 'value')), - array('entity_type_id', 'value')) - ->addForeignKey($this->getFkName($eavTableName, 'entity_id', 'eav/entity', 'entity_id'), - 'entity_id', $this->getTable('eav/entity'), 'entity_id', + array('entity_id')); + if ($type !== 'text') { + $eavTable->addIndex($this->getIdxName($eavTableName, array('attribute_id', 'value')), + array('attribute_id', 'value')); + $eavTable->addIndex($this->getIdxName($eavTableName, array('entity_type_id', 'value')), + array('entity_type_id', 'value')); + } + + $eavTable + ->addForeignKey($this->getFkName($eavTableName, 'entity_id', $baseTableName, 'entity_id'), + 'entity_id', $this->getTable($baseTableName), 'entity_id', Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE) ->addForeignKey($this->getFkName($eavTableName, 'entity_type_id', 'eav/entity_type', 'entity_type_id'), 'entity_type_id', $this->getTable('eav/entity_type'), 'entity_type_id', diff --git a/app/code/core/Mage/Eav/sql/eav_setup/install-1.6.0.0.php b/app/code/core/Mage/Eav/sql/eav_setup/install-1.6.0.0.php index 92965fb496..d31768d937 100644 --- a/app/code/core/Mage/Eav/sql/eav_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Eav/sql/eav_setup/install-1.6.0.0.php @@ -92,7 +92,7 @@ ), 'Additional Attribute Table') ->addColumn('entity_attribute_collection', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array( 'nullable' => true, - 'default' => '', + 'default' => null, ), 'Entity Attribute Collection') ->addIndex($installer->getIdxName('eav/entity_type', array('entity_type_code')), array('entity_type_code')) @@ -121,8 +121,8 @@ 'default' => '0', ), 'Attribute Set Id') ->addColumn('increment_id', Varien_Db_Ddl_Table::TYPE_TEXT, 50, array( - 'nullable' => false, - 'default' => '', + 'nullable' => true, + 'default' => null, ), 'Increment Id') ->addColumn('parent_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array( 'unsigned' => true, @@ -520,8 +520,8 @@ 'default' => '0', ), 'Entity Id') ->addColumn('value', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array( - 'nullable' => false, - 'default' => '', + 'nullable' => true, + 'default' => null, ), 'Attribute Value') ->addIndex($installer->getIdxName(array('eav/entity_value_prefix', 'varchar'), array('entity_type_id')), array('entity_type_id')) @@ -589,8 +589,8 @@ 'default' => '0', ), 'Entity Type Id') ->addColumn('attribute_code', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array( - 'nullable' => false, - 'default' => '', + 'nullable' => true, + 'default' => null, ), 'Attribute Code') ->addColumn('attribute_model', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array( ), 'Attribute Model') @@ -706,8 +706,8 @@ 'default' => '0', ), 'Entity Type Id') ->addColumn('attribute_set_name', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array( - 'nullable' => false, - 'default' => '', + 'nullable' => true, + 'default' => null, ), 'Attribute Set Name') ->addColumn('sort_order', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array( 'nullable' => false, @@ -746,8 +746,8 @@ 'default' => '0', ), 'Attribute Set Id') ->addColumn('attribute_group_name', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array( - 'nullable' => false, - 'default' => '', + 'nullable' => true, + 'default' => null, ), 'Attribute Group Name') ->addColumn('sort_order', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array( 'nullable' => false, @@ -900,8 +900,8 @@ 'default' => '0', ), 'Store Id') ->addColumn('value', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array( - 'nullable' => false, - 'default' => '', + 'nullable' => true, + 'default' => null, ), 'Value') ->addIndex($installer->getIdxName('eav/attribute_option_value', array('option_id')), array('option_id')) @@ -940,8 +940,8 @@ 'default' => '0', ), 'Store Id') ->addColumn('value', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array( - 'nullable' => false, - 'default' => '', + 'nullable' => true, + 'default' => null, ), 'Value') ->addIndex($installer->getIdxName('eav/attribute_label', array('attribute_id')), array('attribute_id')) diff --git a/app/code/core/Mage/GoogleAnalytics/Block/Ga.php b/app/code/core/Mage/GoogleAnalytics/Block/Ga.php index e6a7cb41e0..beaf7a538b 100644 --- a/app/code/core/Mage/GoogleAnalytics/Block/Ga.php +++ b/app/code/core/Mage/GoogleAnalytics/Block/Ga.php @@ -32,7 +32,7 @@ * @package Mage_GoogleAnalytics * @author Magento Core Team */ -class Mage_GoogleAnalytics_Block_Ga extends Mage_Core_Block_Text +class Mage_GoogleAnalytics_Block_Ga extends Mage_Core_Block_Template { /** * @deprecated after 1.4.1.1 @@ -119,11 +119,14 @@ protected function _getOrdersTrackingCode() $address = $order->getShippingAddress(); } $result[] = sprintf("_gaq.push(['_addTrans', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s']);", - $order->getIncrementId(), Mage::app()->getStore()->getFrontendName(), $order->getBaseGrandTotal(), - $order->getBaseTaxAmount(), $order->getBaseShippingAmount(), - $this->jsQuoteEscape($address->getCity()), - $this->jsQuoteEscape($address->getRegion()), - $this->jsQuoteEscape($address->getCountry()) + $order->getIncrementId(), + $this->jsQuoteEscape(Mage::app()->getStore()->getFrontendName()), + $order->getBaseGrandTotal(), + $order->getBaseTaxAmount(), + $order->getBaseShippingAmount(), + $this->jsQuoteEscape(Mage::helper('core')->escapeHtml($address->getCity())), + $this->jsQuoteEscape(Mage::helper('core')->escapeHtml($address->getRegion())), + $this->jsQuoteEscape(Mage::helper('core')->escapeHtml($address->getCountry())) ); foreach ($order->getAllVisibleItems() as $item) { $result[] = sprintf("_gaq.push(['_addItem', '%s', '%s', '%s', '%s', '%s', '%s']);", @@ -148,22 +151,7 @@ protected function _toHtml() if (!Mage::helper('googleanalytics')->isGoogleAnalyticsAvailable()) { return ''; } - $accountId = Mage::getStoreConfig(Mage_GoogleAnalytics_Helper_Data::XML_PATH_ACCOUNT); - return ' - - -'; + return parent::_toHtml(); } } diff --git a/app/code/core/Mage/GoogleBase/Model/Observer.php b/app/code/core/Mage/GoogleBase/Model/Observer.php index 9949c7b426..2b36d27931 100644 --- a/app/code/core/Mage/GoogleBase/Model/Observer.php +++ b/app/code/core/Mage/GoogleBase/Model/Observer.php @@ -58,8 +58,7 @@ public function saveProductItem($observer) } catch (Exception $e) { if (Mage::app()->getStore()->isAdmin()) { Mage::getSingleton('adminhtml/session')->addNotice( - Mage::helper('googlebase')->__("Cannot update Google Base Item for Store '%s'", - Mage::app()->getStore($item->getStoreId())->getName()) + Mage::helper('googlebase')->__("Cannot update Google Base Item for Store '%s'", Mage::app()->getStore($item->getStoreId())->getName()) ); } else { throw $e; @@ -89,8 +88,7 @@ public function deleteProductItem($observer) } catch (Exception $e) { if (Mage::app()->getStore()->isAdmin()) { Mage::getSingleton('adminhtml/session')->addNotice( - Mage::helper('googlebase')->__("Cannot update Google Base Item for Store '%s'", - Mage::app()->getStore($item->getStoreId())->getName()) + Mage::helper('googlebase')->__("Cannot update Google Base Item for Store '%s'", Mage::app()->getStore($item->getStoreId())->getName()) ); } else { throw $e; diff --git a/app/code/core/Mage/GoogleCheckout/Model/Api/Xml/Abstract.php b/app/code/core/Mage/GoogleCheckout/Model/Api/Xml/Abstract.php index 52c89bc4b8..c4ae8a80df 100644 --- a/app/code/core/Mage/GoogleCheckout/Model/Api/Xml/Abstract.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Api/Xml/Abstract.php @@ -66,7 +66,10 @@ public function getMerchantKey() public function getServerType() { if (!$this->hasData('server_type')) { - $this->setData('server_type', Mage::getStoreConfig('google/checkout/sandbox', $this->getStoreId()) ? "sandbox" : ""); + $this->setData( + 'server_type', + Mage::getStoreConfig('google/checkout/sandbox', $this->getStoreId()) ? "sandbox" : "" + ); } return $this->getData('server_type'); } @@ -173,6 +176,7 @@ public function _call($xml) $response = preg_split('/^\r?$/m', $response, 2); $response = trim($response[1]); $debugData['result'] = $response; + $http->close(); } catch (Exception $e) { $debugData['result'] = array('error' => $e->getMessage(), 'code' => $e->getCode()); @@ -183,7 +187,9 @@ public function _call($xml) $this->getApi()->debugData($debugData); $result = @simplexml_load_string($response); if (!$result) { - $result = simplexml_load_string('Invalid response from Google Checkout server'); + $result = simplexml_load_string( + 'Invalid response from Google Checkout server' + ); } if ($result->getName() == 'error') { $this->setError($this->__('Google Checkout: %s', (string)$result->{'error-message'})); @@ -199,7 +205,10 @@ public function _call($xml) protected function _getCallbackUrl() { - return Mage::getUrl('googlecheckout/api', array('_forced_secure'=>Mage::getStoreConfig('google/checkout/use_secure_callback_url', $this->getStoreId()))); + return Mage::getUrl( + 'googlecheckout/api', + array('_forced_secure'=>Mage::getStoreConfig('google/checkout/use_secure_callback_url',$this->getStoreId())) + ); } /** diff --git a/app/code/core/Mage/GoogleCheckout/Model/Api/Xml/Checkout.php b/app/code/core/Mage/GoogleCheckout/Model/Api/Xml/Checkout.php index 97b0ad3b88..3aa11ff685 100644 --- a/app/code/core/Mage/GoogleCheckout/Model/Api/Xml/Checkout.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Api/Xml/Checkout.php @@ -896,10 +896,7 @@ protected function _getCustomerTaxClass() { $customerGroup = $this->getQuote()->getCustomerGroupId(); if (!$customerGroup) { - $customerGroup = Mage::getStoreConfig( - Mage_Customer_Model_Group::XML_PATH_DEFAULT_ID, - $this->getQuote()->getStoreId() - ); + $customerGroup = Mage::helper('customer')->getDefaultCustomerGroupId($this->getQuote()->getStoreId()); } return Mage::getModel('customer/group')->load($customerGroup)->getTaxClassId(); } diff --git a/app/code/core/Mage/GoogleCheckout/Model/Payment.php b/app/code/core/Mage/GoogleCheckout/Model/Payment.php index 6028996379..c944b0c847 100644 --- a/app/code/core/Mage/GoogleCheckout/Model/Payment.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Payment.php @@ -59,7 +59,7 @@ public function canEdit() /** * Return Order Place Redirect URL * - * @return string Order Redirect URL + * @return string Order Redirect URL */ public function getOrderPlaceRedirectUrl() { @@ -114,21 +114,15 @@ public function capture(Varien_Object $payment, $amount) /** * Refund money * - * @param Varien_Object $invoicePayment + * @param Varien_Object $payment + * @param float $amount + * * @return Mage_GoogleCheckout_Model_Payment */ - //public function refund(Varien_Object $payment, $amount) public function refund(Varien_Object $payment, $amount) { - $hlp = Mage::helper('googlecheckout'); - -// foreach ($payment->getCreditMemo()->getCommentsCollection() as $comment) { -// $this->setReason($hlp->__('See Comments')); -// $this->setComment($comment->getComment()); -// } - - $reason = $this->getReason() ? $this->getReason() : $hlp->__('No Reason'); - $comment = $this->getComment() ? $this->getComment() : $hlp->__('No Comment'); + $reason = $this->getReason() ? $this->getReason() : Mage::helper('googlecheckout')->__('No Reason'); + $comment = $this->getComment() ? $this->getComment() : Mage::helper('googlecheckout')->__('No Comment'); $api = Mage::getModel('googlecheckout/api')->setStoreId($payment->getOrder()->getStoreId()); $api->refund($payment->getOrder()->getExtOrderId(), $amount, $reason, $comment); @@ -146,15 +140,15 @@ public function void(Varien_Object $payment) /** * Void payment * - * @param Varien_Object $invoicePayment - * @return Mage_GoogleCheckout_Model_Payment + * @param Varien_Object $payment + * + * @return Mage_GoogleCheckout_Model_Payment */ public function cancel(Varien_Object $payment) { if (!$payment->getOrder()->getBeingCanceledFromGoogleApi()) { - $hlp = Mage::helper('googlecheckout'); - $reason = $this->getReason() ? $this->getReason() : $hlp->__('Unknown Reason'); - $comment = $this->getComment() ? $this->getComment() : $hlp->__('No Comment'); + $reason = $this->getReason() ? $this->getReason() : Mage::helper('googlecheckout')->__('Unknown Reason'); + $comment = $this->getComment() ? $this->getComment() : Mage::helper('googlecheckout')->__('No Comment'); $api = Mage::getModel('googlecheckout/api')->setStoreId($payment->getOrder()->getStoreId()); $api->cancel($payment->getOrder()->getExtOrderId(), $reason, $comment); @@ -164,10 +158,11 @@ public function cancel(Varien_Object $payment) } /** - * Retrieve information from payment configuration. - * Rewrited because of custom node for checkout settings + * Retrieve information from payment configuration + * + * @param string $field + * @param int|string|null|Mage_Core_Model_Store $storeId * - * @param string $field * @return mixed */ public function getConfigData($field, $storeId = null) @@ -176,6 +171,7 @@ public function getConfigData($field, $storeId = null) $storeId = $this->getStore(); } $path = 'google/checkout/' . $field; + return Mage::getStoreConfig($path, $storeId); } diff --git a/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Carrier.php b/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Carrier.php index 66ea14961a..e20b8bd2e8 100644 --- a/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Carrier.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Carrier.php @@ -29,31 +29,30 @@ class Mage_GoogleCheckout_Model_Source_Shipping_Carrier { public function toOptionArray() { - $hlp = Mage::helper('googlecheckout'); return array( - array('label' => $hlp->__('FedEx'), 'value' => array( - array('label' => $hlp->__('Ground'), 'value' => 'FedEx/Ground'), - array('label' => $hlp->__('Home Delivery'), 'value' => 'FedEx/Home Delivery'), - array('label' => $hlp->__('Express Saver'), 'value' => 'FedEx/Express Saver'), - array('label' => $hlp->__('First Overnight'), 'value' => 'FedEx/First Overnight'), - array('label' => $hlp->__('Priority Overnight'), 'value' => 'FedEx/Priority Overnight'), - array('label' => $hlp->__('Standard Overnight'), 'value' => 'FedEx/Standard Overnight'), - array('label' => $hlp->__('2Day'), 'value' => 'FedEx/2Day'), + array('label' => Mage::helper('googlecheckout')->__('FedEx'), 'value' => array( + array('label' => Mage::helper('googlecheckout')->__('Ground'), 'value' => 'FedEx/Ground'), + array('label' => Mage::helper('googlecheckout')->__('Home Delivery'), 'value' => 'FedEx/Home Delivery'), + array('label' => Mage::helper('googlecheckout')->__('Express Saver'), 'value' => 'FedEx/Express Saver'), + array('label' => Mage::helper('googlecheckout')->__('First Overnight'), 'value' => 'FedEx/First Overnight'), + array('label' => Mage::helper('googlecheckout')->__('Priority Overnight'), 'value' => 'FedEx/Priority Overnight'), + array('label' => Mage::helper('googlecheckout')->__('Standard Overnight'), 'value' => 'FedEx/Standard Overnight'), + array('label' => Mage::helper('googlecheckout')->__('2Day'), 'value' => 'FedEx/2Day'), )), - array('label' => $hlp->__('UPS'), 'value' => array( - array('label' => $hlp->__('Next Day Air'), 'value' => 'UPS/Next Day Air'), - array('label' => $hlp->__('Next Day Air Early AM'), 'value' => 'UPS/Next Day Air Early AM'), - array('label' => $hlp->__('Next Day Air Saver'), 'value' => 'UPS/Next Day Air Saver'), - array('label' => $hlp->__('2nd Day Air'), 'value' => 'UPS/2nd Day Air'), - array('label' => $hlp->__('2nd Day Air AM'), 'value' => 'UPS/2nd Day Air AM'), - array('label' => $hlp->__('3 Day Select'), 'value' => 'UPS/3 Day Select'), - array('label' => $hlp->__('Ground'), 'value' => 'UPS/Ground'), + array('label' => Mage::helper('googlecheckout')->__('UPS'), 'value' => array( + array('label' => Mage::helper('googlecheckout')->__('Next Day Air'), 'value' => 'UPS/Next Day Air'), + array('label' => Mage::helper('googlecheckout')->__('Next Day Air Early AM'), 'value' => 'UPS/Next Day Air Early AM'), + array('label' => Mage::helper('googlecheckout')->__('Next Day Air Saver'), 'value' => 'UPS/Next Day Air Saver'), + array('label' => Mage::helper('googlecheckout')->__('2nd Day Air'), 'value' => 'UPS/2nd Day Air'), + array('label' => Mage::helper('googlecheckout')->__('2nd Day Air AM'), 'value' => 'UPS/2nd Day Air AM'), + array('label' => Mage::helper('googlecheckout')->__('3 Day Select'), 'value' => 'UPS/3 Day Select'), + array('label' => Mage::helper('googlecheckout')->__('Ground'), 'value' => 'UPS/Ground'), )), - array('label' => $hlp->__('USPS'), 'value' => array( - array('label' => $hlp->__('Express Mail'), 'value' => 'USPS/Express Mail'), - array('label' => $hlp->__('Priority Mail'), 'value' => 'USPS/Priority Mail'), - array('label' => $hlp->__('Parcel Post'), 'value' => 'USPS/Parcel Post'), - array('label' => $hlp->__('Media Mail'), 'value' => 'USPS/Media Mail'), + array('label' => Mage::helper('googlecheckout')->__('USPS'), 'value' => array( + array('label' => Mage::helper('googlecheckout')->__('Express Mail'), 'value' => 'USPS/Express Mail'), + array('label' => Mage::helper('googlecheckout')->__('Priority Mail'), 'value' => 'USPS/Priority Mail'), + array('label' => Mage::helper('googlecheckout')->__('Parcel Post'), 'value' => 'USPS/Parcel Post'), + array('label' => Mage::helper('googlecheckout')->__('Media Mail'), 'value' => 'USPS/Media Mail'), )), ); } diff --git a/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Category.php b/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Category.php index 7c9028a2fd..390224cc43 100644 --- a/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Category.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Category.php @@ -29,10 +29,9 @@ class Mage_GoogleCheckout_Model_Source_Shipping_Category { public function toOptionArray() { - $hlp = Mage::helper('googlecheckout'); return array( - array('value' => 'COMMERCIAL', 'label' => $hlp->__('Commercial')), - array('value' => 'RESIDENTIAL', 'label' => $hlp->__('Residential')), + array('value' => 'COMMERCIAL', 'label' => Mage::helper('googlecheckout')->__('Commercial')), + array('value' => 'RESIDENTIAL', 'label' => Mage::helper('googlecheckout')->__('Residential')), ); } } diff --git a/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Units.php b/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Units.php index 88720402a7..bc34bc101a 100644 --- a/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Units.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Units.php @@ -29,9 +29,8 @@ class Mage_GoogleCheckout_Model_Source_Shipping_Units { public function toOptionArray() { - $hlp = Mage::helper('googlecheckout'); return array( - array('value' => 'IN', 'label' => $hlp->__('Inches')), + array('value' => 'IN', 'label' => Mage::helper('googlecheckout')->__('Inches')), ); } } diff --git a/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Virtual/Method.php b/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Virtual/Method.php index 2408a46531..faf863a427 100644 --- a/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Virtual/Method.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Virtual/Method.php @@ -29,11 +29,10 @@ class Mage_GoogleCheckout_Model_Source_Shipping_Virtual_Method { public function toOptionArray() { - $hlp = Mage::helper('googlecheckout'); return array( - array('value' => 'email', 'label' => $hlp->__('Email delivery')), - // array('value'=>'key_url', 'label'=>$hlp->__('Key/URL delivery')), - // array('value'=>'description_based', 'label'=>$hlp->__('Description-based delivery')), + array('value' => 'email', 'label' => Mage::helper('googlecheckout')->__('Email delivery')), + // array('value'=>'key_url', 'label'=> Mage::helper('googlecheckout')->__('Key/URL delivery')), + // array('value'=>'description_based', 'label'=> Mage::helper('googlecheckout')->__('Description-based delivery')) ); } } diff --git a/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Virtual/Schedule.php b/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Virtual/Schedule.php index 8a2651625b..391b1ae810 100644 --- a/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Virtual/Schedule.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Virtual/Schedule.php @@ -29,10 +29,9 @@ class Mage_GoogleCheckout_Model_Source_Shipping_Virtual_Schedule { public function toOptionArray() { - $hlp = Mage::helper('googlecheckout'); return array( - array('value' => 'OPTIMISTIC', 'label' => $hlp->__('Optimistic')), - array('value' => 'PESSIMISTIC', 'label' => $hlp->__('Pessimistic')), + array('value' => 'OPTIMISTIC', 'label' => Mage::helper('googlecheckout')->__('Optimistic')), + array('value' => 'PESSIMISTIC', 'label' => Mage::helper('googlecheckout')->__('Pessimistic')), ); } } diff --git a/app/code/core/Mage/ImportExport/Model/Export/Entity/Abstract.php b/app/code/core/Mage/ImportExport/Model/Export/Entity/Abstract.php index a94c955db2..68ea2566ba 100644 --- a/app/code/core/Mage/ImportExport/Model/Export/Entity/Abstract.php +++ b/app/code/core/Mage/ImportExport/Model/Export/Entity/Abstract.php @@ -256,11 +256,13 @@ protected function _prepareEntityCollection(Mage_Eav_Model_Entity_Collection_Abs $from = array_shift($exportFilter[$attrCode]); $to = array_shift($exportFilter[$attrCode]); - if (is_scalar($from) && strtotime($from)) { - $collection->addAttributeToFilter($attrCode, array('from' => $from, 'date' => true)); + if (is_scalar($from) && !empty($from)) { + $date = Mage::app()->getLocale()->date($from,null,null,false)->toString('MM/dd/YYYY'); + $collection->addAttributeToFilter($attrCode, array('from' => $date, 'date' => true)); } - if (is_scalar($to) && strtotime($to)) { - $collection->addAttributeToFilter($attrCode, array('to' => $to, 'date' => true)); + if (is_scalar($to) && !empty($to)) { + $date = Mage::app()->getLocale()->date($to,null,null,false)->toString('MM/dd/YYYY'); + $collection->addAttributeToFilter($attrCode, array('to' => $date, 'date' => true)); } } } elseif (Mage_ImportExport_Model_Export::FILTER_TYPE_NUMBER == $attrFilterType) { diff --git a/app/code/core/Mage/ImportExport/Model/Import.php b/app/code/core/Mage/ImportExport/Model/Import.php index b6d103b11d..b253f82a9f 100644 --- a/app/code/core/Mage/ImportExport/Model/Import.php +++ b/app/code/core/Mage/ImportExport/Model/Import.php @@ -74,7 +74,8 @@ class Mage_ImportExport_Model_Import extends Mage_ImportExport_Model_Abstract 'catalog_product' => array ( 'catalog_product_price', 'catalog_category_product', - 'catalogsearch_fulltext' + 'catalogsearch_fulltext', + 'catalog_product_flat', ) ); diff --git a/app/code/core/Mage/ImportExport/Model/Import/Entity/Abstract.php b/app/code/core/Mage/ImportExport/Model/Import/Entity/Abstract.php index 50b37d1cd5..3dbc74271b 100644 --- a/app/code/core/Mage/ImportExport/Model/Import/Entity/Abstract.php +++ b/app/code/core/Mage/ImportExport/Model/Import/Entity/Abstract.php @@ -560,8 +560,8 @@ public function isAttributeValid($attrCode, array $attrParams, array $rowData, $ break; case 'datetime': $val = trim($rowData[$attrCode]); - $valid = strtotime($val) - || preg_match('/^\d{2}.\d{2}.\d{2,4}(?:\s+\d{1,2}.\d{1,2}(?:.\d{1,2})?)?$/', $val); + $valid = strtotime($val) !== false + || preg_match('/^\d{2}.\d{2}.\d{2,4}(?:\s+\d{1,2}.\d{1,2}(?:.\d{1,2})?)?$/', $val); break; case 'text': $val = Mage::helper('core/string')->cleanString($rowData[$attrCode]); diff --git a/app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php b/app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php index bb9e3ecc17..70c9390cb6 100644 --- a/app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php +++ b/app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php @@ -68,27 +68,28 @@ class Mage_ImportExport_Model_Import_Entity_Product extends Mage_ImportExport_Mo /** * Error codes. */ - const ERROR_INVALID_SCOPE = 'invalidScope'; - const ERROR_INVALID_WEBSITE = 'invalidWebsite'; - const ERROR_INVALID_STORE = 'invalidStore'; - const ERROR_INVALID_ATTR_SET = 'invalidAttrSet'; - const ERROR_INVALID_TYPE = 'invalidType'; - const ERROR_INVALID_CATEGORY = 'invalidCategory'; - const ERROR_VALUE_IS_REQUIRED = 'isRequired'; - const ERROR_TYPE_CHANGED = 'typeChanged'; - const ERROR_SKU_IS_EMPTY = 'skuEmpty'; - const ERROR_NO_DEFAULT_ROW = 'noDefaultRow'; - const ERROR_CHANGE_TYPE = 'changeProductType'; - const ERROR_DUPLICATE_SCOPE = 'duplicateScope'; - const ERROR_DUPLICATE_SKU = 'duplicateSKU'; - const ERROR_CHANGE_ATTR_SET = 'changeAttrSet'; - const ERROR_TYPE_UNSUPPORTED = 'productTypeUnsupported'; - const ERROR_ROW_IS_ORPHAN = 'rowIsOrphan'; - const ERROR_INVALID_TIER_PRICE_QTY = 'invalidTierPriceOrQty'; - const ERROR_INVALID_TIER_PRICE_SITE = 'tierPriceWebsiteInvalid'; - const ERROR_INVALID_TIER_PRICE_GROUP = 'tierPriceGroupInvalid'; - const ERROR_TIER_DATA_INCOMPLETE = 'tierPriceDataIsIncomplete'; - const ERROR_SKU_NOT_FOUND_FOR_DELETE = 'skuNotFoundToDelete'; + const ERROR_INVALID_SCOPE = 'invalidScope'; + const ERROR_INVALID_WEBSITE = 'invalidWebsite'; + const ERROR_INVALID_STORE = 'invalidStore'; + const ERROR_INVALID_ATTR_SET = 'invalidAttrSet'; + const ERROR_INVALID_TYPE = 'invalidType'; + const ERROR_INVALID_CATEGORY = 'invalidCategory'; + const ERROR_VALUE_IS_REQUIRED = 'isRequired'; + const ERROR_TYPE_CHANGED = 'typeChanged'; + const ERROR_SKU_IS_EMPTY = 'skuEmpty'; + const ERROR_NO_DEFAULT_ROW = 'noDefaultRow'; + const ERROR_CHANGE_TYPE = 'changeProductType'; + const ERROR_DUPLICATE_SCOPE = 'duplicateScope'; + const ERROR_DUPLICATE_SKU = 'duplicateSKU'; + const ERROR_CHANGE_ATTR_SET = 'changeAttrSet'; + const ERROR_TYPE_UNSUPPORTED = 'productTypeUnsupported'; + const ERROR_ROW_IS_ORPHAN = 'rowIsOrphan'; + const ERROR_INVALID_TIER_PRICE_QTY = 'invalidTierPriceOrQty'; + const ERROR_INVALID_TIER_PRICE_SITE = 'tierPriceWebsiteInvalid'; + const ERROR_INVALID_TIER_PRICE_GROUP = 'tierPriceGroupInvalid'; + const ERROR_TIER_DATA_INCOMPLETE = 'tierPriceDataIsIncomplete'; + const ERROR_SKU_NOT_FOUND_FOR_DELETE = 'skuNotFoundToDelete'; + const ERROR_SUPER_PRODUCTS_SKU_NOT_FOUND = 'superProductsSkuNotFound'; /** * Pairs of attribute set ID-to-name. @@ -149,27 +150,28 @@ class Mage_ImportExport_Model_Import_Entity_Product extends Mage_ImportExport_Mo * @var array */ protected $_messageTemplates = array( - self::ERROR_INVALID_SCOPE => 'Invalid value in Scope column', - self::ERROR_INVALID_WEBSITE => 'Invalid value in Website column (website does not exists?)', - self::ERROR_INVALID_STORE => 'Invalid value in Store column (store does not exists?)', - self::ERROR_INVALID_ATTR_SET => 'Invalid value for Attribute Set column (set does not exists?)', - self::ERROR_INVALID_TYPE => 'Product Type is invalid or not supported', - self::ERROR_INVALID_CATEGORY => 'Category does not exists', - self::ERROR_VALUE_IS_REQUIRED => "Required attribute '%s' has an empty value", - self::ERROR_TYPE_CHANGED => 'Trying to change type of existing products', - self::ERROR_SKU_IS_EMPTY => 'SKU is empty', - self::ERROR_NO_DEFAULT_ROW => 'Default values row does not exists', - self::ERROR_CHANGE_TYPE => 'Product type change is not allowed', - self::ERROR_DUPLICATE_SCOPE => 'Duplicate scope', - self::ERROR_DUPLICATE_SKU => 'Duplicate SKU', - self::ERROR_CHANGE_ATTR_SET => 'Product attribute set change is not allowed', - self::ERROR_TYPE_UNSUPPORTED => 'Product type is not supported', - self::ERROR_ROW_IS_ORPHAN => 'Orphan rows that will be skipped due default row errors', - self::ERROR_INVALID_TIER_PRICE_QTY => 'Tier Price data price or quantity value is invalid', - self::ERROR_INVALID_TIER_PRICE_SITE => 'Tier Price data website is invalid', - self::ERROR_INVALID_TIER_PRICE_GROUP => 'Tier Price customer group ID is invalid', - self::ERROR_TIER_DATA_INCOMPLETE => 'Tier Price data is incomplete', - self::ERROR_SKU_NOT_FOUND_FOR_DELETE => 'Product with specified SKU not found' + self::ERROR_INVALID_SCOPE => 'Invalid value in Scope column', + self::ERROR_INVALID_WEBSITE => 'Invalid value in Website column (website does not exists?)', + self::ERROR_INVALID_STORE => 'Invalid value in Store column (store does not exists?)', + self::ERROR_INVALID_ATTR_SET => 'Invalid value for Attribute Set column (set does not exists?)', + self::ERROR_INVALID_TYPE => 'Product Type is invalid or not supported', + self::ERROR_INVALID_CATEGORY => 'Category does not exists', + self::ERROR_VALUE_IS_REQUIRED => "Required attribute '%s' has an empty value", + self::ERROR_TYPE_CHANGED => 'Trying to change type of existing products', + self::ERROR_SKU_IS_EMPTY => 'SKU is empty', + self::ERROR_NO_DEFAULT_ROW => 'Default values row does not exists', + self::ERROR_CHANGE_TYPE => 'Product type change is not allowed', + self::ERROR_DUPLICATE_SCOPE => 'Duplicate scope', + self::ERROR_DUPLICATE_SKU => 'Duplicate SKU', + self::ERROR_CHANGE_ATTR_SET => 'Product attribute set change is not allowed', + self::ERROR_TYPE_UNSUPPORTED => 'Product type is not supported', + self::ERROR_ROW_IS_ORPHAN => 'Orphan rows that will be skipped due default row errors', + self::ERROR_INVALID_TIER_PRICE_QTY => 'Tier Price data price or quantity value is invalid', + self::ERROR_INVALID_TIER_PRICE_SITE => 'Tier Price data website is invalid', + self::ERROR_INVALID_TIER_PRICE_GROUP => 'Tier Price customer group ID is invalid', + self::ERROR_TIER_DATA_INCOMPLETE => 'Tier Price data is incomplete', + self::ERROR_SKU_NOT_FOUND_FOR_DELETE => 'Product with specified SKU not found', + self::ERROR_SUPER_PRODUCTS_SKU_NOT_FOUND => 'Product with specified super products SKU not found' ); /** @@ -573,6 +575,26 @@ protected function _isTierPriceValid(array $rowData, $rowNum) return true; } + /** + * Check super products SKU + * + * @param array $rowData + * @param int $rowNum + * @return bool + */ + protected function _isSuperProductsSkuValid($rowData, $rowNum) + { + if (!empty($rowData['_super_products_sku']) + && (!isset($this->_oldSku[$rowData['_super_products_sku']]) + && !isset($this->_newSku[$rowData['_super_products_sku']]) + ) + ) { + $this->addRowError(self::ERROR_SUPER_PRODUCTS_SKU_NOT_FOUND, $rowNum); + return false; + } + return true; + } + /** * Custom options save. * @@ -1166,7 +1188,7 @@ protected function _saveProducts() $attrTable = $attribute->getBackend()->getTable(); $storeIds = array(0); - if ('datetime' == $attribute->getBackendType()) { + if ('datetime' == $attribute->getBackendType() && strtotime($attrValue)) { $attrValue = gmstrftime($strftimeFormat, strtotime($attrValue)); } elseif ($backModel) { $attribute->getBackend()->beforeSave($product); @@ -1613,6 +1635,7 @@ public function validateRow(array $rowData, $rowNum) $this->_isProductWebsiteValid($rowData, $rowNum); $this->_isProductCategoryValid($rowData, $rowNum); $this->_isTierPriceValid($rowData, $rowNum); + $this->_isSuperProductsSkuValid($rowData, $rowNum); if (self::SCOPE_DEFAULT == $rowScope) { // SKU is specified, row is SCOPE_DEFAULT, new product block begins $this->_processedEntitiesCount ++; diff --git a/app/code/core/Mage/ImportExport/Model/Import/Entity/Product/Type/Abstract.php b/app/code/core/Mage/ImportExport/Model/Import/Entity/Product/Type/Abstract.php index 872646d3ae..a18c1a580c 100644 --- a/app/code/core/Mage/ImportExport/Model/Import/Entity/Product/Type/Abstract.php +++ b/app/code/core/Mage/ImportExport/Model/Import/Entity/Product/Type/Abstract.php @@ -298,6 +298,8 @@ public function prepareAttributesForSave(array $rowData) ('select' == $attrParams['type'] || 'multiselect' == $attrParams['type']) ? $attrParams['options'][strtolower($rowData[$attrCode])] : $rowData[$attrCode]; + } elseif (array_key_exists($attrCode, $rowData)) { + $resultAttrs[$attrCode] = $rowData[$attrCode]; } elseif (null !== $attrParams['default_value']) { $resultAttrs[$attrCode] = $attrParams['default_value']; } diff --git a/app/code/core/Mage/Index/Block/Adminhtml/Notifications.php b/app/code/core/Mage/Index/Block/Adminhtml/Notifications.php index 12de6cd103..93a92e03fb 100644 --- a/app/code/core/Mage/Index/Block/Adminhtml/Notifications.php +++ b/app/code/core/Mage/Index/Block/Adminhtml/Notifications.php @@ -34,9 +34,12 @@ class Mage_Index_Block_Adminhtml_Notifications extends Mage_Adminhtml_Block_Temp public function getProcessesForReindex() { $res = array(); - $processes = Mage::getSingleton('index/indexer')->getProcessesCollection(); + $processes = Mage::getSingleton('index/indexer')->getProcessesCollection()->addEventsStats(); + /** @var $process Mage_Index_Model_Process */ foreach ($processes as $process) { - if ($process->getStatus() == Mage_Index_Model_Process::STATUS_REQUIRE_REINDEX) { + if (($process->getStatus() == Mage_Index_Model_Process::STATUS_REQUIRE_REINDEX + || $process->getEvents() > 0) && $process->getIndexer()->isVisible() + ) { $res[] = $process->getIndexer()->getName(); } } diff --git a/app/code/core/Mage/Index/Block/Adminhtml/Process/Grid.php b/app/code/core/Mage/Index/Block/Adminhtml/Process/Grid.php index 0ad486e601..e7aa55bf93 100644 --- a/app/code/core/Mage/Index/Block/Adminhtml/Process/Grid.php +++ b/app/code/core/Mage/Index/Block/Adminhtml/Process/Grid.php @@ -26,15 +26,27 @@ class Mage_Index_Block_Adminhtml_Process_Grid extends Mage_Adminhtml_Block_Widget_Grid { + /** + * Process model + * + * @var Mage_Index_Model_Process + */ protected $_processModel; + /** + * Mass-action block + * + * @var string + */ + protected $_massactionBlockName = 'index/adminhtml_process_grid_massaction'; + /** * Class constructor */ public function __construct() { parent::__construct(); - $this->_processModel = Mage::getModel('index/process'); + $this->_processModel = Mage::getSingleton('index/process'); $this->setId('indexer_processes_grid'); $this->_filterVisibility = false; $this->_pagerVisibility = false; @@ -55,9 +67,18 @@ protected function _prepareCollection() */ protected function _afterLoadCollection() { - foreach ($this->_collection as $item) { + /** @var $item Mage_Index_Model_Process */ + foreach ($this->_collection as $key => $item) { + if (!$item->getIndexer()->isVisible()) { + $this->_collection->removeItemByKey($key); + continue; + } $item->setName($item->getIndexer()->getName()); $item->setDescription($item->getIndexer()->getDescription()); + $item->setUpdateRequired($item->getUnprocessedEventsCollection()->count() > 0 ? 1 : 0); + if ($item->isLocked()) { + $item->setStatus(Mage_Index_Model_Process::STATUS_RUNNING); + } } return $this; } @@ -102,8 +123,19 @@ protected function _prepareColumns() 'frame_callback' => array($this, 'decorateStatus') )); + $this->addColumn('update_required', array( + 'header' => Mage::helper('index')->__('Update Required'), + 'sortable' => false, + 'width' => '120', + 'align' => 'left', + 'index' => 'update_required', + 'type' => 'options', + 'options' => $this->_processModel->getUpdateRequiredOptions(), + 'frame_callback' => array($this, 'decorateUpdateRequired') + )); + $this->addColumn('ended_at', array( - 'header' => Mage::helper('index')->__('Last Run'), + 'header' => Mage::helper('index')->__('Updated At'), 'type' => 'datetime', 'width' => '180', 'align' => 'left', @@ -123,11 +155,6 @@ protected function _prepareColumns() 'url' => array('base'=> '*/*/reindexProcess'), 'field' => 'process' ), -// array( -// 'caption' => Mage::helper('index')->__('Pending Events'), -// 'url' => array('base'=> '*/*/reindexEvents'), -// 'field' => 'process' -// ) ), 'filter' => false, 'sortable' => false, @@ -140,6 +167,10 @@ protected function _prepareColumns() /** * Decorate status column values * + * @param string $value + * @param Mage_Index_Model_Process $row + * @param Mage_Adminhtml_Block_Widget_Grid_Column $column + * @param bool $isExport * @return string */ public function decorateStatus($value, $row, $column, $isExport) @@ -159,6 +190,29 @@ public function decorateStatus($value, $row, $column, $isExport) return ''.$value.''; } + /** + * Decorate "Update Required" column values + * + * @param string $value + * @param Mage_Index_Model_Process $row + * @param Mage_Adminhtml_Block_Widget_Grid_Column $column + * @param bool $isExport + * @return string + */ + public function decorateUpdateRequired($value, $row, $column, $isExport) + { + $class = ''; + switch ($row->getUpdateRequired()) { + case 0: + $class = 'grid-severity-notice'; + break; + case 1: + $class = 'grid-severity-critical'; + break; + } + return ''.$value.''; + } + /** * Decorate last run date coumn * diff --git a/app/code/core/Mage/Index/Block/Adminhtml/Process/Grid/Massaction.php b/app/code/core/Mage/Index/Block/Adminhtml/Process/Grid/Massaction.php new file mode 100644 index 0000000000..6250266a19 --- /dev/null +++ b/app/code/core/Mage/Index/Block/Adminhtml/Process/Grid/Massaction.php @@ -0,0 +1,54 @@ + + */ +class Mage_Index_Block_Adminhtml_Process_Grid_Massaction extends Mage_Adminhtml_Block_Widget_Grid_Massaction_Abstract +{ + /** + * Get ids for only visible indexers + * + * @return string + */ + public function getGridIdsJson() + { + if (!$this->getUseSelectAll()) { + return ''; + } + + $ids = array(); + foreach ($this->getParentBlock()->getCollection() as $process) { + $ids[] = $process->getId(); + } + + return implode(',', $ids); + } +} diff --git a/app/code/core/Mage/Index/Model/Event.php b/app/code/core/Mage/Index/Model/Event.php index 3cb6452165..e6d4c3db1b 100644 --- a/app/code/core/Mage/Index/Model/Event.php +++ b/app/code/core/Mage/Index/Model/Event.php @@ -37,6 +37,7 @@ * @method Mage_Index_Model_Event setCreatedAt(string $value) * @method Mage_Index_Model_Event setOldData(string $value) * @method Mage_Index_Model_Event setNewData(string $value) + * @method Varien_Object getDataObject() * * @category Mage * @package Mage_Index @@ -116,14 +117,10 @@ public function setDataNamespace($namespace) public function resetData() { if ($this->_dataNamespace) { - $data = $this->getOldData(false); - $data[$this->_dataNamespace] = null; - $this->setOldData($data); $data = $this->getNewData(false); $data[$this->_dataNamespace] = null; $this->setNewData($data); } else { - $this->setOldData(array()); $this->setNewData(array()); } return $this; @@ -151,6 +148,37 @@ public function getProcessIds() return $this->_processIds; } + /** + * Merge new data + * + * @param array $previous + * @param mixed $current + * @return array + */ + protected function _mergeNewDataRecursive($previous, $current) + { + if (!is_array($current)) { + if (!is_null($current)) { + $previous[] = $current; + } + return $previous; + } + + foreach ($previous as $key => $value) { + if (array_key_exists($key, $current) && !is_null($current[$key]) && is_array($previous[$key])) { + if (!is_string($key) || is_array($current[$key])) { + $current[$key] = $this->_mergeNewDataRecursive($previous[$key], $current[$key]); + } + } elseif (!array_key_exists($key, $current) || is_null($current[$key])) { + $current[$key] = $previous[$key]; + } elseif (!is_array($previous[$key]) && !is_string($key)) { + $current[] = $previous[$key]; + } + } + + return $current; + } + /** * Merge previous event data to object. * Used for events duplicated protection @@ -164,40 +192,61 @@ public function mergePreviousData($data) $this->setId($data['event_id']); $this->setCreatedAt($data['created_at']); } - if (!empty($data['old_data'])) { - $this->setOldData($data['old_data']); - } + if (!empty($data['new_data'])) { $previousNewData = unserialize($data['new_data']); $currentNewData = $this->getNewData(false); - $currentNewData = array_merge($previousNewData, $currentNewData); + $currentNewData = $this->_mergeNewDataRecursive($previousNewData, $currentNewData); $this->setNewData(serialize($currentNewData)); } return $this; } + /** + * Clean new data, unset data for done processes + * + * @return Mage_Index_Model_Event + */ + public function cleanNewData() + { + $processIds = $this->getProcessIds(); + if (!is_array($processIds) || empty($processIds)) { + return $this; + } + + $newData = $this->getNewData(false); + foreach ($processIds as $processId => $processStatus) { + if ($processStatus == Mage_Index_Model_Process::EVENT_STATUS_DONE) { + $process = Mage::getSingleton('index/indexer')->getProcessById($processId); + if ($process) { + $namespace = get_class($process->getIndexer()); + if (array_key_exists($namespace, $newData)) { + unset($newData[$namespace]); + } + } + } + } + $this->setNewData(serialize($newData)); + + return $this; + } + /** * Get event old data array * + * @deprecated since 1.6.2.0 + * @param bool $useNamespace * @return array */ public function getOldData($useNamespace = true) { - $data = $this->_getData('old_data'); - if (is_string($data)) { - $data = unserialize($data); - } elseif (empty($data) || !is_array($data)) { - $data = array(); - } - if ($useNamespace && $this->_dataNamespace) { - return isset($data[$this->_dataNamespace]) ? $data[$this->_dataNamespace] : array(); - } - return $data; + return array(); } /** * Get event new data array * + * @param bool $useNamespace * @return array */ public function getNewData($useNamespace = true) @@ -217,26 +266,13 @@ public function getNewData($useNamespace = true) /** * Add new values to old data array (overwrite if value with same key exist) * + * @deprecated since 1.6.2.0 * @param array | string $data * @param null | mixed $value * @return Mage_Index_Model_Event */ public function addOldData($key, $value=null) { - $oldData = $this->getOldData(false); - if (!is_array($key)) { - $key = array($key => $value); - } - - if ($this->_dataNamespace) { - if (!isset($oldData[$this->_dataNamespace])) { - $oldData[$this->_dataNamespace] = array(); - } - $oldData[$this->_dataNamespace] = array_merge($oldData[$this->_dataNamespace], $key); - } else { - $oldData = array_merge($oldData, $key); - } - $this->setOldData($oldData); return $this; } @@ -294,9 +330,7 @@ public function getType() */ protected function _beforeSave() { - $oldData = $this->getOldData(false); $newData = $this->getNewData(false); - $this->setOldData(serialize($oldData)); $this->setNewData(serialize($newData)); if (!$this->hasCreatedAt()) { $this->setCreatedAt($this->_getResource()->formatDate(time(), true)); diff --git a/app/code/core/Mage/Index/Model/Indexer.php b/app/code/core/Mage/Index/Model/Indexer.php index 4ac94a0373..9c0c29d02c 100644 --- a/app/code/core/Mage/Index/Model/Indexer.php +++ b/app/code/core/Mage/Index/Model/Indexer.php @@ -39,6 +39,7 @@ class Mage_Index_Model_Indexer /** * Indexer processes lock flag * + * @deprecated after 1.6.1.0 * @var bool */ protected $_lockFlag = false; @@ -50,6 +51,14 @@ class Mage_Index_Model_Indexer */ protected $_allowTableChanges = true; + /** + * Current processing event(s) + * In array case it should be array(Entity type, Event type) + * + * @var null|Mage_Index_Model_Event|array + */ + protected $_currentEvent = null; + /** * Class constructor. Initialize index processes based on configuration */ @@ -102,6 +111,9 @@ public function getProcessByCode($code) /** * Lock indexer actions + * @deprecated after 1.6.1.0 + * + * @return Mage_Index_Model_Indexer */ public function lockIndexer() { @@ -111,6 +123,9 @@ public function lockIndexer() /** * Unlock indexer actions + * @deprecated after 1.6.1.0 + * + * @return Mage_Index_Model_Indexer */ public function unlockIndexer() { @@ -121,6 +136,7 @@ public function unlockIndexer() /** * Check if onject actions are locked * + * @deprecated after 1.6.1.0 * @return bool */ public function isLocked() @@ -138,11 +154,32 @@ public function isLocked() */ public function indexEvents($entity=null, $type=null) { - if ($this->isLocked()) { - return $this; + Mage::dispatchEvent('start_index_events' . $this->_getEventTypeName($entity, $type)); + + /** @var $resourceModel Mage_Index_Model_Resource_Process */ + $resourceModel = Mage::getResourceSingleton('index/process'); + + $allowTableChanges = $this->_allowTableChanges && !$resourceModel->isInTransaction(); + if ($allowTableChanges) { + $this->_currentEvent = array($entity, $type); + $this->_changeKeyStatus(false); } - $this->_runAll('indexEvents', array($entity, $type)); + $resourceModel->beginTransaction(); + $this->_allowTableChanges = false; + try { + $this->_runAll('indexEvents', array($entity, $type)); + $resourceModel->commit(); + } catch (Exception $e) { + $resourceModel->rollBack(); + throw $e; + } + if ($allowTableChanges) { + $this->_allowTableChanges = true; + $this->_changeKeyStatus(true); + $this->_currentEvent = null; + } + Mage::dispatchEvent('end_index_events' . $this->_getEventTypeName($entity, $type)); return $this; } @@ -154,11 +191,7 @@ public function indexEvents($entity=null, $type=null) */ public function indexEvent(Mage_Index_Model_Event $event) { - if ($this->isLocked()) { - return $this; - } - - $this->_runAll('processEvent', array($event)); + $this->_runAll('safeProcessEvent', array($event)); return $this; } @@ -169,10 +202,6 @@ public function indexEvent(Mage_Index_Model_Event $event) */ public function registerEvent(Mage_Index_Model_Event $event) { - if ($this->isLocked()) { - return $this; - } - $this->_runAll('register', array($event)); return $this; } @@ -188,9 +217,6 @@ public function registerEvent(Mage_Index_Model_Event $event) */ public function logEvent(Varien_Object $entity, $entityType, $eventType, $doSave=true) { - if ($this->isLocked()) { - return $this; - } $event = Mage::getModel('index/event') ->setEntity($entityType) ->setType($eventType) @@ -215,31 +241,43 @@ public function logEvent(Varien_Object $entity, $entityType, $eventType, $doSave */ public function processEntityAction(Varien_Object $entity, $entityType, $eventType) { - if ($this->isLocked()) { - return $this; - } $event = $this->logEvent($entity, $entityType, $eventType, false); /** * Index and save event just in case if some process matched it */ if ($event->getProcessIds()) { - $this->_changeKeyStatus(false); - /** @var $resourceModel Mage_Index_Model_Resource_Abstract */ - $resourceModel = Mage::getResourceModel('index/process'); + Mage::dispatchEvent('start_process_event' . $this->_getEventTypeName($entityType, $eventType)); + + /** @var $resourceModel Mage_Index_Model_Resource_Process */ + $resourceModel = Mage::getResourceSingleton('index/process'); + + $allowTableChanges = $this->_allowTableChanges && !$resourceModel->isInTransaction(); + if ($allowTableChanges) { + $this->_currentEvent = $event; + $this->_changeKeyStatus(false); + } + $resourceModel->beginTransaction(); $this->_allowTableChanges = false; try { $this->indexEvent($event); $resourceModel->commit(); - $this->_allowTableChanges = true; - $this->_changeKeyStatus(); } catch (Exception $e) { $resourceModel->rollBack(); - $this->_allowTableChanges = true; - $this->_changeKeyStatus(); + if ($allowTableChanges) { + $this->_allowTableChanges = true; + $this->_changeKeyStatus(true); + $this->_currentEvent = null; + } throw $e; } + if ($allowTableChanges) { + $this->_allowTableChanges = true; + $this->_changeKeyStatus(true); + $this->_currentEvent = null; + } $event->save(); + Mage::dispatchEvent('end_process_event' . $this->_getEventTypeName($entityType, $eventType)); } return $this; } @@ -255,44 +293,44 @@ public function processEntityAction(Varien_Object $entity, $entityType, $eventTy */ protected function _runAll($method, $args) { + $checkLocks = $method != 'register'; $processed = array(); foreach ($this->_processesCollection as $process) { $code = $process->getIndexerCode(); if (in_array($code, $processed)) { continue; } + $hasLocks = false; - if (!$this->_allowTableChanges && is_callable(array($process, 'setAllowTableChanges'))) { - $process->setAllowTableChanges(false); - } if ($process->getDepends()) { foreach ($process->getDepends() as $processCode) { $dependProcess = $this->getProcessByCode($processCode); if ($dependProcess && !in_array($processCode, $processed)) { - if (!$this->_allowTableChanges && is_callable(array($dependProcess, 'setAllowTableChanges'))) { - $dependProcess->setAllowTableChanges(false); - } - call_user_func_array(array($dependProcess, $method), $args); - if (!$this->_allowTableChanges && is_callable(array($dependProcess, 'setAllowTableChanges'))) { - $dependProcess->setAllowTableChanges(true); + if ($checkLocks && $dependProcess->isLocked()) { + $hasLocks = true; + } else { + call_user_func_array(array($dependProcess, $method), $args); + if ($checkLocks && $dependProcess->getMode() == Mage_Index_Model_Process::MODE_MANUAL) { + $hasLocks = true; + } else { + $processed[] = $processCode; + } } - $processed[] = $processCode; } } } - call_user_func_array(array($process, $method), $args); - if (!$this->_allowTableChanges && is_callable(array($process, 'setAllowTableChanges'))) { - $process->setAllowTableChanges(true); + if (!$hasLocks) { + call_user_func_array(array($process, $method), $args); + $processed[] = $code; } - - $processed[] = $code; } } /** * Enable/Disable keys in index tables * + * @param bool $enable * @return Mage_Index_Model_Indexer */ protected function _changeKeyStatus($enable = true) @@ -308,28 +346,62 @@ protected function _changeKeyStatus($enable = true) foreach ($process->getDepends() as $processCode) { $dependProcess = $this->getProcessByCode($processCode); if ($dependProcess && !in_array($processCode, $processed)) { - if ($dependProcess instanceof Mage_Index_Model_Process) { - if ($enable) { - $dependProcess->enableIndexerKeys(); - } else { - $dependProcess->disableIndexerKeys(); - } + if ($this->_changeProcessKeyStatus($dependProcess, $enable)) { $processed[] = $processCode; } } } } - if ($process instanceof Mage_Index_Model_Process) { - if ($enable) { - $process->enableIndexerKeys(); - } else { - $process->disableIndexerKeys(); - } + if ($this->_changeProcessKeyStatus($process, $enable)) { $processed[] = $code; } } return $this; } + + /** + * Check if the event will be processed and disable/enable keys in index tables + * + * @param mixed|Mage_Index_Model_Process $process + * @param bool $enable + * @return bool + */ + protected function _changeProcessKeyStatus($process, $enable = true) + { + $event = $this->_currentEvent; + if ($process instanceof Mage_Index_Model_Process + && $process->getMode() !== Mage_Index_Model_Process::MODE_MANUAL + && !$process->isLocked() + && (is_null($event) + || ($event instanceof Mage_Index_Model_Event && $process->matchEvent($event)) + || (is_array($event) && $process->matchEntityAndType($event[0], $event[1])) + )) { + if ($enable) { + $process->enableIndexerKeys(); + } else { + $process->disableIndexerKeys(); + } + return true; + } + return false; + } + + /** + * Get event type name + * + * @param null|string $entityType + * @param null|string $eventType + * @return string + */ + protected function _getEventTypeName($entityType = null, $eventType = null) + { + $eventName = $entityType . '_' . $eventType; + $eventName = trim($eventName, '_'); + if (!empty($eventName)) { + $eventName = '_' . $eventName; + } + return $eventName; + } } diff --git a/app/code/core/Mage/Index/Model/Indexer/Abstract.php b/app/code/core/Mage/Index/Model/Indexer/Abstract.php index f17c98cf20..c633427359 100644 --- a/app/code/core/Mage/Index/Model/Indexer/Abstract.php +++ b/app/code/core/Mage/Index/Model/Indexer/Abstract.php @@ -35,10 +35,18 @@ abstract class Mage_Index_Model_Indexer_Abstract extends Mage_Core_Model_Abstrac /** * Whether table changes are allowed * + * @deprecated after 1.6.1.0 * @var bool */ protected $_allowTableChanges = true; + /** + * Whether the indexer should be displayed on process/list page + * + * @var bool + */ + protected $_isVisible = true; + /** * Get Indexer name * @@ -51,7 +59,10 @@ abstract public function getName(); * * @return string */ - abstract public function getDescription(); + public function getDescription() + { + return ''; + } /** * Register indexer required data inside event object @@ -149,13 +160,7 @@ public function callEventHandler(Mage_Index_Model_Event $event) $resourceModel = $this->_getResource(); if (method_exists($resourceModel, $method)) { - if (!$this->_allowTableChanges && is_callable(array($resourceModel, 'setAllowTableChanges'))) { - $resourceModel->setAllowTableChanges(false); - } $resourceModel->$method($event); - if (!$this->_allowTableChanges && is_callable(array($resourceModel, 'setAllowTableChanges'))) { - $resourceModel->setAllowTableChanges(true); - } } return $this; } @@ -163,6 +168,7 @@ public function callEventHandler(Mage_Index_Model_Event $event) /** * Set whether table changes are allowed * + * @deprecated after 1.6.1.0 * @param bool $value * @return Mage_Index_Model_Indexer_Abstract */ @@ -211,4 +217,14 @@ public function enableKeys() return $this; } + + /** + * Whether the indexer should be displayed on process/list page + * + * @return bool + */ + public function isVisible() + { + return $this->_isVisible; + } } diff --git a/app/code/core/Mage/Index/Model/Observer.php b/app/code/core/Mage/Index/Model/Observer.php index 2f0e0bd806..498bca0cf1 100644 --- a/app/code/core/Mage/Index/Model/Observer.php +++ b/app/code/core/Mage/Index/Model/Observer.php @@ -35,7 +35,7 @@ class Mage_Index_Model_Observer public function __construct() { - $this->_indexer = Mage::getModel('index/indexer'); + $this->_indexer = Mage::getSingleton('index/indexer'); } /** diff --git a/app/code/core/Mage/Index/Model/Process.php b/app/code/core/Mage/Index/Model/Process.php index b2e355b277..b8c29699eb 100644 --- a/app/code/core/Mage/Index/Model/Process.php +++ b/app/code/core/Mage/Index/Model/Process.php @@ -85,6 +85,7 @@ class Mage_Index_Model_Process extends Mage_Core_Model_Abstract /** * Whether table changes are allowed * + * @deprecated after 1.6.1.0 * @var bool */ protected $_allowTableChanges = true; @@ -135,6 +136,9 @@ public function register(Mage_Index_Model_Event $event) $this->getIndexer()->register($event); $event->addProcessId($this->getId()); $this->_resetEventNamespace($event); + if ($this->getMode() == self::MODE_MANUAL) { + $this->_getResource()->updateStatus($this, self::STATUS_REQUIRE_REINDEX); + } } return $this; @@ -151,21 +155,71 @@ public function matchEvent(Mage_Index_Model_Event $event) return $this->getIndexer()->matchEvent($event); } + /** + * Check if specific entity and action type is matched + * + * @param string $entity + * @param string $type + * @return bool + */ + public function matchEntityAndType($entity, $type) + { + if ($entity !== null && $type !== null) { + return $this->getIndexer()->matchEntityAndType($entity, $type); + } + return true; + } + /** * Reindex all data what this process responsible is * - * @return unknown_type */ public function reindexAll() { if ($this->isLocked()) { Mage::throwException(Mage::helper('index')->__('%s Index process is working now. Please try run this process later.', $this->getIndexer()->getName())); } + + $processStatus = $this->getStatus(); + $this->_getResource()->startProcess($this); $this->lock(); - $this->getIndexer()->reindexAll(); - $this->unlock(); - $this->_getResource()->endProcess($this); + try { + $eventsCollection = $this->getUnprocessedEventsCollection(); + + /** @var $eventResource Mage_Index_Model_Resource_Event */ + $eventResource = Mage::getResourceSingleton('index/event'); + + if ($eventsCollection->count() > 0 && $processStatus == self::STATUS_PENDING + || $this->getForcePartialReindex() + ) { + $this->_getResource()->beginTransaction(); + try { + $this->_processEventsCollection($eventsCollection, false); + $this->_getResource()->commit(); + } catch (Exception $e) { + $this->_getResource()->rollBack(); + throw $e; + } + } else { + //Update existing events since we'll do reindexAll + $eventResource->updateProcessEvents($this); + $this->getIndexer()->reindexAll(); + } + $this->unlock(); + + $unprocessedEvents = $eventResource->getUnprocessedEvents($this); + if ($this->getMode() == self::MODE_MANUAL && (count($unprocessedEvents) > 0)) { + $this->_getResource()->updateStatus($this, self::STATUS_REQUIRE_REINDEX); + } else { + $this->_getResource()->endProcess($this); + } + } catch (Exception $e) { + $this->unlock(); + $this->_getResource()->failProcess($this); + throw $e; + } + Mage::dispatchEvent('after_reindex_process_' . $this->getIndexerCode()); } /** @@ -180,6 +234,11 @@ public function reindexEverything() return $this; } + /** @var $eventResource Mage_Index_Model_Resource_Event */ + $eventResource = Mage::getResourceSingleton('index/event'); + $unprocessedEvents = $eventResource->getUnprocessedEvents($this); + $this->setForcePartialReindex(count($unprocessedEvents) > 0 && $this->getStatus() == self::STATUS_PENDING); + if ($this->getDepends()) { $indexer = Mage::getSingleton('index/indexer'); foreach ($this->getDepends() as $code) { @@ -202,27 +261,28 @@ public function reindexEverything() */ public function processEvent(Mage_Index_Model_Event $event) { - if ($this->getMode() == self::MODE_MANUAL) { - $this->changeStatus(self::STATUS_REQUIRE_REINDEX); + if (!$this->matchEvent($event)) { return $this; } - if (!$this->getIndexer()->matchEvent($event)) { + if ($this->getMode() == self::MODE_MANUAL) { + $this->changeStatus(self::STATUS_REQUIRE_REINDEX); return $this; } + + $this->_getResource()->updateProcessStartDate($this); $this->_setEventNamespace($event); + $isError = false; - $indexer = $this->getIndexer(); - if (!$this->_allowTableChanges && is_callable(array($indexer, 'setAllowTableChanges'))) { - $indexer->setAllowTableChanges(false); - } - $this->getIndexer()->processEvent($event); - if (!$this->_allowTableChanges && is_callable(array($indexer, 'setAllowTableChanges'))) { - $indexer->setAllowTableChanges(true); + try { + $this->getIndexer()->processEvent($event); + } catch (Exception $e) { + $isError = true; } - $event->resetData(); $this->_resetEventNamespace($event); - $event->addProcessId($this->getId(), self::EVENT_STATUS_DONE); + $this->_getResource()->updateProcessEndDate($this); + $event->addProcessId($this->getId(), $isError ? self::EVENT_STATUS_ERROR : self::EVENT_STATUS_DONE); + return $this; } @@ -278,36 +338,56 @@ public function indexEvents($entity=null, $type=null) if ($this->isLocked()) { return $this; } + $this->lock(); + try { + /** + * Prepare events collection + */ + $eventsCollection = $this->getUnprocessedEventsCollection(); + if ($entity !== null) { + $eventsCollection->addEntityFilter($entity); + } + if ($type !== null) { + $eventsCollection->addTypeFilter($type); + } - /** - * Prepare events collection - */ - $eventsCollection = Mage::getResourceModel('index/event_collection') - ->addProcessFilter($this, self::EVENT_STATUS_NEW); - if ($entity !== null) { - $eventsCollection->addEntityFilter($entity); - } - if ($type !== null) { - $eventsCollection->addTypeFilter($type); + $this->_processEventsCollection($eventsCollection); + $this->unlock(); + } catch (Exception $e) { + $this->unlock(); + throw $e; } + return $this; + } - /** - * Process all new events - */ - while ($eventsCollection->getSize()) { - foreach ($eventsCollection as $event) { - try { - $this->processEvent($event); - } catch (Exception $e) { - $event->addProcessId($this->getId(), self::EVENT_STATUS_ERROR); + /** + * Process all events of the collection + * + * @param Mage_Index_Model_Resource_Event_Collection $eventsCollection + * @param bool $skipUnmatched + * @return Mage_Index_Model_Process + */ + protected function _processEventsCollection( + Mage_Index_Model_Resource_Event_Collection $eventsCollection, + $skipUnmatched = true + ) { + // We can't reload the collection because of transaction + /** @var $event Mage_Index_Model_Event */ + while ($event = $eventsCollection->fetchItem()) { + try { + $this->processEvent($event); + if (!$skipUnmatched) { + $eventProcessIds = $event->getProcessIds(); + if (!isset($eventProcessIds[$this->getId()])) { + $event->addProcessId($this->getId(), null); + } } - $event->save(); + } catch (Exception $e) { + $event->addProcessId($this->getId(), self::EVENT_STATUS_ERROR); } - $eventsCollection->reset(); + $event->save(); } - - $this->unlock(); return $this; } @@ -451,6 +531,19 @@ public function getStatusesOptions() ); } + /** + * Get list of "Update Required" options + * + * @return array + */ + public function getUpdateRequiredOptions() + { + return array( + 0 => Mage::helper('index')->__('No'), + 1 => Mage::helper('index')->__('Yes'), + ); + } + /** * Retrieve depend indexer codes * @@ -479,6 +572,7 @@ public function getDepends() /** * Set whether table changes are allowed * + * @deprecated after 1.6.1.0 * @param bool $value * @return Mage_Index_Model_Process */ @@ -515,4 +609,42 @@ public function enableIndexerKeys() } return $this; } + + /** + * Process event with locks checking + * + * @param Mage_Index_Model_Event $event + * @return Mage_Index_Model_Process + */ + public function safeProcessEvent(Mage_Index_Model_Event $event) + { + if ($this->isLocked()) { + return $this; + } + if (!$this->matchEvent($event)) { + return $this; + } + $this->lock(); + try { + $this->processEvent($event); + $this->unlock(); + } catch (Exception $e) { + $this->unlock(); + throw $e; + } + return $this; + } + + /** + * Get unprocessed events collection + * + * @return Mage_Index_Model_Resource_Event_Collection + */ + public function getUnprocessedEventsCollection() + { + /** @var $eventsCollection Mage_Index_Model_Resource_Event_Collection */ + $eventsCollection = Mage::getResourceModel('index/event_collection'); + $eventsCollection->addProcessFilter($this, self::EVENT_STATUS_NEW); + return $eventsCollection; + } } diff --git a/app/code/core/Mage/Index/Model/Resource/Abstract.php b/app/code/core/Mage/Index/Model/Resource/Abstract.php index 0484f929fe..adf051f6f5 100755 --- a/app/code/core/Mage/Index/Model/Resource/Abstract.php +++ b/app/code/core/Mage/Index/Model/Resource/Abstract.php @@ -53,6 +53,7 @@ abstract class Mage_Index_Model_Resource_Abstract extends Mage_Core_Model_Resour /** * Whether table changes are allowed * + * @deprecated after 1.6.1.0 * @var bool */ protected $_allowTableChanges = true; @@ -104,12 +105,17 @@ public function getIdxTable($table = null) public function syncData() { $this->beginTransaction(); - /** - * Can't use truncate because of transaction - */ - $this->_getWriteAdapter()->delete($this->getMainTable()); - $this->insertFromTable($this->getIdxTable(), $this->getMainTable(), false); - $this->commit(); + try { + /** + * Can't use truncate because of transaction + */ + $this->_getWriteAdapter()->delete($this->getMainTable()); + $this->insertFromTable($this->getIdxTable(), $this->getMainTable(), false); + $this->commit(); + } catch (Exception $e) { + $this->rollBack(); + throw $e; + } return $this; } @@ -168,9 +174,6 @@ public function insertFromSelect($select, $destTable, array $columns, $readToInd $to = $this->_getWriteAdapter(); } - if ($this->useDisableKeys() && $this->_allowTableChanges) { - $to->disableTableKeys($destTable); - } if ($from === $to) { $query = $select->insertFromSelect($destTable, $columns); $to->query($query); @@ -191,9 +194,7 @@ public function insertFromSelect($select, $destTable, array $columns, $readToInd $to->insertArray($destTable, $columns, $data); } } - if ($this->useDisableKeys() && $this->_allowTableChanges) { - $to->enableTableKeys($destTable); - } + return $this; } @@ -237,6 +238,7 @@ public function clearTemporaryIndexTable() /** * Set whether table changes are allowed * + * @deprecated after 1.6.1.0 * @param bool $value * @return Mage_Index_Model_Resource_Abstract */ diff --git a/app/code/core/Mage/Index/Model/Resource/Event.php b/app/code/core/Mage/Index/Model/Resource/Event.php index 32aa54804e..b411fce1c1 100755 --- a/app/code/core/Mage/Index/Model/Resource/Event.php +++ b/app/code/core/Mage/Index/Model/Resource/Event.php @@ -67,6 +67,7 @@ protected function _beforeSave(Mage_Core_Model_Abstract $object) $object->mergePreviousData($data); } } + $object->cleanNewData(); return parent::_beforeSave($object); } @@ -85,10 +86,17 @@ protected function _afterSave(Mage_Core_Model_Abstract $object) $this->_getWriteAdapter()->delete($processTable); } else { foreach ($processIds as $processId => $processStatus) { + if (is_null($processStatus) || $processStatus == Mage_Index_Model_Process::EVENT_STATUS_DONE) { + $this->_getWriteAdapter()->delete($processTable, array( + 'process_id = ?' => $processId, + 'event_id = ?' => $object->getId(), + )); + continue; + } $data = array( - 'process_id'=> $processId, - 'event_id' => $object->getId(), - 'status' => $processStatus + 'process_id' => $processId, + 'event_id' => $object->getId(), + 'status' => $processStatus ); $this->_getWriteAdapter()->insertOnDuplicate($processTable, $data, array('status')); } @@ -96,4 +104,45 @@ protected function _afterSave(Mage_Core_Model_Abstract $object) } return parent::_afterSave($object); } + + /** + * Update status for events of process + * + * @param int|array|Mage_Index_Model_Process $process + * @param string $status + * @return Mage_Index_Model_Resource_Event + */ + public function updateProcessEvents($process, $status = Mage_Index_Model_Process::EVENT_STATUS_DONE) + { + $whereCondition = ''; + if ($process instanceof Mage_Index_Model_Process) { + $whereCondition = array('process_id = ?' => $process->getId()); + } elseif (is_array($process) && !empty($process)) { + $whereCondition = array('process_id IN (?)' => $process); + } elseif (!is_array($whereCondition)) { + $whereCondition = array('process_id = ?' => $process); + } + $this->_getWriteAdapter()->update( + $this->getTable('index/process_event'), + array('status' => $status), + $whereCondition + ); + return $this; + } + + /** + * Retrieve unprocessed events list by specified process + * + * @param Mage_Index_Model_Process $process + * @return array + */ + public function getUnprocessedEvents($process) + { + $select = $this->_getReadAdapter()->select() + ->from($this->getTable('index/process_event')) + ->where('process_id = ?', $process->getId()) + ->where('status = ?', Mage_Index_Model_Process::EVENT_STATUS_NEW); + + return $this->_getReadAdapter()->fetchAll($select); + } } diff --git a/app/code/core/Mage/Index/Model/Resource/Event/Collection.php b/app/code/core/Mage/Index/Model/Resource/Event/Collection.php index 3e998a2441..1e1eb4c9f4 100755 --- a/app/code/core/Mage/Index/Model/Resource/Event/Collection.php +++ b/app/code/core/Mage/Index/Model/Resource/Event/Collection.php @@ -88,13 +88,17 @@ public function addProcessFilter($process, $status = null) if ($process instanceof Mage_Index_Model_Process) { $this->addFieldToFilter('process_event.process_id', $process->getId()); } elseif (is_array($process) && !empty($process)) { - $this->addFieldToFilter('process_event.process_id', array('in'=>$process)); + $this->addFieldToFilter('process_event.process_id', array('in' => $process)); } else { $this->addFieldToFilter('process_event.process_id', $process); } if ($status !== null) { - $this->addFieldToFilter('process_event.status', $status); + if (is_array($status) && !empty($status)) { + $this->addFieldToFilter('process_event.status', array('in' => $status)); + } else { + $this->addFieldToFilter('process_event.status', $status); + } } return $this; } @@ -126,6 +130,7 @@ public function reset() $this->_totalRecords = null; $this->_data = null; $this->_isCollectionLoaded = false; + $this->_items = array(); return $this; } } diff --git a/app/code/core/Mage/Index/Model/Resource/Process.php b/app/code/core/Mage/Index/Model/Resource/Process.php index 1b7554d566..ec35a2d653 100755 --- a/app/code/core/Mage/Index/Model/Resource/Process.php +++ b/app/code/core/Mage/Index/Model/Resource/Process.php @@ -94,6 +94,22 @@ public function startProcess(Mage_Index_Model_Process $process) return $this; } + /** + * Register process fail + * + * @param Mage_Index_Model_Process $process + * @return Mage_Index_Model_Resource_Process + */ + public function failProcess(Mage_Index_Model_Process $process) + { + $data = array( + 'status' => Mage_Index_Model_Process::STATUS_REQUIRE_REINDEX, + 'ended_at' => $this->formatDate(time()), + ); + $this->_updateProcessData($process->getId(), $data); + return $this; + } + /** * Update process status field * @@ -115,11 +131,45 @@ public function updateStatus($process, $status) * @param array $data * @return Mage_Index_Model_Resource_Process */ - protected function _updateProcessData($processId,$data) + protected function _updateProcessData($processId, $data) { $bind = array('process_id=?' => $processId); $this->_getWriteAdapter()->update($this->getMainTable(), $data, $bind); return $this; } + + /** + * Update process start date + * + * @param Mage_Index_Model_Process $process + * @return Mage_Index_Model_Resource_Process + */ + public function updateProcessStartDate(Mage_Index_Model_Process $process) + { + $this->_updateProcessData($process->getId(), array('started_at' => $this->formatDate(time()))); + return $this; + } + + /** + * Update process end date + * + * @param Mage_Index_Model_Process $process + * @return Mage_Index_Model_Resource_Process + */ + public function updateProcessEndDate(Mage_Index_Model_Process $process) + { + $this->_updateProcessData($process->getId(), array('ended_at' => $this->formatDate(time()))); + return $this; + } + + /** + * Whether transaction is already started + * + * @return bool + */ + public function isInTransaction() + { + return $this->_getWriteAdapter()->getTransactionLevel() > 0; + } } diff --git a/app/code/core/Mage/Index/Model/Resource/Process/Collection.php b/app/code/core/Mage/Index/Model/Resource/Process/Collection.php index 3f3390daef..9b0b1e908c 100755 --- a/app/code/core/Mage/Index/Model/Resource/Process/Collection.php +++ b/app/code/core/Mage/Index/Model/Resource/Process/Collection.php @@ -42,4 +42,27 @@ protected function _construct() { $this->_init('index/process'); } + + /** + * Add count of unprocessed events to process collection + * + * @return Mage_Index_Model_Resource_Process_Collection + */ + public function addEventsStats() + { + $countsSelect = $this->getConnection() + ->select() + ->from($this->getTable('index/process_event'), array('process_id', 'events' => 'COUNT(*)')) + ->where('status=?', Mage_Index_Model_Process::EVENT_STATUS_NEW) + ->group('process_id'); + $this->getSelect() + ->joinLeft( + array('e' => $countsSelect), + 'e.process_id=main_table.process_id', + array('events' => $this->getConnection()->getCheckSql( + $this->getConnection()->prepareSqlCondition('e.events', array('null' => null)), 0, 'e.events' + )) + ); + return $this; + } } diff --git a/app/code/core/Mage/Install/Model/Installer/Db.php b/app/code/core/Mage/Install/Model/Installer/Db.php index 992d9dc1f3..43c5b31d22 100644 --- a/app/code/core/Mage/Install/Model/Installer/Db.php +++ b/app/code/core/Mage/Install/Model/Installer/Db.php @@ -67,8 +67,8 @@ public function checkDbConnectionData($data) } } if (!empty($absenteeExtensions)) { - Mage::throwException(Mage::helper('install')->__('PHP Extensions "%s" must be loaded.', - implode(',', $absenteeExtensions)) + Mage::throwException( + Mage::helper('install')->__('PHP Extensions "%s" must be loaded.', implode(',', $absenteeExtensions)) ); } @@ -78,14 +78,16 @@ public function checkDbConnectionData($data) // check DB server version if (version_compare($version, $requiredVersion) == -1) { - Mage::throwException(Mage::helper('install')->__('The database server version ' - . 'does not match system requirements (required: %s, actual: %s).', $requiredVersion, $version)); + Mage::throwException( + Mage::helper('install')->__('The database server version doesn\'t match system requirements (required: %s, actual: %s).', $requiredVersion, $version) + ); } // check InnoDB support if (!$resource->supportEngine()) { - Mage::throwException(Mage::helper('install')->__('Database server does not support ' - . 'the InnoDB storage engine.')); + Mage::throwException( + Mage::helper('install')->__('Database server does not support the InnoDB storage engine.') + ); } // TODO: check user roles @@ -121,8 +123,8 @@ protected function _getCheckedData($data) if ($data['db_prefix'] != '') { if (!preg_match('/^[a-z]+[a-z0-9_]*$/', $data['db_prefix'])) { Mage::throwException( - Mage::helper('install')->__('The table prefix should contain only letters (a-z), ' - . 'numbers (0-9) or underscores (_), the first character should be a letter.')); + Mage::helper('install')->__('The table prefix should contain only letters (a-z), numbers (0-9) or underscores (_), the first character should be a letter.') + ); } } //set default db model @@ -158,7 +160,9 @@ protected function _getDbResource($model) if (!isset($this->_dbResource)) { $resource = Mage::getSingleton(sprintf('install/installer_db_%s', $model)); if (!$resource) { - Mage::throwException(Mage::helper('install')->__(sprintf('Installer does not exist for %s database type', $model))); + Mage::throwException( + Mage::helper('install')->__('Installer does not exist for %s database type', $model) + ); } $this->_dbResource = $resource; } diff --git a/app/code/core/Mage/Log/Model/Resource/Visitor.php b/app/code/core/Mage/Log/Model/Resource/Visitor.php index a015174447..aea1cac85f 100755 --- a/app/code/core/Mage/Log/Model/Resource/Visitor.php +++ b/app/code/core/Mage/Log/Model/Resource/Visitor.php @@ -119,6 +119,26 @@ protected function _afterSave(Mage_Core_Model_Abstract $visitor) return $this; } + /** + * Perform actions after object load + * + * @param Varien_Object $object + * @return Mage_Core_Model_Resource_Db_Abstract + */ + protected function _afterLoad(Mage_Core_Model_Abstract $object) + { + parent::_afterLoad($object); + // Add information about quote to visitor + $adapter = $this->_getReadAdapter(); + $select = $adapter->select()->from($this->getTable('log/quote_table'), 'quote_id') + ->where('visitor_id = ?', $object->getId())->limit(1); + $result = $adapter->query($select)->fetch(); + if (isset($result['quote_id'])) { + $object->setQuoteId((int) $result['quote_id']); + } + return $this; + } + /** * Saving visitor information * diff --git a/app/code/core/Mage/Log/sql/log_setup/install-1.6.0.0.php b/app/code/core/Mage/Log/sql/log_setup/install-1.6.0.0.php index 83a4e88c64..ab67fc4530 100644 --- a/app/code/core/Mage/Log/sql/log_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Log/sql/log_setup/install-1.6.0.0.php @@ -127,8 +127,8 @@ 'primary' => true, ), 'Type ID') ->addColumn('type_code', Varien_Db_Ddl_Table::TYPE_TEXT, 64, array( - 'nullable' => false, - 'default' => '', + 'nullable' => true, + 'default' => null, ), 'Type Code') ->addColumn('period', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array( 'unsigned' => true, @@ -176,8 +176,8 @@ 'primary' => true, ), 'URL ID') ->addColumn('url', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array( - 'nullable' => false, - 'default' => '', + 'nullable' => true, + 'default' => null, ), 'URL') ->addColumn('referer', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array( ), 'Referrer') @@ -196,8 +196,8 @@ 'primary' => true, ), 'Visitor ID') ->addColumn('session_id', Varien_Db_Ddl_Table::TYPE_TEXT, 64, array( - 'nullable' => false, - 'default' => '', + 'nullable' => true, + 'default' => null, ), 'Session ID') ->addColumn('first_visit_at', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null, array( ), 'First Visit Time') diff --git a/app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php index 3d7fc81487..9b91186bf2 100644 --- a/app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ b/app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php @@ -218,8 +218,8 @@ 'url' => array( 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, 'length' => 255, - 'nullable' => false, - 'default' => '', + 'nullable' => true, + 'default' => null, 'comment' => 'URL' ), 'referer' => array( diff --git a/app/code/core/Mage/Newsletter/Model/Resource/Problem/Collection.php b/app/code/core/Mage/Newsletter/Model/Resource/Problem/Collection.php index faae66c0f3..9fc65ac49e 100755 --- a/app/code/core/Mage/Newsletter/Model/Resource/Problem/Collection.php +++ b/app/code/core/Mage/Newsletter/Model/Resource/Problem/Collection.php @@ -68,6 +68,7 @@ public function addSubscriberInfo() 'main_table.subscriber_id = subscriber.subscriber_id', array('subscriber_email','customer_id','subscriber_status') ); + $this->addFilterToMap('subscriber_id', 'main_table.subscriber_id'); $this->_subscribersInfoJoinedFlag = true; return $this; diff --git a/app/code/core/Mage/Newsletter/Model/Resource/Queue/Collection.php b/app/code/core/Mage/Newsletter/Model/Resource/Queue/Collection.php index 811710ce52..b16383edb6 100755 --- a/app/code/core/Mage/Newsletter/Model/Resource/Queue/Collection.php +++ b/app/code/core/Mage/Newsletter/Model/Resource/Queue/Collection.php @@ -82,24 +82,21 @@ public function addTemplateInfo() */ protected function _addSubscriberInfoToSelect() { - if (!$this->_addSubscribersFlag) { - $this->_addSubscribersFlag = true; - //Possibel solution with join select - $select = $this->getConnection()->select() - ->from(array('qlt' => $this->getTable('newsletter/queue_link')), 'COUNT(qlt.queue_link_id)') - ->where('qlt.queue_id = main_table.queue_id'); - $totalExpr = new Zend_Db_Expr(sprintf('(%s)', $select->assemble())); - $select = $this->getConnection()->select() - ->from(array('qls' => $this->getTable('newsletter/queue_link')), 'COUNT(qls.queue_link_id)') - ->where('qls.queue_id = main_table.queue_id') - ->where('qls.letter_sent_at IS NOT NULL'); - $sentExpr = new Zend_Db_Expr(sprintf('(%s)', $select->assemble())); - - $this->getSelect()->columns(array( - 'subscribers_sent' => $sentExpr, - 'subscribers_total' => $totalExpr - )); - } + /** @var $select Varien_Db_Select */ + $select = $this->getConnection()->select() + ->from(array('qlt' => $this->getTable('newsletter/queue_link')), 'COUNT(qlt.queue_link_id)') + ->where('qlt.queue_id = main_table.queue_id'); + $totalExpr = new Zend_Db_Expr(sprintf('(%s)', $select->assemble())); + $select = $this->getConnection()->select() + ->from(array('qls' => $this->getTable('newsletter/queue_link')), 'COUNT(qls.queue_link_id)') + ->where('qls.queue_id = main_table.queue_id') + ->where('qls.letter_sent_at IS NOT NULL'); + $sentExpr = new Zend_Db_Expr(sprintf('(%s)', $select->assemble())); + + $this->getSelect()->columns(array( + 'subscribers_sent' => $sentExpr, + 'subscribers_total' => $totalExpr + )); return $this; } diff --git a/app/code/core/Mage/Newsletter/data/newsletter_setup/data-upgrade-1.6.0.0-1.6.0.1.php b/app/code/core/Mage/Newsletter/data/newsletter_setup/data-upgrade-1.6.0.0-1.6.0.1.php new file mode 100644 index 0000000000..14b76128b0 --- /dev/null +++ b/app/code/core/Mage/Newsletter/data/newsletter_setup/data-upgrade-1.6.0.0-1.6.0.1.php @@ -0,0 +1,43 @@ +getTable('newsletter/subscriber'); + +$select = $installer->getConnection()->select() + ->from(array('main_table' => $subscriberTable)) + ->join( + array('customer' => $installer->getTable('customer/entity')), + 'main_table.customer_id = customer.entity_id', + array('website_id') + ) + ->where('customer.website_id = 0'); + +$installer->getConnection()->query( + $installer->getConnection()->deleteFromSelect($select, 'main_table') +); diff --git a/app/code/core/Mage/Newsletter/etc/config.xml b/app/code/core/Mage/Newsletter/etc/config.xml index 9c9b2e25d9..660540f165 100644 --- a/app/code/core/Mage/Newsletter/etc/config.xml +++ b/app/code/core/Mage/Newsletter/etc/config.xml @@ -28,7 +28,7 @@ - 1.6.0.0 + 1.6.0.1 diff --git a/app/code/core/Mage/Newsletter/sql/newsletter_setup/install-1.6.0.0.php b/app/code/core/Mage/Newsletter/sql/newsletter_setup/install-1.6.0.0.php index 76a679880a..7a80417e85 100644 --- a/app/code/core/Mage/Newsletter/sql/newsletter_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Newsletter/sql/newsletter_setup/install-1.6.0.0.php @@ -60,8 +60,8 @@ 'default' => '0', ), 'Customer Id') ->addColumn('subscriber_email', Varien_Db_Ddl_Table::TYPE_TEXT, 150, array( - 'nullable' => false, - 'default' => '', + 'nullable' => true, + 'default' => null, ), 'Subscriber Email') ->addColumn('subscriber_status', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array( 'nullable' => false, @@ -202,7 +202,8 @@ ->addForeignKey($installer->getFkName('newsletter/queue_link', 'queue_id', 'newsletter/queue', 'queue_id'), 'queue_id', $installer->getTable('newsletter/queue'), 'queue_id', Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE) - ->addForeignKey($installer->getFkName('newsletter/queue_link', 'subscriber_id', 'newsletter/subscriber', 'subscriber_id'), + ->addForeignKey( + $installer->getFkName('newsletter/queue_link', 'subscriber_id', 'newsletter/subscriber', 'subscriber_id'), 'subscriber_id', $installer->getTable('newsletter/subscriber'), 'subscriber_id', Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE) ->setComment('Newsletter Queue Link'); @@ -268,7 +269,8 @@ ->addForeignKey($installer->getFkName('newsletter/problem', 'queue_id', 'newsletter/queue', 'queue_id'), 'queue_id', $installer->getTable('newsletter/queue'), 'queue_id', Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE) - ->addForeignKey($installer->getFkName('newsletter/problem', 'subscriber_id', 'newsletter/subscriber', 'subscriber_id'), + ->addForeignKey( + $installer->getFkName('newsletter/problem', 'subscriber_id', 'newsletter/subscriber', 'subscriber_id'), 'subscriber_id', $installer->getTable('newsletter/subscriber'), 'subscriber_id', Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE) ->setComment('Newsletter Problems'); diff --git a/app/code/core/Mage/Paygate/Helper/Data.php b/app/code/core/Mage/Paygate/Helper/Data.php index b4f915be2c..9c13e888e7 100644 --- a/app/code/core/Mage/Paygate/Helper/Data.php +++ b/app/code/core/Mage/Paygate/Helper/Data.php @@ -51,8 +51,29 @@ public function convertMessagesToMessage($messages) * @param string $exception * @return bool|string */ - public function getTransactionMessage($payment, $requestType, $lastTransactionId, $card, $amount = false, $exception = false) - { + public function getTransactionMessage($payment, $requestType, $lastTransactionId, $card, $amount = false, + $exception = false + ) { + return $this->getExtendedTransactionMessage( + $payment, $requestType, $lastTransactionId, $card, $amount, $exception + ); + } + + /** + * Return message for gateway transaction request + * + * @param Mage_Payment_Model_Info $payment + * @param string $requestType + * @param string $lastTransactionId + * @param Varien_Object $card + * @param float $amount + * @param string $exception + * @param string $additionalMessage Custom message, which will be added to the end of generated message + * @return bool|string + */ + public function getExtendedTransactionMessage($payment, $requestType, $lastTransactionId, $card, $amount = false, + $exception = false, $additionalMessage = false + ) { $operation = $this->_getOperation($requestType); if (!$operation) { @@ -70,9 +91,23 @@ public function getTransactionMessage($payment, $requestType, $lastTransactionId } $card = $this->__('Credit Card: xxxx-%s', $card->getCcLast4()); - $transaction = $this->__('Authorize.Net Transaction ID %s', $lastTransactionId); - return $this->__('%s %s %s - %s. %s. %s', $card, $amount, $operation, $result, $transaction, $exception ); + $pattern = '%s %s %s - %s.'; + $texts = array($card, $amount, $operation, $result); + + if (!is_null($lastTransactionId)) { + $pattern .= ' %s.'; + $texts[] = $this->__('Authorize.Net Transaction ID %s', $lastTransactionId); + } + + if ($additionalMessage) { + $pattern .= ' %s.'; + $texts[] = $additionalMessage; + } + $pattern .= ' %s'; + $texts[] = $exception; + + return call_user_func_array(array($this, '__'), array_merge(array($pattern), $texts)); } /** @@ -98,7 +133,7 @@ protected function _getOperation($requestType) return false; } } - + /** * Format price with currency sign * @param Mage_Payment_Model_Info $payment diff --git a/app/code/core/Mage/Paygate/Model/Authorizenet.php b/app/code/core/Mage/Paygate/Model/Authorizenet.php index 76783007b8..312b3a2081 100644 --- a/app/code/core/Mage/Paygate/Model/Authorizenet.php +++ b/app/code/core/Mage/Paygate/Model/Authorizenet.php @@ -64,6 +64,7 @@ class Mage_Paygate_Model_Authorizenet extends Mage_Payment_Model_Method_Cc const RESPONSE_CODE_HELD = 4; const RESPONSE_REASON_CODE_APPROVED = 1; + const RESPONSE_REASON_CODE_NOT_FOUND = 16; const RESPONSE_REASON_CODE_PARTIAL_APPROVE = 295; const RESPONSE_REASON_CODE_PENDING_REVIEW_AUTHORIZED = 252; const RESPONSE_REASON_CODE_PENDING_REVIEW = 253; @@ -79,6 +80,8 @@ class Mage_Paygate_Model_Authorizenet extends Mage_Payment_Model_Method_Cc const METHOD_CODE = 'authorizenet'; + const TRANSACTION_STATUS_EXPIRED = 'expired'; + protected $_code = self::METHOD_CODE; /** @@ -828,6 +831,34 @@ protected function _voidCardTransaction($payment, $card) break; case self::RESPONSE_CODE_DECLINED: case self::RESPONSE_CODE_ERROR: + if ($result->getResponseReasonCode() == self::RESPONSE_REASON_CODE_NOT_FOUND + && $this->_isTransactionExpired($realAuthTransactionId) + ) { + $voidTransactionId = $realAuthTransactionId . '-void'; + return $this->_addTransaction( + $payment, + $voidTransactionId, + Mage_Sales_Model_Order_Payment_Transaction::TYPE_VOID, + array( + 'is_transaction_closed' => 1, + 'should_close_parent_transaction' => 1, + 'parent_transaction_id' => $authTransactionId + ), + array(), + Mage::helper('paygate')->getExtendedTransactionMessage( + $payment, + self::REQUEST_TYPE_VOID, + null, + $card, + false, + false, + Mage::helper('paygate')->__( + 'Parent Authorize.Net transaction (ID %s) expired', + $realAuthTransactionId + ) + ) + ); + } $exceptionMessage = $this->_wrapGatewayError($result->getResponseReasonText()); break; default: @@ -841,6 +872,18 @@ protected function _voidCardTransaction($payment, $card) Mage::throwException($exceptionMessage); } + /** + * Check if transaction is expired + * + * @param string $realAuthTransactionId + * @return bool + */ + protected function _isTransactionExpired($realAuthTransactionId) + { + $transactionDetails = $this->_getTransactionDetails($realAuthTransactionId); + return $transactionDetails->getTransactionStatus() == self::TRANSACTION_STATUS_EXPIRED; + } + /** * Refund the card transaction through gateway * @@ -1509,6 +1552,7 @@ protected function _getTransactionDetails($transactionId) $response ->setResponseCode((string)$responseXmlDocument->transaction->responseCode) ->setResponseReasonCode((string)$responseXmlDocument->transaction->responseReasonCode) + ->setTransactionStatus((string)$responseXmlDocument->transaction->transactionStatus) ; return $response; } diff --git a/app/code/core/Mage/Payment/Block/Form/Container.php b/app/code/core/Mage/Payment/Block/Form/Container.php index a54b4d6972..37e8c4a6ea 100644 --- a/app/code/core/Mage/Payment/Block/Form/Container.php +++ b/app/code/core/Mage/Payment/Block/Form/Container.php @@ -116,7 +116,7 @@ public function getMethods() $quote = $this->getQuote(); $store = $quote ? $quote->getStoreId() : null; $methods = $this->helper('payment')->getStoreMethods($store, $quote); - $total = $quote->getBaseSubtotal(); + $total = $quote->getBaseSubtotal() + $quote->getShippingAddress()->getBaseShippingAmount(); foreach ($methods as $key => $method) { if ($this->_canUseMethod($method) && ($total != 0 diff --git a/app/code/core/Mage/Payment/Block/Info/Cc.php b/app/code/core/Mage/Payment/Block/Info/Cc.php index dfac07e831..920e54b9e7 100644 --- a/app/code/core/Mage/Payment/Block/Info/Cc.php +++ b/app/code/core/Mage/Payment/Block/Info/Cc.php @@ -44,6 +44,16 @@ public function getCcTypeName() return (empty($ccType)) ? Mage::helper('payment')->__('N/A') : $ccType; } + /** + * Whether current payment method has credit card expiration info + * + * @return bool + */ + public function hasCcExpDate() + { + return (int)$this->getInfo()->getCcExpMonth() || (int)$this->getInfo()->getCcExpYear(); + } + /** * Retrieve CC expiration month * diff --git a/app/code/core/Mage/Payment/Model/Method/Abstract.php b/app/code/core/Mage/Payment/Model/Method/Abstract.php index 5d869c9f73..d4aac27bfa 100644 --- a/app/code/core/Mage/Payment/Model/Method/Abstract.php +++ b/app/code/core/Mage/Payment/Model/Method/Abstract.php @@ -297,7 +297,8 @@ public function canManageBillingAgreements() */ public function canManageRecurringProfiles() { - return $this->_canManageRecurringProfiles && ($this instanceof Mage_Payment_Model_Recurring_Profile_MethodInterface); + return $this->_canManageRecurringProfiles + && ($this instanceof Mage_Payment_Model_Recurring_Profile_MethodInterface); } /** @@ -318,7 +319,7 @@ protected function _getHelper() public function getCode() { if (empty($this->_code)) { - Mage::throwException($this->_getHelper()->__('Cannot retrieve the payment method code.')); + Mage::throwException(Mage::helper('payment')->__('Cannot retrieve the payment method code.')); } return $this->_code; } @@ -352,7 +353,7 @@ public function getInfoInstance() { $instance = $this->getData('info_instance'); if (!($instance instanceof Mage_Payment_Model_Info)) { - Mage::throwException($this->_getHelper()->__('Cannot retrieve the payment information object instance.')); + Mage::throwException(Mage::helper('payment')->__('Cannot retrieve the payment information object instance.')); } return $instance; } @@ -360,13 +361,12 @@ public function getInfoInstance() /** * Validate payment method information object * - * @param Varien_Object $info - * @return Mage_Payment_Model_Abstract + * @return Mage_Payment_Model_Abstract */ public function validate() { /** - * to validate paymene method is allowed for billing country or not + * to validate payment method is allowed for billing country or not */ $paymentInfo = $this->getInfoInstance(); if ($paymentInfo instanceof Mage_Sales_Model_Order_Payment) { @@ -375,51 +375,55 @@ public function validate() $billingCountry = $paymentInfo->getQuote()->getBillingAddress()->getCountryId(); } if (!$this->canUseForCountry($billingCountry)) { - Mage::throwException($this->_getHelper()->__('Selected payment type is not allowed for billing country.')); + Mage::throwException(Mage::helper('payment')->__('Selected payment type is not allowed for billing country.')); } return $this; } /** - * Order + * Order payment abstract method + * + * @param Varien_Object $payment + * @param float $amount * - * @param Varien_Object $orderPayment - * @return Mage_Payment_Model_Abstract + * @return Mage_Payment_Model_Abstract */ public function order(Varien_Object $payment, $amount) { if (!$this->canOrder()) { - Mage::throwException($this->_getHelper()->__('Order action is not available.')); + Mage::throwException(Mage::helper('payment')->__('Order action is not available.')); } return $this; } /** - * Authorize + * Authorize payment abstract method * - * @param Varien_Object $orderPayment + * @param Varien_Object $payment * @param float $amount - * @return Mage_Payment_Model_Abstract + * + * @return Mage_Payment_Model_Abstract */ public function authorize(Varien_Object $payment, $amount) { if (!$this->canAuthorize()) { - Mage::throwException($this->_getHelper()->__('Authorize action is not available.')); + Mage::throwException(Mage::helper('payment')->__('Authorize action is not available.')); } return $this; } /** - * Capture payment + * Capture payment abstract method * - * @param Varien_Object $orderPayment + * @param Varien_Object $payment * @param float $amount - * @return Mage_Payment_Model_Abstract + * + * @return Mage_Payment_Model_Abstract */ public function capture(Varien_Object $payment, $amount) { if (!$this->canCapture()) { - Mage::throwException($this->_getHelper()->__('Capture action is not available.')); + Mage::throwException(Mage::helper('payment')->__('Capture action is not available.')); } return $this; @@ -453,18 +457,18 @@ public function processBeforeRefund($invoice, $payment) } /** - * Refund money + * Refund specified amount for payment * - * @param Varien_Object $invoicePayment + * @param Varien_Object $payment * @param float $amount - * @return Mage_Payment_Model_Abstract + * + * @return Mage_Payment_Model_Abstract */ - //public function refund(Varien_Object $payment, $amount) public function refund(Varien_Object $payment, $amount) { if (!$this->canRefund()) { - Mage::throwException($this->_getHelper()->__('Refund action is not available.')); + Mage::throwException(Mage::helper('payment')->__('Refund action is not available.')); } @@ -484,10 +488,11 @@ public function processCreditmemo($creditmemo, $payment) } /** - * Cancel payment (GoogleCheckout) + * Cancel payment abstract method + * + * @param Varien_Object $payment * - * @param Varien_Object $invoicePayment - * @return Mage_Payment_Model_Abstract + * @return Mage_Payment_Model_Abstract */ public function cancel(Varien_Object $payment) { @@ -509,15 +514,16 @@ public function processBeforeVoid($invoice, $payment) } /** - * Void payment + * Void payment abstract method + * + * @param Varien_Object $payment * - * @param Varien_Object $invoicePayment - * @return Mage_Payment_Model_Abstract + * @return Mage_Payment_Model_Abstract */ public function void(Varien_Object $payment) { if (!$this->canVoid($payment)) { - Mage::throwException($this->_getHelper()->__('Void action is not available.')); + Mage::throwException(Mage::helper('payment')->__('Void action is not available.')); } return $this; } @@ -526,7 +532,7 @@ public function void(Varien_Object $payment) * Whether this method can accept or deny payment * * @param Mage_Payment_Model_Info $payment - * @param bool $soft + * * @return bool */ public function canReviewPayment(Mage_Payment_Model_Info $payment) @@ -577,8 +583,10 @@ public function getTitle() /** * Retrieve information from payment configuration * - * @param string $field - * @return mixed + * @param string $field + * @param int|string|null|Mage_Core_Model_Store $storeId + * + * @return mixed */ public function getConfigData($field, $storeId = null) { @@ -618,8 +626,11 @@ public function prepareSave() /** * Check whether payment method can be used + * * TODO: payment method instance is not supposed to know about quote - * @param Mage_Sales_Model_Quote + * + * @param Mage_Sales_Model_Quote $quote + * * @return bool */ public function isAvailable($quote = null) @@ -645,10 +656,12 @@ public function isAvailable($quote = null) /** * Method that will be executed instead of authorize or capture - * if flag isInitilizeNeeded set to true + * if flag isInitializeNeeded set to true * - * @param string $paymentAction - * @return Mage_Payment_Model_Abstract + * @param string $paymentAction + * @param object $stateObject + * + * @return Mage_Payment_Model_Abstract */ public function initialize($paymentAction, $stateObject) { @@ -656,7 +669,7 @@ public function initialize($paymentAction, $stateObject) } /** - * Get config peyment action url + * Get config payment action url * Used to universalize payment actions when processing payment place * * @return string diff --git a/app/code/core/Mage/Payment/Model/Method/Cc.php b/app/code/core/Mage/Payment/Model/Method/Cc.php index b20a9945ce..861f45329b 100644 --- a/app/code/core/Mage/Payment/Model/Method/Cc.php +++ b/app/code/core/Mage/Payment/Model/Method/Cc.php @@ -107,14 +107,29 @@ public function validate() $ccType = 'OT'; $ccTypeRegExpList = array( //Solo, Switch or Maestro. International safe - //'SS' => '/^((6759[0-9]{12})|(6334|6767[0-9]{12})|(6334|6767[0-9]{14,15})|(5018|5020|5038|6304|6759|6761|6763[0-9]{12,19})|(49[013][1356][0-9]{12})|(633[34][0-9]{12})|(633110[0-9]{10})|(564182[0-9]{10}))([0-9]{2,3})?$/', // Maestro / Solo - 'SO' => '/(^(6334)[5-9](\d{11}$|\d{13,14}$))|(^(6767)(\d{12}$|\d{14,15}$))/', // Solo only - 'SM' => '/(^(5[0678])\d{11,18}$)|(^(6[^05])\d{11,18}$)|(^(601)[^1]\d{9,16}$)|(^(6011)\d{9,11}$)|(^(6011)\d{13,16}$)|(^(65)\d{11,13}$)|(^(65)\d{15,18}$)|(^(49030)[2-9](\d{10}$|\d{12,13}$))|(^(49033)[5-9](\d{10}$|\d{12,13}$))|(^(49110)[1-2](\d{10}$|\d{12,13}$))|(^(49117)[4-9](\d{10}$|\d{12,13}$))|(^(49118)[0-2](\d{10}$|\d{12,13}$))|(^(4936)(\d{12}$|\d{14,15}$))/', - 'VI' => '/^4[0-9]{12}([0-9]{3})?$/', // Visa - 'MC' => '/^5[1-5][0-9]{14}$/', // Master Card - 'AE' => '/^3[47][0-9]{13}$/', // American Express - 'DI' => '/^6011[0-9]{12}$/', // Discovery - 'JCB' => '/^(3[0-9]{15}|(2131|1800)[0-9]{11})$/', // JCB + /* + // Maestro / Solo + 'SS' => '/^((6759[0-9]{12})|(6334|6767[0-9]{12})|(6334|6767[0-9]{14,15})' + . '|(5018|5020|5038|6304|6759|6761|6763[0-9]{12,19})|(49[013][1356][0-9]{12})' + . '|(633[34][0-9]{12})|(633110[0-9]{10})|(564182[0-9]{10}))([0-9]{2,3})?$/', + */ + // Solo only + 'SO' => '/(^(6334)[5-9](\d{11}$|\d{13,14}$))|(^(6767)(\d{12}$|\d{14,15}$))/', + 'SM' => '/(^(5[0678])\d{11,18}$)|(^(6[^05])\d{11,18}$)|(^(601)[^1]\d{9,16}$)|(^(6011)\d{9,11}$)' + . '|(^(6011)\d{13,16}$)|(^(65)\d{11,13}$)|(^(65)\d{15,18}$)' + . '|(^(49030)[2-9](\d{10}$|\d{12,13}$))|(^(49033)[5-9](\d{10}$|\d{12,13}$))' + . '|(^(49110)[1-2](\d{10}$|\d{12,13}$))|(^(49117)[4-9](\d{10}$|\d{12,13}$))' + . '|(^(49118)[0-2](\d{10}$|\d{12,13}$))|(^(4936)(\d{12}$|\d{14,15}$))/', + // Visa + 'VI' => '/^4[0-9]{12}([0-9]{3})?$/', + // Master Card + 'MC' => '/^5[1-5][0-9]{14}$/', + // American Express + 'AE' => '/^3[47][0-9]{13}$/', + // Discovery + 'DI' => '/^6011[0-9]{12}$/', + // JCB + 'JCB' => '/^(3[0-9]{15}|(2131|1800)[0-9]{11})$/' ); foreach ($ccTypeRegExpList as $ccTypeMatch=>$ccTypeRegExp) { @@ -125,19 +140,16 @@ public function validate() } if (!$this->OtherCcType($info->getCcType()) && $ccType!=$info->getCcType()) { - $errorCode = 'ccsave_cc_type,ccsave_cc_number'; - $errorMsg = $this->_getHelper()->__('Credit card number mismatch with credit card type.'); + $errorMsg = Mage::helper('payment')->__('Credit card number mismatch with credit card type.'); } } else { - $errorCode = 'ccsave_cc_number'; - $errorMsg = $this->_getHelper()->__('Invalid Credit Card Number'); + $errorMsg = Mage::helper('payment')->__('Invalid Credit Card Number'); } } else { - $errorCode = 'ccsave_cc_type'; - $errorMsg = $this->_getHelper()->__('Credit card type is not allowed for this payment method.'); + $errorMsg = Mage::helper('payment')->__('Credit card type is not allowed for this payment method.'); } //validate credit card verification number @@ -145,18 +157,16 @@ public function validate() $verifcationRegEx = $this->getVerificationRegEx(); $regExp = isset($verifcationRegEx[$info->getCcType()]) ? $verifcationRegEx[$info->getCcType()] : ''; if (!$info->getCcCid() || !$regExp || !preg_match($regExp ,$info->getCcCid())){ - $errorMsg = $this->_getHelper()->__('Please enter a valid credit card verification number.'); + $errorMsg = Mage::helper('payment')->__('Please enter a valid credit card verification number.'); } } if ($ccType != 'SS' && !$this->_validateExpDate($info->getCcExpYear(), $info->getCcExpMonth())) { - $errorCode = 'ccsave_expiration,ccsave_expiration_yr'; - $errorMsg = $this->_getHelper()->__('Incorrect credit card expiration date.'); + $errorMsg = Mage::helper('payment')->__('Incorrect credit card expiration date.'); } if($errorMsg){ Mage::throwException($errorMsg); - //throw Mage::exception('Mage_Payment', $errorMsg, $errorCode); } //This must be after all validation conditions @@ -195,7 +205,9 @@ public function getVerificationRegEx() protected function _validateExpDate($expYear, $expMonth) { $date = Mage::app()->getLocale()->date(); - if (!$expYear || !$expMonth || ($date->compareYear($expYear)==1) || ($date->compareYear($expYear) == 0 && ($date->compareMonth($expMonth)==1 ) )) { + if (!$expYear || !$expMonth || ($date->compareYear($expYear) == 1) + || ($date->compareYear($expYear) == 0 && ($date->compareMonth($expMonth) == 1)) + ) { return false; } return true; diff --git a/app/code/core/Mage/Payment/Model/Method/Free.php b/app/code/core/Mage/Payment/Model/Method/Free.php index c77c6b227f..0ca45647aa 100644 --- a/app/code/core/Mage/Payment/Model/Method/Free.php +++ b/app/code/core/Mage/Payment/Model/Method/Free.php @@ -46,7 +46,6 @@ class Mage_Payment_Model_Method_Free extends Mage_Payment_Model_Method_Abstract * @var bool */ protected $_canAuthorize = true; - protected $_canCapture = true; /** * Payment code name diff --git a/app/code/core/Mage/Payment/etc/system.xml b/app/code/core/Mage/Payment/etc/system.xml index 977c4d7063..8cd6b1bfde 100644 --- a/app/code/core/Mage/Payment/etc/system.xml +++ b/app/code/core/Mage/Payment/etc/system.xml @@ -79,6 +79,7 @@ 1 1 0 + validate-number <label>Title</label> @@ -202,6 +203,7 @@ <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>0</show_in_store> + <frontend_class>validate-number</frontend_class> </sort_order> <title translate="label"> <label>Title</label> @@ -307,6 +309,7 @@ <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>0</show_in_store> + <frontend_class>validate-number</frontend_class> </sort_order> <title translate="label"> <label>Title</label> @@ -390,6 +393,7 @@ <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>0</show_in_store> + <frontend_class>validate-number</frontend_class> </sort_order> <title translate="label"> <label>Title</label> diff --git a/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/Payflowlink/Advanced.php b/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/Payflowlink/Advanced.php new file mode 100644 index 0000000000..1767bc98db --- /dev/null +++ b/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/Payflowlink/Advanced.php @@ -0,0 +1,43 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Paypal + * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Renderer for Payflow Link information + * + * @category Mage + * @package Mage_Paypal + * @author Magento Core Team <core@magentocommerce.com> + */ + class Mage_Paypal_Block_Adminhtml_System_Config_Payflowlink_Advanced + extends Mage_Paypal_Block_Adminhtml_System_Config_Payflowlink_Info +{ + /** + * Template path + * + * @var string + */ + protected $_template = 'paypal/system/config/payflowlink/advanced.phtml'; +} diff --git a/app/code/core/Mage/Paypal/Block/Iframe.php b/app/code/core/Mage/Paypal/Block/Iframe.php index bcc3bba935..35ba60256b 100644 --- a/app/code/core/Mage/Paypal/Block/Iframe.php +++ b/app/code/core/Mage/Paypal/Block/Iframe.php @@ -75,8 +75,9 @@ protected function _construct() ->getMethod(); if (in_array($paymentCode, $this->helper('paypal/hss')->getHssMethods())) { $this->_paymentMethodCode = $paymentCode; + $template_path = str_replace('_', '', $paymentCode); + $this->setTemplate("paypal/{$template_path}/iframe.phtml"); } - $this->setTemplate('paypal/hss/iframe.phtml'); } /** diff --git a/app/code/core/Mage/Paypal/Block/Payflow/Advanced/Form.php b/app/code/core/Mage/Paypal/Block/Payflow/Advanced/Form.php new file mode 100644 index 0000000000..33999784ee --- /dev/null +++ b/app/code/core/Mage/Paypal/Block/Payflow/Advanced/Form.php @@ -0,0 +1,56 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Paypal + * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Payflow Advanced iframe block + * + * @category Mage + * @package Mage_Paypal + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Paypal_Block_Payflow_Advanced_Form extends Mage_Paypal_Block_Payflow_Link_Form +{ + /** + * Internal constructor + * Set payment method code + * + */ + protected function _construct() + { + parent::_construct(); + $this->setTemplate('paypal/payflowadvanced/info.phtml'); + } + + /** + * Get frame action URL + * + * @return string + */ + public function getFrameActionUrl() + { + return $this->getUrl('paypal/payflowadvanced/form', array('_secure' => true)); + } +} diff --git a/app/code/core/Mage/Paypal/Block/Payflow/Advanced/Iframe.php b/app/code/core/Mage/Paypal/Block/Payflow/Advanced/Iframe.php new file mode 100644 index 0000000000..c66b35e5ed --- /dev/null +++ b/app/code/core/Mage/Paypal/Block/Payflow/Advanced/Iframe.php @@ -0,0 +1,67 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Paypal + * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Payflow Advanced iframe block + * + * @category Mage + * @package Mage_Paypal + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Paypal_Block_Payflow_Advanced_Iframe extends Mage_Paypal_Block_Payflow_Link_Iframe +{ + /** + * Set payment method code + */ + protected function _construct() + { + parent::_construct(); + $this->_paymentMethodCode = Mage_Paypal_Model_Config::METHOD_PAYFLOWADVANCED; + } + + /** + * Get frame action URL + * + * @return string + */ + public function getFrameActionUrl() + { + return $this->getUrl('paypal/payflowadvanced/form', array('_secure' => true)); + } + + /** + * Check sandbox mode + * + * @return bool + */ + public function isTestMode() + { + $mode = Mage::helper('payment') + ->getMethodInstance(Mage_Paypal_Model_Config::METHOD_PAYFLOWADVANCED) + ->getConfigData('sandbox_flag'); + return (bool) $mode; + } +} diff --git a/app/code/core/Mage/Paypal/Block/Payflow/Advanced/Info.php b/app/code/core/Mage/Paypal/Block/Payflow/Advanced/Info.php new file mode 100644 index 0000000000..0fa276f768 --- /dev/null +++ b/app/code/core/Mage/Paypal/Block/Payflow/Advanced/Info.php @@ -0,0 +1,37 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Paypal + * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Payflow Advanced infoblock + * + * @category Mage + * @package Mage_Paypal + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Paypal_Block_Payflow_Advanced_Info extends Mage_Paypal_Block_Payflow_Link_Info +{ + +} diff --git a/app/code/core/Mage/Paypal/Block/Payflow/Advanced/Review.php b/app/code/core/Mage/Paypal/Block/Payflow/Advanced/Review.php new file mode 100644 index 0000000000..0686af95a7 --- /dev/null +++ b/app/code/core/Mage/Paypal/Block/Payflow/Advanced/Review.php @@ -0,0 +1,38 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Paypal + * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Paypal Payflow Advanced Express Onepage checkout block + * + * @deprecated since 1.6.2.0 + * @category Mage + * @package Mage_Paypal + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Paypal_Block_Payflow_Advanced_Review extends Mage_Paypal_Block_Payflow_Link_Review +{ + +} diff --git a/app/code/core/Mage/Paypal/Block/Payflow/Link/Form.php b/app/code/core/Mage/Paypal/Block/Payflow/Link/Form.php index 09838bc757..bd84e7b001 100644 --- a/app/code/core/Mage/Paypal/Block/Payflow/Link/Form.php +++ b/app/code/core/Mage/Paypal/Block/Payflow/Link/Form.php @@ -41,7 +41,7 @@ class Mage_Paypal_Block_Payflow_Link_Form extends Mage_Payment_Block_Form protected function _construct() { parent::_construct(); - $this->setTemplate('paypal/payflowlink/iframe.phtml'); + $this->setTemplate('paypal/payflowlink/info.phtml'); } /** diff --git a/app/code/core/Mage/Paypal/Block/Payflow/Link/Iframe.php b/app/code/core/Mage/Paypal/Block/Payflow/Link/Iframe.php index 62b2c55c63..d3b6866e4e 100644 --- a/app/code/core/Mage/Paypal/Block/Payflow/Link/Iframe.php +++ b/app/code/core/Mage/Paypal/Block/Payflow/Link/Iframe.php @@ -31,8 +31,17 @@ * @package Mage_Paypal * @author Magento Core Team <core@magentocommerce.com> */ -class Mage_Paypal_Block_Payflow_Link_Iframe extends Mage_Payment_Block_Form +class Mage_Paypal_Block_Payflow_Link_Iframe extends Mage_Paypal_Block_Iframe { + /** + * Set payment method code + */ + protected function _construct() + { + parent::_construct(); + $this->_paymentMethodCode = Mage_Paypal_Model_Config::METHOD_PAYFLOWLINK; + } + /** * Get frame action URL * @@ -50,7 +59,7 @@ public function getFrameActionUrl() */ public function getSecureToken() { - return $this->_getSalesDocument() + return $this->_getOrder() ->getPayment() ->getAdditionalInformation('secure_token'); } @@ -62,7 +71,7 @@ public function getSecureToken() */ public function getSecureTokenId() { - return $this->_getSalesDocument() + return $this->_getOrder() ->getPayment() ->getAdditionalInformation('secure_token_id'); } @@ -85,18 +94,8 @@ public function getTransactionUrl() public function isTestMode() { $mode = Mage::helper('payment') - ->getMethodInstance(Mage_Paypal_Model_Config::METHOD_PAYFLOWLINK) + ->getMethodInstance($this->_paymentMethodCode) ->getConfigData('sandbox_flag'); return (bool) $mode; } - - /** - * Get sales document object - * - * @return Mage_Sales_Model_Order|Mage_Sales_Model_Quote - */ - protected function _getSalesDocument() - { - return Mage::getSingleton('checkout/session')->getQuote(); - } } diff --git a/app/code/core/Mage/Paypal/Block/Payflow/Link/Review.php b/app/code/core/Mage/Paypal/Block/Payflow/Link/Review.php new file mode 100644 index 0000000000..5e4747305c --- /dev/null +++ b/app/code/core/Mage/Paypal/Block/Payflow/Link/Review.php @@ -0,0 +1,47 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Paypal + * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Paypal PayflowLink Express Onepage checkout block + * + * @deprecated since 1.6.2.0 + * @category Mage + * @package Mage_Paypal + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Paypal_Block_Payflow_Link_Review extends Mage_Paypal_Block_Express_Review +{ + + /** + * Retrieve payment method and assign additional template values + * + * @return Mage_Paypal_Block_Express_Review + */ + protected function _beforeToHtml() + { + return parent::_beforeToHtml(); + } +} diff --git a/app/code/core/Mage/Paypal/Controller/Express/Abstract.php b/app/code/core/Mage/Paypal/Controller/Express/Abstract.php index 8dd3da2e1e..a661171277 100644 --- a/app/code/core/Mage/Paypal/Controller/Express/Abstract.php +++ b/app/code/core/Mage/Paypal/Controller/Express/Abstract.php @@ -69,7 +69,7 @@ public function startAction() $customer = Mage::getSingleton('customer/session')->getCustomer(); if ($customer && $customer->getId()) { $this->_checkout->setCustomerWithAddressChange( - $customer, null, $this->_getQuote()->getShippingAddress() + $customer, $this->_getQuote()->getBillingAddress(), $this->_getQuote()->getShippingAddress() ); } diff --git a/app/code/core/Mage/Paypal/Helper/Hss.php b/app/code/core/Mage/Paypal/Helper/Hss.php index 569f3af2fe..7764604705 100644 --- a/app/code/core/Mage/Paypal/Helper/Hss.php +++ b/app/code/core/Mage/Paypal/Helper/Hss.php @@ -35,7 +35,9 @@ class Mage_Paypal_Helper_Hss extends Mage_Core_Helper_Abstract * @var array */ protected $_hssMethods = array( - Mage_Paypal_Model_Config::METHOD_HOSTEDPRO + Mage_Paypal_Model_Config::METHOD_HOSTEDPRO, + Mage_Paypal_Model_Config::METHOD_PAYFLOWLINK, + Mage_Paypal_Model_Config::METHOD_PAYFLOWADVANCED ); /** diff --git a/app/code/core/Mage/Paypal/Model/Api/Nvp.php b/app/code/core/Mage/Paypal/Model/Api/Nvp.php index 54bbb7ec2e..f3783313eb 100644 --- a/app/code/core/Mage/Paypal/Model/Api/Nvp.php +++ b/app/code/core/Mage/Paypal/Model/Api/Nvp.php @@ -950,8 +950,6 @@ public function call($methodName, array $request) throw $e; } - $http->close(); - $response = preg_split('/^\r?$/m', $response, 2); $response = trim($response[1]); $response = $this->_deformatNVP($response); @@ -964,9 +962,13 @@ public function call($methodName, array $request) Mage::logException(new Exception( sprintf('PayPal NVP CURL connection error #%s: %s', $http->getErrno(), $http->getError()) )); + $http->close(); + Mage::throwException(Mage::helper('paypal')->__('Unable to communicate with the PayPal gateway.')); } + // cUrl resource must be closed after checking it for errors + $http->close(); if (!$this->_validateResponse($methodName, $response)) { Mage::logException(new Exception( @@ -1036,6 +1038,10 @@ protected function _handleCallErrors($response) */ protected function _isCallSuccessful($response) { + if (!isset($response['ACK'])) { + return false; + } + $ack = strtoupper($response['ACK']); $this->_callWarnings = array(); if ($ack == 'SUCCESS' || $ack == 'SUCCESSWITHWARNING') { diff --git a/app/code/core/Mage/Paypal/Model/Cart.php b/app/code/core/Mage/Paypal/Model/Cart.php index ab165bb909..8254ebfef4 100644 --- a/app/code/core/Mage/Paypal/Model/Cart.php +++ b/app/code/core/Mage/Paypal/Model/Cart.php @@ -213,7 +213,7 @@ public function addItem($name, $qty, $amount, $identifier = null) /** * Remove item from cart by identifier - * + * * @param string $identifier * @return bool */ @@ -335,12 +335,6 @@ protected function _render() ); } - $this->_validate(); - // if cart items are invalid, prepare cart for transfer without line items - if (!$this->_areItemsValid) { - $this->removeItem($shippingItemId); - } - // compound non-regular items into subtotal foreach ($this->_items as $key => $item) { if ($key > $lastRegularItemKey && $item->getAmount() != 0) { @@ -348,6 +342,12 @@ protected function _render() } } + $this->_validate(); + // if cart items are invalid, prepare cart for transfer without line items + if (!$this->_areItemsValid) { + $this->removeItem($shippingItemId); + } + $this->_shouldRender = false; } diff --git a/app/code/core/Mage/Paypal/Model/Config.php b/app/code/core/Mage/Paypal/Model/Config.php index e0f4a267a2..2adf45ea60 100644 --- a/app/code/core/Mage/Paypal/Model/Config.php +++ b/app/code/core/Mage/Paypal/Model/Config.php @@ -64,13 +64,14 @@ class Mage_Paypal_Model_Config * Payflow Pro Gateway * @var string */ - const METHOD_PAYFLOWPRO = 'verisign'; + const METHOD_PAYFLOWPRO = 'verisign'; - const METHOD_PAYFLOWLINK = 'payflow_link'; + const METHOD_PAYFLOWLINK = 'payflow_link'; + const METHOD_PAYFLOWADVANCED = 'payflow_advanced'; - const METHOD_HOSTEDPRO = 'hosted_pro'; + const METHOD_HOSTEDPRO = 'hosted_pro'; - const METHOD_BILLING_AGREEMENT = 'paypal_billing_agreement'; + const METHOD_BILLING_AGREEMENT = 'paypal_billing_agreement'; /** * Buttons and images @@ -97,6 +98,8 @@ class Mage_Paypal_Model_Config /** * Authorization amounts for Account Verification + * + * @deprecated since 1.6.2.0 * @var int */ const AUTHORIZATION_AMOUNT_ZERO = 0; @@ -481,6 +484,7 @@ public function getCountryMethods($countryCode = null) self::METHOD_WPP_PE_EXPRESS, self::METHOD_PAYFLOWPRO, self::METHOD_PAYFLOWLINK, + self::METHOD_PAYFLOWADVANCED, ), 'CA' => array( self::METHOD_WPS, @@ -871,16 +875,12 @@ public function getPaymentAction() /** * Returns array of possible Authorization Amounts for Account Verification * + * @deprecated since 1.6.2.0 * @return array */ public function getAuthorizationAmounts() { - $authorizationAmount = array( - self::AUTHORIZATION_AMOUNT_ZERO => Mage::helper('paypal')->__('$0 Auth'), - self::AUTHORIZATION_AMOUNT_ONE => Mage::helper('paypal')->__('$1 Auth'), - self::AUTHORIZATION_AMOUNT_FULL => Mage::helper('paypal')->__('Full Auth'), - ); - return $authorizationAmount; + return array(); } /** @@ -1004,6 +1004,7 @@ public static function getIsCreditCardMethod($code) case self::METHOD_WPP_PE_DIRECT: case self::METHOD_PAYFLOWPRO: case self::METHOD_PAYFLOWLINK: + case self::METHOD_PAYFLOWADVANCED: case self::METHOD_HOSTEDPRO: return true; } diff --git a/app/code/core/Mage/Paypal/Model/Ipn.php b/app/code/core/Mage/Paypal/Model/Ipn.php index e9da8a45db..f84321fbb4 100644 --- a/app/code/core/Mage/Paypal/Model/Ipn.php +++ b/app/code/core/Mage/Paypal/Model/Ipn.php @@ -132,7 +132,7 @@ protected function _postBack(Zend_Http_Client_Adapter_Interface $httpAdapter) { $sReq = ''; foreach ($this->_request as $k => $v) { - $sReq .= '&'.$k.'='.urlencode(stripslashes($v)); + $sReq .= '&'.$k.'='.urlencode($v); } $sReq .= "&cmd=_notify-validate"; $sReq = substr($sReq, 1); @@ -170,7 +170,12 @@ protected function _getOrder() $id = $this->_request['invoice']; $this->_order = Mage::getModel('sales/order')->loadByIncrementId($id); if (!$this->_order->getId()) { - throw new Exception(sprintf('Wrong order ID: "%s".', $id)); + $this->_debugData['exception'] = sprintf('Wrong order ID: "%s".', $id); + $this->_debug(); + Mage::app()->getResponse() + ->setHeader('HTTP/1.1','503 Service Unavailable') + ->sendResponse(); + exit; } // re-initialize config with the method code and store id $methodCode = $this->_order->getPayment()->getMethod(); diff --git a/app/code/core/Mage/Paypal/Model/Observer.php b/app/code/core/Mage/Paypal/Model/Observer.php index 7b2a5bc7ea..29aefce254 100644 --- a/app/code/core/Mage/Paypal/Model/Observer.php +++ b/app/code/core/Mage/Paypal/Model/Observer.php @@ -57,35 +57,12 @@ public function fetchReports() /** * Clean unfinished transaction * + * @deprecated since 1.6.2.0 * @return Mage_Paypal_Model_Observer */ public function cleanTransactions() { - /** @var $date Mage_Core_Model_Date */ - $date = Mage::getModel('core/date'); - $createdBefore = strtotime('-1 hour', $date->timestamp()); - - /** @var $collection Mage_Paypal_Model_Resource_Payment_Transaction_Collection */ - $collection = Mage::getModel('paypal/payment_transaction')->getCollection(); - $collection->addCreatedBeforeFilter($date->gmtDate(null, $createdBefore)); - - /** @var $method Mage_Paypal_Model_Payflowlink */ - $method = Mage::helper('payment')->getMethodInstance(Mage_Paypal_Model_Config::METHOD_PAYFLOWLINK); - - /** @var $item Mage_Paypal_Model_Payment_Transaction */ - foreach ($collection as $item) { - try { - $method->void(new Varien_Object(array( - 'transaction_id' => $item->getTxnId(), - 'store' => $item->getAdditionalInformation('store_id') - ))); - $item->delete(); - } catch (Mage_Paypal_Exception $e) { - $item->delete(); - } catch (Exception $e) { - Mage::logException($e); - } - } + return $this; } /** diff --git a/app/code/core/Mage/Paypal/Model/Payflowadvanced.php b/app/code/core/Mage/Paypal/Model/Payflowadvanced.php new file mode 100644 index 0000000000..3f6ee0becb --- /dev/null +++ b/app/code/core/Mage/Paypal/Model/Payflowadvanced.php @@ -0,0 +1,57 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Paypal + * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Payments Advanced gateway model + * + * @category Mage + * @package Mage_Paypal + * @author Magento Core Team <core@magentocommerce.com> + */ + +class Mage_Paypal_Model_Payflowadvanced extends Mage_Paypal_Model_Payflowlink +{ + /** + * Payment method code + * + * @var string + */ + protected $_code = Mage_Paypal_Model_Config::METHOD_PAYFLOWADVANCED; + + /** + * Type of block that generates method form + * + * @var string + */ + protected $_formBlockType = 'paypal/payflow_advanced_form'; + + /** + * Type of block that displays method information + * + * @var string + */ + protected $_infoBlockType = 'paypal/payflow_advanced_info'; +} diff --git a/app/code/core/Mage/Paypal/Model/Payflowlink.php b/app/code/core/Mage/Paypal/Model/Payflowlink.php index 2d833e86f5..46b6f6e6c3 100644 --- a/app/code/core/Mage/Paypal/Model/Payflowlink.php +++ b/app/code/core/Mage/Paypal/Model/Payflowlink.php @@ -47,6 +47,7 @@ class Mage_Paypal_Model_Payflowlink extends Mage_Paypal_Model_Payflowpro */ protected $_canUseInternal = false; protected $_canUseForMultishipping = false; + protected $_isInitializeNeeded = true; /** * Request & response model @@ -66,12 +67,6 @@ class Mage_Paypal_Model_Payflowlink extends Mage_Paypal_Model_Payflowpro */ const RESPONSE_ERROR_MSG = 'Payment error. %s was not found.'; - /** - * Quote Changed Error message - * @var string - */ - const SHOPPING_CART_CHANGED_ERROR_MSG = 'Shopping cart contents has been changed.'; - /** * Key for storing secure hash in additional information of payment model * @@ -113,194 +108,29 @@ public function isAvailable($quote = null) */ public function initialize($paymentAction, $stateObject) { - $payment = $this->getInfoInstance(); - - $salesDocument = $payment->getOrder(); - if (!$salesDocument) { - $salesDocument = $payment->getQuote(); - $amount = $salesDocument->getBaseGrandTotal(); - } else { - $amount = $salesDocument->getBaseTotalDue(); - } - //create reference transaction if Verification Authorization Amount set to $0 or $1 - $authorizationAmount = $this->getConfigData('authorization_amount', $salesDocument->getStoreId()); - switch ($authorizationAmount) { - case Mage_Paypal_Model_Config::AUTHORIZATION_AMOUNT_FULL: - $this->_initialize($payment, $amount); + switch ($paymentAction) { + case Mage_Paypal_Model_Config::PAYMENT_ACTION_AUTH: + case Mage_Paypal_Model_Config::PAYMENT_ACTION_SALE: + $payment = $this->getInfoInstance(); + $order = $payment->getOrder(); + $order->setCanSendNewEmailFlag(false); + $payment->setAmountAuthorized($order->getTotalDue()); + $payment->setBaseAmountAuthorized($order->getBaseTotalDue()); + $this->_generateSecureSilentPostHash($payment); + $request = $this->_buildTokenRequest($payment); + $response = $this->_postRequest($request); + $this->_processTokenErrors($response, $payment); + + $order = $payment->getOrder(); + $order->setCanSendNewEmailFlag(false); + + $stateObject->setState(Mage_Sales_Model_Order::STATE_PENDING_PAYMENT); + $stateObject->setStatus('pending_payment'); + $stateObject->setIsNotified(false); break; - case Mage_Paypal_Model_Config::AUTHORIZATION_AMOUNT_ONE: - $this->_initialize($payment, 1); - break; - case Mage_Paypal_Model_Config::AUTHORIZATION_AMOUNT_ZERO: - try { - $this->_initialize($payment, 0); - } catch (Mage_Paypal_Exception $e) { - $authorizationAmount = Mage_Paypal_Model_Config::AUTHORIZATION_AMOUNT_ONE; - $this->_initialize($payment, 1); - } + default: break; } - $payment->setAdditionalInformation('authorization_amount', $authorizationAmount); - - return $this; - } - - /** - * Add transaction with correct transaction Id - * - * @param Varien_Object $payment - * @param string $txnId - * @return void - */ - protected function _addTransaction($payment, $txnId) - { - $previousTxnId = $payment->getTransactionId(); - $payment->setTransactionId($txnId); - $payment->addTransaction(Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH); - $payment->setTransactionId($previousTxnId); - } - /** - * Initialize request - * - * @param Varien_Object $payment - * @param $amount - * @return Mage_Paypal_Model_Payflowlink - */ - protected function _initialize(Varien_Object $payment, $amount) - { - $this->_generateSecureSilentPostHash($payment); - $request = $this->_buildTokenRequest($payment, $amount); - $response = $this->_postRequest($request); - $this->_processTokenErrors($response, $payment); - return $this; - } - - /** - * Authorize payment - * - * @param Mage_Sales_Model_Order_Payment | Mage_Sales_Model_Quote_Payment $payment - * @param mixed $amount - * @return Mage_Paypal_Model_Payflowlink - */ - public function authorize(Varien_Object $payment, $amount) - { - $txnId = $payment->getAdditionalInformation('authorization_id'); - /** @var $transaction Mage_Paypal_Model_Payment_Transaction */ - $transaction = Mage::getModel('paypal/payment_transaction'); - $transaction->loadByTxnId($txnId); - - $payment->setTransactionId($txnId)->setIsTransactionClosed(0); - if ($payment->getAdditionalInformation('paypal_fraud_filters') !== null) { - $payment->setIsTransactionPending(true); - $payment->setIsFraudDetected(true); - } - - if ($transaction->getId() && $payment->getAdditionalInformation('authorization_amount') != - Mage_Paypal_Model_Config::AUTHORIZATION_AMOUNT_FULL - ) { - $this->_addTransaction($payment, $txnId); - } - - $this->_authorize($payment, $amount, $transaction, $txnId); - if ($payment->getAdditionalInformation('authorization_amount') != - Mage_Paypal_Model_Config::AUTHORIZATION_AMOUNT_FULL - ) { - $payment->setParentTransactionId($txnId); - parent::authorize($payment, $amount); - if ($payment->getTransactionId()) { - $payment->setAdditionalInformation('authorization_id', $payment->getTransactionId()); - } - } - - $transaction->delete(); - return $this; - } - - /** - * Additional authorization logic for Account Verification - * - * @param Varien_Object $payment - * @param mixed $amount - * @param Mage_Paypal_Model_Payment_Transaction $transaction - * @param string $txnId - * @return Mage_Paypal_Model_Payflowlink - */ - protected function _authorize(Varien_Object $payment, $amount, $transaction, $txnId) - { - $authorizationAmount = $payment->getAdditionalInformation('authorization_amount'); - if ($authorizationAmount == Mage_Paypal_Model_Config::AUTHORIZATION_AMOUNT_ONE) { - $payment->setParentTransactionId($txnId); - $this->void($payment); - } elseif ($authorizationAmount == Mage_Paypal_Model_Config::AUTHORIZATION_AMOUNT_FULL) { - $this->_checkTransaction($transaction, $amount); - } - return $this; - } - - /** - * Capture payment - * - * @param Mage_Sales_Model_Order_Payment | Mage_Sales_Model_Quote_Payment $payment - * @param mixed $amount - * @return Mage_Paypal_Model_Payflowlink - */ - public function capture(Varien_Object $payment, $amount) - { - $removePaypalTransaction = false; - /** @var $transaction Mage_Paypal_Model_Payment_Transaction */ - $transaction = Mage::getModel('paypal/payment_transaction'); - $txnId = $payment->getAdditionalInformation('authorization_id'); - $transaction->loadByTxnId($txnId); - if ($transaction->getId()) { - $removePaypalTransaction = true; - $this->_authorize($payment, $amount, $transaction, $txnId); - - $this->_addTransaction($payment, $txnId); - - $payment->setReferenceTransactionId($payment->getAdditionalInformation('authorization_id')); - } - - $payment->setParentTransactionId($txnId); - - $payment->setRequestAmount(round($amount,2)); - parent::capture($payment, $amount); - - if ($removePaypalTransaction) { - $transaction->delete(); - } - - return $this; - } - - /** - * Void payment - * - * @param Varien_Object $payment - * @return Mage_Paypal_Model_Payflowlink - */ - public function void(Varien_Object $payment) - { - /** @var $payment Mage_Sales_Model_Quote_Payment */ - if ($payment instanceof Mage_Sales_Model_Order_Payment) { - parent::void($payment); - $payment->addTransaction(Mage_Sales_Model_Order_Payment_Transaction::TYPE_VOID); - return $this; - } elseif ($payment instanceof Mage_Sales_Model_Quote_Payment) { - $this->setStore($payment->getQuote()->getStoreId()); - } else { - if ($payment->getStore()) { - $this->setStore($payment->getStore()); - } - } - - $request = $this->_buildBasicRequest($payment); - $request->setTrxtype(self::TRXTYPE_DELAYED_VOID); - - $request->setOrigid($payment->getTransactionId()); - $response = $this->_postRequest($request); - $this->_processErrors($response); - - return $this; } /** @@ -346,49 +176,63 @@ public function process($responseData) $this->setResponseData($responseData); - $document = $this->_getDocumentFromResponse(); - if ($document) { - $this->_process($document); + if ($order = $this->_getOrderFromResponse()) { + $this->_processOrder($order); } } /** - * Operate with order or quote using information from silent post + * Operate with order using information from silent post * - * @param Varien_Object $document + * @param Mage_Sales_Model_Order $order */ - protected function _process(Varien_Object $document) + protected function _processOrder(Mage_Sales_Model_Order $order) { $response = $this->getResponse(); - $payment = $document->getPayment(); + $payment = $order->getPayment(); + $payment->setTransactionId($response->getPnref()) + ->setIsTransactionClosed(0); + $canSendNewOrderEmail = true; if ($response->getResult() == self::RESPONSE_CODE_FRAUDSERVICE_FILTER || $response->getResult() == self::RESPONSE_CODE_DECLINED_BY_FILTER ) { - $fraudMessage = $this->_getFraudMessage() ? $response->getFraudMessage() : $response->getRespmsg(); - $payment->setAdditionalInformation('paypal_fraud_filters', $fraudMessage); + $canSendNewOrderEmail = false; + $fraudMessage = $this->_getFraudMessage() ? + $response->getFraudMessage() : $response->getRespmsg(); + $payment->setIsTransactionPending(true) + ->setIsFraudDetected(true) + ->setAdditionalInformation('paypal_fraud_filters', $fraudMessage); } if ($response->getAvsdata() && strstr(substr($response->getAvsdata(), 0, 2), 'N')) { $payment->setAdditionalInformation('paypal_avs_code', substr($response->getAvsdata(), 0, 2)); } - if ($response->getCvv2match() && $response->getCvv2match() != 'Y') { $payment->setAdditionalInformation('paypal_cvv2_match', $response->getCvv2match()); } - $payment->setAdditionalInformation('authorization_id', $response->getPnref()); - - /** @var $transaction Mage_Paypal_Model_Payment_Transaction */ - $transaction = Mage::getModel('paypal/payment_transaction'); - $transaction->setTxnId($response->getPnref()); - - $transaction->setAdditionalInformation('amt', $response->getAmt()); - $transaction->setAdditionalInformation('store_id', $document->getStoreId()); + switch ($response->getType()){ + case self::TRXTYPE_AUTH_ONLY: + $payment->registerAuthorizationNotification($payment->getBaseAmountAuthorized()); + break; + case self::TRXTYPE_SALE: + $payment->registerCaptureNotification($payment->getBaseAmountAuthorized()); + break; + } + $order->save(); - $document->setIsChanged(1); - $document->save(); - $transaction->save(); + try { + if ($canSendNewOrderEmail) { + $order->sendNewOrderEmail(); + } + Mage::getModel('sales/quote') + ->load($order->getQuoteId()) + ->setIsActive(false) + ->save(); + } catch (Exception $e) { + Mage::throwException(Mage::helper('paypal')->__('Can not send new order email.')); + } } /** @@ -407,58 +251,49 @@ protected function _getFraudMessage() return false; } - /** - * Check Transaction - * - * @param Mage_Paypal_Model_Payment_Transaction $transaction - * @param mixed $amount - * @return Mage_Paypal_Model_Payflowlink - */ - protected function _checkTransaction($transaction, $amount) - { - if (!$transaction->getId()) { - Mage::throwException(Mage::helper('paypal')->__(self::SHOPPING_CART_CHANGED_ERROR_MSG)); - } - - $authorizedAmt = $transaction->getAdditionalInformation('amt'); - - if (!$authorizedAmt || $amount > $authorizedAmt) { - Mage::throwException(Mage::helper('paypal')->__(self::SHOPPING_CART_CHANGED_ERROR_MSG)); - } - return $this; - } - /** * Check response from Payflow gateway. * - * @return Mage_Sales_Model_Abstract in case of validation passed + * @return Mage_Sales_Model_Order in case of validation passed * @throws Mage_Core_Exception in other cases */ - protected function _getDocumentFromResponse() + protected function _getOrderFromResponse() { $response = $this->getResponse(); - $salesDocument = Mage::getModel('sales/quote')->load($response->getPonum()); - $salesDocument->getPayment()->setMethod(Mage_Paypal_Model_Config::METHOD_PAYFLOWLINK); + $order = Mage::getModel('sales/order') + ->loadByIncrementId($response->getInvnum()); - if ($this->_getSecureSilentPostHash($salesDocument->getPayment()) != $response->getUser2() - || $this->_code != $salesDocument->getPayment()->getMethodInstance()->getCode()) { + if ($this->_getSecureSilentPostHash($order->getPayment()) != $response->getUser2() + || $this->_code != $order->getPayment()->getMethodInstance()->getCode() + ) { return false; } - if ($response->getResult() != self::RESPONSE_CODE_FRAUDSERVICE_FILTER && - $response->getResult() != self::RESPONSE_CODE_DECLINED_BY_FILTER && - $response->getResult() != self::RESPONSE_CODE_APPROVED + if ($response->getResult() != self::RESPONSE_CODE_FRAUDSERVICE_FILTER + && $response->getResult() != self::RESPONSE_CODE_DECLINED_BY_FILTER + && $response->getResult() != self::RESPONSE_CODE_APPROVED ) { + if ($order->getState() != Mage_Sales_Model_Order::STATE_CANCELED) { + $order->registerCancellation($response->getRespmsg())->save(); + } Mage::throwException($response->getRespmsg()); } - $fetchData = $this->fetchTransactionInfo($salesDocument->getPayment(), $response->getPnref()); - if (!isset($fetchData['custref']) || $fetchData['custref'] != $salesDocument->getReservedOrderId()) { - Mage::throwException($this->_formatStr(self::RESPONSE_ERROR_MSG, 'Transaction error')); + $amountCompared = ($response->getAmt() == $order->getPayment()->getBaseAmountAuthorized()) ? true : false; + if (!$order->getId() + || $order->getState() != Mage_Sales_Model_Order::STATE_PENDING_PAYMENT + || !$amountCompared + ) { + Mage::throwException($this->_formatStr(self::RESPONSE_ERROR_MSG, 'Order')); } - return $salesDocument; + $fetchData = $this->fetchTransactionInfo($order->getPayment(), $response->getPnref()); + if (!isset($fetchData['custref']) || $fetchData['custref'] != $order->getIncrementId()) { + Mage::throwException($this->_formatStr(self::RESPONSE_ERROR_MSG, 'Transaction')); + } + + return $order; } /** @@ -467,42 +302,27 @@ protected function _getDocumentFromResponse() * @param Mage_Sales_Model_Order_Payment $payment * @return Varien_Object */ - protected function _buildTokenRequest(Varien_Object $payment, $amount) + protected function _buildTokenRequest(Mage_Sales_Model_Order_Payment $payment) { - $orderId = null; - $fullAmount = $payment->getAdditionalInformation('authorization_amount'); - - $salesDocument = $payment->getOrder(); - if (!$salesDocument) { - $salesDocument = $payment->getQuote(); - if (!$salesDocument->getReservedOrderId()) { - $salesDocument->reserveOrderId(); - } - $orderId = $salesDocument->getReservedOrderId(); - } else { - $orderId = $salesDocument->getIncrementId(); - } - $request = $this->_buildBasicRequest($payment); - if (empty($salesDocument)) { - return $request; - } - $request->setCreatesecuretoken('Y') ->setSecuretokenid($this->_generateSecureTokenId()) ->setTrxtype($this->_getTrxTokenType()) - ->setAmt($this->_formatStr('%.2F', $amount)) - ->setCurrency($salesDocument->getBaseCurrencyCode()) - ->setInvnum($orderId) - ->setCustref($orderId) - ->setPonum($salesDocument->getId()); - if ($fullAmount != Mage_Paypal_Model_Config::AUTHORIZATION_AMOUNT_FULL) { - $request->setSubtotal($this->_formatStr('%.2F', $salesDocument->getBaseSubtotal())) - ->setTaxamt($this->_formatStr('%.2F', $salesDocument->getBaseTaxAmount())) - ->setFreightamt($this->_formatStr('%.2F', $salesDocument->getBaseShippingAmount())); + ->setAmt($this->_formatStr('%.2F', $payment->getOrder()->getBaseTotalDue())) + ->setCurrency($payment->getOrder()->getBaseCurrencyCode()) + ->setInvnum($payment->getOrder()->getIncrementId()) + ->setCustref($payment->getOrder()->getIncrementId()) + ->setPonum($payment->getOrder()->getId()) + ->setSubtotal($payment->getOrder()->getBaseSubtotal()) + ->setTaxamt($this->_formatStr('%.2F', $payment->getOrder()->getBaseTaxAmount())) + ->setFreightamt($this->_formatStr('%.2F', $payment->getOrder()->getBaseShippingAmount())); + + $order = $payment->getOrder(); + if (empty($order)) { + return $request; } - $billing = $salesDocument->getBillingAddress(); + $billing = $order->getBillingAddress(); if (!empty($billing)) { $request->setFirstname($billing->getFirstname()) ->setLastname($billing->getLastname()) @@ -511,9 +331,9 @@ protected function _buildTokenRequest(Varien_Object $payment, $amount) ->setState($billing->getRegionCode()) ->setZip($billing->getPostcode()) ->setCountry($billing->getCountry()) - ->setEmail($salesDocument->getCustomerEmail()); + ->setEmail($order->getCustomerEmail()); } - $shipping = $salesDocument->getShippingAddress(); + $shipping = $order->getShippingAddress(); if (!empty($shipping)) { $this->_applyCountryWorkarounds($shipping); $request->setShiptofirstname($shipping->getFirstname()) @@ -525,7 +345,7 @@ protected function _buildTokenRequest(Varien_Object $payment, $amount) ->setShiptocountry($shipping->getCountry()); } //pass store Id to request - $request->setUser1($salesDocument->getStoreId()) + $request->setUser1($order->getStoreId()) ->setUser2($this->_getSecureSilentPostHash($payment)); return $request; @@ -563,25 +383,6 @@ protected function _buildBasicRequest(Varien_Object $payment) ->setPwd($this->getConfigData('pwd', $this->_getStoreId())) ->setVerbosity($this->getConfigData('verbosity', $this->_getStoreId())) ->setTender(self::TENDER_CC); - if ($payment->getRequestAmount() > 0) { - $request->setAmt(round($payment->getRequestAmount(),2)); - } - return $request; - } - - /** - * Return request object with information for 'authorization' or 'sale' action - * - * @param Mage_Sales_Model_Order_Payment $payment - * @param float $amount - * @return Varien_Object - */ - protected function _buildPlaceRequest(Varien_Object $payment, $amount) - { - $request = $this->_buildBasicRequest($payment); - $request->setAmt(round($amount,2)); - $request->setCurrency($payment->getOrder()->getBaseCurrencyCode()); - return $request; } @@ -592,7 +393,12 @@ protected function _buildPlaceRequest(Varien_Object $payment, $amount) */ protected function _getTrxTokenType() { - return self::TRXTYPE_AUTH_ONLY; + switch ($this->getConfigData('payment_action')) { + case Mage_Paypal_Model_Config::PAYMENT_ACTION_AUTH: + return self::TRXTYPE_AUTH_ONLY; + case Mage_Paypal_Model_Config::PAYMENT_ACTION_SALE: + return self::TRXTYPE_SALE; + } } /** @@ -627,9 +433,7 @@ protected function _formatStr($format, $string) */ protected function _processTokenErrors($response, $payment) { - if ($response->getResult() == self::RESPONSE_CODE_INVALID_AMOUNT) { - throw new Mage_Paypal_Exception(Mage::helper('paypal')->__('Invalid Amount')); - } elseif (!$response->getSecuretoken() && + if (!$response->getSecuretoken() && $response->getResult() != self::RESPONSE_CODE_APPROVED && $response->getResult() != self::RESPONSE_CODE_FRAUDSERVICE_FILTER) { Mage::throwException($response->getRespmsg()); @@ -664,21 +468,88 @@ protected function _generateSecureSilentPostHash($payment) } /** - * Set reference transaction data into request + * Add transaction with correct transaction Id + * + * @deprecated since 1.6.2.0 + * @param Varien_Object $payment + * @param string $txnId + * @return void + */ + protected function _addTransaction($payment, $txnId) + { + } + + /** + * Initialize request * + * @deprecated since 1.6.2.0 * @param Varien_Object $payment - * @param Varien_Object $request + * @param $amount * @return Mage_Paypal_Model_Payflowlink */ - protected function _setReferenceTransaction(Varien_Object $payment, $request) + protected function _initialize(Varien_Object $payment, $amount) { - if ($payment->getParentTransactionId()) { - $request->setOrigid($payment->getParentTransactionId()); + return $this; + } - $request->unsAcct(); - $request->unsExpdate(); - $request->unsCvv2(); - } + /** + * Check whether order review has enough data to initialize + * + * @deprecated since 1.6.2.0 + * @param $token + * @throws Mage_Core_Exception + */ + public function prepareOrderReview($token = null) + { + } + + /** + * Additional authorization logic for Account Verification + * + * @deprecated since 1.6.2.0 + * @param Varien_Object $payment + * @param mixed $amount + * @param Mage_Paypal_Model_Payment_Transaction $transaction + * @param string $txnId + * @return Mage_Paypal_Model_Payflowlink + */ + protected function _authorize(Varien_Object $payment, $amount, $transaction, $txnId) + { + return $this; + } + + /** + * Operate with order or quote using information from silent post + * + * @deprecated since 1.6.2.0 + * @param Varien_Object $document + */ + protected function _process(Varien_Object $document) + { + } + + /** + * Check Transaction + * + * @deprecated since 1.6.2.0 + * @param Mage_Paypal_Model_Payment_Transaction $transaction + * @param mixed $amount + * @return Mage_Paypal_Model_Payflowlink + */ + protected function _checkTransaction($transaction, $amount) + { return $this; } + + /** + * Check response from Payflow gateway. + * + * @deprecated since 1.6.2.0 + * @return Mage_Sales_Model_Abstract in case of validation passed + * @throws Mage_Core_Exception in other cases + */ + protected function _getDocumentFromResponse() + { + return null; + } } diff --git a/app/code/core/Mage/Paypal/Model/Payflowpro.php b/app/code/core/Mage/Paypal/Model/Payflowpro.php index 45af5ebe71..71336fd6ae 100644 --- a/app/code/core/Mage/Paypal/Model/Payflowpro.php +++ b/app/code/core/Mage/Paypal/Model/Payflowpro.php @@ -416,8 +416,11 @@ protected function _buildPlaceRequest(Varien_Object $payment, $amount) $order = $payment->getOrder(); if(!empty($order)){ - $request->setCurrency($order->getBaseCurrencyCode()) - ->setCustref($order->getIncrementId()); + $request->setCurrency($order->getBaseCurrencyCode()); + + $orderIncrementId = $order->getIncrementId(); + $request->setCustref($orderIncrementId) + ->setComment1($orderIncrementId); $billing = $order->getBillingAddress(); if (!empty($billing)) { diff --git a/app/code/core/Mage/Paypal/Model/Report/Settlement.php b/app/code/core/Mage/Paypal/Model/Report/Settlement.php index fe21bdffd3..952868b65c 100644 --- a/app/code/core/Mage/Paypal/Model/Report/Settlement.php +++ b/app/code/core/Mage/Paypal/Model/Report/Settlement.php @@ -70,7 +70,7 @@ class Mage_Paypal_Model_Report_Settlement extends Mage_Core_Model_Abstract const REPORTS_PATH = "/ppreports/outgoing"; /** - * Original charset of report files + * Original charset of old report files * @var string */ const FILES_IN_CHARSET = "UTF-16"; @@ -87,6 +87,84 @@ class Mage_Paypal_Model_Report_Settlement extends Mage_Core_Model_Abstract */ protected $_rows = array(); + protected $_csvColumns = array( + 'old' => array( + 'section_columns' => array( + '' => 0, + 'TransactionID' => 1, + 'InvoiceID' => 2, + 'PayPalReferenceID' => 3, + 'PayPalReferenceIDType' => 4, + 'TransactionEventCode' => 5, + 'TransactionInitiationDate' => 6, + 'TransactionCompletionDate' => 7, + 'TransactionDebitOrCredit' => 8, + 'GrossTransactionAmount' => 9, + 'GrossTransactionCurrency' => 10, + 'FeeDebitOrCredit' => 11, + 'FeeAmount' => 12, + 'FeeCurrency' => 13, + 'CustomField' => 14, + 'ConsumerID' => 15 + ), + 'rowmap' => array( + 'TransactionID' => 'transaction_id', + 'InvoiceID' => 'invoice_id', + 'PayPalReferenceID' => 'paypal_reference_id', + 'PayPalReferenceIDType' => 'paypal_reference_id_type', + 'TransactionEventCode' => 'transaction_event_code', + 'TransactionInitiationDate' => 'transaction_initiation_date', + 'TransactionCompletionDate' => 'transaction_completion_date', + 'TransactionDebitOrCredit' => 'transaction_debit_or_credit', + 'GrossTransactionAmount' => 'gross_transaction_amount', + 'GrossTransactionCurrency' => 'gross_transaction_currency', + 'FeeDebitOrCredit' => 'fee_debit_or_credit', + 'FeeAmount' => 'fee_amount', + 'FeeCurrency' => 'fee_currency', + 'CustomField' => 'custom_field', + 'ConsumerID' => 'consumer_id' + ) + ), + 'new' => array( + 'section_columns' => array( + '' => 0, + 'Transaction ID' => 1, + 'Invoice ID' => 2, + 'PayPal Reference ID' => 3, + 'PayPal Reference ID Type' => 4, + 'Transaction Event Code' => 5, + 'Transaction Initiation Date' => 6, + 'Transaction Completion Date' => 7, + 'Transaction Debit or Credit' => 8, + 'Gross Transaction Amount' => 9, + 'Gross Transaction Currency' => 10, + 'Fee Debit or Credit' => 11, + 'Fee Amount' => 12, + 'Fee Currency' => 13, + 'Custom Field' => 14, + 'Consumer ID' => 15, + 'Payment Tracking ID' => 16 + ), + 'rowmap' => array( + 'Transaction ID' => 'transaction_id', + 'Invoice ID' => 'invoice_id', + 'PayPal Reference ID' => 'paypal_reference_id', + 'PayPal Reference ID Type' => 'paypal_reference_id_type', + 'Transaction Event Code' => 'transaction_event_code', + 'Transaction Initiation Date' => 'transaction_initiation_date', + 'Transaction Completion Date' => 'transaction_completion_date', + 'Transaction Debit or Credit' => 'transaction_debit_or_credit', + 'Gross Transaction Amount' => 'gross_transaction_amount', + 'Gross Transaction Currency' => 'gross_transaction_currency', + 'Fee Debit or Credit' => 'fee_debit_or_credit', + 'Fee Amount' => 'fee_amount', + 'Fee Currency' => 'fee_currency', + 'Custom Field' => 'custom_field', + 'Consumer ID' => 'consumer_id', + 'Payment Tracking ID' => 'payment_tracking_id' + ) + ) + ); /** * Initialize resource model */ @@ -138,8 +216,12 @@ public function fetchAndSave($config) } $encoded = file_get_contents($localCsv); - $decoded = @iconv(self::FILES_IN_CHARSET, self::FILES_OUT_CHARSET.'//IGNORE', $encoded); - file_put_contents($localCsv, $decoded); + $csvFormat = 'new'; + if (self::FILES_OUT_CHARSET != mb_detect_encoding(($encoded))) { + $decoded = @iconv(self::FILES_IN_CHARSET, self::FILES_OUT_CHARSET.'//IGNORE', $encoded); + file_put_contents($localCsv, $decoded); + $csvFormat = 'old'; + } // Set last modified date, this value will be overwritten during parsing if (isset($attributes['mtime'])) { @@ -149,7 +231,7 @@ public function fetchAndSave($config) $this->setReportDate($this->_fileNameToDate($filename)) ->setFilename($filename) - ->parseCsv($localCsv); + ->parseCsv($localCsv, $csvFormat); if ($this->getAccountId()) { $this->save(); @@ -170,47 +252,17 @@ public function fetchAndSave($config) * Parse CSV file and collect report rows * * @param string $localCsv Path to CSV file + * @param string $format CSV format(column names) * @return Mage_Paypal_Model_Report_Settlement */ - public function parseCsv($localCsv) + public function parseCsv($localCsv, $format = 'new') { $this->_rows = array(); - $section_columns = array('' => 0, - 'TransactionID' => 1, - 'InvoiceID' => 2, - 'PayPalReferenceID' => 3, - 'PayPalReferenceIDType' => 4, - 'TransactionEventCode' => 5, - 'TransactionInitiationDate' => 6, - 'TransactionCompletionDate' => 7, - 'TransactionDebitOrCredit' => 8, - 'GrossTransactionAmount' => 9, - 'GrossTransactionCurrency' => 10, - 'FeeDebitOrCredit' => 11, - 'FeeAmount' => 12, - 'FeeCurrency' => 13, - 'CustomField' => 14, - 'ConsumerID' => 15, - ); - $rowmap = array( - 'TransactionID' => 'transaction_id', - 'InvoiceID' => 'invoice_id', - 'PayPalReferenceID' => 'paypal_reference_id', - 'PayPalReferenceIDType' => 'paypal_reference_id_type', - 'TransactionEventCode' => 'transaction_event_code', - 'TransactionInitiationDate' => 'transaction_initiation_date', - 'TransactionCompletionDate' => 'transaction_completion_date', - 'TransactionDebitOrCredit' => 'transaction_debit_or_credit', - 'GrossTransactionAmount' => 'gross_transaction_amount', - 'GrossTransactionCurrency' => 'gross_transaction_currency', - 'FeeDebitOrCredit' => 'fee_debit_or_credit', - 'FeeAmount' => 'fee_amount', - 'FeeCurrency' => 'fee_currency', - 'CustomField' => 'custom_field', - 'ConsumerID' => 'consumer_id', - ); - $flipped_section_columns = array_flip($section_columns); + $sectionColumns = $this->_csvColumns[$format]['section_columns']; + $rowMap = $this->_csvColumns[$format]['rowmap']; + + $flippedSectionColumns = array_flip($sectionColumns); $fp = fopen($localCsv, 'r'); while($line = fgetcsv($fp)) { if (empty($line)) { // The line was empty, so skip it. @@ -234,16 +286,16 @@ public function parseCsv($localCsv) // In case ever the column order is changed, we will have the items recorded properly // anyway. We have named, not numbered columns. for ($i = 1; $i < count($line); $i++) { - $section_columns[$line[$i]] = $i; + $sectionColumns[$line[$i]] = $i; } - $flipped_section_columns = array_flip($section_columns); + $flippedSectionColumns = array_flip($sectionColumns); break; case 'SB': // Section body. - $bodyitem = array(); + $bodyItem = array(); for($i = 1; $i < count($line); $i++) { - $bodyitem[$rowmap[$flipped_section_columns[$i]]] = $line[$i]; + $bodyItem[$rowMap[$flippedSectionColumns[$i]]] = $line[$i]; } - $this->_rows[] = $bodyitem; + $this->_rows[] = $bodyItem; break; case 'SC': // Section records count. case 'RC': // Report records count. diff --git a/app/code/core/Mage/Paypal/Model/Resource/Payment/Transaction.php b/app/code/core/Mage/Paypal/Model/Resource/Payment/Transaction.php index cddaf8bcd3..981f4c3889 100644 --- a/app/code/core/Mage/Paypal/Model/Resource/Payment/Transaction.php +++ b/app/code/core/Mage/Paypal/Model/Resource/Payment/Transaction.php @@ -27,6 +27,7 @@ /** * Paypal transaction resource model * + * @deprecated since 1.6.2.0 * @category Mage * @package Mage_Paypal * @author Magento Core Team <core@magentocommerce.com> diff --git a/app/code/core/Mage/Paypal/Model/Resource/Payment/Transaction/Collection.php b/app/code/core/Mage/Paypal/Model/Resource/Payment/Transaction/Collection.php index 53adcfde91..569bc36a7e 100644 --- a/app/code/core/Mage/Paypal/Model/Resource/Payment/Transaction/Collection.php +++ b/app/code/core/Mage/Paypal/Model/Resource/Payment/Transaction/Collection.php @@ -27,6 +27,7 @@ /** * Payment transactions collection * + * @deprecated since 1.6.2.0 * @category Mage * @package Mage_Paypal * @author Magento Core Team <core@magentocommerce.com> diff --git a/app/code/core/Mage/Paypal/Model/System/Config/Source/AuthorizationAmounts.php b/app/code/core/Mage/Paypal/Model/System/Config/Source/AuthorizationAmounts.php index 3160a23606..eec78d64a9 100644 --- a/app/code/core/Mage/Paypal/Model/System/Config/Source/AuthorizationAmounts.php +++ b/app/code/core/Mage/Paypal/Model/System/Config/Source/AuthorizationAmounts.php @@ -26,6 +26,11 @@ /** * Source model for available Authorization Amounts for Account Verification + * + * @deprecated since 1.6.2.0 + * @category Mage + * @package Mage_Paypal + * @author Magento Core Team <core@magentocommerce.com> */ class Mage_Paypal_Model_System_Config_Source_AuthorizationAmounts { @@ -36,8 +41,6 @@ class Mage_Paypal_Model_System_Config_Source_AuthorizationAmounts */ public function toOptionArray() { - /** @var $configModel Mage_Paypal_Model_Config */ - $configModel = Mage::getModel('paypal/config'); - return $configModel->getAuthorizationAmounts(); + return array(); } } diff --git a/app/code/core/Mage/Paypal/controllers/PayflowController.php b/app/code/core/Mage/Paypal/controllers/PayflowController.php index f9b6459a22..c05edd5f5e 100644 --- a/app/code/core/Mage/Paypal/controllers/PayflowController.php +++ b/app/code/core/Mage/Paypal/controllers/PayflowController.php @@ -31,7 +31,7 @@ * @package Mage_Paypal * @author Magento Core Team <core@magentocommerce.com> */ -class Mage_Paypal_PayflowController extends Mage_Core_Controller_Front_Action +class Mage_Paypal_PayflowController extends Mage_Paypal_Controller_Express_Abstract { /** * When a customer cancel payment from payflow gateway. @@ -54,20 +54,54 @@ public function returnUrlAction() ->setTemplate('paypal/payflowlink/redirect.phtml'); $session = $this->_getCheckout(); - $quote = $session->getQuote(); - /** @var $payment Mage_Sales_Model_Quote_Payment */ - $payment = $quote->getPayment(); - $gotoSection = 'payment'; - if ($payment->getAdditionalInformation('authorization_id')) { - $gotoSection = 'review'; - } else { - $gotoSection = 'payment'; - $redirectBlock->setErrorMsg($this->__('Payment has been declined. Please try again.')); + if ($session->getLastRealOrderId()) { + $order = Mage::getModel('sales/order')->loadByIncrementId($session->getLastRealOrderId()); + + if ($order && $order->getIncrementId() == $session->getLastRealOrderId()) { + $allowedOrderStates = array( + Mage_Sales_Model_Order::STATE_PROCESSING, + Mage_Sales_Model_Order::STATE_COMPLETE + ); + if (in_array($order->getState(), $allowedOrderStates)) { + $session->unsLastRealOrderId(); + $redirectBlock->setGotoSuccessPage(true); + } else { + $gotoSection = $this->_cancelPayment(strval($this->getRequest()->getParam('RESPMSG'))); + $redirectBlock->setGotoSection($gotoSection); + $redirectBlock->setErrorMsg($this->__('Payment has been declined. Please try again.')); + } + } } - $redirectBlock->setGotoSection($gotoSection); + $this->getResponse()->setBody($redirectBlock->toHtml()); } + /** + * Submit transaction to Payflow getaway into iframe + */ + public function formAction() + { + $this->getResponse() + ->setBody($this->_getIframeBlock()->toHtml()); + } + + /** + * Get response from PayPal by silent post method + */ + public function silentPostAction() + { + $data = $this->getRequest()->getPost(); + if (isset($data['INVNUM'])) { + /** @var $paymentModel Mage_Paypal_Model_Payflowlink */ + $paymentModel = Mage::getModel('paypal/payflowlink'); + try { + $paymentModel->process($data); + } catch (Exception $e) { + Mage::logException($e); + } + } + } + /** * Cancel order, return quote to customer * @@ -104,53 +138,6 @@ protected function _cancelPayment($errorMsg = '') return $gotoSection; } - /** - * Submit transaction to Payflow getaway into iframe - */ - public function formAction() - { - $quote = $this->_getCheckout()->getQuote(); - $payment = $quote->getPayment(); - - try { - $method = Mage::helper('payment')->getMethodInstance(Mage_Paypal_Model_Config::METHOD_PAYFLOWLINK); - $method->setData('info_instance', $payment); - $method->initialize($method->getConfigData('payment_action'), new Varien_Object()); - - $quote->save(); - } catch (Mage_Core_Exception $e) { - $this->loadLayout('paypal_payflow_link_iframe'); - - $block = $this->getLayout()->getBlock('payflow.link.info'); - $block->setErrorMessage($e->getMessage()); - - $this->getResponse()->setBody( - $block->toHtml() - ); - return; - } catch (Exception $e) { - Mage::logException($e); - } - $this->getResponse() - ->setBody($this->_getIframeBlock()->toHtml()); - } - - /** - * Get response from PayPal by silent post method - */ - public function silentPostAction() - { - $data = $this->getRequest()->getPost(); - if (isset($data['INVNUM'])) { - $paymentModel = Mage::getModel('paypal/payflowlink'); - try { - $paymentModel->process($data); - } catch (Exception $e) { - Mage::logException($e); - } - } - } - /** * Get frontend checkout session object * diff --git a/app/code/core/Mage/Paypal/controllers/PayflowadvancedController.php b/app/code/core/Mage/Paypal/controllers/PayflowadvancedController.php new file mode 100644 index 0000000000..64c9840809 --- /dev/null +++ b/app/code/core/Mage/Paypal/controllers/PayflowadvancedController.php @@ -0,0 +1,170 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Paypal + * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Payflow Advanced Checkout Controller + * + * @category Mage + * @package Mage_Paypal + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Paypal_PayflowadvancedController extends Mage_Paypal_Controller_Express_Abstract +{ + /** + * When a customer cancel payment from payflow gateway. + * + * @return void + */ + public function cancelPaymentAction() + { + $gotoSection = $this->_cancelPayment(); + $redirectBlock = $this->_getIframeBlock() + ->setGotoSection($gotoSection) + ->setTemplate('paypal/payflowadvanced/redirect.phtml'); + $this->getResponse()->setBody($redirectBlock->toHtml()); + } + + /** + * When a customer return to website from payflow gateway. + * + * @return void + */ + public function returnUrlAction() + { + $redirectBlock = $this->_getIframeBlock() + ->setTemplate('paypal/payflowadvanced/redirect.phtml'); + + $session = $this->_getCheckout(); + if ($session->getLastRealOrderId()) { + $order = Mage::getModel('sales/order')->loadByIncrementId($session->getLastRealOrderId()); + + if ($order && $order->getIncrementId() == $session->getLastRealOrderId()) { + $allowedOrderStates = array( + Mage_Sales_Model_Order::STATE_PROCESSING, + Mage_Sales_Model_Order::STATE_COMPLETE + ); + if (in_array($order->getState(), $allowedOrderStates)) { + $session->unsLastRealOrderId(); + $redirectBlock->setGotoSuccessPage(true); + } else { + $gotoSection = $this->_cancelPayment(strval($this->getRequest()->getParam('RESPMSG'))); + $redirectBlock->setGotoSection($gotoSection); + $redirectBlock->setErrorMsg($this->__('Payment has been declined. Please try again.')); + } + } + } + + $this->getResponse()->setBody($redirectBlock->toHtml()); + } + + /** + * Submit transaction to Payflow getaway into iframe + * + * @return void + */ + public function formAction() + { + $this->getResponse() + ->setBody($this->_getIframeBlock()->toHtml()); + } + + /** + * Get response from PayPal by silent post method + * + * @return void + */ + public function silentPostAction() + { + $data = $this->getRequest()->getPost(); + if (isset($data['INVNUM'])) { + /** @var $paymentModel Mage_Paypal_Model_Payflowadvanced */ + $paymentModel = Mage::getModel('paypal/payflowadvanced'); + try { + $paymentModel->process($data); + } catch (Exception $e) { + Mage::logException($e); + } + } + } + + /** + * Cancel order, return quote to customer + * + * @param string $errorMsg + * @return bool|string + */ + protected function _cancelPayment($errorMsg = '') + { + $gotoSection = false; + $session = $this->_getCheckout(); + if ($session->getLastRealOrderId()) { + $order = Mage::getModel('sales/order')->loadByIncrementId($session->getLastRealOrderId()); + if ($order->getId()) { + //Cancel order + if ($order->getState() != Mage_Sales_Model_Order::STATE_CANCELED) { + $order->registerCancellation($errorMsg)->save(); + } + $quote = Mage::getModel('sales/quote') + ->load($order->getQuoteId()); + //Return quote + if ($quote->getId()) { + $quote->setIsActive(1) + ->setReservedOrderId(NULL) + ->save(); + $session->replaceQuote($quote); + } + //Unset data + $session->unsLastRealOrderId(); + //Redirect to payment step + $gotoSection = 'payment'; + } + } + + return $gotoSection; + } + + /** + * Get frontend checkout session object + * + * @return Mage_Checkout_Model_Session + */ + protected function _getCheckout() + { + return Mage::getSingleton('checkout/session'); + } + + /** + * Get iframe block + * + * @return Mage_Paypal_Block_Payflow_Advanced_Iframe + */ + protected function _getIframeBlock() + { + $this->loadLayout('paypal_payflow_advanced_iframe'); + return $this->getLayout() + ->getBlock('payflow.advanced.iframe'); + } +} diff --git a/app/code/core/Mage/Paypal/etc/config.xml b/app/code/core/Mage/Paypal/etc/config.xml index 86a5feb541..d804cf46e1 100644 --- a/app/code/core/Mage/Paypal/etc/config.xml +++ b/app/code/core/Mage/Paypal/etc/config.xml @@ -28,7 +28,7 @@ <config> <modules> <Mage_Paypal> - <version>1.6.0.1</version> + <version>1.6.0.2</version> </Mage_Paypal> </modules> <global> @@ -254,12 +254,23 @@ </paypal_billing_agreement> <payflow_link> <model>paypal/payflowlink</model> - <title>Payflow Link Authorization HIGH paypal + Credit Card + + paypal/payflowadvanced + Authorization + HIGH + + paypal + Credit Card + PayPal + PayPal + PayPal + paypal/hostedpro Payment by cards or by PayPal account @@ -275,14 +286,6 @@ paypal/observer::fetchReports - - - */15 * * * * - - - paypal/observer::cleanTransactions - - diff --git a/app/code/core/Mage/Paypal/etc/system.xml b/app/code/core/Mage/Paypal/etc/system.xml index 8da14aa53f..7002b25677 100644 --- a/app/code/core/Mage/Paypal/etc/system.xml +++ b/app/code/core/Mage/Paypal/etc/system.xml @@ -98,6 +98,11 @@ all + + + + + payment/paypal_express/active checkbox @@ -112,6 +117,11 @@ all + + + + + payment/paypal_standard/active checkbox @@ -173,7 +183,7 @@ - Quick set-up service lets your customers securely complete transactions. + Accept payments with a PCI-compliant checkout that keeps customers on your site. For use with your own merchant account. US, CA @@ -184,6 +194,18 @@ 1 1 + + + Accept payments with a PCI-compliant checkout that keeps customers on your site. Includes a merchant account from PayPal. + + US + + payment/payflow_advanced/active + checkbox + 55 + 1 + 1 + Contact PayPal before activating]]> @@ -209,6 +231,11 @@
Pasarela integral Settings
+ + + + + payment/hosted_pro/active checkbox @@ -355,6 +382,7 @@ 1 1 1 + validate-number @@ -530,6 +558,7 @@ 1 1 1 + validate-number @@ -627,6 +656,7 @@ 1 1 1 + validate-number @@ -776,6 +806,7 @@ 1 1 1 + validate-number @@ -863,6 +894,7 @@ 1 1 1 + validate-number @@ -1080,6 +1112,7 @@ 1 1 1 + validate-number @@ -1286,6 +1319,7 @@ 10 1 1 + validate-number @@ -1562,6 +1596,7 @@ 1 1 1 + validate-number @@ -1572,16 +1607,6 @@ 1 1 - - - Learn More]]> - payment/payflow_link/authorization_amount - select - paypal/system_config_source_authorizationAmounts - 15 - 1 - 1 - payment/payflow_link/allowspecific @@ -1690,6 +1715,158 @@
+ + + text + 90 + 1 + 1 + 1 + + + paypal/adminhtml_system_config_payflowlink_advanced + 1 + 1 + 1 + 22 + + + <label>Title</label> + <comment>It is recommended to set this value to "Debit or Credit Card" per store views.</comment> + <config_path>payment/payflow_advanced/title</config_path> + <frontend_type>text</frontend_type> + <sort_order>5</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>1</show_in_store> + + + + payment/payflow_advanced/sort_order + text + 10 + 1 + 1 + 1 + validate-number + + + + payment/payflow_advanced/payment_action + select + paypal/system_config_source_paymentActions + 15 + 1 + 1 + + + + payment/payflow_advanced/allowspecific + select + adminhtml/system_config_source_payment_allspecificcountries + 20 + 1 + 1 + + + + payment/payflow_advanced/specificcountry + multiselect + paypal/system_config_source_buyerCountry + 25 + 1 + 1 + 1 + + + + payment/payflow_advanced/debug + select + adminhtml/system_config_source_yesno + 30 + 1 + 1 + + + + adminhtml/system_config_form_field_heading + 35 + 1 + 1 + + + + payment/payflow_advanced/partner + text + 40 + 1 + 1 + + + + payment/payflow_advanced/vendor + text + 45 + 1 + 1 + + + + If you do not have multiple users set up on your account, please re-enter your Vendor/Merchant Login here. + text + payment/payflow_advanced/user + 50 + 1 + 1 + + + + payment/payflow_advanced/pwd + obscure + adminhtml/system_config_backend_encrypted + 55 + 1 + 1 + + + + payment/payflow_advanced/sandbox_flag + select + adminhtml/system_config_source_yesno + 60 + 1 + 1 + + + + payment/payflow_advanced/use_proxy + select + adminhtml/system_config_source_yesno + 65 + 1 + 1 + + + + payment/payflow_advanced/proxy_host + text + 70 + 1 + 1 + 1 + + + + payment/payflow_advanced/proxy_port + text + 75 + 1 + 1 + 1 + + + + text @@ -1716,6 +1893,7 @@ 1 1 1 + validate-number diff --git a/app/code/core/Mage/Paypal/sql/paypal_setup/upgrade-1.6.0.1-1.6.0.2.php b/app/code/core/Mage/Paypal/sql/paypal_setup/upgrade-1.6.0.1-1.6.0.2.php new file mode 100644 index 0000000000..397b660940 --- /dev/null +++ b/app/code/core/Mage/Paypal/sql/paypal_setup/upgrade-1.6.0.1-1.6.0.2.php @@ -0,0 +1,35 @@ +getConnection() + ->addColumn($installer->getTable('paypal/settlement_report_row'), 'payment_tracking_id', array( + 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, + 'comment' => 'Payment Tracking ID', + 'length' => '255' + )); diff --git a/app/code/core/Mage/Poll/Model/Poll/Answer.php b/app/code/core/Mage/Poll/Model/Poll/Answer.php index 31b6912ba2..f846d2e56e 100644 --- a/app/code/core/Mage/Poll/Model/Poll/Answer.php +++ b/app/code/core/Mage/Poll/Model/Poll/Answer.php @@ -52,7 +52,9 @@ protected function _construct() public function countPercent($poll) { - $this->setPercent(round(( $poll->getVotesCount() > 0 ) ? ($this->getVotesCount() * 100 / $poll->getVotesCount()) : 0)); + $this->setPercent( + round(($poll->getVotesCount() > 0 ) ? ($this->getVotesCount() * 100 / $poll->getVotesCount()) : 0, 2) + ); return $this; } diff --git a/app/code/core/Mage/Reports/Model/Flag.php b/app/code/core/Mage/Reports/Model/Flag.php index fe2fad95f9..b64b5b5114 100644 --- a/app/code/core/Mage/Reports/Model/Flag.php +++ b/app/code/core/Mage/Reports/Model/Flag.php @@ -41,6 +41,7 @@ class Mage_Reports_Model_Flag extends Mage_Core_Model_Flag const REPORT_REFUNDED_FLAG_CODE = 'report_refunded_aggregated'; const REPORT_COUPONS_FLAG_CODE = 'report_coupons_aggregated'; const REPORT_BESTSELLERS_FLAG_CODE = 'report_bestsellers_aggregated'; + const REPORT_PRODUCT_VIEWED_FLAG_CODE = 'report_product_viewed_aggregated'; /** * Setter for flag code diff --git a/app/code/core/Mage/Reports/Model/Mysql4/Product/Index/Abstract.php b/app/code/core/Mage/Reports/Model/Mysql4/Product/Index/Abstract.php index c7bd644200..4142cc0e1c 100644 --- a/app/code/core/Mage/Reports/Model/Mysql4/Product/Index/Abstract.php +++ b/app/code/core/Mage/Reports/Model/Mysql4/Product/Index/Abstract.php @@ -32,6 +32,7 @@ * @package Mage_Reports * @author Magento Core Team */ -class Mage_Reports_Model_Mysql4_Product_Index_Abstract extends Mage_Reports_Model_Resource_Product_Index_Abstract +abstract class Mage_Reports_Model_Mysql4_Product_Index_Abstract + extends Mage_Reports_Model_Resource_Product_Index_Abstract { } diff --git a/app/code/core/Mage/Reports/Model/Mysql4/Product/Index/Collection/Abstract.php b/app/code/core/Mage/Reports/Model/Mysql4/Product/Index/Collection/Abstract.php index 096d056da1..196c49017c 100644 --- a/app/code/core/Mage/Reports/Model/Mysql4/Product/Index/Collection/Abstract.php +++ b/app/code/core/Mage/Reports/Model/Mysql4/Product/Index/Collection/Abstract.php @@ -32,7 +32,7 @@ * @package Mage_Reports * @author Magento Core Team */ -class Mage_Reports_Model_Mysql4_Product_Index_Collection_Abstract +abstract class Mage_Reports_Model_Mysql4_Product_Index_Collection_Abstract extends Mage_Reports_Model_Resource_Product_Index_Collection_Abstract { } diff --git a/app/code/core/Mage/Reports/Model/Mysql4/Report/Abstract.php b/app/code/core/Mage/Reports/Model/Mysql4/Report/Abstract.php index c73bd373bf..ebe9c32730 100644 --- a/app/code/core/Mage/Reports/Model/Mysql4/Report/Abstract.php +++ b/app/code/core/Mage/Reports/Model/Mysql4/Report/Abstract.php @@ -32,6 +32,6 @@ * @package Mage_Reports * @author Magento Core Team */ -class Mage_Reports_Model_Mysql4_Report_Abstract extends Mage_Reports_Model_Resource_Report_Abstract +abstract class Mage_Reports_Model_Mysql4_Report_Abstract extends Mage_Reports_Model_Resource_Report_Abstract { } diff --git a/app/code/core/Mage/Reports/Model/Resource/Helper/Interface.php b/app/code/core/Mage/Reports/Model/Resource/Helper/Interface.php new file mode 100644 index 0000000000..8e2442e597 --- /dev/null +++ b/app/code/core/Mage/Reports/Model/Resource/Helper/Interface.php @@ -0,0 +1,52 @@ + */ class Mage_Reports_Model_Resource_Helper_Mysql4 extends Mage_Core_Model_Resource_Helper_Mysql4 + implements Mage_Reports_Model_Resource_Helper_Interface { /** @@ -48,4 +49,71 @@ public function mergeVisitorProductIndex($mainTable, $data, $matchFields) return $result; } + /** + * Update rating position + * + * @param string $type day|month|year + * @param string $column + * @param string $mainTable + * @param string $aggregationTable + * @return Mage_Core_Model_Resource_Helper_Mysql4 + */ + public function updateReportRatingPos($type, $column, $mainTable, $aggregationTable) { + $adapter = $this->_getWriteAdapter(); + $periodSubSelect = $adapter->select(); + $ratingSubSelect = $adapter->select(); + $ratingSelect = $adapter->select(); + + switch ($type) { + case 'year': + $periodCol = $adapter->getDateFormatSql('t.period', '%Y-01-01'); + break; + case 'month': + $periodCol = $adapter->getDateFormatSql('t.period', '%Y-%m-01'); + break; + default: + $periodCol = 't.period'; + break; + } + + $columns = array( + 'period' => 't.period', + 'store_id' => 't.store_id', + 'product_id' => 't.product_id', + 'product_name' => 't.product_name', + 'product_price' => 't.product_price', + ); + + if ($type == 'day') { + $columns['id'] = 't.id'; // to speed-up insert on duplicate key update + } + + $cols = array_keys($columns); + $cols['total_qty'] = new Zend_Db_Expr('SUM(t.' . $column . ')'); + $periodSubSelect->from(array('t' => $mainTable), $cols) + ->group(array('t.store_id', $periodCol, 't.product_id')) + ->order(array('t.store_id', $periodCol, 'total_qty DESC')); + + $cols = $columns; + $cols[$column] = 't.total_qty'; + $cols['rating_pos'] = new Zend_Db_Expr( + "(@pos := IF(t.`store_id` <> @prevStoreId OR {$periodCol} <> @prevPeriod, 1, @pos+1))"); + $cols['prevStoreId'] = new Zend_Db_Expr('(@prevStoreId := t.`store_id`)'); + $cols['prevPeriod'] = new Zend_Db_Expr("(@prevPeriod := {$periodCol})"); + $ratingSubSelect->from($periodSubSelect, $cols); + + $cols = $columns; + $cols['period'] = $periodCol; + $cols[$column] = 't.' . $column; + $cols['rating_pos'] = 't.rating_pos'; + $ratingSelect->from($ratingSubSelect, $cols); + + $sql = $ratingSelect->insertFromSelect($aggregationTable, array_keys($cols)); + $adapter->query("SET @pos = 0, @prevStoreId = -1, @prevPeriod = '0000-00-00'"); + + $adapter->query($sql); + + return $this; + } + } diff --git a/app/code/core/Mage/Reports/Model/Resource/Product/Viewed/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Product/Viewed/Collection.php index 4f228527c3..6c7476732b 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Product/Viewed/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Product/Viewed/Collection.php @@ -34,6 +34,13 @@ */ class Mage_Reports_Model_Resource_Product_Viewed_Collection extends Mage_Reports_Model_Resource_Product_Collection { + /** + * List of store ids for the current collection will be filtered by + * + * @var array + */ + protected $_storeIds = array(); + /** * Join fields * @@ -73,6 +80,45 @@ public function setStoreIds($storeIds) $storeId = array_pop($storeIds); $this->setStoreId($storeId); $this->addStoreFilter($storeId); + $this->addStoreIds($storeId); + return $this; + } + + /** + * Add store ids to filter 'report_event' data by store + * + * @param array|int $storeIds + * @return Mage_Reports_Model_Resource_Product_Viewed_Collection + */ + public function addStoreIds($storeIds) + { + if (is_array($storeIds)) { + $this->_storeIds = array_merge($this->_storeIds, $storeIds); + } else { + $this->_storeIds[] = $storeIds; + } + return $this; + } + + /** + * Apply store filter + * + * @return Mage_Reports_Model_Resource_Product_Viewed_Collection + */ + protected function _applyStoreIds() + { + $this->getSelect()->where('store_id IN(?)', $this->_storeIds); return $this; } + + /** + * Apply filters + * + * @return Mage_Catalog_Model_Resource_Product_Collection + */ + protected function _beforeLoad() + { + $this->_applyStoreIds(); + return parent::_beforeLoad(); + } } diff --git a/app/code/core/Mage/Reports/Model/Resource/Quote/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Quote/Collection.php index 4f435d4213..1c8a10241b 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Quote/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Quote/Collection.php @@ -89,7 +89,7 @@ public function prepareForAbandonedReport($storeIds, $filter = null) ->addSubtotal($storeIds, $filter) ->addCustomerData($filter) ->setOrder('updated_at'); - if (is_array($storeIds)) { + if (is_array($storeIds) && !empty($storeIds)) { $this->addFieldToFilter('store_id', array('in' => $storeIds)); } @@ -139,7 +139,7 @@ public function prepareForProductsInCarts() ->joinInner( array('product_price' => $productAttrPriceTable), "product_price.entity_id = e.entity_id AND product_price.attribute_id = {$productAttrPriceId}", - array('price'=>'product_price.value')) + array('price' => new Zend_Db_Expr('product_price.value * main_table.base_to_global_rate'))) ->joinLeft( array('order_items' => new Zend_Db_Expr(sprintf('(%s)', $ordersSubSelect))), 'order_items.product_id = e.entity_id', diff --git a/app/code/core/Mage/Reports/Model/Resource/Report/Abstract.php b/app/code/core/Mage/Reports/Model/Resource/Report/Abstract.php index 50c98eb514..cde4d93a2f 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Report/Abstract.php +++ b/app/code/core/Mage/Reports/Model/Resource/Report/Abstract.php @@ -368,7 +368,7 @@ public function getStoreTZOffsetQuery($table, $column, $from = null, $to = null, foreach ($periods as $offset => $timestamps) { $subParts = array(); foreach ($timestamps as $ts) { - $subParts[] = "($column between '{$ts['from']}' and '{$ts['to']}')"; + $subParts[] = "($column between {$ts['from']} and {$ts['to']})"; } $then = $this->_getWriteAdapter() @@ -393,16 +393,17 @@ protected function _getTZOffsetTransitions($timezone, $from = null, $to = null) $tzTransitions = array(); try { if (!empty($from)) { - $from = new Zend_Date($from, 'Y-m-d H:i:s'); + $from = new Zend_Date($from, Varien_Date::DATETIME_INTERNAL_FORMAT); $from = $from->getTimestamp(); } - $to = new Zend_Date($to); - $nextPeriod = $to->toString('c'); + $to = new Zend_Date($to, Varien_Date::DATETIME_INTERNAL_FORMAT); + $nextPeriod = $this->_getWriteAdapter()->formatDate($to->toString(Varien_Date::DATETIME_INTERNAL_FORMAT)); $to = $to->getTimestamp(); $dtz = new DateTimeZone($timezone); $transitions = $dtz->getTransitions(); + $dateTimeObject = new Zend_Date('c'); for ($i = count($transitions) - 1; $i >= 0; $i--) { $tr = $transitions[$i]; @@ -410,6 +411,9 @@ protected function _getTZOffsetTransitions($timezone, $from = null, $to = null) continue; } + $dateTimeObject->set($tr['time']); + $tr['time'] = $this->_getWriteAdapter() + ->formatDate($dateTimeObject->toString(Varien_Date::DATETIME_INTERNAL_FORMAT)); $tzTransitions[$tr['offset']][] = array('from' => $tr['time'], 'to' => $nextPeriod); if (!empty($from) && $tr['ts'] < $from) { diff --git a/app/code/core/Mage/Reports/Model/Resource/Report/Collection/Abstract.php b/app/code/core/Mage/Reports/Model/Resource/Report/Collection/Abstract.php new file mode 100644 index 0000000000..d6326e2d65 --- /dev/null +++ b/app/code/core/Mage/Reports/Model/Resource/Report/Collection/Abstract.php @@ -0,0 +1,287 @@ + + */ +class Mage_Reports_Model_Resource_Report_Collection_Abstract extends Mage_Core_Model_Resource_Db_Collection_Abstract +{ + /** + * From date + * + * @var string + */ + protected $_from = null; + + /** + * To date + * + * @var string + */ + protected $_to = null; + + /** + * Period + * + * @var string + */ + protected $_period = null; + + /** + * Store ids + * + * @var int|array + */ + protected $_storesIds = 0; + + /** + * Does filters should be applied + * + * @var bool + */ + protected $_applyFilters = true; + + /** + * Is totals + * + * @var bool + */ + protected $_isTotals = false; + + /** + * Is subtotals + * + * @var bool + */ + protected $_isSubTotals = false; + + /** + * Aggregated columns + * + * @var array + */ + protected $_aggregatedColumns = array(); + + /** + * Set array of columns that should be aggregated + * + * @param array $columns + * @return Mage_Sales_Model_Resource_Report_Collection_Abstract + */ + public function setAggregatedColumns(array $columns) + { + $this->_aggregatedColumns = $columns; + return $this; + } + + /** + * Retrieve array of columns that should be aggregated + * + * @return array + */ + public function getAggregatedColumns() + { + return $this->_aggregatedColumns; + } + + /** + * Set date range + * + * @param mixed $from + * @param mixed $to + * @return Mage_Sales_Model_Resource_Report_Collection_Abstract + */ + public function setDateRange($from = null, $to = null) + { + $this->_from = $from; + $this->_to = $to; + return $this; + } + + /** + * Set period + * + * @param string $period + * @return Mage_Sales_Model_Resource_Report_Collection_Abstract + */ + public function setPeriod($period) + { + $this->_period = $period; + return $this; + } + + /** + * Apply date range filter + * + * @return Mage_Sales_Model_Resource_Report_Collection_Abstract + */ + protected function _applyDateRangeFilter() + { + // Remember that field PERIOD is a DATE(YYYY-MM-DD) in all databases including Oracle + if ($this->_from !== null) { + $this->getSelect()->where('period >= ?', $this->_from); + } + if ($this->_to !== null) { + $this->getSelect()->where('period <= ?', $this->_to); + } + + return $this; + } + + /** + * Set store ids + * + * @param mixed $storeIds (null, int|string, array, array may contain null) + * @return Mage_Sales_Model_Resource_Report_Collection_Abstract + */ + public function addStoreFilter($storeIds) + { + $this->_storesIds = $storeIds; + return $this; + } + + /** + * Apply stores filter to select object + * + * @param Zend_Db_Select $select + * @return Mage_Sales_Model_Resource_Report_Collection_Abstract + */ + protected function _applyStoresFilterToSelect(Zend_Db_Select $select) + { + $nullCheck = false; + $storeIds = $this->_storesIds; + + if (!is_array($storeIds)) { + $storeIds = array($storeIds); + } + + $storeIds = array_unique($storeIds); + + if ($index = array_search(null, $storeIds)) { + unset($storeIds[$index]); + $nullCheck = true; + } + + $storeIds[0] = ($storeIds[0] == '') ? 0 : $storeIds[0]; + + if ($nullCheck) { + $select->where('store_id IN(?) OR store_id IS NULL', $storeIds); + } else { + $select->where('store_id IN(?)', $storeIds); + } + + return $this; + } + + /** + * Apply stores filter + * + * @return Mage_Sales_Model_Resource_Report_Collection_Abstract + */ + protected function _applyStoresFilter() + { + return $this->_applyStoresFilterToSelect($this->getSelect()); + } + + /** + * Set apply filters flag + * + * @param boolean $flag + * @return Mage_Sales_Model_Resource_Report_Collection_Abstract + */ + public function setApplyFilters($flag) + { + $this->_applyFilters = $flag; + return $this; + } + + /** + * Getter/Setter for isTotals + * + * @param null|boolean $flag + * @return Mage_Sales_Model_Resource_Report_Collection_Abstract + */ + public function isTotals($flag = null) + { + if (is_null($flag)) { + return $this->_isTotals; + } + $this->_isTotals = $flag; + return $this; + } + + /** + * Getter/Setter for isSubTotals + * + * @param null|boolean $flag + * @return Mage_Sales_Model_Resource_Report_Collection_Abstract + */ + public function isSubTotals($flag = null) + { + if (is_null($flag)) { + return $this->_isSubTotals; + } + $this->_isSubTotals = $flag; + return $this; + } + + /** + * Custom filters application ability + * + * @return Mage_Reports_Model_Resource_Report_Collection_Abstract + */ + protected function _applyCustomFilter() + { + return $this; + } + + /** + * Load data + * Redeclare parent load method just for adding method _beforeLoad + * + * @param bool $printQuery + * @param bool $logQuery + * @return Mage_Sales_Model_Resource_Report_Collection_Abstract + */ + public function load($printQuery = false, $logQuery = false) + { + if ($this->isLoaded()) { + return $this; + } + $this->_initSelect(); + if ($this->_applyFilters) { + $this->_applyDateRangeFilter(); + $this->_applyStoresFilter(); + $this->_applyCustomFilter(); + } + return parent::load($printQuery, $logQuery); + } +} diff --git a/app/code/core/Mage/Reports/Model/Resource/Report/Product/Viewed.php b/app/code/core/Mage/Reports/Model/Resource/Report/Product/Viewed.php new file mode 100644 index 0000000000..e4403e8717 --- /dev/null +++ b/app/code/core/Mage/Reports/Model/Resource/Report/Product/Viewed.php @@ -0,0 +1,212 @@ + + */ +class Mage_Reports_Model_Resource_Report_Product_Viewed extends Mage_Sales_Model_Resource_Report_Abstract +{ + const AGGREGATION_DAILY = 'reports/viewed_aggregated_daily'; + const AGGREGATION_MONTHLY = 'reports/viewed_aggregated_monthly'; + const AGGREGATION_YEARLY = 'reports/viewed_aggregated_yearly'; + + /** + * Model initialization + * + */ + protected function _construct() + { + $this->_init(self::AGGREGATION_DAILY, 'id'); + } + + /** + * Aggregate products view data + * + * @param mixed $from + * @param mixed $to + * @return Mage_Sales_Model_Resource_Report_Bestsellers + */ + public function aggregate($from = null, $to = null) + { + $mainTable = $this->getMainTable(); + $adapter = $this->_getWriteAdapter(); + + // convert input dates to UTC to be comparable with DATETIME fields in DB + $from = $this->_dateToUtc($from); + $to = $this->_dateToUtc($to); + + $this->_checkDates($from, $to); + + if ($from !== null || $to !== null) { + $subSelect = $this->_getTableDateRangeSelect( + $this->getTable('reports/event'), + 'logged_at', 'logged_at', $from, $to + ); + } else { + $subSelect = null; + } + $this->_clearTableByDateRange($mainTable, $from, $to, $subSelect); + // convert dates from UTC to current admin timezone + $periodExpr = $adapter->getDatePartSql( + $this->getStoreTZOffsetQuery( + array('source_table' => $this->getTable('reports/event')), + 'source_table.logged_at', $from, $to + ) + ); + + $helper = Mage::getResourceHelper('core'); + $select = $adapter->select(); + + $select->group(array( + $periodExpr, + 'source_table.store_id', + 'source_table.object_id' + )); + + $viewsNumExpr = new Zend_Db_Expr('COUNT(source_table.event_id)'); + + $columns = array( + 'period' => $periodExpr, + 'store_id' => 'source_table.store_id', + 'product_id' => 'source_table.object_id', + 'product_name' => new Zend_Db_Expr( + sprintf('MIN(%s)', + $adapter->getIfNullSql('product_name.value','product_default_name.value') + ) + ), + 'product_price' => new Zend_Db_Expr( + sprintf('%s', + $helper->prepareColumn( + sprintf('MIN(%s)', + $adapter->getIfNullSql( + $adapter->getIfNullSql('product_price.value','product_default_price.value'), 0) + ), + $select->getPart(Zend_Db_Select::GROUP) + ) + ) + ), + 'views_num' => $viewsNumExpr + ); + + $select + ->from( + array( + 'source_table' => $this->getTable('reports/event')), + $columns) + ->where('source_table.event_type_id = ?', Mage_Reports_Model_Event::EVENT_PRODUCT_VIEW); + + /** @var Mage_Catalog_Model_Resource_Product $product */ + $product = Mage::getResourceSingleton('catalog/product'); + + $select->joinInner( + array( + 'product' => $this->getTable('catalog/product')), + 'product.entity_id = source_table.object_id', + array() + ); + + // join product attributes Name & Price + $nameAttribute = $product->getAttribute('name'); + $joinExprProductName = array( + 'product_name.entity_id = product.entity_id', + 'product_name.store_id = source_table.store_id', + $adapter->quoteInto('product_name.attribute_id = ?', $nameAttribute->getAttributeId()) + ); + $joinExprProductName = implode(' AND ', $joinExprProductName); + $joinExprProductDefaultName = array( + 'product_default_name.entity_id = product.entity_id', + 'product_default_name.store_id = 0', + $adapter->quoteInto('product_default_name.attribute_id = ?', $nameAttribute->getAttributeId()) + ); + $joinExprProductDefaultName = implode(' AND ', $joinExprProductDefaultName); + $select->joinLeft( + array( + 'product_name' => $nameAttribute->getBackend()->getTable()), + $joinExprProductName, + array() + ) + ->joinLeft( + array( + 'product_default_name' => $nameAttribute->getBackend()->getTable()), + $joinExprProductDefaultName, + array() + ); + $priceAttribute = $product->getAttribute('price'); + $joinExprProductPrice = array( + 'product_price.entity_id = product.entity_id', + 'product_price.store_id = source_table.store_id', + $adapter->quoteInto('product_price.attribute_id = ?', $priceAttribute->getAttributeId()) + ); + $joinExprProductPrice = implode(' AND ', $joinExprProductPrice); + + $joinExprProductDefPrice = array( + 'product_default_price.entity_id = product.entity_id', + 'product_default_price.store_id = 0', + $adapter->quoteInto('product_default_price.attribute_id = ?', $priceAttribute->getAttributeId()) + ); + $joinExprProductDefPrice = implode(' AND ', $joinExprProductDefPrice); + $select->joinLeft( + array('product_price' => $priceAttribute->getBackend()->getTable()), + $joinExprProductPrice, + array() + ) + ->joinLeft( + array('product_default_price' => $priceAttribute->getBackend()->getTable()), + $joinExprProductDefPrice, + array() + ); + + $havingPart = array($adapter->prepareSqlCondition($viewsNumExpr, array('gt' => 0))); + if (!is_null($subSelect)) { + $subSelectHavingPart = $this->_makeConditionFromDateRangeSelect($subSelect, 'period'); + if ($subSelectHavingPart) { + $havingPart[] = '(' . $subSelectHavingPart . ')'; + } + } + $select->having(implode(' AND ', $havingPart)); + + $select->useStraightJoin(); + $insertQuery = $helper->getInsertFromSelectUsingAnalytic($select, $this->getMainTable(), + array_keys($columns)); + $adapter->query($insertQuery); + + Mage::getResourceHelper('reports') + ->updateReportRatingPos('day', 'views_num', $mainTable, $this->getTable(self::AGGREGATION_DAILY)); + Mage::getResourceHelper('reports') + ->updateReportRatingPos('month', 'views_num', $mainTable, $this->getTable(self::AGGREGATION_MONTHLY)); + Mage::getResourceHelper('reports') + ->updateReportRatingPos('year', 'views_num', $mainTable, $this->getTable(self::AGGREGATION_YEARLY)); + + $this->_setFlagData(Mage_Reports_Model_Flag::REPORT_PRODUCT_VIEWED_FLAG_CODE); + + return $this; + } +} diff --git a/app/code/core/Mage/Reports/Model/Resource/Report/Product/Viewed/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Report/Product/Viewed/Collection.php new file mode 100644 index 0000000000..1f95ddd16b --- /dev/null +++ b/app/code/core/Mage/Reports/Model/Resource/Report/Product/Viewed/Collection.php @@ -0,0 +1,367 @@ +setModel('adminhtml/report_item'); + $this->_resource = Mage::getResourceModel('sales/report') + ->init(Mage_Reports_Model_Resource_Report_Product_Viewed::AGGREGATION_DAILY); + $this->setConnection($this->getResource()->getReadConnection()); + // overwrite default behaviour + $this->_applyFilters = false; + } + + /** + * Retrieve selected columns + * + * @return array + */ + protected function _getSelectedColumns() + { + $adapter = $this->getConnection(); + + if (!$this->_selectedColumns) { + if ($this->isTotals()) { + $this->_selectedColumns = $this->getAggregatedColumns(); + } else { + $this->_selectedColumns = array( + 'period' => sprintf('MAX(%s)', $adapter->getDateFormatSql('period', '%Y-%m-%d')), + 'views_num' => 'SUM(views_num)', + 'product_id' => 'product_id', + 'product_name' => 'MAX(product_name)', + 'product_price' => 'MAX(product_price)', + ); + if ('year' == $this->_period) { + $this->_selectedColumns['period'] = $adapter->getDateFormatSql('period', '%Y'); + } elseif ('month' == $this->_period) { + $this->_selectedColumns['period'] = $adapter->getDateFormatSql('period', '%Y-%m'); + } + } + } + return $this->_selectedColumns; + } + + /** + * Make select object for date boundary + * + * @param mixed $from + * @param mixed $to + * @return Zend_Db_Select + */ + protected function _makeBoundarySelect($from, $to) + { + $adapter = $this->getConnection(); + $cols = $this->_getSelectedColumns(); + $cols['views_num'] = 'SUM(views_num)'; + $select = $adapter->select() + ->from($this->getResource()->getMainTable(), $cols) + ->where('period >= ?', $from) + ->where('period <= ?', $to) + ->group('product_id') + ->order('views_num DESC') + ->limit($this->_ratingLimit); + + $this->_applyStoresFilterToSelect($select); + + return $select; + } + + /** + * Init collection select + * + * @return Mage_Reports_Model_Resource_Report_Product_Viewed_Collection + */ + protected function _initSelect() + { + $select = $this->getSelect(); + + // if grouping by product, not by period + if (!$this->_period) { + $cols = $this->_getSelectedColumns(); + $cols['views_num'] = 'SUM(views_num)'; + if ($this->_from || $this->_to) { + $mainTable = $this->getTable(Mage_Reports_Model_Resource_Report_Product_Viewed::AGGREGATION_DAILY); + $select->from($mainTable, $cols); + } else { + $mainTable = $this->getTable(Mage_Reports_Model_Resource_Report_Product_Viewed::AGGREGATION_YEARLY); + $select->from($mainTable, $cols); + } + + //exclude removed products + $subSelect = $this->getConnection()->select(); + $subSelect->from(array('existed_products' => $this->getTable('catalog/product')), new Zend_Db_Expr('1)')); + + $select->exists($subSelect, $mainTable . '.product_id = existed_products.entity_id') + ->group('product_id') + ->order('views_num ' . Varien_Db_Select::SQL_DESC) + ->limit($this->_ratingLimit); + + return $this; + } + + if ('year' == $this->_period) { + $mainTable = $this->getTable(Mage_Reports_Model_Resource_Report_Product_Viewed::AGGREGATION_YEARLY); + $select->from($mainTable, $this->_getSelectedColumns()); + } elseif ('month' == $this->_period) { + $mainTable = $this->getTable(Mage_Reports_Model_Resource_Report_Product_Viewed::AGGREGATION_MONTHLY); + $select->from($mainTable, $this->_getSelectedColumns()); + } else { + $mainTable = $this->getTable(Mage_Reports_Model_Resource_Report_Product_Viewed::AGGREGATION_DAILY); + $select->from($mainTable, $this->_getSelectedColumns()); + } + if (!$this->isTotals()) { + $select->group(array('period', 'product_id')); + } + $select->where('rating_pos <= ?', $this->_ratingLimit); + + return $this; + } + + /** + * Get SQL for get record count + * + * @return Varien_Db_Select + */ + public function getSelectCountSql() + { + $this->_renderFilters(); + $select = clone $this->getSelect(); + $select->reset(Zend_Db_Select::ORDER); + return $this->getConnection()->select()->from($select, 'COUNT(*)'); + } + + /** + * Set ids for store restrictions + * + * @param array $storeIds + * @return Mage_Reports_Model_Resource_Report_Product_Viewed_Collection + */ + public function addStoreRestrictions($storeIds) + { + if (!is_array($storeIds)) { + $storeIds = array($storeIds); + } + $currentStoreIds = $this->_storesIds; + if (isset($currentStoreIds) && $currentStoreIds != Mage_Core_Model_App::ADMIN_STORE_ID + && $currentStoreIds != array(Mage_Core_Model_App::ADMIN_STORE_ID)) { + if (!is_array($currentStoreIds)) { + $currentStoreIds = array($currentStoreIds); + } + $this->_storesIds = array_intersect($currentStoreIds, $storeIds); + } else { + $this->_storesIds = $storeIds; + } + + return $this; + } + + /** + * Redeclare parent method for applying filters after parent method + * but before adding unions and calculating totals + * + * @return Mage_Reports_Model_Resource_Report_Product_Viewed_Collection + */ + protected function _beforeLoad() + { + parent::_beforeLoad(); + + $this->_applyStoresFilter(); + + if ($this->_period) { + $selectUnions = array(); + + // apply date boundaries (before calling $this->_applyDateRangeFilter()) + $dtFormat = Varien_Date::DATE_INTERNAL_FORMAT; + $periodFrom = (!is_null($this->_from) ? new Zend_Date($this->_from, $dtFormat) : null); + $periodTo = (!is_null($this->_to) ? new Zend_Date($this->_to, $dtFormat) : null); + if ('year' == $this->_period) { + + if ($periodFrom) { + // not the first day of the year + if ($periodFrom->toValue(Zend_Date::MONTH) != 1 || $periodFrom->toValue(Zend_Date::DAY) != 1) { + $dtFrom = $periodFrom->getDate(); + // last day of the year + $dtTo = $periodFrom->getDate()->setMonth(12)->setDay(31); + if (!$periodTo || $dtTo->isEarlier($periodTo)) { + $selectUnions[] = $this->_makeBoundarySelect( + $dtFrom->toString($dtFormat), + $dtTo->toString($dtFormat) + ); + + // first day of the next year + $this->_from = $periodFrom->getDate() + ->addYear(1) + ->setMonth(1) + ->setDay(1) + ->toString($dtFormat); + } + } + } + + if ($periodTo) { + // not the last day of the year + if ($periodTo->toValue(Zend_Date::MONTH) != 12 || $periodTo->toValue(Zend_Date::DAY) != 31) { + $dtFrom = $periodTo->getDate()->setMonth(1)->setDay(1); // first day of the year + $dtTo = $periodTo->getDate(); + if (!$periodFrom || $dtFrom->isLater($periodFrom)) { + $selectUnions[] = $this->_makeBoundarySelect( + $dtFrom->toString($dtFormat), + $dtTo->toString($dtFormat) + ); + + // last day of the previous year + $this->_to = $periodTo->getDate() + ->subYear(1) + ->setMonth(12) + ->setDay(31) + ->toString($dtFormat); + } + } + } + + if ($periodFrom && $periodTo) { + // the same year + if ($periodFrom->toValue(Zend_Date::YEAR) == $periodTo->toValue(Zend_Date::YEAR)) { + $dtFrom = $periodFrom->getDate(); + $dtTo = $periodTo->getDate(); + $selectUnions[] = $this->_makeBoundarySelect( + $dtFrom->toString($dtFormat), + $dtTo->toString($dtFormat) + ); + + $this->getSelect()->where('1<>1'); + } + } + + } + else if ('month' == $this->_period) { + if ($periodFrom) { + // not the first day of the month + if ($periodFrom->toValue(Zend_Date::DAY) != 1) { + $dtFrom = $periodFrom->getDate(); + // last day of the month + $dtTo = $periodFrom->getDate()->addMonth(1)->setDay(1)->subDay(1); + if (!$periodTo || $dtTo->isEarlier($periodTo)) { + $selectUnions[] = $this->_makeBoundarySelect( + $dtFrom->toString($dtFormat), + $dtTo->toString($dtFormat) + ); + + // first day of the next month + $this->_from = $periodFrom->getDate()->addMonth(1)->setDay(1)->toString($dtFormat); + } + } + } + + if ($periodTo) { + // not the last day of the month + if ($periodTo->toValue(Zend_Date::DAY) != $periodTo->toValue(Zend_Date::MONTH_DAYS)) { + $dtFrom = $periodTo->getDate()->setDay(1); // first day of the month + $dtTo = $periodTo->getDate(); + if (!$periodFrom || $dtFrom->isLater($periodFrom)) { + $selectUnions[] = $this->_makeBoundarySelect( + $dtFrom->toString($dtFormat), + $dtTo->toString($dtFormat) + ); + + // last day of the previous month + $this->_to = $periodTo->getDate()->setDay(1)->subDay(1)->toString($dtFormat); + } + } + } + + if ($periodFrom && $periodTo) { + // the same month + if ($periodFrom->toValue(Zend_Date::YEAR) == $periodTo->toValue(Zend_Date::YEAR) + && $periodFrom->toValue(Zend_Date::MONTH) == $periodTo->toValue(Zend_Date::MONTH) + ) { + $dtFrom = $periodFrom->getDate(); + $dtTo = $periodTo->getDate(); + $selectUnions[] = $this->_makeBoundarySelect( + $dtFrom->toString($dtFormat), + $dtTo->toString($dtFormat) + ); + + $this->getSelect()->where('1<>1'); + } + } + + } + + $this->_applyDateRangeFilter(); + + // add unions to select + if ($selectUnions) { + $unionParts = array(); + $cloneSelect = clone $this->getSelect(); + $helper = Mage::getResourceHelper('core'); + $unionParts[] = '(' . $cloneSelect . ')'; + foreach ($selectUnions as $union) { + $query = $helper->getQueryUsingAnalyticFunction($union); + $unionParts[] = '(' . $query . ')'; + } + $this->getSelect()->reset()->union($unionParts, Zend_Db_Select::SQL_UNION_ALL); + } + + if ($this->isTotals()) { + // calculate total + $cloneSelect = clone $this->getSelect(); + $this->getSelect()->reset()->from($cloneSelect, $this->getAggregatedColumns()); + } else { + // add sorting + $this->getSelect()->order(array('period ASC', 'views_num DESC')); + } + } + + return $this; + } +} diff --git a/app/code/core/Mage/Reports/Model/Resource/Tag/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Tag/Collection.php index 7be1b75693..a119a8f54f 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Tag/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Tag/Collection.php @@ -57,12 +57,13 @@ public function addPopularity($storeIds) $select = $this->getSelect() ->joinLeft( array('tr' => $this->getTable('tag/relation')), - 'main_table.tag_id = tr.tag_id', + 'main_table.tag_id = tr.tag_id AND tr.active = 1', array('popularity' => 'COUNT(tr.tag_id)') ); if (!empty($storeIds)) { $select->where('tr.store_id IN(?)', $storeIds); } + $select->group('main_table.tag_id'); /** diff --git a/app/code/core/Mage/Reports/etc/config.xml b/app/code/core/Mage/Reports/etc/config.xml index 5956512fb8..64f21bbd15 100644 --- a/app/code/core/Mage/Reports/etc/config.xml +++ b/app/code/core/Mage/Reports/etc/config.xml @@ -28,7 +28,7 @@ - 1.6.0.0 + 1.6.0.0.1 @@ -53,6 +53,15 @@ report_viewed_product_index
+ + report_viewed_product_aggregated_daily
+
+ + report_viewed_product_aggregated_monthly
+
+ + report_viewed_product_aggregated_yearly
+
diff --git a/app/code/core/Mage/Reports/sql/reports_setup/upgrade-1.6.0.0-1.6.0.0.1.php b/app/code/core/Mage/Reports/sql/reports_setup/upgrade-1.6.0.0-1.6.0.0.1.php new file mode 100644 index 0000000000..be07726725 --- /dev/null +++ b/app/code/core/Mage/Reports/sql/reports_setup/upgrade-1.6.0.0-1.6.0.0.1.php @@ -0,0 +1,99 @@ +startSetup(); + +$aggregationTables = array( + Mage_Reports_Model_Resource_Report_Product_Viewed::AGGREGATION_DAILY, + Mage_Reports_Model_Resource_Report_Product_Viewed::AGGREGATION_MONTHLY, + Mage_Reports_Model_Resource_Report_Product_Viewed::AGGREGATION_YEARLY, +); +$aggregationTableComments = array( + 'Most Viewed Products Aggregated Daily', + 'Most Viewed Products Aggregated Monthly', + 'Most Viewed Products Aggregated Yearly', +); + +for ($i = 0; $i < 3; ++$i) { + $table = $installer->getConnection() + ->newTable($installer->getTable($aggregationTables[$i])) + ->addColumn('id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array( + 'identity' => true, + 'unsigned' => true, + 'nullable' => false, + 'primary' => true, + ), 'Id') + ->addColumn('period', Varien_Db_Ddl_Table::TYPE_DATE, null, array( + ), 'Period') + ->addColumn('store_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array( + 'unsigned' => true, + ), 'Store Id') + ->addColumn('product_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array( + 'unsigned' => true, + ), 'Product Id') + ->addColumn('product_name', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array( + 'nullable' => true, + ), 'Product Name') + ->addColumn('product_price', Varien_Db_Ddl_Table::TYPE_DECIMAL, '12,4', array( + 'nullable' => false, + 'default' => '0.0000', + ), 'Product Price') + ->addColumn('views_num', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array( + 'nullable' => false, + 'default' => '0', + ), 'Number of Views') + ->addColumn('rating_pos', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array( + 'unsigned' => true, + 'nullable' => false, + 'default' => '0', + ), 'Rating Pos') + ->addIndex( + $installer->getIdxName( + $aggregationTables[$i], + array('period', 'store_id', 'product_id'), + Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE + ), + array('period', 'store_id', 'product_id'), array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE)) + ->addIndex($installer->getIdxName($aggregationTables[$i], array('store_id')), array('store_id')) + ->addIndex($installer->getIdxName($aggregationTables[$i], array('product_id')), array('product_id')) + ->addForeignKey( + $installer->getFkName($aggregationTables[$i], 'store_id', 'core/store', 'store_id'), + 'store_id', $installer->getTable('core/store'), 'store_id', + Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE) + ->addForeignKey( + $installer->getFkName($aggregationTables[$i], 'product_id', 'catalog/product', 'entity_id'), + 'product_id', $installer->getTable('catalog/product'), 'entity_id', + Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE) + ->setComment($aggregationTableComments[$i]); + $installer->getConnection()->createTable($table); +} + +$installer->endSetup(); diff --git a/app/code/core/Mage/Review/Model/Review.php b/app/code/core/Mage/Review/Model/Review.php index 949a29f5d9..116b32bbaa 100644 --- a/app/code/core/Mage/Review/Model/Review.php +++ b/app/code/core/Mage/Review/Model/Review.php @@ -119,18 +119,16 @@ public function validate() { $errors = array(); - $helper = Mage::helper('customer'); - if (!Zend_Validate::is($this->getTitle(), 'NotEmpty')) { - $errors[] = $helper->__('Review summary can\'t be empty'); + $errors[] = Mage::helper('review')->__('Review summary can\'t be empty'); } if (!Zend_Validate::is($this->getNickname(), 'NotEmpty')) { - $errors[] = $helper->__('Nickname can\'t be empty'); + $errors[] = Mage::helper('review')->__('Nickname can\'t be empty'); } if (!Zend_Validate::is($this->getDetail(), 'NotEmpty')) { - $errors[] = $helper->__('Review can\'t be empty'); + $errors[] = Mage::helper('review')->__('Review can\'t be empty'); } if (empty($errors)) { diff --git a/app/code/core/Mage/Review/controllers/ProductController.php b/app/code/core/Mage/Review/controllers/ProductController.php index 4cf922e378..bfa26a6de9 100644 --- a/app/code/core/Mage/Review/controllers/ProductController.php +++ b/app/code/core/Mage/Review/controllers/ProductController.php @@ -75,6 +75,9 @@ protected function _initProduct() $productId = (int) $this->getRequest()->getParam('id'); $product = $this->_loadProduct($productId); + if (!$product) { + return false; + } if ($categoryId) { $category = Mage::getModel('catalog/category')->load($categoryId); @@ -83,7 +86,10 @@ protected function _initProduct() try { Mage::dispatchEvent('review_controller_product_init', array('product'=>$product)); - Mage::dispatchEvent('review_controller_product_init_after', array('product'=>$product, 'controller_action' => $this)); + Mage::dispatchEvent('review_controller_product_init_after', array( + 'product' => $product, + 'controller_action' => $this + )); } catch (Mage_Core_Exception $e) { Mage::logException($e); return false; diff --git a/app/code/core/Mage/Rss/Block/Catalog/New.php b/app/code/core/Mage/Rss/Block/Catalog/New.php index 50c988ff45..10f9abb4f7 100644 --- a/app/code/core/Mage/Rss/Block/Catalog/New.php +++ b/app/code/core/Mage/Rss/Block/Catalog/New.php @@ -65,20 +65,31 @@ protected function _toHtml() */ $product = Mage::getModel('catalog/product'); - $todayDate = $product->getResource()->formatDate(time()); + + $todayStartOfDayDate = Mage::app()->getLocale()->date() + ->setTime('00:00:00') + ->toString(Varien_Date::DATETIME_INTERNAL_FORMAT); + + $todayEndOfDayDate = Mage::app()->getLocale()->date() + ->setTime('23:59:59') + ->toString(Varien_Date::DATETIME_INTERNAL_FORMAT); $products = $product->getCollection() ->setStoreId($storeId) ->addStoreFilter() - - ->addAttributeToFilter('news_from_date', array('date'=>true, 'to'=> $todayDate)) + ->addAttributeToFilter('news_from_date', array('or' => array( + 0 => array('date' => true, 'to' => $todayEndOfDayDate), + 1 => array('is' => new Zend_Db_Expr('null'))) + ), 'left') + ->addAttributeToFilter('news_to_date', array('or' => array( + 0 => array('date' => true, 'from' => $todayStartOfDayDate), + 1 => array('is' => new Zend_Db_Expr('null'))) + ), 'left') ->addAttributeToFilter( array( - array('attribute'=>'news_to_date', 'date'=>true, 'from'=>$todayDate), - array('attribute'=>'news_to_date', 'is' => new Zend_Db_Expr('null')) - ), - '', - 'left' + array('attribute' => 'news_from_date', 'is' => new Zend_Db_Expr('not null')), + array('attribute' => 'news_to_date', 'is' => new Zend_Db_Expr('not null')) + ) ) ->addAttributeToSort('news_from_date','desc') ->addAttributeToSelect(array('name', 'short_description', 'description', 'thumbnail'), 'inner') diff --git a/app/code/core/Mage/Rss/Block/Catalog/NotifyStock.php b/app/code/core/Mage/Rss/Block/Catalog/NotifyStock.php index b2f824d6dc..106e7e5090 100644 --- a/app/code/core/Mage/Rss/Block/Catalog/NotifyStock.php +++ b/app/code/core/Mage/Rss/Block/Catalog/NotifyStock.php @@ -64,9 +64,7 @@ protected function _construct() protected function _toHtml() { $newUrl = Mage::getUrl('rss/catalog/notifystock'); - /* @var $helper Mage_Rss_Helper_Data */ - $helper = Mage::helper('rss'); - $title = $helper->__('Low Stock Products'); + $title = Mage::helper('rss')->__('Low Stock Products'); $rssObj = Mage::getModel('rss/rss'); $data = array( @@ -81,7 +79,7 @@ protected function _toHtml() Mage_CatalogInventory_Model_Stock_Item::XML_PATH_MANAGE_STOCK); $globalNotifyStockQty = (float) Mage::getStoreConfig( Mage_CatalogInventory_Model_Stock_Item::XML_PATH_NOTIFY_STOCK_QTY); - $helper->disableFlat(); + Mage::helper('rss')->disableFlat(); /* @var $product Mage_Catalog_Model_Product */ $product = Mage::getModel('catalog/product'); /* @var $collection Mage_Catalog_Model_Resource_Product_Collection */ diff --git a/app/code/core/Mage/Rss/Block/Catalog/Review.php b/app/code/core/Mage/Rss/Block/Catalog/Review.php index 456cd3cf09..006caad9a0 100644 --- a/app/code/core/Mage/Rss/Block/Catalog/Review.php +++ b/app/code/core/Mage/Rss/Block/Catalog/Review.php @@ -64,10 +64,8 @@ protected function _construct() protected function _toHtml() { $newUrl = Mage::getUrl('rss/catalog/review'); - /* @var $helper Mage_Rss_Helper_Data */ - $helper = Mage::helper('rss'); - $title = $helper->__('Pending product review(s)'); - $helper->disableFlat(); + $title = Mage::helper('rss')->__('Pending product review(s)'); + Mage::helper('rss')->disableFlat(); $rssObj = Mage::getModel('rss/rss'); $data = array( diff --git a/app/code/core/Mage/Rss/Block/Wishlist.php b/app/code/core/Mage/Rss/Block/Wishlist.php index cd93335c25..9f57d8bd51 100644 --- a/app/code/core/Mage/Rss/Block/Wishlist.php +++ b/app/code/core/Mage/Rss/Block/Wishlist.php @@ -110,33 +110,32 @@ protected function _toHtml() 'language' => $lang )); - /** @var $product Mage_Wishlist_Model_Item*/ - foreach ($this->getWishlistItems() as $product) { + /** @var $wishlistItem Mage_Wishlist_Model_Item*/ + foreach ($this->getWishlistItems() as $wishlistItem) { + /* @var $product Mage_Catalog_Model_Product */ + $product = $wishlistItem->getProduct(); $productUrl = $this->getProductUrl($product); - - /* @var $wishlistProduct Mage_Catalog_Model_Product */ - $wishlistProduct = $product->getProduct(); - $wishlistProduct->setAllowedInRss(true); - $wishlistProduct->setAllowedPriceInRss(true); - $wishlistProduct->setProductUrl($productUrl); - $args = array('product'=>$wishlistProduct); + $product->setAllowedInRss(true); + $product->setAllowedPriceInRss(true); + $product->setProductUrl($productUrl); + $args = array('product' => $product); Mage::dispatchEvent('rss_wishlist_xml_callback', $args); - if (!$wishlistProduct->getAllowedInRss()) { + if (!$product->getAllowedInRss()) { continue; } $description = '' . ' + + XOF + KG + CM + Togo + + + + TJS + KG + CM + AP + Tajikistan + + + USD + KG + CM + East Timor + + + TND + KG + CM + Tunisia + + + TOP + KG + CM + Tonga + + + TRY + KG + CM + AP + Turkey + + + TTD + KG + CM + AM + Trinidad and Tobago + + + AUD + KG + CM + Tuvalu + + + TWD + KG + CM + AP + Taiwan + + + TZS + KG + CM + Tanzania + + + UAH + KG + CM + AP + Ukraine + + + UGX + KG + CM + Uganda + + + USD + LB + IN + AM + United States Of America + + + UYU + KG + CM + AM + Uruguay + + + UZS + KG + CM + AP + Uzbekistan + + + XCD + KG + CM + AM + St. Vincent + + + VEF + KG + CM + AM + Venezuela + + + USD + KG + CM + AM + Virgin Islands (British) + + + USD + LB + IN + Virgin Islands (US) + + + VND + KG + CM + AP + Vietnam + + + VUV + KG + CM + Vanuatu + + + WST + KG + CM + Samoa + + + EUR + KG + CM + Bonaire + + + EUR + KG + CM + AM + Curacao + + + ANG + KG + CM + St. Eustatius + + + EUR + KG + CM + AM + St. Maarten + + + XCD + KG + CM + AM + Nevis + + + SIS + KG + CM + Somaliland, Rep of (North Somalia) + + + ANG + KG + CM + AM + St. Barthelemy + + + YER + KG + CM + AP + Yemen, Republic of + + + EUR + KG + CM + Mayotte + + + ZAR + KG + CM + AP + South Africa + + + ZMK + KG + CM + Zambia + + + ZWD + KG + CM + Zimbabwe + + diff --git a/app/code/core/Mage/Usa/etc/system.xml b/app/code/core/Mage/Usa/etc/system.xml index eecf43971d..613205f3f2 100644 --- a/app/code/core/Mage/Usa/etc/system.xml +++ b/app/code/core/Mage/Usa/etc/system.xml @@ -30,7 +30,7 @@ - + text 130 1 @@ -215,7 +215,7 @@ 1 1 0 - 0 + <label>Title</label> <frontend_type>text</frontend_type> @@ -801,7 +801,7 @@ <show_in_website>1</show_in_website> <show_in_store>0</show_in_store> </type> - <unit_of_measure translate="label"> + <unit_of_measure translate="label comment"> <label>Weight Unit</label> <frontend_type>select</frontend_type> <source_model>usa/shipping_carrier_ups_source_unitofmeasure</source_model> @@ -811,7 +811,7 @@ <show_in_store>0</show_in_store> </unit_of_measure> <username translate="label"> - <label>UserId</label> + <label>User ID</label> <frontend_type>obscure</frontend_type> <backend_model>adminhtml/system_config_backend_encrypted</backend_model> <sort_order>30</sort_order> @@ -1146,8 +1146,287 @@ 0</sort_order> </fields> </usps> + <dhlint translate="label" module="usa"> + <label>DHL</label> + <frontend_type>text</frontend_type> + <sort_order>140</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>1</show_in_store> + <fields> + <active translate="label"> + <label>Enabled for Checkout</label> + <frontend_type>select</frontend_type> + <source_model>adminhtml/system_config_source_yesno</source_model> + <sort_order>10</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + </active> + <gateway_url translate="label"> + <label>Gateway URL</label> + <frontend_type>text</frontend_type> + <sort_order>20</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + </gateway_url> + <title translate="label"> + <label>Title</label> + <frontend_type>text</frontend_type> + <sort_order>20</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>1</show_in_store> + + + + obscure + adminhtml/system_config_backend_encrypted + 50 + 1 + 1 + 0 + + + + obscure + adminhtml/system_config_backend_encrypted + 60 + 1 + 1 + 0 + + + + text + 70 + 1 + 1 + 0 + + + + select + usa/shipping_carrier_dhl_international_source_contenttype + 90 + 1 + 1 + 0 + + + + select + shipping/source_handlingType + 100 + 1 + 1 + 0 + + + + "Per Order" allows single handling fee for entire order. "Per Package" allows individual handling fee for each package. + select + shipping/source_handlingAction + 110 + 1 + 1 + 0 + + + + text + 120 + 1 + 1 + 0 + + + + Allows breaking total order weight into smaller pieces if it exeeds 70 kg to ensure accurate calculation of shipping charges. + select + adminhtml/system_config_source_yesno + 130 + 1 + 1 + 1 + + + + select + usa/shipping_carrier_dhl_international_source_method_unitofmeasure + usa/adminhtml_dhl_unitofmeasure + 140 + 1 + 1 + 1 + + + + select + usa/shipping_carrier_dhl_international_source_method_size + 150 + 1 + 1 + 1 + + + + text + 151 + 1 + 1 + 1 + 1 + + + + text + 152 + 1 + 1 + 1 + 1 + + + + text + 153 + 1 + 1 + 1 + 1 + + + + multiselect + usa/shipping_carrier_dhl_international_source_method_doc + 170 + 1 + 1 + 0 + D + + + + multiselect + usa/shipping_carrier_dhl_international_source_method_nondoc + 170 + 1 + 1 + 0 + N + + + + Package ready time after order submission (in hours) + text + 180 + 1 + 1 + 0 + + + + textarea + 800 + 1 + 1 + 1 + + + + + select + free-method + usa/shipping_carrier_dhl_international_source_method_freedoc + 1200 + 1 + 1 + 0 + D + + + + select + free-method + usa/shipping_carrier_dhl_international_source_method_freenondoc + 1200 + 1 + 1 + 0 + N + + + + select + adminhtml/system_config_source_enabledisable + 1210 + 1 + 1 + 0 + + + + text + 1220 + 1 + 1 + 0 + + + + select + 1900 + shipping-applicable-country + adminhtml/system_config_source_shipping_allspecificcountries + 1 + 1 + 0 + + + + multiselect + 1910 + adminhtml/system_config_source_country + 1 + 1 + 0 + 1 + + + + select + 1940 + shipping-skip-hide + adminhtml/system_config_source_yesno + 1 + 1 + 0 + + + + text + 2000 + 1 + 1 + 0 + + + + select + adminhtml/system_config_source_yesno + 1950 + 1 + 1 + 0 + + + - diff --git a/app/code/core/Mage/Weee/Helper/Data.php b/app/code/core/Mage/Weee/Helper/Data.php index 2e63651966..4f119e59d9 100644 --- a/app/code/core/Mage/Weee/Helper/Data.php +++ b/app/code/core/Mage/Weee/Helper/Data.php @@ -26,6 +26,10 @@ /** * WEEE data helper + * + * @category Mage + * @package Mage_Weee + * @author Magento Core Team */ class Mage_Weee_Helper_Data extends Mage_Core_Helper_Abstract { @@ -130,9 +134,17 @@ public function getAmount($product, $shipping = null, $billing = null, $website return 0; } + /** + * Returns diaplay type for price accordingly to current zone + * + * @param Mage_Catalog_Model_Product $product + * @param array|null $compareTo + * @param string $zone + * @param Mage_Core_Model_Store $store + * @return bool|int + */ public function typeOfDisplay($product, $compareTo = null, $zone = null, $store = null) { - $type = 0; if (!$this->isEnabled($store)) { return false; } @@ -169,6 +181,16 @@ public function typeOfDisplay($product, $compareTo = null, $zone = null, $store } } + /** + * Proxy for Mage_Weee_Model_Tax::getProductWeeeAttributes() + * + * @param Mage_Catalog_Model_Product $product + * @param null|false|Varien_Object $shipping + * @param null|false|Varien_Object $billing + * @param Mage_Core_Model_Website $website + * @param bool $calculateTaxes + * @return array + */ public function getProductWeeeAttributes($product, $shipping = null, $billing = null, $website = null, $calculateTaxes = false) { @@ -176,6 +198,12 @@ public function getProductWeeeAttributes($product, $shipping = null, $billing = ->getProductWeeeAttributes($product, $shipping, $billing, $website, $calculateTaxes); } + /** + * Returns applied weee taxes + * + * @param Mage_Sales_Model_Quote_Item_Abstract $item + * @return array + */ public function getApplied($item) { if ($item instanceof Mage_Sales_Model_Quote_Item_Abstract) { @@ -202,12 +230,25 @@ public function getApplied($item) return unserialize($item->getWeeeTaxApplied()); } + /** + * Sets applied weee taxes + * + * @param Mage_Sales_Model_Quote_Item_Abstract $item + * @param array $value + * @return Mage_Weee_Helper_Data + */ public function setApplied($item, $value) { $item->setWeeeTaxApplied(serialize($value)); return $this; } + /** + * Returns array of weee attributes allowed for display + * + * @param Mage_Catalog_Model_Product $product + * @return array + */ public function getProductWeeeAttributesForDisplay($product) { if ($this->isEnabled()) { @@ -241,6 +282,12 @@ public function getProductWeeeAttributesForRenderer($product, $shipping = null, return array(); } + /** + * Returns amount to display + * + * @param Mage_Catalog_Model_Product $product + * @return int + */ public function getAmountForDisplay($product) { if ($this->isEnabled()) { @@ -250,6 +297,12 @@ public function getAmountForDisplay($product) return 0; } + /** + * Returns original amount + * + * @param Mage_Catalog_Model_Product $product + * @return int + */ public function getOriginalAmount($product) { if ($this->isEnabled()) { @@ -258,15 +311,24 @@ public function getOriginalAmount($product) return 0; } + /** + * Adds HTML containers and formats tier prices accordingly to the currency used + * + * @param Mage_Catalog_Model_Product $product + * @param array $tierPrices + * @return Mage_Weee_Helper_Data + */ public function processTierPrices($product, &$tierPrices) { $weeeAmount = $this->getAmountForDisplay($product); $store = Mage::app()->getStore(); - foreach ($tierPrices as &$tier) { - $tier['formated_price_incl_weee'] = $store->formatPrice($store - ->convertPrice(Mage::helper('tax')->getPrice($product, $tier['website_price'], true)+$weeeAmount)); - $tier['formated_price_incl_weee_only'] = $store->formatPrice($store - ->convertPrice(Mage::helper('tax')->getPrice($product, $tier['website_price'])+$weeeAmount)); + foreach ($tierPrices as $index => &$tier) { + $html = $store->formatPrice($store->convertPrice( + Mage::helper('tax')->getPrice($product, $tier['website_price'], true)+$weeeAmount), false); + $tier['formated_price_incl_weee'] = '' . $html . ''; + $html = $store->formatPrice($store->convertPrice( + Mage::helper('tax')->getPrice($product, $tier['website_price'])+$weeeAmount), false); + $tier['formated_price_incl_weee_only'] = '' . $html . ''; $tier['formated_weee'] = $store->formatPrice($store->convertPrice($weeeAmount)); } return $this; @@ -275,6 +337,7 @@ public function processTierPrices($product, &$tierPrices) /** * Check if fixed taxes are used in system * + * @param Mage_Core_Model_Store $store * @return bool */ public function isEnabled($store = null) diff --git a/app/code/core/Mage/Weee/Model/Observer.php b/app/code/core/Mage/Weee/Model/Observer.php index 1921d0ddd2..d7bbc01843 100644 --- a/app/code/core/Mage/Weee/Model/Observer.php +++ b/app/code/core/Mage/Weee/Model/Observer.php @@ -120,7 +120,7 @@ public function prepareCatalogIndexSelect(Varien_Event_Observer $observer) $fieldAlias = sprintf('weee_%s_table.value', $attribute); $checkAdditionalCalculation = $select->getAdapter()->getCheckSql("{$fieldAlias} IS NULL", 0, $fieldAlias); if (Mage::helper('weee')->isDiscounted()) { - $additionalCalculations[] = sprintf('+(%s*(1-(%s/100))', $checkAdditionalCalculation, $checkDiscountField); + $additionalCalculations[] = sprintf('+(%s*(1-(%s/100)))', $checkAdditionalCalculation, $checkDiscountField); } else { $additionalCalculations[] = "+($checkAdditionalCalculation)"; } diff --git a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Chooser.php b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Chooser.php index a84f0d8af6..9b5f279c42 100644 --- a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Chooser.php +++ b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Chooser.php @@ -180,13 +180,23 @@ protected function _toHtml() - + '; } } diff --git a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Layout.php b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Layout.php index ebf98c74f0..60144db9c1 100644 --- a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Layout.php +++ b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Layout.php @@ -128,7 +128,8 @@ protected function _toHtml() ->setName($this->getSelectName()) ->setId('layout_handle') ->setClass('required-entry select') - ->setExtraParams("onchange=\"WidgetInstance.loadSelectBoxByType(\'block_reference\', this.up(\'div.pages\'), this.value)\"") + ->setExtraParams("onchange=\"WidgetInstance.loadSelectBoxByType(\'block_reference\', " . + "this.up(\'div.pages\'), this.value)\"") ->setOptions($this->getLayoutHandles( $this->getArea(), $this->getPackage(), @@ -166,7 +167,9 @@ protected function _collectLayoutHandles($layoutHandles) foreach ($layoutHandlesArr as $node) { if ($this->_filterLayoutHandle($node->getName())) { $helper = Mage::helper(Mage_Core_Model_Layout::findTranslationModuleName($node)); - $this->_layoutHandles[$node->getName()] = $helper->__((string)$node->label); + $this->_layoutHandles[$node->getName()] = $this->helper('core')->jsQuoteEscape( + $helper->__((string)$node->label) + ); } } asort($this->_layoutHandles, SORT_STRING); diff --git a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Main/Layout.php b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Main/Layout.php index 6797219574..9bcfe2f7f6 100644 --- a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Main/Layout.php +++ b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Main/Layout.php @@ -150,45 +150,45 @@ protected function _getDisplayOnOptions() $options = array(); $options[] = array( 'value' => '', - 'label' => Mage::helper('widget')->__('-- Please Select --') + 'label' => $this->helper('core')->jsQuoteEscape(Mage::helper('widget')->__('-- Please Select --')) ); $options[] = array( 'label' => Mage::helper('widget')->__('Categories'), 'value' => array( array( 'value' => 'anchor_categories', - 'label' => Mage::helper('widget')->__('Anchor Categories') + 'label' => $this->helper('core')->jsQuoteEscape(Mage::helper('widget')->__('Anchor Categories')) ), array( 'value' => 'notanchor_categories', - 'label' => Mage::helper('widget')->__('Non-Anchor Categories') + 'label' => $this->helper('core')->jsQuoteEscape(Mage::helper('widget')->__('Non-Anchor Categories')) ) ) ); foreach (Mage_Catalog_Model_Product_Type::getTypes() as $typeId => $type) { $productsOptions[] = array( 'value' => $typeId.'_products', - 'label' => $type['label'] + 'label' => $this->helper('core')->jsQuoteEscape($type['label']) ); } array_unshift($productsOptions, array( 'value' => 'all_products', - 'label' => Mage::helper('widget')->__('All Product Types') + 'label' => $this->helper('core')->jsQuoteEscape(Mage::helper('widget')->__('All Product Types')) )); $options[] = array( - 'label' => Mage::helper('widget')->__('Products'), + 'label' => $this->helper('core')->jsQuoteEscape(Mage::helper('widget')->__('Products')), 'value' => $productsOptions ); $options[] = array( - 'label' => Mage::helper('widget')->__('Generic Pages'), + 'label' => $this->helper('core')->jsQuoteEscape(Mage::helper('widget')->__('Generic Pages')), 'value' => array( array( 'value' => 'all_pages', - 'label' => Mage::helper('widget')->__('All Pages') + 'label' => $this->helper('core')->jsQuoteEscape(Mage::helper('widget')->__('All Pages')) ), array( 'value' => 'pages', - 'label' => Mage::helper('widget')->__('Specified Page') + 'label' => $this->helper('core')->jsQuoteEscape(Mage::helper('widget')->__('Specified Page')) ) ) ); @@ -281,7 +281,7 @@ public function getRemoveLayoutButtonHtml() { $button = $this->getLayout()->createBlock('adminhtml/widget_button') ->setData(array( - 'label' => Mage::helper('widget')->__('Remove Layout Update'), + 'label' => $this->helper('core')->jsQuoteEscape(Mage::helper('widget')->__('Remove Layout Update')), 'onclick' => 'WidgetInstance.removePageGroup(this)', 'class' => 'delete' )); diff --git a/app/code/core/Mage/Widget/Model/Resource/Widget/Instance/Collection.php b/app/code/core/Mage/Widget/Model/Resource/Widget/Instance/Collection.php index cc78826856..00d1567a03 100755 --- a/app/code/core/Mage/Widget/Model/Resource/Widget/Instance/Collection.php +++ b/app/code/core/Mage/Widget/Model/Resource/Widget/Instance/Collection.php @@ -34,6 +34,14 @@ */ class Mage_Widget_Model_Resource_Widget_Instance_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract { + /** + * Fields map for corellation names & real selected fields + * + * @var array + */ + protected $_map = array('fields' => array('type' => 'instance_type')); + + /** * Constructor * diff --git a/app/code/core/Mage/Widget/controllers/Adminhtml/Widget/InstanceController.php b/app/code/core/Mage/Widget/controllers/Adminhtml/Widget/InstanceController.php index f77bd1873e..4f1de1a2aa 100644 --- a/app/code/core/Mage/Widget/controllers/Adminhtml/Widget/InstanceController.php +++ b/app/code/core/Mage/Widget/controllers/Adminhtml/Widget/InstanceController.php @@ -62,7 +62,7 @@ protected function _initAction() /** * Init widget instance object and set it to registry * - * @return age_Widget_Model_Widget_Instance|boolean + * @return Mage_Widget_Model_Widget_Instance|boolean */ protected function _initWidgetInstance() { diff --git a/app/code/core/Mage/Wishlist/Block/Share/Email/Items.php b/app/code/core/Mage/Wishlist/Block/Share/Email/Items.php index 020ff01e6a..1b60b3cf0e 100644 --- a/app/code/core/Mage/Wishlist/Block/Share/Email/Items.php +++ b/app/code/core/Mage/Wishlist/Block/Share/Email/Items.php @@ -70,4 +70,19 @@ public function getAddToCartUrl($product, $additional = array()) $additional['_store_to_url'] = true; return parent::getAddToCartUrl($product, $additional); } + + /** + * Check whether whishlist item has description + * + * @param Mage_Wishlist_Model_Item $item + * @return bool + */ + public function hasDescription($item) + { + $hasDescription = parent::hasDescription($item); + if ($hasDescription) { + return ($item->getDescription() !== Mage::helper('wishlist')->defaultCommentString()); + } + return $hasDescription; + } } diff --git a/app/code/core/Mage/Wishlist/controllers/IndexController.php b/app/code/core/Mage/Wishlist/controllers/IndexController.php index db76caa080..37c97c554e 100644 --- a/app/code/core/Mage/Wishlist/controllers/IndexController.php +++ b/app/code/core/Mage/Wishlist/controllers/IndexController.php @@ -193,7 +193,7 @@ public function addAction() Mage::helper('wishlist')->calculate(); - $message = $this->__('%1$s has been added to your wishlist. Click here to continue shopping', $product->getName(), $referer); + $message = $this->__('%1$s has been added to your wishlist. Click here to continue shopping', $product->getName(), Mage::helper('core')->escapeUrl($referer)); $session->addSuccess($message); } catch (Mage_Core_Exception $e) { @@ -552,6 +552,7 @@ public function sendAction() /* @var $emailModel Mage_Core_Model_Email_Template */ $emailModel = Mage::getModel('core/email_template'); + $sharingCode = $wishlist->getSharingCode(); foreach($emails as $email) { $emailModel->sendTransactional( Mage::getStoreConfig('wishlist/email/email_template'), @@ -562,8 +563,8 @@ public function sendAction() 'customer' => $customer, 'salable' => $wishlist->isSalable() ? 'yes' : '', 'items' => $wishlistBlock, - 'addAllLink' => Mage::getUrl('*/shared/allcart', array('code' => $wishlist->getSharingCode())), - 'viewOnSiteLink'=> Mage::getUrl('*/shared/index', array('code' => $wishlist->getSharingCode())), + 'addAllLink' => Mage::getUrl('*/shared/allcart', array('code' => $sharingCode)), + 'viewOnSiteLink'=> Mage::getUrl('*/shared/index', array('code' => $sharingCode)), 'message' => $message ) ); diff --git a/app/code/core/Mage/XmlConnect/Block/Cart.php b/app/code/core/Mage/XmlConnect/Block/Cart.php index a86f34f78b..b126dc84b4 100644 --- a/app/code/core/Mage/XmlConnect/Block/Cart.php +++ b/app/code/core/Mage/XmlConnect/Block/Cart.php @@ -61,7 +61,7 @@ protected function _toHtml() $itemXml->addChild('entity_id', $item->getProduct()->getId()); $itemXml->addChild('entity_type', $type); $itemXml->addChild('item_id', $item->getId()); - $itemXml->addChild('name', $xmlObject->xmlentities($renderer->getProductName())); + $itemXml->addChild('name', $xmlObject->escapeXml($renderer->getProductName())); $itemXml->addChild('code', 'cart[' . $item->getId() . '][qty]'); $itemXml->addChild('qty', $renderer->getQty()); $icon = $renderer->getProductThumbnail()->resize( @@ -190,27 +190,27 @@ protected function _toHtml() /** * Options list */ - if ($_options = $renderer->getOptionList()) { + $_options = $renderer->getOptionList(); + if ($_options) { $itemOptionsXml = $itemXml->addChild('options'); foreach ($_options as $_option) { $_formattedOptionValue = $renderer->getFormatedOptionValue($_option); $optionXml = $itemOptionsXml->addChild('option'); $optionXml->addAttribute('label', $xmlObject->xmlAttribute($_option['label'])); - $optionXml->addAttribute( - 'text', $xmlObject->xmlAttribute(strip_tags($_formattedOptionValue['value'])) - ); + $optionXml->addAttribute('text', $xmlObject->xmlAttribute($_formattedOptionValue['value'])); } } /** * Item messages */ - if ($messages = $renderer->getMessages()) { + $messages = $renderer->getMessages(); + if ($messages) { $itemMessagesXml = $itemXml->addChild('messages'); foreach ($messages as $message) { $messageXml = $itemMessagesXml->addChild('option'); $messageXml->addChild('type', $message['type']); - $messageXml->addChild('text', $xmlObject->xmlentities($message['text'])); + $messageXml->addChild('text', $xmlObject->escapeXml($message['text'])); } } } diff --git a/app/code/core/Mage/XmlConnect/Block/Cart/Crosssell.php b/app/code/core/Mage/XmlConnect/Block/Cart/Crosssell.php index ed5f40b6aa..ed7bc5e15c 100644 --- a/app/code/core/Mage/XmlConnect/Block/Cart/Crosssell.php +++ b/app/code/core/Mage/XmlConnect/Block/Cart/Crosssell.php @@ -55,7 +55,7 @@ protected function _toHtml() /** @var $product Mage_Catalog_Model_Product */ foreach ($this->getItems() as $product) { $itemXmlObj = $crossSellXmlObj->addChild('item'); - $itemXmlObj->addChild('name', $crossSellXmlObj->xmlentities($product->getName())); + $itemXmlObj->addChild('name', $crossSellXmlObj->escapeXml($product->getName())); $icon = $this->helper('catalog/image')->init($product, 'thumbnail') ->resize(Mage::helper('xmlconnect/image')->getImageSizeForContent('product_small')); @@ -70,12 +70,13 @@ protected function _toHtml() /** * If product type is grouped than it has options as its grouped items */ - if ($product->getTypeId() == Mage_Catalog_Model_Product_Type_Grouped::TYPE_CODE) { + if ($product->getTypeId() == Mage_Catalog_Model_Product_Type_Grouped::TYPE_CODE + || $product->getTypeId() == Mage_Catalog_Model_Product_Type_Configurable::TYPE_CODE) { $product->setHasOptions(true); } $itemXmlObj->addChild('has_options', (int)$product->getHasOptions()); - $itemXmlObj->addChild('in_stock', (int)$product->getIsInStock()); + $itemXmlObj->addChild('in_stock', (int)$product->getStockItem()->getIsInStock()); if ($product->getTypeId() == Mage_Downloadable_Model_Product_Type::TYPE_DOWNLOADABLE) { $itemXmlObj->addChild('is_salable', 0); } else { diff --git a/app/code/core/Mage/XmlConnect/Block/Cart/Item/Renderer.php b/app/code/core/Mage/XmlConnect/Block/Cart/Item/Renderer.php index 3a6f0f2c15..3ab6f66d0a 100644 --- a/app/code/core/Mage/XmlConnect/Block/Cart/Item/Renderer.php +++ b/app/code/core/Mage/XmlConnect/Block/Cart/Item/Renderer.php @@ -92,7 +92,7 @@ protected function _addSubtotalToXmlObj(Mage_XmlConnect_Model_Simplexml_Element $exclPrice = $_item->getRowTotal(); } $exclPrice = $this->_formatPrice($exclPrice); - $subtotalXmlObj->addAttribute('excluding_tax', $subtotalXmlObj->xmlentities($exclPrice)); + $subtotalXmlObj->addAttribute('excluding_tax', $subtotalXmlObj->escapeXml($exclPrice)); } if ($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()) { @@ -107,7 +107,7 @@ protected function _addSubtotalToXmlObj(Mage_XmlConnect_Model_Simplexml_Element } $inclPrice = $this->_formatPrice($inclPrice); - $subtotalXmlObj->addAttribute('including_tax', $subtotalXmlObj->xmlentities($inclPrice)); + $subtotalXmlObj->addAttribute('including_tax', $subtotalXmlObj->escapeXml($inclPrice)); } if (Mage::helper('weee')->getApplied($_item)) { @@ -152,7 +152,7 @@ protected function _addPriceToXmlObj(Mage_XmlConnect_Model_Simplexml_Element $pr } $exclPrice = $this->_formatPrice($exclPrice); - $priceXmlObj->addAttribute('excluding_tax', $priceXmlObj->xmlentities($exclPrice)); + $priceXmlObj->addAttribute('excluding_tax', $priceXmlObj->escapeXml($exclPrice)); } if ($this->helper('tax')->displayCartPriceInclTax() @@ -169,7 +169,7 @@ protected function _addPriceToXmlObj(Mage_XmlConnect_Model_Simplexml_Element $pr } $inclPrice = $this->_formatPrice($inclPrice); - $priceXmlObj->addAttribute('including_tax', $priceXmlObj->xmlentities($inclPrice)); + $priceXmlObj->addAttribute('including_tax', $priceXmlObj->escapeXml($inclPrice)); } if (Mage::helper('weee')->getApplied($_item)) { @@ -240,10 +240,7 @@ protected function _addWeeeToXmlObj(Mage_XmlConnect_Model_Simplexml_Element $pri } $totalExcl = $this->_formatPrice($totalExcl); - $priceXmlObj->addAttribute( - 'total_excluding_tax', - $priceXmlObj->xmlentities($totalExcl) - ); + $priceXmlObj->addAttribute('total_excluding_tax', $priceXmlObj->escapeXml($totalExcl)); } if ($typeOfDisplay2 && $_item->getWeeeTaxAppliedAmount()) { @@ -254,7 +251,7 @@ protected function _addWeeeToXmlObj(Mage_XmlConnect_Model_Simplexml_Element $pri } $totalIncl = $this->_formatPrice($totalIncl); - $priceXmlObj->addAttribute('total_including_tax', $priceXmlObj->xmlentities($totalIncl)); + $priceXmlObj->addAttribute('total_including_tax', $priceXmlObj->escapeXml($totalIncl)); } return $priceXmlObj; diff --git a/app/code/core/Mage/XmlConnect/Block/Cart/Totals.php b/app/code/core/Mage/XmlConnect/Block/Cart/Totals.php index 19d4819eeb..67c786c5b7 100644 --- a/app/code/core/Mage/XmlConnect/Block/Cart/Totals.php +++ b/app/code/core/Mage/XmlConnect/Block/Cart/Totals.php @@ -112,7 +112,7 @@ protected function _toHtml() $title = $this->__('Gift Card (%s)', $cardCode['c']); $value = $cardCode['c']; $totalXmlObj = $totalsXmlObj->addChild($code); - $totalXmlObj->addChild('title', $totalsXmlObj->xmlentities($title)); + $totalXmlObj->addChild('title', $totalsXmlObj->escapeXml($title)); $totalXmlObj->addChild('value', $value); $value = Mage::helper('xmlconnect')->formatPriceForXml($cardCode['a']); $formattedValue = $this->getQuote()->getStore()->formatPrice($value, false); @@ -149,7 +149,7 @@ protected function _addTotalDataToXmlObj($totalsXmlObj, $code, $title, $value) { $value = Mage::helper('xmlconnect')->formatPriceForXml($value); $totalXmlObj = $totalsXmlObj->addChild($code); - $totalXmlObj->addChild('title', $totalsXmlObj->xmlentities($title)); + $totalXmlObj->addChild('title', $totalsXmlObj->escapeXml($title)); $formattedValue = $this->getQuote()->getStore()->formatPrice($value, false); $totalXmlObj->addChild('value', $value); $totalXmlObj->addChild('formated_value', $formattedValue); diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog.php b/app/code/core/Mage/XmlConnect/Block/Catalog.php index 54e8b01832..91399be2a9 100644 --- a/app/code/core/Mage/XmlConnect/Block/Catalog.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog.php @@ -67,7 +67,7 @@ public function getProductSortFeildsXmlObject() $item->addAttribute('isDefault', 1); } $item->addChild('code', $code); - $item->addChild('name', $ordersXmlObject->xmlentities(strip_tags($name))); + $item->addChild('name', $ordersXmlObject->escapeXml($name)); } return $ordersXmlObject; diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Category.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Category.php index eb5aa2c9cf..28bd9e207a 100644 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Category.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Category.php @@ -78,7 +78,7 @@ protected function _toHtml() $item = Mage::getModel('catalog/category')->load($item->getId()); $itemXmlObj = $itemsXmlObj->addChild('item'); - $itemXmlObj->addChild('label', $categoryXmlObj->xmlentities($item->getName())); + $itemXmlObj->addChild('label', $categoryXmlObj->escapeXml($item->getName())); $itemXmlObj->addChild('entity_id', $item->getId()); $itemXmlObj->addChild('content_type', $item->hasChildren() ? 'categories' : 'products'); if (!is_null($categoryId)) { diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Category/Info.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Category/Info.php index ba74afce1e..9d24ae57be 100644 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Category/Info.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Category/Info.php @@ -50,7 +50,7 @@ public function getCategoryInfoXmlObject() */ $title = $this->__('Shop'); if ($category->getParentCategory()->getLevel() > 1) { - $title = $infoXmlObj->xmlentities($category->getParentCategory()->getName()); + $title = $infoXmlObj->escapeXml($category->getParentCategory()->getName()); } $infoXmlObj->addChild('parent_title', $title); diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Filters.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Filters.php index cb72d40270..dadbce1c4b 100644 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Filters.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Filters.php @@ -50,14 +50,14 @@ protected function _toHtml() continue; } $itemXmlObj = $filtersXmlObj->addChild('item'); - $itemXmlObj->addChild('name', $categoryXmlObj->xmlentities($item->getName())); - $itemXmlObj->addChild('code', $categoryXmlObj->xmlentities($item->getCode())); + $itemXmlObj->addChild('name', $categoryXmlObj->escapeXml($item->getName())); + $itemXmlObj->addChild('code', $categoryXmlObj->escapeXml($item->getCode())); $valuesXmlObj = $itemXmlObj->addChild('values'); foreach ($item->getValues() as $value) { $valueXmlObj = $valuesXmlObj->addChild('value'); - $valueXmlObj->addChild('id', $categoryXmlObj->xmlentities($value->getValueString())); - $valueXmlObj->addChild('label', $categoryXmlObj->xmlentities(strip_tags($value->getLabel()))); + $valueXmlObj->addChild('id', $categoryXmlObj->escapeXml($value->getValueString())); + $valueXmlObj->addChild('label', $categoryXmlObj->escapeXml($value->getLabel())); $valueXmlObj->addChild('count', (int)$value->getProductsCount()); } } diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Product.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Product.php index 701afbdd90..095e01bf86 100644 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Product.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Product.php @@ -46,9 +46,9 @@ public function productToXmlObject(Mage_Catalog_Model_Product $product, $itemNod $item = Mage::getModel('xmlconnect/simplexml_element', '<' . $itemNodeName . '>'); if ($product && $product->getId()) { $item->addChild('entity_id', $product->getId()); - $item->addChild('name', $item->xmlentities($product->getName())); + $item->addChild('name', $item->escapeXml($product->getName())); $item->addChild('entity_type', $product->getTypeId()); - $item->addChild('short_description', $item->xmlentities($product->getShortDescription())); + $item->addChild('short_description', $item->escapeXml($product->getShortDescription())); $description = Mage::helper('xmlconnect')->htmlize($item->xmlentities($product->getDescription())); $item->addChild('description', $description); $item->addChild('link', $product->getProductUrl()); @@ -81,7 +81,8 @@ public function productToXmlObject(Mage_Catalog_Model_Product $product, $itemNod /** * If product type is grouped than it has options as its grouped items */ - if ($product->getTypeId() == Mage_Catalog_Model_Product_Type_Grouped::TYPE_CODE) { + if ($product->getTypeId() == Mage_Catalog_Model_Product_Type_Grouped::TYPE_CODE + || $product->getTypeId() == Mage_Catalog_Model_Product_Type_Configurable::TYPE_CODE) { $product->setHasOptions(true); } $item->addChild('has_options', (int)$product->getHasOptions()); diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options.php index 1d159608b7..7d276e29cf 100644 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options.php @@ -87,7 +87,7 @@ public function getProductCustomOptionsXmlObject(Mage_Catalog_Model_Product $pro } $optionNode->addAttribute('code', $code); $optionNode->addAttribute('type', $type); - $optionNode->addAttribute('label', $xmlModel->xmlentities($option->getTitle())); + $optionNode->addAttribute('label', $xmlModel->escapeXml($option->getTitle())); if ($option->getIsRequire()) { $optionNode->addAttribute('is_required', 1); } @@ -105,7 +105,7 @@ public function getProductCustomOptionsXmlObject(Mage_Catalog_Model_Product $pro foreach ($option->getValues() as $value) { $valueNode = $optionNode->addChild('value'); $valueNode->addAttribute('code', $value->getId()); - $valueNode->addAttribute('label', $xmlModel->xmlentities($value->getTitle())); + $valueNode->addAttribute('label', $xmlModel->escapeXml($value->getTitle())); if ($value->getPrice() != 0) { $price = Mage::helper('xmlconnect')->formatPriceForXml($value->getPrice()); diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Bundle.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Bundle.php index 94ed27c17c..690021844b 100644 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Bundle.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Bundle.php @@ -80,7 +80,7 @@ public function getProductOptionsXml(Mage_Catalog_Model_Product $product, $isObj } $optionNode->addAttribute('code', $code); $optionNode->addAttribute('type', $type); - $optionNode->addAttribute('label', $optionsXmlObj->xmlentities($_option->getTitle())); + $optionNode->addAttribute('label', $optionsXmlObj->escapeXml($_option->getTitle())); if ($_option->getRequired()) { $optionNode->addAttribute('is_required', 1); } @@ -93,7 +93,7 @@ public function getProductOptionsXml(Mage_Catalog_Model_Product $product, $isObj $valueNode = $optionNode->addChild('value'); $valueNode->addAttribute('code', $_selection->getSelectionId()); - $valueNode->addAttribute('label', $optionsXmlObj->xmlentities($_selection->getName())); + $valueNode->addAttribute('label', $optionsXmlObj->escapeXml($_selection->getName())); if (!$_option->isMultiSelection()) { if ($_selection->getSelectionCanChangeQty()) { $valueNode->addAttribute('is_qty_editable', 1); diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Configurable.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Configurable.php index cbaaa866af..6edc281770 100644 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Configurable.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Configurable.php @@ -131,13 +131,13 @@ public function getProductOptionsXml(Mage_Catalog_Model_Product $product, $isObj $optionNode = $optionsXmlObj->addChild('option'); $optionNode->addAttribute('code', 'super_attribute[' . $id . ']'); $optionNode->addAttribute('type', 'select'); - $optionNode->addAttribute('label', $optionsXmlObj->xmlentities($attribute['label'])); + $optionNode->addAttribute('label', $optionsXmlObj->escapeXml($attribute['label'])); $optionNode->addAttribute('is_required', 1); if ($isFirst) { foreach ($attribute['options'] as $option) { $valueNode = $optionNode->addChild('value'); $valueNode->addAttribute('code', $option['id']); - $valueNode->addAttribute('label', $optionsXmlObj->xmlentities($option['label'])); + $valueNode->addAttribute('label', $optionsXmlObj->escapeXml($option['label'])); if ((float)$option['price'] != 0.00) { $valueNode->addAttribute('price', $option['price']); $valueNode->addAttribute('formated_price', $option['formated_price']); @@ -187,7 +187,7 @@ protected function _prepareRecursivelyRelatedValues(&$valueNode, $attributes, $p $_valueNode = $relatedNode->addChild('value'); $_valueNode->addAttribute('code', $option['id']); - $_valueNode->addAttribute('label', $_valueNode->xmlentities($option['label'])); + $_valueNode->addAttribute('label', $_valueNode->escapeXml($option['label'])); if ((float)$option['price'] != 0.00) { $_valueNode->addAttribute('price', $option['price']); $_valueNode->addAttribute('formated_price', $option['formated_price']); diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Grouped.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Grouped.php index 8c90bb5c32..cdedcea493 100644 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Grouped.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Grouped.php @@ -68,7 +68,7 @@ public function getProductOptionsXml(Mage_Catalog_Model_Product $product, $isObj $optionNode->addAttribute('code', 'super_group[' . $_item->getId() . ']'); $optionNode->addAttribute('type', 'product'); - $optionNode->addAttribute('label', $xmlModel->xmlentities($_item->getName())); + $optionNode->addAttribute('label', $xmlModel->escapeXml($_item->getName())); $optionNode->addAttribute('is_qty_editable', 1); $optionNode->addAttribute('qty', $_item->getQty()*1); diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Price/Bundle.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Price/Bundle.php index d446da2754..7670fd4ea2 100644 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Price/Bundle.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Price/Bundle.php @@ -104,7 +104,7 @@ public function collectProductPrices( } $weeeItemXmlObj = $weeeXmlObj->addChild('item'); $weeeItemXmlObj->addAttribute( - 'name', $weeeItemXmlObj->xmlentities($_weeeTaxAttribute->getName()) + 'name', $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName()) ); $weeeItemXmlObj->addAttribute( 'amount', $_coreHelper->currency($amount, true, false) @@ -132,7 +132,7 @@ public function collectProductPrices( } $weeeItemXmlObj = $weeeXmlObj->addChild('item'); $weeeItemXmlObj->addAttribute( - 'name', $weeeItemXmlObj->xmlentities($_weeeTaxAttribute->getName()) + 'name', $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName()) ); $weeeItemXmlObj->addAttribute( 'amount', $_coreHelper->currency($amount, true, false) @@ -168,7 +168,7 @@ public function collectProductPrices( } $weeeItemXmlObj = $weeeXmlObj->addChild('item'); $weeeItemXmlObj->addAttribute( - 'name', $weeeItemXmlObj->xmlentities($_weeeTaxAttribute->getName()) + 'name', $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName()) ); $weeeItemXmlObj->addAttribute( 'amount', $_coreHelper->currency($amount, true, false) @@ -194,7 +194,7 @@ public function collectProductPrices( } $weeeItemXmlObj = $weeeXmlObj->addChild('item'); $weeeItemXmlObj->addAttribute( - 'name', $weeeItemXmlObj->xmlentities($_weeeTaxAttribute->getName()) + 'name', $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName()) ); $weeeItemXmlObj->addAttribute('amount', $_coreHelper->currency($amount, true, false)); } @@ -237,7 +237,7 @@ public function collectProductPrices( } $weeeItemXmlObj = $weeeXmlObj->addChild('item'); $weeeItemXmlObj->addAttribute( - 'name', $weeeItemXmlObj->xmlentities($_weeeTaxAttribute->getName()) + 'name', $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName()) ); $weeeItemXmlObj->addAttribute( 'amount', $_coreHelper->currency($amount, true, false) @@ -265,7 +265,7 @@ public function collectProductPrices( } $weeeItemXmlObj = $weeeXmlObj->addChild('item'); $weeeItemXmlObj->addAttribute( - 'name', $weeeItemXmlObj->xmlentities($_weeeTaxAttribute->getName()) + 'name', $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName()) ); $weeeItemXmlObj->addAttribute( 'amount', $_coreHelper->currency($amount, true, false) @@ -300,7 +300,7 @@ public function collectProductPrices( } $weeeItemXmlObj = $weeeXmlObj->addChild('item'); $weeeItemXmlObj->addAttribute( - 'name', $weeeItemXmlObj->xmlentities($_weeeTaxAttribute->getName()) + 'name', $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName()) ); $weeeItemXmlObj->addAttribute( 'amount', $_coreHelper->currency($amount, true, false) @@ -328,7 +328,7 @@ public function collectProductPrices( } $weeeItemXmlObj = $weeeXmlObj->addChild('item'); $weeeItemXmlObj->addAttribute( - 'name', $weeeItemXmlObj->xmlentities($_weeeTaxAttribute->getName()) + 'name', $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName()) ); $weeeItemXmlObj->addAttribute( 'amount', $_coreHelper->currency($amount, true, false) diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Price/Default.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Price/Default.php index 33de63ad5d..c136f84d49 100644 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Price/Default.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Price/Default.php @@ -102,7 +102,7 @@ public function collectProductPrices( foreach ($_weeeTaxAttributes as $_weeeTaxAttribute) { $weeeItemXmlObj = $weeeXmlObj->addChild('item'); $weeeItemXmlObj->addAttribute( - 'name', $weeeItemXmlObj->xmlentities($_weeeTaxAttribute->getName()) + 'name', $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName()) ); $weeeItemXmlObj->addAttribute( 'amount', $_coreHelper->currency($_weeeTaxAttribute->getAmount(), true, false) @@ -124,7 +124,7 @@ public function collectProductPrices( foreach ($_weeeTaxAttributes as $_weeeTaxAttribute) { $weeeItemXmlObj = $weeeXmlObj->addChild('item'); $weeeItemXmlObj->addAttribute( - 'name', $weeeItemXmlObj->xmlentities($_weeeTaxAttribute->getName()) + 'name', $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName()) ); $weeeItemXmlObj->addAttribute('amount', $_coreHelper->currency( $_weeeTaxAttribute->getAmount() + $_weeeTaxAttribute->getTaxAmount(), true, false @@ -139,7 +139,7 @@ public function collectProductPrices( foreach ($_weeeTaxAttributes as $_weeeTaxAttribute) { $weeeItemXmlObj = $weeeXmlObj->addChild('item'); $weeeItemXmlObj->addAttribute( - 'name', $weeeItemXmlObj->xmlentities($_weeeTaxAttribute->getName()) + 'name', $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName()) ); $weeeItemXmlObj->addAttribute( 'amount', $_coreHelper->currency($_weeeTaxAttribute->getAmount(), true, false) @@ -178,7 +178,7 @@ public function collectProductPrices( foreach ($_weeeTaxAttributes as $_weeeTaxAttribute) { $weeeItemXmlObj = $weeeXmlObj->addChild('item'); $weeeItemXmlObj->addAttribute( - 'name', $weeeItemXmlObj->xmlentities($_weeeTaxAttribute->getName()) + 'name', $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName()) ); $weeeItemXmlObj->addAttribute( 'amount', $_coreHelper->currency($_weeeTaxAttribute->getAmount(), true, false) @@ -197,7 +197,7 @@ public function collectProductPrices( foreach ($_weeeTaxAttributes as $_weeeTaxAttribute) { $weeeItemXmlObj = $weeeXmlObj->addChild('item'); $weeeItemXmlObj->addAttribute( - 'name', $weeeItemXmlObj->xmlentities($_weeeTaxAttribute->getName()) + 'name', $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName()) ); $weeeItemXmlObj->addAttribute('amount', $_coreHelper->currency( $_weeeTaxAttribute->getAmount() + $_weeeTaxAttribute->getTaxAmount(), true, false @@ -214,7 +214,7 @@ public function collectProductPrices( foreach ($_weeeTaxAttributes as $_weeeTaxAttribute) { $weeeItemXmlObj = $weeeXmlObj->addChild('item'); $weeeItemXmlObj->addAttribute( - 'name', $weeeItemXmlObj->xmlentities($_weeeTaxAttribute->getName()) + 'name', $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName()) ); $weeeItemXmlObj->addAttribute( 'amount', $_coreHelper->currency($_weeeTaxAttribute->getAmount(), true, false) @@ -267,7 +267,7 @@ public function collectProductPrices( foreach ($_weeeTaxAttributes as $_weeeTaxAttribute) { $weeeItemXmlObj = $weeeXmlObj->addChild('item'); $weeeItemXmlObj->addAttribute( - 'name', $weeeItemXmlObj->xmlentities($_weeeTaxAttribute->getName()) + 'name', $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName()) ); $weeeItemXmlObj->addAttribute('amount', $_coreHelper->currency( $_weeeTaxAttribute->getAmount(), true, false @@ -292,7 +292,7 @@ public function collectProductPrices( foreach ($_weeeTaxAttributes as $_weeeTaxAttribute) { $weeeItemXmlObj = $weeeXmlObj->addChild('item'); $weeeItemXmlObj->addAttribute( - 'name', $weeeItemXmlObj->xmlentities($_weeeTaxAttribute->getName()) + 'name', $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName()) ); $weeeItemXmlObj->addAttribute('amount', $_coreHelper->currency( $_weeeTaxAttribute->getAmount() + $_weeeTaxAttribute->getTaxAmount(), true, false @@ -313,7 +313,7 @@ public function collectProductPrices( foreach ($_weeeTaxAttributes as $_weeeTaxAttribute) { $weeeItemXmlObj = $weeeXmlObj->addChild('item'); $weeeItemXmlObj->addAttribute( - 'name', $weeeItemXmlObj->xmlentities($_weeeTaxAttribute->getName()) + 'name', $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName()) ); $weeeItemXmlObj->addAttribute('amount', $_coreHelper->currency( $_weeeTaxAttribute->getAmount(), true, false diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Review.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Review.php index 8b196ccbfb..3194eb4ac4 100644 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Review.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Review.php @@ -52,9 +52,9 @@ public function reviewToXmlObject(Mage_Review_Model_Review $review, $itemNodeNam if ($review->getId()) { $item->addChild('review_id', $review->getId()); $item->addChild('created_at', $this->formatDate($review->getCreatedAt())); - $item->addChild('title', $item->xmlentities($review->getTitle())); - $item->addChild('nickname', $item->xmlentities($review->getNickname())); - $detail = $item->xmlentities($review->getDetail()); + $item->addChild('title', $item->escapeXml($review->getTitle())); + $item->addChild('nickname', $item->escapeXml($review->getNickname())); + $detail = $item->escapeXml($review->getDetail()); if ($itemNodeName == 'item') { $remainder = ''; $deviceType = Mage::helper('xmlconnect')->getDeviceType(); diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Search.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Search.php index a782092bbd..a2c884779e 100644 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Search.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Search.php @@ -96,7 +96,7 @@ protected function _toHtml() continue; } $item = $filtersXmlObject->addChild('item'); - $item->addChild('name', $searchXmlObject->xmlentities($filter->getName())); + $item->addChild('name', $searchXmlObject->escapeXml($filter->getName())); $item->addChild('code', $filter->getRequestVar()); $values = $item->addChild('values'); @@ -107,9 +107,7 @@ protected function _toHtml() } $value = $values->addChild('value'); $value->addChild('id', $valueItem->getValueString()); - $value->addChild( - 'label', $searchXmlObject->xmlentities(strip_tags($valueItem->getLabel())) - ); + $value->addChild('label', $searchXmlObject->escapeXml($valueItem->getLabel())); $value->addChild('count', $count); } } diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Search/Suggest.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Search/Suggest.php index d35c133214..a3e4ea8cc5 100644 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Search/Suggest.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Search/Suggest.php @@ -58,7 +58,7 @@ protected function _toHtml() $items = ''; foreach ($suggestData as $item) { - $items .= $suggestXmlObj->xmlentities(strip_tags($item['title'])) . self::SUGGEST_ITEM_SEPARATOR + $items .= $suggestXmlObj->escapeXml($item['title']) . self::SUGGEST_ITEM_SEPARATOR . (int)$item['num_of_results'] . self::SUGGEST_ITEM_SEPARATOR; } diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Address/Billing.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Address/Billing.php index 8d5b5c7b7e..891d2b72c2 100644 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Address/Billing.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Address/Billing.php @@ -55,7 +55,7 @@ protected function _toHtml() } $this->getChild('address_list')->prepareAddressData($address, $item); $item->addChild( - 'address_line', $billingXmlObj->xmlentities($address->format('oneline')) + 'address_line', $billingXmlObj->escapeXml($address->format('oneline')) ); } diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Address/Shipping.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Address/Shipping.php index 014a90d918..f29eef62bf 100644 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Address/Shipping.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Address/Shipping.php @@ -54,7 +54,7 @@ protected function _toHtml() $item->addAttribute('selected', 1); } $this->getChild('address_list')->prepareAddressData($address, $item); - $item->addChild('address_line', $shippingXmlObj->xmlentities($address->format('oneline'))); + $item->addChild('address_line', $shippingXmlObj->escapeXml($address->format('oneline'))); } return $shippingXmlObj->asNiceXml(); diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Agreements.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Agreements.php index c5f667e6d9..bb6f3285f2 100644 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Agreements.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Agreements.php @@ -40,15 +40,18 @@ class Mage_XmlConnect_Block_Checkout_Agreements extends Mage_Checkout_Block_Agre */ protected function _toHtml() { + /** @var $agreementsXmlObj Mage_XmlConnect_Model_Simplexml_Element */ $agreementsXmlObj = Mage::getModel('xmlconnect/simplexml_element', ''); if ($this->getAgreements()) { foreach ($this->getAgreements() as $agreement) { $itemXmlObj = $agreementsXmlObj->addChild('item'); - $content = $agreementsXmlObj->xmlentities($agreement->getContent()); + $content = $agreement->getContent(); if (!$agreement->getIsHtml()) { - $content = nl2br(strip_tags($content)); + $content = nl2br($agreementsXmlObj->escapeXml($content)); + } else { + $agreementsXmlObj->xmlentities($content); } - $agreementText = $agreementsXmlObj->xmlentities($agreement->getCheckboxText()); + $agreementText = $agreementsXmlObj->escapeXml($agreement->getCheckboxText()); $itemXmlObj->addChild('label', $agreementText); $itemXmlObj->addChild('content', $content); $itemXmlObj->addChild('code', 'agreement[' . $agreement->getId() . ']'); diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Order/Review/Info.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Order/Review/Info.php index cab02fc13b..3988c74f86 100644 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Order/Review/Info.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Order/Review/Info.php @@ -55,7 +55,7 @@ protected function _toHtml() $itemXml->addChild('entity_id', $item->getProduct()->getId()); $itemXml->addChild('entity_type', $type); $itemXml->addChild('item_id', $item->getId()); - $itemXml->addChild('name', $itemsXmlObj->xmlentities($renderer->getProductName())); + $itemXml->addChild('name', $itemsXmlObj->escapeXml($renderer->getProductName())); $itemXml->addChild('qty', $renderer->getQty()); $icon = $renderer->getProductThumbnail()->resize( Mage::helper('xmlconnect/image')->getImageSizeForContent('product_small') @@ -169,16 +169,15 @@ protected function _toHtml() /** * Options list */ - if ($_options = $renderer->getOptionList()) { + $_options = $renderer->getOptionList(); + if ($_options) { $itemOptionsXml = $itemXml->addChild('options'); foreach ($_options as $_option) { $_formattedOptionValue = $renderer->getFormatedOptionValue($_option); $optionXml = $itemOptionsXml->addChild('option'); - $labelValue = $itemsXmlObj->xmlentities($_option['label']); + $labelValue = $itemsXmlObj->escapeXml($_option['label']); $optionXml->addAttribute('label', $labelValue); - $textValue = $itemsXmlObj->xmlentities( - strip_tags($_formattedOptionValue['value']) - ); + $textValue = $itemsXmlObj->escapeXml($_formattedOptionValue['value']); $optionXml->addAttribute('text', $textValue); } } diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/List.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/List.php index 36c201aa5d..8096a237eb 100644 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/List.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/List.php @@ -285,7 +285,7 @@ protected function _toHtml() $methodItemXmlObj = $methodsXmlObj->addChild('method'); $methodItemXmlObj->addAttribute('post_name', 'payment[method]'); $methodItemXmlObj->addAttribute('code', $method->getCode()); - $methodItemXmlObj->addAttribute('label', $methodsXmlObj->xmlentities($method->getTitle())); + $methodItemXmlObj->addAttribute('label', $methodsXmlObj->escapeXml($method->getTitle())); if ($this->getQuote()->getPayment()->getMethod() == $method->getCode()) { $methodItemXmlObj->addAttribute('selected', 1); } diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Shipping/Method/Available.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Shipping/Method/Available.php index ca6bcb1ef6..a2aa2cfdb8 100644 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Shipping/Method/Available.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Shipping/Method/Available.php @@ -49,16 +49,16 @@ protected function _toHtml() $_sole = count($_shippingRateGroups) == 1; foreach ($_shippingRateGroups as $code => $_rates) { $methodXmlObj = $methodsXmlObj->addChild('method'); - $methodXmlObj->addAttribute('label', $methodsXmlObj->xmlentities($this->getCarrierName($code))); + $methodXmlObj->addAttribute('label', $methodsXmlObj->escapeXml($this->getCarrierName($code))); $ratesXmlObj = $methodXmlObj->addChild('rates'); $_sole = $_sole && count($_rates) == 1; foreach ($_rates as $_rate) { $rateXmlObj = $ratesXmlObj->addChild('rate'); - $rateXmlObj->addAttribute('label', $methodsXmlObj->xmlentities($_rate->getMethodTitle())); + $rateXmlObj->addAttribute('label', $methodsXmlObj->escapeXml($_rate->getMethodTitle())); $rateXmlObj->addAttribute('code', $_rate->getCode()); if ($_rate->getErrorMessage()) { - $rateXmlObj->addChild('error_message', $methodsXmlObj->xmlentities($_rate->getErrorMessage())); + $rateXmlObj->addChild('error_message', $methodsXmlObj->escapeXml($_rate->getErrorMessage())); } else { $price = Mage::helper('tax')->getShippingPrice( $_rate->getPrice(), diff --git a/app/code/core/Mage/XmlConnect/Block/Customer/Address/Form.php b/app/code/core/Mage/XmlConnect/Block/Customer/Address/Form.php index ab998621c4..4a00292e7f 100644 --- a/app/code/core/Mage/XmlConnect/Block/Customer/Address/Form.php +++ b/app/code/core/Mage/XmlConnect/Block/Customer/Address/Form.php @@ -250,12 +250,12 @@ protected function _addPrefix(Mage_XmlConnect_Model_Simplexml_Form_Element_Field if ($this->getNameWidgetBlock()->getPrefixOptions() === false) { $contactInfoFieldset->addField($this->getNameWidgetBlock()->getFieldId('prefix'), 'text', array( - 'label' => $this->getNameWidgetBlock()->__('Prefix'), + 'label' => $this->__('Prefix'), 'name' => $this->getNameWidgetBlock()->getFieldName('prefix') ) + $attributes); } else { $contactInfoFieldset->addField($this->getNameWidgetBlock()->getFieldId('prefix'), 'select', array( - 'label' => $this->getNameWidgetBlock()->__('Prefix'), + 'label' => $this->__('Prefix'), 'name' => $this->getNameWidgetBlock()->getFieldName('prefix'), 'options' => $this->getNameWidgetBlock()->getPrefixOptions() ) + $attributes); @@ -284,12 +284,12 @@ protected function _addSuffix( if ($this->getNameWidgetBlock()->getSuffixOptions() === false) { $contactInfoFieldset->addField($this->getNameWidgetBlock()->getFieldId('suffix'), 'text', array( - 'label' => $this->getNameWidgetBlock()->__('Suffix'), + 'label' => $this->__('Suffix'), 'name' => $this->getNameWidgetBlock()->getFieldName('suffix') ) + $attributes); } else { $contactInfoFieldset->addField($this->getNameWidgetBlock()->getFieldId('suffix'), 'select', array( - 'label' => $this->getNameWidgetBlock()->__('Suffix'), + 'label' => $this->__('Suffix'), 'name' => $this->getNameWidgetBlock()->getFieldName('suffix'), 'options' => $this->getNameWidgetBlock()->getSuffixOptions() ) + $attributes); @@ -314,7 +314,7 @@ protected function _addMiddleName( ); $contactInfoFieldset->addField($this->getNameWidgetBlock()->getFieldId('middlename'), 'text', array( - 'label' => $this->getNameWidgetBlock()->__('M.I.'), + 'label' => $this->__('M.I.'), 'name' => $this->getNameWidgetBlock()->getFieldName('middlename') ) + $attributes); diff --git a/app/code/core/Mage/XmlConnect/Block/Customer/Address/List.php b/app/code/core/Mage/XmlConnect/Block/Customer/Address/List.php index b0f2381891..d4f0e0534f 100644 --- a/app/code/core/Mage/XmlConnect/Block/Customer/Address/List.php +++ b/app/code/core/Mage/XmlConnect/Block/Customer/Address/List.php @@ -82,10 +82,8 @@ protected function _toHtml() * @return array */ public function prepareAddressData( - Mage_Customer_Model_Address $address, - Mage_XmlConnect_Model_Simplexml_Element $item - ) - { + Mage_Customer_Model_Address $address, Mage_XmlConnect_Model_Simplexml_Element $item + ) { if (!$address) { return array(); } @@ -123,7 +121,7 @@ public function prepareAddressData( if (empty($value)) { continue; } - $item->addChild($key, $item->xmlentities($value)); + $item->addChild($key, $item->escapeXml($value)); } } } diff --git a/app/code/core/Mage/XmlConnect/Block/Customer/Form.php b/app/code/core/Mage/XmlConnect/Block/Customer/Form.php index 24431c1e84..8e1d18bf96 100644 --- a/app/code/core/Mage/XmlConnect/Block/Customer/Form.php +++ b/app/code/core/Mage/XmlConnect/Block/Customer/Form.php @@ -46,32 +46,32 @@ protected function _toHtml() $xmlModel = Mage::getModel('xmlconnect/simplexml_element', ''); //Enterprise_Customer if ($editFlag == 1 && $customer && $customer->getId()) { - $firstname = $xmlModel->xmlentities($customer->getFirstname()); - $lastname = $xmlModel->xmlentities($customer->getLastname()); - $email = $xmlModel->xmlentities($customer->getEmail()); + $firstname = $xmlModel->escapeXml($customer->getFirstname()); + $lastname = $xmlModel->escapeXml($customer->getLastname()); + $email = $xmlModel->escapeXml($customer->getEmail()); } else { $firstname = $lastname = $email = ''; } if ($editFlag) { $passwordManageXml = ' - +
- - - + + + - password + password
'; } else { $passwordManageXml = ' - - + + - password + password '; @@ -80,11 +80,11 @@ protected function _toHtml() $xml = <<
- - - + + + - + $passwordManageXml diff --git a/app/code/core/Mage/XmlConnect/Block/Customer/Order/List.php b/app/code/core/Mage/XmlConnect/Block/Customer/Order/List.php index 90734f5fe9..8e3a4e789b 100644 --- a/app/code/core/Mage/XmlConnect/Block/Customer/Order/List.php +++ b/app/code/core/Mage/XmlConnect/Block/Customer/Order/List.php @@ -65,7 +65,7 @@ protected function _toHtml() $item->addChild('number', $_order->getRealOrderId()); $item->addChild('date', $this->formatDate($_order->getCreatedAtStoreDate())); if ($_order->getShippingAddress()) { - $item->addChild('ship_to', $ordersXmlObj->xmlentities($_order->getShippingAddress()->getName())); + $item->addChild('ship_to', $ordersXmlObj->escapeXml($_order->getShippingAddress()->getName())); } $item->addChild('total', $_order->getOrderCurrency()->formatPrecision( $_order->getGrandTotal(), 2, array(), false, false diff --git a/app/code/core/Mage/XmlConnect/Block/Customer/Storecredit.php b/app/code/core/Mage/XmlConnect/Block/Customer/Storecredit.php index 2412011ac0..59792ac05d 100644 --- a/app/code/core/Mage/XmlConnect/Block/Customer/Storecredit.php +++ b/app/code/core/Mage/XmlConnect/Block/Customer/Storecredit.php @@ -46,10 +46,8 @@ protected function _toHtml() $accountBalance = $this->getLayout() ->addBlock('enterprise_customerbalance/account_balance', 'account_balance'); - $customerBalanceHelper = Mage::helper('enterprise_customerbalance'); - $xmlModel->addCustomChild('balance', null, array( - 'label' => $customerBalanceHelper->__('Your current balance is:'), + 'label' => $this->__('Your current balance is:'), 'value' => $accountBalance->getBalance(), 'formatted_value' => Mage::helper('core')->currency($accountBalance->getBalance(), true, false) )); @@ -59,11 +57,11 @@ protected function _toHtml() if ($accountHistory->canShow() && $accountHistory->getEvents() && count($accountHistory->getEvents())) { $balanceHistory = $xmlModel->addCustomChild('balance_history', null, array( - 'label' => $customerBalanceHelper->__('Balance History'), - 'action_label' => $customerBalanceHelper->__('Action'), - 'balance_change_label' => $customerBalanceHelper->__('Balance Change'), - 'balance_label' => $customerBalanceHelper->__('Balance'), - 'date_label' => $customerBalanceHelper->__('Date') + 'label' => $this->__('Balance History'), + 'action_label' => $this->__('Action'), + 'balance_change_label' => $this->__('Balance Change'), + 'balance_label' => $this->__('Balance'), + 'date_label' => $this->__('Date') )); foreach ($accountHistory->getEvents() as $event) { diff --git a/app/code/core/Mage/XmlConnect/Block/Home.php b/app/code/core/Mage/XmlConnect/Block/Home.php index af9a7d34ae..d058c3eceb 100644 --- a/app/code/core/Mage/XmlConnect/Block/Home.php +++ b/app/code/core/Mage/XmlConnect/Block/Home.php @@ -69,7 +69,7 @@ protected function _toHtml() /** @var $item Mage_Catalog_Model_Category */ $item = Mage::getModel('catalog/category')->load($item->getId()); $itemXmlObj = $itemsXmlObj->addChild('item'); - $itemXmlObj->addChild('label', $homeXmlObj->xmlentities($item->getName())); + $itemXmlObj->addChild('label', $homeXmlObj->escapeXml($item->getName())); $itemXmlObj->addChild('entity_id', $item->getId()); $itemXmlObj->addChild('content_type', $item->hasChildren() ? 'categories' : 'products'); $icon = Mage::helper('xmlconnect/catalog_category_image')->initialize($item, 'thumbnail') diff --git a/app/code/core/Mage/XmlConnect/Block/Review/Form.php b/app/code/core/Mage/XmlConnect/Block/Review/Form.php index 5e55d76826..28dbf76031 100644 --- a/app/code/core/Mage/XmlConnect/Block/Review/Form.php +++ b/app/code/core/Mage/XmlConnect/Block/Review/Form.php @@ -55,7 +55,7 @@ protected function _toHtml() $nickname = ''; if ($customer->getId()) { - $nickname = $xmlReview->xmlentities($customer->getFirstname()); + $nickname = $xmlReview->escapeXml($customer->getFirstname()); } if ($this->getRatings()) { diff --git a/app/code/core/Mage/XmlConnect/Block/Wishlist.php b/app/code/core/Mage/XmlConnect/Block/Wishlist.php index f2ca53bf46..e2fb0f7ae4 100644 --- a/app/code/core/Mage/XmlConnect/Block/Wishlist.php +++ b/app/code/core/Mage/XmlConnect/Block/Wishlist.php @@ -70,13 +70,14 @@ protected function _toHtml() $itemXmlObj->addChild('item_id', $item->getWishlistItemId()); $itemXmlObj->addChild('entity_id', $item->getProductId()); $itemXmlObj->addChild('entity_type_id', $item->getProduct()->getTypeId()); - $itemXmlObj->addChild('name', $wishlistXmlObj->xmlentities($item->getName())); - $itemXmlObj->addChild('in_stock', (int)$item->getProduct()->getIsInStock()); + $itemXmlObj->addChild('name', $wishlistXmlObj->escapeXml($item->getName())); + $itemXmlObj->addChild('in_stock', (int)$item->getProduct()->getStockItem()->getIsInStock()); $itemXmlObj->addChild('is_salable', (int)$item->getProduct()->isSalable()); /** * If product type is grouped than it has options as its grouped items */ - if ($item->getProduct()->getTypeId() == Mage_Catalog_Model_Product_Type_Grouped::TYPE_CODE) { + if ($item->getProduct()->getTypeId() == Mage_Catalog_Model_Product_Type_Grouped::TYPE_CODE + || $item->getProduct()->getTypeId() == Mage_Catalog_Model_Product_Type_Configurable::TYPE_CODE) { $item->getProduct()->setHasOptions(true); } $itemXmlObj->addChild('has_options', (int)$item->getProduct()->getHasOptions()); @@ -89,10 +90,10 @@ protected function _toHtml() $file = Mage::helper('xmlconnect')->urlToPath($icon); $iconXml->addAttribute('modification_time', filemtime($file)); - $description = $wishlistXmlObj->xmlentities(strip_tags($item->getDescription())); + $description = $wishlistXmlObj->escapeXml($item->getDescription()); $itemXmlObj->addChild('description', $description); - $addedDate = $wishlistXmlObj->xmlentities($this->getFormatedDate($item->getAddedAt())); + $addedDate = $wishlistXmlObj->escapeXml($this->getFormatedDate($item->getAddedAt())); $itemXmlObj->addChild('added_date', $addedDate); if ($this->getChild('product_price')) { diff --git a/app/code/core/Mage/XmlConnect/Helper/Customer/Form/Renderer.php b/app/code/core/Mage/XmlConnect/Helper/Customer/Form/Renderer.php index ea40a65c31..b7adcfc13a 100644 --- a/app/code/core/Mage/XmlConnect/Helper/Customer/Form/Renderer.php +++ b/app/code/core/Mage/XmlConnect/Helper/Customer/Form/Renderer.php @@ -37,11 +37,11 @@ class Mage_XmlConnect_Helper_Customer_Form_Renderer extends Mage_Core_Helper_Abs * Get title and required attributes for a field * * @param Mage_XmlConnect_Model_Simplexml_Form_Abstract $fieldsetXmlObj - * @param Enterprise_Customer_Block_Form_Renderer_Abstract $blockObject + * @param Enterprise_Eav_Block_Form_Renderer_Abstract $blockObject * @return array */ public function addTitleAndRequiredAttr(Mage_XmlConnect_Model_Simplexml_Form_Abstract $fieldsetXmlObj, - Enterprise_Customer_Block_Form_Renderer_Abstract $blockObject + Enterprise_Eav_Block_Form_Renderer_Abstract $blockObject ) { $attributes = array(); diff --git a/app/code/core/Mage/XmlConnect/Helper/Customer/Order.php b/app/code/core/Mage/XmlConnect/Helper/Customer/Order.php index b588441280..fe877b1135 100644 --- a/app/code/core/Mage/XmlConnect/Helper/Customer/Order.php +++ b/app/code/core/Mage/XmlConnect/Helper/Customer/Order.php @@ -62,7 +62,7 @@ public function addPriceAndSubtotalToXml(Mage_Core_Block_Template $renderer, Mag $typesOfDisplay = $renderer->getTypesOfDisplay(); if ($isIncludeTax) { $nodeName = 'including_tax'; - $nodeLabel = $renderer->__('Incl. Tax'); + $nodeLabel = Mage::helper('tax')->__('Incl. Tax'); $inclPrice = $renderer->helper('checkout')->getPriceInclTax($item); $inclSubtotal = $renderer->helper('checkout')->getSubtotalInclTax($item); @@ -77,7 +77,7 @@ public function addPriceAndSubtotalToXml(Mage_Core_Block_Template $renderer, Mag $weeeParams['include'] = $inclPrice; } else { $nodeName = 'excluding_tax'; - $nodeLabel = $renderer->__('Excl. Tax'); + $nodeLabel = Mage::helper('tax')->__('Excl. Tax'); if ($typesOfDisplay[self::PRICE_DISPLAY_TYPE_14]) { $price = $item->getPrice() + $renderer->getWeeeTaxAppliedAmount() @@ -221,19 +221,19 @@ public function addQuantityToXml(Mage_Core_Block_Template $renderer, ) { $qty = 1 * $item->getQtyOrdered(); if ($qty > 0) { - $quantityXml->addCustomChild('value', $qty, array('label' => $renderer->__('Ordered'))); + $quantityXml->addCustomChild('value', $qty, array('label' => Mage::helper('xmlconnect')->__('Ordered'))); } $qty = 1 * $item->getQtyShipped(); if ($qty > 0) { - $quantityXml->addCustomChild('value', $qty, array('label' => $renderer->__('Shipped'))); + $quantityXml->addCustomChild('value', $qty, array('label' => Mage::helper('xmlconnect')->__('Shipped'))); } $qty = 1 * $item->getQtyCanceled(); if ($qty > 0) { - $quantityXml->addCustomChild('value', $qty, array('label' => $renderer->__('Canceled'))); + $quantityXml->addCustomChild('value', $qty, array('label' => Mage::helper('xmlconnect')->__('Canceled'))); } $qty = 1 * $item->getQtyRefunded(); if ($qty > 0) { - $quantityXml->addCustomChild('value', $qty, array('label' => $renderer->__('Refunded'))); + $quantityXml->addCustomChild('value', $qty, array('label' => Mage::helper('xmlconnect')->__('Refunded'))); } } diff --git a/app/code/core/Mage/XmlConnect/Helper/Data.php b/app/code/core/Mage/XmlConnect/Helper/Data.php index daf287f808..1413a32a9f 100644 --- a/app/code/core/Mage/XmlConnect/Helper/Data.php +++ b/app/code/core/Mage/XmlConnect/Helper/Data.php @@ -43,6 +43,11 @@ class Mage_XmlConnect_Helper_Data extends Mage_Core_Helper_Abstract */ const MESSAGE_TITLE_LENGTH = 255; + /** + * Curl default timeout + */ + const CURLOPT_DEFAULT_TIMEOUT = 60; + /** * List of the keys for xml config that have to be excluded form application config * @@ -422,7 +427,6 @@ public function htmlize($body) { $w3cUrl = 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'; return <<getAppCode(); + $applicationId = Mage::getModel('xmlconnect/template')->load($queue->getTemplateId())->getApplicationId(); /** @var $app Mage_XmlConnect_Model_Application */ - $app = Mage::getModel('xmlconnect/application')->loadByCode($appCode); + $app = Mage::getModel('xmlconnect/application')->load($applicationId); if (!$app->getId()) { Mage::throwException( - Mage::helper('xmlconnect')->__('Can\'t load application with code "%s"', $appCode) + Mage::helper('xmlconnect')->__('Can\'t load application with id "%s"', $applicationId) ); } @@ -636,8 +640,6 @@ public function sendBroadcastMessage(Mage_XmlConnect_Model_Queue $queue) return; } - $userpwd = $app->getUserpwd(); - $sendType = $queue->getData('type'); switch ($sendType) { case Mage_XmlConnect_Model_Queue::MESSAGE_TYPE_AIRMAIL: @@ -652,29 +654,21 @@ public function sendBroadcastMessage(Mage_XmlConnect_Model_Queue $queue) break; } - $curlHandler = curl_init(Mage::getStoreConfig($configPath)); + $curl = new Varien_Http_Adapter_Curl(); + $curl->setConfig($this->_getCurlConfig($app->getUserpwd())); - $httpHeaders = $this->getHttpHeaders(); + $urbanUrl = Mage::getStoreConfig($configPath); + $curl->write( + Zend_Http_Client::POST, $urbanUrl, HTTP_REQUEST_HTTP_VER_1_1, $this->getHttpHeaders(), $params + ); - curl_setopt($curlHandler, CURLOPT_POST, 1); - curl_setopt($curlHandler, CURLOPT_HTTPHEADER, $httpHeaders); - curl_setopt($curlHandler, CURLOPT_POSTFIELDS, $params); - curl_setopt($curlHandler, CURLOPT_RETURNTRANSFER, 1); - curl_setopt($curlHandler, CURLOPT_USERPWD, $userpwd); - curl_setopt($curlHandler, CURLOPT_TIMEOUT, 60); - - // Execute the request. - $result = curl_exec($curlHandler); - $succeeded = curl_errno($curlHandler) == 0 ? true : false; - - // close cURL resource, and free up system resources - curl_close($curlHandler); - - if ($succeeded && (is_null($result) || strtolower($result) == 'null')) { + if ($curl->read() && $curl->getInfo(CURLINFO_HTTP_CODE) == 200) { $queue->setStatus(Mage_XmlConnect_Model_Queue::STATUS_COMPLETED); } - $queue->setIsSent(true); + $curl->close(); + $queue->setIsSent(true); + $queue->save(); return; } catch (Exception $e) { Mage::logException($e); @@ -685,12 +679,23 @@ public function sendBroadcastMessage(Mage_XmlConnect_Model_Queue $queue) /** * Get headers for broadcast message * - * @return string + * @return array */ public function getHttpHeaders() { - $httpHeaders = array('Content-Type: application/json'); - return $httpHeaders; + return array('Content-Type: application/json'); + } + + /** + * Get urban airship curl request configuration + * + * @param string $userPwd + * @param int $timeout + * @return array + */ + protected function _getCurlConfig($userPwd, $timeout = self::CURLOPT_DEFAULT_TIMEOUT) + { + return array ('timeout' => $timeout, 'userpwd' => $userPwd); } /** diff --git a/app/code/core/Mage/XmlConnect/Model/Observer.php b/app/code/core/Mage/XmlConnect/Model/Observer.php index 5bf0b4de8f..398d059143 100644 --- a/app/code/core/Mage/XmlConnect/Model/Observer.php +++ b/app/code/core/Mage/XmlConnect/Model/Observer.php @@ -112,7 +112,6 @@ public function scheduledSend() foreach ($collection as $message) { if ($message->getId()) { Mage::helper('xmlconnect')->sendBroadcastMessage($message); - $message->save(); } } } diff --git a/app/code/core/Mage/XmlConnect/Model/Simplexml/Element.php b/app/code/core/Mage/XmlConnect/Model/Simplexml/Element.php index 67aea94c7a..2f60848fef 100644 --- a/app/code/core/Mage/XmlConnect/Model/Simplexml/Element.php +++ b/app/code/core/Mage/XmlConnect/Model/Simplexml/Element.php @@ -60,18 +60,55 @@ public function appendChild($source) return $this; } + /** + * Escape xml entities + * + * @param mixed $data + * @param bool $stripTags + * @param array $allowedTags + * @return mixed + */ + public function escapeXml($data, $stripTags = true, $allowedTags = null) + { + if (is_array($data)) { + $result = array(); + foreach ($data as $item) { + if ($stripTags) { + $item = Mage::helper('core')->stripTags($item, $allowedTags); + } + $result[] = $this->xmlentities($item); + } + } else { + if (is_null($data)) { + $data = $this; + } + $data = (string)$data; + + if ($stripTags) { + $data = Mage::helper('core')->stripTags($data, $allowedTags); + } + $result = $this->xmlentities($data); + } + return $result; + } + /** * Converts meaningful xml character (") to xml attribute specification * * @param string $value + * @param bool $stripTags * @return string|this */ - public function xmlAttribute($value = null) + public function xmlAttribute($value = null, $stripTags = true) { if (is_null($value)) { $value = $this; } $value = (string)$value; + + if ($stripTags) { + $value = Mage::helper('core')->stripTags($value); + } $value = str_replace(array('&', '"', '<', '>'), array('&', '"', '<', '>'), $value); return $value; } diff --git a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Abstract.php b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Abstract.php index 7608e9068d..78ce6bc426 100644 --- a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Abstract.php +++ b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Abstract.php @@ -182,7 +182,7 @@ public function addType($type, $className) public function getElements() { if (empty($this->_elements)) { - $this->_elements = Mage::getModel('xmlconnect/simplexml_form_element_collection'); + $this->_elements = Mage::getModel('xmlconnect/simplexml_form_element_collection', $this); } return $this->_elements; } diff --git a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Validator/Abstract.php b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Validator/Abstract.php index 91eb1c1e4d..348e76a2f3 100644 --- a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Validator/Abstract.php +++ b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Validator/Abstract.php @@ -71,22 +71,21 @@ public function __construct($attributes = array()) */ protected function _setDefaultValidatorTypeMessages() { - $helper = Mage::helper('xmlconnect'); $this->_validatorTypeMessages = array( - 'min_length' => $helper->__('Text length does not satisfy specified min text range.'), - 'max_length' => $helper->__('Text length does not satisfy specified max text range.'), - 'alphanumeric' => $helper->__('Please use only letters (a-z or A-Z) or numbers (0-9) only in this field. No spaces or other characters are allowed.'), - 'email' => $helper->__('Please enter a valid email address. For example johndoe@domain.com.'), - 'required' => $helper->__('This is a required field.'), - 'required_select' => $helper->__('Please select an option.'), - 'numeric' => $helper->__('Please use numbers only in this field. Please avoid spaces or other characters such as dots or commas.'), - 'alpha' => $helper->__('Please use letters only (a-z or A-Z) in this field.'), - 'url' => $helper->__('Please enter a valid URL. Protocol is required (http://, https:// or ftp://)'), - 'date' => $helper->__('Please enter a valid date.'), - 'max_file_size' => $helper->__('\'%s\' exceeds the allowed file size: %d (bytes)', $this->getFieldLabel(), $this->getValue()), - 'file_extensions' => $helper->__('\'%s\' is not a valid file extension. Allowed extensions: %s', $this->getFieldLabel(), $this->getValue()), - 'max_image_width' => $helper->__('\'%s\' width exceeds allowed value of %d px', $this->getFieldLabel(), $this->getValue()), - 'max_image_height' => $helper->__('\'%s\' height exceeds allowed value of %d px', $this->getFieldLabel(), $this->getValue()) + 'min_length' => Mage::helper('xmlconnect')->__('Text length does not satisfy specified min text range.'), + 'max_length' => Mage::helper('xmlconnect')->__('Text length does not satisfy specified max text range.'), + 'alphanumeric' => Mage::helper('xmlconnect')->__('Please use only letters (a-z or A-Z) or numbers (0-9) only in this field. No spaces or other characters are allowed.'), + 'email' => Mage::helper('xmlconnect')->__('Please enter a valid email address. For example johndoe@domain.com.'), + 'required' => Mage::helper('xmlconnect')->__('This is a required field.'), + 'required_select' => Mage::helper('xmlconnect')->__('Please select an option.'), + 'numeric' => Mage::helper('xmlconnect')->__('Please use numbers only in this field. Please avoid spaces or other characters such as dots or commas.'), + 'alpha' => Mage::helper('xmlconnect')->__('Please use letters only (a-z or A-Z) in this field.'), + 'url' => Mage::helper('xmlconnect')->__('Please enter a valid URL. Protocol is required (http://, https:// or ftp://)'), + 'date' => Mage::helper('xmlconnect')->__('Please enter a valid date.'), + 'max_file_size' => Mage::helper('xmlconnect')->__('\'%s\' exceeds the allowed file size: %d (bytes)', $this->getFieldLabel(), $this->getValue()), + 'file_extensions' => Mage::helper('xmlconnect')->__('\'%s\' is not a valid file extension. Allowed extensions: %s', $this->getFieldLabel(), $this->getValue()), + 'max_image_width' => Mage::helper('xmlconnect')->__('\'%s\' width exceeds allowed value of %d px', $this->getFieldLabel(), $this->getValue()), + 'max_image_height' => Mage::helper('xmlconnect')->__('\'%s\' height exceeds allowed value of %d px', $this->getFieldLabel(), $this->getValue()) ); return $this; } diff --git a/app/code/core/Mage/XmlConnect/controllers/Adminhtml/MobileController.php b/app/code/core/Mage/XmlConnect/controllers/Adminhtml/MobileController.php index 8b81bca344..273e0ce38e 100644 --- a/app/code/core/Mage/XmlConnect/controllers/Adminhtml/MobileController.php +++ b/app/code/core/Mage/XmlConnect/controllers/Adminhtml/MobileController.php @@ -317,25 +317,29 @@ protected function _clearSessionData() protected function _processPostRequest() { try { + /** @var $app Mage_XmlConnect_Model_Application */ $app = Mage::helper('xmlconnect')->getApplication(); $params = $app->getSubmitParams(); $appConnectorUrl = Mage::getStoreConfig('xmlconnect/mobile_application/magentocommerce_url'); - $curlHandler = curl_init($appConnectorUrl . $params['key']); - - // set URL and other appropriate options - curl_setopt($curlHandler, CURLOPT_POST, 1); - curl_setopt($curlHandler, CURLOPT_POSTFIELDS, $params); - curl_setopt($curlHandler, CURLOPT_SSL_VERIFYHOST, 2); - curl_setopt($curlHandler, CURLOPT_RETURNTRANSFER, 1); - curl_setopt($curlHandler, CURLOPT_SSL_VERIFYPEER, FALSE); - curl_setopt($curlHandler, CURLOPT_TIMEOUT, 60); - // Execute the request. - $result = curl_exec($curlHandler); - - // close cURL resource, and free up system resources - curl_close($curlHandler); + $curl = new Varien_Http_Adapter_Curl(); + $verifyPeerValue = Mage::getStoreConfig('xmlconnect/mobile_application/curl_ssl_verifypeer'); + $curl->setConfig(array( + 'timeout' => Mage_XmlConnect_Helper_Data::CURLOPT_DEFAULT_TIMEOUT, + 'verifypeer' => $verifyPeerValue, 'verifyhost' => 2, 'header' => false + )); + + $mCommerceUrl = $appConnectorUrl . $params['key']; + $curl->write(Zend_Http_Client::POST, $mCommerceUrl, CURL_HTTP_VERSION_1_1, array(), $params); + + $result = $curl->read(); + if(false === $result) { + Mage::log('Curl error: ' . $curl->getError()); + $curl->close(); + Mage::throwException($this->__('Request internal error.')); + } + $curl->close(); // Assert that we received an expected message in reponse. $resultArray = json_decode($result, true); @@ -1313,13 +1317,13 @@ public function queueMessageAction() } if (isset($template)) { - $appCode = $template->getAppCode(); + $applicationId = $template->getApplicationId(); } else { - $appCode = Mage::getModel('xmlconnect/template')->load($message->getTemplateId())->getAppCode(); + $applicationId = Mage::getModel('xmlconnect/template')->load($message->getTemplateId())->getApplicationId(); } /** @var $app Mage_XmlConnect_Model_Application */ - $app = Mage::getModel('xmlconnect/application')->loadByCode($appCode); + $app = Mage::getModel('xmlconnect/application')->load($applicationId); if(!$app->isNotificationsActive()) { $this->_getSession()->addError( diff --git a/app/code/core/Mage/XmlConnect/controllers/CatalogController.php b/app/code/core/Mage/XmlConnect/controllers/CatalogController.php index 9b1381c2e8..a8775f1aff 100644 --- a/app/code/core/Mage/XmlConnect/controllers/CatalogController.php +++ b/app/code/core/Mage/XmlConnect/controllers/CatalogController.php @@ -295,14 +295,7 @@ public function sendEmailAction() $model->setWebsiteId(Mage::app()->getStore()->getWebsiteId()); Mage::register('send_to_friend_model', $model); -/* - if ($model->getMaxSendsToFriend()) { - $this->_message($this->__('Messages cannot be sent more than %d times in an hour.', - $model->getMaxSendsToFriend()), - self::MESSAGE_STATUS_WARNING); - return $this; - } -*/ + $data = $this->getRequest()->getPost(); if (!$data) { diff --git a/app/code/core/Mage/XmlConnect/controllers/CheckoutController.php b/app/code/core/Mage/XmlConnect/controllers/CheckoutController.php index 4cc97dbcb5..c7a0161136 100644 --- a/app/code/core/Mage/XmlConnect/controllers/CheckoutController.php +++ b/app/code/core/Mage/XmlConnect/controllers/CheckoutController.php @@ -332,8 +332,7 @@ public function saveShippingMethodAction() if (!$result) { Mage::dispatchEvent('checkout_controller_onepage_save_shipping_method', array( - 'request' => $this->getRequest(), - 'quote' => $this->getOnepage()->getQuote() + 'request' => $this->getRequest(), 'quote' => $this->getOnepage()->getQuote() )); $this->getOnepage()->getQuote()->collectTotals()->save(); @@ -343,8 +342,7 @@ public function saveShippingMethodAction() $result['message'] = array($result['message']); } Mage::dispatchEvent('checkout_controller_onepage_save_shipping_method', array( - 'request' => $this->getRequest(), - 'quote' => $this->getOnepage()->getQuote() + 'request' => $this->getRequest(), 'quote' => $this->getOnepage()->getQuote() )); $this->getOnepage()->getQuote()->collectTotals()->save(); $this->_message(implode('. ', $result['message']), self::MESSAGE_STATUS_ERROR); diff --git a/app/code/core/Mage/XmlConnect/controllers/CustomerController.php b/app/code/core/Mage/XmlConnect/controllers/CustomerController.php index 35ce112d60..d28f38207d 100644 --- a/app/code/core/Mage/XmlConnect/controllers/CustomerController.php +++ b/app/code/core/Mage/XmlConnect/controllers/CustomerController.php @@ -367,7 +367,6 @@ public function forgotPasswordAction() public function addressAction() { if (!$this->_getSession()->isLoggedIn()) { - Mage::log('address:'.$this->_getSession()->getSessionId()); $this->_message( $this->__('Customer not logged in.'), self::MESSAGE_STATUS_ERROR, array('logged_in' => '0') ); diff --git a/app/code/core/Mage/XmlConnect/controllers/PbridgeController.php b/app/code/core/Mage/XmlConnect/controllers/PbridgeController.php index 8a33ad5a1f..c9ee4ea260 100755 --- a/app/code/core/Mage/XmlConnect/controllers/PbridgeController.php +++ b/app/code/core/Mage/XmlConnect/controllers/PbridgeController.php @@ -60,9 +60,7 @@ protected function _initActionLayout() protected function _checkPbridge() { if (!is_object(Mage::getConfig()->getNode('modules/Enterprise_Pbridge'))) { - $this->getResponse()->setBody( - $this->__('Payment Bridge module unavailable.') - ); + $this->getResponse()->setBody($this->__('Payment Bridge module unavailable.')); return false; } return true; diff --git a/app/code/core/Mage/XmlConnect/etc/config.xml b/app/code/core/Mage/XmlConnect/etc/config.xml index 339824ed87..5e9b71ab25 100644 --- a/app/code/core/Mage/XmlConnect/etc/config.xml +++ b/app/code/core/Mage/XmlConnect/etc/config.xml @@ -29,7 +29,7 @@ 1.6.0.0 - 22.0 + 22.1 @@ -387,6 +387,7 @@ + 1 www.magentocommerce.com/products/index.php/mobile/activate/index/key/ http://www.magentocommerce.com/product/mobile http://www.magentocommerce.com/product/mobile#resubmission diff --git a/app/code/core/Zend/Date.php b/app/code/core/Zend/Date.php new file mode 100644 index 0000000000..1992f51bdb --- /dev/null +++ b/app/code/core/Zend/Date.php @@ -0,0 +1,5008 @@ + 'iso', // format for date strings 'iso' or 'php' + 'fix_dst' => true, // fix dst on summer/winter time change + 'extend_month' => false, // false - addMonth like SQL, true like excel + 'cache' => null, // cache to set + 'timesync' => null // timesync server to set + ); + + // Class wide Date Constants + const DAY = 'dd'; + const DAY_SHORT = 'd'; + const DAY_SUFFIX = 'SS'; + const DAY_OF_YEAR = 'D'; + const WEEKDAY = 'EEEE'; + const WEEKDAY_SHORT = 'EEE'; + const WEEKDAY_NARROW = 'E'; + const WEEKDAY_NAME = 'EE'; + const WEEKDAY_8601 = 'eee'; + const WEEKDAY_DIGIT = 'e'; + const WEEK = 'ww'; + const MONTH = 'MM'; + const MONTH_SHORT = 'M'; + const MONTH_DAYS = 'ddd'; + const MONTH_NAME = 'MMMM'; + const MONTH_NAME_SHORT = 'MMM'; + const MONTH_NAME_NARROW = 'MMMMM'; + const YEAR = 'y'; + const YEAR_SHORT = 'yy'; + const YEAR_8601 = 'Y'; + const YEAR_SHORT_8601 = 'YY'; + const LEAPYEAR = 'l'; + const MERIDIEM = 'a'; + const SWATCH = 'B'; + const HOUR = 'HH'; + const HOUR_SHORT = 'H'; + const HOUR_AM = 'hh'; + const HOUR_SHORT_AM = 'h'; + const MINUTE = 'mm'; + const MINUTE_SHORT = 'm'; + const SECOND = 'ss'; + const SECOND_SHORT = 's'; + const MILLISECOND = 'S'; + const TIMEZONE_NAME = 'zzzz'; + const DAYLIGHT = 'I'; + const GMT_DIFF = 'Z'; + const GMT_DIFF_SEP = 'ZZZZ'; + const TIMEZONE = 'z'; + const TIMEZONE_SECS = 'X'; + const ISO_8601 = 'c'; + const RFC_2822 = 'r'; + const TIMESTAMP = 'U'; + const ERA = 'G'; + const ERA_NAME = 'GGGG'; + const ERA_NARROW = 'GGGGG'; + const DATES = 'F'; + const DATE_FULL = 'FFFFF'; + const DATE_LONG = 'FFFF'; + const DATE_MEDIUM = 'FFF'; + const DATE_SHORT = 'FF'; + const TIMES = 'WW'; + const TIME_FULL = 'TTTTT'; + const TIME_LONG = 'TTTT'; + const TIME_MEDIUM = 'TTT'; + const TIME_SHORT = 'TT'; + const DATETIME = 'K'; + const DATETIME_FULL = 'KKKKK'; + const DATETIME_LONG = 'KKKK'; + const DATETIME_MEDIUM = 'KKK'; + const DATETIME_SHORT = 'KK'; + const ATOM = 'OOO'; + const COOKIE = 'CCC'; + const RFC_822 = 'R'; + const RFC_850 = 'RR'; + const RFC_1036 = 'RRR'; + const RFC_1123 = 'RRRR'; + const RFC_3339 = 'RRRRR'; + const RSS = 'SSS'; + const W3C = 'WWW'; + + /** + * Minimum allowed year value + */ + const YEAR_MIN_VALUE = -10000; + + /** + * Maximum allowed year value + */ + const YEAR_MAX_VALUE = 10000; + + /** + * Generates the standard date object, could be a unix timestamp, localized date, + * string, integer, array and so on. Also parts of dates or time are supported + * Always set the default timezone: http://php.net/date_default_timezone_set + * For example, in your bootstrap: date_default_timezone_set('America/Los_Angeles'); + * For detailed instructions please look in the docu. + * + * @param string|integer|Zend_Date|array $date OPTIONAL Date value or value of date part to set + * ,depending on $part. If null the actual time is set + * @param string $part OPTIONAL Defines the input format of $date + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date + * @throws Zend_Date_Exception + */ + public function __construct($date = null, $part = null, $locale = null) + { + if (is_object($date) and !($date instanceof Zend_TimeSync_Protocol) and + !($date instanceof Zend_Date)) { + if ($locale instanceof Zend_Locale) { + $locale = $date; + $date = null; + $part = null; + } else { + $date = (string) $date; + } + } + + if (($date !== null) and !is_array($date) and !($date instanceof Zend_TimeSync_Protocol) and + !($date instanceof Zend_Date) and !defined($date) and Zend_Locale::isLocale($date, true, false)) { + $locale = $date; + $date = null; + $part = null; + } else if (($part !== null) and !defined($part) and Zend_Locale::isLocale($part, true, false)) { + $locale = $part; + $part = null; + } + + $this->setLocale($locale); + if (is_string($date) && ($part === null) && (strlen($date) <= 5)) { + $part = $date; + $date = null; + } + + if ($date === null) { + if ($part === null) { + $date = time(); + } else if ($part !== self::TIMESTAMP) { + $date = self::now($locale); + $date = $date->get($part); + } + } + + if ($date instanceof Zend_TimeSync_Protocol) { + $date = $date->getInfo(); + $date = $this->_getTime($date['offset']); + $part = null; + } else if (parent::$_defaultOffset != 0) { + $date = $this->_getTime(parent::$_defaultOffset); + } + + // set the timezone and offset for $this + $zone = @date_default_timezone_get(); + $this->setTimezone($zone); + + // try to get timezone from date-string + if (!is_int($date)) { + $zone = $this->getTimezoneFromString($date); + $this->setTimezone($zone); + } + + // set datepart + if (($part !== null && $part !== self::TIMESTAMP) or (!is_numeric($date))) { + // switch off dst handling for value setting + $this->setUnixTimestamp($this->getGmtOffset()); + $this->set($date, $part, $this->_locale); + + // DST fix + if (is_array($date) === true) { + if (!isset($date['hour'])) { + $date['hour'] = 0; + } + + $hour = $this->toString('H', 'iso', true); + $hour = $date['hour'] - $hour; + switch ($hour) { + case 1 : + case -23 : + $this->addTimestamp(3600); + break; + case -1 : + case 23 : + $this->subTimestamp(3600); + break; + case 2 : + case -22 : + $this->addTimestamp(7200); + break; + case -2 : + case 22 : + $this->subTimestamp(7200); + break; + } + } + } else { + $this->setUnixTimestamp($date); + } + } + + /** + * Sets class wide options, if no option was given, the actual set options will be returned + * + * @param array $options Options to set + * @throws Zend_Date_Exception + * @return Options array if no option was given + */ + public static function setOptions(array $options = array()) + { + if (empty($options)) { + return self::$_options; + } + + foreach ($options as $name => $value) { + $name = strtolower($name); + + if (array_key_exists($name, self::$_options)) { + switch($name) { + case 'format_type' : + if ((strtolower($value) != 'php') && (strtolower($value) != 'iso')) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("Unknown format type ($value) for dates, only 'iso' and 'php' supported", 0, null, $value); + } + break; + case 'fix_dst' : + if (!is_bool($value)) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("'fix_dst' has to be boolean", 0, null, $value); + } + break; + case 'extend_month' : + if (!is_bool($value)) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("'extend_month' has to be boolean", 0, null, $value); + } + break; + case 'cache' : + if ($value === null) { + parent::$_cache = null; + } else { + if (!$value instanceof Zend_Cache_Core) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("Instance of Zend_Cache expected"); + } + + parent::$_cache = $value; + parent::$_cacheTags = Zend_Date_DateObject::_getTagSupportForCache(); + Zend_Locale_Data::setCache($value); + } + break; + case 'timesync' : + if ($value === null) { + parent::$_defaultOffset = 0; + } else { + if (!$value instanceof Zend_TimeSync_Protocol) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("Instance of Zend_TimeSync expected"); + } + + $date = $value->getInfo(); + parent::$_defaultOffset = $date['offset']; + } + break; + } + self::$_options[$name] = $value; + } + else { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("Unknown option: $name = $value"); + } + } + } + + /** + * Returns this object's internal UNIX timestamp (equivalent to Zend_Date::TIMESTAMP). + * If the timestamp is too large for integers, then the return value will be a string. + * This function does not return the timestamp as an object. + * Use clone() or copyPart() instead. + * + * @return integer|string UNIX timestamp + */ + public function getTimestamp() + { + return $this->getUnixTimestamp(); + } + + /** + * Returns the calculated timestamp + * HINT: timestamps are always GMT + * + * @param string $calc Type of calculation to make + * @param string|integer|array|Zend_Date $stamp Timestamp to calculate, when null the actual timestamp is calculated + * @return Zend_Date|integer + * @throws Zend_Date_Exception + */ + private function _timestamp($calc, $stamp) + { + if ($stamp instanceof Zend_Date) { + // extract timestamp from object + $stamp = $stamp->getTimestamp(); + } + + if (is_array($stamp)) { + if (isset($stamp['timestamp']) === true) { + $stamp = $stamp['timestamp']; + } else { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception('no timestamp given in array'); + } + } + + if ($calc === 'set') { + $return = $this->setUnixTimestamp($stamp); + } else { + $return = $this->_calcdetail($calc, $stamp, self::TIMESTAMP, null); + } + if ($calc != 'cmp') { + return $this; + } + return $return; + } + + /** + * Sets a new timestamp + * + * @param integer|string|array|Zend_Date $timestamp Timestamp to set + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function setTimestamp($timestamp) + { + return $this->_timestamp('set', $timestamp); + } + + /** + * Adds a timestamp + * + * @param integer|string|array|Zend_Date $timestamp Timestamp to add + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function addTimestamp($timestamp) + { + return $this->_timestamp('add', $timestamp); + } + + /** + * Subtracts a timestamp + * + * @param integer|string|array|Zend_Date $timestamp Timestamp to sub + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function subTimestamp($timestamp) + { + return $this->_timestamp('sub', $timestamp); + } + + /** + * Compares two timestamps, returning the difference as integer + * + * @param integer|string|array|Zend_Date $timestamp Timestamp to compare + * @return integer 0 = equal, 1 = later, -1 = earlier + * @throws Zend_Date_Exception + */ + public function compareTimestamp($timestamp) + { + return $this->_timestamp('cmp', $timestamp); + } + + /** + * Returns a string representation of the object + * Supported format tokens are: + * G - era, y - year, Y - ISO year, M - month, w - week of year, D - day of year, d - day of month + * E - day of week, e - number of weekday (1-7), h - hour 1-12, H - hour 0-23, m - minute, s - second + * A - milliseconds of day, z - timezone, Z - timezone offset, S - fractional second, a - period of day + * + * Additionally format tokens but non ISO conform are: + * SS - day suffix, eee - php number of weekday(0-6), ddd - number of days per month + * l - Leap year, B - swatch internet time, I - daylight saving time, X - timezone offset in seconds + * r - RFC2822 format, U - unix timestamp + * + * Not supported ISO tokens are + * u - extended year, Q - quarter, q - quarter, L - stand alone month, W - week of month + * F - day of week of month, g - modified julian, c - stand alone weekday, k - hour 0-11, K - hour 1-24 + * v - wall zone + * + * @param string $format OPTIONAL Rule for formatting output. If null the default date format is used + * @param string $type OPTIONAL Type for the format string which overrides the standard setting + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return string + */ + public function toString($format = null, $type = null, $locale = null) + { + if (is_object($format)) { + if ($format instanceof Zend_Locale) { + $locale = $format; + $format = null; + } else { + $format = (string) $format; + } + } + + if (is_object($type)) { + if ($type instanceof Zend_Locale) { + $locale = $type; + $type = null; + } else { + $type = (string) $type; + } + } + + if (($format !== null) && !defined($format) + && ($format != 'ee') && ($format != 'ss') && ($format != 'GG') && ($format != 'MM') && ($format != 'EE') && ($format != 'TT') + && Zend_Locale::isLocale($format, null, false)) { + $locale = $format; + $format = null; + } + + if (($type !== null) and ($type != 'php') and ($type != 'iso') and + Zend_Locale::isLocale($type, null, false)) { + $locale = $type; + $type = null; + } + + if ($locale === null) { + $locale = $this->getLocale(); + } + + if ($format === null) { + $format = Zend_Locale_Format::getDateFormat($locale) . ' ' . Zend_Locale_Format::getTimeFormat($locale); + } else if (((self::$_options['format_type'] == 'php') && ($type === null)) or ($type == 'php')) { + $format = Zend_Locale_Format::convertPhpToIsoFormat($format); + } + + return $this->date($this->_toToken($format, $locale), $this->getUnixTimestamp(), false); + } + + /** + * Returns a string representation of the date which is equal with the timestamp + * + * @return string + */ + public function __toString() + { + return $this->toString(null, $this->_locale); + } + + /** + * Returns a integer representation of the object + * But returns false when the given part is no value f.e. Month-Name + * + * @param string|integer|Zend_Date $part OPTIONAL Defines the date or datepart to return as integer + * @return integer|false + */ + public function toValue($part = null) + { + $result = $this->get($part); + if (is_numeric($result)) { + return intval("$result"); + } else { + return false; + } + } + + /** + * Returns an array representation of the object + * + * @return array + */ + public function toArray() + { + return array('day' => $this->toString(self::DAY_SHORT, 'iso'), + 'month' => $this->toString(self::MONTH_SHORT, 'iso'), + 'year' => $this->toString(self::YEAR, 'iso'), + 'hour' => $this->toString(self::HOUR_SHORT, 'iso'), + 'minute' => $this->toString(self::MINUTE_SHORT, 'iso'), + 'second' => $this->toString(self::SECOND_SHORT, 'iso'), + 'timezone' => $this->toString(self::TIMEZONE, 'iso'), + 'timestamp' => $this->toString(self::TIMESTAMP, 'iso'), + 'weekday' => $this->toString(self::WEEKDAY_8601, 'iso'), + 'dayofyear' => $this->toString(self::DAY_OF_YEAR, 'iso'), + 'week' => $this->toString(self::WEEK, 'iso'), + 'gmtsecs' => $this->toString(self::TIMEZONE_SECS, 'iso')); + } + + /** + * Returns a representation of a date or datepart + * This could be for example a localized monthname, the time without date, + * the era or only the fractional seconds. There are about 50 different supported date parts. + * For a complete list of supported datepart values look into the docu + * + * @param string $part OPTIONAL Part of the date to return, if null the timestamp is returned + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return string date or datepart + */ + public function get($part = null, $locale = null) + { + if ($locale === null) { + $locale = $this->getLocale(); + } + + if (($part !== null) && !defined($part) + && ($part != 'ee') && ($part != 'ss') && ($part != 'GG') && ($part != 'MM') && ($part != 'EE') && ($part != 'TT') + && Zend_Locale::isLocale($part, null, false)) { + $locale = $part; + $part = null; + } + + if ($part === null) { + $part = self::TIMESTAMP; + } else if (self::$_options['format_type'] == 'php') { + $part = Zend_Locale_Format::convertPhpToIsoFormat($part); + } + + return $this->date($this->_toToken($part, $locale), $this->getUnixTimestamp(), false); + } + + /** + * Internal method to apply tokens + * + * @param string $part + * @param string $locale + * @return string + */ + private function _toToken($part, $locale) { + // get format tokens + $comment = false; + $format = ''; + $orig = ''; + for ($i = 0; isset($part[$i]); ++$i) { + if ($part[$i] == "'") { + $comment = $comment ? false : true; + if (isset($part[$i+1]) && ($part[$i+1] == "'")) { + $comment = $comment ? false : true; + $format .= "\\'"; + ++$i; + } + + $orig = ''; + continue; + } + + if ($comment) { + $format .= '\\' . $part[$i]; + $orig = ''; + } else { + $orig .= $part[$i]; + if (!isset($part[$i+1]) || (isset($orig[0]) && ($orig[0] != $part[$i+1]))) { + $format .= $this->_parseIsoToDate($orig, $locale); + $orig = ''; + } + } + } + + return $format; + } + + /** + * Internal parsing method + * + * @param string $token + * @param string $locale + * @return string + */ + private function _parseIsoToDate($token, $locale) { + switch($token) { + case self::DAY : + return 'd'; + break; + + case self::WEEKDAY_SHORT : + $weekday = strtolower($this->date('D', $this->getUnixTimestamp(), false)); + $day = Zend_Locale_Data::getContent($locale, 'day', array('gregorian', 'format', 'wide', $weekday)); + return $this->_toComment(iconv_substr($day, 0, 3, 'UTF-8')); + break; + + case self::DAY_SHORT : + return 'j'; + break; + + case self::WEEKDAY : + $weekday = strtolower($this->date('D', $this->getUnixTimestamp(), false)); + return $this->_toComment(Zend_Locale_Data::getContent($locale, 'day', array('gregorian', 'format', 'wide', $weekday))); + break; + + case self::WEEKDAY_8601 : + return 'N'; + break; + + case 'ee' : + return $this->_toComment(str_pad($this->date('N', $this->getUnixTimestamp(), false), 2, '0', STR_PAD_LEFT)); + break; + + case self::DAY_SUFFIX : + return 'S'; + break; + + case self::WEEKDAY_DIGIT : + return 'w'; + break; + + case self::DAY_OF_YEAR : + return 'z'; + break; + + case 'DDD' : + return $this->_toComment(str_pad($this->date('z', $this->getUnixTimestamp(), false), 3, '0', STR_PAD_LEFT)); + break; + + case 'DD' : + return $this->_toComment(str_pad($this->date('z', $this->getUnixTimestamp(), false), 2, '0', STR_PAD_LEFT)); + break; + + case self::WEEKDAY_NARROW : + case 'EEEEE' : + $weekday = strtolower($this->date('D', $this->getUnixTimestamp(), false)); + $day = Zend_Locale_Data::getContent($locale, 'day', array('gregorian', 'format', 'abbreviated', $weekday)); + return $this->_toComment(iconv_substr($day, 0, 1, 'UTF-8')); + break; + + case self::WEEKDAY_NAME : + $weekday = strtolower($this->date('D', $this->getUnixTimestamp(), false)); + return $this->_toComment(Zend_Locale_Data::getContent($locale, 'day', array('gregorian', 'format', 'abbreviated', $weekday))); + break; + + case 'w' : + $week = $this->date('W', $this->getUnixTimestamp(), false); + return $this->_toComment(($week[0] == '0') ? $week[1] : $week); + break; + + case self::WEEK : + return 'W'; + break; + + case self::MONTH_NAME : + $month = $this->date('n', $this->getUnixTimestamp(), false); + return $this->_toComment(Zend_Locale_Data::getContent($locale, 'month', array('gregorian', 'format', 'wide', $month))); + break; + + case self::MONTH : + return 'm'; + break; + + case self::MONTH_NAME_SHORT : + $month = $this->date('n', $this->getUnixTimestamp(), false); + return $this->_toComment(Zend_Locale_Data::getContent($locale, 'month', array('gregorian', 'format', 'abbreviated', $month))); + break; + + case self::MONTH_SHORT : + return 'n'; + break; + + case self::MONTH_DAYS : + return 't'; + break; + + case self::MONTH_NAME_NARROW : + $month = $this->date('n', $this->getUnixTimestamp(), false); + $mon = Zend_Locale_Data::getContent($locale, 'month', array('gregorian', 'format', 'abbreviated', $month)); + return $this->_toComment(iconv_substr($mon, 0, 1, 'UTF-8')); + break; + + case self::LEAPYEAR : + return 'L'; + break; + + case self::YEAR_8601 : + return 'o'; + break; + + case self::YEAR : + return 'Y'; + break; + + case self::YEAR_SHORT : + return 'y'; + break; + + case self::YEAR_SHORT_8601 : + return $this->_toComment(substr($this->date('o', $this->getUnixTimestamp(), false), -2, 2)); + break; + + case self::MERIDIEM : + $am = $this->date('a', $this->getUnixTimestamp(), false); + if ($am == 'am') { + return $this->_toComment(Zend_Locale_Data::getContent($locale, 'am')); + } + + return $this->_toComment(Zend_Locale_Data::getContent($locale, 'pm')); + break; + + case self::SWATCH : + return 'B'; + break; + + case self::HOUR_SHORT_AM : + return 'g'; + break; + + case self::HOUR_SHORT : + return 'G'; + break; + + case self::HOUR_AM : + return 'h'; + break; + + case self::HOUR : + return 'H'; + break; + + case self::MINUTE : + return $this->_toComment(str_pad($this->date('i', $this->getUnixTimestamp(), false), 2, '0', STR_PAD_LEFT)); + break; + + case self::SECOND : + return $this->_toComment(str_pad($this->date('s', $this->getUnixTimestamp(), false), 2, '0', STR_PAD_LEFT)); + break; + + case self::MINUTE_SHORT : + return 'i'; + break; + + case self::SECOND_SHORT : + return 's'; + break; + + case self::MILLISECOND : + return $this->_toComment($this->getMilliSecond()); + break; + + case self::TIMEZONE_NAME : + case 'vvvv' : + return 'e'; + break; + + case self::DAYLIGHT : + return 'I'; + break; + + case self::GMT_DIFF : + case 'ZZ' : + case 'ZZZ' : + return 'O'; + break; + + case self::GMT_DIFF_SEP : + return 'P'; + break; + + case self::TIMEZONE : + case 'v' : + case 'zz' : + case 'zzz' : + return 'T'; + break; + + case self::TIMEZONE_SECS : + return 'Z'; + break; + + case self::ISO_8601 : + return 'c'; + break; + + case self::RFC_2822 : + return 'r'; + break; + + case self::TIMESTAMP : + return 'U'; + break; + + case self::ERA : + case 'GG' : + case 'GGG' : + $year = $this->date('Y', $this->getUnixTimestamp(), false); + if ($year < 0) { + return $this->_toComment(Zend_Locale_Data::getContent($locale, 'era', array('gregorian', 'Abbr', '0'))); + } + + return $this->_toComment(Zend_Locale_Data::getContent($locale, 'era', array('gregorian', 'Abbr', '1'))); + break; + + case self::ERA_NARROW : + $year = $this->date('Y', $this->getUnixTimestamp(), false); + if ($year < 0) { + return $this->_toComment(iconv_substr(Zend_Locale_Data::getContent($locale, 'era', array('gregorian', 'Abbr', '0')), 0, 1, 'UTF-8')) . '.'; + } + + return $this->_toComment(iconv_substr(Zend_Locale_Data::getContent($locale, 'era', array('gregorian', 'Abbr', '1')), 0, 1, 'UTF-8')) . '.'; + break; + + case self::ERA_NAME : + $year = $this->date('Y', $this->getUnixTimestamp(), false); + if ($year < 0) { + return $this->_toComment(Zend_Locale_Data::getContent($locale, 'era', array('gregorian', 'Names', '0'))); + } + + return $this->_toComment(Zend_Locale_Data::getContent($locale, 'era', array('gregorian', 'Names', '1'))); + break; + + case self::DATES : + return $this->_toToken(Zend_Locale_Format::getDateFormat($locale), $locale); + break; + + case self::DATE_FULL : + return $this->_toToken(Zend_Locale_Data::getContent($locale, 'date', array('gregorian', 'full')), $locale); + break; + + case self::DATE_LONG : + return $this->_toToken(Zend_Locale_Data::getContent($locale, 'date', array('gregorian', 'long')), $locale); + break; + + case self::DATE_MEDIUM : + return $this->_toToken(Zend_Locale_Data::getContent($locale, 'date', array('gregorian', 'medium')), $locale); + break; + + case self::DATE_SHORT : + return $this->_toToken(Zend_Locale_Data::getContent($locale, 'date', array('gregorian', 'short')), $locale); + break; + + case self::TIMES : + return $this->_toToken(Zend_Locale_Format::getTimeFormat($locale), $locale); + break; + + case self::TIME_FULL : + return $this->_toToken(Zend_Locale_Data::getContent($locale, 'time', 'full'), $locale); + break; + + case self::TIME_LONG : + return $this->_toToken(Zend_Locale_Data::getContent($locale, 'time', 'long'), $locale); + break; + + case self::TIME_MEDIUM : + return $this->_toToken(Zend_Locale_Data::getContent($locale, 'time', 'medium'), $locale); + break; + + case self::TIME_SHORT : + return $this->_toToken(Zend_Locale_Data::getContent($locale, 'time', 'short'), $locale); + break; + + case self::DATETIME : + return $this->_toToken(Zend_Locale_Format::getDateTimeFormat($locale), $locale); + break; + + case self::DATETIME_FULL : + return $this->_toToken(Zend_Locale_Data::getContent($locale, 'datetime', array('gregorian', 'full')), $locale); + break; + + case self::DATETIME_LONG : + return $this->_toToken(Zend_Locale_Data::getContent($locale, 'datetime', array('gregorian', 'long')), $locale); + break; + + case self::DATETIME_MEDIUM : + return $this->_toToken(Zend_Locale_Data::getContent($locale, 'datetime', array('gregorian', 'medium')), $locale); + break; + + case self::DATETIME_SHORT : + return $this->_toToken(Zend_Locale_Data::getContent($locale, 'datetime', array('gregorian', 'short')), $locale); + break; + + case self::ATOM : + return 'Y\-m\-d\TH\:i\:sP'; + break; + + case self::COOKIE : + return 'l\, d\-M\-y H\:i\:s e'; + break; + + case self::RFC_822 : + return 'D\, d M y H\:i\:s O'; + break; + + case self::RFC_850 : + return 'l\, d\-M\-y H\:i\:s e'; + break; + + case self::RFC_1036 : + return 'D\, d M y H\:i\:s O'; + break; + + case self::RFC_1123 : + return 'D\, d M Y H\:i\:s O'; + break; + + case self::RFC_3339 : + return 'Y\-m\-d\TH\:i\:sP'; + break; + + case self::RSS : + return 'D\, d M Y H\:i\:s O'; + break; + + case self::W3C : + return 'Y\-m\-d\TH\:i\:sP'; + break; + } + + if ($token == '') { + return ''; + } + + switch ($token[0]) { + case 'y' : + if ((strlen($token) == 4) && (abs($this->getUnixTimestamp()) <= 0x7FFFFFFF)) { + return 'Y'; + } + + $length = iconv_strlen($token, 'UTF-8'); + return $this->_toComment(str_pad($this->date('Y', $this->getUnixTimestamp(), false), $length, '0', STR_PAD_LEFT)); + break; + + case 'Y' : + if ((strlen($token) == 4) && (abs($this->getUnixTimestamp()) <= 0x7FFFFFFF)) { + return 'o'; + } + + $length = iconv_strlen($token, 'UTF-8'); + return $this->_toComment(str_pad($this->date('o', $this->getUnixTimestamp(), false), $length, '0', STR_PAD_LEFT)); + break; + + case 'A' : + $length = iconv_strlen($token, 'UTF-8'); + $result = substr($this->getMilliSecond(), 0, 3); + $result += $this->date('s', $this->getUnixTimestamp(), false) * 1000; + $result += $this->date('i', $this->getUnixTimestamp(), false) * 60000; + $result += $this->date('H', $this->getUnixTimestamp(), false) * 3600000; + + return $this->_toComment(str_pad($result, $length, '0', STR_PAD_LEFT)); + break; + } + + return $this->_toComment($token); + } + + /** + * Private function to make a comment of a token + * + * @param string $token + * @return string + */ + private function _toComment($token) + { + $token = str_split($token); + $result = ''; + foreach ($token as $tok) { + $result .= '\\' . $tok; + } + + return $result; + } + + /** + * Return digit from standard names (english) + * Faster implementation than locale aware searching + * + * @param string $name + * @return integer Number of this month + * @throws Zend_Date_Exception + */ + private function _getDigitFromName($name) + { + switch($name) { + case "Jan": + return 1; + + case "Feb": + return 2; + + case "Mar": + return 3; + + case "Apr": + return 4; + + case "May": + return 5; + + case "Jun": + return 6; + + case "Jul": + return 7; + + case "Aug": + return 8; + + case "Sep": + return 9; + + case "Oct": + return 10; + + case "Nov": + return 11; + + case "Dec": + return 12; + + default: + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception('Month ($name) is not a known month'); + } + } + + /** + * Counts the exact year number + * < 70 - 2000 added, >70 < 100 - 1900, others just returned + * + * @param integer $value year number + * @return integer Number of year + */ + public static function getFullYear($value) + { + if ($value >= 0) { + if ($value < 70) { + $value += 2000; + } else if ($value < 100) { + $value += 1900; + } + } + return $value; + } + + /** + * Sets the given date as new date or a given datepart as new datepart returning the new datepart + * This could be for example a localized dayname, the date without time, + * the month or only the seconds. There are about 50 different supported date parts. + * For a complete list of supported datepart values look into the docu + * + * @param string|integer|array|Zend_Date $date Date or datepart to set + * @param string $part OPTIONAL Part of the date to set, if null the timestamp is set + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function set($date, $part = null, $locale = null) + { + if (self::$_options['format_type'] == 'php') { + $part = Zend_Locale_Format::convertPhpToIsoFormat($part); + } + + $zone = $this->getTimezoneFromString($date); + $this->setTimezone($zone); + + $this->_calculate('set', $date, $part, $locale); + return $this; + } + + /** + * Adds a date or datepart to the existing date, by extracting $part from $date, + * and modifying this object by adding that part. The $part is then extracted from + * this object and returned as an integer or numeric string (for large values, or $part's + * corresponding to pre-defined formatted date strings). + * This could be for example a ISO 8601 date, the hour the monthname or only the minute. + * There are about 50 different supported date parts. + * For a complete list of supported datepart values look into the docu. + * + * @param string|integer|array|Zend_Date $date Date or datepart to add + * @param string $part OPTIONAL Part of the date to add, if null the timestamp is added + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function add($date, $part = self::TIMESTAMP, $locale = null) + { + if (self::$_options['format_type'] == 'php') { + $part = Zend_Locale_Format::convertPhpToIsoFormat($part); + } + + $this->_calculate('add', $date, $part, $locale); + return $this; + } + + /** + * Subtracts a date from another date. + * This could be for example a RFC2822 date, the time, + * the year or only the timestamp. There are about 50 different supported date parts. + * For a complete list of supported datepart values look into the docu + * Be aware: Adding -2 Months is not equal to Subtracting 2 Months !!! + * + * @param string|integer|array|Zend_Date $date Date or datepart to subtract + * @param string $part OPTIONAL Part of the date to sub, if null the timestamp is subtracted + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function sub($date, $part = self::TIMESTAMP, $locale = null) + { + if (self::$_options['format_type'] == 'php') { + $part = Zend_Locale_Format::convertPhpToIsoFormat($part); + } + + $this->_calculate('sub', $date, $part, $locale); + return $this; + } + + /** + * Compares a date or datepart with the existing one. + * Returns -1 if earlier, 0 if equal and 1 if later. + * + * @param string|integer|array|Zend_Date $date Date or datepart to compare with the date object + * @param string $part OPTIONAL Part of the date to compare, if null the timestamp is subtracted + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return integer 0 = equal, 1 = later, -1 = earlier + * @throws Zend_Date_Exception + */ + public function compare($date, $part = self::TIMESTAMP, $locale = null) + { + if (self::$_options['format_type'] == 'php') { + $part = Zend_Locale_Format::convertPhpToIsoFormat($part); + } + + $compare = $this->_calculate('cmp', $date, $part, $locale); + + if ($compare > 0) { + return 1; + } else if ($compare < 0) { + return -1; + } + return 0; + } + + /** + * Returns a new instance of Zend_Date with the selected part copied. + * To make an exact copy, use PHP's clone keyword. + * For a complete list of supported date part values look into the docu. + * If a date part is copied, all other date parts are set to standard values. + * For example: If only YEAR is copied, the returned date object is equal to + * 01-01-YEAR 00:00:00 (01-01-1970 00:00:00 is equal to timestamp 0) + * If only HOUR is copied, the returned date object is equal to + * 01-01-1970 HOUR:00:00 (so $this contains a timestamp equal to a timestamp of 0 plus HOUR). + * + * @param string $part Part of the date to compare, if null the timestamp is subtracted + * @param string|Zend_Locale $locale OPTIONAL New object's locale. No adjustments to timezone are made. + * @return Zend_Date New clone with requested part + */ + public function copyPart($part, $locale = null) + { + $clone = clone $this; // copy all instance variables + $clone->setUnixTimestamp(0); // except the timestamp + if ($locale != null) { + $clone->setLocale($locale); // set an other locale if selected + } + $clone->set($this, $part); + return $clone; + } + + /** + * Internal function, returns the offset of a given timezone + * + * @param string $zone + * @return integer + */ + public function getTimezoneFromString($zone) + { + if (is_array($zone)) { + return $this->getTimezone(); + } + + if ($zone instanceof Zend_Date) { + return $zone->getTimezone(); + } + + $match = array(); + preg_match('/\dZ$/', $zone, $match); + if (!empty($match)) { + return "Etc/UTC"; + } + + preg_match('/([+-]\d{2}):{0,1}\d{2}/', $zone, $match); + if (!empty($match) and ($match[count($match) - 1] <= 12) and ($match[count($match) - 1] >= -12)) { + $zone = "Etc/GMT"; + $zone .= ($match[count($match) - 1] < 0) ? "+" : "-"; + $zone .= (int) abs($match[count($match) - 1]); + return $zone; + } + + preg_match('/([[:alpha:]\/]{3,30})(?!.*([[:alpha:]\/]{3,30}))/', $zone, $match); + try { + if (!empty($match) and (!is_int($match[count($match) - 1]))) { + $oldzone = $this->getTimezone(); + $this->setTimezone($match[count($match) - 1]); + $result = $this->getTimezone(); + $this->setTimezone($oldzone); + if ($result !== $oldzone) { + return $match[count($match) - 1]; + } + } + } catch (Exception $e) { + // fall through + } + + return $this->getTimezone(); + } + + /** + * Calculates the date or object + * + * @param string $calc Calculation to make + * @param string|integer $date Date for calculation + * @param string|integer $comp Second date for calculation + * @param boolean|integer $dst Use dst correction if option is set + * @return integer|string|Zend_Date new timestamp or Zend_Date depending on calculation + */ + private function _assign($calc, $date, $comp = 0, $dst = false) + { + switch ($calc) { + case 'set' : + if (!empty($comp)) { + $this->setUnixTimestamp(call_user_func(Zend_Locale_Math::$sub, $this->getUnixTimestamp(), $comp)); + } + $this->setUnixTimestamp(call_user_func(Zend_Locale_Math::$add, $this->getUnixTimestamp(), $date)); + $value = $this->getUnixTimestamp(); + break; + case 'add' : + $this->setUnixTimestamp(call_user_func(Zend_Locale_Math::$add, $this->getUnixTimestamp(), $date)); + $value = $this->getUnixTimestamp(); + break; + case 'sub' : + $this->setUnixTimestamp(call_user_func(Zend_Locale_Math::$sub, $this->getUnixTimestamp(), $date)); + $value = $this->getUnixTimestamp(); + break; + default : + // cmp - compare + return call_user_func(Zend_Locale_Math::$comp, $comp, $date); + break; + } + + // dst-correction if 'fix_dst' = true and dst !== false but only for non UTC and non GMT + if ((self::$_options['fix_dst'] === true) and ($dst !== false) and ($this->_dst === true)) { + $hour = $this->toString(self::HOUR, 'iso'); + if ($hour != $dst) { + if (($dst == ($hour + 1)) or ($dst == ($hour - 23))) { + $value += 3600; + } else if (($dst == ($hour - 1)) or ($dst == ($hour + 23))) { + $value -= 3600; + } + $this->setUnixTimestamp($value); + } + } + return $this->getUnixTimestamp(); + } + + + /** + * Calculates the date or object + * + * @param string $calc Calculation to make, one of: 'add'|'sub'|'cmp'|'copy'|'set' + * @param string|integer|array|Zend_Date $date Date or datepart to calculate with + * @param string $part Part of the date to calculate, if null the timestamp is used + * @param string|Zend_Locale $locale Locale for parsing input + * @return integer|string|Zend_Date new timestamp + * @throws Zend_Date_Exception + */ + private function _calculate($calc, $date, $part, $locale) + { + if ($date === null) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception('parameter $date must be set, null is not allowed'); + } + + if (($part !== null) && (strlen($part) !== 2) && (Zend_Locale::isLocale($part, null, false))) { + $locale = $part; + $part = null; + } + + if ($locale === null) { + $locale = $this->getLocale(); + } + + $locale = (string) $locale; + + // Create date parts + $year = $this->toString(self::YEAR, 'iso'); + $month = $this->toString(self::MONTH_SHORT, 'iso'); + $day = $this->toString(self::DAY_SHORT, 'iso'); + $hour = $this->toString(self::HOUR_SHORT, 'iso'); + $minute = $this->toString(self::MINUTE_SHORT, 'iso'); + $second = $this->toString(self::SECOND_SHORT, 'iso'); + // If object extract value + if ($date instanceof Zend_Date) { + $date = $date->toString($part, 'iso', $locale); + } + + if (is_array($date) === true) { + if (empty($part) === false) { + switch($part) { + // Fall through + case self::DAY: + case self::DAY_SHORT: + if (isset($date['day']) === true) { + $date = $date['day']; + } + break; + // Fall through + case self::WEEKDAY_SHORT: + case self::WEEKDAY: + case self::WEEKDAY_8601: + case self::WEEKDAY_DIGIT: + case self::WEEKDAY_NARROW: + case self::WEEKDAY_NAME: + if (isset($date['weekday']) === true) { + $date = $date['weekday']; + $part = self::WEEKDAY_DIGIT; + } + break; + case self::DAY_OF_YEAR: + if (isset($date['day_of_year']) === true) { + $date = $date['day_of_year']; + } + break; + // Fall through + case self::MONTH: + case self::MONTH_SHORT: + case self::MONTH_NAME: + case self::MONTH_NAME_SHORT: + case self::MONTH_NAME_NARROW: + if (isset($date['month']) === true) { + $date = $date['month']; + } + break; + // Fall through + case self::YEAR: + case self::YEAR_SHORT: + case self::YEAR_8601: + case self::YEAR_SHORT_8601: + if (isset($date['year']) === true) { + $date = $date['year']; + } + break; + // Fall through + case self::HOUR: + case self::HOUR_AM: + case self::HOUR_SHORT: + case self::HOUR_SHORT_AM: + if (isset($date['hour']) === true) { + $date = $date['hour']; + } + break; + // Fall through + case self::MINUTE: + case self::MINUTE_SHORT: + if (isset($date['minute']) === true) { + $date = $date['minute']; + } + break; + // Fall through + case self::SECOND: + case self::SECOND_SHORT: + if (isset($date['second']) === true) { + $date = $date['second']; + } + break; + // Fall through + case self::TIMEZONE: + case self::TIMEZONE_NAME: + if (isset($date['timezone']) === true) { + $date = $date['timezone']; + } + break; + case self::TIMESTAMP: + if (isset($date['timestamp']) === true) { + $date = $date['timestamp']; + } + break; + case self::WEEK: + if (isset($date['week']) === true) { + $date = $date['week']; + } + break; + case self::TIMEZONE_SECS: + if (isset($date['gmtsecs']) === true) { + $date = $date['gmtsecs']; + } + break; + default: + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("datepart for part ($part) not found in array"); + break; + } + } else { + $hours = 0; + if (isset($date['hour']) === true) { + $hours = $date['hour']; + } + $minutes = 0; + if (isset($date['minute']) === true) { + $minutes = $date['minute']; + } + $seconds = 0; + if (isset($date['second']) === true) { + $seconds = $date['second']; + } + $months = 0; + if (isset($date['month']) === true) { + $months = $date['month']; + } + $days = 0; + if (isset($date['day']) === true) { + $days = $date['day']; + } + $years = 0; + if (isset($date['year']) === true) { + $years = $date['year']; + } + return $this->_assign($calc, $this->mktime($hours, $minutes, $seconds, $months, $days, $years, true), + $this->mktime($hour, $minute, $second, $month, $day, $year, true), $hour); + } + } + + // $date as object, part of foreign date as own date + switch($part) { + + // day formats + case self::DAY: + if (is_numeric($date)) { + return $this->_assign($calc, $this->mktime(0, 0, 0, 1, 1 + intval($date), 1970, true), + $this->mktime(0, 0, 0, 1, 1 + intval($day), 1970, true), $hour); + } + + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, day expected", 0, null, $date); + break; + + case self::WEEKDAY_SHORT: + $daylist = Zend_Locale_Data::getList($locale, 'day'); + $weekday = (int) $this->toString(self::WEEKDAY_DIGIT, 'iso', $locale); + $cnt = 0; + + foreach ($daylist as $key => $value) { + if (strtoupper(iconv_substr($value, 0, 3, 'UTF-8')) == strtoupper($date)) { + $found = $cnt; + break; + } + ++$cnt; + } + + // Weekday found + if ($cnt < 7) { + return $this->_assign($calc, $this->mktime(0, 0, 0, 1, 1 + $found, 1970, true), + $this->mktime(0, 0, 0, 1, 1 + $weekday, 1970, true), $hour); + } + + // Weekday not found + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, weekday expected", 0, null, $date); + break; + + case self::DAY_SHORT: + if (is_numeric($date)) { + return $this->_assign($calc, $this->mktime(0, 0, 0, 1, 1 + intval($date), 1970, true), + $this->mktime(0, 0, 0, 1, 1 + intval($day), 1970, true), $hour); + } + + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, day expected", 0, null, $date); + break; + + case self::WEEKDAY: + $daylist = Zend_Locale_Data::getList($locale, 'day'); + $weekday = (int) $this->toString(self::WEEKDAY_DIGIT, 'iso', $locale); + $cnt = 0; + + foreach ($daylist as $key => $value) { + if (strtoupper($value) == strtoupper($date)) { + $found = $cnt; + break; + } + ++$cnt; + } + + // Weekday found + if ($cnt < 7) { + return $this->_assign($calc, $this->mktime(0, 0, 0, 1, 1 + $found, 1970, true), + $this->mktime(0, 0, 0, 1, 1 + $weekday, 1970, true), $hour); + } + + // Weekday not found + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, weekday expected", 0, null, $date); + break; + + case self::WEEKDAY_8601: + $weekday = (int) $this->toString(self::WEEKDAY_8601, 'iso', $locale); + if ((intval($date) > 0) and (intval($date) < 8)) { + return $this->_assign($calc, $this->mktime(0, 0, 0, 1, 1 + intval($date), 1970, true), + $this->mktime(0, 0, 0, 1, 1 + $weekday, 1970, true), $hour); + } + + // Weekday not found + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, weekday expected", 0, null, $date); + break; + + case self::DAY_SUFFIX: + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception('day suffix not supported', 0, null, $date); + break; + + case self::WEEKDAY_DIGIT: + $weekday = (int) $this->toString(self::WEEKDAY_DIGIT, 'iso', $locale); + if (is_numeric($date) and (intval($date) >= 0) and (intval($date) < 7)) { + return $this->_assign($calc, $this->mktime(0, 0, 0, 1, 1 + $date, 1970, true), + $this->mktime(0, 0, 0, 1, 1 + $weekday, 1970, true), $hour); + } + + // Weekday not found + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, weekday expected", 0, null, $date); + break; + + case self::DAY_OF_YEAR: + if (is_numeric($date)) { + if (($calc == 'add') || ($calc == 'sub')) { + $year = 1970; + ++$date; + ++$day; + } + + return $this->_assign($calc, $this->mktime(0, 0, 0, 1, $date, $year, true), + $this->mktime(0, 0, 0, $month, $day, $year, true), $hour); + } + + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, day expected", 0, null, $date); + break; + + case self::WEEKDAY_NARROW: + $daylist = Zend_Locale_Data::getList($locale, 'day', array('gregorian', 'format', 'abbreviated')); + $weekday = (int) $this->toString(self::WEEKDAY_DIGIT, 'iso', $locale); + $cnt = 0; + foreach ($daylist as $key => $value) { + if (strtoupper(iconv_substr($value, 0, 1, 'UTF-8')) == strtoupper($date)) { + $found = $cnt; + break; + } + ++$cnt; + } + + // Weekday found + if ($cnt < 7) { + return $this->_assign($calc, $this->mktime(0, 0, 0, 1, 1 + $found, 1970, true), + $this->mktime(0, 0, 0, 1, 1 + $weekday, 1970, true), $hour); + } + + // Weekday not found + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, weekday expected", 0, null, $date); + break; + + case self::WEEKDAY_NAME: + $daylist = Zend_Locale_Data::getList($locale, 'day', array('gregorian', 'format', 'abbreviated')); + $weekday = (int) $this->toString(self::WEEKDAY_DIGIT, 'iso', $locale); + $cnt = 0; + foreach ($daylist as $key => $value) { + if (strtoupper($value) == strtoupper($date)) { + $found = $cnt; + break; + } + ++$cnt; + } + + // Weekday found + if ($cnt < 7) { + return $this->_assign($calc, $this->mktime(0, 0, 0, 1, 1 + $found, 1970, true), + $this->mktime(0, 0, 0, 1, 1 + $weekday, 1970, true), $hour); + } + + // Weekday not found + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, weekday expected", 0, null, $date); + break; + + // week formats + case self::WEEK: + if (is_numeric($date)) { + $week = (int) $this->toString(self::WEEK, 'iso', $locale); + return $this->_assign($calc, parent::mktime(0, 0, 0, 1, 1 + ($date * 7), 1970, true), + parent::mktime(0, 0, 0, 1, 1 + ($week * 7), 1970, true), $hour); + } + + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, week expected", 0, null, $date); + break; + + // month formats + case self::MONTH_NAME: + $monthlist = Zend_Locale_Data::getList($locale, 'month'); + $cnt = 0; + foreach ($monthlist as $key => $value) { + if (strtoupper($value) == strtoupper($date)) { + $found = $key; + break; + } + ++$cnt; + } + $date = array_search($date, $monthlist); + + // Monthname found + if ($cnt < 12) { + $fixday = 0; + if ($calc == 'add') { + $date += $found; + $calc = 'set'; + if (self::$_options['extend_month'] == false) { + $parts = $this->getDateParts($this->mktime($hour, $minute, $second, $date, $day, $year, false)); + if ($parts['mday'] != $day) { + $fixday = ($parts['mday'] < $day) ? -$parts['mday'] : ($parts['mday'] - $day); + } + } + } else if ($calc == 'sub') { + $date = $month - $found; + $calc = 'set'; + if (self::$_options['extend_month'] == false) { + $parts = $this->getDateParts($this->mktime($hour, $minute, $second, $date, $day, $year, false)); + if ($parts['mday'] != $day) { + $fixday = ($parts['mday'] < $day) ? -$parts['mday'] : ($parts['mday'] - $day); + } + } + } + return $this->_assign($calc, $this->mktime(0, 0, 0, $date, $day + $fixday, $year, true), + $this->mktime(0, 0, 0, $month, $day, $year, true), $hour); + } + + // Monthname not found + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, month expected", 0, null, $date); + break; + + case self::MONTH: + if (is_numeric($date)) { + $fixday = 0; + if ($calc == 'add') { + $date += $month; + $calc = 'set'; + if (self::$_options['extend_month'] == false) { + $parts = $this->getDateParts($this->mktime($hour, $minute, $second, $date, $day, $year, false)); + if ($parts['mday'] != $day) { + $fixday = ($parts['mday'] < $day) ? -$parts['mday'] : ($parts['mday'] - $day); + } + } + } else if ($calc == 'sub') { + $date = $month - $date; + $calc = 'set'; + if (self::$_options['extend_month'] == false) { + $parts = $this->getDateParts($this->mktime($hour, $minute, $second, $date, $day, $year, false)); + if ($parts['mday'] != $day) { + $fixday = ($parts['mday'] < $day) ? -$parts['mday'] : ($parts['mday'] - $day); + } + } + } + return $this->_assign($calc, $this->mktime(0, 0, 0, $date, $day + $fixday, $year, true), + $this->mktime(0, 0, 0, $month, $day, $year, true), $hour); + } + + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, month expected", 0, null, $date); + break; + + case self::MONTH_NAME_SHORT: + $monthlist = Zend_Locale_Data::getList($locale, 'month', array('gregorian', 'format', 'abbreviated')); + $cnt = 0; + foreach ($monthlist as $key => $value) { + if (strtoupper($value) == strtoupper($date)) { + $found = $key; + break; + } + ++$cnt; + } + $date = array_search($date, $monthlist); + + // Monthname found + if ($cnt < 12) { + $fixday = 0; + if ($calc == 'add') { + $date += $found; + $calc = 'set'; + if (self::$_options['extend_month'] === false) { + $parts = $this->getDateParts($this->mktime($hour, $minute, $second, $date, $day, $year, false)); + if ($parts['mday'] != $day) { + $fixday = ($parts['mday'] < $day) ? -$parts['mday'] : ($parts['mday'] - $day); + } + } + } else if ($calc == 'sub') { + $date = $month - $found; + $calc = 'set'; + if (self::$_options['extend_month'] === false) { + $parts = $this->getDateParts($this->mktime($hour, $minute, $second, $date, $day, $year, false)); + if ($parts['mday'] != $day) { + $fixday = ($parts['mday'] < $day) ? -$parts['mday'] : ($parts['mday'] - $day); + } + } + } + return $this->_assign($calc, $this->mktime(0, 0, 0, $date, $day + $fixday, $year, true), + $this->mktime(0, 0, 0, $month, $day, $year, true), $hour); + } + + // Monthname not found + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, month expected", 0, null, $date); + break; + + case self::MONTH_SHORT: + if (is_numeric($date) === true) { + $fixday = 0; + if ($calc === 'add') { + $date += $month; + $calc = 'set'; + if (self::$_options['extend_month'] === false) { + $parts = $this->getDateParts($this->mktime($hour, $minute, $second, $date, $day, $year, false)); + if ($parts['mday'] != $day) { + $fixday = ($parts['mday'] < $day) ? -$parts['mday'] : ($parts['mday'] - $day); + } + } + } else if ($calc === 'sub') { + $date = $month - $date; + $calc = 'set'; + if (self::$_options['extend_month'] === false) { + $parts = $this->getDateParts($this->mktime($hour, $minute, $second, $date, $day, $year, false)); + if ($parts['mday'] != $day) { + $fixday = ($parts['mday'] < $day) ? -$parts['mday'] : ($parts['mday'] - $day); + } + } + } + + return $this->_assign($calc, $this->mktime(0, 0, 0, $date, $day + $fixday, $year, true), + $this->mktime(0, 0, 0, $month, $day, $year, true), $hour); + } + + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, month expected", 0, null, $date); + break; + + case self::MONTH_DAYS: + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception('month days not supported', 0, null, $date); + break; + + case self::MONTH_NAME_NARROW: + $monthlist = Zend_Locale_Data::getList($locale, 'month', array('gregorian', 'stand-alone', 'narrow')); + $cnt = 0; + foreach ($monthlist as $key => $value) { + if (strtoupper($value) === strtoupper($date)) { + $found = $key; + break; + } + ++$cnt; + } + $date = array_search($date, $monthlist); + + // Monthname found + if ($cnt < 12) { + $fixday = 0; + if ($calc === 'add') { + $date += $found; + $calc = 'set'; + if (self::$_options['extend_month'] === false) { + $parts = $this->getDateParts($this->mktime($hour, $minute, $second, $date, $day, $year, false)); + if ($parts['mday'] != $day) { + $fixday = ($parts['mday'] < $day) ? -$parts['mday'] : ($parts['mday'] - $day); + } + } + } else if ($calc === 'sub') { + $date = $month - $found; + $calc = 'set'; + if (self::$_options['extend_month'] === false) { + $parts = $this->getDateParts($this->mktime($hour, $minute, $second, $date, $day, $year, false)); + if ($parts['mday'] != $day) { + $fixday = ($parts['mday'] < $day) ? -$parts['mday'] : ($parts['mday'] - $day); + } + } + } + return $this->_assign($calc, $this->mktime(0, 0, 0, $date, $day + $fixday, $year, true), + $this->mktime(0, 0, 0, $month, $day, $year, true), $hour); + } + + // Monthname not found + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, month expected", 0, null, $date); + break; + + // year formats + case self::LEAPYEAR: + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception('leap year not supported', 0, null, $date); + break; + + case self::YEAR_8601: + if (is_numeric($date)) { + if ($calc === 'add') { + $date += $year; + $calc = 'set'; + } else if ($calc === 'sub') { + $date = $year - $date; + $calc = 'set'; + } + + return $this->_assign($calc, $this->mktime(0, 0, 0, $month, $day, intval($date), true), + $this->mktime(0, 0, 0, $month, $day, $year, true), false); + } + + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, year expected", 0, null, $date); + break; + + case self::YEAR: + if (is_numeric($date)) { + if ($calc === 'add') { + $date += $year; + $calc = 'set'; + } else if ($calc === 'sub') { + $date = $year - $date; + $calc = 'set'; + } + + return $this->_assign($calc, $this->mktime(0, 0, 0, $month, $day, intval($date), true), + $this->mktime(0, 0, 0, $month, $day, $year, true), false); + } + + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, year expected", 0, null, $date); + break; + + case self::YEAR_SHORT: + if (is_numeric($date)) { + $date = intval($date); + if (($calc == 'set') || ($calc == 'cmp')) { + $date = self::getFullYear($date); + } + if ($calc === 'add') { + $date += $year; + $calc = 'set'; + } else if ($calc === 'sub') { + $date = $year - $date; + $calc = 'set'; + } + + return $this->_assign($calc, $this->mktime(0, 0, 0, $month, $day, $date, true), + $this->mktime(0, 0, 0, $month, $day, $year, true), false); + } + + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, year expected", 0, null, $date); + break; + + case self::YEAR_SHORT_8601: + if (is_numeric($date)) { + $date = intval($date); + if (($calc === 'set') || ($calc === 'cmp')) { + $date = self::getFullYear($date); + } + if ($calc === 'add') { + $date += $year; + $calc = 'set'; + } else if ($calc === 'sub') { + $date = $year - $date; + $calc = 'set'; + } + + return $this->_assign($calc, $this->mktime(0, 0, 0, $month, $day, $date, true), + $this->mktime(0, 0, 0, $month, $day, $year, true), false); + } + + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, year expected", 0, null, $date); + break; + + // time formats + case self::MERIDIEM: + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception('meridiem not supported', 0, null, $date); + break; + + case self::SWATCH: + if (is_numeric($date)) { + $rest = intval($date); + $hours = floor($rest * 24 / 1000); + $rest = $rest - ($hours * 1000 / 24); + $minutes = floor($rest * 1440 / 1000); + $rest = $rest - ($minutes * 1000 / 1440); + $seconds = floor($rest * 86400 / 1000); + return $this->_assign($calc, $this->mktime($hours, $minutes, $seconds, 1, 1, 1970, true), + $this->mktime($hour, $minute, $second, 1, 1, 1970, true), false); + } + + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, swatchstamp expected", 0, null, $date); + break; + + case self::HOUR_SHORT_AM: + if (is_numeric($date)) { + return $this->_assign($calc, $this->mktime(intval($date), 0, 0, 1, 1, 1970, true), + $this->mktime($hour, 0, 0, 1, 1, 1970, true), false); + } + + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, hour expected", 0, null, $date); + break; + + case self::HOUR_SHORT: + if (is_numeric($date)) { + return $this->_assign($calc, $this->mktime(intval($date), 0, 0, 1, 1, 1970, true), + $this->mktime($hour, 0, 0, 1, 1, 1970, true), false); + } + + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, hour expected", 0, null, $date); + break; + + case self::HOUR_AM: + if (is_numeric($date)) { + return $this->_assign($calc, $this->mktime(intval($date), 0, 0, 1, 1, 1970, true), + $this->mktime($hour, 0, 0, 1, 1, 1970, true), false); + } + + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, hour expected", 0, null, $date); + break; + + case self::HOUR: + if (is_numeric($date)) { + return $this->_assign($calc, $this->mktime(intval($date), 0, 0, 1, 1, 1970, true), + $this->mktime($hour, 0, 0, 1, 1, 1970, true), false); + } + + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, hour expected", 0, null, $date); + break; + + case self::MINUTE: + if (is_numeric($date)) { + return $this->_assign($calc, $this->mktime(0, intval($date), 0, 1, 1, 1970, true), + $this->mktime(0, $minute, 0, 1, 1, 1970, true), false); + } + + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, minute expected", 0, null, $date); + break; + + case self::SECOND: + if (is_numeric($date)) { + return $this->_assign($calc, $this->mktime(0, 0, intval($date), 1, 1, 1970, true), + $this->mktime(0, 0, $second, 1, 1, 1970, true), false); + } + + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, second expected", 0, null, $date); + break; + + case self::MILLISECOND: + if (is_numeric($date)) { + switch($calc) { + case 'set' : + return $this->setMillisecond($date); + break; + case 'add' : + return $this->addMillisecond($date); + break; + case 'sub' : + return $this->subMillisecond($date); + break; + } + + return $this->compareMillisecond($date); + } + + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, milliseconds expected", 0, null, $date); + break; + + case self::MINUTE_SHORT: + if (is_numeric($date)) { + return $this->_assign($calc, $this->mktime(0, intval($date), 0, 1, 1, 1970, true), + $this->mktime(0, $minute, 0, 1, 1, 1970, true), false); + } + + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, minute expected", 0, null, $date); + break; + + case self::SECOND_SHORT: + if (is_numeric($date)) { + return $this->_assign($calc, $this->mktime(0, 0, intval($date), 1, 1, 1970, true), + $this->mktime(0, 0, $second, 1, 1, 1970, true), false); + } + + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, second expected", 0, null, $date); + break; + + // timezone formats + // break intentionally omitted + case self::TIMEZONE_NAME: + case self::TIMEZONE: + case self::TIMEZONE_SECS: + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception('timezone not supported', 0, null, $date); + break; + + case self::DAYLIGHT: + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception('daylight not supported', 0, null, $date); + break; + + case self::GMT_DIFF: + case self::GMT_DIFF_SEP: + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception('gmtdiff not supported', 0, null, $date); + break; + + // date strings + case self::ISO_8601: + // (-)YYYY-MM-dd + preg_match('/^(-{0,1}\d{4})-(\d{2})-(\d{2})/', $date, $datematch); + // (-)YY-MM-dd + if (empty($datematch)) { + preg_match('/^(-{0,1}\d{2})-(\d{2})-(\d{2})/', $date, $datematch); + } + // (-)YYYYMMdd + if (empty($datematch)) { + preg_match('/^(-{0,1}\d{4})(\d{2})(\d{2})/', $date, $datematch); + } + // (-)YYMMdd + if (empty($datematch)) { + preg_match('/^(-{0,1}\d{2})(\d{2})(\d{2})/', $date, $datematch); + } + $tmpdate = $date; + if (!empty($datematch)) { + $dateMatchCharCount = iconv_strlen($datematch[0], 'UTF-8'); + $tmpdate = iconv_substr($date, + $dateMatchCharCount, + iconv_strlen($date, 'UTF-8') - $dateMatchCharCount, + 'UTF-8'); + } + // (T)hh:mm:ss + preg_match('/[T,\s]{0,1}(\d{2}):(\d{2}):(\d{2})/', $tmpdate, $timematch); + if (empty($timematch)) { + preg_match('/[T,\s]{0,1}(\d{2})(\d{2})(\d{2})/', $tmpdate, $timematch); + } + if (empty($datematch) and empty($timematch)) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("unsupported ISO8601 format ($date)", 0, null, $date); + } + if (!empty($timematch)) { + $timeMatchCharCount = iconv_strlen($timematch[0], 'UTF-8'); + $tmpdate = iconv_substr($tmpdate, + $timeMatchCharCount, + iconv_strlen($tmpdate, 'UTF-8') - $timeMatchCharCount, + 'UTF-8'); + } + if (empty($datematch)) { + $datematch[1] = 1970; + $datematch[2] = 1; + $datematch[3] = 1; + } else if (iconv_strlen($datematch[1], 'UTF-8') == 2) { + $datematch[1] = self::getFullYear($datematch[1]); + } + if (empty($timematch)) { + $timematch[1] = 0; + $timematch[2] = 0; + $timematch[3] = 0; + } + + if (($calc == 'set') || ($calc == 'cmp')) { + --$datematch[2]; + --$month; + --$datematch[3]; + --$day; + $datematch[1] -= 1970; + $year -= 1970; + } + return $this->_assign($calc, $this->mktime($timematch[1], $timematch[2], $timematch[3], 1 + $datematch[2], 1 + $datematch[3], 1970 + $datematch[1], false), + $this->mktime($hour, $minute, $second, 1 + $month, 1 + $day, 1970 + $year, false), false); + break; + + case self::RFC_2822: + $result = preg_match('/^\w{3},\s(\d{1,2})\s(\w{3})\s(\d{4})\s(\d{2}):(\d{2}):{0,1}(\d{0,2})\s([+-]{1}\d{4})$/', $date, $match); + if (!$result) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("no RFC 2822 format ($date)", 0, null, $date); + } + + $months = $this->_getDigitFromName($match[2]); + + if (($calc == 'set') || ($calc == 'cmp')) { + --$months; + --$month; + --$match[1]; + --$day; + $match[3] -= 1970; + $year -= 1970; + } + return $this->_assign($calc, $this->mktime($match[4], $match[5], $match[6], 1 + $months, 1 + $match[1], 1970 + $match[3], false), + $this->mktime($hour, $minute, $second, 1 + $month, 1 + $day, 1970 + $year, false), false); + break; + + case self::TIMESTAMP: + if (is_numeric($date)) { + return $this->_assign($calc, $date, $this->getUnixTimestamp()); + } + + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, timestamp expected", 0, null, $date); + break; + + // additional formats + // break intentionally omitted + case self::ERA: + case self::ERA_NAME: + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception('era not supported', 0, null, $date); + break; + + case self::DATES: + try { + $parsed = Zend_Locale_Format::getDate($date, array('locale' => $locale, 'format_type' => 'iso', 'fix_date' => true)); + + if (($calc == 'set') || ($calc == 'cmp')) { + --$parsed['month']; + --$month; + --$parsed['day']; + --$day; + $parsed['year'] -= 1970; + $year -= 1970; + } + + return $this->_assign($calc, $this->mktime(0, 0, 0, 1 + $parsed['month'], 1 + $parsed['day'], 1970 + $parsed['year'], true), + $this->mktime(0, 0, 0, 1 + $month, 1 + $day, 1970 + $year, true), $hour); + } catch (Zend_Locale_Exception $e) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception($e->getMessage(), 0, $e, $date); + } + break; + + case self::DATE_FULL: + try { + $format = Zend_Locale_Data::getContent($locale, 'date', array('gregorian', 'full')); + $parsed = Zend_Locale_Format::getDate($date, array('date_format' => $format, 'format_type' => 'iso', 'locale' => $locale)); + + if (($calc == 'set') || ($calc == 'cmp')) { + --$parsed['month']; + --$month; + --$parsed['day']; + --$day; + $parsed['year'] -= 1970; + $year -= 1970; + } + return $this->_assign($calc, $this->mktime(0, 0, 0, 1 + $parsed['month'], 1 + $parsed['day'], 1970 + $parsed['year'], true), + $this->mktime(0, 0, 0, 1 + $month, 1 + $day, 1970 + $year, true), $hour); + } catch (Zend_Locale_Exception $e) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception($e->getMessage(), 0, $e, $date); + } + break; + + case self::DATE_LONG: + try { + $format = Zend_Locale_Data::getContent($locale, 'date', array('gregorian', 'long')); + $parsed = Zend_Locale_Format::getDate($date, array('date_format' => $format, 'format_type' => 'iso', 'locale' => $locale)); + + if (($calc == 'set') || ($calc == 'cmp')){ + --$parsed['month']; + --$month; + --$parsed['day']; + --$day; + $parsed['year'] -= 1970; + $year -= 1970; + } + return $this->_assign($calc, $this->mktime(0, 0, 0, 1 + $parsed['month'], 1 + $parsed['day'], 1970 + $parsed['year'], true), + $this->mktime(0, 0, 0, 1 + $month, 1 + $day, 1970 + $year, true), $hour); + } catch (Zend_Locale_Exception $e) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception($e->getMessage(), 0, $e, $date); + } + break; + + case self::DATE_MEDIUM: + try { + $format = Zend_Locale_Data::getContent($locale, 'date', array('gregorian', 'medium')); + $parsed = Zend_Locale_Format::getDate($date, array('date_format' => $format, 'format_type' => 'iso', 'locale' => $locale)); + + if (($calc == 'set') || ($calc == 'cmp')) { + --$parsed['month']; + --$month; + --$parsed['day']; + --$day; + $parsed['year'] -= 1970; + $year -= 1970; + } + return $this->_assign($calc, $this->mktime(0, 0, 0, 1 + $parsed['month'], 1 + $parsed['day'], 1970 + $parsed['year'], true), + $this->mktime(0, 0, 0, 1 + $month, 1 + $day, 1970 + $year, true), $hour); + } catch (Zend_Locale_Exception $e) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception($e->getMessage(), 0, $e, $date); + } + break; + + case self::DATE_SHORT: + try { + $format = Zend_Locale_Data::getContent($locale, 'date', array('gregorian', 'short')); + $parsed = Zend_Locale_Format::getDate($date, array('date_format' => $format, 'format_type' => 'iso', 'locale' => $locale)); + + $parsed['year'] = self::getFullYear($parsed['year']); + + if (($calc == 'set') || ($calc == 'cmp')) { + --$parsed['month']; + --$month; + --$parsed['day']; + --$day; + $parsed['year'] -= 1970; + $year -= 1970; + } + return $this->_assign($calc, $this->mktime(0, 0, 0, 1 + $parsed['month'], 1 + $parsed['day'], 1970 + $parsed['year'], true), + $this->mktime(0, 0, 0, 1 + $month, 1 + $day, 1970 + $year, true), $hour); + } catch (Zend_Locale_Exception $e) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception($e->getMessage(), 0, $e, $date); + } + break; + + case self::TIMES: + try { + if ($calc != 'set') { + $month = 1; + $day = 1; + $year = 1970; + } + $parsed = Zend_Locale_Format::getTime($date, array('locale' => $locale, 'format_type' => 'iso', 'fix_date' => true)); + return $this->_assign($calc, $this->mktime($parsed['hour'], $parsed['minute'], $parsed['second'], $month, $day, $year, true), + $this->mktime($hour, $minute, $second, $month, $day, $year, true), false); + } catch (Zend_Locale_Exception $e) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception($e->getMessage(), 0, $e, $date); + } + break; + + case self::TIME_FULL: + try { + $format = Zend_Locale_Data::getContent($locale, 'time', array('gregorian', 'full')); + $parsed = Zend_Locale_Format::getTime($date, array('date_format' => $format, 'format_type' => 'iso', 'locale' => $locale)); + if ($calc != 'set') { + $month = 1; + $day = 1; + $year = 1970; + } + + if (!isset($parsed['second'])) { + $parsed['second'] = 0; + } + + return $this->_assign($calc, $this->mktime($parsed['hour'], $parsed['minute'], $parsed['second'], $month, $day, $year, true), + $this->mktime($hour, $minute, $second, $month, $day, $year, true), false); + } catch (Zend_Locale_Exception $e) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception($e->getMessage(), 0, $e, $date); + } + break; + + case self::TIME_LONG: + try { + $format = Zend_Locale_Data::getContent($locale, 'time', array('gregorian', 'long')); + $parsed = Zend_Locale_Format::getTime($date, array('date_format' => $format, 'format_type' => 'iso', 'locale' => $locale)); + if ($calc != 'set') { + $month = 1; + $day = 1; + $year = 1970; + } + return $this->_assign($calc, $this->mktime($parsed['hour'], $parsed['minute'], $parsed['second'], $month, $day, $year, true), + $this->mktime($hour, $minute, $second, $month, $day, $year, true), false); + } catch (Zend_Locale_Exception $e) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception($e->getMessage(), 0, $e, $date); + } + break; + + case self::TIME_MEDIUM: + try { + $format = Zend_Locale_Data::getContent($locale, 'time', array('gregorian', 'medium')); + $parsed = Zend_Locale_Format::getTime($date, array('date_format' => $format, 'format_type' => 'iso', 'locale' => $locale)); + if ($calc != 'set') { + $month = 1; + $day = 1; + $year = 1970; + } + return $this->_assign($calc, $this->mktime($parsed['hour'], $parsed['minute'], $parsed['second'], $month, $day, $year, true), + $this->mktime($hour, $minute, $second, $month, $day, $year, true), false); + } catch (Zend_Locale_Exception $e) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception($e->getMessage(), 0, $e, $date); + } + break; + + case self::TIME_SHORT: + try { + $format = Zend_Locale_Data::getContent($locale, 'time', array('gregorian', 'short')); + $parsed = Zend_Locale_Format::getTime($date, array('date_format' => $format, 'format_type' => 'iso', 'locale' => $locale)); + if ($calc != 'set') { + $month = 1; + $day = 1; + $year = 1970; + } + + if (!isset($parsed['second'])) { + $parsed['second'] = 0; + } + + return $this->_assign($calc, $this->mktime($parsed['hour'], $parsed['minute'], $parsed['second'], $month, $day, $year, true), + $this->mktime($hour, $minute, $second, $month, $day, $year, true), false); + } catch (Zend_Locale_Exception $e) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception($e->getMessage(), 0, $e, $date); + } + break; + + case self::DATETIME: + try { + $parsed = Zend_Locale_Format::getDateTime($date, array('locale' => $locale, 'format_type' => 'iso', 'fix_date' => true)); + if (($calc == 'set') || ($calc == 'cmp')) { + --$parsed['month']; + --$month; + --$parsed['day']; + --$day; + $parsed['year'] -= 1970; + $year -= 1970; + } + return $this->_assign($calc, $this->mktime($parsed['hour'], $parsed['minute'], $parsed['second'], 1 + $parsed['month'], 1 + $parsed['day'], 1970 + $parsed['year'], true), + $this->mktime($hour, $minute, $second, 1 + $month, 1 + $day, 1970 + $year, true), $hour); + } catch (Zend_Locale_Exception $e) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception($e->getMessage(), 0, $e, $date); + } + break; + + case self::DATETIME_FULL: + try { + $format = Zend_Locale_Data::getContent($locale, 'datetime', array('gregorian', 'full')); + $parsed = Zend_Locale_Format::getDateTime($date, array('date_format' => $format, 'format_type' => 'iso', 'locale' => $locale)); + + if (($calc == 'set') || ($calc == 'cmp')) { + --$parsed['month']; + --$month; + --$parsed['day']; + --$day; + $parsed['year'] -= 1970; + $year -= 1970; + } + + if (!isset($parsed['second'])) { + $parsed['second'] = 0; + } + + return $this->_assign($calc, $this->mktime($parsed['hour'], $parsed['minute'], $parsed['second'], 1 + $parsed['month'], 1 + $parsed['day'], 1970 + $parsed['year'], true), + $this->mktime($hour, $minute, $second, 1 + $month, 1 + $day, 1970 + $year, true), $hour); + } catch (Zend_Locale_Exception $e) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception($e->getMessage(), 0, $e, $date); + } + break; + + case self::DATETIME_LONG: + try { + $format = Zend_Locale_Data::getContent($locale, 'datetime', array('gregorian', 'long')); + $parsed = Zend_Locale_Format::getDateTime($date, array('date_format' => $format, 'format_type' => 'iso', 'locale' => $locale)); + + if (($calc == 'set') || ($calc == 'cmp')){ + --$parsed['month']; + --$month; + --$parsed['day']; + --$day; + $parsed['year'] -= 1970; + $year -= 1970; + } + return $this->_assign($calc, $this->mktime($parsed['hour'], $parsed['minute'], $parsed['second'], 1 + $parsed['month'], 1 + $parsed['day'], 1970 + $parsed['year'], true), + $this->mktime($hour, $minute, $second, 1 + $month, 1 + $day, 1970 + $year, true), $hour); + } catch (Zend_Locale_Exception $e) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception($e->getMessage(), 0, $e, $date); + } + break; + + case self::DATETIME_MEDIUM: + try { + $format = Zend_Locale_Data::getContent($locale, 'datetime', array('gregorian', 'medium')); + $parsed = Zend_Locale_Format::getDateTime($date, array('date_format' => $format, 'format_type' => 'iso', 'locale' => $locale)); + if (($calc == 'set') || ($calc == 'cmp')) { + --$parsed['month']; + --$month; + --$parsed['day']; + --$day; + $parsed['year'] -= 1970; + $year -= 1970; + } + return $this->_assign($calc, $this->mktime($parsed['hour'], $parsed['minute'], $parsed['second'], 1 + $parsed['month'], 1 + $parsed['day'], 1970 + $parsed['year'], true), + $this->mktime($hour, $minute, $second, 1 + $month, 1 + $day, 1970 + $year, true), $hour); + } catch (Zend_Locale_Exception $e) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception($e->getMessage(), 0, $e, $date); + } + break; + + case self::DATETIME_SHORT: + try { + $format = Zend_Locale_Data::getContent($locale, 'datetime', array('gregorian', 'short')); + $parsed = Zend_Locale_Format::getDateTime($date, array('date_format' => $format, 'format_type' => 'iso', 'locale' => $locale)); + + $parsed['year'] = self::getFullYear($parsed['year']); + + if (($calc == 'set') || ($calc == 'cmp')) { + --$parsed['month']; + --$month; + --$parsed['day']; + --$day; + $parsed['year'] -= 1970; + $year -= 1970; + } + + if (!isset($parsed['second'])) { + $parsed['second'] = 0; + } + + return $this->_assign($calc, $this->mktime($parsed['hour'], $parsed['minute'], $parsed['second'], 1 + $parsed['month'], 1 + $parsed['day'], 1970 + $parsed['year'], true), + $this->mktime($hour, $minute, $second, 1 + $month, 1 + $day, 1970 + $year, true), $hour); + } catch (Zend_Locale_Exception $e) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception($e->getMessage(), 0, $e, $date); + } + break; + + // ATOM and RFC_3339 are identical + case self::ATOM: + case self::RFC_3339: + $result = preg_match('/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})\d{0,4}([+-]{1}\d{2}:\d{2}|Z)$/', $date, $match); + if (!$result) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, ATOM format expected", 0, null, $date); + } + + if (($calc == 'set') || ($calc == 'cmp')) { + --$match[2]; + --$month; + --$match[3]; + --$day; + $match[1] -= 1970; + $year -= 1970; + } + return $this->_assign($calc, $this->mktime($match[4], $match[5], $match[6], 1 + $match[2], 1 + $match[3], 1970 + $match[1], true), + $this->mktime($hour, $minute, $second, 1 + $month, 1 + $day, 1970 + $year, true), false); + break; + + case self::COOKIE: + $result = preg_match("/^\w{6,9},\s(\d{2})-(\w{3})-(\d{2})\s(\d{2}):(\d{2}):(\d{2})\s.{3,20}$/", $date, $match); + if (!$result) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, COOKIE format expected", 0, null, $date); + } + $matchStartPos = iconv_strpos($match[0], ' ', 0, 'UTF-8') + 1; + $match[0] = iconv_substr($match[0], + $matchStartPos, + iconv_strlen($match[0], 'UTF-8') - $matchStartPos, + 'UTF-8'); + + $months = $this->_getDigitFromName($match[2]); + $match[3] = self::getFullYear($match[3]); + + if (($calc == 'set') || ($calc == 'cmp')) { + --$months; + --$month; + --$match[1]; + --$day; + $match[3] -= 1970; + $year -= 1970; + } + return $this->_assign($calc, $this->mktime($match[4], $match[5], $match[6], 1 + $months, 1 + $match[1], 1970 + $match[3], true), + $this->mktime($hour, $minute, $second, 1 + $month, 1 + $day, 1970 + $year, true), false); + break; + + case self::RFC_822: + case self::RFC_1036: + // new RFC 822 format, identical to RFC 1036 standard + $result = preg_match('/^\w{0,3},{0,1}\s{0,1}(\d{1,2})\s(\w{3})\s(\d{2})\s(\d{2}):(\d{2}):{0,1}(\d{0,2})\s([+-]{1}\d{4}|\w{1,20})$/', $date, $match); + if (!$result) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, RFC 822 date format expected", 0, null, $date); + } + + $months = $this->_getDigitFromName($match[2]); + $match[3] = self::getFullYear($match[3]); + + if (($calc == 'set') || ($calc == 'cmp')) { + --$months; + --$month; + --$match[1]; + --$day; + $match[3] -= 1970; + $year -= 1970; + } + return $this->_assign($calc, $this->mktime($match[4], $match[5], $match[6], 1 + $months, 1 + $match[1], 1970 + $match[3], false), + $this->mktime($hour, $minute, $second, 1 + $month, 1 + $day, 1970 + $year, false), false); + break; + + case self::RFC_850: + $result = preg_match('/^\w{6,9},\s(\d{2})-(\w{3})-(\d{2})\s(\d{2}):(\d{2}):(\d{2})\s.{3,21}$/', $date, $match); + if (!$result) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, RFC 850 date format expected", 0, null, $date); + } + + $months = $this->_getDigitFromName($match[2]); + $match[3] = self::getFullYear($match[3]); + + if (($calc == 'set') || ($calc == 'cmp')) { + --$months; + --$month; + --$match[1]; + --$day; + $match[3] -= 1970; + $year -= 1970; + } + return $this->_assign($calc, $this->mktime($match[4], $match[5], $match[6], 1 + $months, 1 + $match[1], 1970 + $match[3], true), + $this->mktime($hour, $minute, $second, 1 + $month, 1 + $day, 1970 + $year, true), false); + break; + + case self::RFC_1123: + $result = preg_match('/^\w{0,3},{0,1}\s{0,1}(\d{1,2})\s(\w{3})\s(\d{2,4})\s(\d{2}):(\d{2}):{0,1}(\d{0,2})\s([+-]{1}\d{4}|\w{1,20})$/', $date, $match); + if (!$result) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, RFC 1123 date format expected", 0, null, $date); + } + + $months = $this->_getDigitFromName($match[2]); + + if (($calc == 'set') || ($calc == 'cmp')) { + --$months; + --$month; + --$match[1]; + --$day; + $match[3] -= 1970; + $year -= 1970; + } + return $this->_assign($calc, $this->mktime($match[4], $match[5], $match[6], 1 + $months, 1 + $match[1], 1970 + $match[3], true), + $this->mktime($hour, $minute, $second, 1 + $month, 1 + $day, 1970 + $year, true), false); + break; + + case self::RSS: + $result = preg_match('/^\w{3},\s(\d{2})\s(\w{3})\s(\d{2,4})\s(\d{1,2}):(\d{2}):(\d{2})\s.{1,21}$/', $date, $match); + if (!$result) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, RSS date format expected", 0, null, $date); + } + + $months = $this->_getDigitFromName($match[2]); + $match[3] = self::getFullYear($match[3]); + + if (($calc == 'set') || ($calc == 'cmp')) { + --$months; + --$month; + --$match[1]; + --$day; + $match[3] -= 1970; + $year -= 1970; + } + return $this->_assign($calc, $this->mktime($match[4], $match[5], $match[6], 1 + $months, 1 + $match[1], 1970 + $match[3], true), + $this->mktime($hour, $minute, $second, 1 + $month, 1 + $day, 1970 + $year, true), false); + break; + + case self::W3C: + $result = preg_match('/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})[+-]{1}\d{2}:\d{2}$/', $date, $match); + if (!$result) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, W3C date format expected", 0, null, $date); + } + + if (($calc == 'set') || ($calc == 'cmp')) { + --$match[2]; + --$month; + --$match[3]; + --$day; + $match[1] -= 1970; + $year -= 1970; + } + return $this->_assign($calc, $this->mktime($match[4], $match[5], $match[6], 1 + $match[2], 1 + $match[3], 1970 + $match[1], true), + $this->mktime($hour, $minute, $second, 1 + $month, 1 + $day, 1970 + $year, true), false); + break; + + default: + if (!is_numeric($date) || !empty($part)) { + try { + if (empty($part)) { + $part = Zend_Locale_Format::getDateFormat($locale) . " "; + $part .= Zend_Locale_Format::getTimeFormat($locale); + } + + $parsed = Zend_Locale_Format::getDate($date, array('date_format' => $part, 'locale' => $locale, 'fix_date' => true, 'format_type' => 'iso')); + if ((strpos(strtoupper($part), 'YY') !== false) and (strpos(strtoupper($part), 'YYYY') === false)) { + $parsed['year'] = self::getFullYear($parsed['year']); + } + + if (($calc == 'set') || ($calc == 'cmp')) { + if (isset($parsed['month'])) { + --$parsed['month']; + } else { + $parsed['month'] = 0; + } + + if (isset($parsed['day'])) { + --$parsed['day']; + } else { + $parsed['day'] = 0; + } + + if (isset($parsed['year'])) { + $parsed['year'] -= 1970; + } else { + $parsed['year'] = 0; + } + } + + return $this->_assign($calc, $this->mktime( + isset($parsed['hour']) ? $parsed['hour'] : 0, + isset($parsed['minute']) ? $parsed['minute'] : 0, + isset($parsed['second']) ? $parsed['second'] : 0, + isset($parsed['month']) ? (1 + $parsed['month']) : 1, + isset($parsed['day']) ? (1 + $parsed['day']) : 1, + isset($parsed['year']) ? (1970 + $parsed['year']) : 1970, + false), $this->getUnixTimestamp(), false); + } catch (Zend_Locale_Exception $e) { + if (!is_numeric($date)) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception($e->getMessage(), 0, $e, $date); + } + } + } + + return $this->_assign($calc, $date, $this->getUnixTimestamp(), false); + break; + } + } + + /** + * Returns true when both date objects or date parts are equal. + * For example: + * 15.May.2000 <-> 15.June.2000 Equals only for Day or Year... all other will return false + * + * @param string|integer|array|Zend_Date $date Date or datepart to equal with + * @param string $part OPTIONAL Part of the date to compare, if null the timestamp is used + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return boolean + * @throws Zend_Date_Exception + */ + public function equals($date, $part = self::TIMESTAMP, $locale = null) + { + $result = $this->compare($date, $part, $locale); + + if ($result == 0) { + return true; + } + + return false; + } + + /** + * Returns if the given date or datepart is earlier + * For example: + * 15.May.2000 <-> 13.June.1999 will return true for day, year and date, but not for month + * + * @param string|integer|array|Zend_Date $date Date or datepart to compare with + * @param string $part OPTIONAL Part of the date to compare, if null the timestamp is used + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return boolean + * @throws Zend_Date_Exception + */ + public function isEarlier($date, $part = null, $locale = null) + { + $result = $this->compare($date, $part, $locale); + + if ($result == -1) { + return true; + } + + return false; + } + + /** + * Returns if the given date or datepart is later + * For example: + * 15.May.2000 <-> 13.June.1999 will return true for month but false for day, year and date + * Returns if the given date is later + * + * @param string|integer|array|Zend_Date $date Date or datepart to compare with + * @param string $part OPTIONAL Part of the date to compare, if null the timestamp is used + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return boolean + * @throws Zend_Date_Exception + */ + public function isLater($date, $part = null, $locale = null) + { + $result = $this->compare($date, $part, $locale); + + if ($result == 1) { + return true; + } + + return false; + } + + /** + * Returns only the time of the date as new Zend_Date object + * For example: + * 15.May.2000 10:11:23 will return a dateobject equal to 01.Jan.1970 10:11:23 + * + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date + */ + public function getTime($locale = null) + { + if (self::$_options['format_type'] == 'php') { + $format = 'H:i:s'; + } else { + $format = self::TIME_MEDIUM; + } + + return $this->copyPart($format, $locale); + } + + /** + * Returns the calculated time + * + * @param string $calc Calculation to make + * @param string|integer|array|Zend_Date $time Time to calculate with, if null the actual time is taken + * @param string $format Timeformat for parsing input + * @param string|Zend_Locale $locale Locale for parsing input + * @return integer|Zend_Date new time + * @throws Zend_Date_Exception + */ + private function _time($calc, $time, $format, $locale) + { + if ($time === null) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception('parameter $time must be set, null is not allowed'); + } + + if ($time instanceof Zend_Date) { + // extract time from object + $time = $time->toString('HH:mm:ss', 'iso'); + } else { + if (is_array($time)) { + if ((isset($time['hour']) === true) or (isset($time['minute']) === true) or + (isset($time['second']) === true)) { + $parsed = $time; + } else { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("no hour, minute or second given in array"); + } + } else { + if (self::$_options['format_type'] == 'php') { + $format = Zend_Locale_Format::convertPhpToIsoFormat($format); + } + try { + if ($locale === null) { + $locale = $this->getLocale(); + } + + $parsed = Zend_Locale_Format::getTime($time, array('date_format' => $format, 'locale' => $locale, 'format_type' => 'iso')); + } catch (Zend_Locale_Exception $e) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception($e->getMessage(), 0, $e); + } + } + + if (!array_key_exists('hour', $parsed)) { + $parsed['hour'] = 0; + } + + if (!array_key_exists('minute', $parsed)) { + $parsed['minute'] = 0; + } + + if (!array_key_exists('second', $parsed)) { + $parsed['second'] = 0; + } + + $time = str_pad($parsed['hour'], 2, '0', STR_PAD_LEFT) . ":"; + $time .= str_pad($parsed['minute'], 2, '0', STR_PAD_LEFT) . ":"; + $time .= str_pad($parsed['second'], 2, '0', STR_PAD_LEFT); + } + + $return = $this->_calcdetail($calc, $time, self::TIMES, 'de'); + if ($calc != 'cmp') { + return $this; + } + + return $return; + } + + + /** + * Sets a new time for the date object. Format defines how to parse the time string. + * Also a complete date can be given, but only the time is used for setting. + * For example: dd.MMMM.yyTHH:mm' and 'ss sec'-> 10.May.07T25:11 and 44 sec => 1h11min44sec + 1 day + * Returned is the new date object and the existing date is left as it was before + * + * @param string|integer|array|Zend_Date $time Time to set + * @param string $format OPTIONAL Timeformat for parsing input + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function setTime($time, $format = null, $locale = null) + { + return $this->_time('set', $time, $format, $locale); + } + + + /** + * Adds a time to the existing date. Format defines how to parse the time string. + * If only parts are given the other parts are set to 0. + * If no format is given, the standardformat of this locale is used. + * For example: HH:mm:ss -> 10 -> +10 hours + * + * @param string|integer|array|Zend_Date $time Time to add + * @param string $format OPTIONAL Timeformat for parsing input + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function addTime($time, $format = null, $locale = null) + { + return $this->_time('add', $time, $format, $locale); + } + + + /** + * Subtracts a time from the existing date. Format defines how to parse the time string. + * If only parts are given the other parts are set to 0. + * If no format is given, the standardformat of this locale is used. + * For example: HH:mm:ss -> 10 -> -10 hours + * + * @param string|integer|array|Zend_Date $time Time to sub + * @param string $format OPTIONAL Timeformat for parsing input + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid inteface + * @throws Zend_Date_Exception + */ + public function subTime($time, $format = null, $locale = null) + { + return $this->_time('sub', $time, $format, $locale); + } + + + /** + * Compares the time from the existing date. Format defines how to parse the time string. + * If only parts are given the other parts are set to default. + * If no format us given, the standardformat of this locale is used. + * For example: HH:mm:ss -> 10 -> 10 hours + * + * @param string|integer|array|Zend_Date $time Time to compare + * @param string $format OPTIONAL Timeformat for parsing input + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return integer 0 = equal, 1 = later, -1 = earlier + * @throws Zend_Date_Exception + */ + public function compareTime($time, $format = null, $locale = null) + { + return $this->_time('cmp', $time, $format, $locale); + } + + /** + * Returns a clone of $this, with the time part set to 00:00:00. + * + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date + */ + public function getDate($locale = null) + { + $orig = self::$_options['format_type']; + if (self::$_options['format_type'] == 'php') { + self::$_options['format_type'] = 'iso'; + } + + $date = $this->copyPart(self::DATE_MEDIUM, $locale); + $date->addTimestamp($this->getGmtOffset()); + self::$_options['format_type'] = $orig; + + return $date; + } + + /** + * Returns the calculated date + * + * @param string $calc Calculation to make + * @param string|integer|array|Zend_Date $date Date to calculate with, if null the actual date is taken + * @param string $format Date format for parsing + * @param string|Zend_Locale $locale Locale for parsing input + * @return integer|Zend_Date new date + * @throws Zend_Date_Exception + */ + private function _date($calc, $date, $format, $locale) + { + if ($date === null) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception('parameter $date must be set, null is not allowed'); + } + + if ($date instanceof Zend_Date) { + // extract date from object + $date = $date->toString('d.M.y', 'iso'); + } else { + if (is_array($date)) { + if ((isset($date['year']) === true) or (isset($date['month']) === true) or + (isset($date['day']) === true)) { + $parsed = $date; + } else { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("no day,month or year given in array"); + } + } else { + if ((self::$_options['format_type'] == 'php') && !defined($format)) { + $format = Zend_Locale_Format::convertPhpToIsoFormat($format); + } + try { + if ($locale === null) { + $locale = $this->getLocale(); + } + + $parsed = Zend_Locale_Format::getDate($date, array('date_format' => $format, 'locale' => $locale, 'format_type' => 'iso')); + if ((strpos(strtoupper($format), 'YY') !== false) and (strpos(strtoupper($format), 'YYYY') === false)) { + $parsed['year'] = self::getFullYear($parsed['year']); + } + } catch (Zend_Locale_Exception $e) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception($e->getMessage(), 0, $e); + } + } + + if (!array_key_exists('day', $parsed)) { + $parsed['day'] = 1; + } + + if (!array_key_exists('month', $parsed)) { + $parsed['month'] = 1; + } + + if (!array_key_exists('year', $parsed)) { + $parsed['year'] = 0; + } + + $date = $parsed['day'] . "." . $parsed['month'] . "." . $parsed['year']; + } + + $return = $this->_calcdetail($calc, $date, self::DATE_MEDIUM, 'de'); + if ($calc != 'cmp') { + return $this; + } + return $return; + } + + + /** + * Sets a new date for the date object. Format defines how to parse the date string. + * Also a complete date with time can be given, but only the date is used for setting. + * For example: MMMM.yy HH:mm-> May.07 22:11 => 01.May.07 00:00 + * Returned is the new date object and the existing time is left as it was before + * + * @param string|integer|array|Zend_Date $date Date to set + * @param string $format OPTIONAL Date format for parsing + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function setDate($date, $format = null, $locale = null) + { + return $this->_date('set', $date, $format, $locale); + } + + + /** + * Adds a date to the existing date object. Format defines how to parse the date string. + * If only parts are given the other parts are set to 0. + * If no format is given, the standardformat of this locale is used. + * For example: MM.dd.YYYY -> 10 -> +10 months + * + * @param string|integer|array|Zend_Date $date Date to add + * @param string $format OPTIONAL Date format for parsing input + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function addDate($date, $format = null, $locale = null) + { + return $this->_date('add', $date, $format, $locale); + } + + + /** + * Subtracts a date from the existing date object. Format defines how to parse the date string. + * If only parts are given the other parts are set to 0. + * If no format is given, the standardformat of this locale is used. + * For example: MM.dd.YYYY -> 10 -> -10 months + * Be aware: Subtracting 2 months is not equal to Adding -2 months !!! + * + * @param string|integer|array|Zend_Date $date Date to sub + * @param string $format OPTIONAL Date format for parsing input + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function subDate($date, $format = null, $locale = null) + { + return $this->_date('sub', $date, $format, $locale); + } + + + /** + * Compares the date from the existing date object, ignoring the time. + * Format defines how to parse the date string. + * If only parts are given the other parts are set to 0. + * If no format is given, the standardformat of this locale is used. + * For example: 10.01.2000 => 10.02.1999 -> false + * + * @param string|integer|array|Zend_Date $date Date to compare + * @param string $format OPTIONAL Date format for parsing input + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return integer 0 = equal, 1 = later, -1 = earlier + * @throws Zend_Date_Exception + */ + public function compareDate($date, $format = null, $locale = null) + { + return $this->_date('cmp', $date, $format, $locale); + } + + + /** + * Returns the full ISO 8601 date from the date object. + * Always the complete ISO 8601 specifiction is used. If an other ISO date is needed + * (ISO 8601 defines several formats) use toString() instead. + * This function does not return the ISO date as object. Use copy() instead. + * + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return string + */ + public function getIso($locale = null) + { + return $this->toString(self::ISO_8601, 'iso', $locale); + } + + + /** + * Sets a new date for the date object. Not given parts are set to default. + * Only supported ISO 8601 formats are accepted. + * For example: 050901 -> 01.Sept.2005 00:00:00, 20050201T10:00:30 -> 01.Feb.2005 10h00m30s + * Returned is the new date object + * + * @param string|integer|Zend_Date $date ISO Date to set + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function setIso($date, $locale = null) + { + return $this->_calcvalue('set', $date, 'iso', self::ISO_8601, $locale); + } + + + /** + * Adds a ISO date to the date object. Not given parts are set to default. + * Only supported ISO 8601 formats are accepted. + * For example: 050901 -> + 01.Sept.2005 00:00:00, 10:00:00 -> +10h + * Returned is the new date object + * + * @param string|integer|Zend_Date $date ISO Date to add + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function addIso($date, $locale = null) + { + return $this->_calcvalue('add', $date, 'iso', self::ISO_8601, $locale); + } + + + /** + * Subtracts a ISO date from the date object. Not given parts are set to default. + * Only supported ISO 8601 formats are accepted. + * For example: 050901 -> - 01.Sept.2005 00:00:00, 10:00:00 -> -10h + * Returned is the new date object + * + * @param string|integer|Zend_Date $date ISO Date to sub + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function subIso($date, $locale = null) + { + return $this->_calcvalue('sub', $date, 'iso', self::ISO_8601, $locale); + } + + + /** + * Compares a ISO date with the date object. Not given parts are set to default. + * Only supported ISO 8601 formats are accepted. + * For example: 050901 -> - 01.Sept.2005 00:00:00, 10:00:00 -> -10h + * Returns if equal, earlier or later + * + * @param string|integer|Zend_Date $date ISO Date to sub + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return integer 0 = equal, 1 = later, -1 = earlier + * @throws Zend_Date_Exception + */ + public function compareIso($date, $locale = null) + { + return $this->_calcvalue('cmp', $date, 'iso', self::ISO_8601, $locale); + } + + + /** + * Returns a RFC 822 compilant datestring from the date object. + * This function does not return the RFC date as object. Use copy() instead. + * + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return string + */ + public function getArpa($locale = null) + { + if (self::$_options['format_type'] == 'php') { + $format = 'D\, d M y H\:i\:s O'; + } else { + $format = self::RFC_822; + } + + return $this->toString($format, 'iso', $locale); + } + + + /** + * Sets a RFC 822 date as new date for the date object. + * Only RFC 822 compilant date strings are accepted. + * For example: Sat, 14 Feb 09 00:31:30 +0100 + * Returned is the new date object + * + * @param string|integer|Zend_Date $date RFC 822 to set + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function setArpa($date, $locale = null) + { + return $this->_calcvalue('set', $date, 'arpa', self::RFC_822, $locale); + } + + + /** + * Adds a RFC 822 date to the date object. + * ARPA messages are used in emails or HTTP Headers. + * Only RFC 822 compilant date strings are accepted. + * For example: Sat, 14 Feb 09 00:31:30 +0100 + * Returned is the new date object + * + * @param string|integer|Zend_Date $date RFC 822 Date to add + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function addArpa($date, $locale = null) + { + return $this->_calcvalue('add', $date, 'arpa', self::RFC_822, $locale); + } + + + /** + * Subtracts a RFC 822 date from the date object. + * ARPA messages are used in emails or HTTP Headers. + * Only RFC 822 compilant date strings are accepted. + * For example: Sat, 14 Feb 09 00:31:30 +0100 + * Returned is the new date object + * + * @param string|integer|Zend_Date $date RFC 822 Date to sub + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function subArpa($date, $locale = null) + { + return $this->_calcvalue('sub', $date, 'arpa', self::RFC_822, $locale); + } + + + /** + * Compares a RFC 822 compilant date with the date object. + * ARPA messages are used in emails or HTTP Headers. + * Only RFC 822 compilant date strings are accepted. + * For example: Sat, 14 Feb 09 00:31:30 +0100 + * Returns if equal, earlier or later + * + * @param string|integer|Zend_Date $date RFC 822 Date to sub + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return integer 0 = equal, 1 = later, -1 = earlier + * @throws Zend_Date_Exception + */ + public function compareArpa($date, $locale = null) + { + return $this->_calcvalue('cmp', $date, 'arpa', self::RFC_822, $locale); + } + + + /** + * Check if location is supported + * + * @param $location array - locations array + * @return $horizon float + */ + private function _checkLocation($location) + { + if (!isset($location['longitude']) or !isset($location['latitude'])) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception('Location must include \'longitude\' and \'latitude\'', 0, null, $location); + } + if (($location['longitude'] > 180) or ($location['longitude'] < -180)) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception('Longitude must be between -180 and 180', 0, null, $location); + } + if (($location['latitude'] > 90) or ($location['latitude'] < -90)) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception('Latitude must be between -90 and 90', 0, null, $location); + } + + if (!isset($location['horizon'])){ + $location['horizon'] = 'effective'; + } + + switch ($location['horizon']) { + case 'civil' : + return -0.104528; + break; + case 'nautic' : + return -0.207912; + break; + case 'astronomic' : + return -0.309017; + break; + default : + return -0.0145439; + break; + } + } + + + /** + * Returns the time of sunrise for this date and a given location as new date object + * For a list of cities and correct locations use the class Zend_Date_Cities + * + * @param $location array - location of sunrise + * ['horizon'] -> civil, nautic, astronomical, effective (default) + * ['longitude'] -> longitude of location + * ['latitude'] -> latitude of location + * @return Zend_Date + * @throws Zend_Date_Exception + */ + public function getSunrise($location) + { + $horizon = $this->_checkLocation($location); + $result = clone $this; + $result->set($this->calcSun($location, $horizon, true), self::TIMESTAMP); + return $result; + } + + + /** + * Returns the time of sunset for this date and a given location as new date object + * For a list of cities and correct locations use the class Zend_Date_Cities + * + * @param $location array - location of sunset + * ['horizon'] -> civil, nautic, astronomical, effective (default) + * ['longitude'] -> longitude of location + * ['latitude'] -> latitude of location + * @return Zend_Date + * @throws Zend_Date_Exception + */ + public function getSunset($location) + { + $horizon = $this->_checkLocation($location); + $result = clone $this; + $result->set($this->calcSun($location, $horizon, false), self::TIMESTAMP); + return $result; + } + + + /** + * Returns an array with the sunset and sunrise dates for all horizon types + * For a list of cities and correct locations use the class Zend_Date_Cities + * + * @param $location array - location of suninfo + * ['horizon'] -> civil, nautic, astronomical, effective (default) + * ['longitude'] -> longitude of location + * ['latitude'] -> latitude of location + * @return array - [sunset|sunrise][effective|civil|nautic|astronomic] + * @throws Zend_Date_Exception + */ + public function getSunInfo($location) + { + $suninfo = array(); + for ($i = 0; $i < 4; ++$i) { + switch ($i) { + case 0 : + $location['horizon'] = 'effective'; + break; + case 1 : + $location['horizon'] = 'civil'; + break; + case 2 : + $location['horizon'] = 'nautic'; + break; + case 3 : + $location['horizon'] = 'astronomic'; + break; + } + $horizon = $this->_checkLocation($location); + $result = clone $this; + $result->set($this->calcSun($location, $horizon, true), self::TIMESTAMP); + $suninfo['sunrise'][$location['horizon']] = $result; + $result = clone $this; + $result->set($this->calcSun($location, $horizon, false), self::TIMESTAMP); + $suninfo['sunset'][$location['horizon']] = $result; + } + return $suninfo; + } + + + /** + * Check a given year for leap year. + * + * @param integer|array|Zend_Date $year Year to check + * @return boolean + */ + public static function checkLeapYear($year) + { + if ($year instanceof Zend_Date) { + $year = (int) $year->toString(self::YEAR, 'iso'); + } + + if (is_array($year)) { + if (isset($year['year']) === true) { + $year = $year['year']; + } else { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("no year given in array"); + } + } + + if (!is_numeric($year)) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("year ($year) has to be integer for checkLeapYear()", 0, null, $year); + } + + return (bool) parent::isYearLeapYear($year); + } + + + /** + * Returns true, if the year is a leap year. + * + * @return boolean + */ + public function isLeapYear() + { + return self::checkLeapYear($this); + } + + + /** + * Returns if the set date is todays date + * + * @return boolean + */ + public function isToday() + { + $today = $this->date('Ymd', $this->_getTime()); + $day = $this->date('Ymd', $this->getUnixTimestamp()); + return ($today == $day); + } + + + /** + * Returns if the set date is yesterdays date + * + * @return boolean + */ + public function isYesterday() + { + list($year, $month, $day) = explode('-', $this->date('Y-m-d', $this->_getTime())); + // adjusts for leap days and DST changes that are timezone specific + $yesterday = $this->date('Ymd', $this->mktime(0, 0, 0, $month, $day -1, $year)); + $day = $this->date('Ymd', $this->getUnixTimestamp()); + return $day == $yesterday; + } + + + /** + * Returns if the set date is tomorrows date + * + * @return boolean + */ + public function isTomorrow() + { + list($year, $month, $day) = explode('-', $this->date('Y-m-d', $this->_getTime())); + // adjusts for leap days and DST changes that are timezone specific + $tomorrow = $this->date('Ymd', $this->mktime(0, 0, 0, $month, $day +1, $year)); + $day = $this->date('Ymd', $this->getUnixTimestamp()); + return $day == $tomorrow; + } + + /** + * Returns the actual date as new date object + * + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date + */ + public static function now($locale = null) + { + return new Zend_Date(time(), self::TIMESTAMP, $locale); + } + + /** + * Calculate date details + * + * @param string $calc Calculation to make + * @param string|integer|array|Zend_Date $date Date or Part to calculate + * @param string $part Datepart for Calculation + * @param string|Zend_Locale $locale Locale for parsing input + * @return integer|string new date + * @throws Zend_Date_Exception + */ + private function _calcdetail($calc, $date, $type, $locale) + { + $old = false; + if (self::$_options['format_type'] == 'php') { + self::$_options['format_type'] = 'iso'; + $old = true; + } + + switch($calc) { + case 'set' : + $return = $this->set($date, $type, $locale); + break; + case 'add' : + $return = $this->add($date, $type, $locale); + break; + case 'sub' : + $return = $this->sub($date, $type, $locale); + break; + default : + $return = $this->compare($date, $type, $locale); + break; + } + + if ($old) { + self::$_options['format_type'] = 'php'; + } + + return $return; + } + + /** + * Internal calculation, returns the requested date type + * + * @param string $calc Calculation to make + * @param string|integer|Zend_Date $value Datevalue to calculate with, if null the actual value is taken + * @param string|Zend_Locale $locale Locale for parsing input + * @return integer|Zend_Date new date + * @throws Zend_Date_Exception + */ + private function _calcvalue($calc, $value, $type, $parameter, $locale) + { + if ($value === null) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("parameter $type must be set, null is not allowed"); + } + + if ($locale === null) { + $locale = $this->getLocale(); + } + + if ($value instanceof Zend_Date) { + // extract value from object + $value = $value->toString($parameter, 'iso', $locale); + } else if (!is_array($value) && !is_numeric($value) && ($type != 'iso') && ($type != 'arpa')) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid $type ($value) operand", 0, null, $value); + } + + $return = $this->_calcdetail($calc, $value, $parameter, $locale); + if ($calc != 'cmp') { + return $this; + } + return $return; + } + + + /** + * Returns only the year from the date object as new object. + * For example: 10.May.2000 10:30:00 -> 01.Jan.2000 00:00:00 + * + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date + */ + public function getYear($locale = null) + { + if (self::$_options['format_type'] == 'php') { + $format = 'Y'; + } else { + $format = self::YEAR; + } + + return $this->copyPart($format, $locale); + } + + + /** + * Sets a new year + * If the year is between 0 and 69, 2000 will be set (2000-2069) + * If the year if between 70 and 99, 1999 will be set (1970-1999) + * 3 or 4 digit years are set as expected. If you need to set year 0-99 + * use set() instead. + * Returned is the new date object + * + * @param string|integer|array|Zend_Date $date Year to set + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function setYear($year, $locale = null) + { + return $this->_calcvalue('set', $year, 'year', self::YEAR, $locale); + } + + + /** + * Adds the year to the existing date object + * If the year is between 0 and 69, 2000 will be added (2000-2069) + * If the year if between 70 and 99, 1999 will be added (1970-1999) + * 3 or 4 digit years are added as expected. If you need to add years from 0-99 + * use add() instead. + * Returned is the new date object + * + * @param string|integer|array|Zend_Date $date Year to add + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function addYear($year, $locale = null) + { + return $this->_calcvalue('add', $year, 'year', self::YEAR, $locale); + } + + + /** + * Subs the year from the existing date object + * If the year is between 0 and 69, 2000 will be subtracted (2000-2069) + * If the year if between 70 and 99, 1999 will be subtracted (1970-1999) + * 3 or 4 digit years are subtracted as expected. If you need to subtract years from 0-99 + * use sub() instead. + * Returned is the new date object + * + * @param string|integer|array|Zend_Date $date Year to sub + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function subYear($year, $locale = null) + { + return $this->_calcvalue('sub', $year, 'year', self::YEAR, $locale); + } + + + /** + * Compares the year with the existing date object, ignoring other date parts. + * For example: 10.03.2000 -> 15.02.2000 -> true + * Returns if equal, earlier or later + * + * @param string|integer|array|Zend_Date $year Year to compare + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return integer 0 = equal, 1 = later, -1 = earlier + * @throws Zend_Date_Exception + */ + public function compareYear($year, $locale = null) + { + return $this->_calcvalue('cmp', $year, 'year', self::YEAR, $locale); + } + + + /** + * Returns only the month from the date object as new object. + * For example: 10.May.2000 10:30:00 -> 01.May.1970 00:00:00 + * + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date + */ + public function getMonth($locale = null) + { + if (self::$_options['format_type'] == 'php') { + $format = 'm'; + } else { + $format = self::MONTH; + } + + return $this->copyPart($format, $locale); + } + + + /** + * Returns the calculated month + * + * @param string $calc Calculation to make + * @param string|integer|array|Zend_Date $month Month to calculate with, if null the actual month is taken + * @param string|Zend_Locale $locale Locale for parsing input + * @return integer|Zend_Date new time + * @throws Zend_Date_Exception + */ + private function _month($calc, $month, $locale) + { + if ($month === null) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception('parameter $month must be set, null is not allowed'); + } + + if ($locale === null) { + $locale = $this->getLocale(); + } + + if ($month instanceof Zend_Date) { + // extract month from object + $found = $month->toString(self::MONTH_SHORT, 'iso', $locale); + } else { + if (is_numeric($month)) { + $found = $month; + } else if (is_array($month)) { + if (isset($month['month']) === true) { + $month = $month['month']; + } else { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("no month given in array"); + } + } else { + $monthlist = Zend_Locale_Data::getList($locale, 'month'); + $monthlist2 = Zend_Locale_Data::getList($locale, 'month', array('gregorian', 'format', 'abbreviated')); + + $monthlist = array_merge($monthlist, $monthlist2); + $found = 0; + $cnt = 0; + foreach ($monthlist as $key => $value) { + if (strtoupper($value) == strtoupper($month)) { + $found = ($key % 12) + 1; + break; + } + ++$cnt; + } + if ($found == 0) { + foreach ($monthlist2 as $key => $value) { + if (strtoupper(iconv_substr($value, 0, 1, 'UTF-8')) == strtoupper($month)) { + $found = $key + 1; + break; + } + ++$cnt; + } + } + if ($found == 0) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("unknown month name ($month)", 0, null, $month); + } + } + } + $return = $this->_calcdetail($calc, $found, self::MONTH_SHORT, $locale); + if ($calc != 'cmp') { + return $this; + } + return $return; + } + + + /** + * Sets a new month + * The month can be a number or a string. Setting months lower then 0 and greater then 12 + * will result in adding or subtracting the relevant year. (12 months equal one year) + * If a localized monthname is given it will be parsed with the default locale or the optional + * set locale. + * Returned is the new date object + * + * @param string|integer|array|Zend_Date $month Month to set + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function setMonth($month, $locale = null) + { + return $this->_month('set', $month, $locale); + } + + + /** + * Adds months to the existing date object. + * The month can be a number or a string. Adding months lower then 0 and greater then 12 + * will result in adding or subtracting the relevant year. (12 months equal one year) + * If a localized monthname is given it will be parsed with the default locale or the optional + * set locale. + * Returned is the new date object + * + * @param string|integer|array|Zend_Date $month Month to add + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function addMonth($month, $locale = null) + { + return $this->_month('add', $month, $locale); + } + + + /** + * Subtracts months from the existing date object. + * The month can be a number or a string. Subtracting months lower then 0 and greater then 12 + * will result in adding or subtracting the relevant year. (12 months equal one year) + * If a localized monthname is given it will be parsed with the default locale or the optional + * set locale. + * Returned is the new date object + * + * @param string|integer|array|Zend_Date $month Month to sub + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function subMonth($month, $locale = null) + { + return $this->_month('sub', $month, $locale); + } + + + /** + * Compares the month with the existing date object, ignoring other date parts. + * For example: 10.03.2000 -> 15.03.1950 -> true + * Returns if equal, earlier or later + * + * @param string|integer|array|Zend_Date $month Month to compare + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return integer 0 = equal, 1 = later, -1 = earlier + * @throws Zend_Date_Exception + */ + public function compareMonth($month, $locale = null) + { + return $this->_month('cmp', $month, $locale); + } + + + /** + * Returns the day as new date object + * Example: 20.May.1986 -> 20.Jan.1970 00:00:00 + * + * @param $locale string|Zend_Locale OPTIONAL Locale for parsing input + * @return Zend_Date + */ + public function getDay($locale = null) + { + return $this->copyPart(self::DAY_SHORT, $locale); + } + + + /** + * Returns the calculated day + * + * @param $calc string Type of calculation to make + * @param $day string|integer|Zend_Date Day to calculate, when null the actual day is calculated + * @param $locale string|Zend_Locale Locale for parsing input + * @return Zend_Date|integer + */ + private function _day($calc, $day, $locale) + { + if ($day === null) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception('parameter $day must be set, null is not allowed'); + } + + if ($locale === null) { + $locale = $this->getLocale(); + } + + if ($day instanceof Zend_Date) { + $day = $day->toString(self::DAY_SHORT, 'iso', $locale); + } + + if (is_numeric($day)) { + $type = self::DAY_SHORT; + } else if (is_array($day)) { + if (isset($day['day']) === true) { + $day = $day['day']; + $type = self::WEEKDAY; + } else { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("no day given in array"); + } + } else { + switch (iconv_strlen($day, 'UTF-8')) { + case 1 : + $type = self::WEEKDAY_NARROW; + break; + case 2: + $type = self::WEEKDAY_NAME; + break; + case 3: + $type = self::WEEKDAY_SHORT; + break; + default: + $type = self::WEEKDAY; + break; + } + } + $return = $this->_calcdetail($calc, $day, $type, $locale); + if ($calc != 'cmp') { + return $this; + } + return $return; + } + + + /** + * Sets a new day + * The day can be a number or a string. Setting days lower then 0 or greater than the number of this months days + * will result in adding or subtracting the relevant month. + * If a localized dayname is given it will be parsed with the default locale or the optional + * set locale. + * Returned is the new date object + * Example: setDay('Montag', 'de_AT'); will set the monday of this week as day. + * + * @param string|integer|array|Zend_Date $month Day to set + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function setDay($day, $locale = null) + { + return $this->_day('set', $day, $locale); + } + + + /** + * Adds days to the existing date object. + * The day can be a number or a string. Adding days lower then 0 or greater than the number of this months days + * will result in adding or subtracting the relevant month. + * If a localized dayname is given it will be parsed with the default locale or the optional + * set locale. + * + * @param string|integer|array|Zend_Date $month Day to add + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function addDay($day, $locale = null) + { + return $this->_day('add', $day, $locale); + } + + + /** + * Subtracts days from the existing date object. + * The day can be a number or a string. Subtracting days lower then 0 or greater than the number of this months days + * will result in adding or subtracting the relevant month. + * If a localized dayname is given it will be parsed with the default locale or the optional + * set locale. + * + * @param string|integer|array|Zend_Date $month Day to sub + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function subDay($day, $locale = null) + { + return $this->_day('sub', $day, $locale); + } + + + /** + * Compares the day with the existing date object, ignoring other date parts. + * For example: 'Monday', 'en' -> 08.Jan.2007 -> 0 + * Returns if equal, earlier or later + * + * @param string|integer|array|Zend_Date $day Day to compare + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return integer 0 = equal, 1 = later, -1 = earlier + * @throws Zend_Date_Exception + */ + public function compareDay($day, $locale = null) + { + return $this->_day('cmp', $day, $locale); + } + + + /** + * Returns the weekday as new date object + * Weekday is always from 1-7 + * Example: 09-Jan-2007 -> 2 = Tuesday -> 02-Jan-1970 (when 02.01.1970 is also Tuesday) + * + * @param $locale string|Zend_Locale OPTIONAL Locale for parsing input + * @return Zend_Date + */ + public function getWeekday($locale = null) + { + if (self::$_options['format_type'] == 'php') { + $format = 'l'; + } else { + $format = self::WEEKDAY; + } + + return $this->copyPart($format, $locale); + } + + + /** + * Returns the calculated weekday + * + * @param $calc string Type of calculation to make + * @param $weekday string|integer|array|Zend_Date Weekday to calculate, when null the actual weekday is calculated + * @param $locale string|Zend_Locale Locale for parsing input + * @return Zend_Date|integer + * @throws Zend_Date_Exception + */ + private function _weekday($calc, $weekday, $locale) + { + if ($weekday === null) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception('parameter $weekday must be set, null is not allowed'); + } + + if ($locale === null) { + $locale = $this->getLocale(); + } + + if ($weekday instanceof Zend_Date) { + $weekday = $weekday->toString(self::WEEKDAY_8601, 'iso', $locale); + } + + if (is_numeric($weekday)) { + $type = self::WEEKDAY_8601; + } else if (is_array($weekday)) { + if (isset($weekday['weekday']) === true) { + $weekday = $weekday['weekday']; + $type = self::WEEKDAY; + } else { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("no weekday given in array"); + } + } else { + switch(iconv_strlen($weekday, 'UTF-8')) { + case 1: + $type = self::WEEKDAY_NARROW; + break; + case 2: + $type = self::WEEKDAY_NAME; + break; + case 3: + $type = self::WEEKDAY_SHORT; + break; + default: + $type = self::WEEKDAY; + break; + } + } + $return = $this->_calcdetail($calc, $weekday, $type, $locale); + if ($calc != 'cmp') { + return $this; + } + return $return; + } + + + /** + * Sets a new weekday + * The weekday can be a number or a string. If a localized weekday name is given, + * then it will be parsed as a date in $locale (defaults to the same locale as $this). + * Returned is the new date object. + * Example: setWeekday(3); will set the wednesday of this week as day. + * + * @param string|integer|array|Zend_Date $month Weekday to set + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function setWeekday($weekday, $locale = null) + { + return $this->_weekday('set', $weekday, $locale); + } + + + /** + * Adds weekdays to the existing date object. + * The weekday can be a number or a string. + * If a localized dayname is given it will be parsed with the default locale or the optional + * set locale. + * Returned is the new date object + * Example: addWeekday(3); will add the difference of days from the begining of the month until + * wednesday. + * + * @param string|integer|array|Zend_Date $month Weekday to add + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function addWeekday($weekday, $locale = null) + { + return $this->_weekday('add', $weekday, $locale); + } + + + /** + * Subtracts weekdays from the existing date object. + * The weekday can be a number or a string. + * If a localized dayname is given it will be parsed with the default locale or the optional + * set locale. + * Returned is the new date object + * Example: subWeekday(3); will subtract the difference of days from the begining of the month until + * wednesday. + * + * @param string|integer|array|Zend_Date $month Weekday to sub + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function subWeekday($weekday, $locale = null) + { + return $this->_weekday('sub', $weekday, $locale); + } + + + /** + * Compares the weekday with the existing date object, ignoring other date parts. + * For example: 'Monday', 'en' -> 08.Jan.2007 -> 0 + * Returns if equal, earlier or later + * + * @param string|integer|array|Zend_Date $weekday Weekday to compare + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return integer 0 = equal, 1 = later, -1 = earlier + * @throws Zend_Date_Exception + */ + public function compareWeekday($weekday, $locale = null) + { + return $this->_weekday('cmp', $weekday, $locale); + } + + + /** + * Returns the day of year as new date object + * Example: 02.Feb.1986 10:00:00 -> 02.Feb.1970 00:00:00 + * + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date + */ + public function getDayOfYear($locale = null) + { + if (self::$_options['format_type'] == 'php') { + $format = 'D'; + } else { + $format = self::DAY_OF_YEAR; + } + + return $this->copyPart($format, $locale); + } + + + /** + * Sets a new day of year + * The day of year is always a number. + * Returned is the new date object + * Example: 04.May.2004 -> setDayOfYear(10) -> 10.Jan.2004 + * + * @param string|integer|array|Zend_Date $day Day of Year to set + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function setDayOfYear($day, $locale = null) + { + return $this->_calcvalue('set', $day, 'day of year', self::DAY_OF_YEAR, $locale); + } + + + /** + * Adds a day of year to the existing date object. + * The day of year is always a number. + * Returned is the new date object + * Example: addDayOfYear(10); will add 10 days to the existing date object. + * + * @param string|integer|array|Zend_Date $day Day of Year to add + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function addDayOfYear($day, $locale = null) + { + return $this->_calcvalue('add', $day, 'day of year', self::DAY_OF_YEAR, $locale); + } + + + /** + * Subtracts a day of year from the existing date object. + * The day of year is always a number. + * Returned is the new date object + * Example: subDayOfYear(10); will subtract 10 days from the existing date object. + * + * @param string|integer|array|Zend_Date $day Day of Year to sub + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function subDayOfYear($day, $locale = null) + { + return $this->_calcvalue('sub', $day, 'day of year', self::DAY_OF_YEAR, $locale); + } + + + /** + * Compares the day of year with the existing date object. + * For example: compareDayOfYear(33) -> 02.Feb.2007 -> 0 + * Returns if equal, earlier or later + * + * @param string|integer|array|Zend_Date $day Day of Year to compare + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return integer 0 = equal, 1 = later, -1 = earlier + * @throws Zend_Date_Exception + */ + public function compareDayOfYear($day, $locale = null) + { + return $this->_calcvalue('cmp', $day, 'day of year', self::DAY_OF_YEAR, $locale); + } + + + /** + * Returns the hour as new date object + * Example: 02.Feb.1986 10:30:25 -> 01.Jan.1970 10:00:00 + * + * @param $locale string|Zend_Locale OPTIONAL Locale for parsing input + * @return Zend_Date + */ + public function getHour($locale = null) + { + return $this->copyPart(self::HOUR, $locale); + } + + + /** + * Sets a new hour + * The hour is always a number. + * Returned is the new date object + * Example: 04.May.1993 13:07:25 -> setHour(7); -> 04.May.1993 07:07:25 + * + * @param string|integer|array|Zend_Date $hour Hour to set + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function setHour($hour, $locale = null) + { + return $this->_calcvalue('set', $hour, 'hour', self::HOUR_SHORT, $locale); + } + + + /** + * Adds hours to the existing date object. + * The hour is always a number. + * Returned is the new date object + * Example: 04.May.1993 13:07:25 -> addHour(12); -> 05.May.1993 01:07:25 + * + * @param string|integer|array|Zend_Date $hour Hour to add + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function addHour($hour, $locale = null) + { + return $this->_calcvalue('add', $hour, 'hour', self::HOUR_SHORT, $locale); + } + + + /** + * Subtracts hours from the existing date object. + * The hour is always a number. + * Returned is the new date object + * Example: 04.May.1993 13:07:25 -> subHour(6); -> 05.May.1993 07:07:25 + * + * @param string|integer|array|Zend_Date $hour Hour to sub + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function subHour($hour, $locale = null) + { + return $this->_calcvalue('sub', $hour, 'hour', self::HOUR_SHORT, $locale); + } + + + /** + * Compares the hour with the existing date object. + * For example: 10:30:25 -> compareHour(10) -> 0 + * Returns if equal, earlier or later + * + * @param string|integer|array|Zend_Date $hour Hour to compare + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return integer 0 = equal, 1 = later, -1 = earlier + * @throws Zend_Date_Exception + */ + public function compareHour($hour, $locale = null) + { + return $this->_calcvalue('cmp', $hour, 'hour', self::HOUR_SHORT, $locale); + } + + + /** + * Returns the minute as new date object + * Example: 02.Feb.1986 10:30:25 -> 01.Jan.1970 00:30:00 + * + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date + */ + public function getMinute($locale = null) + { + if (self::$_options['format_type'] == 'php') { + $format = 'i'; + } else { + $format = self::MINUTE; + } + + return $this->copyPart($format, $locale); + } + + + /** + * Sets a new minute + * The minute is always a number. + * Returned is the new date object + * Example: 04.May.1993 13:07:25 -> setMinute(29); -> 04.May.1993 13:29:25 + * + * @param string|integer|array|Zend_Date $minute Minute to set + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function setMinute($minute, $locale = null) + { + return $this->_calcvalue('set', $minute, 'minute', self::MINUTE_SHORT, $locale); + } + + + /** + * Adds minutes to the existing date object. + * The minute is always a number. + * Returned is the new date object + * Example: 04.May.1993 13:07:25 -> addMinute(65); -> 04.May.1993 13:12:25 + * + * @param string|integer|array|Zend_Date $minute Minute to add + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function addMinute($minute, $locale = null) + { + return $this->_calcvalue('add', $minute, 'minute', self::MINUTE_SHORT, $locale); + } + + + /** + * Subtracts minutes from the existing date object. + * The minute is always a number. + * Returned is the new date object + * Example: 04.May.1993 13:07:25 -> subMinute(9); -> 04.May.1993 12:58:25 + * + * @param string|integer|array|Zend_Date $minute Minute to sub + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function subMinute($minute, $locale = null) + { + return $this->_calcvalue('sub', $minute, 'minute', self::MINUTE_SHORT, $locale); + } + + + /** + * Compares the minute with the existing date object. + * For example: 10:30:25 -> compareMinute(30) -> 0 + * Returns if equal, earlier or later + * + * @param string|integer|array|Zend_Date $minute Hour to compare + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return integer 0 = equal, 1 = later, -1 = earlier + * @throws Zend_Date_Exception + */ + public function compareMinute($minute, $locale = null) + { + return $this->_calcvalue('cmp', $minute, 'minute', self::MINUTE_SHORT, $locale); + } + + + /** + * Returns the second as new date object + * Example: 02.Feb.1986 10:30:25 -> 01.Jan.1970 00:00:25 + * + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date + */ + public function getSecond($locale = null) + { + if (self::$_options['format_type'] == 'php') { + $format = 's'; + } else { + $format = self::SECOND; + } + + return $this->copyPart($format, $locale); + } + + + /** + * Sets new seconds to the existing date object. + * The second is always a number. + * Returned is the new date object + * Example: 04.May.1993 13:07:25 -> setSecond(100); -> 04.May.1993 13:08:40 + * + * @param string|integer|array|Zend_Date $second Second to set + * @param string|Zend_Locale $locale (Optional) Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function setSecond($second, $locale = null) + { + return $this->_calcvalue('set', $second, 'second', self::SECOND_SHORT, $locale); + } + + + /** + * Adds seconds to the existing date object. + * The second is always a number. + * Returned is the new date object + * Example: 04.May.1993 13:07:25 -> addSecond(65); -> 04.May.1993 13:08:30 + * + * @param string|integer|array|Zend_Date $second Second to add + * @param string|Zend_Locale $locale (Optional) Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function addSecond($second, $locale = null) + { + return $this->_calcvalue('add', $second, 'second', self::SECOND_SHORT, $locale); + } + + + /** + * Subtracts seconds from the existing date object. + * The second is always a number. + * Returned is the new date object + * Example: 04.May.1993 13:07:25 -> subSecond(10); -> 04.May.1993 13:07:15 + * + * @param string|integer|array|Zend_Date $second Second to sub + * @param string|Zend_Locale $locale (Optional) Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function subSecond($second, $locale = null) + { + return $this->_calcvalue('sub', $second, 'second', self::SECOND_SHORT, $locale); + } + + + /** + * Compares the second with the existing date object. + * For example: 10:30:25 -> compareSecond(25) -> 0 + * Returns if equal, earlier or later + * + * @param string|integer|array|Zend_Date $second Second to compare + * @param string|Zend_Locale $locale (Optional) Locale for parsing input + * @return integer 0 = equal, 1 = later, -1 = earlier + * @throws Zend_Date_Exception + */ + public function compareSecond($second, $locale = null) + { + return $this->_calcvalue('cmp', $second, 'second', self::SECOND_SHORT, $locale); + } + + + /** + * Returns the precision for fractional seconds + * + * @return integer + */ + public function getFractionalPrecision() + { + return $this->_precision; + } + + + /** + * Sets a new precision for fractional seconds + * + * @param integer $precision Precision for the fractional datepart 3 = milliseconds + * @throws Zend_Date_Exception + * @return Zend_Date Provides fluid interface + */ + public function setFractionalPrecision($precision) + { + if (!intval($precision) or ($precision < 0) or ($precision > 9)) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("precision ($precision) must be a positive integer less than 10", 0, null, $precision); + } + + $this->_precision = (int) $precision; + if ($this->_precision < strlen($this->_fractional)) { + $this->_fractional = substr($this->_fractional, 0, $this->_precision); + } else { + $this->_fractional = str_pad($this->_fractional, $this->_precision, '0', STR_PAD_RIGHT); + } + + return $this; + } + + + /** + * Returns the milliseconds of the date object + * + * @return string + */ + public function getMilliSecond() + { + return $this->_fractional; + } + + + /** + * Sets new milliseconds for the date object + * Example: setMilliSecond(550, 2) -> equals +5 Sec +50 MilliSec + * + * @param integer|Zend_Date $milli (Optional) Millisecond to set, when null the actual millisecond is set + * @param integer $precision (Optional) Fraction precision of the given milliseconds + * @return Zend_Date Provides fluid interface + */ + public function setMilliSecond($milli = null, $precision = null) + { + if ($milli === null) { + list($milli, $time) = explode(" ", microtime()); + $milli = intval($milli); + $precision = 6; + } else if (!is_numeric($milli)) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid milli second ($milli) operand", 0, null, $milli); + } + + if ($precision === null) { + $precision = $this->_precision; + } + + if (!is_int($precision) || $precision < 1 || $precision > 9) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("precision ($precision) must be a positive integer less than 10", 0, null, $precision); + } + + $this->_fractional = 0; + $this->addMilliSecond($milli, $precision); + return $this; + } + + + /** + * Adds milliseconds to the date object + * + * @param integer|Zend_Date $milli (Optional) Millisecond to add, when null the actual millisecond is added + * @param integer $precision (Optional) Fractional precision for the given milliseconds + * @return Zend_Date Provides fluid interface + */ + public function addMilliSecond($milli = null, $precision = null) + { + if ($milli === null) { + list($milli, $time) = explode(" ", microtime()); + $milli = intval($milli); + } else if (!is_numeric($milli)) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid milli second ($milli) operand", 0, null, $milli); + } + + if ($precision === null) { + $precision = strlen($milli); + if ($milli < 0) { + --$precision; + } + } + + if (!is_int($precision) || $precision < 1 || $precision > 9) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("precision ($precision) must be a positive integer less than 10", 0, null, $precision); + } + + $this->_fractional += $milli; + + // Add/sub milliseconds + add/sub seconds + $max = pow(10, $this->_precision); + // Milli includes seconds + if ($this->_fractional >= $max) { + while ($this->_fractional >= $max) { + $this->addSecond(1); + $this->_fractional -= $max; + } + } + + if ($this->_fractional < 0) { + while ($this->_fractional < 0) { + $this->subSecond(1); + $this->_fractional += $max; + } + } + + if ($this->_precision > strlen($this->_fractional)) { + $this->_fractional = str_pad($this->_fractional, $this->_precision, '0', STR_PAD_LEFT); + } + + return $this; + } + + + /** + * Subtracts a millisecond + * + * @param integer|Zend_Date $milli (Optional) Millisecond to sub, when null the actual millisecond is subtracted + * @param integer $precision (Optional) Fractional precision for the given milliseconds + * @return Zend_Date Provides fluid interface + */ + public function subMilliSecond($milli = null, $precision = null) + { + $this->addMilliSecond(0 - $milli, $precision); + return $this; + } + + /** + * Compares only the millisecond part, returning the difference + * + * @param integer|Zend_Date $milli OPTIONAL Millisecond to compare, when null the actual millisecond is compared + * @param integer $precision OPTIONAL Fractional precision for the given milliseconds + * @throws Zend_Date_Exception On invalid input + * @return integer 0 = equal, 1 = later, -1 = earlier + */ + public function compareMilliSecond($milli = null, $precision = null) + { + if ($milli === null) { + list($milli, $time) = explode(" ", microtime()); + $milli = intval($milli); + } else if (is_numeric($milli) === false) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid milli second ($milli) operand", 0, null, $milli); + } + + if ($precision === null) { + $precision = strlen($milli); + } else if (!is_int($precision) || $precision < 1 || $precision > 9) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("precision ($precision) must be a positive integer less than 10", 0, null, $precision); + } + + if ($precision === 0) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception('precision is 0'); + } + + if ($precision != $this->_precision) { + if ($precision > $this->_precision) { + $diff = $precision - $this->_precision; + $milli = (int) ($milli / (10 * $diff)); + } else { + $diff = $this->_precision - $precision; + $milli = (int) ($milli * (10 * $diff)); + } + } + + $comp = $this->_fractional - $milli; + if ($comp < 0) { + return -1; + } else if ($comp > 0) { + return 1; + } + return 0; + } + + /** + * Returns the week as new date object using monday as begining of the week + * Example: 12.Jan.2007 -> 08.Jan.1970 00:00:00 + * + * @param $locale string|Zend_Locale OPTIONAL Locale for parsing input + * @return Zend_Date + */ + public function getWeek($locale = null) + { + if (self::$_options['format_type'] == 'php') { + $format = 'W'; + } else { + $format = self::WEEK; + } + + return $this->copyPart($format, $locale); + } + + /** + * Sets a new week. The week is always a number. The day of week is not changed. + * Returned is the new date object + * Example: 09.Jan.2007 13:07:25 -> setWeek(1); -> 02.Jan.2007 13:07:25 + * + * @param string|integer|array|Zend_Date $week Week to set + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function setWeek($week, $locale = null) + { + return $this->_calcvalue('set', $week, 'week', self::WEEK, $locale); + } + + /** + * Adds a week. The week is always a number. The day of week is not changed. + * Returned is the new date object + * Example: 09.Jan.2007 13:07:25 -> addWeek(1); -> 16.Jan.2007 13:07:25 + * + * @param string|integer|array|Zend_Date $week Week to add + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function addWeek($week, $locale = null) + { + return $this->_calcvalue('add', $week, 'week', self::WEEK, $locale); + } + + /** + * Subtracts a week. The week is always a number. The day of week is not changed. + * Returned is the new date object + * Example: 09.Jan.2007 13:07:25 -> subWeek(1); -> 02.Jan.2007 13:07:25 + * + * @param string|integer|array|Zend_Date $week Week to sub + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function subWeek($week, $locale = null) + { + return $this->_calcvalue('sub', $week, 'week', self::WEEK, $locale); + } + + /** + * Compares only the week part, returning the difference + * Returned is the new date object + * Returns if equal, earlier or later + * Example: 09.Jan.2007 13:07:25 -> compareWeek(2); -> 0 + * + * @param string|integer|array|Zend_Date $week Week to compare + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return integer 0 = equal, 1 = later, -1 = earlier + */ + public function compareWeek($week, $locale = null) + { + return $this->_calcvalue('cmp', $week, 'week', self::WEEK, $locale); + } + + /** + * Sets a new standard locale for the date object. + * This locale will be used for all functions + * Returned is the really set locale. + * Example: 'de_XX' will be set to 'de' because 'de_XX' does not exist + * 'xx_YY' will be set to 'root' because 'xx' does not exist + * + * @param string|Zend_Locale $locale (Optional) Locale for parsing input + * @throws Zend_Date_Exception When the given locale does not exist + * @return Zend_Date Provides fluent interface + */ + public function setLocale($locale = null) + { + try { + $this->_locale = Zend_Locale::findLocale($locale); + } catch (Zend_Locale_Exception $e) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception($e->getMessage(), 0, $e); + } + + return $this; + } + + /** + * Returns the actual set locale + * + * @return string + */ + public function getLocale() + { + return $this->_locale; + } + + /** + * Checks if the given date is a real date or datepart. + * Returns false if a expected datepart is missing or a datepart exceeds its possible border. + * But the check will only be done for the expected dateparts which are given by format. + * If no format is given the standard dateformat for the actual locale is used. + * f.e. 30.February.2007 will return false if format is 'dd.MMMM.YYYY' + * + * @param string|array|Zend_Date $date Date to parse for correctness + * @param string $format (Optional) Format for parsing the date string + * @param string|Zend_Locale $locale (Optional) Locale for parsing date parts + * @return boolean True when all date parts are correct + */ + public static function isDate($date, $format = null, $locale = null) + { + if (!is_string($date) && !is_numeric($date) && !($date instanceof Zend_Date) && + !is_array($date)) { + return false; + } + + if (($format !== null) && ($format != 'ee') && ($format != 'ss') && ($format != 'GG') && ($format != 'MM') && ($format != 'EE') && ($format != 'TT') + && (Zend_Locale::isLocale($format, null, false))) { + $locale = $format; + $format = null; + } + + $locale = Zend_Locale::findLocale($locale); + + if ($format === null) { + $format = Zend_Locale_Format::getDateFormat($locale); + } else if ((self::$_options['format_type'] == 'php') && !defined($format)) { + $format = Zend_Locale_Format::convertPhpToIsoFormat($format); + } + + $format = self::_getLocalizedToken($format, $locale); + if (!is_array($date)) { + try { + $parsed = Zend_Locale_Format::getDate($date, array('locale' => $locale, + 'date_format' => $format, 'format_type' => 'iso', + 'fix_date' => false)); + } catch (Zend_Locale_Exception $e) { + // Date can not be parsed + return false; + } + } else { + $parsed = $date; + } + + if (((strpos($format, 'Y') !== false) or (strpos($format, 'y') !== false)) and + (!isset($parsed['year']))) { + // Year expected but not found + return false; + } + + if ((strpos($format, 'M') !== false) and (!isset($parsed['month']))) { + // Month expected but not found + return false; + } + + if ((strpos($format, 'd') !== false) and (!isset($parsed['day']))) { + // Day expected but not found + return false; + } + + if (((strpos($format, 'H') !== false) or (strpos($format, 'h') !== false)) and + (!isset($parsed['hour']))) { + // Hour expected but not found + return false; + } + + if ((strpos($format, 'm') !== false) and (!isset($parsed['minute']))) { + // Minute expected but not found + return false; + } + + if ((strpos($format, 's') !== false) and (!isset($parsed['second']))) { + // Second expected but not found + return false; + } + + // Set not given dateparts + if (isset($parsed['hour']) === false) { + $parsed['hour'] = 12; + } + + if (isset($parsed['minute']) === false) { + $parsed['minute'] = 0; + } + + if (isset($parsed['second']) === false) { + $parsed['second'] = 0; + } + + if (isset($parsed['month']) === false) { + $parsed['month'] = 1; + } + + if (isset($parsed['day']) === false) { + $parsed['day'] = 1; + } + + if (isset($parsed['year']) === false) { + $parsed['year'] = 1970; + } + + if (self::isYearLeapYear($parsed['year'])) { + $parsed['year'] = 1972; + } else { + $parsed['year'] = 1971; + } + + $date = new self($parsed, null, $locale); + $timestamp = $date->mktime($parsed['hour'], $parsed['minute'], $parsed['second'], + $parsed['month'], $parsed['day'], $parsed['year']); + + if ($parsed['year'] != $date->date('Y', $timestamp)) { + // Given year differs from parsed year + return false; + } + + if ($parsed['month'] != $date->date('n', $timestamp)) { + // Given month differs from parsed month + return false; + } + + if ($parsed['day'] != $date->date('j', $timestamp)) { + // Given day differs from parsed day + return false; + } + + if ($parsed['hour'] != $date->date('G', $timestamp)) { + // Given hour differs from parsed hour + return false; + } + + if ($parsed['minute'] != $date->date('i', $timestamp)) { + // Given minute differs from parsed minute + return false; + } + + if ($parsed['second'] != $date->date('s', $timestamp)) { + // Given second differs from parsed second + return false; + } + + return true; + } + + /** + * Returns the ISO Token for all localized constants + * + * @param string $token Token to normalize + * @param string $locale Locale to search + * @return string + */ + protected static function _getLocalizedToken($token, $locale) + { + switch($token) { + case self::ISO_8601 : + return "yyyy-MM-ddThh:mm:ss"; + break; + case self::RFC_2822 : + return "EEE, dd MMM yyyy HH:mm:ss"; + break; + case self::DATES : + return Zend_Locale_Data::getContent($locale, 'date'); + break; + case self::DATE_FULL : + return Zend_Locale_Data::getContent($locale, 'date', array('gregorian', 'full')); + break; + case self::DATE_LONG : + return Zend_Locale_Data::getContent($locale, 'date', array('gregorian', 'long')); + break; + case self::DATE_MEDIUM : + return Zend_Locale_Data::getContent($locale, 'date', array('gregorian', 'medium')); + break; + case self::DATE_SHORT : + return Zend_Locale_Data::getContent($locale, 'date', array('gregorian', 'short')); + break; + case self::TIMES : + return Zend_Locale_Data::getContent($locale, 'time'); + break; + case self::TIME_FULL : + return Zend_Locale_Data::getContent($locale, 'time', array('gregorian', 'full')); + break; + case self::TIME_LONG : + return Zend_Locale_Data::getContent($locale, 'time', array('gregorian', 'long')); + break; + case self::TIME_MEDIUM : + return Zend_Locale_Data::getContent($locale, 'time', array('gregorian', 'medium')); + break; + case self::TIME_SHORT : + return Zend_Locale_Data::getContent($locale, 'time', array('gregorian', 'short')); + break; + case self::DATETIME : + return Zend_Locale_Data::getContent($locale, 'datetime'); + break; + case self::DATETIME_FULL : + return Zend_Locale_Data::getContent($locale, 'datetime', array('gregorian', 'full')); + break; + case self::DATETIME_LONG : + return Zend_Locale_Data::getContent($locale, 'datetime', array('gregorian', 'long')); + break; + case self::DATETIME_MEDIUM : + return Zend_Locale_Data::getContent($locale, 'datetime', array('gregorian', 'medium')); + break; + case self::DATETIME_SHORT : + return Zend_Locale_Data::getContent($locale, 'datetime', array('gregorian', 'short')); + break; + case self::ATOM : + case self::RFC_3339 : + case self::W3C : + return "yyyy-MM-DD HH:mm:ss"; + break; + case self::COOKIE : + case self::RFC_850 : + return "EEEE, dd-MM-yyyy HH:mm:ss"; + break; + case self::RFC_822 : + case self::RFC_1036 : + case self::RFC_1123 : + case self::RSS : + return "EEE, dd MM yyyy HH:mm:ss"; + break; + } + + return $token; + } + + /** + * Get unix timestamp. + * Added limitation: $year value must be between -10 000 and 10 000 + * Parent method implementation causes 504 error if it gets too big(small) year value + * + * @see Zend_Date_DateObject::mktime + * @throws Zend_Date_Exception + * @param $hour + * @param $minute + * @param $second + * @param $month + * @param $day + * @param $year + * @param bool $gmt + * @return float|int + */ + protected function mktime($hour, $minute, $second, $month, $day, $year, $gmt = false) + { + $day = intval($day); + $month = intval($month); + $year = intval($year); + + // correct months > 12 and months < 1 + if ($month > 12) { + $overlap = floor($month / 12); + $year += $overlap; + $month -= $overlap * 12; + } else { + $overlap = ceil((1 - $month) / 12); + $year -= $overlap; + $month += $overlap * 12; + } + + if ($year > self::YEAR_MAX_VALUE || $year < self::YEAR_MIN_VALUE) { + throw new Zend_Date_Exception('Invalid year, it must be between ' . self::YEAR_MIN_VALUE . ' and ' + . self::YEAR_MAX_VALUE); + } + + return parent::mktime($hour, $minute, $second, $month, $day, $year, $gmt); + } +} diff --git a/app/design/adminhtml/default/default/layout/captcha.xml b/app/design/adminhtml/default/default/layout/captcha.xml new file mode 100755 index 0000000000..0615f967d7 --- /dev/null +++ b/app/design/adminhtml/default/default/layout/captcha.xml @@ -0,0 +1,48 @@ + + + + + + + backend_login + 226 + 50 + + + + + + + backend_forgotpassword + 226 + 50 + + + + diff --git a/app/design/adminhtml/default/default/layout/customer.xml b/app/design/adminhtml/default/default/layout/customer.xml index b5b7415149..5b439d8c93 100644 --- a/app/design/adminhtml/default/default/layout/customer.xml +++ b/app/design/adminhtml/default/default/layout/customer.xml @@ -57,4 +57,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/design/adminhtml/default/default/layout/main.xml b/app/design/adminhtml/default/default/layout/main.xml index 77af339d41..eb72265b83 100644 --- a/app/design/adminhtml/default/default/layout/main.xml +++ b/app/design/adminhtml/default/default/layout/main.xml @@ -56,6 +56,7 @@ Default layout, loads most of the pages Magento Admin + jsextjs/fix-defer-before.jscan_load_ext_js @@ -247,10 +248,42 @@ Base preview layout + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - diff --git a/app/design/adminhtml/default/default/layout/promo.xml b/app/design/adminhtml/default/default/layout/promo.xml index 642380065e..b76eed4c57 100644 --- a/app/design/adminhtml/default/default/layout/promo.xml +++ b/app/design/adminhtml/default/default/layout/promo.xml @@ -73,11 +73,17 @@ + + + + main_sectionpromo_quote_edit_tab_main conditions_sectionpromo_quote_edit_tab_conditions actions_sectionpromo_quote_edit_tab_actions labels_sectionpromo_quote_edit_tab_labels + coupons_sectionpromo_quote_edit_tab_coupons + @@ -87,4 +93,9 @@ + + + + + diff --git a/app/design/adminhtml/default/default/layout/report.xml b/app/design/adminhtml/default/default/layout/report.xml index c042d44672..c76ca36561 100644 --- a/app/design/adminhtml/default/default/layout/report.xml +++ b/app/design/adminhtml/default/default/layout/report.xml @@ -32,4 +32,24 @@ + + + + This report depends on timezone configuration. Once timezone is changed, the lifetime statistics need to be refreshed. + + + + + + store_ids + + + + report_type + 0 + + + + + diff --git a/app/design/adminhtml/default/default/layout/sales.xml b/app/design/adminhtml/default/default/layout/sales.xml index 3ab7b25798..c7ac871b38 100644 --- a/app/design/adminhtml/default/default/layout/sales.xml +++ b/app/design/adminhtml/default/default/layout/sales.xml @@ -924,7 +924,7 @@ store_ids - + created_at_order Order Created Date diff --git a/app/design/adminhtml/default/default/layout/tag.xml b/app/design/adminhtml/default/default/layout/tag.xml index b47e61f329..1af8f3d49b 100644 --- a/app/design/adminhtml/default/default/layout/tag.xml +++ b/app/design/adminhtml/default/default/layout/tag.xml @@ -49,4 +49,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/design/adminhtml/default/default/template/backup/dialogs.phtml b/app/design/adminhtml/default/default/template/backup/dialogs.phtml new file mode 100644 index 0000000000..e19bbc9c94 --- /dev/null +++ b/app/design/adminhtml/default/default/template/backup/dialogs.phtml @@ -0,0 +1,125 @@ + + + + +
' . $this->helper('catalog/output') ->productAttribute($product, $product->getShortDescription(), 'short_description') . '

'; - if ($wishlistProduct->getAllowedPriceInRss()) { - $description .= $this->getPriceHtml($wishlistProduct,true); + if ($product->getAllowedPriceInRss()) { + $description .= $this->getPriceHtml($product,true); } $description .= '

'; if ($this->hasDescription($product)) { diff --git a/app/code/core/Mage/Rss/etc/config.xml b/app/code/core/Mage/Rss/etc/config.xml index 7f7b4f7719..7b798df1e9 100644 --- a/app/code/core/Mage/Rss/etc/config.xml +++ b/app/code/core/Mage/Rss/etc/config.xml @@ -49,7 +49,7 @@ - + @@ -71,22 +71,22 @@ - + rss/observer salesOrderItemSaveAfterNotifyStock - - + + rss/observer salesOrderItemSaveAfterOrderNew - + diff --git a/app/code/core/Mage/Rule/Block/Editable.php b/app/code/core/Mage/Rule/Block/Editable.php index 4a33bad404..951cd22c0c 100644 --- a/app/code/core/Mage/Rule/Block/Editable.php +++ b/app/code/core/Mage/Rule/Block/Editable.php @@ -28,35 +28,47 @@ class Mage_Rule_Block_Editable extends Mage_Core_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface { + /** + * Render element + * + * @param Varien_Data_Form_Element_Abstract $element + * @see Varien_Data_Form_Element_Renderer_Interface::render() + * @return string + */ public function render(Varien_Data_Form_Element_Abstract $element) { $element->addClass('element-value-changer'); $valueName = $element->getValueName(); - if ($valueName==='') { + if ($valueName === '') { $valueName = '...'; } - if ($element->getShowAsText()) { - $html = ' '; - $html.= htmlspecialchars($valueName).' '; + if ($element->getShowAsText()) { + $html = ' ' + . htmlspecialchars($valueName) . ' '; } else { - $html = ' getParamId() ? ' id="' . $element->getParamId() . '"' : '') . '>'; - - $html.= ''; + $html = ' getParamId() ? ' id="' . $element->getParamId() . '"' : '') . '>' + . ''; - $html.= htmlspecialchars(Mage::helper('core/string')->truncate($valueName, 33, '...')); + $translate = Mage::getSingleton('core/translate_inline'); - $html.= ' '; + $html .= $translate->isAllowed() ? Mage::helper('core')->escapeHtml($valueName) : + Mage::helper('core')->escapeHtml(Mage::helper('core/string')->truncate($valueName, 33, '...')); - $html.= $element->getElementHtml(); + $html .= ' ' . $element->getElementHtml(); if ($element->getExplicitApply()) { - $html.= ' '.$this->__('Apply').' '; + $html .= ' '
+                    . $this->__('Apply') . ' '; } - $html.= ' '; - } + $html .= ' '; + } + return $html; } } diff --git a/app/code/core/Mage/Rule/Model/Condition/Combine.php b/app/code/core/Mage/Rule/Model/Condition/Combine.php index ffab00c731..70e2a33327 100644 --- a/app/code/core/Mage/Rule/Model/Condition/Combine.php +++ b/app/code/core/Mage/Rule/Model/Condition/Combine.php @@ -27,6 +27,47 @@ class Mage_Rule_Model_Condition_Combine extends Mage_Rule_Model_Condition_Abstract { + /** + * Store all used condition models + * + * @var array + */ + static protected $_conditionModels = array(); + + + + + + /** + * Retrieve new object for each requested model. + * If model is requested first time, store it at static array. + * + * It's made by performance reasons to avoid initialization of same models each time when rules are being processed. + * + * @param string $modelClass + * @return Mage_Rule_Model_Condition_Abstract|bool + */ + protected function _getNewConditionModelInstance($modelClass) + { + if (empty($modelClass)) { + return false; + } + + if (!array_key_exists($modelClass, self::$_conditionModels)) { + $model = Mage::getModel($modelClass); + self::$_conditionModels[$modelClass] = $model; + } else { + $model = self::$_conditionModels[$modelClass]; + } + + if (!$model) { + return false; + } + + $newModel = clone $model; + return $newModel; + } + public function __construct() { parent::__construct(); @@ -165,8 +206,8 @@ public function loadArray($arr, $key='conditions') if (!empty($arr[$key]) && is_array($arr[$key])) { foreach ($arr[$key] as $condArr) { try { - $cond = @Mage::getModel($condArr['type']); - if (!empty($cond)) { + $cond = $this->_getNewConditionModelInstance($condArr['type']); + if ($cond) { $this->addCondition($cond); $cond->loadArray($condArr, $key); } @@ -194,11 +235,8 @@ public function loadXml($xml) public function asHtml() { $html = $this->getTypeElement()->getHtml(). - Mage::helper('rule')->__("If %s of these conditions are %s:", - $this->getAggregatorElement()->getHtml(), - $this->getValueElement()->getHtml() - ); - if ($this->getId()!='1') { + Mage::helper('rule')->__('If %s of these conditions are %s:', $this->getAggregatorElement()->getHtml(), $this->getValueElement()->getHtml()); + if ($this->getId() != '1') { $html.= $this->getRemoveLinkHtml(); } return $html; diff --git a/app/code/core/Mage/Sales/Block/Adminhtml/Report/Filter/Form/Coupon.php b/app/code/core/Mage/Sales/Block/Adminhtml/Report/Filter/Form/Coupon.php new file mode 100644 index 0000000000..bb35aa56b2 --- /dev/null +++ b/app/code/core/Mage/Sales/Block/Adminhtml/Report/Filter/Form/Coupon.php @@ -0,0 +1,89 @@ + + */ +class Mage_Sales_Block_Adminhtml_Report_Filter_Form_Coupon extends Mage_Sales_Block_Adminhtml_Report_Filter_Form +{ + /** + * Prepare form + * + * @return Mage_Sales_Block_Adminhtml_Report_Filter_Form_Coupon + */ + protected function _prepareForm() + { + parent::_prepareForm(); + + $form = $this->getForm(); + $htmlIdPrefix = $form->getHtmlIdPrefix(); + + /** @var Varien_Data_Form_Element_Fieldset $fieldset */ + $fieldset = $this->getForm()->getElement('base_fieldset'); + + if (is_object($fieldset) && $fieldset instanceof Varien_Data_Form_Element_Fieldset) { + + $fieldset->addField('price_rule_type', 'select', array( + 'name' => 'price_rule_type', + 'options' => array( + Mage::helper('reports')->__('Any'), + Mage::helper('reports')->__('Specified') + ), + 'label' => Mage::helper('reports')->__('Shopping Cart Price Rule'), + )); + + $rulesList = Mage::getResourceModel('salesrule/report_rule')->getUniqRulesNamesList(); + + $rulesListOptions = array(); + + foreach ($rulesList as $key => $ruleName) { + $rulesListOptions[] = array( + 'label' => $ruleName, + 'value' => $key, + 'title' => $ruleName + ); + } + + $fieldset->addField('rules_list', 'multiselect', array( + 'name' => 'rules_list', + 'values' => $rulesListOptions, + 'display' => 'none' + ), 'price_rule_type'); + + $this->setChild('form_after', $this->getLayout()->createBlock('adminhtml/widget_form_element_dependence') + ->addFieldMap($htmlIdPrefix . 'price_rule_type', 'price_rule_type') + ->addFieldMap($htmlIdPrefix . 'rules_list', 'rules_list') + ->addFieldDependence('rules_list', 'price_rule_type', '1') + ); + } + + return $this; + } +} diff --git a/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Attribute/Frontend/Discount.php b/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Attribute/Frontend/Discount.php index 6b237bcc9a..eee7f5eb8b 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Attribute/Frontend/Discount.php +++ b/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Attribute/Frontend/Discount.php @@ -33,8 +33,9 @@ public function fetchTotals(Mage_Sales_Model_Quote_Address $address) $amount = $address->getDiscountAmount(); if ($amount!=0) { $title = Mage::helper('sales')->__('Discount'); - if ($address->getQuote()->getCouponCode()) { - $title .= ' ('.$address->getQuote()->getCouponCode().')'; + $couponCode = $address->getQuote()->getCouponCode(); + if (strlen($couponCode)) { + $title .= ' ('. $couponCode .')'; } $address->addTotal(array( 'code'=>'discount', diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Abstract.php b/app/code/core/Mage/Sales/Model/Mysql4/Abstract.php index 3b01bf77fe..e15afa35b3 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Abstract.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Abstract.php @@ -32,6 +32,6 @@ * @package Mage_Sales * @author Magento Core Team */ -class Mage_Sales_Model_Mysql4_Abstract extends Mage_Sales_Model_Resource_Abstract +abstract class Mage_Sales_Model_Mysql4_Abstract extends Mage_Sales_Model_Resource_Abstract { } diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Report/Abstract.php b/app/code/core/Mage/Sales/Model/Mysql4/Report/Abstract.php index 34858bb550..9292c9db2f 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Report/Abstract.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Report/Abstract.php @@ -32,6 +32,6 @@ * @package Mage_Sales * @author Magento Core Team */ -class Mage_Sales_Model_Mysql4_Report_Abstract extends Mage_Sales_Model_Resource_Report_Abstract +abstract class Mage_Sales_Model_Mysql4_Report_Abstract extends Mage_Sales_Model_Resource_Report_Abstract { } diff --git a/app/code/core/Mage/Sales/Model/Observer.php b/app/code/core/Mage/Sales/Model/Observer.php index 46981f51e5..4700dd31bc 100644 --- a/app/code/core/Mage/Sales/Model/Observer.php +++ b/app/code/core/Mage/Sales/Model/Observer.php @@ -334,5 +334,113 @@ public function setQuoteCanApplyMsrp(Varien_Event_Observer $observer) $quote->setCanApplyMsrp($canApplyMsrp); } -} + /** + * Handle customer VAT number if needed + * + * @param Varien_Event_Observer $observer + */ + public function handleCustomerVatNumber(Varien_Event_Observer $observer) + { + /** @var $addressHelper Mage_Customer_Helper_Address */ + $addressHelper = Mage::helper('customer/address'); + + /** @var $customerInstance Mage_Customer_Model_Customer */ + $customerInstance = $observer->getQuote()->getCustomer(); + + if (!$addressHelper->isVatValidationEnabled($customerInstance->getStore())) { + return; + } + + /** @var $quoteInstance Mage_Sales_Model_Quote */ + $quoteInstance = $observer->getQuote(); + $quoteBillingAddress = $quoteInstance->getBillingAddress(); + + /** @var $customerHelper Mage_Customer_Helper_Data */ + $customerHelper = Mage::helper('customer'); + + $customerAddressId = $quoteBillingAddress->getCustomerAddressId(); + $customerDefaultBillingAddressId = $customerInstance->getDefaultBilling(); + + $customerCountryCode = $quoteBillingAddress->getCountryId(); + $customerVatNumber = $quoteBillingAddress->getVatId(); + + if (empty($customerVatNumber) || !Mage::helper('core')->isCountryInEU($customerCountryCode)) { + $groupId = $customerHelper->getDefaultCustomerGroupId($customerInstance->getStore()); + + if ($groupId && $customerInstance->getGroupId() != $groupId) { + $quoteInstance->setCustomer($customerInstance->setGroupId($groupId)); + $quoteInstance->setCustomerGroupId($groupId); + } + + return; + } + + $mustValidateVat = $addressHelper->getValidateOnEachTransaction($customerInstance->getStore()) + || $customerCountryCode != $quoteBillingAddress->getValidatedCountryCode() + || $customerVatNumber != $quoteBillingAddress->getValidatedVatNumber(); + + if (!$mustValidateVat) { + return; + } + + /** @var $coreHelper Mage_Core_Helper_Data */ + $coreHelper = Mage::helper('core'); + $merchantCountryCode = $coreHelper->getMerchantCountryCode(); + $merchantVatNumber = $coreHelper->getMerchantVatNumber(); + + $gatewayResponse = $customerHelper->checkVatNumber( + $customerCountryCode, + $customerVatNumber, + ($merchantVatNumber !== '') ? $merchantCountryCode : '', + $merchantVatNumber + ); + + // Store validation results in quote billing address + $quoteBillingAddress->setVatIsValid((int) $gatewayResponse->getIsValid()) + ->setVatRequestId($gatewayResponse->getRequestIdentifier()) + ->setVatRequestDate($gatewayResponse->getRequestDate()) + ->setVatRequestSuccess($gatewayResponse->getRequestSuccess()) + ->setValidatedVatNumber($customerVatNumber) + ->setValidatedCountryCode($customerCountryCode) + ->save(); + + if ($customerAddressId != $customerDefaultBillingAddressId) { + $groupId = $customerHelper->getCustomerGroupIdBasedOnVatNumber( + $customerCountryCode, $gatewayResponse, $customerInstance->getStore()); + + if ($groupId) { + $quoteInstance->setCustomer($customerInstance->setGroupId($groupId)); + $quoteInstance->setCustomerGroupId($groupId); + } + } + } + + /** + * Add VAT validation request date and identifier to order comments + * + * @param Varien_Event_Observer $observer + * @return null + */ + public function addVatRequestParamsOrderComment(Varien_Event_Observer $observer) + { + /** @var $orderInstance Mage_Sales_Model_Order */ + $orderInstance = $observer->getOrder(); + /** @var $billingAddress Mage_Sales_Model_Order_Address */ + $billingAddress = $orderInstance->getBillingAddress(); + if ($billingAddress instanceof Mage_Sales_Model_Order_Address) { + $vatRequestId = $billingAddress->getVatRequestId(); + $vatRequestDate = $billingAddress->getVatRequestDate(); + if (is_string($vatRequestId) + && !empty($vatRequestId) + && is_string($vatRequestDate) + && !empty($vatRequestDate) + ) { + $orderHistoryComment = Mage::helper('customer')->__('VAT Request Identifier') + . ': ' . $vatRequestId . '
' . Mage::helper('customer')->__('VAT Request Date') + . ': ' . $vatRequestDate; + $orderInstance->addStatusHistoryComment($orderHistoryComment, false); + } + } + } +} diff --git a/app/code/core/Mage/Sales/Model/Order/Config.php b/app/code/core/Mage/Sales/Model/Order/Config.php index a7be7851e5..6a330dcb98 100644 --- a/app/code/core/Mage/Sales/Model/Order/Config.php +++ b/app/code/core/Mage/Sales/Model/Order/Config.php @@ -142,7 +142,11 @@ public function getStates() */ public function getStateStatuses($state, $addLabels = true) { - $key = $state . $addLabels; + if (is_array($state)) { + $key = implode("|", $state) . $addLabels; + } else { + $key = $state . $addLabels; + } if (isset($this->_stateStatuses[$key])) { return $this->_stateStatuses[$key]; } diff --git a/app/code/core/Mage/Sales/Model/Order/Creditmemo.php b/app/code/core/Mage/Sales/Model/Order/Creditmemo.php index b5fd93a6c0..f7ae46a412 100644 --- a/app/code/core/Mage/Sales/Model/Order/Creditmemo.php +++ b/app/code/core/Mage/Sales/Model/Order/Creditmemo.php @@ -160,6 +160,13 @@ class Mage_Sales_Model_Order_Creditmemo extends Mage_Sales_Model_Abstract protected $_order; protected $_comments; + /** + * Calculator instances for delta rounding of prices + * + * @var array + */ + protected $_calculators = array(); + protected $_eventPrefix = 'sales_order_creditmemo'; protected $_eventObject = 'creditmemo'; @@ -285,6 +292,22 @@ public function getItemById($itemId) return false; } + /** + * Returns credit memo item by its order id + * + * @param $orderId + * @return Mage_Sales_Model_Order_Creditmemo_Item|bool + */ + public function getItemByOrderId($orderId) + { + foreach ($this->getItemsCollection() as $item) { + if ($item->getOrderItemId() == $orderId) { + return $item; + } + } + return false; + } + public function addItem(Mage_Sales_Model_Order_Creditmemo_Item $item) { $item->setCreditmemo($this) @@ -309,6 +332,25 @@ public function collectTotals() return $this; } + /** + * Round price considering delta + * + * @param float $price + * @param string $type + * @param bool $negative Indicates if we perform addition (true) or subtraction (false) of rounded value + * @return float + */ + public function roundPrice($price, $type = 'regular', $negative = false) + { + if ($price) { + if (!isset($this->_calculators[$type])) { + $this->_calculators[$type] = Mage::getModel('core/calculator', $this->getStore()); + } + $price = $this->_calculators[$type]->deltaRound($price, $negative); + } + return $price; + } + public function canRefund() { if ($this->getState() != self::STATE_CANCELED @@ -374,9 +416,7 @@ public function refund() $baseAvailableRefund = $this->getOrder()->getBaseTotalPaid()- $this->getOrder()->getBaseTotalRefunded(); Mage::throwException( - Mage::helper('sales')->__('Maximum amount available to refund is %s', - $this->getOrder()->formatBasePrice($baseAvailableRefund) - ) + Mage::helper('sales')->__('Maximum amount available to refund is %s', $this->getOrder()->formatBasePrice($baseAvailableRefund)) ); } $order = $this->getOrder(); diff --git a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Item.php b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Item.php index 3d2397912f..6539a7c837 100644 --- a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Item.php +++ b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Item.php @@ -214,17 +214,18 @@ public function setQty($qty) */ public function register() { - $this->getOrderItem()->setQtyRefunded( - $this->getOrderItem()->getQtyRefunded() + $this->getQty() - ); - $this->getOrderItem()->setTaxRefunded( - $this->getOrderItem()->getTaxRefunded() - + $this->getOrderItem()->getBaseTaxAmount() * $this->getQty() / $this->getOrderItem()->getQtyOrdered() - ); - $this->getOrderItem()->setHiddenTaxRefunded( - $this->getOrderItem()->getHiddenTaxRefunded() - + $this->getOrderItem()->getHiddenTaxAmount() * $this->getQty() / $this->getOrderItem()->getQtyOrdered() - ); + $orderItem = $this->getOrderItem(); + + $orderItem->setQtyRefunded($orderItem->getQtyRefunded() + $this->getQty()); + $orderItem->setTaxRefunded($orderItem->getTaxRefunded() + $this->getTaxAmount()); + $orderItem->setBaseTaxRefunded($orderItem->getBaseTaxRefunded() + $this->getBaseTaxAmount()); + $orderItem->setHiddenTaxRefunded($orderItem->getHiddenTaxRefunded() + $this->getHiddenTaxAmount()); + $orderItem->setBaseHiddenTaxRefunded($orderItem->getBaseHiddenTaxRefunded() + $this->getBaseHiddenTaxAmount()); + $orderItem->setAmountRefunded($orderItem->getAmountRefunded() + $this->getRowTotal()); + $orderItem->setBaseAmountRefunded($orderItem->getBaseAmountRefunded() + $this->getBaseRowTotal()); + $orderItem->setDiscountRefunded($orderItem->getDiscountRefunded() + $this->getDiscountAmount()); + $orderItem->setBaseDiscountRefunded($orderItem->getBaseDiscountRefunded() + $this->getBaseDiscountAmount()); + return $this; } @@ -251,24 +252,31 @@ public function cancel() */ public function calcRowTotal() { - $store = $this->getCreditmemo()->getStore(); - $orderItem = $this->getOrderItem(); - $orderItemQty = $orderItem->getQtyOrdered(); - - $rowTotal = $orderItem->getRowTotal(); - $baseRowTotal = $orderItem->getBaseRowTotal(); - $rowTotalInclTax = $orderItem->getRowTotalInclTax(); - $baseRowTotalInclTax= $orderItem->getBaseRowTotalInclTax(); + $creditmemo = $this->getCreditmemo(); + $orderItem = $this->getOrderItem(); + $orderItemQtyInvoiced = $orderItem->getQtyInvoiced(); - $rowTotal = $rowTotal/$orderItemQty*$this->getQty(); - $baseRowTotal = $baseRowTotal/$orderItemQty*$this->getQty(); + $rowTotal = $orderItem->getRowInvoiced() - $orderItem->getAmountRefunded(); + $baseRowTotal = $orderItem->getBaseRowInvoiced() - $orderItem->getBaseAmountRefunded(); + $rowTotalInclTax = $orderItem->getRowTotalInclTax(); + $baseRowTotalInclTax = $orderItem->getBaseRowTotalInclTax(); - $this->setRowTotal($store->roundPrice($rowTotal)); - $this->setBaseRowTotal($store->roundPrice($baseRowTotal)); + if (!$this->isLast()) { + $availableQty = $orderItemQtyInvoiced - $orderItem->getQtyRefunded(); + $rowTotal = $creditmemo->roundPrice($rowTotal / $availableQty * $this->getQty()); + $baseRowTotal = $creditmemo->roundPrice($baseRowTotal / $availableQty * $this->getQty(), 'base'); + } + $this->setRowTotal($rowTotal); + $this->setBaseRowTotal($baseRowTotal); if ($rowTotalInclTax && $baseRowTotalInclTax) { - $this->setRowTotalInclTax($store->roundPrice($rowTotalInclTax/$orderItemQty*$this->getQty())); - $this->setBaseRowTotalInclTax($store->roundPrice($baseRowTotalInclTax/$orderItemQty*$this->getQty())); + $orderItemQty = $orderItem->getQtyOrdered(); + $this->setRowTotalInclTax( + $creditmemo->roundPrice($rowTotalInclTax / $orderItemQty * $this->getQty(), 'including') + ); + $this->setBaseRowTotalInclTax( + $creditmemo->roundPrice($baseRowTotalInclTax / $orderItemQty * $this->getQty(), 'including_base') + ); } return $this; } diff --git a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Discount.php b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Discount.php index ea2209cf81..bcc37f97b1 100644 --- a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Discount.php +++ b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Discount.php @@ -49,20 +49,30 @@ public function collect(Mage_Sales_Model_Order_Creditmemo $creditmemo) $baseTotalDiscountAmount = $baseTotalDiscountAmount + $baseShippingDiscount; } + /** @var $item Mage_Sales_Model_Order_Invoice_Item */ foreach ($creditmemo->getAllItems() as $item) { - if ($item->getOrderItem()->isDummy()) { + $orderItem = $item->getOrderItem(); + + if ($orderItem->isDummy()) { continue; } - $orderItemDiscount = (float) $item->getOrderItem()->getDiscountAmount(); - $baseOrderItemDiscount = (float) $item->getOrderItem()->getBaseDiscountAmount(); - $orderItemQty = $item->getOrderItem()->getQtyOrdered(); - if ($orderItemDiscount && $orderItemQty) { - $discount = $orderItemDiscount*$item->getQty()/$orderItemQty; - $baseDiscount = $baseOrderItemDiscount*$item->getQty()/$orderItemQty; + $orderItemDiscount = (float) $orderItem->getDiscountInvoiced(); + $baseOrderItemDiscount = (float) $orderItem->getBaseDiscountInvoiced(); + $orderItemQty = $orderItem->getQtyInvoiced(); - $discount = $creditmemo->getStore()->roundPrice($discount); - $baseDiscount = $creditmemo->getStore()->roundPrice($baseDiscount); + if ($orderItemDiscount && $orderItemQty) { + $discount = $orderItemDiscount - $orderItem->getDiscountRefunded(); + $baseDiscount = $baseOrderItemDiscount - $orderItem->getBaseDiscountRefunded(); + if (!$item->isLast()) { + $availableQty = $orderItemQty - $orderItem->getQtyRefunded(); + $discount = $creditmemo->roundPrice( + $discount / $availableQty * $item->getQty(), 'regular', true + ); + $baseDiscount = $creditmemo->roundPrice( + $baseDiscount / $availableQty * $item->getQty(), 'base', true + ); + } $item->setDiscountAmount($discount); $item->setBaseDiscountAmount($baseDiscount); diff --git a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Subtotal.php b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Subtotal.php index d1c80ca878..509a6722df 100644 --- a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Subtotal.php +++ b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Subtotal.php @@ -41,12 +41,12 @@ public function collect(Mage_Sales_Model_Order_Creditmemo $creditmemo) $baseSubtotalInclTax = 0; foreach ($creditmemo->getAllItems() as $item) { - $item->calcRowTotal(); - if ($item->getOrderItem()->isDummy()) { continue; } + $item->calcRowTotal(); + $subtotal += $item->getRowTotal(); $baseSubtotal += $item->getBaseRowTotal(); $subtotalInclTax+= $item->getRowTotalInclTax(); diff --git a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Tax.php b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Tax.php index 7d3432e917..b6fba96335 100644 --- a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Tax.php +++ b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Tax.php @@ -38,49 +38,38 @@ public function collect(Mage_Sales_Model_Order_Creditmemo $creditmemo) $order = $creditmemo->getOrder(); + /** @var $item Mage_Sales_Model_Order_Creditmemo_Item */ foreach ($creditmemo->getAllItems() as $item) { - if ($item->getOrderItem()->isDummy()) { + $orderItem = $item->getOrderItem(); + if ($orderItem->isDummy()) { continue; } - $orderItem = $item->getOrderItem(); - $orderItemTax = $item->getOrderItem()->getTaxAmount(); - $baseOrderItemTax = $item->getOrderItem()->getBaseTaxAmount(); - $orderItemQty = $item->getOrderItem()->getQtyOrdered(); + $orderItemTax = $orderItem->getTaxInvoiced(); + $baseOrderItemTax = $orderItem->getBaseTaxInvoiced(); + $orderItemQty = $orderItem->getQtyInvoiced(); if ($orderItemTax && $orderItemQty) { /** * Check item tax amount */ - - if ($item->isLast()) { - $tax = $orderItemTax - $item->getOrderItem()->getTaxRefunded() - - $item->getOrderItem()->getTaxCanceled(); - $baseTax = $baseOrderItemTax - $item->getOrderItem()->getTaxRefunded() - - $item->getOrderItem()->getTaxCanceled(); - $hiddenTax = $orderItem->getHiddenTaxAmount() - $orderItem->getHiddenTaxRefunded() - - $item->getOrderItem()->getHiddenTaxCanceled(); - $baseHiddenTax = $orderItem->getBaseHiddenTaxAmount() - $orderItem->getBaseHiddenTaxRefunded() - - $item->getOrderItem()->getHiddenTaxCanceled(); - - } - else { - $tax = $orderItemTax*$item->getQty()/$orderItemQty; - $baseTax = $baseOrderItemTax*$item->getQty()/$orderItemQty; - $hiddenTax = $orderItem->getHiddenTaxAmount()*$item->getQty()/$orderItemQty; - $baseHiddenTax = $orderItem->getBaseHiddenTaxAmount()*$item->getQty()/$orderItemQty; - - $tax = $creditmemo->getStore()->roundPrice($tax); - $baseTax = $creditmemo->getStore()->roundPrice($baseTax); - $hiddenTax = $creditmemo->getStore()->roundPrice($hiddenTax); - $baseHiddenTax = $creditmemo->getStore()->roundPrice($baseHiddenTax); + $tax = $orderItemTax - $orderItem->getTaxRefunded(); + $baseTax = $baseOrderItemTax - $orderItem->getTaxRefunded(); + $hiddenTax = $orderItem->getHiddenTaxAmount() - $orderItem->getHiddenTaxRefunded(); + $baseHiddenTax = $orderItem->getBaseHiddenTaxAmount() - $orderItem->getBaseHiddenTaxRefunded(); + if (!$item->isLast()) { + $availableQty = $orderItemQty - $orderItem->getQtyRefunded(); + $tax = $creditmemo->roundPrice($tax / $availableQty * $item->getQty()); + $baseTax = $creditmemo->roundPrice($baseTax / $availableQty * $item->getQty(), 'base'); + $hiddenTax = $creditmemo->roundPrice($hiddenTax / $availableQty * $item->getQty()); + $baseHiddenTax = $creditmemo->roundPrice($baseHiddenTax / $availableQty * $item->getQty(), 'base'); } + $item->setTaxAmount($tax); $item->setBaseTaxAmount($baseTax); $item->setHiddenTaxAmount($hiddenTax); $item->setBaseHiddenTaxAmount($baseHiddenTax); - $totalTax += $tax; $baseTotalTax += $baseTax; $totalHiddenTax += $hiddenTax; @@ -98,12 +87,12 @@ public function collect(Mage_Sales_Model_Order_Creditmemo $creditmemo) $baseTotalHiddenTax += $invoice->getBaseShippingHiddenTaxAmount()*$taxFactor; $shippingHiddenTaxAmount = $invoice->getShippingHiddenTaxAmount()*$taxFactor; $baseShippingHiddenTaxAmount = $invoice->getBaseShippingHiddenTaxAmount()*$taxFactor; - $shippingTaxAmount = $creditmemo->getStore()->roundPrice($shippingTaxAmount); - $baseShippingTaxAmount = $creditmemo->getStore()->roundPrice($baseShippingTaxAmount); - $totalHiddenTax = $creditmemo->getStore()->roundPrice($totalHiddenTax); - $baseTotalHiddenTax = $creditmemo->getStore()->roundPrice($baseTotalHiddenTax); - $shippingHiddenTaxAmount = $creditmemo->getStore()->roundPrice($shippingHiddenTaxAmount); - $baseShippingHiddenTaxAmount = $creditmemo->getStore()->roundPrice($baseShippingHiddenTaxAmount); + $shippingTaxAmount = $creditmemo->roundPrice($shippingTaxAmount); + $baseShippingTaxAmount = $creditmemo->roundPrice($baseShippingTaxAmount, 'base'); + $totalHiddenTax = $creditmemo->roundPrice($totalHiddenTax); + $baseTotalHiddenTax = $creditmemo->roundPrice($baseTotalHiddenTax, 'base'); + $shippingHiddenTaxAmount = $creditmemo->roundPrice($shippingHiddenTaxAmount); + $baseShippingHiddenTaxAmount = $creditmemo->roundPrice($baseShippingHiddenTaxAmount, 'base'); $totalTax += $shippingTaxAmount; $baseTotalTax += $baseShippingTaxAmount; } @@ -130,10 +119,10 @@ public function collect(Mage_Sales_Model_Order_Creditmemo $creditmemo) $baseShippingTaxAmount = $order->getBaseShippingTaxAmount()*$basePart; $shippingHiddenTaxAmount = $order->getShippingHiddenTaxAmount()*$part; $baseShippingHiddenTaxAmount= $order->getBaseShippingHiddenTaxAmount()*$basePart; - $shippingTaxAmount = $creditmemo->getStore()->roundPrice($shippingTaxAmount); - $baseShippingTaxAmount = $creditmemo->getStore()->roundPrice($baseShippingTaxAmount); - $shippingHiddenTaxAmount = $creditmemo->getStore()->roundPrice($shippingHiddenTaxAmount); - $baseShippingHiddenTaxAmount= $creditmemo->getStore()->roundPrice($baseShippingHiddenTaxAmount); + $shippingTaxAmount = $creditmemo->roundPrice($shippingTaxAmount); + $baseShippingTaxAmount = $creditmemo->roundPrice($baseShippingTaxAmount, 'base'); + $shippingHiddenTaxAmount = $creditmemo->roundPrice($shippingHiddenTaxAmount); + $baseShippingHiddenTaxAmount= $creditmemo->roundPrice($baseShippingHiddenTaxAmount, 'base'); } elseif ($shippingDelta == $creditmemo->getBaseShippingAmount()) { $shippingTaxAmount = $order->getShippingTaxAmount() - $order->getShippingTaxRefunded(); $baseShippingTaxAmount = $order->getBaseShippingTaxAmount() - $order->getBaseShippingTaxRefunded(); diff --git a/app/code/core/Mage/Sales/Model/Order/Invoice.php b/app/code/core/Mage/Sales/Model/Order/Invoice.php index a031c95fc8..7e3f9a49b1 100644 --- a/app/code/core/Mage/Sales/Model/Order/Invoice.php +++ b/app/code/core/Mage/Sales/Model/Order/Invoice.php @@ -160,6 +160,13 @@ class Mage_Sales_Model_Order_Invoice extends Mage_Sales_Model_Abstract protected $_comments; protected $_order; + /** + * Calculator instances for delta rounding of prices + * + * @var array + */ + protected $_rounders = array(); + protected $_saveBeforeDestruct = false; protected $_eventPrefix = 'sales_order_invoice'; @@ -495,6 +502,25 @@ public function collectTotals() return $this; } + /** + * Round price considering delta + * + * @param float $price + * @param string $type + * @param bool $negative Indicates if we perform addition (true) or subtraction (false) of rounded value + * @return float + */ + public function roundPrice($price, $type = 'regular', $negative = false) + { + if ($price) { + if (!isset($this->_rounders[$type])) { + $this->_rounders[$type] = Mage::getModel('core/calculator', $this->getStore()); + } + $price = $this->_rounders[$type]->deltaRound($price, $negative); + } + return $price; + } + /** * Get invoice items collection * diff --git a/app/code/core/Mage/Sales/Model/Order/Invoice/Item.php b/app/code/core/Mage/Sales/Model/Order/Invoice/Item.php index aa23d32c67..6e27f7e044 100644 --- a/app/code/core/Mage/Sales/Model/Order/Invoice/Item.php +++ b/app/code/core/Mage/Sales/Model/Order/Invoice/Item.php @@ -264,24 +264,27 @@ public function cancel() */ public function calcRowTotal() { - $store = $this->getInvoice()->getStore(); + $invoice = $this->getInvoice(); $orderItem = $this->getOrderItem(); $orderItemQty = $orderItem->getQtyOrdered(); - $rowTotal = $orderItem->getRowTotal(); - $baseRowTotal = $orderItem->getBaseRowTotal(); - $rowTotalInclTax = $orderItem->getRowTotalInclTax(); - $baseRowTotalInclTax= $orderItem->getBaseRowTotalInclTax(); + $rowTotal = $orderItem->getRowTotal() - $orderItem->getRowInvoiced(); + $baseRowTotal = $orderItem->getBaseRowTotal() - $orderItem->getBaseRowInvoiced(); + $rowTotalInclTax = $orderItem->getRowTotalInclTax(); + $baseRowTotalInclTax = $orderItem->getBaseRowTotalInclTax(); - $rowTotal = $rowTotal/$orderItemQty*$this->getQty(); - $baseRowTotal = $baseRowTotal/$orderItemQty*$this->getQty(); + if (!$this->isLast()) { + $availableQty = $orderItemQty - $orderItem->getQtyInvoiced(); + $rowTotal = $invoice->roundPrice($rowTotal / $availableQty * $this->getQty()); + $baseRowTotal = $invoice->roundPrice($baseRowTotal / $availableQty * $this->getQty(), 'base'); + } - $this->setRowTotal($store->roundPrice($rowTotal)); - $this->setBaseRowTotal($store->roundPrice($baseRowTotal)); + $this->setRowTotal($rowTotal); + $this->setBaseRowTotal($baseRowTotal); if ($rowTotalInclTax && $baseRowTotalInclTax) { - $this->setRowTotalInclTax($store->roundPrice($rowTotalInclTax/$orderItemQty*$this->getQty())); - $this->setBaseRowTotalInclTax($store->roundPrice($baseRowTotalInclTax/$orderItemQty*$this->getQty())); + $this->setRowTotalInclTax($invoice->roundPrice($rowTotalInclTax / $orderItemQty * $this->getQty(), 'including')); + $this->setBaseRowTotalInclTax($invoice->roundPrice($baseRowTotalInclTax / $orderItemQty * $this->getQty(), 'including_base')); } return $this; } diff --git a/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Discount.php b/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Discount.php index 4d6f531b3c..7d39444a28 100644 --- a/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Discount.php +++ b/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Discount.php @@ -52,6 +52,7 @@ public function collect(Mage_Sales_Model_Order_Invoice $invoice) $baseTotalDiscountAmount = $baseTotalDiscountAmount + $invoice->getOrder()->getBaseShippingDiscountAmount(); } + /** @var $item Mage_Sales_Model_Order_Invoice_Item */ foreach ($invoice->getAllItems() as $item) { if ($item->getOrderItem()->isDummy()) { continue; @@ -65,16 +66,12 @@ public function collect(Mage_Sales_Model_Order_Invoice $invoice) /** * Resolve rounding problems */ - if ($item->isLast()) { - $discount = $orderItemDiscount - $orderItem->getDiscountInvoiced(); - $baseDiscount = $baseOrderItemDiscount - $orderItem->getBaseDiscountInvoiced(); - } - else { - $discount = $orderItemDiscount*$item->getQty()/$orderItemQty; - $baseDiscount = $baseOrderItemDiscount*$item->getQty()/$orderItemQty; - - $discount = $invoice->getStore()->roundPrice($discount); - $baseDiscount = $invoice->getStore()->roundPrice($baseDiscount); + $discount = $orderItemDiscount - $orderItem->getDiscountInvoiced(); + $baseDiscount = $baseOrderItemDiscount - $orderItem->getBaseDiscountInvoiced(); + if (!$item->isLast()) { + $activeQty = $orderItemQty - $orderItem->getQtyInvoiced(); + $discount = $invoice->roundPrice($discount / $activeQty * $item->getQty(), 'regular', true); + $baseDiscount = $invoice->roundPrice($baseDiscount / $activeQty * $item->getQty(), 'base', true); } $item->setDiscountAmount($discount); diff --git a/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Subtotal.php b/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Subtotal.php index 0ed5d0affa..e61d1c393f 100644 --- a/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Subtotal.php +++ b/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Subtotal.php @@ -43,12 +43,12 @@ public function collect(Mage_Sales_Model_Order_Invoice $invoice) $order = $invoice->getOrder(); foreach ($invoice->getAllItems() as $item) { - $item->calcRowTotal(); - if ($item->getOrderItem()->isDummy()) { continue; } + $item->calcRowTotal(); + $subtotal += $item->getRowTotal(); $baseSubtotal += $item->getBaseRowTotal(); $subtotalInclTax+= $item->getRowTotalInclTax(); @@ -56,11 +56,30 @@ public function collect(Mage_Sales_Model_Order_Invoice $invoice) } $allowedSubtotal = $order->getSubtotal() - $order->getSubtotalInvoiced(); - $baseAllowedSubtotal = $order->getBaseSubtotal() -$order->getBaseSubtotalInvoiced(); + $baseAllowedSubtotal = $order->getBaseSubtotal() - $order->getBaseSubtotalInvoiced(); $allowedSubtotalInclTax = $allowedSubtotal + $order->getHiddenTaxAmount() - + $order->getTaxAmount() - $order->getTaxInvoiced() - $order->getShippingTaxAmount(); + + $order->getTaxAmount() - $order->getTaxInvoiced() - $order->getHiddenTaxInvoiced(); $baseAllowedSubtotalInclTax = $baseAllowedSubtotal + $order->getBaseHiddenTaxAmount() - + $order->getBaseTaxAmount() - $order->getBaseTaxInvoiced() - $order->getBaseShippingTaxAmount(); + + $order->getBaseTaxAmount() - $order->getBaseTaxInvoiced() - $order->getBaseHiddenTaxInvoiced(); + + /** + * Check if shipping tax calculation is included to current invoice. + */ + $includeShippingTax = true; + foreach ($invoice->getOrder()->getInvoiceCollection() as $previousInvoice) { + if ($previousInvoice->getShippingAmount() && !$previousInvoice->isCanceled()) { + $includeShippingTax = false; + break; + } + } + + if ($includeShippingTax) { + $allowedSubtotalInclTax -= $order->getShippingTaxAmount(); + $baseAllowedSubtotalInclTax -= $order->getBaseShippingTaxAmount(); + } else { + $allowedSubtotalInclTax += $order->getShippingHiddenTaxAmount(); + $baseAllowedSubtotalInclTax += $order->getBaseShippingHiddenTaxAmount(); + } if ($invoice->isLast()) { $subtotal = $allowedSubtotal; diff --git a/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Tax.php b/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Tax.php index 03e1c975b6..8d5574f508 100644 --- a/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Tax.php +++ b/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Tax.php @@ -31,6 +31,7 @@ class Mage_Sales_Model_Order_Invoice_Total_Tax extends Mage_Sales_Model_Order_In * Collect invoice tax amount * * @param Mage_Sales_Model_Order_Invoice $invoice + * @return Mage_Sales_Model_Order_Invoice_Total_Tax */ public function collect(Mage_Sales_Model_Order_Invoice $invoice) { @@ -40,6 +41,8 @@ public function collect(Mage_Sales_Model_Order_Invoice $invoice) $baseTotalHiddenTax = 0; $order = $invoice->getOrder(); + + /** @var $item Mage_Sales_Model_Order_Invoice_Item */ foreach ($invoice->getAllItems() as $item) { $orderItem = $item->getOrderItem(); $orderItemQty = $orderItem->getQtyOrdered(); @@ -52,21 +55,16 @@ public function collect(Mage_Sales_Model_Order_Invoice $invoice) /** * Resolve rounding problems */ - if ($item->isLast()) { - $tax = $orderItem->getTaxAmount() - $orderItem->getTaxInvoiced(); - $baseTax = $orderItem->getBaseTaxAmount() - $orderItem->getBaseTaxInvoiced(); - $hiddenTax = $orderItem->getHiddenTaxAmount() - $orderItem->getHiddenTaxInvoiced(); - $baseHiddenTax = $orderItem->getBaseHiddenTaxAmount() - $orderItem->getBaseHiddenTaxInvoiced(); - } else { - $tax = $orderItem->getTaxAmount()*$item->getQty()/$orderItemQty; - $baseTax = $orderItem->getBaseTaxAmount()*$item->getQty()/$orderItemQty; - $hiddenTax = $orderItem->getHiddenTaxAmount()*$item->getQty()/$orderItemQty; - $baseHiddenTax = $orderItem->getBaseHiddenTaxAmount()*$item->getQty()/$orderItemQty; - - $tax = $invoice->getStore()->roundPrice($tax); - $baseTax = $invoice->getStore()->roundPrice($baseTax); - $hiddenTax = $invoice->getStore()->roundPrice($hiddenTax); - $baseHiddenTax = $invoice->getStore()->roundPrice($baseHiddenTax); + $tax = $orderItem->getTaxAmount() - $orderItem->getTaxInvoiced(); + $baseTax = $orderItem->getBaseTaxAmount() - $orderItem->getBaseTaxInvoiced(); + $hiddenTax = $orderItem->getHiddenTaxAmount() - $orderItem->getHiddenTaxInvoiced(); + $baseHiddenTax = $orderItem->getBaseHiddenTaxAmount() - $orderItem->getBaseHiddenTaxInvoiced(); + if (!$item->isLast()) { + $availableQty = $orderItemQty - $orderItem->getQtyInvoiced(); + $tax = $invoice->roundPrice($tax / $availableQty * $item->getQty()); + $baseTax = $invoice->roundPrice($baseTax / $availableQty * $item->getQty(), 'base'); + $hiddenTax = $invoice->roundPrice($hiddenTax / $availableQty * $item->getQty()); + $baseHiddenTax = $invoice->roundPrice($baseHiddenTax / $availableQty * $item->getQty(), 'base'); } $item->setTaxAmount($tax); @@ -124,12 +122,13 @@ public function collect(Mage_Sales_Model_Order_Invoice $invoice) /** * Check if shipping tax calculation can be included to current invoice * @param Mage_Sales_Model_Order_Invoice $invoice + * @return boolean */ protected function _canIncludeShipping($invoice) { $includeShippingTax = true; /** - * Check shipping amount in previus invoices + * Check shipping amount in previous invoices */ foreach ($invoice->getOrder()->getInvoiceCollection() as $previusInvoice) { if ($previusInvoice->getShippingAmount() && !$previusInvoice->isCanceled()) { diff --git a/app/code/core/Mage/Sales/Model/Order/Item.php b/app/code/core/Mage/Sales/Model/Order/Item.php index 85f28ff6b6..7e3692ef26 100644 --- a/app/code/core/Mage/Sales/Model/Order/Item.php +++ b/app/code/core/Mage/Sales/Model/Order/Item.php @@ -180,6 +180,12 @@ * @method Mage_Sales_Model_Order_Item setHiddenTaxCanceled(float $value) * @method float getTaxRefunded() * @method Mage_Sales_Model_Order_Item setTaxRefunded(float $value) + * @method float getBaseTaxRefunded() + * @method Mage_Sales_Model_Order_Item setBaseTaxRefunded(float $value) + * @method float getDiscountRefunded() + * @method Mage_Sales_Model_Order_Item setDiscountRefunded(float $value) + * @method float getBaseDiscountRefunded() + * @method Mage_Sales_Model_Order_Item setBaseDiscountRefunded(float $value) * * @category Mage * @package Mage_Sales @@ -427,7 +433,7 @@ public function getStatusId() if (!$invoiced && !$shipped && !$refunded && !$canceled && !$backordered) { return self::STATUS_PENDING; } - if ($shipped && !$invoiced && ($actuallyOrdered == $shipped)) { + if ($shipped && $invoiced && ($actuallyOrdered == $shipped)) { return self::STATUS_SHIPPED; } diff --git a/app/code/core/Mage/Sales/Model/Order/Payment.php b/app/code/core/Mage/Sales/Model/Order/Payment.php index a3530f8a54..6a96243724 100644 --- a/app/code/core/Mage/Sales/Model/Order/Payment.php +++ b/app/code/core/Mage/Sales/Model/Order/Payment.php @@ -331,7 +331,7 @@ public function place() $orderIsNotified = $stateObject->getIsNotified(); } else { $orderStatus = $methodInstance->getConfigData('order_status'); - if (!$orderStatus || $order->getIsVirtual()) { + if (!$orderStatus) { $orderStatus = $order->getConfig()->getStateDefaultStatus($orderState); } } @@ -1024,11 +1024,6 @@ protected function _authorize($isOnline, $amount) if ($isOnline) { // invoke authorization on gateway $this->getMethodInstance()->setStore($order->getStoreId())->authorize($this, $amount); - } else { - $message = Mage::helper('sales')->__( - 'Registered notification about authorized amount of %s.', - $this->_formatPrice($amount) - ); } // similar logic of "payment review" order as in capturing diff --git a/app/code/core/Mage/Sales/Model/Order/Pdf/Abstract.php b/app/code/core/Mage/Sales/Model/Order/Pdf/Abstract.php index 04f85c9a16..43a134ef15 100644 --- a/app/code/core/Mage/Sales/Model/Order/Pdf/Abstract.php +++ b/app/code/core/Mage/Sales/Model/Order/Pdf/Abstract.php @@ -577,7 +577,7 @@ protected function _drawItem(Varien_Object $item, Zend_Pdf_Page $page, Mage_Sale protected function _setFontRegular($object, $size = 7) { - $font = Zend_Pdf_Font::fontWithPath(Mage::getBaseDir() . '/lib/LinLibertineFont/LinLibertineC_Re-2.8.0.ttf'); + $font = Zend_Pdf_Font::fontWithPath(Mage::getBaseDir() . '/lib/LinLibertineFont/LinLibertine_Re-4.4.1.ttf'); $object->setFont($font, $size); return $font; } @@ -728,6 +728,10 @@ public function drawLineBlocks(Zend_Pdf_Page $page, array $draw, array $pageSett $lineSpacing = !empty($column['height']) ? $column['height'] : $height; $top = 0; foreach ($column['text'] as $part) { + if ($this->y - $lineSpacing < 15) { + $page = $this->newPage($pageSettings); + } + $feed = $column['feed']; $textAlign = empty($column['align']) ? 'left' : $column['align']; $width = empty($column['width']) ? 0 : $column['width']; diff --git a/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Abstract.php b/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Abstract.php index f6b0aa972c..c6fbc952a1 100644 --- a/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Abstract.php +++ b/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Abstract.php @@ -259,7 +259,7 @@ public function getItemOptions() { protected function _setFontRegular($size = 7) { - $font = Zend_Pdf_Font::fontWithPath(Mage::getBaseDir() . '/lib/LinLibertineFont/LinLibertineC_Re-2.8.0.ttf'); + $font = Zend_Pdf_Font::fontWithPath(Mage::getBaseDir() . '/lib/LinLibertineFont/LinLibertine_Re-4.4.1.ttf'); $this->getPage()->setFont($font, $size); return $font; } diff --git a/app/code/core/Mage/Sales/Model/Quote.php b/app/code/core/Mage/Sales/Model/Quote.php index 11461cc4c9..0ff6ee2c30 100644 --- a/app/code/core/Mage/Sales/Model/Quote.php +++ b/app/code/core/Mage/Sales/Model/Quote.php @@ -466,9 +466,10 @@ public function getCustomer() */ public function getCustomerGroupId() { - if ($this->getCustomerId()) { - return ($this->getData('customer_group_id')) ? $this->getData('customer_group_id') - : $this->getCustomer()->getGroupId(); + if ($this->hasData('customer_group_id')) { + return $this->getData('customer_group_id'); + } else if ($this->getCustomerId()) { + return $this->getCustomer()->getGroupId(); } else { return Mage_Customer_Model_Group::NOT_LOGGED_IN_ID; } @@ -816,6 +817,19 @@ public function removeItem($itemId) return $this; } + /** + * Mark all quote items as deleted (empty quote) + * + * @return Mage_Sales_Model_Quote + */ + public function removeAllItems() + { + foreach ($this->getItemsCollection() as $item) { + $item->isDeleted(true); + } + return $this; + } + /** * Adding new item to quote * @@ -1209,12 +1223,7 @@ public function collectTotals() if ($this->getTotalsCollectedFlag()) { return $this; } - Mage::dispatchEvent( - $this->_eventPrefix . '_collect_totals_before', - array( - $this->_eventObject=>$this - ) - ); + Mage::dispatchEvent($this->_eventPrefix . '_collect_totals_before', array($this->_eventObject => $this)); $this->setSubtotal(0); $this->setBaseSubtotal(0); @@ -1279,10 +1288,7 @@ public function collectTotals() $this->setData('trigger_recollect', 0); $this->_validateCouponCode(); - Mage::dispatchEvent( - $this->_eventPrefix . '_collect_totals_after', - array($this->_eventObject => $this) - ); + Mage::dispatchEvent($this->_eventPrefix . '_collect_totals_after', array($this->_eventObject => $this)); $this->setTotalsCollectedFlag(true); return $this; @@ -1350,6 +1356,11 @@ public function addMessage($message, $index = 'error') return $this; } + /** + * Retrieve current quote messages + * + * @return array + */ public function getMessages() { $messages = $this->getData('messages'); @@ -1360,6 +1371,23 @@ public function getMessages() return $messages; } + /** + * Retrieve current quote errors + * + * @return array + */ + public function getErrors() + { + $errors = array(); + foreach ($this->getMessages() as $message) { + /* @var $error Mage_Core_Model_Message_Abstract */ + if ($message->getType() == Mage_Core_Model_Message::ERROR) { + array_push($errors, $message); + } + } + return $errors; + } + /** * Sets flag, whether this quote has some error associated with it. * @@ -1763,7 +1791,7 @@ public function prepareRecurringPaymentProfiles() protected function _validateCouponCode() { $code = $this->_getData('coupon_code'); - if ($code) { + if (strlen($code)) { $addressHasCoupon = false; $addresses = $this->getAllAddresses(); if (count($addresses)>0) { diff --git a/app/code/core/Mage/Sales/Model/Quote/Address.php b/app/code/core/Mage/Sales/Model/Quote/Address.php index d1099ac7fc..2764d48de8 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Address.php +++ b/app/code/core/Mage/Sales/Model/Quote/Address.php @@ -874,6 +874,8 @@ public function requestShippingRates(Mage_Sales_Model_Quote_Item_Abstract $item $request->setPackageCurrency($this->getQuote()->getStore()->getCurrentCurrency()); $request->setLimitCarrier($this->getLimitCarrier()); + $request->setBaseSubtotalInclTax($this->getBaseSubtotalInclTax()); + $result = Mage::getModel('shipping/shipping')->collectRates($request)->getResult(); $found = false; diff --git a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Discount.php b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Discount.php index 3a2e77b197..5ba7816a67 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Discount.php +++ b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Discount.php @@ -139,7 +139,8 @@ public function fetch(Mage_Sales_Model_Quote_Address $address) $amount = $address->getDiscountAmount(); if ($amount!=0) { $title = Mage::helper('sales')->__('Discount'); - if ($code = $address->getCouponCode()) { + $code = $address->getCouponCode(); + if (strlen($code)) { $title = Mage::helper('sales')->__('Discount (%s)', $code); } $address->addTotal(array( diff --git a/app/code/core/Mage/Sales/Model/Quote/Item/Abstract.php b/app/code/core/Mage/Sales/Model/Quote/Item/Abstract.php index 202970f56b..38695cfa4c 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Item/Abstract.php +++ b/app/code/core/Mage/Sales/Model/Quote/Item/Abstract.php @@ -308,8 +308,9 @@ public function getTotalQty() public function calcRowTotal() { $qty = $this->getTotalQty(); - $total = $this->getCalculationPriceOriginal()*$qty; - $baseTotal = $this->getBaseCalculationPriceOriginal()*$qty; + // Round unit price before multiplying to prevent losing 1 cent on subtotal + $total = $this->getStore()->roundPrice($this->getCalculationPriceOriginal()) * $qty; + $baseTotal = $this->getBaseCalculationPriceOriginal() * $qty; $this->setRowTotal($this->getStore()->roundPrice($total)); $this->setBaseRowTotal($this->getStore()->roundPrice($baseTotal)); diff --git a/app/code/core/Mage/Sales/Model/Resource/Helper/Interface.php b/app/code/core/Mage/Sales/Model/Resource/Helper/Interface.php new file mode 100644 index 0000000000..1f116f2d76 --- /dev/null +++ b/app/code/core/Mage/Sales/Model/Resource/Helper/Interface.php @@ -0,0 +1,49 @@ + + */ +interface Mage_Sales_Model_Resource_Helper_Interface +{ + /** + * Update rating position + * + * @param string $aggregation One of Mage_Sales_Model_Resource_Report_Bestsellers::AGGREGATION_XXX constants + * @param array $aggregationAliases + * @param string $mainTable + * @param string $aggregationTable + * @return Mage_Sales_Model_Resource_Helper_Abstract + */ + public function getBestsellersReportUpdateRatingPos($aggregation, $aggregationAliases, + $mainTable, $aggregationTable + ); +} diff --git a/app/code/core/Mage/Sales/Model/Resource/Helper/Mysql4.php b/app/code/core/Mage/Sales/Model/Resource/Helper/Mysql4.php index e52f9b3af3..ed27a4ba7f 100644 --- a/app/code/core/Mage/Sales/Model/Resource/Helper/Mysql4.php +++ b/app/code/core/Mage/Sales/Model/Resource/Helper/Mysql4.php @@ -33,6 +33,7 @@ * @author Magento Core Team */ class Mage_Sales_Model_Resource_Helper_Mysql4 extends Mage_Core_Model_Resource_Helper_Mysql4 + implements Mage_Sales_Model_Resource_Helper_Interface { /** * Update rating position @@ -46,55 +47,20 @@ class Mage_Sales_Model_Resource_Helper_Mysql4 extends Mage_Core_Model_Resource_H public function getBestsellersReportUpdateRatingPos($aggregation, $aggregationAliases, $mainTable, $aggregationTable ) { - $adapter = $this->_getWriteAdapter(); - $periodSubSelect = $adapter->select(); - $ratingSubSelect = $adapter->select(); - $ratingSelect = $adapter->select(); + /** @var $reportsResourceHelper Mage_Reports_Model_Resource_Helper_Interface */ + $reportsResourceHelper = Mage::getResourceHelper('reports'); - $periodCol = 't.period'; if ($aggregation == $aggregationAliases['monthly']) { - $periodCol = $adapter->getDateFormatSql('t.period', '%Y-%m-01'); + $reportsResourceHelper + ->updateReportRatingPos('month', 'qty_ordered', $mainTable, $aggregationTable); } elseif ($aggregation == $aggregationAliases['yearly']) { - $periodCol = $adapter->getDateFormatSql('t.period', '%Y-01-01'); + $reportsResourceHelper + ->updateReportRatingPos('year', 'qty_ordered', $mainTable, $aggregationTable); + } else { + $reportsResourceHelper + ->updateReportRatingPos('day', 'qty_ordered', $mainTable, $aggregationTable); } - $columns = array( - 'period' => 't.period', - 'store_id' => 't.store_id', - 'product_id' => 't.product_id', - 'product_name' => 't.product_name', - 'product_price' => 't.product_price', - ); - - if ($aggregation == $aggregationAliases['daily']) { - $columns['id'] = 't.id'; // to speed-up insert on duplicate key update - } - - $cols = array_keys($columns); - $cols['total_qty_ordered'] = new Zend_Db_Expr('SUM(t.qty_ordered)'); - $periodSubSelect->from(array('t' => $mainTable), $cols) - ->group(array('t.store_id', $periodCol, 't.product_id')) - ->order(array('t.store_id', $periodCol, 'total_qty_ordered DESC')); - - $cols = $columns; - $cols['qty_ordered'] = 't.total_qty_ordered'; - $cols['rating_pos'] = new Zend_Db_Expr( - "(@pos := IF(t.`store_id` <> @prevStoreId OR {$periodCol} <> @prevPeriod, 1, @pos+1))"); - $cols['prevStoreId'] = new Zend_Db_Expr('(@prevStoreId := t.`store_id`)'); - $cols['prevPeriod'] = new Zend_Db_Expr("(@prevPeriod := {$periodCol})"); - $ratingSubSelect->from($periodSubSelect, $cols); - - $cols = $columns; - $cols['period'] = $periodCol; // important! - $cols['qty_ordered'] = 't.qty_ordered'; - $cols['rating_pos'] = 't.rating_pos'; - $ratingSelect->from($ratingSubSelect, $cols); - - $sql = $ratingSelect->insertFromSelect($aggregationTable, array_keys($cols)); - $adapter->query("SET @pos = 0, @prevStoreId = -1, @prevPeriod = '0000-00-00'"); - - $adapter->query($sql); - return $this; } } diff --git a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend/Discount.php b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend/Discount.php index c2363b0697..577ca0bc1b 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend/Discount.php +++ b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend/Discount.php @@ -46,8 +46,9 @@ public function fetchTotals(Mage_Sales_Model_Quote_Address $address) $amount = $address->getDiscountAmount(); if ($amount != 0) { $title = Mage::helper('sales')->__('Discount'); - if ($address->getQuote()->getCouponCode()) { - $title .= sprintf(' (%s)', $address->getQuote()->getCouponCode()); + $couponCode = $address->getQuote()->getCouponCode(); + if (strlen($couponCode)) { + $title .= sprintf(' (%s)', $couponCode); } $address->addTotal(array( 'code' => 'discount', diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Bestsellers/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Report/Bestsellers/Collection.php index c6b8578320..d5b445480b 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Report/Bestsellers/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report/Bestsellers/Collection.php @@ -110,7 +110,7 @@ protected function _makeBoundarySelect($from, $to) ->where('period >= ?', $from) ->where('period <= ?', $to) ->group('product_id') - ->order('qty_ordered') + ->order('qty_ordered DESC') ->limit($this->_ratingLimit); $this->_applyStoresFilterToSelect($sel); @@ -218,7 +218,6 @@ protected function _beforeLoad() parent::_beforeLoad(); $this->_applyStoresFilter(); - $this->_applyDateRangeFilter(); if ($this->_period) { // @@ -342,6 +341,8 @@ protected function _beforeLoad() } + $this->_applyDateRangeFilter(); + // add unions to select if ($selectUnions) { $unionParts = array(); diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Collection/Abstract.php b/app/code/core/Mage/Sales/Model/Resource/Report/Collection/Abstract.php index 8c19fe7d68..3b73b63db1 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Report/Collection/Abstract.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report/Collection/Abstract.php @@ -32,22 +32,9 @@ * @package Mage_Sales * @author Magento Core Team */ -class Mage_Sales_Model_Resource_Report_Collection_Abstract extends Mage_Core_Model_Resource_Db_Collection_Abstract +class Mage_Sales_Model_Resource_Report_Collection_Abstract + extends Mage_Reports_Model_Resource_Report_Collection_Abstract { - /** - * From date - * - * @var string - */ - protected $_from = null; - - /** - * To date - * - * @var string - */ - protected $_to = null; - /** * Order status * @@ -55,169 +42,6 @@ class Mage_Sales_Model_Resource_Report_Collection_Abstract extends Mage_Core_Mod */ protected $_orderStatus = null; - /** - * Period - * - * @var string - */ - protected $_period = null; - - /** - * Store ids - * - * @var int|array - */ - protected $_storesIds = 0; - - /** - * Does filters should be applied - * - * @var bool - */ - protected $_applyFilters = true; - - /** - * Is totals - * - * @var bool - */ - protected $_isTotals = false; - - /** - * Is subtotals - * - * @var bool - */ - protected $_isSubTotals = false; - - /** - * Aggregated columns - * - * @var array - */ - protected $_aggregatedColumns = array(); - - /** - * Set array of columns that should be aggregated - * - * @param array $columns - * @return Mage_Sales_Model_Resource_Report_Collection_Abstract - */ - public function setAggregatedColumns(array $columns) - { - $this->_aggregatedColumns = $columns; - return $this; - } - - /** - * Retrieve array of columns that should be aggregated - * - * @return array - */ - public function getAggregatedColumns() - { - return $this->_aggregatedColumns; - } - - /** - * Set date range - * - * @param mixed $from - * @param mixed $to - * @return Mage_Sales_Model_Resource_Report_Collection_Abstract - */ - public function setDateRange($from = null, $to = null) - { - $this->_from = $from; - $this->_to = $to; - return $this; - } - - /** - * Set period - * - * @param string $period - * @return Mage_Sales_Model_Resource_Report_Collection_Abstract - */ - public function setPeriod($period) - { - $this->_period = $period; - return $this; - } - - /** - * Apply date range filter - * - * @return Mage_Sales_Model_Resource_Report_Collection_Abstract - */ - protected function _applyDateRangeFilter() - { - // Remember that field PERIOD is a DATE(YYYY-MM-DD) in all databases including Oracle - if ($this->_from !== null) { - $this->getSelect()->where('period >= ?', $this->_from); - } - if ($this->_to !== null) { - $this->getSelect()->where('period <= ?', $this->_to); - } - - return $this; - } - - /** - * Set store ids - * - * @param mixed $storeIds (null, int|string, array, array may contain null) - * @return Mage_Sales_Model_Resource_Report_Collection_Abstract - */ - public function addStoreFilter($storeIds) - { - $this->_storesIds = $storeIds; - return $this; - } - - /** - * Apply stores filter to select object - * - * @param Zend_Db_Select $select - * @return Mage_Sales_Model_Resource_Report_Collection_Abstract - */ - protected function _applyStoresFilterToSelect(Zend_Db_Select $select) - { - $nullCheck = false; - $storeIds = $this->_storesIds; - - if (!is_array($storeIds)) { - $storeIds = array($storeIds); - } - - $storeIds = array_unique($storeIds); - - if ($index = array_search(null, $storeIds)) { - unset($storeIds[$index]); - $nullCheck = true; - } - - $storeIds[0] = ($storeIds[0] == '') ? 0 : $storeIds[0]; - - if ($nullCheck) { - $select->where('store_id IN(?) OR store_id IS NULL', $storeIds); - } else { - $select->where('store_id IN(?)', $storeIds); - } - - return $this; - } - - /** - * Apply stores filter - * - * @return Mage_Sales_Model_Resource_Report_Collection_Abstract - */ - protected function _applyStoresFilter() - { - return $this->_applyStoresFilterToSelect($this->getSelect()); - } - /** * Set status filter * @@ -249,66 +73,12 @@ protected function _applyOrderStatusFilter() } /** - * Set apply filters flag - * - * @param boolean $flag - * @return Mage_Sales_Model_Resource_Report_Collection_Abstract - */ - public function setApplyFilters($flag) - { - $this->_applyFilters = $flag; - return $this; - } - - /** - * Getter/Setter for isTotals - * - * @param null|boolean $flag - * @return Mage_Sales_Model_Resource_Report_Collection_Abstract - */ - public function isTotals($flag = null) - { - if (is_null($flag)) { - return $this->_isTotals; - } - $this->_isTotals = $flag; - return $this; - } - - /** - * Getter/Setter for isSubTotals + * Order status filter is custom for this collection * - * @param null|boolean $flag * @return Mage_Sales_Model_Resource_Report_Collection_Abstract */ - public function isSubTotals($flag = null) + protected function _applyCustomFilter() { - if (is_null($flag)) { - return $this->_isSubTotals; - } - $this->_isSubTotals = $flag; - return $this; - } - - /** - * Load data - * Redeclare parent load method just for adding method _beforeLoad - * - * @param bool $printQuery - * @param bool $logQuery - * @return Mage_Sales_Model_Resource_Report_Collection_Abstract - */ - public function load($printQuery = false, $logQuery = false) - { - if ($this->isLoaded()) { - return $this; - } - $this->_initSelect(); - if ($this->_applyFilters) { - $this->_applyDateRangeFilter(); - $this->_applyStoresFilter(); - $this->_applyOrderStatusFilter(); - } - return parent::load($printQuery, $logQuery); + return $this->_applyOrderStatusFilter(); } } diff --git a/app/code/core/Mage/Sales/Model/Service/Order.php b/app/code/core/Mage/Sales/Model/Service/Order.php index 88a5935661..458c3e879f 100644 --- a/app/code/core/Mage/Sales/Model/Service/Order.php +++ b/app/code/core/Mage/Sales/Model/Service/Order.php @@ -77,9 +77,10 @@ public function getOrder() } /** - * Prepare order invoice based on order data and requested items qtys + * Prepare order invoice based on order data and requested items qtys. If $qtys is not empty - the function will + * prepare only specified items, otherwise all containing in the order. * - * @param array $data + * @param array $qtys * @return Mage_Sales_Model_Order_Invoice */ public function prepareInvoice($qtys = array()) @@ -93,14 +94,12 @@ public function prepareInvoice($qtys = array()) $item = $this->_convertor->itemToInvoiceItem($orderItem); if ($orderItem->isDummy()) { $qty = $orderItem->getQtyOrdered() ? $orderItem->getQtyOrdered() : 1; - } else { + } else if (!empty($qtys)) { if (isset($qtys[$orderItem->getId()])) { $qty = (float) $qtys[$orderItem->getId()]; - } elseif (!count($qtys)) { - $qty = $orderItem->getQtyToInvoice(); - } else { - continue; } + } else { + $qty = $orderItem->getQtyToInvoice(); } $totalQty += $qty; $item->setQty($qty); diff --git a/app/code/core/Mage/Sales/Model/Service/Quote.php b/app/code/core/Mage/Sales/Model/Service/Quote.php index bf49660f59..18b37e3655 100644 --- a/app/code/core/Mage/Sales/Model/Service/Quote.php +++ b/app/code/core/Mage/Sales/Model/Service/Quote.php @@ -289,31 +289,30 @@ protected function _inactivateQuote() */ protected function _validate() { - $helper = Mage::helper('sales'); if (!$this->getQuote()->isVirtual()) { $address = $this->getQuote()->getShippingAddress(); $addressValidation = $address->validate(); if ($addressValidation !== true) { Mage::throwException( - $helper->__('Please check shipping address information. %s', implode(' ', $addressValidation)) + Mage::helper('sales')->__('Please check shipping address information. %s', implode(' ', $addressValidation)) ); } $method= $address->getShippingMethod(); $rate = $address->getShippingRateByCode($method); if (!$this->getQuote()->isVirtual() && (!$method || !$rate)) { - Mage::throwException($helper->__('Please specify a shipping method.')); + Mage::throwException(Mage::helper('sales')->__('Please specify a shipping method.')); } } $addressValidation = $this->getQuote()->getBillingAddress()->validate(); if ($addressValidation !== true) { Mage::throwException( - $helper->__('Please check billing address information. %s', implode(' ', $addressValidation)) + Mage::helper('sales')->__('Please check billing address information. %s', implode(' ', $addressValidation)) ); } if (!($this->getQuote()->getPayment()->getMethod())) { - Mage::throwException($helper->__('Please select a valid payment method.')); + Mage::throwException(Mage::helper('sales')->__('Please select a valid payment method.')); } return $this; diff --git a/app/code/core/Mage/Sales/data/sales_setup/data-upgrade-1.6.0.4-1.6.0.5.php b/app/code/core/Mage/Sales/data/sales_setup/data-upgrade-1.6.0.4-1.6.0.5.php new file mode 100644 index 0000000000..608d430bac --- /dev/null +++ b/app/code/core/Mage/Sales/data/sales_setup/data-upgrade-1.6.0.4-1.6.0.5.php @@ -0,0 +1,76 @@ +getConnection()->select() + ->from( + array('citem' => $installer->getTable('sales/creditmemo_item')), + array( + 'amount_refunded' => 'SUM(citem.row_total)', + 'base_amount_refunded' => 'SUM(citem.base_row_total)', + 'base_tax_refunded' => 'SUM(citem.base_tax_amount)', + 'discount_refunded' => 'SUM(citem.discount_amount)', + 'base_discount_refunded' => 'SUM(citem.base_discount_amount)', + ) + ) + ->joinLeft( + array('c' => $installer->getTable('sales/creditmemo')), + 'c.entity_id = citem.parent_id', + array() + ) + ->joinLeft( + array('o' => $installer->getTable('sales/order')), + 'o.entity_id = c.order_id', + array() + ) + ->joinLeft( + array('oitem' => $installer->getTable('sales/order_item')), + 'oitem.order_id = o.entity_id AND oitem.product_id=citem.product_id', + array('item_id') + ) + ->group('oitem.item_id'); + +$select = $installer->getConnection()->select() + ->from( + array('selected' => $subSelect), + array( + 'amount_refunded' => 'amount_refunded', + 'base_amount_refunded' => 'base_amount_refunded', + 'base_tax_refunded' => 'base_tax_refunded', + 'discount_refunded' => 'discount_refunded', + 'base_discount_refunded' => 'base_discount_refunded', + ) + ) + ->where('main.item_id = selected.item_id'); + +$updateQuery = $installer->getConnection()->updateFromSelect( + $select, + array('main' => $installer->getTable('sales/order_item')) +); + +$installer->getConnection()->query($updateQuery); diff --git a/app/code/core/Mage/Sales/etc/config.xml b/app/code/core/Mage/Sales/etc/config.xml index cfb1f8d5cc..46db3b3716 100644 --- a/app/code/core/Mage/Sales/etc/config.xml +++ b/app/code/core/Mage/Sales/etc/config.xml @@ -28,7 +28,7 @@ - 1.6.0.4 + 1.6.0.7 @@ -1464,6 +1464,24 @@ + + + + + sales/observer + handleCustomerVatNumber + + + + + + + sales/observer + addVatRequestParamsOrderComment + + + + diff --git a/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.4-1.6.0.5.php b/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.4-1.6.0.5.php new file mode 100644 index 0000000000..ed4255763c --- /dev/null +++ b/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.4-1.6.0.5.php @@ -0,0 +1,49 @@ +getConnection() + ->addColumn($installer->getTable('sales/order_item'), 'base_tax_refunded', array( + 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, + 'comment' => 'Base Tax Refunded', + 'scale' => 4, + 'precision' => 12, + )); +$installer->getConnection() + ->addColumn($installer->getTable('sales/order_item'), 'discount_refunded', array( + 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, + 'comment' => 'Discount Refunded', + 'scale' => 4, + 'precision' => 12, + )); +$installer->getConnection() + ->addColumn($installer->getTable('sales/order_item'), 'base_discount_refunded', array( + 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, + 'comment' => 'Base Discount Refunded', + 'scale' => 4, + 'precision' => 12, + )); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.5-1.6.0.6.php b/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.5-1.6.0.6.php new file mode 100644 index 0000000000..a7d3f63621 --- /dev/null +++ b/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.5-1.6.0.6.php @@ -0,0 +1,47 @@ + array('type' => Varien_Db_Ddl_Table::TYPE_TEXT), + 'vat_is_valid' => array('type' => Varien_Db_Ddl_Table::TYPE_SMALLINT), + 'vat_request_id' => array('type' => Varien_Db_Ddl_Table::TYPE_TEXT), + 'vat_request_date' => array('type' => Varien_Db_Ddl_Table::TYPE_TEXT), + 'vat_request_success' => array('type' => Varien_Db_Ddl_Table::TYPE_SMALLINT) +); + +foreach ($entitiesToAlter as $entityName) { + foreach ($attributes as $attributeCode => $attributeParams) { + $installer->addAttribute($entityName, $attributeCode, $attributeParams); + } +} diff --git a/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.6-1.6.0.7.php b/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.6-1.6.0.7.php new file mode 100644 index 0000000000..7fb9f66f47 --- /dev/null +++ b/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.6-1.6.0.7.php @@ -0,0 +1,36 @@ +getConnection() + ->addColumn($installer->getTable('sales/order'), 'coupon_rule_name', array( + 'TYPE' => Varien_Db_Ddl_Table::TYPE_TEXT, + 'LENGTH' => 255, + 'NULLABLE' => true, + 'COMMENT' => 'Coupon Sales Rule Name' + )); diff --git a/app/code/core/Mage/SalesRule/Helper/Coupon.php b/app/code/core/Mage/SalesRule/Helper/Coupon.php new file mode 100644 index 0000000000..240967ec2a --- /dev/null +++ b/app/code/core/Mage/SalesRule/Helper/Coupon.php @@ -0,0 +1,147 @@ + + */ +class Mage_SalesRule_Helper_Coupon extends Mage_Core_Helper_Abstract +{ + /** + * Constants which defines all possible coupon codes formats + */ + const COUPON_FORMAT_ALPHANUMERIC = 'alphanum'; + const COUPON_FORMAT_ALPHABETICAL = 'alpha'; + const COUPON_FORMAT_NUMERIC = 'num'; + + /** + * Defines type of Coupon + */ + const COUPON_TYPE_SPECIFIC_AUTOGENERATED = 1; + + /** + * XML paths to coupon codes generation options + */ + const XML_PATH_SALES_RULE_COUPON_LENGTH = 'promo/auto_generated_coupon_codes/length'; + const XML_PATH_SALES_RULE_COUPON_FORMAT = 'promo/auto_generated_coupon_codes/format'; + const XML_PATH_SALES_RULE_COUPON_PREFIX = 'promo/auto_generated_coupon_codes/prefix'; + const XML_PATH_SALES_RULE_COUPON_SUFFIX = 'promo/auto_generated_coupon_codes/suffix'; + const XML_PATH_SALES_RULE_COUPON_DASH_INTERVAL = 'promo/auto_generated_coupon_codes/dash'; + + /** + * Config path for character set and separator + */ + const XML_CHARSET_NODE = 'global/salesrule/coupon/charset/%s'; + const XML_CHARSET_SEPARATOR = 'global/salesrule/coupon/separator'; + + /** + * Get all possible coupon codes formats + * + * @return array + */ + public function getFormatsList() + { + return array( + self::COUPON_FORMAT_ALPHANUMERIC => $this->__('Alphanumeric'), + self::COUPON_FORMAT_ALPHABETICAL => $this->__('Alphabetical'), + self::COUPON_FORMAT_NUMERIC => $this->__('Numeric'), + ); + } + + /** + * Get default coupon code length + * + * @return int + */ + public function getDefaultLength() + { + return (int)Mage::getStoreConfig(self::XML_PATH_SALES_RULE_COUPON_LENGTH); + } + + /** + * Get default coupon code format + * + * @return int + */ + public function getDefaultFormat() + { + return (int)Mage::getStoreConfig(self::XML_PATH_SALES_RULE_COUPON_FORMAT); + } + + /** + * Get default coupon code prefix + * + * @return string + */ + public function getDefaultPrefix() + { + return Mage::getStoreConfig(self::XML_PATH_SALES_RULE_COUPON_PREFIX); + } + + /** + * Get default coupon code suffix + * + * @return string + */ + public function getDefaultSuffix() + { + return Mage::getStoreConfig(self::XML_PATH_SALES_RULE_COUPON_SUFFIX); + } + + /** + * Get dashes occurrences frequency in coupon code + * + * @return int + */ + public function getDefaultDashInterval() + { + return (int)Mage::getStoreConfig(self::XML_PATH_SALES_RULE_COUPON_DASH_INTERVAL); + } + + /** + * Get Coupon's alphabet as array of chars + * + * @param string $format + * @return array|bool + */ + public function getCharset($format) + { + return str_split((string) Mage::app()->getConfig()->getNode(sprintf(self::XML_CHARSET_NODE, $format))); + } + + /** + * Retrieve Separator from config + * + * @return string + */ + public function getCodeSeparator() + { + return (string) Mage::app()->getConfig()->getNode(Mage_SalesRule_Helper_Coupon::XML_CHARSET_SEPARATOR); + } +} diff --git a/app/code/core/Mage/SalesRule/Model/Coupon.php b/app/code/core/Mage/SalesRule/Model/Coupon.php index cbd0c40411..0a1f10412c 100644 --- a/app/code/core/Mage/SalesRule/Model/Coupon.php +++ b/app/code/core/Mage/SalesRule/Model/Coupon.php @@ -44,6 +44,8 @@ * @method Mage_SalesRule_Model_Coupon setExpirationDate(string $value) * @method int getIsPrimary() * @method Mage_SalesRule_Model_Coupon setIsPrimary(int $value) + * @method int getType() + * @method Mage_SalesRule_Model_Coupon setType(int $value) * * @category Mage * @package Mage_SalesRule @@ -92,11 +94,24 @@ public function setRule(Mage_SalesRule_Model_Rule $rule) /** * Load primary coupon for specified rule * - * @param Mage_SalesRule_Model_Rule|int Rule + * @param Mage_SalesRule_Model_Rule|int $rule + * @return Mage_SalesRule_Model_Coupon */ public function loadPrimaryByRule($rule) { $this->getResource()->loadPrimaryByRule($this, $rule); return $this; } + + /** + * Load Shopping Cart Price Rule by coupon code + * + * @param string $couponCode + * @return Mage_SalesRule_Model_Coupon + */ + public function loadByCode($couponCode) + { + $this->load($couponCode, 'code'); + return $this; + } } diff --git a/app/code/core/Mage/SalesRule/Model/Coupon/Massgenerator.php b/app/code/core/Mage/SalesRule/Model/Coupon/Massgenerator.php new file mode 100644 index 0000000000..0107f6f26a --- /dev/null +++ b/app/code/core/Mage/SalesRule/Model/Coupon/Massgenerator.php @@ -0,0 +1,188 @@ + + */ +class Mage_SalesRule_Model_Coupon_Massgenerator extends Mage_Core_Model_Abstract + implements Mage_SalesRule_Model_Coupon_CodegeneratorInterface +{ + /** + * Maximum probability of guessing the coupon on the first attempt + */ + const MAX_PROBABILITY_OF_GUESSING = 0.25; + const MAX_GENERATE_ATTEMPTS = 10; + + /** + * Count of generated Coupons + * @var int + */ + protected $_generatedCount = 0; + + /** + * Initialize resource + */ + protected function _construct() + { + $this->_init('salesrule/coupon'); + } + + /** + * Generate coupon code + * + * @return string + */ + public function generateCode() + { + $format = $this->getFormat(); + if (!$format) { + $format = Mage_SalesRule_Helper_Coupon::COUPON_FORMAT_ALPHANUMERIC; + } + $length = max(1, (int) $this->getLength()); + $split = max(0, (int) $this->getDash()); + $suffix = $this->getSuffix(); + $prefix = $this->getPrefix(); + + $splitChar = $this->getDelimiter(); + $charset = Mage::helper('salesrule/coupon')->getCharset($format); + + $code = ''; + for ($i=0; $i<$length; $i++) { + $char = $charset[array_rand($charset)]; + if ($split > 0 && ($i%$split) == 0 && $i != 0) { + $char = $splitChar . $char; + } + $code .= $char; + } + + $code = $prefix . $code . $suffix; + return $code; + } + + /** + * Retrieve delimiter + * + * @return string + */ + public function getDelimiter() + { + if ($this->getData('delimiter')) { + return $this->getData('delimiter'); + } else { + return Mage::helper('salesrule/coupon')->getCodeSeparator(); + } + } + + /** + * Generate Coupons Pool + * + * @return Mage_SalesRule_Model_Coupon_Massgenerator + */ + public function generatePool() + { + $this->_generatedCount = 0; + $size = $this->getQty(); + + $maxProbability = $this->getMaxProbability() ? $this->getMaxProbability() : self::MAX_PROBABILITY_OF_GUESSING; + $maxAttempts = $this->getMaxAttempts() ? $this->getMaxAttempts() : self::MAX_GENERATE_ATTEMPTS; + + /** @var $coupon Mage_SalesRule_Model_Coupon */ + $coupon = Mage::getModel('salesrule/coupon'); + + $chars = count(Mage::helper('salesrule/coupon')->getCharset($this->getFormat())); + $length = (int) $this->getLength(); + $maxCodes = pow($chars, $length); + $probability = $size / $maxCodes; + //increase the length of Code if probability is low + if ($probability > $maxProbability) { + do { + $length++; + $maxCodes = pow($chars, $length); + $probability = $size / $maxCodes; + } while ($probability > $maxProbability); + $this->setLength($length); + } + + for ($i = 0; $i < $size; $i++) { + $attempt = 0; + do { + if ($attempt >= $maxAttempts) { + Mage::throwException(Mage::helper('salesrule')->__('Unable to create requested Coupon Qty. Please check settings and try again.')); + } + $code = $this->generateCode(); + $attempt++; + } while ($this->getResource()->exists($code)); + + $expirationDate = $this->getToDate(); + if ($expirationDate instanceof Zend_Date) { + $expirationDate = $expirationDate->toString(Varien_Date::DATETIME_INTERNAL_FORMAT); + } + + $coupon->setId(null) + ->setRuleId($this->getRuleId()) + ->setUsageLimit($this->getUsesPerCoupon()) + ->setUsagePerCustomer($this->getUsesPerCustomer()) + ->setExpirationDate($expirationDate) + ->setType(Mage_SalesRule_Helper_Coupon::COUPON_TYPE_SPECIFIC_AUTOGENERATED) + ->setCode($code) + ->save(); + + $this->_generatedCount++; + } + return $this; + } + + /** + * Validate input + * + * @param array $data + * @return bool + */ + public function validateData($data) + { + return !empty($data) && !empty($data['qty']) && !empty($data['rule_id']) + && !empty($data['length']) && !empty($data['format']) + && (int)$data['qty'] > 0 && (int) $data['rule_id'] > 0 + && (int) $data['length'] > 0; + } + + /** + * Retrieve count of generated Coupons + * + * @return int + */ + public function getGeneratedCount() + { + return $this->_generatedCount; + } +} diff --git a/app/code/core/Mage/SalesRule/Model/Observer.php b/app/code/core/Mage/SalesRule/Model/Observer.php index 9235701076..14745af65b 100644 --- a/app/code/core/Mage/SalesRule/Model/Observer.php +++ b/app/code/core/Mage/SalesRule/Model/Observer.php @@ -241,5 +241,43 @@ public function addProductAttributes(Varien_Event_Observer $observer) $attributesTransfer->addData($result); return $this; } + + /** + * Add coupon's rule name to order data + * + * @param Varien_Event_Observer $observer + * @return Mage_SalesRule_Model_Observer + */ + public function addSalesRuleNameToOrder($observer) + { + $order = $observer->getOrder(); + $couponCode = $order->getCouponCode(); + + if (empty($couponCode)) { + return $this; + } + + /** + * @var Mage_SalesRule_Model_Coupon $couponModel + */ + $couponModel = Mage::getModel('salesrule/coupon'); + $couponModel->loadByCode($couponCode); + + $ruleId = $couponModel->getRuleId(); + + if (empty($ruleId)) { + return $this; + } + + /** + * @var Mage_SalesRule_Model_Rule $ruleModel + */ + $ruleModel = Mage::getModel('salesrule/rule'); + $ruleModel->load($ruleId); + + $order->setCouponRuleName($ruleModel->getName()); + + return $this; + } } diff --git a/app/code/core/Mage/SalesRule/Model/Quote/Discount.php b/app/code/core/Mage/SalesRule/Model/Quote/Discount.php index 01639d91bc..5f884b899c 100644 --- a/app/code/core/Mage/SalesRule/Model/Quote/Discount.php +++ b/app/code/core/Mage/SalesRule/Model/Quote/Discount.php @@ -139,7 +139,7 @@ public function fetch(Mage_Sales_Model_Quote_Address $address) if ($amount!=0) { $description = $address->getDiscountDescription(); - if ($description) { + if (strlen($description)) { $title = Mage::helper('sales')->__('Discount (%s)', $description); } else { $title = Mage::helper('sales')->__('Discount'); diff --git a/app/code/core/Mage/SalesRule/Model/Resource/Coupon.php b/app/code/core/Mage/SalesRule/Model/Resource/Coupon.php index 96045a2102..3fa2d14c3c 100755 --- a/app/code/core/Mage/SalesRule/Model/Resource/Coupon.php +++ b/app/code/core/Mage/SalesRule/Model/Resource/Coupon.php @@ -36,22 +36,21 @@ class Mage_SalesRule_Model_Resource_Coupon extends Mage_Core_Model_Resource_Db_A { /** * Constructor adds unique fields - * */ protected function _construct() { $this->_init('salesrule/coupon', 'coupon_id'); $this->addUniqueField(array( 'field' => 'code', - 'title' => Mage::helper('salesRule')->__('Coupon with the same code') + 'title' => Mage::helper('salesrule')->__('Coupon with the same code') )); } /** * Perform actions before object save * - * @param Varien_Object $object - * @return unknown + * @param Mage_Core_Model_Abstract $object + * @return Mage_Core_Model_Resource_Db_Abstract */ public function _beforeSave(Mage_Core_Model_Abstract $object) { @@ -72,7 +71,7 @@ public function _beforeSave(Mage_Core_Model_Abstract $object) * * * @param Mage_SalesRule_Model_Coupon $object - * @param unknown_type $rule + * @param Mage_SalesRule_Model_Rule|int $rule * @return unknown */ public function loadPrimaryByRule(Mage_SalesRule_Model_Coupon $object, $rule) @@ -100,4 +99,62 @@ public function loadPrimaryByRule(Mage_SalesRule_Model_Coupon $object, $rule) $this->_afterLoad($object); return true; } + + /** + * Check if code exists + * + * @param string $code + * @return bool + */ + public function exists($code) + { + $read = $this->_getReadAdapter(); + $select = $read->select(); + $select->from($this->getMainTable(), 'code'); + $select->where('code = :code'); + + if ($read->fetchOne($select, array('code' => $code)) === false) { + return false; + } + return true; + } + + /** + * Update auto generated Specific Coupon if it's rule changed + * + * @param Mage_SalesRule_Model_Rule $rule + * @return Mage_SalesRule_Model_Resource_Coupon + */ + public function updateSpecificCoupons(Mage_SalesRule_Model_Rule $rule) + { + if (!$rule || !$rule->getId() || !$rule->hasDataChanges()) { + return $this; + } + + $updateArray = array(); + if ($rule->dataHasChangedFor('uses_per_coupon')) { + $updateArray['usage_limit'] = $rule->getUsesPerCoupon(); + } + + if ($rule->dataHasChangedFor('uses_per_customer')) { + $updateArray['usage_per_customer'] = $rule->getUsesPerCustomer(); + } + + $ruleNewDate = new Zend_Date($rule->getToDate()); + $ruleOldDate = new Zend_Date($rule->getOrigData('to_date')); + + if ($ruleNewDate->compare($ruleOldDate)) { + $updateArray['expiration_date'] = $rule->getToDate(); + } + + if (!empty($updateArray)) { + $this->_getWriteAdapter()->update( + $this->getTable('salesrule/coupon'), + $updateArray, + array('rule_id = ?' => $rule->getId()) + ); + } + + return $this; + } } diff --git a/app/code/core/Mage/SalesRule/Model/Resource/Coupon/Collection.php b/app/code/core/Mage/SalesRule/Model/Resource/Coupon/Collection.php index f0f0af9a5b..77115ff227 100755 --- a/app/code/core/Mage/SalesRule/Model/Resource/Coupon/Collection.php +++ b/app/code/core/Mage/SalesRule/Model/Resource/Coupon/Collection.php @@ -47,8 +47,9 @@ protected function _construct() /** * Add rule to filter * + * @param Mage_SalesRule_Model_Rule|int $rule * - * @param unknown_type $rule + * @return Mage_SalesRule_Model_Resource_Coupon_Collection */ public function addRuleToFilter($rule) { @@ -57,17 +58,48 @@ public function addRuleToFilter($rule) } else { $ruleId = (int)$rule; } + $this->addFieldToFilter('rule_id', $ruleId); + + return $this; } /** * Add rule IDs to filter * - * * @param array $ruleIds + * + * @return Mage_SalesRule_Model_Resource_Coupon_Collection */ public function addRuleIdsToFilter(array $ruleIds) { $this->addFieldToFilter('rule_id', array('in' => $ruleIds)); + return $this; + } + + /** + * Filter collection to be filled with auto-generated coupons only + * + * @return Mage_SalesRule_Model_Resource_Coupon_Collection + */ + public function addGeneratedCouponsFilter() + { + $this->addFieldToFilter('is_primary', array('null' => 1)); + return $this; + } + + /** + * Callback function that filters collection by field "Used" from grid + * + * @param Mage_Core_Model_Resource_Db_Collection_Abstract $collection + * @param Mage_Adminhtml_Block_Widget_Grid_Column $column + */ + public function addIsUsedFilterCallback($collection, $column) + { + $filterValue = $column->getFilter()->getCondition(); + $collection->addFieldToFilter( + $this->getConnection()->getCheckSql('main_table.times_used > 0', 1, 0), + array('eq' => $filterValue) + ); } } diff --git a/app/code/core/Mage/SalesRule/Model/Resource/Report/Collection.php b/app/code/core/Mage/SalesRule/Model/Resource/Report/Collection.php index 911c6a871a..bc7d552f9d 100755 --- a/app/code/core/Mage/SalesRule/Model/Resource/Report/Collection.php +++ b/app/code/core/Mage/SalesRule/Model/Resource/Report/Collection.php @@ -55,6 +55,13 @@ class Mage_SalesRule_Model_Resource_Report_Collection extends Mage_Sales_Model_R */ protected $_selectedColumns = array(); + /** + * array where rules ids stored + * + * @var array + */ + protected $_rulesIdsFilter; + /** * Initialize custom resource model * @@ -88,6 +95,7 @@ protected function _getSelectedColumns() $this->_selectedColumns = array( 'period' => $this->_periodFormat, 'coupon_code', + 'rule_name', 'coupon_uses' => 'SUM(coupon_uses)', 'subtotal_amount' => 'SUM(subtotal_amount)', 'discount_amount' => 'SUM(discount_amount)', @@ -131,5 +139,54 @@ protected function _initSelect() return $this; } + /** + * Add filtering by rules ids + * + * @param array $rulesList + * @return Mage_SalesRule_Model_Resource_Report_Collection + */ + public function addRuleFilter($rulesList) + { + $this->_rulesIdsFilter = $rulesList; + return $this; + } + /** + * Apply filtering by rules ids + * + * @return Mage_SalesRule_Model_Resource_Report_Collection + */ + protected function _applyRulesFilter() + { + if (empty($this->_rulesIdsFilter) || !is_array($this->_rulesIdsFilter)) { + return $this; + } + + $rulesList = Mage::getResourceModel('salesrule/report_rule')->getUniqRulesNamesList(); + + $rulesFilterSqlParts = array(); + + foreach ($this->_rulesIdsFilter as $ruleId) { + if (!isset($rulesList[$ruleId])) { + continue; + } + $ruleName = $rulesList[$ruleId]; + $rulesFilterSqlParts[] = $this->getConnection()->quoteInto('rule_name = ?', $ruleName); + } + + if (!empty($rulesFilterSqlParts)) { + $this->getSelect()->where(implode($rulesFilterSqlParts, ' OR ')); + } + } + + /** + * Apply collection custom filter + * + * @return Mage_Sales_Model_Resource_Report_Collection_Abstract + */ + protected function _applyCustomFilter() + { + $this->_applyRulesFilter(); + return parent::_applyCustomFilter(); + } } diff --git a/app/code/core/Mage/SalesRule/Model/Resource/Report/Rule.php b/app/code/core/Mage/SalesRule/Model/Resource/Report/Rule.php index f769a42d09..927a342d67 100755 --- a/app/code/core/Mage/SalesRule/Model/Resource/Report/Rule.php +++ b/app/code/core/Mage/SalesRule/Model/Resource/Report/Rule.php @@ -59,6 +59,35 @@ public function aggregate($from = null, $to = null) return $this; } + /** + * Get all unique Rule Names from aggregated coupons usage data + * + * @return array + */ + public function getUniqRulesNamesList() + { + $adapter = $this->_getReadAdapter(); + $tableName = $this->getTable('salesrule/coupon_aggregated'); + $select = $adapter->select() + ->from( + $tableName, + new Zend_Db_Expr('DISTINCT rule_name') + ) + ->where('rule_name IS NOT NULL') + ->where('rule_name <> ""') + ->order('rule_name ASC'); + + $rulesNames = $adapter->fetchAll($select); + + $result = array(); + + foreach ($rulesNames as $row) { + $result[] = $row['rule_name']; + } + + return $result; + } + /** * Aggregate coupons reports by order created at as range * diff --git a/app/code/core/Mage/SalesRule/Model/Resource/Report/Rule/Createdat.php b/app/code/core/Mage/SalesRule/Model/Resource/Report/Rule/Createdat.php index 0a7b620426..f1aa2ec8a4 100644 --- a/app/code/core/Mage/SalesRule/Model/Resource/Report/Rule/Createdat.php +++ b/app/code/core/Mage/SalesRule/Model/Resource/Report/Rule/Createdat.php @@ -66,6 +66,11 @@ public function aggregate($from = null, $to = null) */ protected function _aggregateByOrder($aggregationField, $from, $to) { + $from = $this->_dateToUtc($from); + $to = $this->_dateToUtc($to); + + $this->_checkDates($from, $to); + $table = $this->getMainTable(); $sourceTable = $this->getTable('sales/order'); $adapter = $this->_getWriteAdapter(); @@ -90,6 +95,7 @@ protected function _aggregateByOrder($aggregationField, $from, $to) 'store_id' => 'store_id', 'order_status' => 'status', 'coupon_code' => 'coupon_code', + 'rule_name' => 'coupon_rule_name', 'coupon_uses' => 'COUNT(entity_id)', 'subtotal_amount' => @@ -151,6 +157,7 @@ protected function _aggregateByOrder($aggregationField, $from, $to) 'store_id' => new Zend_Db_Expr('0'), 'order_status' => 'order_status', 'coupon_code' => 'coupon_code', + 'rule_name' => 'rule_name', 'coupon_uses' => 'SUM(coupon_uses)', 'subtotal_amount' => 'SUM(subtotal_amount)', 'discount_amount' => 'SUM(discount_amount)', diff --git a/app/code/core/Mage/SalesRule/Model/Resource/Rule.php b/app/code/core/Mage/SalesRule/Model/Resource/Rule.php index 250b9f2acf..a35bc90f18 100755 --- a/app/code/core/Mage/SalesRule/Model/Resource/Rule.php +++ b/app/code/core/Mage/SalesRule/Model/Resource/Rule.php @@ -58,7 +58,7 @@ public function _beforeSave(Mage_Core_Model_Abstract $object) } if (!$object->getToDate()) { - $object->setToDate(new Zend_Db_Expr('NULL')); + $object->setToDate(null); } else { if ($object->getToDate() instanceof Zend_Date) { $object->setToDate($object->getToDate()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT)); @@ -66,7 +66,7 @@ public function _beforeSave(Mage_Core_Model_Abstract $object) } if (!$object->getDiscountQty()) { - $object->setDiscountQty(new Zend_Db_Expr('NULL')); + $object->setDiscountQty(null); } parent::_beforeSave($object); diff --git a/app/code/core/Mage/SalesRule/Model/Resource/Rule/Collection.php b/app/code/core/Mage/SalesRule/Model/Resource/Rule/Collection.php index 9260151da8..e7443c5a74 100755 --- a/app/code/core/Mage/SalesRule/Model/Resource/Rule/Collection.php +++ b/app/code/core/Mage/SalesRule/Model/Resource/Rule/Collection.php @@ -47,10 +47,10 @@ protected function _construct() /** * Set filter to select rules that matches current criteria * - * @param unknown_type $websiteId - * @param unknown_type $customerGroupId - * @param unknown_type $couponCode - * @param unknown_type $now + * @param int $websiteId + * @param int $customerGroupId + * @param string $couponCode + * @param string $now * @return Mage_SalesRule_Model_Resource_Rule_Collection */ public function setValidationFilter($websiteId, $customerGroupId, $couponCode = '', $now = null) @@ -66,7 +66,7 @@ public function setValidationFilter($websiteId, $customerGroupId, $couponCode = ->addFieldToFilter('customer_group_ids', array('finset' => (int)$customerGroupId)) ->addFieldToFilter('is_active', 1); - if ($couponCode) { + if (strlen($couponCode)) { $this->getSelect() ->joinLeft( array('rule_coupons' => $this->getTable('salesrule/coupon')), @@ -144,4 +144,19 @@ public function addAttributeInConditionFilter($attributeCode) return $this; } + + /** + * Excludes price rules with generated specific coupon codes from collection + * + * @return Mage_SalesRule_Model_Resource_Rule_Collection + */ + public function addAllowedSalesRulesFilter() + { + $this->addFieldToFilter( + 'main_table.use_auto_generation', + array('neq' => 1) + ); + + return $this; + } } diff --git a/app/code/core/Mage/SalesRule/Model/Rule.php b/app/code/core/Mage/SalesRule/Model/Rule.php index a25044b7d4..372bf41aed 100644 --- a/app/code/core/Mage/SalesRule/Model/Rule.php +++ b/app/code/core/Mage/SalesRule/Model/Rule.php @@ -40,6 +40,8 @@ * @method Mage_SalesRule_Model_Rule setToDate(string $value) * @method int getUsesPerCustomer() * @method Mage_SalesRule_Model_Rule setUsesPerCustomer(int $value) + * @method int getUsesPerCoupon() + * @method Mage_SalesRule_Model_Rule setUsesPerCoupon(int $value) * @method string getCustomerGroupIds() * @method Mage_SalesRule_Model_Rule setCustomerGroupIds(string $value) * @method int getIsActive() @@ -76,6 +78,10 @@ * @method Mage_SalesRule_Model_Rule setWebsiteIds(string $value) * @method int getCouponType() * @method Mage_SalesRule_Model_Rule setCouponType(int $value) + * @method int getUseAutoGeneration() + * @method Mage_SalesRule_Model_Rule setUseAutoGeneration(int $value) + * @method string getCouponCode() + * @method Mage_SalesRule_Model_Rule setCouponCode(string $value) * * @category Mage * @package Mage_SalesRule @@ -83,9 +89,15 @@ */ class Mage_SalesRule_Model_Rule extends Mage_Rule_Model_Rule { + /** + * Free shipping for Item and Address constants + */ const FREE_SHIPPING_ITEM = 1; const FREE_SHIPPING_ADDRESS = 2; + /** + * Coupon types + */ const COUPON_TYPE_NO_COUPON = 1; const COUPON_TYPE_SPECIFIC = 2; const COUPON_TYPE_AUTO = 3; @@ -100,7 +112,6 @@ class Mage_SalesRule_Model_Rule extends Mage_Rule_Model_Rule const CART_FIXED_ACTION = 'cart_fixed'; const BUY_X_GET_Y_ACTION = 'buy_x_get_y'; - /** * @var Mage_SalesRule_Model_Coupon_CodegeneratorInterface */ @@ -122,6 +133,11 @@ class Mage_SalesRule_Model_Rule extends Mage_Rule_Model_Rule */ protected $_eventObject = 'rule'; + /** + * Rule labels for stores + * + * @var array + */ protected $_labels = array(); /** @@ -152,6 +168,9 @@ class Mage_SalesRule_Model_Rule extends Mage_Rule_Model_Rule */ protected $_validatedAddresses = array(); + /** + * Initializes resource and sets ID field name + */ protected function _construct() { parent::_construct(); @@ -160,7 +179,17 @@ protected function _construct() } /** - * Set code generator instance for auto generated coupons + * Returns code mass generator instance for auto generated specific coupons + * + * @return Mage_SalesRule_Model_Coupon_MassgneratorInterface + */ + public static function getCouponMassGenerator() + { + return Mage::getSingleton('salesrule/coupon_massgenerator'); + } + + /** + * Returns code generator instance for auto generated coupons * * @return Mage_SalesRule_Model_Coupon_CodegeneratorInterface */ @@ -205,36 +234,36 @@ public function getPrimaryCoupon() protected function _afterLoad() { $this->setCouponCode($this->getPrimaryCoupon()->getCode()); - $this->setUsesPerCoupon($this->getPrimaryCoupon()->getUsageLimit()); + if ($this->getUsesPerCoupon() !== null && !$this->getUseAutoGeneration()) { + $this->setUsesPerCoupon($this->getPrimaryCoupon()->getUsageLimit()); + } return parent::_afterLoad(); } + /** + * Get rule condition combine model instance + * + * @return Mage_SalesRule_Model_Rule_Condition_Combine + */ public function getConditionsInstance() { return Mage::getModel('salesrule/rule_condition_combine'); } + /** + * Get rule condition product combine model instance + * + * @return Mage_SalesRule_Model_Rule_Condition_Product_Combine + */ public function getActionsInstance() { return Mage::getModel('salesrule/rule_condition_product_combine'); } - public function toString($format='') - { - $str = Mage::helper('salesrule')->__("Name: %s", $this->getName()) ."\n" - . Mage::helper('salesrule')->__("Start at: %s", $this->getStartAt()) ."\n" - . Mage::helper('salesrule')->__("Expire at: %s", $this->getExpireAt()) ."\n" - . Mage::helper('salesrule')->__("Customer registered: %s", $this->getCustomerRegistered()) ."\n" - . Mage::helper('salesrule')->__("Customer is new buyer: %s", $this->getCustomerNewBuyer()) ."\n" - . Mage::helper('salesrule')->__("Description: %s", $this->getDescription()) ."\n\n" - . $this->getConditions()->toStringRecursive() ."\n\n" - . $this->getActions()->toStringRecursive() ."\n\n"; - return $str; - } - /** * Initialize rule model data from array * + * * @param array $rule * @return Mage_SalesRule_Model_Rule */ @@ -254,26 +283,10 @@ public function loadPost(array $rule) } /** - * Returns rule as an array for admin interface - * - * Output example: - * array( - * 'name'=>'Example rule', - * 'conditions'=>{condition_combine::toArray} - * 'actions'=>{action_collection::toArray} - * ) + * Get resource collection * - * @return array + * @return Mage_SalesRule_Model_Resource_Rule_Collection */ - public function toArray(array $arrAttributes = array()) - { - $out = parent::toArray($arrAttributes); - $out['customer_registered'] = $this->getCustomerRegistered(); - $out['customer_new_buyer'] = $this->getCustomerNewBuyer(); - - return $out; - } - public function getResourceCollection() { return Mage::getResourceModel('salesrule/rule_collection'); @@ -290,7 +303,10 @@ protected function _afterSave() $this->_getResource()->saveStoreLabels($this->getId(), $this->getStoreLabels()); } $couponCode = trim($this->getCouponCode()); - if ($couponCode && $this->getCouponType() == self::COUPON_TYPE_SPECIFIC) { + if (strlen($couponCode) + && $this->getCouponType() == self::COUPON_TYPE_SPECIFIC + && !$this->getUseAutoGeneration() + ) { $this->getPrimaryCoupon() ->setCode($couponCode) ->setUsageLimit($this->getUsesPerCoupon() ? $this->getUsesPerCoupon() : null) @@ -309,6 +325,11 @@ protected function _afterSave() if (count($ruleProductAttributes)) { $this->getResource()->setActualProductAttributes($this, $ruleProductAttributes); } + + //Update auto geterated specific coupons if exists + if ($this->getUseAutoGeneration() && $this->hasDataChanges()) { + Mage::getResourceModel('salesrule/coupon')->updateSpecificCoupons($this); + } return parent::_afterSave(); } @@ -454,7 +475,7 @@ protected function _getUsedAttributes($serializedString) $result = array(); if (preg_match_all('~s:32:"salesrule/rule_condition_product";s:9:"attribute";s:\d+:"(.*?)"~s', $serializedString, $matches)){ - foreach ($matches[1] as $offset => $attributeCode) { + foreach ($matches[1] as $attributeCode) { $result[] = $attributeCode; } } diff --git a/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Found.php b/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Found.php index a0a9ae0388..3aa3e54e81 100644 --- a/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Found.php +++ b/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Found.php @@ -50,12 +50,10 @@ public function loadValueOptions() public function asHtml() { - $html = $this->getTypeElement()->getHtml(). - Mage::helper('salesrule')->__("If an item is %s in the cart with %s of these conditions true:", - $this->getValueElement()->getHtml(), $this->getAggregatorElement()->getHtml()); - if ($this->getId()!='1') { - $html.= $this->getRemoveLinkHtml(); - } + $html = $this->getTypeElement()->getHtml() . Mage::helper('salesrule')->__("If an item is %s in the cart with %s of these conditions true:", $this->getValueElement()->getHtml(), $this->getAggregatorElement()->getHtml()); + if ($this->getId() != '1') { + $html.= $this->getRemoveLinkHtml(); + } return $html; } diff --git a/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Subselect.php b/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Subselect.php index 2bdd63178c..04bd530db9 100644 --- a/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Subselect.php +++ b/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Subselect.php @@ -45,29 +45,17 @@ public function loadArray($arr, $key='conditions') public function asXml($containerKey='conditions', $itemKey='condition') { - $xml .= ''.$this->getAttribute().'' - .''.$this->getOperator().'' - .parent::asXml($containerKey, $itemKey); + $xml = ''.$this->getAttribute().'' + . ''.$this->getOperator().'' + . parent::asXml($containerKey, $itemKey); return $xml; } -// public function loadAggregatorOptions() -// { -// $this->setAggregatorOption(array( -// '1/all' => Mage::helper('rule')->__('MATCHING ALL'), -// '1/any' => Mage::helper('rule')->__('MATCHING ANY'), -// '0/all' => Mage::helper('rule')->__('NOT MATCHING ALL'), -// '0/any' => Mage::helper('rule')->__('NOT MATCHING ANY'), -// )); -// return $this; -// } - public function loadAttributeOptions() { - $hlp = Mage::helper('salesrule'); $this->setAttributeOption(array( - 'qty' => $hlp->__('total quantity'), - 'base_row_total' => $hlp->__('total amount'), + 'qty' => Mage::helper('salesrule')->__('total quantity'), + 'base_row_total' => Mage::helper('salesrule')->__('total amount'), )); return $this; } @@ -100,15 +88,10 @@ public function getValueElementType() public function asHtml() { $html = $this->getTypeElement()->getHtml(). - Mage::helper('salesrule')->__("If %s %s %s for a subselection of items in cart matching %s of these conditions:", - $this->getAttributeElement()->getHtml(), - $this->getOperatorElement()->getHtml(), - $this->getValueElement()->getHtml(), - $this->getAggregatorElement()->getHtml() - ); - if ($this->getId()!='1') { - $html.= $this->getRemoveLinkHtml(); - } + Mage::helper('salesrule')->__("If %s %s %s for a subselection of items in cart matching %s of these conditions:", $this->getAttributeElement()->getHtml(), $this->getOperatorElement()->getHtml(), $this->getValueElement()->getHtml(), $this->getAggregatorElement()->getHtml()); + if ($this->getId() != '1') { + $html .= $this->getRemoveLinkHtml(); + } return $html; } diff --git a/app/code/core/Mage/SalesRule/Model/System/Config/Source/Coupon/Format.php b/app/code/core/Mage/SalesRule/Model/System/Config/Source/Coupon/Format.php new file mode 100644 index 0000000000..8980237bcb --- /dev/null +++ b/app/code/core/Mage/SalesRule/Model/System/Config/Source/Coupon/Format.php @@ -0,0 +1,54 @@ + + */ +class Mage_SalesRule_Model_System_Config_Source_Coupon_Format +{ + /** + * Options getter + * + * @return array + */ + public function toOptionArray() + { + $formatsList = Mage::helper('salesrule/coupon')->getFormatsList(); + $result = array(); + foreach ($formatsList as $formatId => $formatTitle) { + $result[] = array( + 'value' => $formatId, + 'label' => $formatTitle + ); + } + + return $result; + } +} diff --git a/app/code/core/Mage/SalesRule/Model/Validator.php b/app/code/core/Mage/SalesRule/Model/Validator.php index e260a2f784..e426d62d9e 100644 --- a/app/code/core/Mage/SalesRule/Model/Validator.php +++ b/app/code/core/Mage/SalesRule/Model/Validator.php @@ -44,6 +44,7 @@ class Mage_SalesRule_Model_Validator extends Mage_Core_Model_Abstract protected $_rules; protected $_roundingDeltas = array(); + protected $_baseRoundingDeltas = array(); /** @@ -148,7 +149,7 @@ protected function _canProcessRule($rule, $address) */ if ($rule->getCouponType() != Mage_SalesRule_Model_Rule::COUPON_TYPE_NO_COUPON) { $couponCode = $address->getQuote()->getCouponCode(); - if ($couponCode) { + if (strlen($couponCode)) { $coupon = Mage::getModel('salesrule/coupon'); $coupon->load($couponCode, 'code'); if ($coupon->getId()) { @@ -678,18 +679,24 @@ public function initTotals($items, Mage_Sales_Model_Quote_Address $address) } /** - * Retrieve subordinate coupon IDs + * Set coupon code to address if $rule contains validated coupon * - * @return array + * @param Mage_Sales_Model_Quote_Address $address + * @param Mage_SalesRule_Model_Rule $rule + * + * @return Mage_SalesRule_Model_Validator */ protected function _maintainAddressCouponCode($address, $rule) { - foreach ($rule->getCoupons() as $coupon) { - if (strtolower($coupon->getCode()) == strtolower($this->getCouponCode())) { - $address->setCouponCode($this->getCouponCode()); - break; - } + /* + Rule is a part of rules collection, which includes only rules with 'No Coupon' type or with validated coupon. + As a result, if rule uses coupon code(s) ('Specific' or 'Auto' Coupon Type), it always contains validated coupon + */ + if ($rule->getCoponType() != Mage_SalesRule_Model_Rule::COUPON_TYPE_NO_COUPON) { + $address->setCouponCode($this->getCouponCode()); } + + return $this; } /** @@ -706,14 +713,16 @@ protected function _addDiscountDescription($address, $rule) $label = ''; if ($ruleLabel) { $label = $ruleLabel; - } else if ($address->getCouponCode()) { + } else if (strlen($address->getCouponCode())) { $label = $address->getCouponCode(); } - if (!empty($label)) { + if (strlen($label)) { $description[$rule->getId()] = $label; } + $address->setDiscountDescriptionArray($description); + return $this; } diff --git a/app/code/core/Mage/SalesRule/etc/config.xml b/app/code/core/Mage/SalesRule/etc/config.xml index af4213d1d5..23d3d53968 100644 --- a/app/code/core/Mage/SalesRule/etc/config.xml +++ b/app/code/core/Mage/SalesRule/etc/config.xml @@ -28,7 +28,7 @@ - 1.6.0.1 + 1.6.0.2 @@ -114,6 +114,14 @@ + + + + salesrule/observer + addSalesRuleNameToOrder + + + @@ -137,6 +145,16 @@ + + + - + + ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 + ABCDEFGHIJKLMNOPQRSTUVWXYZ + 0123456789 + + + @@ -190,4 +208,12 @@ + + + + 12 + 1 + + + diff --git a/app/code/core/Mage/SalesRule/etc/system.xml b/app/code/core/Mage/SalesRule/etc/system.xml new file mode 100644 index 0000000000..a6f9131240 --- /dev/null +++ b/app/code/core/Mage/SalesRule/etc/system.xml @@ -0,0 +1,95 @@ + + + + + + separator-top + + customer + text + 400 + 1 + 0 + 0 + + + + 1 + 10 + + + + text + 10 + 1 + 0 + 0 + Excluding prefix, suffix and separators. + validate-digits + + + + select + salesrule/system_config_source_coupon_format + 20 + 1 + 0 + 0 + + + + text + 30 + 1 + 0 + 0 + + + + text + 40 + 1 + 0 + 0 + + + + text + 50 + 1 + 0 + 0 + If empty no separation. + validate-digits + + + + + + + diff --git a/app/code/core/Mage/SalesRule/sql/salesrule_setup/upgrade-1.6.0.1-1.6.0.2.php b/app/code/core/Mage/SalesRule/sql/salesrule_setup/upgrade-1.6.0.1-1.6.0.2.php new file mode 100644 index 0000000000..5f4af2ccb9 --- /dev/null +++ b/app/code/core/Mage/SalesRule/sql/salesrule_setup/upgrade-1.6.0.1-1.6.0.2.php @@ -0,0 +1,145 @@ +getConnection() + ->addColumn( + $installer->getTable('salesrule/coupon'), + 'created_at', + array( + 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, + 'comment' => 'Coupon Code Creation Date', + 'nullable' => false, + 'default' => Varien_Db_Ddl_Table::TIMESTAMP_INIT + ) + ); + +$installer->getConnection()->addColumn( + $installer->getTable('salesrule/coupon'), + 'type', + array( + 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, + 'comment' => 'Coupon Code Type', + 'default' => 0 + ) + ); + +$installer->getConnection() + ->addColumn( + $installer->getTable('salesrule/rule'), + 'use_auto_generation', + array( + 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, + 'comment' => 'Use Auto Generation', + 'nullable' => false, + 'default' => 0 + ) + ); + +$installer->getConnection() + ->addColumn( + $installer->getTable('salesrule/rule'), + 'uses_per_coupon', + array( + 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, + 'comment' => 'Uses Per Coupon', + 'nullable' => false, + 'default' => 0 + ) + ); + +$installer->getConnection() + ->addColumn( + $installer->getTable('salesrule/coupon_aggregated'), + 'rule_name', + array( + 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, + 'length' => 255, + 'comment' => 'Rule Name', + ) + ); + +$installer->getConnection() + ->addColumn( + $installer->getTable('salesrule/coupon_aggregated_order'), + 'rule_name', + array( + 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, + 'length' => 255, + 'comment' => 'Rule Name', + ) + ); + +$installer->getConnection() + ->addColumn( + $installer->getTable('salesrule/coupon_aggregated_updated'), + 'rule_name', + array( + 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, + 'length' => 255, + 'comment' => 'Rule Name', + ) + ); + +$installer->getConnection() + ->addIndex( + $installer->getTable('salesrule/coupon_aggregated'), + $installer->getIdxName( + 'salesrule/coupon_aggregated', + array('rule_name'), + Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX + ), + array('rule_name'), + Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX + ); + +$installer->getConnection() + ->addIndex( + $installer->getTable('salesrule/coupon_aggregated_order'), + $installer->getIdxName( + 'salesrule/coupon_aggregated_order', + array('rule_name'), + Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX + ), + array('rule_name'), + Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX + ); + +$installer->getConnection() + ->addIndex( + $installer->getTable('salesrule/coupon_aggregated_updated'), + $installer->getIdxName( + 'salesrule/coupon_aggregated_updated', + array('rule_name'), + Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX + ), + array('rule_name'), + Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX + ); diff --git a/app/code/core/Mage/Sendfriend/etc/system.xml b/app/code/core/Mage/Sendfriend/etc/system.xml index 756af4194d..060fcc001f 100644 --- a/app/code/core/Mage/Sendfriend/etc/system.xml +++ b/app/code/core/Mage/Sendfriend/etc/system.xml @@ -78,6 +78,7 @@ 1 1 1 + validate-digits @@ -86,6 +87,7 @@ 1 1 1 + validate-digits diff --git a/app/code/core/Mage/Shipping/Model/Carrier/Abstract.php b/app/code/core/Mage/Shipping/Model/Carrier/Abstract.php index 91b86492e0..b043a217dc 100644 --- a/app/code/core/Mage/Shipping/Model/Carrier/Abstract.php +++ b/app/code/core/Mage/Shipping/Model/Carrier/Abstract.php @@ -27,10 +27,34 @@ abstract class Mage_Shipping_Model_Carrier_Abstract extends Varien_Object { + /** + * Carrier's code + * + * @var string + */ protected $_code; + + /** + * Rates result + * + * @var array + */ protected $_rates = null; + + /** + * Number of boxes in package + * + * @var int + */ protected $_numBoxes = 1; + /** + * Free Method config path + * + * @var string + */ + protected $_freeMethod = 'free_method'; + /** * Whether this carrier has fixed rates calculation * @@ -316,7 +340,7 @@ protected function _updateFreeMethodQuote($request) return; } - $freeMethod = $this->getConfigData('free_method'); + $freeMethod = $this->getConfigData($this->_freeMethod); if (!$freeMethod) { return; } @@ -378,9 +402,9 @@ protected function _updateFreeMethodQuote($request) */ public function getMethodPrice($cost, $method='') { - if ($method == $this->getConfigData('free_method') && $this->getConfigData('free_shipping_enable') - && $this->getConfigData('free_shipping_subtotal') <= $this->_rawRequest->getValueWithDiscount() - ){ + if ($method == $this->getConfigData($this->_freeMethod) && $this->getConfigData('free_shipping_enable') + && $this->getConfigData('free_shipping_subtotal') <= $this->_rawRequest->getBaseSubtotalInclTax() + ) { $price = '0.00'; } else { $price = $this->getFinalPriceWithHandlingFee($cost); @@ -391,12 +415,12 @@ public function getMethodPrice($cost, $method='') /** * get the handling fee for the shipping + cost * - * @return final price for shipping emthod + * @param float $cost + * @return float final price for shipping method */ public function getFinalPriceWithHandlingFee($cost) { $handlingFee = $this->getConfigData('handling_fee'); - $finalMethodPrice = 0; $handlingType = $this->getConfigData('handling_type'); if (!$handlingType) { $handlingType = self::HANDLING_TYPE_FIXED; @@ -406,22 +430,43 @@ public function getFinalPriceWithHandlingFee($cost) $handlingAction = self::HANDLING_ACTION_PERORDER; } - if($handlingAction == self::HANDLING_ACTION_PERPACKAGE) - { - if ($handlingType == self::HANDLING_TYPE_PERCENT) { - $finalMethodPrice = ($cost + ($cost * $handlingFee/100)) * $this->_numBoxes; - } else { - $finalMethodPrice = ($cost + $handlingFee) * $this->_numBoxes; - } - } else { - if ($handlingType == self::HANDLING_TYPE_PERCENT) { - $finalMethodPrice = ($cost * $this->_numBoxes) + ($cost * $this->_numBoxes * $handlingFee / 100); - } else { - $finalMethodPrice = ($cost * $this->_numBoxes) + $handlingFee; - } + return ($handlingAction == self::HANDLING_ACTION_PERPACKAGE) + ? $this->_getPerpackagePrice($cost, $handlingType, $handlingFee) + : $this->_getPerorderPrice($cost, $handlingType, $handlingFee); + } + + /** + * Get final price for shipping method with handling fee per package + * + * @param float $cost + * @param string $handlingType + * @param float $handlingFee + * @return float + */ + protected function _getPerpackagePrice($cost, $handlingType, $handlingFee) + { + if ($handlingType == self::HANDLING_TYPE_PERCENT) { + return ($cost + ($cost * $handlingFee/100)) * $this->_numBoxes; + } + + return ($cost + $handlingFee) * $this->_numBoxes; + } + /** + * Get final price for shipping method with handling fee per order + * + * @param float $cost + * @param string $handlingType + * @param float $handlingFee + * @return float + */ + protected function _getPerorderPrice($cost, $handlingType, $handlingFee) + { + if ($handlingType == self::HANDLING_TYPE_PERCENT) { + return ($cost * $this->_numBoxes) + ($cost * $this->_numBoxes * $handlingFee / 100); } - return $finalMethodPrice; + + return ($cost * $this->_numBoxes) + $handlingFee; } /** diff --git a/app/code/core/Mage/Shipping/Model/Carrier/Freeshipping.php b/app/code/core/Mage/Shipping/Model/Carrier/Freeshipping.php index d2ef1e3ebe..eec6ddd615 100644 --- a/app/code/core/Mage/Shipping/Model/Carrier/Freeshipping.php +++ b/app/code/core/Mage/Shipping/Model/Carrier/Freeshipping.php @@ -53,14 +53,12 @@ public function collectRates(Mage_Shipping_Model_Rate_Request $request) } $result = Mage::getModel('shipping/rate_result'); - $packageValue = $request->getPackageValue(); $this->_updateFreeMethodQuote($request); - $allow = ($request->getFreeShipping()) - || ($packageValue >= $this->getConfigData('free_shipping_subtotal')); - - if ($allow) { + if (($request->getFreeShipping()) + || ($request->getBaseSubtotalInclTax() >= $this->getConfigData('free_shipping_subtotal')) + ) { $method = Mage::getModel('shipping/rate_result_method'); $method->setCarrier('freeshipping'); diff --git a/app/code/core/Mage/Shipping/Model/Resource/Carrier/Tablerate.php b/app/code/core/Mage/Shipping/Model/Resource/Carrier/Tablerate.php index 60e78c47d7..7568ab16dc 100755 --- a/app/code/core/Mage/Shipping/Model/Resource/Carrier/Tablerate.php +++ b/app/code/core/Mage/Shipping/Model/Resource/Carrier/Tablerate.php @@ -267,8 +267,7 @@ public function uploadAndImport(Varien_Object $object) $adapter->commit(); if ($this->_importErrors) { - $error = Mage::helper('shipping')->__('%1$d records have been imported. See the following list of errors for each record that has not been imported: %2$s', - $this->_importedRows, implode(" \n", $this->_importErrors)); + $error = Mage::helper('shipping')->__('%1$d records have been imported. See the following list of errors for each record that has not been imported: %2$s', $this->_importedRows, implode(" \n", $this->_importErrors)); Mage::throwException($error); } @@ -349,8 +348,7 @@ protected function _getImportRow($row, $rowNumber = 0) { // validate row if (count($row) < 5) { - $this->_importErrors[] = Mage::helper('shipping')->__('Invalid Table Rates format in the Row #%s', - $rowNumber); + $this->_importErrors[] = Mage::helper('shipping')->__('Invalid Table Rates format in the Row #%s', $rowNumber); return false; } @@ -367,8 +365,7 @@ protected function _getImportRow($row, $rowNumber = 0) } elseif ($row[0] == '*' || $row[0] == '') { $countryId = '0'; } else { - $this->_importErrors[] = Mage::helper('shipping')->__('Invalid Country "%s" in the Row #%s.', - $row[0], $rowNumber); + $this->_importErrors[] = Mage::helper('shipping')->__('Invalid Country "%s" in the Row #%s.', $row[0], $rowNumber); return false; } @@ -378,8 +375,7 @@ protected function _getImportRow($row, $rowNumber = 0) } elseif ($row[1] == '*' || $row[1] == '') { $regionId = 0; } else { - $this->_importErrors[] = Mage::helper('shipping')->__('Invalid Region/State "%s" in the Row #%s.', - $row[1], $rowNumber); + $this->_importErrors[] = Mage::helper('shipping')->__('Invalid Region/State "%s" in the Row #%s.', $row[1], $rowNumber); return false; } @@ -393,24 +389,21 @@ protected function _getImportRow($row, $rowNumber = 0) // validate condition value $value = $this->_parseDecimalValue($row[3]); if ($value === false) { - $this->_importErrors[] = Mage::helper('shipping')->__('Invalid %s "%s" in the Row #%s.', - $this->_getConditionFullName($this->_importConditionName), $row[3], $rowNumber); + $this->_importErrors[] = Mage::helper('shipping')->__('Invalid %s "%s" in the Row #%s.', $this->_getConditionFullName($this->_importConditionName), $row[3], $rowNumber); return false; } // validate price $price = $this->_parseDecimalValue($row[4]); if ($price === false) { - $this->_importErrors[] = Mage::helper('shipping')->__('Invalid Shipping Price "%s" in the Row #%s.', - $row[4], $rowNumber); + $this->_importErrors[] = Mage::helper('shipping')->__('Invalid Shipping Price "%s" in the Row #%s.', $row[4], $rowNumber); return false; } // protect from duplicate $hash = sprintf("%s-%d-%s-%F", $countryId, $regionId, $zipCode, $value); if (isset($this->_importUniqueHash[$hash])) { - $this->_importErrors[] = Mage::helper('shipping')->__('Duplicate Row #%s (Country "%s", Region/State "%s", Zip "%s" and Value "%s").', - $rowNumber, $row[0], $row[1], $zipCode, $value); + $this->_importErrors[] = Mage::helper('shipping')->__('Duplicate Row #%s (Country "%s", Region/State "%s", Zip "%s" and Value "%s").', $rowNumber, $row[0], $row[1], $zipCode, $value); return false; } $this->_importUniqueHash[$hash] = true; diff --git a/app/code/core/Mage/Shipping/Model/Shipping.php b/app/code/core/Mage/Shipping/Model/Shipping.php index 06478f08b8..24d3fe787a 100644 --- a/app/code/core/Mage/Shipping/Model/Shipping.php +++ b/app/code/core/Mage/Shipping/Model/Shipping.php @@ -147,12 +147,13 @@ public function collectRates(Mage_Shipping_Model_Rate_Request $request) /** * Collect rates of given carrier * - * @param string $carrierCode + * @param string $carrierCode * @param Mage_Shipping_Model_Rate_Request $request * @return Mage_Shipping_Model_Shipping */ public function collectCarrierRates($carrierCode, $request) { + /* @var $carrier Mage_Shipping_Model_Carrier_Abstract */ $carrier = $this->getCarrierByCode($carrierCode, $request->getStoreId()); if (!$carrier) { return $this; @@ -164,7 +165,7 @@ public function collectCarrierRates($carrierCode, $request) } /* * Result will be false if the admin set not to show the shipping module - * if the devliery country is not within specific countries + * if the delivery country is not within specific countries */ if (false !== $result){ if (!$result instanceof Mage_Shipping_Model_Rate_Result_Error) { @@ -211,6 +212,8 @@ public function collectRatesByAddress(Varien_Object $address, $limitCarrier = nu $request->setPackageCurrency(Mage::app()->getStore()->getCurrentCurrency()); $request->setLimitCarrier($limitCarrier); + $request->setBaseSubtotalInclTax($address->getBaseSubtotalInclTax()); + return $this->collectRates($request); } @@ -297,20 +300,20 @@ public function requestToShipment(Mage_Sales_Model_Order_Shipment $orderShipment $request->setShipperContactCompanyName($storeInfo->getName()); $request->setShipperContactPhoneNumber($storeInfo->getPhone()); $request->setShipperEmail($admin->getEmail()); - $request->setShipperAddressStreet($originStreet1 . ' ' . $originStreet2); + $request->setShipperAddressStreet(trim($originStreet1 . ' ' . $originStreet2)); $request->setShipperAddressStreet1($originStreet1); $request->setShipperAddressStreet2($originStreet2); $request->setShipperAddressCity(Mage::getStoreConfig(self::XML_PATH_STORE_CITY, $shipmentStoreId)); $request->setShipperAddressStateOrProvinceCode($shipperRegionCode); $request->setShipperAddressPostalCode(Mage::getStoreConfig(self::XML_PATH_STORE_ZIP, $shipmentStoreId)); $request->setShipperAddressCountryCode(Mage::getStoreConfig(self::XML_PATH_STORE_COUNTRY_ID, $shipmentStoreId)); - $request->setRecipientContactPersonName($address->getFirstname() . ' ' . $address->getLastname()); + $request->setRecipientContactPersonName(trim($address->getFirstname() . ' ' . $address->getLastname())); $request->setRecipientContactPersonFirstName($address->getFirstname()); $request->setRecipientContactPersonLastName($address->getLastname()); $request->setRecipientContactCompanyName($address->getCompany()); $request->setRecipientContactPhoneNumber($address->getTelephone()); $request->setRecipientEmail($address->getEmail()); - $request->setRecipientAddressStreet($address->getStreetFull()); + $request->setRecipientAddressStreet(trim($address->getStreet1() . ' ' . $address->getStreet2())); $request->setRecipientAddressStreet1($address->getStreet1()); $request->setRecipientAddressStreet2($address->getStreet2()); $request->setRecipientAddressCity($address->getCity()); diff --git a/app/code/core/Mage/Tag/Model/Resource/Indexer/Summary.php b/app/code/core/Mage/Tag/Model/Resource/Indexer/Summary.php index 0a494e0c11..080c8b1928 100755 --- a/app/code/core/Mage/Tag/Model/Resource/Indexer/Summary.php +++ b/app/code/core/Mage/Tag/Model/Resource/Indexer/Summary.php @@ -144,7 +144,7 @@ public function reindexAll() public function aggregate($tagIds = null) { $writeAdapter = $this->_getWriteAdapter(); - $writeAdapter->beginTransaction(); + $this->beginTransaction(); try { if (!empty($tagIds)) { @@ -198,7 +198,8 @@ public function aggregate($tagIds = null) ->group(array( 'tr.tag_id', 'tr.store_id' - )); + )) + ->where('tr.active = 1'); $statusCond = $writeAdapter->quoteInto('=?', Mage_Catalog_Model_Product_Status::STATUS_ENABLED); $this->_addAttributeToSelect($select, 'status', 'e.entity_id', 'cs.store_id', $statusCond); @@ -245,7 +246,8 @@ public function aggregate($tagIds = null) $agregateSelect = $writeAdapter->select(); $agregateSelect->from($this->getTable('tag/relation'), $selectedFields) - ->group('tag_id'); + ->group('tag_id') + ->where('active = 1'); if (!empty($tagIds)) { $agregateSelect->where('tag_id IN(?)', $tagIds); @@ -254,12 +256,12 @@ public function aggregate($tagIds = null) $writeAdapter->query( $agregateSelect->insertFromSelect($this->getTable('tag/summary'), array_keys($selectedFields)) ); + $this->commit(); } catch (Exception $e) { - $writeAdapter->rollBack(); + $this->rollBack(); throw $e; } - $writeAdapter->commit(); return $this; } } diff --git a/app/code/core/Mage/Tag/Model/Resource/Tag.php b/app/code/core/Mage/Tag/Model/Resource/Tag.php index b938fe12d3..2becd70de7 100755 --- a/app/code/core/Mage/Tag/Model/Resource/Tag.php +++ b/app/code/core/Mage/Tag/Model/Resource/Tag.php @@ -203,7 +203,8 @@ protected function _getAggregationPerStoreView($tagId) array() ) ->group('main.store_id') - ->where('main.tag_id = :tag_id'); + ->where('main.tag_id = :tag_id') + ->where('main.active = 1'); $selectHistoricalResult = $readAdapter->fetchAll($selectHistorical, array('tag_id' => $tagId)); @@ -270,7 +271,8 @@ protected function _getGlobalAggregation($tagId) 'product_website.website_id = store.website_id AND product_website.product_id = main.product_id', array() ) - ->where('main.tag_id = :tag_id'); + ->where('main.tag_id = :tag_id') + ->where('main.active = 1'); $result['historical_uses'] = (int) $readAdapter->fetchOne($selectHistoricalGlobal, array('tag_id' => $tagId)); return $result; diff --git a/app/code/core/Mage/Tag/controllers/IndexController.php b/app/code/core/Mage/Tag/controllers/IndexController.php index 0233f0cbe4..cbb1f7035f 100644 --- a/app/code/core/Mage/Tag/controllers/IndexController.php +++ b/app/code/core/Mage/Tag/controllers/IndexController.php @@ -112,11 +112,9 @@ protected function _extractTags($tagNamesInString) */ protected function _cleanTags(array $tagNamesArr) { - $helper = Mage::helper('core'); foreach( $tagNamesArr as $key => $tagName ) { $tagNamesArr[$key] = trim($tagNamesArr[$key], '\''); $tagNamesArr[$key] = trim($tagNamesArr[$key]); - $tagNamesArr[$key] = $helper->escapeHtml($tagNamesArr[$key]); if( $tagNamesArr[$key] == '' ) { unset($tagNamesArr[$key]); } @@ -133,28 +131,35 @@ protected function _cleanTags(array $tagNamesArr) protected function _fillMessageBox($counter) { $session = Mage::getSingleton('catalog/session'); + $helper = Mage::helper('core'); if (count($counter[Mage_Tag_Model_Tag::ADD_STATUS_NEW])) { - $session->addSuccess($this->__('%s tag(s) have been accepted for moderation.', - count($counter[Mage_Tag_Model_Tag::ADD_STATUS_NEW])) + $session->addSuccess( + $this->__('%s tag(s) have been accepted for moderation.', count($counter[Mage_Tag_Model_Tag::ADD_STATUS_NEW])) ); } if (count($counter[Mage_Tag_Model_Tag::ADD_STATUS_EXIST])) { foreach ($counter[Mage_Tag_Model_Tag::ADD_STATUS_EXIST] as $tagName) { - $session->addNotice($this->__('Tag "%s" has already been added to the product.' ,$tagName)); + $session->addNotice( + $this->__('Tag "%s" has already been added to the product.' , $helper->escapeHtml($tagName)) + ); } } if (count($counter[Mage_Tag_Model_Tag::ADD_STATUS_SUCCESS])) { foreach ($counter[Mage_Tag_Model_Tag::ADD_STATUS_SUCCESS] as $tagName) { - $session->addSuccess($this->__('Tag "%s" has been added to the product.' ,$tagName)); + $session->addSuccess( + $this->__('Tag "%s" has been added to the product.' ,$helper->escapeHtml($tagName)) + ); } } if (count($counter[Mage_Tag_Model_Tag::ADD_STATUS_REJECTED])) { foreach ($counter[Mage_Tag_Model_Tag::ADD_STATUS_REJECTED] as $tagName) { - $session->addNotice($this->__('Tag "%s" has been rejected by administrator.' ,$tagName)); + $session->addNotice( + $this->__('Tag "%s" has been rejected by administrator.' ,$helper->escapeHtml($tagName)) + ); } } } diff --git a/app/code/core/Mage/Tag/etc/config.xml b/app/code/core/Mage/Tag/etc/config.xml index 14955ab1ae..be4ccece23 100644 --- a/app/code/core/Mage/Tag/etc/config.xml +++ b/app/code/core/Mage/Tag/etc/config.xml @@ -61,7 +61,7 @@ - Mage_Tag_Model_Customer_Resource + Mage_Tag_Model_Resource_Customer diff --git a/app/code/core/Mage/Tax/Helper/Data.php b/app/code/core/Mage/Tax/Helper/Data.php index fc614c3db0..83f6ecea3b 100644 --- a/app/code/core/Mage/Tax/Helper/Data.php +++ b/app/code/core/Mage/Tax/Helper/Data.php @@ -555,10 +555,10 @@ protected function _calculatePrice($price, $percent, $type) { $calculator = Mage::getSingleton('tax/calculation'); if ($type) { - $taxAmount = $calculator->calcTaxAmount($price, $percent, false); + $taxAmount = $calculator->calcTaxAmount($price, $percent, false, false); return $price + $taxAmount; } else { - $taxAmount = $calculator->calcTaxAmount($price, $percent, true); + $taxAmount = $calculator->calcTaxAmount($price, $percent, true, false); return $price - $taxAmount; } } diff --git a/app/code/core/Mage/Tax/Model/Calculation.php b/app/code/core/Mage/Tax/Model/Calculation.php index 12fcbe3214..117c93bd05 100644 --- a/app/code/core/Mage/Tax/Model/Calculation.php +++ b/app/code/core/Mage/Tax/Model/Calculation.php @@ -70,7 +70,7 @@ public function setCustomer(Mage_Customer_Model_Customer $customer) public function getDefaultCustomerTaxClass($store = null) { if ($this->_defaultCustomerTaxClass === null) { - $defaultCustomerGroup = Mage::getStoreConfig(Mage_Customer_Model_Group::XML_PATH_DEFAULT_ID, $store); + $defaultCustomerGroup = Mage::helper('customer')->getDefaultCustomerGroupId($store); $this->_defaultCustomerTaxClass = Mage::getModel('customer/group')->getTaxClassId($defaultCustomerGroup); } return $this->_defaultCustomerTaxClass; diff --git a/app/code/core/Mage/Tax/Model/Resource/Class.php b/app/code/core/Mage/Tax/Model/Resource/Class.php index 459956edb5..102232ee46 100755 --- a/app/code/core/Mage/Tax/Model/Resource/Class.php +++ b/app/code/core/Mage/Tax/Model/Resource/Class.php @@ -52,7 +52,7 @@ protected function _initUniqueFields() { $this->_uniqueFields = array(array( 'field' => array('class_type', 'class_name'), - 'title' => Mage::helper('tax')->__('An error occurred while saving this tax class. A class with the same name already exists.'), + 'title' => Mage::helper('tax')->__('An error occurred while saving this tax class. A class with the same name'), )); return $this; } diff --git a/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Subtotal.php b/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Subtotal.php index af707fc90d..80c0013e7e 100644 --- a/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Subtotal.php +++ b/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Subtotal.php @@ -64,8 +64,18 @@ class Mage_Tax_Model_Sales_Total_Quote_Subtotal extends Mage_Sales_Model_Quote_A */ protected $_storeTaxRequest = null; + /** + * Quote store + * + * @var Mage_Core_Model_Store + */ protected $_store; + /** + * Rounding deltas for prices + * + * @var array + */ protected $_roundingDeltas = array(); /** @@ -588,10 +598,10 @@ protected function _sameRateAsStore($request) protected function _deltaRound($price, $rate, $direction, $type='regular') { if ($price) { - $rate = (string) $rate; - $type = $type.$direction; - $delta = isset($this->_roundingDeltas[$type][$rate]) ? $this->_roundingDeltas[$type][$rate] : 0; - $price += $delta; + $rate = (string) $rate; + $type = $type . $direction; + $delta = isset($this->_roundingDeltas[$type][$rate]) ? $this->_roundingDeltas[$type][$rate] : 0; + $price += $delta; $this->_roundingDeltas[$type][$rate] = $price - $this->_calculator->round($price); $price = $this->_calculator->round($price); } diff --git a/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Tax.php b/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Tax.php index 8e197ee9d8..f4a4cfa329 100644 --- a/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Tax.php +++ b/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Tax.php @@ -454,6 +454,7 @@ protected function _rowBaseCalculation(Mage_Sales_Model_Quote_Address $address, $child->getBaseTaxAmount(), $rate ); + $child->setTaxRates($applied); } $this->_recalculateParent($item); } @@ -474,6 +475,7 @@ protected function _rowBaseCalculation(Mage_Sales_Model_Quote_Address $address, $item->getBaseTaxAmount(), $rate ); + $item->setTaxRates($applied); } } @@ -693,12 +695,12 @@ protected function _aggregateTaxPerRate($item, $rate, &$taxGroups) protected function _deltaRound($price, $rate, $direction, $type='regular') { if ($price) { - $rate = (string) $rate; - $type = $type.$direction; - $delta = isset($this->_roundingDeltas[$type][$rate]) ? $this->_roundingDeltas[$type][$rate] : 0; - $price += $delta; + $rate = (string) $rate; + $type = $type . $direction; + $delta = isset($this->_roundingDeltas[$type][$rate]) ? $this->_roundingDeltas[$type][$rate] : 0; + $price += $delta; $this->_roundingDeltas[$type][$rate] = $price - $this->_calculator->round($price); - $price = $this->_calculator->round($price); + $price = $this->_calculator->round($price); } return $price; } diff --git a/app/code/core/Mage/Usa/Block/Adminhtml/Dhl/Unitofmeasure.php b/app/code/core/Mage/Usa/Block/Adminhtml/Dhl/Unitofmeasure.php new file mode 100644 index 0000000000..a8d6519d7c --- /dev/null +++ b/app/code/core/Mage/Usa/Block/Adminhtml/Dhl/Unitofmeasure.php @@ -0,0 +1,82 @@ + + */ +class Mage_Usa_Block_Adminhtml_Dhl_Unitofmeasure extends Mage_Adminhtml_Block_System_Config_Form_Field +{ + + /** + * Define params and variables + * + * @return void + */ + public function _construct() + { + parent::_construct(); + + $carrierModel = Mage::getSingleton('usa/shipping_carrier_dhl_international'); + + $this->setInch($this->jsQuoteEscape($carrierModel->getCode('unit_of_dimension_cut', 'I'))); + $this->setCm($this->jsQuoteEscape($carrierModel->getCode('unit_of_dimension_cut', 'C'))); + + $this->setHeight($this->jsQuoteEscape($carrierModel->getCode('dimensions', 'height'))); + $this->setDepth($this->jsQuoteEscape($carrierModel->getCode('dimensions', 'depth'))); + $this->setWidth($this->jsQuoteEscape($carrierModel->getCode('dimensions', 'width'))); + + $kgWeight = 70; + + $this->setDivideOrderWeightNoteKg( + $this->jsQuoteEscape($this->__('Allows breaking total order weight into smaller pieces if it exeeds %s %s to ensure accurate calculation of shipping charges.', $kgWeight, 'kg')) + ); + + $weight = round( + Mage::helper('usa')->convertMeasureWeight( + $kgWeight, Zend_Measure_Weight::KILOGRAM, Zend_Measure_Weight::POUND), 3); + + $this->setDivideOrderWeightNoteLbp( + $this->jsQuoteEscape($this->__('Allows breaking total order weight into smaller pieces if it exeeds %s %s to ensure accurate calculation of shipping charges.', $weight, 'pounds')) + ); + + $this->setTemplate('usa/dhl/unitofmeasure.phtml'); + } + + /** + * Retrieve Element HTML fragment + * + * @param Varien_Data_Form_Element_Abstract $element + * @return string + */ + protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element) + { + return parent::_getElementHtml($element) . $this->renderView(); + } +} diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Abstract.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Abstract.php index 17a4a7e9bc..5cdebbc2f4 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Abstract.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Abstract.php @@ -128,7 +128,18 @@ public function isShippingLabelsAvailable() } /** - * Processing additional validation to check is carrier applicable. + * Some carriers need to override this method to get the correct quote + * + * @param Mage_Shipping_Model_Rate_Request $request + * @return array + */ + public function getAllItems(Mage_Shipping_Model_Rate_Request $request) + { + return $request->getAllItems(); + } + + /** + * Processing additional validation to check if carrier applicable. * * @param Mage_Shipping_Model_Rate_Request $request * @return Mage_Shipping_Model_Carrier_Abstract|Mage_Shipping_Model_Rate_Result_Error|boolean @@ -136,7 +147,7 @@ public function isShippingLabelsAvailable() public function proccessAdditionalValidation(Mage_Shipping_Model_Rate_Request $request) { //Skip by item validation if there is no items in request - if(!count($request->getAllItems())) { + if(!count($this->getAllItems($request))) { return $this; } @@ -146,9 +157,9 @@ public function proccessAdditionalValidation(Mage_Shipping_Model_Rate_Request $r $defaultErrorMsg = Mage::helper('shipping')->__('The shipping module is not available.'); $showMethod = $this->getConfigData('showmethod'); - foreach ($request->getAllItems() as $item) { + foreach ($this->getAllItems($request) as $item) { if ($item->getProduct() && $item->getProduct()->getId()) { - if ($item->getProduct()->getWeight() > $maxAllowedWeight) { + if ($item->getProduct()->getWeight() * $item->getProduct()->getQty() > $maxAllowedWeight) { $errorMsg = ($configErrorMsg) ? $configErrorMsg : $defaultErrorMsg; break; } diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl.php index c56d97e2f0..72f9b1c07f 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl.php @@ -381,6 +381,8 @@ public function setRequest(Varien_Object $request) $r->setPackageId($request->getPackageId()); } + $r->setBaseSubtotalInclTax($request->getBaseSubtotalInclTax()); + $this->_rawRequest = $r; return $this; } @@ -796,8 +798,7 @@ protected function _parseXmlResponse($response) $code = (string)$xml->Faults->Fault->Code; $description = $xml->Faults->Fault->Description; $context = $xml->Faults->Fault->Context; - $this->_errors[$code] = Mage::helper('usa')->__('Error #%s : %s (%s)', $code, $description, - $context); + $this->_errors[$code] = Mage::helper('usa')->__('Error #%s : %s (%s)', $code, $description, $context); } else { if ($r->getDestCountryId() == self::USA_COUNTRY_ID) { if ($xml->Shipment) { @@ -855,14 +856,12 @@ protected function _parseXmlResponse($response) $rate->setPrice($data['price_total']); $result->append($rate); } - } else { - foreach ($this->_errors as $errorText) { - $error = Mage::getModel('shipping/rate_result_error'); - $error->setCarrier('dhl'); - $error->setCarrierTitle($this->getConfigData('title')); - $error->setErrorMessage($this->getConfigData('specificerrmsg')); - $result->append($error); - } + } else if (!empty($this->_errors)) { + $error = Mage::getModel('shipping/rate_result_error'); + $error->setCarrier('dhl'); + $error->setCarrierTitle($this->getConfigData('title')); + $error->setErrorMessage($this->getConfigData('specificerrmsg')); + $result->append($error); } return $result; } @@ -1198,15 +1197,9 @@ protected function _parseXmlTrackingResponse($trackings, $response) } else { $description = (string)$txml->Result->Desc; if ($description) - $errorArr[$tracknum] = Mage::helper('usa')->__( - 'Error #%s: %s', - $code, - $description - ); + $errorArr[$tracknum] = Mage::helper('usa')->__('Error #%s: %s', $code, $description); else - $errorArr[$tracknum] = Mage::helper('usa')->__( - 'Unable to retrieve tracking' - ); + $errorArr[$tracknum] = Mage::helper('usa')->__('Unable to retrieve tracking'); } } else { $errorArr[$tracknum] = Mage::helper('usa')->__('Unable to retrieve tracking'); @@ -1371,6 +1364,8 @@ protected function _mapRequestToShipment(Varien_Object $request) $request->setPackageCustomsValue($customsValue); $request->setFreeMethodWeight(0); $request->setDhlShipmentType($request->getPackagingType()); + + $request->setBaseSubtotalInclTax($request->getBaseSubtotalInclTax()); } /** diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International.php new file mode 100644 index 0000000000..24456206b8 --- /dev/null +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International.php @@ -0,0 +1,1490 @@ + + */ +class Mage_Usa_Model_Shipping_Carrier_Dhl_International + extends Mage_Usa_Model_Shipping_Carrier_Abstract + implements Mage_Shipping_Model_Carrier_Interface +{ + /** + * Carrier Product indicator + */ + const DHL_CONTENT_TYPE_DOC = 'D'; + const DHL_CONTENT_TYPE_NON_DOC = 'N'; + + /** + * Container types that could be customized + * + * @var array + */ + protected $_customizableContainerTypes = array(self::DHL_CONTENT_TYPE_NON_DOC); + + /** + * Code of the carrier + */ + const CODE = 'dhlint'; + + /** + * Rate request data + * + * @var Mage_Shipping_Model_Rate_Request|null + */ + protected $_request = null; + + /** + * Raw rate request data + * + * @var Varien_Object|null + */ + protected $_rawRequest = null; + + /** + * Rate result data + * + * @var Mage_Shipping_Model_Rate_Result|null + */ + protected $_result = null; + + /** + * Countries parameters data + * + * @var SimpleXMLElement|null + */ + protected $_countryParams = null; + + /** + * Errors placeholder + * + * @var array + */ + protected $_errors = array(); + + /** + * Dhl rates result + * + * @var array + */ + protected $_rates = array(); + + /** + * Store Id + * + * @var int|null + */ + protected $_storeId = null; + + /** + * Carrier's code + * + * @var string + */ + protected $_code = self::CODE; + + /** + * Free Method config path + * + * @var string + */ + protected $_freeMethod = 'free_method_nondoc'; + + /** + * Max weight without fee + * + * @var int + */ + protected $_maxWeight = 70; + + /** + * Request variables array + * + * @var array + */ + protected $_requestVariables = array( + 'id' => array('code' => 'dhl_id', 'setCode' => 'id'), + 'password' => array('code' => 'dhl_password', 'setCode' => 'password'), + 'account' => array('code' => 'dhl_account', 'setCode' => 'account_nbr'), + 'shipping_key' => array('code' => 'dhl_shipping_key', 'setCode' => 'shipping_key'), + 'shipping_intlkey' => array('code' => 'dhl_shipping_intl_key', 'setCode' => 'shipping_intl_key'), + 'shipment_type' => array('code' => 'dhl_shipment_type', 'setCode' => 'shipment_type'), + 'dutiable' => array('code' => 'dhl_dutiable', 'setCode' => 'dutiable'), + 'dutypaymenttype' => array('code' => 'dhl_duty_payment_type', 'setCode' => 'duty_payment_type'), + 'contentdesc' => array('code' => 'dhl_content_desc', 'setCode' => 'content_desc') + ); + + /** + * Dhl International Class constructor + * + * Sets necessary data + */ + protected function _construct() + { + if ($this->getConfigData('content_type') == self::DHL_CONTENT_TYPE_DOC) { + $this->_freeMethod = 'free_method_doc'; + } + } + + /** + * Returns value of given variable + * + * @param mixed $origValue + * @param string $pathToValue + * @return mixed + */ + protected function _getDefaultValue($origValue, $pathToValue) + { + if (!$origValue) { + $origValue = Mage::getStoreConfig( + $pathToValue, + $this->_storeId + ); + } + + return $origValue; + } + + /** + * Collect and get rates + * + * @param Mage_Shipping_Model_Rate_Request $request + * @return bool|Mage_Shipping_Model_Rate_Result|null + */ + public function collectRates(Mage_Shipping_Model_Rate_Request $request) + { + if (!$this->getConfigFlag($this->_activeFlag)) { + return false; + } + + $requestDhl = clone $request; + $this->_storeId = $requestDhl->getStoreId(); + + $origCompanyName = $this->_getDefaultValue( + $requestDhl->getOrigCompanyName(), + Mage_Core_Model_Store::XML_PATH_STORE_STORE_NAME + ); + $origCountryId = $this->_getDefaultValue( + $requestDhl->getOrigCountryId(), + Mage_Shipping_Model_Shipping::XML_PATH_STORE_COUNTRY_ID + ); + $origState = $this->_getDefaultValue( + $requestDhl->getOrigState(), + Mage_Shipping_Model_Shipping::XML_PATH_STORE_REGION_ID + ); + $origCity = $this->_getDefaultValue( + $requestDhl->getOrigCity(), + Mage_Shipping_Model_Shipping::XML_PATH_STORE_CITY + ); + $origPostcode = $this->_getDefaultValue( + $requestDhl->getOrigPostcode(), + Mage_Shipping_Model_Shipping::XML_PATH_STORE_ZIP + ); + + $requestDhl->setOrigCompanyName($origCompanyName) + ->setCountryId($origCountryId) + ->setOrigState($origState) + ->setOrigCity($origCity) + ->setOrigPostal($origPostcode); + $this->setRequest($requestDhl); + + $this->_result = $this->_getQuotes(); + + $this->_updateFreeMethodQuote($request); + + return $this->_result; + } + + /** + * Set Free Method Request + * + * @param string $freeMethod + * @return void + */ + protected function _setFreeMethodRequest($freeMethod) + { + $rawRequest = $this->_rawRequest; + + $rawRequest->setFreeMethodRequest(true); + $freeWeight = $this->getTotalNumOfBoxes($rawRequest->getFreeMethodWeight()); + $rawRequest->setWeight($freeWeight); + $rawRequest->setService($freeMethod); + } + + /** + * Returns request result + * + * @return Mage_Shipping_Model_Rate_Result|null + */ + public function getResult() + { + return $this->_result; + } + + protected function _addParams($requestObject) + { + $request = $this->_request; + foreach ($this->_requestVariables as $code => $objectCode) { + if ($request->getDhlId()) { + $value = $request->getData($objectCode['code']); + } else { + $value = $this->getConfigData($code); + } + $requestObject->setData($objectCode['setCode'], $value); + } + return $requestObject; + } + + /** + * Prepare and set request in property of current instance + * + * @param Varien_Object $request + * @return Mage_Usa_Model_Shipping_Carrier_Dhl + */ + public function setRequest(Varien_Object $request) + { + $this->_request = $request; + $this->_storeId = $request->getStoreId(); + + $requestObject = new Varien_Object(); + + $requestObject->setIsGenerateLabelReturn($request->getIsGenerateLabelReturn()); + + $requestObject->setStoreId($request->getStoreId()); + + if ($request->getLimitMethod()) { + $requestObject->setService($request->getLimitMethod()); + } + + $requestObject = $this->_addParams($requestObject); + + if ($request->getDestPostcode()) { + $requestObject->setDestPostal($request->getDestPostcode()); + } + + $requestObject->setOrigCountry( + $this->_getDefaultValue( + $request->getOrigCountry(), Mage_Shipping_Model_Shipping::XML_PATH_STORE_COUNTRY_ID) + ) + ->setOrigCountryId( + $this->_getDefaultValue( + $request->getOrigCountryId(), Mage_Shipping_Model_Shipping::XML_PATH_STORE_COUNTRY_ID) + ); + + $shippingWeight = $request->getPackageWeight(); + + $requestObject->setValue(round($request->getPackageValue(), 2)) + ->setValueWithDiscount($request->getPackageValueWithDiscount()) + ->setCustomsValue($request->getPackageCustomsValue()) + ->setDestStreet( + Mage::helper('core/string')->substr(str_replace("\n", '', $request->getDestStreet()), 0, 35)) + ->setDestStreetLine2($request->getDestStreetLine2()) + ->setDestCity($request->getDestCity()) + ->setOrigCompanyName($request->getOrigCompanyName()) + ->setOrigCity($request->getOrigCity()) + ->setOrigPhoneNumber($request->getOrigPhoneNumber()) + ->setOrigPersonName($request->getOrigPersonName()) + ->setOrigEmail(Mage::getStoreConfig('trans_email/ident_general/email', $requestObject->getStoreId())) + ->setOrigCity($request->getOrigCity()) + ->setOrigPostal($request->getOrigPostal()) + ->setOrigStreetLine2($request->getOrigStreetLine2()) + ->setDestPhoneNumber($request->getDestPhoneNumber()) + ->setDestPersonName($request->getDestPersonName()) + ->setDestCompanyName($request->getDestCompanyName()); + + $originStreet2 = Mage::getStoreConfig( + Mage_Shipping_Model_Shipping::XML_PATH_STORE_ADDRESS2, $requestObject->getStoreId()); + + $requestObject->setOrigStreet($request->getOrigStreet() ? $request->getOrigStreet() : $originStreet2); + + if (is_numeric($request->getOrigState())) { + $requestObject->setOrigState(Mage::getModel('directory/region')->load($request->getOrigState())->getCode()); + } else { + $requestObject->setOrigState($request->getOrigState()); + } + + if ($request->getDestCountryId()) { + $destCountry = $request->getDestCountryId(); + } else { + $destCountry = self::USA_COUNTRY_ID; + } + + // for DHL, Puerto Rico state for US will assume as Puerto Rico country + // for Puerto Rico, dhl will ship as international + if ($destCountry == self::USA_COUNTRY_ID && ($request->getDestPostcode() == '00912' + || $request->getDestRegionCode() == self::PUERTORICO_COUNTRY_ID) + ) { + $destCountry = self::PUERTORICO_COUNTRY_ID; + } + + $requestObject->setDestCountryId($destCountry) + ->setDestState($request->getDestRegionCode()) + ->setWeight($shippingWeight) + ->setFreeMethodWeight($request->getFreeMethodWeight()) + ->setOrderShipment($request->getOrderShipment()); + + if ($request->getPackageId()) { + $requestObject->setPackageId($request->getPackageId()); + } + + $requestObject->setBaseSubtotalInclTax($request->getBaseSubtotalInclTax()); + + $this->_rawRequest = $requestObject; + return $this; + } + + /** + * Get allowed shipping methods + * + * @return array + */ + public function getAllowedMethods() + { + $contentType = $this->getConfigData('content_type'); + $allowedMethods = array(); + switch ($contentType) { + case self::DHL_CONTENT_TYPE_DOC: + $allowedMethods = explode(',', $this->getConfigData('doc_methods')); + break; + + case self::DHL_CONTENT_TYPE_NON_DOC: + $allowedMethods = explode(',', $this->getConfigData('nondoc_methods')); + break; + default: + Mage::throwException(Mage::helper('usa')->__('Wrong Content Type.')); + } + $methods = array(); + foreach ($allowedMethods as $method) { + $methods[$method] = $this->getDhlProductTitle($method); + } + return $methods; + } + + /** + * Get configuration data of carrier + * + * @param strin $type + * @param string $code + * @return array|bool + */ + public function getCode($type, $code = '') + { + $codes = array( + 'unit_of_measure' => array( + 'L' => Mage::helper('usa')->__('Pounds'), + 'K' => Mage::helper('usa')->__('Kilograms'), + ), + 'unit_of_dimension' => array( + 'I' => Mage::helper('usa')->__('Inches'), + 'C' => Mage::helper('usa')->__('Centimeters'), + ), + 'unit_of_dimension_cut' => array( + 'I' => Mage::helper('usa')->__('inch'), + 'C' => Mage::helper('usa')->__('cm'), + ), + 'dimensions' => array( + 'height' => Mage::helper('usa')->__('Height'), + 'depth' => Mage::helper('usa')->__('Depth'), + 'width' => Mage::helper('usa')->__('Width'), + ), + 'size' => array( + '0' => Mage::helper('usa')->__('Regular'), + '1' => Mage::helper('usa')->__('Specific'), + ), + 'dimensions_variables' => array( + 'L' => Zend_Measure_Weight::POUND, + 'LB' => Zend_Measure_Weight::POUND, + 'POUND' => Zend_Measure_Weight::POUND, + 'K' => Zend_Measure_Weight::KILOGRAM, + 'KG' => Zend_Measure_Weight::KILOGRAM, + 'KILOGRAM' => Zend_Measure_Weight::KILOGRAM, + 'I' => Zend_Measure_Length::INCH, + 'IN' => Zend_Measure_Length::INCH, + 'INCH' => Zend_Measure_Length::INCH, + 'C' => Zend_Measure_Length::CENTIMETER, + 'CM' => Zend_Measure_Length::CENTIMETER, + 'CENTIMETER'=> Zend_Measure_Length::CENTIMETER, + + ) + ); + + if (!isset($codes[$type])) { + return false; + } elseif ('' === $code) { + return $codes[$type]; + } + + if (!isset($codes[$type][$code])) { + return false; + } else { + return $codes[$type][$code]; + } + } + + /** + * Returns DHL shipment methods (depending on package content type, if necessary) + * + * @param string $doc Package content type (doc/non-doc) see DHL_CONTENT_TYPE_* constants + * @return array + */ + public function getDhlProducts($doc) + { + if ($doc == self::DHL_CONTENT_TYPE_DOC) { + // Documents shipping + return array( + '2' => Mage::helper('usa')->__('Easy shop'), + '5' => Mage::helper('usa')->__('Sprintline'), + '6' => Mage::helper('usa')->__('Secureline'), + '7' => Mage::helper('usa')->__('Express easy'), + '9' => Mage::helper('usa')->__('Europack'), + 'B' => Mage::helper('usa')->__('Break bulk express'), + 'C' => Mage::helper('usa')->__('Medical express'), + 'D' => Mage::helper('usa')->__('Express worldwide'), // product content code: DOX + 'U' => Mage::helper('usa')->__('Express worldwide'), // product content code: ECX + 'K' => Mage::helper('usa')->__('Express 9:00'), + 'L' => Mage::helper('usa')->__('Express 10:30'), + 'G' => Mage::helper('usa')->__('Domestic economy select'), + 'W' => Mage::helper('usa')->__('Economy select'), + 'I' => Mage::helper('usa')->__('Break bulk economy'), + 'N' => Mage::helper('usa')->__('Domestic express'), + 'O' => Mage::helper('usa')->__('Others'), + 'R' => Mage::helper('usa')->__('Globalmail business'), + 'S' => Mage::helper('usa')->__('Same day'), + 'T' => Mage::helper('usa')->__('Express 12:00'), + 'X' => Mage::helper('usa')->__('Express envelope'), + ); + } else { + // Services for shipping non-documents cargo + return array( + '1' => Mage::helper('usa')->__('Customer services'), + '3' => Mage::helper('usa')->__('Easy shop'), + '4' => Mage::helper('usa')->__('Jetline'), + '8' => Mage::helper('usa')->__('Express easy'), + 'P' => Mage::helper('usa')->__('Express worldwide'), + 'Q' => Mage::helper('usa')->__('Medical express'), + 'E' => Mage::helper('usa')->__('Express 9:00'), + 'F' => Mage::helper('usa')->__('Freight worldwide'), + 'H' => Mage::helper('usa')->__('Economy select'), + 'J' => Mage::helper('usa')->__('Jumbo box'), + 'M' => Mage::helper('usa')->__('Express 10:30'), + 'V' => Mage::helper('usa')->__('Europack'), + 'Y' => Mage::helper('usa')->__('Express 12:00'), + ); + } + } + + /** + * Returns title of DHL shipping method by its code + * + * @param string $code One-symbol code (see getDhlProducts()) + * @return bool + */ + public function getDhlProductTitle($code) + { + $contentType = $this->getConfigData('content_type'); + $dhlProducts = $this->getDhlProducts($contentType); + return isset($dhlProducts[$code]) ? $dhlProducts[$code] : false; + } + + /** + * Convert item weight to needed weight based on config weight unit dimensions + * + * @param float $weight + * @param bool $maxWeight + * @return float + */ + protected function _getWeight($weight, $maxWeight = false) + { + if ($maxWeight) { + $configWeightUnit = Zend_Measure_Weight::KILOGRAM; + } else { + $configWeightUnit = $this->getCode( + 'dimensions_variables', + strtoupper((string)$this->getConfigData('unit_of_measure')) + ); + } + + $countryWeightUnit = $this->getCode( + 'dimensions_variables', + strtoupper($this->_getWeightUnit()) + ); + + if ($configWeightUnit != $countryWeightUnit) { + $weight = round(Mage::helper('usa')->convertMeasureWeight( + $weight, + $configWeightUnit, + $countryWeightUnit + ), 3); + } + + return round($weight, 3); + } + + /** + * Prepare items to pieces + * + * @return array + */ + protected function _getAllItems() + { + $allItems = $this->_request->getAllItems(); + $fullItems = array(); + + foreach ($allItems as $item) { + if ($item->getProductType() == Mage_Catalog_Model_Product_Type::TYPE_BUNDLE + && $item->getProduct()->getShipmentType() + ) { + continue; + } + + $qty = $item->getQty(); + + if ($item->getParentItem()) { + if (!$item->getParentItem()->getProduct()->getShipmentType()) { + continue; + } + $qty = $item->getIsQtyDecimal() + ? $item->getParentItem()->getQty() + : $item->getParentItem()->getQty() * $item->getQty(); + } + + $itemWeight = $item->getWeight(); + if ($item->getIsQtyDecimal() && $item->getProductType() != Mage_Catalog_Model_Product_Type::TYPE_BUNDLE) { + $itemWeight = $itemWeight * $item->getQty(); + } + + if ($this->_getWeight($itemWeight) > $this->_getWeight($this->_maxWeight, true)) { + return array(); + } + + if (!$item->getParentItem() && $item->getIsQtyDecimal() + && $item->getProductType() != Mage_Catalog_Model_Product_Type::TYPE_BUNDLE + ) { + $qty = 1; + } + $fullItems = array_merge($fullItems, array_fill(0, $qty, $this->_getWeight($itemWeight))); + } + sort($fullItems); + + return $fullItems; + } + + /** + * Make pieces + * + * @param SimpleXMLElement $nodeBkgDetails + * @return void + */ + protected function _makePieces(SimpleXMLElement $nodeBkgDetails) + { + $divideOrderWeight = (string)$this->getConfigData('divide_order_weight'); + $nodePieces = $nodeBkgDetails->addChild('Pieces', '', ''); + $items = $this->_getAllItems(); + $numberOfPieces = 0; + + if ($divideOrderWeight && !empty($items)) { + $maxWeight = $this->_getWeight($this->_maxWeight, true); + $sumWeight = 0; + + $reverseOrderItems = $items; + arsort($reverseOrderItems); + + foreach ($reverseOrderItems as $key => $weight) { + if (!isset($items[$key])) { + continue; + } + unset($items[$key]); + $sumWeight = $weight; + foreach ($items as $key => $weight) { + if (($sumWeight + $weight) < $maxWeight) { + unset($items[$key]); + $sumWeight += $weight; + } elseif (($sumWeight + $weight) > $maxWeight) { + $numberOfPieces++; + $nodePiece = $nodePieces->addChild('Piece', '', ''); + $nodePiece->addChild('PieceID', $numberOfPieces); + $this->_addDimension($nodePiece); + $nodePiece->addChild('Weight', $sumWeight); + break; + } else { + unset($items[$key]); + $numberOfPieces++; + $sumWeight += $weight; + $nodePiece = $nodePieces->addChild('Piece', '', ''); + $nodePiece->addChild('PieceID', $numberOfPieces); + $this->_addDimension($nodePiece); + $nodePiece->addChild('Weight', $sumWeight); + $sumWeight = 0; + break; + } + } + } + if ($sumWeight > 0) { + $numberOfPieces++; + $nodePiece = $nodePieces->addChild('Piece', '', ''); + $nodePiece->addChild('PieceID', $numberOfPieces); + $this->_addDimension($nodePiece); + $nodePiece->addChild('Weight', $sumWeight); + } + } else { + $nodePiece = $nodePieces->addChild('Piece', '', ''); + $nodePiece->addChild('PieceID', 1); + $this->_addDimension($nodePiece); + $nodePiece->addChild('Weight', $this->_getWeight($this->_rawRequest->getWeight())); + } + + $handlingAction = $this->getConfigData('handling_action'); + if ($handlingAction == Mage_Shipping_Model_Carrier_Abstract::HANDLING_ACTION_PERORDER || !$numberOfPieces) { + $numberOfPieces = 1; + } + $this->_numBoxes = $numberOfPieces; + } + + /** + * Convert item dimension to needed dimension based on config dimension unit of measure + * + * @param float $dimension + * @return float + */ + protected function _getDimension($dimension) + { + $configWeightUnit = $this->getCode( + 'dimensions_variables', + strtoupper((string)$this->getConfigData('unit_of_measure')) + ); + + if ($configWeightUnit == Zend_Measure_Weight::POUND) { + $configWeightUnit = Zend_Measure_Length::INCH; + } else { + $configWeightUnit = Zend_Measure_Length::CENTIMETER; + } + + + $countryDimensionUnit = $this->getCode( + 'dimensions_variables', + strtoupper($this->_getDimensionUnit()) + ); + + if ($configWeightUnit != $countryDimensionUnit) { + $dimension = round(Mage::helper('usa')->convertMeasureDimension( + $dimension, + $configWeightUnit, + $countryDimensionUnit + ), 3); + } + + return round($dimension, 3); + } + + /** + * Add dimension to piece + * + * @param SimpleXMLElement $nodePiece + * @return void + */ + protected function _addDimension($nodePiece) + { + $sizeChecker = (string)$this->getConfigData('size'); + + $height = $this->_getDimension((string)$this->getConfigData('height')); + $depth = $this->_getDimension((string)$this->getConfigData('depth')); + $width = $this->_getDimension((string)$this->getConfigData('width')); + + if ($sizeChecker && $height && $depth && $width) { + $nodePiece->addChild('Height', $height); + $nodePiece->addChild('Depth', $depth); + $nodePiece->addChild('Width', $width); + } + } + + /** + * Get shipping quotes + * + * @return Mage_Core_Model_Abstract|Mage_Shipping_Model_Rate_Result + */ + protected function _getQuotes() + { + $rawRequest = $this->_rawRequest; + $xmlStr = '' + . ''; + $xml = new SimpleXMLElement($xmlStr); + $nodeGetQuote = $xml->addChild('GetQuote', '', ''); + $nodeRequest = $nodeGetQuote->addChild('Request'); + + $nodeServiceHeader = $nodeRequest->addChild('ServiceHeader'); + $nodeServiceHeader->addChild('SiteID', (string)$this->getConfigData('id')); + $nodeServiceHeader->addChild('Password', (string)$this->getConfigData('password')); + + $nodeFrom = $nodeGetQuote->addChild('From'); + $nodeFrom->addChild('CountryCode', $rawRequest->getOrigCountryId()); + $nodeFrom->addChild('Postalcode', $rawRequest->getOrigPostal()); + $nodeFrom->addChild('City', $rawRequest->getOrigCity()); + + $nodeBkgDetails = $nodeGetQuote->addChild('BkgDetails'); + $nodeBkgDetails->addChild('PaymentCountryCode', $rawRequest->getOrigCountryId()); + $nodeBkgDetails->addChild('Date', Varien_Date::now(true)); + $nodeBkgDetails->addChild('ReadyTime', 'PT' . (int)(string)$this->getConfigData('ready_time') . 'H00M'); + + $nodeBkgDetails->addChild('DimensionUnit', $this->_getDimensionUnit()); + $nodeBkgDetails->addChild('WeightUnit', $this->_getWeightUnit()); + + $this->_makePieces($nodeBkgDetails); + + $nodeBkgDetails->addChild('PaymentAccountNumber', (string)$this->getConfigData('account')); + + $nodeTo = $nodeGetQuote->addChild('To'); + $nodeTo->addChild('CountryCode', $rawRequest->getDestCountryId()); + $nodeTo->addChild('Postalcode', $rawRequest->getDestPostal()); + $nodeTo->addChild('City', $rawRequest->getDestCity()); + + if ($this->getConfigData('content_type') == self::DHL_CONTENT_TYPE_NON_DOC) { + // IsDutiable flag and Dutiable node indicates that cargo is not a documentation + $nodeBkgDetails->addChild('IsDutiable', 'Y'); + $nodeDutiable = $nodeGetQuote->addChild('Dutiable'); + $baseCurrencyCode = Mage::app()->getWebsite($this->_request->getWebsiteId())->getBaseCurrencyCode(); + $nodeDutiable->addChild('DeclaredCurrency', $baseCurrencyCode); + $nodeDutiable->addChild('DeclaredValue', $rawRequest->getValue()); + } + + $request = $xml->asXML(); + $request = utf8_encode($request); + $responseBody = $this->_getCachedQuotes($request); + if ($responseBody === null) { + $debugData = array('request' => $request); + try { + $client = new Varien_Http_Client(); + $client->setUri((string)$this->getConfigData('gateway_url')); + $client->setConfig(array('maxredirects' => 0, 'timeout' => 30)); + $client->setRawData($request); + $responseBody = $client->request(Varien_Http_Client::POST)->getBody(); + $debugData['result'] = $responseBody; + $this->_setCachedQuotes($request, $responseBody); + } catch (Exception $e) { + $this->_errors[$e->getCode()] = $e->getMessage(); + $responseBody = ''; + } + $this->_debug($debugData); + } + + return $this->_parseResponse($responseBody); + } + + /** + * Parse response from DHL web service + * + * @param string $response + * @return Mage_Shipping_Model_Rate_Result + */ + protected function _parseResponse($response) + { + $htmlTranslationTable = get_html_translation_table(HTML_ENTITIES); + unset($htmlTranslationTable['<'], $htmlTranslationTable['>'], $htmlTranslationTable['"']); + $response = str_replace(array_keys($htmlTranslationTable), array_values($htmlTranslationTable), $response); + + if (strlen(trim($response)) > 0) { + if (strpos(trim($response), 'Response->Status->ActionStatus) && $xml->Response->Status->ActionStatus == 'Error') + || (isset($xml->GetQuoteResponse->Note->Condition)) + ) { + if (isset($xml->Response->Status->Condition)) { + $nodeCondition = $xml->Response->Status->Condition; + } else { + $nodeCondition = $xml->GetQuoteResponse->Note->Condition; + } + + $code = isset($nodeCondition->ConditionCode) ? (string)$nodeCondition->ConditionCode : 0; + $data = isset($nodeCondition->ConditionData) ? (string)$nodeCondition->ConditionData : ''; + $this->_errors[$code] = Mage::helper('usa')->__('Error #%s : %s', $code, $data); + } else { + if (isset($xml->GetQuoteResponse->BkgDetails->QtdShp)) { + foreach ($xml->GetQuoteResponse->BkgDetails->QtdShp as $quotedShipment) { + $this->_addRate($quotedShipment); + } + } elseif (isset($xml->AirwayBillNumber)) { + $result = new Varien_Object(); + $result->setTrackingNumber((string)$xml->AirwayBillNumber); + $result->setShippingLabelContent(base64_decode((string)$xml->Barcodes->OriginDestnBarcode)); + return $result; + } else { + $this->_errors[] = Mage::helper('usa')->__('The response is in wrong format.'); + } + } + } + } else { + $this->_errors[] = Mage::helper('usa')->__('The response is in wrong format.'); + } + } + + /* @var $result Mage_Shipping_Model_Rate_Result */ + $result = Mage::getModel('shipping/rate_result'); + if ($this->_rates) { + foreach ($this->_rates as $rate) { + $method = $rate['service']; + $data = $rate['data']; + /* @var $rate Mage_Shipping_Model_Rate_Result_Method */ + $rate = Mage::getModel('shipping/rate_result_method'); + $rate->setCarrier(self::CODE); + $rate->setCarrierTitle($this->getConfigData('title')); + $rate->setMethod($method); + $rate->setMethodTitle($data['term']); + $rate->setCost($data['price_total']); + $rate->setPrice($data['price_total']); + $result->append($rate); + } + } else if (!empty($this->_errors)) { + return $this->_showError(); + } + return $result; + } + + /** + * Add rate to DHL rates array + * + * @param SimpleXMLElement $shipmentDetails + * @return Mage_Usa_Model_Shipping_Carrier_Dhl_International + */ + protected function _addRate(SimpleXMLElement $shipmentDetails) + { + if (isset($shipmentDetails->ProductShortName) + && isset($shipmentDetails->ShippingCharge) + && isset($shipmentDetails->GlobalProductCode) + && isset($shipmentDetails->CurrencyCode) + && array_key_exists((string)$shipmentDetails->GlobalProductCode, $this->getAllowedMethods()) + ) { + // DHL product code, e.g. '3', 'A', 'Q', etc. + $dhlProduct = (string)$shipmentDetails->GlobalProductCode; + $totalEstimate = (float)(string)$shipmentDetails->ShippingCharge; + $currencyCode = (string)$shipmentDetails->CurrencyCode; + $baseCurrencyCode = Mage::app()->getWebsite($this->_request->getWebsiteId())->getBaseCurrencyCode(); + $dhlProductDescription = $this->getDhlProductTitle($dhlProduct); + + if ($currencyCode != $baseCurrencyCode) { + /* @var $currency Mage_Directory_Model_Currency */ + $currency = Mage::getModel('directory/currency'); + $rates = $currency->getCurrencyRates($currencyCode, array($baseCurrencyCode)); + if (!empty($rates) && isset($rates[$baseCurrencyCode])) { + // Convert to store display currency using store exchange rate + $totalEstimate = $totalEstimate * $rates[$baseCurrencyCode]; + } else { + $rates = $currency->getCurrencyRates($baseCurrencyCode, array($currencyCode)); + if (!empty($rates) && isset($rates[$currencyCode])) { + $totalEstimate = $totalEstimate/$rates[$currencyCode]; + } + if (!isset($rates[$currencyCode]) || !$totalEstimate) { + $totalEstimate = false; + $this->_errors[] = Mage::helper('usa')->__("Exchange rate %s (Base Currency) -> %s not found. DHL method %s skipped", $currencyCode, $baseCurrencyCode, $dhlProductDescription); + } + } + } + if ($totalEstimate) { + $data = array('term' => $dhlProductDescription, + 'price_total' => $this->getMethodPrice($totalEstimate, $dhlProduct)); + if (!empty($this->_rates)) { + foreach ($this->_rates as $product) { + if ($product['data']['term'] == $data['term'] + && $product['data']['price_total'] == $data['price_total'] + ) { + return $this; + } + } + } + $this->_rates[] = array('service' => $dhlProduct, 'data' => $data); + } else { + $this->_errors[] = Mage::helper('usa')->__("Zero shipping charge for '%s'", $dhlProductDescription); + } + } else { + $dhlProductDescription = false; + if (isset($shipmentDetails->GlobalProductCode)) { + $dhlProductDescription = $this->getDhlProductTitle((string)$shipmentDetails->GlobalProductCode); + } + $dhlProductDescription = $dhlProductDescription ? $dhlProductDescription : Mage::helper('usa')->__("DHL"); + $this->_errors[] = Mage::helper('usa')->__("Zero shipping charge for '%s'", $dhlProductDescription); + } + return $this; + } + + /** + * Returns dimension unit (cm or inch) + * + * @return string + */ + protected function _getDimensionUnit() + { + $countryId = $this->_rawRequest->getOrigCountryId(); + $measureUnit = $this->getCountryParams($countryId)->getMeasureUnit(); + if (empty($measureUnit)) { + Mage::throwException(Mage::helper('usa')->__("Cannot identify measure unit for %s", $countryId)); + } + return $measureUnit; + } + + /** + * Returns weight unit (kg or pound) + * + * @return string + */ + protected function _getWeightUnit() + { + $countryId = $this->_rawRequest->getOrigCountryId(); + $weightUnit = $this->getCountryParams($countryId)->getWeightUnit(); + if (empty($weightUnit)) { + Mage::throwException(Mage::helper('usa')->__("Cannot identify weight unit for %s", $countryId)); + } + return $weightUnit; + } + + /** + * Get Country Params by Country Code + * + * @param string $countryCode + * @return Varien_Object + * + * @see $countryCode ISO 3166 Codes (Countries) A2 + */ + protected function getCountryParams($countryCode) + { + if (empty($this->_countryParams)) { + $dhlConfigPath = Mage::getModuleDir('etc', 'Mage_Usa') . DS . 'dhl' . DS; + $countriesXml = file_get_contents($dhlConfigPath . 'international' . DS . 'countries.xml'); + $this->_countryParams = new Varien_Simplexml_Element($countriesXml); + } + if (isset($this->_countryParams->$countryCode)) { + $countryParams = new Varien_Object($this->_countryParams->$countryCode->asArray()); + } + return isset($countryParams) ? $countryParams : new Varien_Object(); + } + + /** + * Do shipment request to carrier web service, obtain Print Shipping Labels and process errors in response + * + * @param Varien_Object $request + * @return Varien_Object + */ + protected function _doShipmentRequest(Varien_Object $request) + { + $this->_prepareShipmentRequest($request); + $this->_mapRequestToShipment($request); + $this->setRequest($request); + + return $this->_doRequest(); + } + + /** + * Processing additional validation to check is carrier applicable. + * + * @param Mage_Shipping_Model_Rate_Request $request + * @return Mage_Shipping_Model_Carrier_Abstract|Mage_Shipping_Model_Rate_Result_Error|boolean + */ + public function proccessAdditionalValidation(Mage_Shipping_Model_Rate_Request $request) + { + //Skip by item validation if there is no items in request + if(!count($this->getAllItems($request))) { + $this->_errors[] = Mage::helper('usa')->__('There is no items in this order'); + } + + if (!empty($this->_errors)) { + return $this->_showError(); + } + + return $this; + } + + /** + * Show default error + * + * @return bool|Mage_Shipping_Model_Rate_Result_Error + */ + protected function _showError() + { + $showMethod = $this->getConfigData('showmethod'); + + if ($showMethod) { + /* @var $error Mage_Shipping_Model_Rate_Result_Error */ + $error = Mage::getModel('shipping/rate_result_error'); + $error->setCarrier(self::CODE); + $error->setCarrierTitle($this->getConfigData('title')); + $error->setErrorMessage($this->getConfigData('specificerrmsg')); + $this->_debug($this->_errors); + return $error; + } else { + return false; + } + } + + /** + * Return container types of carrier + * + * @param Varien_Object|null $params + * @return array + */ + public function getContainerTypes(Varien_Object $params = null) + { + return array( + self::DHL_CONTENT_TYPE_DOC => Mage::helper('usa')->__('Documents'), + self::DHL_CONTENT_TYPE_NON_DOC => Mage::helper('usa')->__('Non Documents') + ); + } + + /** + * Map request to shipment + * + * @param Varien_Object $request + * @return null + */ + protected function _mapRequestToShipment(Varien_Object $request) + { + $customsValue = $request->getPackageParams()->getCustomsValue(); + + $request->getLimitMethod($request->getShippingMethod()); + $request->getPackageValue($customsValue); + $request->getValueWithDiscount($customsValue); + $request->getPackageCustomsValue($customsValue); + $request->getFreeMethodWeight(0); + $request->getDhlShipmentType($request->getPackagingType()); + } + + /** + * Do rate request and handle errors + * + * @return Mage_Shipping_Model_Rate_Result|Varien_Object + */ + protected function _doRequest() + { + $rawRequest = $this->_request; + + $originRegion = (string)$this->getCountryParams( + Mage::getStoreConfig(Mage_Shipping_Model_Shipping::XML_PATH_STORE_COUNTRY_ID, $this->getStore()) + )->region; + + if (!$originRegion) { + Mage::throwException(Mage::helper('usa')->__('Wrong Region.')); + } + + if ($originRegion == 'AM') { + $originRegion = ''; + } + + $xmlStr = '' + . ''; + $xml = new SimpleXMLElement($xmlStr); + + $nodeRequest = $xml->addChild('Request', '', ''); + $nodeServiceHeader = $nodeRequest->addChild('ServiceHeader'); + $nodeServiceHeader->addChild('SiteID', (string)$this->getConfigData('id')); + $nodeServiceHeader->addChild('Password', (string)$this->getConfigData('password')); + + $xml->addChild('LanguageCode', 'EN', ''); + $xml->addChild('PiecesEnabled', 'Y', ''); + + /* Billing */ + $nodeBilling = $xml->addChild('Billing', '', ''); + $nodeBilling->addChild('ShipperAccountNumber', (string)$this->getConfigData('account')); + /* + * Method of Payment: + * S (Shipper) + * R (Receiver) + * T (Third Party) + */ + $nodeBilling->addChild('ShippingPaymentType', 'S'); + + /* + * Shipment bill to account – required if Shipping PaymentType is other than 'S' + */ + //$nodeBilling->addChild('BillingAccountNumber', (string)$this->getConfigData('password')); + //$nodeBilling->addChild('DutyPaymentType', ''); + //$nodeBilling->addChild('DutyAccountNumber', ''); + + /* Receiver */ + $nodeConsignee = $xml->addChild('Consignee', '', ''); + + $companyName = ($rawRequest->getRecipientContactCompanyName()) + ? $rawRequest->getRecipientContactCompanyName() + : $rawRequest->getRecipientContactPersonName(); + + $nodeConsignee->addChild('CompanyName', substr($companyName, 0, 35)); + + $address = $rawRequest->getRecipientAddressStreet1(). ' ' . $rawRequest->getRecipientAddressStreet2(); + $addressLength = strlen($address); + if ($addressLength > 35) { + for ($i = 0; $i < $addressLength; $i += 35) { + $nodeConsignee->addChild('AddressLine', substr($address, $i, 35)); + } + } else { + $nodeConsignee->addChild('AddressLine', $address); + } + + $nodeConsignee->addChild('City', $rawRequest->getRecipientAddressCity()); + $nodeConsignee->addChild('Division', $rawRequest->getRecipientAddressStateOrProvinceCode()); + $nodeConsignee->addChild('PostalCode', $rawRequest->getRecipientAddressPostalCode()); + $nodeConsignee->addChild('CountryCode', $rawRequest->getRecipientAddressCountryCode()); + $nodeConsignee->addChild('CountryName', + (string)$this->getCountryParams($rawRequest->getRecipientAddressCountryCode())->name + ); + $nodeContact = $nodeConsignee->addChild('Contact'); + $nodeContact->addChild('PersonName', substr($rawRequest->getRecipientContactPersonName(), 0, 34)); + $nodeContact->addChild('PhoneNumber', substr($rawRequest->getRecipientContactPhoneNumber(), 0, 24)); + + /* Commodity */ + /* + * The CommodityCode element contains commodity code for shipment contents. Its + * value should lie in between 1 to 9999.This field is mandatory. + */ + $nodeCommodity = $xml->addChild('Commodity', '', ''); + $nodeCommodity->addChild('CommodityCode', '1'); + + /* Dutiable */ + if ($this->getConfigData('content_type') == self::DHL_CONTENT_TYPE_NON_DOC) { + $nodeDutiable = $xml->addChild('Dutiable', '', ''); + $nodeDutiable->addChild('DeclaredValue', + round($rawRequest->getOrderShipment()->getOrder()->getSubtotal(), 2) + ); + $baseCurrencyCode = Mage::app()->getWebsite($rawRequest->getWebsiteId())->getBaseCurrencyCode(); + $nodeDutiable->addChild('DeclaredCurrency', $baseCurrencyCode); + } + + /* Reference */ + /* + * This element identifies the reference information. It is an optional field in the + * shipment validation request. Only the first reference will be taken currently. + */ + $nodeReference = $xml->addChild('Reference', '', ''); + $nodeReference->addChild('ReferenceID', 'shipment reference'); + $nodeReference->addChild('ReferenceType', 'St'); + + /* Shipment Details */ + $nodeShipmentDetails = $xml->addChild('ShipmentDetails', '', ''); + $nodeShipmentDetails->addChild('NumberOfPieces', count($rawRequest->getPackages())); + $nodeShipmentDetails->addChild('CurrencyCode', + Mage::app()->getWebsite($this->_request->getWebsiteId())->getBaseCurrencyCode() + ); + $nodePieces = $nodeShipmentDetails->addChild('Pieces', '', ''); + + /* + * Package type + * EE (DHL Express Envelope), OD (Other DHL Packaging), CP (Custom Packaging) + * DC (Document), DM (Domestic), ED (Express Document), FR (Freight) + * BD (Jumbo Document), BP (Jumbo Parcel), JD (Jumbo Junior Document) + * JP (Jumbo Junior Parcel), PA (Parcel), DF (DHL Flyer) + */ + foreach ($rawRequest->getPackages() as $package) { + $nodePiece = $nodePieces->addChild('Piece', '', ''); + $packageType = 'DC'; + if ($package['params']['container'] == self::DHL_CONTENT_TYPE_NON_DOC) { + $packageType = 'CP'; + } + //$niodePiece->addChild('PieceID', ''); + $nodePiece->addChild('PackageType', $packageType); + $nodePiece->addChild('Weight', $package['params']['weight']); + $nodePiece->addChild('Depth', $package['params']['length']); + $nodePiece->addChild('Width', $package['params']['width']); + $nodePiece->addChild('Height', $package['params']['height']); + } + + if ($package['params']['container'] == self::DHL_CONTENT_TYPE_NON_DOC) { + $packageType = 'CP'; + } + $nodeShipmentDetails->addChild('PackageType', $packageType); + $nodeShipmentDetails->addChild('Weight', $rawRequest->getPackageWeight()); + + $dimensionUnit = $rawRequest->getPackageParams()->getDimensionUnits(); + $weightUnits = $rawRequest->getPackageParams()->getWeightUnits(); + + $nodeShipmentDetails->addChild('DimensionUnit', $dimensionUnit[0]); + $nodeShipmentDetails->addChild('WeightUnit', $weightUnits[0]); + + $nodeShipmentDetails->addChild('GlobalProductCode', $rawRequest->getShippingMethod()); + $nodeShipmentDetails->addChild('LocalProductCode', $rawRequest->getShippingMethod()); + + /* + * The DoorTo Element defines the type of delivery service that applies to the shipment. + * The valid values are DD (Door to Door), DA (Door to Airport) , AA and DC (Door to + * Door non-compliant) + */ + $nodeShipmentDetails->addChild('DoorTo', 'DD'); + $nodeShipmentDetails->addChild('Date', Mage::getModel('core/date')->date('Y-m-d')); + $nodeShipmentDetails->addChild('Contents', 'DHL Parcel TEST'); + if ($this->getConfigData('content_type') == self::DHL_CONTENT_TYPE_NON_DOC) { + $nodeShipmentDetails->addChild('IsDutiable', 'Y'); + } + + /* Shipper */ + $nodeShipper = $xml->addChild('Shipper', '', ''); + $nodeShipper->addChild('ShipperID', (string)$this->getConfigData('account')); + $nodeShipper->addChild('CompanyName', $rawRequest->getShipperContactCompanyName()); + //$nodeShipper->addChild('RegisteredAccount', ''); + + $address = $rawRequest->getShipperAddressStreet1(). ' ' . $rawRequest->getShipperAddressStreet2(); + $addressLength = strlen($address); + if ($addressLength > 35) { + for ($i = 0; $i < $addressLength; $i += 35) { + $nodeShipper->addChild('AddressLine', substr($address, $i, 35)); + } + } else { + $nodeShipper->addChild('AddressLine', $address); + } + + $nodeShipper->addChild('City', $rawRequest->getShipperAddressCity()); + $nodeShipper->addChild('Division', $rawRequest->getShipperAddressStateOrProvinceCode()); + $nodeShipper->addChild('PostalCode', $rawRequest->getShipperAddressPostalCode()); + $nodeShipper->addChild('CountryCode', $rawRequest->getShipperAddressCountryCode()); + $nodeShipper->addChild('CountryName', + (string)$this->getCountryParams($rawRequest->getShipperAddressCountryCode())->name + ); + $nodeContact = $nodeShipper->addChild('Contact', '', ''); + $nodeContact->addChild('PersonName', substr($rawRequest->getShipperContactPersonName(), 0, 34)); + $nodeContact->addChild('PhoneNumber', substr($rawRequest->getShipperContactPhoneNumber(), 0, 24)); + + $request = $xml->asXML(); + $request = utf8_encode($request); + $responseBody = $this->_getCachedQuotes($request); + if ($responseBody === null) { + $debugData = array('request' => $request); + try { + $client = new Varien_Http_Client(); + $client->setUri((string)$this->getConfigData('gateway_url')); + $client->setConfig(array('maxredirects' => 0, 'timeout' => 30)); + $client->setRawData($request); + $responseBody = $client->request(Varien_Http_Client::POST)->getBody(); + $debugData['result'] = $responseBody; + $this->_setCachedQuotes($request, $responseBody); + } catch (Exception $e) { + $this->_errors[$e->getCode()] = $e->getMessage(); + $responseBody = ''; + } + $this->_debug($debugData); + } + + return $this->_parseResponse($responseBody); + } + + /** + * Get tracking + * + * @param mixed $trackings + * @return mixed + */ + public function getTracking($trackings) + { + if (!is_array($trackings)) { + $trackings = array($trackings); + } + $this->_getXMLTracking($trackings); + + return $this->_result; + } + + /** + * Send request for tracking + * + * @param array $trackings + * @return void + */ + protected function _getXMLTracking($trackings) + { + $xmlStr = '' + . ''; + + $xml = new SimpleXMLElement($xmlStr); + + $requestNode = $xml->addChild('Request', '', ''); + $serviceHeaderNode = $requestNode->addChild('ServiceHeader', '', ''); + $serviceHeaderNode->addChild('SiteID', (string)$this->getConfigData('id')); + $serviceHeaderNode->addChild('Password', (string)$this->getConfigData('password')); + + $xml->addChild('LanguageCode', 'EN', ''); + foreach ($trackings as $tracking) { + $xml->addChild('AWBNumber', $tracking, ''); + } + /* + * Checkpoint details selection flag + * LAST_CHECK_POINT_ONLY + * ALL_CHECK_POINTS + */ + $xml->addChild('LevelOfDetails', 'ALL_CHECK_POINTS', ''); + + /* + * Value that indicates for getting the tracking details with the additional + * piece details and its respective Piece Details, Piece checkpoints along with + * Shipment Details if queried. + * + * S-Only Shipment Details + * B-Both Shipment & Piece Details + * P-Only Piece Details + * Default is ‘S’ + */ + //$xml->addChild('PiecesEnabled', 'ALL_CHECK_POINTS'); + + $request = $xml->asXML(); + $request = utf8_encode($request); + + $responseBody = $this->_getCachedQuotes($request); + if ($responseBody === null) { + $debugData = array('request' => $request); + try { + $client = new Varien_Http_Client(); + $client->setUri((string)$this->getConfigData('gateway_url')); + $client->setConfig(array('maxredirects' => 0, 'timeout' => 30)); + $client->setRawData($request); + $responseBody = $client->request(Varien_Http_Client::POST)->getBody(); + $debugData['result'] = $responseBody; + $this->_setCachedQuotes($request, $responseBody); + } catch (Exception $e) { + $this->_errors[$e->getCode()] = $e->getMessage(); + $responseBody = ''; + } + $this->_debug($debugData); + } + + $this->_parseXmlTrackingResponse($trackings, $responseBody); + } + + /** + * Parse xml tracking response + * + * @param array $trackings + * @param string $response + * @return void + */ + protected function _parseXmlTrackingResponse($trackings, $response) + { + $errorTitle = Mage::helper('usa')->__('Unable to retrieve tracking'); + $resultArr = array(); + + $htmlTranslationTable = get_html_translation_table(HTML_ENTITIES); + unset($htmlTranslationTable['<'], $htmlTranslationTable['>'], $htmlTranslationTable['"']); + $response = str_replace(array_keys($htmlTranslationTable), array_values($htmlTranslationTable), $response); + + if (strlen(trim($response)) > 0) { + $xml = simplexml_load_string($response); + if (!is_object($xml)) { + $errorTitle = Mage::helper('usa')->__('Response is in the wrong format'); + } + if (is_object($xml) && ((isset($xml->Response->Status->ActionStatus) + && $xml->Response->Status->ActionStatus == 'Failure') + || isset($xml->GetQuoteResponse->Note->Condition)) + ) { + if (isset($xml->Response->Status->Condition)) { + $nodeCondition = $xml->Response->Status->Condition; + } + + $code = isset($nodeCondition->ConditionCode) ? (string)$nodeCondition->ConditionCode : 0; + $data = isset($nodeCondition->ConditionData) ? (string)$nodeCondition->ConditionData : ''; + $this->_errors[$code] = Mage::helper('usa')->__('Error #%s : %s', $code, $data); + } elseif (is_object($xml) && is_object($xml->AWBInfo)) { + foreach ($xml->AWBInfo as $awbinfo) { + $awbinfoData = array(); + $trackNum = isset($awbinfo->AWBNumber) ? (string)$awbinfo->AWBNumber : ''; + if (!is_object($awbinfo) || !$awbinfo->ShipmentInfo) { + $this->_errors[$trackNum] = Mage::helper('usa')->__('Unable to retrieve tracking'); + continue; + } + $shipmentInfo = $awbinfo->ShipmentInfo; + + if ($shipmentInfo->ShipmentDesc) { + $awbinfoData['service'] = (string)$shipmentInfo->ShipmentDesc; + } + + $awbinfoData['weight'] = (string)$shipmentInfo->Weight . ' ' . (string)$shipmentInfo->WeightUnit; + + $packageProgress = array(); + if (isset($shipmentInfo->ShipmentEvent)) { + foreach ($shipmentInfo->ShipmentEvent as $shipmentEvent) { + $shipmentEventArray = array(); + $shipmentEventArray['activity'] = (string)$shipmentEvent->ServiceEvent->EventCode + . ' ' . (string)$shipmentEvent->ServiceEvent->Description; + $shipmentEventArray['deliverydate'] = (string)$shipmentEvent->Date; + $shipmentEventArray['deliverytime'] = (string)$shipmentEvent->Time; + $shipmentEventArray['deliverylocation'] = (string)$shipmentEvent->ServiceArea->Description + . ' [' . (string)$shipmentEvent->ServiceArea->ServiceAreaCode . ']'; + $packageProgress[] = $shipmentEventArray; + } + $awbinfoData['progressdetail'] = $packageProgress; + } + $resultArr[$trackNum] = $awbinfoData; + } + } + } + + $result = Mage::getModel('shipping/tracking_result'); + + if (!empty($resultArr)) { + foreach ($resultArr as $trackNum => $data) { + $tracking = Mage::getModel('shipping/tracking_result_status'); + $tracking->setCarrier($this->_code); + $tracking->setCarrierTitle($this->getConfigData('title')); + $tracking->setTracking($trackNum); + $tracking->addData($data); + $result->append($tracking); + } + } + + if (!empty($this->_errors) || empty($resultArr)) { + $resultArr = !empty($this->_errors) ? $this->_errors : $trackings; + foreach ($resultArr as $trackNum => $err) { + $error = Mage::getModel('shipping/tracking_result_error'); + $error->setCarrier($this->_code); + $error->setCarrierTitle($this->getConfigData('title')); + $error->setTracking(!empty($this->_errors) ? $trackNum : $err); + $error->setErrorMessage(!empty($this->_errors) ? $err : $errorTitle); + $result->append($error); + } + } + + $this->_result = $result; + } + + /** + * Get final price for shipping method with handling fee per package + * + * @param float $cost + * @param string $handlingType + * @param float $handlingFee + * @return float + */ + protected function _getPerpackagePrice($cost, $handlingType, $handlingFee) + { + if ($handlingType == Mage_Shipping_Model_Carrier_Abstract::HANDLING_TYPE_PERCENT) { + return $cost + ($cost * $this->_numBoxes * $handlingFee / 100); + } + + return $cost + $this->_numBoxes * $handlingFee; + } +} diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Contenttype.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Contenttype.php new file mode 100644 index 0000000000..755a1c0f64 --- /dev/null +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Contenttype.php @@ -0,0 +1,50 @@ + + */ +class Mage_Usa_Model_Shipping_Carrier_Dhl_International_Source_Contenttype +{ + /** + * Returns array to be used in multiselect on back-end + * + * @return array + */ + public function toOptionArray() + { + return array( + array('label' => Mage::helper('usa')->__('Documents'), + 'value' => Mage_Usa_Model_Shipping_Carrier_Dhl_International::DHL_CONTENT_TYPE_DOC), + array('label' => Mage::helper('usa')->__('Non documents'), + 'value' => Mage_Usa_Model_Shipping_Carrier_Dhl_International::DHL_CONTENT_TYPE_NON_DOC), + ); + } +} diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Freemethod.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Freemethod.php new file mode 100644 index 0000000000..5e3b4b843d --- /dev/null +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Freemethod.php @@ -0,0 +1,41 @@ + '', 'label' => Mage::helper('shipping')->__('None'))); + return $arr; + } +} diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method.php new file mode 100644 index 0000000000..8eedc1c94b --- /dev/null +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method.php @@ -0,0 +1,43 @@ +getDhlProducts() as $code => $title) { + $arr[] = array('value' => $code, 'label' => $title); + } + return $arr; + } +} diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Abstract.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Abstract.php new file mode 100644 index 0000000000..3b2939e7b3 --- /dev/null +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Abstract.php @@ -0,0 +1,72 @@ + + */ +abstract class Mage_Usa_Model_Shipping_Carrier_Dhl_International_Source_Method_Abstract +{ + /** + * Carrier Product Type Indicator + * + * @var string $_contentType + */ + protected $_contentType; + + /** + * Show 'none' in methods list or not; + * + * @var bool + */ + protected $_noneMethod = false; + + /** + * Returns array to be used in multiselect on back-end + * + * @return array + */ + public function toOptionArray() + { + /* @var $carrierModel Mage_Usa_Model_Shipping_Carrier_Dhl_International */ + $carrierModel = Mage::getSingleton('usa/shipping_carrier_dhl_international'); + $dhlProducts = $carrierModel->getDhlProducts($this->_contentType); + + $options = array(); + foreach ($dhlProducts as $code => $title) { + $options[] = array('value' => $code, 'label' => $title); + } + + if ($this->_noneMethod) { + array_unshift($options, array('value' => '', 'label' => Mage::helper('usa')->__('None'))); + } + + return $options; + } +} diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/All.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/All.php new file mode 100644 index 0000000000..3d6b0bdf12 --- /dev/null +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/All.php @@ -0,0 +1,46 @@ + + */ +class Mage_Usa_Model_Shipping_Carrier_Dhl_International_Source_Method_All +{ + public function toOptionArray() + { + /* @var $dhl Mage_Usa_Model_Shipping_Carrier_Dhl_International */ + $dhl = Mage::getModel('usa/shipping_carrier_dhl_international'); + $options = array(); + foreach ($dhl->getDhlProducts(Mage_Usa_Model_Shipping_Carrier_Dhl_International::DOC_EVERYTHING) as $k => $v) { + $options[] = array('value' => $k, 'label' => $v); + } + return $options; + } +} diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Doc.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Doc.php new file mode 100644 index 0000000000..e27c6b0842 --- /dev/null +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Doc.php @@ -0,0 +1,43 @@ + + */ +class Mage_Usa_Model_Shipping_Carrier_Dhl_International_Source_Method_Doc + extends Mage_Usa_Model_Shipping_Carrier_Dhl_International_Source_Method_Abstract +{ + /** + * Carrier Product Type Indicator + * + * @var string $_contentType + */ + protected $_contentType = Mage_Usa_Model_Shipping_Carrier_Dhl_International::DHL_CONTENT_TYPE_DOC; +} diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Freedoc.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Freedoc.php new file mode 100644 index 0000000000..8e190f334f --- /dev/null +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Freedoc.php @@ -0,0 +1,50 @@ + + */ +class Mage_Usa_Model_Shipping_Carrier_Dhl_International_Source_Method_Freedoc + extends Mage_Usa_Model_Shipping_Carrier_Dhl_International_Source_Method_Abstract +{ + /** + * Carrier Product Type Indicator + * + * @var string $_contentType + */ + protected $_contentType = Mage_Usa_Model_Shipping_Carrier_Dhl_International::DHL_CONTENT_TYPE_DOC; + + /** + * Show 'none' in methods list or not; + * + * @var bool + */ + protected $_noneMethod = true; +} diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Freenondoc.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Freenondoc.php new file mode 100644 index 0000000000..d01a2ef9a8 --- /dev/null +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Freenondoc.php @@ -0,0 +1,50 @@ + + */ +class Mage_Usa_Model_Shipping_Carrier_Dhl_International_Source_Method_Freenondoc + extends Mage_Usa_Model_Shipping_Carrier_Dhl_International_Source_Method_Abstract +{ + /** + * Carrier Product Type Indicator + * + * @var string $_contentType + */ + protected $_contentType = Mage_Usa_Model_Shipping_Carrier_Dhl_International::DHL_CONTENT_TYPE_NON_DOC; + + /** + * Show 'none' in methods list or not; + * + * @var bool + */ + protected $_noneMethod = true; +} diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Nondoc.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Nondoc.php new file mode 100644 index 0000000000..784098a290 --- /dev/null +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Nondoc.php @@ -0,0 +1,43 @@ + + */ +class Mage_Usa_Model_Shipping_Carrier_Dhl_International_Source_Method_Nondoc + extends Mage_Usa_Model_Shipping_Carrier_Dhl_International_Source_Method_Abstract +{ + /** + * Carrier Product Type Indicator + * + * @var string $_contentType + */ + protected $_contentType = Mage_Usa_Model_Shipping_Carrier_Dhl_International::DHL_CONTENT_TYPE_NON_DOC; +} diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Size.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Size.php new file mode 100644 index 0000000000..a2f08177e1 --- /dev/null +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Size.php @@ -0,0 +1,51 @@ + + */ +class Mage_Usa_Model_Shipping_Carrier_Dhl_International_Source_Method_Size +{ + /** + * Returns array to be used in multiselect on back-end + * + * @return array + */ + public function toOptionArray() + { + $unitArr = Mage::getSingleton('usa/shipping_carrier_dhl_international')->getCode('size'); + + $returnArr = array(); + foreach ($unitArr as $key => $val) { + $returnArr[] = array('value' => $key, 'label' => $val); + } + return $returnArr; + } +} diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Unitofmeasure.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Unitofmeasure.php new file mode 100644 index 0000000000..218feb7f64 --- /dev/null +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Unitofmeasure.php @@ -0,0 +1,51 @@ + + */ +class Mage_Usa_Model_Shipping_Carrier_Dhl_International_Source_Method_Unitofmeasure +{ + /** + * Returns array to be used in multiselect on back-end + * + * @return array + */ + public function toOptionArray() + { + $unitArr = Mage::getSingleton('usa/shipping_carrier_dhl_international')->getCode('unit_of_measure'); + + $returnArr = array(); + foreach ($unitArr as $key => $val) { + $returnArr[] = array('value' => $key, 'label' => $val); + } + return $returnArr; + } +} diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php index d567b6e3c3..91833f666a 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php @@ -261,6 +261,8 @@ public function setRequest(Mage_Shipping_Model_Rate_Request $request) $r->setIsReturn($request->getIsReturn()); + $r->setBaseSubtotalInclTax($request->getBaseSubtotalInclTax()); + $this->_rawRequest = $r; return $this; @@ -395,8 +397,7 @@ protected function _prepareRateResponse($response) foreach ($response->RateReplyDetails as $rate) { $serviceName = (string)$rate->ServiceType; if (in_array($serviceName, $allowedMethods)) { - $amount = (string)$rate->RatedShipmentDetails[0] - ->ShipmentRateDetail->TotalNetCharge->Amount; + $amount = $this->_getRateAmountOriginBased($rate); $costArr[$serviceName] = $amount; $priceArr[$serviceName] = $this->getMethodPrice($amount, $serviceName); } @@ -406,7 +407,7 @@ protected function _prepareRateResponse($response) $rate = $response->RateReplyDetails; $serviceName = (string)$rate->ServiceType; if (in_array($serviceName, $allowedMethods)) { - $amount = (string)$rate->RatedShipmentDetails[0]->ShipmentRateDetail->TotalNetCharge->Amount; + $amount = $this->_getRateAmountOriginBased($rate); $costArr[$serviceName] = $amount; $priceArr[$serviceName] = $this->getMethodPrice($amount, $serviceName); } @@ -438,6 +439,31 @@ protected function _prepareRateResponse($response) return $result; } + /** + * Get origin based amount form response of rate estimation + * + * @param stdClass $rate + * @return null|float + */ + protected function _getRateAmountOriginBased($rate) + { + $amount = null; + if (is_object($rate)) { + foreach($rate->RatedShipmentDetails as $ratedShipmentDetail) { + $shipmentRateDetail = $ratedShipmentDetail->ShipmentRateDetail; + // The "RATED..." rates are expressed in the currency of the origin country + if ((string)$shipmentRateDetail->RateType == 'RATED_ACCOUNT_SHIPMENT') { + $amount = (string)$shipmentRateDetail->TotalNetCharge->Amount; + } + } + if (is_null($amount)) { + $amount = (string)$rate->RatedShipmentDetails[0]->ShipmentRateDetail + ->TotalNetCharge->Amount; + } + } + return $amount; + } + /** * Set free method request * @@ -698,6 +724,11 @@ public function getCode($type, $code='') 'STANDARD_OVERNIGHT', 'PRIORITY_OVERNIGHT', 'FIRST_OVERNIGHT', + 'FEDEX_FREIGHT', + 'FEDEX_1_DAY_FREIGHT', + 'FEDEX_2_DAY_FREIGHT', + 'FEDEX_3_DAY_FREIGHT', + 'FEDEX_NATIONAL_FREIGHT', ) ), 'from_us' => array( diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php index 3819a2e6c8..2ce88521d1 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php @@ -272,6 +272,8 @@ public function setRequest(Mage_Shipping_Model_Rate_Request $request) $r->setIsReturn($request->getIsReturn()); + $r->setBaseSubtotalInclTax($request->getBaseSubtotalInclTax()); + $this->_rawRequest = $r; return $this; @@ -703,6 +705,7 @@ public function getCode($type, $code='') '14', // Next Day Air Early AM '02', // 2nd Day Air '59', // 2nd Day Air AM + '13', // Next Day Air Saver ) ), 'from_us' => array( @@ -1006,10 +1009,7 @@ protected function _parseXmlResponse($xmlResponse) if (in_array($responseCurrencyCode, $allowedCurrencies)) { $cost = (float) $cost * $this->_getBaseCurrencyRate($responseCurrencyCode); } else { - $errorTitle = Mage::helper('directory') - ->__('Can\'t convert rate from "%s-%s".', - $responseCurrencyCode, - $this->_request->getPackageCurrency()->getCode()); + $errorTitle = Mage::helper('directory')->__('Can\'t convert rate from "%s-%s".', $responseCurrencyCode, $this->_request->getPackageCurrency()->getCode()); $error = Mage::getModel('shipping/rate_result_error'); $error->setCarrier('ups'); $error->setCarrierTitle($this->getConfigData('title')); @@ -1806,4 +1806,38 @@ protected function _getDeliveryConfirmationLevel($countyDest = null) { return self::DELIVERY_CONFIRMATION_SHIPMENT; } + + /** + * Return items for further shipment rate evaluation. We need to pass children of a bundle instead passing the + * bundle itself, otherwise we may not get a rate at all (e.g. when total weight of a bundle exceeds max weight + * despite each item by itself is not) + * + * @param Mage_Shipping_Model_Rate_Request $request + * @return array + */ + public function getAllItems(Mage_Shipping_Model_Rate_Request $request) + { + $items = array(); + if ($request->getAllItems()) { + foreach ($request->getAllItems() as $item) { + /* @var $item Mage_Sales_Model_Quote_Item */ + if ($item->getProduct()->isVirtual() || $item->getParentItem()) { + // Don't process children here - we will process (or already have processed) them below + continue; + } + + if ($item->getHasChildren() && $item->isShipSeparately()) { + foreach ($item->getChildren() as $child) { + if (!$child->getFreeShipping() && !$child->getProduct()->isVirtual()) { + $items[] = $child; + } + } + } else { + // Ship together - count compound item as one solid + $items[] = $item; + } + } + } + return $items; + } } diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps.php index 810fbfece2..3685d97bc3 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps.php @@ -287,6 +287,8 @@ public function setRequest(Mage_Shipping_Model_Rate_Request $request) $r->setValue($request->getPackageValue()); $r->setValueWithDiscount($request->getPackageValueWithDiscount()); + $r->setBaseSubtotalInclTax($request->getBaseSubtotalInclTax()); + $this->_rawRequest = $r; return $this; diff --git a/app/code/core/Mage/Usa/etc/config.xml b/app/code/core/Mage/Usa/etc/config.xml index aeed1122db..2f14f1e17b 100644 --- a/app/code/core/Mage/Usa/etc/config.xml +++ b/app/code/core/Mage/Usa/etc/config.xml @@ -59,6 +59,9 @@ Mage_Usa_Model_Shipping_Carrier_Dhl + + Mage_Usa_Model_Shipping_Carrier_Dhl_International + @@ -110,7 +113,7 @@ P - DHL + DHL (Deprecated) This shipping method is currently unavailable. If you would like to ship using this shipping method, please contact us. 150 F @@ -191,6 +194,25 @@ F O + + usa/shipping_carrier_dhl_international + + 0 + DHL + 0 + 1,2,3,4,5,6,7,8,9,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y + G + https://xmlpitest-ea.dhl.com/XMLShippingServlet + + + N + This shipping method is currently unavailable. If you would like to ship using this shipping method, please contact us. + 1 + K + R + F + O + diff --git a/app/code/core/Mage/Usa/etc/dhl/international/countries.xml b/app/code/core/Mage/Usa/etc/dhl/international/countries.xml new file mode 100644 index 0000000000..24deccbff6 --- /dev/null +++ b/app/code/core/Mage/Usa/etc/dhl/international/countries.xml @@ -0,0 +1,1553 @@ + + + + + EUR + KG + CM + Andorra + + + AED + KG + CM + AP + United Arab Emirates + + + AFN + KG + CM + AP + Afghanistan + + + XCD + KG + CM + AM + Antigua + + + XCD + KG + CM + AM + Anguilla + + + EUR + KG + CM + AP + Albania + + + AMD + KG + CM + AP + Armenia + + + ANG + KG + CM + Netherlands Antilles + + + AOA + KG + CM + Angola + + + ARS + KG + CM + AM + Argentina + + + USD + LB + IN + American Samoa + + + EUR + KG + CM + EA + Austria + + + AUD + KG + CM + AP + Australia + + + AWG + KG + CM + AM + Aruba + + + AZM + KG + CM + Azerbaijan + + + BAM + KG + CM + AP + Bosnia and Herzegovina + + + BBD + KG + CM + AM + Barbados + + + BDT + KG + CM + AP + Bangladesh + + + EUR + KG + CM + EA + Belgium + + + XOF + KG + CM + Burkina Faso + + + BGN + KG + CM + EA + Bulgaria + + + BHD + KG + CM + AP + Bahrain + + + BIF + KG + CM + Burundi + + + XOF + KG + CM + Benin + + + BMD + KG + CM + AM + Bermuda + + + BND + KG + CM + Brunei + + + BOB + KG + CM + AM + Bolivia + +
+ BRL + KG + CM + AM + Brazil +
+ + BSD + KG + CM + AM + Bahamas + + + BTN + KG + CM + Bhutan + + + BWP + KG + CM + Botswana + + + BYR + KG + CM + AP + Belarus + + + BZD + KG + CM + Belize + + + CAD + KG + CM + AM + Canada + + + CDF + KG + CM + Congo, The Democratic Republic of + + + XAF + KG + CM + Central African Republic + + + XAF + KG + CM + Congo + + + CHF + KG + CM + EA + Switzerland + + + XOF + KG + CM + AP + Cote d'Ivoire + + + NZD + KG + CM + Cook Islands + + + CLP + KG + CM + AM + Chile + + + XAF + KG + CM + Cameroon + + + CNY + KG + CM + AP + China, People's Republic + + + COP + KG + CM + AM + Colombia + + + CRC + KG + CM + AM + Costa Rica + + + CUP + KG + CM + Cuba + + + CVE + KG + CM + Cape Verde + + + EUR + KG + CM + AP + Cyprus + + + CZK + KG + CM + EA + Czech Republic, The + + + EUR + KG + CM + EA + Germany + + + DJF + KG + CM + Djibouti + + + DKK + KG + CM + EA + Denmark + + + XCD + KG + CM + AM + Dominica + + + DOP + KG + CM + AM + Dominican Rep. + + + DZD + KG + CM + AP + Algeria + + + USD + KG + CM + AM + Ecuador + + + EEK + KG + CM + EA + Estonia + + + EGP + KG + CM + AP + Egypt + + + ERN + KG + CM + Eritrea + + + EUR + KG + CM + EA + Spain + + + ETB + KG + CM + Ethiopia + + + EUR + KG + CM + EA + Finland + + + FJD + KG + CM + AP + Fiji + + + FKP + KG + CM + Falkland Islands + + + USD + LB + IN + MICRONESIA, FEDERATED STATES OF + + + DKK + KG + CM + Faroe Islands + + + EUR + KG + CM + EA + France + + + XAF + KG + CM + Gabon + + + GBP + KG + CM + EA + United Kingdom + + + XCD + KG + CM + AM + Grenada + + + GEL + KG + CM + Georgia + + + EUR + KG + CM + AM + French Guyana + + + GBP + KG + CM + Guernsey + + + GHS + KG + CM + AP + Ghana + + + GIP + KG + CM + Gibraltar + + + DKK + KG + CM + Greenland + + + GMD + KG + CM + Gambia + + + GNF + KG + CM + Guinea Republic + + + EUR + KG + CM + AM + Guadeloupe + + + XAF + KG + CM + Guinea-Equatorial + + + EUR + KG + CM + EA + Greece + + + GTQ + KG + CM + AM + Guatemala + + + USD + LB + IN + AM + Guam + + + GWP + KG + CM + Guinea-Bissau + + + GYD + KG + CM + AM + Guyana (British) + + + HKD + KG + CM + AP + Hong Kong + + + HNL + KG + CM + AM + Honduras + +
+ HRK + KG + CM + AP + Croatia + + + HTG + KG + CM + AM + Haiti + + + HUF + KG + CM + EA + Hungary + + + EUR + KG + CM + Canary Islands, The + + + IDR + KG + CM + AP + Indonesia + + + EUR + KG + CM + EA + Ireland, Republic Of + + + ILS + KG + CM + AP + Israel + + + INR + KG + CM + AP + India + + + IQD + KG + CM + Iraq + + + IRR + KG + CM + AP + Iran (Islamic Republic of) + + + ISK + KG + CM + EA + Iceland + + + EUR + KG + CM + EA + Italy + + + GBP + KG + CM + Jersey + + + JMD + KG + CM + AM + Jamaica + + + JOD + KG + CM + AP + Jordan + + + JPY + KG + CM + AP + Japan + + + KES + KG + CM + AP + Kenya + + + KGS + KG + CM + AP + Kyrgyzstan + + + KHR + KG + CM + Cambodia + + + AUD + KG + CM + Kiribati + + + KMF + KG + CM + Comoros + + + XCD + KG + CM + AM + St. Kitts + + + KPW + KG + CM + Korea, The D.P.R of + + + KRW + KG + CM + AP + Korea, Republic Of + + + EUR + KG + CM + Kosovo + + + KWD + KG + CM + AP + Kuwait + + + KYD + KG + CM + AM + Cayman Islands + + + KZT + KG + CM + AP + Kazakhstan + + + LAK + KG + CM + Lao People's Democratic Republic + + + USD + KG + CM + AP + Lebanon + + + XCD + KG + CM + AM + St. Lucia + +
  • + CHF + KG + CM + Liechtenstein +
  • + + LKR + KG + CM + AP + Sri Lanka + + + LRD + KG + CM + Liberia + + + LSL + KG + CM + Lesotho + + + LTL + KG + CM + EA + Lithuania + + + EUR + KG + CM + EA + Luxembourg + + + LVL + KG + CM + EA + Latvia + + + LYD + KG + CM + Libya + + + MAD + KG + CM + AP + Morocco + + + EUR + KG + CM + Monaco + + + MDL + KG + CM + AP + Moldova, Republic Of + + + EUR + KG + CM + Montenegro, Republic of + + + MGA + KG + CM + Madagascar + + + USD + LB + IN + Marshall Islands + + + MKD + KG + CM + AP + Macedonia, Rep. of (FYROM) + + + XOF + KG + CM + Mali + + + USD + KG + CM + AP + Myanmar + + + MNT + KG + CM + Mongolia + + + MOP + KG + CM + Macau + + + USD + LB + IN + Saipan + + + EUR + KG + CM + AM + Martinique + + + MRO + KG + CM + Mauritania + + + XCD + KG + CM + Montserrat + + + EUR + KG + CM + AP + Malta + + + MUR + KG + CM + AP + Mauritius + + + MVR + KG + CM + Maldives + + + MWK + KG + CM + Malawi + + + MXN + KG + CM + AM + Mexico + + + MYR + KG + CM + AP + Malaysia + + + MZN + KG + CM + Mozambique + + + ZAR + KG + CM + AP + Namibia + + + XPF + KG + CM + New Caledonia + + + XOF + KG + CM + Niger + + + NGN + KG + CM + AP + Nigeria + + + NIO + KG + CM + AM + Nicaragua + + + EUR + KG + CM + EA + Netherlands, The + + + NOK + KG + CM + EA + Norway + + + NPR + KG + CM + AP + Nepal + + + AUD + KG + CM + Nauru, Republic Of + + + NZD + KG + CM + Niue + + + NZD + KG + CM + AP + New Zealand + + + OMR + KG + CM + AP + Oman + + + PAB + KG + CM + AM + Panama + + + PEN + KG + CM + AM + Peru + + + XPF + KG + CM + Tahiti + + + PGK + KG + CM + Papua New Guinea + + + PHP + KG + CM + AP + Philippines, The + + + PKR + KG + CM + AP + Pakistan + + + PLN + KG + CM + EA + Poland + + + USD + LB + IN + AM + Puerto Rico + + + EUR + KG + CM + EA + Portugal + + + USD + KG + CM + Palau + + + PYG + KG + CM + AM + Paraguay + + + QAR + KG + CM + AP + Qatar + + + EUR + KG + CM + AP + Reunion, Island Of + + + RON + KG + CM + EA + Romania + + + RSD + KG + CM + AP + Serbia, Republic of + + + RUB + KG + CM + AP + Russian Federation, The + + + RWF + KG + CM + Rwanda + + + SAR + KG + CM + AP + Saudi Arabia + + + SBD + KG + CM + Solomon Islands + + + SCR + KG + CM + Seychelles + + + SDG + KG + CM + AP + Sudan + + + SEK + KG + CM + EA + Sweden + + + SGD + KG + CM + AP + Singapore + + + EUR + KG + CM + EA + Slovenia + + + EUR + KG + CM + EA + Slovakia + + + SLL + KG + CM + Sierra Leone + + + EUR + KG + CM + San Marino + + + XOF + KG + CM + AP + Senegal + + + SOS + KG + CM + Somalia + + + SRD + KG + CM + AM + Suriname + + + STD + KG + CM + Sao Tome and Principe + + + USD + KG + CM + AM + El Salvador + + + SYP + KG + CM + Syria + + + SZL + KG + CM + Swaziland + + + USD + KG + CM + AM + Turks and Caicos Islands + +
    + XAF + KG + CM + Chad + + THB + KG + CM + AP + Thailand +
    + + + + + + + + + + + + +
      + + +
    + + + + +
    +
    + + +
    +
    + + + + + +getUrl('*/*/rollback'); + $backupUrl = $this->getUrl('*/*/create'); +?> + + diff --git a/app/design/adminhtml/default/default/template/backup/list.phtml b/app/design/adminhtml/default/default/template/backup/list.phtml index bc4dad963d..1a3183d636 100644 --- a/app/design/adminhtml/default/default/template/backup/list.phtml +++ b/app/design/adminhtml/default/default/template/backup/list.phtml @@ -28,8 +28,13 @@ - +

    __('Backups') ?>

    getCreateButtonHtml(); ?> + getCreateSnapshotButtonHtml(); ?> + getCreateMediaBackupButtonHtml(); ?> + getCreateButtonHtml(); ?> +
    getGridHtml() ?> +getDialogsHtml() ?> diff --git a/app/design/adminhtml/default/default/template/captcha/zend.phtml b/app/design/adminhtml/default/default/template/captcha/zend.phtml new file mode 100644 index 0000000000..5ba346aff9 --- /dev/null +++ b/app/design/adminhtml/default/default/template/captcha/zend.phtml @@ -0,0 +1,57 @@ + +getCaptchaModel() ?> + +
    +
    +
    +
    + +
    +
    + <?php echo $this->__('Reload captcha') ?> + +
    +
    +isCaseSensitive()) :?> +
    +

    __('Attention: Captcha is case sensitive.') ?>

    +
    + + diff --git a/app/design/adminhtml/default/default/template/catalog/product/attribute/js.phtml b/app/design/adminhtml/default/default/template/catalog/product/attribute/js.phtml index 6894d7458b..f413e0729f 100644 --- a/app/design/adminhtml/default/default/template/catalog/product/attribute/js.phtml +++ b/app/design/adminhtml/default/default/template/catalog/product/attribute/js.phtml @@ -117,26 +117,33 @@ function bindAttributeInputType() setRowVisibility('is_wysiwyg_enabled', false); setRowVisibility('is_html_allowed_on_front', false); - if ($('frontend_input').value=='textarea') { - setRowVisibility('is_wysiwyg_enabled', true); - if($('is_wysiwyg_enabled').value == '0'){ + + switch ($('frontend_input').value) { + case 'textarea': + setRowVisibility('is_wysiwyg_enabled', true); + if($('is_wysiwyg_enabled').value == '0'){ + setRowVisibility('is_html_allowed_on_front', true); + $('is_html_allowed_on_front').disabled = false; + } + $('frontend_class').value = ''; + $('frontend_class').disabled = true; + break; + case 'text': setRowVisibility('is_html_allowed_on_front', true); $('is_html_allowed_on_front').disabled = false; - } - $('frontend_class').value = ''; - $('frontend_class').disabled = true; - } - else if($('frontend_input').value=='text'){ - setRowVisibility('is_html_allowed_on_front', true); - $('is_html_allowed_on_front').disabled = false; - if (!$('frontend_class').getAttribute('readonly')) { - $('frontend_class').disabled = false; - } - } - else{ - $('frontend_class').value = ''; - $('frontend_class').disabled = true; + if (!$('frontend_class').getAttribute('readonly')) { + $('frontend_class').disabled = false; + } + break; + case 'select': + case 'multiselect': + setRowVisibility('is_html_allowed_on_front', true); + $('is_html_allowed_on_front').disabled = false; + break; + default: + $('frontend_class').value = ''; + $('frontend_class').disabled = true; } switchIsFilterable(); diff --git a/app/design/adminhtml/default/default/template/catalog/product/attribute/set/main.phtml b/app/design/adminhtml/default/default/template/catalog/product/attribute/set/main.phtml index 4438cef1f5..cdb511c6e1 100644 --- a/app/design/adminhtml/default/default/template/catalog/product/attribute/set/main.phtml +++ b/app/design/adminhtml/default/default/template/catalog/product/attribute/set/main.phtml @@ -229,12 +229,12 @@ } if( editSet.SystemNodesExists(editSet.currentNode) ) { - alert('__('This group contains system attributes. Please move system attributes to another group and try again.') ?>'); + alert('jsQuoteEscape(Mage::helper('catalog')->__('This group contains system attributes. Please move system attributes to another group and try again.')) ?>'); return; } if (editSet.ConfigurableNodeExists(editSet.currentNode)) { - alert('__('This group contains attributes, used in configurable products. Please move these attributes to another group and try again.') ?>'); + alert('jsQuoteEscape(Mage::helper('catalog')->__('This group contains attributes, used in configurable products. Please move these attributes to another group and try again.')) ?>'); return; } @@ -362,7 +362,7 @@ }, failure : function(o) { - alert('__('Unable to complete this request.') ?>'); + alert('jsQuoteEscape(Mage::helper('catalog')->__('Unable to complete this request.')) ?>'); }, groupBeforeMove : function(tree, nodeThis, oldParent, newParent) { @@ -377,11 +377,11 @@ rightBeforeAppend : function(tree, nodeThis, node, newParent) { if (node.attributes.is_user_defined == 0) { - alert('__('You cannot remove system attribute from this set.') ?>'); + alert('jsQuoteEscape(Mage::helper('catalog')->__('You cannot remove system attribute from this set.')) ?>'); return false; } else if (node.attributes.is_configurable == 1) { - alert('__('This attribute is used in configurable products. You cannot remove it from the attribute set.') ?>'); + alert('jsQuoteEscape(Mage::helper('catalog')->__('This attribute is used in configurable products. You cannot remove it from the attribute set.')) ?>'); return false; } else { @@ -396,11 +396,11 @@ } if (node.attributes.is_user_defined == 0) { - alert('__('You cannot remove system attribute from this set.') ?>'); + alert('jsQuoteEscape(Mage::helper('catalog')->__('You cannot remove system attribute from this set.')) ?>'); return false; } else if (node.attributes.is_configurable == 1) { - alert('__('This attribute is used in configurable products. You cannot remove it from the attribute set.') ?>'); + alert('jsQuoteEscape(Mage::helper('catalog')->__('This attribute is used in configurable products. You cannot remove it from the attribute set.')) ?>'); return false; } else { diff --git a/app/design/adminhtml/default/default/template/catalog/product/edit/action/inventory.phtml b/app/design/adminhtml/default/default/template/catalog/product/edit/action/inventory.phtml index b62594e751..768e6b28b9 100644 --- a/app/design/adminhtml/default/default/template/catalog/product/edit/action/inventory.phtml +++ b/app/design/adminhtml/default/default/template/catalog/product/edit/action/inventory.phtml @@ -62,7 +62,7 @@ function toggleValueElementsWithCheckbox(checkbox) { - __('[GLOBAL]') ?> + __('[GLOBAL]') ?> @@ -71,7 +71,7 @@ function toggleValueElementsWithCheckbox(checkbox) { - __('[GLOBAL]') ?> + __('[GLOBAL]') ?> @@ -81,7 +81,7 @@ function toggleValueElementsWithCheckbox(checkbox) { - __('[GLOBAL]') ?> + __('[GLOBAL]') ?> @@ -91,7 +91,7 @@ function toggleValueElementsWithCheckbox(checkbox) { - __('[GLOBAL]') ?> + __('[GLOBAL]') ?> @@ -101,7 +101,7 @@ function toggleValueElementsWithCheckbox(checkbox) { - __('[GLOBAL]') ?> + __('[GLOBAL]') ?> @@ -112,7 +112,7 @@ function toggleValueElementsWithCheckbox(checkbox) { - __('[GLOBAL]') ?> + __('[GLOBAL]') ?> @@ -127,7 +127,7 @@ function toggleValueElementsWithCheckbox(checkbox) { - __('[GLOBAL]') ?> + __('[GLOBAL]') ?> @@ -137,7 +137,7 @@ function toggleValueElementsWithCheckbox(checkbox) { - __('[GLOBAL]') ?> + __('[GLOBAL]') ?> @@ -151,7 +151,7 @@ function toggleValueElementsWithCheckbox(checkbox) { - __('[GLOBAL]') ?> + __('[GLOBAL]') ?> @@ -162,7 +162,7 @@ function toggleValueElementsWithCheckbox(checkbox) { - __('[GLOBAL]') ?> + __('[GLOBAL]') ?> @@ -174,7 +174,7 @@ function toggleValueElementsWithCheckbox(checkbox) { - __('[GLOBAL]') ?> + __('[GLOBAL]') ?>
    diff --git a/app/design/adminhtml/default/default/template/catalog/product/edit/options/type/file.phtml b/app/design/adminhtml/default/default/template/catalog/product/edit/options/type/file.phtml index 72b610e328..05c0e499b1 100644 --- a/app/design/adminhtml/default/default/template/catalog/product/edit/options/type/file.phtml +++ b/app/design/adminhtml/default/default/template/catalog/product/edit/options/type/file.phtml @@ -38,7 +38,7 @@ OptionTemplateFile = ''+ ''+ ''+ getCanReadPrice() !== false) : ?> - '' + + '' + '' + '' + diff --git a/app/design/adminhtml/default/default/template/catalog/product/edit/price/group.phtml b/app/design/adminhtml/default/default/template/catalog/product/edit/price/group.phtml new file mode 100644 index 0000000000..38a353cda7 --- /dev/null +++ b/app/design/adminhtml/default/default/template/catalog/product/edit/price/group.phtml @@ -0,0 +1,169 @@ + +getElement()->getHtmlId(); +$_htmlClass = $this->getElement()->getClass(); +$_htmlName = $this->getElement()->getName(); +$_readonly = $this->getElement()->getReadonly(); +$_priceValueValidation = $this->getPriceValidation('validate-greater-than-zero'); + +$_showWebsite= $this->isMultiWebsites(); +?> + + + diff --git a/app/design/adminhtml/default/default/template/catalog/product/edit/price/tier.phtml b/app/design/adminhtml/default/default/template/catalog/product/edit/price/tier.phtml index 7af1fe4e28..877844d540 100644 --- a/app/design/adminhtml/default/default/template/catalog/product/edit/price/tier.phtml +++ b/app/design/adminhtml/default/default/template/catalog/product/edit/price/tier.phtml @@ -80,11 +80,11 @@ var tierPriceRowTemplate = '' + '' + '' + + ' __("and above")?>' + '' + '' + + '' + ''; var tierPriceControl = { diff --git a/app/design/adminhtml/default/default/template/catalog/product/edit/super/config.phtml b/app/design/adminhtml/default/default/template/catalog/product/edit/super/config.phtml index 8bc7ffd9f5..9c679082f6 100644 --- a/app/design/adminhtml/default/default/template/catalog/product/edit/super/config.phtml +++ b/app/design/adminhtml/default/default/template/catalog/product/edit/super/config.phtml @@ -72,7 +72,7 @@
    - isReadonly()):?> disabled="disabled" class="input-text attribute-label required-entry template no-display" value="'{{label}}'" readonly="label" /> + isAttributesConfigurationReadonly()): ?> disabled="disabled" class="input-text attribute-label required-entry template no-display" value="'{{label}}'" readonly="label" />
      @@ -87,17 +87,17 @@
      __('Price:') ?> - isReadonly() || $this->getCanEditPrice() === false):?> disabled="disabled" class="input-text attribute-price validate-number template no-display" value="'{{pricing_value}}'"/> + isAttributesPricesReadonly() || $this->getCanEditPrice() === false): ?> disabled="disabled" class="input-text attribute-price validate-number template no-display" value="'{{pricing_value}}'"/>
      -  isAttributesPricesReadonly() || $this->getCanEditPrice() === false): ?> disabled="disabled" >
      getShowUseDefaultPrice()):?>
      -  isReadonly() || $this->getCanEditPrice() === false):?> disabled="disabled" class="attribute-use-default-value"> +  isAttributesPricesReadonly() || $this->getCanEditPrice() === false): ?> disabled="disabled" class="attribute-use-default-value">
      diff --git a/app/design/adminhtml/default/default/template/catalog/product/price.phtml b/app/design/adminhtml/default/default/template/catalog/product/price.phtml index 991737ddb6..c01b4e541e 100644 --- a/app/design/adminhtml/default/default/template/catalog/product/price.phtml +++ b/app/design/adminhtml/default/default/template/catalog/product/price.phtml @@ -213,13 +213,13 @@ $_inclTax = $_taxHelper->getPrice($_product, $_minimalPriceValue, $includingTax

      __('Special Price:') ?> - __('Excl. Tax:') ?> + helper('tax')->__('Excl. Tax:') ?> currencyByStore($_finalPrice+$_weeeTaxAmount, $_storeId, true, false) ?> - __('Incl. Tax:') ?> + helper('tax')->__('Incl. Tax:') ?> currencyByStore($_finalPriceInclTax+$_weeeTaxAmount, $_storeId, true, false) ?> @@ -245,7 +245,7 @@ $_inclTax = $_taxHelper->getPrice($_product, $_minimalPriceValue, $includingTax

      __('Special Price:') ?> - __('Excl. Tax:') ?> + helper('tax')->__('Excl. Tax:') ?> currencyByStore($_finalPrice+$_weeeTaxAmount, $_storeId, true, false) ?> @@ -275,7 +275,7 @@ $_inclTax = $_taxHelper->getPrice($_product, $_minimalPriceValue, $includingTax

      __('Special Price:') ?> - __('Excl. Tax:') ?> + helper('tax')->__('Excl. Tax:') ?> currencyByStore($_finalPrice+$_weeeTaxAmount, $_storeId, true, false) ?> @@ -305,7 +305,7 @@ $_inclTax = $_taxHelper->getPrice($_product, $_minimalPriceValue, $includingTax

      __('Special Price:') ?> - __('Excl. Tax:') ?> + helper('tax')->__('Excl. Tax:') ?> currencyByStore($_finalPrice, $_storeId, true, false) ?> @@ -316,7 +316,7 @@ $_inclTax = $_taxHelper->getPrice($_product, $_minimalPriceValue, $includingTax - __('Incl. Tax:') ?> + helper('tax')->__('Incl. Tax:') ?> currencyByStore($_finalPriceInclTax+$_weeeTaxAmount, $_storeId, true, false) ?> @@ -334,7 +334,7 @@ $_inclTax = $_taxHelper->getPrice($_product, $_minimalPriceValue, $includingTax

      __('Special Price:') ?> - __('Excl. Tax:') ?> + helper('tax')->__('Excl. Tax:') ?> currencyByStore($_finalPrice, $_storeId, true, false) ?> diff --git a/app/design/adminhtml/default/default/template/catalog/product/tab/inventory.phtml b/app/design/adminhtml/default/default/template/catalog/product/tab/inventory.phtml index 383a16ceef..85798dad02 100644 --- a/app/design/adminhtml/default/default/template/catalog/product/tab/inventory.phtml +++ b/app/design/adminhtml/default/default/template/catalog/product/tab/inventory.phtml @@ -49,7 +49,7 @@ onclick="toggleValueElements(this, this.parentNode);" class="checkbox" /> isReadonly()):?> -

    + getProduct()->isComposite()): ?> @@ -61,7 +61,7 @@ /> - + @@ -72,7 +72,7 @@ onclick="toggleValueElements(this, this.parentNode);" /> isReadonly()):?> - + @@ -83,7 +83,7 @@ onclick="toggleValueElements(this, this.parentNode);" class="checkbox" /> isReadonly()):?> - + @@ -94,7 +94,7 @@ onclick="toggleValueElements(this, this.parentNode);" class="checkbox" /> isReadonly()):?> - + canUseQtyDecimals()): ?> @@ -105,7 +105,7 @@ - + @@ -122,7 +122,7 @@ onclick="toggleValueElements(this, this.parentNode);" class="checkbox" /> isReadonly()):?> - + @@ -132,7 +132,7 @@ onclick="toggleValueElements(this, this.parentNode);" class="checkbox" /> isReadonly()):?> - + @@ -147,7 +147,7 @@ onclick="toggleValueElements(this, this.parentNode);" class="checkbox" /> isReadonly()):?> - + @@ -157,7 +157,7 @@ onclick="toggleValueElements(this, this.parentNode);" class="checkbox" /> isReadonly()):?> - + @@ -168,7 +168,7 @@ - +
    getCanEditPrice() === false) : ?> disabled="disabled">getCanEditPrice() === false) : ?> disabled="disabled">getPriceTypeSelectHtml() ?>
    getElement()->getLabel(); ?> + + + + + + + + + + + + + + + + + + + + + + +
    style="display: none;">__('Website'); ?>__('Customer Group'); ?>getPriceColumnHeader(Mage::helper('catalog')->__('Price')); ?>__('Action'); ?>
    style="display: none;">getAddButtonHtml(); ?>
    + + +
    ' - + ' __("and above")?>' - + '
    __('[GLOBAL]') ?>__('[GLOBAL]') ?>
    __('[GLOBAL]') ?>__('[GLOBAL]') ?>
    __('[GLOBAL]') ?>__('[GLOBAL]') ?>
    __('[GLOBAL]') ?>__('[GLOBAL]') ?>
    __('[GLOBAL]') ?>__('[GLOBAL]') ?>
    __('[GLOBAL]') ?>__('[GLOBAL]') ?>
    __('[GLOBAL]') ?>__('[GLOBAL]') ?>
    __('[GLOBAL]') ?>__('[GLOBAL]') ?>
    __('[GLOBAL]') ?>__('[GLOBAL]') ?>
    __('[GLOBAL]') ?>__('[GLOBAL]') ?>
    __('[GLOBAL]') ?>__('[GLOBAL]') ?>
    + diff --git a/app/design/adminhtml/default/default/template/customer/tab/addresses.phtml b/app/design/adminhtml/default/default/template/customer/tab/addresses.phtml index 355c88f91d..5ef8ccc96f 100644 --- a/app/design/adminhtml/default/default/template/customer/tab/addresses.phtml +++ b/app/design/adminhtml/default/default/template/customer/tab/addresses.phtml @@ -406,8 +406,12 @@ addressesModel.prototype = { var html = this.itemContentTemplate.evaluate(data); html = html.replace(new RegExp('(\\s*){2,}','img'),'
    '); html = html.replace(new RegExp('(\\s*,){1,}\\s*','ig'),'
    '); + html = html.replace(new RegExp('(\\s*,){1,}(.*)','ig'),'
    $2
    '); + html = html.replace(new RegExp('(.*?)(,\\s*){1,}','ig'),'
    $1
    '); + html = html.replace(new RegExp('(.*?)(,\\s*){2,}(.*?)','ig'),'
    $1, $3
    '); html = html.replace(new RegExp('t:\\s*','ig'),''); - html = html.replace(new RegExp('f:\\s*$','ig'),''); + html = html.replace(new RegExp('f:\\s*','ig'),''); + html = html.replace(new RegExp('vat:\\s*$','ig'),''); itemContainer[0].innerHTML = html; } } diff --git a/app/design/adminhtml/default/default/template/customer/tab/cart.phtml b/app/design/adminhtml/default/default/template/customer/tab/cart.phtml index 512e7a16f6..6bde7d40df 100644 --- a/app/design/adminhtml/default/default/template/customer/tab/cart.phtml +++ b/app/design/adminhtml/default/default/template/customer/tab/cart.phtml @@ -65,10 +65,10 @@ removeItem: function (itemId) { if (!itemId) { - alert('__('No item specified.') ?>'); + alert('jsQuoteEscape(Mage::helper('customer')->__('No item specified.')) ?>'); return false; } - if(!confirm('__('Are you sure that you want to remove this item?') ?>')) { + if(!confirm('jsQuoteEscape(Mage::helper('customer')->__('Are you sure that you want to remove this item?')) ?>')) { return false; } diff --git a/app/design/adminhtml/default/default/template/downloadable/product/edit/downloadable.phtml b/app/design/adminhtml/default/default/template/downloadable/product/edit/downloadable.phtml index 188b66fc16..0fa88510e6 100644 --- a/app/design/adminhtml/default/default/template/downloadable/product/edit/downloadable.phtml +++ b/app/design/adminhtml/default/default/template/downloadable/product/edit/downloadable.phtml @@ -230,7 +230,7 @@ Validation.addAllThese([ newFileContainer = element.up(0).down('div.new-file'); if (!alertAlreadyDisplayed && (newFileContainer.empty() || newFileContainer.style.display != 'none')) { alertAlreadyDisplayed = true; - alert('There are files that were selected but not uploaded yet. Please upload or remove them first'); + alert('jsQuoteEscape($this->__('There are files that were selected but not uploaded yet. Please upload or remove them first'));?>'); } return false; } diff --git a/app/design/adminhtml/default/default/template/downloadable/product/edit/downloadable/links.phtml b/app/design/adminhtml/default/default/template/downloadable/product/edit/downloadable/links.phtml index caf70a67fa..2ccd1520f1 100644 --- a/app/design/adminhtml/default/default/template/downloadable/product/edit/downloadable/links.phtml +++ b/app/design/adminhtml/default/default/template/downloadable/product/edit/downloadable/links.phtml @@ -40,7 +40,7 @@ getStoreId() && $this->getUsedDefault())?'disabled="disabled"':'' ?> /> - isSingleStoreMode()): ?>[STORE VIEW] + isSingleStoreMode() ? Mage::helper('adminhtml')->__('[STORE VIEW]') : ''; ?> getStoreId()): ?> getUsedDefault()?'checked="checked"':'' ?> /> @@ -59,7 +59,7 @@ getPurchasedSeparatelySelect()?> - isSingleStoreMode()): ?>[GLOBAL] + isSingleStoreMode() ? Mage::helper('adminhtml')->__('[GLOBAL]') : ''; ?>   diff --git a/app/design/adminhtml/default/default/template/downloadable/product/edit/downloadable/samples.phtml b/app/design/adminhtml/default/default/template/downloadable/product/edit/downloadable/samples.phtml index 3116693f0a..100ef7a240 100644 --- a/app/design/adminhtml/default/default/template/downloadable/product/edit/downloadable/samples.phtml +++ b/app/design/adminhtml/default/default/template/downloadable/product/edit/downloadable/samples.phtml @@ -40,7 +40,7 @@ getStoreId() && $this->getUsedDefault())?'disabled="disabled"':'' ?> /> - isSingleStoreMode()): ?>[STORE VIEW] + isSingleStoreMode() ? Mage::helper('adminhtml')->__('[STORE VIEW]') : ''; ?> getStoreId()): ?> getUsedDefault()?'checked="checked"':'' ?> /> diff --git a/app/design/adminhtml/default/default/template/forgotpassword.phtml b/app/design/adminhtml/default/default/template/forgotpassword.phtml index 4a146cda96..94150e9891 100644 --- a/app/design/adminhtml/default/default/template/forgotpassword.phtml +++ b/app/design/adminhtml/default/default/template/forgotpassword.phtml @@ -28,38 +28,40 @@ - <?php echo Mage::helper('adminhtml')->__('Log into Magento Admin Page') ?> - - - - + <?php echo Mage::helper('adminhtml')->__('Log into Magento Admin Page'); ?> + + + + - + + - - - + + + + + diff --git a/app/design/frontend/default/iphone/template/checkout/onepage/login.phtml b/app/design/frontend/default/iphone/template/checkout/onepage/login.phtml new file mode 100644 index 0000000000..efd3e24dc7 --- /dev/null +++ b/app/design/frontend/default/iphone/template/checkout/onepage/login.phtml @@ -0,0 +1,121 @@ + +
    + getChildHtml('login_before')?> +
    +

    getQuote()->isAllowedGuestCheckout() ): ?>__('Checkout as a Guest or Register') ?>__('Register to Create an Account') ?>

    + getQuote()->isAllowedGuestCheckout() ): ?> +

    __('Register with us for future convenience:') ?>

    + +

    __('Register and save time!') ?>
    + __('Register with us for future convenience:') ?>

    +
      +
    • __('Fast and easy check out') ?>
    • +
    • __('Easy access to your order history and status') ?>
    • +
    + + getQuote()->isAllowedGuestCheckout() ): ?> +
      + getQuote()->isAllowedGuestCheckout() ): ?> +
    • + getQuote()->getCheckoutMethod()==Mage_Checkout_Model_Type_Onepage::METHOD_GUEST): ?> checked="checked" class="radio" /> +
    • + +
    • + getQuote()->getCheckoutMethod()==Mage_Checkout_Model_Type_Onepage::METHOD_REGISTER || !$this->getQuote()->isAllowedGuestCheckout()): ?> checked="checked" class="radio" /> +
    • +
    +

    __('Register and save time!') ?>

    +

    __('Register with us for future convenience:') ?>

    +
      +
    • __('Fast and easy check out') ?>
    • +
    • __('Easy access to your order history and status') ?>
    • +
    + + + +
    +
    +

    __('Login') ?>

    + getMessagesBlock()->getGroupedHtml() ?> +
    +
    +

    __('Already registered?') ?>

    +

    __('Please log in below:') ?>

    +
      +
    • + +
      + +
      +
    • +
    • + +
      + +
      +
    • + getChildHtml('form.additional.info'); ?> +
    +
    +
    +
    +
    +
    +
    +
    +

     

    + +
    +
    +
    +
    +

    __('* Required Fields') ?>

    + __('Forgot your password?') ?> + +
    +
    +
    + diff --git a/app/design/frontend/default/iphone/template/customer/form/edit.phtml b/app/design/frontend/default/iphone/template/customer/form/edit.phtml new file mode 100644 index 0000000000..f71f9b9154 --- /dev/null +++ b/app/design/frontend/default/iphone/template/customer/form/edit.phtml @@ -0,0 +1,127 @@ + + + + + diff --git a/app/design/frontend/default/iphone/template/customer/form/forgotpassword.phtml b/app/design/frontend/default/iphone/template/customer/form/forgotpassword.phtml index e8052bb53e..53d199047b 100644 --- a/app/design/frontend/default/iphone/template/customer/form/forgotpassword.phtml +++ b/app/design/frontend/default/iphone/template/customer/form/forgotpassword.phtml @@ -24,18 +24,20 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> -
    -

    __('Retrieve your password here') ?>

    -
    +

    + __('Back to Login') ?> + __('Retrieve Password') ?> +

    getMessagesBlock()->getGroupedHtml() ?>
    - - -
    - « __('Back to Login') ?> - -
    +

    __('Retrieve your password here') ?>

    + + +
      + getChildHtml('form.additional.info'); ?> +
    +
    + + +
    +

    __('New Customers') ?>

    + +

    __('By creating an account with our store, you will be able to move through the checkout process faster, store multiple shipping addresses, view and track your orders in your account and more.') ?>

    +
    + diff --git a/app/design/frontend/default/iphone/template/customer/form/register.phtml b/app/design/frontend/default/iphone/template/customer/form/register.phtml new file mode 100644 index 0000000000..95a182d397 --- /dev/null +++ b/app/design/frontend/default/iphone/template/customer/form/register.phtml @@ -0,0 +1,178 @@ + + + +
    +

    __('New Customer') ?>

    +
    +
    + + + getChildHtml('form_fields_before')?> + getMessagesBlock()->getGroupedHtml() ?> +
    +

    __('Personal Information') ?>

    +
      +
    • + + +
    • +
    • + + +
    • +
    • + + +
    • + isNewsletterEnabled()): ?> +
    • + +
    +
    + getShowAddressFields()): ?> +
    + +

    __('Address Information') ?>

    +
      +
    • +
      + +
      + +
      +
      +
      + +
      + +
      +
      +
    • +
    • + +
      + +
      +
    • + helper('customer/address')->getStreetLines(); $_i<=$_n; $_i++): ?> +
    • +
      + +
      +
    • + +
    • +
      + +
      + +
      +
      +
      + +
      + + + +
      +
      +
    • +
    • +
      + +
      + +
      +
      +
      + +
      + getCountryHtmlSelect() ?> +
      +
      +
    • +
    + + +
    + +
    +
      + getLayout()->createBlock('customer/widget_dob') ?> + isEnabled()): ?> +
    • setDate($this->getFormData()->getDob())->toHtml() ?>
    • + + getLayout()->createBlock('customer/widget_taxvat') ?> + isEnabled()): ?> +
    • setTaxvat($this->getFormData()->getTaxvat())->toHtml() ?>
    • + + getLayout()->createBlock('customer/widget_gender') ?> + isEnabled()): ?> +
    • setGender($this->getFormData()->getGender())->toHtml() ?>
    • + +
    +
    + +
    +
    +
    + diff --git a/app/design/frontend/default/iphone/template/page/1column.phtml b/app/design/frontend/default/iphone/template/page/1column.phtml index 57eee7bb78..0ff5cce312 100644 --- a/app/design/frontend/default/iphone/template/page/1column.phtml +++ b/app/design/frontend/default/iphone/template/page/1column.phtml @@ -24,37 +24,24 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> - - - + + getChildHtml('head') ?> - -getChildHtml('after_body_start') ?> -getChildHtml('global_notices') ?> -
    +getBodyClass()?' class="'.$this->getBodyClass().'"':'' ?>> + getChildHtml('after_body_start') ?> + getChildHtml('global_notices') ?> getChildHtml('header') ?> -
    -
    -
    + +
    getChildHtml('breadcrumbs') ?> -
    -
    - getChildHtml('content') ?> -
    -
    -
    - -getChildHtml('before_body_end') ?> -getAbsoluteFooter() ?> + getChildHtml('content') ?> + + + getChildHtml('footer') ?> + + getChildHtml('before_body_end') ?> + getAbsoluteFooter() ?> diff --git a/app/design/frontend/default/iphone/template/page/html/footer.phtml b/app/design/frontend/default/iphone/template/page/html/footer.phtml index 7f0d407ac2..9719e392dc 100644 --- a/app/design/frontend/default/iphone/template/page/html/footer.phtml +++ b/app/design/frontend/default/iphone/template/page/html/footer.phtml @@ -24,9 +24,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> -
    +
    getChildHtml() ?> -
    -

    - getCopyright() ?> -

    +

    getCopyright() ?>

    + diff --git a/app/design/frontend/default/iphone/template/page/html/head.phtml b/app/design/frontend/default/iphone/template/page/html/head.phtml index 039e486d9f..3ff3587703 100644 --- a/app/design/frontend/default/iphone/template/page/html/head.phtml +++ b/app/design/frontend/default/iphone/template/page/html/head.phtml @@ -24,14 +24,24 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> - - <?php echo htmlspecialchars(html_entity_decode($this->getTitle())) ?> - - +<?php echo $this->getTitle() ?> + + + + + + + + + getCssJsHtml() ?> getChildHtml() ?> +helper('core/js')->getTranslatorScript() ?> +getIncludes() ?> diff --git a/app/design/frontend/default/iphone/template/page/html/header.phtml b/app/design/frontend/default/iphone/template/page/html/header.phtml index 06f92c23c3..2381c22ae7 100644 --- a/app/design/frontend/default/iphone/template/page/html/header.phtml +++ b/app/design/frontend/default/iphone/template/page/html/header.phtml @@ -27,24 +27,35 @@ * @var Mage_Page_Block_Html_Header $this */ ?> - -getChildHtml('topSearch') ?> -
    -
    -
    -

    <?php echo $this->getLogoAlt() ?>

    -
    -
    -
    - getChildHtml('store_language') ?> -
    -
    - -

    getWelcome()?>

    - getChildHtml('accountLinks') ?> -
    +helper('checkout/cart')->getSummaryCount(); ?> +
    + -
    -
    - getChildHtml('topLinks') ?> -
    + + getChildHtml('accountLinks') ?> + +getChildHtml('topCart') ?> diff --git a/app/design/frontend/default/iphone/template/page/html/pager.phtml b/app/design/frontend/default/iphone/template/page/html/pager.phtml new file mode 100644 index 0000000000..0283083ce1 --- /dev/null +++ b/app/design/frontend/default/iphone/template/page/html/pager.phtml @@ -0,0 +1,113 @@ + + +getCollection()->getSize()): ?> + + getUseContainer()): ?> +
    + + + getShowAmounts()): ?> +

    + + getLastPageNum()>1): ?> + __('Items %s to %s of %s total', $this->getFirstNum(), $this->getLastNum(), $this->getTotalNum()) ?> + + __('%s Item(s)', $this->getTotalNum()) ?> + +

    + + + getShowPerPage()): ?> +
    + + __('per page') ?> +
    + + + getLastPageNum()>1): ?> +
    + __('Page') ?> + + + isFirstPage()): ?> + + +   + + + isLastPage()): ?> +   + +   + + +
    + + + getUseContainer()): ?> +
    + + + diff --git a/app/design/frontend/default/iphone/template/page/switch/languages.phtml b/app/design/frontend/default/iphone/template/page/switch/languages.phtml new file mode 100644 index 0000000000..6ee5459731 --- /dev/null +++ b/app/design/frontend/default/iphone/template/page/switch/languages.phtml @@ -0,0 +1,46 @@ + + +getStores())>1): ?> +
  • + __('Language') ?>: + +
  • + diff --git a/app/design/frontend/default/iphone/template/page/switch/stores.phtml b/app/design/frontend/default/iphone/template/page/switch/stores.phtml new file mode 100644 index 0000000000..a212888862 --- /dev/null +++ b/app/design/frontend/default/iphone/template/page/switch/stores.phtml @@ -0,0 +1,46 @@ + + +getGroups())>1): ?> +
  • + __('Selected Store') ?>: + +
  • + diff --git a/app/design/frontend/default/iphone/template/persistent/checkout/onepage/login.phtml b/app/design/frontend/default/iphone/template/persistent/checkout/onepage/login.phtml new file mode 100644 index 0000000000..54fea170f5 --- /dev/null +++ b/app/design/frontend/default/iphone/template/persistent/checkout/onepage/login.phtml @@ -0,0 +1,154 @@ + + +
    + getChildHtml('login_before')?> + +
    +

    getQuote()->isAllowedGuestCheckout() ): ?>__('Checkout as a Guest or Register') ?>__('Register to Create an Account') ?>

    + getQuote()->isAllowedGuestCheckout() ): ?> +

    __('Register with us for future convenience:') ?>

    + +

    __('Register and save time!') ?>
    + __('Register with us for future convenience:') ?>

    +
      +
    • __('Fast and easy check out') ?>
    • +
    • __('Easy access to your order history and status') ?>
    • +
    + + getQuote()->isAllowedGuestCheckout() ): ?> +
      + getQuote()->isAllowedGuestCheckout() ): ?> +
    • + getQuote()->getCheckoutMethod()==Mage_Checkout_Model_Type_Onepage::METHOD_GUEST): ?> checked="checked" class="radio" /> +
    • + +
    • + getQuote()->getCheckoutMethod()==Mage_Checkout_Model_Type_Onepage::METHOD_REGISTER || !$this->getQuote()->isAllowedGuestCheckout()): ?> checked="checked" class="radio" /> +
    • +
    + + + + +
    +
    +
    +
    +
    + + getQuote()->isAllowedGuestCheckout()): ?> + + +
    + +
    + +
    +
    +
    +
    +
    + +getRequest()->getParam('register'); + if ($registerParam || $registerParam === ''): +?> + + diff --git a/app/design/frontend/default/iphone/template/persistent/customer/form/login.phtml b/app/design/frontend/default/iphone/template/persistent/customer/form/login.phtml index ebbf0d8161..8b6cc0936e 100644 --- a/app/design/frontend/default/iphone/template/persistent/customer/form/login.phtml +++ b/app/design/frontend/default/iphone/template/persistent/customer/form/login.phtml @@ -32,38 +32,59 @@ */ /** @var $this Mage_Customer_Block_Form_Login */ ?> -
    + + + + diff --git a/app/design/frontend/default/iphone/template/sales/order/items.phtml b/app/design/frontend/default/iphone/template/sales/order/items.phtml new file mode 100644 index 0000000000..c8c501ba58 --- /dev/null +++ b/app/design/frontend/default/iphone/template/sales/order/items.phtml @@ -0,0 +1,73 @@ + +getOrder() ?> + + + getChildHtml('order_totals') ?> + + getItemsCollection(); ?> + + count(); ?> + + getParentItem()) continue; ?> + + getItemHtml($_item) ?> + helper('giftmessage/message')->getIsMessagesAvailable('order_item', $_item) && $_item->getGiftMessageId()): ?> + + helper('giftmessage/message')->getGiftMessageForEntity($_item); ?> + + + + + +
    + diff --git a/app/design/frontend/default/iphone/template/sales/order/totals.phtml b/app/design/frontend/default/iphone/template/sales/order/totals.phtml new file mode 100644 index 0000000000..46c1cada7f --- /dev/null +++ b/app/design/frontend/default/iphone/template/sales/order/totals.phtml @@ -0,0 +1,52 @@ + +getTotals() as $_code => $_total): ?> + getBlockName()): ?> + getChildHtml($_total->getBlockName(), false); ?> + + + + getStrong()):?> + getLabel()?> + + getLabel()?> + + + + getStrong()):?> + formatValue($_total) ?> + + formatValue($_total) ?> + + + + + diff --git a/app/design/frontend/default/iphone/template/sendfriend/send.phtml b/app/design/frontend/default/iphone/template/sendfriend/send.phtml new file mode 100644 index 0000000000..d492babe71 --- /dev/null +++ b/app/design/frontend/default/iphone/template/sendfriend/send.phtml @@ -0,0 +1,148 @@ + + + + + +
    + getMessagesBlock()->getGroupedHtml() ?> +
    +
    + getMaxRecipients()): ?> +

    + +

    + +

    __('Recipient:') ?>

    +
      +
    • +
      + +
      + +
      +
      +
      + +
      + +
      +
      +
    • +
    +
    + +
    + getBlockHtml('formkey')?> +

    __('Sender:') ?>

    +
      +
    • +
      + +
      + +
      +
      +
      + +
      + +
      +
      +
    • +
    • + +
      + +
      +
    • +
    +
    +
    + +
    +
    + +
    diff --git a/app/design/frontend/default/iphone/template/tag/list.phtml b/app/design/frontend/default/iphone/template/tag/list.phtml new file mode 100644 index 0000000000..6ec24ad17a --- /dev/null +++ b/app/design/frontend/default/iphone/template/tag/list.phtml @@ -0,0 +1,35 @@ + +getCount() ): ?> +
    +

    __('Product Tags') ?>

    + getChildHtml('list_before')?> +
    + renderTags('%2$s (%3$s)') ?> +
    +
    + diff --git a/app/design/frontend/default/iphone/template/wishlist/view.phtml b/app/design/frontend/default/iphone/template/wishlist/view.phtml index 10e10d8410..787bc378fd 100644 --- a/app/design/frontend/default/iphone/template/wishlist/view.phtml +++ b/app/design/frontend/default/iphone/template/wishlist/view.phtml @@ -27,74 +27,60 @@ ?> helper('wishlist')->isAllow()) : ?>
    -
    - helper('wishlist')->isRssAllow() && $this->hasWishlistItems()): ?> - __('RSS Feed') ?> - -

    __('My Wishlist') ?>

    -
    +

    __('My Wishlist') ?>

    + getMessagesBlock()->getGroupedHtml() ?> hasWishlistItems()): ?> -
    -
    +
    + + <?php echo $this->__('Remove All')?> getBlockHtml('formkey')?> - - - - - - - - - - - - - +
      getWishlistItems() as $item): ?> -
    - - - - - - - + getProduct(); + $isVisibleProduct = $product->isVisibleInSiteVisibility(); + ?> +
  • + <?php echo $this->escapeHtml($product->getName()) ?> +
    +

    + <?php echo $this->__('Remove item')?> + + __('E') ?> + + escapeHtml($product->getName()) ?> +

    + getPriceHtml($product) ?> + getDetailsHtml($item) ?> + canHaveQty() && $isVisibleProduct): ?> + __('Qty') ?>: + + + isSaleable()): ?> + + + + + __('Out of stock') ?> + + +
    +
  • - -
    __('Product') ?>__('Added On') ?>__('Add to Cart') ?>
    - <?php echo $this->escapeHtml($item->getName()) ?> -

    escapeHtml($item->getName()) ?>

    - getPriceHtml($item) ?> -
    - getFormatedDate($item->getAddedAt()) ?> - - canHaveQty()): ?> -

    - - isSaleable()): ?> - - -

    __('Out of stock') ?>

    - -

    __('Edit') ?>

    - __('Remove item')?> -
    - __('Comment:') ?> - -
    - -
    - + +
      +
    • + +
    • isSaleable()):?> - +
    • __('Add All to Cart') ?>
    • - -
    -
    -
    + + +
    -

    __('You have no items in your wishlist.') ?>

    +

    __('You have no items in your wishlist.') ?>

    - +« __('Back') ?> diff --git a/app/design/frontend/default/modern/layout/checkout.xml b/app/design/frontend/default/modern/layout/checkout.xml index 92c30467ca..8a1224a9d3 100644 --- a/app/design/frontend/default/modern/layout/checkout.xml +++ b/app/design/frontend/default/modern/layout/checkout.xml @@ -99,7 +99,7 @@ Default layout, loads most of the pages - + diff --git a/app/design/frontend/default/modern/layout/customer.xml b/app/design/frontend/default/modern/layout/customer.xml index 6dbc270645..8c24150fcc 100644 --- a/app/design/frontend/default/modern/layout/customer.xml +++ b/app/design/frontend/default/modern/layout/customer.xml @@ -91,7 +91,7 @@ Layout for customer login page - + @@ -152,7 +152,7 @@ New customer registration - + @@ -190,7 +190,7 @@ Customer account pages, rendered for all tabs in dashboard - + diff --git a/app/design/frontend/default/modern/template/catalogsearch/form.mini.phtml b/app/design/frontend/default/modern/template/catalogsearch/form.mini.phtml index 1283d1b909..06711d9620 100644 --- a/app/design/frontend/default/modern/template/catalogsearch/form.mini.phtml +++ b/app/design/frontend/default/modern/template/catalogsearch/form.mini.phtml @@ -23,17 +23,20 @@ * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ +/* @var $this Mage_Core_Block_Template */ +/* @var $catalogSearchHelper Mage_Catalogsearch_Helper_Data */ +$catalogSearchHelper = $this->helper('catalogsearch'); ?> -
    + diff --git a/app/design/frontend/default/modern/template/checkout/cart.phtml b/app/design/frontend/default/modern/template/checkout/cart.phtml index 7f12065a07..e1469f5bdc 100644 --- a/app/design/frontend/default/modern/template/checkout/cart.phtml +++ b/app/design/frontend/default/modern/template/checkout/cart.phtml @@ -99,7 +99,8 @@ getContinueShoppingUrl()): ?> - + + diff --git a/app/design/install/default/default/template/install/config.phtml b/app/design/install/default/default/template/install/config.phtml index 6d0e7a2d3c..4e13c93c61 100644 --- a/app/design/install/default/default/template/install/config.phtml +++ b/app/design/install/default/default/template/install/config.phtml @@ -99,9 +99,6 @@
  • getFormData()->getUseSecureAdmin()): ?>checked="checked" />
    -
  • getSkipUrlValidation()): ?>checked="checked" /> diff --git a/app/etc/local.xml.additional b/app/etc/local.xml.additional index 207131bc05..c491fb81dd 100644 --- a/app/etc/local.xml.additional +++ b/app/etc/local.xml.additional @@ -58,6 +58,20 @@ to app/etc/local.xml manually. + + + + + full_page_cache + + + 1 + 0777 + fpc + + + + HTTP_X_REAL_IP HTTP_X_FORWARDED_FOR diff --git a/app/etc/modules/Mage_Captcha.xml b/app/etc/modules/Mage_Captcha.xml new file mode 100755 index 0000000000..80b850309d --- /dev/null +++ b/app/etc/modules/Mage_Captcha.xml @@ -0,0 +1,39 @@ + + + + + + true + core + + + + + + + diff --git a/app/locale/en_US/Mage_Adminhtml.csv b/app/locale/en_US/Mage_Adminhtml.csv index 3c533d9f6e..dc2719c2e9 100644 --- a/app/locale/en_US/Mage_Adminhtml.csv +++ b/app/locale/en_US/Mage_Adminhtml.csv @@ -1,7 +1,9 @@ " The customer does not exist in the system anymore."," The customer does not exist in the system anymore." +" You will need to navigate to your "," You will need to navigate to your " " [deleted]"," [deleted]" " and "," and " -" note that the URLs provided below are the correct values for your current website): "," note that the URLs provided below are the correct values for your current website): " +" and go to the "," and go to the " +" sections for your Hosted Checkout Pages."," sections for your Hosted Checkout Pages." "%s (Default Template from Locale)","%s (Default Template from Locale)" "%s cache type(s) disabled.","%s cache type(s) disabled." "%s cache type(s) enabled.","%s cache type(s) enabled." @@ -30,14 +32,17 @@ "-- Please select --","-- Please select --" "--Please Select--","--Please Select--" "1 Hour","1 Hour" +"1. set up","1. set up" "12 Hours","12 Hours" "12h AM/PM","12h AM/PM" "2 Hours","2 Hours" +"2. customize","2. customize" "24 Hours","24 Hours" "24h","24h" "2YTD","2YTD" "6 Hours","6 Hours" "

    404 Error

    Page not found.

    ","

    404 Error

    Page not found.

    " +"Attention: Captcha is case sensitive.","Attention: Captcha is case sensitive." "A user with the same user name or email aleady exists.","A user with the same user name or email aleady exists." "API Key","API Key" "API Key Confirmation","API Key Confirmation" @@ -92,11 +97,11 @@ "All possible rates were fetched, please click on ""Save"" to apply","All possible rates were fetched, please click on ""Save"" to apply" "All rates were fetched, please click on ""Save"" to apply","All rates were fetched, please click on ""Save"" to apply" "All valid rates have been saved.","All valid rates have been saved." +"Always (during development)","Always (during development)" "Amounts","Amounts" "An error has occured while syncronizing media storages.","An error has occured while syncronizing media storages." "An error occurred while clearing the JavaScript/CSS cache.","An error occurred while clearing the JavaScript/CSS cache." "An error occurred while clearing the image cache.","An error occurred while clearing the image cache." -"An error occurred while creating the backup.","An error occurred while creating the backup." "An error occurred while deleting URL Rewrite.","An error occurred while deleting URL Rewrite." "An error occurred while deleting email template data. Please review log and try again.","An error occurred while deleting email template data. Please review log and try again." "An error occurred while deleting record(s).","An error occurred while deleting record(s)." @@ -128,10 +133,12 @@ "Any Store","Any Store" "Any Type","Any Type" "Any Visibility","Any Visibility" +"Any data created since the backup was made will be lost including admin users, customers and orders.","Any data created since the backup was made will be lost including admin users, customers and orders." "Archive file name:","Archive file name:" "Are you sure that you want to delete this template?","Are you sure that you want to delete this template?" "Are you sure that you want to strip tags?","Are you sure that you want to strip tags?" "Are you sure you want to do this?","Are you sure you want to do this?" +"Are you sure you want to proceed?","Are you sure you want to proceed?" "Area","Area" "As low as:","As low as:" "Assigned","Assigned" @@ -145,7 +152,6 @@ "Back","Back" "Back to Login","Back to Login" "Backup","Backup" -"Backup record was deleted.","Backup record was deleted." "Backups","Backups" "Base currency","Base currency" "Bcc","Bcc" @@ -180,7 +186,6 @@ "Cannot initialize shipment for delete tracking number.","Cannot initialize shipment for delete tracking number." "Cannot load track with retrieving identifier.","Cannot load track with retrieving identifier." "Cannot retrieve tracking number detail.","Cannot retrieve tracking number detail." -"Cannot save a new password.","Cannot save a new password." "Cannot save shipment.","Cannot save shipment." "Cannot save the credit memo.","Cannot save the credit memo." "Cannot send shipment information.","Cannot send shipment information." @@ -230,6 +235,7 @@ "Credit memo #%s created","Credit memo #%s created" "Credit memo\'s total must be positive.","Credit memo\'s total must be positive." "Currency","Currency" +"Currency ""%s"" is used as %s in %s.","Currency ""%s"" is used as %s in %s." "Currency Information","Currency Information" "Currency Setup Section","Currency Setup Section" "Current Configuration Scope:","Current Configuration Scope:" @@ -294,9 +300,8 @@ "Display %s first","Display %s first" "Display default currency","Display default currency" "Distributed under GNU LGPL. See %s for details.","Distributed under GNU LGPL. See %s for details." -"Do not enable AVS or CSC options. The do not work when using Payflow Link Silent Mode.","Do not enable AVS or CSC options. The do not work when using Payflow Link Silent Mode." -"Do not set any fields in the Billing and Shipping Information block as editable in your Payflow account.","Do not set any fields in the Billing and Shipping Information block as editable in your Payflow account." "Do you really want to KILL parallel process and start new indexing process?","Do you really want to KILL parallel process and start new indexing process?" +"Do you really want to proceed?","Do you really want to proceed?" "Download","Download" "Downloads","Downloads" "Drag to move","Drag to move" @@ -321,14 +326,12 @@ "Email to a Friend","Email to a Friend" "Email:","Email:" "Enable","Enable" -"Enable Secure Token:","Enable Secure Token:" "Enabled","Enabled" "Enclose Values In:","Enclose Values In:" "Entity Attributes","Entity Attributes" "Entity Type","Entity Type" "Entity type:","Entity type:" "Error","Error" -"Error URL: ","Error URL: " "Excel XML","Excel XML" "Excl. Tax","Excl. Tax" "Expiration Date","Expiration Date" @@ -338,7 +341,11 @@ "Export Filters","Export Filters" "Export to:","Export to:" "Export:","Export:" +"FTP Host","FTP Host" "FTP Host[:Port]","FTP Host[:Port]" +"FTP Login","FTP Login" +"FTP Password","FTP Password" +"FTP credentials","FTP credentials" "Failed to add a product to cart by id ""%s"".","Failed to add a product to cart by id ""%s""." "Failed to cancel the billing agreement.","Failed to cancel the billing agreement." "Failed to clear the JavaScript/CSS cache.","Failed to clear the JavaScript/CSS cache." @@ -399,7 +406,6 @@ "IPN (Instant Payment Notification) Only","IPN (Instant Payment Notification) Only" "If there is an account associated with %s you will receive an email with a link to reset your password.","If there is an account associated with %s you will receive an email with a link to reset your password." "If this message persists, please contact the store owner.","If this message persists, please contact the store owner." -"If your Magento instance is used for multiple websites, you must configure a separate Payflow Link account for each website.","If your Magento instance is used for multiple websites, you must configure a separate Payflow Link account for each website." "Images (.gif, .jpg, .png)","Images (.gif, .jpg, .png)" "Images Cache","Images Cache" "Import","Import" @@ -424,9 +430,10 @@ "Invalid Import Service Specified","Invalid Import Service Specified" "Invalid POST data (please check post_max_size and upload_max_filesize settings in your php.ini file).","Invalid POST data (please check post_max_size and upload_max_filesize settings in your php.ini file)." "Invalid Secret Key. Please refresh the page.","Invalid Secret Key. Please refresh the page." -"Invalid Username or Password.","Invalid Username or Password." +"Invalid User Name or Password.","Invalid User Name or Password." "Invalid directory: %s","Invalid directory: %s" "Invalid email address ""%s"".","Invalid email address ""%s""." +"Invalid email address.","Invalid email address." "Invalid file: %s","Invalid file: %s" "Invalid input data for %s => %s rate","Invalid input data for %s => %s rate" "Invalid parent block for this block","Invalid parent block for this block" @@ -447,6 +454,7 @@ "Is Closed","Is Closed" "Issue Number","Issue Number" "Items","Items" +"JavaScript seems to be disabled in your browser.","JavaScript seems to be disabled in your browser." "JavaScript/CSS","JavaScript/CSS" "JavaScript/CSS Cache","JavaScript/CSS Cache" "Kb","Kb" @@ -493,6 +501,7 @@ "Magento Connect Manager","Magento Connect Manager" "Magento Logo","Magento Logo" "Magento is a trademark of Magento Inc. Copyright © %s Magento Inc.","Magento is a trademark of Magento Inc. Copyright © %s Magento Inc." +"Magento root directory","Magento root directory" "Magento ver. %s","Magento ver. %s" "Magento™ is a trademark of Magento Inc.
    Copyright © %s Magento Inc.","Magento™ is a trademark of Magento Inc.
    Copyright © %s Magento Inc." "Make sure that data encoding in the file is consistent and saved in one of supported encodings (UTF-8 or ANSI).","Make sure that data encoding in the file is consistent and saved in one of supported encodings (UTF-8 or ANSI)." @@ -523,6 +532,7 @@ "Name on Card","Name on Card" "Name on the Card: %s","Name on the Card: %s" "Name:","Name:" +"Never (production)","Never (production)" "New ","New " "New API Key","New API Key" "New Accounts","New Accounts" @@ -590,13 +600,14 @@ "Notifications","Notifications" "Number of Orders","Number of Orders" "Number of Uses","Number of Uses" +"Number of Views","Number of Views" "Number of records:","Number of records:" +"OK","OK" "Old rate:","Old rate:" -"On my website","On my website" -"Once you log into your Payflow Link account, navigate to the Service Settings - Hosted Checkout Pages - Set Up menu and set the options described below","Once you log into your Payflow Link account, navigate to the Service Settings - Hosted Checkout Pages - Set Up menu and set the options described below" "One or more media files failed to be synchronized during the media storages syncronization process. Refer to the log file for details.","One or more media files failed to be synchronized during the media storages syncronization process. Refer to the log file for details." "One or more of the Cache Types are invalidated:","One or more of the Cache Types are invalidated:" "Online Customers","Online Customers" +"Only Once (version upgrade)","Only Once (version upgrade)" "Only attributes with scope ""Global"", input type ""Dropdown"" and Use To Create Configurable Product ""Yes"" are available.","Only attributes with scope ""Global"", input type ""Dropdown"" and Use To Create Configurable Product ""Yes"" are available." "Only mapped fields","Only mapped fields" "Optional","Optional" @@ -625,6 +636,7 @@ "Password must include both numeric and alphabetic characters.","Password must include both numeric and alphabetic characters." "Password:","Password:" "Path:","Path:" +"PayPal Manager","PayPal Manager" "Payment method instance is not available.","Payment method instance is not available." "Payment method is not available.","Payment method is not available." "Payment method must be specified.","Payment method must be specified." @@ -658,11 +670,12 @@ "Please enter a valid zip code.","Please enter a valid zip code." "Please enter a valid zip code. For example 90602 or 90602-1234.","Please enter a valid zip code. For example 90602 or 90602-1234." "Please enter another credit card number to complete your purchase.","Please enter another credit card number to complete your purchase." +"Please enter password","Please enter password" +"Please enter password to confirm rollback.","Please enter password to confirm rollback." "Please enter valid password.","Please enter valid password." "Please make sure that all global admin search modules are installed and activated.","Please make sure that all global admin search modules are installed and activated." "Please make sure that your changes were saved before running the profile.","Please make sure that your changes were saved before running the profile." "Please make sure your passwords match.","Please make sure your passwords match." -"Please navigate to Hosted Checkout Pages - Customize menu and select Layout C.","Please navigate to Hosted Checkout Pages - Customize menu and select Layout C." "Please select State/Province.","Please select State/Province." "Please select a customer.","Please select a customer." "Please select a store.","Please select a store." @@ -674,9 +687,9 @@ "Please select one of the options.","Please select one of the options." "Please select review(s).","Please select review(s)." "Please select tag(s).","Please select tag(s)." -"Please specify at least start or end date.","Please specify at least start or end date." "Please specify the admin custom URL.","Please specify the admin custom URL." "Please try to logout and sign in again.","Please try to logout and sign in again." +"Please type the letters from the image:","Please type the letters from the image:" "Please use in this field only ""a-z,0-9,_"".","Please use in this field only ""a-z,0-9,_""." "Please use letters only (a-z) in this field.","Please use letters only (a-z) in this field." "Please use numbers only in this field. Please avoid spaces or other characters such as dots or commas.","Please use numbers only in this field. Please avoid spaces or other characters such as dots or commas." @@ -697,10 +710,12 @@ "Prev. year (hold for menu)","Prev. year (hold for menu)" "Preview","Preview" "Preview Template","Preview Template" +"Price","Price" "Price alert subscription was saved.","Price alert subscription was saved." "Price:","Price:" "Processed %s%% %s/%d records","Processed %s%% %s/%d records" "Product","Product" +"Product Name","Product Name" "Product Reviews","Product Reviews" "Product Tax Classes","Product Tax Classes" "Product Thumbnail Itself","Product Thumbnail Itself" @@ -708,6 +723,7 @@ "Product:","Product:" "Products","Products" "Products Bestsellers Report","Products Bestsellers Report" +"Products Most Viewed Report","Products Most Viewed Report" "Products Ordered","Products Ordered" "Products in Carts","Products in Carts" "Profile Action","Profile Action" @@ -723,6 +739,8 @@ "Promo","Promo" "Promotions","Promotions" "Purchased Item","Purchased Item" +"Put store on the maintenance mode while backup creation","Put store on the maintenance mode while backup creation" +"Put store on the maintenance mode while rollback processing","Put store on the maintenance mode while rollback processing" "Quantity","Quantity" "Queue Refresh","Queue Refresh" "Queued... Cancel","Queued... Cancel" @@ -748,12 +766,12 @@ "Release","Release" "Release Stability","Release Stability" "Release Version","Release Version" +"Reload captcha","Reload captcha" "Remote FTP","Remote FTP" "Remove","Remove" "Reports","Reports" "Request Path","Request Path" "Required","Required" -"Required settings","Required settings" "Reset","Reset" "Reset Filter","Reset Filter" "Reset Password","Reset Password" @@ -764,7 +782,6 @@ "Results","Results" "Retrieve Password","Retrieve Password" "Return Html Version","Return Html Version" -"Return URL: ","Return URL: " "Revenue","Revenue" "Reviews","Reviews" "Reviews and Ratings","Reviews and Ratings" @@ -806,12 +823,9 @@ "Search Term","Search Term" "Search Terms","Search Terms" "Select","Select" -"Select $0 Auth if your credit card processor supports $0 Auth capability and Reference Transactions, or if you are unsure what to select. This setting provides the best experience for shoppers.","Select $0 Auth if your credit card processor supports $0 Auth capability and Reference Transactions, or if you are unsure what to select. This setting provides the best experience for shoppers." -"Select $1 Auth if your credit card processor does not support $0 Auth, but does support Reference Transactions. This will provide a very good shopper experience, but might require you to pay a small additional authorization fee from your merchant account provider for any cart abandoned after payment details are entered. If you select $0 Auth, but your credit card processor does not support $0 Auth, your transaction will run as a $1 Auth instead.","Select $1 Auth if your credit card processor does not support $0 Auth, but does support Reference Transactions. This will provide a very good shopper experience, but might require you to pay a small additional authorization fee from your merchant account provider for any cart abandoned after payment details are entered. If you select $0 Auth, but your credit card processor does not support $0 Auth, your transaction will run as a $1 Auth instead." "Select All","Select All" "Select Category","Select Category" "Select Date","Select Date" -"Select Full Auth if you want to minimize your credit card processing fees, or if your credit card processor does not permit reference transactions. Please note that in some cases, shoppers who abandon your cart late in the process may find that there is a payment authorization outstanding from your company, which will go away on its own in a few days/weeks. This authorization can be reversal by voiding it, however, there is no guarantee the card-issuing bank will accept this request.","Select Full Auth if you want to minimize your credit card processing fees, or if your credit card processor does not permit reference transactions. Please note that in some cases, shoppers who abandon your cart late in the process may find that there is a payment authorization outstanding from your company, which will go away on its own in a few days/weeks. This authorization can be reversal by voiding it, however, there is no guarantee the card-issuing bank will accept this request." "Select Range","Select Range" "Select date","Select date" "Selected allowed currency ""%s"" is not available in installed currencies.","Selected allowed currency ""%s"" is not available in installed currencies." @@ -821,6 +835,8 @@ "Self-assigned roles cannot be deleted.","Self-assigned roles cannot be deleted." "Sender","Sender" "Separate Email","Separate Email" +"Service Settings","Service Settings" +"Set up & Customize","Set up & Customize" "Shipment #%s comment added","Shipment #%s comment added" "Shipment #%s created","Shipment #%s created" "Shipment Comments","Shipment Comments" @@ -840,8 +856,6 @@ "Show By","Show By" "Show Report For","Show Report For" "Show Reviews","Show Reviews" -"Show confirmation page: ","Show confirmation page: " -"Silent Post URL:","Silent Post URL:" "Sitemap Information","Sitemap Information" "Size for %s","Size for %s" "Skip Category Selection","Skip Category Selection" @@ -914,7 +928,7 @@ "The account has been saved.","The account has been saved." "The archive can be uncompressed with %s on Windows systems","The archive can be uncompressed with %s on Windows systems" "The attribute set has been removed.","The attribute set has been removed." -"The backup has been created.","The backup has been created." +"The backup's creation process will take time.","The backup's creation process will take time." "The billing agreement has been canceled.","The billing agreement has been canceled." "The billing agreement has been deleted.","The billing agreement has been deleted." "The cache storage has been flushed.","The cache storage has been flushed." @@ -945,6 +959,7 @@ "The invoice has been created.","The invoice has been created." "The invoice has been voided.","The invoice has been voided." "The invoice no longer exists.","The invoice no longer exists." +"The item %s (SKU %s) does not exist in the catalog anymore.","The item %s (SKU %s) does not exist in the catalog anymore." "The order does not allow creating an invoice.","The order does not allow creating an invoice." "The order no longer exists.","The order no longer exists." "The poll has been deleted.","The poll has been deleted." @@ -961,10 +976,11 @@ "The role has been successfully saved.","The role has been successfully saved." "The search index has been rebuilt.","The search index has been rebuilt." "The shipment has been created.","The shipment has been created." -"The shipment has been created. The shipping label has been created.","The shipment has been created. The shipping label has been created." "The shipment has been sent.","The shipment has been sent." +"The shipping label has been created.","The shipping label has been created." "The tag has been deleted.","The tag has been deleted." "The tag has been saved.","The tag has been saved." +"The transaction details have been updated.","The transaction details have been updated." "The user has been deleted.","The user has been deleted." "The user has been saved.","The user has been saved." "Themes JavaScript and CSS files combined to one file.","Themes JavaScript and CSS files combined to one file." @@ -975,6 +991,7 @@ "This Role no longer exists.","This Role no longer exists." "This account is","This account is" "This account is inactive.","This account is inactive." +"This action cannot be undone.","This action cannot be undone." "This attribute set does not have attributes which we can use for configurable product","This attribute set does not have attributes which we can use for configurable product" "This attribute shares the same value in all the stores","This attribute shares the same value in all the stores" "This is a demo store. Any orders placed through this store will not be honored or fulfilled.","This is a demo store. Any orders placed through this store will not be honored or fulfilled." @@ -989,7 +1006,8 @@ "Timeout limit for response from synchronize process was reached.","Timeout limit for response from synchronize process was reached." "To","To" "To cancel pending authorizations and release amounts that have already been processed during this payment, click Cancel.","To cancel pending authorizations and release amounts that have already been processed during this payment, click Cancel." -"To use Payflow Link, you must configure your Payflow Link account on the Paypal website.","To use Payflow Link, you must configure your Payflow Link account on the Paypal website." +"To use PayPal Payflow Link you must configure some settings in your Payflow account by logging into","To use PayPal Payflow Link you must configure some settings in your Payflow account by logging into" +"To use PayPal Payments Advanced you must configure some settings in your PayPal Payments Advanced account by logging into","To use PayPal Payments Advanced you must configure some settings in your PayPal Payments Advanced account by logging into" "Toggle Editor","Toggle Editor" "Tools","Tools" "Top 5 Search Terms","Top 5 Search Terms" @@ -1000,7 +1018,10 @@ "Total of %d record(s) have been deleted.","Total of %d record(s) have been deleted." "Total of %d record(s) have been updated.","Total of %d record(s) have been updated." "Total of %d record(s) were canceled.","Total of %d record(s) were canceled." +"Total of %d record(s) were deleted","Total of %d record(s) were deleted" "Total of %d record(s) were deleted.","Total of %d record(s) were deleted." +"Total of %d record(s) were updated","Total of %d record(s) were updated" +"Total of %d record(s) were updated.","Total of %d record(s) were updated." "Track Order","Track Order" "Track this shipment","Track this shipment" "Tracking number %s for %s assigned","Tracking number %s for %s assigned" @@ -1029,6 +1050,7 @@ "Unable to save the invoice.","Unable to save the invoice." "Unable to send the invoice email.","Unable to send the invoice email." "Unable to send the shipment email.","Unable to send the shipment email." +"Unable to update transaction details.","Unable to update transaction details." "Unable to void the credit memo.","Unable to void the credit memo." "Unknown","Unknown" "Unlimited","Unlimited" @@ -1045,7 +1067,7 @@ "Use Default","Use Default" "Use Default Value","Use Default Value" "Use Default Variable Values","Use Default Variable Values" -"Use Silent Post:","Use Silent Post:" +"Use FTP Connection","Use FTP Connection" "Use Website","Use Website" "Used Currently For","Used Currently For" "Used as Default For","Used as Default For" @@ -1056,11 +1078,14 @@ "User Name","User Name" "User Name is required field.","User Name is required field." "User Name:","User Name:" +"User Password","User Password" "User Role","User Role" "User Roles","User Roles" "User Roles Information","User Roles Information" "User name","User name" "Users","Users" +"VAT Number is Invalid","VAT Number is Invalid" +"VAT Number is Valid","VAT Number is Valid" "Validation Results","Validation Results" "Value","Value" "Value Delimiter:","Value Delimiter:" @@ -1077,20 +1102,19 @@ "View Shipment","View Shipment" "View Statistics For","View Statistics For" "Visibility:","Visibility:" +"Warning","Warning" "Warning! Empty value can cause problems with CSV format.","Warning! Empty value can cause problems with CSV format." "Warning!\r\nThis action will remove this user from already assigned role\r\nAre you sure?","Warning!\r\nThis action will remove this user from already assigned role\r\nAre you sure?" "Warning!\r\nThis action will remove those users from already assigned roles\r\nAre you sure?","Warning!\r\nThis action will remove those users from already assigned roles\r\nAre you sure?" "Warning: Please do not close the window during importing/exporting data","Warning: Please do not close the window during importing/exporting data" "Watermark File for %s","Watermark File for %s" "We appreciate our merchants\' feedback, please take our survey to provide insight on the features you would like included in Magento. Remove this notification","We appreciate our merchants\' feedback, please take our survey to provide insight on the features you would like included in Magento. Remove this notification" -"We detected that your JavaScript seem to be disabled.","We detected that your JavaScript seem to be disabled." "We\'re in our typing table, coding away more features for Magento. Thank you for your patience.","We\'re in our typing table, coding away more features for Magento. Thank you for your patience." "Web Section","Web Section" "Web Services","Web Services" "Web services","Web services" "Website","Website" "What is this?","What is this?" -"When using Payflow Link in Magento, a payment authorization transaction must be performed after the shopper enters their credit card information on the Payment page of checkout. If a full authorization is performed for the entire dollar amount of the transaction, then in some cases, the transaction amount might be reserved on the shopper\'s credit card for up to 30 days, even if they abandon their cart. This is not an ideal customer experience. Using this advanced setting in Magento, you can configure key details of this authorization.","When using Payflow Link in Magento, a payment authorization transaction must be performed after the shopper enters their credit card information on the Payment page of checkout. If a full authorization is performed for the entire dollar amount of the transaction, then in some cases, the transaction amount might be reserved on the shopper\'s credit card for up to 30 days, even if they abandon their cart. This is not an ideal customer experience. Using this advanced setting in Magento, you can configure key details of this authorization." "Wishlist Report","Wishlist Report" "Wishlist item is not loaded.","Wishlist item is not loaded." "Wrong account specified.","Wrong account specified." @@ -1112,10 +1136,13 @@ "Yes (only price with tax)","Yes (only price with tax)" "You cannot delete your own account.","You cannot delete your own account." "You have %s unread message(s).","You have %s unread message(s)." +"You have %s unread message(s). Go to messages inbox.","You have %s unread message(s). Go to messages inbox." +"You have %s, %s and %s unread messages. Go to messages inbox.","You have %s, %s and %s unread messages. Go to messages inbox." "You have logged out.","You have logged out." "You have not enough permissions to use this functionality.","You have not enough permissions to use this functionality." "You must have JavaScript enabled in your browser to utilize the functionality of this website.","You must have JavaScript enabled in your browser to utilize the functionality of this website." "You need to specify order items.","You need to specify order items." +"You will need to wait when the action ends.","You will need to wait when the action ends." "Your answers contain duplicates.","Your answers contain duplicates." "Your password has been updated.","Your password has been updated." "Your password reset link has expired.","Your password reset link has expired." @@ -1132,11 +1159,13 @@ "critical","critical" "example: ""sitemap/"" or ""/"" for base path (path must be writeable)","example: ""sitemap/"" or ""/"" for base path (path must be writeable)" "example: sitemap.xml","example: sitemap.xml" +"failed","failed" "from","from" "major","major" "minor","minor" "notice","notice" "store(%s) scope","store(%s) scope" +"successful","successful" "to","to" "website(%s) scope","website(%s) scope" "{{base_url}} is not recommended to use in a production environment to declare the Base Unsecure URL / Base Secure URL. It is highly recommended to change this value in your Magento configuration.","{{base_url}} is not recommended to use in a production environment to declare the Base Unsecure URL / Base Secure URL. It is highly recommended to change this value in your Magento configuration." diff --git a/app/locale/en_US/Mage_Backup.csv b/app/locale/en_US/Mage_Backup.csv index 6248e8ae5c..ce622aa51f 100644 --- a/app/locale/en_US/Mage_Backup.csv +++ b/app/locale/en_US/Mage_Backup.csv @@ -1,19 +1,49 @@ "Action","Action" +"An error occurred while creating the backup.","An error occurred while creating the backup." "An error occurred while writing to the backup file ""%s"".","An error occurred while writing to the backup file ""%s""." +"Are you sure you want to delete the selected backup(s)?","Are you sure you want to delete the selected backup(s)?" +"Backup Type","Backup Type" "Backup file ""%s"" cannot be read from or written to.","Backup file ""%s"" cannot be read from or written to." "Backup file ""%s"" does not exist.","Backup file ""%s"" does not exist." "Backup file does not exist.","Backup file does not exist." "Backup file handler was unspecified.","Backup file handler was unspecified." +"Backup file not found","Backup file not found" "Backup file path was not specified.","Backup file path was not specified." "Backups","Backups" "Cannot read backup file.","Cannot read backup file." "Create Backup","Create Backup" -"DB","DB" +"Database Backup","Database Backup" +"Database and Media Backup","Database and Media Backup" "Database was successfuly backed up.","Database was successfuly backed up." "Download","Download" +"Enable Scheduled Backup","Enable Scheduled Backup" +"Failed to connect to FTP","Failed to connect to FTP" +"Failed to delete one or several backups.","Failed to delete one or several backups." +"Failed to rollback","Failed to rollback" +"Failed to validate FTP","Failed to validate FTP" +"Frequency","Frequency" +"Invalid Password.","Invalid Password." +"Maintenance Mode","Maintenance Mode" +"Not enough free space to create backup.","Not enough free space to create backup." +"Not enough permissions to create backup.","Not enough permissions to create backup." +"Not enough permissions to perform rollback","Not enough permissions to perform rollback" +"Please deselect the sufficient check-box, if you want to continue backup's creation","Please deselect the sufficient check-box, if you want to continue backup's creation" +"Please deselect the sufficient check-box, if you want to continue rollback processing","Please deselect the sufficient check-box, if you want to continue rollback processing" +"Put store on the maintenance mode while backup's creation","Put store on the maintenance mode while backup's creation" +"Rollback","Rollback" +"Scheduled Backup Settings","Scheduled Backup Settings" "Size, Bytes","Size, Bytes" +"Start Time","Start Time" +"System Backup","System Backup" +"System couldn't put store on the maintenance mode","System couldn't put store on the maintenance mode" +"The database and media backup has been created.","The database and media backup has been created." +"The database backup has been created.","The database backup has been created." "The file was compressed with Zlib, but this extension is not installed on server.","The file was compressed with Zlib, but this extension is not installed on server." +"The selected backup(s) has been deleted.","The selected backup(s) has been deleted." +"The system backup has been created.","The system backup has been created." "Time","Time" "Type","Type" "Unable to create backup. Please, try again later.","Unable to create backup. Please, try again later." +"Unable to save the cron expression.","Unable to save the cron expression." +"Warning! System couldn't put store on the maintenance mode.","Warning! System couldn't put store on the maintenance mode." "Wrong order of creation for new backup.","Wrong order of creation for new backup." diff --git a/app/locale/en_US/Mage_Captcha.csv b/app/locale/en_US/Mage_Captcha.csv new file mode 100644 index 0000000000..e5a7814ab6 --- /dev/null +++ b/app/locale/en_US/Mage_Captcha.csv @@ -0,0 +1,22 @@ +"Attention: Captcha is case sensitive.","Attention: Captcha is case sensitive." +"After number of attempts to login","After number of attempts to login" +"Always","Always" +"CAPTCHA","CAPTCHA" +"CAPTCHA Timeout (minutes)","CAPTCHA Timeout (minutes)" +"CAPTCHA for ""Create user"" and ""Forgot password"" forms is always enabled if chosen","CAPTCHA for ""Create user"" and ""Forgot password"" forms is always enabled if chosen" +"Case Sensitive","Case Sensitive" +"Displaying Mode","Displaying Mode" +"Enable CAPTCHA in Admin","Enable CAPTCHA in Admin" +"Enable CAPTCHA on Frontend","Enable CAPTCHA on Frontend" +"Font","Font" +"Forms","Forms" +"If 0 is specified, CAPTCHA on the Login form will be always available.","If 0 is specified, CAPTCHA on the Login form will be always available." +"Incorrect CAPTCHA.","Incorrect CAPTCHA." +"Number of Symbols","Number of Symbols" +"Number of Unsuccessful Attempts to Login","Number of Unsuccessful Attempts to Login" +"Please specify 8 symbols at the most. Range allowed (e.g. 3-5)","Please specify 8 symbols at the most. Range allowed (e.g. 3-5)" +"Please type the letters below","Please type the letters below" +"Please type the letters from the image:","Please type the letters from the image:" +"Please use only letters (a-z or A-Z) or numbers (0-9) in this field. No spaces or other characters are allowed.
    Similar looking characters (e.g. ""i"", ""l"", ""1"") decrease chance of correct recognition by customer.","Please use only letters (a-z or A-Z) or numbers (0-9) in this field. No spaces or other characters are allowed.
    Similar looking characters (e.g. ""i"", ""l"", ""1"") decrease chance of correct recognition by customer." +"Reload captcha","Reload captcha" +"Symbols Used in CAPTCHA","Symbols Used in CAPTCHA" diff --git a/app/locale/en_US/Mage_Catalog.csv b/app/locale/en_US/Mage_Catalog.csv index 7c10041ff9..698def10c6 100644 --- a/app/locale/en_US/Mage_Catalog.csv +++ b/app/locale/en_US/Mage_Catalog.csv @@ -2,9 +2,9 @@ "%1$s incl tax.","%1$s incl tax." "%s - %s","%s - %s" "%s Item(s)","%s Item(s)" +"%s and above","%s and above" "(%d)","(%d)" "(Copy data from: %s)","(Copy data from: %s)" -"(Will make search for the query above return results for this search.)","(Will make search for the query above return results for this search.)" "* Required Fields","* Required Fields" "-- Please Select --","-- Please Select --" "86400 by default, if not set. To refresh instantly, Clear the Blocks HTML Output Cache.","86400 by default, if not set. To refresh instantly, Clear the Blocks HTML Output Cache." @@ -20,6 +20,7 @@ "Add Attribute","Add Attribute" "Add Design Change","Add Design Change" "Add Group","Add Group" +"Add Group Price","Add Group Price" "Add New","Add New" "Add New Attribute","Add New Attribute" "Add New Attribute Set","Add New Attribute Set" @@ -60,6 +61,7 @@ "An error occurred while removing products from websites.","An error occurred while removing products from websites." "An error occurred while saving the URL rewrite","An error occurred while saving the URL rewrite" "An error occurred while saving the attribute set.","An error occurred while saving the attribute set." +"An error occurred while saving the collection, aborting. Error message: %s","An error occurred while saving the collection, aborting. Error message: %s" "An error occurred while saving the product. ","An error occurred while saving the product. " "An error occurred while saving the search query.","An error occurred while saving the search query." "An error occurred while saving this group.","An error occurred while saving this group." @@ -95,6 +97,7 @@ "Attribute Set","Attribute Set" "Attribute Sets","Attribute Sets" "Attribute add","Attribute add" +"Attribute code is invalid. Please use only letters (a-z), numbers (0-9) or underscore(_) in this field, first character should be a letter.","Attribute code is invalid. Please use only letters (a-z), numbers (0-9) or underscore(_) in this field, first character should be a letter." "Attribute group with the \"/name/\" name already exists","Attribute group with the \"/name/\" name already exists" "Attribute remove","Attribute remove" "Attribute with the same code already exists","Attribute with the same code already exists" @@ -233,10 +236,12 @@ "Delete Attribute","Delete Attribute" "Delete Attribute Set","Delete Attribute Set" "Delete Category","Delete Category" +"Delete Group Price","Delete Group Price" "Delete Option","Delete Option" "Delete Row","Delete Row" "Delete Search","Delete Search" "Delete Selected Group","Delete Selected Group" +"Delete Tier","Delete Tier" "Delete attribute","Delete attribute" "Delete category","Delete category" "Delete product","Delete product" @@ -251,6 +256,7 @@ "Double click on above image to view full picture","Double click on above image to view full picture" "Downloadable Information","Downloadable Information" "Duplicate","Duplicate" +"Duplicate website group price customer group.","Duplicate website group price customer group." "Duplicate website tier price customer group and quantity.","Duplicate website tier price customer group and quantity." "Duplicate website, country and state tax found.","Duplicate website, country and state tax found." "E.g. {{media url=""path/to/image.jpg""}} {{skin url=""path/to/picture.gif""}}. Dynamic directives parsing impacts catalog performance.","E.g. {{media url=""path/to/image.jpg""}} {{skin url=""path/to/picture.gif""}}. Dynamic directives parsing impacts catalog performance." @@ -285,6 +291,7 @@ "First Name","First Name" "Fixed","Fixed" "For internal use.","For internal use." +"For the last time placed.","For the last time placed." "Frontend","Frontend" "Frontend Model","Frontend Model" "Frontend Properties","Frontend Properties" @@ -377,10 +384,13 @@ "Max Characters","Max Characters" "Maximal Depth","Maximal Depth" "Maximum Image Size","Maximum Image Size" +"Maximum Number of Price Intervals","Maximum Number of Price Intervals" "Maximum Qty Allowed in Shopping Cart","Maximum Qty Allowed in Shopping Cart" +"Maximum allowed image size for '%s' is %sx%s px.","Maximum allowed image size for '%s' is %sx%s px." "Maximum image height","Maximum image height" "Maximum image width","Maximum image width" "Maximum number of characters:","Maximum number of characters:" +"Maximum number of price intervals is 100","Maximum number of price intervals is 100" "Media Image","Media Image" "Minimum Advertised Price","Minimum Advertised Price" "Minimum Lines per Page","Minimum Lines per Page" @@ -415,7 +425,8 @@ "Notify for Quantity Below","Notify for Quantity Below" "Number of Products to Display","Number of Products to Display" "Number of Uses","Number of Uses" -"Number of results
    (For the last time placed)","Number of results
    (For the last time placed)" +"Number of results","Number of results" +"Number of results (For the last time placed)","Number of results (For the last time placed)" "OK","OK" "OR","OR" "Old Price:","Old Price:" @@ -613,8 +624,12 @@ "Simple Product","Simple Product" "Site Map","Site Map" "Sitemap","Sitemap" +"Skip import row, is not valid value ""%s"" for field ""%s""","Skip import row, is not valid value ""%s"" for field ""%s""" "Skip import row, required field ""%s"" for the new customer is not defined.","Skip import row, required field ""%s"" for the new customer is not defined." +"Skip import row, the value ""%s"" is invalid for field ""%s""","Skip import row, the value ""%s"" is invalid for field ""%s""" +"Skipping import row, required field ""%s"" for new products is not defined.","Skipping import row, required field ""%s"" for new products is not defined." "Skipping import row, required field ""%s"" is not defined.","Skipping import row, required field ""%s"" is not defined." +"Skipping import row, store ""%s"" field does not exist.","Skipping import row, store ""%s"" field does not exist." "Skipping import row, the value ""%s"" is not valid for the ""%s"" field.","Skipping import row, the value ""%s"" is not valid for the ""%s"" field." "Some of the processed products have no SKU value defined. Please fill it prior to performing operations on these products.","Some of the processed products have no SKU value defined. Please fill it prior to performing operations on these products." "Some of the products below do not have all the required options. Please edit them and configure all the required options.","Some of the products below do not have all the required options. Please edit them and configure all the required options." @@ -648,6 +663,8 @@ "The category has been deleted.","The category has been deleted." "The category has been saved.","The category has been saved." "The comparison list was cleared.","The comparison list was cleared." +"The file '%s' for '%s' has an invalid extension","The file '%s' for '%s' has an invalid extension" +"The file '%s' you uploaded is larger than %s Megabytes allowed by server","The file '%s' you uploaded is larger than %s Megabytes allowed by server" "The file you uploaded is larger than %s Megabytes allowed by server","The file you uploaded is larger than %s Megabytes allowed by server" "The filters must be an array.","The filters must be an array." "The image contents is not valid base64 data.","The image contents is not valid base64 data." @@ -698,6 +715,7 @@ "Total incl. Tax: %1$s","Total incl. Tax: %1$s" "Total of %d record(s) have been deleted.","Total of %d record(s) have been deleted." "Total of %d record(s) have been updated.","Total of %d record(s) have been updated." +"Total of %d record(s) were updated","Total of %d record(s) were updated" "Type","Type" "URL Rewrite Management","URL Rewrite Management" "Unable to complete this request.","Unable to complete this request." @@ -766,6 +784,7 @@ "Websites","Websites" "What's this?","What's this?" "Whether to show ""All"" option in the ""Show X Per Page"" dropdown.","Whether to show ""All"" option in the ""Show X Per Page"" dropdown." +"Will make search for the query above return results for this search.","Will make search for the query above return results for this search." "Wrong BuyRequest instance in options group.","Wrong BuyRequest instance in options group." "Wrong configuration item instance in options group.","Wrong configuration item instance in options group." "Wrong configuration item option instance in options group.","Wrong configuration item option instance in options group." @@ -781,8 +800,8 @@ "You may also be interested in the following product(s)","You may also be interested in the following product(s)" "Zoom In","Zoom In" "Zoom Out","Zoom Out" -"[GLOBAL]","[GLOBAL]" "and","and" +"and above","and above" "categories","categories" "each","each" "ex. http://domain.com","ex. http://domain.com" diff --git a/app/locale/en_US/Mage_CatalogInventory.csv b/app/locale/en_US/Mage_CatalogInventory.csv index b5e39e4dc4..9f785b5578 100644 --- a/app/locale/en_US/Mage_CatalogInventory.csv +++ b/app/locale/en_US/Mage_CatalogInventory.csv @@ -1,3 +1,4 @@ +"""%s"" is not available in the requested quantity. %s of the items will be backordered.","""%s"" is not available in the requested quantity. %s of the items will be backordered." "%s is available for purchase in increments of %s only.","%s is available for purchase in increments of %s only." "%s is not a correct comparsion method.","%s is not a correct comparsion method." "Note that these settings are applicable to cart line items, not the whole cart.","Note that these settings are applicable to cart line items, not the whole cart." @@ -11,6 +12,7 @@ "Cannot specify product identifier for the order item.","Cannot specify product identifier for the order item." "Catalog Inventory","Catalog Inventory" "Decrease Stock When Order is Placed","Decrease Stock When Order is Placed" +"Display Out of Stock Products","Display Out of Stock Products" "Enable Qty Increments","Enable Qty Increments" "In Stock","In Stock" "Index Product Stock Status","Index Product Stock Status" @@ -33,12 +35,19 @@ "Retrieve stock data by product ids","Retrieve stock data by product ids" "Rule price","Rule price" "Set Items' Status to be In Stock When Order is Cancelled","Set Items' Status to be In Stock When Order is Cancelled" +"Some of the products are currently out of stock","Some of the products are currently out of stock" +"Some of the products cannot be ordered in requested quantity.","Some of the products cannot be ordered in requested quantity." "Some of the products cannot be ordered in the requested quantity.","Some of the products cannot be ordered in the requested quantity." "Stock Options","Stock Options" "Stock Status","Stock Status" +"The maximum quantity allowed for purchase is %s.","The maximum quantity allowed for purchase is %s." +"The minimum quantity allowed for purchase is %s.","The minimum quantity allowed for purchase is %s." +"The requested quantity for ""%s"" is not available.","The requested quantity for ""%s"" is not available." "The stock item for Product in option is not valid.","The stock item for Product in option is not valid." "The stock item for Product is not valid.","The stock item for Product is not valid." "This product is available for purchase in increments of %s only.","This product is available for purchase in increments of %s only." +"This product is currently out of stock.","This product is currently out of stock." +"This product is not available in the requested quantity. %s of the items will be backordered.","This product is not available in the requested quantity. %s of the items will be backordered." "To Fixed Value","To Fixed Value" "To Percentage","To Percentage" "Undefined product type.","Undefined product type." diff --git a/app/locale/en_US/Mage_CatalogSearch.csv b/app/locale/en_US/Mage_CatalogSearch.csv index 705f59c1f6..9149c0114e 100644 --- a/app/locale/en_US/Mage_CatalogSearch.csv +++ b/app/locale/en_US/Mage_CatalogSearch.csv @@ -21,6 +21,7 @@ "Maximum Query Length","Maximum Query Length" "Maximum Query Words Count","Maximum Query Words Count" "Maximum Search query length is %s. Your query was cut.","Maximum Search query length is %s. Your query was cut." +"Maximum words count is %1$s. In your search query was cut next part: %2$s.","Maximum words count is %1$s. In your search query was cut next part: %2$s." "Minimal Query Length","Minimal Query Length" "Minimum Search query length is %s","Minimum Search query length is %s" "Modify your search","Modify your search" diff --git a/app/locale/en_US/Mage_Checkout.csv b/app/locale/en_US/Mage_Checkout.csv index 34f9742a36..6617d2a6ee 100644 --- a/app/locale/en_US/Mage_Checkout.csv +++ b/app/locale/en_US/Mage_Checkout.csv @@ -58,6 +58,7 @@ "Checkout as a Guest or Register","Checkout as a Guest or Register" "Checkout with Multiple Addresses","Checkout with Multiple Addresses" "City","City" +"Clear Shopping Cart","Clear Shopping Cart" "Click here to print a copy of your order confirmation.","Click here to print a copy of your order confirmation." "Click here to continue shopping.","Click here to continue shopping." "Close","Close" @@ -82,6 +83,7 @@ "Create Shipping Address","Create Shipping Address" "Create an order from shopping cart","Create an order from shopping cart" "Create shopping cart","Create shopping cart" +"Customer Address is not valid.","Customer Address is not valid." "Customer Information","Customer Information" "Customer's information","Customer's information" "Data saving problem","Data saving problem" @@ -100,6 +102,7 @@ "Edit","Edit" "Edit Address","Edit Address" "Edit Billing Address","Edit Billing Address" +"Edit Condition","Edit Condition" "Edit Items","Edit Items" "Edit Shipping Address","Edit Shipping Address" "Edit Terms and Conditions","Edit Terms and Conditions" @@ -131,7 +134,11 @@ "HTML","HTML" "ID","ID" "Incl. Tax","Incl. Tax" +"Invalid checkout type.","Invalid checkout type." +"Invalid data.","Invalid data." +"Invalid email address ""%s""","Invalid email address ""%s""" "Invalid method: %s","Invalid method: %s" +"Invalid shipping method.","Invalid shipping method." "Item not found or already ordered","Item not found or already ordered" "Items","Items" "Items After","Items After" @@ -140,7 +147,7 @@ "Loading next step...","Loading next step..." "Login","Login" "Login/Registration Before","Login/Registration Before" -"Manage Checkout Terms and Conditions","Manage Checkout Terms and Conditions" +"Manage Terms and Conditions","Manage Terms and Conditions" "Maximum Display Recently Added Item(s)","Maximum Display Recently Added Item(s)" "Maximum qty allowed for Shipping to multiple addresses is %s","Maximum qty allowed for Shipping to multiple addresses is %s" "Move to Wishlist","Move to Wishlist" @@ -163,6 +170,7 @@ "My Cart Link","My Cart Link" "New Address","New Address" "New Condition","New Condition" +"New Terms and Conditions","New Terms and Conditions" "ORDER TOTAL WILL BE DISPLAYED BEFORE YOU SUBMIT THE ORDER","ORDER TOTAL WILL BE DISPLAYED BEFORE YOU SUBMIT THE ORDER" "One Page Checkout","One Page Checkout" "One Page Checkout Failure","One Page Checkout Failure" @@ -193,10 +201,17 @@ "Please agree to all Terms and Conditions before placing the order.","Please agree to all Terms and Conditions before placing the order." "Please agree to all Terms and Conditions before placing the orders.","Please agree to all Terms and Conditions before placing the orders." "Please agree to all the terms and conditions before placing the order.","Please agree to all the terms and conditions before placing the order." +"Please check billing address information.","Please check billing address information." +"Please check shipping address information.","Please check shipping address information." +"Please check shipping addresses information.","Please check shipping addresses information." "Please log in below:","Please log in below:" "Please select region, state or province","Please select region, state or province" "Please select shipping address for applicable items","Please select shipping address for applicable items" "Please select shipping methods for all addresses","Please select shipping methods for all addresses" +"Please select valid payment method.","Please select valid payment method." +"Please specify payment method.","Please specify payment method." +"Please specify shipping method.","Please specify shipping method." +"Please specify shipping methods for all addresses.","Please specify shipping methods for all addresses." "Price","Price" "Proceed to Checkout","Proceed to Checkout" "Product","Product" @@ -219,6 +234,7 @@ "Remove item","Remove item" "Remove product from shopping cart","Remove product from shopping cart" "Remove product(s) from shopping cart","Remove product(s) from shopping cart" +"Require Customer To Be Logged In To Checkout","Require Customer To Be Logged In To Checkout" "Retrieve information about shopping cart","Retrieve information about shopping cart" "Review Order","Review Order" "Review Order - %s","Review Order - %s" @@ -262,6 +278,8 @@ "Some of the requested products are not available in the desired quantity.","Some of the requested products are not available in the desired quantity." "Some of the requested products are unavailable.","Some of the requested products are unavailable." "Some products quantities were recalculated because of quantity increment mismatch","Some products quantities were recalculated because of quantity increment mismatch" +"Sorry, guest checkout is not enabled. Please try again or contact store owner.","Sorry, guest checkout is not enabled. Please try again or contact store owner." +"Sorry, guest checkout is not enabled. Please try again or contact the store owner.","Sorry, guest checkout is not enabled. Please try again or contact the store owner." "Sorry, no quotes are available for this order at this time.","Sorry, no quotes are available for this order at this time." "State/Province","State/Province" "Status","Status" @@ -283,6 +301,7 @@ "The product does not exist.","The product does not exist." "There are %s items in your cart.","There are %s items in your cart." "There is 1 item in your cart.","There is 1 item in your cart." +"There is already a customer registered using this email address. Please login using this email address or enter a different email address to register your account.","There is already a customer registered using this email address. Please login using this email address or enter a different email address to register your account." "There was an error processing your order. Please contact us or try again later.","There was an error processing your order. Please contact us or try again later." "This condition no longer exists.","This condition no longer exists." "Total","Total" @@ -296,6 +315,7 @@ "Update product quantities in shopping cart","Update product quantities in shopping cart" "Update product(s) quantities in shopping cart","Update product(s) quantities in shopping cart" "Use Billing Address","Use Billing Address" +"VAT Number","VAT Number" "We are processing your order and you will soon receive an email with details of the order. Once the order has shipped you will receive another email with a link to track its progress.","We are processing your order and you will soon receive an email with details of the order. Once the order has shipped you will receive another email with a link to track its progress." "What's this?","What's this?" "You have no items in your shopping cart.","You have no items in your shopping cart." diff --git a/app/locale/en_US/Mage_Core.csv b/app/locale/en_US/Mage_Core.csv index 9e8b14263d..fedcaa2752 100644 --- a/app/locale/en_US/Mage_Core.csv +++ b/app/locale/en_US/Mage_Core.csv @@ -35,8 +35,10 @@ "Base JavaScript URL","Base JavaScript URL" "Base Link URL","Base Link URL" "Base Media URL","Base Media URL" +"Base Secure URL","Base Secure URL" "Base Skin URL","Base Skin URL" "Base URL","Base URL" +"Base Unsecure URL","Base Unsecure URL" "Before modifying the store view code please make sure that it is not used in index.php.","Before modifying the store view code please make sure that it is not used in index.php." "Before modifying the website code please make sure that it is not used in index.php.","Before modifying the website code please make sure that it is not used in index.php." "Block with name ""%s"" already exists","Block with name ""%s"" already exists" @@ -58,6 +60,7 @@ "Copyright","Copyright" "Core","Core" "Countries Options","Countries Options" +"Country","Country" "Create Store","Create Store" "Create Store View","Create Store View" "Create Website","Create Website" @@ -69,6 +72,10 @@ "Custom Email 1","Custom Email 1" "Custom Email 2","Custom Email 2" "Custom Variables","Custom Variables" +"Custom1 Contact Email","Custom1 Contact Email" +"Custom1 Contact Name","Custom1 Contact Name" +"Custom2 Contact Email","Custom2 Contact Email" +"Custom2 Contact Name","Custom2 Contact Name" "Customer Support","Customer Support" "Dashboard","Dashboard" "Date From","Date From" @@ -112,12 +119,14 @@ "Environment Update Time","Environment Update Time" "Error in file: ""%s"" - %s","Error in file: ""%s"" - %s" "Error: Passwords do not match","Error: Passwords do not match" +"European Union Countries","European Union Countries" "Exceptions Log File Name","Exceptions Log File Name" "Favicon Icon","Favicon Icon" "File %s does not exist","File %s does not exist" "File %s is not readable","File %s is not readable" "File not found","File not found" "File system","File system" +"File with an extension ""%value%"" is protected and cannot be uploaded","File with an extension ""%value%"" is protected and cannot be uploaded" "First Day of Week","First Day of Week" "Flush Cache Storage","Flush Cache Storage" "Flush Magento Cache","Flush Magento Cache" @@ -126,6 +135,8 @@ "Forgot Password Email Template","Forgot Password Email Template" "General","General" "General Contact","General Contact" +"General Contact Email","General Contact Email" +"General Contact Name","General Contact Name" "General Settings","General Settings" "Global","Global" "HTML Head","HTML Head" @@ -170,6 +181,7 @@ "Miscellaneous Scripts","Miscellaneous Scripts" "Model class does not exist: %s.","Model class does not exist: %s." "Model collection resource name is not defined.","Model collection resource name is not defined." +"Module ""%1$s"" cannot depend on ""%2$s"".","Module ""%1$s"" cannot depend on ""%2$s""." "Module ""%1$s"" requires module ""%2$s"".","Module ""%1$s"" requires module ""%2$s""." "Name","Name" "New Design Change","New Design Change" @@ -178,6 +190,7 @@ "New Website","New Website" "No","No" "Offloader header","Offloader header" +"PHP SOAP extension is required.","PHP SOAP extension is required." "Package","Package" "Pagination","Pagination" "Pagination Frame","Pagination Frame" @@ -253,6 +266,8 @@ "Return-Path Email","Return-Path Email" "Root Category","Root Category" "Sales Representative","Sales Representative" +"Sales Representative Contact Email","Sales Representative Contact Email" +"Sales Representative Contact Name","Sales Representative Contact Name" "Save","Save" "Save Store","Save Store" "Save Store View","Save Store View" @@ -318,6 +333,7 @@ "This is a required field.","This is a required field." "This store cannot be deleted.","This store cannot be deleted." "This store view cannot be deleted.","This store view cannot be deleted." +"This value must be greater than 0.","This value must be greater than 0." "This website cannot be deleted.","This website cannot be deleted." "This will be displayed just before body closing tag.","This will be displayed just before body closing tag." "This will be included before head closing tag in page HTML.","This will be included before head closing tag in page HTML." @@ -348,6 +364,7 @@ "Use Secure URLs in Admin","Use Secure URLs in Admin" "Use Secure URLs in Frontend","Use Secure URLs in Frontend" "Use Web Server Rewrites","Use Web Server Rewrites" +"VAT Number","VAT Number" "Validate HTTP_USER_AGENT","Validate HTTP_USER_AGENT" "Validate HTTP_VIA","Validate HTTP_VIA" "Validate HTTP_X_FORWARDED_FOR","Validate HTTP_X_FORWARDED_FOR" diff --git a/app/locale/en_US/Mage_Customer.csv b/app/locale/en_US/Mage_Customer.csv index 728689aac0..93723adcd1 100644 --- a/app/locale/en_US/Mage_Customer.csv +++ b/app/locale/en_US/Mage_Customer.csv @@ -47,6 +47,7 @@ "Back - link to the previously viewed page","Back - link to the previously viewed page" "Back to Login","Back to Login" "Bad request.","Bad request." +"Based on the VAT ID, the customer would belong to Customer Group %s.","Based on the VAT ID, the customer would belong to Customer Group %s." "Bill to Name","Bill to Name" "Bought From","Bought From" "By creating an account with our store, you will be able to move through the checkout process faster, store multiple shipping addresses, view and track your orders in your account and more.","By creating an account with our store, you will be able to move through the checkout process faster, store multiple shipping addresses, view and track your orders in your account and more." @@ -125,6 +126,7 @@ "Delete customer address","Delete customer address" "Deleted Stores","Deleted Stores" "Details","Details" +"Disable Automatic Group Changes Based on VAT ID Default Value","Disable Automatic Group Changes Based on VAT ID Default Value" "Disabled","Disabled" "Edit","Edit" "Edit Account Info","Edit Account Info" @@ -140,6 +142,7 @@ "Email Address","Email Address" "Email Sender","Email Sender" "Email:","Email:" +"Enable Automatic Assignment to Customer Group","Enable Automatic Assignment to Customer Group" "Entity collection is expected.","Entity collection is expected." "Excel XML","Excel XML" "Failed to confirm customer account.","Failed to confirm customer account." @@ -153,6 +156,7 @@ "Form Fields Before","Form Fields Before" "From your My Account Dashboard you have the ability to view a snapshot of your recent account activity and update your account information. Select a link below to view or edit information.","From your My Account Dashboard you have the ability to view a snapshot of your recent account activity and update your account information. Select a link below to view or edit information." "Gender","Gender" +"Gender is required.","Gender is required." "General Subscription","General Subscription" "Generate Human-Friendly Customer ID","Generate Human-Friendly Customer ID" "Global","Global" @@ -160,21 +164,30 @@ "Group","Group" "Group Information","Group Information" "Group Name","Group Name" +"Group for Invalid VAT ID","Group for Invalid VAT ID" +"Group for Valid VAT ID - Domestic","Group for Valid VAT ID - Domestic" +"Group for Valid VAT ID - Intra-Union","Group for Valid VAT ID - Intra-Union" "Guest","Guest" "HTML","HTML" "Hello, %s!","Hello, %s!" "ID","ID" "IP Address","IP Address" "If there is an account associated with %s you will receive an email with a link to reset your password.","If there is an account associated with %s you will receive an email with a link to reset your password." +"If you are a registered VAT customer, please click here to enter you billing address to see proper VAT calculated","If you are a registered VAT customer, please click here to enter you billing address to see proper VAT calculated" +"If you believe this is an error, please contact us at %s","If you believe this is an error, please contact us at %s" "If you have an account with us, please log in.","If you have an account with us, please log in." "Invalid attribute option specified for attribute %s (%s), skipping the record.","Invalid attribute option specified for attribute %s (%s), skipping the record." "Invalid attribute set specified, skipping the record.","Invalid attribute set specified, skipping the record." +"Invalid billing address for (%s)","Invalid billing address for (%s)" "Invalid current password","Invalid current password" "Invalid customer data","Invalid customer data" +"Invalid email address ""%s"".","Invalid email address ""%s""." "Invalid email address.","Invalid email address." "Invalid login or password.","Invalid login or password." "Invalid password reset token.","Invalid password reset token." +"Invalid shipping address for (%s)","Invalid shipping address for (%s)" "Invalid store specified, skipping the record.","Invalid store specified, skipping the record." +"Invalid website, skipping the record, line: %s","Invalid website, skipping the record, line: %s" "Last Activity","Last Activity" "Last Date Subscribed","Last Date Subscribed" "Last Date Unsubscribed","Last Date Unsubscribed" @@ -193,9 +206,14 @@ "MM","MM" "Manage Addresses","Manage Addresses" "Manage Customers","Manage Customers" +"Maximum length must be less then %s symbols","Maximum length must be less then %s symbols" +"Missing email, skipping the record, line: %s","Missing email, skipping the record, line: %s" "Missing email, skipping the record.","Missing email, skipping the record." +"Missing first name, skipping the record, line: %s","Missing first name, skipping the record, line: %s" "Missing firstname, skipping the record.","Missing firstname, skipping the record." +"Missing last name, skipping the record, line: %s","Missing last name, skipping the record, line: %s" "Missing lastname, skipping the record.","Missing lastname, skipping the record." +"Missing website, skipping the record, line: %s","Missing website, skipping the record, line: %s" "Month","Month" "My Account","My Account" "My Account Wrapper","My Account Wrapper" @@ -250,10 +268,23 @@ "Pending","Pending" "Per Website","Per Website" "Personal Information","Personal Information" +"Please enter a valid date between %s and %s at %s.","Please enter a valid date between %s and %s at %s." +"Please enter a valid date equal to or greater than %s at %s.","Please enter a valid date equal to or greater than %s at %s." +"Please enter a valid date less than or equal to %s at %s.","Please enter a valid date less than or equal to %s at %s." +"Please enter the city.","Please enter the city." +"Please enter the country.","Please enter the country." +"Please enter the first name.","Please enter the first name." +"Please enter the last name.","Please enter the last name." +"Please enter the state/province.","Please enter the state/province." +"Please enter the street.","Please enter the street." +"Please enter the telephone number.","Please enter the telephone number." +"Please enter the zip/postal code.","Please enter the zip/postal code." "Please enter your email address below. You will receive a link to reset your password.","Please enter your email address below. You will receive a link to reset your password." "Please enter your email below and we\'ll send you confirmation link for it.","Please enter your email below and we\'ll send you confirmation link for it." "Please enter your email.","Please enter your email." +"Please make sure your passwords match.","Please make sure your passwords match." "Please select","Please select" +"Please select a website which contains store view","Please select a website which contains store view" "Please select region, state or province","Please select region, state or province" "Please, check your email for confirmation key.","Please, check your email for confirmation key." "Prefix Dropdown Options","Prefix Dropdown Options" @@ -312,6 +343,7 @@ "Shipped to Name","Shipped to Name" "Shopping Cart","Shopping Cart" "Shopping Cart - %d item(s)","Shopping Cart - %d item(s)" +"Shopping Cart of %1$s - %2$d item(s)","Shopping Cart of %1$s - %2$d item(s)" "Show Date of Birth","Show Date of Birth" "Show Gender","Show Gender" "Show Middle Name (initial)","Show Middle Name (initial)" @@ -340,20 +372,33 @@ "Text","Text" "Text One Line","Text One Line" "Thank you for registering with %s.","Thank you for registering with %s." +"The Date of Birth is required.","The Date of Birth is required." +"The TAX/VAT number is required.","The TAX/VAT number is required." +"The VAT ID entered (%s) is not a valid VAT ID.","The VAT ID entered (%s) is not a valid VAT ID." +"The VAT ID entered (%s) is not valid VAT ID.","The VAT ID entered (%s) is not valid VAT ID." +"The VAT ID is valid. The current Customer Group will be used.","The VAT ID is valid. The current Customer Group will be used." "The account information has been saved.","The account information has been saved." "The address does not belong to this customer.","The address does not belong to this customer." "The address has been deleted.","The address has been deleted." "The address has been saved.","The address has been saved." +"The customer ID and email did not match, skipping the record, line: %s","The customer ID and email did not match, skipping the record, line: %s" "The customer does not have default billing address.","The customer does not have default billing address." +"The customer email (%s) already exists, skipping the record, line: %s","The customer email (%s) already exists, skipping the record, line: %s" "The customer group has been deleted.","The customer group has been deleted." "The customer group has been saved.","The customer group has been saved." +"The customer is currently assigned to Customer Group %s.","The customer is currently assigned to Customer Group %s." +"The first name cannot be empty.","The first name cannot be empty." "The group ""%s"" cannot be deleted","The group ""%s"" cannot be deleted" +"The last name cannot be empty.","The last name cannot be empty." +"The minimum password length is %s","The minimum password length is %s" +"The password cannot be empty.","The password cannot be empty." "The password must have at least 6 characters. Leading or trailing spaces will be ignored.","The password must have at least 6 characters. Leading or trailing spaces will be ignored." "The suffix that goes after name (Jr., Sr., etc.)","The suffix that goes after name (Jr., Sr., etc.)" "The title that goes before name (Mr., Mrs., etc.)","The title that goes before name (Mr., Mrs., etc.)" "There are no items in customer's wishlist at the moment","There are no items in customer's wishlist at the moment" "There are no items in customer\'s shopping cart at the moment","There are no items in customer\'s shopping cart at the moment" "There is already an account with this email address. If you are sure that it is your email address, click here to get your password and access your account.","There is already an account with this email address. If you are sure that it is your email address, click here to get your password and access your account." +"There was an error validating the VAT ID. Please try again later.","There was an error validating the VAT ID. Please try again later." "This account is not confirmed.","This account is not confirmed." "This account is not confirmed. Click here to resend confirmation email.","This account is not confirmed. Click here to resend confirmation email." "This customer email already exists","This customer email already exists" @@ -361,6 +406,7 @@ "This email does not require confirmation.","This email does not require confirmation." "This email will be sent instead of default welcome email, after account confirmation.","This email will be sent instead of default welcome email, after account confirmation." "This is My Default %s Address","This is My Default %s Address" +"This value must be greater than 0.","This value must be greater than 0." "To Cart","To Cart" "Total","Total" "Type","Type" @@ -374,6 +420,12 @@ "Use as My Default Shipping Address","Use as My Default Shipping Address" "Use as my default billing address","Use as my default billing address" "Use as my default shipping address","Use as my default shipping address" +"VAT Number","VAT Number" +"VAT Request Date","VAT Request Date" +"VAT Request Identifier","VAT Request Identifier" +"Validate VAT Number","Validate VAT Number" +"Validate on Each Transaction","Validate on Each Transaction" +"Validation Error Group","Validation Error Group" "View","View" "View Order","View Order" "Visitor","Visitor" @@ -382,6 +434,7 @@ "Welcome Email","Welcome Email" "Wishlist","Wishlist" "Wishlist - %d item(s)","Wishlist - %d item(s)" +"Would you like to change the Customer Group for this order?","Would you like to change the Customer Group for this order?" "Wrong confirmation key.","Wrong confirmation key." "Wrong customer account specified.","Wrong customer account specified." "Wrong email.","Wrong email." @@ -403,6 +456,10 @@ "You have not set a default shipping address.","You have not set a default shipping address." "You have placed no orders yet.","You have placed no orders yet." "You have placed no products yet.","You have placed no products yet." +"You will be charged tax.","You will be charged tax." +"You will not be charged tax.","You will not be charged tax." +"Your Tax ID cannot be validated.","Your Tax ID cannot be validated." +"Your VAT ID was successfully validated.","Your VAT ID was successfully validated." "Your account balance is: %s","Your account balance is: %s" "Your password has been updated.","Your password has been updated." "Your password reset link has expired.","Your password reset link has expired." diff --git a/app/locale/en_US/Mage_Dataflow.csv b/app/locale/en_US/Mage_Dataflow.csv index 60bb9f8ee4..7169faed85 100644 --- a/app/locale/en_US/Mage_Dataflow.csv +++ b/app/locale/en_US/Mage_Dataflow.csv @@ -1,4 +1,5 @@ "Link","Link" +"Actions XML is not valid.","Actions XML is not valid." "An error occurred while opening file: ""%s"".","An error occurred while opening file: ""%s""." "Could not load file: ""%s"".","Could not load file: ""%s""." "Could not save file: %s.","Could not save file: %s." @@ -18,6 +19,7 @@ "Method ""%s"" was not defined in adapter %s.","Method ""%s"" was not defined in adapter %s." "Please declare ""adapter"" and ""method"" nodes first.","Please declare ""adapter"" and ""method"" nodes first." "Processed records: %s","Processed records: %s" +"Profile with the same name already exists.","Profile with the same name already exists." "Saved successfully: ""%s"" [%d byte(s)].","Saved successfully: ""%s"" [%d byte(s)]." "Sheet 1","Sheet 1" "Skip undefined row.","Skip undefined row." diff --git a/app/locale/en_US/Mage_Directory.csv b/app/locale/en_US/Mage_Directory.csv index fcd4d9f899..7f77011cca 100644 --- a/app/locale/en_US/Mage_Directory.csv +++ b/app/locale/en_US/Mage_Directory.csv @@ -2,6 +2,7 @@ "Allowed Currencies","Allowed Currencies" "Base Currency","Base Currency" "Base currency is used for all online payment transactions. Scope is defined by the catalog price scope (""Catalog"" > ""Price"" > ""Catalog Price Scope"").","Base currency is used for all online payment transactions. Scope is defined by the catalog price scope (""Catalog"" > ""Price"" > ""Catalog Price Scope"")." +"Can\'t convert rate from ""%s-%s"".","Can\'t convert rate from ""%s-%s""." "Cannot retrieve rate from %s.","Cannot retrieve rate from %s." "Connection Timeout in Seconds","Connection Timeout in Seconds" "Continue »","Continue »" diff --git a/app/locale/en_US/Mage_Downloadable.csv b/app/locale/en_US/Mage_Downloadable.csv index 762ebb2527..ded3b4ff22 100644 --- a/app/locale/en_US/Mage_Downloadable.csv +++ b/app/locale/en_US/Mage_Downloadable.csv @@ -51,6 +51,7 @@ "Ordered","Ordered" "Out of stock","Out of stock" "Pending","Pending" +"Please log in to download your product or purchase %s.","Please log in to download your product or purchase %s." "Please log in to download your product.","Please log in to download your product." "Please set resource file and link type.","Please set resource file and link type." "Please specify product link(s).","Please specify product link(s)." @@ -74,6 +75,7 @@ "The file does not exist.","The file does not exist." "The link has expired.","The link has expired." "The link is not available.","The link is not available." +"There are files that were selected but not uploaded yet. Please upload or remove them first","There are files that were selected but not uploaded yet. Please upload or remove them first" "Title","Title" "To:","To:" "U","U" diff --git a/app/locale/en_US/Mage_Eav.csv b/app/locale/en_US/Mage_Eav.csv index 46bacd588c..d8af90a97d 100644 --- a/app/locale/en_US/Mage_Eav.csv +++ b/app/locale/en_US/Mage_Eav.csv @@ -61,6 +61,7 @@ "Entity is not initialized","Entity is not initialized" "Entity object is undefined","Entity object is undefined" "Failed to load node %s from config","Failed to load node %s from config" +"For internal use. Must be unique with no spaces. Maximum length of attribute code must be less then %s symbols","For internal use. Must be unique with no spaces. Maximum length of attribute code must be less then %s symbols" "Form Element with the same attribute","Form Element with the same attribute" "Form Fieldset with the same code","Form Fieldset with the same code" "Form Type with the same code","Form Type with the same code" diff --git a/app/locale/en_US/Mage_GoogleBase.csv b/app/locale/en_US/Mage_GoogleBase.csv index daa8fcf337..964c4a94ff 100644 --- a/app/locale/en_US/Mage_GoogleBase.csv +++ b/app/locale/en_US/Mage_GoogleBase.csv @@ -12,6 +12,7 @@ "AuthSub","AuthSub" "Available Products","Available Products" "Base Currency should be set to %s for %s in system configuration. Otherwise item prices won't be correct in Google Base.","Base Currency should be set to %s for %s in system configuration. Otherwise item prices won't be correct in Google Base." +"Cannot update Google Base Item for Store '%s'","Cannot update Google Base Item for Store '%s'" "Captcha confirmation error: %s","Captcha confirmation error: %s" "Captcha has been confirmed.","Captcha has been confirmed." "Catalog","Catalog" diff --git a/app/locale/en_US/Mage_GoogleCheckout.csv b/app/locale/en_US/Mage_GoogleCheckout.csv index 59144438c1..87b363f9ec 100644 --- a/app/locale/en_US/Mage_GoogleCheckout.csv +++ b/app/locale/en_US/Mage_GoogleCheckout.csv @@ -1,4 +1,8 @@ "* Select shipping method","* Select shipping method" +"2Day","2Day" +"2nd Day Air","2nd Day Air" +"2nd Day Air AM","2nd Day Air AM" +"3 Day Select","3 Day Select" "
    Warning: %s
    ","
    Warning: %s
    " "Warning! This option disables the merchant calculated shipping. With this option, Google API ignores any attempt to affect shipping prices.","Warning! This option disables the merchant calculated shipping. With this option, Google API ignores any attempt to affect shipping prices." "A virtual item to reflect the discount total","A virtual item to reflect the discount total" @@ -15,6 +19,7 @@ "Carrier Calculated Methods","Carrier Calculated Methods" "Cart Discount","Cart Discount" "Checkout Image Style","Checkout Image Style" +"Commercial","Commercial" "Continue Shopping URL","Continue Shopping URL" "Credit memo has been created automatically","Credit memo has been created automatically" "Debug","Debug" @@ -25,9 +30,11 @@ "Default price:","Default price:" "Delivery Address Category","Delivery Address Category" "Delivery Schedule","Delivery Schedule" +"Description-based delivery","Description-based delivery" "Disable Default Tax Tables","Disable Default Tax Tables" "Discount Tax","Discount Tax" "Eligible for Protection: %s","Eligible for Protection: %s" +"Email delivery","Email delivery" "Enable","Enable" "Enable Carrier Calculated","Enable Carrier Calculated" "Enable Digital Delivery","Enable Digital Delivery" @@ -35,7 +42,11 @@ "Enable Merchant Calculated","Enable Merchant Calculated" "Enable this if your checkout request is too big and being cut off.","Enable this if your checkout request is too big and being cut off." "Expiration: %s","Expiration: %s" +"Express Mail","Express Mail" +"Express Saver","Express Saver" +"FedEx","FedEx" "Financial: %s -> %s","Financial: %s -> %s" +"First Overnight","First Overnight" "Free Shipping","Free Shipping" "Fulfillment: %s -> %s","Fulfillment: %s -> %s" "Google API","Google API" @@ -53,24 +64,39 @@ "Google Order Status Change:","Google Order Status Change:" "Google Refund:","Google Refund:" "Google Risk Information:","Google Risk Information:" +"Ground","Ground" "Hide Cart Contents","Hide Cart Contents" +"Home Delivery","Home Delivery" "IP Address: %s","IP Address: %s" "If enabled, cart contents will be hidden after clicking on the Google Checkout button in the shopping cart, and restored if ""Edit Cart"" link was activated.","If enabled, cart contents will be hidden after clicking on the Google Checkout button in the shopping cart, and restored if ""Edit Cart"" link was activated." +"Inches","Inches" "Invoice Auto-Created: %s","Invoice Auto-Created: %s" "Is Buyer Willing to Receive Marketing Emails: %s","Is Buyer Willing to Receive Marketing Emails: %s" +"Key/URL delivery","Key/URL delivery" "Large - %s","Large - %s" "Latest Charge: %s","Latest Charge: %s" "Latest Chargeback: %s","Latest Chargeback: %s" "Latest Refund: %s","Latest Refund: %s" "Location","Location" +"Media Mail","Media Mail" "Medium - %s","Medium - %s" "Merchant ID","Merchant ID" "Merchant Key","Merchant Key" "Method","Method" "New Order Status","New Order Status" +"Next Day Air","Next Day Air" +"Next Day Air Early AM","Next Day Air Early AM" +"Next Day Air Saver","Next Day Air Saver" "No","No" +"No Comment","No Comment" +"No Reason","No Reason" +"Optimistic","Optimistic" "Optional, leave empty for home page.","Optional, leave empty for home page." "Order creation error","Order creation error" +"Parcel Post","Parcel Post" +"Pessimistic","Pessimistic" +"Priority Mail","Priority Mail" +"Priority Overnight","Priority Overnight" "Rate 1 Amount","Rate 1 Amount" "Rate 1 Ship To Applicable Countries","Rate 1 Ship To Applicable Countries" "Rate 1 Ship to Specific Countries","Rate 1 Ship to Specific Countries" @@ -85,17 +111,22 @@ "Rate 3 Title","Rate 3 Title" "Remove","Remove" "Required for live Google Checkout transactions.","Required for live Google Checkout transactions." +"Residential","Residential" "Sandbox","Sandbox" "Secure Callback URL","Secure Callback URL" "Small - %s","Small - %s" +"Standard Overnight","Standard Overnight" "The tax amount has been applied based on the information received from Google Checkout, because tax amount received from Google Checkout is different from the calculated tax amount","The tax amount has been applied based on the information received from Google Checkout, because tax amount received from Google Checkout is different from the calculated tax amount" "Title","Title" "Total Chargeback: %s","Total Chargeback: %s" "Total Charged: %s","Total Charged: %s" "Total Refunded: %s","Total Refunded: %s" "Transparent","Transparent" +"UPS","UPS" +"USPS","USPS" "United Kingdom","United Kingdom" "United States","United States" +"Unknown Reason","Unknown Reason" "White Background","White Background" "Yes","Yes" "You will be redirected to GoogleCheckout in a few seconds.","You will be redirected to GoogleCheckout in a few seconds." diff --git a/app/locale/en_US/Mage_Index.csv b/app/locale/en_US/Mage_Index.csv index a185a13bae..4d02a5509c 100644 --- a/app/locale/en_US/Mage_Index.csv +++ b/app/locale/en_US/Mage_Index.csv @@ -19,12 +19,11 @@ "Indexer code is not defined.","Indexer code is not defined." "Indexer model is not defined.","Indexer model is not defined." "Indexer model should extend Mage_Index_Model_Indexer_Abstract.","Indexer model should extend Mage_Index_Model_Indexer_Abstract." -"Last Run","Last Run" "Manual Update","Manual Update" "Mode","Mode" "Never","Never" +"No","No" "One or more of the Indexes are not up to date:","One or more of the Indexes are not up to date:" -"Pending Events","Pending Events" "Please select Index(es)","Please select Index(es)" "Please select Indexes","Please select Indexes" "Process Information","Process Information" @@ -40,4 +39,7 @@ "There was a problem with saving process.","There was a problem with saving process." "Total of %d index(es) have changed index mode.","Total of %d index(es) have changed index mode." "Total of %d index(es) have reindexed data.","Total of %d index(es) have reindexed data." +"Update Required","Update Required" "Update on Save","Update on Save" +"Updated At","Updated At" +"Yes","Yes" diff --git a/app/locale/en_US/Mage_Install.csv b/app/locale/en_US/Mage_Install.csv index e2abbd0d2a..a26c853d3a 100644 --- a/app/locale/en_US/Mage_Install.csv +++ b/app/locale/en_US/Mage_Install.csv @@ -27,6 +27,7 @@ "Database Type","Database Type" "Database connection error.","Database connection error." "Database host","Database host" +"Database server does not support the InnoDB storage engine.","Database server does not support the InnoDB storage engine." "Database user name","Database user name" "Database user password","Database user password" "Default Currency","Default Currency" @@ -59,6 +60,7 @@ "In other cases you will need to make Magento files writeable for the user that the web server process is running under.","In other cases you will need to make Magento files writeable for the user that the web server process is running under." "Installation","Installation" "Installation Guide","Installation Guide" +"Installer does not exist for %s database type","Installer does not exist for %s database type" "Last Name","Last Name" "License Agreement","License Agreement" "Locale","Locale" @@ -74,6 +76,7 @@ "No resource for %s DB model.","No resource for %s DB model." "One of PHP Extensions ""%s"" must be loaded.","One of PHP Extensions ""%s"" must be loaded." "PHP Extension '%s' loaded","PHP Extension '%s' loaded" +"PHP Extensions ""%s"" must be loaded.","PHP Extensions ""%s"" must be loaded." "PHP extension ""%s"" must be loaded.","PHP extension ""%s"" must be loaded." "Package Management through the Web","Package Management through the Web" "Password","Password" @@ -103,6 +106,8 @@ "Tables Prefix","Tables Prefix" "The URL ""%s"" is invalid.","The URL ""%s"" is invalid." "The URL ""%s"" is not accessible.","The URL ""%s"" is not accessible." +"The database server version doesn\'t match system requirements (required: %s, actual: %s).","The database server version doesn\'t match system requirements (required: %s, actual: %s)." +"The table prefix should contain only letters (a-z), numbers (0-9) or underscores (_), the first character should be a letter.","The table prefix should contain only letters (a-z), numbers (0-9) or underscores (_), the first character should be a letter." "There was a problem installing Magento packages. Please read the log, correct errors and try again.","There was a problem installing Magento packages. Please read the log, correct errors and try again." "Time Zone","Time Zone" "Use Secure URLs (SSL)","Use Secure URLs (SSL)" diff --git a/app/locale/en_US/Mage_Page.csv b/app/locale/en_US/Mage_Page.csv index b53a79eee8..8035808bf7 100644 --- a/app/locale/en_US/Mage_Page.csv +++ b/app/locale/en_US/Mage_Page.csv @@ -39,7 +39,7 @@ "Help Us to Keep Magento Healthy","Help Us to Keep Magento Healthy" "Interface Language","Interface Language" "Items %s to %s of %s total","Items %s to %s of %s total" -"JavaScript seem to be disabled in your browser.","JavaScript seem to be disabled in your browser." +"JavaScript seems to be disabled in your browser.","JavaScript seems to be disabled in your browser." "Left Column","Left Column" "Main Content Area","Main Content Area" "Navigation Bar","Navigation Bar" diff --git a/app/locale/en_US/Mage_Paygate.csv b/app/locale/en_US/Mage_Paygate.csv index e447bf42a4..841297c09b 100644 --- a/app/locale/en_US/Mage_Paygate.csv +++ b/app/locale/en_US/Mage_Paygate.csv @@ -1,4 +1,3 @@ -"%s %s %s - %s. %s. %s","%s %s %s - %s. %s. %s" "3D Secure","3D Secure" "3D Secure Card Validation","3D Secure Card Validation" "API Login ID","API Login ID" diff --git a/app/locale/en_US/Mage_Payment.csv b/app/locale/en_US/Mage_Payment.csv index 779511ac83..809565db45 100644 --- a/app/locale/en_US/Mage_Payment.csv +++ b/app/locale/en_US/Mage_Payment.csv @@ -6,6 +6,7 @@ "A value is required for live mode. Refer to your CardinalCommerce agreement.","A value is required for live mode. Refer to your CardinalCommerce agreement." "Allow Initial Fee Failure","Allow Initial Fee Failure" "An internal reference ID is required to save the payment profile.","An internal reference ID is required to save the payment profile." +"Authorize action is not available.","Authorize action is not available." "Auto Bill on Next Cycle","Auto Bill on Next Cycle" "Automatically Invoice All Items","Automatically Invoice All Items" "Automatically bill the outstanding balance amount in the next billing cycle (if there were failed payments).","Automatically bill the outstanding balance amount in the next billing cycle (if there were failed payments)." @@ -17,7 +18,10 @@ "Billing period unit is not defined or wrong.","Billing period unit is not defined or wrong." "Cannot retrieve payment method instance.","Cannot retrieve payment method instance." "Cannot retrieve the payment info model object.","Cannot retrieve the payment info model object." +"Cannot retrieve the payment information object instance.","Cannot retrieve the payment information object instance." +"Cannot retrieve the payment method code.","Cannot retrieve the payment method code." "Cannot retrieve the payment method model object.","Cannot retrieve the payment method model object." +"Capture action is not available.","Capture action is not available." "Card Verification Number","Card Verification Number" "Centinel API URL","Centinel API URL" "Check / Money Order","Check / Money Order" @@ -26,6 +30,8 @@ "Credit Card Type","Credit Card Type" "Credit Card Type: %s","Credit Card Type: %s" "Credit Card Types","Credit Card Types" +"Credit card number mismatch with credit card type.","Credit card number mismatch with credit card type." +"Credit card type is not allowed for this payment method.","Credit card type is not allowed for this payment method." "Currency","Currency" "Currency code is undefined.","Currency code is undefined." "Customer ID is not set.","Customer ID is not set." @@ -35,9 +41,11 @@ "Expiration Date","Expiration Date" "Expiration Date: %s/%s","Expiration Date: %s/%s" "Full name of the person receiving the product or service paid for by the recurring payment.","Full name of the person receiving the product or service paid for by the recurring payment." +"Incorrect credit card expiration date.","Incorrect credit card expiration date." "Initial Fee","Initial Fee" "Initial non-recurring payment amount due immediately upon profile creation.","Initial non-recurring payment amount due immediately upon profile creation." "Internal Reference ID","Internal Reference ID" +"Invalid Credit Card Number","Invalid Credit Card Number" "Issue Number","Issue Number" "Make Check Payable to","Make Check Payable to" "Make Check payable to:","Make Check payable to:" @@ -55,6 +63,7 @@ "Name on the Card: %s","Name on the Card: %s" "New Order Status","New Order Status" "Number of billing periods that make up one billing cycle.","Number of billing periods that make up one billing cycle." +"Order action is not available.","Order action is not available." "Overrides API URL that may be specified by a payment method.","Overrides API URL that may be specified by a payment method." "Password","Password" "Payment ID: %s","Payment ID: %s" @@ -69,6 +78,7 @@ "Payment method code is undefined.","Payment method code is undefined." "Payment profile is invalid:\n%s","Payment profile is invalid:\n%s" "Period frequency is wrong.","Period frequency is wrong." +"Please enter a valid credit card verification number.","Please enter a valid credit card verification number." "Processor ID","Processor ID" "Purchase Order","Purchase Order" "Purchase Order Number","Purchase Order Number" @@ -77,12 +87,14 @@ "Recurring Profile Start Date","Recurring Profile Start Date" "Recurring profile start date has invalid format.","Recurring profile start date has invalid format." "Reference ID is not set.","Reference ID is not set." +"Refund action is not available.","Refund action is not available." "Repeats %s time(s).","Repeats %s time(s)." "Repeats until suspended or canceled.","Repeats until suspended or canceled." "Request Card Security Code","Request Card Security Code" "Saved CC","Saved CC" "Schedule Description","Schedule Description" "Schedule description must be not empty.","Schedule description must be not empty." +"Selected payment type is not allowed for billing country.","Selected payment type is not allowed for billing country." "Send Check to","Send Check to" "Send Check to:","Send Check to:" "Severe 3D Secure Card Validation","Severe 3D Secure Card Validation" @@ -116,6 +128,7 @@ "Unable to save Billing Agreement:","Unable to save Billing Agreement:" "Unit for billing during the subscription period.","Unit for billing during the subscription period." "Unsupported currency code: %s.","Unsupported currency code: %s." +"Void action is not available.","Void action is not available." "Week","Week" "What is this?","What is this?" "Whether to suspend the payment profile if the initial fee fails or add it to the outstanding balance.","Whether to suspend the payment profile if the initial fee fails or add it to the outstanding balance." diff --git a/app/locale/en_US/Mage_Paypal.csv b/app/locale/en_US/Mage_Paypal.csv index 4460f85387..62d39b9b8a 100644 --- a/app/locale/en_US/Mage_Paypal.csv +++ b/app/locale/en_US/Mage_Paypal.csv @@ -1,5 +1,3 @@ -"$0 Auth","$0 Auth" -"$1 Auth","$1 Auth" "-OR-","-OR-" "2-pixel perimeter around the header space.","2-pixel perimeter around the header space." "3D Secure","3D Secure" @@ -21,6 +19,8 @@ "API/Integration Settings","API/Integration Settings" "Ability for buyer to purchase without PayPal account.","Ability for buyer to purchase without PayPal account." "Accept PayPal payments in your shopping cart. PayPal will process your credit card payments through the Payflow Pro Gateway.","Accept PayPal payments in your shopping cart. PayPal will process your credit card payments through the Payflow Pro Gateway." +"Accept payments with a PCI-compliant checkout that keeps customers on your site. Includes a merchant account from PayPal.","Accept payments with a PCI-compliant checkout that keeps customers on your site. Includes a merchant account from PayPal." +"Accept payments with a PCI-compliant checkout that keeps customers on your site. For use with your own merchant account.","Accept payments with a PCI-compliant checkout that keeps customers on your site. For use with your own merchant account." "Accept payments without customers leaving your website. Many popular web-hosting services and shopping carts come with the Payflow payment gateways built in, so they are easy to set up.","Accept payments without customers leaving your website. Many popular web-hosting services and shopping carts come with the Payflow payment gateways built in, so they are easy to set up." "Acceptance Mark","Acceptance Mark" "Acceptance Mark Image","Acceptance Mark Image" @@ -59,6 +59,7 @@ "CNPJ","CNPJ" "CPF","CPF" "CVV2 Check Result by PayPal","CVV2 Check Result by PayPal" +"Can not send new order email.","Can not send new order email." "Cannot create target file for reading reports.","Cannot create target file for reading reports." "Centinel API URL","Centinel API URL" "Centinel Custom API URL","Centinel Custom API URL" @@ -128,7 +129,6 @@ "Fetch Updates","Fetch Updates" "Fetched %s report rows from '%s@%s'.","Fetched %s report rows from '%s@%s'." "Frontend Experience Settings","Frontend Experience Settings" -"Full Auth","Full Auth" "Funding","Funding" "General (Authorization)","General (Authorization)" "General (Dividend)","General (Dividend)" @@ -169,7 +169,6 @@ "Initiation Date","Initiation Date" "Integral Evolution","Integral Evolution" "Integral Evolution Settings","Integral Evolution Settings" -"Invalid Amount","Invalid Amount" "Invoice ID","Invoice ID" "Issuer Liability","Issuer Liability" "It is recommended to set this value to ""Debit or Credit Card"" per store views.","It is recommended to set this value to ""Debit or Credit Card"" per store views." @@ -178,7 +177,6 @@ "Last Correlation ID","Last Correlation ID" "Last Transaction ID","Last Transaction ID" "Learn More","Learn More" -"Loading payment information...","Loading payment information..." "Login","Login" "Looking for PayPal? We have our own tab to the left under Sales.","Looking for PayPal? We have our own tab to the left under Sales." "Mass Pay Payment","Mass Pay Payment" @@ -254,6 +252,7 @@ "PayPal Express Order Review Form","PayPal Express Order Review Form" "PayPal Fee Information","PayPal Fee Information" "PayPal Merchant Pages Style","PayPal Merchant Pages Style" +"PayPal Payments Advanced","PayPal Payments Advanced" "PayPal Pro","PayPal Pro" "PayPal Pro Settings","PayPal Pro Settings" "PayPal Product Logo","PayPal Product Logo" @@ -306,7 +305,6 @@ "Proxy Host","Proxy Host" "Proxy Port","Proxy Port" "Qty","Qty" -"Quick set-up service lets your customers securely complete transactions.","Quick set-up service lets your customers securely complete transactions." "Reauthorization","Reauthorization" "Reference Information","Reference Information" "Refund issued by merchant.","Refund issued by merchant." @@ -331,6 +329,7 @@ "Schedule description is too long.","Schedule description is too long." "Scheduled Fetching","Scheduled Fetching" "Select a PayPal Solution","Select a PayPal Solution" +"Server Error. Please try again.","Server Error. Please try again." "Settlement Consolidation","Settlement Consolidation" "Settlement Report Settings","Settlement Report Settings" "Settlement of a chargeback.","Settlement of a chargeback." @@ -394,6 +393,7 @@ "Unable to process Express Checkout approval.","Unable to process Express Checkout approval." "Unable to start Express Checkout.","Unable to start Express Checkout." "Unable to update shipping method.","Unable to update shipping method." +"Unknown Error. Please try again later.","Unknown Error. Please try again later." "Unknown reason. Please contact PayPal customer service.","Unknown reason. Please contact PayPal customer service." "Update Shipping Method","Update Shipping Method" "Use Proxy","Use Proxy" @@ -403,7 +403,6 @@ "Uses store frontend name by default.","Uses store frontend name by default." "Vendor","Vendor" "Vendor / Merchant Login","Vendor / Merchant Login" -"Verification Authorization Amount","Verification Authorization Amount" "View","View" "View Demo","View Demo" "View PayPal solutions.","View PayPal solutions." @@ -431,7 +430,6 @@ "WorldLink Withdrawal","WorldLink Withdrawal" "Would you like to sign a billing agreement to streamline further purchases with PayPal?","Would you like to sign a billing agreement to streamline further purchases with PayPal?" "Wrong PayPal Express Checkout Token specified.","Wrong PayPal Express Checkout Token specified." -"Wrong configuration of Payment Method","Wrong configuration of Payment Method" "Yes","Yes" "Yes. Matched Address and five-didgit ZIP","Yes. Matched Address and five-didgit ZIP" "You cannot void a verification transaction","You cannot void a verification transaction" diff --git a/app/locale/en_US/Mage_Persistent.csv b/app/locale/en_US/Mage_Persistent.csv index 7c5ab9e1dc..eae5d2aa2b 100644 --- a/app/locale/en_US/Mage_Persistent.csv +++ b/app/locale/en_US/Mage_Persistent.csv @@ -56,6 +56,7 @@ "Street Address %s","Street Address %s" "Submit","Submit" "Telephone","Telephone" +"VAT Number","VAT Number" "Welcome, %s!","Welcome, %s!" "What\'s this?","What\'s this?" "Zip/Postal Code","Zip/Postal Code" diff --git a/app/locale/en_US/Mage_Reports.csv b/app/locale/en_US/Mage_Reports.csv index 0c055c4619..c1b5626d86 100644 --- a/app/locale/en_US/Mage_Reports.csv +++ b/app/locale/en_US/Mage_Reports.csv @@ -68,7 +68,6 @@ "Name","Name" "New Accounts","New Accounts" "No","No" -"No records found for this period.","No records found for this period." "Number Added","Number Added" "Number Fulfilled","Number Fulfilled" "Number Of Reviews","Number Of Reviews" @@ -132,6 +131,7 @@ "Select day of the month.","Select day of the month." "Shipping","Shipping" "Shopping Cart","Shopping Cart" +"Shopping Cart Price Rule","Shopping Cart Price Rule" "Show Actual Values","Show Actual Values" "Show Report","Show Report" "Show for Current","Show for Current" diff --git a/app/locale/en_US/Mage_Review.csv b/app/locale/en_US/Mage_Review.csv index 9eef53f76e..ca5ab989d9 100644 --- a/app/locale/en_US/Mage_Review.csv +++ b/app/locale/en_US/Mage_Review.csv @@ -6,6 +6,7 @@ "3 stars","3 stars" "4 stars","4 stars" "5 stars","5 stars" +"%2$s %3$s (%4$s)","%2$s %3$s (%4$s)" "Add New Review","Add New Review" "Add Your Review","Add Your Review" "Administrator","Administrator" @@ -43,6 +44,7 @@ "Name in Store","Name in Store" "New Review","New Review" "Nickname","Nickname" +"Nickname can\'t be empty","Nickname can\'t be empty" "Only registered users can write reviews. Please, log in or register","Only registered users can write reviews. Please, log in or register" "Pending Reviews","Pending Reviews" "Pending Reviews of Customer `%s`","Pending Reviews of Customer `%s`" @@ -65,6 +67,8 @@ "Review Details","Review Details" "Review Form Fields Before","Review Form Fields Before" "Review by %s","Review by %s" +"Review can\'t be empty","Review can\'t be empty" +"Review summary can\'t be empty","Review summary can\'t be empty" "Reviews and Ratings","Reviews and Ratings" "SKU","SKU" "Save Review","Save Review" diff --git a/app/locale/en_US/Mage_Rss.csv b/app/locale/en_US/Mage_Rss.csv index 64ae2f3a63..7b5dbe4e26 100644 --- a/app/locale/en_US/Mage_Rss.csv +++ b/app/locale/en_US/Mage_Rss.csv @@ -21,6 +21,7 @@ "Get Feed","Get Feed" "Gift Message","Gift Message" "Grand Total","Grand Total" +"Low Stock Products","Low Stock Products" "Message:","Message:" "Miscellaneous Feeds","Miscellaneous Feeds" "New Orders","New Orders" @@ -29,6 +30,7 @@ "Notified Date: %s
    ","Notified Date: %s
    " "Order # %s Notification(s)","Order # %s Notification(s)" "Order #%s created at %s","Order #%s created at %s" +"Pending product review(s)","Pending product review(s)" "Product: ""%s"" review By: %s","Product: ""%s"" review By: %s" "Product: %s
    ","Product: %s
    " "Products tagged with %s","Products tagged with %s" diff --git a/app/locale/en_US/Mage_Rule.csv b/app/locale/en_US/Mage_Rule.csv index fe9e316556..868d5c3245 100644 --- a/app/locale/en_US/Mage_Rule.csv +++ b/app/locale/en_US/Mage_Rule.csv @@ -9,10 +9,6 @@ "FALSE","FALSE" "If %s of these conditions are %s:","If %s of these conditions are %s:" "Invalid discount amount.","Invalid discount amount." -"MATCHING ALL","MATCHING ALL" -"MATCHING ANY","MATCHING ANY" -"NOT MATCHING ALL","NOT MATCHING ALL" -"NOT MATCHING ANY","NOT MATCHING ANY" "Name: %s","Name: %s" "Open Chooser","Open Chooser" "Perform following actions","Perform following actions" diff --git a/app/locale/en_US/Mage_Sales.csv b/app/locale/en_US/Mage_Sales.csv index ac04eb30b6..db2f4c1493 100644 --- a/app/locale/en_US/Mage_Sales.csv +++ b/app/locale/en_US/Mage_Sales.csv @@ -126,6 +126,7 @@ "Changing address information will not recalculate shipping, tax or other order amount.","Changing address information will not recalculate shipping, tax or other order amount." "Checkout Totals Sort Order","Checkout Totals Sort Order" "City","City" +"Clear Shopping Cart","Clear Shopping Cart" "Click to change shipping method","Click to change shipping method" "Close","Close" "Closed","Closed" @@ -340,12 +341,15 @@ "Logo for PDF Print-outs (200x50)","Logo for PDF Print-outs (200x50)" "Make Check payable to:","Make Check payable to:" "Manage","Manage" +"Maximum amount available to refund is %s","Maximum amount available to refund is %s" "Maximum shipping amount allowed to refund is: %s","Maximum shipping amount allowed to refund is: %s" "Message","Message" "Message:","Message:" "Minimum Amount","Minimum Amount" "Minimum Order Amount","Minimum Order Amount" "Mixed","Mixed" +"Most Viewed","Most Viewed" +"Most Viewed Products Report","Most Viewed Products Report" "Move to Shopping Cart","Move to Shopping Cart" "Move to Wishlist","Move to Wishlist" "Multi-address Description Message","Multi-address Description Message" @@ -358,6 +362,8 @@ "New Billing Agreement","New Billing Agreement" "New Credit Memo","New Credit Memo" "New Credit Memo for Guest","New Credit Memo for Guest" +"New Credit Memo for Invoice #%s","New Credit Memo for Invoice #%s" +"New Credit Memo for Order #%s","New Credit Memo for Order #%s" "New Invoice","New Invoice" "New Invoice and Shipment for Order #%s","New Invoice and Shipment for Order #%s" "New Invoice for Guest","New Invoice for Guest" @@ -493,8 +499,12 @@ "Please Select Products to Add","Please Select Products to Add" "Please Select a Customer","Please Select a Customer" "Please Select a Store","Please Select a Store" +"Please check billing address information. %s","Please check billing address information. %s" +"Please check shipping address information. %s","Please check shipping address information. %s" "Please define PDF object before using.","Please define PDF object before using." "Please enter positive number in this field.","Please enter positive number in this field." +"Please select a valid payment method.","Please select a valid payment method." +"Please specify a shipping method.","Please specify a shipping method." "Please specify a valid grid column alias name that exists in grid table.","Please specify a valid grid column alias name that exists in grid table." "Price","Price" "Print","Print" @@ -792,6 +802,7 @@ "Tracking Number","Tracking Number" "Tracking Number(s):","Tracking Number(s):" "Transaction ""%s"" was already processed.","Transaction ""%s"" was already processed." +"Transaction # %s | %s","Transaction # %s | %s" "Transaction ID","Transaction ID" "Transaction ID must not be empty.","Transaction ID must not be empty." "Transaction ID: ""%s"".","Transaction ID: ""%s""." diff --git a/app/locale/en_US/Mage_SalesRule.csv b/app/locale/en_US/Mage_SalesRule.csv index f79ae3b048..88e4935ecc 100644 --- a/app/locale/en_US/Mage_SalesRule.csv +++ b/app/locale/en_US/Mage_SalesRule.csv @@ -1,39 +1,51 @@ "%d Shopping Cart Price Rules based on ""%s"" attribute have been disabled.","%d Shopping Cart Price Rules based on ""%s"" attribute have been disabled." +"%s Coupon(s) generated successfully","%s Coupon(s) generated successfully" "Actions","Actions" "Active","Active" "Add New Rule","Add New Rule" +"Alphabetical","Alphabetical" +"Alphanumeric","Alphanumeric" +"An error occurred while generating coupons. Please review the log and try again.","An error occurred while generating coupons. Please review the log and try again." "Apply","Apply" "Apply To","Apply To" "Apply the rule only if the following conditions are met (leave blank for all products)","Apply the rule only if the following conditions are met (leave blank for all products)" "Apply the rule only to cart items matching the following conditions (leave blank for all items)","Apply the rule only to cart items matching the following conditions (leave blank for all items)" "Apply the rule to cart items matching the following conditions","Apply the rule to cart items matching the following conditions" "Apply to Shipping Amount","Apply to Shipping Amount" +"Are you sure you want to delete the selected coupon(s)?","Are you sure you want to delete the selected coupon(s)?" "Auto","Auto" +"Auto Generated Specific Coupon Codes","Auto Generated Specific Coupon Codes" "Buy X get Y free (discount amount is Y)","Buy X get Y free (discount amount is Y)" "By Fixed value","By Fixed value" "By Percentage","By Percentage" "Can\'t acquire coupon.","Can\'t acquire coupon." "Cart Attribute","Cart Attribute" "Catalog","Catalog" +"Code Format","Code Format" +"Code Length","Code Length" +"Code Prefix","Code Prefix" +"Code Suffix","Code Suffix" "Conditions","Conditions" "Conditions combination","Conditions combination" "Coupon","Coupon" "Coupon Code","Coupon Code" +"Coupon Qty","Coupon Qty" +"Coupon with the same code","Coupon with the same code" +"Coupons Information","Coupons Information" +"Created On","Created On" "Customer Groups","Customer Groups" -"Customer is new buyer: %s","Customer is new buyer: %s" -"Customer registered: %s","Customer registered: %s" +"Dash Every X Characters","Dash Every X Characters" "Date Expire","Date Expire" "Date Start","Date Start" "Default Label","Default Label" "Default Rule Label for All Store Views","Default Rule Label for All Store Views" "Delete Rule","Delete Rule" "Description","Description" -"Description: %s","Description: %s" "Discount Amount","Discount Amount" "Discount Qty Step (Buy X)","Discount Qty Step (Buy X)" "Edit Rule","Edit Rule" "Edit Rule '%s'","Edit Rule '%s'" -"Expire at: %s","Expire at: %s" +"Excluding prefix, suffix and separators.","Excluding prefix, suffix and separators." "FOUND","FOUND" "Fixed amount discount","Fixed amount discount" "Fixed amount discount for whole cart","Fixed amount discount for whole cart" @@ -42,18 +54,25 @@ "Free Shipping","Free Shipping" "From Date","From Date" "General Information","General Information" +"Generate","Generate" "ID","ID" +"If %s %s %s for a subselection of items in cart matching %s of these conditions:","If %s %s %s for a subselection of items in cart matching %s of these conditions:" +"If an item is %s in the cart with %s of these conditions true:","If an item is %s in the cart with %s of these conditions true:" +"If empty no separation.","If empty no separation." +"If you select and save the rule you will be able to generate multiple coupon codes","If you select and save the rule you will be able to generate multiple coupon codes" "Inactive","Inactive" "Item totals are not set for rule.","Item totals are not set for rule." "Labels","Labels" +"Manage Coupons Codes","Manage Coupons Codes" "Maximum Qty Discount is Applied To","Maximum Qty Discount is Applied To" "NOT FOUND","NOT FOUND" "NOT LOGGED IN","NOT LOGGED IN" -"Name: %s","Name: %s" "New Rule","New Rule" "No","No" "No Coupon","No Coupon" +"Not valid data provided","Not valid data provided" "Number of Uses","Number of Uses" +"Numeric","Numeric" "Payment Method","Payment Method" "Percent of product price discount","Percent of product price discount" "Period","Period" @@ -67,6 +86,7 @@ "Row total in cart","Row total in cart" "Rule Information","Rule Information" "Rule Name","Rule Name" +"Rule is not defined","Rule is not defined" "Sales Discount Amount","Sales Discount Amount" "Sales Subtotal Amount","Sales Subtotal Amount" "Sales Total Amount","Sales Total Amount" @@ -81,7 +101,6 @@ "Shopping Cart Price Rules","Shopping Cart Price Rules" "Special Price","Special Price" "Specific Coupon","Specific Coupon" -"Start at: %s","Start at: %s" "Status","Status" "Stop Further Rules Processing","Stop Further Rules Processing" "Store View Specific Labels","Store View Specific Labels" @@ -90,6 +109,7 @@ "The rule has been deleted.","The rule has been deleted." "The rule has been saved.","The rule has been saved." "This rule no longer exists.","This rule no longer exists." +"Times Used","Times Used" "To Date","To Date" "To Fixed Value","To Fixed Value" "To Percentage","To Percentage" @@ -97,11 +117,16 @@ "Total Amount","Total Amount" "Total Items Quantity","Total Items Quantity" "Total Weight","Total Weight" +"Unable to create requested Coupon Qty. Please check settings and try again.","Unable to create requested Coupon Qty. Please check settings and try again." "Unable to find a rule to delete.","Unable to find a rule to delete." "Update prices using the following information","Update prices using the following information" "Update product's %s %s: %s","Update product's %s %s: %s" "Update the Product","Update the Product" +"Use Auto Generation","Use Auto Generation" +"Used","Used" "Uses per Coupon","Uses per Coupon" "Uses per Customer","Uses per Customer" "Wrong rule specified.","Wrong rule specified." "Yes","Yes" +"total amount","total amount" +"total quantity","total quantity" diff --git a/app/locale/en_US/Mage_Shipping.csv b/app/locale/en_US/Mage_Shipping.csv index 839b245531..3b132907ae 100644 --- a/app/locale/en_US/Mage_Shipping.csv +++ b/app/locale/en_US/Mage_Shipping.csv @@ -1,6 +1,7 @@ " for more information or "," for more information or " "# of Items (and above)","# of Items (and above)" "# of Items vs. Destination","# of Items vs. Destination" +"%1$d records have been imported. See the following list of errors for each record that has not been imported: %2$s","%1$d records have been imported. See the following list of errors for each record that has not been imported: %2$s" "Allow Shipping to Multiple Addresses","Allow Shipping to Multiple Addresses" "An error occurred while import table rates.","An error occurred while import table rates." "Calculate Handling Fee","Calculate Handling Fee" @@ -14,6 +15,7 @@ "Delivered to:","Delivered to:" "Description","Description" "Displayed Error Message","Displayed Error Message" +"Duplicate Row #%s (Country ""%s"", Region/State ""%s"", Zip ""%s"" and Value ""%s"").","Duplicate Row #%s (Country ""%s"", Region/State ""%s"", Zip ""%s"" and Value ""%s"")." "Enabled","Enabled" "Error:","Error:" "Export","Export" @@ -25,9 +27,14 @@ "Import","Import" "Include Virtual Products in Price Calculation","Include Virtual Products in Price Calculation" "Info:","Info:" +"Invalid %s ""%s"" in the Row #%s.","Invalid %s ""%s"" in the Row #%s." +"Invalid Country ""%s"" in the Row #%s.","Invalid Country ""%s"" in the Row #%s." +"Invalid Region/State ""%s"" in the Row #%s.","Invalid Region/State ""%s"" in the Row #%s." +"Invalid Shipping Price ""%s"" in the Row #%s.","Invalid Shipping Price ""%s"" in the Row #%s." "Invalid Table Rate code for type %s: %s","Invalid Table Rate code for type %s: %s" "Invalid Table Rate code type: %s","Invalid Table Rate code type: %s" "Invalid Table Rates File Format","Invalid Table Rates File Format" +"Invalid Table Rates format in the Row #%s","Invalid Table Rates format in the Row #%s" "Local Time","Local Time" "Location","Location" "Maximum Qty Allowed for Shipping to Multiple Addresses","Maximum Qty Allowed for Shipping to Multiple Addresses" diff --git a/app/locale/en_US/Mage_Tag.csv b/app/locale/en_US/Mage_Tag.csv index 752777ffcb..948e0cf189 100644 --- a/app/locale/en_US/Mage_Tag.csv +++ b/app/locale/en_US/Mage_Tag.csv @@ -1,4 +1,5 @@ "# of Uses","# of Uses" +"%s tag(s) have been accepted for moderation.","%s tag(s) have been accepted for moderation." "Tag Name: %s","Tag Name: %s" "Action","Action" "Add","Add" @@ -97,3 +98,4 @@ "XML","XML" "You have not tagged any products yet.","You have not tagged any products yet." "ZIP/Post Code","ZIP/Post Code" +"[STORE VIEW]","[STORE VIEW]" diff --git a/app/locale/en_US/Mage_Tax.csv b/app/locale/en_US/Mage_Tax.csv index 0669355af1..3aa98d793d 100644 --- a/app/locale/en_US/Mage_Tax.csv +++ b/app/locale/en_US/Mage_Tax.csv @@ -10,7 +10,7 @@ "An error occurred while deleting this tax rule.","An error occurred while deleting this tax rule." "An error occurred while saving this rate.","An error occurred while saving this rate." "An error occurred while saving this tax class.","An error occurred while saving this tax class." -"An error occurred while saving this tax class. A class with the same name already exists.","An error occurred while saving this tax class. A class with the same name already exists." +"An error occurred while saving this tax class. A class with the same name","An error occurred while saving this tax class. A class with the same name" "An error occurred while saving this tax rule.","An error occurred while saving this tax rule." "Apply Customer Tax","Apply Customer Tax" "Apply Discount On Prices","Apply Discount On Prices" diff --git a/app/locale/en_US/Mage_Usa.csv b/app/locale/en_US/Mage_Usa.csv index d3f46d78d7..3c4f297830 100644 --- a/app/locale/en_US/Mage_Usa.csv +++ b/app/locale/en_US/Mage_Usa.csv @@ -1,4 +1,5 @@ " was not delivered nor scanned"," was not delivered nor scanned" +"""Per Order"" allows single handling fee for entire order. ""Per Package"" allows individual handling fee for each package.","""Per Order"" allows single handling fee for entire order. ""Per Package"" allows individual handling fee for each package." "1 Day Freight","1 Day Freight" "2 Day","2 Day" "2 Day Freight","2 Day Freight" @@ -21,43 +22,68 @@ "Adult","Adult" "Adult Signature Required","Adult Signature Required" "Allowed Methods","Allowed Methods" +"Allows breaking total order weight into smaller pieces if it exeeds %s %s to ensure accurate calculation of shipping charges.","Allows breaking total order weight into smaller pieces if it exeeds %s %s to ensure accurate calculation of shipping charges." +"Allows breaking total order weight into smaller pieces if it exeeds 70 kg to ensure accurate calculation of shipping charges.","Allows breaking total order weight into smaller pieces if it exeeds 70 kg to ensure accurate calculation of shipping charges." "Bound Printed Matter","Bound Printed Matter" +"Break bulk economy","Break bulk economy" +"Break bulk express","Break bulk express" "Business Service Center","Business Service Center" "Calculate Handling Fee","Calculate Handling Fee" "Canada Standard","Canada Standard" +"Cannot identify measure unit for %s","Cannot identify measure unit for %s" +"Cannot identify weight unit for %s","Cannot identify weight unit for %s" "Cannot retrieve shipping rates","Cannot retrieve shipping rates" +"Centimeters","Centimeters" "Commercial","Commercial" "Configuration","Configuration" "Container","Container" +"Content Type","Content Type" "Customer Packaging","Customer Packaging" "Customer Supplied Package","Customer Supplied Package" +"Customer services","Customer services" "DHL","DHL" +"DHL (Deprecated)","DHL (Deprecated)" "Debug","Debug" "Default Package Height","Default Package Height" "Default Package Length","Default Package Length" "Default Package Width","Default Package Width" "Delivered","Delivered" "Delivery Confirmation","Delivery Confirmation" +"Depth","Depth" "Destination Type","Destination Type" "Development","Development" "Direct","Direct" "Displayed Error Message","Displayed Error Message" +"Divide Order Weight","Divide Order Weight" "Documents","Documents" "Domestic Shipment Days","Domestic Shipment Days" +"Domestic economy select","Domestic economy select" +"Domestic express","Domestic express" "Drop Box","Drop Box" "Dropoff","Dropoff" +"Easy shop","Easy shop" +"Economy select","Economy select" "Empty response","Empty response" "Enable Negotiated Rates","Enable Negotiated Rates" "Enabled for Checkout","Enabled for Checkout" "Enables/Disables SSL verification of Magento server by UPS.","Enables/Disables SSL verification of Magento server by UPS." +"Error #%s : %s","Error #%s : %s" "Error #%s : %s (%s)","Error #%s : %s (%s)" "Error #%s: %s","Error #%s: %s" +"Europack","Europack" "Europe First Priority","Europe First Priority" +"Exchange rate %s (Base Currency) -> %s not found. DHL method %s skipped","Exchange rate %s (Base Currency) -> %s not found. DHL method %s skipped" "Express","Express" +"Express 10:30","Express 10:30" "Express 10:30 AM","Express 10:30 AM" +"Express 12:00","Express 12:00" +"Express 9:00","Express 9:00" "Express Mail","Express Mail" "Express Saturday","Express Saturday" "Express Saver","Express Saver" +"Express easy","Express easy" +"Express envelope","Express envelope" +"Express worldwide","Express worldwide" "Failed to parse xml document: %s","Failed to parse xml document: %s" "FedEx","FedEx" "FedEx 10kg Box","FedEx 10kg Box" @@ -74,10 +100,12 @@ "Free Method","Free Method" "Free Shipping with Minimum Order Amount","Free Shipping with Minimum Order Amount" "Freight","Freight" +"Freight worldwide","Freight worldwide" "Gateway URL","Gateway URL" "Gateway XML URL","Gateway XML URL" "Gift","Gift" "Girth","Girth" +"Globalmail business","Globalmail business" "Ground","Ground" "Ground Commercial","Ground Commercial" "Ground Residential","Ground Residential" @@ -85,6 +113,7 @@ "Handling Fee","Handling Fee" "Height","Height" "Home Delivery","Home Delivery" +"Inches","Inches" "Indirect","Indirect" "International Economy","International Economy" "International Express","International Express" @@ -94,6 +123,8 @@ "International Shipment Days","International Shipment Days" "Intl Economy Freight","Intl Economy Freight" "Intl Priority Freight","Intl Priority Freight" +"Jetline","Jetline" +"Jumbo box","Jumbo box" "Key","Key" "Kilograms","Kilograms" "Large","Large" @@ -105,6 +136,7 @@ "Machinable","Machinable" "Maximum Package Weight (Please consult your shipping carrier for maximum supported shipping weight)","Maximum Package Weight (Please consult your shipping carrier for maximum supported shipping weight)" "Media Mail","Media Mail" +"Medical express","Medical express" "Medium Express Box","Medium Express Box" "Merchandise","Merchandise" "Meter Number","Meter Number" @@ -122,11 +154,15 @@ "Next Day Air Saver Letter","Next Day Air Saver Letter" "No","No" "No packages for request","No packages for request" +"Non Documents","Non Documents" +"Non documents","Non documents" "Non-rectangular","Non-rectangular" +"None","None" "Not Required","Not Required" "Order","Order" "Origin of the Shipment","Origin of the Shipment" "Other","Other" +"Others","Others" "PAK","PAK" "Package","Package" "Package Description","Package Description" @@ -152,10 +188,12 @@ "Response is in the wrong format","Response is in the wrong format" "Return","Return" "Round","Round" +"Same day","Same day" "Sample","Sample" "Sandbox Mode","Sandbox Mode" "Second Day Service","Second Day Service" "Secure Gateway URL","Secure Gateway URL" +"Secureline","Secureline" "Sender","Sender" "Service type does not match","Service type does not match" "Ship to Applicable Countries","Ship to Applicable Countries" @@ -175,12 +213,15 @@ "Small Express Box","Small Express Box" "Smart Post","Smart Post" "Sort Order","Sort Order" +"Specific","Specific" +"Sprintline","Sprintline" "Standard Overnight","Standard Overnight" "Station","Station" "Subtotal","Subtotal" "Subtotal With Discount","Subtotal With Discount" "The response is in wrong format.","The response is in wrong format." "There is no available method for selected shipping address.","There is no available method for selected shipping address." +"There is no items in this order","There is no items in this order" "Third Party","Third Party" "Title","Title" "To Lower","To Lower" @@ -223,7 +264,6 @@ "Unknown error","Unknown error" "Used only when ""Additional Protection Value"" is set to ""Configuration"". Can contain only numeric amount.","Used only when ""Additional Protection Value"" is set to ""Configuration"". Can contain only numeric amount." "User ID","User ID" -"UserId","UserId" "Variable","Variable" "Weight Unit","Weight Unit" "Width","Width" @@ -233,5 +273,10 @@ "Worldwide Express Plus","Worldwide Express Plus" "Worldwide Express Plus Letter","Worldwide Express Plus Letter" "Worldwide Express Saver","Worldwide Express Saver" +"Wrong Content Type.","Wrong Content Type." +"Wrong Region.","Wrong Region." "Yes","Yes" "Your Packaging","Your Packaging" +"Zero shipping charge for '%s'","Zero shipping charge for '%s'" +"cm","cm" +"inch","inch" diff --git a/app/locale/en_US/Mage_Widget.csv b/app/locale/en_US/Mage_Widget.csv index edd41fcee7..79dd29c6c9 100644 --- a/app/locale/en_US/Mage_Widget.csv +++ b/app/locale/en_US/Mage_Widget.csv @@ -7,6 +7,7 @@ "All Pages","All Pages" "All Product Types","All Product Types" "Anchor Categories","Anchor Categories" +"Apply","Apply" "Assign to Store Views","Assign to Store Views" "Big Image","Big Image" "Block Reference","Block Reference" @@ -30,6 +31,7 @@ "Next page","Next page" "Non-Anchor Categories","Non-Anchor Categories" "Not Selected","Not Selected" +"Open Chooser","Open Chooser" "Page","Page" "Please Select Block Reference First","Please Select Block Reference First" "Previous page","Previous page" diff --git a/app/locale/en_US/Mage_XmlConnect.csv b/app/locale/en_US/Mage_XmlConnect.csv index 9af43b0eca..0ec93c8cc6 100644 --- a/app/locale/en_US/Mage_XmlConnect.csv +++ b/app/locale/en_US/Mage_XmlConnect.csv @@ -99,6 +99,9 @@ "Back","Back" "Back to App Edit","Back to App Edit" "Background Color","Background Color" +"Balance","Balance" +"Balance Change","Balance Change" +"Balance History","Balance History" "Banner on Home Screen","Banner on Home Screen" "Banner on Home Screen (landscape mode) image missing.","Banner on Home Screen (landscape mode) image missing." "Banner on Home Screen (portrait mode) image missing.","Banner on Home Screen (portrait mode) image missing." @@ -120,7 +123,7 @@ "Can\'t create wishlist.","Can\'t create wishlist." "Can\'t delete ""%s"" theme.","Can\'t delete ""%s"" theme." "Can\'t load XML.","Can\'t load XML." -"Can\'t load application with code ""%s""","Can\'t load application with code ""%s""" +"Can\'t load application with id ""%s""","Can\'t load application with id ""%s""" "Can\'t load cart info.","Can\'t load cart info." "Can\'t load cart.","Can\'t load cart." "Can\'t load customer form.","Can\'t load customer form." @@ -201,6 +204,7 @@ "Customer logout problem.","Customer logout problem." "Customer not logged in.","Customer not logged in." "DD","DD" +"Date","Date" "Date Created","Date Created" "Date Submitted","Date Submitted" "Date Updated","Date Updated" @@ -337,6 +341,7 @@ "Logo in Header","Logo in Header" "Logo in Header image missing.","Logo in Header image missing." "Logout complete.","Logout complete." +"M.I.","M.I." "MEP is PayPal\'s native checkout experience for the iPhone. You can choose to use MEP alongside standard checkout, or use it as your only checkout method for Magento mobile. PayPal MEP requires a PayPal business account","MEP is PayPal\'s native checkout experience for the iPhone. You can choose to use MEP alongside standard checkout, or use it as your only checkout method for Magento mobile. PayPal MEP requires a PayPal business account" "MM","MM" "Mailbox title","Mailbox title" @@ -390,6 +395,7 @@ "Order Date: %s","Order Date: %s" "Order id is not specified.","Order id is not specified." "Order is not available.","Order is not available." +"Ordered","Ordered" "Output format is not specified. Please, specify ""format"" key in constructor, or set it using setFormat().","Output format is not specified. Please, specify ""format"" key in constructor, or set it using setFormat()." "POST data is not valid.","POST data is not valid." "Pages","Pages" @@ -415,6 +421,9 @@ "Please agree to all the terms and conditions before placing the order.","Please agree to all the terms and conditions before placing the order." "Please create and save an application first.","Please create and save an application first." "Please enter ""App Title"".","Please enter ""App Title""." +"Please enter a valid URL. Protocol is required (http://, https:// or ftp://)","Please enter a valid URL. Protocol is required (http://, https:// or ftp://)" +"Please enter a valid date.","Please enter a valid date." +"Please enter a valid email address. For example johndoe@domain.com.","Please enter a valid email address. For example johndoe@domain.com." "Please enter issue number or start date for switch/solo card type.","Please enter issue number or start date for switch/solo card type." "Please enter the Activation Key.","Please enter the Activation Key." "Please enter the Copyright.","Please enter the Copyright." @@ -423,6 +432,7 @@ "Please enter the Resubmission Key.","Please enter the Resubmission Key." "Please enter the Title.","Please enter the Title." "Please make sure your passwords match.","Please make sure your passwords match." +"Please select an option.","Please select an option." "Please select at least one country.","Please select at least one country." "Please upload an image for ""App Background (landscape mode)"" field from Design Tab.","Please upload an image for ""App Background (landscape mode)"" field from Design Tab." "Please upload an image for ""App Background (portrait mode)"" field from Design Tab.","Please upload an image for ""App Background (portrait mode)"" field from Design Tab." @@ -431,6 +441,10 @@ "Please upload an image for ""Banner on Home Screen (portrait mode)"" field from Design Tab.","Please upload an image for ""Banner on Home Screen (portrait mode)"" field from Design Tab." "Please upload an image for ""Banner on Home Screen"" field from Design Tab.","Please upload an image for ""Banner on Home Screen"" field from Design Tab." "Please upload an image for ""Logo in Header"" field from Design Tab.","Please upload an image for ""Logo in Header"" field from Design Tab." +"Please use letters only (a-z or A-Z) in this field.","Please use letters only (a-z or A-Z) in this field." +"Please use numbers only in this field. Please avoid spaces or other characters such as dots or commas.","Please use numbers only in this field. Please avoid spaces or other characters such as dots or commas." +"Please use only letters (a-z or A-Z) or numbers (0-9) only in this field. No spaces or other characters are allowed.","Please use only letters (a-z or A-Z) or numbers (0-9) only in this field. No spaces or other characters are allowed." +"Prefix","Prefix" "Preset Theme","Preset Theme" "Preview","Preview" "Price","Price" @@ -465,8 +479,10 @@ "Recommended size 768px x 294px. Note: Image size affects the performance of your app.","Recommended size 768px x 294px. Note: Image size affects the performance of your app." "Recommended size 768px x 960px. Note: Image size affects the performance of your app.","Recommended size 768px x 960px. Note: Image size affects the performance of your app." "Redemption functionality is disabled.","Redemption functionality is disabled." +"Refunded","Refunded" "Regular and confirmation passwords must be equal","Regular and confirmation passwords must be equal" "Related Product Background Color","Related Product Background Color" +"Request internal error.","Request internal error." "Reset theme to default","Reset theme to default" "Resubmission Key","Resubmission Key" "Resubmit App","Resubmit App" @@ -488,6 +504,7 @@ "Selected product is unavailable.","Selected product is unavailable." "Sender Information","Sender Information" "Settings","Settings" +"Shipped","Shipped" "Shipping Address","Shipping Address" "Shipping Method","Shipping Method" "Shipping address has been set.","Shipping address has been set." @@ -530,6 +547,7 @@ "Submitted","Submitted" "Subtotal (Excl. Tax)","Subtotal (Excl. Tax)" "Subtotal (Incl. Tax)","Subtotal (Incl. Tax)" +"Suffix","Suffix" "Summary of Your Review","Summary of Your Review" "T-Shirts","T-Shirts" "Tabs","Tabs" @@ -544,6 +562,8 @@ "Template does not exist.","Template does not exist." "Template for new AirMail Message does not exist.","Template for new AirMail Message does not exist." "Template has been deleted.","Template has been deleted." +"Text length does not satisfy specified max text range.","Text length does not satisfy specified max text range." +"Text length does not satisfy specified min text range.","Text length does not satisfy specified min text range." "Thank you for registering!","Thank you for registering!" "Thank you for your purchase! ","Thank you for your purchase! " "The Mailbox title will be shown in the More Info tab. To understand more about the title, please click here","The Mailbox title will be shown in the More Info tab. To understand more about the title, please click here" @@ -557,6 +577,7 @@ "Theme name is not set.","Theme name is not set." "There were some problems with the data.","There were some problems with the data." "This email address was not found in our records.","This email address was not found in our records." +"This is a required field.","This is a required field." "Title","Title" "Title bar","Title bar" "To activate PayPal MEP payment method activate Express checkout first. ","To activate PayPal MEP payment method activate Express checkout first. " @@ -637,9 +658,14 @@ "You can watch statistics here.","You can watch statistics here." "You need to enable PayPal Express Checkout first from the Payment configuration before enabling PayPal MECL.","You need to enable PayPal Express Checkout first from the Payment configuration before enabling PayPal MECL." "You will receive an order confirmation email with details of your order and a link to track its progress.","You will receive an order confirmation email with details of your order and a link to track its progress." +"Your current balance is:","Your current balance is:" "Your order # is: %s. ","Your order # is: %s. " "Your review has been accepted for moderation.","Your review has been accepted for moderation." "Zip/Postal Code","Zip/Postal Code" +"\'%s\' exceeds the allowed file size: %d (bytes)","\'%s\' exceeds the allowed file size: %d (bytes)" +"\'%s\' height exceeds allowed value of %d px","\'%s\' height exceeds allowed value of %d px" +"\'%s\' is not a valid file extension. Allowed extensions: %s","\'%s\' is not a valid file extension. Allowed extensions: %s" +"\'%s\' width exceeds allowed value of %d px","\'%s\' width exceeds allowed value of %d px" "and","and" "each","each" "iPad","iPad" diff --git a/downloader/Maged/Connect.php b/downloader/Maged/Connect.php index f1df349d01..f229d5cb73 100644 --- a/downloader/Maged/Connect.php +++ b/downloader/Maged/Connect.php @@ -55,17 +55,17 @@ class Maged_Connect { /** - * Object of config - * - * @var Mage_Connect_Config - */ + * Object of config + * + * @var Mage_Connect_Config + */ protected $_config; /** - * Object of single config - * - * @var Mage_Connect_Singleconfig - */ + * Object of single config + * + * @var Mage_Connect_Singleconfig + */ protected $_sconfig; /** @@ -76,22 +76,29 @@ class Maged_Connect protected $_frontend; /** - * Internal cache for command objects - * - * @var array - */ + * Internal cache for command objects + * + * @var array + */ protected $_cmdCache = array(); /** - * Instance of class - * - * @var Maged_Connect - */ + * Console Started flag + * + * @var boolean + */ + protected $_consoleStarted = false; + + /** + * Instance of class + * + * @var Maged_Connect + */ static protected $_instance; /** - * Constructor - */ + * Constructor loads Config, Cache Config and initializes Frontend + */ public function __construct() { $this->getConfig(); @@ -100,10 +107,20 @@ public function __construct() } /** - * Initialize instance - * - * @return Maged_Connect - */ + * Destructor, sends Console footer if Console started + */ + public function __destruct() + { + if ($this->_consoleStarted) { + $this->_consoleFooter(); + } + } + + /** + * Initialize instance + * + * @return Maged_Connect + */ public static function getInstance() { if (!self::$_instance) { @@ -113,10 +130,10 @@ public static function getInstance() } /** - * Retrieve object of config and set it to Mage_Connect_Command - * - * @return Mage_Connect_Config - */ + * Retrieve object of config and set it to Mage_Connect_Command + * + * @return Mage_Connect_Config + */ public function getConfig() { if (!$this->_config) { @@ -135,15 +152,19 @@ public function getConfig() } /** - * Retrieve object of single config and set it to Mage_Connect_Command - * - * @param bool $reload - * @return Mage_Connect_Singleconfig - */ + * Retrieve object of single config and set it to Mage_Connect_Command + * + * @param bool $reload + * @return Mage_Connect_Singleconfig + */ public function getSingleConfig($reload = false) { if(!$this->_sconfig || $reload) { - $this->_sconfig = new Mage_Connect_Singleconfig($this->getConfig()->magento_root . DIRECTORY_SEPARATOR . $this->getConfig()->downloader_path . DIRECTORY_SEPARATOR . Mage_Connect_Singleconfig::DEFAULT_SCONFIG_FILENAME); + $this->_sconfig = new Mage_Connect_Singleconfig( + $this->getConfig()->magento_root . DIRECTORY_SEPARATOR + . $this->getConfig()->downloader_path . DIRECTORY_SEPARATOR + . Mage_Connect_Singleconfig::DEFAULT_SCONFIG_FILENAME + ); } Mage_Connect_Command::setSconfig($this->_sconfig); return $this->_sconfig; @@ -151,10 +172,10 @@ public function getSingleConfig($reload = false) } /** - * Retrieve object of frontend and set it to Mage_Connect_Command - * - * @return Maged_Connect_Frontend - */ + * Retrieve object of frontend and set it to Mage_Connect_Command + * + * @return Maged_Connect_Frontend + */ public function getFrontend() { if (!$this->_frontend) { @@ -165,30 +186,30 @@ public function getFrontend() } /** - * Retrieve lof from frontend - * - * @return array - */ + * Retrieve lof from frontend + * + * @return array + */ public function getLog() { return $this->getFrontend()->getLog(); } /** - * Retrieve output from frontend - * - * @return array - */ + * Retrieve output from frontend + * + * @return array + */ public function getOutput() { return $this->getFrontend()->getOutput(); } /** - * Clean registry - * - * @return Maged_Connect - */ + * Clean registry + * + * @return Maged_Connect + */ public function cleanSconfig() { $this->getSingleConfig()->clear(); @@ -196,11 +217,11 @@ public function cleanSconfig() } /** - * Delete directory recursively - * - * @param string $path - * @return Maged_Connect - */ + * Delete directory recursively + * + * @param string $path + * @return Maged_Connect + */ public function delTree($path) { if (@is_dir($path)) { $entries = @scandir($path); @@ -217,13 +238,13 @@ public function delTree($path) { } /** - * Run commands from Mage_Connect_Command - * - * @param string $command - * @param array $options - * @param array $params - * @return - */ + * Run commands from Mage_Connect_Command + * + * @param string $command + * @param array $options + * @param array $params + * @return boolean|Mage_Connect_Error + */ public function run($command, $options=array(), $params=array()) { @set_time_limit(0); @@ -257,16 +278,20 @@ public function run($command, $options=array(), $params=array()) } } - public function setRemoteConfig($uri) #$host, $user, $password, $path='', $port=null) + /** + * Set remote Config by URI + * + * @param $uri + * @return Maged_Connect + */ + public function setRemoteConfig($uri) { - #$uri = 'ftp://' . $user . ':' . $password . '@' . $host . (is_numeric($port) ? ':' . $port : '') . '/' . trim($path, '/') . '/'; - //$this->run('config-set', array(), array('remote_config', $uri)); - //$this->run('config-set', array('ftp'=>$uri), array('remote_config', $uri)); $this->getConfig()->remote_config=$uri; return $this; } /** + * Show Errors * * @param array $errors Error messages * @return Maged_Connect @@ -277,7 +302,7 @@ public function showConnectErrors($errors) $run = new Maged_Model_Connect_Request(); if ($callback = $run->get('failure_callback')) { if (is_array($callback)) { - call_user_func_array($callback, array($result)); + call_user_func_array($callback, array($errors)); } else { echo $callback; } @@ -290,8 +315,9 @@ public function showConnectErrors($errors) /** * Run Mage_Connect_Command with html output console style * - * @param array|Maged_Model $runParams command, options, params, - * comment, success_callback, failure_callback + * @throws Maged_Exception + * @param array|string|Maged_Model $runParams command, options, params, comment, success_callback, failure_callback + * @return bool|Mage_Connect_Error */ public function runHtmlConsole($runParams) { @@ -318,6 +344,58 @@ public function runHtmlConsole($runParams) } if (!$run->get('no-header')) { + $this->_consoleHeader(); + } + echo htmlspecialchars($run->get('comment')).'
    '; + + if ($command = $run->get('command')) { + $result = $this->run($command, $run->get('options'), $run->get('params')); + + if ($this->getFrontend()->hasErrors()) { + echo "
    CONNECT ERROR: "; + foreach ($this->getFrontend()->getErrors(false) as $error) { + echo nl2br($error[1]); + echo '
    '; + } + } + echo ''; + } else { + $result = false; + } + if ($this->getFrontend()->getErrors() || !$run->get('no-footer')) { + //$this->_consoleFooter(); + $fe->setLogStream($oldLogStream); + } + return $result; + } + + /** + * Show HTML Console Header + * + * @return void + */ + protected function _consoleHeader() { + if (!$this->_consoleStarted) { ?> '; - }); - - // Wrap noscript elements - h = h.replace(/]+|)>([\s\S]*?)<\/noscript>/g, function(v, attribs, text) { - return ''; - }); - } - - h = h.replace(//g, ''); - - // This function processes the attributes in the HTML string to force boolean - // attributes to the attr="attr" format and convert style, src and href to _mce_ versions - function processTags(html) { - return html.replace(tagRegExp, function(match, elm_name, attrs, end) { - return '<' + elm_name + attrs.replace(attrRegExp, function(match, name, value, val2, val3) { - var mceValue; - - name = name.toLowerCase(); - value = value || val2 || val3 || ""; - - // Treat boolean attributes - if (boolAttrs[name]) { - // false or 0 is treated as a missing attribute - if (value === 'false' || value === '0') - return; - - return name + '="' + name + '"'; - } - - // Is attribute one that needs special treatment - if (mceAttribs[name] && attrs.indexOf('_mce_' + name) == -1) { - mceValue = t.decode(value); - - // Convert URLs to relative/absolute ones - if (s.url_converter && (name == "src" || name == "href")) - mceValue = s.url_converter.call(s.url_converter_scope || t, mceValue, name, elm_name); - - // Process styles lowercases them and compresses them - if (name == 'style') - mceValue = t.serializeStyle(t.parseStyle(mceValue), name); - - return name + '="' + value + '"' + ' _mce_' + name + '="' + t.encode(mceValue) + '"'; - } - - return match; - }) + end + '>'; - }); - }; - - h = processTags(h); - - // Restore script blocks - h = h.replace(/MCE_SCRIPT:([0-9]+)/g, function(val, idx) { - return codeBlocks[idx]; - }); - } - - return h; - }, - /** * Returns the outer HTML of an element. * * @method getOuterHTML - * @param {String/Element} e Element ID or element object to get outer HTML from. + * @param {String/Element} elm Element ID or element object to get outer HTML from. * @return {String} Outer HTML string. + * @example + * tinymce.DOM.getOuterHTML(editorElement); + * tinyMCE.activeEditor.getOuterHTML(tinyMCE.activeEditor.getBody()); */ - getOuterHTML : function(e) { - var d; + getOuterHTML : function(elm) { + var doc, self = this; - e = this.get(e); + elm = self.get(elm); - if (!e) + if (!elm) return null; - if (e.outerHTML !== undefined) - return e.outerHTML; + if (elm.nodeType === 1 && self.hasOuterHTML) + return elm.outerHTML; - d = (e.ownerDocument || this.doc).createElement("body"); - d.appendChild(e.cloneNode(true)); + doc = (elm.ownerDocument || self.doc).createElement("body"); + doc.appendChild(elm.cloneNode(true)); - return d.innerHTML; + return doc.innerHTML; }, /** @@ -1435,6 +1200,12 @@ * @param {Element/String/Array} e DOM element, element id string or array of elements/ids to set outer HTML on. * @param {Object} h HTML code to set as outer value for the element. * @param {Document} d Optional document scope to use in this process defaults to the document of the DOM class. + * @example + * // Sets the outer HTML of all paragraphs in the active editor + * tinyMCE.activeEditor.dom.setOuterHTML(tinyMCE.activeEditor.dom.select('p'), '
    some html
    '); + * + * // Sets the outer HTML of a element by id in the document + * tinyMCE.DOM.setOuterHTML('mydiv', '
    some html
    '); */ setOuterHTML : function(e, h, d) { var t = this; @@ -1485,41 +1256,16 @@ * @param {String} s String to decode entities on. * @return {String} Entity decoded string. */ - decode : function(s) { - var e, n, v; - - // Look for entities to decode - if (/&[\w#]+;/.test(s)) { - // Decode the entities using a div element not super efficient but less code - e = this.doc.createElement("div"); - e.innerHTML = s; - n = e.firstChild; - v = ''; - - if (n) { - do { - v += n.nodeValue; - } while (n = n.nextSibling); - } - - return v || s; - } - - return s; - }, + decode : Entities.decode, /** * Entity encodes a string, encodes the most common entities <>"& into entities. * * @method encode - * @param {String} s String to encode with entities. + * @param {String} text String to encode with entities. * @return {String} Entity encoded string. */ - encode : function(str) { - return ('' + str).replace(encodeCharsRe, function(chr) { - return encodedChars[chr]; - }); - }, + encode : Entities.encodeAllRaw, /** * Inserts a element after the reference element. @@ -1551,16 +1297,17 @@ * Returns true/false if the specified element is a block element or not. * * @method isBlock - * @param {Node} n Element/Node to check. + * @param {Node/String} node Element/Node to check. * @return {Boolean} True/False state if the node is a block element or not. */ - isBlock : function(n) { - if (n.nodeType && n.nodeType !== 1) - return false; + isBlock : function(node) { + var type = node.nodeType; - n = n.nodeName || n; + // If it's a node then check the type and use the nodeName + if (type) + return !!(type === 1 && blockElementsMap[node.nodeName]); - return blockRe.test(n); + return !!blockElementsMap[node]; }, /** @@ -1704,7 +1451,7 @@ // Remove everything but class name ov = v; - v = v.replace(/.*\.([a-z0-9_\-]+).*/i, '$1'); + v = tinymce._replace(/.*\.([a-z0-9_\-]+).*/i, '$1', v); // Filter classes if (f && !(v = f(v, ov))) @@ -1812,6 +1559,62 @@ return n.attributes; }, + /** + * Returns true/false if the specified node is to be considered empty or not. + * + * @example + * tinymce.DOM.isEmpty(node, {img : true}); + * @method isEmpty + * @param {Object} elements Optional name/value object with elements that are automatically treated as non empty elements. + * @return {Boolean} true/false if the node is empty or not. + */ + isEmpty : function(node, elements) { + var self = this, i, attributes, type, walker, name, parentNode; + + node = node.firstChild; + if (node) { + walker = new tinymce.dom.TreeWalker(node); + elements = elements || self.schema ? self.schema.getNonEmptyElements() : null; + + do { + type = node.nodeType; + + if (type === 1) { + // Ignore bogus elements + if (node.getAttribute('data-mce-bogus')) + continue; + + // Keep empty elements like + name = node.nodeName.toLowerCase(); + if (elements && elements[name]) { + // Ignore single BR elements in blocks like


    + parentNode = node.parentNode; + if (name === 'br' && self.isBlock(parentNode) && parentNode.firstChild === node && parentNode.lastChild === node) { + continue; + } + + return false; + } + + // Keep elements with data-bookmark attributes or name attribute like + attributes = self.getAttribs(node); + i = node.attributes.length; + while (i--) { + name = node.attributes[i].nodeName; + if (name === "name" || name === 'data-mce-bookmark') + return false; + } + } + + // Keep non whitespace text nodes + if ((type === 3 && !whiteSpaceRegExp.test(node.nodeValue))) + return false; + } while (node = walker.next()); + } + + return true; + }, + /** * Destroys all internal references to the DOM to solve IE leak issues. * @@ -1836,6 +1639,9 @@ * * @method createRng * @return {DOMRange} DOM Range object. + * @example + * var rng = tinymce.DOM.createRng(); + * alert(rng.startContainer + "," + rng.startOffset); */ createRng : function() { var d = this.doc; @@ -1862,7 +1668,6 @@ if (nodeType == lastNodeType || !node.nodeValue.length) continue; } - idx++; lastNodeType = nodeType; } @@ -1894,23 +1699,24 @@ // this function will then trim of empty edges and produce: //

    text 1

    CHOP

    text 2

    function trim(node) { - var i, children = node.childNodes; + var i, children = node.childNodes, type = node.nodeType; - if (node.nodeType == 1 && node.getAttribute('_mce_type') == 'bookmark') + if (type == 1 && node.getAttribute('data-mce-type') == 'bookmark') return; for (i = children.length - 1; i >= 0; i--) trim(children[i]); - if (node.nodeType != 9) { + if (type != 9) { // Keep non whitespace text nodes - if (node.nodeType == 3 && node.nodeValue.length > 0) - return; - - if (node.nodeType == 1) { + if (type == 3 && node.nodeValue.length > 0) { + // If parent element isn't a block or there isn't any useful contents for example "

    " + if (!t.isBlock(node.parentNode) || tinymce.trim(node.nodeValue).length > 0) + return; + } else if (type == 1) { // If the only child is a bookmark then move it up children = node.childNodes; - if (children.length == 1 && children[0] && children[0].nodeType == 1 && children[0].getAttribute('_mce_type') == 'bookmark') + if (children.length == 1 && children[0] && children[0].nodeType == 1 && children[0].getAttribute('data-mce-type') == 'bookmark') node.parentNode.insertBefore(children[0], node); // Keep non empty elements or img, hr etc @@ -2062,6 +1868,9 @@ * @property DOM * @member tinymce * @type tinymce.dom.DOMUtils + * @example + * // Example of how to add a class to some element by id + * tinymce.DOM.addClass('someid', 'someclass'); */ tinymce.DOM = new tinymce.dom.DOMUtils(document, {process_html : 0}); })(tinymce); diff --git a/js/tiny_mce/classes/dom/Element.js b/js/tiny_mce/classes/dom/Element.js index 1e6d6753fa..a1a8786254 100644 --- a/js/tiny_mce/classes/dom/Element.js +++ b/js/tiny_mce/classes/dom/Element.js @@ -15,6 +15,12 @@ * since it's bound to an element. * * @class tinymce.dom.Element + * @example + * // Creates an basic element for an existing element + * var elm = new tinymce.dom.Element('someid'); + * + * elm.setStyle('background-color', 'red'); + * elm.moveTo(10, 10); */ /** diff --git a/js/tiny_mce/classes/dom/EventUtils.js b/js/tiny_mce/classes/dom/EventUtils.js index 06746e7c24..50851ddcb8 100644 --- a/js/tiny_mce/classes/dom/EventUtils.js +++ b/js/tiny_mce/classes/dom/EventUtils.js @@ -39,6 +39,11 @@ * @param {function} f Function to execute when the event occurs. * @param {Object} s Optional scope to execute the function in. * @return {function} Function callback handler the same as the one passed in. + * @example + * // Adds a click handler to the current document + * tinymce.dom.Event.add(document, 'click', function(e) { + * console.debug(e.target); + * }); */ add : function(o, n, f, s) { var cb, t = this, el = t.events, r; @@ -129,6 +134,14 @@ * @param {String} n Event handler name like for example: "click" * @param {function} f Function to remove. * @return {bool/Array} Bool state if true if the handler was removed or an array with states if multiple elements where passed in. + * @example + * // Adds a click handler to the current document + * var func = tinymce.dom.Event.add(document, 'click', function(e) { + * console.debug(e.target); + * }); + * + * // Removes the click handler from the document + * tinymce.dom.Event.remove(document, 'click', func); */ remove : function(o, n, f) { var t = this, a = t.events, s = false, r; @@ -164,6 +177,11 @@ * * @method clear * @param {Object} o DOM element or object to remove all events from. + * @example + * // Cancels all mousedown events in the active editor + * tinyMCE.activeEditor.onMouseDown.add(function(ed, e) { + * return tinymce.dom.Event.cancel(e); + * }); */ clear : function(o) { var t = this, a = t.events, i, e; @@ -312,7 +330,7 @@ return; try { - // If IE is used, use the trick by Diego Perini + // If IE is used, use the trick by Diego Perini licensed under MIT by request to the author. // http://javascript.nwbox.com/IEContentLoaded/ doc.documentElement.doScroll("left"); } catch (ex) { @@ -335,7 +353,7 @@ }, _stoppers : { - preventDefault : function() { + preventDefault : function() { this.returnValue = false; }, diff --git a/js/tiny_mce/classes/dom/Range.js b/js/tiny_mce/classes/dom/Range.js index 634459d507..54b847221f 100644 --- a/js/tiny_mce/classes/dom/Range.js +++ b/js/tiny_mce/classes/dom/Range.js @@ -106,23 +106,24 @@ }; function compareBoundaryPoints(h, r) { - var sc = t[START_CONTAINER], so = t[START_OFFSET], ec = t[END_CONTAINER], eo = t[END_OFFSET]; + var sc = t[START_CONTAINER], so = t[START_OFFSET], ec = t[END_CONTAINER], eo = t[END_OFFSET], + rsc = r.startContainer, rso = r.startOffset, rec = r.endContainer, reo = r.endOffset; // Check START_TO_START if (h === 0) - return _compareBoundaryPoints(sc, so, sc, so); - + return _compareBoundaryPoints(sc, so, rsc, rso); + // Check START_TO_END if (h === 1) - return _compareBoundaryPoints(sc, so, ec, eo); - + return _compareBoundaryPoints(ec, eo, rsc, rso); + // Check END_TO_END if (h === 2) - return _compareBoundaryPoints(ec, eo, ec, eo); - + return _compareBoundaryPoints(ec, eo, rec, reo); + // Check END_TO_START - if (h === 3) - return _compareBoundaryPoints(ec, eo, sc, so); + if (h === 3) + return _compareBoundaryPoints(sc, so, rec, reo); }; function deleteContents() { @@ -214,7 +215,7 @@ function _compareBoundaryPoints(containerA, offsetA, containerB, offsetB) { var c, offsetC, n, cmnRoot, childA, childB; - + // In the first case the boundary-points have the same container. A is before B // if its offset is less than the offset of B, A is equal to B if its offset is // equal to the offset of B, and A is after B if its offset is greater than the @@ -500,7 +501,7 @@ frag.appendChild(n); startIdx = nodeIndex(startAncestor); - ++startIdx; // Because we already traversed it.... + ++startIdx; // Because we already traversed it cnt = t[END_OFFSET] - startIdx; n = startAncestor.nextSibling; diff --git a/js/tiny_mce/classes/dom/RangeUtils.js b/js/tiny_mce/classes/dom/RangeUtils.js index 6f96886da8..051c395c04 100644 --- a/js/tiny_mce/classes/dom/RangeUtils.js +++ b/js/tiny_mce/classes/dom/RangeUtils.js @@ -37,6 +37,31 @@ return; } + /** + * Excludes start/end text node if they are out side the range + * + * @private + * @param {Array} nodes Nodes to exclude items from. + * @return {Array} Array with nodes excluding the start/end container if needed. + */ + function exclude(nodes) { + var node; + + // First node is excluded + node = nodes[0]; + if (node.nodeType === 3 && node === startContainer && startOffset >= node.nodeValue.length) { + nodes.splice(0, 1); + } + + // Last node is excluded + node = nodes[nodes.length - 1]; + if (endOffset === 0 && nodes.length > 0 && node === endContainer && node.nodeType === 3) { + nodes.splice(nodes.length - 1, 1); + } + + return nodes; + }; + /** * Collects siblings * @@ -82,7 +107,7 @@ if (!next) siblings.reverse(); - callback(siblings); + callback(exclude(siblings)); } } }; @@ -93,30 +118,30 @@ // If index based end position then resolve it if (endContainer.nodeType == 1 && endContainer.hasChildNodes()) - endContainer = endContainer.childNodes[Math.min(startOffset == endOffset ? endOffset : endOffset - 1, endContainer.childNodes.length - 1)]; - - // Find common ancestor and end points - ancestor = dom.findCommonAncestor(startContainer, endContainer); + endContainer = endContainer.childNodes[Math.min(endOffset - 1, endContainer.childNodes.length - 1)]; // Same container if (startContainer == endContainer) - return callback([startContainer]); + return callback(exclude([startContainer])); + // Find common ancestor and end points + ancestor = dom.findCommonAncestor(startContainer, endContainer); + // Process left side for (node = startContainer; node; node = node.parentNode) { - if (node == endContainer) + if (node === endContainer) return walkBoundary(startContainer, ancestor, true); - if (node == ancestor) + if (node === ancestor) break; } // Process right side for (node = endContainer; node; node = node.parentNode) { - if (node == startContainer) + if (node === startContainer) return walkBoundary(endContainer, ancestor); - if (node == ancestor) + if (node === ancestor) break; } @@ -135,7 +160,7 @@ ); if (siblings.length) - callback(siblings); + callback(exclude(siblings)); // Walk right leaf walkBoundary(endContainer, endPoint); @@ -147,42 +172,40 @@ * @param {Range/RangeObject} rng Range to split. * @return {Object} Range position object. */ -/* this.split = function(rng) { + this.split = function(rng) { var startContainer = rng.startContainer, startOffset = rng.startOffset, endContainer = rng.endContainer, endOffset = rng.endOffset; function splitText(node, offset) { - if (offset == node.nodeValue.length) - node.appendData(INVISIBLE_CHAR); - - node = node.splitText(offset); - - if (node.nodeValue === INVISIBLE_CHAR) - node.nodeValue = ''; - - return node; + return node.splitText(offset); }; // Handle single text node - if (startContainer == endContainer) { - if (startContainer.nodeType == 3) { - if (startOffset != 0) - startContainer = endContainer = splitText(startContainer, startOffset); - - if (endOffset - startOffset != startContainer.nodeValue.length) - splitText(startContainer, endOffset - startOffset); + if (startContainer == endContainer && startContainer.nodeType == 3) { + if (startOffset > 0 && startOffset < startContainer.nodeValue.length) { + endContainer = splitText(startContainer, startOffset); + startContainer = endContainer.previousSibling; + + if (endOffset > startOffset) { + endOffset = endOffset - startOffset; + startContainer = endContainer = splitText(endContainer, endOffset).previousSibling; + endOffset = endContainer.nodeValue.length; + startOffset = 0; + } else { + endOffset = 0; + } } } else { // Split startContainer text node if needed - if (startContainer.nodeType == 3 && startOffset != 0) { + if (startContainer.nodeType == 3 && startOffset > 0 && startOffset < startContainer.nodeValue.length) { startContainer = splitText(startContainer, startOffset); startOffset = 0; } // Split endContainer text node if needed - if (endContainer.nodeType == 3 && endOffset != endContainer.nodeValue.length) { + if (endContainer.nodeType == 3 && endOffset > 0 && endOffset < endContainer.nodeValue.length) { endContainer = splitText(endContainer, endOffset).previousSibling; endOffset = endContainer.nodeValue.length; } @@ -195,7 +218,7 @@ endOffset : endOffset }; }; -*/ + }; /** diff --git a/js/tiny_mce/classes/dom/Schema.js b/js/tiny_mce/classes/dom/Schema.js deleted file mode 100644 index 4148d7e3c5..0000000000 --- a/js/tiny_mce/classes/dom/Schema.js +++ /dev/null @@ -1,185 +0,0 @@ -/** - * Schema.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - var transitional = {}; - - /** - * Unpacks the specified lookup and string data it will also parse it into an object - * map with sub object for it's children. This will later also include the attributes. - */ - function unpack(lookup, data) { - var key; - - function replace(value) { - return value.replace(/[A-Z]+/g, function(key) { - return replace(lookup[key]); - }); - }; - - // Unpack lookup - for (key in lookup) { - if (lookup.hasOwnProperty(key)) - lookup[key] = replace(lookup[key]); - } - - // Unpack and parse data into object map - replace(data).replace(/#/g, '#text').replace(/(\w+)\[([^\]]+)\]/g, function(str, name, children) { - var i, map = {}; - - children = children.split(/\|/); - - for (i = children.length - 1; i >= 0; i--) - map[children[i]] = 1; - - transitional[name] = map; - }); - }; - - // This is the XHTML 1.0 transitional elements with it's children packed to reduce it's size - // we will later include the attributes here and use it as a default for valid elements but it - // requires us to rewrite the serializer engine - unpack({ - Z : '#|H|K|N|O|P', - Y : '#|X|form|R|Q', - X : 'p|T|div|U|W|isindex|fieldset|table', - W : 'pre|hr|blockquote|address|center|noframes', - U : 'ul|ol|dl|menu|dir', - ZC : '#|p|Y|div|U|W|table|br|span|bdo|object|applet|img|map|K|N|Q', - T : 'h1|h2|h3|h4|h5|h6', - ZB : '#|X|S|Q', - S : 'R|P', - ZA : '#|a|G|J|M|O|P', - R : '#|a|H|K|N|O', - Q : 'noscript|P', - P : 'ins|del|script', - O : 'input|select|textarea|label|button', - N : 'M|L', - M : 'em|strong|dfn|code|q|samp|kbd|var|cite|abbr|acronym', - L : 'sub|sup', - K : 'J|I', - J : 'tt|i|b|u|s|strike', - I : 'big|small|font|basefont', - H : 'G|F', - G : 'br|span|bdo', - F : 'object|applet|img|map|iframe' - }, 'script[]' + - 'style[]' + - 'object[#|param|X|form|a|H|K|N|O|Q]' + - 'param[]' + - 'p[S]' + - 'a[Z]' + - 'br[]' + - 'span[S]' + - 'bdo[S]' + - 'applet[#|param|X|form|a|H|K|N|O|Q]' + - 'h1[S]' + - 'img[]' + - 'map[X|form|Q|area]' + - 'h2[S]' + - 'iframe[#|X|form|a|H|K|N|O|Q]' + - 'h3[S]' + - 'tt[S]' + - 'i[S]' + - 'b[S]' + - 'u[S]' + - 's[S]' + - 'strike[S]' + - 'big[S]' + - 'small[S]' + - 'font[S]' + - 'basefont[]' + - 'em[S]' + - 'strong[S]' + - 'dfn[S]' + - 'code[S]' + - 'q[S]' + - 'samp[S]' + - 'kbd[S]' + - 'var[S]' + - 'cite[S]' + - 'abbr[S]' + - 'acronym[S]' + - 'sub[S]' + - 'sup[S]' + - 'input[]' + - 'select[optgroup|option]' + - 'optgroup[option]' + - 'option[]' + - 'textarea[]' + - 'label[S]' + - 'button[#|p|T|div|U|W|table|G|object|applet|img|map|K|N|Q]' + - 'h4[S]' + - 'ins[#|X|form|a|H|K|N|O|Q]' + - 'h5[S]' + - 'del[#|X|form|a|H|K|N|O|Q]' + - 'h6[S]' + - 'div[#|X|form|a|H|K|N|O|Q]' + - 'ul[li]' + - 'li[#|X|form|a|H|K|N|O|Q]' + - 'ol[li]' + - 'dl[dt|dd]' + - 'dt[S]' + - 'dd[#|X|form|a|H|K|N|O|Q]' + - 'menu[li]' + - 'dir[li]' + - 'pre[ZA]' + - 'hr[]' + - 'blockquote[#|X|form|a|H|K|N|O|Q]' + - 'address[S|p]' + - 'center[#|X|form|a|H|K|N|O|Q]' + - 'noframes[#|X|form|a|H|K|N|O|Q]' + - 'isindex[]' + - 'fieldset[#|legend|X|form|a|H|K|N|O|Q]' + - 'legend[S]' + - 'table[caption|col|colgroup|thead|tfoot|tbody|tr]' + - 'caption[S]' + - 'col[]' + - 'colgroup[col]' + - 'thead[tr]' + - 'tr[th|td]' + - 'th[#|X|form|a|H|K|N|O|Q]' + - 'form[#|X|a|H|K|N|O|Q]' + - 'noscript[#|X|form|a|H|K|N|O|Q]' + - 'td[#|X|form|a|H|K|N|O|Q]' + - 'tfoot[tr]' + - 'tbody[tr]' + - 'area[]' + - 'base[]' + - 'body[#|X|form|a|H|K|N|O|Q]' - ); - - /** - * Schema validator class. - * - * @class tinymce.dom.Schema - * @example - * if (tinymce.activeEditor.schema.isValid('p', 'span')) - * alert('span is valid child of p.'); - */ - tinymce.dom.Schema = function() { - var t = this, elements = transitional; - - /** - * Returns true/false if the specified element and optionally it's child is valid or not - * according to the XHTML transitional DTD. - * - * @method isValid - * @param {String} name Element name to check for. - * @param {String} child_name Element child name to check for. - * @return {boolean} true/false if the element is valid or not. - */ - t.isValid = function(name, child_name) { - var element = elements[name]; - - return !!(element && (!child_name || element[child_name])); - }; - }; -})(); \ No newline at end of file diff --git a/js/tiny_mce/classes/dom/ScriptLoader.js b/js/tiny_mce/classes/dom/ScriptLoader.js index 70bef4a500..b79bab1375 100644 --- a/js/tiny_mce/classes/dom/ScriptLoader.js +++ b/js/tiny_mce/classes/dom/ScriptLoader.js @@ -9,6 +9,30 @@ */ (function(tinymce) { + /** + * This class handles asynchronous/synchronous loading of JavaScript files it will execute callbacks when various items gets loaded. This class is useful to load external JavaScript files. + * + * @class tinymce.dom.ScriptLoader + * @example + * // Load a script from a specific URL using the global script loader + * tinymce.ScriptLoader.load('somescript.js'); + * + * // Load a script using a unique instance of the script loader + * var scriptLoader = new tinymce.dom.ScriptLoader(); + * + * scriptLoader.load('somescript.js'); + * + * // Load multiple scripts + * var scriptLoader = new tinymce.dom.ScriptLoader(); + * + * scriptLoader.add('somescript1.js'); + * scriptLoader.add('somescript2.js'); + * scriptLoader.add('somescript3.js'); + * + * scriptLoader.loadQueue(function() { + * alert('All scripts are now loaded.'); + * }); + */ tinymce.dom.ScriptLoader = function(settings) { var QUEUED = 0, LOADING = 1, @@ -40,6 +64,17 @@ callback(); }; + + function error() { + // Report the error so it's easier for people to spot loading errors + if (typeof(console) !== "undefined" && console.log) + console.log("Failed to load: " + url); + + // We can't mark it as done if there is a load error since + // A) We don't want to produce 404 errors on the server and + // B) the onerror event won't fire on all browsers. + // done(); + }; id = dom.uniqueId(); @@ -49,7 +84,7 @@ // If script is from same domain and we // use IE 6 then use XHR since it's more reliable - if (uri.host == loc.hostname && uri.port == loc.port && (uri.protocol + ':') == loc.protocol) { + if (uri.host == loc.hostname && uri.port == loc.port && (uri.protocol + ':') == loc.protocol && uri.protocol.toLowerCase() != 'file') { tinymce.util.XHR.send({ url : tinymce._addVer(uri.getURI()), success : function(content) { @@ -64,7 +99,9 @@ dom.remove(script); done(); - } + }, + + error : error }); return; @@ -78,17 +115,26 @@ src : tinymce._addVer(url) }); - // Add onload and readystate listeners - elm.onload = done; - elm.onreadystatechange = function() { - var state = elm.readyState; - - // Loaded state is passed on IE 6 however there - // are known issues with this method but we can't use - // XHR in a cross domain loading - if (state == 'complete' || state == 'loaded') - done(); - }; + // Add onload listener for non IE browsers since IE9 + // fires onload event before the script is parsed and executed + if (!tinymce.isIE) + elm.onload = done; + + // Add onerror event will get fired on some browsers but not all of them + elm.onerror = error; + + // Opera 9.60 doesn't seem to fire the onreadystate event at correctly + if (!tinymce.isOpera) { + elm.onreadystatechange = function() { + var state = elm.readyState; + + // Loaded state is passed on IE 6 however there + // are known issues with this method but we can't use + // XHR in a cross domain loading + if (state == 'complete' || state == 'loaded') + done(); + }; + } // Most browsers support this feature so we report errors // for those at least to help users track their missing plugins etc diff --git a/js/tiny_mce/classes/dom/Selection.js b/js/tiny_mce/classes/dom/Selection.js index fd1779c5ec..3041e6672a 100644 --- a/js/tiny_mce/classes/dom/Selection.js +++ b/js/tiny_mce/classes/dom/Selection.js @@ -1,766 +1,1103 @@ -/** - * Selection.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function(tinymce) { - function trimNl(s) { - return s.replace(/[\n\r]+/g, ''); - }; - - // Shorten names - var is = tinymce.is, isIE = tinymce.isIE, each = tinymce.each; - - /** - * This class handles text and control selection it's an crossbrowser utility class. - * Consult the TinyMCE Wiki API for more details and examples on how to use this class. - * @class tinymce.dom.Selection - */ - tinymce.create('tinymce.dom.Selection', { - /** - * Constructs a new selection instance. - * - * @constructor - * @method Selection - * @param {tinymce.dom.DOMUtils} dom DOMUtils object reference. - * @param {Window} win Window to bind the selection object to. - * @param {tinymce.dom.Serializer} serializer DOM serialization class to use for getContent. - */ - Selection : function(dom, win, serializer) { - var t = this; - - t.dom = dom; - t.win = win; - t.serializer = serializer; - - // Add events - each([ - 'onBeforeSetContent', - 'onBeforeGetContent', - 'onSetContent', - 'onGetContent' - ], function(e) { - t[e] = new tinymce.util.Dispatcher(t); - }); - - // No W3C Range support - if (!t.win.getSelection) - t.tridentSel = new tinymce.dom.TridentSelection(t); - - // Prevent leaks - tinymce.addUnload(t.destroy, t); - }, - - /** - * Returns the selected contents using the DOM serializer passed in to this class. - * - * @method getContent - * @param {Object} s Optional settings class with for example output format text or html. - * @return {String} Selected contents in for example HTML format. - */ - getContent : function(s) { - var t = this, r = t.getRng(), e = t.dom.create("body"), se = t.getSel(), wb, wa, n; - - s = s || {}; - wb = wa = ''; - s.get = true; - s.format = s.format || 'html'; - t.onBeforeGetContent.dispatch(t, s); - - if (s.format == 'text') - return t.isCollapsed() ? '' : (r.text || (se.toString ? se.toString() : '')); - - if (r.cloneContents) { - n = r.cloneContents(); - - if (n) - e.appendChild(n); - } else if (is(r.item) || is(r.htmlText)) - e.innerHTML = r.item ? r.item(0).outerHTML : r.htmlText; - else - e.innerHTML = r.toString(); - - // Keep whitespace before and after - if (/^\s/.test(e.innerHTML)) - wb = ' '; - - if (/\s+$/.test(e.innerHTML)) - wa = ' '; - - s.getInner = true; - - s.content = t.isCollapsed() ? '' : wb + t.serializer.serialize(e, s) + wa; - t.onGetContent.dispatch(t, s); - - return s.content; - }, - - /** - * Sets the current selection to the specified content. If any contents is selected it will be replaced - * with the contents passed in to this function. If there is no selection the contents will be inserted - * where the caret is placed in the editor/page. - * - * @method setContent - * @param {String} h HTML contents to set could also be other formats depending on settings. - * @param {Object} s Optional settings object with for example data format. - */ - setContent : function(h, s) { - var t = this, r = t.getRng(), c, d = t.win.document; - - s = s || {format : 'html'}; - s.set = true; - h = s.content = t.dom.processHTML(h); - - // Dispatch before set content event - t.onBeforeSetContent.dispatch(t, s); - h = s.content; - - if (r.insertNode) { - // Make caret marker since insertNode places the caret in the beginning of text after insert - h += '_'; - - // Delete and insert new node - - if (r.startContainer == d && r.endContainer == d) { - // WebKit will fail if the body is empty since the range is then invalid and it can't insert contents - d.body.innerHTML = h; - } else { - r.deleteContents(); - if (d.body.childNodes.length == 0) { - d.body.innerHTML = h; - } else { - r.insertNode(r.createContextualFragment(h)); - } - } - - // Move to caret marker - c = t.dom.get('__caret'); - // Make sure we wrap it compleatly, Opera fails with a simple select call - r = d.createRange(); - r.setStartBefore(c); - r.setEndBefore(c); - t.setRng(r); - - // Remove the caret position - t.dom.remove('__caret'); - } else { - if (r.item) { - // Delete content and get caret text selection - d.execCommand('Delete', false, null); - r = t.getRng(); - } - - r.pasteHTML(h); - } - - // Dispatch set content event - t.onSetContent.dispatch(t, s); - }, - - /** - * Returns the start element of a selection range. If the start is in a text - * node the parent element will be returned. - * - * @method getStart - * @return {Element} Start element of selection range. - */ - getStart : function() { - var rng = this.getRng(), startElement, parentElement, checkRng, node; - - if (rng.duplicate || rng.item) { - // Control selection, return first item - if (rng.item) - return rng.item(0); - - // Get start element - checkRng = rng.duplicate(); - checkRng.collapse(1); - startElement = checkRng.parentElement(); - - // Check if range parent is inside the start element, then return the inner parent element - // This will fix issues when a single element is selected, IE would otherwise return the wrong start element - parentElement = node = rng.parentElement(); - while (node = node.parentNode) { - if (node == startElement) { - startElement = parentElement; - break; - } - } - - // If start element is body element try to move to the first child if it exists - if (startElement && startElement.nodeName == 'BODY') - return startElement.firstChild || startElement; - - return startElement; - } else { - startElement = rng.startContainer; - - if (startElement.nodeType == 1 && startElement.hasChildNodes()) - startElement = startElement.childNodes[Math.min(startElement.childNodes.length - 1, rng.startOffset)]; - - if (startElement && startElement.nodeType == 3) - return startElement.parentNode; - - return startElement; - } - }, - - /** - * Returns the end element of a selection range. If the end is in a text - * node the parent element will be returned. - * - * @method getEnd - * @return {Element} End element of selection range. - */ - getEnd : function() { - var t = this, r = t.getRng(), e, eo; - - if (r.duplicate || r.item) { - if (r.item) - return r.item(0); - - r = r.duplicate(); - r.collapse(0); - e = r.parentElement(); - - if (e && e.nodeName == 'BODY') - return e.lastChild || e; - - return e; - } else { - e = r.endContainer; - eo = r.endOffset; - - if (e.nodeType == 1 && e.hasChildNodes()) - e = e.childNodes[eo > 0 ? eo - 1 : eo]; - - if (e && e.nodeType == 3) - return e.parentNode; - - return e; - } - }, - - /** - * Returns a bookmark location for the current selection. This bookmark object - * can then be used to restore the selection after some content modification to the document. - * - * @method getBookmark - * @param {Number} type Optional state if the bookmark should be simple or not. Default is complex. - * @param {Boolean} normalized Optional state that enables you to get a position that it would be after normalization. - * @return {Object} Bookmark object, use moveToBookmark with this object to restore the selection. - */ - getBookmark : function(type, normalized) { - var t = this, dom = t.dom, rng, rng2, id, collapsed, name, element, index, chr = '\uFEFF', styles; - - function findIndex(name, element) { - var index = 0; - - each(dom.select(name), function(node, i) { - if (node == element) - index = i; - }); - - return index; - }; - - if (type == 2) { - function getLocation() { - var rng = t.getRng(true), root = dom.getRoot(), bookmark = {}; - - function getPoint(rng, start) { - var container = rng[start ? 'startContainer' : 'endContainer'], - offset = rng[start ? 'startOffset' : 'endOffset'], point = [], node, childNodes, after = 0; - - if (container.nodeType == 3) { - if (normalized) { - for (node = container.previousSibling; node && node.nodeType == 3; node = node.previousSibling) - offset += node.nodeValue.length; - } - - point.push(offset); - } else { - childNodes = container.childNodes; - - if (offset >= childNodes.length && childNodes.length) { - after = 1; - offset = Math.max(0, childNodes.length - 1); - } - - point.push(t.dom.nodeIndex(childNodes[offset], normalized) + after); - } - - for (; container && container != root; container = container.parentNode) - point.push(t.dom.nodeIndex(container, normalized)); - - return point; - }; - - bookmark.start = getPoint(rng, true); - - if (!t.isCollapsed()) - bookmark.end = getPoint(rng); - - return bookmark; - }; - - return getLocation(); - } - - // Handle simple range - if (type) - return {rng : t.getRng()}; - - rng = t.getRng(); - id = dom.uniqueId(); - collapsed = tinyMCE.activeEditor.selection.isCollapsed(); - styles = 'overflow:hidden;line-height:0px'; - - // Explorer method - if (rng.duplicate || rng.item) { - // Text selection - if (!rng.item) { - rng2 = rng.duplicate(); - - // Insert start marker - rng.collapse(); - rng.pasteHTML('' + chr + ''); - - // Insert end marker - if (!collapsed) { - rng2.collapse(false); - rng2.pasteHTML('' + chr + ''); - } - } else { - // Control selection - element = rng.item(0); - name = element.nodeName; - - return {name : name, index : findIndex(name, element)}; - } - } else { - element = t.getNode(); - name = element.nodeName; - if (name == 'IMG') - return {name : name, index : findIndex(name, element)}; - - // W3C method - rng2 = rng.cloneRange(); - - // Insert end marker - if (!collapsed) { - rng2.collapse(false); - rng2.insertNode(dom.create('span', {_mce_type : "bookmark", id : id + '_end', style : styles}, chr)); - } - - rng.collapse(true); - rng.insertNode(dom.create('span', {_mce_type : "bookmark", id : id + '_start', style : styles}, chr)); - } - - t.moveToBookmark({id : id, keep : 1}); - - return {id : id}; - }, - - /** - * Restores the selection to the specified bookmark. - * - * @method moveToBookmark - * @param {Object} bookmark Bookmark to restore selection from. - * @return {Boolean} true/false if it was successful or not. - */ - moveToBookmark : function(bookmark) { - var t = this, dom = t.dom, marker1, marker2, rng, root, startContainer, endContainer, startOffset, endOffset; - - // Clear selection cache - if (t.tridentSel) - t.tridentSel.destroy(); - - if (bookmark) { - if (bookmark.start) { - rng = dom.createRng(); - root = dom.getRoot(); - - function setEndPoint(start) { - var point = bookmark[start ? 'start' : 'end'], i, node, offset, children; - - if (point) { - // Find container node - for (node = root, i = point.length - 1; i >= 1; i--) { - children = node.childNodes; - - if (children.length) - node = children[point[i]]; - } - - // Set offset within container node - if (start) - rng.setStart(node, point[0]); - else - rng.setEnd(node, point[0]); - } - }; - - setEndPoint(true); - setEndPoint(); - - t.setRng(rng); - } else if (bookmark.id) { - function restoreEndPoint(suffix) { - var marker = dom.get(bookmark.id + '_' + suffix), node, idx, next, prev, keep = bookmark.keep; - - if (marker) { - node = marker.parentNode; - - if (suffix == 'start') { - if (!keep) { - idx = dom.nodeIndex(marker); - } else { - node = marker.firstChild; - idx = 1; - } - - startContainer = endContainer = node; - startOffset = endOffset = idx; - } else { - if (!keep) { - idx = dom.nodeIndex(marker); - } else { - node = marker.firstChild; - idx = 1; - } - - endContainer = node; - endOffset = idx; - } - - if (!keep) { - prev = marker.previousSibling; - next = marker.nextSibling; - - // Remove all marker text nodes - each(tinymce.grep(marker.childNodes), function(node) { - if (node.nodeType == 3) - node.nodeValue = node.nodeValue.replace(/\uFEFF/g, ''); - }); - - // Remove marker but keep children if for example contents where inserted into the marker - // Also remove duplicated instances of the marker for example by a split operation or by WebKit auto split on paste feature - while (marker = dom.get(bookmark.id + '_' + suffix)) - dom.remove(marker, 1); - - // If siblings are text nodes then merge them - if (prev && next && prev.nodeType == next.nodeType && prev.nodeType == 3) { - idx = prev.nodeValue.length; - prev.appendData(next.nodeValue); - dom.remove(next); - - if (suffix == 'start') { - startContainer = endContainer = prev; - startOffset = endOffset = idx; - } else { - endContainer = prev; - endOffset = idx; - } - } - } - } - }; - - function addBogus(node) { - // Adds a bogus BR element for empty block elements - // on non IE browsers just to have a place to put the caret - if (!isIE && dom.isBlock(node) && !node.innerHTML) - node.innerHTML = '
    '; - - return node; - }; - - // Restore start/end points - restoreEndPoint('start'); - restoreEndPoint('end'); - - rng = dom.createRng(); - rng.setStart(addBogus(startContainer), startOffset); - rng.setEnd(addBogus(endContainer), endOffset); - t.setRng(rng); - } else if (bookmark.name) { - t.select(dom.select(bookmark.name)[bookmark.index]); - } else if (bookmark.rng) - t.setRng(bookmark.rng); - } - }, - - /** - * Selects the specified element. This will place the start and end of the selection range around the element. - * - * @method select - * @param {Element} node HMTL DOM element to select. - * @param {Boolean} content Optional bool state if the contents should be selected or not on non IE browser. - * @return {Element} Selected element the same element as the one that got passed in. - */ - select : function(node, content) { - var t = this, dom = t.dom, rng = dom.createRng(), idx; - - idx = dom.nodeIndex(node); - rng.setStart(node.parentNode, idx); - rng.setEnd(node.parentNode, idx + 1); - - // Find first/last text node or BR element - if (content) { - function setPoint(node, start) { - var walker = new tinymce.dom.TreeWalker(node, node); - - do { - // Text node - if (node.nodeType == 3 && tinymce.trim(node.nodeValue).length != 0) { - if (start) - rng.setStart(node, 0); - else - rng.setEnd(node, node.nodeValue.length); - - return; - } - - // BR element - if (node.nodeName == 'BR') { - if (start) - rng.setStartBefore(node); - else - rng.setEndBefore(node); - - return; - } - } while (node = (start ? walker.next() : walker.prev())); - }; - - setPoint(node, 1); - setPoint(node); - } - - t.setRng(rng); - - return node; - }, - - /** - * Returns true/false if the selection range is collapsed or not. Collapsed means if it's a caret or a larger selection. - * - * @method isCollapsed - * @return {Boolean} true/false state if the selection range is collapsed or not. Collapsed means if it's a caret or a larger selection. - */ - isCollapsed : function() { - var t = this, r = t.getRng(), s = t.getSel(); - - if (!r || r.item) - return false; - - if (r.compareEndPoints) - return r.compareEndPoints('StartToEnd', r) === 0; - - return !s || r.collapsed; - }, - - /** - * Collapse the selection to start or end of range. - * - * @method collapse - * @param {Boolean} b Optional boolean state if to collapse to end or not. Defaults to start. - */ - collapse : function(b) { - var t = this, r = t.getRng(), n; - - // Control range on IE - if (r.item) { - n = r.item(0); - r = this.win.document.body.createTextRange(); - r.moveToElementText(n); - } - - r.collapse(!!b); - t.setRng(r); - }, - - /** - * Returns the browsers internal selection object. - * - * @method getSel - * @return {Selection} Internal browser selection object. - */ - getSel : function() { - var t = this, w = this.win; - - return w.getSelection ? w.getSelection() : w.document.selection; - }, - - /** - * Returns the browsers internal range object. - * - * @method getRng - * @param {Boolean} w3c Forces a compatible W3C range on IE. - * @return {Range} Internal browser range object. - */ - getRng : function(w3c) { - var t = this, s, r; - - // Found tridentSel object then we need to use that one - if (w3c && t.tridentSel) - return t.tridentSel.getRangeAt(0); - - try { - if (s = t.getSel()) - r = s.rangeCount > 0 ? s.getRangeAt(0) : (s.createRange ? s.createRange() : t.win.document.createRange()); - } catch (ex) { - // IE throws unspecified error here if TinyMCE is placed in a frame/iframe - } - - // No range found then create an empty one - // This can occur when the editor is placed in a hidden container element on Gecko - // Or on IE when there was an exception - if (!r) - r = t.win.document.createRange ? t.win.document.createRange() : t.win.document.body.createTextRange(); - - if (t.selectedRange && t.explicitRange) { - if (r.compareBoundaryPoints(r.START_TO_START, t.selectedRange) === 0 && r.compareBoundaryPoints(r.END_TO_END, t.selectedRange) === 0) { - // Safari, Opera and Chrome only ever select text which causes the range to change. - // This lets us use the originally set range if the selection hasn't been changed by the user. - r = t.explicitRange; - } else { - t.selectedRange = null; - t.explicitRange = null; - } - } - return r; - }, - - /** - * Changes the selection to the specified DOM range. - * - * @method setRng - * @param {Range} r Range to select. - */ - setRng : function(r) { - var s, t = this; - - if (!t.tridentSel) { - s = t.getSel(); - - if (s) { - t.explicitRange = r; - s.removeAllRanges(); - s.addRange(r); - t.selectedRange = s.getRangeAt(0); - } - } else { - // Is W3C Range - if (r.cloneRange) { - t.tridentSel.addRange(r); - return; - } - - // Is IE specific range - try { - r.select(); - } catch (ex) { - // Needed for some odd IE bug #1843306 - } - } - }, - - /** - * Sets the current selection to the specified DOM element. - * - * @method setNode - * @param {Element} n Element to set as the contents of the selection. - * @return {Element} Returns the element that got passed in. - */ - setNode : function(n) { - var t = this; - - t.setContent(t.dom.getOuterHTML(n)); - - return n; - }, - - /** - * Returns the currently selected element or the common ancestor element for both start and end of the selection. - * - * @method getNode - * @return {Element} Currently selected element or common ancestor element. - */ - getNode : function() { - var t = this, rng = t.getRng(), sel = t.getSel(), elm; - - if (rng.setStart) { - // Range maybe lost after the editor is made visible again - if (!rng) - return t.dom.getRoot(); - - elm = rng.commonAncestorContainer; - - // Handle selection a image or other control like element such as anchors - if (!rng.collapsed) { - if (rng.startContainer == rng.endContainer) { - if (rng.startOffset - rng.endOffset < 2) { - if (rng.startContainer.hasChildNodes()) - elm = rng.startContainer.childNodes[rng.startOffset]; - } - } - - // If the anchor node is a element instead of a text node then return this element - if (tinymce.isWebKit && sel.anchorNode && sel.anchorNode.nodeType == 1) - return sel.anchorNode.childNodes[sel.anchorOffset]; - } - - if (elm && elm.nodeType == 3) - return elm.parentNode; - - return elm; - } - - return rng.item ? rng.item(0) : rng.parentElement(); - }, - - getSelectedBlocks : function(st, en) { - var t = this, dom = t.dom, sb, eb, n, bl = []; - - sb = dom.getParent(st || t.getStart(), dom.isBlock); - eb = dom.getParent(en || t.getEnd(), dom.isBlock); - - if (sb) - bl.push(sb); - - if (sb && eb && sb != eb) { - n = sb; - - while ((n = n.nextSibling) && n != eb) { - if (dom.isBlock(n)) - bl.push(n); - } - } - - if (eb && sb != eb) - bl.push(eb); - - return bl; - }, - - destroy : function(s) { - var t = this; - - t.win = null; - - if (t.tridentSel) - t.tridentSel.destroy(); - - // Manual destroy then remove unload handler - if (!s) - tinymce.removeUnload(t.destroy); - } - }); -})(tinymce); +/** + * Selection.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function(tinymce) { + function trimNl(s) { + return s.replace(/[\n\r]+/g, ''); + }; + + // Shorten names + var is = tinymce.is, isIE = tinymce.isIE, each = tinymce.each; + + /** + * This class handles text and control selection it's an crossbrowser utility class. + * Consult the TinyMCE Wiki API for more details and examples on how to use this class. + * + * @class tinymce.dom.Selection + * @example + * // Getting the currently selected node for the active editor + * alert(tinymce.activeEditor.selection.getNode().nodeName); + */ + tinymce.create('tinymce.dom.Selection', { + /** + * Constructs a new selection instance. + * + * @constructor + * @method Selection + * @param {tinymce.dom.DOMUtils} dom DOMUtils object reference. + * @param {Window} win Window to bind the selection object to. + * @param {tinymce.dom.Serializer} serializer DOM serialization class to use for getContent. + */ + Selection : function(dom, win, serializer) { + var t = this; + + t.dom = dom; + t.win = win; + t.serializer = serializer; + + // Add events + each([ + /** + * This event gets executed before contents is extracted from the selection. + * + * @event onBeforeSetContent + * @param {tinymce.dom.Selection} selection Selection object that fired the event. + * @param {Object} args Contains things like the contents that will be returned. + */ + 'onBeforeSetContent', + + /** + * This event gets executed before contents is inserted into selection. + * + * @event onBeforeGetContent + * @param {tinymce.dom.Selection} selection Selection object that fired the event. + * @param {Object} args Contains things like the contents that will be inserted. + */ + 'onBeforeGetContent', + + /** + * This event gets executed when contents is inserted into selection. + * + * @event onSetContent + * @param {tinymce.dom.Selection} selection Selection object that fired the event. + * @param {Object} args Contains things like the contents that will be inserted. + */ + 'onSetContent', + + /** + * This event gets executed when contents is extracted from the selection. + * + * @event onGetContent + * @param {tinymce.dom.Selection} selection Selection object that fired the event. + * @param {Object} args Contains things like the contents that will be returned. + */ + 'onGetContent' + ], function(e) { + t[e] = new tinymce.util.Dispatcher(t); + }); + + // No W3C Range support + if (!t.win.getSelection) + t.tridentSel = new tinymce.dom.TridentSelection(t); + + if (tinymce.isIE && dom.boxModel) + this._fixIESelection(); + + // Prevent leaks + tinymce.addUnload(t.destroy, t); + }, + + /** + * Move the selection cursor range to the specified node and offset. + * @param node Node to put the cursor in. + * @param offset Offset from the start of the node to put the cursor at. + */ + setCursorLocation: function(node, offset) { + var t = this; var r = t.dom.createRng(); + r.setStart(node, offset); + r.setEnd(node, offset); + t.setRng(r); + t.collapse(false); + }, + /** + * Returns the selected contents using the DOM serializer passed in to this class. + * + * @method getContent + * @param {Object} s Optional settings class with for example output format text or html. + * @return {String} Selected contents in for example HTML format. + * @example + * // Alerts the currently selected contents + * alert(tinyMCE.activeEditor.selection.getContent()); + * + * // Alerts the currently selected contents as plain text + * alert(tinyMCE.activeEditor.selection.getContent({format : 'text'})); + */ + getContent : function(s) { + var t = this, r = t.getRng(), e = t.dom.create("body"), se = t.getSel(), wb, wa, n; + + s = s || {}; + wb = wa = ''; + s.get = true; + s.format = s.format || 'html'; + s.forced_root_block = ''; + t.onBeforeGetContent.dispatch(t, s); + + if (s.format == 'text') + return t.isCollapsed() ? '' : (r.text || (se.toString ? se.toString() : '')); + + if (r.cloneContents) { + n = r.cloneContents(); + + if (n) + e.appendChild(n); + } else if (is(r.item) || is(r.htmlText)) { + // IE will produce invalid markup if elements are present that + // it doesn't understand like custom elements or HTML5 elements. + // Adding a BR in front of the contents and then remoiving it seems to fix it though. + e.innerHTML = '
    ' + (r.item ? r.item(0).outerHTML : r.htmlText); + e.removeChild(e.firstChild); + } else + e.innerHTML = r.toString(); + + // Keep whitespace before and after + if (/^\s/.test(e.innerHTML)) + wb = ' '; + + if (/\s+$/.test(e.innerHTML)) + wa = ' '; + + s.getInner = true; + + s.content = t.isCollapsed() ? '' : wb + t.serializer.serialize(e, s) + wa; + t.onGetContent.dispatch(t, s); + + return s.content; + }, + + /** + * Sets the current selection to the specified content. If any contents is selected it will be replaced + * with the contents passed in to this function. If there is no selection the contents will be inserted + * where the caret is placed in the editor/page. + * + * @method setContent + * @param {String} content HTML contents to set could also be other formats depending on settings. + * @param {Object} args Optional settings object with for example data format. + * @example + * // Inserts some HTML contents at the current selection + * tinyMCE.activeEditor.selection.setContent('Some contents'); + */ + setContent : function(content, args) { + var self = this, rng = self.getRng(), caretNode, doc = self.win.document, frag, temp; + + args = args || {format : 'html'}; + args.set = true; + content = args.content = content; + + // Dispatch before set content event + if (!args.no_events) + self.onBeforeSetContent.dispatch(self, args); + + content = args.content; + + if (rng.insertNode) { + // Make caret marker since insertNode places the caret in the beginning of text after insert + content += '_'; + + // Delete and insert new node + if (rng.startContainer == doc && rng.endContainer == doc) { + // WebKit will fail if the body is empty since the range is then invalid and it can't insert contents + doc.body.innerHTML = content; + } else { + rng.deleteContents(); + + if (doc.body.childNodes.length == 0) { + doc.body.innerHTML = content; + } else { + // createContextualFragment doesn't exists in IE 9 DOMRanges + if (rng.createContextualFragment) { + rng.insertNode(rng.createContextualFragment(content)); + } else { + // Fake createContextualFragment call in IE 9 + frag = doc.createDocumentFragment(); + temp = doc.createElement('div'); + + frag.appendChild(temp); + temp.outerHTML = content; + + rng.insertNode(frag); + } + } + } + + // Move to caret marker + caretNode = self.dom.get('__caret'); + + // Make sure we wrap it compleatly, Opera fails with a simple select call + rng = doc.createRange(); + rng.setStartBefore(caretNode); + rng.setEndBefore(caretNode); + self.setRng(rng); + + // Remove the caret position + self.dom.remove('__caret'); + + try { + self.setRng(rng); + } catch (ex) { + // Might fail on Opera for some odd reason + } + } else { + if (rng.item) { + // Delete content and get caret text selection + doc.execCommand('Delete', false, null); + rng = self.getRng(); + } + + // Explorer removes spaces from the beginning of pasted contents + if (/^\s+/.test(content)) { + rng.pasteHTML('_' + content); + self.dom.remove('__mce_tmp'); + } else + rng.pasteHTML(content); + } + + // Dispatch set content event + if (!args.no_events) + self.onSetContent.dispatch(self, args); + }, + + /** + * Returns the start element of a selection range. If the start is in a text + * node the parent element will be returned. + * + * @method getStart + * @return {Element} Start element of selection range. + */ + getStart : function() { + var rng = this.getRng(), startElement, parentElement, checkRng, node; + + if (rng.duplicate || rng.item) { + // Control selection, return first item + if (rng.item) + return rng.item(0); + + // Get start element + checkRng = rng.duplicate(); + checkRng.collapse(1); + startElement = checkRng.parentElement(); + + // Check if range parent is inside the start element, then return the inner parent element + // This will fix issues when a single element is selected, IE would otherwise return the wrong start element + parentElement = node = rng.parentElement(); + while (node = node.parentNode) { + if (node == startElement) { + startElement = parentElement; + break; + } + } + + return startElement; + } else { + startElement = rng.startContainer; + + if (startElement.nodeType == 1 && startElement.hasChildNodes()) + startElement = startElement.childNodes[Math.min(startElement.childNodes.length - 1, rng.startOffset)]; + + if (startElement && startElement.nodeType == 3) + return startElement.parentNode; + + return startElement; + } + }, + + /** + * Returns the end element of a selection range. If the end is in a text + * node the parent element will be returned. + * + * @method getEnd + * @return {Element} End element of selection range. + */ + getEnd : function() { + var t = this, r = t.getRng(), e, eo; + + if (r.duplicate || r.item) { + if (r.item) + return r.item(0); + + r = r.duplicate(); + r.collapse(0); + e = r.parentElement(); + + if (e && e.nodeName == 'BODY') + return e.lastChild || e; + + return e; + } else { + e = r.endContainer; + eo = r.endOffset; + + if (e.nodeType == 1 && e.hasChildNodes()) + e = e.childNodes[eo > 0 ? eo - 1 : eo]; + + if (e && e.nodeType == 3) + return e.parentNode; + + return e; + } + }, + + /** + * Returns a bookmark location for the current selection. This bookmark object + * can then be used to restore the selection after some content modification to the document. + * + * @method getBookmark + * @param {Number} type Optional state if the bookmark should be simple or not. Default is complex. + * @param {Boolean} normalized Optional state that enables you to get a position that it would be after normalization. + * @return {Object} Bookmark object, use moveToBookmark with this object to restore the selection. + * @example + * // Stores a bookmark of the current selection + * var bm = tinyMCE.activeEditor.selection.getBookmark(); + * + * tinyMCE.activeEditor.setContent(tinyMCE.activeEditor.getContent() + 'Some new content'); + * + * // Restore the selection bookmark + * tinyMCE.activeEditor.selection.moveToBookmark(bm); + */ + getBookmark : function(type, normalized) { + var t = this, dom = t.dom, rng, rng2, id, collapsed, name, element, index, chr = '\uFEFF', styles; + + function findIndex(name, element) { + var index = 0; + + each(dom.select(name), function(node, i) { + if (node == element) + index = i; + }); + + return index; + }; + + if (type == 2) { + function getLocation() { + var rng = t.getRng(true), root = dom.getRoot(), bookmark = {}; + + function getPoint(rng, start) { + var container = rng[start ? 'startContainer' : 'endContainer'], + offset = rng[start ? 'startOffset' : 'endOffset'], point = [], node, childNodes, after = 0; + + if (container.nodeType == 3) { + if (normalized) { + for (node = container.previousSibling; node && node.nodeType == 3; node = node.previousSibling) + offset += node.nodeValue.length; + } + + point.push(offset); + } else { + childNodes = container.childNodes; + + if (offset >= childNodes.length && childNodes.length) { + after = 1; + offset = Math.max(0, childNodes.length - 1); + } + + point.push(t.dom.nodeIndex(childNodes[offset], normalized) + after); + } + + for (; container && container != root; container = container.parentNode) + point.push(t.dom.nodeIndex(container, normalized)); + + return point; + }; + + bookmark.start = getPoint(rng, true); + + if (!t.isCollapsed()) + bookmark.end = getPoint(rng); + + return bookmark; + }; + + if (t.tridentSel) + return t.tridentSel.getBookmark(type); + + return getLocation(); + } + + // Handle simple range + if (type) + return {rng : t.getRng()}; + + rng = t.getRng(); + id = dom.uniqueId(); + collapsed = tinyMCE.activeEditor.selection.isCollapsed(); + styles = 'overflow:hidden;line-height:0px'; + + // Explorer method + if (rng.duplicate || rng.item) { + // Text selection + if (!rng.item) { + rng2 = rng.duplicate(); + + try { + // Insert start marker + rng.collapse(); + rng.pasteHTML('' + chr + ''); + + // Insert end marker + if (!collapsed) { + rng2.collapse(false); + + // Detect the empty space after block elements in IE and move the end back one character

    ] becomes

    ]

    + rng.moveToElementText(rng2.parentElement()); + if (rng.compareEndPoints('StartToEnd', rng2) == 0) + rng2.move('character', -1); + + rng2.pasteHTML('' + chr + ''); + } + } catch (ex) { + // IE might throw unspecified error so lets ignore it + return null; + } + } else { + // Control selection + element = rng.item(0); + name = element.nodeName; + + return {name : name, index : findIndex(name, element)}; + } + } else { + element = t.getNode(); + name = element.nodeName; + if (name == 'IMG') + return {name : name, index : findIndex(name, element)}; + + // W3C method + rng2 = rng.cloneRange(); + + // Insert end marker + if (!collapsed) { + rng2.collapse(false); + rng2.insertNode(dom.create('span', {'data-mce-type' : "bookmark", id : id + '_end', style : styles}, chr)); + } + + rng.collapse(true); + rng.insertNode(dom.create('span', {'data-mce-type' : "bookmark", id : id + '_start', style : styles}, chr)); + } + + t.moveToBookmark({id : id, keep : 1}); + + return {id : id}; + }, + + /** + * Restores the selection to the specified bookmark. + * + * @method moveToBookmark + * @param {Object} bookmark Bookmark to restore selection from. + * @return {Boolean} true/false if it was successful or not. + * @example + * // Stores a bookmark of the current selection + * var bm = tinyMCE.activeEditor.selection.getBookmark(); + * + * tinyMCE.activeEditor.setContent(tinyMCE.activeEditor.getContent() + 'Some new content'); + * + * // Restore the selection bookmark + * tinyMCE.activeEditor.selection.moveToBookmark(bm); + */ + moveToBookmark : function(bookmark) { + var t = this, dom = t.dom, marker1, marker2, rng, root, startContainer, endContainer, startOffset, endOffset; + + if (bookmark) { + if (bookmark.start) { + rng = dom.createRng(); + root = dom.getRoot(); + + function setEndPoint(start) { + var point = bookmark[start ? 'start' : 'end'], i, node, offset, children; + + if (point) { + offset = point[0]; + + // Find container node + for (node = root, i = point.length - 1; i >= 1; i--) { + children = node.childNodes; + + if (point[i] > children.length - 1) + return; + + node = children[point[i]]; + } + + // Move text offset to best suitable location + if (node.nodeType === 3) + offset = Math.min(point[0], node.nodeValue.length); + + // Move element offset to best suitable location + if (node.nodeType === 1) + offset = Math.min(point[0], node.childNodes.length); + + // Set offset within container node + if (start) + rng.setStart(node, offset); + else + rng.setEnd(node, offset); + } + + return true; + }; + + if (t.tridentSel) + return t.tridentSel.moveToBookmark(bookmark); + + if (setEndPoint(true) && setEndPoint()) { + t.setRng(rng); + } + } else if (bookmark.id) { + function restoreEndPoint(suffix) { + var marker = dom.get(bookmark.id + '_' + suffix), node, idx, next, prev, keep = bookmark.keep; + + if (marker) { + node = marker.parentNode; + + if (suffix == 'start') { + if (!keep) { + idx = dom.nodeIndex(marker); + } else { + node = marker.firstChild; + idx = 1; + } + + startContainer = endContainer = node; + startOffset = endOffset = idx; + } else { + if (!keep) { + idx = dom.nodeIndex(marker); + } else { + node = marker.firstChild; + idx = 1; + } + + endContainer = node; + endOffset = idx; + } + + if (!keep) { + prev = marker.previousSibling; + next = marker.nextSibling; + + // Remove all marker text nodes + each(tinymce.grep(marker.childNodes), function(node) { + if (node.nodeType == 3) + node.nodeValue = node.nodeValue.replace(/\uFEFF/g, ''); + }); + + // Remove marker but keep children if for example contents where inserted into the marker + // Also remove duplicated instances of the marker for example by a split operation or by WebKit auto split on paste feature + while (marker = dom.get(bookmark.id + '_' + suffix)) + dom.remove(marker, 1); + + // If siblings are text nodes then merge them unless it's Opera since it some how removes the node + // and we are sniffing since adding a lot of detection code for a browser with 3% of the market isn't worth the effort. Sorry, Opera but it's just a fact + if (prev && next && prev.nodeType == next.nodeType && prev.nodeType == 3 && !tinymce.isOpera) { + idx = prev.nodeValue.length; + prev.appendData(next.nodeValue); + dom.remove(next); + + if (suffix == 'start') { + startContainer = endContainer = prev; + startOffset = endOffset = idx; + } else { + endContainer = prev; + endOffset = idx; + } + } + } + } + }; + + function addBogus(node) { + // Adds a bogus BR element for empty block elements or just a space on IE since it renders BR elements incorrectly + if (dom.isBlock(node) && !node.innerHTML) + node.innerHTML = !isIE ? '
    ' : ' '; + + return node; + }; + + // Restore start/end points + restoreEndPoint('start'); + restoreEndPoint('end'); + + if (startContainer) { + rng = dom.createRng(); + rng.setStart(addBogus(startContainer), startOffset); + rng.setEnd(addBogus(endContainer), endOffset); + t.setRng(rng); + } + } else if (bookmark.name) { + t.select(dom.select(bookmark.name)[bookmark.index]); + } else if (bookmark.rng) + t.setRng(bookmark.rng); + } + }, + + /** + * Selects the specified element. This will place the start and end of the selection range around the element. + * + * @method select + * @param {Element} node HMTL DOM element to select. + * @param {Boolean} content Optional bool state if the contents should be selected or not on non IE browser. + * @return {Element} Selected element the same element as the one that got passed in. + * @example + * // Select the first paragraph in the active editor + * tinyMCE.activeEditor.selection.select(tinyMCE.activeEditor.dom.select('p')[0]); + */ + select : function(node, content) { + var t = this, dom = t.dom, rng = dom.createRng(), idx; + + if (node) { + idx = dom.nodeIndex(node); + rng.setStart(node.parentNode, idx); + rng.setEnd(node.parentNode, idx + 1); + + // Find first/last text node or BR element + if (content) { + function setPoint(node, start) { + var walker = new tinymce.dom.TreeWalker(node, node); + + do { + // Text node + if (node.nodeType == 3 && tinymce.trim(node.nodeValue).length != 0) { + if (start) + rng.setStart(node, 0); + else + rng.setEnd(node, node.nodeValue.length); + + return; + } + + // BR element + if (node.nodeName == 'BR') { + if (start) + rng.setStartBefore(node); + else + rng.setEndBefore(node); + + return; + } + } while (node = (start ? walker.next() : walker.prev())); + }; + + setPoint(node, 1); + setPoint(node); + } + + t.setRng(rng); + } + + return node; + }, + + /** + * Returns true/false if the selection range is collapsed or not. Collapsed means if it's a caret or a larger selection. + * + * @method isCollapsed + * @return {Boolean} true/false state if the selection range is collapsed or not. Collapsed means if it's a caret or a larger selection. + */ + isCollapsed : function() { + var t = this, r = t.getRng(), s = t.getSel(); + + if (!r || r.item) + return false; + + if (r.compareEndPoints) + return r.compareEndPoints('StartToEnd', r) === 0; + + return !s || r.collapsed; + }, + + /** + * Collapse the selection to start or end of range. + * + * @method collapse + * @param {Boolean} to_start Optional boolean state if to collapse to end or not. Defaults to start. + */ + collapse : function(to_start) { + var self = this, rng = self.getRng(), node; + + // Control range on IE + if (rng.item) { + node = rng.item(0); + rng = self.win.document.body.createTextRange(); + rng.moveToElementText(node); + } + + rng.collapse(!!to_start); + self.setRng(rng); + }, + + /** + * Returns the browsers internal selection object. + * + * @method getSel + * @return {Selection} Internal browser selection object. + */ + getSel : function() { + var t = this, w = this.win; + + return w.getSelection ? w.getSelection() : w.document.selection; + }, + + /** + * Returns the browsers internal range object. + * + * @method getRng + * @param {Boolean} w3c Forces a compatible W3C range on IE. + * @return {Range} Internal browser range object. + * @see http://www.quirksmode.org/dom/range_intro.html + * @see http://www.dotvoid.com/2001/03/using-the-range-object-in-mozilla/ + */ + getRng : function(w3c) { + var t = this, s, r, elm, doc = t.win.document; + + // Found tridentSel object then we need to use that one + if (w3c && t.tridentSel) + return t.tridentSel.getRangeAt(0); + + try { + if (s = t.getSel()) + r = s.rangeCount > 0 ? s.getRangeAt(0) : (s.createRange ? s.createRange() : doc.createRange()); + } catch (ex) { + // IE throws unspecified error here if TinyMCE is placed in a frame/iframe + } + + // We have W3C ranges and it's IE then fake control selection since IE9 doesn't handle that correctly yet + if (tinymce.isIE && r && r.setStart && doc.selection.createRange().item) { + elm = doc.selection.createRange().item(0); + r = doc.createRange(); + r.setStartBefore(elm); + r.setEndAfter(elm); + } + + // No range found then create an empty one + // This can occur when the editor is placed in a hidden container element on Gecko + // Or on IE when there was an exception + if (!r) + r = doc.createRange ? doc.createRange() : doc.body.createTextRange(); + + if (t.selectedRange && t.explicitRange) { + if (r.compareBoundaryPoints(r.START_TO_START, t.selectedRange) === 0 && r.compareBoundaryPoints(r.END_TO_END, t.selectedRange) === 0) { + // Safari, Opera and Chrome only ever select text which causes the range to change. + // This lets us use the originally set range if the selection hasn't been changed by the user. + r = t.explicitRange; + } else { + t.selectedRange = null; + t.explicitRange = null; + } + } + + return r; + }, + + /** + * Changes the selection to the specified DOM range. + * + * @method setRng + * @param {Range} r Range to select. + */ + setRng : function(r) { + var s, t = this; + + if (!t.tridentSel) { + s = t.getSel(); + + if (s) { + t.explicitRange = r; + + try { + s.removeAllRanges(); + } catch (ex) { + // IE9 might throw errors here don't know why + } + + s.addRange(r); + t.selectedRange = s.getRangeAt(0); + } + } else { + // Is W3C Range + if (r.cloneRange) { + t.tridentSel.addRange(r); + return; + } + + // Is IE specific range + try { + r.select(); + } catch (ex) { + // Needed for some odd IE bug #1843306 + } + } + }, + + /** + * Sets the current selection to the specified DOM element. + * + * @method setNode + * @param {Element} n Element to set as the contents of the selection. + * @return {Element} Returns the element that got passed in. + * @example + * // Inserts a DOM node at current selection/caret location + * tinyMCE.activeEditor.selection.setNode(tinyMCE.activeEditor.dom.create('img', {src : 'some.gif', title : 'some title'})); + */ + setNode : function(n) { + var t = this; + + t.setContent(t.dom.getOuterHTML(n)); + + return n; + }, + + /** + * Returns the currently selected element or the common ancestor element for both start and end of the selection. + * + * @method getNode + * @return {Element} Currently selected element or common ancestor element. + * @example + * // Alerts the currently selected elements node name + * alert(tinyMCE.activeEditor.selection.getNode().nodeName); + */ + getNode : function() { + var t = this, rng = t.getRng(), sel = t.getSel(), elm, start = rng.startContainer, end = rng.endContainer; + + // Range maybe lost after the editor is made visible again + if (!rng) + return t.dom.getRoot(); + + if (rng.setStart) { + elm = rng.commonAncestorContainer; + + // Handle selection a image or other control like element such as anchors + if (!rng.collapsed) { + if (rng.startContainer == rng.endContainer) { + if (rng.endOffset - rng.startOffset < 2) { + if (rng.startContainer.hasChildNodes()) + elm = rng.startContainer.childNodes[rng.startOffset]; + } + } + + // If the anchor node is a element instead of a text node then return this element + //if (tinymce.isWebKit && sel.anchorNode && sel.anchorNode.nodeType == 1) + // return sel.anchorNode.childNodes[sel.anchorOffset]; + + // Handle cases where the selection is immediately wrapped around a node and return that node instead of it's parent. + // This happens when you double click an underlined word in FireFox. + if (start.nodeType === 3 && end.nodeType === 3) { + function skipEmptyTextNodes(n, forwards) { + var orig = n; + while (n && n.nodeType === 3 && n.length === 0) { + n = forwards ? n.nextSibling : n.previousSibling; + } + return n || orig; + } + if (start.length === rng.startOffset) { + start = skipEmptyTextNodes(start.nextSibling, true); + } else { + start = start.parentNode; + } + if (rng.endOffset === 0) { + end = skipEmptyTextNodes(end.previousSibling, false); + } else { + end = end.parentNode; + } + + if (start && start === end) + return start; + } + } + + if (elm && elm.nodeType == 3) + return elm.parentNode; + + return elm; + } + + return rng.item ? rng.item(0) : rng.parentElement(); + }, + + getSelectedBlocks : function(st, en) { + var t = this, dom = t.dom, sb, eb, n, bl = []; + + sb = dom.getParent(st || t.getStart(), dom.isBlock); + eb = dom.getParent(en || t.getEnd(), dom.isBlock); + + if (sb) + bl.push(sb); + + if (sb && eb && sb != eb) { + n = sb; + + var walker = new tinymce.dom.TreeWalker(sb, dom.getRoot()); + while ((n = walker.next()) && n != eb) { + if (dom.isBlock(n)) + bl.push(n); + } + } + + if (eb && sb != eb) + bl.push(eb); + + return bl; + }, + + normalize : function() { + var self = this, rng, normalized; + + // Normalize only on non IE browsers for now + if (tinymce.isIE) + return; + + function normalizeEndPoint(start) { + var container, offset, walker, dom = self.dom, body = dom.getRoot(), node; + + container = rng[(start ? 'start' : 'end') + 'Container']; + offset = rng[(start ? 'start' : 'end') + 'Offset']; + + // If the container is a document move it to the body element + if (container.nodeType === 9) { + container = container.body; + offset = 0; + } + + // If the container is body try move it into the closest text node or position + // TODO: Add more logic here to handle element selection cases + if (container === body) { + // Resolve the index + if (container.hasChildNodes()) { + container = container.childNodes[Math.min(!start && offset > 0 ? offset - 1 : offset, container.childNodes.length - 1)]; + offset = 0; + + // Don't walk into elements that doesn't have any child nodes like a IMG + if (container.hasChildNodes()) { + // Walk the DOM to find a text node to place the caret at or a BR + node = container; + walker = new tinymce.dom.TreeWalker(container, body); + do { + // Found a text node use that position + if (node.nodeType === 3) { + offset = start ? 0 : node.nodeValue.length - 1; + container = node; + break; + } + + // Found a BR element that we can place the caret before + if (node.nodeName === 'BR') { + offset = dom.nodeIndex(node); + container = node.parentNode; + break; + } + } while (node = (start ? walker.next() : walker.prev())); + + normalized = true; + } + } + } + + // Set endpoint if it was normalized + if (normalized) + rng['set' + (start ? 'Start' : 'End')](container, offset); + }; + + rng = self.getRng(); + + // Normalize the end points + normalizeEndPoint(true); + + if (rng.collapsed) + normalizeEndPoint(); + + // Set the selection if it was normalized + if (normalized) { + //console.log(self.dom.dumpRng(rng)); + self.setRng(rng); + } + }, + + destroy : function(s) { + var t = this; + + t.win = null; + + // Manual destroy then remove unload handler + if (!s) + tinymce.removeUnload(t.destroy); + }, + + // IE has an issue where you can't select/move the caret by clicking outside the body if the document is in standards mode + _fixIESelection : function() { + var dom = this.dom, doc = dom.doc, body = doc.body, started, startRng, htmlElm; + + // Make HTML element unselectable since we are going to handle selection by hand + doc.documentElement.unselectable = true; + + // Return range from point or null if it failed + function rngFromPoint(x, y) { + var rng = body.createTextRange(); + + try { + rng.moveToPoint(x, y); + } catch (ex) { + // IE sometimes throws and exception, so lets just ignore it + rng = null; + } + + return rng; + }; + + // Fires while the selection is changing + function selectionChange(e) { + var pointRng; + + // Check if the button is down or not + if (e.button) { + // Create range from mouse position + pointRng = rngFromPoint(e.x, e.y); + + if (pointRng) { + // Check if pointRange is before/after selection then change the endPoint + if (pointRng.compareEndPoints('StartToStart', startRng) > 0) + pointRng.setEndPoint('StartToStart', startRng); + else + pointRng.setEndPoint('EndToEnd', startRng); + + pointRng.select(); + } + } else + endSelection(); + } + + // Removes listeners + function endSelection() { + var rng = doc.selection.createRange(); + + // If the range is collapsed then use the last start range + if (startRng && !rng.item && rng.compareEndPoints('StartToEnd', rng) === 0) + startRng.select(); + + dom.unbind(doc, 'mouseup', endSelection); + dom.unbind(doc, 'mousemove', selectionChange); + startRng = started = 0; + }; + + // Detect when user selects outside BODY + dom.bind(doc, ['mousedown', 'contextmenu'], function(e) { + if (e.target.nodeName === 'HTML') { + if (started) + endSelection(); + + // Detect vertical scrollbar, since IE will fire a mousedown on the scrollbar and have target set as HTML + htmlElm = doc.documentElement; + if (htmlElm.scrollHeight > htmlElm.clientHeight) + return; + + started = 1; + // Setup start position + startRng = rngFromPoint(e.x, e.y); + if (startRng) { + // Listen for selection change events + dom.bind(doc, 'mouseup', endSelection); + dom.bind(doc, 'mousemove', selectionChange); + + dom.win.focus(); + startRng.select(); + } + } + }); + } + }); +})(tinymce); diff --git a/js/tiny_mce/classes/dom/Serializer.js b/js/tiny_mce/classes/dom/Serializer.js index 71c0b0bc44..c0530dd915 100644 --- a/js/tiny_mce/classes/dom/Serializer.js +++ b/js/tiny_mce/classes/dom/Serializer.js @@ -9,937 +9,371 @@ */ (function(tinymce) { - // Shorten names - var extend = tinymce.extend, each = tinymce.each, Dispatcher = tinymce.util.Dispatcher, isIE = tinymce.isIE, isGecko = tinymce.isGecko; - - function wildcardToRE(s) { - return s.replace(/([?+*])/g, '.$1'); - }; - /** - * This class is used to serialize DOM trees into a string. - * Consult the TinyMCE Wiki API for more details and examples on how to use this class. + * This class is used to serialize DOM trees into a string. Consult the TinyMCE Wiki API for more details and examples on how to use this class. + * * @class tinymce.dom.Serializer */ - tinymce.create('tinymce.dom.Serializer', { - /** - * Constucts a new DOM serializer class. - * - * @constructor - * @method Serializer - * @param {Object} s Optional name/Value collection of settings for the serializer. - */ - Serializer : function(s) { - var t = this; - - t.key = 0; - t.onPreProcess = new Dispatcher(t); - t.onPostProcess = new Dispatcher(t); - - try { - t.writer = new tinymce.dom.XMLWriter(); - } catch (ex) { - // IE might throw exception if ActiveX is disabled so we then switch to the slightly slower StringWriter - t.writer = new tinymce.dom.StringWriter(); - } - - // Default settings - t.settings = s = extend({ - dom : tinymce.DOM, - valid_nodes : 0, - node_filter : 0, - attr_filter : 0, - invalid_attrs : /^(_mce_|_moz_|sizset|sizcache)/, - closed : /^(br|hr|input|meta|img|link|param|area)$/, - entity_encoding : 'named', - entities : '160,nbsp,161,iexcl,162,cent,163,pound,164,curren,165,yen,166,brvbar,167,sect,168,uml,169,copy,170,ordf,171,laquo,172,not,173,shy,174,reg,175,macr,176,deg,177,plusmn,178,sup2,179,sup3,180,acute,181,micro,182,para,183,middot,184,cedil,185,sup1,186,ordm,187,raquo,188,frac14,189,frac12,190,frac34,191,iquest,192,Agrave,193,Aacute,194,Acirc,195,Atilde,196,Auml,197,Aring,198,AElig,199,Ccedil,200,Egrave,201,Eacute,202,Ecirc,203,Euml,204,Igrave,205,Iacute,206,Icirc,207,Iuml,208,ETH,209,Ntilde,210,Ograve,211,Oacute,212,Ocirc,213,Otilde,214,Ouml,215,times,216,Oslash,217,Ugrave,218,Uacute,219,Ucirc,220,Uuml,221,Yacute,222,THORN,223,szlig,224,agrave,225,aacute,226,acirc,227,atilde,228,auml,229,aring,230,aelig,231,ccedil,232,egrave,233,eacute,234,ecirc,235,euml,236,igrave,237,iacute,238,icirc,239,iuml,240,eth,241,ntilde,242,ograve,243,oacute,244,ocirc,245,otilde,246,ouml,247,divide,248,oslash,249,ugrave,250,uacute,251,ucirc,252,uuml,253,yacute,254,thorn,255,yuml,402,fnof,913,Alpha,914,Beta,915,Gamma,916,Delta,917,Epsilon,918,Zeta,919,Eta,920,Theta,921,Iota,922,Kappa,923,Lambda,924,Mu,925,Nu,926,Xi,927,Omicron,928,Pi,929,Rho,931,Sigma,932,Tau,933,Upsilon,934,Phi,935,Chi,936,Psi,937,Omega,945,alpha,946,beta,947,gamma,948,delta,949,epsilon,950,zeta,951,eta,952,theta,953,iota,954,kappa,955,lambda,956,mu,957,nu,958,xi,959,omicron,960,pi,961,rho,962,sigmaf,963,sigma,964,tau,965,upsilon,966,phi,967,chi,968,psi,969,omega,977,thetasym,978,upsih,982,piv,8226,bull,8230,hellip,8242,prime,8243,Prime,8254,oline,8260,frasl,8472,weierp,8465,image,8476,real,8482,trade,8501,alefsym,8592,larr,8593,uarr,8594,rarr,8595,darr,8596,harr,8629,crarr,8656,lArr,8657,uArr,8658,rArr,8659,dArr,8660,hArr,8704,forall,8706,part,8707,exist,8709,empty,8711,nabla,8712,isin,8713,notin,8715,ni,8719,prod,8721,sum,8722,minus,8727,lowast,8730,radic,8733,prop,8734,infin,8736,ang,8743,and,8744,or,8745,cap,8746,cup,8747,int,8756,there4,8764,sim,8773,cong,8776,asymp,8800,ne,8801,equiv,8804,le,8805,ge,8834,sub,8835,sup,8836,nsub,8838,sube,8839,supe,8853,oplus,8855,otimes,8869,perp,8901,sdot,8968,lceil,8969,rceil,8970,lfloor,8971,rfloor,9001,lang,9002,rang,9674,loz,9824,spades,9827,clubs,9829,hearts,9830,diams,338,OElig,339,oelig,352,Scaron,353,scaron,376,Yuml,710,circ,732,tilde,8194,ensp,8195,emsp,8201,thinsp,8204,zwnj,8205,zwj,8206,lrm,8207,rlm,8211,ndash,8212,mdash,8216,lsquo,8217,rsquo,8218,sbquo,8220,ldquo,8221,rdquo,8222,bdquo,8224,dagger,8225,Dagger,8240,permil,8249,lsaquo,8250,rsaquo,8364,euro', - valid_elements : '*[*]', - extended_valid_elements : 0, - invalid_elements : 0, - fix_table_elements : 1, - fix_list_elements : true, - fix_content_duplication : true, - convert_fonts_to_spans : false, - font_size_classes : 0, - apply_source_formatting : 0, - indent_mode : 'simple', - indent_char : '\t', - indent_levels : 1, - remove_linebreaks : 1, - remove_redundant_brs : 1, - element_format : 'xhtml' - }, s); - - t.dom = s.dom; - t.schema = s.schema; - - // Use raw entities if no entities are defined - if (s.entity_encoding == 'named' && !s.entities) - s.entity_encoding = 'raw'; - - if (s.remove_redundant_brs) { - t.onPostProcess.add(function(se, o) { - // Remove single BR at end of block elements since they get rendered - o.content = o.content.replace(/(
    \s*)+<\/(p|h[1-6]|div|li)>/gi, function(a, b, c) { - // Check if it's a single element - if (/^
    \s*<\//.test(a)) - return ''; - - return a; - }); - }); - } - - // Remove XHTML element endings i.e. produce crap :) XHTML is better - if (s.element_format == 'html') { - t.onPostProcess.add(function(se, o) { - o.content = o.content.replace(/<([^>]+) \/>/g, '<$1>'); - }); - } - - if (s.fix_list_elements) { - t.onPreProcess.add(function(se, o) { - var nl, x, a = ['ol', 'ul'], i, n, p, r = /^(OL|UL)$/, np; - - function prevNode(e, n) { - var a = n.split(','), i; - - while ((e = e.previousSibling) != null) { - for (i=0; i= 1767) { - each(t.dom.select('p table', o.node).reverse(), function(n) { - var parent = t.dom.getParent(n.parentNode, 'table,p'); - - if (parent.nodeName != 'TABLE') { - try { - t.dom.split(parent, n); - } catch (ex) { - // IE can sometimes fire an unknown runtime error so we just ignore it - } - } - }); - } - }); - } - }, - - /** - * Sets a list of entities to use for the named entity encoded. - * - * @method setEntities - * @param {String} s List of entities in the following format: number,name,.... - */ - setEntities : function(s) { - var t = this, a, i, l = {}, v; - - // No need to setup more than once - if (t.entityLookup) - return; - - // Build regex and lookup array - a = s.split(','); - for (i = 0; i < a.length; i += 2) { - v = a[i]; - // Don't add default & " etc. - if (v == 34 || v == 38 || v == 60 || v == 62) - continue; + /** + * Constucts a new DOM serializer class. + * + * @constructor + * @method Serializer + * @param {Object} settings Serializer settings object. + * @param {tinymce.dom.DOMUtils} dom DOMUtils instance reference. + * @param {tinymce.html.Schema} schema Optional schema reference. + */ + tinymce.dom.Serializer = function(settings, dom, schema) { + var onPreProcess, onPostProcess, isIE = tinymce.isIE, each = tinymce.each, htmlParser; - l[String.fromCharCode(a[i])] = a[i + 1]; + // Support the old apply_source_formatting option + if (!settings.apply_source_formatting) + settings.indent = false; - v = parseInt(a[i]).toString(16); - } + settings.remove_trailing_brs = true; - t.entityLookup = l; - }, + // Default DOM and Schema if they are undefined + dom = dom || tinymce.DOM; + schema = schema || new tinymce.html.Schema(settings); + settings.entity_encoding = settings.entity_encoding || 'named'; /** - * Sets the valid elements rules of the serializer this enables you to specify things like what elements should be - * outputted and what attributes specific elements might have. - * Consult the Wiki for more details on this format. + * This event gets executed before a HTML fragment gets serialized into a HTML string. This event enables you to do modifications to the DOM before the serialization occurs. It's important to know that the element that is getting serialized is cloned so it's not inside a document. * - * @method setRules - * @param {String} s Valid elements rules string. + * @event onPreProcess + * @param {tinymce.dom.Serializer} sender object/Serializer instance that is serializing an element. + * @param {Object} args Object containing things like the current node. + * @example + * // Adds an observer to the onPreProcess event + * serializer.onPreProcess.add(function(se, o) { + * // Add a class to each paragraph + * se.dom.addClass(se.dom.select('p', o.node), 'myclass'); + * }); */ - setRules : function(s) { - var t = this; - - t._setup(); - t.rules = {}; - t.wildRules = []; - t.validElements = {}; - - return t.addRules(s); - }, + onPreProcess = new tinymce.util.Dispatcher(self); /** - * Adds valid elements rules to the serializer this enables you to specify things like what elements should be - * outputted and what attributes specific elements might have. - * Consult the Wiki for more details on this format. + * This event gets executed after a HTML fragment has been serialized into a HTML string. This event enables you to do modifications to the HTML string like regexp replaces etc. * - * @method addRules - * @param {String} s Valid elements rules string to add. + * @event onPreProcess + * @param {tinymce.dom.Serializer} sender object/Serializer instance that is serializing an element. + * @param {Object} args Object containing things like the current contents. + * @example + * // Adds an observer to the onPostProcess event + * serializer.onPostProcess.add(function(se, o) { + * // Remove all paragraphs and replace with BR + * o.content = o.content.replace(/]+>|

    /g, ''); + * o.content = o.content.replace(/<\/p>/g, '
    '); + * }); */ - addRules : function(s) { - var t = this, dr; - - if (!s) - return; + onPostProcess = new tinymce.util.Dispatcher(self); - t._setup(); + htmlParser = new tinymce.html.DomParser(settings, schema); - each(s.split(','), function(s) { - var p = s.split(/\[|\]/), tn = p[0].split('/'), ra, at, wat, va = []; + // Convert move data-mce-src, data-mce-href and data-mce-style into nodes or process them if needed + htmlParser.addAttributeFilter('src,href,style', function(nodes, name) { + var i = nodes.length, node, value, internalName = 'data-mce-' + name, urlConverter = settings.url_converter, urlConverterScope = settings.url_converter_scope, undef; - // Extend with default rules - if (dr) - at = tinymce.extend([], dr.attribs); + while (i--) { + node = nodes[i]; - // Parse attributes - if (p.length > 1) { - each(p[1].split('|'), function(s) { - var ar = {}, i; + value = node.attributes.map[internalName]; + if (value !== undef) { + // Set external name to internal value and remove internal + node.attr(name, value.length > 0 ? value : null); + node.attr(internalName, null); + } else { + // No internal attribute found then convert the value we have in the DOM + value = node.attributes.map[name]; - at = at || []; + if (name === "style") + value = dom.serializeStyle(dom.parseStyle(value), node.name); + else if (urlConverter) + value = urlConverter.call(urlConverterScope, value, name, node.name); - // Parse attribute rule - s = s.replace(/::/g, '~'); - s = /^([!\-])?([\w*.?~_\-]+|)([=:<])?(.+)?$/.exec(s); - s[2] = s[2].replace(/~/g, ':'); - - // Add required attributes - if (s[1] == '!') { - ra = ra || []; - ra.push(s[2]); - } - - // Remove inherited attributes - if (s[1] == '-') { - for (i = 0; i 0 ? value : null); } - - // Handle element names - each(tn, function(s, i) { - var pr = s.charAt(0), x = 1, ru = {}; - - // Extend with default rule data - if (dr) { - if (dr.noEmpty) - ru.noEmpty = dr.noEmpty; - - if (dr.fullEnd) - ru.fullEnd = dr.fullEnd; - - if (dr.padd) - ru.padd = dr.padd; - } - - // Handle prefixes - switch (pr) { - case '-': - ru.noEmpty = true; - break; - - case '+': - ru.fullEnd = true; - break; - - case '#': - ru.padd = true; - break; - - default: - x = 0; - } - - tn[i] = s = s.substring(x); - t.validElements[s] = 1; - - // Add element name or element regex - if (/[*.?]/.test(tn[0])) { - ru.nameRE = new RegExp('^' + wildcardToRE(tn[0]) + '$'); - t.wildRules = t.wildRules || {}; - t.wildRules.push(ru); - } else { - ru.name = tn[0]; - - // Store away default rule - if (tn[0] == '@') - dr = ru; - - t.rules[s] = ru; - } - - ru.attribs = at; - - if (ra) - ru.requiredAttribs = ra; - - if (wat) { - // Build valid attributes regexp - s = ''; - each(va, function(v) { - if (s) - s += '|'; - - s += '(' + wildcardToRE(v) + ')'; - }); - ru.validAttribsRE = new RegExp('^' + s.toLowerCase() + '$'); - ru.wildAttribs = wat; - } - }); - }); - - // Build valid elements regexp - s = ''; - each(t.validElements, function(v, k) { - if (s) - s += '|'; - - if (k != '@') - s += k; - }); - t.validElementsRE = new RegExp('^(' + wildcardToRE(s.toLowerCase()) + ')$'); - - //console.debug(t.validElementsRE.toString()); - //console.dir(t.rules); - //console.dir(t.wildRules); - }, - - /** - * Finds a rule object by name. - * - * @method findRule - * @param {String} n Name to look for in rules collection. - * @return {Object} Rule object found or null if it wasn't found. - */ - findRule : function(n) { - var t = this, rl = t.rules, i, r; - - t._setup(); - - // Exact match - r = rl[n]; - if (r) - return r; - - // Try wildcards - rl = t.wildRules; - for (i = 0; i < rl.length; i++) { - if (rl[i].nameRE.test(n)) - return rl[i]; } + }); - return null; - }, - - /** - * Finds an attribute rule object by name. - * - * @method findAttribRule - * @param {Object} ru Rule object to search though. - * @param {String} n Name of the rule to retrive. - * @return {Object} Rule object of the specified attribute. - */ - findAttribRule : function(ru, n) { - var i, wa = ru.wildAttribs; + // Remove internal classes mceItem<..> + htmlParser.addAttributeFilter('class', function(nodes, name) { + var i = nodes.length, node, value; - for (i = 0; i < wa.length; i++) { - if (wa[i].nameRE.test(n)) - return wa[i]; + while (i--) { + node = nodes[i]; + value = node.attr('class').replace(/\s*mce(Item\w+|Selected)\s*/g, ''); + node.attr('class', value.length > 0 ? value : null); } + }); - return null; - }, + // Remove bookmark elements + htmlParser.addAttributeFilter('data-mce-type', function(nodes, name, args) { + var i = nodes.length, node; - /** - * Serializes the specified node into a HTML string. - * - * @method serialize - * @param {Element} n Element/Node to serialize. - * @param {Object} o Object to add serialized contents to, this object will also be passed to the event listeners. - * @return {String} Serialized HTML contents. - */ - serialize : function(n, o) { - var h, t = this, doc, oldDoc, impl, selected; - - t._setup(); - o = o || {}; - o.format = o.format || 'html'; - t.processObj = o; - - // IE looses the selected attribute on option elements so we need to store it - // See: http://support.microsoft.com/kb/829907 - if (isIE) { - selected = []; - each(n.getElementsByTagName('option'), function(n) { - var v = t.dom.getAttrib(n, 'selected'); - - selected.push(v ? v : null); - }); - } - - n = n.cloneNode(true); + while (i--) { + node = nodes[i]; - // IE looses the selected attribute on option elements so we need to restore it - if (isIE) { - each(n.getElementsByTagName('option'), function(n, i) { - t.dom.setAttrib(n, 'selected', selected[i]); - }); + if (node.attributes.map['data-mce-type'] === 'bookmark' && !args.cleanup) + node.remove(); } + }); - // Nodes needs to be attached to something in WebKit/Opera - // Older builds of Opera crashes if you attach the node to an document created dynamically - // and since we can't feature detect a crash we need to sniff the acutal build number - // This fix will make DOM ranges and make Sizzle happy! - impl = n.ownerDocument.implementation; - if (impl.createHTMLDocument && (tinymce.isOpera && opera.buildNumber() >= 1767)) { - // Create an empty HTML document - doc = impl.createHTMLDocument(""); - - // Add the element or it's children if it's a body element to the new document - each(n.nodeName == 'BODY' ? n.childNodes : [n], function(node) { - doc.body.appendChild(doc.importNode(node, true)); - }); - - // Grab first child or body element for serialization - if (n.nodeName != 'BODY') - n = doc.body.firstChild; - else - n = doc.body; - - // set the new document in DOMUtils so createElement etc works - oldDoc = t.dom.doc; - t.dom.doc = doc; - } + // Force script into CDATA sections and remove the mce- prefix also add comments around styles + htmlParser.addNodeFilter('script,style', function(nodes, name) { + var i = nodes.length, node, value; - t.key = '' + (parseInt(t.key) + 1); - - // Pre process - if (!o.no_events) { - o.node = n; - t.onPreProcess.dispatch(t, o); - } - - // Serialize HTML DOM into a string - t.writer.reset(); - t._info = o; - t._serializeNode(n, o.getInner); - - // Post process - o.content = t.writer.getContent(); - - // Restore the old document if it was changed - if (oldDoc) - t.dom.doc = oldDoc; - - if (!o.no_events) - t.onPostProcess.dispatch(t, o); - - t._postProcess(o); - o.node = null; + function trim(value) { + return value.replace(/()/g, '\n') + .replace(/^[\r\n]*|[\r\n]*$/g, '') + .replace(/^\s*(\/\/\s*|\]\]>|-->|\]\]-->)\s*$/g, ''); + }; - return tinymce.trim(o.content); - }, + while (i--) { + node = nodes[i]; + value = node.firstChild ? node.firstChild.value : ''; - // Internal functions + if (name === "script") { + // Remove mce- prefix from script elements + node.attr('type', (node.attr('type') || 'text/javascript').replace(/^mce\-/, '')); - /** - * Indents the specified content object. - * - * @param {Object} o Content object to indent. - */ - _postProcess : function(o) { - var t = this, s = t.settings, h = o.content, sc = [], p; - - if (o.format == 'html') { - // Protect some elements - p = t._protect({ - content : h, - patterns : [ - {pattern : /(]*>)(.*?)(<\/script>)/g}, - {pattern : /(]*>)(.*?)(<\/noscript>)/g}, - {pattern : /(]*>)(.*?)(<\/style>)/g}, - {pattern : /(]*>)(.*?)(<\/pre>)/g, encode : 1}, - {pattern : /()/g} - ] - }); - - h = p.content; - - // Entity encode - if (s.entity_encoding !== 'raw') - h = t._encode(h); - - // Use BR instead of   padded P elements inside editor and use

     

    outside editor -/* if (o.set) - h = h.replace(/

    \s+( | |\u00a0|
    )\s+<\/p>/g, '


    '); - else - h = h.replace(/

    \s+( | |\u00a0|
    )\s+<\/p>/g, '

    $1

    ');*/ - - // Since Gecko and Safari keeps whitespace in the DOM we need to - // remove it inorder to match other browsers. But I think Gecko and Safari is right. - // This process is only done when getting contents out from the editor. - if (!o.set) { - // We need to replace paragraph whitespace with an nbsp before indentation to keep the \u00a0 char - h = h.replace(/

    \s+<\/p>|]+)>\s+<\/p>/g, s.entity_encoding == 'numeric' ? ' 

    ' : ' 

    '); - - if (s.remove_linebreaks) { - h = h.replace(/\r?\n|\r/g, ' '); - h = h.replace(/(<[^>]+>)\s+/g, '$1 '); - h = h.replace(/\s+(<\/[^>]+>)/g, ' $1'); - h = h.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object) ([^>]+)>\s+/g, '<$1 $2>'); // Trim block start - h = h.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>\s+/g, '<$1>'); // Trim block start - h = h.replace(/\s+<\/(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>/g, ''); // Trim block end - } - - // Simple indentation - if (s.apply_source_formatting && s.indent_mode == 'simple') { - // Add line breaks before and after block elements - h = h.replace(/<(\/?)(ul|hr|table|meta|link|tbody|tr|object|body|head|html|map)(|[^>]+)>\s*/g, '\n<$1$2$3>\n'); - h = h.replace(/\s*<(p|h[1-6]|blockquote|div|title|style|pre|script|td|li|area)(|[^>]+)>/g, '\n<$1$2>'); - h = h.replace(/<\/(p|h[1-6]|blockquote|div|title|style|pre|script|td|li)>\s*/g, '\n'); - h = h.replace(/\n\n/g, '\n'); - } + if (value.length > 0) + node.firstChild.value = '// '; + } else { + if (value.length > 0) + node.firstChild.value = ''; } - - h = t._unprotect(h, p); - - // Restore CDATA sections - h = h.replace(//g, ''); - - // Restore the \u00a0 character if raw mode is enabled - if (s.entity_encoding == 'raw') - h = h.replace(/

     <\/p>|]+)> <\/p>/g, '\u00a0

    '); - - // Restore noscript elements - h = h.replace(/]+|)>([\s\S]*?)<\/noscript>/g, function(v, attribs, text) { - return '' + t.dom.decode(text.replace(//g, '')) + ''; - }); } - - o.content = h; - }, - - _serializeNode : function(n, inner) { - var t = this, s = t.settings, w = t.writer, hc, el, cn, i, l, a, at, no, v, nn, ru, ar, iv, closed, keep, type; - - if (!s.node_filter || s.node_filter(n)) { - switch (n.nodeType) { - case 1: // Element - if (n.hasAttribute ? n.hasAttribute('_mce_bogus') : n.getAttribute('_mce_bogus')) - return; - - iv = keep = false; - hc = n.hasChildNodes(); - nn = n.getAttribute('_mce_name') || n.nodeName.toLowerCase(); - - // Get internal type - type = n.getAttribute('_mce_type'); - if (type) { - if (!t._info.cleanup) { - iv = true; - return; - } else - keep = 1; - } - - // Add correct prefix on IE - if (isIE) { - if (n.scopeName !== 'HTML' && n.scopeName !== 'html') - nn = n.scopeName + ':' + nn; - } - - // Remove mce prefix on IE needed for the abbr element - if (nn.indexOf('mce:') === 0) - nn = nn.substring(4); - - // Check if valid - if (!keep) { - if (!t.validElementsRE || !t.validElementsRE.test(nn) || (t.invalidElementsRE && t.invalidElementsRE.test(nn)) || inner) { - iv = true; - break; - } - } - - if (isIE) { - // Fix IE content duplication (DOM can have multiple copies of the same node) - if (s.fix_content_duplication) { - if (n._mce_serialized == t.key) - return; - - n._mce_serialized = t.key; - } - - // IE sometimes adds a / infront of the node name - if (nn.charAt(0) == '/') - nn = nn.substring(1); - } else if (isGecko) { - // Ignore br elements - if (n.nodeName === 'BR' && n.getAttribute('type') == '_moz') - return; - } - - // Check if valid child - if (s.validate_children) { - if (t.elementName && !t.schema.isValid(t.elementName, nn)) { - iv = true; - break; - } - - t.elementName = nn; - } - - ru = t.findRule(nn); - - // No valid rule for this element could be found then skip it - if (!ru) { - iv = true; - break; - } - - nn = ru.name || nn; - closed = s.closed.test(nn); - - // Skip empty nodes or empty node name in IE - if ((!hc && ru.noEmpty) || (isIE && !nn)) { - iv = true; - break; - } - - // Check required - if (ru.requiredAttribs) { - a = ru.requiredAttribs; - - for (i = a.length - 1; i >= 0; i--) { - if (this.dom.getAttrib(n, a[i]) !== '') - break; - } - - // None of the required was there - if (i == -1) { - iv = true; - break; - } - } - - w.writeStartElement(nn); - - // Add ordered attributes - if (ru.attribs) { - for (i=0, at = ru.attribs, l = at.length; i-1; i--) { - no = at[i]; - - if (no.specified) { - a = no.nodeName.toLowerCase(); - - if (s.invalid_attrs.test(a) || !ru.validAttribsRE.test(a)) - continue; - - ar = t.findAttribRule(ru, a); - v = t._getAttrib(n, ar, a); - - if (v !== null) - w.writeAttribute(a, v); - } - } - } - - // Keep type attribute - if (type && keep) - w.writeAttribute('_mce_type', type); - - // Write text from script - if (nn === 'script' && tinymce.trim(n.innerHTML)) { - w.writeText('// '); // Padd it with a comment so it will parse on older browsers - w.writeCDATA(n.innerHTML.replace(/|<\[CDATA\[|\]\]>/g, '')); // Remove comments and cdata stuctures - hc = false; - break; - } - - // Padd empty nodes with a   - if (ru.padd) { - // If it has only one bogus child, padd it anyway workaround for
    bug - if (hc && (cn = n.firstChild) && cn.nodeType === 1 && n.childNodes.length === 1) { - if (cn.hasAttribute ? cn.hasAttribute('_mce_bogus') : cn.getAttribute('_mce_bogus')) - w.writeText('\u00a0'); - } else if (!hc) - w.writeText('\u00a0'); // No children then padd it - } - - break; - - case 3: // Text - // Check if valid child - if (s.validate_children && t.elementName && !t.schema.isValid(t.elementName, '#text')) - return; - - return w.writeText(n.nodeValue); - - case 4: // CDATA - return w.writeCDATA(n.nodeValue); - - case 8: // Comment - return w.writeComment(n.nodeValue); - } - } else if (n.nodeType == 1) - hc = n.hasChildNodes(); - - if (hc && !closed) { - cn = n.firstChild; - - while (cn) { - t._serializeNode(cn); - t.elementName = nn; - cn = cn.nextSibling; + }); + + // Convert comments to cdata and handle protected comments + htmlParser.addNodeFilter('#comment', function(nodes, name) { + var i = nodes.length, node; + + while (i--) { + node = nodes[i]; + + if (node.value.indexOf('[CDATA[') === 0) { + node.name = '#cdata'; + node.type = 4; + node.value = node.value.replace(/^\[CDATA\[|\]\]$/g, ''); + } else if (node.value.indexOf('mce:protected ') === 0) { + node.name = "#text"; + node.type = 3; + node.raw = true; + node.value = unescape(node.value).substr(14); } } - - // Write element end - if (!iv) { - if (!closed) - w.writeFullEndElement(); - else - w.writeEndElement(); - } - }, - - _protect : function(o) { - var t = this; - - o.items = o.items || []; - - function enc(s) { - return s.replace(/[\r\n\\]/g, function(c) { - if (c === '\n') - return '\\n'; - else if (c === '\\') - return '\\\\'; - - return '\\r'; - }); - }; - - function dec(s) { - return s.replace(/\\[\\rn]/g, function(c) { - if (c === '\\n') - return '\n'; - else if (c === '\\\\') - return '\\'; - - return '\r'; - }); - }; - - each(o.patterns, function(p) { - o.content = dec(enc(o.content).replace(p.pattern, function(x, a, b, c) { - b = dec(b); - - if (p.encode) - b = t._encode(b); - - o.items.push(b); - return a + '' + c; - })); - }); - - return o; - }, - - _unprotect : function(h, o) { - h = h.replace(/\'); - this.count++; - }, - - /** - * String writer specific function. Enables you to write raw contents to the string. - * - * @method writeRaw - * @param {String} v String with raw contents to write. - */ - writeRaw : function(v) { - this.str += v; - }, - - /** - * String writer specific method. This encodes the raw entities of a string. - * - * @method encode - * @param {String} s String to encode. - * @return {String} String with entity encoding of the raw elements like <>&". - */ - encode : function(s) { - return s.replace(/[<>&"]/g, function(v) { - switch (v) { - case '<': - return '<'; - - case '>': - return '>'; - - case '&': - return '&'; - - case '"': - return '"'; - } - - return v; - }); - }, - - /** - * Returns a string representation of the elements/nodes written. - * - * @method getContent - * @return {String} String representation of the written elements/nodes. - */ - getContent : function() { - return this.str; - }, - - _writeAttributesEnd : function(s) { - if (!this.inAttr) - return; - - this.inAttr = false; - - if (s && this.elementCount == this.count) { - this.writeRaw(' />'); - return false; - } - - this.writeRaw('>'); - - return true; - } - }); -})(tinymce); diff --git a/js/tiny_mce/classes/dom/TreeWalker.js b/js/tiny_mce/classes/dom/TreeWalker.js index c7fc06047c..3436aae367 100644 --- a/js/tiny_mce/classes/dom/TreeWalker.js +++ b/js/tiny_mce/classes/dom/TreeWalker.js @@ -59,6 +59,6 @@ tinymce.dom.TreeWalker = function(start_node, root_node) { * @return {Node} Current node where the walker is after moving to the previous node. */ this.prev = function(shallow) { - return (node = findSibling(node, 'lastChild', 'lastSibling', shallow)); + return (node = findSibling(node, 'lastChild', 'previousSibling', shallow)); }; }; diff --git a/js/tiny_mce/classes/dom/TridentSelection.js b/js/tiny_mce/classes/dom/TridentSelection.js index 30d1ae39f7..5f37055313 100644 --- a/js/tiny_mce/classes/dom/TridentSelection.js +++ b/js/tiny_mce/classes/dom/TridentSelection.js @@ -10,366 +10,434 @@ (function() { function Selection(selection) { - var t = this, invisibleChar = '\uFEFF', range, lastIERng, dom = selection.dom, TRUE = true, FALSE = false; + var self = this, dom = selection.dom, TRUE = true, FALSE = false; + + function getPosition(rng, start) { + var checkRng, startIndex = 0, endIndex, inside, + children, child, offset, index, position = -1, parent; + + // Setup test range, collapse it and get the parent + checkRng = rng.duplicate(); + checkRng.collapse(start); + parent = checkRng.parentElement(); + + // Check if the selection is within the right document + if (parent.ownerDocument !== selection.dom.doc) + return; + + // IE will report non editable elements as it's parent so look for an editable one + while (parent.contentEditable === "false") { + parent = parent.parentNode; + } + + // If parent doesn't have any children then return that we are inside the element + if (!parent.hasChildNodes()) { + return {node : parent, inside : 1}; + } + + // Setup node list and endIndex + children = parent.children; + endIndex = children.length - 1; + + // Perform a binary search for the position + while (startIndex <= endIndex) { + index = Math.floor((startIndex + endIndex) / 2); + + // Move selection to node and compare the ranges + child = children[index]; + checkRng.moveToElementText(child); + position = checkRng.compareEndPoints(start ? 'StartToStart' : 'EndToEnd', rng); + + // Before/after or an exact match + if (position > 0) { + endIndex = index - 1; + } else if (position < 0) { + startIndex = index + 1; + } else { + return {node : child}; + } + } + + // Check if child position is before or we didn't find a position + if (position < 0) { + // No element child was found use the parent element and the offset inside that + if (!child) { + checkRng.moveToElementText(parent); + checkRng.collapse(true); + child = parent; + inside = true; + } else + checkRng.collapse(false); + + checkRng.setEndPoint(start ? 'EndToStart' : 'EndToEnd', rng); + + // Fix for edge case:
    ..
    ab|c
    + if (checkRng.compareEndPoints(start ? 'StartToStart' : 'StartToEnd', rng) > 0) { + checkRng = rng.duplicate(); + checkRng.collapse(start); + + offset = -1; + while (parent == checkRng.parentElement()) { + if (checkRng.move('character', -1) == 0) + break; + + offset++; + } + } + + offset = offset || checkRng.text.replace('\r\n', ' ').length; + } else { + // Child position is after the selection endpoint + checkRng.collapse(true); + checkRng.setEndPoint(start ? 'StartToStart' : 'StartToEnd', rng); + + // Get the length of the text to find where the endpoint is relative to it's container + offset = checkRng.text.replace('\r\n', ' ').length; + } + + return {node : child, position : position, offset : offset, inside : inside}; + }; // Returns a W3C DOM compatible range object by using the IE Range API function getRange() { - var ieRange = selection.getRng(), domRange = dom.createRng(), element, collapsed; + var ieRange = selection.getRng(), domRange = dom.createRng(), element, collapsed, tmpRange, element2, bookmark, fail; // If selection is outside the current document just return an empty range element = ieRange.item ? ieRange.item(0) : ieRange.parentElement(); if (element.ownerDocument != dom.doc) return domRange; - // Handle control selection or text selection of a image - if (ieRange.item || !element.hasChildNodes()) { + collapsed = selection.isCollapsed(); + + // Handle control selection + if (ieRange.item) { domRange.setStart(element.parentNode, dom.nodeIndex(element)); domRange.setEnd(domRange.startContainer, domRange.startOffset + 1); return domRange; } - collapsed = selection.isCollapsed(); - function findEndPoint(start) { - var marker, container, offset, nodes, startIndex = 0, endIndex, index, parent, checkRng, position; - - // Setup temp range and collapse it - checkRng = ieRange.duplicate(); - checkRng.collapse(start); + var endPoint = getPosition(ieRange, start), container, offset, textNodeOffset = 0, sibling, undef, nodeValue; - // Create marker and insert it at the end of the endpoints parent - marker = dom.create('a'); - parent = checkRng.parentElement(); + container = endPoint.node; + offset = endPoint.offset; - // If parent doesn't have any children then set the container to that parent and the index to 0 - if (!parent.hasChildNodes()) { - domRange[start ? 'setStart' : 'setEnd'](parent, 0); + if (endPoint.inside && !container.hasChildNodes()) { + domRange[start ? 'setStart' : 'setEnd'](container, 0); return; } - parent.appendChild(marker); - checkRng.moveToElementText(marker); - position = ieRange.compareEndPoints(start ? 'StartToStart' : 'EndToEnd', checkRng); - if (position > 0) { - // The position is after the end of the parent element. - // This is the case where IE puts the caret to the left edge of a table. - domRange[start ? 'setStartAfter' : 'setEndAfter'](parent); - dom.remove(marker); + if (offset === undef) { + domRange[start ? 'setStartBefore' : 'setEndAfter'](container); return; } - // Setup node list and endIndex - nodes = tinymce.grep(parent.childNodes); - endIndex = nodes.length - 1; - // Perform a binary search for the position - while (startIndex <= endIndex) { - index = Math.floor((startIndex + endIndex) / 2); - - // Insert marker and check it's position relative to the selection - parent.insertBefore(marker, nodes[index]); - checkRng.moveToElementText(marker); - position = ieRange.compareEndPoints(start ? 'StartToStart' : 'EndToEnd', checkRng); - if (position > 0) { - // Marker is to the right - startIndex = index + 1; - } else if (position < 0) { - // Marker is to the left - endIndex = index - 1; - } else { - // Maker is where we are - found = true; - break; + if (endPoint.position < 0) { + sibling = endPoint.inside ? container.firstChild : container.nextSibling; + + if (!sibling) { + domRange[start ? 'setStartAfter' : 'setEndAfter'](container); + return; } - } - // Setup container - container = position > 0 || index == 0 ? marker.nextSibling : marker.previousSibling; + if (!offset) { + if (sibling.nodeType == 3) + domRange[start ? 'setStart' : 'setEnd'](sibling, 0); + else + domRange[start ? 'setStartBefore' : 'setEndBefore'](sibling); - // Handle element selection - if (container.nodeType == 1) { - dom.remove(marker); + return; + } - // Find offset and container - offset = dom.nodeIndex(container); - container = container.parentNode; + // Find the text node and offset + while (sibling) { + nodeValue = sibling.nodeValue; + textNodeOffset += nodeValue.length; + + // We are at or passed the position we where looking for + if (textNodeOffset >= offset) { + container = sibling; + textNodeOffset -= offset; + textNodeOffset = nodeValue.length - textNodeOffset; + break; + } - // Move the offset if we are setting the end or the position is after an element - if (!start || index > 0) - offset++; + sibling = sibling.nextSibling; + } } else { - // Calculate offset within text node - if (position > 0 || index == 0) { - checkRng.setEndPoint(start ? 'StartToStart' : 'EndToEnd', ieRange); - offset = checkRng.text.length; - } else { - checkRng.setEndPoint(start ? 'StartToStart' : 'EndToEnd', ieRange); - offset = container.nodeValue.length - checkRng.text.length; + // Find the text node and offset + sibling = container.previousSibling; + + if (!sibling) + return domRange[start ? 'setStartBefore' : 'setEndBefore'](container); + + // If there isn't any text to loop then use the first position + if (!offset) { + if (container.nodeType == 3) + domRange[start ? 'setStart' : 'setEnd'](sibling, container.nodeValue.length); + else + domRange[start ? 'setStartAfter' : 'setEndAfter'](sibling); + + return; } - dom.remove(marker); + while (sibling) { + textNodeOffset += sibling.nodeValue.length; + + // We are at or passed the position we where looking for + if (textNodeOffset >= offset) { + container = sibling; + textNodeOffset -= offset; + break; + } + + sibling = sibling.previousSibling; + } } - domRange[start ? 'setStart' : 'setEnd'](container, offset); + domRange[start ? 'setStart' : 'setEnd'](container, textNodeOffset); }; - // Find start point - findEndPoint(true); + try { + // Find start point + findEndPoint(true); - // Find end point if needed - if (!collapsed) - findEndPoint(); + // Find end point if needed + if (!collapsed) + findEndPoint(); + } catch (ex) { + // IE has a nasty bug where text nodes might throw "invalid argument" when you + // access the nodeValue or other properties of text nodes. This seems to happend when + // text nodes are split into two nodes by a delete/backspace call. So lets detect it and try to fix it. + if (ex.number == -2147024809) { + // Get the current selection + bookmark = self.getBookmark(2); + + // Get start element + tmpRange = ieRange.duplicate(); + tmpRange.collapse(true); + element = tmpRange.parentElement(); + + // Get end element + if (!collapsed) { + tmpRange = ieRange.duplicate(); + tmpRange.collapse(false); + element2 = tmpRange.parentElement(); + element2.innerHTML = element2.innerHTML; + } - return domRange; - }; + // Remove the broken elements + element.innerHTML = element.innerHTML; - this.addRange = function(rng) { - var ieRng, ieRng2, doc = selection.dom.doc, body = doc.body, startPos, endPos, sc, so, ec, eo, marker, lastIndex, skipStart, skipEnd; + // Restore the selection + self.moveToBookmark(bookmark); - this.destroy(); + // Since the range has moved we need to re-get it + ieRange = selection.getRng(); - // Setup some shorter versions - sc = rng.startContainer; - so = rng.startOffset; - ec = rng.endContainer; - eo = rng.endOffset; - ieRng = body.createTextRange(); + // Find start point + findEndPoint(true); - // If document selection move caret to first node in document - if (sc == doc || ec == doc) { - ieRng = body.createTextRange(); - ieRng.collapse(); - ieRng.select(); - return; + // Find end point if needed + if (!collapsed) + findEndPoint(); + } else + throw ex; // Throw other errors } - // If child index resolve it - if (sc.nodeType == 1 && sc.hasChildNodes()) { - lastIndex = sc.childNodes.length - 1; + return domRange; + }; + + this.getBookmark = function(type) { + var rng = selection.getRng(), start, end, bookmark = {}; - // Index is higher that the child count then we need to jump over the start container - if (so > lastIndex) { - skipStart = 1; - sc = sc.childNodes[lastIndex]; - } else - sc = sc.childNodes[so]; + function getIndexes(node) { + var node, parent, root, children, i, indexes = []; - // Child was text node then move offset to start of it - if (sc.nodeType == 3) - so = 0; - } + parent = node.parentNode; + root = dom.getRoot().parentNode; - // If child index resolve it - if (ec.nodeType == 1 && ec.hasChildNodes()) { - lastIndex = ec.childNodes.length - 1; + while (parent != root && parent.nodeType !== 9) { + children = parent.children; - if (eo == 0) { - skipEnd = 1; - ec = ec.childNodes[0]; - } else { - ec = ec.childNodes[Math.min(lastIndex, eo - 1)]; + i = children.length; + while (i--) { + if (node === children[i]) { + indexes.push(i); + break; + } + } - // Child was text node then move offset to end of text node - if (ec.nodeType == 3) - eo = ec.nodeValue.length; + node = parent; + parent = parent.parentNode; } + + return indexes; + }; + + function getBookmarkEndPoint(start) { + var position; + + position = getPosition(rng, start); + if (position) { + return { + position : position.position, + offset : position.offset, + indexes : getIndexes(position.node), + inside : position.inside + }; + } + }; + + // Non ubstructive bookmark + if (type === 2) { + // Handle text selection + if (!rng.item) { + bookmark.start = getBookmarkEndPoint(true); + + if (!selection.isCollapsed()) + bookmark.end = getBookmarkEndPoint(); + } else + bookmark.start = {ctrl : true, indexes : getIndexes(rng.item(0))}; } - // Single element selection - if (sc == ec && sc.nodeType == 1) { - // Make control selection for some elements - if (/^(IMG|TABLE)$/.test(sc.nodeName) && so != eo) { - ieRng = body.createControlRange(); - ieRng.addElement(sc); - } else { - ieRng = body.createTextRange(); + return bookmark; + }; - // Padd empty elements with invisible character - if (!sc.hasChildNodes() && sc.canHaveHTML) - sc.innerHTML = invisibleChar; + this.moveToBookmark = function(bookmark) { + var rng, body = dom.doc.body; - // Select element contents - ieRng.moveToElementText(sc); + function resolveIndexes(indexes) { + var node, i, idx, children; - // If it's only containing a padding remove it so the caret remains - if (sc.innerHTML == invisibleChar) { - ieRng.collapse(TRUE); - sc.removeChild(sc.firstChild); + node = dom.getRoot(); + for (i = indexes.length - 1; i >= 0; i--) { + children = node.children; + idx = indexes[i]; + + if (idx <= children.length - 1) { + node = children[idx]; } } - if (so == eo) - ieRng.collapse(eo <= rng.endContainer.childNodes.length - 1); + return node; + }; + + function setBookmarkEndPoint(start) { + var endPoint = bookmark[start ? 'start' : 'end'], moveLeft, moveRng, undef; - ieRng.select(); - ieRng.scrollIntoView(); - return; - } + if (endPoint) { + moveLeft = endPoint.position > 0; - // Create range and marker - ieRng = body.createTextRange(); - marker = doc.createElement('span'); - marker.innerHTML = ' '; - - // Set start of range to startContainer/startOffset - if (sc.nodeType == 3) { - // Insert marker after/before startContainer - if (skipStart) - dom.insertAfter(marker, sc); - else - sc.parentNode.insertBefore(marker, sc); - - // Select marker the caret to offset position - ieRng.moveToElementText(marker); - marker.parentNode.removeChild(marker); - - // Move if we need to, moving it 0 characters actually moves it! - if (so > 0) - ieRng.move('character', so); - } else { - ieRng.moveToElementText(sc); + moveRng = body.createTextRange(); + moveRng.moveToElementText(resolveIndexes(endPoint.indexes)); - if (skipStart) - ieRng.collapse(FALSE); - } + offset = endPoint.offset; + if (offset !== undef) { + moveRng.collapse(endPoint.inside || moveLeft); + moveRng.moveStart('character', moveLeft ? -offset : offset); + } else + moveRng.collapse(start); - // If same text container then we can do a more simple move - if (sc == ec && sc.nodeType == 3) { - try { - ieRng.moveEnd('character', eo - so); - ieRng.select(); - ieRng.scrollIntoView(); - } catch (ex) { - // Some times a Runtime error of the 800a025e type gets thrown - // especially when the caret is placed before a table. - // This is a somewhat strange location for the caret. - // TODO: Find a better solution for this would possible require a rewrite of the setRng method - } + rng.setEndPoint(start ? 'StartToStart' : 'EndToStart', moveRng); - return; - } + if (start) + rng.collapse(true); + } + }; - // Set end of range to endContainer/endOffset - ieRng2 = body.createTextRange(); - if (ec.nodeType == 3) { - // Insert marker after/before startContainer - ec.parentNode.insertBefore(marker, ec); - - // Move selection to end marker and move caret to end offset - ieRng2.moveToElementText(marker); - marker.parentNode.removeChild(marker); - ieRng2.move('character', eo); - ieRng.setEndPoint('EndToStart', ieRng2); - } else { - ieRng2.moveToElementText(ec); - ieRng2.collapse(!!skipEnd); - ieRng.setEndPoint('EndToEnd', ieRng2); + if (bookmark.start) { + if (bookmark.start.ctrl) { + rng = body.createControlRange(); + rng.addElement(resolveIndexes(bookmark.start.indexes)); + rng.select(); + } else { + rng = body.createTextRange(); + setBookmarkEndPoint(true); + setBookmarkEndPoint(); + rng.select(); + } } - - ieRng.select(); - ieRng.scrollIntoView(); }; - this.getRangeAt = function() { - // Setup new range if the cache is empty - if (!range || !tinymce.dom.RangeUtils.compareRanges(lastIERng, selection.getRng())) { - range = getRange(); + this.addRange = function(rng) { + var ieRng, ctrlRng, startContainer, startOffset, endContainer, endOffset, doc = selection.dom.doc, body = doc.body; - // Store away text range for next call - lastIERng = selection.getRng(); - } + function setEndPoint(start) { + var container, offset, marker, tmpRng, nodes; - // IE will say that the range is equal then produce an invalid argument exception - // if you perform specific operations in a keyup event. For example Ctrl+Del. - // This hack will invalidate the range cache if the exception occurs - try { - range.startContainer.nextSibling; - } catch (ex) { - range = getRange(); - lastIERng = null; - } + marker = dom.create('a'); + container = start ? startContainer : endContainer; + offset = start ? startOffset : endOffset; + tmpRng = ieRng.duplicate(); - // Return cached range - return range; - }; + if (container == doc || container == doc.documentElement) { + container = body; + offset = 0; + } - this.destroy = function() { - // Destroy cached range and last IE range to avoid memory leaks - lastIERng = range = null; - }; + if (container.nodeType == 3) { + container.parentNode.insertBefore(marker, container); + tmpRng.moveToElementText(marker); + tmpRng.moveStart('character', offset); + dom.remove(marker); + ieRng.setEndPoint(start ? 'StartToStart' : 'EndToEnd', tmpRng); + } else { + nodes = container.childNodes; - // IE has an issue where you can't select/move the caret by clicking outside the body if the document is in standards mode - if (selection.dom.boxModel) { - (function() { - var doc = dom.doc, body = doc.body, started, startRng; + if (nodes.length) { + if (offset >= nodes.length) { + dom.insertAfter(marker, nodes[nodes.length - 1]); + } else { + container.insertBefore(marker, nodes[offset]); + } - // Make HTML element unselectable since we are going to handle selection by hand - doc.documentElement.unselectable = TRUE; + tmpRng.moveToElementText(marker); + } else { + // Empty node selection for example
    |
    + marker = doc.createTextNode('\uFEFF'); + container.appendChild(marker); + tmpRng.moveToElementText(marker.parentNode); + tmpRng.collapse(TRUE); + } - // Return range from point or null if it failed - function rngFromPoint(x, y) { - var rng = body.createTextRange(); + ieRng.setEndPoint(start ? 'StartToStart' : 'EndToEnd', tmpRng); + dom.remove(marker); + } + } + + // Setup some shorter versions + startContainer = rng.startContainer; + startOffset = rng.startOffset; + endContainer = rng.endContainer; + endOffset = rng.endOffset; + ieRng = body.createTextRange(); + // If single element selection then try making a control selection out of it + if (startContainer == endContainer && startContainer.nodeType == 1 && startOffset == endOffset - 1) { + if (startOffset == endOffset - 1) { try { - rng.moveToPoint(x, y); + ctrlRng = body.createControlRange(); + ctrlRng.addElement(startContainer.childNodes[startOffset]); + ctrlRng.select(); + return; } catch (ex) { - // IE sometimes throws and exception, so lets just ignore it - rng = null; + // Ignore } + } + } - return rng; - }; - - // Fires while the selection is changing - function selectionChange(e) { - var pointRng; - - // Check if the button is down or not - if (e.button) { - // Create range from mouse position - pointRng = rngFromPoint(e.x, e.y); - - if (pointRng) { - // Check if pointRange is before/after selection then change the endPoint - if (pointRng.compareEndPoints('StartToStart', startRng) > 0) - pointRng.setEndPoint('StartToStart', startRng); - else - pointRng.setEndPoint('EndToEnd', startRng); + // Set start/end point of selection + setEndPoint(true); + setEndPoint(); - pointRng.select(); - } - } else - endSelection(); - } + // Select the new range and scroll it into view + ieRng.select(); + }; - // Removes listeners - function endSelection() { - dom.unbind(doc, 'mouseup', endSelection); - dom.unbind(doc, 'mousemove', selectionChange); - started = 0; - }; - - // Detect when user selects outside BODY - dom.bind(doc, 'mousedown', function(e) { - if (e.target.nodeName === 'HTML') { - if (started) - endSelection(); - - started = 1; - - // Setup start position - startRng = rngFromPoint(e.x, e.y); - if (startRng) { - // Listen for selection change events - dom.bind(doc, 'mouseup', endSelection); - dom.bind(doc, 'mousemove', selectionChange); - - startRng.select(); - } - } - }); - })(); - } + // Expose range method + this.getRangeAt = getRange; }; // Expose the selection object diff --git a/js/tiny_mce/classes/dom/XMLWriter.js b/js/tiny_mce/classes/dom/XMLWriter.js deleted file mode 100644 index fe361a1991..0000000000 --- a/js/tiny_mce/classes/dom/XMLWriter.js +++ /dev/null @@ -1,165 +0,0 @@ -/** - * XMLWriter.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function(tinymce) { - /** - * This class writes nodes into a XML document structure. This structure can then be - * serialized down to a HTML string later on. - * @class tinymce.dom.XMLWriter - */ - tinymce.create('tinymce.dom.XMLWriter', { - node : null, - - /** - * Constructs a new XMLWriter. - * - * @constructor - * @method XMLWriter - * @param {Object} s Optional settings object. - */ - XMLWriter : function(s) { - // Get XML document - function getXML() { - var i = document.implementation; - - if (!i || !i.createDocument) { - // Try IE objects - try {return new ActiveXObject('MSXML2.DOMDocument');} catch (ex) {} - try {return new ActiveXObject('Microsoft.XmlDom');} catch (ex) {} - } else - return i.createDocument('', '', null); - }; - - this.doc = getXML(); - - // Since Opera and WebKit doesn't escape > into > we need to do it our self to normalize the output for all browsers - this.valid = tinymce.isOpera || tinymce.isWebKit; - - this.reset(); - }, - - /** - * Resets the writer so it can be reused the contents of the writer is cleared. - * - * @method reset - */ - reset : function() { - var t = this, d = t.doc; - - if (d.firstChild) - d.removeChild(d.firstChild); - - t.node = d.appendChild(d.createElement("html")); - }, - - /** - * Writes the start of an element like for example: /g, '%MCGT%'); - - this.node.setAttribute(n, v); - }, - - /** - * Write the end of a element. This will add a short end for elements with out children like for example a img element. - * - * @method writeEndElement - */ - writeEndElement : function() { - this.node = this.node.parentNode; - }, - - /** - * Writes the end of a element. This will add a full end to the element even if it didn't have any children. - * - * @method writeFullEndElement - */ - writeFullEndElement : function() { - var t = this, n = t.node; - - n.appendChild(t.doc.createTextNode("")); - t.node = n.parentNode; - }, - - /** - * Writes a text node value. - * - * @method writeText - * @param {String} v Value to append as a text node. - */ - writeText : function(v) { - if (this.valid) - v = v.replace(/>/g, '%MCGT%'); - - this.node.appendChild(this.doc.createTextNode(v)); - }, - - /** - * Writes a CDATA section. - * - * @method writeCDATA - * @param {String} v Value to write in CDATA. - */ - writeCDATA : function(v) { - this.node.appendChild(this.doc.createCDATASection(v)); - }, - - /** - * Writes a comment. - * - * @method writeComment - * @param {String} v Value of the comment. - */ - writeComment : function(v) { - // Fix for bug #2035694 - if (tinymce.isIE) - v = v.replace(/^\-|\-$/g, ' '); - - this.node.appendChild(this.doc.createComment(v.replace(/\-\-/g, ' '))); - }, - - /** - * Returns a string representation of the elements/nodes written. - * - * @method getContent - * @return {String} String representation of the written elements/nodes. - */ - getContent : function() { - var h; - - h = this.doc.xml || new XMLSerializer().serializeToString(this.doc); - h = h.replace(/<\?[^?]+\?>||<\/html>||]+>/g, ''); - h = h.replace(/ ?\/>/g, ' />'); - - if (this.valid) - h = h.replace(/\%MCGT%/g, '>'); - - return h; - } - }); -})(tinymce); diff --git a/js/tiny_mce/classes/firebug/FIREBUG.LICENSE b/js/tiny_mce/classes/firebug/FIREBUG.LICENSE new file mode 100644 index 0000000000..8b9c44ab72 --- /dev/null +++ b/js/tiny_mce/classes/firebug/FIREBUG.LICENSE @@ -0,0 +1,30 @@ +Software License Agreement (BSD License) + +Copyright (c) 2007, Parakey Inc. +All rights reserved. + +Redistribution and use of this software in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + +* Neither the name of Parakey Inc. nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission of Parakey Inc. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER +IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/js/tiny_mce/classes/html/DomParser.js b/js/tiny_mce/classes/html/DomParser.js new file mode 100644 index 0000000000..dadbf0891e --- /dev/null +++ b/js/tiny_mce/classes/html/DomParser.js @@ -0,0 +1,577 @@ +/** + * DomParser.js + * + * Copyright 2010, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function(tinymce) { + var Node = tinymce.html.Node; + + /** + * This class parses HTML code into a DOM like structure of nodes it will remove redundant whitespace and make + * sure that the node tree is valid according to the specified schema. So for example:

    a

    b

    c

    will become

    a

    b

    c

    + * + * @example + * var parser = new tinymce.html.DomParser({validate: true}, schema); + * var rootNode = parser.parse('

    content

    '); + * + * @class tinymce.html.DomParser + * @version 3.4 + */ + + /** + * Constructs a new DomParser instance. + * + * @constructor + * @method DomParser + * @param {Object} settings Name/value collection of settings. comment, cdata, text, start and end are callbacks. + * @param {tinymce.html.Schema} schema HTML Schema class to use when parsing. + */ + tinymce.html.DomParser = function(settings, schema) { + var self = this, nodeFilters = {}, attributeFilters = [], matchedNodes = {}, matchedAttributes = {}; + + settings = settings || {}; + settings.validate = "validate" in settings ? settings.validate : true; + settings.root_name = settings.root_name || 'body'; + self.schema = schema = schema || new tinymce.html.Schema(); + + function fixInvalidChildren(nodes) { + var ni, node, parent, parents, newParent, currentNode, tempNode, childNode, i, + childClone, nonEmptyElements, nonSplitableElements, sibling, nextNode; + + nonSplitableElements = tinymce.makeMap('tr,td,th,tbody,thead,tfoot,table'); + nonEmptyElements = schema.getNonEmptyElements(); + + for (ni = 0; ni < nodes.length; ni++) { + node = nodes[ni]; + + // Already removed + if (!node.parent) + continue; + + // Get list of all parent nodes until we find a valid parent to stick the child into + parents = [node]; + for (parent = node.parent; parent && !schema.isValidChild(parent.name, node.name) && !nonSplitableElements[parent.name]; parent = parent.parent) + parents.push(parent); + + // Found a suitable parent + if (parent && parents.length > 1) { + // Reverse the array since it makes looping easier + parents.reverse(); + + // Clone the related parent and insert that after the moved node + newParent = currentNode = self.filterNode(parents[0].clone()); + + // Start cloning and moving children on the left side of the target node + for (i = 0; i < parents.length - 1; i++) { + if (schema.isValidChild(currentNode.name, parents[i].name)) { + tempNode = self.filterNode(parents[i].clone()); + currentNode.append(tempNode); + } else + tempNode = currentNode; + + for (childNode = parents[i].firstChild; childNode && childNode != parents[i + 1]; ) { + nextNode = childNode.next; + tempNode.append(childNode); + childNode = nextNode; + } + + currentNode = tempNode; + } + + if (!newParent.isEmpty(nonEmptyElements)) { + parent.insert(newParent, parents[0], true); + parent.insert(node, newParent); + } else { + parent.insert(node, parents[0], true); + } + + // Check if the element is empty by looking through it's contents and special treatment for


    + parent = parents[0]; + if (parent.isEmpty(nonEmptyElements) || parent.firstChild === parent.lastChild && parent.firstChild.name === 'br') { + parent.empty().remove(); + } + } else if (node.parent) { + // If it's an LI try to find a UL/OL for it or wrap it + if (node.name === 'li') { + sibling = node.prev; + if (sibling && (sibling.name === 'ul' || sibling.name === 'ul')) { + sibling.append(node); + continue; + } + + sibling = node.next; + if (sibling && (sibling.name === 'ul' || sibling.name === 'ul')) { + sibling.insert(node, sibling.firstChild, true); + continue; + } + + node.wrap(self.filterNode(new Node('ul', 1))); + continue; + } + + // Try wrapping the element in a DIV + if (schema.isValidChild(node.parent.name, 'div') && schema.isValidChild('div', node.name)) { + node.wrap(self.filterNode(new Node('div', 1))); + } else { + // We failed wrapping it, then remove or unwrap it + if (node.name === 'style' || node.name === 'script') + node.empty().remove(); + else + node.unwrap(); + } + } + } + }; + + /** + * Runs the specified node though the element and attributes filters. + * + * @param {tinymce.html.Node} Node the node to run filters on. + * @return {tinymce.html.Node} The passed in node. + */ + self.filterNode = function(node) { + var i, name, list; + + // Run element filters + if (name in nodeFilters) { + list = matchedNodes[name]; + + if (list) + list.push(node); + else + matchedNodes[name] = [node]; + } + + // Run attribute filters + i = attributeFilters.length; + while (i--) { + name = attributeFilters[i].name; + + if (name in node.attributes.map) { + list = matchedAttributes[name]; + + if (list) + list.push(node); + else + matchedAttributes[name] = [node]; + } + } + + return node; + }; + + /** + * Adds a node filter function to the parser, the parser will collect the specified nodes by name + * and then execute the callback ones it has finished parsing the document. + * + * @example + * parser.addNodeFilter('p,h1', function(nodes, name) { + * for (var i = 0; i < nodes.length; i++) { + * console.log(nodes[i].name); + * } + * }); + * @method addNodeFilter + * @method {String} name Comma separated list of nodes to collect. + * @param {function} callback Callback function to execute once it has collected nodes. + */ + self.addNodeFilter = function(name, callback) { + tinymce.each(tinymce.explode(name), function(name) { + var list = nodeFilters[name]; + + if (!list) + nodeFilters[name] = list = []; + + list.push(callback); + }); + }; + + /** + * Adds a attribute filter function to the parser, the parser will collect nodes that has the specified attributes + * and then execute the callback ones it has finished parsing the document. + * + * @example + * parser.addAttributeFilter('src,href', function(nodes, name) { + * for (var i = 0; i < nodes.length; i++) { + * console.log(nodes[i].name); + * } + * }); + * @method addAttributeFilter + * @method {String} name Comma separated list of nodes to collect. + * @param {function} callback Callback function to execute once it has collected nodes. + */ + self.addAttributeFilter = function(name, callback) { + tinymce.each(tinymce.explode(name), function(name) { + var i; + + for (i = 0; i < attributeFilters.length; i++) { + if (attributeFilters[i].name === name) { + attributeFilters[i].callbacks.push(callback); + return; + } + } + + attributeFilters.push({name: name, callbacks: [callback]}); + }); + }; + + /** + * Parses the specified HTML string into a DOM like node tree and returns the result. + * + * @example + * var rootNode = new DomParser({...}).parse('text'); + * @method parse + * @param {String} html Html string to sax parse. + * @param {Object} args Optional args object that gets passed to all filter functions. + * @return {tinymce.html.Node} Root node containing the tree. + */ + self.parse = function(html, args) { + var parser, rootNode, node, nodes, i, l, fi, fl, list, name, validate, + blockElements, startWhiteSpaceRegExp, invalidChildren = [], + endWhiteSpaceRegExp, allWhiteSpaceRegExp, whiteSpaceElements, children, nonEmptyElements, rootBlockName; + + args = args || {}; + matchedNodes = {}; + matchedAttributes = {}; + blockElements = tinymce.extend(tinymce.makeMap('script,style,head,html,body,title,meta,param'), schema.getBlockElements()); + nonEmptyElements = schema.getNonEmptyElements(); + children = schema.children; + validate = settings.validate; + rootBlockName = "forced_root_block" in args ? args.forced_root_block : settings.forced_root_block; + + whiteSpaceElements = schema.getWhiteSpaceElements(); + startWhiteSpaceRegExp = /^[ \t\r\n]+/; + endWhiteSpaceRegExp = /[ \t\r\n]+$/; + allWhiteSpaceRegExp = /[ \t\r\n]+/g; + + function addRootBlocks() { + var node = rootNode.firstChild, next, rootBlockNode; + + while (node) { + next = node.next; + + if (node.type == 3 || (node.type == 1 && node.name !== 'p' && !blockElements[node.name] && !node.attr('data-mce-type'))) { + if (!rootBlockNode) { + // Create a new root block element + rootBlockNode = createNode(rootBlockName, 1); + rootNode.insert(rootBlockNode, node); + rootBlockNode.append(node); + } else + rootBlockNode.append(node); + } else { + rootBlockNode = null; + } + + node = next; + }; + }; + + function createNode(name, type) { + var node = new Node(name, type), list; + + if (name in nodeFilters) { + list = matchedNodes[name]; + + if (list) + list.push(node); + else + matchedNodes[name] = [node]; + } + + return node; + }; + + function removeWhitespaceBefore(node) { + var textNode, textVal, sibling; + + for (textNode = node.prev; textNode && textNode.type === 3; ) { + textVal = textNode.value.replace(endWhiteSpaceRegExp, ''); + + if (textVal.length > 0) { + textNode.value = textVal; + textNode = textNode.prev; + } else { + sibling = textNode.prev; + textNode.remove(); + textNode = sibling; + } + } + }; + + parser = new tinymce.html.SaxParser({ + validate : validate, + fix_self_closing : !validate, // Let the DOM parser handle
  • in
  • or

    in

    for better results + + cdata: function(text) { + node.append(createNode('#cdata', 4)).value = text; + }, + + text: function(text, raw) { + var textNode; + + // Trim all redundant whitespace on non white space elements + if (!whiteSpaceElements[node.name]) { + text = text.replace(allWhiteSpaceRegExp, ' '); + + if (node.lastChild && blockElements[node.lastChild.name]) + text = text.replace(startWhiteSpaceRegExp, ''); + } + + // Do we need to create the node + if (text.length !== 0) { + textNode = createNode('#text', 3); + textNode.raw = !!raw; + node.append(textNode).value = text; + } + }, + + comment: function(text) { + node.append(createNode('#comment', 8)).value = text; + }, + + pi: function(name, text) { + node.append(createNode(name, 7)).value = text; + removeWhitespaceBefore(node); + }, + + doctype: function(text) { + var newNode; + + newNode = node.append(createNode('#doctype', 10)); + newNode.value = text; + removeWhitespaceBefore(node); + }, + + start: function(name, attrs, empty) { + var newNode, attrFiltersLen, elementRule, textNode, attrName, text, sibling, parent; + + elementRule = validate ? schema.getElementRule(name) : {}; + if (elementRule) { + newNode = createNode(elementRule.outputName || name, 1); + newNode.attributes = attrs; + newNode.shortEnded = empty; + + node.append(newNode); + + // Check if node is valid child of the parent node is the child is + // unknown we don't collect it since it's probably a custom element + parent = children[node.name]; + if (parent && children[newNode.name] && !parent[newNode.name]) + invalidChildren.push(newNode); + + attrFiltersLen = attributeFilters.length; + while (attrFiltersLen--) { + attrName = attributeFilters[attrFiltersLen].name; + + if (attrName in attrs.map) { + list = matchedAttributes[attrName]; + + if (list) + list.push(newNode); + else + matchedAttributes[attrName] = [newNode]; + } + } + + // Trim whitespace before block + if (blockElements[name]) + removeWhitespaceBefore(newNode); + + // Change current node if the element wasn't empty i.e not
    or + if (!empty) + node = newNode; + } + }, + + end: function(name) { + var textNode, elementRule, text, sibling, tempNode; + + elementRule = validate ? schema.getElementRule(name) : {}; + if (elementRule) { + if (blockElements[name]) { + if (!whiteSpaceElements[node.name]) { + // Trim whitespace at beginning of block + for (textNode = node.firstChild; textNode && textNode.type === 3; ) { + text = textNode.value.replace(startWhiteSpaceRegExp, ''); + + if (text.length > 0) { + textNode.value = text; + textNode = textNode.next; + } else { + sibling = textNode.next; + textNode.remove(); + textNode = sibling; + } + } + + // Trim whitespace at end of block + for (textNode = node.lastChild; textNode && textNode.type === 3; ) { + text = textNode.value.replace(endWhiteSpaceRegExp, ''); + + if (text.length > 0) { + textNode.value = text; + textNode = textNode.prev; + } else { + sibling = textNode.prev; + textNode.remove(); + textNode = sibling; + } + } + } + + // Trim start white space + textNode = node.prev; + if (textNode && textNode.type === 3) { + text = textNode.value.replace(startWhiteSpaceRegExp, ''); + + if (text.length > 0) + textNode.value = text; + else + textNode.remove(); + } + } + + // Handle empty nodes + if (elementRule.removeEmpty || elementRule.paddEmpty) { + if (node.isEmpty(nonEmptyElements)) { + if (elementRule.paddEmpty) + node.empty().append(new Node('#text', '3')).value = '\u00a0'; + else { + // Leave nodes that have a name like + if (!node.attributes.map.name) { + tempNode = node.parent; + node.empty().remove(); + node = tempNode; + return; + } + } + } + } + + node = node.parent; + } + } + }, schema); + + rootNode = node = new Node(args.context || settings.root_name, 11); + + parser.parse(html); + + // Fix invalid children or report invalid children in a contextual parsing + if (validate && invalidChildren.length) { + if (!args.context) + fixInvalidChildren(invalidChildren); + else + args.invalid = true; + } + + // Wrap nodes in the root into block elements if the root is body + if (rootBlockName && rootNode.name == 'body') + addRootBlocks(); + + // Run filters only when the contents is valid + if (!args.invalid) { + // Run node filters + for (name in matchedNodes) { + list = nodeFilters[name]; + nodes = matchedNodes[name]; + + // Remove already removed children + fi = nodes.length; + while (fi--) { + if (!nodes[fi].parent) + nodes.splice(fi, 1); + } + + for (i = 0, l = list.length; i < l; i++) + list[i](nodes, name, args); + } + + // Run attribute filters + for (i = 0, l = attributeFilters.length; i < l; i++) { + list = attributeFilters[i]; + + if (list.name in matchedAttributes) { + nodes = matchedAttributes[list.name]; + + // Remove already removed children + fi = nodes.length; + while (fi--) { + if (!nodes[fi].parent) + nodes.splice(fi, 1); + } + + for (fi = 0, fl = list.callbacks.length; fi < fl; fi++) + list.callbacks[fi](nodes, list.name, args); + } + } + } + + return rootNode; + }; + + // Remove
    at end of block elements Gecko and WebKit injects BR elements to + // make it possible to place the caret inside empty blocks. This logic tries to remove + // these elements and keep br elements that where intended to be there intact + if (settings.remove_trailing_brs) { + self.addNodeFilter('br', function(nodes, name) { + var i, l = nodes.length, node, blockElements = schema.getBlockElements(), + nonEmptyElements = schema.getNonEmptyElements(), parent, prev, prevName; + + // Remove brs from body element as well + blockElements.body = 1; + + // Must loop forwards since it will otherwise remove all brs in

    a


    + for (i = 0; i < l; i++) { + node = nodes[i]; + parent = node.parent; + + if (blockElements[node.parent.name] && node === parent.lastChild) { + // Loop all nodes to the right of the current node and check for other BR elements + // excluding bookmarks since they are invisible + prev = node.prev; + while (prev) { + prevName = prev.name; + + // Ignore bookmarks + if (prevName !== "span" || prev.attr('data-mce-type') !== 'bookmark') { + // Found a non BR element + if (prevName !== "br") + break; + + // Found another br it's a

    structure then don't remove anything + if (prevName === 'br') { + node = null; + break; + } + } + + prev = prev.prev; + } + + if (node) { + node.remove(); + + // Is the parent to be considered empty after we removed the BR + if (parent.isEmpty(nonEmptyElements)) { + elementRule = schema.getElementRule(parent.name); + + // Remove or padd the element depending on schema rule + if (elementRule) { + if (elementRule.removeEmpty) + parent.remove(); + else if (elementRule.paddEmpty) + parent.empty().append(new tinymce.html.Node('#text', 3)).value = '\u00a0'; + } + } + } + } + } + }); + } + } +})(tinymce); diff --git a/js/tiny_mce/classes/html/Entities.js b/js/tiny_mce/classes/html/Entities.js new file mode 100644 index 0000000000..5965f55a94 --- /dev/null +++ b/js/tiny_mce/classes/html/Entities.js @@ -0,0 +1,253 @@ +/** + * Entities.js + * + * Copyright 2010, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function(tinymce) { + var namedEntities, baseEntities, reverseEntities, + attrsCharsRegExp = /[&<>\"\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g, + textCharsRegExp = /[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g, + rawCharsRegExp = /[<>&\"\']/g, + entityRegExp = /&(#x|#)?([\w]+);/g, + asciiMap = { + 128 : "\u20AC", 130 : "\u201A", 131 : "\u0192", 132 : "\u201E", 133 : "\u2026", 134 : "\u2020", + 135 : "\u2021", 136 : "\u02C6", 137 : "\u2030", 138 : "\u0160", 139 : "\u2039", 140 : "\u0152", + 142 : "\u017D", 145 : "\u2018", 146 : "\u2019", 147 : "\u201C", 148 : "\u201D", 149 : "\u2022", + 150 : "\u2013", 151 : "\u2014", 152 : "\u02DC", 153 : "\u2122", 154 : "\u0161", 155 : "\u203A", + 156 : "\u0153", 158 : "\u017E", 159 : "\u0178" + }; + + // Raw entities + baseEntities = { + '\"' : '"', // Needs to be escaped since the YUI compressor would otherwise break the code + "'" : ''', + '<' : '<', + '>' : '>', + '&' : '&' + }; + + // Reverse lookup table for raw entities + reverseEntities = { + '<' : '<', + '>' : '>', + '&' : '&', + '"' : '"', + ''' : "'" + }; + + // Decodes text by using the browser + function nativeDecode(text) { + var elm; + + elm = document.createElement("div"); + elm.innerHTML = text; + + return elm.textContent || elm.innerText || text; + }; + + // Build a two way lookup table for the entities + function buildEntitiesLookup(items, radix) { + var i, chr, entity, lookup = {}; + + if (items) { + items = items.split(','); + radix = radix || 10; + + // Build entities lookup table + for (i = 0; i < items.length; i += 2) { + chr = String.fromCharCode(parseInt(items[i], radix)); + + // Only add non base entities + if (!baseEntities[chr]) { + entity = '&' + items[i + 1] + ';'; + lookup[chr] = entity; + lookup[entity] = chr; + } + } + + return lookup; + } + }; + + // Unpack entities lookup where the numbers are in radix 32 to reduce the size + namedEntities = buildEntitiesLookup( + '50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,' + + '5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,' + + '5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,' + + '5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,' + + '68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,' + + '6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,' + + '6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,' + + '75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,' + + '7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,' + + '7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,' + + 'sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,' + + 'st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,' + + 't9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,' + + 'tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,' + + 'u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,' + + '81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,' + + '8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,' + + '8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,' + + '8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,' + + '8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,' + + 'nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,' + + 'rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,' + + 'Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,' + + '80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,' + + '811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro' + , 32); + + tinymce.html = tinymce.html || {}; + + /** + * Entity encoder class. + * + * @class tinymce.html.SaxParser + * @static + * @version 3.4 + */ + tinymce.html.Entities = { + /** + * Encodes the specified string using raw entities. This means only the required XML base entities will be endoded. + * + * @method encodeRaw + * @param {String} text Text to encode. + * @param {Boolean} attr Optional flag to specify if the text is attribute contents. + * @return {String} Entity encoded text. + */ + encodeRaw : function(text, attr) { + return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) { + return baseEntities[chr] || chr; + }); + }, + + /** + * Encoded the specified text with both the attributes and text entities. This function will produce larger text contents + * since it doesn't know if the context is within a attribute or text node. This was added for compatibility + * and is exposed as the DOMUtils.encode function. + * + * @method encodeAllRaw + * @param {String} text Text to encode. + * @return {String} Entity encoded text. + */ + encodeAllRaw : function(text) { + return ('' + text).replace(rawCharsRegExp, function(chr) { + return baseEntities[chr] || chr; + }); + }, + + /** + * Encodes the specified string using numeric entities. The core entities will be encoded as named ones but all non lower ascii characters + * will be encoded into numeric entities. + * + * @method encodeNumeric + * @param {String} text Text to encode. + * @param {Boolean} attr Optional flag to specify if the text is attribute contents. + * @return {String} Entity encoded text. + */ + encodeNumeric : function(text, attr) { + return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) { + // Multi byte sequence convert it to a single entity + if (chr.length > 1) + return '&#' + (((chr.charCodeAt(0) - 0xD800) * 0x400) + (chr.charCodeAt(1) - 0xDC00) + 0x10000) + ';'; + + return baseEntities[chr] || '&#' + chr.charCodeAt(0) + ';'; + }); + }, + + /** + * Encodes the specified string using named entities. The core entities will be encoded as named ones but all non lower ascii characters + * will be encoded into named entities. + * + * @method encodeNamed + * @param {String} text Text to encode. + * @param {Boolean} attr Optional flag to specify if the text is attribute contents. + * @param {Object} entities Optional parameter with entities to use. + * @return {String} Entity encoded text. + */ + encodeNamed : function(text, attr, entities) { + entities = entities || namedEntities; + + return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) { + return baseEntities[chr] || entities[chr] || chr; + }); + }, + + /** + * Returns an encode function based on the name(s) and it's optional entities. + * + * @method getEncodeFunc + * @param {String} name Comma separated list of encoders for example named,numeric. + * @param {String} entities Optional parameter with entities to use instead of the built in set. + * @return {function} Encode function to be used. + */ + getEncodeFunc : function(name, entities) { + var Entities = tinymce.html.Entities; + + entities = buildEntitiesLookup(entities) || namedEntities; + + function encodeNamedAndNumeric(text, attr) { + return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) { + return baseEntities[chr] || entities[chr] || '&#' + chr.charCodeAt(0) + ';' || chr; + }); + }; + + function encodeCustomNamed(text, attr) { + return Entities.encodeNamed(text, attr, entities); + }; + + // Replace + with , to be compatible with previous TinyMCE versions + name = tinymce.makeMap(name.replace(/\+/g, ',')); + + // Named and numeric encoder + if (name.named && name.numeric) + return encodeNamedAndNumeric; + + // Named encoder + if (name.named) { + // Custom names + if (entities) + return encodeCustomNamed; + + return Entities.encodeNamed; + } + + // Numeric + if (name.numeric) + return Entities.encodeNumeric; + + // Raw encoder + return Entities.encodeRaw; + }, + + /** + * Decodes the specified string, this will replace entities with raw UTF characters. + * + * @param {String} text Text to entity decode. + * @return {String} Entity decoded string. + */ + decode : function(text) { + return text.replace(entityRegExp, function(all, numeric, value) { + if (numeric) { + value = parseInt(value, numeric.length === 2 ? 16 : 10); + + // Support upper UTF + if (value > 0xFFFF) { + value -= 0x10000; + + return String.fromCharCode(0xD800 + (value >> 10), 0xDC00 + (value & 0x3FF)); + } else + return asciiMap[value] || String.fromCharCode(value); + } + + return reverseEntities[all] || namedEntities[all] || nativeDecode(all); + }); + } + }; +})(tinymce); diff --git a/js/tiny_mce/classes/html/Node.js b/js/tiny_mce/classes/html/Node.js new file mode 100644 index 0000000000..774adbc737 --- /dev/null +++ b/js/tiny_mce/classes/html/Node.js @@ -0,0 +1,474 @@ +/** + * Node.js + * + * Copyright 2010, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function(tinymce) { + var whiteSpaceRegExp = /^[ \t\r\n]*$/, typeLookup = { + '#text' : 3, + '#comment' : 8, + '#cdata' : 4, + '#pi' : 7, + '#doctype' : 10, + '#document-fragment' : 11 + }; + + // Walks the tree left/right + function walk(node, root_node, prev) { + var sibling, parent, startName = prev ? 'lastChild' : 'firstChild', siblingName = prev ? 'prev' : 'next'; + + // Walk into nodes if it has a start + if (node[startName]) + return node[startName]; + + // Return the sibling if it has one + if (node !== root_node) { + sibling = node[siblingName]; + + if (sibling) + return sibling; + + // Walk up the parents to look for siblings + for (parent = node.parent; parent && parent !== root_node; parent = parent.parent) { + sibling = parent[siblingName]; + + if (sibling) + return sibling; + } + } + }; + + /** + * This class is a minimalistic implementation of a DOM like node used by the DomParser class. + * + * @example + * var node = new tinymce.html.Node('strong', 1); + * someRoot.append(node); + * + * @class tinymce.html.Node + * @version 3.4 + */ + + /** + * Constructs a new Node instance. + * + * @constructor + * @method Node + * @param {String} name Name of the node type. + * @param {Number} type Numeric type representing the node. + */ + function Node(name, type) { + this.name = name; + this.type = type; + + if (type === 1) { + this.attributes = []; + this.attributes.map = {}; + } + } + + tinymce.extend(Node.prototype, { + /** + * Replaces the current node with the specified one. + * + * @example + * someNode.replace(someNewNode); + * + * @method replace + * @param {tinymce.html.Node} node Node to replace the current node with. + * @return {tinymce.html.Node} The old node that got replaced. + */ + replace : function(node) { + var self = this; + + if (node.parent) + node.remove(); + + self.insert(node, self); + self.remove(); + + return self; + }, + + /** + * Gets/sets or removes an attribute by name. + * + * @example + * someNode.attr("name", "value"); // Sets an attribute + * console.log(someNode.attr("name")); // Gets an attribute + * someNode.attr("name", null); // Removes an attribute + * + * @method attr + * @param {String} name Attribute name to set or get. + * @param {String} value Optional value to set. + * @return {String/tinymce.html.Node} String or undefined on a get operation or the current node on a set operation. + */ + attr : function(name, value) { + var self = this, attrs, i, undef; + + if (typeof name !== "string") { + for (i in name) + self.attr(i, name[i]); + + return self; + } + + if (attrs = self.attributes) { + if (value !== undef) { + // Remove attribute + if (value === null) { + if (name in attrs.map) { + delete attrs.map[name]; + + i = attrs.length; + while (i--) { + if (attrs[i].name === name) { + attrs = attrs.splice(i, 1); + return self; + } + } + } + + return self; + } + + // Set attribute + if (name in attrs.map) { + // Set attribute + i = attrs.length; + while (i--) { + if (attrs[i].name === name) { + attrs[i].value = value; + break; + } + } + } else + attrs.push({name: name, value: value}); + + attrs.map[name] = value; + + return self; + } else { + return attrs.map[name]; + } + } + }, + + /** + * Does a shallow clones the node into a new node. It will also exclude id attributes since + * there should only be one id per document. + * + * @example + * var clonedNode = node.clone(); + * + * @method clone + * @return {tinymce.html.Node} New copy of the original node. + */ + clone : function() { + var self = this, clone = new Node(self.name, self.type), i, l, selfAttrs, selfAttr, cloneAttrs; + + // Clone element attributes + if (selfAttrs = self.attributes) { + cloneAttrs = []; + cloneAttrs.map = {}; + + for (i = 0, l = selfAttrs.length; i < l; i++) { + selfAttr = selfAttrs[i]; + + // Clone everything except id + if (selfAttr.name !== 'id') { + cloneAttrs[cloneAttrs.length] = {name: selfAttr.name, value: selfAttr.value}; + cloneAttrs.map[selfAttr.name] = selfAttr.value; + } + } + + clone.attributes = cloneAttrs; + } + + clone.value = self.value; + clone.shortEnded = self.shortEnded; + + return clone; + }, + + /** + * Wraps the node in in another node. + * + * @example + * node.wrap(wrapperNode); + * + * @method wrap + */ + wrap : function(wrapper) { + var self = this; + + self.parent.insert(wrapper, self); + wrapper.append(self); + + return self; + }, + + /** + * Unwraps the node in other words it removes the node but keeps the children. + * + * @example + * node.unwrap(); + * + * @method unwrap + */ + unwrap : function() { + var self = this, node, next; + + for (node = self.firstChild; node; ) { + next = node.next; + self.insert(node, self, true); + node = next; + } + + self.remove(); + }, + + /** + * Removes the node from it's parent. + * + * @example + * node.remove(); + * + * @method remove + * @return {tinymce.html.Node} Current node that got removed. + */ + remove : function() { + var self = this, parent = self.parent, next = self.next, prev = self.prev; + + if (parent) { + if (parent.firstChild === self) { + parent.firstChild = next; + + if (next) + next.prev = null; + } else { + prev.next = next; + } + + if (parent.lastChild === self) { + parent.lastChild = prev; + + if (prev) + prev.next = null; + } else { + next.prev = prev; + } + + self.parent = self.next = self.prev = null; + } + + return self; + }, + + /** + * Appends a new node as a child of the current node. + * + * @example + * node.append(someNode); + * + * @method append + * @param {tinymce.html.Node} node Node to append as a child of the current one. + * @return {tinymce.html.Node} The node that got appended. + */ + append : function(node) { + var self = this, last; + + if (node.parent) + node.remove(); + + last = self.lastChild; + if (last) { + last.next = node; + node.prev = last; + self.lastChild = node; + } else + self.lastChild = self.firstChild = node; + + node.parent = self; + + return node; + }, + + /** + * Inserts a node at a specific position as a child of the current node. + * + * @example + * parentNode.insert(newChildNode, oldChildNode); + * + * @method insert + * @param {tinymce.html.Node} node Node to insert as a child of the current node. + * @param {tinymce.html.Node} ref_node Reference node to set node before/after. + * @param {Boolean} before Optional state to insert the node before the reference node. + * @return {tinymce.html.Node} The node that got inserted. + */ + insert : function(node, ref_node, before) { + var parent; + + if (node.parent) + node.remove(); + + parent = ref_node.parent || this; + + if (before) { + if (ref_node === parent.firstChild) + parent.firstChild = node; + else + ref_node.prev.next = node; + + node.prev = ref_node.prev; + node.next = ref_node; + ref_node.prev = node; + } else { + if (ref_node === parent.lastChild) + parent.lastChild = node; + else + ref_node.next.prev = node; + + node.next = ref_node.next; + node.prev = ref_node; + ref_node.next = node; + } + + node.parent = parent; + + return node; + }, + + /** + * Get all children by name. + * + * @method getAll + * @param {String} name Name of the child nodes to collect. + * @return {Array} Array with child nodes matchin the specified name. + */ + getAll : function(name) { + var self = this, node, collection = []; + + for (node = self.firstChild; node; node = walk(node, self)) { + if (node.name === name) + collection.push(node); + } + + return collection; + }, + + /** + * Removes all children of the current node. + * + * @method empty + * @return {tinymce.html.Node} The current node that got cleared. + */ + empty : function() { + var self = this, nodes, i, node; + + // Remove all children + if (self.firstChild) { + nodes = []; + + // Collect the children + for (node = self.firstChild; node; node = walk(node, self)) + nodes.push(node); + + // Remove the children + i = nodes.length; + while (i--) { + node = nodes[i]; + node.parent = node.firstChild = node.lastChild = node.next = node.prev = null; + } + } + + self.firstChild = self.lastChild = null; + + return self; + }, + + /** + * Returns true/false if the node is to be considered empty or not. + * + * @example + * node.isEmpty({img : true}); + * @method isEmpty + * @param {Object} elements Name/value object with elements that are automatically treated as non empty elements. + * @return {Boolean} true/false if the node is empty or not. + */ + isEmpty : function(elements) { + var self = this, node = self.firstChild, i, name; + + if (node) { + do { + if (node.type === 1) { + // Ignore bogus elements + if (node.attributes.map['data-mce-bogus']) + continue; + + // Keep empty elements like + if (elements[node.name]) + return false; + + // Keep elements with data attributes or name attribute like
    + i = node.attributes.length; + while (i--) { + name = node.attributes[i].name; + if (name === "name" || name.indexOf('data-') === 0) + return false; + } + } + + // Keep non whitespace text nodes + if ((node.type === 3 && !whiteSpaceRegExp.test(node.value))) + return false; + } while (node = walk(node, self)); + } + + return true; + }, + + /** + * Walks to the next or previous node and returns that node or null if it wasn't found. + * + * @method walk + * @param {Boolean} prev Optional previous node state defaults to false. + * @return {tinymce.html.Node} Node that is next to or previous of the current node. + */ + walk : function(prev) { + return walk(this, null, prev); + } + }); + + tinymce.extend(Node, { + /** + * Creates a node of a specific type. + * + * @static + * @method create + * @param {String} name Name of the node type to create for example "b" or "#text". + * @param {Object} attrs Name/value collection of attributes that will be applied to elements. + */ + create : function(name, attrs) { + var node, attrName; + + // Create node + node = new Node(name, typeLookup[name] || 1); + + // Add attributes if needed + if (attrs) { + for (attrName in attrs) + node.attr(attrName, attrs[attrName]); + } + + return node; + } + }); + + tinymce.html.Node = Node; +})(tinymce); diff --git a/js/tiny_mce/classes/html/SaxParser.js b/js/tiny_mce/classes/html/SaxParser.js new file mode 100644 index 0000000000..73a71c0f30 --- /dev/null +++ b/js/tiny_mce/classes/html/SaxParser.js @@ -0,0 +1,355 @@ +/** + * SaxParser.js + * + * Copyright 2010, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function(tinymce) { + /** + * This class parses HTML code using pure JavaScript and executes various events for each item it finds. It will + * always execute the events in the right order for tag soup code like

    . It will also remove elements + * and attributes that doesn't fit the schema if the validate setting is enabled. + * + * @example + * var parser = new tinymce.html.SaxParser({ + * validate: true, + * + * comment: function(text) { + * console.log('Comment:', text); + * }, + * + * cdata: function(text) { + * console.log('CDATA:', text); + * }, + * + * text: function(text, raw) { + * console.log('Text:', text, 'Raw:', raw); + * }, + * + * start: function(name, attrs, empty) { + * console.log('Start:', name, attrs, empty); + * }, + * + * end: function(name) { + * console.log('End:', name); + * }, + * + * pi: function(name, text) { + * console.log('PI:', name, text); + * }, + * + * doctype: function(text) { + * console.log('DocType:', text); + * } + * }, schema); + * @class tinymce.html.SaxParser + * @version 3.4 + */ + + /** + * Constructs a new SaxParser instance. + * + * @constructor + * @method SaxParser + * @param {Object} settings Name/value collection of settings. comment, cdata, text, start and end are callbacks. + * @param {tinymce.html.Schema} schema HTML Schema class to use when parsing. + */ + tinymce.html.SaxParser = function(settings, schema) { + var self = this, noop = function() {}; + + settings = settings || {}; + self.schema = schema = schema || new tinymce.html.Schema(); + + if (settings.fix_self_closing !== false) + settings.fix_self_closing = true; + + // Add handler functions from settings and setup default handlers + tinymce.each('comment cdata text start end pi doctype'.split(' '), function(name) { + if (name) + self[name] = settings[name] || noop; + }); + + /** + * Parses the specified HTML string and executes the callbacks for each item it finds. + * + * @example + * new SaxParser({...}).parse('text'); + * @method parse + * @param {String} html Html string to sax parse. + */ + self.parse = function(html) { + var self = this, matches, index = 0, value, endRegExp, stack = [], attrList, i, text, name, isInternalElement, removeInternalElements, + shortEndedElements, fillAttrsMap, isShortEnded, validate, elementRule, isValidElement, attr, attribsValue, invalidPrefixRegExp, + validAttributesMap, validAttributePatterns, attributesRequired, attributesDefault, attributesForced, selfClosing, + tokenRegExp, attrRegExp, specialElements, attrValue, idCount = 0, decode = tinymce.html.Entities.decode, fixSelfClosing, isIE; + + function processEndTag(name) { + var pos, i; + + // Find position of parent of the same type + pos = stack.length; + while (pos--) { + if (stack[pos].name === name) + break; + } + + // Found parent + if (pos >= 0) { + // Close all the open elements + for (i = stack.length - 1; i >= pos; i--) { + name = stack[i]; + + if (name.valid) + self.end(name.name); + } + + // Remove the open elements from the stack + stack.length = pos; + } + }; + + // Precompile RegExps and map objects + tokenRegExp = new RegExp('<(?:' + + '(?:!--([\\w\\W]*?)-->)|' + // Comment + '(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|' + // CDATA + '(?:!DOCTYPE([\\w\\W]*?)>)|' + // DOCTYPE + '(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|' + // PI + '(?:\\/([^>]+)>)|' + // End element + '(?:([^\\s\\/<>]+)((?:\\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\\/)>)' + // Start element + ')', 'g'); + + attrRegExp = /([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:\\.|[^\"])*)\")|(?:\'((?:\\.|[^\'])*)\')|([^>\s]+)))?/g; + specialElements = { + 'script' : /<\/script[^>]*>/gi, + 'style' : /<\/style[^>]*>/gi, + 'noscript' : /<\/noscript[^>]*>/gi + }; + + // Setup lookup tables for empty elements and boolean attributes + shortEndedElements = schema.getShortEndedElements(); + selfClosing = schema.getSelfClosingElements(); + fillAttrsMap = schema.getBoolAttrs(); + validate = settings.validate; + removeInternalElements = settings.remove_internals; + fixSelfClosing = settings.fix_self_closing; + isIE = tinymce.isIE; + invalidPrefixRegExp = /^:/; + + while (matches = tokenRegExp.exec(html)) { + // Text + if (index < matches.index) + self.text(decode(html.substr(index, matches.index - index))); + + if (value = matches[6]) { // End element + value = value.toLowerCase(); + + // IE will add a ":" in front of elements it doesn't understand like custom elements or HTML5 elements + if (isIE && invalidPrefixRegExp.test(value)) + value = value.substr(1); + + processEndTag(value); + } else if (value = matches[7]) { // Start element + value = value.toLowerCase(); + + // IE will add a ":" in front of elements it doesn't understand like custom elements or HTML5 elements + if (isIE && invalidPrefixRegExp.test(value)) + value = value.substr(1); + + isShortEnded = value in shortEndedElements; + + // Is self closing tag for example an
  • after an open
  • + if (fixSelfClosing && selfClosing[value] && stack.length > 0 && stack[stack.length - 1].name === value) + processEndTag(value); + + // Validate element + if (!validate || (elementRule = schema.getElementRule(value))) { + isValidElement = true; + + // Grab attributes map and patters when validation is enabled + if (validate) { + validAttributesMap = elementRule.attributes; + validAttributePatterns = elementRule.attributePatterns; + } + + // Parse attributes + if (attribsValue = matches[8]) { + isInternalElement = attribsValue.indexOf('data-mce-type') !== -1; // Check if the element is an internal element + + // If the element has internal attributes then remove it if we are told to do so + if (isInternalElement && removeInternalElements) + isValidElement = false; + + attrList = []; + attrList.map = {}; + + attribsValue.replace(attrRegExp, function(match, name, value, val2, val3) { + var attrRule, i; + + name = name.toLowerCase(); + value = name in fillAttrsMap ? name : decode(value || val2 || val3 || ''); // Handle boolean attribute than value attribute + + // Validate name and value + if (validate && !isInternalElement && name.indexOf('data-') !== 0) { + attrRule = validAttributesMap[name]; + + // Find rule by pattern matching + if (!attrRule && validAttributePatterns) { + i = validAttributePatterns.length; + while (i--) { + attrRule = validAttributePatterns[i]; + if (attrRule.pattern.test(name)) + break; + } + + // No rule matched + if (i === -1) + attrRule = null; + } + + // No attribute rule found + if (!attrRule) + return; + + // Validate value + if (attrRule.validValues && !(value in attrRule.validValues)) + return; + } + + // Add attribute to list and map + attrList.map[name] = value; + attrList.push({ + name: name, + value: value + }); + }); + } else { + attrList = []; + attrList.map = {}; + } + + // Process attributes if validation is enabled + if (validate && !isInternalElement) { + attributesRequired = elementRule.attributesRequired; + attributesDefault = elementRule.attributesDefault; + attributesForced = elementRule.attributesForced; + + // Handle forced attributes + if (attributesForced) { + i = attributesForced.length; + while (i--) { + attr = attributesForced[i]; + name = attr.name; + attrValue = attr.value; + + if (attrValue === '{$uid}') + attrValue = 'mce_' + idCount++; + + attrList.map[name] = attrValue; + attrList.push({name: name, value: attrValue}); + } + } + + // Handle default attributes + if (attributesDefault) { + i = attributesDefault.length; + while (i--) { + attr = attributesDefault[i]; + name = attr.name; + + if (!(name in attrList.map)) { + attrValue = attr.value; + + if (attrValue === '{$uid}') + attrValue = 'mce_' + idCount++; + + attrList.map[name] = attrValue; + attrList.push({name: name, value: attrValue}); + } + } + } + + // Handle required attributes + if (attributesRequired) { + i = attributesRequired.length; + while (i--) { + if (attributesRequired[i] in attrList.map) + break; + } + + // None of the required attributes where found + if (i === -1) + isValidElement = false; + } + + // Invalidate element if it's marked as bogus + if (attrList.map['data-mce-bogus']) + isValidElement = false; + } + + if (isValidElement) + self.start(value, attrList, isShortEnded); + } else + isValidElement = false; + + // Treat script, noscript and style a bit different since they may include code that looks like elements + if (endRegExp = specialElements[value]) { + endRegExp.lastIndex = index = matches.index + matches[0].length; + + if (matches = endRegExp.exec(html)) { + if (isValidElement) + text = html.substr(index, matches.index - index); + + index = matches.index + matches[0].length; + } else { + text = html.substr(index); + index = html.length; + } + + if (isValidElement && text.length > 0) + self.text(text, true); + + if (isValidElement) + self.end(value); + + tokenRegExp.lastIndex = index; + continue; + } + + // Push value on to stack + if (!isShortEnded) { + if (!attribsValue || attribsValue.indexOf('/') != attribsValue.length - 1) + stack.push({name: value, valid: isValidElement}); + else if (isValidElement) + self.end(value); + } + } else if (value = matches[1]) { // Comment + self.comment(value); + } else if (value = matches[2]) { // CDATA + self.cdata(value); + } else if (value = matches[3]) { // DOCTYPE + self.doctype(value); + } else if (value = matches[4]) { // PI + self.pi(value, matches[5]); + } + + index = matches.index + matches[0].length; + } + + // Text + if (index < html.length) + self.text(decode(html.substr(index))); + + // Close any open elements + for (i = stack.length - 1; i >= 0; i--) { + value = stack[i]; + + if (value.valid) + self.end(value.name); + } + }; + } +})(tinymce); diff --git a/js/tiny_mce/classes/html/Schema.js b/js/tiny_mce/classes/html/Schema.js new file mode 100644 index 0000000000..ff7c173b49 --- /dev/null +++ b/js/tiny_mce/classes/html/Schema.js @@ -0,0 +1,663 @@ +/** + * Schema.js + * + * Copyright 2010, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function(tinymce) { + var transitional = {}, boolAttrMap, blockElementsMap, shortEndedElementsMap, nonEmptyElementsMap, customElementsMap = {}, + defaultWhiteSpaceElementsMap, selfClosingElementsMap, makeMap = tinymce.makeMap, each = tinymce.each; + + function split(str, delim) { + return str.split(delim || ','); + }; + + /** + * Unpacks the specified lookup and string data it will also parse it into an object + * map with sub object for it's children. This will later also include the attributes. + */ + function unpack(lookup, data) { + var key, elements = {}; + + function replace(value) { + return value.replace(/[A-Z]+/g, function(key) { + return replace(lookup[key]); + }); + }; + + // Unpack lookup + for (key in lookup) { + if (lookup.hasOwnProperty(key)) + lookup[key] = replace(lookup[key]); + } + + // Unpack and parse data into object map + replace(data).replace(/#/g, '#text').replace(/(\w+)\[([^\]]+)\]\[([^\]]*)\]/g, function(str, name, attributes, children) { + attributes = split(attributes, '|'); + + elements[name] = { + attributes : makeMap(attributes), + attributesOrder : attributes, + children : makeMap(children, '|', {'#comment' : {}}) + } + }); + + return elements; + }; + + // Build a lookup table for block elements both lowercase and uppercase + blockElementsMap = 'h1,h2,h3,h4,h5,h6,hr,p,div,address,pre,form,table,tbody,thead,tfoot,' + + 'th,tr,td,li,ol,ul,caption,blockquote,center,dl,dt,dd,dir,fieldset,' + + 'noscript,menu,isindex,samp,header,footer,article,section,hgroup'; + blockElementsMap = makeMap(blockElementsMap, ',', makeMap(blockElementsMap.toUpperCase())); + + // This is the XHTML 1.0 transitional elements with it's attributes and children packed to reduce it's size + transitional = unpack({ + Z : 'H|K|N|O|P', + Y : 'X|form|R|Q', + ZG : 'E|span|width|align|char|charoff|valign', + X : 'p|T|div|U|W|isindex|fieldset|table', + ZF : 'E|align|char|charoff|valign', + W : 'pre|hr|blockquote|address|center|noframes', + ZE : 'abbr|axis|headers|scope|rowspan|colspan|align|char|charoff|valign|nowrap|bgcolor|width|height', + ZD : '[E][S]', + U : 'ul|ol|dl|menu|dir', + ZC : 'p|Y|div|U|W|table|br|span|bdo|object|applet|img|map|K|N|Q', + T : 'h1|h2|h3|h4|h5|h6', + ZB : 'X|S|Q', + S : 'R|P', + ZA : 'a|G|J|M|O|P', + R : 'a|H|K|N|O', + Q : 'noscript|P', + P : 'ins|del|script', + O : 'input|select|textarea|label|button', + N : 'M|L', + M : 'em|strong|dfn|code|q|samp|kbd|var|cite|abbr|acronym', + L : 'sub|sup', + K : 'J|I', + J : 'tt|i|b|u|s|strike', + I : 'big|small|font|basefont', + H : 'G|F', + G : 'br|span|bdo', + F : 'object|applet|img|map|iframe', + E : 'A|B|C', + D : 'accesskey|tabindex|onfocus|onblur', + C : 'onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup', + B : 'lang|xml:lang|dir', + A : 'id|class|style|title' + }, 'script[id|charset|type|language|src|defer|xml:space][]' + + 'style[B|id|type|media|title|xml:space][]' + + 'object[E|declare|classid|codebase|data|type|codetype|archive|standby|width|height|usemap|name|tabindex|align|border|hspace|vspace][#|param|Y]' + + 'param[id|name|value|valuetype|type][]' + + 'p[E|align][#|S]' + + 'a[E|D|charset|type|name|href|hreflang|rel|rev|shape|coords|target][#|Z]' + + 'br[A|clear][]' + + 'span[E][#|S]' + + 'bdo[A|C|B][#|S]' + + 'applet[A|codebase|archive|code|object|alt|name|width|height|align|hspace|vspace][#|param|Y]' + + 'h1[E|align][#|S]' + + 'img[E|src|alt|name|longdesc|width|height|usemap|ismap|align|border|hspace|vspace][]' + + 'map[B|C|A|name][X|form|Q|area]' + + 'h2[E|align][#|S]' + + 'iframe[A|longdesc|name|src|frameborder|marginwidth|marginheight|scrolling|align|width|height][#|Y]' + + 'h3[E|align][#|S]' + + 'tt[E][#|S]' + + 'i[E][#|S]' + + 'b[E][#|S]' + + 'u[E][#|S]' + + 's[E][#|S]' + + 'strike[E][#|S]' + + 'big[E][#|S]' + + 'small[E][#|S]' + + 'font[A|B|size|color|face][#|S]' + + 'basefont[id|size|color|face][]' + + 'em[E][#|S]' + + 'strong[E][#|S]' + + 'dfn[E][#|S]' + + 'code[E][#|S]' + + 'q[E|cite][#|S]' + + 'samp[E][#|S]' + + 'kbd[E][#|S]' + + 'var[E][#|S]' + + 'cite[E][#|S]' + + 'abbr[E][#|S]' + + 'acronym[E][#|S]' + + 'sub[E][#|S]' + + 'sup[E][#|S]' + + 'input[E|D|type|name|value|checked|disabled|readonly|size|maxlength|src|alt|usemap|onselect|onchange|accept|align][]' + + 'select[E|name|size|multiple|disabled|tabindex|onfocus|onblur|onchange][optgroup|option]' + + 'optgroup[E|disabled|label][option]' + + 'option[E|selected|disabled|label|value][]' + + 'textarea[E|D|name|rows|cols|disabled|readonly|onselect|onchange][]' + + 'label[E|for|accesskey|onfocus|onblur][#|S]' + + 'button[E|D|name|value|type|disabled][#|p|T|div|U|W|table|G|object|applet|img|map|K|N|Q]' + + 'h4[E|align][#|S]' + + 'ins[E|cite|datetime][#|Y]' + + 'h5[E|align][#|S]' + + 'del[E|cite|datetime][#|Y]' + + 'h6[E|align][#|S]' + + 'div[E|align][#|Y]' + + 'ul[E|type|compact][li]' + + 'li[E|type|value][#|Y]' + + 'ol[E|type|compact|start][li]' + + 'dl[E|compact][dt|dd]' + + 'dt[E][#|S]' + + 'dd[E][#|Y]' + + 'menu[E|compact][li]' + + 'dir[E|compact][li]' + + 'pre[E|width|xml:space][#|ZA]' + + 'hr[E|align|noshade|size|width][]' + + 'blockquote[E|cite][#|Y]' + + 'address[E][#|S|p]' + + 'center[E][#|Y]' + + 'noframes[E][#|Y]' + + 'isindex[A|B|prompt][]' + + 'fieldset[E][#|legend|Y]' + + 'legend[E|accesskey|align][#|S]' + + 'table[E|summary|width|border|frame|rules|cellspacing|cellpadding|align|bgcolor][caption|col|colgroup|thead|tfoot|tbody|tr]' + + 'caption[E|align][#|S]' + + 'col[ZG][]' + + 'colgroup[ZG][col]' + + 'thead[ZF][tr]' + + 'tr[ZF|bgcolor][th|td]' + + 'th[E|ZE][#|Y]' + + 'form[E|action|method|name|enctype|onsubmit|onreset|accept|accept-charset|target][#|X|R|Q]' + + 'noscript[E][#|Y]' + + 'td[E|ZE][#|Y]' + + 'tfoot[ZF][tr]' + + 'tbody[ZF][tr]' + + 'area[E|D|shape|coords|href|nohref|alt|target][]' + + 'base[id|href|target][]' + + 'body[E|onload|onunload|background|bgcolor|text|link|vlink|alink][#|Y]' + ); + + boolAttrMap = makeMap('checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected,autoplay,loop,controls'); + shortEndedElementsMap = makeMap('area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed,source'); + nonEmptyElementsMap = tinymce.extend(makeMap('td,th,iframe,video,audio,object'), shortEndedElementsMap); + defaultWhiteSpaceElementsMap = makeMap('pre,script,style,textarea'); + selfClosingElementsMap = makeMap('colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr'); + + /** + * Schema validator class. + * + * @class tinymce.html.Schema + * @example + * if (tinymce.activeEditor.schema.isValidChild('p', 'span')) + * alert('span is valid child of p.'); + * + * if (tinymce.activeEditor.schema.getElementRule('p')) + * alert('P is a valid element.'); + * + * @class tinymce.html.Schema + * @version 3.4 + */ + + /** + * Constructs a new Schema instance. + * + * @constructor + * @method Schema + * @param {Object} settings Name/value settings object. + */ + tinymce.html.Schema = function(settings) { + var self = this, elements = {}, children = {}, patternElements = [], validStyles, whiteSpaceElementsMap; + + settings = settings || {}; + + // Allow all elements and attributes if verify_html is set to false + if (settings.verify_html === false) + settings.valid_elements = '*[*]'; + + // Build styles list + if (settings.valid_styles) { + validStyles = {}; + + // Convert styles into a rule list + each(settings.valid_styles, function(value, key) { + validStyles[key] = tinymce.explode(value); + }); + } + + whiteSpaceElementsMap = settings.whitespace_elements ? makeMap(settings.whitespace_elements) : defaultWhiteSpaceElementsMap; + + // Converts a wildcard expression string to a regexp for example *a will become /.*a/. + function patternToRegExp(str) { + return new RegExp('^' + str.replace(/([?+*])/g, '.$1') + '$'); + }; + + // Parses the specified valid_elements string and adds to the current rules + // This function is a bit hard to read since it's heavily optimized for speed + function addValidElements(valid_elements) { + var ei, el, ai, al, yl, matches, element, attr, attrData, elementName, attrName, attrType, attributes, attributesOrder, + prefix, outputName, globalAttributes, globalAttributesOrder, transElement, key, childKey, value, + elementRuleRegExp = /^([#+-])?([^\[\/]+)(?:\/([^\[]+))?(?:\[([^\]]+)\])?$/, + attrRuleRegExp = /^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/, + hasPatternsRegExp = /[*?+]/; + + if (valid_elements) { + // Split valid elements into an array with rules + valid_elements = split(valid_elements); + + if (elements['@']) { + globalAttributes = elements['@'].attributes; + globalAttributesOrder = elements['@'].attributesOrder; + } + + // Loop all rules + for (ei = 0, el = valid_elements.length; ei < el; ei++) { + // Parse element rule + matches = elementRuleRegExp.exec(valid_elements[ei]); + if (matches) { + // Setup local names for matches + prefix = matches[1]; + elementName = matches[2]; + outputName = matches[3]; + attrData = matches[4]; + + // Create new attributes and attributesOrder + attributes = {}; + attributesOrder = []; + + // Create the new element + element = { + attributes : attributes, + attributesOrder : attributesOrder + }; + + // Padd empty elements prefix + if (prefix === '#') + element.paddEmpty = true; + + // Remove empty elements prefix + if (prefix === '-') + element.removeEmpty = true; + + // Copy attributes from global rule into current rule + if (globalAttributes) { + for (key in globalAttributes) + attributes[key] = globalAttributes[key]; + + attributesOrder.push.apply(attributesOrder, globalAttributesOrder); + } + + // Attributes defined + if (attrData) { + attrData = split(attrData, '|'); + for (ai = 0, al = attrData.length; ai < al; ai++) { + matches = attrRuleRegExp.exec(attrData[ai]); + if (matches) { + attr = {}; + attrType = matches[1]; + attrName = matches[2].replace(/::/g, ':'); + prefix = matches[3]; + value = matches[4]; + + // Required + if (attrType === '!') { + element.attributesRequired = element.attributesRequired || []; + element.attributesRequired.push(attrName); + attr.required = true; + } + + // Denied from global + if (attrType === '-') { + delete attributes[attrName]; + attributesOrder.splice(tinymce.inArray(attributesOrder, attrName), 1); + continue; + } + + // Default value + if (prefix) { + // Default value + if (prefix === '=') { + element.attributesDefault = element.attributesDefault || []; + element.attributesDefault.push({name: attrName, value: value}); + attr.defaultValue = value; + } + + // Forced value + if (prefix === ':') { + element.attributesForced = element.attributesForced || []; + element.attributesForced.push({name: attrName, value: value}); + attr.forcedValue = value; + } + + // Required values + if (prefix === '<') + attr.validValues = makeMap(value, '?'); + } + + // Check for attribute patterns + if (hasPatternsRegExp.test(attrName)) { + element.attributePatterns = element.attributePatterns || []; + attr.pattern = patternToRegExp(attrName); + element.attributePatterns.push(attr); + } else { + // Add attribute to order list if it doesn't already exist + if (!attributes[attrName]) + attributesOrder.push(attrName); + + attributes[attrName] = attr; + } + } + } + } + + // Global rule, store away these for later usage + if (!globalAttributes && elementName == '@') { + globalAttributes = attributes; + globalAttributesOrder = attributesOrder; + } + + // Handle substitute elements such as b/strong + if (outputName) { + element.outputName = elementName; + elements[outputName] = element; + } + + // Add pattern or exact element + if (hasPatternsRegExp.test(elementName)) { + element.pattern = patternToRegExp(elementName); + patternElements.push(element); + } else + elements[elementName] = element; + } + } + } + }; + + function setValidElements(valid_elements) { + elements = {}; + patternElements = []; + + addValidElements(valid_elements); + + each(transitional, function(element, name) { + children[name] = element.children; + }); + }; + + // Adds custom non HTML elements to the schema + function addCustomElements(custom_elements) { + var customElementRegExp = /^(~)?(.+)$/; + + if (custom_elements) { + each(split(custom_elements), function(rule) { + var matches = customElementRegExp.exec(rule), + inline = matches[1] === '~', + cloneName = inline ? 'span' : 'div', + name = matches[2]; + + children[name] = children[cloneName]; + customElementsMap[name] = cloneName; + + // If it's not marked as inline then add it to valid block elements + if (!inline) + blockElementsMap[name] = {}; + + // Add custom elements at span/div positions + each(children, function(element, child) { + if (element[cloneName]) + element[name] = element[cloneName]; + }); + }); + } + }; + + // Adds valid children to the schema object + function addValidChildren(valid_children) { + var childRuleRegExp = /^([+\-]?)(\w+)\[([^\]]+)\]$/; + + if (valid_children) { + each(split(valid_children), function(rule) { + var matches = childRuleRegExp.exec(rule), parent, prefix; + + if (matches) { + prefix = matches[1]; + + // Add/remove items from default + if (prefix) + parent = children[matches[2]]; + else + parent = children[matches[2]] = {'#comment' : {}}; + + parent = children[matches[2]]; + + each(split(matches[3], '|'), function(child) { + if (prefix === '-') + delete parent[child]; + else + parent[child] = {}; + }); + } + }); + } + }; + + function getElementRule(name) { + var element = elements[name], i; + + // Exact match found + if (element) + return element; + + // No exact match then try the patterns + i = patternElements.length; + while (i--) { + element = patternElements[i]; + + if (element.pattern.test(name)) + return element; + } + }; + + if (!settings.valid_elements) { + // No valid elements defined then clone the elements from the transitional spec + each(transitional, function(element, name) { + elements[name] = { + attributes : element.attributes, + attributesOrder : element.attributesOrder + }; + + children[name] = element.children; + }); + + // Switch these + each(split('strong/b,em/i'), function(item) { + item = split(item, '/'); + elements[item[1]].outputName = item[0]; + }); + + // Add default alt attribute for images + elements.img.attributesDefault = [{name: 'alt', value: ''}]; + + // Remove these if they are empty by default + each(split('ol,ul,sub,sup,blockquote,span,font,a,table,tbody,tr'), function(name) { + elements[name].removeEmpty = true; + }); + + // Padd these by default + each(split('p,h1,h2,h3,h4,h5,h6,th,td,pre,div,address,caption'), function(name) { + elements[name].paddEmpty = true; + }); + } else + setValidElements(settings.valid_elements); + + addCustomElements(settings.custom_elements); + addValidChildren(settings.valid_children); + addValidElements(settings.extended_valid_elements); + + // Todo: Remove this when we fix list handling to be valid + addValidChildren('+ol[ul|ol],+ul[ul|ol]'); + + // If the user didn't allow span only allow internal spans + if (!getElementRule('span')) + addValidElements('span[!data-mce-type|*]'); + + // Delete invalid elements + if (settings.invalid_elements) { + tinymce.each(tinymce.explode(settings.invalid_elements), function(item) { + if (elements[item]) + delete elements[item]; + }); + } + + /** + * Name/value map object with valid parents and children to those parents. + * + * @example + * children = { + * div:{p:{}, h1:{}} + * }; + * @field children + * @type {Object} + */ + self.children = children; + + /** + * Name/value map object with valid styles for each element. + * + * @field styles + * @type {Object} + */ + self.styles = validStyles; + + /** + * Returns a map with boolean attributes. + * + * @method getBoolAttrs + * @return {Object} Name/value lookup map for boolean attributes. + */ + self.getBoolAttrs = function() { + return boolAttrMap; + }; + + /** + * Returns a map with block elements. + * + * @method getBoolAttrs + * @return {Object} Name/value lookup map for block elements. + */ + self.getBlockElements = function() { + return blockElementsMap; + }; + + /** + * Returns a map with short ended elements such as BR or IMG. + * + * @method getShortEndedElements + * @return {Object} Name/value lookup map for short ended elements. + */ + self.getShortEndedElements = function() { + return shortEndedElementsMap; + }; + + /** + * Returns a map with self closing tags such as
  • . + * + * @method getSelfClosingElements + * @return {Object} Name/value lookup map for self closing tags elements. + */ + self.getSelfClosingElements = function() { + return selfClosingElementsMap; + }; + + /** + * Returns a map with elements that should be treated as contents regardless if it has text + * content in them or not such as TD, VIDEO or IMG. + * + * @method getNonEmptyElements + * @return {Object} Name/value lookup map for non empty elements. + */ + self.getNonEmptyElements = function() { + return nonEmptyElementsMap; + }; + + /** + * Returns a map with elements where white space is to be preserved like PRE or SCRIPT. + * + * @method getWhiteSpaceElements + * @return {Object} Name/value lookup map for white space elements. + */ + self.getWhiteSpaceElements = function() { + return whiteSpaceElementsMap; + }; + + /** + * Returns true/false if the specified element and it's child is valid or not + * according to the schema. + * + * @method isValidChild + * @param {String} name Element name to check for. + * @param {String} child Element child to verify. + * @return {Boolean} True/false if the element is a valid child of the specified parent. + */ + self.isValidChild = function(name, child) { + var parent = children[name]; + + return !!(parent && parent[child]); + }; + + /** + * Returns true/false if the specified element is valid or not + * according to the schema. + * + * @method getElementRule + * @param {String} name Element name to check for. + * @return {Object} Element object or undefined if the element isn't valid. + */ + self.getElementRule = getElementRule; + + /** + * Returns an map object of all custom elements. + * + * @method getCustomElements + * @return {Object} Name/value map object of all custom elements. + */ + self.getCustomElements = function() { + return customElementsMap; + }; + + /** + * Parses a valid elements string and adds it to the schema. The valid elements format is for example "element[attr=default|otherattr]". + * Existing rules will be replaced with the ones specified, so this extends the schema. + * + * @method addValidElements + * @param {String} valid_elements String in the valid elements format to be parsed. + */ + self.addValidElements = addValidElements; + + /** + * Parses a valid elements string and sets it to the schema. The valid elements format is for example "element[attr=default|otherattr]". + * Existing rules will be replaced with the ones specified, so this extends the schema. + * + * @method setValidElements + * @param {String} valid_elements String in the valid elements format to be parsed. + */ + self.setValidElements = setValidElements; + + /** + * Adds custom non HTML elements to the schema. + * + * @method addCustomElements + * @param {String} custom_elements Comma separated list of custom elements to add. + */ + self.addCustomElements = addCustomElements; + + /** + * Parses a valid children string and adds them to the schema structure. The valid children format is for example: "element[child1|child2]". + * + * @method addValidChildren + * @param {String} valid_children Valid children elements string to parse + */ + self.addValidChildren = addValidChildren; + }; + + // Expose boolMap and blockElementMap as static properties for usage in DOMUtils + tinymce.html.Schema.boolAttrMap = boolAttrMap; + tinymce.html.Schema.blockElementsMap = blockElementsMap; +})(tinymce); diff --git a/js/tiny_mce/classes/html/Serializer.js b/js/tiny_mce/classes/html/Serializer.js new file mode 100644 index 0000000000..b74e223d94 --- /dev/null +++ b/js/tiny_mce/classes/html/Serializer.js @@ -0,0 +1,152 @@ +/** + * Serializer.js + * + * Copyright 2010, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function(tinymce) { + /** + * This class is used to serialize down the DOM tree into a string using a Writer instance. + * + * + * @example + * new tinymce.html.Serializer().serialize(new tinymce.html.DomParser().parse('

    text

    ')); + * @class tinymce.html.Serializer + * @version 3.4 + */ + + /** + * Constructs a new Serializer instance. + * + * @constructor + * @method Serializer + * @param {Object} settings Name/value settings object. + * @param {tinymce.html.Schema} schema Schema instance to use. + */ + tinymce.html.Serializer = function(settings, schema) { + var self = this, writer = new tinymce.html.Writer(settings); + + settings = settings || {}; + settings.validate = "validate" in settings ? settings.validate : true; + + self.schema = schema = schema || new tinymce.html.Schema(); + self.writer = writer; + + /** + * Serializes the specified node into a string. + * + * @example + * new tinymce.html.Serializer().serialize(new tinymce.html.DomParser().parse('

    text

    ')); + * @method serialize + * @param {tinymce.html.Node} node Node instance to serialize. + * @return {String} String with HTML based on DOM tree. + */ + self.serialize = function(node) { + var handlers, validate; + + validate = settings.validate; + + handlers = { + // #text + 3: function(node, raw) { + writer.text(node.value, node.raw); + }, + + // #comment + 8: function(node) { + writer.comment(node.value); + }, + + // Processing instruction + 7: function(node) { + writer.pi(node.name, node.value); + }, + + // Doctype + 10: function(node) { + writer.doctype(node.value); + }, + + // CDATA + 4: function(node) { + writer.cdata(node.value); + }, + + // Document fragment + 11: function(node) { + if ((node = node.firstChild)) { + do { + walk(node); + } while (node = node.next); + } + } + }; + + writer.reset(); + + function walk(node) { + var handler = handlers[node.type], name, isEmpty, attrs, attrName, attrValue, sortedAttrs, i, l, elementRule; + + if (!handler) { + name = node.name; + isEmpty = node.shortEnded; + attrs = node.attributes; + + // Sort attributes + if (validate && attrs && attrs.length > 1) { + sortedAttrs = []; + sortedAttrs.map = {}; + + elementRule = schema.getElementRule(node.name); + for (i = 0, l = elementRule.attributesOrder.length; i < l; i++) { + attrName = elementRule.attributesOrder[i]; + + if (attrName in attrs.map) { + attrValue = attrs.map[attrName]; + sortedAttrs.map[attrName] = attrValue; + sortedAttrs.push({name: attrName, value: attrValue}); + } + } + + for (i = 0, l = attrs.length; i < l; i++) { + attrName = attrs[i].name; + + if (!(attrName in sortedAttrs.map)) { + attrValue = attrs.map[attrName]; + sortedAttrs.map[attrName] = attrValue; + sortedAttrs.push({name: attrName, value: attrValue}); + } + } + + attrs = sortedAttrs; + } + + writer.start(node.name, attrs, isEmpty); + + if (!isEmpty) { + if ((node = node.firstChild)) { + do { + walk(node); + } while (node = node.next); + } + + writer.end(name); + } + } else + handler(node); + } + + // Serialize element and treat all non elements as fragments + if (node.type == 1 && !settings.inner) + walk(node); + else + handlers[11](node); + + return writer.getContent(); + }; + } +})(tinymce); diff --git a/js/tiny_mce/classes/html/Styles.js b/js/tiny_mce/classes/html/Styles.js new file mode 100644 index 0000000000..1324cfba3e --- /dev/null +++ b/js/tiny_mce/classes/html/Styles.js @@ -0,0 +1,279 @@ +/** + * Styles.js + * + * Copyright 2010, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +/** + * This class is used to parse CSS styles it also compresses styles to reduce the output size. + * + * @example + * var Styles = new tinymce.html.Styles({ + * url_converter: function(url) { + * return url; + * } + * }); + * + * styles = Styles.parse('border: 1px solid red'); + * styles.color = 'red'; + * + * console.log(new tinymce.html.StyleSerializer().serialize(styles)); + * + * @class tinymce.html.Styles + * @version 3.4 + */ +tinymce.html.Styles = function(settings, schema) { + var rgbRegExp = /rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi, + urlOrStrRegExp = /(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi, + styleRegExp = /\s*([^:]+):\s*([^;]+);?/g, + trimRightRegExp = /\s+$/, + urlColorRegExp = /rgb/, + undef, i, encodingLookup = {}, encodingItems; + + settings = settings || {}; + + encodingItems = '\\" \\\' \\; \\: ; : \uFEFF'.split(' '); + for (i = 0; i < encodingItems.length; i++) { + encodingLookup[encodingItems[i]] = '\uFEFF' + i; + encodingLookup['\uFEFF' + i] = encodingItems[i]; + } + + function toHex(match, r, g, b) { + function hex(val) { + val = parseInt(val).toString(16); + + return val.length > 1 ? val : '0' + val; // 0 -> 00 + }; + + return '#' + hex(r) + hex(g) + hex(b); + }; + + return { + /** + * Parses the specified RGB color value and returns a hex version of that color. + * + * @method toHex + * @param {String} color RGB string value like rgb(1,2,3) + * @return {String} Hex version of that RGB value like #FF00FF. + */ + toHex : function(color) { + return color.replace(rgbRegExp, toHex); + }, + + /** + * Parses the specified style value into an object collection. This parser will also + * merge and remove any redundant items that browsers might have added. It will also convert non hex + * colors to hex values. Urls inside the styles will also be converted to absolute/relative based on settings. + * + * @method parse + * @param {String} css Style value to parse for example: border:1px solid red;. + * @return {Object} Object representation of that style like {border : '1px solid red'} + */ + parse : function(css) { + var styles = {}, matches, name, value, isEncoded, urlConverter = settings.url_converter, urlConverterScope = settings.url_converter_scope || this; + + function compress(prefix, suffix) { + var top, right, bottom, left; + + // Get values and check it it needs compressing + top = styles[prefix + '-top' + suffix]; + if (!top) + return; + + right = styles[prefix + '-right' + suffix]; + if (top != right) + return; + + bottom = styles[prefix + '-bottom' + suffix]; + if (right != bottom) + return; + + left = styles[prefix + '-left' + suffix]; + if (bottom != left) + return; + + // Compress + styles[prefix + suffix] = left; + delete styles[prefix + '-top' + suffix]; + delete styles[prefix + '-right' + suffix]; + delete styles[prefix + '-bottom' + suffix]; + delete styles[prefix + '-left' + suffix]; + }; + + /** + * Checks if the specific style can be compressed in other words if all border-width are equal. + */ + function canCompress(key) { + var value = styles[key], i; + + if (!value || value.indexOf(' ') < 0) + return; + + value = value.split(' '); + i = value.length; + while (i--) { + if (value[i] !== value[0]) + return false; + } + + styles[key] = value[0]; + + return true; + }; + + /** + * Compresses multiple styles into one style. + */ + function compress2(target, a, b, c) { + if (!canCompress(a)) + return; + + if (!canCompress(b)) + return; + + if (!canCompress(c)) + return; + + // Compress + styles[target] = styles[a] + ' ' + styles[b] + ' ' + styles[c]; + delete styles[a]; + delete styles[b]; + delete styles[c]; + }; + + // Encodes the specified string by replacing all \" \' ; : with _ + function encode(str) { + isEncoded = true; + + return encodingLookup[str]; + }; + + // Decodes the specified string by replacing all _ with it's original value \" \' etc + // It will also decode the \" \' if keep_slashes is set to fale or omitted + function decode(str, keep_slashes) { + if (isEncoded) { + str = str.replace(/\uFEFF[0-9]/g, function(str) { + return encodingLookup[str]; + }); + } + + if (!keep_slashes) + str = str.replace(/\\([\'\";:])/g, "$1"); + + return str; + } + + if (css) { + // Encode \" \' % and ; and : inside strings so they don't interfere with the style parsing + css = css.replace(/\\[\"\';:\uFEFF]/g, encode).replace(/\"[^\"]+\"|\'[^\']+\'/g, function(str) { + return str.replace(/[;:]/g, encode); + }); + + // Parse styles + while (matches = styleRegExp.exec(css)) { + name = matches[1].replace(trimRightRegExp, '').toLowerCase(); + value = matches[2].replace(trimRightRegExp, ''); + + if (name && value.length > 0) { + // Opera will produce 700 instead of bold in their style values + if (name === 'font-weight' && value === '700') + value = 'bold'; + else if (name === 'color' || name === 'background-color') // Lowercase colors like RED + value = value.toLowerCase(); + + // Convert RGB colors to HEX + value = value.replace(rgbRegExp, toHex); + + // Convert URLs and force them into url('value') format + value = value.replace(urlOrStrRegExp, function(match, url, url2, url3, str, str2) { + str = str || str2; + + if (str) { + str = decode(str); + + // Force strings into single quote format + return "'" + str.replace(/\'/g, "\\'") + "'"; + } + + url = decode(url || url2 || url3); + + // Convert the URL to relative/absolute depending on config + if (urlConverter) + url = urlConverter.call(urlConverterScope, url, 'style'); + + // Output new URL format + return "url('" + url.replace(/\'/g, "\\'") + "')"; + }); + + styles[name] = isEncoded ? decode(value, true) : value; + } + + styleRegExp.lastIndex = matches.index + matches[0].length; + } + + // Compress the styles to reduce it's size for example IE will expand styles + compress("border", ""); + compress("border", "-width"); + compress("border", "-color"); + compress("border", "-style"); + compress("padding", ""); + compress("margin", ""); + compress2('border', 'border-width', 'border-style', 'border-color'); + + // Remove pointless border, IE produces these + if (styles.border === 'medium none') + delete styles.border; + } + + return styles; + }, + + /** + * Serializes the specified style object into a string. + * + * @method serialize + * @param {Object} styles Object to serialize as string for example: {border : '1px solid red'} + * @param {String} element_name Optional element name, if specified only the styles that matches the schema will be serialized. + * @return {String} String representation of the style object for example: border: 1px solid red. + */ + serialize : function(styles, element_name) { + var css = '', name, value; + + function serializeStyles(name) { + var styleList, i, l, value; + + styleList = schema.styles[name]; + if (styleList) { + for (i = 0, l = styleList.length; i < l; i++) { + name = styleList[i]; + value = styles[name]; + + if (value !== undef && value.length > 0) + css += (css.length > 0 ? ' ' : '') + name + ': ' + value + ';'; + } + } + }; + + // Serialize styles according to schema + if (element_name && schema && schema.styles) { + // Serialize global styles and element specific styles + serializeStyles('*'); + serializeStyles(element_name); + } else { + // Output the styles in the order they are inside the object + for (name in styles) { + value = styles[name]; + + if (value !== undef && value.length > 0) + css += (css.length > 0 ? ' ' : '') + name + ': ' + value + ';'; + } + } + + return css; + } + }; +}; diff --git a/js/tiny_mce/classes/html/Writer.js b/js/tiny_mce/classes/html/Writer.js new file mode 100644 index 0000000000..8010a0b8f3 --- /dev/null +++ b/js/tiny_mce/classes/html/Writer.js @@ -0,0 +1,186 @@ +/** + * Writer.js + * + * Copyright 2010, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +/** + * This class is used to write HTML tags out it can be used with the Serializer or the SaxParser. + * + * @class tinymce.html.Writer + * @example + * var writer = new tinymce.html.Writer({indent : true}); + * var parser = new tinymce.html.SaxParser(writer).parse('


    '); + * console.log(writer.getContent()); + * + * @class tinymce.html.Writer + * @version 3.4 + */ + +/** + * Constructs a new Writer instance. + * + * @constructor + * @method Writer + * @param {Object} settings Name/value settings object. + */ +tinymce.html.Writer = function(settings) { + var html = [], indent, indentBefore, indentAfter, encode, htmlOutput; + + settings = settings || {}; + indent = settings.indent; + indentBefore = tinymce.makeMap(settings.indent_before || ''); + indentAfter = tinymce.makeMap(settings.indent_after || ''); + encode = tinymce.html.Entities.getEncodeFunc(settings.entity_encoding || 'raw', settings.entities); + htmlOutput = settings.element_format == "html"; + + return { + /** + * Writes the a start element such as

    . + * + * @method start + * @param {String} name Name of the element. + * @param {Array} attrs Optional attribute array or undefined if it hasn't any. + * @param {Boolean} empty Optional empty state if the tag should end like
    . + */ + start: function(name, attrs, empty) { + var i, l, attr, value; + + if (indent && indentBefore[name] && html.length > 0) { + value = html[html.length - 1]; + + if (value.length > 0 && value !== '\n') + html.push('\n'); + } + + html.push('<', name); + + if (attrs) { + for (i = 0, l = attrs.length; i < l; i++) { + attr = attrs[i]; + html.push(' ', attr.name, '="', encode(attr.value, true), '"'); + } + } + + if (!empty || htmlOutput) + html[html.length] = '>'; + else + html[html.length] = ' />'; + + if (empty && indent && indentAfter[name] && html.length > 0) { + value = html[html.length - 1]; + + if (value.length > 0 && value !== '\n') + html.push('\n'); + } + }, + + /** + * Writes the a end element such as

    . + * + * @method end + * @param {String} name Name of the element. + */ + end: function(name) { + var value; + + /*if (indent && indentBefore[name] && html.length > 0) { + value = html[html.length - 1]; + + if (value.length > 0 && value !== '\n') + html.push('\n'); + }*/ + + html.push(''); + + if (indent && indentAfter[name] && html.length > 0) { + value = html[html.length - 1]; + + if (value.length > 0 && value !== '\n') + html.push('\n'); + } + }, + + /** + * Writes a text node. + * + * @method text + * @param {String} text String to write out. + * @param {Boolean} raw Optional raw state if true the contents wont get encoded. + */ + text: function(text, raw) { + if (text.length > 0) + html[html.length] = raw ? text : encode(text); + }, + + /** + * Writes a cdata node such as . + * + * @method cdata + * @param {String} text String to write out inside the cdata. + */ + cdata: function(text) { + html.push(''); + }, + + /** + * Writes a comment node such as . + * + * @method cdata + * @param {String} text String to write out inside the comment. + */ + comment: function(text) { + html.push(''); + }, + + /** + * Writes a PI node such as . + * + * @method pi + * @param {String} name Name of the pi. + * @param {String} text String to write out inside the pi. + */ + pi: function(name, text) { + if (text) + html.push(''); + else + html.push(''); + + if (indent) + html.push('\n'); + }, + + /** + * Writes a doctype node such as . + * + * @method doctype + * @param {String} text String to write out inside the doctype. + */ + doctype: function(text) { + html.push('', indent ? '\n' : ''); + }, + + /** + * Resets the internal buffer if one wants to reuse the writer. + * + * @method reset + */ + reset: function() { + html.length = 0; + }, + + /** + * Returns the contents that got serialized. + * + * @method getContent + * @return {String} HTML contents that got written down. + */ + getContent: function() { + return html.join('').replace(/\n$/, ''); + } + }; +}; diff --git a/js/tiny_mce/classes/tinymce.js b/js/tiny_mce/classes/tinymce.js index ebd3664ec2..6afea2fe2d 100644 --- a/js/tiny_mce/classes/tinymce.js +++ b/js/tiny_mce/classes/tinymce.js @@ -1,664 +1,869 @@ -/** - * tinymce.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function(win) { - var whiteSpaceRe = /^\s*|\s*$/g, - undefined; - - /** - * Core namespace with core functionality for the TinyMCE API all sub classes will be added to this namespace/object. - * - * @static - * @class tinymce - * @example - * // Using each method - * tinymce.each([1, 2, 3], function(v, i) { - * console.log(i + '=' + v); - * }); - * - * // Checking for a specific browser - * if (tinymce.isIE) - * console.log("IE"); - */ - var tinymce = { - /** - * Major version of TinyMCE build. - * - * @property majorVersion - * @type String - */ - majorVersion : '@@tinymce_major_version@@', - - /** - * Major version of TinyMCE build. - * - * @property minorVersion - * @type String - */ - minorVersion : '@@tinymce_minor_version@@', - - /** - * Release date of TinyMCE build. - * - * @property minorVersion - * @type String - */ - releaseDate : '@@tinymce_release_date@@', - - /** - * Initializes the TinyMCE global namespace this will setup browser detection and figure out where TinyMCE is running from. - */ - _init : function() { - var t = this, d = document, na = navigator, ua = na.userAgent, i, nl, n, base, p, v; - - /** - * Constant that is true if the browser is Opera. - * - * @property isOpera - * @type Boolean - * @final - */ - t.isOpera = win.opera && opera.buildNumber; - - /** - * Constant that is true if the browser is WebKit (Safari/Chrome). - * - * @property isWebKit - * @type Boolean - * @final - */ - t.isWebKit = /WebKit/.test(ua); - - /** - * Constant that is true if the browser is IE. - * - * @property isIE - * @type Boolean - * @final - */ - t.isIE = !t.isWebKit && !t.isOpera && (/MSIE/gi).test(ua) && (/Explorer/gi).test(na.appName); - - /** - * Constant that is true if the browser is IE 6 or older. - * - * @property isIE6 - * @type Boolean - * @final - */ - t.isIE6 = t.isIE && /MSIE [56]/.test(ua); - - /** - * Constant that is true if the browser is Gecko. - * - * @property isGecko - * @type Boolean - * @final - */ - t.isGecko = !t.isWebKit && /Gecko/.test(ua); - - /** - * Constant that is true if the os is Mac OS. - * - * @property isMac - * @type Boolean - * @final - */ - t.isMac = ua.indexOf('Mac') != -1; - - /** - * Constant that is true if the runtime is Adobe Air. - * - * @property isAir - * @type Boolean - * @final - */ - t.isAir = /adobeair/i.test(ua); - - /** - * Constant that tells if the current browser is an iPhone or iPad. - * - * @property isIDevice - * @type Boolean - * @final - */ - t.isIDevice = /(iPad|iPhone)/.test(ua); - - // TinyMCE .NET webcontrol might be setting the values for TinyMCE - if (win.tinyMCEPreInit) { - t.suffix = tinyMCEPreInit.suffix; - t.baseURL = tinyMCEPreInit.base; - t.query = tinyMCEPreInit.query; - return; - } - - // Get suffix and base - t.suffix = ''; - - // If base element found, add that infront of baseURL - nl = d.getElementsByTagName('base'); - for (i=0; i : - s = /^((static) )?([\w.]+)(:([\w.]+))?/.exec(s); - cn = s[3].match(/(^|\.)(\w+)$/i)[2]; // Class name - - // Create namespace for new class - ns = t.createNS(s[3].replace(/\.\w+$/, '')); - - // Class already exists - if (ns[cn]) - return; - - // Make pure static class - if (s[2] == 'static') { - ns[cn] = p; - - if (this.onCreate) - this.onCreate(s[2], s[3], ns[cn]); - - return; - } - - // Create default constructor - if (!p[cn]) { - p[cn] = function() {}; - de = 1; - } - - // Add constructor and methods - ns[cn] = p[cn]; - t.extend(ns[cn].prototype, p); - - // Extend - if (s[5]) { - sp = t.resolve(s[5]).prototype; - scn = s[5].match(/\.(\w+)$/i)[1]; // Class name - - // Extend constructor - c = ns[cn]; - if (de) { - // Add passthrough constructor - ns[cn] = function() { - return sp[scn].apply(this, arguments); - }; - } else { - // Add inherit constructor - ns[cn] = function() { - this.parent = sp[scn]; - return c.apply(this, arguments); - }; - } - ns[cn].prototype[cn] = ns[cn]; - - // Add super methods - t.each(sp, function(f, n) { - ns[cn].prototype[n] = sp[n]; - }); - - // Add overridden methods - t.each(p, function(f, n) { - // Extend methods if needed - if (sp[n]) { - ns[cn].prototype[n] = function() { - this.parent = sp[n]; - return f.apply(this, arguments); - }; - } else { - if (n != cn) - ns[cn].prototype[n] = f; - } - }); - } - - // Add static methods - t.each(p['static'], function(f, n) { - ns[cn][n] = f; - }); - - if (this.onCreate) - this.onCreate(s[2], s[3], ns[cn].prototype); - }, - - /** - * Executed the specified function for each item in a object tree. - * - * @method walk - * @param {Object} o Object tree to walk though. - * @param {function} f Function to call for each item. - * @param {String} n Optional name of collection inside the objects to walk for example childNodes. - * @param {String} s Optional scope to execute the function in. - */ - walk : function(o, f, n, s) { - s = s || this; - - if (o) { - if (n) - o = o[n]; - - tinymce.each(o, function(o, i) { - if (f.call(s, o, i, n) === false) - return false; - - tinymce.walk(o, f, n, s); - }); - } - }, - - /** - * Creates a namespace on a specific object. - * - * @method createNS - * @param {String} n Namespace to create for example a.b.c.d. - * @param {Object} o Optional object to add namespace to, defaults to window. - * @return {Object} New namespace object the last item in path. - */ - createNS : function(n, o) { - var i, v; - - o = o || win; - - n = n.split('.'); - for (i=0; i=534; + + // TinyMCE .NET webcontrol might be setting the values for TinyMCE + if (win.tinyMCEPreInit) { + t.suffix = tinyMCEPreInit.suffix; + t.baseURL = tinyMCEPreInit.base; + t.query = tinyMCEPreInit.query; + return; + } + + // Get suffix and base + t.suffix = ''; + + // If base element found, add that infront of baseURL + nl = d.getElementsByTagName('base'); + for (i=0; i 3;}); + */ + grep : function(a, f) { + var o = []; + + tinymce.each(a, function(v) { + if (!f || f(v)) + o.push(v); + }); + + return o; + }, + + /** + * Returns the index of a value in an array, this method will return -1 if the item wasn't found. + * + * @method inArray + * @param {Array} a Array/Object to search for value in. + * @param {Object} v Value to check for inside the array. + * @return {Number/String} Index of item inside the array inside an object. Or -1 if it wasn't found. + * @example + * // Get index of value in array this will alert 1 since 2 is at that index + * alert(tinymce.inArray([1,2,3], 2)); + */ + inArray : function(a, v) { + var i, l; + + if (a) { + for (i = 0, l = a.length; i < l; i++) { + if (a[i] === v) + return i; + } + } + + return -1; + }, + + /** + * Extends an object with the specified other object(s). + * + * @method extend + * @param {Object} o Object to extend with new items. + * @param {Object} e..n Object(s) to extend the specified object with. + * @return {Object} o New extended object, same reference as the input object. + * @example + * // Extends obj1 with two new fields + * var obj = tinymce.extend(obj1, { + * somefield1 : 'a', + * somefield2 : 'a' + * }); + * + * // Extends obj with obj2 and obj3 + * tinymce.extend(obj, obj2, obj3); + */ + extend : function(o, e) { + var i, l, a = arguments; + + for (i = 1, l = a.length; i < l; i++) { + e = a[i]; + + tinymce.each(e, function(v, n) { + if (v !== undefined) + o[n] = v; + }); + } + + return o; + }, + + // #endif + + /** + * Removes whitespace from the beginning and end of a string. + * + * @method trim + * @param {String} s String to remove whitespace from. + * @return {String} New string with removed whitespace. + */ + trim : function(s) { + return (s ? '' + s : '').replace(whiteSpaceRe, ''); + }, + + /** + * Creates a class, subclass or static singleton. + * More details on this method can be found in the Wiki. + * + * @method create + * @param {String} s Class name, inheritage and prefix. + * @param {Object} p Collection of methods to add to the class. + * @param {Object} root Optional root object defaults to the global window object. + * @example + * // Creates a basic class + * tinymce.create('tinymce.somepackage.SomeClass', { + * SomeClass : function() { + * // Class constructor + * }, + * + * method : function() { + * // Some method + * } + * }); + * + * // Creates a basic subclass class + * tinymce.create('tinymce.somepackage.SomeSubClass:tinymce.somepackage.SomeClass', { + * SomeSubClass: function() { + * // Class constructor + * this.parent(); // Call parent constructor + * }, + * + * method : function() { + * // Some method + * this.parent(); // Call parent method + * }, + * + * 'static' : { + * staticMethod : function() { + * // Static method + * } + * } + * }); + * + * // Creates a singleton/static class + * tinymce.create('static tinymce.somepackage.SomeSingletonClass', { + * method : function() { + * // Some method + * } + * }); + */ + create : function(s, p, root) { + var t = this, sp, ns, cn, scn, c, de = 0; + + // Parse : : + s = /^((static) )?([\w.]+)(:([\w.]+))?/.exec(s); + cn = s[3].match(/(^|\.)(\w+)$/i)[2]; // Class name + + // Create namespace for new class + ns = t.createNS(s[3].replace(/\.\w+$/, ''), root); + + // Class already exists + if (ns[cn]) + return; + + // Make pure static class + if (s[2] == 'static') { + ns[cn] = p; + + if (this.onCreate) + this.onCreate(s[2], s[3], ns[cn]); + + return; + } + + // Create default constructor + if (!p[cn]) { + p[cn] = function() {}; + de = 1; + } + + // Add constructor and methods + ns[cn] = p[cn]; + t.extend(ns[cn].prototype, p); + + // Extend + if (s[5]) { + sp = t.resolve(s[5]).prototype; + scn = s[5].match(/\.(\w+)$/i)[1]; // Class name + + // Extend constructor + c = ns[cn]; + if (de) { + // Add passthrough constructor + ns[cn] = function() { + return sp[scn].apply(this, arguments); + }; + } else { + // Add inherit constructor + ns[cn] = function() { + this.parent = sp[scn]; + return c.apply(this, arguments); + }; + } + ns[cn].prototype[cn] = ns[cn]; + + // Add super methods + t.each(sp, function(f, n) { + ns[cn].prototype[n] = sp[n]; + }); + + // Add overridden methods + t.each(p, function(f, n) { + // Extend methods if needed + if (sp[n]) { + ns[cn].prototype[n] = function() { + this.parent = sp[n]; + return f.apply(this, arguments); + }; + } else { + if (n != cn) + ns[cn].prototype[n] = f; + } + }); + } + + // Add static methods + t.each(p['static'], function(f, n) { + ns[cn][n] = f; + }); + + if (this.onCreate) + this.onCreate(s[2], s[3], ns[cn].prototype); + }, + + /** + * Executed the specified function for each item in a object tree. + * + * @method walk + * @param {Object} o Object tree to walk though. + * @param {function} f Function to call for each item. + * @param {String} n Optional name of collection inside the objects to walk for example childNodes. + * @param {String} s Optional scope to execute the function in. + */ + walk : function(o, f, n, s) { + s = s || this; + + if (o) { + if (n) + o = o[n]; + + tinymce.each(o, function(o, i) { + if (f.call(s, o, i, n) === false) + return false; + + tinymce.walk(o, f, n, s); + }); + } + }, + + /** + * Creates a namespace on a specific object. + * + * @method createNS + * @param {String} n Namespace to create for example a.b.c.d. + * @param {Object} o Optional object to add namespace to, defaults to window. + * @return {Object} New namespace object the last item in path. + * @example + * // Create some namespace + * tinymce.createNS('tinymce.somepackage.subpackage'); + * + * // Add a singleton + * var tinymce.somepackage.subpackage.SomeSingleton = { + * method : function() { + * // Some method + * } + * }; + */ + createNS : function(n, o) { + var i, v; + + o = o || win; + + n = n.split('.'); + for (i=0; i'; - - if (s.image) - h += '' + l + ''; + h = ''; + if (s.image && !(this.editor &&this.editor.forcedHighContrastMode) ) + h += '' + DOM.encode(s.title) + '' + l; else - h += '' + (l ? '' + l + '' : '') + ''; + h += '' + (l ? '' + l + '' : ''); + h += ''; + h += ''; return h; }, diff --git a/js/tiny_mce/classes/ui/ColorSplitButton.js b/js/tiny_mce/classes/ui/ColorSplitButton.js index 9391dc8862..d389ecaa11 100644 --- a/js/tiny_mce/classes/ui/ColorSplitButton.js +++ b/js/tiny_mce/classes/ui/ColorSplitButton.js @@ -26,11 +26,12 @@ * @method ColorSplitButton * @param {String} id Control id for the color split button. * @param {Object} s Optional name/value settings object. + * @param {Editor} ed The editor instance this button is for. */ - ColorSplitButton : function(id, s) { + ColorSplitButton : function(id, s, ed) { var t = this; - t.parent(id, s); + t.parent(id, s, ed); /** * Settings object. @@ -123,20 +124,21 @@ hideMenu : function(e) { var t = this; - // Prevent double toogles by canceling the mouse click event to the button - if (e && e.type == "mousedown" && DOM.getParent(e.target, function(e) {return e.id === t.id + '_open';})) - return; - - if (!e || !DOM.getParent(e.target, '.mceSplitButtonMenu')) { - DOM.removeClass(t.id, 'mceSplitButtonSelected'); - Event.remove(DOM.doc, 'mousedown', t.hideMenu, t); - Event.remove(t.id + '_menu', 'keydown', t._keyHandler); - DOM.hide(t.id + '_menu'); - } + if (t.isMenuVisible) { + // Prevent double toogles by canceling the mouse click event to the button + if (e && e.type == "mousedown" && DOM.getParent(e.target, function(e) {return e.id === t.id + '_open';})) + return; - t.onHideMenu.dispatch(t); + if (!e || !DOM.getParent(e.target, '.mceSplitButtonMenu')) { + DOM.removeClass(t.id, 'mceSplitButtonSelected'); + Event.remove(DOM.doc, 'mousedown', t.hideMenu, t); + Event.remove(t.id + '_menu', 'keydown', t._keyHandler); + DOM.hide(t.id + '_menu'); + } - t.isMenuVisible = 0; + t.isMenuVisible = 0; + t.onHideMenu.dispatch(); + } }, /** @@ -145,13 +147,13 @@ * @method renderMenu */ renderMenu : function() { - var t = this, m, i = 0, s = t.settings, n, tb, tr, w; + var t = this, m, i = 0, s = t.settings, n, tb, tr, w, context; - w = DOM.add(s.menu_container, 'div', {id : t.id + '_menu', 'class' : s['menu_class'] + ' ' + s['class'], style : 'position:absolute;left:0;top:-1000px;'}); + w = DOM.add(s.menu_container, 'div', {role: 'listbox', id : t.id + '_menu', 'class' : s['menu_class'] + ' ' + s['class'], style : 'position:absolute;left:0;top:-1000px;'}); m = DOM.add(w, 'div', {'class' : s['class'] + ' mceSplitButtonMenu'}); DOM.add(m, 'span', {'class' : 'mceMenuLine'}); - n = DOM.add(m, 'table', {'class' : 'mceColorSplitMenu'}); + n = DOM.add(m, 'table', {role: 'presentation', 'class' : 'mceColorSplitMenu'}); tb = DOM.add(n, 'tbody'); // Generate color grid @@ -165,20 +167,32 @@ } n = DOM.add(tr, 'td'); - n = DOM.add(n, 'a', { + role : 'option', href : 'javascript:;', style : { backgroundColor : '#' + c }, - _mce_color : '#' + c + 'title': t.editor.getLang('colors.' + c, c), + 'data-mce-color' : '#' + c }); + + if (t.editor.forcedHighContrastMode) { + n = DOM.add(n, 'canvas', { width: 16, height: 16, 'aria-hidden': 'true' }); + if (n.getContext && (context = n.getContext("2d"))) { + context.fillStyle = '#' + c; + context.fillRect(0, 0, 16, 16); + } else { + // No point leaving a canvas element around if it's not supported for drawing on anyway. + DOM.remove(n); + } + } }); if (s.more_colors_func) { n = DOM.add(tb, 'tr'); n = DOM.add(n, 'td', {colspan : s.grid_width, 'class' : 'mceMoreColors'}); - n = DOM.add(n, 'a', {id : t.id + '_more', href : 'javascript:;', onclick : 'return false;', 'class' : 'mceMoreColors'}, s.more_colors_title); + n = DOM.add(n, 'a', {role: 'option', id : t.id + '_more', href : 'javascript:;', onclick : 'return false;', 'class' : 'mceMoreColors'}, s.more_colors_title); Event.add(n, 'click', function(e) { s.more_colors_func.call(s.more_colors_scope || this); @@ -187,13 +201,25 @@ } DOM.addClass(m, 'mceColorSplitMenu'); + + new tinymce.ui.KeyboardNavigation({ + root: t.id + '_menu', + items: DOM.select('a', t.id + '_menu'), + onCancel: function() { + t.hideMenu(); + t.focus(); + } + }); + + // Prevent IE from scrolling and hindering click to occur #4019 + Event.add(t.id + '_menu', 'mousedown', function(e) {return Event.cancel(e);}); Event.add(t.id + '_menu', 'click', function(e) { var c; - e = e.target; + e = DOM.getParent(e.target, 'a', tb); - if (e.nodeName == 'A' && (c = e.getAttribute('_mce_color'))) + if (e && e.nodeName.toLowerCase() == 'a' && (c = e.getAttribute('data-mce-color'))) t.setColor(c); return Event.cancel(e); // Prevent IE auto save warning @@ -209,13 +235,23 @@ * @param {String} c Color code value in hex for example: #FF00FF */ setColor : function(c) { + this.displayColor(c); + this.hideMenu(); + this.settings.onselect(c); + }, + + /** + * Change the currently selected color for the control. + * + * @method displayColor + * @param {String} c Color code value in hex for example: #FF00FF + */ + displayColor : function(c) { var t = this; DOM.setStyle(t.id + '_preview', 'backgroundColor', c); t.value = c; - t.hideMenu(); - t.settings.onselect(c); }, /** diff --git a/js/tiny_mce/classes/ui/Container.js b/js/tiny_mce/classes/ui/Container.js index 1a6a6aa34e..47d5b0e8f7 100644 --- a/js/tiny_mce/classes/ui/Container.js +++ b/js/tiny_mce/classes/ui/Container.js @@ -24,8 +24,8 @@ tinymce.create('tinymce.ui.Container:tinymce.ui.Control', { * @param {String} id Control id to use for the container. * @param {Object} s Optional name/value settings object. */ - Container : function(id, s) { - this.parent(id, s); + Container : function(id, s, editor) { + this.parent(id, s, editor); /** * Array of controls added to the container. diff --git a/js/tiny_mce/classes/ui/Control.js b/js/tiny_mce/classes/ui/Control.js index d5635ffe92..1564c827bd 100644 --- a/js/tiny_mce/classes/ui/Control.js +++ b/js/tiny_mce/classes/ui/Control.js @@ -27,7 +27,7 @@ * @param {String} id Control id. * @param {Object} s Optional name/value settings object. */ - Control : function(id, s) { + Control : function(id, s, editor) { this.id = id; this.settings = s = s || {}; this.rendered = false; @@ -36,6 +36,18 @@ this.scope = s.scope || this; this.disabled = 0; this.active = 0; + this.editor = editor; + }, + + setAriaProperty : function(property, value) { + var element = DOM.get(this.id + '_aria') || DOM.get(this.id); + if (element) { + DOM.setAttrib(element, 'aria-' + property, !!value); + } + }, + + focus : function() { + DOM.get(this.id).focus(); }, /** @@ -46,19 +58,8 @@ * @param {Boolean} s Boolean state if the control should be disabled or not. */ setDisabled : function(s) { - var e; - if (s != this.disabled) { - e = DOM.get(this.id); - - // Add accessibility title for unavailable actions - if (e && this.settings.unavailable_prefix) { - if (s) { - this.prevTitle = e.title; - e.title = this.settings.unavailable_prefix + ": " + e.title; - } else - e.title = this.prevTitle; - } + this.setAriaProperty('disabled', s); this.setState('Disabled', s); this.setState('Enabled', !s); @@ -88,6 +89,7 @@ if (s != this.active) { this.setState('Active', s); this.active = s; + this.setAriaProperty('pressed', s); } }, diff --git a/js/tiny_mce/classes/ui/DropMenu.js b/js/tiny_mce/classes/ui/DropMenu.js index cc4390c3f7..84ef334788 100644 --- a/js/tiny_mce/classes/ui/DropMenu.js +++ b/js/tiny_mce/classes/ui/DropMenu.js @@ -17,6 +17,50 @@ * * @class tinymce.ui.DropMenu * @extends tinymce.ui.Menu + * @example + * // Adds a menu to the currently active editor instance + * var dm = tinyMCE.activeEditor.controlManager.createDropMenu('somemenu'); + * + * // Add some menu items + * dm.add({title : 'Menu 1', onclick : function() { + * alert('Item 1 was clicked.'); + * }}); + * + * dm.add({title : 'Menu 2', onclick : function() { + * alert('Item 2 was clicked.'); + * }}); + * + * // Adds a submenu + * var sub1 = dm.addMenu({title : 'Menu 3'}); + * sub1.add({title : 'Menu 1.1', onclick : function() { + * alert('Item 1.1 was clicked.'); + * }}); + * + * // Adds a horizontal separator + * sub1.addSeparator(); + * + * sub1.add({title : 'Menu 1.2', onclick : function() { + * alert('Item 1.2 was clicked.'); + * }}); + * + * // Adds a submenu to the submenu + * var sub2 = sub1.addMenu({title : 'Menu 1.3'}); + * + * // Adds items to the sub sub menu + * sub2.add({title : 'Menu 1.3.1', onclick : function() { + * alert('Item 1.3.1 was clicked.'); + * }}); + * + * sub2.add({title : 'Menu 1.3.2', onclick : function() { + * alert('Item 1.3.2 was clicked.'); + * }}); + * + * dm.add({title : 'Menu 4', onclick : function() { + * alert('Item 3 was clicked.'); + * }}); + * + * // Display the menu at position 100, 100 + * dm.showMenu(100, 100); */ tinymce.create('tinymce.ui.DropMenu:tinymce.ui.Menu', { /** @@ -60,12 +104,20 @@ s['class'] = s['class'] || cs['class']; s.vp_offset_x = s.vp_offset_x || cs.vp_offset_x; s.vp_offset_y = s.vp_offset_y || cs.vp_offset_y; + s.keyboard_focus = cs.keyboard_focus; m = new tinymce.ui.DropMenu(s.id || DOM.uniqueId(), s); m.onAddItem.add(t.onAddItem.dispatch, t.onAddItem); return m; }, + + focus : function() { + var t = this; + if (t.keyboardNav) { + t.keyboardNav.focus(); + } + }, /** * Repaints the menu after new items have been added dynamically. @@ -202,13 +254,13 @@ } }); } + + Event.add(co, 'keydown', t._keyHandler, t); t.onShowMenu.dispatch(t); - if (s.keyboard_focus) { - Event.add(co, 'keydown', t._keyHandler, t); - DOM.select('a', 'menu_' + t.id)[0].focus(); // Select first link - t._focusIdx = 0; + if (s.keyboard_focus) { + t._setupKeyboardNav(); } }, @@ -223,6 +275,7 @@ if (!t.isMenuVisible) return; + if (t.keyboardNav) t.keyboardNav.destroy(); Event.remove(co, 'mouseover', t.mouseOverFunc); Event.remove(co, 'click', t.mouseClickFunc); Event.remove(co, 'keydown', t._keyHandler); @@ -292,8 +345,11 @@ destroy : function() { var t = this, co = DOM.get('menu_' + t.id); + if (t.keyboardNav) t.keyboardNav.destroy(); Event.remove(co, 'mouseover', t.mouseOverFunc); + Event.remove(DOM.select('a', co), 'focus', t.mouseOverFunc); Event.remove(co, 'click', t.mouseClickFunc); + Event.remove(co, 'keydown', t._keyHandler); if (t.element) t.element.remove(); @@ -310,15 +366,18 @@ renderNode : function() { var t = this, s = t.settings, n, tb, co, w; - w = DOM.create('div', {id : 'menu_' + t.id, 'class' : s['class'], 'style' : 'position:absolute;left:0;top:0;z-index:200000'}); - co = DOM.add(w, 'div', {id : 'menu_' + t.id + '_co', 'class' : t.classPrefix + (s['class'] ? ' ' + s['class'] : '')}); + w = DOM.create('div', {role: 'listbox', id : 'menu_' + t.id, 'class' : s['class'], 'style' : 'position:absolute;left:0;top:0;z-index:200000;outline:0'}); + if (t.settings.parent) { + DOM.setAttrib(w, 'aria-parent', 'menu_' + t.settings.parent.id); + } + co = DOM.add(w, 'div', {role: 'presentation', id : 'menu_' + t.id + '_co', 'class' : t.classPrefix + (s['class'] ? ' ' + s['class'] : '')}); t.element = new Element('menu_' + t.id, {blocker : 1, container : s.container}); if (s.menu_line) DOM.add(co, 'span', {'class' : t.classPrefix + 'Line'}); // n = DOM.add(co, 'div', {id : 'menu_' + t.id + '_co', 'class' : 'mceMenuContainer'}); - n = DOM.add(co, 'table', {id : 'menu_' + t.id + '_tbl', border : 0, cellPadding : 0, cellSpacing : 0}); + n = DOM.add(co, 'table', {role: 'presentation', id : 'menu_' + t.id + '_tbl', border : 0, cellPadding : 0, cellSpacing : 0}); tb = DOM.add(n, 'tbody'); each(t.items, function(o) { @@ -331,33 +390,36 @@ }, // Internal functions + _setupKeyboardNav : function(){ + var contextMenu, menuItems, t=this; + contextMenu = DOM.select('#menu_' + t.id)[0]; + menuItems = DOM.select('a[role=option]', 'menu_' + t.id); + menuItems.splice(0,0,contextMenu); + t.keyboardNav = new tinymce.ui.KeyboardNavigation({ + root: 'menu_' + t.id, + items: menuItems, + onCancel: function() { + t.hideMenu(); + }, + enableUpDown: true + }); + contextMenu.focus(); + }, - _keyHandler : function(e) { - var t = this, kc = e.keyCode; - - function focus(d) { - var i = t._focusIdx + d, e = DOM.select('a', 'menu_' + t.id)[i]; - - if (e) { - t._focusIdx = i; - e.focus(); - } - }; - - switch (kc) { - case 38: - focus(-1); // Select first link - return; - - case 40: - focus(1); - return; - - case 13: - return; - - case 27: - return this.hideMenu(); + _keyHandler : function(evt) { + var t = this, e; + switch (evt.keyCode) { + case 37: // Left + if (t.settings.parent) { + t.hideMenu(); + t.settings.parent.focus(); + Event.cancel(evt); + } + break; + case 39: // Right + if (t.mouseOverFunc) + t.mouseOverFunc(evt); + break; } }, @@ -375,8 +437,13 @@ } n = ro = DOM.add(tb, 'tr', {id : o.id, 'class' : cp + 'Item ' + cp + 'ItemEnabled'}); - n = it = DOM.add(n, 'td'); - n = a = DOM.add(n, 'a', {href : 'javascript:;', onclick : "return false;", onmousedown : 'return false;'}); + n = it = DOM.add(n, s.titleItem ? 'th' : 'td'); + n = a = DOM.add(n, 'a', {id: o.id + '_aria', role: s.titleItem ? 'presentation' : 'option', href : 'javascript:;', onclick : "return false;", onmousedown : 'return false;'}); + + if (s.parent) { + DOM.setAttrib(a, 'aria-haspopup', 'true'); + DOM.setAttrib(a, 'aria-owns', 'menu_' + o.id); + } DOM.addClass(it, s['class']); // n = DOM.add(n, 'span', {'class' : 'item'}); diff --git a/js/tiny_mce/classes/ui/KeyboardNavigation.js b/js/tiny_mce/classes/ui/KeyboardNavigation.js new file mode 100644 index 0000000000..b083704083 --- /dev/null +++ b/js/tiny_mce/classes/ui/KeyboardNavigation.js @@ -0,0 +1,183 @@ +/** + * KeyboardNavigation.js + * + * Copyright 2011, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function(tinymce) { + var Event = tinymce.dom.Event, each = tinymce.each; + + /** + * This class provides basic keyboard navigation using the arrow keys to children of a component. + * For example, this class handles moving between the buttons on the toolbars. + * + * @class tinymce.ui.KeyboardNavigation + */ + tinymce.create('tinymce.ui.KeyboardNavigation', { + /** + * Create a new KeyboardNavigation instance to handle the focus for a specific element. + * + * @constructor + * @method KeyboardNavigation + * @param {Object} settings the settings object to define how keyboard navigation works. + * @param {DOMUtils} dom the DOMUtils instance to use. + * + * @setting {Element/String} root the root element or ID of the root element for the control. + * @setting {Array} items an array containing the items to move focus between. Every object in this array must have an id attribute which maps to the actual DOM element. If the actual elements are passed without an ID then one is automatically assigned. + * @setting {Function} onCancel the callback for when the user presses escape or otherwise indicates cancelling. + * @setting {Function} onAction (optional) the action handler to call when the user activates an item. + * @setting {Boolean} enableLeftRight (optional, default) when true, the up/down arrows move through items. + * @setting {Boolean} enableUpDown (optional) when true, the up/down arrows move through items. + * Note for both up/down and left/right explicitly set both enableLeftRight and enableUpDown to true. + */ + KeyboardNavigation: function(settings, dom) { + var t = this, root = settings.root, items = settings.items, + enableUpDown = settings.enableUpDown, enableLeftRight = settings.enableLeftRight || !settings.enableUpDown, + excludeFromTabOrder = settings.excludeFromTabOrder, + itemFocussed, itemBlurred, rootKeydown, rootFocussed, focussedId; + + dom = dom || tinymce.DOM; + + itemFocussed = function(evt) { + focussedId = evt.target.id; + }; + + itemBlurred = function(evt) { + dom.setAttrib(evt.target.id, 'tabindex', '-1'); + }; + + rootFocussed = function(evt) { + var item = dom.get(focussedId); + dom.setAttrib(item, 'tabindex', '0'); + item.focus(); + }; + + t.focus = function() { + dom.get(focussedId).focus(); + }; + + /** + * Destroys the KeyboardNavigation and unbinds any focus/blur event handles it might have added. + * + * @method destroy + */ + t.destroy = function() { + each(items, function(item) { + dom.unbind(dom.get(item.id), 'focus', itemFocussed); + dom.unbind(dom.get(item.id), 'blur', itemBlurred); + }); + + dom.unbind(dom.get(root), 'focus', rootFocussed); + dom.unbind(dom.get(root), 'keydown', rootKeydown); + + items = dom = root = t.focus = itemFocussed = itemBlurred = rootKeydown = rootFocussed = null; + t.destroy = function() {}; + }; + + t.moveFocus = function(dir, evt) { + var idx = -1, controls = t.controls, newFocus; + + if (!focussedId) + return; + + each(items, function(item, index) { + if (item.id === focussedId) { + idx = index; + return false; + } + }); + + idx += dir; + if (idx < 0) { + idx = items.length - 1; + } else if (idx >= items.length) { + idx = 0; + } + + newFocus = items[idx]; + dom.setAttrib(focussedId, 'tabindex', '-1'); + dom.setAttrib(newFocus.id, 'tabindex', '0'); + dom.get(newFocus.id).focus(); + + if (settings.actOnFocus) { + settings.onAction(newFocus.id); + } + + if (evt) + Event.cancel(evt); + }; + + rootKeydown = function(evt) { + var DOM_VK_LEFT = 37, DOM_VK_RIGHT = 39, DOM_VK_UP = 38, DOM_VK_DOWN = 40, DOM_VK_ESCAPE = 27, DOM_VK_ENTER = 14, DOM_VK_RETURN = 13, DOM_VK_SPACE = 32; + + switch (evt.keyCode) { + case DOM_VK_LEFT: + if (enableLeftRight) t.moveFocus(-1); + break; + + case DOM_VK_RIGHT: + if (enableLeftRight) t.moveFocus(1); + break; + + case DOM_VK_UP: + if (enableUpDown) t.moveFocus(-1); + break; + + case DOM_VK_DOWN: + if (enableUpDown) t.moveFocus(1); + break; + + case DOM_VK_ESCAPE: + if (settings.onCancel) { + settings.onCancel(); + Event.cancel(evt); + } + break; + + case DOM_VK_ENTER: + case DOM_VK_RETURN: + case DOM_VK_SPACE: + if (settings.onAction) { + settings.onAction(focussedId); + Event.cancel(evt); + } + break; + } + }; + + // Set up state and listeners for each item. + each(items, function(item, idx) { + var tabindex; + + if (!item.id) { + item.id = dom.uniqueId('_mce_item_'); + } + + if (excludeFromTabOrder) { + dom.bind(item.id, 'blur', itemBlurred); + tabindex = '-1'; + } else { + tabindex = (idx === 0 ? '0' : '-1'); + } + + dom.setAttrib(item.id, 'tabindex', tabindex); + dom.bind(dom.get(item.id), 'focus', itemFocussed); + }); + + // Setup initial state for root element. + if (items[0]){ + focussedId = items[0].id; + } + + dom.setAttrib(root, 'tabindex', '-1'); + + // Setup listeners for root element. + dom.bind(dom.get(root), 'focus', rootFocussed); + dom.bind(dom.get(root), 'keydown', rootKeydown); + } + }); +})(tinymce); diff --git a/js/tiny_mce/classes/ui/ListBox.js b/js/tiny_mce/classes/ui/ListBox.js index 54bd42ec77..ced8cb9ab4 100644 --- a/js/tiny_mce/classes/ui/ListBox.js +++ b/js/tiny_mce/classes/ui/ListBox.js @@ -17,6 +17,41 @@ * * @class tinymce.ui.ListBox * @extends tinymce.ui.Control + * @example + * // Creates a new plugin class and a custom listbox + * tinymce.create('tinymce.plugins.ExamplePlugin', { + * createControl: function(n, cm) { + * switch (n) { + * case 'mylistbox': + * var mlb = cm.createListBox('mylistbox', { + * title : 'My list box', + * onselect : function(v) { + * tinyMCE.activeEditor.windowManager.alert('Value selected:' + v); + * } + * }); + * + * // Add some values to the list box + * mlb.add('Some item 1', 'val1'); + * mlb.add('some item 2', 'val2'); + * mlb.add('some item 3', 'val3'); + * + * // Return the new listbox instance + * return mlb; + * } + * + * return null; + * } + * }); + * + * // Register plugin with a short name + * tinymce.PluginManager.add('example', tinymce.plugins.ExamplePlugin); + * + * // Initialize TinyMCE with the new plugin and button + * tinyMCE.init({ + * ... + * plugins : '-example', // - means TinyMCE will not try to load it + * theme_advanced_buttons1 : 'mylistbox' // Add the new example listbox to the toolbar + * }); */ tinymce.create('tinymce.ui.ListBox:tinymce.ui.Control', { /** @@ -26,11 +61,12 @@ * @method ListBox * @param {String} id Control id for the list box. * @param {Object} s Optional name/value settings object. + * @param {Editor} ed Optional the editor instance this button is for. */ - ListBox : function(id, s) { + ListBox : function(id, s, ed) { var t = this; - t.parent(id, s); + t.parent(id, s, ed); /** * Array of ListBox items. @@ -117,23 +153,27 @@ * @param {String} idx Index to select, pass -1 to select menu/title of select box. */ selectByIndex : function(idx) { - var t = this, e, o; + var t = this, e, o, label; if (idx != t.selectedIndex) { e = DOM.get(t.id + '_text'); + label = DOM.get(t.id + '_voiceDesc'); o = t.items[idx]; if (o) { t.selectedValue = o.value; t.selectedIndex = idx; DOM.setHTML(e, DOM.encode(o.title)); + DOM.setHTML(label, t.settings.title + " - " + o.title); DOM.removeClass(e, 'mceTitle'); + DOM.setAttrib(t.id, 'aria-valuenow', o.title); } else { DOM.setHTML(e, DOM.encode(t.settings.title)); + DOM.setHTML(label, DOM.encode(t.settings.title)); DOM.addClass(e, 'mceTitle'); t.selectedValue = t.selectedIndex = null; + DOM.setAttrib(t.id, 'aria-valuenow', t.settings.title); } - e = 0; } }, @@ -179,10 +219,11 @@ renderHTML : function() { var h = '', t = this, s = t.settings, cp = t.classPrefix; - h = ''; - h += ''; - h += ''; - h += '
    ' + DOM.createHTML('a', {id : t.id + '_text', href : 'javascript:;', 'class' : 'mceText', onclick : "return false;", onmousedown : 'return false;'}, DOM.encode(t.settings.title)) + '' + DOM.createHTML('a', {id : t.id + '_open', tabindex : -1, href : 'javascript:;', 'class' : 'mceOpen', onclick : "return false;", onmousedown : 'return false;'}, '') + '
    '; + h = ''; + h += ''; + h += ''; + h += ''; return h; }, @@ -193,7 +234,7 @@ * @method showMenu */ showMenu : function() { - var t = this, p1, p2, e = DOM.get(this.id), m; + var t = this, p2, e = DOM.get(this.id), m; if (t.isDisabled() || t.items.length == 0) return; @@ -206,7 +247,6 @@ t.isMenuRendered = true; } - p1 = DOM.getPos(this.settings.menu_container); p2 = DOM.getPos(e); m = t.menu; @@ -242,6 +282,8 @@ var t = this; if (t.menu && t.menu.isMenuVisible) { + DOM.removeClass(t.id, t.classPrefix + 'Selected'); + // Prevent double toogles by canceling the mouse click event to the button if (e && e.type == "mousedown" && (e.target.id == t.id + '_text' || e.target.id == t.id + '_open')) return; @@ -269,7 +311,10 @@ max_height : 150 }); - m.onHideMenu.add(t.hideMenu, t); + m.onHideMenu.add(function() { + t.hideMenu(); + t.focus(); + }); m.add({ title : t.settings.title, @@ -285,6 +330,7 @@ if (o.value === undefined) { m.add({ title : o.title, + role : "option", 'class' : 'mceMenuItemTitle', onclick : function() { if (t.settings.onselect('') !== false) @@ -293,6 +339,7 @@ }); } else { o.id = DOM.uniqueId(); + o.role= "option"; o.onclick = function() { if (t.settings.onselect(o.value) !== false) t.select(o.value); // Must be runned after @@ -316,40 +363,39 @@ var t = this, cp = t.classPrefix; Event.add(t.id, 'click', t.showMenu, t); - Event.add(t.id + '_text', 'focus', function() { + Event.add(t.id, 'keydown', function(evt) { + if (evt.keyCode == 32) { // Space + t.showMenu(evt); + Event.cancel(evt); + } + }); + Event.add(t.id, 'focus', function() { if (!t._focused) { - t.keyDownHandler = Event.add(t.id + '_text', 'keydown', function(e) { - var idx = -1, v, kc = e.keyCode; - - // Find current index - each(t.items, function(v, i) { - if (t.selectedValue == v.value) - idx = i; - }); - - // Move up/down - if (kc == 38) - v = t.items[idx - 1]; - else if (kc == 40) - v = t.items[idx + 1]; - else if (kc == 13) { + t.keyDownHandler = Event.add(t.id, 'keydown', function(e) { + if (e.keyCode == 40) { + t.showMenu(); + Event.cancel(e); + } + }); + t.keyPressHandler = Event.add(t.id, 'keypress', function(e) { + var v; + if (e.keyCode == 13) { // Fake select on enter v = t.selectedValue; t.selectedValue = null; // Needs to be null to fake change + Event.cancel(e); t.settings.onselect(v); - return Event.cancel(e); - } - - if (v) { - t.hideMenu(); - t.select(v.value); } }); } t._focused = 1; }); - Event.add(t.id + '_text', 'blur', function() {Event.remove(t.id + '_text', 'keydown', t.keyDownHandler); t._focused = 0;}); + Event.add(t.id, 'blur', function() { + Event.remove(t.id, 'keydown', t.keyDownHandler); + Event.remove(t.id, 'keypress', t.keyPressHandler); + t._focused = 0; + }); // Old IE doesn't have hover on all elements if (tinymce.isIE6 || !DOM.boxModel) { @@ -379,4 +425,4 @@ Event.clear(this.id + '_open'); } }); -})(tinymce); \ No newline at end of file +})(tinymce); diff --git a/js/tiny_mce/classes/ui/MenuButton.js b/js/tiny_mce/classes/ui/MenuButton.js index 6633bd4a38..48547244d3 100644 --- a/js/tiny_mce/classes/ui/MenuButton.js +++ b/js/tiny_mce/classes/ui/MenuButton.js @@ -17,6 +17,36 @@ * * @class tinymce.ui.MenuButton * @extends tinymce.ui.Control + * @example + * // Creates a new plugin class and a custom menu button + * tinymce.create('tinymce.plugins.ExamplePlugin', { + * createControl: function(n, cm) { + * switch (n) { + * case 'mymenubutton': + * var c = cm.createSplitButton('mysplitbutton', { + * title : 'My menu button', + * image : 'some.gif' + * }); + * + * c.onRenderMenu.add(function(c, m) { + * m.add({title : 'Some title', 'class' : 'mceMenuItemTitle'}).setDisabled(1); + * + * m.add({title : 'Some item 1', onclick : function() { + * alert('Some item 1 was clicked.'); + * }}); + * + * m.add({title : 'Some item 2', onclick : function() { + * alert('Some item 2 was clicked.'); + * }}); + * }); + * + * // Return the new menubutton instance + * return c; + * } + * + * return null; + * } + * }); */ tinymce.create('tinymce.ui.MenuButton:tinymce.ui.Button', { /** @@ -26,9 +56,10 @@ * @method MenuButton * @param {String} id Control id for the split button. * @param {Object} s Optional name/value settings object. + * @param {Editor} ed Optional the editor instance this button is for. */ - MenuButton : function(id, s) { - this.parent(id, s); + MenuButton : function(id, s, ed) { + this.parent(id, s, ed); /** * Fires when the menu is rendered. @@ -90,7 +121,10 @@ icons : t.settings.icons }); - m.onHideMenu.add(t.hideMenu, t); + m.onHideMenu.add(function() { + t.hideMenu(); + t.focus(); + }); t.onRenderMenu.dispatch(t, m); t.menu = m; diff --git a/js/tiny_mce/classes/ui/MenuItem.js b/js/tiny_mce/classes/ui/MenuItem.js index af76922ead..0273a92cab 100644 --- a/js/tiny_mce/classes/ui/MenuItem.js +++ b/js/tiny_mce/classes/ui/MenuItem.js @@ -41,6 +41,7 @@ */ setSelected : function(s) { this.setState('Selected', s); + this.setAriaProperty('checked', !!s); this.selected = s; }, diff --git a/js/tiny_mce/classes/ui/NativeListBox.js b/js/tiny_mce/classes/ui/NativeListBox.js index 1689e05f38..1cbb6735c9 100644 --- a/js/tiny_mce/classes/ui/NativeListBox.js +++ b/js/tiny_mce/classes/ui/NativeListBox.js @@ -41,6 +41,7 @@ */ setDisabled : function(s) { DOM.get(this.id).disabled = s; + this.setAriaProperty('disabled', s); }, /** @@ -156,8 +157,8 @@ h += DOM.createHTML('option', {value : it.value}, it.title); }); - h = DOM.createHTML('select', {id : t.id, 'class' : 'mceNativeListBox'}, h); - + h = DOM.createHTML('select', {id : t.id, 'class' : 'mceNativeListBox', 'aria-labelledby': t.id + '_aria'}, h); + h += DOM.createHTML('span', {id : t.id + '_aria', 'style': 'display: none'}, t.settings.title); return h; }, @@ -168,7 +169,7 @@ * @method postRender */ postRender : function() { - var t = this, ch; + var t = this, ch, changeListenerAdded = true; t.rendered = true; @@ -190,12 +191,20 @@ var bf; Event.remove(t.id, 'change', ch); + changeListenerAdded = false; bf = Event.add(t.id, 'blur', function() { + if (changeListenerAdded) return; + changeListenerAdded = true; Event.add(t.id, 'change', onChange); Event.remove(t.id, 'blur', bf); }); + //prevent default left and right keys on chrome - so that the keyboard navigation is used. + if (tinymce.isWebKit && (e.keyCode==37 ||e.keyCode==39)) { + return Event.prevent(e); + } + if (e.keyCode == 13 || e.keyCode == 32) { onChange(e); return Event.cancel(e); @@ -205,4 +214,4 @@ t.onPostRender.dispatch(t, DOM.get(t.id)); } }); -})(tinymce); \ No newline at end of file +})(tinymce); diff --git a/js/tiny_mce/classes/ui/Separator.js b/js/tiny_mce/classes/ui/Separator.js index 8ecd690391..9e6daf7932 100644 --- a/js/tiny_mce/classes/ui/Separator.js +++ b/js/tiny_mce/classes/ui/Separator.js @@ -26,6 +26,7 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', { Separator : function(id, s) { this.parent(id, s); this.classPrefix = 'mceSeparator'; + this.setDisabled(true); }, /** @@ -36,6 +37,6 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', { * @return {String} HTML for the separator control element. */ renderHTML : function() { - return tinymce.DOM.createHTML('span', {'class' : this.classPrefix}); + return tinymce.DOM.createHTML('span', {'class' : this.classPrefix, role : 'separator', 'aria-orientation' : 'vertical', tabindex : '-1'}); } }); diff --git a/js/tiny_mce/classes/ui/SplitButton.js b/js/tiny_mce/classes/ui/SplitButton.js index 945f5449f6..7242361987 100644 --- a/js/tiny_mce/classes/ui/SplitButton.js +++ b/js/tiny_mce/classes/ui/SplitButton.js @@ -16,6 +16,39 @@ * * @class tinymce.ui.SplitButton * @extends tinymce.ui.Button + * @example + * // Creates a new plugin class and a custom split button + * tinymce.create('tinymce.plugins.ExamplePlugin', { + * createControl: function(n, cm) { + * switch (n) { + * case 'mysplitbutton': + * var c = cm.createSplitButton('mysplitbutton', { + * title : 'My split button', + * image : 'some.gif', + * onclick : function() { + * alert('Button was clicked.'); + * } + * }); + * + * c.onRenderMenu.add(function(c, m) { + * m.add({title : 'Some title', 'class' : 'mceMenuItemTitle'}).setDisabled(1); + * + * m.add({title : 'Some item 1', onclick : function() { + * alert('Some item 1 was clicked.'); + * }}); + * + * m.add({title : 'Some item 2', onclick : function() { + * alert('Some item 2 was clicked.'); + * }}); + * }); + * + * // Return the new splitbutton instance + * return c; + * } + * + * return null; + * } + * }); */ tinymce.create('tinymce.ui.SplitButton:tinymce.ui.MenuButton', { /** @@ -25,9 +58,10 @@ * @method SplitButton * @param {String} id Control id for the split button. * @param {Object} s Optional name/value settings object. + * @param {Editor} ed Optional the editor instance this button is for. */ - SplitButton : function(id, s) { - this.parent(id, s); + SplitButton : function(id, s, ed) { + this.parent(id, s, ed); this.classPrefix = 'mceSplitButton'; }, @@ -44,18 +78,19 @@ h = ''; if (s.image) - h1 = DOM.createHTML('img ', {src : s.image, 'class' : 'mceAction ' + s['class']}); + h1 = DOM.createHTML('img ', {src : s.image, role: 'presentation', 'class' : 'mceAction ' + s['class']}); else h1 = DOM.createHTML('span', {'class' : 'mceAction ' + s['class']}, ''); - h += '' + DOM.createHTML('a', {id : t.id + '_action', href : 'javascript:;', 'class' : 'mceAction ' + s['class'], onclick : "return false;", onmousedown : 'return false;', title : s.title}, h1) + ''; + h1 += DOM.createHTML('span', {'class': 'mceVoiceLabel mceIconOnly', id: t.id + '_voice', style: 'display:none;'}, s.title); + h += '' + DOM.createHTML('a', {role: 'button', id : t.id + '_action', tabindex: '-1', href : 'javascript:;', 'class' : 'mceAction ' + s['class'], onclick : "return false;", onmousedown : 'return false;', title : s.title}, h1) + ''; - h1 = DOM.createHTML('span', {'class' : 'mceOpen ' + s['class']}); - h += '' + DOM.createHTML('a', {id : t.id + '_open', href : 'javascript:;', 'class' : 'mceOpen ' + s['class'], onclick : "return false;", onmousedown : 'return false;', title : s.title}, h1) + ''; + h1 = DOM.createHTML('span', {'class' : 'mceOpen ' + s['class']}, ''); + h += '' + DOM.createHTML('a', {role: 'button', id : t.id + '_open', tabindex: '-1', href : 'javascript:;', 'class' : 'mceOpen ' + s['class'], onclick : "return false;", onmousedown : 'return false;', title : s.title}, h1) + ''; h += ''; - - return DOM.createHTML('table', {id : t.id, 'class' : 'mceSplitButton mceSplitButtonEnabled ' + s['class'], cellpadding : '0', cellspacing : '0', onmousedown : 'return false;', title : s.title}, h); + h = DOM.createHTML('table', { role: 'presentation', 'class' : 'mceSplitButton mceSplitButtonEnabled ' + s['class'], cellpadding : '0', cellspacing : '0', title : s.title}, h); + return DOM.createHTML('div', {id : t.id, role: 'button', tabindex: '0', 'aria-labelledby': t.id + '_voice', 'aria-haspopup': 'true'}, h); }, /** @@ -65,18 +100,34 @@ * @method postRender */ postRender : function() { - var t = this, s = t.settings; + var t = this, s = t.settings, activate; if (s.onclick) { - Event.add(t.id + '_action', 'click', function() { - if (!t.isDisabled()) + activate = function(evt) { + if (!t.isDisabled()) { s.onclick(t.value); + Event.cancel(evt); + } + }; + Event.add(t.id + '_action', 'click', activate); + Event.add(t.id, ['click', 'keydown'], function(evt) { + var DOM_VK_SPACE = 32, DOM_VK_ENTER = 14, DOM_VK_RETURN = 13, DOM_VK_UP = 38, DOM_VK_DOWN = 40; + if ((evt.keyCode === 32 || evt.keyCode === 13 || evt.keyCode === 14) && !evt.altKey && !evt.ctrlKey && !evt.metaKey) { + activate(); + Event.cancel(evt); + } else if (evt.type === 'click' || evt.keyCode === DOM_VK_DOWN) { + t.showMenu(); + Event.cancel(evt); + } }); } - Event.add(t.id + '_open', 'click', t.showMenu, t); - Event.add(t.id + '_open', 'focus', function() {t._focused = 1;}); - Event.add(t.id + '_open', 'blur', function() {t._focused = 0;}); + Event.add(t.id + '_open', 'click', function (evt) { + t.showMenu(); + Event.cancel(evt); + }); + Event.add([t.id, t.id + '_open'], 'focus', function() {t._focused = 1;}); + Event.add([t.id, t.id + '_open'], 'blur', function() {t._focused = 0;}); // Old IE doesn't have hover on all elements if (tinymce.isIE6 || !DOM.boxModel) { @@ -97,6 +148,7 @@ Event.clear(this.id + '_action'); Event.clear(this.id + '_open'); + Event.clear(this.id); } }); })(tinymce); diff --git a/js/tiny_mce/classes/ui/Toolbar.js b/js/tiny_mce/classes/ui/Toolbar.js index 4c6142edf8..10b780ab84 100644 --- a/js/tiny_mce/classes/ui/Toolbar.js +++ b/js/tiny_mce/classes/ui/Toolbar.js @@ -8,6 +8,9 @@ * Contributing: http://tinymce.moxiecode.com/contributing */ +(function(tinymce) { +// Shorten class names +var dom = tinymce.DOM, each = tinymce.each; /** * This class is used to create toolbars a toolbar is a container for other controls like buttons etc. * @@ -23,7 +26,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { * @return {String} HTML for the toolbar control. */ renderHTML : function() { - var t = this, h = '', c, co, dom = tinymce.DOM, s = t.settings, i, pr, nx, cl; + var t = this, h = '', c, co, s = t.settings, i, pr, nx, cl; cl = t.controls; for (i=0; i')); - return dom.createHTML('table', {id : t.id, 'class' : 'mceToolbar' + (s['class'] ? ' ' + s['class'] : ''), cellpadding : '0', cellspacing : '0', align : t.settings.align || ''}, '' + h + ''); + return dom.createHTML('table', {id : t.id, 'class' : 'mceToolbar' + (s['class'] ? ' ' + s['class'] : ''), cellpadding : '0', cellspacing : '0', align : t.settings.align || '', role: 'presentation', tabindex: '-1'}, '' + h + ''); } }); +})(tinymce); diff --git a/js/tiny_mce/classes/ui/ToolbarGroup.js b/js/tiny_mce/classes/ui/ToolbarGroup.js new file mode 100644 index 0000000000..c96dbfa5f9 --- /dev/null +++ b/js/tiny_mce/classes/ui/ToolbarGroup.js @@ -0,0 +1,81 @@ +/** + * ToolbarGroup.js + * + * Copyright 2010, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function(tinymce) { +// Shorten class names +var dom = tinymce.DOM, each = tinymce.each, Event = tinymce.dom.Event; +/** + * This class is used to group a set of toolbars together and control the keyboard navigation and focus. + * + * @class tinymce.ui.ToolbarGroup + * @extends tinymce.ui.Container + */ +tinymce.create('tinymce.ui.ToolbarGroup:tinymce.ui.Container', { + /** + * Renders the toolbar group as a HTML string. + * + * @method renderHTML + * @return {String} HTML for the toolbar control. + */ + renderHTML : function() { + var t = this, h = [], controls = t.controls, each = tinymce.each, settings = t.settings; + + h.push('
    '); + //TODO: ACC test this out - adding a role = application for getting the landmarks working well. + h.push(""); + h.push(''); + each(controls, function(toolbar) { + h.push(toolbar.renderHTML()); + }); + h.push(""); + h.push('
    '); + + return h.join(''); + }, + + focus : function() { + var t = this; + dom.get(t.id).focus(); + }, + + postRender : function() { + var t = this, items = []; + + each(t.controls, function(toolbar) { + each (toolbar.controls, function(control) { + if (control.id) { + items.push(control); + } + }); + }); + + t.keyNav = new tinymce.ui.KeyboardNavigation({ + root: t.id, + items: items, + onCancel: function() { + //Move focus if webkit so that navigation back will read the item. + if (tinymce.isWebKit) { + dom.get(t.editor.id+"_ifr").focus(); + } + t.editor.focus(); + }, + excludeFromTabOrder: !t.settings.tab_focus_toolbar + }); + }, + + destroy : function() { + var self = this; + + self.parent(); + self.keyNav.destroy(); + Event.clear(self.id); + } +}); +})(tinymce); diff --git a/js/tiny_mce/classes/util/Cookie.js b/js/tiny_mce/classes/util/Cookie.js index 8209bd70a7..a390554a92 100644 --- a/js/tiny_mce/classes/util/Cookie.js +++ b/js/tiny_mce/classes/util/Cookie.js @@ -16,6 +16,15 @@ * * @class tinymce.util.Cookie * @static + * @example + * // Gets a cookie from the browser + * console.debug(tinymce.util.Cookie.get('mycookie')); + * + * // Gets a hash table cookie from the browser and takes out the x parameter from it + * console.debug(tinymce.util.Cookie.getHash('mycookie').x); + * + * // Sets a hash table cookie to the browser + * tinymce.util.Cookie.setHash({x : '1', y : '2'}); */ tinymce.create('static tinymce.util.Cookie', { /** diff --git a/js/tiny_mce/classes/util/Dispatcher.js b/js/tiny_mce/classes/util/Dispatcher.js index 86588a64d4..e97976db31 100644 --- a/js/tiny_mce/classes/util/Dispatcher.js +++ b/js/tiny_mce/classes/util/Dispatcher.js @@ -13,6 +13,12 @@ * All internal events inside TinyMCE uses this class. * * @class tinymce.util.Dispatcher + * @example + * // Creates a custom event + * this.onSomething = new tinymce.util.Dispatcher(this); + * + * // Dispatch/fire the event + * this.onSomething.dispatch('some string'); */ tinymce.create('tinymce.util.Dispatcher', { scope : null, diff --git a/js/tiny_mce/classes/util/JSON.js b/js/tiny_mce/classes/util/JSON.js index 0d271da868..5c69bc50b5 100644 --- a/js/tiny_mce/classes/util/JSON.js +++ b/js/tiny_mce/classes/util/JSON.js @@ -8,22 +8,11 @@ * Contributing: http://tinymce.moxiecode.com/contributing */ -/** - * JSON parser and serializer class. - * - * @class tinymce.util.JSON - * @static - */ -tinymce.create('static tinymce.util.JSON', { - /** - * Serializes the specified object as a JSON string. - * - * @method serialize - * @param {Object} o Object to serialize as a JSON string. - * @return {string} JSON string serialized from input. - */ - serialize : function(o) { - var i, v, s = tinymce.util.JSON.serialize, t; +(function() { + function serialize(o, quote) { + var i, v, t; + + quote = quote || '"'; if (o == null) return 'null'; @@ -33,7 +22,11 @@ tinymce.create('static tinymce.util.JSON', { if (t == 'string') { v = '\bb\tt\nn\ff\rr\""\'\'\\\\'; - return '"' + o.replace(/([\u0080-\uFFFF\x00-\x1f\"])/g, function(a, b) { + return quote + o.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g, function(a, b) { + // Make sure single quotes never get encoded inside double quotes for JSON compatibility + if (quote === '"' && a === "'") + return a; + i = v.indexOf(b); if (i + 1) @@ -42,42 +35,69 @@ tinymce.create('static tinymce.util.JSON', { a = b.charCodeAt().toString(16); return '\\u' + '0000'.substring(a.length) + a; - }) + '"'; + }) + quote; } if (t == 'object') { if (o.hasOwnProperty && o instanceof Array) { for (i=0, v = '['; i 0 ? ',' : '') + s(o[i]); + v += (i > 0 ? ',' : '') + serialize(o[i], quote); return v + ']'; } v = '{'; - for (i in o) - v += typeof o[i] != 'function' ? (v.length > 1 ? ',"' : '"') + i + '":' + s(o[i]) : ''; + for (i in o) { + if (o.hasOwnProperty(i)) { + v += typeof o[i] != 'function' ? (v.length > 1 ? ',' + quote : quote) + i + quote +':' + serialize(o[i], quote) : ''; + } + } return v + '}'; } return '' + o; - }, + }; /** - * Unserializes/parses the specified JSON string into a object. + * JSON parser and serializer class. * - * @method parse - * @param {string} s JSON String to parse into a JavaScript object. - * @return {Object} Object from input JSON string or undefined if it failed. + * @class tinymce.util.JSON + * @static + * @example + * // JSON parse a string into an object + * var obj = tinymce.util.JSON.parse(somestring); + * + * // JSON serialize a object into an string + * var str = tinymce.util.JSON.serialize(obj); */ - parse : function(s) { - try { - return eval('(' + s + ')'); - } catch (ex) { - // Ignore + tinymce.util.JSON = { + /** + * Serializes the specified object as a JSON string. + * + * @method serialize + * @param {Object} obj Object to serialize as a JSON string. + * @param {String} quote Optional quote string defaults to ". + * @return {string} JSON string serialized from input. + */ + serialize: serialize, + + /** + * Unserializes/parses the specified JSON string into a object. + * + * @method parse + * @param {string} s JSON String to parse into a JavaScript object. + * @return {Object} Object from input JSON string or undefined if it failed. + */ + parse: function(s) { + try { + return eval('(' + s + ')'); + } catch (ex) { + // Ignore + } } - } - /**#@-*/ -}); + /**#@-*/ + }; +})(); diff --git a/js/tiny_mce/classes/util/JSONRequest.js b/js/tiny_mce/classes/util/JSONRequest.js index 7e62b30500..9e502879ce 100644 --- a/js/tiny_mce/classes/util/JSONRequest.js +++ b/js/tiny_mce/classes/util/JSONRequest.js @@ -15,6 +15,28 @@ * This class enables you to use JSON-RPC to call backend methods. * * @class tinymce.util.JSONRequest + * @example + * var json = new tinymce.util.JSONRequest({ + * url : 'somebackend.php' + * }); + * + * // Send RPC call 1 + * json.send({ + * method : 'someMethod1', + * params : ['a', 'b'], + * success : function(result) { + * console.dir(result); + * } + * }); + * + * // Send RPC call 2 + * json.send({ + * method : 'someMethod2', + * params : ['a', 'b'], + * success : function(result) { + * console.dir(result); + * } + * }); */ tinymce.create('tinymce.util.JSONRequest', { /** @@ -57,7 +79,8 @@ }; o.error = function(ty, x) { - ecb.call(o.error_scope || o.scope, ty, x); + if (ecb) + ecb.call(o.error_scope || o.scope, ty, x); }; o.data = JSON.serialize({ diff --git a/js/tiny_mce/classes/util/Quirks.js b/js/tiny_mce/classes/util/Quirks.js new file mode 100644 index 0000000000..1194afd7c4 --- /dev/null +++ b/js/tiny_mce/classes/util/Quirks.js @@ -0,0 +1,229 @@ +(function(tinymce) { + var VK = tinymce.VK, BACKSPACE = VK.BACKSPACE, DELETE = VK.DELETE; + + /** + * Fixes a WebKit bug when deleting contents using backspace or delete key. + * WebKit will produce a span element if you delete across two block elements. + * + * Example: + *

    a

    |b

    + * + * Will produce this on backspace: + *

    ab

    + * + * This fixes the backspace to produce: + *

    a|b

    + * + * See bug: https://bugs.webkit.org/show_bug.cgi?id=45784 + * + * This code is a bit of a hack and hopefully it will be fixed soon in WebKit. + */ + function cleanupStylesWhenDeleting(ed) { + var dom = ed.dom, selection = ed.selection; + + ed.onKeyDown.add(function(ed, e) { + var rng, blockElm, node, clonedSpan, isDelete; + + isDelete = e.keyCode == DELETE; + if (isDelete || e.keyCode == BACKSPACE) { + e.preventDefault(); + rng = selection.getRng(); + + // Find root block + blockElm = dom.getParent(rng.startContainer, dom.isBlock); + + // On delete clone the root span of the next block element + if (isDelete) + blockElm = dom.getNext(blockElm, dom.isBlock); + + // Locate root span element and clone it since it would otherwise get merged by the "apple-style-span" on delete/backspace + if (blockElm) { + node = blockElm.firstChild; + + // Ignore empty text nodes + while (node && node.nodeType == 3 && node.nodeValue.length == 0) + node = node.nextSibling; + + if (node && node.nodeName === 'SPAN') { + clonedSpan = node.cloneNode(false); + } + } + + // Do the backspace/delete actiopn + ed.getDoc().execCommand(isDelete ? 'ForwardDelete' : 'Delete', false, null); + + // Find all odd apple-style-spans + blockElm = dom.getParent(rng.startContainer, dom.isBlock); + tinymce.each(dom.select('span.Apple-style-span,font.Apple-style-span', blockElm), function(span) { + var bm = selection.getBookmark(); + + if (clonedSpan) { + dom.replace(clonedSpan.cloneNode(false), span, true); + } else { + dom.remove(span, true); + } + + // Restore the selection + selection.moveToBookmark(bm); + }); + } + }); + }; + + /** + * WebKit and IE doesn't empty the editor if you select all contents and hit backspace or delete. This fix will check if the body is empty + * like a

    or

    and then forcefully remove all contents. + */ + function emptyEditorWhenDeleting(ed) { + ed.onKeyUp.add(function(ed, e) { + var keyCode = e.keyCode; + + if (keyCode == DELETE || keyCode == BACKSPACE) { + if (ed.dom.isEmpty(ed.getBody())) { + ed.setContent('', {format : 'raw'}); + ed.nodeChanged(); + return; + } + } + }); + }; + + /** + * WebKit on MacOS X has a weird issue where it some times fails to properly convert keypresses to input method keystrokes. + * So a fix where we just get the range and set the range back seems to do the trick. + */ + function inputMethodFocus(ed) { + ed.dom.bind(ed.getDoc(), 'focusin', function() { + ed.selection.setRng(ed.selection.getRng()); + }); + }; + + /** + * Backspacing in FireFox/IE from a paragraph into a horizontal rule results in a floating text node because the + * browser just deletes the paragraph - the browser fails to merge the text node with a horizontal rule so it is + * left there. TinyMCE sees a floating text node and wraps it in a paragraph on the key up event (ForceBlocks.js + * addRootBlocks), meaning the action does nothing. With this code, FireFox/IE matche the behaviour of other + * browsers + */ + function removeHrOnBackspace(ed) { + ed.onKeyDown.add(function(ed, e) { + if (e.keyCode === BACKSPACE) { + if (ed.selection.isCollapsed() && ed.selection.getRng(true).startOffset === 0) { + var node = ed.selection.getNode(); + var previousSibling = node.previousSibling; + if (previousSibling && previousSibling.nodeName && previousSibling.nodeName.toLowerCase() === "hr") { + ed.dom.remove(previousSibling); + tinymce.dom.Event.cancel(e); + } + } + } + }) + } + + /** + * Firefox 3.x has an issue where the body element won't get proper focus if you click out + * side it's rectangle. + */ + function focusBody(ed) { + // Fix for a focus bug in FF 3.x where the body element + // wouldn't get proper focus if the user clicked on the HTML element + if (!Range.prototype.getClientRects) { // Detect getClientRects got introduced in FF 4 + ed.onMouseDown.add(function(ed, e) { + if (e.target.nodeName === "HTML") { + var body = ed.getBody(); + + // Blur the body it's focused but not correctly focused + body.blur(); + + // Refocus the body after a little while + setTimeout(function() { + body.focus(); + }, 0); + } + }); + } + }; + + /** + * WebKit has a bug where it isn't possible to select image, hr or anchor elements + * by clicking on them so we need to fake that. + */ + function selectControlElements(ed) { + ed.onClick.add(function(ed, e) { + e = e.target; + + // Workaround for bug, http://bugs.webkit.org/show_bug.cgi?id=12250 + // WebKit can't even do simple things like selecting an image + // Needs tobe the setBaseAndExtend or it will fail to select floated images + if (/^(IMG|HR)$/.test(e.nodeName)) + ed.selection.getSel().setBaseAndExtent(e, 0, e, 1); + + if (e.nodeName == 'A' && ed.dom.hasClass(e, 'mceItemAnchor')) + ed.selection.select(e); + + ed.nodeChanged(); + }); + }; + + /** + * Fire a nodeChanged when the selection is changed on WebKit this fixes selection issues on iOS5. It only fires the nodeChange + * event every 50ms since it would other wise update the UI when you type and it hogs the CPU. + */ + function selectionChangeNodeChanged(ed) { + var lastRng, selectionTimer; + + ed.dom.bind(ed.getDoc(), 'selectionchange', function() { + if (selectionTimer) { + clearTimeout(selectionTimer); + selectionTimer = 0; + } + + selectionTimer = window.setTimeout(function() { + var rng = ed.selection.getRng(); + + // Compare the ranges to see if it was a real change or not + if (!lastRng || !tinymce.dom.RangeUtils.compareRanges(rng, lastRng)) { + ed.nodeChanged(); + lastRng = rng; + } + }, 50); + }); + } + + /** + * Screen readers on IE needs to have the role application set on the body. + */ + function ensureBodyHasRoleApplication(ed) { + document.body.setAttribute("role", "application"); + } + + tinymce.create('tinymce.util.Quirks', { + Quirks: function(ed) { + // WebKit + if (tinymce.isWebKit) { + cleanupStylesWhenDeleting(ed); + emptyEditorWhenDeleting(ed); + inputMethodFocus(ed); + selectControlElements(ed); + + // iOS + if (tinymce.isIDevice) { + selectionChangeNodeChanged(ed); + } + } + + // IE + if (tinymce.isIE) { + removeHrOnBackspace(ed); + emptyEditorWhenDeleting(ed); + ensureBodyHasRoleApplication(ed); + } + + // Gecko + if (tinymce.isGecko) { + removeHrOnBackspace(ed); + focusBody(ed); + } + } + }); +})(tinymce); diff --git a/js/tiny_mce/classes/util/URI.js b/js/tiny_mce/classes/util/URI.js index 7af644832c..e8cb3f9f75 100644 --- a/js/tiny_mce/classes/util/URI.js +++ b/js/tiny_mce/classes/util/URI.js @@ -25,7 +25,7 @@ * @param {Object} s Optional settings object. */ URI : function(u, s) { - var t = this, o, a, b; + var t = this, o, a, b, base_url; // Trim whitespace u = tinymce.trim(u); @@ -33,8 +33,9 @@ // Default settings s = t.settings = s || {}; - // Strange app protocol or local anchor - if (/^(mailto|tel|news|javascript|about|data):/i.test(u) || /^\s*#/.test(u)) { + // Strange app protocol that isn't http/https or local anchor + // For example: mailto,skype,tel etc. + if (/^([\w\-]+):([^\/]{2})/i.test(u) || /^\s*#/.test(u)) { t.source = u; return; } @@ -44,8 +45,10 @@ u = (s.base_uri ? s.base_uri.protocol || 'http' : 'http') + '://mce_host' + u; // Relative path http:// or protocol relative //path - if (!/^\w*:?\/\//.test(u)) - u = (s.base_uri.protocol || 'http') + '://mce_host' + t.toAbsPath(s.base_uri.path, u); + if (!/^[\w-]*:?\/\//.test(u)) { + base_url = s.base_uri ? s.base_uri.path : new tinymce.util.URI(location.href).directory; + u = ((s.base_uri && s.base_uri.protocol) || 'http') + '://mce_host' + t.toAbsPath(base_url, u); + } // Parse URL (Credits goes to Steave, http://blog.stevenlevithan.com/archives/parseuri) u = u.replace(/@@/g, '(mce_at)'); // Zope 3 workaround, they use @@something @@ -106,6 +109,9 @@ * @method toRelative * @param {String} u URI to convert into a relative path/URI. * @return {String} Relative URI from the point specified in the current URI instance. + * @example + * // Converts an absolute URL to an relative URL url will be somedir/somefile.htm + * var url = new tinymce.util.URI('http://www.site.com/dir/').toRelative('http://www.site.com/dir/somedir/somefile.htm'); */ toRelative : function(u) { var t = this, o; @@ -139,6 +145,9 @@ * @param {String} u URI to convert into a relative path/URI. * @param {Boolean} nh No host and protocol prefix. * @return {String} Absolute URI from the point specified in the current URI instance. + * @example + * // Converts an relative URL to an absolute URL url will be http://www.site.com/dir/somedir/somefile.htm + * var url = new tinymce.util.URI('http://www.site.com/dir/').toAbsolute('somedir/somefile.htm'); */ toAbsolute : function(u, nh) { var u = new tinymce.util.URI(u, {base_uri : this}); diff --git a/js/tiny_mce/classes/util/VK.js b/js/tiny_mce/classes/util/VK.js new file mode 100644 index 0000000000..08bc8fc29e --- /dev/null +++ b/js/tiny_mce/classes/util/VK.js @@ -0,0 +1,15 @@ +/** + * This file exposes a set of the common KeyCodes for use. Please grow it as needed. + */ + +(function(tinymce){ + tinymce.VK = { + DELETE: 46, + BACKSPACE: 8, + ENTER: 13, + TAB: 9, + SPACEBAR: 32, + UP: 38, + DOWN: 40 + } +})(tinymce); diff --git a/js/tiny_mce/classes/util/XHR.js b/js/tiny_mce/classes/util/XHR.js index a444c13643..cbbdd38149 100644 --- a/js/tiny_mce/classes/util/XHR.js +++ b/js/tiny_mce/classes/util/XHR.js @@ -12,6 +12,14 @@ * This class enables you to send XMLHTTPRequests cross browser. * @class tinymce.util.XHR * @static + * @example + * // Sends a low level Ajax request + * tinymce.util.XHR.send({ + * url : 'someurl', + * success : function(text) { + * console.debug(text); + * } + * }); */ tinymce.create('static tinymce.util.XHR', { /** diff --git a/js/tiny_mce/jquery.tinymce.js b/js/tiny_mce/jquery.tinymce.js index 4866c2a06b..8e61a3cddb 100644 --- a/js/tiny_mce/jquery.tinymce.js +++ b/js/tiny_mce/jquery.tinymce.js @@ -1 +1 @@ -(function(b){var e,d,a=[],c=window;b.fn.tinymce=function(j){var p=this,g,k,h,m,i,l="",n="";if(!p.length){return p}if(!j){return tinyMCE.get(p[0].id)}function o(){var r=[],q=0;if(f){f();f=null}p.each(function(t,u){var s,w=u.id,v=j.oninit;if(!w){u.id=w=tinymce.DOM.uniqueId()}s=new tinymce.Editor(w,j);r.push(s);if(v){s.onInit.add(function(){var x,y=v;if(++q==r.length){if(tinymce.is(y,"string")){x=(y.indexOf(".")===-1)?null:tinymce.resolve(y.replace(/\.\w+$/,""));y=tinymce.resolve(y)}y.apply(x||tinymce,r)}})}});b.each(r,function(t,s){s.render()})}if(!c.tinymce&&!d&&(g=j.script_url)){d=1;h=g.substring(0,g.lastIndexOf("/"));if(/_(src|dev)\.js/g.test(g)){n="_src"}m=g.lastIndexOf("?");if(m!=-1){l=g.substring(m+1)}c.tinyMCEPreInit=c.tinyMCEPreInit||{base:h,suffix:n,query:l};if(g.indexOf("gzip")!=-1){i=j.language||"en";g=g+(/\?/.test(g)?"&":"?")+"js=true&core=true&suffix="+escape(n)+"&themes="+escape(j.theme)+"&plugins="+escape(j.plugins)+"&languages="+i;if(!c.tinyMCE_GZ){tinyMCE_GZ={start:function(){tinymce.suffix=n;function q(r){tinymce.ScriptLoader.markDone(tinyMCE.baseURI.toAbsolute(r))}q("langs/"+i+".js");q("themes/"+j.theme+"/editor_template"+n+".js");q("themes/"+j.theme+"/langs/"+i+".js");b.each(j.plugins.split(","),function(s,r){if(r){q("plugins/"+r+"/editor_plugin"+n+".js");q("plugins/"+r+"/langs/"+i+".js")}})},end:function(){}}}}b.ajax({type:"GET",url:g,dataType:"script",cache:true,success:function(){tinymce.dom.Event.domLoaded=1;d=2;if(j.script_loaded){j.script_loaded()}o();b.each(a,function(q,r){r()})}})}else{if(d===1){a.push(o)}else{o()}}return p};b.extend(b.expr[":"],{tinymce:function(g){return g.id&&!!tinyMCE.get(g.id)}});function f(){function i(l){if(l==="remove"){this.each(function(n,o){var m=h(o);if(m){m.remove()}})}this.find("span.mceEditor,div.mceEditor").each(function(n,o){var m=tinyMCE.get(o.id.replace(/_parent$/,""));if(m){m.remove()}})}function k(n){var m=this,l;if(n!==e){i.call(m);m.each(function(p,q){var o;if(o=tinyMCE.get(q.id)){o.setContent(n)}})}else{if(m.length>0){if(l=tinyMCE.get(m[0].id)){return l.getContent()}}}}function h(m){var l=null;(m)&&(m.id)&&(c.tinymce)&&(l=tinyMCE.get(m.id));return l}function g(l){return !!((l)&&(l.length)&&(c.tinymce)&&(l.is(":tinymce")))}var j={};b.each(["text","html","val"],function(n,l){var o=j[l]=b.fn[l],m=(l==="text");b.fn[l]=function(s){var p=this;if(!g(p)){return o.apply(p,arguments)}if(s!==e){k.call(p.filter(":tinymce"),s);o.apply(p.not(":tinymce"),arguments);return p}else{var r="";var q=arguments;(m?p:p.eq(0)).each(function(u,v){var t=h(v);r+=t?(m?t.getContent().replace(/<(?:"[^"]*"|'[^']*'|[^'">])*>/g,""):t.getContent()):o.apply(b(v),q)});return r}}});b.each(["append","prepend"],function(n,m){var o=j[m]=b.fn[m],l=(m==="prepend");b.fn[m]=function(q){var p=this;if(!g(p)){return o.apply(p,arguments)}if(q!==e){p.filter(":tinymce").each(function(s,t){var r=h(t);r&&r.setContent(l?q+r.getContent():r.getContent()+q)});o.apply(p.not(":tinymce"),arguments);return p}}});b.each(["remove","replaceWith","replaceAll","empty"],function(m,l){var n=j[l]=b.fn[l];b.fn[l]=function(){i.call(this,l);return n.apply(this,arguments)}});j.attr=b.fn.attr;b.fn.attr=function(n,q,o){var m=this;if((!n)||(n!=="value")||(!g(m))){return j.attr.call(m,n,q,o)}if(q!==e){k.call(m.filter(":tinymce"),q);j.attr.call(m.not(":tinymce"),n,q,o);return m}else{var p=m[0],l=h(p);return l?l.getContent():j.attr.call(b(p),n,q,o)}}}})(jQuery); \ No newline at end of file +(function(b){var e,d,a=[],c=window;b.fn.tinymce=function(j){var p=this,g,k,h,m,i,l="",n="";if(!p.length){return p}if(!j){return tinyMCE.get(p[0].id)}p.css("visibility","hidden");function o(){var r=[],q=0;if(f){f();f=null}p.each(function(t,u){var s,w=u.id,v=j.oninit;if(!w){u.id=w=tinymce.DOM.uniqueId()}s=new tinymce.Editor(w,j);r.push(s);s.onInit.add(function(){var x,y=v;p.css("visibility","");if(v){if(++q==r.length){if(tinymce.is(y,"string")){x=(y.indexOf(".")===-1)?null:tinymce.resolve(y.replace(/\.\w+$/,""));y=tinymce.resolve(y)}y.apply(x||tinymce,r)}}})});b.each(r,function(t,s){s.render()})}if(!c.tinymce&&!d&&(g=j.script_url)){d=1;h=g.substring(0,g.lastIndexOf("/"));if(/_(src|dev)\.js/g.test(g)){n="_src"}m=g.lastIndexOf("?");if(m!=-1){l=g.substring(m+1)}c.tinyMCEPreInit=c.tinyMCEPreInit||{base:h,suffix:n,query:l};if(g.indexOf("gzip")!=-1){i=j.language||"en";g=g+(/\?/.test(g)?"&":"?")+"js=true&core=true&suffix="+escape(n)+"&themes="+escape(j.theme)+"&plugins="+escape(j.plugins)+"&languages="+i;if(!c.tinyMCE_GZ){tinyMCE_GZ={start:function(){tinymce.suffix=n;function q(r){tinymce.ScriptLoader.markDone(tinyMCE.baseURI.toAbsolute(r))}q("langs/"+i+".js");q("themes/"+j.theme+"/editor_template"+n+".js");q("themes/"+j.theme+"/langs/"+i+".js");b.each(j.plugins.split(","),function(s,r){if(r){q("plugins/"+r+"/editor_plugin"+n+".js");q("plugins/"+r+"/langs/"+i+".js")}})},end:function(){}}}}b.ajax({type:"GET",url:g,dataType:"script",cache:true,success:function(){tinymce.dom.Event.domLoaded=1;d=2;if(j.script_loaded){j.script_loaded()}o();b.each(a,function(q,r){r()})}})}else{if(d===1){a.push(o)}else{o()}}return p};b.extend(b.expr[":"],{tinymce:function(g){return g.id&&!!tinyMCE.get(g.id)}});function f(){function i(l){if(l==="remove"){this.each(function(n,o){var m=h(o);if(m){m.remove()}})}this.find("span.mceEditor,div.mceEditor").each(function(n,o){var m=tinyMCE.get(o.id.replace(/_parent$/,""));if(m){m.remove()}})}function k(n){var m=this,l;if(n!==e){i.call(m);m.each(function(p,q){var o;if(o=tinyMCE.get(q.id)){o.setContent(n)}})}else{if(m.length>0){if(l=tinyMCE.get(m[0].id)){return l.getContent()}}}}function h(m){var l=null;(m)&&(m.id)&&(c.tinymce)&&(l=tinyMCE.get(m.id));return l}function g(l){return !!((l)&&(l.length)&&(c.tinymce)&&(l.is(":tinymce")))}var j={};b.each(["text","html","val"],function(n,l){var o=j[l]=b.fn[l],m=(l==="text");b.fn[l]=function(s){var p=this;if(!g(p)){return o.apply(p,arguments)}if(s!==e){k.call(p.filter(":tinymce"),s);o.apply(p.not(":tinymce"),arguments);return p}else{var r="";var q=arguments;(m?p:p.eq(0)).each(function(u,v){var t=h(v);r+=t?(m?t.getContent().replace(/<(?:"[^"]*"|'[^']*'|[^'">])*>/g,""):t.getContent()):o.apply(b(v),q)});return r}}});b.each(["append","prepend"],function(n,m){var o=j[m]=b.fn[m],l=(m==="prepend");b.fn[m]=function(q){var p=this;if(!g(p)){return o.apply(p,arguments)}if(q!==e){p.filter(":tinymce").each(function(s,t){var r=h(t);r&&r.setContent(l?q+r.getContent():r.getContent()+q)});o.apply(p.not(":tinymce"),arguments);return p}}});b.each(["remove","replaceWith","replaceAll","empty"],function(m,l){var n=j[l]=b.fn[l];b.fn[l]=function(){i.call(this,l);return n.apply(this,arguments)}});j.attr=b.fn.attr;b.fn.attr=function(n,q,o){var m=this;if((!n)||(n!=="value")||(!g(m))){return j.attr.call(m,n,q,o)}if(q!==e){k.call(m.filter(":tinymce"),q);j.attr.call(m.not(":tinymce"),n,q,o);return m}else{var p=m[0],l=h(p);return l?l.getContent():j.attr.call(b(p),n,q,o)}}}})(jQuery); \ No newline at end of file diff --git a/js/tiny_mce/langs/en.js b/js/tiny_mce/langs/en.js index ea4a1b0e14..6379b0d958 100644 --- a/js/tiny_mce/langs/en.js +++ b/js/tiny_mce/langs/en.js @@ -1,170 +1 @@ -tinyMCE.addI18n({en:{ -common:{ -edit_confirm:"Do you want to use the WYSIWYG mode for this textarea?", -apply:"Apply", -insert:"Insert", -update:"Update", -cancel:"Cancel", -close:"Close", -browse:"Browse", -class_name:"Class", -not_set:"-- Not set --", -clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?", -clipboard_no_support:"Currently not supported by your browser, use keyboard shortcuts instead.", -popup_blocked:"Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.", -invalid_data:"Error: Invalid values entered, these are marked in red.", -more_colors:"More colors" -}, -contextmenu:{ -align:"Alignment", -left:"Left", -center:"Center", -right:"Right", -full:"Full" -}, -insertdatetime:{ -date_fmt:"%Y-%m-%d", -time_fmt:"%H:%M:%S", -insertdate_desc:"Insert date", -inserttime_desc:"Insert time", -months_long:"January,February,March,April,May,June,July,August,September,October,November,December", -months_short:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec", -day_long:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday", -day_short:"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun" -}, -print:{ -print_desc:"Print" -}, -preview:{ -preview_desc:"Preview" -}, -directionality:{ -ltr_desc:"Direction left to right", -rtl_desc:"Direction right to left" -}, -layer:{ -insertlayer_desc:"Insert new layer", -forward_desc:"Move forward", -backward_desc:"Move backward", -absolute_desc:"Toggle absolute positioning", -content:"New layer..." -}, -save:{ -save_desc:"Save", -cancel_desc:"Cancel all changes" -}, -nonbreaking:{ -nonbreaking_desc:"Insert non-breaking space character" -}, -iespell:{ -iespell_desc:"Run spell checking", -download:"ieSpell not detected. Do you want to install it now?" -}, -advhr:{ -advhr_desc:"Horizontal rule" -}, -emotions:{ -emotions_desc:"Emotions" -}, -searchreplace:{ -search_desc:"Find", -replace_desc:"Find/Replace" -}, -advimage:{ -image_desc:"Insert/edit image" -}, -advlink:{ -link_desc:"Insert/edit link" -}, -xhtmlxtras:{ -cite_desc:"Citation", -abbr_desc:"Abbreviation", -acronym_desc:"Acronym", -del_desc:"Deletion", -ins_desc:"Insertion", -attribs_desc:"Insert/Edit Attributes" -}, -style:{ -desc:"Edit CSS Style" -}, -paste:{ -paste_text_desc:"Paste as Plain Text", -paste_word_desc:"Paste from Word", -selectall_desc:"Select All", -plaintext_mode_sticky:"Paste is now in plain text mode. Click again to toggle back to regular paste mode. After you paste something you will be returned to regular paste mode.", -plaintext_mode:"Paste is now in plain text mode. Click again to toggle back to regular paste mode." -}, -paste_dlg:{ -text_title:"Use CTRL+V on your keyboard to paste the text into the window.", -text_linebreaks:"Keep linebreaks", -word_title:"Use CTRL+V on your keyboard to paste the text into the window." -}, -table:{ -desc:"Inserts a new table", -row_before_desc:"Insert row before", -row_after_desc:"Insert row after", -delete_row_desc:"Delete row", -col_before_desc:"Insert column before", -col_after_desc:"Insert column after", -delete_col_desc:"Remove column", -split_cells_desc:"Split merged table cells", -merge_cells_desc:"Merge table cells", -row_desc:"Table row properties", -cell_desc:"Table cell properties", -props_desc:"Table properties", -paste_row_before_desc:"Paste table row before", -paste_row_after_desc:"Paste table row after", -cut_row_desc:"Cut table row", -copy_row_desc:"Copy table row", -del:"Delete table", -row:"Row", -col:"Column", -cell:"Cell" -}, -autosave:{ -unload_msg:"The changes you made will be lost if you navigate away from this page.", -restore_content:"Restore auto-saved content.", -warning_message:"If you restore the saved content, you will lose all the content that is currently in the editor.\n\nAre you sure you want to restore the saved content?." -}, -fullscreen:{ -desc:"Toggle fullscreen mode" -}, -media:{ -desc:"Insert / edit embedded media", -edit:"Edit embedded media" -}, -fullpage:{ -desc:"Document properties" -}, -template:{ -desc:"Insert predefined template content" -}, -visualchars:{ -desc:"Visual control characters on/off." -}, -spellchecker:{ -desc:"Toggle spellchecker", -menu:"Spellchecker settings", -ignore_word:"Ignore word", -ignore_words:"Ignore all", -langs:"Languages", -wait:"Please wait...", -sug:"Suggestions", -no_sug:"No suggestions", -no_mpell:"No misspellings found." -}, -pagebreak:{ -desc:"Insert page break." -}, -advlist:{ -types:"Types", -def:"Default", -lower_alpha:"Lower alpha", -lower_greek:"Lower greek", -lower_roman:"Lower roman", -upper_alpha:"Upper alpha", -upper_roman:"Upper roman", -circle:"Circle", -disc:"Disc", -square:"Square" -}}}); \ No newline at end of file +tinyMCE.addI18n({en:{common:{"more_colors":"More Colors...","invalid_data":"Error: Invalid values entered, these are marked in red.","popup_blocked":"Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.","clipboard_no_support":"Currently not supported by your browser, use keyboard shortcuts instead.","clipboard_msg":"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?","not_set":"-- Not Set --","class_name":"Class",browse:"Browse",close:"Close",cancel:"Cancel",update:"Update",insert:"Insert",apply:"Apply","edit_confirm":"Do you want to use the WYSIWYG mode for this textarea?","invalid_data_number":"{#field} must be a number","invalid_data_min":"{#field} must be a number greater than {#min}","invalid_data_size":"{#field} must be a number or percentage",value:"(value)"},contextmenu:{full:"Full",right:"Right",center:"Center",left:"Left",align:"Alignment"},insertdatetime:{"day_short":"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun","day_long":"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday","months_short":"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec","months_long":"January,February,March,April,May,June,July,August,September,October,November,December","inserttime_desc":"Insert Time","insertdate_desc":"Insert Date","time_fmt":"%H:%M:%S","date_fmt":"%Y-%m-%d"},print:{"print_desc":"Print"},preview:{"preview_desc":"Preview"},directionality:{"rtl_desc":"Direction Right to Left","ltr_desc":"Direction Left to Right"},layer:{content:"New layer...","absolute_desc":"Toggle Absolute Positioning","backward_desc":"Move Backward","forward_desc":"Move Forward","insertlayer_desc":"Insert New Layer"},save:{"save_desc":"Save","cancel_desc":"Cancel All Changes"},nonbreaking:{"nonbreaking_desc":"Insert Non-Breaking Space Character"},iespell:{download:"ieSpell not detected. Do you want to install it now?","iespell_desc":"Check Spelling"},advhr:{"delta_height":"","delta_width":"","advhr_desc":"Insert Horizontal Line"},emotions:{"delta_height":"","delta_width":"","emotions_desc":"Emotions"},searchreplace:{"replace_desc":"Find/Replace","delta_width":"","delta_height":"","search_desc":"Find"},advimage:{"delta_width":"","image_desc":"Insert/Edit Image","delta_height":""},advlink:{"delta_height":"","delta_width":"","link_desc":"Insert/Edit Link"},xhtmlxtras:{"attribs_delta_height":"","attribs_delta_width":"","ins_delta_height":"","ins_delta_width":"","del_delta_height":"","del_delta_width":"","acronym_delta_height":"","acronym_delta_width":"","abbr_delta_height":"","abbr_delta_width":"","cite_delta_height":"","cite_delta_width":"","attribs_desc":"Insert/Edit Attributes","ins_desc":"Insertion","del_desc":"Deletion","acronym_desc":"Acronym","abbr_desc":"Abbreviation","cite_desc":"Citation"},style:{"delta_height":"","delta_width":"",desc:"Edit CSS Style"},paste:{"plaintext_mode_stick":"Paste is now in plain text mode. Click again to toggle back to regular paste mode.","plaintext_mode":"Paste is now in plain text mode. Click again to toggle back to regular paste mode. After you paste something you will be returned to regular paste mode.","selectall_desc":"Select All","paste_word_desc":"Paste from Word","paste_text_desc":"Paste as Plain Text"},"paste_dlg":{"word_title":"Use Ctrl+V on your keyboard to paste the text into the window.","text_linebreaks":"Keep Linebreaks","text_title":"Use Ctrl+V on your keyboard to paste the text into the window."},table:{"merge_cells_delta_height":"","merge_cells_delta_width":"","table_delta_height":"","table_delta_width":"","cellprops_delta_height":"","cellprops_delta_width":"","rowprops_delta_height":"","rowprops_delta_width":"",cell:"Cell",col:"Column",row:"Row",del:"Delete Table","copy_row_desc":"Copy Table Row","cut_row_desc":"Cut Table Row","paste_row_after_desc":"Paste Table Row After","paste_row_before_desc":"Paste Table Row Before","props_desc":"Table Properties","cell_desc":"Table Cell Properties","row_desc":"Table Row Properties","merge_cells_desc":"Merge Table Cells","split_cells_desc":"Split Merged Table Cells","delete_col_desc":"Delete Column","col_after_desc":"Insert Column After","col_before_desc":"Insert Column Before","delete_row_desc":"Delete Row","row_after_desc":"Insert Row After","row_before_desc":"Insert Row Before",desc:"Insert/Edit Table"},autosave:{"warning_message":"If you restore the saved content, you will lose all the content that is currently in the editor.\n\nAre you sure you want to restore the saved content?","restore_content":"Restore auto-saved content.","unload_msg":"The changes you made will be lost if you navigate away from this page."},fullscreen:{desc:"Toggle Full Screen Mode"},media:{"delta_height":"","delta_width":"",edit:"Edit Embedded Media",desc:"Insert/Edit Embedded Media"},fullpage:{desc:"Document Properties","delta_width":"","delta_height":""},template:{desc:"Insert Predefined Template Content"},visualchars:{desc:"Show/Hide Visual Control Characters"},spellchecker:{desc:"Toggle Spell Checker",menu:"Spell Checker Settings","ignore_word":"Ignore Word","ignore_words":"Ignore All",langs:"Languages",wait:"Please wait...",sug:"Suggestions","no_sug":"No Suggestions","no_mpell":"No misspellings found.","learn_word":"Learn word"},pagebreak:{desc:"Insert Page Break for Printing"},advlist:{types:"Types",def:"Default","lower_alpha":"Lower Alpha","lower_greek":"Lower Greek","lower_roman":"Lower Roman","upper_alpha":"Upper Alpha","upper_roman":"Upper Roman",circle:"Circle",disc:"Disc",square:"Square"},colors:{"333300":"Dark olive","993300":"Burnt orange","000000":"Black","003300":"Dark green","003366":"Dark azure","000080":"Navy Blue","333399":"Indigo","333333":"Very dark gray","800000":"Maroon",FF6600:"Orange","808000":"Olive","008000":"Green","008080":"Teal","0000FF":"Blue","666699":"Grayish blue","808080":"Gray",FF0000:"Red",FF9900:"Amber","99CC00":"Yellow green","339966":"Sea green","33CCCC":"Turquoise","3366FF":"Royal blue","800080":"Purple","999999":"Medium gray",FF00FF:"Magenta",FFCC00:"Gold",FFFF00:"Yellow","00FF00":"Lime","00FFFF":"Aqua","00CCFF":"Sky blue","993366":"Brown",C0C0C0:"Silver",FF99CC:"Pink",FFCC99:"Peach",FFFF99:"Light yellow",CCFFCC:"Pale green",CCFFFF:"Pale cyan","99CCFF":"Light sky blue",CC99FF:"Plum",FFFFFF:"White"},aria:{"rich_text_area":"Rich Text Area"},wordcount:{words:"Words:"}}}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advhr/langs/en_dlg.js b/js/tiny_mce/plugins/advhr/langs/en_dlg.js index 873bfd8d38..0c3bf15e6f 100644 --- a/js/tiny_mce/plugins/advhr/langs/en_dlg.js +++ b/js/tiny_mce/plugins/advhr/langs/en_dlg.js @@ -1,5 +1 @@ -tinyMCE.addI18n('en.advhr_dlg',{ -width:"Width", -size:"Height", -noshade:"No shadow" -}); \ No newline at end of file +tinyMCE.addI18n('en.advhr_dlg',{size:"Height",noshade:"No Shadow",width:"Width",normal:"Normal",widthunits:"Units"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advhr/rule.htm b/js/tiny_mce/plugins/advhr/rule.htm index fc37b2aecd..843e1f8f0b 100644 --- a/js/tiny_mce/plugins/advhr/rule.htm +++ b/js/tiny_mce/plugins/advhr/rule.htm @@ -8,43 +8,44 @@ - +
    - - - - - - - - - - - - - -
    - - -
    + + + + + + + + + + + + + +
    + + + +
    diff --git a/js/tiny_mce/plugins/advimage/editor_plugin.js b/js/tiny_mce/plugins/advimage/editor_plugin.js index 4c7a9c3a88..d613a61393 100644 --- a/js/tiny_mce/plugins/advimage/editor_plugin.js +++ b/js/tiny_mce/plugins/advimage/editor_plugin.js @@ -1 +1 @@ -(function(){tinymce.create("tinymce.plugins.AdvancedImagePlugin",{init:function(a,b){a.addCommand("mceAdvImage",function(){if(a.dom.getAttrib(a.selection.getNode(),"class").indexOf("mceItem")!=-1){return}a.windowManager.open({file:b+"/image.htm",width:480+parseInt(a.getLang("advimage.delta_width",0)),height:385+parseInt(a.getLang("advimage.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("image",{title:"advimage.image_desc",cmd:"mceAdvImage"})},getInfo:function(){return{longname:"Advanced image",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advimage",tinymce.plugins.AdvancedImagePlugin)})(); \ No newline at end of file +(function(){tinymce.create("tinymce.plugins.AdvancedImagePlugin",{init:function(a,b){a.addCommand("mceAdvImage",function(){if(a.dom.getAttrib(a.selection.getNode(),"class","").indexOf("mceItem")!=-1){return}a.windowManager.open({file:b+"/image.htm",width:480+parseInt(a.getLang("advimage.delta_width",0)),height:385+parseInt(a.getLang("advimage.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("image",{title:"advimage.image_desc",cmd:"mceAdvImage"})},getInfo:function(){return{longname:"Advanced image",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advimage",tinymce.plugins.AdvancedImagePlugin)})(); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/editor_plugin_src.js b/js/tiny_mce/plugins/advimage/editor_plugin_src.js index 2625dd2131..d2678cbcf2 100644 --- a/js/tiny_mce/plugins/advimage/editor_plugin_src.js +++ b/js/tiny_mce/plugins/advimage/editor_plugin_src.js @@ -14,7 +14,7 @@ // Register commands ed.addCommand('mceAdvImage', function() { // Internal image object like a flash placeholder - if (ed.dom.getAttrib(ed.selection.getNode(), 'class').indexOf('mceItem') != -1) + if (ed.dom.getAttrib(ed.selection.getNode(), 'class', '').indexOf('mceItem') != -1) return; ed.windowManager.open({ diff --git a/js/tiny_mce/plugins/advimage/image.htm b/js/tiny_mce/plugins/advimage/image.htm index 79cff3f19f..ed16b3d4a9 100644 --- a/js/tiny_mce/plugins/advimage/image.htm +++ b/js/tiny_mce/plugins/advimage/image.htm @@ -10,13 +10,14 @@ - - + + + @@ -25,15 +26,15 @@
    {#advimage_dlg.general} - +
    - @@ -60,7 +61,7 @@
    {#advimage_dlg.tab_appearance} -
    +
    - + - - - -
    - x - px + + x + + px
      + - + @@ -109,7 +108,7 @@ @@ -118,7 +117,7 @@ @@ -129,7 +128,7 @@ - -
    @@ -142,18 +145,18 @@
    {#advimage_dlg.swap_image} - + -
    +
    - @@ -161,12 +164,12 @@ - @@ -178,7 +181,7 @@
    {#advimage_dlg.misc} -
    + +
    - - + + -
      
    + +
    - - + + -
      
    +
    @@ -211,12 +214,12 @@ -
    + +
    - - + + -
      
    @@ -227,6 +230,6 @@ - + diff --git a/js/tiny_mce/plugins/advimage/js/image.js b/js/tiny_mce/plugins/advimage/js/image.js index 3bda86a2d3..546b69c0de 100644 --- a/js/tiny_mce/plugins/advimage/js/image.js +++ b/js/tiny_mce/plugins/advimage/js/image.js @@ -9,13 +9,13 @@ var ImageDialog = { }, init : function(ed) { - var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, dom = ed.dom, n = ed.selection.getNode(); + var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, dom = ed.dom, n = ed.selection.getNode(), fl = tinyMCEPopup.getParam('external_image_list', 'tinyMCEImageList'); tinyMCEPopup.resizeToInnerSize(); this.fillClassList('class_list'); - this.fillFileList('src_list', 'tinyMCEImageList'); - this.fillFileList('over_list', 'tinyMCEImageList'); - this.fillFileList('out_list', 'tinyMCEImageList'); + this.fillFileList('src_list', fl); + this.fillFileList('over_list', fl); + this.fillFileList('out_list', fl); TinyMCE_EditableSelects.init(); if (n.nodeName == 'IMG') { @@ -142,7 +142,7 @@ var ImageDialog = { } tinymce.extend(args, { - src : nl.src.value, + src : nl.src.value.replace(/ /g, '%20'), width : nl.width.value, height : nl.height.value, alt : nl.alt.value, @@ -171,12 +171,18 @@ var ImageDialog = { if (el && el.nodeName == 'IMG') { ed.dom.setAttribs(el, args); } else { - ed.execCommand('mceInsertContent', false, '', {skip_undo : 1}); - ed.dom.setAttribs('__mce_tmp', args); - ed.dom.setAttrib('__mce_tmp', 'id', ''); + tinymce.each(args, function(value, name) { + if (value === "") { + delete args[name]; + } + }); + + ed.execCommand('mceInsertContent', false, tinyMCEPopup.editor.dom.createHTML('img', args), {skip_undo : 1}); ed.undoManager.add(); } + tinyMCEPopup.editor.execCommand('mceRepaint'); + tinyMCEPopup.editor.focus(); tinyMCEPopup.close(); }, @@ -285,7 +291,7 @@ var ImageDialog = { fillFileList : function(id, l) { var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; - l = window[l]; + l = typeof(l) === 'function' ? l() : window[l]; lst.options.length = 0; if (l && l.length > 0) { @@ -359,7 +365,7 @@ var ImageDialog = { }, updateStyle : function(ty) { - var dom = tinyMCEPopup.dom, st, v, f = document.forms[0], img = dom.create('img', {style : dom.get('style').value}); + var dom = tinyMCEPopup.dom, b, bStyle, bColor, v, isIE = tinymce.isIE, f = document.forms[0], img = dom.create('img', {style : dom.get('style').value}); if (tinyMCEPopup.editor.settings.inline_styles) { // Handle align @@ -378,14 +384,27 @@ var ImageDialog = { // Handle border if (ty == 'border') { + b = img.style.border ? img.style.border.split(' ') : []; + bStyle = dom.getStyle(img, 'border-style'); + bColor = dom.getStyle(img, 'border-color'); + dom.setStyle(img, 'border', ''); v = f.border.value; if (v || v == '0') { if (v == '0') - img.style.border = '0'; - else - img.style.border = v + 'px solid black'; + img.style.border = isIE ? '0' : '0 none none'; + else { + if (b.length == 3 && b[isIE ? 2 : 1]) + bStyle = b[isIE ? 2 : 1]; + else if (!bStyle || bStyle == 'none') + bStyle = 'solid'; + if (b.length == 3 && b[isIE ? 0 : 2]) + bColor = b[isIE ? 0 : 2]; + else if (!bColor || bColor == 'none') + bColor = 'black'; + img.style.border = v + 'px ' + bStyle + ' ' + bColor; + } } } diff --git a/js/tiny_mce/plugins/advimage/langs/en_dlg.js b/js/tiny_mce/plugins/advimage/langs/en_dlg.js index f493d196fa..5f122e2cd3 100644 --- a/js/tiny_mce/plugins/advimage/langs/en_dlg.js +++ b/js/tiny_mce/plugins/advimage/langs/en_dlg.js @@ -1,43 +1 @@ -tinyMCE.addI18n('en.advimage_dlg',{ -tab_general:"General", -tab_appearance:"Appearance", -tab_advanced:"Advanced", -general:"General", -title:"Title", -preview:"Preview", -constrain_proportions:"Constrain proportions", -langdir:"Language direction", -langcode:"Language code", -long_desc:"Long description link", -style:"Style", -classes:"Classes", -ltr:"Left to right", -rtl:"Right to left", -id:"Id", -map:"Image map", -swap_image:"Swap image", -alt_image:"Alternative image", -mouseover:"for mouse over", -mouseout:"for mouse out", -misc:"Miscellaneous", -example_img:"Appearance preview image", -missing_alt:"Are you sure you want to continue without including an Image Description? Without it the image may not be accessible to some users with disabilities, or to those using a text browser, or browsing the Web with images turned off.", -dialog_title:"Insert/edit image", -src:"Image URL", -alt:"Image description", -list:"Image list", -border:"Border", -dimensions:"Dimensions", -vspace:"Vertical space", -hspace:"Horizontal space", -align:"Alignment", -align_baseline:"Baseline", -align_top:"Top", -align_middle:"Middle", -align_bottom:"Bottom", -align_texttop:"Text top", -align_textbottom:"Text bottom", -align_left:"Left", -align_right:"Right", -image_list:"Image list" -}); \ No newline at end of file +tinyMCE.addI18n('en.advimage_dlg',{"image_list":"Image List","align_right":"Right","align_left":"Left","align_textbottom":"Text Bottom","align_texttop":"Text Top","align_bottom":"Bottom","align_middle":"Middle","align_top":"Top","align_baseline":"Baseline",align:"Alignment",hspace:"Horizontal Space",vspace:"Vertical Space",dimensions:"Dimensions",border:"Border",list:"Image List",alt:"Image Description",src:"Image URL","dialog_title":"Insert/Edit Image","missing_alt":"Are you sure you want to continue without including an Image Description? Without it the image may not be accessible to some users with disabilities, or to those using a text browser, or browsing the Web with images turned off.","example_img":"Appearance Preview Image",misc:"Miscellaneous",mouseout:"For Mouse Out",mouseover:"For Mouse Over","alt_image":"Alternative Image","swap_image":"Swap Image",map:"Image Map",id:"ID",rtl:"Right to Left",ltr:"Left to Right",classes:"Classes",style:"Style","long_desc":"Long Description Link",langcode:"Language Code",langdir:"Language Direction","constrain_proportions":"Constrain Proportions",preview:"Preview",title:"Title",general:"General","tab_advanced":"Advanced","tab_appearance":"Appearance","tab_general":"General",width:"Width",height:"Height"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/js/advlink.js b/js/tiny_mce/plugins/advlink/js/advlink.js index b78e82f76b..837c937c66 100644 --- a/js/tiny_mce/plugins/advlink/js/advlink.js +++ b/js/tiny_mce/plugins/advlink/js/advlink.js @@ -30,8 +30,6 @@ function init() { document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser','href','file','advlink'); document.getElementById('popupurlbrowsercontainer').innerHTML = getBrowserHTML('popupurlbrowser','popupurl','file','advlink'); - document.getElementById('linklisthrefcontainer').innerHTML = getLinkListHTML('linklisthref','href'); - document.getElementById('anchorlistcontainer').innerHTML = getAnchorListHTML('anchorlist','href'); document.getElementById('targetlistcontainer').innerHTML = getTargetListHTML('targetlist','target'); // Link list @@ -41,6 +39,13 @@ function init() { else document.getElementById("linklisthrefcontainer").innerHTML = html; + // Anchor list + html = getAnchorListHTML('anchorlist','href'); + if (html == "") + document.getElementById("anchorlistrow").style.display = 'none'; + else + document.getElementById("anchorlistcontainer").innerHTML = html; + // Resize some elements if (isVisible('hrefbrowser')) document.getElementById('href').style.width = '260px'; @@ -360,20 +365,22 @@ function setAttrib(elm, attrib, value) { } function getAnchorListHTML(id, target) { - var inst = tinyMCEPopup.editor; - var nodes = inst.dom.select('a.mceItemAnchor,img.mceItemAnchor'), name, i; - var html = ""; - - html += ''; + if (html == "") + return ""; + + html = ''; return html; } @@ -389,7 +396,6 @@ function insertAction() { // Remove element if there is no href if (!document.forms[0].href.value) { - tinyMCEPopup.execCommand("mceBeginUndoLevel"); i = inst.selection.getBookmark(); inst.dom.remove(elm, 1); inst.selection.moveToBookmark(i); @@ -398,12 +404,10 @@ function insertAction() { return; } - tinyMCEPopup.execCommand("mceBeginUndoLevel"); - // Create new anchor elements if (elm == null) { inst.getDoc().execCommand("unlink", false, null); - tinyMCEPopup.execCommand("CreateLink", false, "#mce_temp_url#", {skip_undo : 1}); + tinyMCEPopup.execCommand("mceInsertLink", false, "#mce_temp_url#", {skip_undo : 1}); elementArray = tinymce.grep(inst.dom.select("a"), function(n) {return inst.dom.getAttrib(n, 'href') == '#mce_temp_url#';}); for (i=0; i - -
    -
    + + + + -
    + diff --git a/js/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif b/js/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif index 16f68cc1e91a9b8ec6cfa0ba4e0c86f94b177f1a..c7cf1011dad0e7500e29a278b0d395b253871109 100644 GIT binary patch delta 268 zcmV+n0rURY0@eZ$M@dFFIbjk25&-lc0J)nSkq}gWCJF-k?l%Ac03rDV1poja04x9i z000sI5&%F2)8HqHP-&K zLM9f)qQm8C1c`;hGBJ_}h73g_p=1mM^9RXLyb^bpf>AvH6dpB#1`P%p2?GxRIXezw z7zGP+3jz%k3l2poa}fvt8yf%!5pp93KMDvH92^x0V-7i+EDszR8Bewx4-y8WehLpR z33wR8E)NQeD=m2M7#-8v+{*T!alCd#3 z1p^Ir4Fi-428xUrkd&O950`xk9-RXQ4F(zs0}qJ@2n?ee0ving0HzHddj}8`MGLmU z8UhImO%o-q#)2Cf00I^Q4_>?<5El-{nhOg84HOFw7eOBf7YG&%hkqFs2p3Q(*Aoat UP6!j@HP+?<{sHjFeFy;nJK@hu1^@s6 diff --git a/js/tiny_mce/plugins/emotions/img/smiley-laughing.gif b/js/tiny_mce/plugins/emotions/img/smiley-laughing.gif index 1606c119e75678c4031f384e0d50849906e8f533..82c5b182e61d32bd394acae551eff180f1eebd26 100644 GIT binary patch delta 269 zcmV+o0rLLX0@nf%M@dFFIbjk25&-lc0K%p+kq}gWQaug+`&s}103rDV1poja04x9i z000sI5&%F2)ZizIQ)!l?Xh>A$7VskoPwh#@I9<*GEDONFahaqh2L%Pf;kcR*isE3L zI2Im3A3bNpK_?^9QN%xH_GCzT(kPR|yLU7KDX_2pAAJa~A*# z2^9-;8v_d!2?_v3DRU7A5(5Jg2N7~31{ezo9uTY$9)TD+oGcI(4STm0Q4*wpwG|r; zF2ODk2{(g0w~m91nJ)p)P~b0v=TXuJkV0)pK%`hRH&5(aq`SQQ0|4*~)Y zj~;||h6NmskCzV%0uYjV3kVjWqM-;FoP`G(WCRQW7Z(8x1b=r16AlX=0u2`oB@7o0 z3LXm%B?eNu8w9Vj0v=tq9}^cH3JDbp8v_d!2?`w-K_3Pe2MZcXM;Z$U7f&hF4hJ0z U3mpdz;x*Id4FABSjR*k%I|lSgp8x;= diff --git a/js/tiny_mce/plugins/emotions/img/smiley-sealed.gif b/js/tiny_mce/plugins/emotions/img/smiley-sealed.gif index b33d3cca1e7b8e62dc689880074d5c61f619520d..fe66220c24b4da4526818a5d68f75a06d9985a29 100644 GIT binary patch delta 249 zcmVc6jM@dFFIbjk25&-lc0Klpjkq}gWQauaR#xDQ>03rDV1poja04x9i z000sI5&%F2z~Co}Q)!l?s2E!2QdA zP6EM+V$0o5egPxNVelL@nuEvS5Py&l$*VJWNgmaeBy#Fc3>i3Y6%ZGOhlmgrZX^W= z8v_Gi8wdrADnAk!5DyO!7!pA_ZyYQc4;~&as7@LN99jl)E**3kv`;r%EDsR|k-xtS zxe5rp69ipb1YdXxI|zjY71PuN7Z3uIlM@dFFIbjk25&+Z_08%{*kq}gWz^WJ3#xDQ>03rDV0RR9W04x9i z000sI5&!@N!r&*0Q)!lCN*2gA3>#8RD(M*Bp=pO_IJA@^(ve^wj|T)J=|mKx31Xqy zL>`%J1fp3WXcLY>lX-YN*)vvS;FJ&#NtObb*E5pGS7DH60e65|cm@i5WOEb=0u&Si zj}nDqhYt}3FPE1Kk%oN{C!Z4r8Io|G1cs;z1QS;X3KIcN6RD}J9RVd52oM(p6~Dj) z7Z3;+U=_R<%FD|T6+s^g3=I$w7#0>7TMZ0QDH9g~2t-Z@0md~SvlqY>7q2NH06S3N BNLv5^ diff --git a/js/tiny_mce/plugins/emotions/img/smiley-smile.gif b/js/tiny_mce/plugins/emotions/img/smiley-smile.gif index e6a9e60d5ddd1243fbbf2197b4dc6cd9c1b58b93..fd27edfaaa29a70a8c4563c0eab9f18c74d374fd 100644 GIT binary patch delta 270 zcmV+p0rCFX0@wl&M@dFFIbjk25&-lc0C`{zkq}gWCJF+oiUI%t03rDV1poja04x9i z000sI5&%F2)!-+JP-&K7%&eE7zha(Mk#X<1{oe683qw@BL@`@2pbbn6B`H)6*`?PtqlrLxC~PZrGN+% zE&vU~#TXL^jVmoMhlVv1IR^#>3>*Rg2{s7;0vrr}2N2W=TMrHb0uEwT<0=*g4h65Q U1r7!lv`7aQ0sjH?nF;{_JD=x5hyVZp delta 271 zcmV+q0r39V0@(r(M@dFFIbjk25&+Z?0453okq}gWd0-BziUI%t03rDV0RR9W04x9i z000sI5&!@N*5D_KP-&K9N=8QJd6^MGDoHFCB1y=#5VX{x;y`RB48~-Ga8wQ>h#?`F zTrSD$M3OMjAdy9t(NHAIO37j-Eo?9tg#s>zZwlT+1~Gwm8h(Hn69^dx2V!s-3=a<+ z0|Oj(k{b($iHwq&l93aYdI$^y9-5LK0}m612L=TU90DB)k_jCG91M5|5EKp@jU52N z03D4R4iqJ;3BC^w0s;=jUAi9-78(f%i;WBz2niY%K_3Se1`Y*FM+FWB7EmeH6b2d& V4jKj&;x*Of0sjHsjr$M+06RN6NSOct diff --git a/js/tiny_mce/plugins/emotions/img/smiley-surprised.gif b/js/tiny_mce/plugins/emotions/img/smiley-surprised.gif index cb99cdd9136fa30462a9f57aa6a0adeb7e4124e7..0cc9bb71cca4cdeafbb248ce7e07c3708c1cbd64 100644 GIT binary patch delta 264 zcmV+j0r&pa0@4ByM@dFFIbjk25&-lc0Q=+`kq}gWC=3F`xI_Q|03rDV1poja04x9i z000sI5&%F2&)_GDP-&KpRzaw7*n2_6C!6#^a!K{=W%7!?bX615c=6B?o`2^cO2 zcoM=c7zsElEfNF+&d-7v$p#C7H3(h^g0}_-5C=(GGudGrRNg8V1`i7u92^)64+a;o OM+X-H`T_N$Apkpuj7YZt delta 268 zcmV+n0rURS0@eZ$M@dFFIbjk25&+Z?04NLskq}gW`{WwLxI_Q|03rDV0RR9W04x9i z000sI5&!@N)8HqHP-&K9N=AmpFq#oTDp_dDHci{26|~f$@kn?Cm5RWVcr*?ph(R$C zG%6BFr6HIo3^YhYGr?3AiY&T{^|8V7w7SrQHo z1RaiZ6q6i?idh5$nwygp7?wp6oeuy28l4>&4~Yf~qLT=v2%Qpp2M`ty9FQFur2rir z1RM_*B?nWxk+Q-ZU$-9+7Yzyt5(*g^X$cAq7eOBf7X}Xt7#tiJ3l9btP$|+D21HH< S7T-0|;sN{t?%*Fn0028#VNAdP diff --git a/js/tiny_mce/plugins/emotions/img/smiley-wink.gif b/js/tiny_mce/plugins/emotions/img/smiley-wink.gif index 9faf1aff8f4b28e02f4f414975fe1859c43b6b54..0631c7616ec8624ddeee02b633326f697ee72f80 100644 GIT binary patch delta 276 zcmV+v0qg$X0^R};M@dFFIbjk25&-lc0MWuJkq}gWC=CMr@j3ti03rDV1poja04x9i z000sI5&%F2+u$dPQfZc>h%k}mS_`xd!)9v?GD=uwG!#n1P{Bx25L@HjmHz$20{ z93>Ts1_E((z8wcwL#Z4|1qR^|i5v)w!ugXVXaI_D!lF>PGz3-%90v;n3^s`y30029B7)0Cv delta 277 zcmV+w0qXwV0^b4/i);if(f&&f[1]){l=f[1].match(/\s*(\w+\s*=\s*".*?"|\w+\s*=\s*'.*?'|\w+\s*=\s*\w+|\w+)\s*/g);if(l){for(c=0,e=l.length;c",a);h.head=f.substring(0,a+1);j=f.indexOf("\n'}h.head+=d.getParam("fullpage_default_doctype",'');h.head+="\n\n\n"+d.getParam("fullpage_default_title","Untitled document")+"\n";if(g=d.getParam("fullpage_default_encoding")){h.head+='\n'}if(g=d.getParam("fullpage_default_font_family")){i+="font-family: "+g+";"}if(g=d.getParam("fullpage_default_font_size")){i+="font-size: "+g+";"}if(g=d.getParam("fullpage_default_text_color")){i+="color: "+g+";"}h.head+="\n\n";h.foot="\n\n"}},_getContent:function(a,c){var b=this;if(!c.source_view||!a.getParam("fullpage_hide_in_source_view")){c.content=tinymce.trim(b.head)+"\n"+tinymce.trim(c.content)+"\n"+tinymce.trim(b.foot)}}});tinymce.PluginManager.add("fullpage",tinymce.plugins.FullPagePlugin)})(); \ No newline at end of file +(function(){var b=tinymce.each,a=tinymce.html.Node;tinymce.create("tinymce.plugins.FullPagePlugin",{init:function(c,d){var e=this;e.editor=c;c.addCommand("mceFullPageProperties",function(){c.windowManager.open({file:d+"/fullpage.htm",width:430+parseInt(c.getLang("fullpage.delta_width",0)),height:495+parseInt(c.getLang("fullpage.delta_height",0)),inline:1},{plugin_url:d,data:e._htmlToData()})});c.addButton("fullpage",{title:"fullpage.desc",cmd:"mceFullPageProperties"});c.onBeforeSetContent.add(e._setContent,e);c.onGetContent.add(e._getContent,e)},getInfo:function(){return{longname:"Fullpage",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullpage",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_htmlToData:function(){var f=this._parseHeader(),h={},c,i,g,e=this.editor;function d(l,j){var k=l.attr(j);return k||""}h.fontface=e.getParam("fullpage_default_fontface","");h.fontsize=e.getParam("fullpage_default_fontsize","");i=f.firstChild;if(i.type==7){h.xml_pi=true;g=/encoding="([^"]+)"/.exec(i.value);if(g){h.docencoding=g[1]}}i=f.getAll("#doctype")[0];if(i){h.doctype=""}i=f.getAll("title")[0];if(i&&i.firstChild){h.metatitle=i.firstChild.value}b(f.getAll("meta"),function(m){var k=m.attr("name"),j=m.attr("http-equiv"),l;if(k){h["meta"+k.toLowerCase()]=m.attr("content")}else{if(j=="Content-Type"){l=/charset\s*=\s*(.*)\s*/gi.exec(m.attr("content"));if(l){h.docencoding=l[1]}}}});i=f.getAll("html")[0];if(i){h.langcode=d(i,"lang")||d(i,"xml:lang")}i=f.getAll("link")[0];if(i&&i.attr("rel")=="stylesheet"){h.stylesheet=i.attr("href")}i=f.getAll("body")[0];if(i){h.langdir=d(i,"dir");h.style=d(i,"style");h.visited_color=d(i,"vlink");h.link_color=d(i,"link");h.active_color=d(i,"alink")}return h},_dataToHtml:function(g){var f,d,h,j,k,e=this.editor.dom;function c(n,l,m){n.attr(l,m?m:undefined)}function i(l){if(d.firstChild){d.insert(l,d.firstChild)}else{d.append(l)}}f=this._parseHeader();d=f.getAll("head")[0];if(!d){j=f.getAll("html")[0];d=new a("head",1);if(j.firstChild){j.insert(d,j.firstChild,true)}else{j.append(d)}}j=f.firstChild;if(g.xml_pi){k='version="1.0"';if(g.docencoding){k+=' encoding="'+g.docencoding+'"'}if(j.type!=7){j=new a("xml",7);f.insert(j,f.firstChild,true)}j.value=k}else{if(j&&j.type==7){j.remove()}}j=f.getAll("#doctype")[0];if(g.doctype){if(!j){j=new a("#doctype",10);if(g.xml_pi){f.insert(j,f.firstChild)}else{i(j)}}j.value=g.doctype.substring(9,g.doctype.length-1)}else{if(j){j.remove()}}j=f.getAll("title")[0];if(g.metatitle){if(!j){j=new a("title",1);j.append(new a("#text",3)).value=g.metatitle;i(j)}}if(g.docencoding){j=null;b(f.getAll("meta"),function(l){if(l.attr("http-equiv")=="Content-Type"){j=l}});if(!j){j=new a("meta",1);j.attr("http-equiv","Content-Type");j.shortEnded=true;i(j)}j.attr("content","text/html; charset="+g.docencoding)}b("keywords,description,author,copyright,robots".split(","),function(m){var l=f.getAll("meta"),n,p,o=g["meta"+m];for(n=0;n"))},_parseHeader:function(){return new tinymce.html.DomParser({validate:false,root_name:"#document"}).parse(this.head)},_setContent:function(g,d){var m=this,i,c,h=d.content,f,l="",e=m.editor.dom,j;function k(n){return n.replace(/<\/?[A-Z]+/g,function(o){return o.toLowerCase()})}if(d.format=="raw"&&m.head){return}if(d.source_view&&g.getParam("fullpage_hide_in_source_view")){return}h=h.replace(/<(\/?)BODY/gi,"<$1body");i=h.indexOf("",i);m.head=k(h.substring(0,i+1));c=h.indexOf("\n"}f=m._parseHeader();b(f.getAll("style"),function(n){if(n.firstChild){l+=n.firstChild.value}});j=f.getAll("body")[0];if(j){e.setAttribs(m.editor.getBody(),{style:j.attr("style")||"",dir:j.attr("dir")||"",vLink:j.attr("vlink")||"",link:j.attr("link")||"",aLink:j.attr("alink")||""})}e.remove("fullpage_styles");if(l){e.add(m.editor.getDoc().getElementsByTagName("head")[0],"style",{id:"fullpage_styles"},l);j=e.get("fullpage_styles");if(j.styleSheet){j.styleSheet.cssText=l}}},_getDefaultHeader:function(){var f="",c=this.editor,e,d="";if(c.getParam("fullpage_default_xml_pi")){f+='\n'}f+=c.getParam("fullpage_default_doctype",'');f+="\n\n\n";if(e=c.getParam("fullpage_default_title")){f+=""+e+"\n"}if(e=c.getParam("fullpage_default_encoding")){f+='\n'}if(e=c.getParam("fullpage_default_font_family")){d+="font-family: "+e+";"}if(e=c.getParam("fullpage_default_font_size")){d+="font-size: "+e+";"}if(e=c.getParam("fullpage_default_text_color")){d+="color: "+e+";"}f+="\n\n";return f},_getContent:function(d,e){var c=this;if(!e.source_view||!d.getParam("fullpage_hide_in_source_view")){e.content=tinymce.trim(c.head)+"\n"+tinymce.trim(e.content)+"\n"+tinymce.trim(c.foot)}}});tinymce.PluginManager.add("fullpage",tinymce.plugins.FullPagePlugin)})(); \ No newline at end of file diff --git a/js/tiny_mce/plugins/fullpage/editor_plugin_src.js b/js/tiny_mce/plugins/fullpage/editor_plugin_src.js index a2c9df8987..23de7c5a1a 100644 --- a/js/tiny_mce/plugins/fullpage/editor_plugin_src.js +++ b/js/tiny_mce/plugins/fullpage/editor_plugin_src.js @@ -9,6 +9,8 @@ */ (function() { + var each = tinymce.each, Node = tinymce.html.Node; + tinymce.create('tinymce.plugins.FullPagePlugin', { init : function(ed, url) { var t = this; @@ -24,7 +26,7 @@ inline : 1 }, { plugin_url : url, - head_html : t.head + data : t._htmlToData() }); }); @@ -32,7 +34,6 @@ ed.addButton('fullpage', {title : 'fullpage.desc', cmd : 'mceFullPageProperties'}); ed.onBeforeSetContent.add(t._setContent, t); - ed.onSetContent.add(t._setBodyAttribs, t); ed.onGetContent.add(t._getContent, t); }, @@ -48,106 +49,357 @@ // Private plugin internal methods - _setBodyAttribs : function(ed, o) { - var bdattr, i, len, kv, k, v, t, attr = this.head.match(/body(.*?)>/i); + _htmlToData : function() { + var headerFragment = this._parseHeader(), data = {}, nodes, elm, matches, editor = this.editor; - if (attr && attr[1]) { - bdattr = attr[1].match(/\s*(\w+\s*=\s*".*?"|\w+\s*=\s*'.*?'|\w+\s*=\s*\w+|\w+)\s*/g); + function getAttr(elm, name) { + var value = elm.attr(name); - if (bdattr) { - for(i = 0, len = bdattr.length; i < len; i++) { - kv = bdattr[i].split('='); - k = kv[0].replace(/\s/,''); - v = kv[1]; + return value || ''; + }; - if (v) { - v = v.replace(/^\s+/,'').replace(/\s+$/,''); - t = v.match(/^["'](.*)["']$/); + // Default some values + data.fontface = editor.getParam("fullpage_default_fontface", ""); + data.fontsize = editor.getParam("fullpage_default_fontsize", ""); + + // Parse XML PI + elm = headerFragment.firstChild; + if (elm.type == 7) { + data.xml_pi = true; + matches = /encoding="([^"]+)"/.exec(elm.value); + if (matches) + data.docencoding = matches[1]; + } - if (t) - v = t[1]; - } else - v = k; + // Parse doctype + elm = headerFragment.getAll('#doctype')[0]; + if (elm) + data.doctype = '"; - ed.dom.setAttrib(ed.getBody(), 'style', v); - } + // Parse title element + elm = headerFragment.getAll('title')[0]; + if (elm && elm.firstChild) { + data.metatitle = elm.firstChild.value; + } + + // Parse meta elements + each(headerFragment.getAll('meta'), function(meta) { + var name = meta.attr('name'), httpEquiv = meta.attr('http-equiv'), matches; + + if (name) + data['meta' + name.toLowerCase()] = meta.attr('content'); + else if (httpEquiv == "Content-Type") { + matches = /charset\s*=\s*(.*)\s*/gi.exec(meta.attr('content')); + + if (matches) + data.docencoding = matches[1]; } + }); + + // Parse html attribs + elm = headerFragment.getAll('html')[0]; + if (elm) + data.langcode = getAttr(elm, 'lang') || getAttr(elm, 'xml:lang'); + + // Parse stylesheet + elm = headerFragment.getAll('link')[0]; + if (elm && elm.attr('rel') == 'stylesheet') + data.stylesheet = elm.attr('href'); + + // Parse body parts + elm = headerFragment.getAll('body')[0]; + if (elm) { + data.langdir = getAttr(elm, 'dir'); + data.style = getAttr(elm, 'style'); + data.visited_color = getAttr(elm, 'vlink'); + data.link_color = getAttr(elm, 'link'); + data.active_color = getAttr(elm, 'alink'); } + + return data; }, - _createSerializer : function() { - return new tinymce.dom.Serializer({ - dom : this.editor.dom, - apply_source_formatting : true + _dataToHtml : function(data) { + var headerFragment, headElement, html, elm, value, dom = this.editor.dom; + + function setAttr(elm, name, value) { + elm.attr(name, value ? value : undefined); + }; + + function addHeadNode(node) { + if (headElement.firstChild) + headElement.insert(node, headElement.firstChild); + else + headElement.append(node); + }; + + headerFragment = this._parseHeader(); + headElement = headerFragment.getAll('head')[0]; + if (!headElement) { + elm = headerFragment.getAll('html')[0]; + headElement = new Node('head', 1); + + if (elm.firstChild) + elm.insert(headElement, elm.firstChild, true); + else + elm.append(headElement); + } + + // Add/update/remove XML-PI + elm = headerFragment.firstChild; + if (data.xml_pi) { + value = 'version="1.0"'; + + if (data.docencoding) + value += ' encoding="' + data.docencoding + '"'; + + if (elm.type != 7) { + elm = new Node('xml', 7); + headerFragment.insert(elm, headerFragment.firstChild, true); + } + + elm.value = value; + } else if (elm && elm.type == 7) + elm.remove(); + + // Add/update/remove doctype + elm = headerFragment.getAll('#doctype')[0]; + if (data.doctype) { + if (!elm) { + elm = new Node('#doctype', 10); + + if (data.xml_pi) + headerFragment.insert(elm, headerFragment.firstChild); + else + addHeadNode(elm); + } + + elm.value = data.doctype.substring(9, data.doctype.length - 1); + } else if (elm) + elm.remove(); + + // Add/update/remove title + elm = headerFragment.getAll('title')[0]; + if (data.metatitle) { + if (!elm) { + elm = new Node('title', 1); + elm.append(new Node('#text', 3)).value = data.metatitle; + addHeadNode(elm); + } + } + + // Add meta encoding + if (data.docencoding) { + elm = null; + each(headerFragment.getAll('meta'), function(meta) { + if (meta.attr('http-equiv') == 'Content-Type') + elm = meta; + }); + + if (!elm) { + elm = new Node('meta', 1); + elm.attr('http-equiv', 'Content-Type'); + elm.shortEnded = true; + addHeadNode(elm); + } + + elm.attr('content', 'text/html; charset=' + data.docencoding); + } + + // Add/update/remove meta + each('keywords,description,author,copyright,robots'.split(','), function(name) { + var nodes = headerFragment.getAll('meta'), i, meta, value = data['meta' + name]; + + for (i = 0; i < nodes.length; i++) { + meta = nodes[i]; + + if (meta.attr('name') == name) { + if (value) + meta.attr('content', value); + else + meta.remove(); + + return; + } + } + + if (value) { + elm = new Node('meta', 1); + elm.attr('name', name); + elm.attr('content', value); + elm.shortEnded = true; + + addHeadNode(elm); + } }); + + // Add/update/delete link + elm = headerFragment.getAll('link')[0]; + if (elm && elm.attr('rel') == 'stylesheet') { + if (data.stylesheet) + elm.attr('href', data.stylesheet); + else + elm.remove(); + } else if (data.stylesheet) { + elm = new Node('link', 1); + elm.attr({ + rel : 'stylesheet', + text : 'text/css', + href : data.stylesheet + }); + elm.shortEnded = true; + + addHeadNode(elm); + } + + // Update body attributes + elm = headerFragment.getAll('body')[0]; + if (elm) { + setAttr(elm, 'dir', data.langdir); + setAttr(elm, 'style', data.style); + setAttr(elm, 'vlink', data.visited_color); + setAttr(elm, 'link', data.link_color); + setAttr(elm, 'alink', data.active_color); + + // Update iframe body as well + dom.setAttribs(this.editor.getBody(), { + style : data.style, + dir : data.dir, + vLink : data.visited_color, + link : data.link_color, + aLink : data.active_color + }); + } + + // Set html attributes + elm = headerFragment.getAll('html')[0]; + if (elm) { + setAttr(elm, 'lang', data.langcode); + setAttr(elm, 'xml:lang', data.langcode); + } + + // Serialize header fragment and crop away body part + html = new tinymce.html.Serializer({ + validate: false, + indent: true, + apply_source_formatting : true, + indent_before: 'head,html,body,meta,title,script,link,style', + indent_after: 'head,html,body,meta,title,script,link,style' + }).serialize(headerFragment); + + this.head = html.substring(0, html.indexOf('')); + }, + + _parseHeader : function() { + // Parse the contents with a DOM parser + return new tinymce.html.DomParser({ + validate: false, + root_name: '#document' + }).parse(this.head); }, _setContent : function(ed, o) { - var t = this, sp, ep, c = o.content, v, st = ''; + var self = this, startPos, endPos, content = o.content, headerFragment, styles = '', dom = self.editor.dom, elm; + + function low(s) { + return s.replace(/<\/?[A-Z]+/g, function(a) { + return a.toLowerCase(); + }) + }; // Ignore raw updated if we already have a head, this will fix issues with undo/redo keeping the head/foot separate - if (o.format == 'raw' && t.head) + if (o.format == 'raw' && self.head) return; if (o.source_view && ed.getParam('fullpage_hide_in_source_view')) return; // Parse out head, body and footer - c = c.replace(/<(\/?)BODY/gi, '<$1body'); - sp = c.indexOf('', sp); - t.head = c.substring(0, sp + 1); + if (startPos != -1) { + startPos = content.indexOf('>', startPos); + self.head = low(content.substring(0, startPos + 1)); - ep = c.indexOf('\n'; + elm = headerFragment.getAll('body')[0]; + if (elm) { + dom.setAttribs(self.editor.getBody(), { + style : elm.attr('style') || '', + dir : elm.attr('dir') || '', + vLink : elm.attr('vlink') || '', + link : elm.attr('link') || '', + aLink : elm.attr('alink') || '' + }); + } - t.head += ed.getParam('fullpage_default_doctype', ''); - t.head += '\n\n\n' + ed.getParam('fullpage_default_title', 'Untitled document') + '\n'; + dom.remove('fullpage_styles'); - if (v = ed.getParam('fullpage_default_encoding')) - t.head += '\n'; + if (styles) { + dom.add(self.editor.getDoc().getElementsByTagName('head')[0], 'style', {id : 'fullpage_styles'}, styles); - if (v = ed.getParam('fullpage_default_font_family')) - st += 'font-family: ' + v + ';'; + // Needed for IE 6/7 + elm = dom.get('fullpage_styles'); + if (elm.styleSheet) + elm.styleSheet.cssText = styles; + } + }, - if (v = ed.getParam('fullpage_default_font_size')) - st += 'font-size: ' + v + ';'; + _getDefaultHeader : function() { + var header = '', editor = this.editor, value, styles = ''; - if (v = ed.getParam('fullpage_default_text_color')) - st += 'color: ' + v + ';'; + if (editor.getParam('fullpage_default_xml_pi')) + header += '\n'; - t.head += '\n\n'; - t.foot = '\n\n'; - } + header += editor.getParam('fullpage_default_doctype', ''); + header += '\n\n\n'; + + if (value = editor.getParam('fullpage_default_title')) + header += '' + value + '\n'; + + if (value = editor.getParam('fullpage_default_encoding')) + header += '\n'; + + if (value = editor.getParam('fullpage_default_font_family')) + styles += 'font-family: ' + value + ';'; + + if (value = editor.getParam('fullpage_default_font_size')) + styles += 'font-size: ' + value + ';'; + + if (value = editor.getParam('fullpage_default_text_color')) + styles += 'color: ' + value + ';'; + + header += '\n\n'; + + return header; }, _getContent : function(ed, o) { - var t = this; + var self = this; if (!o.source_view || !ed.getParam('fullpage_hide_in_source_view')) - o.content = tinymce.trim(t.head) + '\n' + tinymce.trim(o.content) + '\n' + tinymce.trim(t.foot); + o.content = tinymce.trim(self.head) + '\n' + tinymce.trim(o.content) + '\n' + tinymce.trim(self.foot); } }); // Register plugin tinymce.PluginManager.add('fullpage', tinymce.plugins.FullPagePlugin); -})(); \ No newline at end of file +})(); diff --git a/js/tiny_mce/plugins/fullpage/fullpage.htm b/js/tiny_mce/plugins/fullpage/fullpage.htm index c32afaf2d9..14ab8652ea 100644 --- a/js/tiny_mce/plugins/fullpage/fullpage.htm +++ b/js/tiny_mce/plugins/fullpage/fullpage.htm @@ -8,13 +8,12 @@ - -
    + + @@ -72,9 +71,9 @@
       -
    -
    - - +
     
    @@ -147,7 +146,7 @@
    - +
     
    @@ -158,7 +157,7 @@
    - +
     
    @@ -173,15 +172,15 @@ - + - + - + - +
    @@ -195,7 +194,7 @@
    - +
    @@ -205,7 +204,7 @@
    - +
     
    @@ -217,7 +216,7 @@
    - +
     
    @@ -225,16 +224,6 @@
       
    @@ -254,310 +243,9 @@
    -
    - - -
    - - -
    - {#fullpage_dlg.head_elements} - -
    -
    -
    - - -
    -
    - - -
    -
    -
    - -
    -
    - -
    - {#fullpage_dlg.meta_element} - - - - - - - - - - - - - - -
    - - -
    - -
    - {#fullpage_dlg.title_element} - - - - - - -
    - - -
    - -
    - {#fullpage_dlg.script_element} - - - -
    - -
    -
    - - - - - - - - - - - - - - - - - -
    - - - - -
     
    -
    - -
    - -
    -
    - - -
    - -
    - {#fullpage_dlg.style_element} - - - -
    - -
    -
    - - - - - - - - - -
    -
    - -
    - -
    -
    - - -
    - -
    - {#fullpage_dlg.base_element} - - - - - - - - - +
    - - -
    - - - -
    - {#fullpage_dlg.comment_element} - - - -
    @@ -566,6 +254,6 @@ - + diff --git a/js/tiny_mce/plugins/fullpage/js/fullpage.js b/js/tiny_mce/plugins/fullpage/js/fullpage.js index a1bb719a38..3f672ad3ba 100644 --- a/js/tiny_mce/plugins/fullpage/js/fullpage.js +++ b/js/tiny_mce/plugins/fullpage/js/fullpage.js @@ -8,464 +8,225 @@ * Contributing: http://tinymce.moxiecode.com/contributing */ -tinyMCEPopup.requireLangPack(); - -var doc; - -var defaultDocTypes = - 'XHTML 1.0 Transitional=,' + - 'XHTML 1.0 Frameset=,' + - 'XHTML 1.0 Strict=,' + - 'XHTML 1.1=,' + - 'HTML 4.01 Transitional=,' + - 'HTML 4.01 Strict=,' + - 'HTML 4.01 Frameset='; - -var defaultEncodings = - 'Western european (iso-8859-1)=iso-8859-1,' + - 'Central European (iso-8859-2)=iso-8859-2,' + - 'Unicode (UTF-8)=utf-8,' + - 'Chinese traditional (Big5)=big5,' + - 'Cyrillic (iso-8859-5)=iso-8859-5,' + - 'Japanese (iso-2022-jp)=iso-2022-jp,' + - 'Greek (iso-8859-7)=iso-8859-7,' + - 'Korean (iso-2022-kr)=iso-2022-kr,' + - 'ASCII (us-ascii)=us-ascii'; - -var defaultMediaTypes = - 'all=all,' + - 'screen=screen,' + - 'print=print,' + - 'tty=tty,' + - 'tv=tv,' + - 'projection=projection,' + - 'handheld=handheld,' + - 'braille=braille,' + - 'aural=aural'; - -var defaultFontNames = 'Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;WingDings=wingdings'; -var defaultFontSizes = '10px,11px,12px,13px,14px,15px,16px'; - -function init() { - var f = document.forms['fullpage'], el = f.elements, e, i, p, doctypes, encodings, mediaTypes, fonts, ed = tinyMCEPopup.editor, dom = tinyMCEPopup.dom, style; - - // Setup doctype select box - doctypes = ed.getParam("fullpage_doctypes", defaultDocTypes).split(','); - for (i=0; i 1) - addSelectValue(f, 'doctypes', p[0], p[1]); - } - - // Setup fonts select box - fonts = ed.getParam("fullpage_fonts", defaultFontNames).split(';'); - for (i=0; i 1) - addSelectValue(f, 'fontface', p[0], p[1]); - } - - // Setup fontsize select box - fonts = ed.getParam("fullpage_fontsizes", defaultFontSizes).split(','); - for (i=0; i 1) { - addSelectValue(f, 'element_style_media', p[0], p[1]); - addSelectValue(f, 'element_link_media', p[0], p[1]); - } - } - - // Setup encodings select box - encodings = ed.getParam("fullpage_encodings", defaultEncodings).split(','); - for (i=0; i 1) { - addSelectValue(f, 'docencoding', p[0], p[1]); - addSelectValue(f, 'element_script_charset', p[0], p[1]); - addSelectValue(f, 'element_link_charset', p[0], p[1]); - } - } - - document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); - document.getElementById('link_color_pickcontainer').innerHTML = getColorPickerHTML('link_color_pick','link_color'); - //document.getElementById('hover_color_pickcontainer').innerHTML = getColorPickerHTML('hover_color_pick','hover_color'); - document.getElementById('visited_color_pickcontainer').innerHTML = getColorPickerHTML('visited_color_pick','visited_color'); - document.getElementById('active_color_pickcontainer').innerHTML = getColorPickerHTML('active_color_pick','active_color'); - document.getElementById('textcolor_pickcontainer').innerHTML = getColorPickerHTML('textcolor_pick','textcolor'); - document.getElementById('stylesheet_browsercontainer').innerHTML = getBrowserHTML('stylesheetbrowser','stylesheet','file','fullpage'); - document.getElementById('link_href_pickcontainer').innerHTML = getBrowserHTML('link_href_browser','element_link_href','file','fullpage'); - document.getElementById('script_src_pickcontainer').innerHTML = getBrowserHTML('script_src_browser','element_script_src','file','fullpage'); - document.getElementById('bgimage_pickcontainer').innerHTML = getBrowserHTML('bgimage_browser','bgimage','image','fullpage'); - - // Resize some elements - if (isVisible('stylesheetbrowser')) - document.getElementById('stylesheet').style.width = '220px'; - - if (isVisible('link_href_browser')) - document.getElementById('element_link_href').style.width = '230px'; - - if (isVisible('bgimage_browser')) - document.getElementById('bgimage').style.width = '210px'; - - // Add iframe - dom.add(document.body, 'iframe', {id : 'documentIframe', src : 'javascript:""', style : {display : 'none'}}); - doc = dom.get('documentIframe').contentWindow.document; - h = tinyMCEPopup.getWindowArg('head_html'); - - // Preprocess the HTML disable scripts and urls - h = h.replace(/ '; - } + if (!url) + return url; - return im; - }); - } - }); + if (force_absolute) + return editor.documentBaseURI.toAbsolute(url); + + return urlConverter.call(urlConverterScope, url, 'src', 'object'); }, getInfo : function() { @@ -202,213 +226,665 @@ }; }, - // Private methods - _objectsToSpans : function(ed, o) { - var t = this, h = o.content; + /** + * Converts the JSON data object to an img node. + */ + dataToImg : function(data, force_absolute) { + var self = this, editor = self.editor, baseUri = editor.documentBaseURI, sources, attrs, img, i; - h = h.replace(/]*>\s*write(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)\(\{([^\)]*)\}\);\s*<\/script>/gi, function(a, b, c) { - var o = t._parse(c); + data.params.src = self.convertUrl(data.params.src, force_absolute); - return '' + attrs = data.video.attrs; + if (attrs) + attrs.src = self.convertUrl(attrs.src, force_absolute); + + if (attrs) + attrs.poster = self.convertUrl(attrs.poster, force_absolute); + + sources = toArray(data.video.sources); + if (sources) { + for (i = 0; i < sources.length; i++) + sources[i].src = self.convertUrl(sources[i].src, force_absolute); + } + + img = self.editor.dom.create('img', { + id : data.id, + style : data.style, + align : data.align, + hspace : data.hspace, + vspace : data.vspace, + src : self.editor.theme.url + '/img/trans.gif', + 'class' : 'mceItemMedia mceItem' + self.getType(data.type).name, + 'data-mce-json' : JSON.serialize(data, "'") }); - h = h.replace(/]*)>/gi, ''); - h = h.replace(/]*)\/?>/gi, ''); - h = h.replace(/]*)>/gi, ''); - h = h.replace(/<\/(object)([^>]*)>/gi, ''); - h = h.replace(/<\/embed>/gi, ''); - h = h.replace(/]*)>/gi, function(a, b) {return ''}); - h = h.replace(/\/ class=\"mceItemParam\"><\/span>/gi, 'class="mceItemParam">'); + img.width = data.width || (data.type == 'audio' ? "300" : "320"); + img.height = data.height || (data.type == 'audio' ? "32" : "240"); + + return img; + }, + + /** + * Converts the JSON data object to a HTML string. + */ + dataToHtml : function(data, force_absolute) { + return this.editor.serializer.serialize(this.dataToImg(data, force_absolute), {forced_root_block : '', force_absolute : force_absolute}); + }, + + /** + * Converts the JSON data object to a HTML string. + */ + htmlToData : function(html) { + var fragment, img, data; + + data = { + type : 'flash', + video: {sources:[]}, + params: {} + }; + + fragment = this.editor.parser.parse(html); + img = fragment.getAll('img')[0]; + + if (img) { + data = JSON.parse(img.attr('data-mce-json')); + data.type = this.getType(img.attr('class')).name.toLowerCase(); + + // Add some extra properties to the data object + tinymce.each(rootAttributes, function(name) { + var value = img.attr(name); - o.content = h; + if (value) + data[name] = value; + }); + } + + return data; + }, + + /** + * Get type item by extension, class, clsid or mime type. + * + * @method getType + * @param {String} value Value to get type item by. + * @return {Object} Type item object or undefined. + */ + getType : function(value) { + var i, values, typeItem; + + // Find type by checking the classes + values = tinymce.explode(value, ' '); + for (i = 0; i < values.length; i++) { + typeItem = this.lookup[values[i]]; + + if (typeItem) + return typeItem; + } }, - _buildObj : function(o, n) { - var ob, ed = this.editor, dom = ed.dom, p = this._parse(n.title), stc; - - stc = ed.getParam('media_strict', true) && o.type == 'application/x-shockwave-flash'; - - p.width = o.width = dom.getAttrib(n, 'width') || 100; - p.height = o.height = dom.getAttrib(n, 'height') || 100; - - if (p.src) - p.src = ed.convertURL(p.src, 'src', n); - - if (stc) { - ob = dom.create('span', { - id : p.id, - _mce_name : 'object', - type : 'application/x-shockwave-flash', - data : p.src, - style : dom.getAttrib(n, 'style'), - width : o.width, - height : o.height + /** + * Converts a tinymce.html.Node image element to video/object/embed. + */ + imgToObject : function(node, args) { + var self = this, editor = self.editor, video, object, embed, iframe, name, value, data, + source, sources, params, param, typeItem, i, item, mp4Source, replacement, + posterSrc, style, audio; + + // Adds the flash player + function addPlayer(video_src, poster_src) { + var baseUri, flashVars, flashVarsOutput, params, flashPlayer; + + flashPlayer = editor.getParam('flash_video_player_url', self.convertUrl(self.url + '/moxieplayer.swf')); + if (flashPlayer) { + baseUri = editor.documentBaseURI; + data.params.src = flashPlayer; + + // Convert the movie url to absolute urls + if (editor.getParam('flash_video_player_absvideourl', true)) { + video_src = baseUri.toAbsolute(video_src || '', true); + poster_src = baseUri.toAbsolute(poster_src || '', true); + } + + // Generate flash vars + flashVarsOutput = ''; + flashVars = editor.getParam('flash_video_player_flashvars', {url : '$url', poster : '$poster'}); + tinymce.each(flashVars, function(value, name) { + // Replace $url and $poster variables in flashvars value + value = value.replace(/\$url/, video_src || ''); + value = value.replace(/\$poster/, poster_src || ''); + + if (value.length > 0) + flashVarsOutput += (flashVarsOutput ? '&' : '') + name + '=' + escape(value); + }); + + if (flashVarsOutput.length) + data.params.flashvars = flashVarsOutput; + + params = editor.getParam('flash_video_player_params', { + allowfullscreen: true, + allowscriptaccess: true + }); + + tinymce.each(params, function(value, name) { + data.params[name] = "" + value; + }); + } + }; + + data = node.attr('data-mce-json'); + if (!data) + return; + + data = JSON.parse(data); + typeItem = this.getType(node.attr('class')); + + style = node.attr('data-mce-style') + if (!style) { + style = node.attr('style'); + + if (style) + style = editor.dom.serializeStyle(editor.dom.parseStyle(style, 'img')); + } + + // Handle iframe + if (typeItem.name === 'Iframe') { + replacement = new Node('iframe', 1); + + tinymce.each(rootAttributes, function(name) { + var value = node.attr(name); + + if (name == 'class' && value) + value = value.replace(/mceItem.+ ?/g, ''); + + if (value && value.length > 0) + replacement.attr(name, value); }); - } else { - ob = dom.create('span', { - id : p.id, - _mce_name : 'object', - classid : "clsid:" + o.classid, - style : dom.getAttrib(n, 'style'), - codebase : o.codebase, - width : o.width, - height : o.height + + for (name in data.params) + replacement.attr(name, data.params[name]); + + replacement.attr({ + style: style, + src: data.params.src }); + + node.replace(replacement); + + return; } - each (p, function(v, k) { - if (!/^(width|height|codebase|classid|id|_cx|_cy)$/.test(k)) { - // Use url instead of src in IE for Windows media - if (o.type == 'application/x-mplayer2' && k == 'src' && !p.url) - k = 'url'; + // Handle scripts + if (this.editor.settings.media_use_script) { + replacement = new Node('script', 1).attr('type', 'text/javascript'); + + value = new Node('#text', 3); + value.value = 'write' + typeItem.name + '(' + JSON.serialize(tinymce.extend(data.params, { + width: node.attr('width'), + height: node.attr('height') + })) + ');'; + + replacement.append(value); + node.replace(replacement); - if (v) - dom.add(ob, 'span', {_mce_name : 'param', name : k, '_mce_value' : v}); + return; + } + + // Add HTML5 video element + if (typeItem.name === 'Video' && data.video.sources[0]) { + // Create new object element + video = new Node('video', 1).attr(tinymce.extend({ + id : node.attr('id'), + width: node.attr('width'), + height: node.attr('height'), + style : style + }, data.video.attrs)); + + // Get poster source and use that for flash fallback + if (data.video.attrs) + posterSrc = data.video.attrs.poster; + + sources = data.video.sources = toArray(data.video.sources); + for (i = 0; i < sources.length; i++) { + if (/\.mp4$/.test(sources[i].src)) + mp4Source = sources[i].src; } - }); - if (!stc) - dom.add(ob, 'span', tinymce.extend({_mce_name : 'embed', type : o.type, style : dom.getAttrib(n, 'style')}, p)); + if (!sources[0].type) { + video.attr('src', sources[0].src); + sources.splice(0, 1); + } - return ob; - }, + for (i = 0; i < sources.length; i++) { + source = new Node('source', 1).attr(sources[i]); + source.shortEnded = true; + video.append(source); + } - _spansToImgs : function(p) { - var t = this, dom = t.editor.dom, im, ci; + // Create flash fallback for video if we have a mp4 source + if (mp4Source) { + addPlayer(mp4Source, posterSrc); + typeItem = self.getType('flash'); + } else + data.params.src = ''; + } - each(dom.select('span', p), function(n) { - // Convert object into image - if (dom.getAttrib(n, 'class') == 'mceItemObject') { - ci = dom.getAttrib(n, "classid").toLowerCase().replace(/\s+/g, ''); + // Add HTML5 audio element + if (typeItem.name === 'Audio' && data.video.sources[0]) { + // Create new object element + audio = new Node('audio', 1).attr(tinymce.extend({ + id : node.attr('id'), + width: node.attr('width'), + height: node.attr('height'), + style : style + }, data.video.attrs)); + + // Get poster source and use that for flash fallback + if (data.video.attrs) + posterSrc = data.video.attrs.poster; + + sources = data.video.sources = toArray(data.video.sources); + if (!sources[0].type) { + audio.attr('src', sources[0].src); + sources.splice(0, 1); + } - switch (ci) { - case 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000': - dom.replace(t._createImg('mceItemFlash', n), n); - break; + for (i = 0; i < sources.length; i++) { + source = new Node('source', 1).attr(sources[i]); + source.shortEnded = true; + audio.append(source); + } - case 'clsid:166b1bca-3f9c-11cf-8075-444553540000': - dom.replace(t._createImg('mceItemShockWave', n), n); - break; + data.params.src = ''; + } - case 'clsid:6bf52a52-394a-11d3-b153-00c04f79faa6': - case 'clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95': - case 'clsid:05589fa1-c356-11ce-bf01-00aa0055595a': - dom.replace(t._createImg('mceItemWindowsMedia', n), n); - break; + if (typeItem.name === 'EmbeddedAudio') { + embed = new Node('embed', 1); + embed.shortEnded = true; + embed.attr({ + id: node.attr('id'), + width: node.attr('width'), + height: node.attr('height'), + style : style, + type: node.attr('type') + }); - case 'clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b': - dom.replace(t._createImg('mceItemQuickTime', n), n); - break; + for (name in data.params) + embed.attr(name, data.params[name]); - case 'clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa': - dom.replace(t._createImg('mceItemRealMedia', n), n); - break; + tinymce.each(rootAttributes, function(name) { + if (data[name] && name != 'type') + embed.attr(name, data[name]); + }); - default: - dom.replace(t._createImg('mceItemFlash', n), n); - } - - return; + data.params.src = ''; + } + + // Do we have a params src then we can generate object + if (data.params.src) { + // Is flv movie add player for it + if (/\.flv$/i.test(data.params.src)) + addPlayer(data.params.src, ''); + + if (args && args.force_absolute) + data.params.src = editor.documentBaseURI.toAbsolute(data.params.src); + + // Create new object element + object = new Node('object', 1).attr({ + id : node.attr('id'), + width: node.attr('width'), + height: node.attr('height'), + style : style + }); + + tinymce.each(rootAttributes, function(name) { + var value = data[name]; + + if (name == 'class' && value) + value = value.replace(/mceItem.+ ?/g, ''); + + if (value && name != 'type') + object.attr(name, value); + }); + + // Add params + for (name in data.params) { + param = new Node('param', 1); + param.shortEnded = true; + value = data.params[name]; + + // Windows media needs to use url instead of src for the media URL + if (name === 'src' && typeItem.name === 'WindowsMedia') + name = 'url'; + + param.attr({name: name, value: value}); + object.append(param); } - // Convert embed into image - if (dom.getAttrib(n, 'class') == 'mceItemEmbed') { - switch (dom.getAttrib(n, 'type')) { - case 'application/x-shockwave-flash': - dom.replace(t._createImg('mceItemFlash', n), n); - break; + // Setup add type and classid if strict is disabled + if (this.editor.getParam('media_strict', true)) { + object.attr({ + data: data.params.src, + type: typeItem.mimes[0] + }); + } else { + object.attr({ + classid: "clsid:" + typeItem.clsids[0], + codebase: typeItem.codebase + }); - case 'application/x-director': - dom.replace(t._createImg('mceItemShockWave', n), n); - break; + embed = new Node('embed', 1); + embed.shortEnded = true; + embed.attr({ + id: node.attr('id'), + width: node.attr('width'), + height: node.attr('height'), + style : style, + type: typeItem.mimes[0] + }); - case 'application/x-mplayer2': - dom.replace(t._createImg('mceItemWindowsMedia', n), n); - break; + for (name in data.params) + embed.attr(name, data.params[name]); - case 'video/quicktime': - dom.replace(t._createImg('mceItemQuickTime', n), n); - break; + tinymce.each(rootAttributes, function(name) { + if (data[name] && name != 'type') + embed.attr(name, data[name]); + }); - case 'audio/x-pn-realaudio-plugin': - dom.replace(t._createImg('mceItemRealMedia', n), n); - break; + object.append(embed); + } - default: - dom.replace(t._createImg('mceItemFlash', n), n); - } - } - }); + // Insert raw HTML + if (data.object_html) { + value = new Node('#text', 3); + value.raw = true; + value.value = data.object_html; + object.append(value); + } + + // Append object to video element if it exists + if (video) + video.append(object); + } + + if (video) { + // Insert raw HTML + if (data.video_html) { + value = new Node('#text', 3); + value.raw = true; + value.value = data.video_html; + video.append(value); + } + } + + if (audio) { + // Insert raw HTML + if (data.video_html) { + value = new Node('#text', 3); + value.raw = true; + value.value = data.video_html; + audio.append(value); + } + } + + var n = video || audio || object || embed; + if (n) + node.replace(n); + else + node.remove(); }, - _createImg : function(cl, n) { - var im, dom = this.editor.dom, pa = {}, ti = '', args; + /** + * Converts a tinymce.html.Node video/object/embed to an img element. + * + * The video/object/embed will be converted into an image placeholder with a JSON data attribute like this: + * + * + * The JSON structure will be like this: + * {'params':{'flashvars':'something','quality':'high','src':'someurl'}, 'video':{'sources':[{src: 'someurl', type: 'video/mp4'}]}} + */ + objectToImg : function(node) { + var object, embed, video, iframe, img, name, id, width, height, style, i, html, + param, params, source, sources, data, type, lookup = this.lookup, + matches, attrs, urlConverter = this.editor.settings.url_converter, + urlConverterScope = this.editor.settings.url_converter_scope, + hspace, vspace, align, bgcolor; + + function getInnerHTML(node) { + return new tinymce.html.Serializer({ + inner: true, + validate: false + }).serialize(node); + }; - args = ['id', 'name', 'width', 'height', 'bgcolor', 'align', 'flashvars', 'src', 'wmode', 'allowfullscreen', 'quality', 'data']; + function lookupAttribute(o, attr) { + return lookup[(o.attr(attr) || '').toLowerCase()]; + } - // Create image - im = dom.create('img', { - src : this.url + '/img/trans.gif', - width : dom.getAttrib(n, 'width') || 100, - height : dom.getAttrib(n, 'height') || 100, - style : dom.getAttrib(n, 'style'), - 'class' : cl - }); + function lookupExtension(src) { + var ext = src.replace(/^.*\.([^.]+)$/, '$1'); + return lookup[ext.toLowerCase() || '']; + } - // Setup base parameters - each(args, function(na) { - var v = dom.getAttrib(n, na); + // If node isn't in document + if (!node.parent) + return; - if (v) - pa[na] = v; - }); + // Handle media scripts + if (node.name === 'script') { + if (node.firstChild) + matches = scriptRegExp.exec(node.firstChild.value); + + if (!matches) + return; + + type = matches[1]; + data = {video : {}, params : JSON.parse(matches[2])}; + width = data.params.width; + height = data.params.height; + } - // Add optional parameters - each(dom.select('span', n), function(n) { - if (dom.hasClass(n, 'mceItemParam')) - pa[dom.getAttrib(n, 'name')] = dom.getAttrib(n, '_mce_value'); + // Setup data objects + data = data || { + video : {}, + params : {} + }; + + // Setup new image object + img = new Node('img', 1); + img.attr({ + src : this.editor.theme.url + '/img/trans.gif' }); - // Use src not movie - if (pa.movie) { - pa.src = pa.movie; - delete pa.movie; + // Video element + name = node.name; + if (name === 'video' || name == 'audio') { + video = node; + object = node.getAll('object')[0]; + embed = node.getAll('embed')[0]; + width = video.attr('width'); + height = video.attr('height'); + id = video.attr('id'); + data.video = {attrs : {}, sources : []}; + + // Get all video attributes + attrs = data.video.attrs; + for (name in video.attributes.map) + attrs[name] = video.attributes.map[name]; + + source = node.attr('src'); + if (source) + data.video.sources.push({src : urlConverter.call(urlConverterScope, source, 'src', node.name)}); + + // Get all sources + sources = video.getAll("source"); + for (i = 0; i < sources.length; i++) { + source = sources[i].remove(); + + data.video.sources.push({ + src: urlConverter.call(urlConverterScope, source.attr('src'), 'src', 'source'), + type: source.attr('type'), + media: source.attr('media') + }); + } + + // Convert the poster URL + if (attrs.poster) + attrs.poster = urlConverter.call(urlConverterScope, attrs.poster, 'poster', node.name); + } + + // Object element + if (node.name === 'object') { + object = node; + embed = node.getAll('embed')[0]; + } + + // Embed element + if (node.name === 'embed') + embed = node; + + // Iframe element + if (node.name === 'iframe') { + iframe = node; + type = 'Iframe'; } - // No src try data - if (!pa.src) { - pa.src = pa.data; - delete pa.data; + if (object) { + // Get width/height + width = width || object.attr('width'); + height = height || object.attr('height'); + style = style || object.attr('style'); + id = id || object.attr('id'); + hspace = hspace || object.attr('hspace'); + vspace = vspace || object.attr('vspace'); + align = align || object.attr('align'); + bgcolor = bgcolor || object.attr('bgcolor'); + data.name = object.attr('name'); + + // Get all object params + params = object.getAll("param"); + for (i = 0; i < params.length; i++) { + param = params[i]; + name = param.remove().attr('name'); + + if (!excludedAttrs[name]) + data.params[name] = param.attr('value'); + } + + data.params.src = data.params.src || object.attr('data'); } - // Merge with embed args - n = dom.select('.mceItemEmbed', n)[0]; - if (n) { - each(args, function(na) { - var v = dom.getAttrib(n, na); + if (embed) { + // Get width/height + width = width || embed.attr('width'); + height = height || embed.attr('height'); + style = style || embed.attr('style'); + id = id || embed.attr('id'); + hspace = hspace || embed.attr('hspace'); + vspace = vspace || embed.attr('vspace'); + align = align || embed.attr('align'); + bgcolor = bgcolor || embed.attr('bgcolor'); + + // Get all embed attributes + for (name in embed.attributes.map) { + if (!excludedAttrs[name] && !data.params[name]) + data.params[name] = embed.attributes.map[name]; + } + } - if (v && !pa[na]) - pa[na] = v; + if (iframe) { + // Get width/height + width = iframe.attr('width'); + height = iframe.attr('height'); + style = style || iframe.attr('style'); + id = iframe.attr('id'); + hspace = iframe.attr('hspace'); + vspace = iframe.attr('vspace'); + align = iframe.attr('align'); + bgcolor = iframe.attr('bgcolor'); + + tinymce.each(rootAttributes, function(name) { + img.attr(name, iframe.attr(name)); }); + + // Get all iframe attributes + for (name in iframe.attributes.map) { + if (!excludedAttrs[name] && !data.params[name]) + data.params[name] = iframe.attributes.map[name]; + } } - delete pa.width; - delete pa.height; + // Use src not movie + if (data.params.movie) { + data.params.src = data.params.src || data.params.movie; + delete data.params.movie; + } - im.title = this._serialize(pa); + // Convert the URL to relative/absolute depending on configuration + if (data.params.src) + data.params.src = urlConverter.call(urlConverterScope, data.params.src, 'src', 'object'); - return im; - }, + if (video) { + if (node.name === 'video') + type = lookup.video.name; + else if (node.name === 'audio') + type = lookup.audio.name; + } - _parse : function(s) { - return tinymce.util.JSON.parse('{' + s + '}'); - }, + if (object && !type) + type = (lookupAttribute(object, 'clsid') || lookupAttribute(object, 'classid') || lookupAttribute(object, 'type') || {}).name; + + if (embed && !type) + type = (lookupAttribute(embed, 'type') || lookupExtension(data.params.src) || {}).name; - _serialize : function(o) { - return tinymce.util.JSON.serialize(o).replace(/[{}]/g, ''); + // for embedded audio we preserve the original specified type + if (embed && type == 'EmbeddedAudio') { + data.params.type = embed.attr('type'); + } + + // Replace the video/object/embed element with a placeholder image containing the data + node.replace(img); + + // Remove embed + if (embed) + embed.remove(); + + // Serialize the inner HTML of the object element + if (object) { + html = getInnerHTML(object.remove()); + + if (html) + data.object_html = html; + } + + // Serialize the inner HTML of the video element + if (video) { + html = getInnerHTML(video.remove()); + + if (html) + data.video_html = html; + } + + data.hspace = hspace; + data.vspace = vspace; + data.align = align; + data.bgcolor = bgcolor; + + // Set width/height of placeholder + img.attr({ + id : id, + 'class' : 'mceItemMedia mceItem' + (type || 'Flash'), + style : style, + width : width || (node.name == 'audio' ? "300" : "320"), + height : height || (node.name == 'audio' ? "32" : "240"), + hspace : hspace, + vspace : vspace, + align : align, + bgcolor : bgcolor, + "data-mce-json" : JSON.serialize(data, "'") + }); } }); // Register plugin tinymce.PluginManager.add('media', tinymce.plugins.MediaPlugin); -})(); \ No newline at end of file +})(); diff --git a/js/tiny_mce/plugins/media/js/media.js b/js/tiny_mce/plugins/media/js/media.js index 86cfa98563..45d88fe1b4 100644 --- a/js/tiny_mce/plugins/media/js/media.js +++ b/js/tiny_mce/plugins/media/js/media.js @@ -1,630 +1,464 @@ -tinyMCEPopup.requireLangPack(); +(function() { + var url; -var oldWidth, oldHeight, ed, url; + if (url = tinyMCEPopup.getParam("media_external_list_url")) + document.write(''); -if (url = tinyMCEPopup.getParam("media_external_list_url")) - document.write(''); - -function init() { - var pl = "", f, val; - var type = "flash", fe, i; - - ed = tinyMCEPopup.editor; - - tinyMCEPopup.resizeToInnerSize(); - f = document.forms[0] - - fe = ed.selection.getNode(); - if (/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(ed.dom.getAttrib(fe, 'class'))) { - pl = fe.title; - - switch (ed.dom.getAttrib(fe, 'class')) { - case 'mceItemFlash': - type = 'flash'; - break; - - case 'mceItemFlashVideo': - type = 'flv'; - break; - - case 'mceItemShockWave': - type = 'shockwave'; - break; - - case 'mceItemWindowsMedia': - type = 'wmp'; - break; - - case 'mceItemQuickTime': - type = 'qt'; - break; - - case 'mceItemRealMedia': - type = 'rmp'; - break; - } - - document.forms[0].insert.value = ed.getLang('update', 'Insert', true); + function get(id) { + return document.getElementById(id); } - document.getElementById('filebrowsercontainer').innerHTML = getBrowserHTML('filebrowser','src','media','media'); - document.getElementById('qtsrcfilebrowsercontainer').innerHTML = getBrowserHTML('qtsrcfilebrowser','qt_qtsrc','media','media'); - document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); - - var html = getMediaListHTML('medialist','src','media','media'); - if (html == "") - document.getElementById("linklistrow").style.display = 'none'; - else - document.getElementById("linklistcontainer").innerHTML = html; - - // Resize some elements - if (isVisible('filebrowser')) - document.getElementById('src').style.width = '230px'; - - // Setup form - if (pl != "") { - pl = tinyMCEPopup.editor.plugins.media._parse(pl); - - switch (type) { - case "flash": - setBool(pl, 'flash', 'play'); - setBool(pl, 'flash', 'loop'); - setBool(pl, 'flash', 'menu'); - setBool(pl, 'flash', 'swliveconnect'); - setStr(pl, 'flash', 'quality'); - setStr(pl, 'flash', 'scale'); - setStr(pl, 'flash', 'salign'); - setStr(pl, 'flash', 'wmode'); - setStr(pl, 'flash', 'base'); - setStr(pl, 'flash', 'flashvars'); - break; - - case "qt": - setBool(pl, 'qt', 'loop'); - setBool(pl, 'qt', 'autoplay'); - setBool(pl, 'qt', 'cache'); - setBool(pl, 'qt', 'controller'); - setBool(pl, 'qt', 'correction'); - setBool(pl, 'qt', 'enablejavascript'); - setBool(pl, 'qt', 'kioskmode'); - setBool(pl, 'qt', 'autohref'); - setBool(pl, 'qt', 'playeveryframe'); - setBool(pl, 'qt', 'tarsetcache'); - setStr(pl, 'qt', 'scale'); - setStr(pl, 'qt', 'starttime'); - setStr(pl, 'qt', 'endtime'); - setStr(pl, 'qt', 'tarset'); - setStr(pl, 'qt', 'qtsrcchokespeed'); - setStr(pl, 'qt', 'volume'); - setStr(pl, 'qt', 'qtsrc'); - break; - - case "shockwave": - setBool(pl, 'shockwave', 'sound'); - setBool(pl, 'shockwave', 'progress'); - setBool(pl, 'shockwave', 'autostart'); - setBool(pl, 'shockwave', 'swliveconnect'); - setStr(pl, 'shockwave', 'swvolume'); - setStr(pl, 'shockwave', 'swstretchstyle'); - setStr(pl, 'shockwave', 'swstretchhalign'); - setStr(pl, 'shockwave', 'swstretchvalign'); - break; - - case "wmp": - setBool(pl, 'wmp', 'autostart'); - setBool(pl, 'wmp', 'enabled'); - setBool(pl, 'wmp', 'enablecontextmenu'); - setBool(pl, 'wmp', 'fullscreen'); - setBool(pl, 'wmp', 'invokeurls'); - setBool(pl, 'wmp', 'mute'); - setBool(pl, 'wmp', 'stretchtofit'); - setBool(pl, 'wmp', 'windowlessvideo'); - setStr(pl, 'wmp', 'balance'); - setStr(pl, 'wmp', 'baseurl'); - setStr(pl, 'wmp', 'captioningid'); - setStr(pl, 'wmp', 'currentmarker'); - setStr(pl, 'wmp', 'currentposition'); - setStr(pl, 'wmp', 'defaultframe'); - setStr(pl, 'wmp', 'playcount'); - setStr(pl, 'wmp', 'rate'); - setStr(pl, 'wmp', 'uimode'); - setStr(pl, 'wmp', 'volume'); - break; - - case "rmp": - setBool(pl, 'rmp', 'autostart'); - setBool(pl, 'rmp', 'loop'); - setBool(pl, 'rmp', 'autogotourl'); - setBool(pl, 'rmp', 'center'); - setBool(pl, 'rmp', 'imagestatus'); - setBool(pl, 'rmp', 'maintainaspect'); - setBool(pl, 'rmp', 'nojava'); - setBool(pl, 'rmp', 'prefetch'); - setBool(pl, 'rmp', 'shuffle'); - setStr(pl, 'rmp', 'console'); - setStr(pl, 'rmp', 'controls'); - setStr(pl, 'rmp', 'numloop'); - setStr(pl, 'rmp', 'scriptcallbacks'); - break; - } - - setStr(pl, null, 'src'); - setStr(pl, null, 'id'); - setStr(pl, null, 'name'); - setStr(pl, null, 'vspace'); - setStr(pl, null, 'hspace'); - setStr(pl, null, 'bgcolor'); - setStr(pl, null, 'align'); - setStr(pl, null, 'width'); - setStr(pl, null, 'height'); - - if ((val = ed.dom.getAttrib(fe, "width")) != "") - pl.width = f.width.value = val; - - if ((val = ed.dom.getAttrib(fe, "height")) != "") - pl.height = f.height.value = val; + function clone(obj) { + var i, len, copy, attr; - oldWidth = pl.width ? parseInt(pl.width) : 0; - oldHeight = pl.height ? parseInt(pl.height) : 0; - } else - oldWidth = oldHeight = 0; + if (null == obj || "object" != typeof obj) + return obj; - selectByValue(f, 'media_type', type); - changedType(type); - updateColor('bgcolor_pick', 'bgcolor'); - - TinyMCE_EditableSelects.init(); - generatePreview(); -} - -function insertMedia() { - var fe, f = document.forms[0], h; - - tinyMCEPopup.restoreSelection(); - - if (!AutoValidator.validate(f)) { - tinyMCEPopup.alert(ed.getLang('invalid_data')); - return false; - } + // Handle Array + if ('length' in obj) { + copy = []; - f.width.value = f.width.value == "" ? 100 : f.width.value; - f.height.value = f.height.value == "" ? 100 : f.height.value; - - fe = ed.selection.getNode(); - if (fe != null && /mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(ed.dom.getAttrib(fe, 'class'))) { - switch (f.media_type.options[f.media_type.selectedIndex].value) { - case "flash": - fe.className = "mceItemFlash"; - break; - - case "flv": - fe.className = "mceItemFlashVideo"; - break; - - case "shockwave": - fe.className = "mceItemShockWave"; - break; - - case "qt": - fe.className = "mceItemQuickTime"; - break; - - case "wmp": - fe.className = "mceItemWindowsMedia"; - break; + for (i = 0, len = obj.length; i < len; ++i) { + copy[i] = clone(obj[i]); + } - case "rmp": - fe.className = "mceItemRealMedia"; - break; + return copy; } - if (fe.width != f.width.value || fe.height != f.height.value) - ed.execCommand('mceRepaint'); - - fe.title = serializeParameters(); - fe.width = f.width.value; - fe.height = f.height.value; - fe.style.width = f.width.value + (f.width.value.indexOf('%') == -1 ? 'px' : ''); - fe.style.height = f.height.value + (f.height.value.indexOf('%') == -1 ? 'px' : ''); - fe.align = f.align.options[f.align.selectedIndex].value; - } else { - h = ' 0) { - var html = ""; - - html += ''; - - return html; + return copy; } - return ""; -} + function getVal(id) { + var elm = get(id); -function getType(v) { - var fo, i, c, el, x, f = document.forms[0]; + if (elm.nodeName == "SELECT") + return elm.options[elm.selectedIndex].value; - fo = ed.getParam("media_types", "flash=swf;flv=flv;shockwave=dcr;qt=mov,qt,mpg,mp3,mp4,mpeg;shockwave=dcr;wmp=avi,wmv,wm,asf,asx,wmx,wvx;rmp=rm,ra,ram").split(';'); - - // YouTube - if (v.match(/watch\?v=(.+)(.*)/)) { - f.width.value = '425'; - f.height.value = '350'; - f.src.value = 'http://www.youtube.com/v/' + v.match(/v=(.*)(.*)/)[0].split('=')[1]; - return 'flash'; - } + if (elm.type == "checkbox") + return elm.checked; - // Google video - if (v.indexOf('http://video.google.com/videoplay?docid=') == 0) { - f.width.value = '425'; - f.height.value = '326'; - f.src.value = 'http://video.google.com/googleplayer.swf?docId=' + v.substring('http://video.google.com/videoplay?docid='.length) + '&hl=en'; - return 'flash'; + return elm.value; } - for (i=0; i 0 ? s.substring(0, s.length - 1) : s; - - return s; -} - -function setBool(pl, p, n) { - if (typeof(pl[n]) == "undefined") - return; - - document.forms[0].elements[p + "_" + n].checked = pl[n] != 'false'; -} - -function setStr(pl, p, n) { - var f = document.forms[0], e = f.elements[(p != null ? p + "_" : '') + n]; - - if (typeof(pl[n]) == "undefined") - return; - - if (e.type == "text") - e.value = pl[n]; - else - selectByValue(f, (p != null ? p + "_" : '') + n, pl[n]); -} - -function getBool(p, n, d, tv, fv) { - var v = document.forms[0].elements[p + "_" + n].checked; - - tv = typeof(tv) == 'undefined' ? 'true' : "'" + jsEncode(tv) + "'"; - fv = typeof(fv) == 'undefined' ? 'false' : "'" + jsEncode(fv) + "'"; - - return (v == d) ? '' : n + (v ? ':' + tv + ',' : ":\'" + fv + "\',"); -} + window.Media = { + init : function() { + var html, editor, self = this; -function getStr(p, n, d) { - var e = document.forms[0].elements[(p != null ? p + "_" : "") + n]; - var v = e.type == "text" ? e.value : e.options[e.selectedIndex].value; + self.editor = editor = tinyMCEPopup.editor; - if (n == 'src') - v = tinyMCEPopup.editor.convertURL(v, 'src', null); + // Setup file browsers and color pickers + get('filebrowsercontainer').innerHTML = getBrowserHTML('filebrowser','src','media','media'); + get('qtsrcfilebrowsercontainer').innerHTML = getBrowserHTML('qtsrcfilebrowser','quicktime_qtsrc','media','media'); + get('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); + get('video_altsource1_filebrowser').innerHTML = getBrowserHTML('video_filebrowser_altsource1','video_altsource1','media','media'); + get('video_altsource2_filebrowser').innerHTML = getBrowserHTML('video_filebrowser_altsource2','video_altsource2','media','media'); + get('audio_altsource1_filebrowser').innerHTML = getBrowserHTML('audio_filebrowser_altsource1','audio_altsource1','media','media'); + get('audio_altsource2_filebrowser').innerHTML = getBrowserHTML('audio_filebrowser_altsource2','audio_altsource2','media','media'); + get('video_poster_filebrowser').innerHTML = getBrowserHTML('filebrowser_poster','video_poster','media','image'); - return ((n == d || v == '') ? '' : n + ":'" + jsEncode(v) + "',"); -} + html = self.getMediaListHTML('medialist', 'src', 'media', 'media'); + if (html == "") + get("linklistrow").style.display = 'none'; + else + get("linklistcontainer").innerHTML = html; -function getInt(p, n, d) { - var e = document.forms[0].elements[(p != null ? p + "_" : "") + n]; - var v = e.type == "text" ? e.value : e.options[e.selectedIndex].value; - - return ((n == d || v == '') ? '' : n + ":" + v.replace(/[^0-9]+/g, '') + ","); -} - -function jsEncode(s) { - s = s.replace(new RegExp('\\\\', 'g'), '\\\\'); - s = s.replace(new RegExp('"', 'g'), '\\"'); - s = s.replace(new RegExp("'", 'g'), "\\'"); + if (isVisible('filebrowser')) + get('src').style.width = '230px'; + + if (isVisible('video_filebrowser_altsource1')) + get('video_altsource1').style.width = '220px'; + + if (isVisible('video_filebrowser_altsource2')) + get('video_altsource2').style.width = '220px'; + + if (isVisible('audio_filebrowser_altsource1')) + get('audio_altsource1').style.width = '220px'; + + if (isVisible('audio_filebrowser_altsource2')) + get('audio_altsource2').style.width = '220px'; + + if (isVisible('filebrowser_poster')) + get('video_poster').style.width = '220px'; + + editor.dom.setOuterHTML(get('media_type'), self.getMediaTypeHTML(editor)); + + self.setDefaultDialogSettings(editor); + self.data = clone(tinyMCEPopup.getWindowArg('data')); + self.dataToForm(); + self.preview(); + + updateColor('bgcolor_pick', 'bgcolor'); + }, + + insert : function() { + var editor = tinyMCEPopup.editor; + + this.formToData(); + editor.execCommand('mceRepaint'); + tinyMCEPopup.restoreSelection(); + editor.selection.setNode(editor.plugins.media.dataToImg(this.data)); + tinyMCEPopup.close(); + }, + + preview : function() { + get('prev').innerHTML = this.editor.plugins.media.dataToHtml(this.data, true); + }, + + moveStates : function(to_form, field) { + var data = this.data, editor = this.editor, + mediaPlugin = editor.plugins.media, ext, src, typeInfo, defaultStates, src; + + defaultStates = { + // QuickTime + quicktime_autoplay : true, + quicktime_controller : true, + + // Flash + flash_play : true, + flash_loop : true, + flash_menu : true, + + // WindowsMedia + windowsmedia_autostart : true, + windowsmedia_enablecontextmenu : true, + windowsmedia_invokeurls : true, + + // RealMedia + realmedia_autogotourl : true, + realmedia_imagestatus : true + }; + + function parseQueryParams(str) { + var out = {}; + + if (str) { + tinymce.each(str.split('&'), function(item) { + var parts = item.split('='); + + out[unescape(parts[0])] = unescape(parts[1]); + }); + } + + return out; + }; + + function setOptions(type, names) { + var i, name, formItemName, value, list; + + if (type == data.type || type == 'global') { + names = tinymce.explode(names); + for (i = 0; i < names.length; i++) { + name = names[i]; + formItemName = type == 'global' ? name : type + '_' + name; + + if (type == 'global') + list = data; + else if (type == 'video' || type == 'audio') { + list = data.video.attrs; + + if (!list && !to_form) + data.video.attrs = list = {}; + } else + list = data.params; + + if (list) { + if (to_form) { + setVal(formItemName, list[name], type == 'video' || type == 'audio' ? name : ''); + } else { + delete list[name]; + + value = getVal(formItemName); + if ((type == 'video' || type == 'audio') && value === true) + value = name; + + if (defaultStates[formItemName]) { + if (value !== defaultStates[formItemName]) { + value = "" + value; + list[name] = value; + } + } else if (value) { + value = "" + value; + list[name] = value; + } + } + } + } + } + } - return s; -} + if (!to_form) { + data.type = get('media_type').options[get('media_type').selectedIndex].value; + data.width = getVal('width'); + data.height = getVal('height'); -function generatePreview(c) { - var f = document.forms[0], p = document.getElementById('prev'), h = '', cls, pl, n, type, codebase, wp, hp, nw, nh; + // Switch type based on extension + src = getVal('src'); + if (field == 'src') { + ext = src.replace(/^.*\.([^.]+)$/, '$1'); + if (typeInfo = mediaPlugin.getType(ext)) + data.type = typeInfo.name.toLowerCase(); - p.innerHTML = ''; + setVal('media_type', data.type); + } - nw = parseInt(f.width.value); - nh = parseInt(f.height.value); + if (data.type == "video" || data.type == "audio") { + if (!data.video.sources) + data.video.sources = []; - if (f.width.value != "" && f.height.value != "") { - if (f.constrain.checked) { - if (c == 'width' && oldWidth != 0) { - wp = nw / oldWidth; - nh = Math.round(wp * nh); - f.height.value = nh; - } else if (c == 'height' && oldHeight != 0) { - hp = nh / oldHeight; - nw = Math.round(hp * nw); - f.width.value = nw; + data.video.sources[0] = {src: getVal('src')}; + } } - } - } - if (f.width.value != "") - oldWidth = nw; - - if (f.height.value != "") - oldHeight = nh; - - // After constrain - pl = serializeParameters(); - - switch (f.media_type.options[f.media_type.selectedIndex].value) { - case "flash": - cls = 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'; - codebase = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0'; - type = 'application/x-shockwave-flash'; - break; - - case "shockwave": - cls = 'clsid:166B1BCA-3F9C-11CF-8075-444553540000'; - codebase = 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0'; - type = 'application/x-director'; - break; - - case "qt": - cls = 'clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B'; - codebase = 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0'; - type = 'video/quicktime'; - break; - - case "wmp": - cls = ed.getParam('media_wmp6_compatible') ? 'clsid:05589FA1-C356-11CE-BF01-00AA0055595A' : 'clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6'; - codebase = 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'; - type = 'application/x-mplayer2'; - break; - - case "rmp": - cls = 'clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA'; - codebase = 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'; - type = 'audio/x-pn-realaudio-plugin'; - break; - } + // Hide all fieldsets and show the one active + get('video_options').style.display = 'none'; + get('audio_options').style.display = 'none'; + get('flash_options').style.display = 'none'; + get('quicktime_options').style.display = 'none'; + get('shockwave_options').style.display = 'none'; + get('windowsmedia_options').style.display = 'none'; + get('realmedia_options').style.display = 'none'; + get('embeddedaudio_options').style.display = 'none'; + + if (get(data.type + '_options')) + get(data.type + '_options').style.display = 'block'; + + setVal('media_type', data.type); + + setOptions('flash', 'play,loop,menu,swliveconnect,quality,scale,salign,wmode,base,flashvars'); + setOptions('quicktime', 'loop,autoplay,cache,controller,correction,enablejavascript,kioskmode,autohref,playeveryframe,targetcache,scale,starttime,endtime,target,qtsrcchokespeed,volume,qtsrc'); + setOptions('shockwave', 'sound,progress,autostart,swliveconnect,swvolume,swstretchstyle,swstretchhalign,swstretchvalign'); + setOptions('windowsmedia', 'autostart,enabled,enablecontextmenu,fullscreen,invokeurls,mute,stretchtofit,windowlessvideo,balance,baseurl,captioningid,currentmarker,currentposition,defaultframe,playcount,rate,uimode,volume'); + setOptions('realmedia', 'autostart,loop,autogotourl,center,imagestatus,maintainaspect,nojava,prefetch,shuffle,console,controls,numloop,scriptcallbacks'); + setOptions('video', 'poster,autoplay,loop,muted,preload,controls'); + setOptions('audio', 'autoplay,loop,preload,controls'); + setOptions('embeddedaudio', 'autoplay,loop,controls'); + setOptions('global', 'id,name,vspace,hspace,bgcolor,align,width,height'); + + if (to_form) { + if (data.type == 'video') { + if (data.video.sources[0]) + setVal('src', data.video.sources[0].src); + + src = data.video.sources[1]; + if (src) + setVal('video_altsource1', src.src); + + src = data.video.sources[2]; + if (src) + setVal('video_altsource2', src.src); + } else if (data.type == 'audio') { + if (data.video.sources[0]) + setVal('src', data.video.sources[0].src); + + src = data.video.sources[1]; + if (src) + setVal('audio_altsource1', src.src); + + src = data.video.sources[2]; + if (src) + setVal('audio_altsource2', src.src); + } else { + // Check flash vars + if (data.type == 'flash') { + tinymce.each(editor.getParam('flash_video_player_flashvars', {url : '$url', poster : '$poster'}), function(value, name) { + if (value == '$url') + data.params.src = parseQueryParams(data.params.flashvars)[name] || data.params.src || ''; + }); + } + + setVal('src', data.params.src); + } + } else { + src = getVal("src"); + + // YouTube *NEW* + if (src.match(/youtu.be\/[a-z1-9.-_]+/)) { + data.width = 425; + data.height = 350; + data.params.frameborder = '0'; + data.type = 'iframe'; + src = 'http://www.youtube.com/embed/' + src.match(/youtu.be\/([a-z1-9.-_]+)/)[1]; + setVal('src', src); + setVal('media_type', data.type); + } + + // YouTube + if (src.match(/youtube.com(.+)v=([^&]+)/)) { + data.width = 425; + data.height = 350; + data.params.frameborder = '0'; + data.type = 'iframe'; + src = 'http://www.youtube.com/embed/' + src.match(/v=([^&]+)/)[1]; + setVal('src', src); + setVal('media_type', data.type); + } + + // Google video + if (src.match(/video.google.com(.+)docid=([^&]+)/)) { + data.width = 425; + data.height = 326; + data.type = 'flash'; + src = 'http://video.google.com/googleplayer.swf?docId=' + src.match(/docid=([^&]+)/)[1] + '&hl=en'; + setVal('src', src); + setVal('media_type', data.type); + } + + if (data.type == 'video') { + if (!data.video.sources) + data.video.sources = []; + + data.video.sources[0] = {src : src}; + + src = getVal("video_altsource1"); + if (src) + data.video.sources[1] = {src : src}; + + src = getVal("video_altsource2"); + if (src) + data.video.sources[2] = {src : src}; + } else if (data.type == 'audio') { + if (!data.video.sources) + data.video.sources = []; + + data.video.sources[0] = {src : src}; + + src = getVal("audio_altsource1"); + if (src) + data.video.sources[1] = {src : src}; + + src = getVal("audio_altsource2"); + if (src) + data.video.sources[2] = {src : src}; + } else + data.params.src = src; + + // Set default size + setVal('width', data.width || (data.type == 'audio' ? 300 : 320)); + setVal('height', data.height || (data.type == 'audio' ? 32 : 240)); + } + }, + + dataToForm : function() { + this.moveStates(true); + }, + + formToData : function(field) { + if (field == "width" || field == "height") + this.changeSize(field); + + if (field == 'source') { + this.moveStates(false, field); + setVal('source', this.editor.plugins.media.dataToHtml(this.data)); + this.panel = 'source'; + } else { + if (this.panel == 'source') { + this.data = clone(this.editor.plugins.media.htmlToData(getVal('source'))); + this.dataToForm(); + this.panel = ''; + } + + this.moveStates(false, field); + this.preview(); + } + }, + + beforeResize : function() { + this.width = parseInt(getVal('width') || (this.data.type == 'audio' ? "300" : "320"), 10); + this.height = parseInt(getVal('height') || (this.data.type == 'audio' ? "32" : "240"), 10); + }, + + changeSize : function(type) { + var width, height, scale, size; + + if (get('constrain').checked) { + width = parseInt(getVal('width') || (this.data.type == 'audio' ? "300" : "320"), 10); + height = parseInt(getVal('height') || (this.data.type == 'audio' ? "32" : "240"), 10); + + if (type == 'width') { + this.height = Math.round((width / this.width) * height); + setVal('height', this.height); + } else { + this.width = Math.round((height / this.height) * width); + setVal('width', this.width); + } + } + }, - if (pl == '') { - p.innerHTML = ''; - return; - } + getMediaListHTML : function() { + if (typeof(tinyMCEMediaList) != "undefined" && tinyMCEMediaList.length > 0) { + var html = ""; - pl = tinyMCEPopup.editor.plugins.media._parse(pl); + html += ''; - // Avoid annoying warning about insecure items - if (!tinymce.isIE || document.location.protocol != 'https:') { - h += ''; + return html; + } - for (n in pl) { - h += ''; + return ""; + }, - // Add extra url parameter if it's an absolute URL - if (n == 'src' && pl[n].indexOf('://') != -1) - h += ''; + getMediaTypeHTML : function(editor) { + function option(media_type){ + return '' + } + var html = ""; + html += ''; + return html; + }, + + setDefaultDialogSettings : function(editor) { + var defaultDialogSettings = editor.getParam("media_dialog_defaults", {}); + tinymce.each(defaultDialogSettings, function(v, k) { + setVal(k, v); + }); } - } - - h += ' - -
    -
    + + + @@ -24,28 +25,21 @@
    {#media_dlg.general} - +
    - + + + + diff --git a/app/code/core/Mage/Core/Controller/Varien/Front.php b/app/code/core/Mage/Core/Controller/Varien/Front.php index a3c9fe933c..0bddf590e9 100644 --- a/app/code/core/Mage/Core/Controller/Varien/Front.php +++ b/app/code/core/Mage/Core/Controller/Varien/Front.php @@ -310,7 +310,7 @@ protected function _checkBaseUrl($request) $baseUrl = Mage::getBaseUrl( Mage_Core_Model_Store::URL_TYPE_WEB, - Mage::getConfig()->shouldUrlBeSecure($request->getPathInfo()) + Mage::app()->getStore()->isCurrentlySecure() ); if (!$baseUrl) { return; @@ -322,12 +322,8 @@ protected function _checkBaseUrl($request) || isset($uri['host']) && $uri['host'] != $request->getHttpHost() || isset($uri['path']) && strpos($requestUri, $uri['path']) === false ) { - $redirectUrl = Mage::getSingleton('core/url')->getRedirectUrl( - Mage::getUrl(ltrim($request->getPathInfo(), '/'), array('_nosid' => true)) - ); - Mage::app()->getFrontController()->getResponse() - ->setRedirect($redirectUrl, $redirectCode) + ->setRedirect($baseUrl, $redirectCode) ->sendResponse(); exit; } diff --git a/app/code/core/Mage/Core/Controller/Varien/Router/Admin.php b/app/code/core/Mage/Core/Controller/Varien/Router/Admin.php index 11b587bbfa..54f7a59a4b 100644 --- a/app/code/core/Mage/Core/Controller/Varien/Router/Admin.php +++ b/app/code/core/Mage/Core/Controller/Varien/Router/Admin.php @@ -95,11 +95,9 @@ protected function _noRouteShouldBeApplied() */ protected function _shouldBeSecure($path) { - $xmlPath = Mage::getStoreConfigFlag( - Mage_Core_Model_Store::XML_PATH_SECURE_IN_ADMINHTML, - Mage_Core_Model_App::ADMIN_STORE_ID - ) ? 'default/web/secure/base_url' : 'default/web/unsecure/base_url'; - return substr((string)Mage::getConfig()->getNode($xmlPath), 0, 5) === 'https'; + return substr((string)Mage::getConfig()->getNode('default/web/unsecure/base_url'), 0, 5) === 'https' + || Mage::getStoreConfigFlag('web/secure/use_in_adminhtml', Mage_Core_Model_App::ADMIN_STORE_ID) + && substr((string)Mage::getConfig()->getNode('default/web/secure/base_url'), 0, 5) === 'https'; } /** diff --git a/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php b/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php index d201d77382..99b98d415b 100644 --- a/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php +++ b/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php @@ -460,9 +460,9 @@ protected function _getCurrentSecureUrl($request) */ protected function _shouldBeSecure($path) { - $xmlPath = Mage::getConfig()->shouldUrlBeSecure($path) - ? Mage_Core_Model_Store::XML_PATH_SECURE_BASE_URL - : Mage_Core_Model_Store::XML_PATH_UNSECURE_BASE_URL; - return substr(Mage::getStoreConfig($xmlPath), 0, 5) === 'https'; + return substr(Mage::getStoreConfig('web/unsecure/base_url'), 0, 5) === 'https' + || Mage::getStoreConfigFlag('web/secure/use_in_frontend') + && substr(Mage::getStoreConfig('web/secure/base_url'), 0, 5) == 'https' + && Mage::getConfig()->shouldUrlBeSecure($path); } } diff --git a/app/code/core/Mage/Core/Helper/Cookie.php b/app/code/core/Mage/Core/Helper/Cookie.php index cd28cea07f..17d5020a81 100644 --- a/app/code/core/Mage/Core/Helper/Cookie.php +++ b/app/code/core/Mage/Core/Helper/Cookie.php @@ -43,6 +43,11 @@ class Mage_Core_Helper_Cookie extends Mage_Core_Helper_Abstract */ const XML_PATH_COOKIE_RESTRICTION = 'web/cookie/cookie_restriction'; + /** + * Cookie restriction lifetime configuration path + */ + const XML_PATH_COOKIE_RESTRICTION_LIFETIME = 'web/cookie/cookie_restriction_lifetime'; + /** * Check if cookie restriction notice should be displayed * @@ -78,4 +83,14 @@ protected function _getAcceptedSaveCookiesWebsites() $unSerializedList = unserialize($serializedList); return is_array($unSerializedList) ? $unSerializedList : array(); } + + /** + * Get cookie restriction lifetime (in seconds) + * + * @return int + */ + public function getCookieRestrictionLifetime() + { + return (int)Mage::getStoreConfig(self::XML_PATH_COOKIE_RESTRICTION_LIFETIME); + } } diff --git a/app/code/core/Mage/Core/Model/File/Storage/Database.php b/app/code/core/Mage/Core/Model/File/Storage/Database.php index 9804c1ff68..415ebeaed9 100644 --- a/app/code/core/Mage/Core/Model/File/Storage/Database.php +++ b/app/code/core/Mage/Core/Model/File/Storage/Database.php @@ -289,6 +289,18 @@ public function renameFile($oldFilePath, $newFilePath) dirname($newFilePath) ); + $newPath = dirname($newFilePath); + $directory = Mage::getModel('core/file_storage_directory_database')->loadByPath($newPath); + + if (!$directory->getId()) { + $directory = $this->getDirectoryModel()->createRecursive($newPath); + } + + $this->loadByFilename($newFilePath); + if ($this->getId()) { + $this->setDirectoryId($directory->getId())->save(); + } + return $this; } diff --git a/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php b/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php index 06d061229d..93d5aff68d 100644 --- a/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php +++ b/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php @@ -624,7 +624,7 @@ protected function _prepareValueForSave($value, $type) /** * Check for unique values existence * - * @param Varien_Object $object + * @param Mage_Core_Model_Abstract $object * @return Mage_Core_Model_Resource_Db_Abstract * @throws Mage_Core_Exception */ @@ -656,7 +656,7 @@ protected function _checkUnique(Mage_Core_Model_Abstract $object) $select->where($unique['field'] . '=?', trim($data->getData($unique['field']))); } - if ($object->getId()) { + if ($object->getId() || $object->getId() === '0') { $select->where($this->getIdFieldName() . '!=?', $object->getId()); } diff --git a/app/code/core/Mage/Core/Model/Translate/Inline.php b/app/code/core/Mage/Core/Model/Translate/Inline.php index bdfe8e15a3..c5ebb2e8be 100644 --- a/app/code/core/Mage/Core/Model/Translate/Inline.php +++ b/app/code/core/Mage/Core/Model/Translate/Inline.php @@ -358,6 +358,16 @@ protected function _getTranslateData($regexp, &$text, $locationCallback, $option * */ protected function _tagAttributes() + { + $this->_prepareTagAttributesForContent($this->_content); + } + + /** + * Prepare tags inline translates for the content + * + * @param string $content + */ + protected function _prepareTagAttributesForContent(&$content) { if ($this->getIsJson()) { $quoteHtml = '\"'; @@ -368,7 +378,7 @@ protected function _tagAttributes() $tagMatch = array(); $nextTag = 0; $tagRegExp = '#<([a-z]+)\s*?[^>]+?((' . $this->_tokenRegex . ')[^>]*?)+/?>#i'; - while (preg_match($tagRegExp, $this->_content, $tagMatch, PREG_OFFSET_CAPTURE, $nextTag)) { + while (preg_match($tagRegExp, $content, $tagMatch, PREG_OFFSET_CAPTURE, $nextTag)) { $next = 0; $tagHtml = $tagMatch[0][0]; $m = array(); @@ -384,7 +394,7 @@ protected function _tagAttributes() $trAttr = ' translate=' . $quoteHtml . htmlspecialchars('[' . join(',', $trArr) . ']') . $quoteHtml; } - $this->_content = substr_replace($this->_content, $tagHtml, $tagMatch[0][1], strlen($tagMatch[0][0])); + $content = substr_replace($content, $tagHtml, $tagMatch[0][1], strlen($tagMatch[0][0])); } $nextTag = $tagMatch[0][1] + strlen($tagHtml); } @@ -492,7 +502,7 @@ protected function _translateTags(&$body, $tagsList, $formatCallback, $isNeedTra } if ($isNeedTranslateAttributes) { - $this->_tagAttributes($tagEnd); + $this->_prepareTagAttributesForContent($tagEnd); } $tagHtml .= $tagEnd; diff --git a/app/code/core/Mage/Core/etc/system.xml b/app/code/core/Mage/Core/etc/system.xml index aaadb7a248..37b31d4331 100644 --- a/app/code/core/Mage/Core/etc/system.xml +++ b/app/code/core/Mage/Core/etc/system.xml @@ -1149,7 +1149,7 @@ 11 - + select adminhtml/system_config_source_yesno @@ -1158,6 +1158,7 @@ 1 0 0 + Warning! When using Store Code in URLs, in some cases system may not work properly if URLs without Store Codes are specified in the third party services (e.g. PayPal etc.).]]> diff --git a/app/code/core/Mage/Customer/Model/Api2/Customer/Address.php b/app/code/core/Mage/Customer/Model/Api2/Customer/Address.php index e37c4936f0..582bf60f4c 100644 --- a/app/code/core/Mage/Customer/Model/Api2/Customer/Address.php +++ b/app/code/core/Mage/Customer/Model/Api2/Customer/Address.php @@ -80,15 +80,24 @@ protected function _isDefaultShippingAddress(Mage_Customer_Model_Address $addres * If id is not found then return passed $region * * @param string $region + * @param string $countryId * @return int|string */ - protected function _getRegionIdByNameOrCode($region) + protected function _getRegionIdByNameOrCode($region, $countryId) { - $id = Mage::getResourceModel('directory/region_collection') - ->addFieldToFilter(array('default_name', 'code'), array($region, $region)) - ->getFirstItem() - ->getId(); - return $id ? $id : $region; + /** @var $collection Mage_Directory_Model_Resource_Region_Collection */ + $collection = Mage::getResourceModel('directory/region_collection'); + + $collection->getSelect() + ->reset() // to avoid locale usage + ->from(array('main_table' => $collection->getMainTable()), 'region_id'); + + $collection->addCountryFilter($countryId) + ->addFieldToFilter(array('default_name', 'code'), array($region, $region)); + + $id = $collection->getResource()->getReadConnection()->fetchOne($collection->getSelect()); + + return $id ? (int)$id : $region; } /** diff --git a/app/code/core/Mage/Customer/Model/Api2/Customer/Address/Rest.php b/app/code/core/Mage/Customer/Model/Api2/Customer/Address/Rest.php index bbb54bfb4d..605de7eda6 100644 --- a/app/code/core/Mage/Customer/Model/Api2/Customer/Address/Rest.php +++ b/app/code/core/Mage/Customer/Model/Api2/Customer/Address/Rest.php @@ -54,7 +54,9 @@ protected function _create(array $data) $this->_critical(self::RESOURCE_DATA_PRE_VALIDATION_ERROR); } - $data['region'] = $this->_getRegionIdByNameOrCode($data['region']); + if (isset($data['region']) && isset($data['country_id'])) { + $data['region'] = $this->_getRegionIdByNameOrCode($data['region'], $data['country_id']); + } /* @var $address Mage_Customer_Model_Address */ $address = Mage::getModel('customer/address'); @@ -154,8 +156,12 @@ protected function _update(array $data) } $this->_critical(self::RESOURCE_DATA_PRE_VALIDATION_ERROR); } - - $data['region'] = isset($data['region']) ? $this->_getRegionIdByNameOrCode($data['region']) : null; + if (isset($data['region'])) { + $data['region'] = $this->_getRegionIdByNameOrCode( + $data['region'], isset($data['country_id']) ? $data['country_id'] : $address->getCountryId() + ); + $data['region_id'] = null; // to avoid overwrite region during update in address model _beforeSave() + } $address->addData($data); try { diff --git a/app/code/core/Mage/Customer/Model/Api2/Customer/Address/Validator.php b/app/code/core/Mage/Customer/Model/Api2/Customer/Address/Validator.php index c86db50d53..982ff09683 100644 --- a/app/code/core/Mage/Customer/Model/Api2/Customer/Address/Validator.php +++ b/app/code/core/Mage/Customer/Model/Api2/Customer/Address/Validator.php @@ -46,16 +46,22 @@ class Mage_Customer_Model_Api2_Customer_Address_Validator extends Mage_Api2_Mode */ public function filter(array $data) { - $data = parent::filter($data); + $filteredData = parent::filter($data); // If the array contains more than two elements, then combine the extra elements in a string - if (isset($data['street']) && is_array($data['street']) && count($data['street']) > 2) { - $data['street'][1] .= self::STREET_SEPARATOR - . implode(self::STREET_SEPARATOR, array_slice($data['street'], 2)); - $filteredData['street'] = array_slice($data['street'], 0, 2); + if (isset($filteredData['street']) && is_array($filteredData['street']) && count($filteredData['street']) > 2) { + $filteredData['street'][1] .= self::STREET_SEPARATOR + . implode(self::STREET_SEPARATOR, array_slice($filteredData['street'], 2)); + $filteredData['street'] = array_slice($filteredData['street'], 0, 2); } - - return $data; + // pass default addresses info + if (isset($data['is_default_billing'])) { + $filteredData['is_default_billing'] = $data['is_default_billing']; + } + if (isset($data['is_default_shipping'])) { + $filteredData['is_default_shipping'] = $data['is_default_shipping']; + } + return $filteredData; } /** @@ -66,15 +72,7 @@ public function filter(array $data) */ public function isValidDataForCreateAssociationWithCountry(array $data) { - // Check the country - $country = $this->_checkCountry($data); - if (false == $country) { - // break the validation if the country is not valid - return false; - } - - // Check the region - return $this->_checkRegion($data, $country); + return $this->_checkRegion($data, Mage::getModel('directory/country')->loadByCode($data['country_id'])); } /** @@ -89,62 +87,15 @@ public function isValidDataForChangeAssociationWithCountry(Mage_Customer_Model_A if (!isset($data['country_id']) && !isset($data['region'])) { return true; } - - // Check the country - if (array_key_exists('country_id', $data)) { - $country = $this->_checkCountry($data); - if (false == $country) { - // break the validation if the country is not valid - return false; - } + // If country is in data - it has been already validated. If no - load current country. + if (isset($data['country_id'])) { + $country = Mage::getModel('directory/country')->loadByCode($data['country_id']); } else { - // if the country is not passed load the current country $country = $address->getCountryModel(); } - - // Check the region return $this->_checkRegion($data, $country); } - /** - * Check country - * - * @param array $data - * @return bool|Mage_Directory_Model_Country - */ - protected function _checkCountry($data) - { - if (!array_key_exists('country_id', $data)) { - $this->_addError('"Country" is required.'); - return false; - } - - if (!is_string($data['country_id'])) { - $this->_addError('Invalid country identifier type.'); - return false; - } - - if ('' == trim($data['country_id'])) { - $this->_addError('"Country" is required.'); - return false; - } - - $validator = new Zend_Validate_StringLength(array('min' => 2, 'max' => 3)); - if (!$validator->isValid($data['country_id'])) { - $this->_addError("Country is not between '2' and '3' inclusively."); - return false; - } - - /* @var $country Mage_Directory_Model_Country */ - $country = Mage::getModel('directory/country')->loadByCode($data['country_id']); - if (!$country->getId()) { - $this->_addError('Country does not exist.'); - return false; - } - - return $country; - } - /** * Check region * diff --git a/app/code/core/Mage/Customer/Model/Api2/Customer/Rest.php b/app/code/core/Mage/Customer/Model/Api2/Customer/Rest.php index 772bb38c66..f6e971c4b4 100644 --- a/app/code/core/Mage/Customer/Model/Api2/Customer/Rest.php +++ b/app/code/core/Mage/Customer/Model/Api2/Customer/Rest.php @@ -42,10 +42,7 @@ abstract class Mage_Customer_Model_Api2_Customer_Rest extends Mage_Customer_Mode protected function _create(array $data) { /** @var $validator Mage_Api2_Model_Resource_Validator_Eav */ - $validator = Mage::getResourceModel('api2/validator_eav', array( - 'resource' => $this, - 'operation' => self::OPERATION_CREATE - )); + $validator = Mage::getResourceModel('api2/validator_eav', array('resource' => $this)); $data = $validator->filter($data); if (!$validator->isValidData($data)) { @@ -104,15 +101,14 @@ protected function _update(array $data) { /** @var $customer Mage_Customer_Model_Customer */ $customer = $this->_loadCustomerById($this->getRequest()->getParam('id')); - /** @var $validator Mage_Api2_Model_Resource_Validator_Eav */ - $validator = Mage::getResourceModel('api2/validator_eav', array( - 'resource' => $this, - 'operation' => self::OPERATION_UPDATE - )); + $validator = Mage::getResourceModel('api2/validator_eav', array('resource' => $this)); $data = $validator->filter($data); - if (!$validator->isValidData($data)) { + + unset($data['website_id']); // website is not allowed to change + + if (!$validator->isValidData($data, true)) { foreach ($validator->getErrors() as $error) { $this->_error($error, Mage_Api2_Model_Server::HTTP_BAD_REQUEST); } diff --git a/app/code/core/Mage/Downloadable/Model/Sales/Order/Pdf/Items/Creditmemo.php b/app/code/core/Mage/Downloadable/Model/Sales/Order/Pdf/Items/Creditmemo.php index 40001be7e8..5a7263e14f 100644 --- a/app/code/core/Mage/Downloadable/Model/Sales/Order/Pdf/Items/Creditmemo.php +++ b/app/code/core/Mage/Downloadable/Model/Sales/Order/Pdf/Items/Creditmemo.php @@ -47,86 +47,57 @@ public function draw() $page = $this->getPage(); $lines = array(); - $leftBound = 35; - $rightBound = 565; - - $x = $leftBound; // draw Product name $lines[0] = array(array( - 'text' => Mage::helper('core/string')->str_split($item->getName(), 60, true, true), - 'feed' => $x, + 'text' => Mage::helper('core/string')->str_split($item->getName(), 35, true, true), + 'feed' => 35, )); - $x += 220; // draw SKU $lines[0][] = array( - 'text' => Mage::helper('core/string')->str_split($this->getSku($item), 25), - 'feed' => $x + 'text' => Mage::helper('core/string')->str_split($this->getSku($item), 17), + 'feed' => 255, + 'align' => 'right' ); - $x += 100; // draw Total (ex) - $i = 0; - $prices = $this->getItemPricesForDisplay(); - foreach ($prices as $priceData){ - if (isset($priceData['label'])) { - // draw Subtotal label - $lines[$i][] = array( - 'text' => $priceData['label'], - 'feed' => $x, - 'align' => 'right', - 'width' => 50, - ); - $i++; - } - // draw Subtotal - $lines[$i][] = array( - 'text' => $priceData['subtotal'], - 'feed' => $x, - 'font' => 'bold', - 'align' => 'right', - 'width' => 50, - ); - $i++; - } + $lines[0][] = array( + 'text' => $order->formatPriceTxt($item->getRowTotal()), + 'feed' => 330, + 'font' => 'bold', + 'align' => 'right', + ); - $x += 50; // draw Discount $lines[0][] = array( 'text' => $order->formatPriceTxt(-$item->getDiscountAmount()), - 'feed' => $x, + 'feed' => 380, 'font' => 'bold', - 'align' => 'right', - 'width' => 50, + 'align' => 'right' ); - $x += 50; // draw QTY $lines[0][] = array( - 'text' => $item->getQty()*1, - 'feed' => $x, + 'text' => $item->getQty() * 1, + 'feed' => 445, 'font' => 'bold', - 'align' => 'center', - 'width' => 30, + 'align' => 'right', ); - $x += 30; // draw Tax $lines[0][] = array( 'text' => $order->formatPriceTxt($item->getTaxAmount()), - 'feed' => $x, + 'feed' => 495, 'font' => 'bold', - 'align' => 'right', - 'width' => 45, + 'align' => 'right' ); - $x += 45; - // draw Subtotal - $subtotal = $item->getRowTotal() - + $item->getTaxAmount() + $item->getHiddenTaxAmount() - $item->getDiscountAmount(); + // draw Total (inc) + $subtotal = $item->getRowTotal() + $item->getTaxAmount() + $item->getHiddenTaxAmount() + - $item->getDiscountAmount(); $lines[0][] = array( 'text' => $order->formatPriceTxt($subtotal), - 'feed' => $rightBound, + 'feed' => 565, 'font' => 'bold', 'align' => 'right' ); @@ -137,18 +108,16 @@ public function draw() foreach ($options as $option) { // draw options label $lines[][] = array( - 'text' => Mage::helper('core/string')->str_split(strip_tags($option['label']), 70, true, true), + 'text' => Mage::helper('core/string')->str_split(strip_tags($option['label']), 40, true, true), 'font' => 'italic', - 'feed' => $leftBound + 'feed' => 35 ); // draw options value - $_printValue = isset($option['print_value']) - ? $option['print_value'] - : strip_tags($option['value']); + $_printValue = isset($option['print_value']) ? $option['print_value'] : strip_tags($option['value']); $lines[][] = array( - 'text' => Mage::helper('core/string')->str_split($_printValue, 50, true, true), - 'feed' => $leftBound + 5 + 'text' => Mage::helper('core/string')->str_split($_printValue, 30, true, true), + 'feed' => 40 ); } } @@ -173,7 +142,7 @@ public function draw() $lineBlock = array( 'lines' => $lines, - 'height' => 10 + 'height' => 20 ); $page = $pdf->drawLineBlocks($page, array($lineBlock), array('table_header' => true)); diff --git a/app/code/core/Mage/Downloadable/Model/Sales/Order/Pdf/Items/Invoice.php b/app/code/core/Mage/Downloadable/Model/Sales/Order/Pdf/Items/Invoice.php index ea6190d212..f31bd27421 100644 --- a/app/code/core/Mage/Downloadable/Model/Sales/Order/Pdf/Items/Invoice.php +++ b/app/code/core/Mage/Downloadable/Model/Sales/Order/Pdf/Items/Invoice.php @@ -49,37 +49,41 @@ public function draw() // draw Product name $lines[0] = array(array( - 'text' => Mage::helper('core/string')->str_split($item->getName(), 64, true, true), + 'text' => Mage::helper('core/string')->str_split($item->getName(), 35, true, true), 'feed' => 35, )); // draw SKU $lines[0][] = array( - 'text' => Mage::helper('core/string')->str_split($this->getSku($item), 25), - 'feed' => 255 + 'text' => Mage::helper('core/string')->str_split($this->getSku($item), 17), + 'feed' => 290, + 'align' => 'right' ); // draw QTY $lines[0][] = array( - 'text' => $item->getQty()*1, - 'feed' => 435 + 'text' => $item->getQty() * 1, + 'feed' => 435, + 'align' => 'right' ); // draw item Prices $i = 0; $prices = $this->getItemPricesForDisplay(); + $feedPrice = 395; + $feedSubtotal = $feedPrice + 170; foreach ($prices as $priceData){ if (isset($priceData['label'])) { // draw Price label $lines[$i][] = array( 'text' => $priceData['label'], - 'feed' => 395, + 'feed' => $feedPrice, 'align' => 'right' ); // draw Subtotal label $lines[$i][] = array( 'text' => $priceData['label'], - 'feed' => 565, + 'feed' => $feedSubtotal, 'align' => 'right' ); $i++; @@ -87,14 +91,14 @@ public function draw() // draw Price $lines[$i][] = array( 'text' => $priceData['price'], - 'feed' => 395, + 'feed' => $feedPrice, 'font' => 'bold', 'align' => 'right' ); // draw Subtotal $lines[$i][] = array( 'text' => $priceData['subtotal'], - 'feed' => 565, + 'feed' => $feedSubtotal, 'font' => 'bold', 'align' => 'right' ); @@ -115,7 +119,7 @@ public function draw() foreach ($options as $option) { // draw options label $lines[][] = array( - 'text' => Mage::helper('core/string')->str_split(strip_tags($option['label']), 70, true, true), + 'text' => Mage::helper('core/string')->str_split(strip_tags($option['label']), 40, true, true), 'font' => 'italic', 'feed' => 35 ); @@ -129,7 +133,7 @@ public function draw() $values = explode(', ', $_printValue); foreach ($values as $value) { $lines[][] = array( - 'text' => Mage::helper('core/string')->str_split($value, 50, true, true), + 'text' => Mage::helper('core/string')->str_split($value, 30, true, true), 'feed' => 40 ); } @@ -157,7 +161,7 @@ public function draw() $lineBlock = array( 'lines' => $lines, - 'height' => 10 + 'height' => 20 ); $page = $pdf->drawLineBlocks($page, array($lineBlock), array('table_header' => true)); diff --git a/app/code/core/Mage/OAuth/Block/Authorize/Style.php b/app/code/core/Mage/OAuth/Block/Authorize/Style.php deleted file mode 100644 index 0f166479a1..0000000000 --- a/app/code/core/Mage/OAuth/Block/Authorize/Style.php +++ /dev/null @@ -1,47 +0,0 @@ - - */ -class Mage_OAuth_Block_Authorize_Style extends Mage_OAuth_Block_Authorize_Abstract -{ - /** - * Set default data - */ - public function __construct() - { - parent::__construct(); - - //default load template from admin package - $this->setIsSimple(true); - } - -} diff --git a/app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/Admin/Token.php b/app/code/core/Mage/Oauth/Block/Adminhtml/Oauth/Admin/Token.php similarity index 88% rename from app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/Admin/Token.php rename to app/code/core/Mage/Oauth/Block/Adminhtml/Oauth/Admin/Token.php index 8bbcee994a..39e4cd54c8 100644 --- a/app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/Admin/Token.php +++ b/app/code/core/Mage/Oauth/Block/Adminhtml/Oauth/Admin/Token.php @@ -19,7 +19,7 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -28,10 +28,10 @@ * OAuth consumers grid container block * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @author Magento Core Team */ -class Mage_OAuth_Block_Adminhtml_OAuth_Admin_Token extends Mage_Adminhtml_Block_Widget_Grid_Container +class Mage_Oauth_Block_Adminhtml_Oauth_Admin_Token extends Mage_Adminhtml_Block_Widget_Grid_Container { /** * Construct grid container @@ -41,7 +41,7 @@ public function __construct() parent::__construct(); $this->_blockGroup = 'oauth'; - $this->_controller = 'adminhtml_oAuth_admin_token'; + $this->_controller = 'adminhtml_oauth_admin_token'; $this->_headerText = Mage::helper('adminhtml')->__('My Applications'); $this->_removeButton('add'); } diff --git a/app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/Admin/Token/Grid.php b/app/code/core/Mage/Oauth/Block/Adminhtml/Oauth/Admin/Token/Grid.php similarity index 90% rename from app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/Admin/Token/Grid.php rename to app/code/core/Mage/Oauth/Block/Adminhtml/Oauth/Admin/Token/Grid.php index c7bfbc6b19..5b31968f30 100644 --- a/app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/Admin/Token/Grid.php +++ b/app/code/core/Mage/Oauth/Block/Adminhtml/Oauth/Admin/Token/Grid.php @@ -19,7 +19,7 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -28,10 +28,10 @@ * OAuth My Application grid block * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @author Magento Core Team */ -class Mage_OAuth_Block_Adminhtml_OAuth_Admin_Token_Grid extends Mage_Adminhtml_Block_Widget_Grid +class Mage_Oauth_Block_Adminhtml_Oauth_Admin_Token_Grid extends Mage_Adminhtml_Block_Widget_Grid { /** * Construct grid block @@ -49,17 +49,17 @@ public function __construct() /** * Prepare collection * - * @return Mage_OAuth_Block_Adminhtml_OAuth_Admin_Token_Grid + * @return Mage_Oauth_Block_Adminhtml_Oauth_Admin_Token_Grid */ protected function _prepareCollection() { /** @var $user Mage_Admin_Model_User */ $user = Mage::getSingleton('admin/session')->getData('user'); - /** @var $collection Mage_OAuth_Model_Resource_Token_Collection */ + /** @var $collection Mage_Oauth_Model_Resource_Token_Collection */ $collection = Mage::getModel('oauth/token')->getCollection(); $collection->joinConsumerAsApplication() - ->addFilterByType(Mage_OAuth_Model_Token::TYPE_ACCESS) + ->addFilterByType(Mage_Oauth_Model_Token::TYPE_ACCESS) ->addFilterByAdminId($user->getId()); $this->setCollection($collection); @@ -70,7 +70,7 @@ protected function _prepareCollection() /** * Prepare columns * - * @return Mage_OAuth_Block_Adminhtml_OAuth_Admin_Token_Grid + * @return Mage_Oauth_Block_Adminhtml_Oauth_Admin_Token_Grid */ protected function _prepareColumns() { @@ -105,7 +105,7 @@ protected function _prepareColumns() /** * Add mass-actions to grid * - * @return Mage_OAuth_Block_Adminhtml_OAuth_Admin_Token_Grid + * @return Mage_Oauth_Block_Adminhtml_Oauth_Admin_Token_Grid */ protected function _prepareMassaction() { diff --git a/app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/Authorize.php b/app/code/core/Mage/Oauth/Block/Adminhtml/Oauth/Authorize.php similarity index 81% rename from app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/Authorize.php rename to app/code/core/Mage/Oauth/Block/Adminhtml/Oauth/Authorize.php index e3174c6e1e..6f1856d56c 100644 --- a/app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/Authorize.php +++ b/app/code/core/Mage/Oauth/Block/Adminhtml/Oauth/Authorize.php @@ -19,7 +19,7 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -28,11 +28,21 @@ * OAuth admin authorization block * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @author Magento Core Team */ -class Mage_OAuth_Block_Adminhtml_OAuth_Authorize extends Mage_OAuth_Block_AuthorizeBaseAbstract +class Mage_Oauth_Block_Adminhtml_Oauth_Authorize extends Mage_Oauth_Block_AuthorizeBaseAbstract { + /** + * Retrieve Session Form Key + * + * @return string + */ + public function getFormKey() + { + return Mage::getSingleton('core/session')->getFormKey(); + } + /** * Retrieve admin form posting url * @@ -40,11 +50,7 @@ class Mage_OAuth_Block_Adminhtml_OAuth_Authorize extends Mage_OAuth_Block_Author */ public function getPostActionUrl() { - $params = array(); - if ($this->getIsSimple()) { - $params['simple'] = 1; - } - return $this->getUrl('adminhtml/index/login', $params); + return $this->getUrl('*/*/*'); } /** @@ -74,6 +80,6 @@ public function getFormTitle() */ public function getRejectUrlPath() { - return 'adminhtml/oAuth_authorize/reject'; + return 'adminhtml/oauth_authorize/reject'; } } diff --git a/app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/Authorize/Button.php b/app/code/core/Mage/Oauth/Block/Adminhtml/Oauth/Authorize/Button.php similarity index 83% rename from app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/Authorize/Button.php rename to app/code/core/Mage/Oauth/Block/Adminhtml/Oauth/Authorize/Button.php index aa6e23537a..9a669327a3 100644 --- a/app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/Authorize/Button.php +++ b/app/code/core/Mage/Oauth/Block/Adminhtml/Oauth/Authorize/Button.php @@ -19,7 +19,7 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -28,10 +28,10 @@ * OAuth authorization block with auth buttons * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @author Magento Core Team */ -class Mage_OAuth_Block_Adminhtml_OAuth_Authorize_Button extends Mage_OAuth_Block_Authorize_ButtonBaseAbstract +class Mage_Oauth_Block_Adminhtml_Oauth_Authorize_Button extends Mage_Oauth_Block_Authorize_ButtonBaseAbstract { /** * Retrieve confirm authorization url path @@ -40,7 +40,7 @@ class Mage_OAuth_Block_Adminhtml_OAuth_Authorize_Button extends Mage_OAuth_Block */ public function getConfirmUrlPath() { - return 'adminhtml/oAuth_authorize/confirm'; + return 'adminhtml/oauth_authorize/confirm'; } /** @@ -50,6 +50,6 @@ public function getConfirmUrlPath() */ public function getRejectUrlPath() { - return 'adminhtml/oAuth_authorize/reject'; + return 'adminhtml/oauth_authorize/reject'; } } diff --git a/app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/AuthorizedTokens.php b/app/code/core/Mage/Oauth/Block/Adminhtml/Oauth/AuthorizedTokens.php similarity index 88% rename from app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/AuthorizedTokens.php rename to app/code/core/Mage/Oauth/Block/Adminhtml/Oauth/AuthorizedTokens.php index b307a59af9..24fcf69305 100644 --- a/app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/AuthorizedTokens.php +++ b/app/code/core/Mage/Oauth/Block/Adminhtml/Oauth/AuthorizedTokens.php @@ -19,7 +19,7 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -28,10 +28,10 @@ * OAuth authorized tokens grid container block * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @author Magento Core Team */ -class Mage_OAuth_Block_Adminhtml_OAuth_AuthorizedTokens extends Mage_Adminhtml_Block_Widget_Grid_Container +class Mage_Oauth_Block_Adminhtml_Oauth_AuthorizedTokens extends Mage_Adminhtml_Block_Widget_Grid_Container { /** * Construct grid container @@ -41,7 +41,7 @@ public function __construct() parent::__construct(); $this->_blockGroup = 'oauth'; - $this->_controller = 'adminhtml_oAuth_authorizedTokens'; + $this->_controller = 'adminhtml_oauth_authorizedTokens'; $this->_headerText = Mage::helper('adminhtml')->__('Authorized OAuth Tokens'); $this->_removeButton('add'); diff --git a/app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/AuthorizedTokens/Grid.php b/app/code/core/Mage/Oauth/Block/Adminhtml/Oauth/AuthorizedTokens/Grid.php similarity index 90% rename from app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/AuthorizedTokens/Grid.php rename to app/code/core/Mage/Oauth/Block/Adminhtml/Oauth/AuthorizedTokens/Grid.php index 69e3d948ac..354b89b9e6 100644 --- a/app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/AuthorizedTokens/Grid.php +++ b/app/code/core/Mage/Oauth/Block/Adminhtml/Oauth/AuthorizedTokens/Grid.php @@ -19,7 +19,7 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -28,10 +28,10 @@ * OAuth authorized tokens grid block * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @author Magento Core Team */ -class Mage_OAuth_Block_Adminhtml_OAuth_AuthorizedTokens_Grid extends Mage_Adminhtml_Block_Widget_Grid +class Mage_Oauth_Block_Adminhtml_Oauth_AuthorizedTokens_Grid extends Mage_Adminhtml_Block_Widget_Grid { /** * Construct grid block @@ -49,14 +49,14 @@ public function __construct() /** * Prepare collection * - * @return Mage_OAuth_Block_Adminhtml_OAuth_AuthorizedTokens_Grid + * @return Mage_Oauth_Block_Adminhtml_Oauth_AuthorizedTokens_Grid */ protected function _prepareCollection() { - /** @var $collection Mage_OAuth_Model_Resource_Token_Collection */ + /** @var $collection Mage_Oauth_Model_Resource_Token_Collection */ $collection = Mage::getModel('oauth/token')->getCollection(); $collection->joinConsumerAsApplication() - ->addFilterByType(Mage_OAuth_Model_Token::TYPE_ACCESS); + ->addFilterByType(Mage_Oauth_Model_Token::TYPE_ACCESS); $this->setCollection($collection); parent::_prepareCollection(); @@ -66,7 +66,7 @@ protected function _prepareCollection() /** * Prepare columns * - * @return Mage_OAuth_Block_Adminhtml_OAuth_AuthorizedTokens_Grid + * @return Mage_Oauth_Block_Adminhtml_Oauth_AuthorizedTokens_Grid */ protected function _prepareColumns() { @@ -125,7 +125,7 @@ public function getGridUrl() /** * Get revoke URL * - * @param Mage_OAuth_Model_Token $row + * @param Mage_Oauth_Model_Token $row * @return string|null */ public function getRevokeUrl($row) @@ -136,7 +136,7 @@ public function getRevokeUrl($row) /** * Get delete URL * - * @param Mage_OAuth_Model_Token $row + * @param Mage_Oauth_Model_Token $row * @return string|null */ public function getDeleteUrl($row) @@ -147,7 +147,7 @@ public function getDeleteUrl($row) /** * Add mass-actions to grid * - * @return Mage_OAuth_Block_Adminhtml_OAuth_AuthorizedTokens_Grid + * @return Mage_Oauth_Block_Adminhtml_Oauth_AuthorizedTokens_Grid */ protected function _prepareMassaction() { @@ -179,7 +179,7 @@ protected function _prepareMassaction() * Decorate user type column * * @param string $value - * @param Mage_OAuth_Model_Token $row + * @param Mage_Oauth_Model_Token $row * @param Mage_Adminhtml_Block_Widget_Grid_Column $column * @param bool $isExport * @return mixed @@ -198,7 +198,7 @@ public function decorateUserType($value, $row, $column, $isExport) * Decorate user type column * * @param string $value - * @param Mage_OAuth_Model_Token $row + * @param Mage_Oauth_Model_Token $row * @param Mage_Adminhtml_Block_Widget_Grid_Column $column * @param bool $isExport * @return mixed diff --git a/app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/Consumer.php b/app/code/core/Mage/Oauth/Block/Adminhtml/Oauth/Consumer.php similarity index 90% rename from app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/Consumer.php rename to app/code/core/Mage/Oauth/Block/Adminhtml/Oauth/Consumer.php index b4c9dca891..a862047a64 100644 --- a/app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/Consumer.php +++ b/app/code/core/Mage/Oauth/Block/Adminhtml/Oauth/Consumer.php @@ -19,7 +19,7 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -28,10 +28,10 @@ * OAuth consumers grid container block * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @author Magento Core Team */ -class Mage_OAuth_Block_Adminhtml_OAuth_Consumer extends Mage_Adminhtml_Block_Widget_Grid_Container +class Mage_Oauth_Block_Adminhtml_Oauth_Consumer extends Mage_Adminhtml_Block_Widget_Grid_Container { /** * Construct grid container @@ -41,7 +41,7 @@ public function __construct() parent::__construct(); $this->_blockGroup = 'oauth'; - $this->_controller = 'adminhtml_oAuth_consumer'; + $this->_controller = 'adminhtml_oauth_consumer'; $this->_headerText = Mage::helper('adminhtml')->__('OAuth Consumers'); //check allow edit diff --git a/app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/Consumer/Edit.php b/app/code/core/Mage/Oauth/Block/Adminhtml/Oauth/Consumer/Edit.php similarity index 91% rename from app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/Consumer/Edit.php rename to app/code/core/Mage/Oauth/Block/Adminhtml/Oauth/Consumer/Edit.php index de7eb17b4b..e57262b304 100644 --- a/app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/Consumer/Edit.php +++ b/app/code/core/Mage/Oauth/Block/Adminhtml/Oauth/Consumer/Edit.php @@ -19,7 +19,7 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -29,22 +29,22 @@ * OAuth Consumer Edit Block * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @author Magento Core Team */ -class Mage_OAuth_Block_Adminhtml_OAuth_Consumer_Edit extends Mage_Adminhtml_Block_Widget_Form_Container +class Mage_Oauth_Block_Adminhtml_Oauth_Consumer_Edit extends Mage_Adminhtml_Block_Widget_Form_Container { /** * Consumer model * - * @var Mage_OAuth_Model_Consumer + * @var Mage_Oauth_Model_Consumer */ protected $_model; /** * Get consumer model * - * @return Mage_OAuth_Model_Consumer + * @return Mage_Oauth_Model_Consumer */ public function getModel() { @@ -61,7 +61,7 @@ public function __construct() { parent::__construct(); $this->_blockGroup = 'oauth'; - $this->_controller = 'adminhtml_oAuth_consumer'; + $this->_controller = 'adminhtml_oauth_consumer'; $this->_mode = 'edit'; $this->_addButton('save_and_continue', array( diff --git a/app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/Consumer/Edit/Form.php b/app/code/core/Mage/Oauth/Block/Adminhtml/Oauth/Consumer/Edit/Form.php similarity index 93% rename from app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/Consumer/Edit/Form.php rename to app/code/core/Mage/Oauth/Block/Adminhtml/Oauth/Consumer/Edit/Form.php index 8d27f2a1c4..79283044aa 100644 --- a/app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/Consumer/Edit/Form.php +++ b/app/code/core/Mage/Oauth/Block/Adminhtml/Oauth/Consumer/Edit/Form.php @@ -19,7 +19,7 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -29,22 +29,22 @@ * OAuth consumer edit form block * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @author Magento Core Team */ -class Mage_OAuth_Block_Adminhtml_OAuth_Consumer_Edit_Form extends Mage_Adminhtml_Block_Widget_Form +class Mage_Oauth_Block_Adminhtml_Oauth_Consumer_Edit_Form extends Mage_Adminhtml_Block_Widget_Form { /** * Consumer model * - * @var Mage_OAuth_Model_Consumer + * @var Mage_Oauth_Model_Consumer */ protected $_model; /** * Get consumer model * - * @return Mage_OAuth_Model_Consumer + * @return Mage_Oauth_Model_Consumer */ public function getModel() { @@ -57,7 +57,7 @@ public function getModel() /** * Prepare form before rendering HTML * - * @return Mage_OAuth_Block_Adminhtml_OAuth_Consumer_Edit_Form + * @return Mage_Oauth_Block_Adminhtml_Oauth_Consumer_Edit_Form */ protected function _prepareForm() { diff --git a/app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/Consumer/Grid.php b/app/code/core/Mage/Oauth/Block/Adminhtml/Oauth/Consumer/Grid.php similarity index 91% rename from app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/Consumer/Grid.php rename to app/code/core/Mage/Oauth/Block/Adminhtml/Oauth/Consumer/Grid.php index b97e0aee5b..f27d8b18c1 100644 --- a/app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/Consumer/Grid.php +++ b/app/code/core/Mage/Oauth/Block/Adminhtml/Oauth/Consumer/Grid.php @@ -19,7 +19,7 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -28,10 +28,10 @@ * OAuth Consumer grid block * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @author Magento Core Team */ -class Mage_OAuth_Block_Adminhtml_OAuth_Consumer_Grid extends Mage_Adminhtml_Block_Widget_Grid +class Mage_Oauth_Block_Adminhtml_Oauth_Consumer_Grid extends Mage_Adminhtml_Block_Widget_Grid { /** * Allow edit status @@ -60,7 +60,7 @@ public function __construct() /** * Prepare collection * - * @return Mage_OAuth_Block_Adminhtml_OAuth_Consumer_Grid + * @return Mage_Oauth_Block_Adminhtml_Oauth_Consumer_Grid */ protected function _prepareCollection() { @@ -73,7 +73,7 @@ protected function _prepareCollection() /** * Prepare columns * - * @return Mage_OAuth_Block_Adminhtml_OAuth_Consumer_Grid + * @return Mage_Oauth_Block_Adminhtml_Oauth_Consumer_Grid */ protected function _prepareColumns() { @@ -105,7 +105,7 @@ public function getGridUrl() /** * Get row URL * - * @param Mage_OAuth_Model_Consumer $row + * @param Mage_Oauth_Model_Consumer $row * @return string|null */ public function getRowUrl($row) diff --git a/app/code/core/Mage/OAuth/Block/Authorize.php b/app/code/core/Mage/Oauth/Block/Authorize.php similarity index 87% rename from app/code/core/Mage/OAuth/Block/Authorize.php rename to app/code/core/Mage/Oauth/Block/Authorize.php index 5aa0c78fd4..b22b4ad7fe 100644 --- a/app/code/core/Mage/OAuth/Block/Authorize.php +++ b/app/code/core/Mage/Oauth/Block/Authorize.php @@ -19,7 +19,7 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -28,10 +28,10 @@ * OAuth authorization block * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @author Magento Core Team */ -class Mage_OAuth_Block_Authorize extends Mage_OAuth_Block_AuthorizeBaseAbstract +class Mage_Oauth_Block_Authorize extends Mage_Oauth_Block_AuthorizeBaseAbstract { /** * Retrieve customer form posting url @@ -44,7 +44,11 @@ public function getPostActionUrl() $helper = $this->helper('customer'); $url = $helper->getLoginPostUrl(); if ($this->getIsSimple()) { - $url = rtrim($url, '/') . '/simple/1'; + if (strstr($url, '?')) { + $url .= '&simple=1'; + } else { + $url = rtrim($url, '/') . '/simple/1'; + } } return $url; } diff --git a/app/code/core/Mage/OAuth/Block/Authorize/Abstract.php b/app/code/core/Mage/Oauth/Block/Authorize/Abstract.php similarity index 81% rename from app/code/core/Mage/OAuth/Block/Authorize/Abstract.php rename to app/code/core/Mage/Oauth/Block/Authorize/Abstract.php index 96ec2e751a..632077b585 100644 --- a/app/code/core/Mage/OAuth/Block/Authorize/Abstract.php +++ b/app/code/core/Mage/Oauth/Block/Authorize/Abstract.php @@ -19,7 +19,7 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -28,32 +28,32 @@ * OAuth abstract authorization block * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @author Magento Core Team * @method string getToken() - * @method Mage_OAuth_Block_AuthorizeBaseAbstract setToken() setToken(string $token) + * @method Mage_Oauth_Block_AuthorizeBaseAbstract setToken() setToken(string $token) * @method boolean getIsSimple() - * @method Mage_OAuth_Block_Authorize_Button setIsSimple() setIsSimple(boolean $flag) + * @method Mage_Oauth_Block_Authorize_Button setIsSimple() setIsSimple(boolean $flag) * @method boolean getHasException() - * @method Mage_OAuth_Block_AuthorizeBaseAbstract setIsException() setHasException(boolean $flag) + * @method Mage_Oauth_Block_AuthorizeBaseAbstract setIsException() setHasException(boolean $flag) * @method boolean getVerifier() - * @method Mage_OAuth_Block_AuthorizeBaseAbstract setVerifier() setVerifier(string $verifier) + * @method Mage_Oauth_Block_AuthorizeBaseAbstract setVerifier() setVerifier(string $verifier) * @method boolean getIsLogged() - * @method Mage_OAuth_Block_AuthorizeBaseAbstract setIsLogged() setIsLogged(boolean $flag) + * @method Mage_Oauth_Block_AuthorizeBaseAbstract setIsLogged() setIsLogged(boolean $flag) */ -abstract class Mage_OAuth_Block_Authorize_Abstract extends Mage_Core_Block_Template +abstract class Mage_Oauth_Block_Authorize_Abstract extends Mage_Core_Block_Template { /** * Helper * - * @var Mage_OAuth_Helper_Data + * @var Mage_Oauth_Helper_Data */ protected $_helper; /** * Consumer model * - * @var Mage_OAuth_Model_Consumer + * @var Mage_Oauth_Model_Consumer */ protected $_consumer; @@ -69,12 +69,12 @@ public function __construct() /** * Get consumer instance by token value * - * @return Mage_OAuth_Model_Consumer + * @return Mage_Oauth_Model_Consumer */ public function getConsumer() { if (null === $this->_consumer) { - /** @var $token Mage_OAuth_Model_Token */ + /** @var $token Mage_Oauth_Model_Token */ $token = Mage::getModel('oauth/token'); $token->load($this->getToken(), 'token'); $this->_consumer = $token->getConsumer(); diff --git a/app/code/core/Mage/OAuth/Block/Authorize/Button.php b/app/code/core/Mage/Oauth/Block/Authorize/Button.php similarity index 92% rename from app/code/core/Mage/OAuth/Block/Authorize/Button.php rename to app/code/core/Mage/Oauth/Block/Authorize/Button.php index 82eda40c7d..41838886c7 100644 --- a/app/code/core/Mage/OAuth/Block/Authorize/Button.php +++ b/app/code/core/Mage/Oauth/Block/Authorize/Button.php @@ -19,7 +19,7 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -28,10 +28,10 @@ * OAuth authorization block with auth buttons * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @author Magento Core Team */ -class Mage_OAuth_Block_Authorize_Button extends Mage_OAuth_Block_Authorize_ButtonBaseAbstract +class Mage_Oauth_Block_Authorize_Button extends Mage_Oauth_Block_Authorize_ButtonBaseAbstract { /** * Retrieve confirm authorization url path diff --git a/app/code/core/Mage/OAuth/Block/Authorize/ButtonBaseAbstract.php b/app/code/core/Mage/Oauth/Block/Authorize/ButtonBaseAbstract.php similarity index 91% rename from app/code/core/Mage/OAuth/Block/Authorize/ButtonBaseAbstract.php rename to app/code/core/Mage/Oauth/Block/Authorize/ButtonBaseAbstract.php index 27199bed54..84efda93a0 100644 --- a/app/code/core/Mage/OAuth/Block/Authorize/ButtonBaseAbstract.php +++ b/app/code/core/Mage/Oauth/Block/Authorize/ButtonBaseAbstract.php @@ -19,7 +19,7 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -28,10 +28,10 @@ * OAuth authorization base abstract block with auth buttons * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @author Magento Core Team */ -abstract class Mage_OAuth_Block_Authorize_ButtonBaseAbstract extends Mage_OAuth_Block_Authorize_Abstract +abstract class Mage_Oauth_Block_Authorize_ButtonBaseAbstract extends Mage_Oauth_Block_Authorize_Abstract { /** * Get confirm url path diff --git a/app/code/core/Mage/OAuth/Block/AuthorizeBaseAbstract.php b/app/code/core/Mage/Oauth/Block/AuthorizeBaseAbstract.php similarity index 92% rename from app/code/core/Mage/OAuth/Block/AuthorizeBaseAbstract.php rename to app/code/core/Mage/Oauth/Block/AuthorizeBaseAbstract.php index 44d9e60b5a..926dcf2239 100644 --- a/app/code/core/Mage/OAuth/Block/AuthorizeBaseAbstract.php +++ b/app/code/core/Mage/Oauth/Block/AuthorizeBaseAbstract.php @@ -19,7 +19,7 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -28,10 +28,10 @@ * OAuth authorization block * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @author Magento Core Team */ -abstract class Mage_OAuth_Block_AuthorizeBaseAbstract extends Mage_OAuth_Block_Authorize_Abstract +abstract class Mage_Oauth_Block_AuthorizeBaseAbstract extends Mage_Oauth_Block_Authorize_Abstract { /** * Retrieve user authorize form posting url diff --git a/app/code/core/Mage/OAuth/Block/Customer/Token/List.php b/app/code/core/Mage/Oauth/Block/Customer/Token/List.php similarity index 86% rename from app/code/core/Mage/OAuth/Block/Customer/Token/List.php rename to app/code/core/Mage/Oauth/Block/Customer/Token/List.php index d1cc4f04da..9f56424f9a 100644 --- a/app/code/core/Mage/OAuth/Block/Customer/Token/List.php +++ b/app/code/core/Mage/Oauth/Block/Customer/Token/List.php @@ -19,7 +19,7 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -29,15 +29,15 @@ * Customer My Applications list block * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @author Magento Core Team */ -class Mage_OAuth_Block_Customer_Token_List extends Mage_Customer_Block_Account_Dashboard +class Mage_Oauth_Block_Customer_Token_List extends Mage_Customer_Block_Account_Dashboard { /** * Collection model * - * @var Mage_OAuth_Model_Resource_Token_Collection + * @var Mage_Oauth_Model_Resource_Token_Collection */ protected $_collection; @@ -49,10 +49,10 @@ protected function _construct() /** @var $session Mage_Customer_Model_Session */ $session = Mage::getSingleton('customer/session'); - /** @var $collection Mage_OAuth_Model_Resource_Token_Collection */ + /** @var $collection Mage_Oauth_Model_Resource_Token_Collection */ $collection = Mage::getModel('oauth/token')->getCollection(); $collection->joinConsumerAsApplication() - ->addFilterByType(Mage_OAuth_Model_Token::TYPE_ACCESS) + ->addFilterByType(Mage_Oauth_Model_Token::TYPE_ACCESS) ->addFilterByCustomerId($session->getCustomerId()); $this->_collection = $collection; } @@ -80,7 +80,7 @@ public function getToolbarHtml() /** * Prepare layout * - * @return Mage_OAuth_Block_Customer_Token_List + * @return Mage_Oauth_Block_Customer_Token_List */ protected function _prepareLayout() { @@ -95,7 +95,7 @@ protected function _prepareLayout() /** * Get collection * - * @return Mage_OAuth_Model_Resource_Token_Collection + * @return Mage_Oauth_Model_Resource_Token_Collection */ public function getCollection() { @@ -105,10 +105,10 @@ public function getCollection() /** * Get link for update revoke status * - * @param Mage_OAuth_Model_Token $model + * @param Mage_Oauth_Model_Token $model * @return string */ - public function getUpdateRevokeLink(Mage_OAuth_Model_Token $model) + public function getUpdateRevokeLink(Mage_Oauth_Model_Token $model) { return Mage::getUrl('oauth/customer_token/revoke/', array('id' => $model->getId(), 'status' => (int) !$model->getRevoked())); @@ -117,10 +117,10 @@ public function getUpdateRevokeLink(Mage_OAuth_Model_Token $model) /** * Get delete link * - * @param Mage_OAuth_Model_Token $model + * @param Mage_Oauth_Model_Token $model * @return string */ - public function getDeleteLink(Mage_OAuth_Model_Token $model) + public function getDeleteLink(Mage_Oauth_Model_Token $model) { return Mage::getUrl('oauth/customer_token/delete/', array('id' => $model->getId())); } diff --git a/app/code/core/Mage/OAuth/Exception.php b/app/code/core/Mage/Oauth/Exception.php similarity index 90% rename from app/code/core/Mage/OAuth/Exception.php rename to app/code/core/Mage/Oauth/Exception.php index 972d05bc52..ebbfb6eeb3 100644 --- a/app/code/core/Mage/OAuth/Exception.php +++ b/app/code/core/Mage/Oauth/Exception.php @@ -19,7 +19,7 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -28,9 +28,9 @@ * oAuth Exception * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @author Magento Core Team */ -class Mage_OAuth_Exception extends Zend_Exception +class Mage_Oauth_Exception extends Zend_Exception { } diff --git a/app/code/core/Mage/OAuth/Helper/Data.php b/app/code/core/Mage/Oauth/Helper/Data.php similarity index 74% rename from app/code/core/Mage/OAuth/Helper/Data.php rename to app/code/core/Mage/Oauth/Helper/Data.php index 6443d9156a..fa6b71aab7 100644 --- a/app/code/core/Mage/OAuth/Helper/Data.php +++ b/app/code/core/Mage/Oauth/Helper/Data.php @@ -19,7 +19,7 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -28,18 +28,18 @@ * OAuth Helper * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @author Magento Core Team */ -class Mage_OAuth_Helper_Data extends Mage_Core_Helper_Abstract +class Mage_Oauth_Helper_Data extends Mage_Core_Helper_Abstract { /**#@+ * Endpoint types with appropriate routes */ const ENDPOINT_AUTHORIZE_CUSTOMER = 'oauth/authorize'; - const ENDPOINT_AUTHORIZE_ADMIN = 'adminhtml/oAuth_authorize'; + const ENDPOINT_AUTHORIZE_ADMIN = 'adminhtml/oauth_authorize'; const ENDPOINT_AUTHORIZE_CUSTOMER_SIMPLE = 'oauth/authorize/simple'; - const ENDPOINT_AUTHORIZE_ADMIN_SIMPLE = 'adminhtml/oAuth_authorize/simple'; + const ENDPOINT_AUTHORIZE_ADMIN_SIMPLE = 'adminhtml/oauth_authorize/simple'; const ENDPOINT_INITIATE = 'oauth/initiate'; const ENDPOINT_TOKEN = 'oauth/token'; /**#@-*/ @@ -88,6 +88,7 @@ class Mage_OAuth_Helper_Data extends Mage_Core_Helper_Abstract */ protected function _generateRandomString($length) { + /** @var $helper Mage_Core_Helper_Data */ $helper = Mage::helper('core'); @@ -103,7 +104,7 @@ protected function _generateRandomString($length) */ public function generateToken() { - return $this->_generateRandomString(Mage_OAuth_Model_Token::LENGTH_TOKEN); + return $this->_generateRandomString(Mage_Oauth_Model_Token::LENGTH_TOKEN); } /** @@ -113,7 +114,7 @@ public function generateToken() */ public function generateTokenSecret() { - return $this->_generateRandomString(Mage_OAuth_Model_Token::LENGTH_SECRET); + return $this->_generateRandomString(Mage_Oauth_Model_Token::LENGTH_SECRET); } /** @@ -123,7 +124,7 @@ public function generateTokenSecret() */ public function generateVerifier() { - return $this->_generateRandomString(Mage_OAuth_Model_Token::LENGTH_VERIFIER); + return $this->_generateRandomString(Mage_Oauth_Model_Token::LENGTH_VERIFIER); } /** @@ -133,7 +134,7 @@ public function generateVerifier() */ public function generateConsumerKey() { - return $this->_generateRandomString(Mage_OAuth_Model_Consumer::KEY_LENGTH); + return $this->_generateRandomString(Mage_Oauth_Model_Consumer::KEY_LENGTH); } /** @@ -143,25 +144,25 @@ public function generateConsumerKey() */ public function generateConsumerSecret() { - return $this->_generateRandomString(Mage_OAuth_Model_Consumer::SECRET_LENGTH); + return $this->_generateRandomString(Mage_Oauth_Model_Consumer::SECRET_LENGTH); } /** * Return complete callback URL or boolean FALSE if no callback provided * - * @param Mage_OAuth_Model_Token $token Token object + * @param Mage_Oauth_Model_Token $token Token object * @param bool $rejected OPTIONAL Add user reject sign * @return bool|string */ - public function getFullCallbackUrl(Mage_OAuth_Model_Token $token, $rejected = false) + public function getFullCallbackUrl(Mage_Oauth_Model_Token $token, $rejected = false) { $callbackUrl = $token->getCallbackUrl(); - if (Mage_OAuth_Model_Server::CALLBACK_ESTABLISHED == $callbackUrl) { + if (Mage_Oauth_Model_Server::CALLBACK_ESTABLISHED == $callbackUrl) { return false; } if ($rejected) { - /** @var $consumer Mage_OAuth_Model_Consumer */ + /** @var $consumer Mage_Oauth_Model_Consumer */ $consumer = Mage::getModel('oauth/consumer')->load($token->getConsumerId()); if ($consumer->getId() && $consumer->getRejectedCallbackUrl()) { @@ -242,4 +243,60 @@ public function sendNotificationOnTokenStatusChange($userEmail, $userName, $appl ) ); } + + /** + * Is current authorize page is simple + * + * @return boolean + */ + protected function _getIsSimple() + { + $simple = false; + if (stristr($this->_getRequest()->getActionName(), 'simple') + || !is_null($this->_getRequest()->getParam('simple', null)) + ) { + $simple = true; + } + + return $simple; + } + + /** + * Get authorize endpoint url + * + * @param string $userType + * @return string + */ + public function getAuthorizeUrl($userType) + { + $simple = $this->_getIsSimple(); + + if (Mage_Oauth_Model_Token::USER_TYPE_CUSTOMER == $userType) { + if ($simple) { + $route = self::ENDPOINT_AUTHORIZE_CUSTOMER_SIMPLE; + } else { + $route = self::ENDPOINT_AUTHORIZE_CUSTOMER; + } + } elseif (Mage_Oauth_Model_Token::USER_TYPE_ADMIN == $userType) { + if ($simple) { + $route = self::ENDPOINT_AUTHORIZE_ADMIN_SIMPLE; + } else { + $route = self::ENDPOINT_AUTHORIZE_ADMIN; + } + } else { + throw new Exception('Invalid user type.'); + } + + return $this->_getUrl($route, array('_query' => array('oauth_token' => $this->getOauthToken()))); + } + + /** + * Retrieve oauth_token param from request + * + * @return string|null + */ + public function getOauthToken() + { + return $this->_getRequest()->getParam('oauth_token', null); + } } diff --git a/app/code/core/Mage/OAuth/Model/Consumer.php b/app/code/core/Mage/Oauth/Model/Consumer.php similarity index 76% rename from app/code/core/Mage/OAuth/Model/Consumer.php rename to app/code/core/Mage/Oauth/Model/Consumer.php index c67a336ef1..7fce3a9589 100644 --- a/app/code/core/Mage/OAuth/Model/Consumer.php +++ b/app/code/core/Mage/Oauth/Model/Consumer.php @@ -19,7 +19,7 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -28,28 +28,28 @@ * Application model * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @author Magento Core Team - * @method Mage_OAuth_Model_Resource_Consumer _getResource() - * @method Mage_OAuth_Model_Resource_Consumer getResource() - * @method Mage_OAuth_Model_Resource_Consumer_Collection getCollection() - * @method Mage_OAuth_Model_Resource_Consumer_Collection getResourceCollection() + * @method Mage_Oauth_Model_Resource_Consumer _getResource() + * @method Mage_Oauth_Model_Resource_Consumer getResource() + * @method Mage_Oauth_Model_Resource_Consumer_Collection getCollection() + * @method Mage_Oauth_Model_Resource_Consumer_Collection getResourceCollection() * @method string getName() - * @method Mage_OAuth_Model_Consumer setName() setName(string $name) + * @method Mage_Oauth_Model_Consumer setName() setName(string $name) * @method string getKey() - * @method Mage_OAuth_Model_Consumer setKey() setKey(string $key) + * @method Mage_Oauth_Model_Consumer setKey() setKey(string $key) * @method string getSecret() - * @method Mage_OAuth_Model_Consumer setSecret() setSecret(string $secret) + * @method Mage_Oauth_Model_Consumer setSecret() setSecret(string $secret) * @method string getCallbackUrl() - * @method Mage_OAuth_Model_Consumer setCallbackUrl() setCallbackUrl(string $url) + * @method Mage_Oauth_Model_Consumer setCallbackUrl() setCallbackUrl(string $url) * @method string getCreatedAt() - * @method Mage_OAuth_Model_Consumer setCreatedAt() setCreatedAt(string $date) + * @method Mage_Oauth_Model_Consumer setCreatedAt() setCreatedAt(string $date) * @method string getUpdatedAt() - * @method Mage_OAuth_Model_Consumer setUpdatedAt() setUpdatedAt(string $date) + * @method Mage_Oauth_Model_Consumer setUpdatedAt() setUpdatedAt(string $date) * @method string getRejectedCallbackUrl() - * @method Mage_OAuth_Model_Consumer setRejectedCallbackUrl() setRejectedCallbackUrl(string $rejectedCallbackUrl) + * @method Mage_Oauth_Model_Consumer setRejectedCallbackUrl() setRejectedCallbackUrl(string $rejectedCallbackUrl) */ -class Mage_OAuth_Model_Consumer extends Mage_Core_Model_Abstract +class Mage_Oauth_Model_Consumer extends Mage_Core_Model_Abstract { /** * Key hash length @@ -74,7 +74,7 @@ protected function _construct() /** * BeforeSave actions * - * @return Mage_OAuth_Model_Consumer + * @return Mage_Oauth_Model_Consumer */ protected function _beforeSave() { @@ -109,10 +109,8 @@ public function validate() } } - /** @var $validatorLength Mage_OAuth_Model_Consumer_Validator_KeyLength */ - $validatorLength = Mage::getModel( - 'oauth/consumer_validator_keyLength', - array('length' => self::KEY_LENGTH)); + /** @var $validatorLength Mage_Oauth_Model_Consumer_Validator_KeyLength */ + $validatorLength = Mage::getModel('oauth/consumer_validator_keyLength', array('length' => self::KEY_LENGTH)); $validatorLength->setName('Consumer Key'); if (!$validatorLength->isValid($this->getKey())) { diff --git a/app/code/core/Mage/OAuth/Model/Consumer/Validator/KeyLength.php b/app/code/core/Mage/Oauth/Model/Consumer/Validator/KeyLength.php similarity index 92% rename from app/code/core/Mage/OAuth/Model/Consumer/Validator/KeyLength.php rename to app/code/core/Mage/Oauth/Model/Consumer/Validator/KeyLength.php index bee2243f84..b1fc2345d0 100644 --- a/app/code/core/Mage/OAuth/Model/Consumer/Validator/KeyLength.php +++ b/app/code/core/Mage/Oauth/Model/Consumer/Validator/KeyLength.php @@ -19,7 +19,7 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -28,10 +28,10 @@ * Validate OAuth keys * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @author Magento Core Team */ -class Mage_OAuth_Model_Consumer_Validator_KeyLength extends Zend_Validate_StringLength +class Mage_Oauth_Model_Consumer_Validator_KeyLength extends Zend_Validate_StringLength { /** * Key name @@ -69,7 +69,7 @@ public function __construct($options = array()) /** * Init validation failure message template definitions * - * @return Mage_OAuth_Model_Consumer_Validator_KeyLength + * @return Mage_Oauth_Model_Consumer_Validator_KeyLength */ protected function _initMessageTemplates() { @@ -96,7 +96,7 @@ protected function _initMessageTemplates() * Set length * * @param $length - * @return Mage_OAuth_Model_Consumer_Validator_KeyLength + * @return Mage_Oauth_Model_Consumer_Validator_KeyLength */ public function setLength($length) { @@ -137,7 +137,7 @@ public function isValid($value) * Set key name * * @param string $name - * @return Mage_OAuth_Model_Consumer_Validator_KeyLength + * @return Mage_Oauth_Model_Consumer_Validator_KeyLength */ public function setName($name) { diff --git a/app/code/core/Mage/OAuth/Model/Nonce.php b/app/code/core/Mage/Oauth/Model/Nonce.php similarity index 78% rename from app/code/core/Mage/OAuth/Model/Nonce.php rename to app/code/core/Mage/Oauth/Model/Nonce.php index ce92f848c3..7bb84d2b59 100644 --- a/app/code/core/Mage/OAuth/Model/Nonce.php +++ b/app/code/core/Mage/Oauth/Model/Nonce.php @@ -19,7 +19,7 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -29,16 +29,16 @@ * oAuth nonce model * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @author Magento Core Team * @method string getNonce() - * @method Mage_OAuth_Model_Nonce setNonce() setNonce(string $nonce) + * @method Mage_Oauth_Model_Nonce setNonce() setNonce(string $nonce) * @method string getTimestamp() - * @method Mage_OAuth_Model_Nonce setTimestamp() setTimestamp(string $timestamp) - * @method Mage_OAuth_Model_Resource_Nonce getResource() - * @method Mage_OAuth_Model_Resource_Nonce _getResource() + * @method Mage_Oauth_Model_Nonce setTimestamp() setTimestamp(string $timestamp) + * @method Mage_Oauth_Model_Resource_Nonce getResource() + * @method Mage_Oauth_Model_Resource_Nonce _getResource() */ -class Mage_OAuth_Model_Nonce extends Mage_Core_Model_Abstract +class Mage_Oauth_Model_Nonce extends Mage_Core_Model_Abstract { /** * Initialize resource model @@ -53,14 +53,14 @@ protected function _construct() /** * "After save" actions * - * @return Mage_OAuth_Model_Nonce + * @return Mage_Oauth_Model_Nonce */ protected function _afterSave() { parent::_afterSave(); //Cleanup old entries - /** @var $helper Mage_OAuth_Helper_Data */ + /** @var $helper Mage_Oauth_Helper_Data */ $helper = Mage::helper('oauth'); if ($helper->isCleanupProbability()) { $this->_getResource()->deleteOldEntries($helper->getCleanupExpirationPeriod()); diff --git a/app/code/core/Mage/OAuth/Model/Observer.php b/app/code/core/Mage/Oauth/Model/Observer.php similarity index 53% rename from app/code/core/Mage/OAuth/Model/Observer.php rename to app/code/core/Mage/Oauth/Model/Observer.php index 6232a69b2c..05ae5c2195 100644 --- a/app/code/core/Mage/OAuth/Model/Observer.php +++ b/app/code/core/Mage/Oauth/Model/Observer.php @@ -19,7 +19,7 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -28,40 +28,11 @@ * OAuth observer * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @author Magento Core Team */ -class Mage_OAuth_Model_Observer +class Mage_Oauth_Model_Observer { - /** - * Get callback url - * - * @param string $userType - * @return string - */ - protected function _getAfterAuthUrl($userType) - { - $simple = Mage::app()->getRequest()->getParam('simple'); - - if (Mage_OAuth_Model_Token::USER_TYPE_CUSTOMER == $userType) { - if ($simple) { - $route = Mage_OAuth_Helper_Data::ENDPOINT_AUTHORIZE_CUSTOMER_SIMPLE; - } else { - $route = Mage_OAuth_Helper_Data::ENDPOINT_AUTHORIZE_CUSTOMER; - } - } elseif (Mage_OAuth_Model_Token::USER_TYPE_ADMIN == $userType) { - if ($simple) { - $route = Mage_OAuth_Helper_Data::ENDPOINT_AUTHORIZE_ADMIN_SIMPLE; - } else { - $route = Mage_OAuth_Helper_Data::ENDPOINT_AUTHORIZE_ADMIN; - } - } else { - throw new Exception('Invalid user type.'); - } - - return Mage::getUrl($route, array('_query' => array('oauth_token' => $this->_getOauthToken()))); - } - /** * Retrieve oauth_token param from request * @@ -69,21 +40,24 @@ protected function _getAfterAuthUrl($userType) */ protected function _getOauthToken() { - return Mage::app()->getRequest()->getParam('oauth_token', null); + return Mage::helper('oauth')->getOauthToken(); } /** - * Redirect customer to callback page after login success + * Redirect customer to callback page after login * * @param Varien_Event_Observer $observer - * @return void */ public function afterCustomerLogin(Varien_Event_Observer $observer) { if (null !== $this->_getOauthToken()) { - /** @var $session Mage_Customer_Model_Session */ - $session = Mage::getSingleton('customer/session'); - $session->setAfterAuthUrl($this->_getAfterAuthUrl(Mage_OAuth_Model_Token::USER_TYPE_CUSTOMER)); + $userType = Mage_Oauth_Model_Token::USER_TYPE_CUSTOMER; + $url = Mage::helper('oauth')->getAuthorizeUrl($userType); + Mage::app()->getResponse() + ->setRedirect($url) + ->sendHeaders() + ->sendResponse(); + exit(); } } @@ -91,21 +65,25 @@ public function afterCustomerLogin(Varien_Event_Observer $observer) * Redirect admin to authorize controller after login success * * @param Varien_Event_Observer $observer - * @return void */ public function afterAdminLogin(Varien_Event_Observer $observer) { if (null !== $this->_getOauthToken()) { - $userType = Mage_OAuth_Model_Token::USER_TYPE_ADMIN; - - $url = $this->_getAfterAuthUrl($userType); + $userType = Mage_Oauth_Model_Token::USER_TYPE_ADMIN; + $url = Mage::helper('oauth')->getAuthorizeUrl($userType); Mage::app()->getResponse() ->setRedirect($url) ->sendHeaders() ->sendResponse(); + exit(); } } + /** + * Redirect admin to authorize controller after login fail + * + * @param Varien_Event_Observer $observer + */ public function afterAdminLoginFailed(Varien_Event_Observer $observer) { if (null !== $this->_getOauthToken()) { @@ -113,19 +91,13 @@ public function afterAdminLoginFailed(Varien_Event_Observer $observer) $session = Mage::getSingleton('admin/session'); $session->addError($observer->getException()->getMessage()); - $params = array('oauth_token' => $this->_getOauthToken()); - - if (Mage::app()->getRequest()->getParam('simple')) { - $route = Mage_OAuth_Helper_Data::ENDPOINT_AUTHORIZE_ADMIN_SIMPLE; - } else { - $route = Mage_OAuth_Helper_Data::ENDPOINT_AUTHORIZE_ADMIN; - } - $url = Mage::getUrl($route, array('_query' => $params)); - + $userType = Mage_Oauth_Model_Token::USER_TYPE_ADMIN; + $url = Mage::helper('oauth')->getAuthorizeUrl($userType); Mage::app()->getResponse() ->setRedirect($url) ->sendHeaders() ->sendResponse(); + exit(); } } } diff --git a/app/code/core/Mage/OAuth/Model/Resource/Consumer.php b/app/code/core/Mage/Oauth/Model/Resource/Consumer.php similarity index 91% rename from app/code/core/Mage/OAuth/Model/Resource/Consumer.php rename to app/code/core/Mage/Oauth/Model/Resource/Consumer.php index ade3cad2af..0327282a98 100644 --- a/app/code/core/Mage/OAuth/Model/Resource/Consumer.php +++ b/app/code/core/Mage/Oauth/Model/Resource/Consumer.php @@ -19,7 +19,7 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -28,10 +28,10 @@ * OAuth Application resource model * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @author Magento Core Team */ -class Mage_OAuth_Model_Resource_Consumer extends Mage_Core_Model_Resource_Db_Abstract +class Mage_Oauth_Model_Resource_Consumer extends Mage_Core_Model_Resource_Db_Abstract { /** * Initialize resource model diff --git a/app/code/core/Mage/OAuth/Model/Resource/Consumer/Collection.php b/app/code/core/Mage/Oauth/Model/Resource/Consumer/Collection.php similarity index 91% rename from app/code/core/Mage/OAuth/Model/Resource/Consumer/Collection.php rename to app/code/core/Mage/Oauth/Model/Resource/Consumer/Collection.php index b9e5859e86..7f08303b98 100644 --- a/app/code/core/Mage/OAuth/Model/Resource/Consumer/Collection.php +++ b/app/code/core/Mage/Oauth/Model/Resource/Consumer/Collection.php @@ -19,7 +19,7 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -28,10 +28,10 @@ * OAuth Application resource collection model * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @author Magento Core Team */ -class Mage_OAuth_Model_Resource_Consumer_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract +class Mage_Oauth_Model_Resource_Consumer_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract { /** * Initialize collection model diff --git a/app/code/core/Mage/OAuth/Model/Resource/Nonce.php b/app/code/core/Mage/Oauth/Model/Resource/Nonce.php similarity index 93% rename from app/code/core/Mage/OAuth/Model/Resource/Nonce.php rename to app/code/core/Mage/Oauth/Model/Resource/Nonce.php index eaa744df57..d3b2051eb9 100644 --- a/app/code/core/Mage/OAuth/Model/Resource/Nonce.php +++ b/app/code/core/Mage/Oauth/Model/Resource/Nonce.php @@ -19,7 +19,7 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -28,10 +28,10 @@ * oAuth nonce resource model * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @author Magento Core Team */ -class Mage_OAuth_Model_Resource_Nonce extends Mage_Core_Model_Resource_Db_Abstract +class Mage_Oauth_Model_Resource_Nonce extends Mage_Core_Model_Resource_Db_Abstract { /** * Initialize resource model diff --git a/app/code/core/Mage/OAuth/Model/Resource/Nonce/Collection.php b/app/code/core/Mage/Oauth/Model/Resource/Nonce/Collection.php similarity index 91% rename from app/code/core/Mage/OAuth/Model/Resource/Nonce/Collection.php rename to app/code/core/Mage/Oauth/Model/Resource/Nonce/Collection.php index 542e113448..02ff3da628 100644 --- a/app/code/core/Mage/OAuth/Model/Resource/Nonce/Collection.php +++ b/app/code/core/Mage/Oauth/Model/Resource/Nonce/Collection.php @@ -19,7 +19,7 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -28,10 +28,10 @@ * OAuth nonce resource collection model * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @author Magento Core Team */ -class Mage_OAuth_Model_Resource_Nonce_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract +class Mage_Oauth_Model_Resource_Nonce_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract { /** * Initialize collection model diff --git a/app/code/core/Mage/OAuth/Model/Resource/Setup.php b/app/code/core/Mage/Oauth/Model/Resource/Setup.php similarity index 90% rename from app/code/core/Mage/OAuth/Model/Resource/Setup.php rename to app/code/core/Mage/Oauth/Model/Resource/Setup.php index facf382388..4c74e7cf15 100644 --- a/app/code/core/Mage/OAuth/Model/Resource/Setup.php +++ b/app/code/core/Mage/Oauth/Model/Resource/Setup.php @@ -19,7 +19,7 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -28,9 +28,9 @@ * OAuth setup model * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @author Magento Core Team */ -class Mage_OAuth_Model_Resource_Setup extends Mage_Core_Model_Resource_Setup +class Mage_Oauth_Model_Resource_Setup extends Mage_Core_Model_Resource_Setup { } diff --git a/app/code/core/Mage/OAuth/Model/Resource/Token.php b/app/code/core/Mage/Oauth/Model/Resource/Token.php similarity index 90% rename from app/code/core/Mage/OAuth/Model/Resource/Token.php rename to app/code/core/Mage/Oauth/Model/Resource/Token.php index 9c16fcfc98..1afeb5a7b0 100644 --- a/app/code/core/Mage/OAuth/Model/Resource/Token.php +++ b/app/code/core/Mage/Oauth/Model/Resource/Token.php @@ -19,7 +19,7 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -28,10 +28,10 @@ * OAuth token resource model * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @author Magento Core Team */ -class Mage_OAuth_Model_Resource_Token extends Mage_Core_Model_Resource_Db_Abstract +class Mage_Oauth_Model_Resource_Token extends Mage_Core_Model_Resource_Db_Abstract { /** * Initialize resource model @@ -46,10 +46,10 @@ protected function _construct() /** * Clean up old authorized tokens for specified consumer-user pairs * - * @param Mage_OAuth_Model_Token $exceptToken Token just created to exclude from delete + * @param Mage_Oauth_Model_Token $exceptToken Token just created to exclude from delete * @return int The number of affected rows */ - public function cleanOldAuthorizedTokensExcept(Mage_OAuth_Model_Token $exceptToken) + public function cleanOldAuthorizedTokensExcept(Mage_Oauth_Model_Token $exceptToken) { if (!$exceptToken->getId() || !$exceptToken->getAuthorized()) { Mage::throwException('Invalid token to except'); @@ -84,7 +84,7 @@ public function deleteOldEntries($minutes) return $adapter->delete( $this->getMainTable(), $adapter->quoteInto( - 'type = "' . Mage_OAuth_Model_Token::TYPE_REQUEST . '" AND created_at <= ?', + 'type = "' . Mage_Oauth_Model_Token::TYPE_REQUEST . '" AND created_at <= ?', Varien_Date::formatDate(time() - $minutes * 60) ) ); diff --git a/app/code/core/Mage/OAuth/Model/Resource/Token/Collection.php b/app/code/core/Mage/Oauth/Model/Resource/Token/Collection.php similarity index 85% rename from app/code/core/Mage/OAuth/Model/Resource/Token/Collection.php rename to app/code/core/Mage/Oauth/Model/Resource/Token/Collection.php index 418941f8e6..67974a1866 100644 --- a/app/code/core/Mage/OAuth/Model/Resource/Token/Collection.php +++ b/app/code/core/Mage/Oauth/Model/Resource/Token/Collection.php @@ -19,7 +19,7 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -28,10 +28,10 @@ * OAuth token resource collection model * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @author Magento Core Team */ -class Mage_OAuth_Model_Resource_Token_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract +class Mage_Oauth_Model_Resource_Token_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract { /** * Initialize collection model @@ -48,7 +48,7 @@ protected function _construct() * * Method use for show applications list (token-consumer) * - * @return Mage_OAuth_Model_Resource_Token_Collection + * @return Mage_Oauth_Model_Resource_Token_Collection */ public function joinConsumerAsApplication() { @@ -66,7 +66,7 @@ public function joinConsumerAsApplication() * Add filter by admin ID * * @param int $adminId - * @return Mage_OAuth_Model_Resource_Token_Collection + * @return Mage_Oauth_Model_Resource_Token_Collection */ public function addFilterByAdminId($adminId) { @@ -78,7 +78,7 @@ public function addFilterByAdminId($adminId) * Add filter by customer ID * * @param int $customerId - * @return Mage_OAuth_Model_Resource_Token_Collection + * @return Mage_Oauth_Model_Resource_Token_Collection */ public function addFilterByCustomerId($customerId) { @@ -90,7 +90,7 @@ public function addFilterByCustomerId($customerId) * Add filter by consumer ID * * @param int $consumerId - * @return Mage_OAuth_Model_Resource_Token_Collection + * @return Mage_Oauth_Model_Resource_Token_Collection */ public function addFilterByConsumerId($consumerId) { @@ -102,7 +102,7 @@ public function addFilterByConsumerId($consumerId) * Add filter by type * * @param string $type - * @return Mage_OAuth_Model_Resource_Token_Collection + * @return Mage_Oauth_Model_Resource_Token_Collection */ public function addFilterByType($type) { @@ -114,7 +114,7 @@ public function addFilterByType($type) * Add filter by ID * * @param array|int $id - * @return Mage_OAuth_Model_Resource_Token_Collection + * @return Mage_Oauth_Model_Resource_Token_Collection */ public function addFilterById($id) { @@ -126,7 +126,7 @@ public function addFilterById($id) * Add filter by "Is Revoked" status * * @param bool|int $flag - * @return Mage_OAuth_Model_Resource_Token_Collection + * @return Mage_Oauth_Model_Resource_Token_Collection */ public function addFilterByRevoked($flag) { diff --git a/app/code/core/Mage/OAuth/Model/Server.php b/app/code/core/Mage/Oauth/Model/Server.php similarity index 95% rename from app/code/core/Mage/OAuth/Model/Server.php rename to app/code/core/Mage/Oauth/Model/Server.php index 892260ad37..b5fdb2c2f1 100644 --- a/app/code/core/Mage/OAuth/Model/Server.php +++ b/app/code/core/Mage/Oauth/Model/Server.php @@ -19,7 +19,7 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -28,10 +28,10 @@ * oAuth Server * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @author Magento Core Team */ -class Mage_OAuth_Model_Server +class Mage_Oauth_Model_Server { /**#@+ * OAuth result statuses @@ -95,7 +95,7 @@ class Mage_OAuth_Model_Server /** * Consumer object * - * @var Mage_OAuth_Model_Consumer + * @var Mage_Oauth_Model_Consumer */ protected $_consumer; @@ -183,7 +183,7 @@ class Mage_OAuth_Model_Server /** * Token object * - * @var Mage_OAuth_Model_Token + * @var Mage_Oauth_Model_Token */ protected $_token; @@ -209,7 +209,7 @@ public function __construct($request = null) * Retrieve protocol and request parameters from request object * * @link http://tools.ietf.org/html/rfc5849#section-3.5 - * @return Mage_OAuth_Model_Server + * @return Mage_Oauth_Model_Server */ protected function _fetchParams() { @@ -266,7 +266,7 @@ protected function _fetchParams() /** * Retrieve protocol parameters from query string * - * @return Mage_OAuth_Model_Server + * @return Mage_Oauth_Model_Server */ protected function _fetchProtocolParamsFromQuery() { @@ -294,7 +294,7 @@ protected function _getResponse() /** * Initialize consumer * - * @throws Mage_OAuth_Exception + * @throws Mage_Oauth_Exception */ protected function _initConsumer() { @@ -310,8 +310,8 @@ protected function _initConsumer() /** * Load token object, validate it depending on request type, set access data and save * - * @return Mage_OAuth_Model_Server - * @throws Mage_OAuth_Exception + * @return Mage_Oauth_Model_Server + * @throws Mage_Oauth_Exception */ protected function _initToken() { @@ -334,7 +334,7 @@ protected function _initToken() if ($this->_token->getConsumerId() != $this->_consumer->getId()) { $this->_throwException('', self::ERR_TOKEN_REJECTED); } - if (Mage_OAuth_Model_Token::TYPE_REQUEST != $this->_token->getType()) { + if (Mage_Oauth_Model_Token::TYPE_REQUEST != $this->_token->getType()) { $this->_throwException('', self::ERR_TOKEN_USED); } } elseif (self::REQUEST_AUTHORIZE == $this->_requestType) { @@ -342,7 +342,7 @@ protected function _initToken() $this->_throwException('', self::ERR_TOKEN_USED); } } elseif (self::REQUEST_RESOURCE == $this->_requestType) { - if (Mage_OAuth_Model_Token::TYPE_ACCESS != $this->_token->getType()) { + if (Mage_Oauth_Model_Token::TYPE_ACCESS != $this->_token->getType()) { $this->_throwException('', self::ERR_TOKEN_REJECTED); } if ($this->_token->getRevoked()) { @@ -371,7 +371,7 @@ protected function _isProtocolParameter($attrName) * Extract parameters from sources (GET, FormBody, Authorization header), decode them and validate * * @param string $requestType Request type - one of REQUEST_... class constant - * @return Mage_OAuth_Model_Server + * @return Mage_Oauth_Model_Server * @throws Mage_Core_Exception */ protected function _processRequest($requestType) @@ -429,11 +429,11 @@ protected function _saveToken() * * @param string $message Exception message * @param int $code Exception code - * @throws Mage_OAuth_Exception + * @throws Mage_Oauth_Exception */ protected function _throwException($message = '', $code = 0) { - throw Mage::exception('Mage_OAuth', $message, $code); + throw Mage::exception('Mage_Oauth', $message, $code); } /** @@ -467,7 +467,7 @@ protected function _validateNonce($nonce, $timestamp) if ($timestamp <= 0 || $timestamp > (time() + self::TIME_DEVIATION)) { $this->_throwException('', self::ERR_TIMESTAMP_REFUSED); } - /** @var $nonceObj Mage_OAuth_Model_Nonce */ + /** @var $nonceObj Mage_Oauth_Model_Nonce */ $nonceObj = Mage::getModel('oauth/nonce'); $nonceObj->load($nonce, 'nonce'); @@ -483,7 +483,7 @@ protected function _validateNonce($nonce, $timestamp) /** * Validate protocol parameters * - * @throws Mage_OAuth_Exception + * @throws Mage_Oauth_Exception */ protected function _validateProtocolParams() { @@ -504,7 +504,7 @@ protected function _validateProtocolParams() } } // validate consumer key length - if (strlen($this->_protocolParams['oauth_consumer_key']) != Mage_OAuth_Model_Consumer::KEY_LENGTH) { + if (strlen($this->_protocolParams['oauth_consumer_key']) != Mage_Oauth_Model_Consumer::KEY_LENGTH) { $this->_throwException('', self::ERR_CONSUMER_KEY_REJECTED); } // validate signature method @@ -526,7 +526,7 @@ protected function _validateProtocolParams() /** * Validate signature * - * @throws Mage_OAuth_Exception + * @throws Mage_Oauth_Exception */ protected function _validateSignature() { @@ -557,7 +557,7 @@ protected function _validateTokenParam() if (!is_string($this->_protocolParams['oauth_token'])) { $this->_throwException('', self::ERR_TOKEN_REJECTED); } - if (strlen($this->_protocolParams['oauth_token']) != Mage_OAuth_Model_Token::LENGTH_TOKEN) { + if (strlen($this->_protocolParams['oauth_token']) != Mage_Oauth_Model_Token::LENGTH_TOKEN) { $this->_throwException('', self::ERR_TOKEN_REJECTED); } } @@ -573,7 +573,7 @@ protected function _validateVerifierParam() if (!is_string($this->_protocolParams['oauth_verifier'])) { $this->_throwException('', self::ERR_VERIFIER_INVALID); } - if (strlen($this->_protocolParams['oauth_verifier']) != Mage_OAuth_Model_Token::LENGTH_VERIFIER) { + if (strlen($this->_protocolParams['oauth_verifier']) != Mage_Oauth_Model_Token::LENGTH_VERIFIER) { $this->_throwException('', self::ERR_VERIFIER_INVALID); } } @@ -598,7 +598,7 @@ public function accessToken() * * @param int $userId Authorization user identifier * @param string $userType Authorization user type - * @return Mage_OAuth_Model_Token + * @return Mage_Oauth_Model_Token */ public function authorizeToken($userId, $userType) { @@ -612,7 +612,7 @@ public function authorizeToken($userId, $userType) /** * Validate request with access token for specified URL * - * @return Mage_OAuth_Model_Token + * @return Mage_Oauth_Model_Token */ public function checkAccessRequest() { @@ -624,7 +624,7 @@ public function checkAccessRequest() /** * Check authorize request for validity and return token * - * @return Mage_OAuth_Model_Token + * @return Mage_Oauth_Model_Token */ public function checkAuthorizeRequest() { @@ -675,7 +675,7 @@ public function reportProblem(Exception $e, Zend_Controller_Response_Http $respo { $eMsg = $e->getMessage(); - if ($e instanceof Mage_OAuth_Exception) { + if ($e instanceof Mage_Oauth_Exception) { $eCode = $e->getCode(); if (isset($this->_errors[$eCode])) { @@ -708,7 +708,7 @@ public function reportProblem(Exception $e, Zend_Controller_Response_Http $respo * Set response object * * @param Zend_Controller_Response_Http $response - * @return Mage_OAuth_Model_Server + * @return Mage_Oauth_Model_Server */ public function setResponse(Zend_Controller_Response_Http $response) { diff --git a/app/code/core/Mage/OAuth/Model/Token.php b/app/code/core/Mage/Oauth/Model/Token.php similarity index 81% rename from app/code/core/Mage/OAuth/Model/Token.php rename to app/code/core/Mage/Oauth/Model/Token.php index 404e9cb00a..4f190eb0f5 100644 --- a/app/code/core/Mage/OAuth/Model/Token.php +++ b/app/code/core/Mage/Oauth/Model/Token.php @@ -19,7 +19,7 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -28,37 +28,37 @@ * oAuth token model * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @author Magento Core Team * @method string getName() Consumer name (joined from consumer table) - * @method Mage_OAuth_Model_Resource_Token_Collection getCollection() - * @method Mage_OAuth_Model_Resource_Token_Collection getResourceCollection() - * @method Mage_OAuth_Model_Resource_Token getResource() - * @method Mage_OAuth_Model_Resource_Token _getResource() + * @method Mage_Oauth_Model_Resource_Token_Collection getCollection() + * @method Mage_Oauth_Model_Resource_Token_Collection getResourceCollection() + * @method Mage_Oauth_Model_Resource_Token getResource() + * @method Mage_Oauth_Model_Resource_Token _getResource() * @method int getConsumerId() - * @method Mage_OAuth_Model_Token setConsumerId() setConsumerId(int $consumerId) + * @method Mage_Oauth_Model_Token setConsumerId() setConsumerId(int $consumerId) * @method int getAdminId() - * @method Mage_OAuth_Model_Token setAdminId() setAdminId(int $adminId) + * @method Mage_Oauth_Model_Token setAdminId() setAdminId(int $adminId) * @method int getCustomerId() - * @method Mage_OAuth_Model_Token setCustomerId() setCustomerId(int $customerId) + * @method Mage_Oauth_Model_Token setCustomerId() setCustomerId(int $customerId) * @method string getType() - * @method Mage_OAuth_Model_Token setType() setType(string $type) + * @method Mage_Oauth_Model_Token setType() setType(string $type) * @method string getVerifier() - * @method Mage_OAuth_Model_Token setVerifier() setVerifier(string $verifier) + * @method Mage_Oauth_Model_Token setVerifier() setVerifier(string $verifier) * @method string getCallbackUrl() - * @method Mage_OAuth_Model_Token setCallbackUrl() setCallbackUrl(string $callbackUrl) + * @method Mage_Oauth_Model_Token setCallbackUrl() setCallbackUrl(string $callbackUrl) * @method string getCreatedAt() - * @method Mage_OAuth_Model_Token setCreatedAt() setCreatedAt(string $createdAt) + * @method Mage_Oauth_Model_Token setCreatedAt() setCreatedAt(string $createdAt) * @method string getToken() - * @method Mage_OAuth_Model_Token setToken() setToken(string $token) + * @method Mage_Oauth_Model_Token setToken() setToken(string $token) * @method string getSecret() - * @method Mage_OAuth_Model_Token setSecret() setSecret(string $tokenSecret) + * @method Mage_Oauth_Model_Token setSecret() setSecret(string $tokenSecret) * @method int getRevoked() - * @method Mage_OAuth_Model_Token setRevoked() setRevoked(int $revoked) + * @method Mage_Oauth_Model_Token setRevoked() setRevoked(int $revoked) * @method int getAuthorized() - * @method Mage_OAuth_Model_Token setAuthorized() setAuthorized(int $authorized) + * @method Mage_Oauth_Model_Token setAuthorized() setAuthorized(int $authorized) */ -class Mage_OAuth_Model_Token extends Mage_Core_Model_Abstract +class Mage_Oauth_Model_Token extends Mage_Core_Model_Abstract { /**#@+ * Token types @@ -95,14 +95,14 @@ protected function _construct() /** * "After save" actions * - * @return Mage_OAuth_Model_Token + * @return Mage_Oauth_Model_Token */ protected function _afterSave() { parent::_afterSave(); //Cleanup old entries - /** @var $helper Mage_OAuth_Helper_Data */ + /** @var $helper Mage_Oauth_Helper_Data */ $helper = Mage::helper('oauth'); if ($helper->isCleanupProbability()) { $this->_getResource()->deleteOldEntries($helper->getCleanupExpirationPeriod()); @@ -115,7 +115,7 @@ protected function _afterSave() * * @param int $userId Authorization user identifier * @param string $userType Authorization user type - * @return Mage_OAuth_Model_Token + * @return Mage_Oauth_Model_Token */ public function authorize($userId, $userType) { @@ -132,7 +132,7 @@ public function authorize($userId, $userType) } else { Mage::throwException('User type is unknown'); } - /** @var $helper Mage_OAuth_Helper_Data */ + /** @var $helper Mage_Oauth_Helper_Data */ $helper = Mage::helper('oauth'); $this->setVerifier($helper->generateVerifier()); @@ -147,14 +147,14 @@ public function authorize($userId, $userType) /** * Convert token to access type * - * @return Mage_OAuth_Model_Token + * @return Mage_Oauth_Model_Token */ public function convertToAccess() { - if (Mage_OAuth_Model_Token::TYPE_REQUEST != $this->getType()) { + if (Mage_Oauth_Model_Token::TYPE_REQUEST != $this->getType()) { Mage::throwException('Can not convert due to token is not request type'); } - /** @var $helper Mage_OAuth_Helper_Data */ + /** @var $helper Mage_Oauth_Helper_Data */ $helper = Mage::helper('oauth'); $this->setType(self::TYPE_ACCESS); @@ -170,11 +170,11 @@ public function convertToAccess() * * @param int $consumerId Consumer identifier * @param string $callbackUrl Callback URL - * @return Mage_OAuth_Model_Token + * @return Mage_Oauth_Model_Token */ public function createRequestToken($consumerId, $callbackUrl) { - /** @var $helper Mage_OAuth_Helper_Data */ + /** @var $helper Mage_Oauth_Helper_Data */ $helper = Mage::helper('oauth'); $this->setData(array( @@ -220,7 +220,7 @@ public function toString($format = '') /** * Before save actions * - * @return Mage_OAuth_Model_Consumer + * @return Mage_Oauth_Model_Consumer */ protected function _beforeSave() { @@ -243,14 +243,14 @@ public function validate() { /** @var $validatorUrl Mage_Core_Model_Url_Validator */ $validatorUrl = Mage::getSingleton('core/url_validator'); - if (Mage_OAuth_Model_Server::CALLBACK_ESTABLISHED != $this->getCallbackUrl() + if (Mage_Oauth_Model_Server::CALLBACK_ESTABLISHED != $this->getCallbackUrl() && !$validatorUrl->isValid($this->getCallbackUrl()) ) { $messages = $validatorUrl->getMessages(); Mage::throwException(array_shift($messages)); } - /** @var $validatorLength Mage_OAuth_Model_Consumer_Validator_KeyLength */ + /** @var $validatorLength Mage_Oauth_Model_Consumer_Validator_KeyLength */ $validatorLength = Mage::getModel( 'oauth/consumer_validator_keyLength'); $validatorLength->setLength(self::LENGTH_SECRET); @@ -281,12 +281,12 @@ public function validate() /** * Get Token Consumer * - * @return Mage_OAuth_Model_Consumer + * @return Mage_Oauth_Model_Consumer */ public function getConsumer() { if (!$this->getData('consumer')) { - /** @var $consumer Mage_OAuth_Model_Consumer */ + /** @var $consumer Mage_Oauth_Model_Consumer */ $consumer = Mage::getModel('oauth/consumer'); $consumer->load($this->getConsumerId()); $this->setData('consumer', $consumer); diff --git a/app/code/core/Mage/OAuth/controllers/Adminhtml/OAuth/Admin/TokenController.php b/app/code/core/Mage/Oauth/controllers/Adminhtml/Oauth/Admin/TokenController.php similarity index 90% rename from app/code/core/Mage/OAuth/controllers/Adminhtml/OAuth/Admin/TokenController.php rename to app/code/core/Mage/Oauth/controllers/Adminhtml/Oauth/Admin/TokenController.php index 4e6a080454..3d1ddbf811 100644 --- a/app/code/core/Mage/OAuth/controllers/Adminhtml/OAuth/Admin/TokenController.php +++ b/app/code/core/Mage/Oauth/controllers/Adminhtml/Oauth/Admin/TokenController.php @@ -19,7 +19,7 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -30,15 +30,15 @@ * Applications for logged admin user * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @author Magento Core Team */ -class Mage_OAuth_Adminhtml_OAuth_Admin_TokenController extends Mage_Adminhtml_Controller_Action +class Mage_Oauth_Adminhtml_Oauth_Admin_TokenController extends Mage_Adminhtml_Controller_Action { /** * Init titles * - * @return Mage_OAuth_Adminhtml_OAuth_Admin_TokenController + * @return Mage_Oauth_Adminhtml_Oauth_Admin_TokenController */ public function preDispatch() { @@ -93,15 +93,15 @@ public function revokeAction() /** @var $user Mage_Admin_Model_User */ $user = Mage::getSingleton('admin/session')->getData('user'); - /** @var $collection Mage_OAuth_Model_Resource_Token_Collection */ + /** @var $collection Mage_Oauth_Model_Resource_Token_Collection */ $collection = Mage::getModel('oauth/token')->getCollection(); $collection->joinConsumerAsApplication() ->addFilterByAdminId($user->getId()) - ->addFilterByType(Mage_OAuth_Model_Token::TYPE_ACCESS) + ->addFilterByType(Mage_Oauth_Model_Token::TYPE_ACCESS) ->addFilterById($ids) ->addFilterByRevoked(!$status); - /** @var $item Mage_OAuth_Model_Token */ + /** @var $item Mage_Oauth_Model_Token */ foreach ($collection as $item) { $item->load($item->getId()); $item->setRevoked($status)->save(); @@ -139,14 +139,14 @@ public function deleteAction() /** @var $user Mage_Admin_Model_User */ $user = Mage::getSingleton('admin/session')->getData('user'); - /** @var $collection Mage_OAuth_Model_Resource_Token_Collection */ + /** @var $collection Mage_Oauth_Model_Resource_Token_Collection */ $collection = Mage::getModel('oauth/token')->getCollection(); $collection->joinConsumerAsApplication() ->addFilterByAdminId($user->getId()) - ->addFilterByType(Mage_OAuth_Model_Token::TYPE_ACCESS) + ->addFilterByType(Mage_Oauth_Model_Token::TYPE_ACCESS) ->addFilterById($ids); - /** @var $item Mage_OAuth_Model_Token */ + /** @var $item Mage_Oauth_Model_Token */ foreach ($collection as $item) { $item->delete(); } diff --git a/app/code/core/Mage/OAuth/controllers/Adminhtml/OAuth/AuthorizeController.php b/app/code/core/Mage/Oauth/controllers/Adminhtml/Oauth/AuthorizeController.php similarity index 69% rename from app/code/core/Mage/OAuth/controllers/Adminhtml/OAuth/AuthorizeController.php rename to app/code/core/Mage/Oauth/controllers/Adminhtml/Oauth/AuthorizeController.php index 0fad0ac13e..833ab13eca 100644 --- a/app/code/core/Mage/OAuth/controllers/Adminhtml/OAuth/AuthorizeController.php +++ b/app/code/core/Mage/Oauth/controllers/Adminhtml/Oauth/AuthorizeController.php @@ -19,7 +19,7 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -28,10 +28,10 @@ * oAuth authorize controller * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @author Magento Core Team */ -class Mage_OAuth_Adminhtml_OAuth_AuthorizeController extends Mage_Adminhtml_Controller_Action +class Mage_Oauth_Adminhtml_Oauth_AuthorizeController extends Mage_Adminhtml_Controller_Action { /** * Session name @@ -56,7 +56,22 @@ class Mage_OAuth_Adminhtml_OAuth_AuthorizeController extends Mage_Adminhtml_Cont public function preDispatch() { $this->getRequest()->setParam('forwarded', true); + + // check login data before it set null in Mage_Admin_Model_Observer::actionPreDispatchAdmin + $loginError = $this->_checkLoginIsEmpty(); + parent::preDispatch(); + + // call after parent::preDispatch(); to get session started + if ($loginError) { + Mage::getSingleton('adminhtml/session') + ->addError(Mage::helper('adminhtml')->__('Invalid User Name or Password.')); + $params = array('_query' => array('oauth_token' => $this->getRequest()->getParam('oauth_token', null))); + $this->setFlag('', self::FLAG_NO_DISPATCH, true); + $this->setFlag('', self::FLAG_NO_POST_DISPATCH, true); + $params = array('_query' => array('oauth_token' => $this->getRequest()->getParam('oauth_token', null))); + $this->_redirect('*/*/*', $params); + } } /** @@ -88,11 +103,11 @@ public function simpleAction() * Init authorize page * * @param bool $simple - * @return Mage_OAuth_Adminhtml_OAuth_AuthorizeController + * @return Mage_Oauth_Adminhtml_Oauth_AuthorizeController */ protected function _initForm($simple = false) { - /** @var $server Mage_OAuth_Model_Server */ + /** @var $server Mage_Oauth_Model_Server */ $server = Mage::getModel('oauth/server'); /** @var $session Mage_Admin_Model_Session */ $session = Mage::getSingleton($this->_sessionName); @@ -102,7 +117,7 @@ protected function _initForm($simple = false) $server->checkAuthorizeRequest(); } catch (Mage_Core_Exception $e) { $session->addError($e->getMessage()); - } catch (Mage_OAuth_Exception $e) { + } catch (Mage_Oauth_Exception $e) { $isException = true; $session->addException($e, $this->__('An error occurred. Your authorization request is invalid.')); } catch (Exception $e) { @@ -117,20 +132,14 @@ protected function _initForm($simple = false) $contentBlock = $layout->getBlock('content'); if ($logged) { $contentBlock->unsetChild('oauth.authorize.form'); - /** @var $block Mage_OAuth_Block_Adminhtml_OAuth_Authorize_Button */ + /** @var $block Mage_Oauth_Block_Adminhtml_Oauth_Authorize_Button */ $block = $contentBlock->getChild('oauth.authorize.button'); } else { $contentBlock->unsetChild('oauth.authorize.button'); - /** @var $block Mage_OAuth_Block_Adminhtml_OAuth_Authorize */ + /** @var $block Mage_Oauth_Block_Adminhtml_Oauth_Authorize */ $block = $contentBlock->getChild('oauth.authorize.form'); } - if ($simple) { - /** @var $style Mage_OAuth_Block_Authorize_Style */ - $style = $layout->getBlock('oauth.authorize.style'); - $style->setIsLogged($logged); - } - $block->setIsSimple($simple) ->setToken($this->getRequest()->getQuery('oauth_token')) ->setHasException($isException); @@ -141,36 +150,43 @@ protected function _initForm($simple = false) * Init confirm page * * @param bool $simple - * @return Mage_OAuth_Adminhtml_OAuth_AuthorizeController + * @return Mage_Oauth_Adminhtml_Oauth_AuthorizeController */ protected function _initConfirmPage($simple = false) { + /** @var $helper Mage_Oauth_Helper_Data */ + $helper = Mage::helper('oauth'); + /** @var $session Mage_Admin_Model_Session */ $session = Mage::getSingleton($this->_sessionName); - /** @var $server Mage_OAuth_Model_Server */ - $server = Mage::getModel('oauth/server'); + /** @var $user Mage_Admin_Model_User */ + $user = $session->getData('user'); + if (!$user) { + $session->addError($this->__('Please login to proceed authorization.')); + $url = $helper->getAuthorizeUrl(Mage_Oauth_Model_Token::USER_TYPE_ADMIN); + $this->_redirectUrl($url); + return $this; + } $this->loadLayout(); - /** @var $block Mage_OAuth_Block_Adminhtml_OAuth_Authorize */ + /** @var $block Mage_Oauth_Block_Adminhtml_Oauth_Authorize */ $block = $this->getLayout()->getBlock('content')->getChild('oauth.authorize.confirm'); $block->setIsSimple($simple); try { - /** @var $user Mage_Admin_Model_User */ - $user = $session->getData('user'); - $token = $server->authorizeToken($user->getId(), Mage_OAuth_Model_Token::USER_TYPE_ADMIN); + /** @var $server Mage_Oauth_Model_Server */ + $server = Mage::getModel('oauth/server'); - /** @var $helper Mage_OAuth_Helper_Data */ - $helper = Mage::helper('oauth'); + $token = $server->authorizeToken($user->getId(), Mage_Oauth_Model_Token::USER_TYPE_ADMIN); if (($callback = $helper->getFullCallbackUrl($token))) { //false in case of OOB $this->getResponse()->setRedirect($callback . ($simple ? '&simple=1' : '')); return $this; } else { - $session->addSuccess($this->__('Authorization confirmed.')); $block->setVerifier($token->getVerifier()); + $session->addSuccess($this->__('Authorization confirmed.')); } } catch (Mage_Core_Exception $e) { $block->setHasException(true); @@ -190,11 +206,11 @@ protected function _initConfirmPage($simple = false) * Init reject page * * @param bool $simple - * @return Mage_OAuth_AuthorizeController + * @return Mage_Oauth_AuthorizeController */ protected function _initRejectPage($simple = false) { - /** @var $server Mage_OAuth_Model_Server */ + /** @var $server Mage_Oauth_Model_Server */ $server = Mage::getModel('oauth/server'); /** @var $session Mage_Admin_Model_Session */ @@ -202,13 +218,13 @@ protected function _initRejectPage($simple = false) $this->loadLayout(); - /** @var $block Mage_OAuth_Block_Authorize */ + /** @var $block Mage_Oauth_Block_Authorize */ $block = $this->getLayout()->getBlock('oauth.authorize.reject'); $block->setIsSimple($simple); try { $token = $server->checkAuthorizeRequest(); - /** @var $helper Mage_OAuth_Helper_Data */ + /** @var $helper Mage_Oauth_Helper_Data */ $helper = Mage::helper('oauth'); if (($callback = $helper->getFullCallbackUrl($token, true))) { @@ -230,6 +246,27 @@ protected function _initRejectPage($simple = false) return $this; } + /** + * Check is login data has empty login or pass + * See Mage_Admin_Model_Session: there is no any error message if login or password is empty + * + * @return boolean + */ + protected function _checkLoginIsEmpty() + { + $error = false; + $action = $this->getRequest()->getActionName(); + if (($action == 'index' || $action == 'simple') && $this->getRequest()->getPost('login')) { + $postLogin = $this->getRequest()->getPost('login'); + $username = isset($postLogin['username']) ? $postLogin['username'] : ''; + $password = isset($postLogin['password']) ? $postLogin['password'] : ''; + if (empty($username) || empty($password)) { + $error = true; + } + } + return $error; + } + /** * Confirm token authorization action */ diff --git a/app/code/core/Mage/OAuth/controllers/Adminhtml/OAuth/AuthorizedTokensController.php b/app/code/core/Mage/Oauth/controllers/Adminhtml/Oauth/AuthorizedTokensController.php similarity index 90% rename from app/code/core/Mage/OAuth/controllers/Adminhtml/OAuth/AuthorizedTokensController.php rename to app/code/core/Mage/Oauth/controllers/Adminhtml/Oauth/AuthorizedTokensController.php index 3252bf0ddd..04f32c2b9a 100644 --- a/app/code/core/Mage/OAuth/controllers/Adminhtml/OAuth/AuthorizedTokensController.php +++ b/app/code/core/Mage/Oauth/controllers/Adminhtml/Oauth/AuthorizedTokensController.php @@ -19,7 +19,7 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -28,15 +28,15 @@ * Manage authorized tokens controller * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @author Magento Core Team */ -class Mage_OAuth_Adminhtml_OAuth_AuthorizedTokensController extends Mage_Adminhtml_Controller_Action +class Mage_Oauth_Adminhtml_Oauth_AuthorizedTokensController extends Mage_Adminhtml_Controller_Action { /** * Init titles * - * @return Mage_OAuth_Adminhtml_OAuth_AuthorizedTokensController + * @return Mage_Oauth_Adminhtml_Oauth_AuthorizedTokensController */ public function preDispatch() { @@ -88,14 +88,14 @@ public function revokeAction() } try { - /** @var $collection Mage_OAuth_Model_Resource_Token_Collection */ + /** @var $collection Mage_Oauth_Model_Resource_Token_Collection */ $collection = Mage::getModel('oauth/token')->getCollection(); $collection->joinConsumerAsApplication() - ->addFilterByType(Mage_OAuth_Model_Token::TYPE_ACCESS) + ->addFilterByType(Mage_Oauth_Model_Token::TYPE_ACCESS) ->addFilterById($ids) ->addFilterByRevoked(!$status); - /** @var $item Mage_OAuth_Model_Token */ + /** @var $item Mage_Oauth_Model_Token */ foreach ($collection as $item) { $item->load($item->getId()); $item->setRevoked($status)->save(); @@ -132,13 +132,13 @@ public function deleteAction() } try { - /** @var $collection Mage_OAuth_Model_Resource_Token_Collection */ + /** @var $collection Mage_Oauth_Model_Resource_Token_Collection */ $collection = Mage::getModel('oauth/token')->getCollection(); $collection->joinConsumerAsApplication() - ->addFilterByType(Mage_OAuth_Model_Token::TYPE_ACCESS) + ->addFilterByType(Mage_Oauth_Model_Token::TYPE_ACCESS) ->addFilterById($ids); - /** @var $item Mage_OAuth_Model_Token */ + /** @var $item Mage_Oauth_Model_Token */ foreach ($collection as $item) { $item->delete(); @@ -169,7 +169,7 @@ protected function _isAllowed() /** * Send email notification to user about token status change * - * @param Mage_OAuth_Model_Token $token Token object + * @param Mage_Oauth_Model_Token $token Token object * @param string $newStatus Name of new token status */ protected function _sendTokenStatusChangeNotification($token, $newStatus) @@ -195,7 +195,7 @@ protected function _sendTokenStatusChangeNotification($token, $newStatus) $email = $customer->getEmail(); $name = $customer->getName(); } - /** @var $helper Mage_OAuth_Helper_Data */ + /** @var $helper Mage_Oauth_Helper_Data */ $helper = Mage::helper('oauth'); $helper->sendNotificationOnTokenStatusChange($email, $name, $token->getConsumer()->getName(), $newStatus); diff --git a/app/code/core/Mage/OAuth/controllers/Adminhtml/OAuth/ConsumerController.php b/app/code/core/Mage/Oauth/controllers/Adminhtml/Oauth/ConsumerController.php similarity index 93% rename from app/code/core/Mage/OAuth/controllers/Adminhtml/OAuth/ConsumerController.php rename to app/code/core/Mage/Oauth/controllers/Adminhtml/Oauth/ConsumerController.php index f1760c205f..31fa0e2b0d 100644 --- a/app/code/core/Mage/OAuth/controllers/Adminhtml/OAuth/ConsumerController.php +++ b/app/code/core/Mage/Oauth/controllers/Adminhtml/Oauth/ConsumerController.php @@ -19,7 +19,7 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -28,10 +28,10 @@ * Manage consumers controller * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @author Magento Core Team */ -class Mage_OAuth_Adminhtml_OAuth_ConsumerController extends Mage_Adminhtml_Controller_Action +class Mage_Oauth_Adminhtml_Oauth_ConsumerController extends Mage_Adminhtml_Controller_Action { /** * Unset unused data from request @@ -53,7 +53,7 @@ protected function _filter(array $data) /** * Init titles * - * @return Mage_OAuth_Adminhtml_OAuth_ConsumerController + * @return Mage_Oauth_Adminhtml_Oauth_ConsumerController */ public function preDispatch() { @@ -87,7 +87,7 @@ public function gridAction() */ public function newAction() { - /** @var $model Mage_OAuth_Model_Consumer */ + /** @var $model Mage_Oauth_Model_Consumer */ $model = Mage::getModel('oauth/consumer'); $formData = $this->_getFormData(); @@ -95,7 +95,7 @@ public function newAction() $this->_setFormData($formData); $model->addData($formData); } else { - /** @var $helper Mage_OAuth_Helper_Data */ + /** @var $helper Mage_Oauth_Helper_Data */ $helper = Mage::helper('oauth'); $model->setKey($helper->generateConsumerKey()); $model->setSecret($helper->generateConsumerSecret()); @@ -121,7 +121,7 @@ public function editAction() return; } - /** @var $model Mage_OAuth_Model_Consumer */ + /** @var $model Mage_Oauth_Model_Consumer */ $model = Mage::getModel('oauth/consumer'); $model->load($id); @@ -155,7 +155,7 @@ public function saveAction() $data = $this->_filter($this->getRequest()->getParams()); - /** @var $model Mage_OAuth_Model_Consumer */ + /** @var $model Mage_Oauth_Model_Consumer */ $model = Mage::getModel('oauth/consumer'); if ($id) { @@ -181,7 +181,7 @@ public function saveAction() } else { // If an admin was started create a new consumer and at this moment he has been edited an existing // consumer, we save the new consumer with a new key-secret pair - /** @var $helper Mage_OAuth_Helper_Data */ + /** @var $helper Mage_Oauth_Helper_Data */ $helper = Mage::helper('oauth'); $data['key'] = $helper->generateConsumerKey(); @@ -250,7 +250,7 @@ protected function _getFormData() * Set form data * * @param $data - * @return Mage_OAuth_Adminhtml_OAuth_ConsumerController + * @return Mage_Oauth_Adminhtml_Oauth_ConsumerController */ protected function _setFormData($data) { @@ -266,7 +266,7 @@ public function deleteAction() $consumerId = (int) $this->getRequest()->getParam('id'); if ($consumerId) { try { - /** @var $consumer Mage_OAuth_Model_Consumer */ + /** @var $consumer Mage_Oauth_Model_Consumer */ $consumer = Mage::getModel('oauth/consumer')->load($consumerId); if (!$consumer->getId()) { Mage::throwException(Mage::helper('oauth')->__('Unable to find a consumer.')); diff --git a/app/code/core/Mage/OAuth/controllers/AuthorizeController.php b/app/code/core/Mage/Oauth/controllers/AuthorizeController.php similarity index 80% rename from app/code/core/Mage/OAuth/controllers/AuthorizeController.php rename to app/code/core/Mage/Oauth/controllers/AuthorizeController.php index 955a8f5f40..9c4ee558d7 100644 --- a/app/code/core/Mage/OAuth/controllers/AuthorizeController.php +++ b/app/code/core/Mage/Oauth/controllers/AuthorizeController.php @@ -19,7 +19,7 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -28,10 +28,10 @@ * oAuth authorize controller * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @author Magento Core Team */ -class Mage_OAuth_AuthorizeController extends Mage_Core_Controller_Front_Action +class Mage_Oauth_AuthorizeController extends Mage_Core_Controller_Front_Action { /** * Session name @@ -44,11 +44,11 @@ class Mage_OAuth_AuthorizeController extends Mage_Core_Controller_Front_Action * Init authorize page * * @param bool $simple Is simple page? - * @return Mage_OAuth_AuthorizeController + * @return Mage_Oauth_AuthorizeController */ protected function _initForm($simple = false) { - /** @var $server Mage_OAuth_Model_Server */ + /** @var $server Mage_Oauth_Model_Server */ $server = Mage::getModel('oauth/server'); /** @var $session Mage_Customer_Model_Session */ $session = Mage::getSingleton($this->_sessionName); @@ -58,7 +58,7 @@ protected function _initForm($simple = false) $server->checkAuthorizeRequest(); } catch (Mage_Core_Exception $e) { $session->addError($e->getMessage()); - } catch (Mage_OAuth_Exception $e) { + } catch (Mage_Oauth_Exception $e) { $isException = true; $session->addException($e, $this->__('An error occurred. Your authorization request is invalid.')); } catch (Exception $e) { @@ -73,18 +73,14 @@ protected function _initForm($simple = false) $contentBlock = $layout->getBlock('content'); if ($logged) { $contentBlock->unsetChild('oauth.authorize.form'); - /** @var $block Mage_OAuth_Block_Authorize_Button */ + /** @var $block Mage_Oauth_Block_Authorize_Button */ $block = $contentBlock->getChild('oauth.authorize.button'); } else { $contentBlock->unsetChild('oauth.authorize.button'); - /** @var $block Mage_OAuth_Block_Authorize */ + /** @var $block Mage_Oauth_Block_Authorize */ $block = $contentBlock->getChild('oauth.authorize.form'); } - if ($simple) { - $layout->getBlock('oauth.authorize.style')->setData('is_logged', $logged); - } - /** @var $helper Mage_Core_Helper_Url */ $helper = Mage::helper('core/url'); $session->setAfterAuthUrl(Mage::getUrl('customer/account/login', array('_nosid' => true))) @@ -100,26 +96,34 @@ protected function _initForm($simple = false) * Init confirm page * * @param bool $simple Is simple page? - * @return Mage_OAuth_AuthorizeController + * @return Mage_Oauth_AuthorizeController */ protected function _initConfirmPage($simple = false) { + /** @var $helper Mage_Oauth_Helper_Data */ + $helper = Mage::helper('oauth'); + + /** @var $session Mage_Customer_Model_Session */ + $session = Mage::getSingleton($this->_sessionName); + if (!$session->getCustomerId()) { + $session->addError($this->__('Please login to proceed authorization.')); + $url = $helper->getAuthorizeUrl(Mage_Oauth_Model_Token::USER_TYPE_CUSTOMER); + $this->_redirectUrl($url); + return $this; + } + $this->loadLayout(); - try { - /** @var $session Mage_Customer_Model_Session */ - $session = Mage::getSingleton($this->_sessionName); - /** @var $server Mage_OAuth_Model_Server */ - $server = Mage::getModel('oauth/server'); - /** @var $block Mage_OAuth_Block_Authorize */ - $block = $this->getLayout()->getBlock('oauth.authorize.confirm'); - $block->setIsSimple($simple); + /** @var $block Mage_Oauth_Block_Authorize */ + $block = $this->getLayout()->getBlock('oauth.authorize.confirm'); + $block->setIsSimple($simple); - /** @var $token Mage_OAuth_Model_Token */ - $token = $server->authorizeToken($session->getCustomerId(), Mage_OAuth_Model_Token::USER_TYPE_CUSTOMER); + try { + /** @var $server Mage_Oauth_Model_Server */ + $server = Mage::getModel('oauth/server'); - /** @var $helper Mage_OAuth_Helper_Data */ - $helper = Mage::helper('oauth'); + /** @var $token Mage_Oauth_Model_Token */ + $token = $server->authorizeToken($session->getCustomerId(), Mage_Oauth_Model_Token::USER_TYPE_CUSTOMER); if (($callback = $helper->getFullCallbackUrl($token))) { //false in case of OOB $this->_redirectUrl($callback . ($simple ? '&simple=1' : '')); @@ -130,7 +134,7 @@ protected function _initConfirmPage($simple = false) } } catch (Mage_Core_Exception $e) { $session->addError($e->getMessage()); - } catch (Mage_OAuth_Exception $e) { + } catch (Mage_Oauth_Exception $e) { $session->addException($e, $this->__('An error occurred. Your authorization request is invalid.')); } catch (Exception $e) { $session->addException($e, $this->__('An error occurred on confirm authorize.')); @@ -146,7 +150,7 @@ protected function _initConfirmPage($simple = false) * Init reject page * * @param bool $simple Is simple page? - * @return Mage_OAuth_AuthorizeController + * @return Mage_Oauth_AuthorizeController */ protected function _initRejectPage($simple = false) { @@ -155,16 +159,16 @@ protected function _initRejectPage($simple = false) /** @var $session Mage_Customer_Model_Session */ $session = Mage::getSingleton($this->_sessionName); try { - /** @var $server Mage_OAuth_Model_Server */ + /** @var $server Mage_Oauth_Model_Server */ $server = Mage::getModel('oauth/server'); - /** @var $block Mage_OAuth_Block_Authorize */ + /** @var $block Mage_Oauth_Block_Authorize */ $block = $this->getLayout()->getBlock('oauth.authorize.reject'); - $block->setIsSimple($simple . ($simple ? '&simple=1' : '')); + $block->setIsSimple($simple); - /** @var $token Mage_OAuth_Model_Token */ + /** @var $token Mage_Oauth_Model_Token */ $token = $server->checkAuthorizeRequest(); - /** @var $helper Mage_OAuth_Helper_Data */ + /** @var $helper Mage_Oauth_Helper_Data */ $helper = Mage::helper('oauth'); if (($callback = $helper->getFullCallbackUrl($token, true))) { diff --git a/app/code/core/Mage/OAuth/controllers/Customer/TokenController.php b/app/code/core/Mage/Oauth/controllers/Customer/TokenController.php similarity index 91% rename from app/code/core/Mage/OAuth/controllers/Customer/TokenController.php rename to app/code/core/Mage/Oauth/controllers/Customer/TokenController.php index bf12802a6c..e729e041ab 100644 --- a/app/code/core/Mage/OAuth/controllers/Customer/TokenController.php +++ b/app/code/core/Mage/Oauth/controllers/Customer/TokenController.php @@ -19,7 +19,7 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -30,10 +30,10 @@ * Tab "My Applications" in the Customer Account * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @author Magento Core Team */ -class Mage_OAuth_Customer_TokenController extends Mage_Core_Controller_Front_Action +class Mage_Oauth_Customer_TokenController extends Mage_Core_Controller_Front_Action { /** * Customer session model @@ -77,7 +77,7 @@ public function indexAction() /** * Redirect to referrer URL or otherwise to index page without params * - * @return Mage_OAuth_Customer_TokenController + * @return Mage_Oauth_Customer_TokenController */ protected function _redirectBack() { @@ -112,16 +112,16 @@ public function revokeAction() } try { - /** @var $collection Mage_OAuth_Model_Resource_Token_Collection */ + /** @var $collection Mage_Oauth_Model_Resource_Token_Collection */ $collection = Mage::getModel('oauth/token')->getCollection(); $collection->joinConsumerAsApplication() ->addFilterByCustomerId($this->_session->getCustomerId()) ->addFilterById($id) - ->addFilterByType(Mage_OAuth_Model_Token::TYPE_ACCESS) + ->addFilterByType(Mage_Oauth_Model_Token::TYPE_ACCESS) ->addFilterByRevoked(!$status); //here is can be load from model, but used from collection for get consumer name - /** @var $model Mage_OAuth_Model_Token */ + /** @var $model Mage_Oauth_Model_Token */ $model = $collection->getFirstItem(); if ($model->getId()) { $name = $model->getName(); @@ -160,14 +160,14 @@ public function deleteAction() } try { - /** @var $collection Mage_OAuth_Model_Resource_Token_Collection */ + /** @var $collection Mage_Oauth_Model_Resource_Token_Collection */ $collection = Mage::getModel('oauth/token')->getCollection(); $collection->joinConsumerAsApplication() ->addFilterByCustomerId($this->_session->getCustomerId()) - ->addFilterByType(Mage_OAuth_Model_Token::TYPE_ACCESS) + ->addFilterByType(Mage_Oauth_Model_Token::TYPE_ACCESS) ->addFilterById($id); - /** @var $model Mage_OAuth_Model_Token */ + /** @var $model Mage_Oauth_Model_Token */ $model = $collection->getFirstItem(); if ($model->getId()) { $name = $model->getName(); diff --git a/app/code/core/Mage/OAuth/controllers/InitiateController.php b/app/code/core/Mage/Oauth/controllers/InitiateController.php similarity index 90% rename from app/code/core/Mage/OAuth/controllers/InitiateController.php rename to app/code/core/Mage/Oauth/controllers/InitiateController.php index 58b6700eb7..53939598bd 100644 --- a/app/code/core/Mage/OAuth/controllers/InitiateController.php +++ b/app/code/core/Mage/Oauth/controllers/InitiateController.php @@ -19,7 +19,7 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -28,10 +28,10 @@ * oAuth initiate controller * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @author Magento Core Team */ -class Mage_OAuth_InitiateController extends Mage_Core_Controller_Front_Action +class Mage_Oauth_InitiateController extends Mage_Core_Controller_Front_Action { /** * Dispatch event before action @@ -53,7 +53,7 @@ public function preDispatch() */ public function indexAction() { - /** @var $server Mage_OAuth_Model_Server */ + /** @var $server Mage_Oauth_Model_Server */ $server = Mage::getModel('oauth/server'); $server->initiateToken(); diff --git a/app/code/core/Mage/OAuth/controllers/TokenController.php b/app/code/core/Mage/Oauth/controllers/TokenController.php similarity index 90% rename from app/code/core/Mage/OAuth/controllers/TokenController.php rename to app/code/core/Mage/Oauth/controllers/TokenController.php index c85f979b2a..43e49a6026 100644 --- a/app/code/core/Mage/OAuth/controllers/TokenController.php +++ b/app/code/core/Mage/Oauth/controllers/TokenController.php @@ -19,7 +19,7 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -28,10 +28,10 @@ * oAuth token controller * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @author Magento Core Team */ -class Mage_OAuth_TokenController extends Mage_Core_Controller_Front_Action +class Mage_Oauth_TokenController extends Mage_Core_Controller_Front_Action { /** * Dispatch event before action @@ -53,7 +53,7 @@ public function preDispatch() */ public function indexAction() { - /** @var $server Mage_OAuth_Model_Server */ + /** @var $server Mage_Oauth_Model_Server */ $server = Mage::getModel('oauth/server'); $server->accessToken(); diff --git a/app/code/core/Mage/OAuth/etc/adminhtml.xml b/app/code/core/Mage/Oauth/etc/adminhtml.xml similarity index 95% rename from app/code/core/Mage/OAuth/etc/adminhtml.xml rename to app/code/core/Mage/Oauth/etc/adminhtml.xml index 3528286afc..ee47e8cd1d 100644 --- a/app/code/core/Mage/OAuth/etc/adminhtml.xml +++ b/app/code/core/Mage/Oauth/etc/adminhtml.xml @@ -20,7 +20,7 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ @@ -80,17 +80,17 @@ REST - OAuth Consumers 50 - adminhtml/oAuth_consumer + adminhtml/oauth_consumer REST - OAuth Authorized Tokens 60 - adminhtml/oAuth_authorizedTokens + adminhtml/oauth_authorizedTokens REST - My Apps 70 - adminhtml/oAuth_admin_token + adminhtml/oauth_admin_token diff --git a/app/code/core/Mage/OAuth/etc/config.xml b/app/code/core/Mage/Oauth/etc/config.xml similarity index 85% rename from app/code/core/Mage/OAuth/etc/config.xml rename to app/code/core/Mage/Oauth/etc/config.xml index 28f3a54870..e85a546c8e 100644 --- a/app/code/core/Mage/OAuth/etc/config.xml +++ b/app/code/core/Mage/Oauth/etc/config.xml @@ -20,25 +20,25 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> - + 1.0.0.0 - + - Mage_OAuth_Model + Mage_Oauth_Model oauth_resource - Mage_OAuth_Model_Resource + Mage_Oauth_Model_Resource
    - +
    - - - + @@ -56,10 +50,10 @@ @@ -116,7 +116,7 @@ helper('wishlist')->isAllow()) : ?> diff --git a/app/design/frontend/default/iphone/template/catalog/product/compare/sidebar.phtml b/app/design/frontend/default/iphone/template/catalog/product/compare/sidebar.phtml index 5160a0eb4a..7634403662 100644 --- a/app/design/frontend/default/iphone/template/catalog/product/compare/sidebar.phtml +++ b/app/design/frontend/default/iphone/template/catalog/product/compare/sidebar.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* @var $this Mage_Catalog_Block_Product_Compare_Sidebar */ diff --git a/app/design/frontend/default/iphone/template/catalog/product/gallery.phtml b/app/design/frontend/default/iphone/template/catalog/product/gallery.phtml index 1abb573081..8c9a9a5da4 100644 --- a/app/design/frontend/default/iphone/template/catalog/product/gallery.phtml +++ b/app/design/frontend/default/iphone/template/catalog/product/gallery.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/default/iphone/template/catalog/product/list.phtml b/app/design/frontend/default/iphone/template/catalog/product/list.phtml index b94fdafb34..effa93c84c 100644 --- a/app/design/frontend/default/iphone/template/catalog/product/list.phtml +++ b/app/design/frontend/default/iphone/template/catalog/product/list.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/default/iphone/template/catalog/product/list/toolbar.phtml b/app/design/frontend/default/iphone/template/catalog/product/list/toolbar.phtml index 4ff56a27a2..dc8a9aebec 100644 --- a/app/design/frontend/default/iphone/template/catalog/product/list/toolbar.phtml +++ b/app/design/frontend/default/iphone/template/catalog/product/list/toolbar.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/default/iphone/template/catalog/product/list/upsell.phtml b/app/design/frontend/default/iphone/template/catalog/product/list/upsell.phtml index f171be8f74..625ae23c42 100644 --- a/app/design/frontend/default/iphone/template/catalog/product/list/upsell.phtml +++ b/app/design/frontend/default/iphone/template/catalog/product/list/upsell.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/default/iphone/template/catalog/product/price.phtml b/app/design/frontend/default/iphone/template/catalog/product/price.phtml index 7f0dbbba19..b257084cb3 100644 --- a/app/design/frontend/default/iphone/template/catalog/product/price.phtml +++ b/app/design/frontend/default/iphone/template/catalog/product/price.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -61,32 +61,32 @@ getPrice($_product, $_product->getFinalPrice()) ?> getPrice($_product, $_product->getFinalPrice(), true) ?> getPriceDisplayType(); ?> - + = $_price): ?> displayBothPrices()): ?> typeOfDisplay($_product, 0)): // including ?> helper('tax')->__('Excl. Tax:') ?> - currency($_price+$_weeeTaxAmount,true,false) ?> + currency($_price + $_weeeTaxAmount, true, false) ?> helper('tax')->__('Incl. Tax:') ?> - currency($_finalPriceInclTax+$_weeeTaxAmount,true,false) ?> + currency($_finalPriceInclTax + $_weeeTaxAmount, true, false) ?> typeOfDisplay($_product, 1)): // incl. + weee ?> helper('tax')->__('Excl. Tax:') ?> - currency($_price+$_weeeTaxAmount,true,false) ?> + currency($_price + $_weeeTaxAmount, true, false) ?> helper('tax')->__('Incl. Tax:') ?> - currency($_finalPriceInclTax+$_weeeTaxAmount,true,false) ?> + currency($_finalPriceInclTax + $_weeeTaxAmount, true, false) ?> ( @@ -100,18 +100,18 @@ helper('tax')->__('Excl. Tax:') ?> - currency($_price+$_weeeTaxAmount,true,false) ?> + currency($_price + $_weeeTaxAmount, true, false) ?> helper('tax')->__('Incl. Tax:') ?> - currency($_finalPriceInclTax+$_weeeTaxAmount,true,false) ?> + currency($_finalPriceInclTax + $_weeeTaxAmount, true, false) ?> ( - getName(); ?>: currency($_weeeTaxAttribute->getAmount()+$_weeeTaxAttribute->getTaxAmount(), true, true); ?> + getName(); ?>: currency($_weeeTaxAttribute->getAmount() + $_weeeTaxAttribute->getTaxAmount(), true, true); ?> ) @@ -120,7 +120,7 @@ helper('tax')->__('Excl. Tax:') ?> - currency($_price,true,false) ?> + currency($_price, true, false) ?> @@ -131,31 +131,36 @@ helper('tax')->__('Incl. Tax:') ?> - currency($_finalPriceInclTax+$_weeeTaxAmount,true,false) ?> + currency($_finalPriceInclTax + $_weeeTaxAmount, true, false) ?> helper('tax')->__('Excl. Tax:') ?> - currency($_price,true,false) ?> + currency($_price, true, false) ?> + + currency($_price, true, false) ?> + + currency($_finalPrice, true, false) ?> + helper('tax')->__('Incl. Tax:') ?> - currency($_finalPriceInclTax,true,false) ?> + currency($_finalPriceInclTax, true, false) ?> typeOfDisplay($_product, 0)): // including ?> - currency($_price+$_weeeTaxAmount,true,true) ?> + currency($_price + $_weeeTaxAmount,true,true) ?> typeOfDisplay($_product, 1)): // incl. + weee ?> - currency($_price+$_weeeTaxAmount,true,true) ?> + currency($_price + $_weeeTaxAmount,true,true) ?> ( @@ -166,12 +171,12 @@ ) typeOfDisplay($_product, 4)): // incl. + weee ?> - currency($_price+$_weeeTaxAmount,true,true) ?> + currency($_price + $_weeeTaxAmount,true,true) ?> ( - getName(); ?>: currency($_weeeTaxAttribute->getAmount()+$_weeeTaxAttribute->getTaxAmount(), true, true); ?> + getName(); ?>: currency($_weeeTaxAttribute->getAmount() + $_weeeTaxAttribute->getTaxAmount(), true, true); ?> ) @@ -183,7 +188,7 @@ - currency($_price+$_weeeTaxAmount,true,true) ?> + currency($_price + $_weeeTaxAmount,true,true) ?> @@ -201,13 +206,13 @@ __('Excl. Tax:') ?> - currency($_finalPrice+$_weeeTaxAmount,true,false) ?> + currency($_finalPrice + $_weeeTaxAmount, true, false) ?> __('Incl. Tax:') ?> - currency($_finalPriceInclTax+$_weeeTaxAmount,true,false) ?> + currency($_finalPriceInclTax + $_weeeTaxAmount, true, false) ?>

    @@ -215,14 +220,14 @@

    __('Special Price:') ?> - currency($_finalPrice+$_weeeTaxAmount,true,false) ?> + currency($_finalPrice + $_weeeTaxAmount, true, false) ?>

    __('Regular Price:') ?> - currency($_regularPrice+$_originalWeeeTaxAmount,true,false) ?> + currency($_regularPrice + $_originalWeeeTaxAmount, true, false) ?>

    @@ -232,7 +237,7 @@ __('Excl. Tax:') ?> - currency($_finalPrice+$_weeeTaxAmount,true,false) ?> + currency($_finalPrice + $_weeeTaxAmount, true, false) ?> ( @@ -245,14 +250,14 @@ __('Incl. Tax:') ?> - currency($_finalPriceInclTax+$_weeeTaxAmount,true,false) ?> + currency($_finalPriceInclTax + $_weeeTaxAmount, true, false) ?>

    __('Regular Price:') ?> - currency($_regularPrice+$_originalWeeeTaxAmount,true,false) ?> + currency($_regularPrice + $_originalWeeeTaxAmount, true, false) ?>

    typeOfDisplay($_product, 4)): // incl. + weee ?> @@ -261,27 +266,27 @@ __('Excl. Tax:') ?> - currency($_finalPrice+$_weeeTaxAmount,true,false) ?> + currency($_finalPrice + $_weeeTaxAmount, true, false) ?> ( - getName(); ?>: currency($_weeeTaxAttribute->getAmount()+$_weeeTaxAttribute->getTaxAmount(), true, true); ?> + getName(); ?>: currency($_weeeTaxAttribute->getAmount() + $_weeeTaxAttribute->getTaxAmount(), true, true); ?> ) helper('tax')->__('Incl. Tax:') ?> - currency($_finalPriceInclTax+$_weeeTaxAmount,true,false) ?> + currency($_finalPriceInclTax + $_weeeTaxAmount, true, false) ?>

    __('Regular Price:') ?> - currency($_regularPrice+$_originalWeeeTaxAmount,true,false) ?> + currency($_regularPrice + $_originalWeeeTaxAmount, true, false) ?>

    typeOfDisplay($_product, 2)): // excl. + weee + final ?> @@ -290,7 +295,7 @@ __('Excl. Tax:') ?> - currency($_finalPrice,true,false) ?> + currency($_finalPrice, true, false) ?> @@ -301,14 +306,14 @@ helper('tax')->__('Incl. Tax:') ?> - currency($_finalPriceInclTax+$_weeeTaxAmount,true,false) ?> + currency($_finalPriceInclTax + $_weeeTaxAmount, true, false) ?>

    __('Regular Price:') ?> - currency($_regularPrice,true,false) ?> + currency($_regularPrice, true, false) ?>

    @@ -318,13 +323,13 @@ __('Excl. Tax:') ?> - currency($_finalPrice,true,false) ?> + currency($_finalPrice, true, false) ?> helper('tax')->__('Incl. Tax:') ?> - currency($_finalPriceInclTax,true,false) ?> + currency($_finalPriceInclTax, true, false) ?>

    @@ -332,14 +337,14 @@

    __('Special Price:') ?> - currency($_finalPrice,true,false) ?> + currency($_finalPrice, true, false) ?>

    __('Regular Price:') ?> - currency($_regularPrice,true,false) ?> + currency($_regularPrice, true, false) ?>

    @@ -350,7 +355,7 @@ typeOfDisplay($_product, array(0, 1, 4))): ?> - + getUseLinkForAsLowAs()):?> @@ -359,7 +364,7 @@ __('As low as:') ?> - currency($_minimalPriceDisplayValue,true,false) ?> + currency($_minimalPriceDisplayValue, true, false) ?> getUseLinkForAsLowAs()):?> diff --git a/app/design/frontend/default/iphone/template/catalog/product/view.phtml b/app/design/frontend/default/iphone/template/catalog/product/view.phtml index 1cb640fac0..1a13808fff 100644 --- a/app/design/frontend/default/iphone/template/catalog/product/view.phtml +++ b/app/design/frontend/default/iphone/template/catalog/product/view.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/default/iphone/template/catalog/product/view/addto.phtml b/app/design/frontend/default/iphone/template/catalog/product/view/addto.phtml index 5859ae0f5d..deb987f000 100644 --- a/app/design/frontend/default/iphone/template/catalog/product/view/addto.phtml +++ b/app/design/frontend/default/iphone/template/catalog/product/view/addto.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -29,7 +29,7 @@ helper('wishlist')->getAddUrl($_product); ?>
      helper('wishlist')->isAllow()) : ?> -
    • __('Add to Wishlist') ?>
    • +
    • __('Add to Wishlist') ?>
    • helper('catalog/product_compare')->getAddUrl($_product); diff --git a/app/design/frontend/default/iphone/template/catalog/product/view/addtocart.phtml b/app/design/frontend/default/iphone/template/catalog/product/view/addtocart.phtml index 80a56b97e7..2e7e54a693 100644 --- a/app/design/frontend/default/iphone/template/catalog/product/view/addtocart.phtml +++ b/app/design/frontend/default/iphone/template/catalog/product/view/addtocart.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/default/iphone/template/catalog/product/view/addtowishlist.phtml b/app/design/frontend/default/iphone/template/catalog/product/view/addtowishlist.phtml index 773b061f57..4723d53d14 100644 --- a/app/design/frontend/default/iphone/template/catalog/product/view/addtowishlist.phtml +++ b/app/design/frontend/default/iphone/template/catalog/product/view/addtowishlist.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ @@ -28,4 +28,4 @@ ?> getProduct(); ?> helper('wishlist')->getAddUrl($_product); ?> -__('Add to Wishlist') ?> +__('Add to Wishlist') ?> diff --git a/app/design/frontend/default/iphone/template/catalog/product/view/media.phtml b/app/design/frontend/default/iphone/template/catalog/product/view/media.phtml index 522424d827..67df011c85 100644 --- a/app/design/frontend/default/iphone/template/catalog/product/view/media.phtml +++ b/app/design/frontend/default/iphone/template/catalog/product/view/media.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/default/iphone/template/catalog/product/view/type/grouped.phtml b/app/design/frontend/default/iphone/template/catalog/product/view/type/grouped.phtml index 24f6e6e561..11d6640d31 100644 --- a/app/design/frontend/default/iphone/template/catalog/product/view/type/grouped.phtml +++ b/app/design/frontend/default/iphone/template/catalog/product/view/type/grouped.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/default/iphone/template/catalog/product/view/type/grouped_grid.phtml b/app/design/frontend/default/iphone/template/catalog/product/view/type/grouped_grid.phtml index 408333e25b..2092560c92 100644 --- a/app/design/frontend/default/iphone/template/catalog/product/view/type/grouped_grid.phtml +++ b/app/design/frontend/default/iphone/template/catalog/product/view/type/grouped_grid.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ $this->setPreconfiguredValue(); ?> diff --git a/app/design/frontend/default/iphone/template/catalogsearch/form.mini.phtml b/app/design/frontend/default/iphone/template/catalogsearch/form.mini.phtml index 78107f09fc..95fdee480a 100644 --- a/app/design/frontend/default/iphone/template/catalogsearch/form.mini.phtml +++ b/app/design/frontend/default/iphone/template/catalogsearch/form.mini.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* @var $this Mage_Core_Block_Template */ diff --git a/app/design/frontend/default/iphone/template/catalogsearch/result.phtml b/app/design/frontend/default/iphone/template/catalogsearch/result.phtml index a6eb94498e..998da01763 100644 --- a/app/design/frontend/default/iphone/template/catalogsearch/result.phtml +++ b/app/design/frontend/default/iphone/template/catalogsearch/result.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/default/iphone/template/checkout/cart.phtml b/app/design/frontend/default/iphone/template/checkout/cart.phtml index 9cd43d3e55..505f53678f 100644 --- a/app/design/frontend/default/iphone/template/checkout/cart.phtml +++ b/app/design/frontend/default/iphone/template/checkout/cart.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/default/iphone/template/checkout/cart/item/default.phtml b/app/design/frontend/default/iphone/template/checkout/cart/item/default.phtml index 287b0ed7aa..a26f5a256b 100644 --- a/app/design/frontend/default/iphone/template/checkout/cart/item/default.phtml +++ b/app/design/frontend/default/iphone/template/checkout/cart/item/default.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -103,6 +103,7 @@ __('Edit') ?> --> +
    - helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()): ?> + helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()) && !$_item->getNoSubtotal()): ?> - helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()): ?> + helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()) && !$_item->getNoSubtotal()): ?> - + @@ -172,7 +172,7 @@ - + @@ -180,7 +180,7 @@ - + @@ -192,11 +192,11 @@ - + - + diff --git a/app/code/core/Mage/Compiler/etc/compilation.xml b/app/code/core/Mage/Compiler/etc/compilation.xml index f5b2130b1d..17a5699b00 100644 --- a/app/code/core/Mage/Compiler/etc/compilation.xml +++ b/app/code/core/Mage/Compiler/etc/compilation.xml @@ -103,10 +103,6 @@ - - - - @@ -339,17 +335,16 @@ - - + - - - + + + diff --git a/app/code/core/Mage/Contacts/etc/system.xml b/app/code/core/Mage/Contacts/etc/system.xml index 6d5fdf4f8f..b74bccc557 100644 --- a/app/code/core/Mage/Contacts/etc/system.xml +++ b/app/code/core/Mage/Contacts/etc/system.xml @@ -67,6 +67,7 @@ text + validate-email 10 1 1 diff --git a/app/code/core/Mage/Core/Controller/Request/Http.php b/app/code/core/Mage/Core/Controller/Request/Http.php index efdaecb156..d7ec794a08 100644 --- a/app/code/core/Mage/Core/Controller/Request/Http.php +++ b/app/code/core/Mage/Core/Controller/Request/Http.php @@ -297,7 +297,7 @@ public function getHttpHost($trimPort = true) /** * Set a member of the $_POST superglobal * - * @param striing|array $key + * @param string|array $key * @param mixed $value * * @return Mage_Core_Controller_Request_Http diff --git a/app/code/core/Mage/Core/Controller/Varien/Action.php b/app/code/core/Mage/Core/Controller/Varien/Action.php index 648b646b14..8f16e3c5e9 100755 --- a/app/code/core/Mage/Core/Controller/Varien/Action.php +++ b/app/code/core/Mage/Core/Controller/Varien/Action.php @@ -147,7 +147,6 @@ public function __construct(Zend_Controller_Request_Abstract $request, Zend_Cont protected function _construct() { - } public function hasAction($action) @@ -242,12 +241,12 @@ public function getLayout() /** * Load layout by handles(s) * - * @param string $handles - * @param string $cacheId - * @param boolean $generateBlocks + * @param string|null|bool $handles + * @param bool $generateBlocks + * @param bool $generateXml * @return Mage_Core_Controller_Varien_Action */ - public function loadLayout($handles=null, $generateBlocks=true, $generateXml=true) + public function loadLayout($handles = null, $generateBlocks = true, $generateXml = true) { // if handles were specified in arguments load them first if (false!==$handles && ''!==$handles) { @@ -466,7 +465,7 @@ public function getActionMethodName($action) /** * Dispatch event before action * - * @return null + * @return void */ public function preDispatch() { @@ -488,13 +487,27 @@ public function preDispatch() } if (!$this->getFlag('', self::FLAG_NO_START_SESSION)) { - $checkCookie = in_array($this->getRequest()->getActionName(), $this->_cookieCheckActions); - $checkCookie = $checkCookie && !$this->getRequest()->getParam('nocookie', false); + $checkCookie = in_array($this->getRequest()->getActionName(), $this->_cookieCheckActions) + && !$this->getRequest()->getParam('nocookie', false); $cookies = Mage::getSingleton('core/cookie')->get(); - if ($checkCookie && empty($cookies)) { - $this->setFlag('', self::FLAG_NO_COOKIES_REDIRECT, true); + /** @var $session Mage_Core_Model_Session */ + $session = Mage::getSingleton('core/session', array('name' => $this->_sessionNamespace))->start(); + + if (empty($cookies)) { + if ($session->getCookieShouldBeReceived()) { + $this->setFlag('', self::FLAG_NO_COOKIES_REDIRECT, true); + $session->unsCookieShouldBeReceived(); + $session->setSkipSessionIdFlag(true); + } elseif ($checkCookie) { + if (isset($_GET[$session->getSessionIdQueryParam()]) && Mage::app()->getUseSessionInUrl() + && $this->_sessionNamespace != Mage_Adminhtml_Controller_Action::SESSION_NAMESPACE + ) { + $session->setCookieShouldBeReceived(true); + } else { + $this->setFlag('', self::FLAG_NO_COOKIES_REDIRECT, true); + } + } } - Mage::getSingleton('core/session', array('name' => $this->_sessionNamespace))->start(); } Mage::app()->loadArea($this->getLayout()->getArea()); @@ -553,7 +566,6 @@ public function norouteAction($coreRoute = null) $this->renderLayout(); } else { $status->setForwarded(true); - #$this->_forward('cmsNoRoute', 'index', 'cms'); $this->_forward( $status->getForwardAction(), $status->getForwardController(), @@ -590,7 +602,7 @@ public function noCookiesAction() * @param string $action * @param string|null $controller * @param string|null $module - * @param string|null $params + * @param array|null $params */ protected function _forward($action, $controller = null, $module = null, array $params = null) { @@ -598,15 +610,15 @@ protected function _forward($action, $controller = null, $module = null, array $ $request->initForward(); - if (!is_null($params)) { + if (isset($params)) { $request->setParams($params); } - if (!is_null($controller)) { + if (isset($controller)) { $request->setControllerName($controller); // Module should only be reset if controller has been specified - if (!is_null($module)) { + if (isset($module)) { $request->setModuleName($module); } } @@ -616,7 +628,7 @@ protected function _forward($action, $controller = null, $module = null, array $ } /** - * Inits layout messages by message storage(s), loading and adding messages to layout messages block + * Initializing layout messages by message storage(s), loading and adding messages to layout messages block * * @param string|array $messagesStorage * @return Mage_Core_Controller_Varien_Action @@ -644,7 +656,7 @@ protected function _initLayoutMessages($messagesStorage) } /** - * Inits layout messages by message storage(s), loading and adding messages to layout messages block + * Initializing layout messages by message storage(s), loading and adding messages to layout messages block * * @param string|array $messagesStorage * @return Mage_Core_Controller_Varien_Action @@ -671,17 +683,42 @@ protected function _redirectUrl($url) * * @param string $path * @param array $arguments + * @return Mage_Core_Controller_Varien_Action + */ + protected function _redirect($path, $arguments = array()) + { + return $this->setRedirectWithCookieCheck($path, $arguments); + } + + /** + * Set redirect into response with session id in URL if it is enabled. + * It allows to distinguish primordial request from browser with cookies disabled. + * + * @param string $path + * @param array $arguments + * @return Mage_Core_Controller_Varien_Action */ - protected function _redirect($path, $arguments=array()) + public function setRedirectWithCookieCheck($path, array $arguments = array()) { + /** @var $session Mage_Core_Model_Session */ + $session = Mage::getSingleton('core/session', array('name' => $this->_sessionNamespace)); + if ($session->getCookieShouldBeReceived() && Mage::app()->getUseSessionInUrl() + && $this->_sessionNamespace != Mage_Adminhtml_Controller_Action::SESSION_NAMESPACE + ) { + $arguments += array('_query' => array( + $session->getSessionIdQueryParam() => $session->getSessionId() + )); + } $this->getResponse()->setRedirect(Mage::getUrl($path, $arguments)); return $this; } + /** * Redirect to success page * * @param string $defaultUrl + * @return Mage_Core_Controller_Varien_Action */ protected function _redirectSuccess($defaultUrl) { @@ -700,6 +737,7 @@ protected function _redirectSuccess($defaultUrl) * Redirect to error page * * @param string $defaultUrl + * @return Mage_Core_Controller_Varien_Action */ protected function _redirectError($defaultUrl) { @@ -715,7 +753,7 @@ protected function _redirectError($defaultUrl) } /** - * Set referer url for redirect in responce + * Set referer url for redirect in response * * @param string $defaultUrl * @return Mage_Core_Controller_Varien_Action @@ -885,6 +923,7 @@ protected function _validateFormKey() * * @see self::_renderTitles() * @param string|false|-1|null $text + * @param bool $resetIfExists * @return Mage_Core_Controller_Varien_Action */ protected function _title($text = null, $resetIfExists = true) @@ -990,7 +1029,7 @@ protected function _filterDateTime($array, $dateFields) } /** - * Declare headers and content file in responce for file download + * Declare headers and content file in response for file download * * @param string $fileName * @param string|array $content set to null to avoid starting output, $contentLength should be set explicitly in diff --git a/app/code/core/Mage/Core/Controller/Varien/Front.php b/app/code/core/Mage/Core/Controller/Varien/Front.php index 93312bbc42..a3c9fe933c 100644 --- a/app/code/core/Mage/Core/Controller/Varien/Front.php +++ b/app/code/core/Mage/Core/Controller/Varien/Front.php @@ -296,35 +296,38 @@ protected function _checkBaseUrl($request) if (!Mage::isInstalled() || $request->getPost()) { return; } - if (!Mage::getStoreConfig('web/url/redirect_to_base')) { + + $redirectCode = (int)Mage::getStoreConfig('web/url/redirect_to_base'); + if (!$redirectCode) { return; + } elseif ($redirectCode != 301) { + $redirectCode = 302; } - if ($this->_isAdminFrontNameMatched($request) - && (string)Mage::getConfig()->getNode(Mage_Adminhtml_Helper_Data::XML_PATH_USE_CUSTOM_ADMIN_URL) - ) { + if ($this->_isAdminFrontNameMatched($request)) { return; } - $baseUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB, Mage::app()->getStore()->isCurrentlySecure()); - + $baseUrl = Mage::getBaseUrl( + Mage_Core_Model_Store::URL_TYPE_WEB, + Mage::getConfig()->shouldUrlBeSecure($request->getPathInfo()) + ); if (!$baseUrl) { return; } - $redirectCode = 302; - if (Mage::getStoreConfig('web/url/redirect_to_base') == 301) { - $redirectCode = 301; - } - - $uri = @parse_url($baseUrl); - $host = isset($uri['host']) ? $uri['host'] : ''; - $path = isset($uri['path']) ? $uri['path'] : ''; - + $uri = @parse_url($baseUrl); $requestUri = $request->getRequestUri() ? $request->getRequestUri() : '/'; - if ($host && $host != $request->getHttpHost() || $path && strpos($requestUri, $path) === false) { + if (isset($uri['scheme']) && $uri['scheme'] != $request->getScheme() + || isset($uri['host']) && $uri['host'] != $request->getHttpHost() + || isset($uri['path']) && strpos($requestUri, $uri['path']) === false + ) { + $redirectUrl = Mage::getSingleton('core/url')->getRedirectUrl( + Mage::getUrl(ltrim($request->getPathInfo(), '/'), array('_nosid' => true)) + ); + Mage::app()->getFrontController()->getResponse() - ->setRedirect($baseUrl, $redirectCode) + ->setRedirect($redirectUrl, $redirectCode) ->sendResponse(); exit; } @@ -338,7 +341,11 @@ protected function _checkBaseUrl($request) */ protected function _isAdminFrontNameMatched($request) { - $adminPath = (string)Mage::getConfig()->getNode(Mage_Adminhtml_Helper_Data::XML_PATH_CUSTOM_ADMIN_PATH); + $useCustomAdminPath = (bool)(string)Mage::getConfig() + ->getNode(Mage_Adminhtml_Helper_Data::XML_PATH_USE_CUSTOM_ADMIN_PATH); + $customAdminPath = (string)Mage::getConfig()->getNode(Mage_Adminhtml_Helper_Data::XML_PATH_CUSTOM_ADMIN_PATH); + $adminPath = ($useCustomAdminPath) ? $customAdminPath : null; + if (!$adminPath) { $adminPath = (string)Mage::getConfig() ->getNode(Mage_Adminhtml_Helper_Data::XML_PATH_ADMINHTML_ROUTER_FRONTNAME); diff --git a/app/code/core/Mage/Core/Controller/Varien/Router/Admin.php b/app/code/core/Mage/Core/Controller/Varien/Router/Admin.php index 46456ec9b5..11b587bbfa 100644 --- a/app/code/core/Mage/Core/Controller/Varien/Router/Admin.php +++ b/app/code/core/Mage/Core/Controller/Varien/Router/Admin.php @@ -88,16 +88,18 @@ protected function _noRouteShouldBeApplied() } /** - * Check whether url should be secure + * Check whether URL for corresponding path should use https protocol * - * @param mixed $path + * @param string $path * @return bool */ protected function _shouldBeSecure($path) { - return substr((string)Mage::getConfig()->getNode('default/web/unsecure/base_url'),0,5)==='https' - || Mage::getStoreConfigFlag('web/secure/use_in_adminhtml', Mage_Core_Model_App::ADMIN_STORE_ID) - && substr((string)Mage::getConfig()->getNode('default/web/secure/base_url'),0,5)==='https'; + $xmlPath = Mage::getStoreConfigFlag( + Mage_Core_Model_Store::XML_PATH_SECURE_IN_ADMINHTML, + Mage_Core_Model_App::ADMIN_STORE_ID + ) ? 'default/web/secure/base_url' : 'default/web/unsecure/base_url'; + return substr((string)Mage::getConfig()->getNode($xmlPath), 0, 5) === 'https'; } /** diff --git a/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php b/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php index 6c72e86e5b..d201d77382 100644 --- a/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php +++ b/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php @@ -412,7 +412,7 @@ public function rewrite(array $p) $p[2] = trim((string)$action); } } -#echo "
    ".print_r($p,1)."
    "; + return $p; } @@ -452,11 +452,17 @@ protected function _getCurrentSecureUrl($request) return Mage::getBaseUrl('link', true).ltrim($request->getPathInfo(), '/'); } + /** + * Check whether URL for corresponding path should use https protocol + * + * @param string $path + * @return bool + */ protected function _shouldBeSecure($path) { - return substr(Mage::getStoreConfig('web/unsecure/base_url'),0,5)==='https' - || Mage::getStoreConfigFlag('web/secure/use_in_frontend') - && substr(Mage::getStoreConfig('web/secure/base_url'),0,5)=='https' - && Mage::getConfig()->shouldUrlBeSecure($path); + $xmlPath = Mage::getConfig()->shouldUrlBeSecure($path) + ? Mage_Core_Model_Store::XML_PATH_SECURE_BASE_URL + : Mage_Core_Model_Store::XML_PATH_UNSECURE_BASE_URL; + return substr(Mage::getStoreConfig($xmlPath), 0, 5) === 'https'; } } diff --git a/app/code/core/Mage/Core/Helper/Cookie.php b/app/code/core/Mage/Core/Helper/Cookie.php new file mode 100644 index 0000000000..cd28cea07f --- /dev/null +++ b/app/code/core/Mage/Core/Helper/Cookie.php @@ -0,0 +1,81 @@ + + */ +class Mage_Core_Helper_Cookie extends Mage_Core_Helper_Abstract +{ + /** + * Cookie name for users who allowed cookie save + */ + const IS_USER_ALLOWED_SAVE_COOKIE = 'user_allowed_save_cookie'; + + /** + * Path to configuration, check is enable cookie restriction mode + */ + const XML_PATH_COOKIE_RESTRICTION = 'web/cookie/cookie_restriction'; + + /** + * Check if cookie restriction notice should be displayed + * + * @return bool + */ + public function isUserNotAllowSaveCookie() + { + $acceptedSaveCookiesWebsites = $this->_getAcceptedSaveCookiesWebsites(); + return Mage::getStoreConfig(self::XML_PATH_COOKIE_RESTRICTION) && + empty($acceptedSaveCookiesWebsites[Mage::app()->getWebsite()->getId()]); + } + + /** + * Return serialzed list of accepted save cookie website + * + * @return string + */ + public function getAcceptedSaveCookiesWebsiteIds() + { + $acceptedSaveCookiesWebsites = $this->_getAcceptedSaveCookiesWebsites(); + $acceptedSaveCookiesWebsites[Mage::app()->getWebsite()->getId()] = 1; + return serialize($acceptedSaveCookiesWebsites); + } + + /** + * Get accepted save cookies websites + * + * @return array + */ + protected function _getAcceptedSaveCookiesWebsites() + { + $serializedList = Mage::getSingleton('core/cookie')->get(self::IS_USER_ALLOWED_SAVE_COOKIE); + $unSerializedList = unserialize($serializedList); + return is_array($unSerializedList) ? $unSerializedList : array(); + } +} diff --git a/app/code/core/Mage/Core/Helper/Js.php b/app/code/core/Mage/Core/Helper/Js.php index bb03d52f3d..96cbec5c78 100644 --- a/app/code/core/Mage/Core/Helper/Js.php +++ b/app/code/core/Mage/Core/Helper/Js.php @@ -84,7 +84,9 @@ public function getTranslatorScript() */ public function getScript($script) { - return ''; + return ''; } /** diff --git a/app/code/core/Mage/Core/Model/App.php b/app/code/core/Mage/Core/Model/App.php index befc1582ea..7703208e15 100644 --- a/app/code/core/Mage/Core/Model/App.php +++ b/app/code/core/Mage/Core/Model/App.php @@ -805,9 +805,11 @@ public function getArea($code) /** * Retrieve application store object * + * @param null|string|bool|int|Mage_Core_Model_Store $id * @return Mage_Core_Model_Store + * @throws Mage_Core_Model_Store_Exception */ - public function getStore($id=null) + public function getStore($id = null) { if (!Mage::isInstalled() || $this->getUpdateMode()) { return $this->_getDefaultStore(); @@ -817,13 +819,13 @@ public function getStore($id=null) return $this->_store; } - if (is_null($id) || ''===$id || $id === true) { + if (!isset($id) || ''===$id || $id === true) { $id = $this->_currentStore; } if ($id instanceof Mage_Core_Model_Store) { return $id; } - if (is_null($id)) { + if (!isset($id)) { $this->throwStoreException(); } @@ -1301,7 +1303,8 @@ public function dispatchEvent($eventName, $args) switch ($obs['type']) { case 'disabled': break; - case 'object': case 'model': + case 'object': + case 'model': $method = $obs['method']; $observer->addData($args); $object = Mage::getModel($obs['model']); @@ -1321,11 +1324,13 @@ public function dispatchEvent($eventName, $args) } /** - * Added not existin observers methods calls protection + * Performs non-existent observer method calls protection * * @param object $object * @param string $method * @param Varien_Event_Observer $observer + * @return Mage_Core_Model_App + * @throws Mage_Core_Exception */ protected function _callObserverMethod($object, $method, $observer) { diff --git a/app/code/core/Mage/Core/Model/Cache.php b/app/code/core/Mage/Core/Model/Cache.php index a548021533..acecd2cc58 100644 --- a/app/code/core/Mage/Core/Model/Cache.php +++ b/app/code/core/Mage/Core/Model/Cache.php @@ -578,7 +578,7 @@ protected function _getInvalidatedTypes() } /** - * Save invalicated cache types + * Save invalidated cache types * * @param array $types * @return Mage_Core_Model_Cache @@ -613,7 +613,7 @@ public function getInvalidatedTypes() * Mark specific cache type(s) as invalidated * * @param string|array $typeCode - * @return + * @return Mage_Core_Model_Cache */ public function invalidateType($typeCode) { @@ -631,7 +631,8 @@ public function invalidateType($typeCode) /** * Clean cached data for specific cache type * - * @param $typeCode + * @param string $typeCode + * @return Mage_Core_Model_Cache */ public function cleanType($typeCode) { diff --git a/app/code/core/Mage/Core/Model/Config.php b/app/code/core/Mage/Core/Model/Config.php index 58827f34ff..45ac03c4ff 100644 --- a/app/code/core/Mage/Core/Model/Config.php +++ b/app/code/core/Mage/Core/Model/Config.php @@ -630,7 +630,7 @@ public function getSectionNode($path) * * @param string $path * @param string $scope - * @param string $scopeCode + * @param string|int $scopeCode * @return Mage_Core_Model_Config_Element */ public function getNode($path=null, $scope='', $scopeCode=null) @@ -1338,7 +1338,7 @@ public function getModelClassName($modelClass) * * @param string $modelClass * @param array|object $constructArguments - * @return Mage_Core_Model_Abstract + * @return Mage_Core_Model_Abstract|false */ public function getModelInstance($modelClass='', $constructArguments=array()) { @@ -1349,10 +1349,6 @@ public function getModelInstance($modelClass='', $constructArguments=array()) Varien_Profiler::stop('CORE::create_object_of::'.$className); return $obj; } else { - /* throw Mage::exception( - 'Mage_Core', - Mage::helper('core')->__('Model class does not exist: %s.', $modelClass) - ); */ return false; } } @@ -1472,18 +1468,23 @@ public function getStoresConfigByPath($path, $allowValues = array(), $useAsKey = } /** - * Check security requirements for url + * Check whether given path should be secure according to configuration security requirements for URL + * "Secure" should not be confused with https protocol, it is about web/secure/*_url settings usage only * * @param string $url * @return bool */ public function shouldUrlBeSecure($url) { + if (!Mage::getStoreConfigFlag(Mage_Core_Model_Store::XML_PATH_SECURE_IN_FRONTEND)) { + return false; + } + if (!isset($this->_secureUrlCache[$url])) { $this->_secureUrlCache[$url] = false; $secureUrls = $this->getNode('frontend/secure_url'); foreach ($secureUrls->children() as $match) { - if (strpos($url, (string)$match)===0) { + if (strpos($url, (string)$match) === 0) { $this->_secureUrlCache[$url] = true; break; } diff --git a/app/code/core/Mage/Core/Model/Email/Template.php b/app/code/core/Mage/Core/Model/Email/Template.php index 32d28b2cda..214a469ba0 100644 --- a/app/code/core/Mage/Core/Model/Email/Template.php +++ b/app/code/core/Mage/Core/Model/Email/Template.php @@ -105,7 +105,7 @@ protected function _getLogoUrl($store) $store = Mage::app()->getStore($store); $fileName = $store->getConfig(self::XML_PATH_DESIGN_EMAIL_LOGO); if ($fileName) { - $uploadDir = Mage_Adminhtml_Model_System_Config_Backend_Email_logo::UPLOAD_DIR; + $uploadDir = Mage_Adminhtml_Model_System_Config_Backend_Email_Logo::UPLOAD_DIR; $fullFileName = Mage::getBaseDir('media') . DS . $uploadDir . DS . $fileName; if (file_exists($fullFileName)) { return Mage::getBaseUrl('media') . $uploadDir . '/' . $fileName; diff --git a/app/code/core/Mage/Core/Model/Input/Filter.php b/app/code/core/Mage/Core/Model/Input/Filter.php new file mode 100644 index 0000000000..2ceebf9e23 --- /dev/null +++ b/app/code/core/Mage/Core/Model/Input/Filter.php @@ -0,0 +1,366 @@ + + * /** @var $filter Mage_Core_Model_Input_Filter {@*} + * $filter = Mage::getModel('core/input_filter'); + * $filter->setFilters(array( + * 'list_values' => array( + * 'children_filters' => array( //filters will applied to all children + * array( + * 'zend' => 'StringToUpper', + * 'args' => array('encoding' => 'utf-8')), + * array('zend' => 'StripTags') + * ) + * ), + * 'list_values_with_name' => array( + * 'children_filters' => array( + * 'item1' => array( + * array( + * 'zend' => 'StringToUpper', + * 'args' => array('encoding' => 'utf-8'))), + * 'item2' => array( + * array('model' => 'core/input_filter_maliciousCode') + * ), + * 'item3' => array( + * array( + * 'helper' => 'core', + * 'method' => 'stripTags', + * 'args' => array('

    ', true)) + * ) + * ) + * ) + * )); + * $filter->addFilter('name2', new Zend_Filter_Alnum()); + * $filter->addFilter('name1', + * array( + * 'zend' => 'StringToUpper', + * 'args' => array('encoding' => 'utf-8'))); + * $filter->addFilter('name1', array('zend' => 'StripTags'), Zend_Filter::CHAIN_PREPEND); + * $filter->addFilters(protected $_filtersToAdd = array( + * 'list_values_with_name' => array( + * 'children_filters' => array( + * 'deep_list' => array( + * 'children_filters' => array( + * 'sub1' => array( + * array( + * 'zend' => 'StringToLower', + * 'args' => array('encoding' => 'utf-8'))), + * 'sub2' => array(array('zend' => 'Int')) + * ) + * ) + * ) + * ) + * )); + * $filter->filter(array( + * 'name1' => 'some string', + * 'name2' => '888 555', + * 'list_values' => array( + * 'some string2', + * 'some

    string3

    ', + * ), + * 'list_values_with_name' => array( + * 'item1' => 'some string4', + * 'item2' => 'some string5', + * 'item3' => 'some

    string5

    bold
    div
    ', + * 'deep_list' => array( + * 'sub1' => 'toLowString', + * 'sub2' => '5 TO INT', + * ) + * ) + * )); + * + * + * @see Mage_Core_Model_Input_FilterTest See this class for manual + * @category Mage + * @package Mage_Core + * @author Magento Api Team + */ +class Mage_Core_Model_Input_Filter implements Zend_Filter_Interface +{ + /** + * Filters data collectors + * + * @var array + */ + protected $_filters = array(); + + /** + * Add filter + * + * @param string $name + * @param array|Zend_Filter_Interface $filter + * @param string $placement + * @return Mage_Core_Model_Input_Filter + */ + public function addFilter($name, $filter, $placement = Zend_Filter::CHAIN_APPEND) + { + if ($placement == Zend_Filter::CHAIN_PREPEND) { + array_unshift($this->_filters[$name], $filter); + } else { + $this->_filters[$name][] = $filter; + } + return $this; + } + + /** + * Add a filter to the end of the chain + * + * @param array|Zend_Filter_Interface $filter + * @return Mage_Core_Model_Input_Filter + */ + public function appendFilter(Zend_Filter_Interface $filter) + { + return $this->addFilter($filter, Zend_Filter::CHAIN_APPEND); + } + + /** + * Add a filter to the start of the chain + * + * @param array|Zend_Filter_Interface $filter + * @return Mage_Core_Model_Input_Filter + */ + public function prependFilter($filter) + { + return $this->addFilter($filter, Zend_Filter::CHAIN_PREPEND); + } + + /** + * Add filters + * + * Filters data must be has view as + * array( + * 'key1' => $filters, + * 'key2' => array( ... ), //array filters data + * 'key2' => $filters + * ) + * + * @param array $filters + * @return Mage_Core_Model_Input_Filter + */ + public function addFilters(array $filters) + { + $this->_filters = array_merge_recursive($this->_filters, $filters); + return $this; + } + + /** + * Set filters + * + * @param array $filters + * @return Mage_Core_Model_Input_Filter + */ + public function setFilters(array $filters) + { + $this->_filters = $filters; + return $this; + } + + /** + * Get filters + * + * @param string|null $name Get filter for selected name + * @return array + */ + public function getFilters($name = null) + { + if (null === $name) { + return $this->_filters; + } else { + return isset($this->_filters[$name]) ? $this->_filters[$name] : null; + } + } + + /** + * Filter data + * + * @param array $data + * @return array Return filtered data + */ + public function filter($data) + { + return $this->_filter($data); + } + + /** + * Recursive filtering + * + * @param array $data + * @param array|null $filters + * @param bool $isFilterListSimple + * @return array + * @throws Exception Exception when filter is not found or not instance of defined instances + */ + protected function _filter(array $data, &$filters = null, $isFilterListSimple = false) + { + if (null === $filters) { + $filters = &$this->_filters; + } + foreach ($data as $key => $value) { + if (!$isFilterListSimple && !empty($filters[$key])) { + $itemFilters = $filters[$key]; + } elseif ($isFilterListSimple && !empty($filters)) { + $itemFilters = $filters; + } else { + continue; + } + + if (!$isFilterListSimple && is_array($value) && isset($filters[$key]['children_filters'])) { + $isChildrenFilterListSimple = is_numeric(implode('', array_keys($filters[$key]['children_filters']))); + $value = $this->_filter($value, $filters[$key]['children_filters'], $isChildrenFilterListSimple); + } else { + foreach ($itemFilters as $filterData) { + if ($zendFilter = $this->_getZendFilter($filterData)) { + $value = $zendFilter->filter($value); + } elseif ($filtrationHelper = $this->_getFiltrationHelper($filterData)) { + $value = $this->_applyFiltrationWithHelper($value, $filtrationHelper, $filterData); + } + } + } + $data[$key] = $value; + } + return $data; + } + + /** + * Call specified helper method for $value filtration + * + * @param mixed $value + * @param Mage_Core_Helper_Abstract $helper + * @param array $filterData + * @return mixed + */ + protected function _applyFiltrationWithHelper($value, Mage_Core_Helper_Abstract $helper, array $filterData) + { + if (!isset($filterData['method']) || empty($filterData['method'])) { + throw new Exception("Helper filtration method is not set"); + } + if (!isset($filterData['args']) || empty($filterData['args'])) { + $filterData['args'] = array(); + } + $filterData['args'] = array(-100 => $value) + $filterData['args']; + // apply filter + $value = call_user_func_array(array($helper, $filterData['method']), $filterData['args']); + return $value; + } + + /** + * Try to create Magento helper for filtration based on $filterData. Return false on failure + * + * @param $filterData + * @return bool|Mage_Core_Helper_Abstract + * @throws Exception + */ + protected function _getFiltrationHelper($filterData) + { + $helper = false; + if (isset($filterData['helper'])) { + $helper = $filterData['helper']; + if (is_string($helper)) { + $helper = Mage::helper($helper); + } + if (!($helper instanceof Mage_Core_Helper_Abstract)) { + throw new Exception("Filter '{$filterData['helper']}' not found"); + } + } + return $helper; + } + + /** + * Try to create Zend filter based on $filterData. Return false on failure + * + * @param $filterData + * @return bool|Zend_Filter_Interface + */ + protected function _getZendFilter($filterData) + { + $zendFilter = false; + if (is_object($filterData) && $filterData instanceof Zend_Filter_Interface) { + /** @var $zendFilter Zend_Filter_Interface */ + $zendFilter = $filterData; + } elseif (isset($filterData['model'])) { + $zendFilter = $this->_createCustomZendFilter($filterData); + } elseif (isset($filterData['zend'])) { + $zendFilter = $this->_createNativeZendFilter($filterData); + } + return $zendFilter; + } + + /** + * Get Magento filters + * + * @param $filterData + * @return Zend_Filter_Interface + * @throws Exception + */ + protected function _createCustomZendFilter($filterData) + { + $filter = $filterData['model']; + if (!isset($filterData['args'])) { + $filterData['args'] = null; + } else { + //use only first element because Mage factory cannot get more + $filterData['args'] = $filterData['args'][0]; + } + if (is_string($filterData['model'])) { + $filter = Mage::getModel($filterData['model'], $filterData['args']); + } + if (!($filter instanceof Zend_Filter_Interface)) { + throw new Exception('Filter is not instance of Zend_Filter_Interface'); + } + return $filter; + } + + /** + * Get native Zend_Filter + * + * @param $filterData + * @return Zend_Filter_Interface + * @throws Exception + */ + protected function _createNativeZendFilter($filterData) + { + $filter = $filterData['zend']; + if (is_string($filter)) { + $class = new ReflectionClass('Zend_Filter_' . $filter); + if ($class->implementsInterface('Zend_Filter_Interface')) { + if (isset($filterData['args']) && $class->hasMethod('__construct')) { + $filter = $class->newInstanceArgs($filterData['args']); + } else { + $filter = $class->newInstance(); + } + } else { + throw new Exception('Filter is not instance of Zend_Filter_Interface'); + } + } + return $filter; + } +} diff --git a/app/code/core/Mage/Core/Model/Magento/Api.php b/app/code/core/Mage/Core/Model/Magento/Api.php new file mode 100644 index 0000000000..ba292f3c54 --- /dev/null +++ b/app/code/core/Mage/Core/Model/Magento/Api.php @@ -0,0 +1,49 @@ + + */ +class Mage_Core_Model_Magento_Api extends Mage_Api_Model_Resource_Abstract +{ + /** + * Retrieve information about current Magento installation + * + * @return array + */ + public function info() + { + $result = array(); + $result['magento_edition'] = Mage::getEdition(); + $result['magento_version'] = Mage::getVersion(); + + return $result; + } +} diff --git a/app/code/core/Mage/Core/Model/Magento/Api/V2.php b/app/code/core/Mage/Core/Model/Magento/Api/V2.php new file mode 100644 index 0000000000..a5ff04abcb --- /dev/null +++ b/app/code/core/Mage/Core/Model/Magento/Api/V2.php @@ -0,0 +1,36 @@ + + */ +class Mage_Core_Model_Magento_Api_V2 extends Mage_Core_Model_Magento_Api +{ +} diff --git a/app/code/core/Mage/Core/Model/Resource/Iterator.php b/app/code/core/Mage/Core/Model/Resource/Iterator.php index 4a14bfa743..42eece9dd8 100644 --- a/app/code/core/Mage/Core/Model/Resource/Iterator.php +++ b/app/code/core/Mage/Core/Model/Resource/Iterator.php @@ -37,7 +37,7 @@ class Mage_Core_Model_Resource_Iterator extends Varien_Object * @param Zend_Db_Statement_Interface|Zend_Db_Select|string $query * @param array|string $callbacks * @param array $args - * @param Varien_Db_Adapter_interface $adapter + * @param Varien_Db_Adapter_Interface $adapter * @return Mage_Core_Model_Resource_Iterator */ public function walk($query, array $callbacks, array $args=array(), $adapter = null) diff --git a/app/code/core/Mage/Core/Model/Session.php b/app/code/core/Mage/Core/Model/Session.php index ea52f0690e..5abbc92b63 100644 --- a/app/code/core/Mage/Core/Model/Session.php +++ b/app/code/core/Mage/Core/Model/Session.php @@ -30,6 +30,9 @@ * * @todo extend from Mage_Core_Model_Session_Abstract * + * @method null|bool getCookieShouldBeReceived() + * @method Mage_Core_Model_Session setCookieShouldBeReceived(bool $flag) + * @method Mage_Core_Model_Session unsCookieShouldBeReceived() */ class Mage_Core_Model_Session extends Mage_Core_Model_Session_Abstract { diff --git a/app/code/core/Mage/Core/Model/Store.php b/app/code/core/Mage/Core/Model/Store.php index bb9cd89079..18163e8480 100644 --- a/app/code/core/Mage/Core/Model/Store.php +++ b/app/code/core/Mage/Core/Model/Store.php @@ -585,11 +585,26 @@ protected function _updatePathUseRewrites($url) || !$this->getConfig(self::XML_PATH_USE_REWRITES) || !Mage::isInstalled() ) { - $url .= basename($_SERVER['SCRIPT_FILENAME']) . '/'; + if ($this->_isCustomEntryPoint()) { + $indexFileName = 'index.php'; + } else { + $indexFileName = basename($_SERVER['SCRIPT_FILENAME']); + } + $url .= $indexFileName . '/'; } return $url; } + /** + * Check if used entry point is custom + * + * @return bool + */ + protected function _isCustomEntryPoint() + { + return (bool)Mage::registry('custom_entry_point'); + } + /** * Retrieve URL for media catalog * @@ -674,7 +689,7 @@ public function isAdminUrlSecure() } /** - * Check if forntend URLs should be secure + * Check if frontend URLs should be secure * * @return boolean */ diff --git a/app/code/core/Mage/Core/Model/Url.php b/app/code/core/Mage/Core/Model/Url.php index cef90cfc86..c87bf481a3 100644 --- a/app/code/core/Mage/Core/Model/Url.php +++ b/app/code/core/Mage/Core/Model/Url.php @@ -864,7 +864,7 @@ public function purgeQueryParams() } /** - * Retrurn Query Params + * Return Query Params * * @return array */ @@ -1035,13 +1035,11 @@ protected function _prepareSessionUrlWithParams($url, array $params) /** @var $session Mage_Core_Model_Session */ $session = Mage::getSingleton('core/session', $params); - if (Mage::app()->getUseSessionVar() && !$session->getSessionIdForHost($url)) { + $sessionId = $session->getSessionIdForHost($url); + if (Mage::app()->getUseSessionVar() && !$sessionId) { $this->setQueryParam('___SID', $this->getSecure() ? 'S' : 'U'); // Secure/Unsecure - } else { - $sessionId = $session->getSessionIdForHost($url); - if ($sessionId) { - $this->setQueryParam($session->getSessionIdQueryParam(), $sessionId); - } + } else if ($sessionId) { + $this->setQueryParam($session->getSessionIdQueryParam(), $sessionId); } return $this; } diff --git a/app/code/core/Mage/Core/Model/Url/Validator.php b/app/code/core/Mage/Core/Model/Url/Validator.php new file mode 100644 index 0000000000..6cad2be8d5 --- /dev/null +++ b/app/code/core/Mage/Core/Model/Url/Validator.php @@ -0,0 +1,78 @@ + + */ +class Mage_Core_Model_Url_Validator extends Zend_Validate_Abstract +{ + /**#@+ + * Error keys + */ + const INVALID_URL = 'invalidUrl'; + /**#@-*/ + + /** + * Object constructor + */ + public function __construct() + { + // set translated message template + $this->setMessage(Mage::helper('core')->__("Invalid URL '%value%'."), self::INVALID_URL); + } + + /** + * Validation failure message template definitions + * + * @var array + */ + protected $_messageTemplates = array( + self::INVALID_URL => "Invalid URL '%value%'.", + ); + + /** + * Validate value + * + * @param string $value + * @return bool + */ + public function isValid($value) + { + $this->_setValue($value); + + //check valid URL + if (!Zend_Uri::check($value)) { + $this->_error(self::INVALID_URL); + return false; + } + + return true; + } +} diff --git a/app/code/core/Mage/Core/etc/api.xml b/app/code/core/Mage/Core/etc/api.xml index 9a57a460d6..1d7daf379e 100644 --- a/app/code/core/Mage/Core/etc/api.xml +++ b/app/code/core/Mage/Core/etc/api.xml @@ -50,13 +50,26 @@ + + core/magento_api + Magento info API + core/magento + + + Get info about current Magento installation + core/magento/info + + + core_store + core_magento store + magento @@ -77,6 +90,12 @@ List of stores + + Magento info + + Retrieve info about current Magento installation + + diff --git a/app/code/core/Mage/Core/etc/config.xml b/app/code/core/Mage/Core/etc/config.xml index 15ca68af86..a36a57421d 100644 --- a/app/code/core/Mage/Core/etc/config.xml +++ b/app/code/core/Mage/Core/etc/config.xml @@ -271,6 +271,7 @@ 3600 css + css_secure js @@ -338,6 +339,7 @@ 3600 1 0 + 31536000 0 diff --git a/app/code/core/Mage/Core/etc/system.xml b/app/code/core/Mage/Core/etc/system.xml index 775910c632..aaadb7a248 100644 --- a/app/code/core/Mage/Core/etc/system.xml +++ b/app/code/core/Mage/Core/etc/system.xml @@ -120,8 +120,8 @@ text - adminhtml/system_config_backend_email_address validate-email + adminhtml/system_config_backend_email_address 2 1 1 @@ -150,8 +150,8 @@ text - adminhtml/system_config_backend_email_address validate-email + adminhtml/system_config_backend_email_address 2 1 1 @@ -180,8 +180,8 @@ text - adminhtml/system_config_backend_email_address validate-email + adminhtml/system_config_backend_email_address 2 1 1 @@ -210,8 +210,8 @@ text - adminhtml/system_config_backend_email_address validate-email + adminhtml/system_config_backend_email_address 2 1 1 @@ -240,8 +240,8 @@ text - adminhtml/system_config_backend_email_address validate-email + adminhtml/system_config_backend_email_address 2 1 1 @@ -785,7 +785,7 @@ 25 1 1 - 1 + 0 1 @@ -794,7 +794,7 @@ 27 1 1 - 1 + 0 1
    @@ -893,8 +893,8 @@ text - adminhtml/system_config_backend_email_address validate-email + adminhtml/system_config_backend_email_address 80 1 0 @@ -977,8 +977,8 @@ adminhtml/system_config_source_email_template 10 1 - 1 - 1 + 0 + 0 @@ -986,8 +986,8 @@ adminhtml/system_config_source_email_identity 20 1 - 1 - 1 + 0 + 0 @@ -1411,6 +1411,7 @@ select adminhtml/system_config_source_yesno + adminhtml/system_config_backend_cookie 50 1 1 diff --git a/app/code/core/Mage/Core/etc/wsdl.xml b/app/code/core/Mage/Core/etc/wsdl.xml index 0689e69f79..8f3116b73f 100644 --- a/app/code/core/Mage/Core/etc/wsdl.xml +++ b/app/code/core/Mage/Core/etc/wsdl.xml @@ -23,6 +23,12 @@ + + + + + + @@ -31,6 +37,12 @@ + + + + + + @@ -49,6 +61,11 @@ + + Info about current Magento installation + + + @@ -70,6 +87,15 @@ + + + + + + + + + diff --git a/app/code/core/Mage/Core/etc/wsi.xml b/app/code/core/Mage/Core/etc/wsi.xml index 8877c0fbdb..7e2b3b7155 100644 --- a/app/code/core/Mage/Core/etc/wsi.xml +++ b/app/code/core/Mage/Core/etc/wsi.xml @@ -24,6 +24,12 @@ + + + + + + @@ -53,6 +59,20 @@ + + + + + + + + + + + + + + @@ -67,6 +87,12 @@ + + + + + + List of stores @@ -78,6 +104,11 @@ + + Info about current Magento installation + + + @@ -99,6 +130,15 @@ + + + + + + + + + diff --git a/app/code/core/Mage/Customer/Block/Widget/Abstract.php b/app/code/core/Mage/Customer/Block/Widget/Abstract.php index 0dade6d7eb..7a56500d62 100644 --- a/app/code/core/Mage/Customer/Block/Widget/Abstract.php +++ b/app/code/core/Mage/Customer/Block/Widget/Abstract.php @@ -61,7 +61,7 @@ public function getFieldName($field) * Retrieve customer attribute instance * * @param string $attributeCode - * @return Mage_Customer_Model_Attribute + * @return Mage_Customer_Model_Attribute|false */ protected function _getAttribute($attributeCode) { diff --git a/app/code/core/Mage/Customer/Block/Widget/Name.php b/app/code/core/Mage/Customer/Block/Widget/Name.php index 50c40addcc..e749eeedda 100644 --- a/app/code/core/Mage/Customer/Block/Widget/Name.php +++ b/app/code/core/Mage/Customer/Block/Widget/Name.php @@ -42,11 +42,7 @@ public function _construct() */ protected function _showConfig($key) { - $value = $this->getConfig($key); - if (empty($value)) { - return false; - } - return true; + return (bool)$this->getConfig($key); } /** @@ -70,7 +66,7 @@ public function isPrefixRequired() } /** - * Retrieve name prefix dropdown options + * Retrieve name prefix drop-down options * * @return array|bool */ @@ -126,7 +122,7 @@ public function isSuffixRequired() } /** - * Retrieve name suffix dropdown options + * Retrieve name suffix drop-down options * * @return array|bool */ @@ -171,7 +167,7 @@ public function getContainerClassName() * Retrieve customer or customer address attribute instance * * @param string $attributeCode - * @return Mage_Eav_Model_Entity_Attribute_Abstract + * @return Mage_Customer_Model_Attribute|false */ protected function _getAttribute($attributeCode) { @@ -179,16 +175,16 @@ protected function _getAttribute($attributeCode) return parent::_getAttribute($attributeCode); } - $_attribute = Mage::getSingleton('eav/config')->getAttribute('customer_address', $attributeCode); + $attribute = Mage::getSingleton('eav/config')->getAttribute('customer_address', $attributeCode); - if ($this->getForceUseCustomerRequiredAttributes() && !$_attribute->getIsRequired()) { + if ($this->getForceUseCustomerRequiredAttributes() && $attribute && !$attribute->getIsRequired()) { $customerAttribute = parent::_getAttribute($attributeCode); if ($customerAttribute && $customerAttribute->getIsRequired()) { - $_attribute = $customerAttribute; + $attribute = $customerAttribute; } } - return $_attribute; + return $attribute; } /** @@ -200,9 +196,6 @@ protected function _getAttribute($attributeCode) public function getStoreLabel($attributeCode) { $attribute = $this->_getAttribute($attributeCode); - if ($attribute) { - return $this->__($attribute->getStoreLabel()); - } - return ''; + return $attribute ? $this->__($attribute->getStoreLabel()) : ''; } } diff --git a/app/code/core/Mage/Customer/Helper/Address.php b/app/code/core/Mage/Customer/Helper/Address.php index 81c6d1b4f2..bfb68a5f21 100644 --- a/app/code/core/Mage/Customer/Helper/Address.php +++ b/app/code/core/Mage/Customer/Helper/Address.php @@ -38,6 +38,7 @@ class Mage_Customer_Helper_Address extends Mage_Core_Helper_Abstract const XML_PATH_VIV_ON_EACH_TRANSACTION = 'customer/create_account/viv_on_each_transaction'; const XML_PATH_VAT_VALIDATION_ENABLED = 'customer/create_account/auto_group_assign'; const XML_PATH_VIV_TAX_CALCULATION_ADDRESS_TYPE = 'customer/create_account/tax_calculation_address_type'; + const XML_PATH_VAT_FRONTEND_VISIBILITY = 'customer/create_account/vat_frontend_visibility'; /** * Array of Customer Address Attributes @@ -138,17 +139,14 @@ public function getFormat($code) } /** - * Determine if specified address config value can show + * Determine if specified address config value can be shown * + * @param string $key * @return bool */ public function canShowConfig($key) { - $value = $this->getConfig($key); - if (empty($value)) { - return false; - } - return true; + return (bool)$this->getConfig($key); } /** @@ -169,6 +167,34 @@ public function getAttributes() return $this->_attributes; } + /** + * Get string with frontend validation classes for attribute + * + * @param string $attributeCode + * @return string + */ + public function getAttributeValidationClass($attributeCode) + { + /** @var $attribute Mage_Customer_Model_Attribute */ + $attribute = isset($this->_attributes[$attributeCode]) ? $this->_attributes[$attributeCode] + : Mage::getSingleton('eav/config')->getAttribute('customer_address', $attributeCode); + $class = $attribute ? $attribute->getFrontend()->getClass() : ''; + + if (in_array($attributeCode, array('firstname', 'middlename', 'lastname', 'prefix', 'suffix', 'taxvat'))) { + if ($class && !$attribute->getIsVisible()) { + $class = ''; // address attribute is not visible thus its validation rules are not applied + } + + /** @var $customerAttribute Mage_Customer_Model_Attribute */ + $customerAttribute = Mage::getSingleton('eav/config')->getAttribute('customer', $attributeCode); + $class .= $customerAttribute && $customerAttribute->getIsVisible() + ? $customerAttribute->getFrontend()->getClass() : ''; + $class = implode(' ', array_unique(array_filter(explode(' ', $class)))); + } + + return $class; + } + /** * Convert streets array to new street lines count * Examples of use: @@ -251,4 +277,14 @@ public function getTaxCalculationAddressType($store = null) { return (string)Mage::getStoreConfig(self::XML_PATH_VIV_TAX_CALCULATION_ADDRESS_TYPE, $store); } + + /** + * Check if VAT ID address attribute has to be shown on frontend (on Customer Address management forms) + * + * @return boolean + */ + public function isVatAttributeVisible() + { + return (bool)Mage::getStoreConfig(self::XML_PATH_VAT_FRONTEND_VISIBILITY); + } } diff --git a/app/code/core/Mage/Customer/Helper/Data.php b/app/code/core/Mage/Customer/Helper/Data.php index fb746fb141..4cc32b6cdf 100644 --- a/app/code/core/Mage/Customer/Helper/Data.php +++ b/app/code/core/Mage/Customer/Helper/Data.php @@ -39,13 +39,18 @@ class Mage_Customer_Helper_Data extends Mage_Core_Helper_Abstract */ const REFERER_QUERY_PARAM_NAME = 'referer'; + /** + * Route for customer account login page + */ + const ROUTE_ACCOUNT_LOGIN = 'customer/account/login'; + /** * Config name for Redirect Customer to Account Dashboard after Logging in setting */ const XML_PATH_CUSTOMER_STARTUP_REDIRECT_TO_DASHBOARD = 'customer/startup/redirect_dashboard'; /** - * Config pathes to VAT related customer groups + * Config paths to VAT related customer groups */ const XML_PATH_CUSTOMER_VIV_INTRA_UNION_GROUP = 'customer/create_account/viv_intra_union_group'; const XML_PATH_CUSTOMER_VIV_DOMESTIC_GROUP = 'customer/create_account/viv_domestic_group'; @@ -128,7 +133,7 @@ public function getGroups() } /** - * Retrieve current (loggined) customer object + * Retrieve current (logged in) customer object * * @return Mage_Customer_Model_Customer */ @@ -167,22 +172,33 @@ public function customerHasAddresses() * @return string */ public function getLoginUrl() + { + return $this->_getUrl(self::ROUTE_ACCOUNT_LOGIN, $this->getLoginUrlParams()); + } + + /** + * Retrieve parameters of customer login url + * + * @return array + */ + public function getLoginUrlParams() { $params = array(); $referer = $this->_getRequest()->getParam(self::REFERER_QUERY_PARAM_NAME); - if (!$referer && !Mage::getStoreConfigFlag(self::XML_PATH_CUSTOMER_STARTUP_REDIRECT_TO_DASHBOARD)) { - if (!Mage::getSingleton('customer/session')->getNoReferer()) { - $referer = Mage::getUrl('*/*/*', array('_current' => true, '_use_rewrite' => true)); - $referer = Mage::helper('core')->urlEncode($referer); - } + if (!$referer && !Mage::getStoreConfigFlag(self::XML_PATH_CUSTOMER_STARTUP_REDIRECT_TO_DASHBOARD) + && !Mage::getSingleton('customer/session')->getNoReferer() + ) { + $referer = Mage::getUrl('*/*/*', array('_current' => true, '_use_rewrite' => true)); + $referer = Mage::helper('core')->urlEncode($referer); } + if ($referer) { $params = array(self::REFERER_QUERY_PARAM_NAME => $referer); } - return $this->_getUrl('customer/account/login', $params); + return $params; } /** diff --git a/app/code/core/Mage/Customer/Model/Api2/Customer.php b/app/code/core/Mage/Customer/Model/Api2/Customer.php new file mode 100644 index 0000000000..de14198c24 --- /dev/null +++ b/app/code/core/Mage/Customer/Model/Api2/Customer.php @@ -0,0 +1,45 @@ + + */ +class Mage_Customer_Model_Api2_Customer extends Mage_Api2_Model_Resource +{ + /** + * Resource specific method to retrieve attributes' codes. May be overriden in child. + * + * @return array + */ + protected function _getResourceAttributes() + { + return $this->getEavAttributes(Mage_Api2_Model_Auth_User_Admin::USER_TYPE != $this->getUserType(), true); + } +} diff --git a/app/code/core/Mage/Customer/Model/Api2/Customer/Address.php b/app/code/core/Mage/Customer/Model/Api2/Customer/Address.php new file mode 100644 index 0000000000..e37c4936f0 --- /dev/null +++ b/app/code/core/Mage/Customer/Model/Api2/Customer/Address.php @@ -0,0 +1,129 @@ + + */ +class Mage_Customer_Model_Api2_Customer_Address extends Mage_Api2_Model_Resource +{ + /** + * Resource specific method to retrieve attributes' codes. May be overriden in child. + * + * @return array + */ + protected function _getResourceAttributes() + { + return $this->getEavAttributes(Mage_Api2_Model_Auth_User_Admin::USER_TYPE != $this->getUserType()); + } + + /** + * Get customer address resource validator instance + * + * @return Mage_Customer_Model_Api2_Customer_Address_Validator + */ + protected function _getValidator() + { + return Mage::getModel('customer/api2_customer_address_validator', array('resource' => $this)); + } + + /** + * Is specified address a default billing address? + * + * @param Mage_Customer_Model_Address $address + * @return bool + */ + protected function _isDefaultBillingAddress(Mage_Customer_Model_Address $address) + { + return $address->getCustomer()->getDefaultBilling() == $address->getId(); + } + + /** + * Is specified address a default shipping address? + * + * @param Mage_Customer_Model_Address $address + * @return bool + */ + protected function _isDefaultShippingAddress(Mage_Customer_Model_Address $address) + { + return $address->getCustomer()->getDefaultShipping() == $address->getId(); + } + + /** + * Get region id by name or code + * If id is not found then return passed $region + * + * @param string $region + * @return int|string + */ + protected function _getRegionIdByNameOrCode($region) + { + $id = Mage::getResourceModel('directory/region_collection') + ->addFieldToFilter(array('default_name', 'code'), array($region, $region)) + ->getFirstItem() + ->getId(); + return $id ? $id : $region; + } + + /** + * Load customer address by id + * + * @param int $id + * @return Mage_Customer_Model_Address + */ + protected function _loadCustomerAddressById($id) + { + /* @var $address Mage_Customer_Model_Address */ + $address = Mage::getModel('customer/address')->load($id); + + if (!$address->getId()) { + $this->_critical(self::RESOURCE_NOT_FOUND); + } + $address->addData($this->_getDefaultAddressesInfo($address)); + + return $address; + } + + /** + * Load customer by id + * + * @param int $id + * @throws Mage_Api2_Exception + * @return Mage_Customer_Model_Customer + */ + protected function _loadCustomerById($id) + { + /* @var $customer Mage_Customer_Model_Customer */ + $customer = Mage::getModel('customer/customer')->load($id); + if (!$customer->getId()) { + $this->_critical(self::RESOURCE_NOT_FOUND); + } + return $customer; + } +} diff --git a/app/code/core/Mage/Customer/Model/Api2/Customer/Address/Rest.php b/app/code/core/Mage/Customer/Model/Api2/Customer/Address/Rest.php new file mode 100644 index 0000000000..bbb54bfb4d --- /dev/null +++ b/app/code/core/Mage/Customer/Model/Api2/Customer/Address/Rest.php @@ -0,0 +1,192 @@ + + */ +abstract class Mage_Customer_Model_Api2_Customer_Address_Rest extends Mage_Customer_Model_Api2_Customer_Address +{ + /** + * Create customer address + * + * @param array $data + * @throws Mage_Api2_Exception + * @return string + */ + protected function _create(array $data) + { + /* @var $customer Mage_Customer_Model_Customer */ + $customer = $this->_loadCustomerById($this->getRequest()->getParam('customer_id')); + $validator = $this->_getValidator(); + + $data = $validator->filter($data); + if (!$validator->isValidData($data) || !$validator->isValidDataForCreateAssociationWithCountry($data)) { + foreach ($validator->getErrors() as $error) { + $this->_error($error, Mage_Api2_Model_Server::HTTP_BAD_REQUEST); + } + $this->_critical(self::RESOURCE_DATA_PRE_VALIDATION_ERROR); + } + + $data['region'] = $this->_getRegionIdByNameOrCode($data['region']); + + /* @var $address Mage_Customer_Model_Address */ + $address = Mage::getModel('customer/address'); + $address->setData($data); + $address->setCustomer($customer); + + try { + $address->save(); + } catch (Mage_Core_Exception $e) { + $this->_error($e->getMessage(), Mage_Api2_Model_Server::HTTP_INTERNAL_ERROR); + } catch (Exception $e) { + $this->_critical(self::RESOURCE_INTERNAL_ERROR); + } + return $this->_getLocation($address); + } + + /** + * Retrieve information about specified customer address + * + * @throws Mage_Api2_Exception + * @return array + */ + protected function _retrieve() + { + /* @var $address Mage_Customer_Model_Address */ + $address = $this->_loadCustomerAddressById($this->getRequest()->getParam('id')); + $addressData = $address->getData(); + $addressData['street'] = $address->getStreet(); + return $addressData; + } + + /** + * Get customer addresses list + * + * @return array + */ + protected function _retrieveCollection() + { + $data = array(); + /* @var $address Mage_Customer_Model_Address */ + foreach ($this->_getCollectionForRetrieve() as $address) { + $addressData = $address->getData(); + $addressData['street'] = $address->getStreet(); + $data[] = array_merge($addressData, $this->_getDefaultAddressesInfo($address)); + } + return $data; + } + + /** + * Retrieve collection instances + * + * @return Mage_Customer_Model_Resource_Address_Collection + */ + protected function _getCollectionForRetrieve() + { + /* @var $customer Mage_Customer_Model_Customer */ + $customer = $this->_loadCustomerById($this->getRequest()->getParam('customer_id')); + + /* @var $collection Mage_Customer_Model_Resource_Address_Collection */ + $collection = $customer->getAddressesCollection(); + + $this->_applyCollectionModifiers($collection); + return $collection; + } + + /** + * Get array with default addresses information if possible + * + * @param Mage_Customer_Model_Address $address + * @return array + */ + protected function _getDefaultAddressesInfo(Mage_Customer_Model_Address $address) + { + return array( + 'is_default_billing' => (int)$this->_isDefaultBillingAddress($address), + 'is_default_shipping' => (int)$this->_isDefaultShippingAddress($address) + ); + } + + /** + * Update specified stock item + * + * @param array $data + * @throws Mage_Api2_Exception + */ + protected function _update(array $data) + { + /* @var $address Mage_Customer_Model_Address */ + $address = $this->_loadCustomerAddressById($this->getRequest()->getParam('id')); + $validator = $this->_getValidator(); + + $data = $validator->filter($data); + if (!$validator->isValidData($data, true) + || !$validator->isValidDataForChangeAssociationWithCountry($address, $data)) { + foreach ($validator->getErrors() as $error) { + $this->_error($error, Mage_Api2_Model_Server::HTTP_BAD_REQUEST); + } + $this->_critical(self::RESOURCE_DATA_PRE_VALIDATION_ERROR); + } + + $data['region'] = isset($data['region']) ? $this->_getRegionIdByNameOrCode($data['region']) : null; + $address->addData($data); + + try { + $address->save(); + } catch (Mage_Core_Exception $e) { + $this->_error($e->getMessage(), Mage_Api2_Model_Server::HTTP_INTERNAL_ERROR); + } catch (Exception $e) { + $this->_critical(self::RESOURCE_INTERNAL_ERROR); + } + } + + /** + * Delete customer + */ + protected function _delete() + { + /* @var $address Mage_Customer_Model_Address */ + $address = $this->_loadCustomerAddressById($this->getRequest()->getParam('id')); + + if ($this->_isDefaultBillingAddress($address) || $this->_isDefaultShippingAddress($address)) { + $this->_critical( + 'Address is default for customer so is not allowed to be deleted', + Mage_Api2_Model_Server::HTTP_BAD_REQUEST + ); + } + try { + $address->delete(); + } catch (Mage_Core_Exception $e) { + $this->_critical($e->getMessage(), Mage_Api2_Model_Server::HTTP_INTERNAL_ERROR); + } catch (Exception $e) { + $this->_critical(self::RESOURCE_INTERNAL_ERROR); + } + } +} diff --git a/app/code/core/Mage/Customer/Model/Api2/Customer/Address/Rest/Admin/V1.php b/app/code/core/Mage/Customer/Model/Api2/Customer/Address/Rest/Admin/V1.php new file mode 100644 index 0000000000..cefed11a9b --- /dev/null +++ b/app/code/core/Mage/Customer/Model/Api2/Customer/Address/Rest/Admin/V1.php @@ -0,0 +1,36 @@ + + */ +class Mage_Customer_Model_Api2_Customer_Address_Rest_Admin_V1 extends Mage_Customer_Model_Api2_Customer_Address_Rest +{ +} diff --git a/app/code/core/Mage/Customer/Model/Api2/Customer/Address/Rest/Customer/V1.php b/app/code/core/Mage/Customer/Model/Api2/Customer/Address/Rest/Customer/V1.php new file mode 100644 index 0000000000..6b03257911 --- /dev/null +++ b/app/code/core/Mage/Customer/Model/Api2/Customer/Address/Rest/Customer/V1.php @@ -0,0 +1,71 @@ + + */ +class Mage_Customer_Model_Api2_Customer_Address_Rest_Customer_V1 extends Mage_Customer_Model_Api2_Customer_Address_Rest +{ + /** + * Load customer address by id + * + * @param int $id + * @throws Mage_Api2_Exception + * @return Mage_Customer_Model_Address + */ + protected function _loadCustomerAddressById($id) + { + /* @var $customerAddress Mage_Customer_Model_Address */ + $customerAddress = parent::_loadCustomerAddressById($id); + // check owner + if ($this->getApiUser()->getUserId() != $customerAddress->getCustomerId()) { + $this->_critical(self::RESOURCE_NOT_FOUND); + } + return $customerAddress; + } + + /** + * Load customer by id + * + * @param int $id + * @throws Mage_Api2_Exception + * @return Mage_Customer_Model_Customer + */ + protected function _loadCustomerById($id) + { + /* @var $customer Mage_Customer_Model_Customer */ + $customer = parent::_loadCustomerById($id); + // check customer accaunt owner + if ($this->getApiUser()->getUserId() != $customer->getId()) { + $this->_critical(self::RESOURCE_NOT_FOUND); + } + return $customer; + } +} diff --git a/app/code/core/Mage/Customer/Model/Api2/Customer/Address/Validator.php b/app/code/core/Mage/Customer/Model/Api2/Customer/Address/Validator.php new file mode 100644 index 0000000000..c86db50d53 --- /dev/null +++ b/app/code/core/Mage/Customer/Model/Api2/Customer/Address/Validator.php @@ -0,0 +1,187 @@ + + */ +class Mage_Customer_Model_Api2_Customer_Address_Validator extends Mage_Api2_Model_Resource_Validator_Eav +{ + /** + * Separator for multistreet + */ + const STREET_SEPARATOR = '; '; + + /** + * Filter request data. + * + * @param array $data + * @return array Filtered data + */ + public function filter(array $data) + { + $data = parent::filter($data); + + // If the array contains more than two elements, then combine the extra elements in a string + if (isset($data['street']) && is_array($data['street']) && count($data['street']) > 2) { + $data['street'][1] .= self::STREET_SEPARATOR + . implode(self::STREET_SEPARATOR, array_slice($data['street'], 2)); + $filteredData['street'] = array_slice($data['street'], 0, 2); + } + + return $data; + } + + /** + * Validate data for create association with the country + * + * @param array $data + * @return bool + */ + public function isValidDataForCreateAssociationWithCountry(array $data) + { + // Check the country + $country = $this->_checkCountry($data); + if (false == $country) { + // break the validation if the country is not valid + return false; + } + + // Check the region + return $this->_checkRegion($data, $country); + } + + /** + * Validate data for change association with the country + * + * @param Mage_Customer_Model_Address $address + * @param array $data + * @return bool + */ + public function isValidDataForChangeAssociationWithCountry(Mage_Customer_Model_Address $address, array $data) + { + if (!isset($data['country_id']) && !isset($data['region'])) { + return true; + } + + // Check the country + if (array_key_exists('country_id', $data)) { + $country = $this->_checkCountry($data); + if (false == $country) { + // break the validation if the country is not valid + return false; + } + } else { + // if the country is not passed load the current country + $country = $address->getCountryModel(); + } + + // Check the region + return $this->_checkRegion($data, $country); + } + + /** + * Check country + * + * @param array $data + * @return bool|Mage_Directory_Model_Country + */ + protected function _checkCountry($data) + { + if (!array_key_exists('country_id', $data)) { + $this->_addError('"Country" is required.'); + return false; + } + + if (!is_string($data['country_id'])) { + $this->_addError('Invalid country identifier type.'); + return false; + } + + if ('' == trim($data['country_id'])) { + $this->_addError('"Country" is required.'); + return false; + } + + $validator = new Zend_Validate_StringLength(array('min' => 2, 'max' => 3)); + if (!$validator->isValid($data['country_id'])) { + $this->_addError("Country is not between '2' and '3' inclusively."); + return false; + } + + /* @var $country Mage_Directory_Model_Country */ + $country = Mage::getModel('directory/country')->loadByCode($data['country_id']); + if (!$country->getId()) { + $this->_addError('Country does not exist.'); + return false; + } + + return $country; + } + + /** + * Check region + * + * @param array $data + * @param Mage_Directory_Model_Country $country + * @return bool + */ + protected function _checkRegion($data, Mage_Directory_Model_Country $country) + { + /* @var $regions Mage_Directory_Model_Resource_Region_Collection */ + $regions = $country->getRegions(); + // Is it the country with predifined regions? + if ($regions->count()) { + if (!array_key_exists('region', $data) || empty($data['region'])) { + $this->_addError('"State/Province" is required.'); + return false; + } + + if (!is_string($data['region'])) { + $this->_addError('Invalid "State/Province" type.'); + return false; + } + + $count = $regions->addFieldToFilter(array('default_name', 'code'), array($data['region'], $data['region'])) + ->clear() + ->count(); + if (!$count) { + $this->_addError('State/Province does not exist.'); + return false; + } + } else { + if (array_key_exists('region', $data) && !is_string($data['region'])) { + $this->_addError('Invalid "State/Province" type.'); + return false; + } + } + + return true; + } +} diff --git a/app/code/core/Mage/Customer/Model/Api2/Customer/Rest.php b/app/code/core/Mage/Customer/Model/Api2/Customer/Rest.php new file mode 100644 index 0000000000..772bb38c66 --- /dev/null +++ b/app/code/core/Mage/Customer/Model/Api2/Customer/Rest.php @@ -0,0 +1,166 @@ + + */ +abstract class Mage_Customer_Model_Api2_Customer_Rest extends Mage_Customer_Model_Api2_Customer +{ + /** + * Create customer + * + * @param array $data + * @return string + */ + protected function _create(array $data) + { + /** @var $validator Mage_Api2_Model_Resource_Validator_Eav */ + $validator = Mage::getResourceModel('api2/validator_eav', array( + 'resource' => $this, + 'operation' => self::OPERATION_CREATE + )); + + $data = $validator->filter($data); + if (!$validator->isValidData($data)) { + foreach ($validator->getErrors() as $error) { + $this->_error($error, Mage_Api2_Model_Server::HTTP_BAD_REQUEST); + } + $this->_critical(self::RESOURCE_DATA_PRE_VALIDATION_ERROR); + } + + /** @var $customer Mage_Customer_Model_Customer */ + $customer = Mage::getModel('customer/customer'); + $customer->setData($data); + + try { + $customer->save(); + } catch (Mage_Core_Exception $e) { + $this->_error($e->getMessage(), Mage_Api2_Model_Server::HTTP_INTERNAL_ERROR); + } catch (Exception $e) { + $this->_critical(self::RESOURCE_INTERNAL_ERROR); + } + + return $this->_getLocation($customer); + } + + /** + * Retrieve information about customer + * + * @throws Mage_Api2_Exception + * @return array + */ + protected function _retrieve() + { + /** @var $customer Mage_Customer_Model_Customer */ + $customer = $this->_loadCustomerById($this->getRequest()->getParam('id')); + return $customer->getData(); + } + + /** + * Get customers list + * + * @return array + */ + protected function _retrieveCollection() + { + $data = $this->_getCollectionForRetrieve()->load()->toArray(); + return isset($data['items']) ? $data['items'] : $data; + } + + /** + * Update customer + * + * @param array $data + * @throws Mage_Api2_Exception + */ + protected function _update(array $data) + { + /** @var $customer Mage_Customer_Model_Customer */ + $customer = $this->_loadCustomerById($this->getRequest()->getParam('id')); + + /** @var $validator Mage_Api2_Model_Resource_Validator_Eav */ + $validator = Mage::getResourceModel('api2/validator_eav', array( + 'resource' => $this, + 'operation' => self::OPERATION_UPDATE + )); + + $data = $validator->filter($data); + if (!$validator->isValidData($data)) { + foreach ($validator->getErrors() as $error) { + $this->_error($error, Mage_Api2_Model_Server::HTTP_BAD_REQUEST); + } + $this->_critical(self::RESOURCE_DATA_PRE_VALIDATION_ERROR); + } + + $customer->addData($data); + + try { + $customer->save(); + } catch (Mage_Core_Exception $e) { + $this->_error($e->getMessage(), Mage_Api2_Model_Server::HTTP_INTERNAL_ERROR); + } catch (Exception $e) { + $this->_critical(self::RESOURCE_INTERNAL_ERROR); + } + } + + /** + * Load customer by id + * + * @param int $id + * @throws Mage_Api2_Exception + * @return Mage_Customer_Model_Customer + */ + protected function _loadCustomerById($id) + { + /** @var $customer Mage_Customer_Model_Customer */ + $customer = Mage::getModel('customer/customer')->load($id); + if (!$customer->getId()) { + $this->_critical(self::RESOURCE_NOT_FOUND); + } + return $customer; + } + + /** + * Retrieve collection instances + * + * @return Mage_Customer_Model_Resource_Customer_Collection + */ + protected function _getCollectionForRetrieve() + { + /** @var $collection Mage_Customer_Model_Resource_Customer_Collection */ + $collection = Mage::getResourceModel('customer/customer_collection'); + $collection->addAttributeToSelect(array_keys( + $this->getAvailableAttributes($this->getUserType(), Mage_Api2_Model_Resource::OPERATION_ATTRIBUTE_READ) + )); + + $this->_applyCollectionModifiers($collection); + return $collection; + } +} diff --git a/app/code/core/Mage/Customer/Model/Api2/Customer/Rest/Admin/V1.php b/app/code/core/Mage/Customer/Model/Api2/Customer/Rest/Admin/V1.php new file mode 100644 index 0000000000..8f408e8778 --- /dev/null +++ b/app/code/core/Mage/Customer/Model/Api2/Customer/Rest/Admin/V1.php @@ -0,0 +1,75 @@ + + */ +class Mage_Customer_Model_Api2_Customer_Rest_Admin_V1 extends Mage_Customer_Model_Api2_Customer_Rest +{ + /** + * Retrieve information about customer + * Add last logged in datetime + * + * @throws Mage_Api2_Exception + * @return array + */ + protected function _retrieve() + { + /** @var $log Mage_Log_Model_Customer */ + $log = Mage::getModel('log/customer'); + $log->loadByCustomer($this->getRequest()->getParam('id')); + + $data = parent::_retrieve(); + $data['is_confirmed'] = (int) !(isset($data['confirmation']) && $data['confirmation']); + + $lastLoginAt = $log->getLoginAt(); + if (null !== $lastLoginAt) { + $data['last_logged_in'] = $lastLoginAt; + } + return $data; + } + + /** + * Delete customer + */ + protected function _delete() + { + /** @var $customer Mage_Customer_Model_Customer */ + $customer = parent::_loadCustomerById($this->getRequest()->getParam('id')); + + try { + $customer->delete(); + } catch (Mage_Core_Exception $e) { + $this->_critical($e->getMessage(), Mage_Api2_Model_Server::HTTP_INTERNAL_ERROR); + } catch (Exception $e) { + $this->_critical(self::RESOURCE_INTERNAL_ERROR); + } + } +} diff --git a/app/code/core/Mage/Customer/Model/Api2/Customer/Rest/Customer/V1.php b/app/code/core/Mage/Customer/Model/Api2/Customer/Rest/Customer/V1.php new file mode 100644 index 0000000000..a4e5c97058 --- /dev/null +++ b/app/code/core/Mage/Customer/Model/Api2/Customer/Rest/Customer/V1.php @@ -0,0 +1,97 @@ + + */ +class Mage_Customer_Model_Api2_Customer_Rest_Customer_V1 extends Mage_Customer_Model_Api2_Customer_Rest +{ + /** + * Is customer has rights to retrieve/update customer item + * + * @param int $customerId + * @throws Mage_Api2_Exception + * @return bool + */ + protected function _isOwner($customerId) + { + if ($this->getApiUser()->getUserId() !== $customerId) { + $this->_critical(self::RESOURCE_NOT_FOUND); + } + return true; + } + + /** + * Retrieve information about customer + * + * @throws Mage_Api2_Exception + * @return array + */ + protected function _retrieve() + { + if ($this->_isOwner($this->getRequest()->getParam('id'))) { + return parent::_retrieve(); + } + } + + /** + * Retrieve collection with only current customer instance + * + * @return Mage_Customer_Model_Resource_Customer_Collection + */ + protected function _getCollectionForRetrieve() + { + return parent::_getCollectionForRetrieve()->addAttributeToFilter('entity_id', $this->getApiUser()->getUserId()); + } + + /** + * Update customer + * + * @param array $data + * @throws Mage_Api2_Exception + */ + protected function _update(array $data) + { + if ($this->_isOwner($this->getRequest()->getParam('id'))) { + parent::_update($data); + } + } + + /** + * Update customers + * + * @param array $data + * @throws Mage_Api2_Exception + */ + protected function _multiUpdate(array $data) + { + $this->_critical(self::RESOURCE_METHOD_NOT_ALLOWED, Mage_Api2_Model_Server::HTTP_FORBIDDEN); + } +} diff --git a/app/code/core/Mage/Customer/Model/Session.php b/app/code/core/Mage/Customer/Model/Session.php index e89d4b6961..4610c0797f 100644 --- a/app/code/core/Mage/Customer/Model/Session.php +++ b/app/code/core/Mage/Customer/Model/Session.php @@ -260,19 +260,25 @@ public function logout() * Authenticate controller action by login customer * * @param Mage_Core_Controller_Varien_Action $action + * @param bool $loginUrl * @return bool */ public function authenticate(Mage_Core_Controller_Varien_Action $action, $loginUrl = null) { - if (!$this->isLoggedIn()) { - $this->setBeforeAuthUrl(Mage::getUrl('*/*/*', array('_current'=>true))); - if (is_null($loginUrl)) { - $loginUrl = Mage::helper('customer')->getLoginUrl(); - } + if ($this->isLoggedIn()) { + return true; + } + + $this->setBeforeAuthUrl(Mage::getUrl('*/*/*', array('_current' => true))); + if (isset($loginUrl)) { $action->getResponse()->setRedirect($loginUrl); - return false; + } else { + $action->setRedirectWithCookieCheck(Mage_Customer_Helper_Data::ROUTE_ACCOUNT_LOGIN, + Mage::helper('customer')->getLoginUrlParams() + ); } - return true; + + return false; } /** diff --git a/app/code/core/Mage/Customer/controllers/AccountController.php b/app/code/core/Mage/Customer/controllers/AccountController.php index f6b8d9192c..98bac6a509 100644 --- a/app/code/core/Mage/Customer/controllers/AccountController.php +++ b/app/code/core/Mage/Customer/controllers/AccountController.php @@ -183,7 +183,6 @@ protected function _loginPostRedirect() $session = $this->_getSession(); if (!$session->getBeforeAuthUrl() || $session->getBeforeAuthUrl() == Mage::getBaseUrl()) { - // Set default URL to redirect customer to $session->setBeforeAuthUrl(Mage::helper('customer')->getAccountUrl()); // Redirect customer to the last page visited after logging in diff --git a/app/code/core/Mage/Customer/etc/api2.xml b/app/code/core/Mage/Customer/etc/api2.xml new file mode 100644 index 0000000000..869d2193e5 --- /dev/null +++ b/app/code/core/Mage/Customer/etc/api2.xml @@ -0,0 +1,213 @@ + + + + + + + Customer + 130 + + + + + customer + 90 + customer/api2_customer + customer/customer + Customer + + + 1 + 1 + 1 + + + 1 + 1 + + + + Customer ID + Last Logged In + First Name + Last Name + Email + Associate to Website + Created From + Group + Is Confirmed + Disable automatic group change based on VAT ID + + + + + 1 + 1 + 1 + 1 + + + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + + + + + + + customer/customer + customer/form + + adminhtml_customer + + + + customer/customer + customer/form + + customer_account_edit + + + + + + + /customers/:id + entity + + + /customers + collection + + + 1 + + + customer + 110 + customer/api2_customer_address + customer/address + Customer Address + + + 1 + 1 + 1 + 1 + + + 1 + 1 + 1 + 1 + + + + Customer Address ID + Is Default Billing Address + Is Default Shipping Address + + + + + 1 + 1 + 1 + 1 + 1 + + + 1 + 1 + 1 + 1 + 1 + 1 + + + + + 1 + + + 1 + 1 + + + + + + + customer/address + customer/form + + adminhtml_customer_address + + + + customer/address + customer/form + + customer_address_edit + + + + + + + /customers/addresses/:id + entity + + + /customers/:customer_id/addresses + collection + + + 1 + + + + diff --git a/app/code/core/Mage/Customer/etc/config.xml b/app/code/core/Mage/Customer/etc/config.xml index edb5dc4374..590af35b42 100644 --- a/app/code/core/Mage/Customer/etc/config.xml +++ b/app/code/core/Mage/Customer/etc/config.xml @@ -510,6 +510,7 @@ customer_create_account_email_template customer_create_account_email_confirmation_template customer_create_account_email_confirmed_template + 0 1 diff --git a/app/code/core/Mage/Customer/etc/system.xml b/app/code/core/Mage/Customer/etc/system.xml index 766a8ed384..acb3732cf9 100644 --- a/app/code/core/Mage/Customer/etc/system.xml +++ b/app/code/core/Mage/Customer/etc/system.xml @@ -88,8 +88,9 @@ 1 1 - + + To show VAT number on frontend, set Show VAT Number on Frontend option to Yes. select adminhtml/system_config_source_yesno 10 @@ -175,6 +176,15 @@ 0 0 + + + select + adminhtml/system_config_source_yesno + 58 + 1 + 1 + 0 + text @@ -458,18 +468,8 @@ - - - - adminhtml/system_config_backend_customer_groupAutoAssign - - - - - adminhtml/system_config_backend_customer_groupAutoAssign - Validate VAT Number @@ -477,7 +477,7 @@ 28 1 1 - 1 + 0 diff --git a/app/code/core/Mage/Customer/sql/customer_setup/upgrade-1.6.1.0-1.6.2.0.php b/app/code/core/Mage/Customer/sql/customer_setup/upgrade-1.6.1.0-1.6.2.0.php index bb6260a2e9..44adab138d 100644 --- a/app/code/core/Mage/Customer/sql/customer_setup/upgrade-1.6.1.0-1.6.2.0.php +++ b/app/code/core/Mage/Customer/sql/customer_setup/upgrade-1.6.1.0-1.6.2.0.php @@ -31,7 +31,7 @@ $installer->addAttribute('customer', $disableAGCAttributeCode, array( 'type' => 'static', - 'label' => 'Disable automatic group change based on VAT ID', + 'label' => 'Disable Automatic Group Change Based on VAT ID', 'input' => 'boolean', 'backend' => 'customer/attribute_backend_data_boolean', 'position' => 28, diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Io.php b/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Io.php index f414472516..07e3db74f8 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Io.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Io.php @@ -43,7 +43,7 @@ public function getResource($forWrite = false) { if (!$this->_resource) { $type = $this->getVar('type', 'file'); - $className = 'Varien_Io_'.ucwords($type); + $className = 'Varien_Io_' . ucwords($type); $this->_resource = new $className(); $isError = false; diff --git a/app/code/core/Mage/Directory/etc/system.xml b/app/code/core/Mage/Directory/etc/system.xml index c2fc6717db..bc37086380 100644 --- a/app/code/core/Mage/Directory/etc/system.xml +++ b/app/code/core/Mage/Directory/etc/system.xml @@ -114,6 +114,7 @@ text + validate-email 5 1 1 diff --git a/app/code/core/Mage/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Links.php b/app/code/core/Mage/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Links.php index aedbed15b7..6156e3bfd0 100644 --- a/app/code/core/Mage/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Links.php +++ b/app/code/core/Mage/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Links.php @@ -159,7 +159,7 @@ public function getLinkData() foreach ($links as $item) { $tmpLinkItem = array( 'link_id' => $item->getId(), - 'title' => $item->getTitle(), + 'title' => $this->escapeHtml($item->getTitle()), 'price' => $this->getCanReadPrice() ? $this->getPriceValue($item->getPrice()) : '', 'number_of_downloads' => $item->getNumberOfDownloads(), 'is_shareable' => $item->getIsShareable(), diff --git a/app/code/core/Mage/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Samples.php b/app/code/core/Mage/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Samples.php index f6e1c41589..94e9040e5e 100644 --- a/app/code/core/Mage/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Samples.php +++ b/app/code/core/Mage/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Samples.php @@ -31,7 +31,8 @@ * @package Mage_Downloadable * @author Magento Core Team */ -class Mage_Downloadable_Block_Adminhtml_Catalog_Product_Edit_Tab_Downloadable_Samples extends Mage_Adminhtml_Block_Widget +class Mage_Downloadable_Block_Adminhtml_Catalog_Product_Edit_Tab_Downloadable_Samples + extends Mage_Adminhtml_Block_Widget { /** * Class constructor @@ -92,7 +93,7 @@ public function getSampleData() foreach ($samples as $item) { $tmpSampleItem = array( 'sample_id' => $item->getId(), - 'title' => $item->getTitle(), + 'title' => $this->escapeHtml($item->getTitle()), 'sample_url' => $item->getSampleUrl(), 'sample_type' => $item->getSampleType(), 'sort_order' => $item->getSortOrder(), @@ -176,7 +177,9 @@ public function getUploadButtonHtml() */ public function getConfigJson() { - $this->getConfig()->setUrl(Mage::getModel('adminhtml/url')->addSessionParam()->getUrl('*/downloadable_file/upload', array('type' => 'samples', '_secure' => true))); + $this->getConfig()->setUrl(Mage::getModel('adminhtml/url') + ->addSessionParam() + ->getUrl('*/downloadable_file/upload', array('type' => 'samples', '_secure' => true))); $this->getConfig()->setParams(array('form_key' => $this->getFormKey())); $this->getConfig()->setFileField('samples'); $this->getConfig()->setFilters(array( diff --git a/app/code/core/Mage/Downloadable/controllers/DownloadController.php b/app/code/core/Mage/Downloadable/controllers/DownloadController.php index cef5be6c47..a4f019070a 100644 --- a/app/code/core/Mage/Downloadable/controllers/DownloadController.php +++ b/app/code/core/Mage/Downloadable/controllers/DownloadController.php @@ -112,7 +112,7 @@ public function sampleAction() $this->_processDownload($resource, $resourceType); exit(0); } catch (Mage_Core_Exception $e) { - $this->_getSession()->addError(Mage::helper('downloadable')->__('An error occurred while getting requested content. Please contact the store owner.')); + $this->_getSession()->addError(Mage::helper('downloadable')->__('Sorry, there was an error getting requested content. Please contact the store owner.')); } } return $this->_redirectReferer(); @@ -142,7 +142,7 @@ public function linkSampleAction() $this->_processDownload($resource, $resourceType); exit(0); } catch (Mage_Core_Exception $e) { - $this->_getCustomerSession()->addError(Mage::helper('downloadable')->__('An error occurred while getting requested content. Please contact the store owner.')); + $this->_getCustomerSession()->addError(Mage::helper('downloadable')->__('Sorry, there was an error getting requested content. Please contact the store owner.')); } } return $this->_redirectReferer(); diff --git a/app/code/core/Mage/Downloadable/etc/config.xml b/app/code/core/Mage/Downloadable/etc/config.xml index 96409de891..bb412c2843 100644 --- a/app/code/core/Mage/Downloadable/etc/config.xml +++ b/app/code/core/Mage/Downloadable/etc/config.xml @@ -252,6 +252,7 @@ /downloadable/customer/ + /downloadable/download/ diff --git a/app/code/core/Mage/Eav/Model/Config.php b/app/code/core/Mage/Eav/Model/Config.php index fb51b52a45..80c1278c82 100644 --- a/app/code/core/Mage/Eav/Model/Config.php +++ b/app/code/core/Mage/Eav/Model/Config.php @@ -118,7 +118,7 @@ public function clear() } /** - * Get object by idetifier + * Get object by identifier * * @param mixed $id * @return mixed @@ -373,7 +373,7 @@ protected function _initAttributes($entityType) * * @param mixed $entityType * @param mixed $code - * @return Mage_Eav_Model_Entity_Attribute_Abstract + * @return Mage_Eav_Model_Entity_Attribute_Abstract|false */ public function getAttribute($entityType, $code) { @@ -406,7 +406,6 @@ public function getAttribute($entityType, $code) return $attribute; } - $attribute = false; if (isset($this->_attributeData[$entityTypeCode][$code])) { $data = $this->_attributeData[$entityTypeCode][$code]; unset($this->_attributeData[$entityTypeCode][$code]); @@ -505,7 +504,9 @@ public function preloadAttributes($entityType, $attributes) $this->_preloadedAttributes[$entityTypeCode] = $attributes; } else { $attributes = array_diff($attributes, $this->_preloadedAttributes[$entityTypeCode]); - $this->_preloadedAttributes[$entityTypeCode] = array_merge($this->_preloadedAttributes[$entityTypeCode], $attributes); + $this->_preloadedAttributes[$entityTypeCode] = array_merge($this->_preloadedAttributes[$entityTypeCode], + $attributes + ); } if (empty($attributes)) { diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Frontend/Abstract.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Frontend/Abstract.php index 7afb91e2d3..77b55ebbf3 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Frontend/Abstract.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Frontend/Abstract.php @@ -134,7 +134,7 @@ public function isVisible() } /** - * Retreive frontend class + * Retrieve frontend class * * @return string */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php b/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php index 88b37d1031..bef9e0d54f 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php +++ b/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php @@ -430,7 +430,8 @@ public function addAttributeToSelect($attribute, $joinType = false) if ($joinType !== false && !$this->getEntity()->getAttribute($attribute)->isStatic()) { $this->_addAttributeJoin($attribute, $joinType); } elseif ('*' === $attribute) { - $attributes = $this->getEntity() + $entity = clone $this->getEntity(); + $attributes = $entity ->loadAllAttributes() ->getAttributesByCode(); foreach ($attributes as $attrCode=>$attr) { diff --git a/app/code/core/Mage/GoogleCheckout/Block/Adminhtml/Shipping/Merchant.php b/app/code/core/Mage/GoogleCheckout/Block/Adminhtml/Shipping/Merchant.php index 0a2d9b310f..12c42b515e 100644 --- a/app/code/core/Mage/GoogleCheckout/Block/Adminhtml/Shipping/Merchant.php +++ b/app/code/core/Mage/GoogleCheckout/Block/Adminhtml/Shipping/Merchant.php @@ -53,21 +53,27 @@ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element) return $html; } - protected function _getRowTemplateHtml($i=0) + /** + * Retrieve html template for shipping method row + * + * @param int $rowIndex + * @return string + */ + protected function _getRowTemplateHtml($rowIndex = 0) { $html = '
  • '; $html .= '_getDisabled() . '/> '; + . $this->_getValue('price/' . $rowIndex) . '" ' . $this->_getDisabled() . '/> '; $html .= $this->_getRemoveRowButtonHtml(); $html .= '
  • '; @@ -152,7 +158,6 @@ protected function _getAddRowButtonHtml($container, $template, $title='Add') ->setType('button') ->setClass('add ' . $this->_getDisabled()) ->setLabel($this->__($title)) - //$this->__('Add') ->setOnClick("Element.insert($('" . $container . "'), {bottom: $('" . $template . "').innerHTML})") ->setDisabled($this->_getDisabled()) ->toHtml(); @@ -167,7 +172,6 @@ protected function _getRemoveRowButtonHtml($selector = 'li', $title = 'Remove') ->setType('button') ->setClass('delete v-middle ' . $this->_getDisabled()) ->setLabel($this->__($title)) - //$this->__('Remove') ->setOnClick("Element.remove($(this).up('" . $selector . "'))") ->setDisabled($this->_getDisabled()) ->toHtml(); diff --git a/app/code/core/Mage/GoogleCheckout/Model/Api/Xml/Checkout.php b/app/code/core/Mage/GoogleCheckout/Model/Api/Xml/Checkout.php index b087b24fd7..bd06cd4958 100644 --- a/app/code/core/Mage/GoogleCheckout/Model/Api/Xml/Checkout.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Api/Xml/Checkout.php @@ -129,12 +129,17 @@ protected function _getItemsXml() $weight = (float) $item->getWeight(); $weightUnit = self::ITEM_WEIGHT_UNIT; + $unitPrice = $item->getBaseCalculationPrice(); + if (Mage::helper('weee')->includeInSubtotal()) { + $unitPrice += $item->getBaseWeeeTaxAppliedAmount(); + } + $xml .= << getSku()}]]> getName()}]]> getDescription()}]]> - {$item->getBaseCalculationPrice()} + {$unitPrice} {$item->getQty()} {$taxClass} diff --git a/app/code/core/Mage/GoogleCheckout/etc/config.xml b/app/code/core/Mage/GoogleCheckout/etc/config.xml index efbe5f33a4..88f487d08e 100644 --- a/app/code/core/Mage/GoogleCheckout/etc/config.xml +++ b/app/code/core/Mage/GoogleCheckout/etc/config.xml @@ -82,6 +82,7 @@ /googlecheckout/redirect/ /googlecheckout/api/beacon/ + /googlecheckout/api/ diff --git a/app/code/core/Mage/GoogleCheckout/etc/system.xml b/app/code/core/Mage/GoogleCheckout/etc/system.xml index 8e04efaf45..a82f6d58d0 100644 --- a/app/code/core/Mage/GoogleCheckout/etc/system.xml +++ b/app/code/core/Mage/GoogleCheckout/etc/system.xml @@ -79,7 +79,7 @@ 1 1 0 - Required for live Google Checkout transactions. + Required for live Google Checkout transactions. Make sure that this option corresponds to Use Secure URLs in Frontend ("Web" > "Secure"). diff --git a/app/code/core/Mage/ImportExport/Helper/Data.php b/app/code/core/Mage/ImportExport/Helper/Data.php index e75a9455d4..f714b36fd4 100644 --- a/app/code/core/Mage/ImportExport/Helper/Data.php +++ b/app/code/core/Mage/ImportExport/Helper/Data.php @@ -33,7 +33,11 @@ */ class Mage_ImportExport_Helper_Data extends Mage_Core_Helper_Data { + /** + * XML path for config data + */ const XML_PATH_EXPORT_LOCAL_VALID_PATH = 'general/file/importexport_local_valid_paths'; + const XML_PATH_BUNCH_SIZE = 'general/file/bunch_size'; /** * Maximum size of uploaded files. @@ -55,4 +59,14 @@ public function getLocalValidPaths() $paths = Mage::getStoreConfig(self::XML_PATH_EXPORT_LOCAL_VALID_PATH); return $paths; } + + /** + * Retrieve size of bunch (how much products should be involved in one import iteration) + * + * @return int + */ + public function getBunchSize() + { + return (int)Mage::getStoreConfig(self::XML_PATH_BUNCH_SIZE); + } } diff --git a/app/code/core/Mage/ImportExport/Model/Export/Entity/Product.php b/app/code/core/Mage/ImportExport/Model/Export/Entity/Product.php index d1e6fc0e11..e7a3a2b83b 100644 --- a/app/code/core/Mage/ImportExport/Model/Export/Entity/Product.php +++ b/app/code/core/Mage/ImportExport/Model/Export/Entity/Product.php @@ -50,6 +50,7 @@ class Mage_ImportExport_Model_Export_Entity_Product extends Mage_ImportExport_Mo const COL_ATTR_SET = '_attribute_set'; const COL_TYPE = '_type'; const COL_CATEGORY = '_category'; + const COL_ROOT_CATEGORY = '_root_category'; const COL_SKU = 'sku'; /** @@ -66,6 +67,13 @@ class Mage_ImportExport_Model_Export_Entity_Product extends Mage_ImportExport_Mo */ protected $_categories = array(); + /** + * Root category names for each category + * + * @var array + */ + protected $_rootCategories = array(); + /** * Attributes with index (not label) value. * @@ -158,13 +166,17 @@ protected function _initCategories() foreach ($collection as $category) { $structure = preg_split('#/+#', $category->getPath()); $pathSize = count($structure); - if ($pathSize > 2) { + if ($pathSize > 1) { $path = array(); - for ($i = 2; $i < $pathSize; $i++) { + for ($i = 1; $i < $pathSize; $i++) { $path[] = $collection->getItemById($structure[$i])->getName(); } - $this->_categories[$category->getId()] = implode('/', $path); + $this->_rootCategories[$category->getId()] = array_shift($path); + if ($pathSize > 2) { + $this->_categories[$category->getId()] = implode('/', $path); + } } + } return $this; } @@ -509,6 +521,29 @@ protected function _prepareConfigurableProductPrice(array $productIds) return $configurablePrice; } + /** + * Update data row with information about categories. Return true, if data row was updated + * + * @param array $dataRow + * @param array $rowCategories + * @param int $productId + * @return bool + */ + protected function _updateDataWithCategoryColumns(&$dataRow, &$rowCategories, $productId) + { + if (!isset($rowCategories[$productId])) { + return false; + } + + $categoryId = array_shift($rowCategories[$productId]); + $dataRow[self::COL_ROOT_CATEGORY] = $this->_rootCategories[$categoryId]; + if (isset($this->_categories[$categoryId])) { + $dataRow[self::COL_CATEGORY] = $this->_categories[$categoryId]; + } + + return true; + } + /** * Export process. * @@ -642,9 +677,10 @@ public function export() break; } - // remove root categories - foreach ($rowCategories as $productId => &$categories) { - $categories = array_intersect($categories, array_keys($this->_categories)); + // remove unused categories + $allCategoriesIds = array_merge(array_keys($this->_categories), array_keys($this->_rootCategories)); + foreach ($rowCategories as &$categories) { + $categories = array_intersect($categories, $allCategoriesIds); } // prepare catalog inventory information @@ -789,7 +825,7 @@ public function export() $headerCols = array_merge( array( self::COL_SKU, self::COL_STORE, self::COL_ATTR_SET, - self::COL_TYPE, self::COL_CATEGORY, '_product_websites' + self::COL_TYPE, self::COL_CATEGORY, self::COL_ROOT_CATEGORY, '_product_websites' ), $validAttrCodes, reset($stockItemRows) ? array_keys(end($stockItemRows)) : array(), @@ -836,9 +872,8 @@ public function export() $dataRow[self::COL_STORE] = null; $dataRow += $stockItemRows[$productId]; } - if ($rowCategories[$productId]) { - $dataRow[self::COL_CATEGORY] = $this->_categories[array_shift($rowCategories[$productId])]; - } + + $this->_updateDataWithCategoryColumns($dataRow, $rowCategories, $productId); if ($rowWebsites[$productId]) { $dataRow['_product_websites'] = $this->_websiteIdToCode[array_shift($rowWebsites[$productId])]; } @@ -917,9 +952,7 @@ public function export() for ($i = 0; $i < $additionalRowsCount; $i++) { $dataRow = array(); - if ($rowCategories[$productId]) { - $dataRow[self::COL_CATEGORY] = $this->_categories[array_shift($rowCategories[$productId])]; - } + $this->_updateDataWithCategoryColumns($dataRow, $rowCategories, $productId); if ($rowWebsites[$productId]) { $dataRow['_product_websites'] = $this ->_websiteIdToCode[array_shift($rowWebsites[$productId])]; diff --git a/app/code/core/Mage/ImportExport/Model/Import/Entity/Abstract.php b/app/code/core/Mage/ImportExport/Model/Import/Entity/Abstract.php index 6aede50b19..d81bb355b3 100644 --- a/app/code/core/Mage/ImportExport/Model/Import/Entity/Abstract.php +++ b/app/code/core/Mage/ImportExport/Model/Import/Entity/Abstract.php @@ -272,6 +272,7 @@ protected function _saveValidatedBunches() $startNewBunch = false; $nextRowBackup = array(); $maxDataSize = Mage::getResourceHelper('importexport')->getMaxDataSize(); + $bunchSize = Mage::helper('importexport')->getBunchSize(); $source->rewind(); $this->_dataSourceModel->cleanBunches(); @@ -295,9 +296,11 @@ protected function _saveValidatedBunches() if ($this->validateRow($rowData, $source->key())) { // add row to bunch for save $rowData = $this->_prepareRowForDb($rowData); - $rowSize = strlen(serialize($rowData)); + $rowSize = strlen(Mage::helper('core')->jsonEncode($rowData)); - if (($productDataSize + $rowSize) >= $maxDataSize) { // check bunch size + $isBunchSizeExceeded = ($bunchSize > 0 && count($bunchRows) >= $bunchSize); + + if (($productDataSize + $rowSize) >= $maxDataSize || $isBunchSizeExceeded) { $startNewBunch = true; $nextRowBackup = array($source->key() => $rowData); } else { diff --git a/app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php b/app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php index 4bd0abf3c5..815cb6c5e7 100644 --- a/app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php +++ b/app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php @@ -63,6 +63,7 @@ class Mage_ImportExport_Model_Import_Entity_Product extends Mage_ImportExport_Mo const COL_ATTR_SET = '_attribute_set'; const COL_TYPE = '_type'; const COL_CATEGORY = '_category'; + const COL_ROOT_CATEGORY = '_root_category'; const COL_SKU = 'sku'; /** @@ -115,6 +116,13 @@ class Mage_ImportExport_Model_Import_Entity_Product extends Mage_ImportExport_Mo */ protected $_categories = array(); + /** + * Categories text-path to ID hash with roots checking. + * + * @var array + */ + protected $_categoriesWithRoots = array(); + /** * Customer groups ID-to-name. * @@ -211,9 +219,9 @@ class Mage_ImportExport_Model_Import_Entity_Product extends Mage_ImportExport_Mo * @var array */ protected $_particularAttributes = array( - '_store', '_attribute_set', '_type', '_category', '_product_websites', '_tier_price_website', - '_tier_price_customer_group', '_tier_price_qty', '_tier_price_price', '_links_related_sku', - '_group_price_website', '_group_price_customer_group', '_group_price_price', + '_store', '_attribute_set', '_type', self::COL_CATEGORY, self::COL_ROOT_CATEGORY, '_product_websites', + '_tier_price_website', '_tier_price_customer_group', '_tier_price_qty', '_tier_price_price', + '_links_related_sku', '_group_price_website', '_group_price_customer_group', '_group_price_price', '_links_related_position', '_links_crosssell_sku', '_links_crosssell_position', '_links_upsell_sku', '_links_upsell_position', '_custom_option_store', '_custom_option_type', '_custom_option_title', '_custom_option_is_required', '_custom_option_price', '_custom_option_sku', '_custom_option_max_characters', @@ -376,12 +384,20 @@ protected function _initCategories() foreach ($collection as $category) { $structure = explode('/', $category->getPath()); $pathSize = count($structure); - if ($pathSize > 2) { + if ($pathSize > 1) { $path = array(); - for ($i = 2; $i < $pathSize; $i++) { + for ($i = 1; $i < $pathSize; $i++) { $path[] = $collection->getItemById($structure[$i])->getName(); } - $this->_categories[implode('/', $path)] = $category->getId(); + $rootCategoryName = array_shift($path); + if (!isset($this->_categoriesWithRoots[$rootCategoryName])) { + $this->_categoriesWithRoots[$rootCategoryName] = array(); + } + $index = implode('/', $path); + $this->_categoriesWithRoots[$rootCategoryName][$index] = $category->getId(); + if ($pathSize > 2) { + $this->_categories[$index] = $category->getId(); + } } } return $this; @@ -491,7 +507,14 @@ protected function _initWebsites() */ protected function _isProductCategoryValid(array $rowData, $rowNum) { - if (!empty($rowData[self::COL_CATEGORY]) && !isset($this->_categories[$rowData[self::COL_CATEGORY]])) { + $emptyCategory = empty($rowData[self::COL_CATEGORY]); + $emptyRootCategory = empty($rowData[self::COL_ROOT_CATEGORY]); + $hasCategory = $emptyCategory ? false : isset($this->_categories[$rowData[self::COL_CATEGORY]]); + $category = $emptyRootCategory ? null : $this->_categoriesWithRoots[$rowData[self::COL_ROOT_CATEGORY]]; + if (!$emptyCategory && !$hasCategory + || !$emptyRootCategory && !isset($category) + || !$emptyRootCategory && !$emptyCategory && !isset($category[$rowData[self::COL_CATEGORY]]) + ) { $this->addRowError(self::ERROR_INVALID_CATEGORY, $rowNum); return false; } @@ -1164,10 +1187,17 @@ protected function _saveProducts() if (!empty($rowData['_product_websites'])) { // 2. Product-to-Website phase $websites[$rowSku][$this->_websiteCodeToId[$rowData['_product_websites']]] = true; } - if (!empty($rowData[self::COL_CATEGORY])) { // 3. Categories phase - $categories[$rowSku][$this->_categories[$rowData[self::COL_CATEGORY]]] = true; + + // 3. Categories phase + $categoryPath = empty($rowData[self::COL_CATEGORY]) ? '' : $rowData[self::COL_CATEGORY]; + if (!empty($rowData[self::COL_ROOT_CATEGORY])) { + $categoryId = $this->_categoriesWithRoots[$rowData[self::COL_ROOT_CATEGORY]][$categoryPath]; + $categories[$rowSku][$categoryId] = true; + } elseif (!empty($categoryPath)) { + $categories[$rowSku][$this->_categories[$categoryPath]] = true; } - if (!empty($rowData['_tier_price_website'])) { // 4. Tier prices phase + + if (!empty($rowData['_tier_price_website'])) { // 4.1. Tier prices phase $tierPrices[$rowSku][] = array( 'all_groups' => $rowData['_tier_price_customer_group'] == self::VALUE_ALL, 'customer_group_id' => ($rowData['_tier_price_customer_group'] == self::VALUE_ALL) @@ -1178,7 +1208,7 @@ protected function _saveProducts() ? 0 : $this->_websiteCodeToId[$rowData['_tier_price_website']] ); } - if (!empty($rowData['_group_price_website'])) { // 5. Group prices phase + if (!empty($rowData['_group_price_website'])) { // 4.2. Group prices phase $groupPrices[$rowSku][] = array( 'all_groups' => $rowData['_group_price_customer_group'] == self::VALUE_ALL, 'customer_group_id' => ($rowData['_group_price_customer_group'] == self::VALUE_ALL) diff --git a/app/code/core/Mage/ImportExport/etc/config.xml b/app/code/core/Mage/ImportExport/etc/config.xml index 9a515fb7f8..81c348a83c 100644 --- a/app/code/core/Mage/ImportExport/etc/config.xml +++ b/app/code/core/Mage/ImportExport/etc/config.xml @@ -136,6 +136,7 @@ var/import/*/*.csv + 100 diff --git a/app/code/core/Mage/Log/etc/system.xml b/app/code/core/Mage/Log/etc/system.xml index ccac0a73d2..3068edc573 100644 --- a/app/code/core/Mage/Log/etc/system.xml +++ b/app/code/core/Mage/Log/etc/system.xml @@ -75,6 +75,7 @@ text + validate-email 5 1 0 diff --git a/app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/Admin/Token.php b/app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/Admin/Token.php new file mode 100644 index 0000000000..8bbcee994a --- /dev/null +++ b/app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/Admin/Token.php @@ -0,0 +1,48 @@ + + */ +class Mage_OAuth_Block_Adminhtml_OAuth_Admin_Token extends Mage_Adminhtml_Block_Widget_Grid_Container +{ + /** + * Construct grid container + */ + public function __construct() + { + parent::__construct(); + + $this->_blockGroup = 'oauth'; + $this->_controller = 'adminhtml_oAuth_admin_token'; + $this->_headerText = Mage::helper('adminhtml')->__('My Applications'); + $this->_removeButton('add'); + } +} diff --git a/app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/Admin/Token/Grid.php b/app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/Admin/Token/Grid.php new file mode 100644 index 0000000000..c7bfbc6b19 --- /dev/null +++ b/app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/Admin/Token/Grid.php @@ -0,0 +1,141 @@ + + */ +class Mage_OAuth_Block_Adminhtml_OAuth_Admin_Token_Grid extends Mage_Adminhtml_Block_Widget_Grid +{ + /** + * Construct grid block + */ + public function __construct() + { + parent::__construct(); + $this->setId('adminTokenGrid'); + $this->setUseAjax(true); + $this->setSaveParametersInSession(true); + $this->setDefaultSort('entity_id') + ->setDefaultDir(Varien_Db_Select::SQL_DESC); + } + + /** + * Prepare collection + * + * @return Mage_OAuth_Block_Adminhtml_OAuth_Admin_Token_Grid + */ + protected function _prepareCollection() + { + /** @var $user Mage_Admin_Model_User */ + $user = Mage::getSingleton('admin/session')->getData('user'); + + /** @var $collection Mage_OAuth_Model_Resource_Token_Collection */ + $collection = Mage::getModel('oauth/token')->getCollection(); + $collection->joinConsumerAsApplication() + ->addFilterByType(Mage_OAuth_Model_Token::TYPE_ACCESS) + ->addFilterByAdminId($user->getId()); + $this->setCollection($collection); + + parent::_prepareCollection(); + return $this; + } + + /** + * Prepare columns + * + * @return Mage_OAuth_Block_Adminhtml_OAuth_Admin_Token_Grid + */ + protected function _prepareColumns() + { + $this->addColumn('entity_id', array( + 'header' => Mage::helper('oauth')->__('ID'), + 'index' => 'entity_id', + 'align' => 'right', + 'width' => '50px', + )); + + $this->addColumn('name', array( + 'header' => $this->__('Application Name'), + 'index' => 'name', + 'escape' => true, + )); + + /** @var $sourceYesNo Mage_Adminhtml_Model_System_Config_Source_Yesno */ + $sourceYesNo = Mage::getSingleton('adminhtml/system_config_source_yesno'); + $this->addColumn('revoked', array( + 'header' => $this->__('Revoked'), + 'index' => 'revoked', + 'width' => '100px', + 'type' => 'options', + 'options' => $sourceYesNo->toArray(), + 'sortable' => true, + )); + + parent::_prepareColumns(); + return $this; + } + + /** + * Add mass-actions to grid + * + * @return Mage_OAuth_Block_Adminhtml_OAuth_Admin_Token_Grid + */ + protected function _prepareMassaction() + { + $this->setMassactionIdField('id'); + $block = $this->getMassactionBlock(); + + $block->setFormFieldName('items'); + $block->addItem('enable', array( + 'label' => Mage::helper('index')->__('Enable'), + 'url' => $this->getUrl('*/*/revoke', array('status' => 0)), + )); + $block->addItem('revoke', array( + 'label' => Mage::helper('index')->__('Revoke'), + 'url' => $this->getUrl('*/*/revoke', array('status' => 1)), + )); + $block->addItem('delete', array( + 'label' => Mage::helper('index')->__('Delete'), + 'url' => $this->getUrl('*/*/delete'), + )); + + return $this; + } + + /** + * Get grid URL + * + * @return string + */ + public function getGridUrl() + { + return $this->getUrl('*/*/grid', array('_current' => true)); + } +} diff --git a/app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/Authorize.php b/app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/Authorize.php new file mode 100644 index 0000000000..e3174c6e1e --- /dev/null +++ b/app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/Authorize.php @@ -0,0 +1,79 @@ + + */ +class Mage_OAuth_Block_Adminhtml_OAuth_Authorize extends Mage_OAuth_Block_AuthorizeBaseAbstract +{ + /** + * Retrieve admin form posting url + * + * @return string + */ + public function getPostActionUrl() + { + $params = array(); + if ($this->getIsSimple()) { + $params['simple'] = 1; + } + return $this->getUrl('adminhtml/index/login', $params); + } + + /** + * Get form identity label + * + * @return string + */ + public function getIdentityLabel() + { + return $this->__('User Name'); + } + + /** + * Get form identity label + * + * @return string + */ + public function getFormTitle() + { + return $this->__('Log in as admin'); + } + + /** + * Retrieve reject application authorization URL + * + * @return string + */ + public function getRejectUrlPath() + { + return 'adminhtml/oAuth_authorize/reject'; + } +} diff --git a/app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/Authorize/Button.php b/app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/Authorize/Button.php new file mode 100644 index 0000000000..aa6e23537a --- /dev/null +++ b/app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/Authorize/Button.php @@ -0,0 +1,55 @@ + + */ +class Mage_OAuth_Block_Adminhtml_OAuth_Authorize_Button extends Mage_OAuth_Block_Authorize_ButtonBaseAbstract +{ + /** + * Retrieve confirm authorization url path + * + * @return string + */ + public function getConfirmUrlPath() + { + return 'adminhtml/oAuth_authorize/confirm'; + } + + /** + * Retrieve reject authorization url path + * + * @return string + */ + public function getRejectUrlPath() + { + return 'adminhtml/oAuth_authorize/reject'; + } +} diff --git a/app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/AuthorizedTokens.php b/app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/AuthorizedTokens.php new file mode 100644 index 0000000000..b307a59af9 --- /dev/null +++ b/app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/AuthorizedTokens.php @@ -0,0 +1,50 @@ + + */ +class Mage_OAuth_Block_Adminhtml_OAuth_AuthorizedTokens extends Mage_Adminhtml_Block_Widget_Grid_Container +{ + /** + * Construct grid container + */ + public function __construct() + { + parent::__construct(); + + $this->_blockGroup = 'oauth'; + $this->_controller = 'adminhtml_oAuth_authorizedTokens'; + $this->_headerText = Mage::helper('adminhtml')->__('Authorized OAuth Tokens'); + + $this->_removeButton('add'); + } +} + diff --git a/app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/AuthorizedTokens/Grid.php b/app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/AuthorizedTokens/Grid.php new file mode 100644 index 0000000000..69e3d948ac --- /dev/null +++ b/app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/AuthorizedTokens/Grid.php @@ -0,0 +1,225 @@ + + */ +class Mage_OAuth_Block_Adminhtml_OAuth_AuthorizedTokens_Grid extends Mage_Adminhtml_Block_Widget_Grid +{ + /** + * Construct grid block + */ + public function __construct() + { + parent::__construct(); + $this->setId('authorizedTokensGrid'); + $this->setUseAjax(true); + $this->setSaveParametersInSession(true); + $this->setDefaultSort('entity_id') + ->setDefaultDir(Varien_Db_Select::SQL_DESC); + } + + /** + * Prepare collection + * + * @return Mage_OAuth_Block_Adminhtml_OAuth_AuthorizedTokens_Grid + */ + protected function _prepareCollection() + { + /** @var $collection Mage_OAuth_Model_Resource_Token_Collection */ + $collection = Mage::getModel('oauth/token')->getCollection(); + $collection->joinConsumerAsApplication() + ->addFilterByType(Mage_OAuth_Model_Token::TYPE_ACCESS); + $this->setCollection($collection); + + parent::_prepareCollection(); + return $this; + } + + /** + * Prepare columns + * + * @return Mage_OAuth_Block_Adminhtml_OAuth_AuthorizedTokens_Grid + */ + protected function _prepareColumns() + { + $this->addColumn('entity_id', array( + 'header' => Mage::helper('oauth')->__('ID'), + 'index' => 'entity_id', + 'align' => 'right', + 'width' => '50px', + + )); + + $this->addColumn('name', array( + 'header' => $this->__('Application Name'), + 'index' => 'name', + 'escape' => true, + )); + + $this->addColumn('type', array( + 'header' => $this->__('User Type'), + //'index' => array('customer_id', 'admin_id'), + 'options' => array(0 => $this->__('Admin'), 1 => $this->__('Customer')), + 'frame_callback' => array($this, 'decorateUserType') + )); + + $this->addColumn('user_id', array( + 'header' => $this->__('User ID'), + //'index' => array('customer_id', 'admin_id'), + 'frame_callback' => array($this, 'decorateUserId') + )); + + /** @var $sourceYesNo Mage_Adminhtml_Model_System_Config_Source_Yesno */ + $sourceYesNo = Mage::getSingleton('adminhtml/system_config_source_yesno'); + $this->addColumn('revoked', array( + 'header' => $this->__('Revoked'), + 'index' => 'revoked', + 'width' => '100px', + 'type' => 'options', + 'options' => $sourceYesNo->toArray(), + 'sortable' => true, + )); + + parent::_prepareColumns(); + return $this; + } + + /** + * Get grid URL + * + * @return string + */ + public function getGridUrl() + { + return $this->getUrl('*/*/grid', array('_current' => true)); + } + + /** + * Get revoke URL + * + * @param Mage_OAuth_Model_Token $row + * @return string|null + */ + public function getRevokeUrl($row) + { + return $this->getUrl('*/*/revoke', array('id' => $row->getId())); + } + + /** + * Get delete URL + * + * @param Mage_OAuth_Model_Token $row + * @return string|null + */ + public function getDeleteUrl($row) + { + return $this->getUrl('*/*/delete', array('id' => $row->getId())); + } + + /** + * Add mass-actions to grid + * + * @return Mage_OAuth_Block_Adminhtml_OAuth_AuthorizedTokens_Grid + */ + protected function _prepareMassaction() + { + if(!$this->_isAllowed()) { + return $this; + } + + $this->setMassactionIdField('id'); + $block = $this->getMassactionBlock(); + + $block->setFormFieldName('items'); + $block->addItem('enable', array( + 'label' => Mage::helper('index')->__('Enable'), + 'url' => $this->getUrl('*/*/revoke', array('status' => 0)), + )); + $block->addItem('revoke', array( + 'label' => Mage::helper('index')->__('Revoke'), + 'url' => $this->getUrl('*/*/revoke', array('status' => 1)), + )); + $block->addItem('delete', array( + 'label' => Mage::helper('index')->__('Delete'), + 'url' => $this->getUrl('*/*/delete'), + )); + + return $this; + } + + /** + * Decorate user type column + * + * @param string $value + * @param Mage_OAuth_Model_Token $row + * @param Mage_Adminhtml_Block_Widget_Grid_Column $column + * @param bool $isExport + * @return mixed + */ + public function decorateUserType($value, $row, $column, $isExport) + { + $options = $column->getOptions(); + + $value = ($row->getCustomerId()) ?$options[1] :$options[0]; + $cell = $value; + + return $cell; + } + + /** + * Decorate user type column + * + * @param string $value + * @param Mage_OAuth_Model_Token $row + * @param Mage_Adminhtml_Block_Widget_Grid_Column $column + * @param bool $isExport + * @return mixed + */ + public function decorateUserId($value, $row, $column, $isExport) + { + $value = ($row->getCustomerId()) ?$row->getCustomerId() :$row->getAdminId(); + $cell = $value; + + return $cell; + } + + /** + * Check admin permissions + * + * @return boolean + */ + protected function _isAllowed() + { + /** @var $session Mage_Admin_Model_Session */ + $session = Mage::getSingleton('admin/session'); + return $session->isAllowed('system/oauth/authorizedTokens'); + } +} diff --git a/app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/Consumer.php b/app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/Consumer.php new file mode 100644 index 0000000000..b4c9dca891 --- /dev/null +++ b/app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/Consumer.php @@ -0,0 +1,54 @@ + + */ +class Mage_OAuth_Block_Adminhtml_OAuth_Consumer extends Mage_Adminhtml_Block_Widget_Grid_Container +{ + /** + * Construct grid container + */ + public function __construct() + { + parent::__construct(); + + $this->_blockGroup = 'oauth'; + $this->_controller = 'adminhtml_oAuth_consumer'; + $this->_headerText = Mage::helper('adminhtml')->__('OAuth Consumers'); + + //check allow edit + /** @var $session Mage_Admin_Model_Session */ + $session = Mage::getSingleton('admin/session'); + if (!$session->isAllowed('system/oauth/consumer/edit')) { + $this->_removeButton('add'); + } + } +} diff --git a/app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/Consumer/Edit.php b/app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/Consumer/Edit.php new file mode 100644 index 0000000000..de7eb17b4b --- /dev/null +++ b/app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/Consumer/Edit.php @@ -0,0 +1,100 @@ + + */ +class Mage_OAuth_Block_Adminhtml_OAuth_Consumer_Edit extends Mage_Adminhtml_Block_Widget_Form_Container +{ + /** + * Consumer model + * + * @var Mage_OAuth_Model_Consumer + */ + protected $_model; + + /** + * Get consumer model + * + * @return Mage_OAuth_Model_Consumer + */ + public function getModel() + { + if (null === $this->_model) { + $this->_model = Mage::registry('current_consumer'); + } + return $this->_model; + } + + /** + * Construct edit page + */ + public function __construct() + { + parent::__construct(); + $this->_blockGroup = 'oauth'; + $this->_controller = 'adminhtml_oAuth_consumer'; + $this->_mode = 'edit'; + + $this->_addButton('save_and_continue', array( + 'label' => Mage::helper('oauth')->__('Save and Continue Edit'), + 'onclick' => 'saveAndContinueEdit()', + 'class' => 'save' + ), 100); + + $this->_formScripts[] = "function saveAndContinueEdit()" . + "{editForm.submit($('edit_form').action + 'back/edit/')}"; + + $this->_updateButton('save', 'label', $this->__('Save')); + $this->_updateButton('save', 'id', 'save_button'); + $this->_updateButton('delete', 'label', $this->__('Delete')); + + /** @var $session Mage_Admin_Model_Session */ + $session = Mage::getSingleton('admin/session'); + if (!$this->getModel()->getId() || !$session->isAllowed('system/oauth/consumer/delete')) { + $this->_removeButton('delete'); + } + } + + /** + * Get header text + * + * @return string + */ + public function getHeaderText() + { + if ($this->getModel()->getId()) { + return $this->__('Edit Consumer'); + } else { + return $this->__('New Consumer'); + } + } +} diff --git a/app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/Consumer/Edit/Form.php b/app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/Consumer/Edit/Form.php new file mode 100644 index 0000000000..8d27f2a1c4 --- /dev/null +++ b/app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/Consumer/Edit/Form.php @@ -0,0 +1,126 @@ + + */ +class Mage_OAuth_Block_Adminhtml_OAuth_Consumer_Edit_Form extends Mage_Adminhtml_Block_Widget_Form +{ + /** + * Consumer model + * + * @var Mage_OAuth_Model_Consumer + */ + protected $_model; + + /** + * Get consumer model + * + * @return Mage_OAuth_Model_Consumer + */ + public function getModel() + { + if (null === $this->_model) { + $this->_model = Mage::registry('current_consumer'); + } + return $this->_model; + } + + /** + * Prepare form before rendering HTML + * + * @return Mage_OAuth_Block_Adminhtml_OAuth_Consumer_Edit_Form + */ + protected function _prepareForm() + { + $model = $this->getModel(); + $form = new Varien_Data_Form(array( + 'id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post' + )); + + $fieldset = $form->addFieldset('base_fieldset', array( + 'legend' => Mage::helper('oauth')->__('Consumer Information'), 'class' => 'fieldset-wide' + )); + + if ($model->getId()) { + $fieldset->addField('id', 'hidden', array('name' => 'id', 'value' => $model->getId())); + } + $fieldset->addField('name', 'text', array( + 'name' => 'name', + 'label' => Mage::helper('oauth')->__('Name'), + 'title' => Mage::helper('oauth')->__('Name'), + 'required' => true, + 'value' => $model->getName(), + )); + + $fieldset->addField('key', 'text', array( + 'name' => 'key', + 'label' => Mage::helper('oauth')->__('Key'), + 'title' => Mage::helper('oauth')->__('Key'), + 'disabled' => true, + 'required' => true, + 'value' => $model->getKey(), + )); + + $fieldset->addField('secret', 'text', array( + 'name' => 'secret', + 'label' => Mage::helper('oauth')->__('Secret'), + 'title' => Mage::helper('oauth')->__('Secret'), + 'disabled' => true, + 'required' => true, + 'value' => $model->getSecret(), + )); + + $fieldset->addField('callback_url', 'text', array( + 'name' => 'callback_url', + 'label' => Mage::helper('oauth')->__('Callback URL'), + 'title' => Mage::helper('oauth')->__('Callback URL'), + 'required' => false, + 'value' => $model->getCallbackUrl(), + 'class' => 'validate-url', + )); + + $fieldset->addField('rejected_callback_url', 'text', array( + 'name' => 'rejected_callback_url', + 'label' => Mage::helper('oauth')->__('Rejected Callback URL'), + 'title' => Mage::helper('oauth')->__('Rejected Callback URL'), + 'required' => false, + 'value' => $model->getRejectedCallbackUrl(), + 'class' => 'validate-url', + )); + + $form->setAction($this->getUrl('*/*/save')); + $form->setUseContainer(true); + $this->setForm($form); + + return parent::_prepareForm(); + } +} diff --git a/app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/Consumer/Grid.php b/app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/Consumer/Grid.php new file mode 100644 index 0000000000..b97e0aee5b --- /dev/null +++ b/app/code/core/Mage/OAuth/Block/Adminhtml/OAuth/Consumer/Grid.php @@ -0,0 +1,118 @@ + + */ +class Mage_OAuth_Block_Adminhtml_OAuth_Consumer_Grid extends Mage_Adminhtml_Block_Widget_Grid +{ + /** + * Allow edit status + * + * @var bool + */ + protected $_editAllow = false; + + /** + * Construct grid block + */ + public function __construct() + { + parent::__construct(); + $this->setId('consumerGrid'); + $this->setUseAjax(true); + $this->setSaveParametersInSession(true); + $this->setDefaultSort('entity_id') + ->setDefaultDir(Varien_Db_Select::SQL_DESC); + + /** @var $session Mage_Admin_Model_Session */ + $session = Mage::getSingleton('admin/session'); + $this->_editAllow = $session->isAllowed('system/oauth/consumer/edit'); + } + + /** + * Prepare collection + * + * @return Mage_OAuth_Block_Adminhtml_OAuth_Consumer_Grid + */ + protected function _prepareCollection() + { + $collection = Mage::getModel('oauth/consumer')->getCollection(); + $this->setCollection($collection); + + return parent::_prepareCollection(); + } + + /** + * Prepare columns + * + * @return Mage_OAuth_Block_Adminhtml_OAuth_Consumer_Grid + */ + protected function _prepareColumns() + { + $this->addColumn('entity_id', array( + 'header' => Mage::helper('oauth')->__('ID'), 'index' => 'entity_id', 'align' => 'right', 'width' => '50px' + )); + + $this->addColumn('name', array( + 'header' => Mage::helper('oauth')->__('Consumer Name'), 'index' => 'name', 'escape' => true + )); + + $this->addColumn('created_at', array( + 'header' => Mage::helper('oauth')->__('Created At'), 'index' => 'created_at' + )); + + return parent::_prepareColumns(); + } + + /** + * Get grid URL + * + * @return string + */ + public function getGridUrl() + { + return $this->getUrl('*/*/grid', array('_current' => true)); + } + + /** + * Get row URL + * + * @param Mage_OAuth_Model_Consumer $row + * @return string|null + */ + public function getRowUrl($row) + { + if ($this->_editAllow) { + return $this->getUrl('*/*/edit', array('id' => $row->getId())); + } + return null; + } +} diff --git a/app/code/core/Mage/OAuth/Block/Authorize.php b/app/code/core/Mage/OAuth/Block/Authorize.php new file mode 100644 index 0000000000..5aa0c78fd4 --- /dev/null +++ b/app/code/core/Mage/OAuth/Block/Authorize.php @@ -0,0 +1,81 @@ + + */ +class Mage_OAuth_Block_Authorize extends Mage_OAuth_Block_AuthorizeBaseAbstract +{ + /** + * Retrieve customer form posting url + * + * @return string + */ + public function getPostActionUrl() + { + /** @var $helper Mage_Customer_Helper_Data */ + $helper = $this->helper('customer'); + $url = $helper->getLoginPostUrl(); + if ($this->getIsSimple()) { + $url = rtrim($url, '/') . '/simple/1'; + } + return $url; + } + + /** + * Get form identity label + * + * @return string + */ + public function getIdentityLabel() + { + return $this->__('Email Address'); + } + + /** + * Get form identity label + * + * @return string + */ + public function getFormTitle() + { + return $this->__('Log in as customer'); + } + + /** + * Retrieve reject URL path + * + * @return string + */ + public function getRejectUrlPath() + { + return 'oauth/authorize/reject'; + } +} diff --git a/app/code/core/Mage/OAuth/Block/Authorize/Abstract.php b/app/code/core/Mage/OAuth/Block/Authorize/Abstract.php new file mode 100644 index 0000000000..96ec2e751a --- /dev/null +++ b/app/code/core/Mage/OAuth/Block/Authorize/Abstract.php @@ -0,0 +1,106 @@ + + * @method string getToken() + * @method Mage_OAuth_Block_AuthorizeBaseAbstract setToken() setToken(string $token) + * @method boolean getIsSimple() + * @method Mage_OAuth_Block_Authorize_Button setIsSimple() setIsSimple(boolean $flag) + * @method boolean getHasException() + * @method Mage_OAuth_Block_AuthorizeBaseAbstract setIsException() setHasException(boolean $flag) + * @method boolean getVerifier() + * @method Mage_OAuth_Block_AuthorizeBaseAbstract setVerifier() setVerifier(string $verifier) + * @method boolean getIsLogged() + * @method Mage_OAuth_Block_AuthorizeBaseAbstract setIsLogged() setIsLogged(boolean $flag) + */ +abstract class Mage_OAuth_Block_Authorize_Abstract extends Mage_Core_Block_Template +{ + /** + * Helper + * + * @var Mage_OAuth_Helper_Data + */ + protected $_helper; + + /** + * Consumer model + * + * @var Mage_OAuth_Model_Consumer + */ + protected $_consumer; + + /** + * Constructor + */ + public function __construct() + { + parent::__construct(); + $this->_helper = Mage::helper('oauth'); + } + + /** + * Get consumer instance by token value + * + * @return Mage_OAuth_Model_Consumer + */ + public function getConsumer() + { + if (null === $this->_consumer) { + /** @var $token Mage_OAuth_Model_Token */ + $token = Mage::getModel('oauth/token'); + $token->load($this->getToken(), 'token'); + $this->_consumer = $token->getConsumer(); + } + return $this->_consumer; + } + + /** + * Get absolute path to template + * + * Load template from adminhtml/default area flag is_simple is set + * + * @return string + */ + public function getTemplateFile() + { + if (!$this->getIsSimple()) { + return parent::getTemplateFile(); + } + + //load base template from admin area + $params = array( + '_relative' => true, + '_area' => 'adminhtml', + '_package' => 'default' + ); + return Mage::getDesign()->getTemplateFilename($this->getTemplate(), $params); + } +} diff --git a/app/code/core/Mage/OAuth/Block/Authorize/Button.php b/app/code/core/Mage/OAuth/Block/Authorize/Button.php new file mode 100644 index 0000000000..82eda40c7d --- /dev/null +++ b/app/code/core/Mage/OAuth/Block/Authorize/Button.php @@ -0,0 +1,55 @@ + + */ +class Mage_OAuth_Block_Authorize_Button extends Mage_OAuth_Block_Authorize_ButtonBaseAbstract +{ + /** + * Retrieve confirm authorization url path + * + * @return string + */ + public function getConfirmUrlPath() + { + return 'oauth/authorize/confirm'; + } + + /** + * Retrieve reject authorization url path + * + * @return string + */ + public function getRejectUrlPath() + { + return 'oauth/authorize/reject'; + } +} diff --git a/app/code/core/Mage/OAuth/Block/Authorize/ButtonBaseAbstract.php b/app/code/core/Mage/OAuth/Block/Authorize/ButtonBaseAbstract.php new file mode 100644 index 0000000000..27199bed54 --- /dev/null +++ b/app/code/core/Mage/OAuth/Block/Authorize/ButtonBaseAbstract.php @@ -0,0 +1,69 @@ + + */ +abstract class Mage_OAuth_Block_Authorize_ButtonBaseAbstract extends Mage_OAuth_Block_Authorize_Abstract +{ + /** + * Get confirm url path + * + * @return string + */ + abstract public function getConfirmUrlPath(); + + /** + * Get reject url path + * + * @return string + */ + abstract public function getRejectUrlPath(); + + /** + * Retrieve reject authorization url + * + * @return string + */ + public function getConfirmUrl() + { + return $this->getUrl($this->getConfirmUrlPath() . ($this->getIsSimple() ? 'Simple' : '')); + } + + /** + * Retrieve reject authorization url + * + * @return string + */ + public function getRejectUrl() + { + return $this->getUrl($this->getRejectUrlPath() . ($this->getIsSimple() ? 'Simple' : '')); + } +} diff --git a/app/code/core/Mage/OAuth/Block/Authorize/Style.php b/app/code/core/Mage/OAuth/Block/Authorize/Style.php new file mode 100644 index 0000000000..0f166479a1 --- /dev/null +++ b/app/code/core/Mage/OAuth/Block/Authorize/Style.php @@ -0,0 +1,47 @@ + + */ +class Mage_OAuth_Block_Authorize_Style extends Mage_OAuth_Block_Authorize_Abstract +{ + /** + * Set default data + */ + public function __construct() + { + parent::__construct(); + + //default load template from admin package + $this->setIsSimple(true); + } + +} diff --git a/app/code/core/Mage/OAuth/Block/AuthorizeBaseAbstract.php b/app/code/core/Mage/OAuth/Block/AuthorizeBaseAbstract.php new file mode 100644 index 0000000000..44d9e60b5a --- /dev/null +++ b/app/code/core/Mage/OAuth/Block/AuthorizeBaseAbstract.php @@ -0,0 +1,75 @@ + + */ +abstract class Mage_OAuth_Block_AuthorizeBaseAbstract extends Mage_OAuth_Block_Authorize_Abstract +{ + /** + * Retrieve user authorize form posting url + * + * @return string + */ + abstract public function getPostActionUrl(); + + /** + * Retrieve reject authorization url + * + * @return string + */ + public function getRejectUrl() + { + $url = $this->getUrl($this->getRejectUrlPath() . ($this->getIsSimple() ? 'Simple' : ''), + array('_query' => array('oauth_token' => $this->getToken()))); + return $url; + } + + /** + * Retrieve reject URL path + * + * @return string + */ + abstract public function getRejectUrlPath(); + + /** + * Get form identity label + * + * @return string + */ + abstract public function getIdentityLabel(); + + /** + * Get form identity label + * + * @return string + */ + abstract public function getFormTitle(); +} diff --git a/app/code/core/Mage/OAuth/Block/Customer/Token/List.php b/app/code/core/Mage/OAuth/Block/Customer/Token/List.php new file mode 100644 index 0000000000..d1cc4f04da --- /dev/null +++ b/app/code/core/Mage/OAuth/Block/Customer/Token/List.php @@ -0,0 +1,172 @@ + + */ +class Mage_OAuth_Block_Customer_Token_List extends Mage_Customer_Block_Account_Dashboard +{ + /** + * Collection model + * + * @var Mage_OAuth_Model_Resource_Token_Collection + */ + protected $_collection; + + /** + * Prepare collection + */ + protected function _construct() + { + /** @var $session Mage_Customer_Model_Session */ + $session = Mage::getSingleton('customer/session'); + + /** @var $collection Mage_OAuth_Model_Resource_Token_Collection */ + $collection = Mage::getModel('oauth/token')->getCollection(); + $collection->joinConsumerAsApplication() + ->addFilterByType(Mage_OAuth_Model_Token::TYPE_ACCESS) + ->addFilterByCustomerId($session->getCustomerId()); + $this->_collection = $collection; + } + + /** + * Get count of total records + * + * @return int + */ + public function count() + { + return $this->_collection->getSize(); + } + + /** + * Get toolbar html + * + * @return string + */ + public function getToolbarHtml() + { + return $this->getChildHtml('toolbar'); + } + + /** + * Prepare layout + * + * @return Mage_OAuth_Block_Customer_Token_List + */ + protected function _prepareLayout() + { + /** @var $toolbar Mage_Page_Block_Html_Pager */ + $toolbar = $this->getLayout()->createBlock('page/html_pager', 'customer_token.toolbar'); + $toolbar->setCollection($this->_collection); + $this->setChild('toolbar', $toolbar); + parent::_prepareLayout(); + return $this; + } + + /** + * Get collection + * + * @return Mage_OAuth_Model_Resource_Token_Collection + */ + public function getCollection() + { + return $this->_collection; + } + + /** + * Get link for update revoke status + * + * @param Mage_OAuth_Model_Token $model + * @return string + */ + public function getUpdateRevokeLink(Mage_OAuth_Model_Token $model) + { + return Mage::getUrl('oauth/customer_token/revoke/', + array('id' => $model->getId(), 'status' => (int) !$model->getRevoked())); + } + + /** + * Get delete link + * + * @param Mage_OAuth_Model_Token $model + * @return string + */ + public function getDeleteLink(Mage_OAuth_Model_Token $model) + { + return Mage::getUrl('oauth/customer_token/delete/', array('id' => $model->getId())); + } + + /** + * Retrieve a token status label + * + * @param int $revokedStatus Token status of revoking + * @return string + */ + public function getStatusLabel($revokedStatus) + { + $labels = array( + $this->__('Enabled'), + $this->__('Disabled') + ); + return $labels[$revokedStatus]; + } + + /** + * Retrieve a label of link to change a token status + * + * @param int $revokedStatus Token status of revoking + * @return string + */ + public function getChangeStatusLabel($revokedStatus) + { + $labels = array( + $this->__('Disable'), + $this->__('Enable') + ); + return $labels[$revokedStatus]; + } + + /** + * Retrieve a message to confirm an action to change a token status + * + * @param int $revokedStatus Token status of revoking + * @return string + */ + public function getChangeStatusConfirmMessage($revokedStatus) + { + $messages = array( + $this->__('Are you sure you want to disable this application?'), + $this->__('Are you sure you want to enable this application?') + ); + return $messages[$revokedStatus]; + } +} diff --git a/app/code/core/Mage/OAuth/Exception.php b/app/code/core/Mage/OAuth/Exception.php new file mode 100644 index 0000000000..972d05bc52 --- /dev/null +++ b/app/code/core/Mage/OAuth/Exception.php @@ -0,0 +1,36 @@ + + */ +class Mage_OAuth_Exception extends Zend_Exception +{ +} diff --git a/app/code/core/Mage/OAuth/Helper/Data.php b/app/code/core/Mage/OAuth/Helper/Data.php new file mode 100644 index 0000000000..6443d9156a --- /dev/null +++ b/app/code/core/Mage/OAuth/Helper/Data.php @@ -0,0 +1,245 @@ + + */ +class Mage_OAuth_Helper_Data extends Mage_Core_Helper_Abstract +{ + /**#@+ + * Endpoint types with appropriate routes + */ + const ENDPOINT_AUTHORIZE_CUSTOMER = 'oauth/authorize'; + const ENDPOINT_AUTHORIZE_ADMIN = 'adminhtml/oAuth_authorize'; + const ENDPOINT_AUTHORIZE_CUSTOMER_SIMPLE = 'oauth/authorize/simple'; + const ENDPOINT_AUTHORIZE_ADMIN_SIMPLE = 'adminhtml/oAuth_authorize/simple'; + const ENDPOINT_INITIATE = 'oauth/initiate'; + const ENDPOINT_TOKEN = 'oauth/token'; + /**#@-*/ + + /**#@+ + * Cleanup xpath config settings + */ + const XML_PATH_CLEANUP_PROBABILITY = 'oauth/cleanup/cleanup_probability'; + const XML_PATH_CLEANUP_EXPIRATION_PERIOD = 'oauth/cleanup/expiration_period'; + /**#@-*/ + + /**#@+ Email template */ + const XML_PATH_EMAIL_TEMPLATE = 'oauth/email/template'; + const XML_PATH_EMAIL_IDENTITY = 'oauth/email/identity'; + /**#@-*/ + + /** + * Cleanup expiration period in minutes + */ + const CLEANUP_EXPIRATION_PERIOD_DEFAULT = 120; + + /** + * Query parameter as a sign that user rejects + */ + const QUERY_PARAM_REJECTED = 'rejected'; + + /** + * Available endpoints list + * + * @var array + */ + protected $_endpoints = array( + self::ENDPOINT_AUTHORIZE_CUSTOMER, + self::ENDPOINT_AUTHORIZE_ADMIN, + self::ENDPOINT_AUTHORIZE_CUSTOMER_SIMPLE, + self::ENDPOINT_AUTHORIZE_ADMIN_SIMPLE, + self::ENDPOINT_INITIATE, + self::ENDPOINT_TOKEN + ); + + /** + * Generate random string for token or secret or verifier + * + * @param int $length String length + * @return string + */ + protected function _generateRandomString($length) + { + /** @var $helper Mage_Core_Helper_Data */ + $helper = Mage::helper('core'); + + return $helper->getRandomString( + $length, Mage_Core_Helper_Data::CHARS_DIGITS . Mage_Core_Helper_Data::CHARS_LOWERS + ); + } + + /** + * Generate random string for token + * + * @return string + */ + public function generateToken() + { + return $this->_generateRandomString(Mage_OAuth_Model_Token::LENGTH_TOKEN); + } + + /** + * Generate random string for token secret + * + * @return string + */ + public function generateTokenSecret() + { + return $this->_generateRandomString(Mage_OAuth_Model_Token::LENGTH_SECRET); + } + + /** + * Generate random string for verifier + * + * @return string + */ + public function generateVerifier() + { + return $this->_generateRandomString(Mage_OAuth_Model_Token::LENGTH_VERIFIER); + } + + /** + * Generate random string for consumer key + * + * @return string + */ + public function generateConsumerKey() + { + return $this->_generateRandomString(Mage_OAuth_Model_Consumer::KEY_LENGTH); + } + + /** + * Generate random string for consumer secret + * + * @return string + */ + public function generateConsumerSecret() + { + return $this->_generateRandomString(Mage_OAuth_Model_Consumer::SECRET_LENGTH); + } + + /** + * Return complete callback URL or boolean FALSE if no callback provided + * + * @param Mage_OAuth_Model_Token $token Token object + * @param bool $rejected OPTIONAL Add user reject sign + * @return bool|string + */ + public function getFullCallbackUrl(Mage_OAuth_Model_Token $token, $rejected = false) + { + $callbackUrl = $token->getCallbackUrl(); + + if (Mage_OAuth_Model_Server::CALLBACK_ESTABLISHED == $callbackUrl) { + return false; + } + if ($rejected) { + /** @var $consumer Mage_OAuth_Model_Consumer */ + $consumer = Mage::getModel('oauth/consumer')->load($token->getConsumerId()); + + if ($consumer->getId() && $consumer->getRejectedCallbackUrl()) { + $callbackUrl = $consumer->getRejectedCallbackUrl(); + } + } elseif (!$token->getAuthorized()) { + Mage::throwException('Token is not authorized'); + } + $callbackUrl .= (false === strpos($callbackUrl, '?') ? '?' : '&'); + $callbackUrl .= 'oauth_token=' . $token->getToken() . '&'; + $callbackUrl .= $rejected ? self::QUERY_PARAM_REJECTED . '=1' : 'oauth_verifier=' . $token->getVerifier(); + + return $callbackUrl; + } + + /** + * Retrieve URL of specified endpoint. + * + * @param string $type Endpoint type (one of ENDPOINT_ constants) + * @return string + * @throws Exception Exception when endpoint not found + */ + public function getProtocolEndpointUrl($type) + { + if (!in_array($type, $this->_endpoints)) { + throw new Exception('Invalid endpoint type passed.'); + } + return rtrim(Mage::getUrl($type), '/'); + } + + /** + * Calculate cleanup possibility for data with lifetime property + * + * @return bool + */ + public function isCleanupProbability() + { + // Safe get cleanup probability value from system configuration + $configValue = (int) Mage::getStoreConfig(self::XML_PATH_CLEANUP_PROBABILITY); + return $configValue > 0 ? 1 == mt_rand(1, $configValue) : false; + } + + /** + * Get cleanup expiration period value from system configuration in minutes + * + * @return int + */ + public function getCleanupExpirationPeriod() + { + $minutes = (int) Mage::getStoreConfig(self::XML_PATH_CLEANUP_EXPIRATION_PERIOD); + return $minutes > 0 ? $minutes : self::CLEANUP_EXPIRATION_PERIOD_DEFAULT; + } + + /** + * Send Email to Token owner + * + * @param string $userEmail + * @param string $userName + * @param string $applicationName + * @param string $status + */ + public function sendNotificationOnTokenStatusChange($userEmail, $userName, $applicationName, $status) + { + /* @var $mailTemplate Mage_Core_Model_Email_Template */ + $mailTemplate = Mage::getModel('core/email_template'); + + $mailTemplate->sendTransactional( + Mage::getStoreConfig(self::XML_PATH_EMAIL_TEMPLATE), + Mage::getStoreConfig(self::XML_PATH_EMAIL_IDENTITY), + $userEmail, + $userName, + array( + 'name' => $userName, + 'email' => $userEmail, + 'applicationName' => $applicationName, + 'status' => $status, + + ) + ); + } +} diff --git a/app/code/core/Mage/OAuth/Model/Consumer.php b/app/code/core/Mage/OAuth/Model/Consumer.php new file mode 100644 index 0000000000..c67a336ef1 --- /dev/null +++ b/app/code/core/Mage/OAuth/Model/Consumer.php @@ -0,0 +1,131 @@ + + * @method Mage_OAuth_Model_Resource_Consumer _getResource() + * @method Mage_OAuth_Model_Resource_Consumer getResource() + * @method Mage_OAuth_Model_Resource_Consumer_Collection getCollection() + * @method Mage_OAuth_Model_Resource_Consumer_Collection getResourceCollection() + * @method string getName() + * @method Mage_OAuth_Model_Consumer setName() setName(string $name) + * @method string getKey() + * @method Mage_OAuth_Model_Consumer setKey() setKey(string $key) + * @method string getSecret() + * @method Mage_OAuth_Model_Consumer setSecret() setSecret(string $secret) + * @method string getCallbackUrl() + * @method Mage_OAuth_Model_Consumer setCallbackUrl() setCallbackUrl(string $url) + * @method string getCreatedAt() + * @method Mage_OAuth_Model_Consumer setCreatedAt() setCreatedAt(string $date) + * @method string getUpdatedAt() + * @method Mage_OAuth_Model_Consumer setUpdatedAt() setUpdatedAt(string $date) + * @method string getRejectedCallbackUrl() + * @method Mage_OAuth_Model_Consumer setRejectedCallbackUrl() setRejectedCallbackUrl(string $rejectedCallbackUrl) + */ +class Mage_OAuth_Model_Consumer extends Mage_Core_Model_Abstract +{ + /** + * Key hash length + */ + const KEY_LENGTH = 32; + + /** + * Secret hash length + */ + const SECRET_LENGTH = 32; + + /** + * Initialize resource model + * + * @return void + */ + protected function _construct() + { + $this->_init('oauth/consumer'); + } + + /** + * BeforeSave actions + * + * @return Mage_OAuth_Model_Consumer + */ + protected function _beforeSave() + { + if (!$this->getId()) { + $this->setUpdatedAt(time()); + } + $this->validate(); + parent::_beforeSave(); + return $this; + } + + /** + * Validate data + * + * @return array|bool + * @throw Mage_Core_Exception|Exception Throw exception on fail validation + */ + public function validate() + { + if ($this->getCallbackUrl() || $this->getRejectedCallbackUrl()) { + $this->setCallbackUrl(trim($this->getCallbackUrl())); + $this->setRejectedCallbackUrl(trim($this->getRejectedCallbackUrl())); + + /** @var $validatorUrl Mage_Core_Model_Url_Validator */ + $validatorUrl = Mage::getSingleton('core/url_validator'); + + if ($this->getCallbackUrl() && !$validatorUrl->isValid($this->getCallbackUrl())) { + Mage::throwException(Mage::helper('oauth')->__('Invalid Callback URL')); + } + if ($this->getRejectedCallbackUrl() && !$validatorUrl->isValid($this->getRejectedCallbackUrl())) { + Mage::throwException(Mage::helper('oauth')->__('Invalid Rejected Callback URL')); + } + } + + /** @var $validatorLength Mage_OAuth_Model_Consumer_Validator_KeyLength */ + $validatorLength = Mage::getModel( + 'oauth/consumer_validator_keyLength', + array('length' => self::KEY_LENGTH)); + + $validatorLength->setName('Consumer Key'); + if (!$validatorLength->isValid($this->getKey())) { + $messages = $validatorLength->getMessages(); + Mage::throwException(array_shift($messages)); + } + + $validatorLength->setLength(self::SECRET_LENGTH); + $validatorLength->setName('Consumer Secret'); + if (!$validatorLength->isValid($this->getSecret())) { + $messages = $validatorLength->getMessages(); + Mage::throwException(array_shift($messages)); + } + return true; + } +} diff --git a/app/code/core/Mage/OAuth/Model/Consumer/Validator/KeyLength.php b/app/code/core/Mage/OAuth/Model/Consumer/Validator/KeyLength.php new file mode 100644 index 0000000000..bee2243f84 --- /dev/null +++ b/app/code/core/Mage/OAuth/Model/Consumer/Validator/KeyLength.php @@ -0,0 +1,157 @@ + + */ +class Mage_OAuth_Model_Consumer_Validator_KeyLength extends Zend_Validate_StringLength +{ + /** + * Key name + * + * @var string + */ + protected $_name = 'Key'; + + /** + * Sets validator options + * + * @param integer|array|Zend_Config $options + */ + public function __construct($options = array()) + { + if (!is_array($options)) { + $options = func_get_args(); + if (!isset($options[1])) { + $options[1] = 'utf-8'; + } + parent::__construct($options[0], $options[0], $options[1]); + return; + } else { + if (isset($options['length'])) { + $options['max'] = + $options['min'] = $options['length']; + } + if (isset($options['name'])) { + $this->_name = $options['name']; + } + } + parent::__construct($options); + } + + /** + * Init validation failure message template definitions + * + * @return Mage_OAuth_Model_Consumer_Validator_KeyLength + */ + protected function _initMessageTemplates() + { + $_messageTemplates[self::TOO_LONG] = + Mage::helper('oauth')->__("%name% '%value%' is too long. It must has length %min% symbols."); + $_messageTemplates[self::TOO_SHORT] = + Mage::helper('oauth')->__("%name% '%value%' is too short. It must has length %min% symbols."); + + return $this; + } + + /** + * Additional variables available for validation failure messages + * + * @var array + */ + protected $_messageVariables = array( + 'min' => '_min', + 'max' => '_max', + 'name' => '_name' + ); + + /** + * Set length + * + * @param $length + * @return Mage_OAuth_Model_Consumer_Validator_KeyLength + */ + public function setLength($length) + { + parent::setMax($length); + parent::setMin($length); + return $this; + } + + /** + * Set length + * + * @return int + */ + public function getLength() + { + return parent::getMin(); + } + + /** + * Defined by Zend_Validate_Interface + * + * Returns true if and only if the string length of $value is at least the min option and + * no greater than the max option (when the max option is not null). + * + * @param string $value + * @return boolean + */ + public function isValid($value) + { + $result = parent::isValid($value); + if (!$result && isset($this->_messages[self::INVALID])) { + throw new Exception($this->_messages[self::INVALID]); + } + return $result; + } + + /** + * Set key name + * + * @param string $name + * @return Mage_OAuth_Model_Consumer_Validator_KeyLength + */ + public function setName($name) + { + $this->_name = $name; + return $this; + } + + /** + * Get key name + * + * @return string + */ + public function getName() + { + return $this->_name; + } +} diff --git a/app/code/core/Mage/OAuth/Model/Nonce.php b/app/code/core/Mage/OAuth/Model/Nonce.php new file mode 100644 index 0000000000..ce92f848c3 --- /dev/null +++ b/app/code/core/Mage/OAuth/Model/Nonce.php @@ -0,0 +1,70 @@ + + * @method string getNonce() + * @method Mage_OAuth_Model_Nonce setNonce() setNonce(string $nonce) + * @method string getTimestamp() + * @method Mage_OAuth_Model_Nonce setTimestamp() setTimestamp(string $timestamp) + * @method Mage_OAuth_Model_Resource_Nonce getResource() + * @method Mage_OAuth_Model_Resource_Nonce _getResource() + */ +class Mage_OAuth_Model_Nonce extends Mage_Core_Model_Abstract +{ + /** + * Initialize resource model + * + * @return void + */ + protected function _construct() + { + $this->_init('oauth/nonce'); + } + + /** + * "After save" actions + * + * @return Mage_OAuth_Model_Nonce + */ + protected function _afterSave() + { + parent::_afterSave(); + + //Cleanup old entries + /** @var $helper Mage_OAuth_Helper_Data */ + $helper = Mage::helper('oauth'); + if ($helper->isCleanupProbability()) { + $this->_getResource()->deleteOldEntries($helper->getCleanupExpirationPeriod()); + } + return $this; + } +} diff --git a/app/code/core/Mage/OAuth/Model/Observer.php b/app/code/core/Mage/OAuth/Model/Observer.php new file mode 100644 index 0000000000..6232a69b2c --- /dev/null +++ b/app/code/core/Mage/OAuth/Model/Observer.php @@ -0,0 +1,131 @@ + + */ +class Mage_OAuth_Model_Observer +{ + /** + * Get callback url + * + * @param string $userType + * @return string + */ + protected function _getAfterAuthUrl($userType) + { + $simple = Mage::app()->getRequest()->getParam('simple'); + + if (Mage_OAuth_Model_Token::USER_TYPE_CUSTOMER == $userType) { + if ($simple) { + $route = Mage_OAuth_Helper_Data::ENDPOINT_AUTHORIZE_CUSTOMER_SIMPLE; + } else { + $route = Mage_OAuth_Helper_Data::ENDPOINT_AUTHORIZE_CUSTOMER; + } + } elseif (Mage_OAuth_Model_Token::USER_TYPE_ADMIN == $userType) { + if ($simple) { + $route = Mage_OAuth_Helper_Data::ENDPOINT_AUTHORIZE_ADMIN_SIMPLE; + } else { + $route = Mage_OAuth_Helper_Data::ENDPOINT_AUTHORIZE_ADMIN; + } + } else { + throw new Exception('Invalid user type.'); + } + + return Mage::getUrl($route, array('_query' => array('oauth_token' => $this->_getOauthToken()))); + } + + /** + * Retrieve oauth_token param from request + * + * @return string|null + */ + protected function _getOauthToken() + { + return Mage::app()->getRequest()->getParam('oauth_token', null); + } + + /** + * Redirect customer to callback page after login success + * + * @param Varien_Event_Observer $observer + * @return void + */ + public function afterCustomerLogin(Varien_Event_Observer $observer) + { + if (null !== $this->_getOauthToken()) { + /** @var $session Mage_Customer_Model_Session */ + $session = Mage::getSingleton('customer/session'); + $session->setAfterAuthUrl($this->_getAfterAuthUrl(Mage_OAuth_Model_Token::USER_TYPE_CUSTOMER)); + } + } + + /** + * Redirect admin to authorize controller after login success + * + * @param Varien_Event_Observer $observer + * @return void + */ + public function afterAdminLogin(Varien_Event_Observer $observer) + { + if (null !== $this->_getOauthToken()) { + $userType = Mage_OAuth_Model_Token::USER_TYPE_ADMIN; + + $url = $this->_getAfterAuthUrl($userType); + Mage::app()->getResponse() + ->setRedirect($url) + ->sendHeaders() + ->sendResponse(); + } + } + + public function afterAdminLoginFailed(Varien_Event_Observer $observer) + { + if (null !== $this->_getOauthToken()) { + /** @var $session Mage_Admin_Model_Session */ + $session = Mage::getSingleton('admin/session'); + $session->addError($observer->getException()->getMessage()); + + $params = array('oauth_token' => $this->_getOauthToken()); + + if (Mage::app()->getRequest()->getParam('simple')) { + $route = Mage_OAuth_Helper_Data::ENDPOINT_AUTHORIZE_ADMIN_SIMPLE; + } else { + $route = Mage_OAuth_Helper_Data::ENDPOINT_AUTHORIZE_ADMIN; + } + $url = Mage::getUrl($route, array('_query' => $params)); + + Mage::app()->getResponse() + ->setRedirect($url) + ->sendHeaders() + ->sendResponse(); + } + } +} diff --git a/app/code/core/Mage/OAuth/Model/Resource/Consumer.php b/app/code/core/Mage/OAuth/Model/Resource/Consumer.php new file mode 100644 index 0000000000..ade3cad2af --- /dev/null +++ b/app/code/core/Mage/OAuth/Model/Resource/Consumer.php @@ -0,0 +1,45 @@ + + */ +class Mage_OAuth_Model_Resource_Consumer extends Mage_Core_Model_Resource_Db_Abstract +{ + /** + * Initialize resource model + * + * @return void + */ + protected function _construct() + { + $this->_init('oauth/consumer', 'entity_id'); + } +} diff --git a/app/code/core/Mage/OAuth/Model/Resource/Consumer/Collection.php b/app/code/core/Mage/OAuth/Model/Resource/Consumer/Collection.php new file mode 100644 index 0000000000..b9e5859e86 --- /dev/null +++ b/app/code/core/Mage/OAuth/Model/Resource/Consumer/Collection.php @@ -0,0 +1,45 @@ + + */ +class Mage_OAuth_Model_Resource_Consumer_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract +{ + /** + * Initialize collection model + * + * @return void + */ + protected function _construct() + { + $this->_init('oauth/consumer'); + } +} diff --git a/app/code/core/Mage/OAuth/Model/Resource/Nonce.php b/app/code/core/Mage/OAuth/Model/Resource/Nonce.php new file mode 100644 index 0000000000..eaa744df57 --- /dev/null +++ b/app/code/core/Mage/OAuth/Model/Resource/Nonce.php @@ -0,0 +1,64 @@ + + */ +class Mage_OAuth_Model_Resource_Nonce extends Mage_Core_Model_Resource_Db_Abstract +{ + /** + * Initialize resource model + * + * @return void + */ + protected function _construct() + { + $this->_init('oauth/nonce', null); + } + + /** + * Delete old entries + * + * @param int $minutes Delete entries older than + * @return int + */ + public function deleteOldEntries($minutes) + { + if ($minutes > 0) { + $adapter = $this->_getWriteAdapter(); + + return $adapter->delete( + $this->getMainTable(), $adapter->quoteInto('timestamp <= ?', time() - $minutes * 60, Zend_Db::INT_TYPE) + ); + } else { + return 0; + } + } +} diff --git a/app/code/core/Mage/OAuth/Model/Resource/Nonce/Collection.php b/app/code/core/Mage/OAuth/Model/Resource/Nonce/Collection.php new file mode 100644 index 0000000000..542e113448 --- /dev/null +++ b/app/code/core/Mage/OAuth/Model/Resource/Nonce/Collection.php @@ -0,0 +1,45 @@ + + */ +class Mage_OAuth_Model_Resource_Nonce_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract +{ + /** + * Initialize collection model + * + * @return void + */ + protected function _construct() + { + $this->_init('oauth/nonce'); + } +} diff --git a/app/code/core/Mage/OAuth/Model/Resource/Setup.php b/app/code/core/Mage/OAuth/Model/Resource/Setup.php new file mode 100644 index 0000000000..facf382388 --- /dev/null +++ b/app/code/core/Mage/OAuth/Model/Resource/Setup.php @@ -0,0 +1,36 @@ + + */ +class Mage_OAuth_Model_Resource_Setup extends Mage_Core_Model_Resource_Setup +{ +} diff --git a/app/code/core/Mage/OAuth/Model/Resource/Token.php b/app/code/core/Mage/OAuth/Model/Resource/Token.php new file mode 100644 index 0000000000..9c16fcfc98 --- /dev/null +++ b/app/code/core/Mage/OAuth/Model/Resource/Token.php @@ -0,0 +1,95 @@ + + */ +class Mage_OAuth_Model_Resource_Token extends Mage_Core_Model_Resource_Db_Abstract +{ + /** + * Initialize resource model + * + * @return void + */ + protected function _construct() + { + $this->_init('oauth/token', 'entity_id'); + } + + /** + * Clean up old authorized tokens for specified consumer-user pairs + * + * @param Mage_OAuth_Model_Token $exceptToken Token just created to exclude from delete + * @return int The number of affected rows + */ + public function cleanOldAuthorizedTokensExcept(Mage_OAuth_Model_Token $exceptToken) + { + if (!$exceptToken->getId() || !$exceptToken->getAuthorized()) { + Mage::throwException('Invalid token to except'); + } + $adapter = $this->_getWriteAdapter(); + $where = $adapter->quoteInto( + 'authorized = 1 AND consumer_id = ?', $exceptToken->getConsumerId(), Zend_Db::INT_TYPE + ); + $where .= $adapter->quoteInto(' AND entity_id <> ?', $exceptToken->getId(), Zend_Db::INT_TYPE); + + if ($exceptToken->getCustomerId()) { + $where .= $adapter->quoteInto(' AND customer_id = ?', $exceptToken->getCustomerId(), Zend_Db::INT_TYPE); + } elseif ($exceptToken->getAdminId()) { + $where .= $adapter->quoteInto(' AND admin_id = ?', $exceptToken->getAdminId(), Zend_Db::INT_TYPE); + } else { + Mage::throwException('Invalid token to except'); + } + return $adapter->delete($this->getMainTable(), $where); + } + + /** + * Delete old entries + * + * @param int $minutes + * @return int + */ + public function deleteOldEntries($minutes) + { + if ($minutes > 0) { + $adapter = $this->_getWriteAdapter(); + + return $adapter->delete( + $this->getMainTable(), + $adapter->quoteInto( + 'type = "' . Mage_OAuth_Model_Token::TYPE_REQUEST . '" AND created_at <= ?', + Varien_Date::formatDate(time() - $minutes * 60) + ) + ); + } else { + return 0; + } + } +} diff --git a/app/code/core/Mage/OAuth/Model/Resource/Token/Collection.php b/app/code/core/Mage/OAuth/Model/Resource/Token/Collection.php new file mode 100644 index 0000000000..418941f8e6 --- /dev/null +++ b/app/code/core/Mage/OAuth/Model/Resource/Token/Collection.php @@ -0,0 +1,136 @@ + + */ +class Mage_OAuth_Model_Resource_Token_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract +{ + /** + * Initialize collection model + * + * @return void + */ + protected function _construct() + { + $this->_init('oauth/token'); + } + + /** + * Load collection with consumer data + * + * Method use for show applications list (token-consumer) + * + * @return Mage_OAuth_Model_Resource_Token_Collection + */ + public function joinConsumerAsApplication() + { + $select = $this->getSelect(); + $select->joinLeft( + array('c' => $this->getTable('oauth/consumer')), + 'c.entity_id = main_table.consumer_id', + 'name' + ); + + return $this; + } + + /** + * Add filter by admin ID + * + * @param int $adminId + * @return Mage_OAuth_Model_Resource_Token_Collection + */ + public function addFilterByAdminId($adminId) + { + $this->addFilter('main_table.admin_id', $adminId); + return $this; + } + + /** + * Add filter by customer ID + * + * @param int $customerId + * @return Mage_OAuth_Model_Resource_Token_Collection + */ + public function addFilterByCustomerId($customerId) + { + $this->addFilter('main_table.customer_id', $customerId); + return $this; + } + + /** + * Add filter by consumer ID + * + * @param int $consumerId + * @return Mage_OAuth_Model_Resource_Token_Collection + */ + public function addFilterByConsumerId($consumerId) + { + $this->addFilter('main_table.consumer_id', $consumerId); + return $this; + } + + /** + * Add filter by type + * + * @param string $type + * @return Mage_OAuth_Model_Resource_Token_Collection + */ + public function addFilterByType($type) + { + $this->addFilter('main_table.type', $type); + return $this; + } + + /** + * Add filter by ID + * + * @param array|int $id + * @return Mage_OAuth_Model_Resource_Token_Collection + */ + public function addFilterById($id) + { + $this->addFilter('main_table.entity_id', array('in' => $id), 'public'); + return $this; + } + + /** + * Add filter by "Is Revoked" status + * + * @param bool|int $flag + * @return Mage_OAuth_Model_Resource_Token_Collection + */ + public function addFilterByRevoked($flag) + { + $this->addFilter('main_table.revoked', (int) $flag, 'public'); + return $this; + } +} diff --git a/app/code/core/Mage/OAuth/Model/Server.php b/app/code/core/Mage/OAuth/Model/Server.php new file mode 100644 index 0000000000..892260ad37 --- /dev/null +++ b/app/code/core/Mage/OAuth/Model/Server.php @@ -0,0 +1,722 @@ + + */ +class Mage_OAuth_Model_Server +{ + /**#@+ + * OAuth result statuses + */ + const ERR_OK = 0; + const ERR_VERSION_REJECTED = 1; + const ERR_PARAMETER_ABSENT = 2; + const ERR_PARAMETER_REJECTED = 3; + const ERR_TIMESTAMP_REFUSED = 4; + const ERR_NONCE_USED = 5; + const ERR_SIGNATURE_METHOD_REJECTED = 6; + const ERR_SIGNATURE_INVALID = 7; + const ERR_CONSUMER_KEY_REJECTED = 8; + const ERR_TOKEN_USED = 9; + const ERR_TOKEN_EXPIRED = 10; + const ERR_TOKEN_REVOKED = 11; + const ERR_TOKEN_REJECTED = 12; + const ERR_VERIFIER_INVALID = 13; + const ERR_PERMISSION_UNKNOWN = 14; + const ERR_PERMISSION_DENIED = 15; + /**#@-*/ + + /**#@+ + * Signature Methods + */ + const SIGNATURE_HMAC = 'HMAC-SHA1'; + const SIGNATURE_RSA = 'RSA-SHA1'; + const SIGNATURE_PLAIN = 'PLAINTEXT'; + /**#@-*/ + + /**#@+ + * Request Types + */ + const REQUEST_INITIATE = 'initiate'; // ask for temporary credentials + const REQUEST_AUTHORIZE = 'authorize'; // display authorize form + const REQUEST_TOKEN = 'token'; // ask for permanent credentials + const REQUEST_RESOURCE = 'resource'; // ask for protected resource using permanent credentials + /**#@-*/ + + /**#@+ + * HTTP Response Codes + */ + const HTTP_OK = 200; + const HTTP_BAD_REQUEST = 400; + const HTTP_UNAUTHORIZED = 401; + const HTTP_INTERNAL_ERROR = 500; + /**#@-*/ + + /** + * Possible time deviation for timestamp validation in sec. + */ + const TIME_DEVIATION = 600; + + /** + * Value of callback URL when it is established or if cliaent is unable to receive callbacks + * + * @link http://tools.ietf.org/html/rfc5849#section-2.1 Requirement in RFC-5849 + */ + const CALLBACK_ESTABLISHED = 'oob'; + + /** + * Consumer object + * + * @var Mage_OAuth_Model_Consumer + */ + protected $_consumer; + + /** + * Error code to error messages pairs + * + * @var array + */ + protected $_errors = array( + self::ERR_VERSION_REJECTED => 'version_rejected', + self::ERR_PARAMETER_ABSENT => 'parameter_absent', + self::ERR_PARAMETER_REJECTED => 'parameter_rejected', + self::ERR_TIMESTAMP_REFUSED => 'timestamp_refused', + self::ERR_NONCE_USED => 'nonce_used', + self::ERR_SIGNATURE_METHOD_REJECTED => 'signature_method_rejected', + self::ERR_SIGNATURE_INVALID => 'signature_invalid', + self::ERR_CONSUMER_KEY_REJECTED => 'consumer_key_rejected', + self::ERR_TOKEN_USED => 'token_used', + self::ERR_TOKEN_EXPIRED => 'token_expired', + self::ERR_TOKEN_REVOKED => 'token_revoked', + self::ERR_TOKEN_REJECTED => 'token_rejected', + self::ERR_VERIFIER_INVALID => 'verifier_invalid', + self::ERR_PERMISSION_UNKNOWN => 'permission_unknown', + self::ERR_PERMISSION_DENIED => 'permission_denied' + ); + + /** + * Error code to HTTP error code + * + * @var array + */ + protected $_errorsToHttpCode = array( + self::ERR_VERSION_REJECTED => self::HTTP_BAD_REQUEST, + self::ERR_PARAMETER_ABSENT => self::HTTP_BAD_REQUEST, + self::ERR_PARAMETER_REJECTED => self::HTTP_BAD_REQUEST, + self::ERR_TIMESTAMP_REFUSED => self::HTTP_BAD_REQUEST, + self::ERR_NONCE_USED => self::HTTP_UNAUTHORIZED, + self::ERR_SIGNATURE_METHOD_REJECTED => self::HTTP_BAD_REQUEST, + self::ERR_SIGNATURE_INVALID => self::HTTP_UNAUTHORIZED, + self::ERR_CONSUMER_KEY_REJECTED => self::HTTP_UNAUTHORIZED, + self::ERR_TOKEN_USED => self::HTTP_UNAUTHORIZED, + self::ERR_TOKEN_EXPIRED => self::HTTP_UNAUTHORIZED, + self::ERR_TOKEN_REVOKED => self::HTTP_UNAUTHORIZED, + self::ERR_TOKEN_REJECTED => self::HTTP_UNAUTHORIZED, + self::ERR_VERIFIER_INVALID => self::HTTP_UNAUTHORIZED, + self::ERR_PERMISSION_UNKNOWN => self::HTTP_UNAUTHORIZED, + self::ERR_PERMISSION_DENIED => self::HTTP_UNAUTHORIZED + ); + + /** + * Request parameters + * + * @var array + */ + protected $_params = array(); + + /** + * Protocol parameters + * + * @var array + */ + protected $_protocolParams = array(); + + /** + * Request object + * + * @var Mage_Core_Controller_Request_Http + */ + protected $_request; + + /** + * Request type: initiate, permanent token request or authorized one + * + * @var string + */ + protected $_requestType; + + /** + * Response object + * + * @var Zend_Controller_Response_Http + */ + protected $_response = null; + + /** + * Token object + * + * @var Mage_OAuth_Model_Token + */ + protected $_token; + + /** + * Internal constructor not depended on params + * + * @param Zend_Controller_Request_Http $request OPTIONAL Request object (If not specified - use singleton) + * @throws Exception + */ + public function __construct($request = null) + { + if (is_object($request)) { + if (!$request instanceof Zend_Controller_Request_Http) { + throw new Exception('Invalid request object passed'); + } + $this->_request = $request; + } else { + $this->_request = Mage::app()->getRequest(); + } + } + + /** + * Retrieve protocol and request parameters from request object + * + * @link http://tools.ietf.org/html/rfc5849#section-3.5 + * @return Mage_OAuth_Model_Server + */ + protected function _fetchParams() + { + $authHeaderValue = $this->_request->getHeader('Authorization'); + + if ($authHeaderValue && 'oauth' === strtolower(substr($authHeaderValue, 0, 5))) { + $authHeaderValue = substr($authHeaderValue, 6); // ignore 'OAuth ' at the beginning + + foreach (explode(',', $authHeaderValue) as $paramStr) { + $nameAndValue = explode('=', trim($paramStr), 2); + + if (count($nameAndValue) < 2) { + continue; + } + if ($this->_isProtocolParameter($nameAndValue[0])) { + $this->_protocolParams[rawurldecode($nameAndValue[0])] = rawurldecode(trim($nameAndValue[1], '"')); + } + } + } + $contentTypeHeader = $this->_request->getHeader(Zend_Http_Client::CONTENT_TYPE); + + if ($contentTypeHeader && 0 === strpos($contentTypeHeader, Zend_Http_Client::ENC_URLENCODED)) { + $protocolParamsNotSet = !$this->_protocolParams; + + parse_str($this->_request->getRawBody(), $bodyParams); + + foreach ($bodyParams as $bodyParamName => $bodyParamValue) { + if (!$this->_isProtocolParameter($bodyParamName)) { + $this->_params[$bodyParamName] = $bodyParamValue; + } elseif ($protocolParamsNotSet) { + $this->_protocolParams[$bodyParamName] = $bodyParamValue; + } + } + } + $protocolParamsNotSet = !$this->_protocolParams; + + $url = $this->_request->getScheme() . '://' . $this->_request->getHttpHost() . $this->_request->getRequestUri(); + + if (($queryString = Zend_Uri_Http::fromString($url)->getQuery())) { + foreach (explode('&', $queryString) as $paramToValue) { + $paramData = explode('=', $paramToValue); + + if (2 === count($paramData) && !$this->_isProtocolParameter($paramData[0])) { + $this->_params[rawurldecode($paramData[0])] = rawurldecode($paramData[1]); + } + } + } + if ($protocolParamsNotSet) { + $this->_fetchProtocolParamsFromQuery(); + } + return $this; + } + + /** + * Retrieve protocol parameters from query string + * + * @return Mage_OAuth_Model_Server + */ + protected function _fetchProtocolParamsFromQuery() + { + foreach ($this->_request->getQuery() as $queryParamName => $queryParamValue) { + if ($this->_isProtocolParameter($queryParamName)) { + $this->_protocolParams[$queryParamName] = $queryParamValue; + } + } + return $this; + } + + /** + * Retrieve response object + * + * @return Zend_Controller_Response_Http + */ + protected function _getResponse() + { + if (null === $this->_response) { + $this->setResponse(Mage::app()->getResponse()); + } + return $this->_response; + } + + /** + * Initialize consumer + * + * @throws Mage_OAuth_Exception + */ + protected function _initConsumer() + { + $this->_consumer = Mage::getModel('oauth/consumer'); + + $this->_consumer->load($this->_protocolParams['oauth_consumer_key'], 'key'); + + if (!$this->_consumer->getId()) { + $this->_throwException('', self::ERR_CONSUMER_KEY_REJECTED); + } + } + + /** + * Load token object, validate it depending on request type, set access data and save + * + * @return Mage_OAuth_Model_Server + * @throws Mage_OAuth_Exception + */ + protected function _initToken() + { + $this->_token = Mage::getModel('oauth/token'); + + if (self::REQUEST_INITIATE != $this->_requestType) { + $this->_validateTokenParam(); + + $this->_token->load($this->_protocolParams['oauth_token'], 'token'); + + if (!$this->_token->getId()) { + $this->_throwException('', self::ERR_TOKEN_REJECTED); + } + if (self::REQUEST_TOKEN == $this->_requestType) { + $this->_validateVerifierParam(); + + if ($this->_token->getVerifier() != $this->_protocolParams['oauth_verifier']) { + $this->_throwException('', self::ERR_VERIFIER_INVALID); + } + if ($this->_token->getConsumerId() != $this->_consumer->getId()) { + $this->_throwException('', self::ERR_TOKEN_REJECTED); + } + if (Mage_OAuth_Model_Token::TYPE_REQUEST != $this->_token->getType()) { + $this->_throwException('', self::ERR_TOKEN_USED); + } + } elseif (self::REQUEST_AUTHORIZE == $this->_requestType) { + if ($this->_token->getAuthorized()) { + $this->_throwException('', self::ERR_TOKEN_USED); + } + } elseif (self::REQUEST_RESOURCE == $this->_requestType) { + if (Mage_OAuth_Model_Token::TYPE_ACCESS != $this->_token->getType()) { + $this->_throwException('', self::ERR_TOKEN_REJECTED); + } + if ($this->_token->getRevoked()) { + $this->_throwException('', self::ERR_TOKEN_REVOKED); + } + //TODO: Implement check for expiration (after it implemented in token model) + } + } else { + $this->_validateCallbackUrlParam(); + } + return $this; + } + + /** + * Is attribute is referred to oAuth protocol? + * + * @param string $attrName + * @return bool + */ + protected function _isProtocolParameter($attrName) + { + return (bool) preg_match('/oauth_[a-z_-]+/', $attrName); + } + + /** + * Extract parameters from sources (GET, FormBody, Authorization header), decode them and validate + * + * @param string $requestType Request type - one of REQUEST_... class constant + * @return Mage_OAuth_Model_Server + * @throws Mage_Core_Exception + */ + protected function _processRequest($requestType) + { + // validate request type to process (AUTHORIZE request is not allowed for method) + if (self::REQUEST_INITIATE != $requestType + && self::REQUEST_RESOURCE != $requestType + && self::REQUEST_TOKEN != $requestType + ) { + Mage::throwException('Invalid request type'); + } + $this->_requestType = $requestType; + + // get parameters from request + $this->_fetchParams(); + + // make generic validation of request parameters + $this->_validateProtocolParams(); + + // initialize consumer + $this->_initConsumer(); + + // initialize token + $this->_initToken(); + + // validate signature + $this->_validateSignature(); + + // save token if signature validation succeed + $this->_saveToken(); + + return $this; + } + + /** + * Save token + */ + protected function _saveToken() + { + if (self::REQUEST_INITIATE == $this->_requestType) { + if (self::CALLBACK_ESTABLISHED == $this->_protocolParams['oauth_callback'] + && $this->_consumer->getCallBackUrl()) { + $callbackUrl = $this->_consumer->getCallBackUrl(); + } else { + $callbackUrl = $this->_protocolParams['oauth_callback']; + } + $this->_token->createRequestToken($this->_consumer->getId(), $callbackUrl); + } elseif (self::REQUEST_TOKEN == $this->_requestType) { + $this->_token->convertToAccess(); + } + } + + /** + * Throw OAuth exception + * + * @param string $message Exception message + * @param int $code Exception code + * @throws Mage_OAuth_Exception + */ + protected function _throwException($message = '', $code = 0) + { + throw Mage::exception('Mage_OAuth', $message, $code); + } + + /** + * Check for 'oauth_callback' parameter + */ + protected function _validateCallbackUrlParam() + { + if (!isset($this->_protocolParams['oauth_callback'])) { + $this->_throwException('oauth_callback', self::ERR_PARAMETER_ABSENT); + } + if (!is_string($this->_protocolParams['oauth_callback'])) { + $this->_throwException('oauth_callback', self::ERR_PARAMETER_REJECTED); + } + if (self::CALLBACK_ESTABLISHED != $this->_protocolParams['oauth_callback'] + && !Zend_Uri::check($this->_protocolParams['oauth_callback']) + ) { + $this->_throwException('oauth_callback', self::ERR_PARAMETER_REJECTED); + } + } + + /** + * Validate nonce request data + * + * @param string $nonce Nonce string + * @param string|int $timestamp UNIX Timestamp + */ + protected function _validateNonce($nonce, $timestamp) + { + $timestamp = (int) $timestamp; + + if ($timestamp <= 0 || $timestamp > (time() + self::TIME_DEVIATION)) { + $this->_throwException('', self::ERR_TIMESTAMP_REFUSED); + } + /** @var $nonceObj Mage_OAuth_Model_Nonce */ + $nonceObj = Mage::getModel('oauth/nonce'); + + $nonceObj->load($nonce, 'nonce'); + + if ($nonceObj->getTimestamp() == $timestamp) { + $this->_throwException('', self::ERR_NONCE_USED); + } + $nonceObj->setNonce($nonce) + ->setTimestamp($timestamp) + ->save(); + } + + /** + * Validate protocol parameters + * + * @throws Mage_OAuth_Exception + */ + protected function _validateProtocolParams() + { + // validate version if specified + if (isset($this->_protocolParams['oauth_version']) && '1.0' != $this->_protocolParams['oauth_version']) { + $this->_throwException('', self::ERR_VERSION_REJECTED); + } + // required parameters validation + foreach (array('oauth_consumer_key', 'oauth_signature_method', 'oauth_signature') as $reqField) { + if (empty($this->_protocolParams[$reqField])) { + $this->_throwException($reqField, self::ERR_PARAMETER_ABSENT); + } + } + // validate parameters type + foreach ($this->_protocolParams as $paramName => $paramValue) { + if (!is_string($paramValue)) { + $this->_throwException($paramName, self::ERR_PARAMETER_REJECTED); + } + } + // validate consumer key length + if (strlen($this->_protocolParams['oauth_consumer_key']) != Mage_OAuth_Model_Consumer::KEY_LENGTH) { + $this->_throwException('', self::ERR_CONSUMER_KEY_REJECTED); + } + // validate signature method + if (!in_array($this->_protocolParams['oauth_signature_method'], self::getSupportedSignatureMethods())) { + $this->_throwException('', self::ERR_SIGNATURE_METHOD_REJECTED); + } + // validate nonce data if signature method is not PLAINTEXT + if (self::SIGNATURE_PLAIN != $this->_protocolParams['oauth_signature_method']) { + if (empty($this->_protocolParams['oauth_nonce'])) { + $this->_throwException('oauth_nonce', self::ERR_PARAMETER_ABSENT); + } + if (empty($this->_protocolParams['oauth_timestamp'])) { + $this->_throwException('oauth_timestamp', self::ERR_PARAMETER_ABSENT); + } + $this->_validateNonce($this->_protocolParams['oauth_nonce'], $this->_protocolParams['oauth_timestamp']); + } + } + + /** + * Validate signature + * + * @throws Mage_OAuth_Exception + */ + protected function _validateSignature() + { + $util = new Zend_Oauth_Http_Utility(); + + $calculatedSign = $util->sign( + array_merge($this->_params, $this->_protocolParams), + $this->_protocolParams['oauth_signature_method'], + $this->_consumer->getSecret(), + $this->_token->getSecret(), + $this->_request->getMethod(), + $this->_request->getScheme() . '://' . $this->_request->getHttpHost() . $this->_request->getRequestUri() + ); + + if ($calculatedSign != $this->_protocolParams['oauth_signature']) { + $this->_throwException($calculatedSign, self::ERR_SIGNATURE_INVALID); + } + } + + /** + * Check for 'oauth_token' parameter + */ + protected function _validateTokenParam() + { + if (empty($this->_protocolParams['oauth_token'])) { + $this->_throwException('oauth_token', self::ERR_PARAMETER_ABSENT); + } + if (!is_string($this->_protocolParams['oauth_token'])) { + $this->_throwException('', self::ERR_TOKEN_REJECTED); + } + if (strlen($this->_protocolParams['oauth_token']) != Mage_OAuth_Model_Token::LENGTH_TOKEN) { + $this->_throwException('', self::ERR_TOKEN_REJECTED); + } + } + + /** + * Check for 'oauth_verifier' parameter + */ + protected function _validateVerifierParam() + { + if (empty($this->_protocolParams['oauth_verifier'])) { + $this->_throwException('oauth_verifier', self::ERR_PARAMETER_ABSENT); + } + if (!is_string($this->_protocolParams['oauth_verifier'])) { + $this->_throwException('', self::ERR_VERIFIER_INVALID); + } + if (strlen($this->_protocolParams['oauth_verifier']) != Mage_OAuth_Model_Token::LENGTH_VERIFIER) { + $this->_throwException('', self::ERR_VERIFIER_INVALID); + } + } + + /** + * Process request for permanent access token + */ + public function accessToken() + { + try { + $this->_processRequest(self::REQUEST_TOKEN); + + $response = $this->_token->toString(); + } catch (Exception $e) { + $response = $this->reportProblem($e); + } + $this->_getResponse()->setBody($response); + } + + /** + * Validate request, authorize token and return it + * + * @param int $userId Authorization user identifier + * @param string $userType Authorization user type + * @return Mage_OAuth_Model_Token + */ + public function authorizeToken($userId, $userType) + { + $token = $this->checkAuthorizeRequest(); + + $token->authorize($userId, $userType); + + return $token; + } + + /** + * Validate request with access token for specified URL + * + * @return Mage_OAuth_Model_Token + */ + public function checkAccessRequest() + { + $this->_processRequest(self::REQUEST_RESOURCE); + + return $this->_token; + } + + /** + * Check authorize request for validity and return token + * + * @return Mage_OAuth_Model_Token + */ + public function checkAuthorizeRequest() + { + if (!$this->_request->isGet()) { + Mage::throwException('Request is not GET'); + } + $this->_requestType = self::REQUEST_AUTHORIZE; + + $this->_fetchProtocolParamsFromQuery(); + $this->_initToken(); + + return $this->_token; + } + + /** + * Retrieve array of supported signature methods + * + * @return array + */ + public static function getSupportedSignatureMethods() + { + return array(self::SIGNATURE_RSA, self::SIGNATURE_HMAC, self::SIGNATURE_PLAIN); + } + + /** + * Process request for temporary (initiative) token + */ + public function initiateToken() + { + try { + $this->_processRequest(self::REQUEST_INITIATE); + + $response = $this->_token->toString() . '&oauth_callback_confirmed=true'; + } catch (Exception $e) { + $response = $this->reportProblem($e); + } + $this->_getResponse()->setBody($response); + } + + /** + * Create response string for problem during request and set HTTP error code + * + * @param Exception $e + * @param Zend_Controller_Response_Http $response OPTIONAL If NULL - will use internal getter + * @return string + */ + public function reportProblem(Exception $e, Zend_Controller_Response_Http $response = null) + { + $eMsg = $e->getMessage(); + + if ($e instanceof Mage_OAuth_Exception) { + $eCode = $e->getCode(); + + if (isset($this->_errors[$eCode])) { + $errorMsg = $this->_errors[$eCode]; + $responseCode = $this->_errorsToHttpCode[$eCode]; + } else { + $errorMsg = 'unknown_problem&code=' . $eCode; + $responseCode = self::HTTP_INTERNAL_ERROR; + } + if (self::ERR_PARAMETER_ABSENT == $eCode) { + $errorMsg .= '&oauth_parameters_absent=' . $eMsg; + } elseif (self::ERR_SIGNATURE_INVALID == $eCode) { + $errorMsg .= '&debug_sbs=' . $eMsg; + } elseif ($eMsg) { + $errorMsg .= '&message=' . $eMsg; + } + } else { + $errorMsg = 'internal_error&message=' . ($eMsg ? $eMsg : 'empty_message'); + $responseCode = self::HTTP_INTERNAL_ERROR; + } + if (!$response) { + $response = $this->_getResponse(); + } + $response->setHttpResponseCode($responseCode); + + return 'oauth_problem=' . $errorMsg; + } + + /** + * Set response object + * + * @param Zend_Controller_Response_Http $response + * @return Mage_OAuth_Model_Server + */ + public function setResponse(Zend_Controller_Response_Http $response) + { + $this->_response = $response; + + $this->_response->setHeader(Zend_Http_Client::CONTENT_TYPE, Zend_Http_Client::ENC_URLENCODED, true); + $this->_response->setHttpResponseCode(self::HTTP_OK); + + return $this; + } +} diff --git a/app/code/core/Mage/OAuth/Model/Token.php b/app/code/core/Mage/OAuth/Model/Token.php new file mode 100644 index 0000000000..404e9cb00a --- /dev/null +++ b/app/code/core/Mage/OAuth/Model/Token.php @@ -0,0 +1,297 @@ + + * @method string getName() Consumer name (joined from consumer table) + * @method Mage_OAuth_Model_Resource_Token_Collection getCollection() + * @method Mage_OAuth_Model_Resource_Token_Collection getResourceCollection() + * @method Mage_OAuth_Model_Resource_Token getResource() + * @method Mage_OAuth_Model_Resource_Token _getResource() + * @method int getConsumerId() + * @method Mage_OAuth_Model_Token setConsumerId() setConsumerId(int $consumerId) + * @method int getAdminId() + * @method Mage_OAuth_Model_Token setAdminId() setAdminId(int $adminId) + * @method int getCustomerId() + * @method Mage_OAuth_Model_Token setCustomerId() setCustomerId(int $customerId) + * @method string getType() + * @method Mage_OAuth_Model_Token setType() setType(string $type) + * @method string getVerifier() + * @method Mage_OAuth_Model_Token setVerifier() setVerifier(string $verifier) + * @method string getCallbackUrl() + * @method Mage_OAuth_Model_Token setCallbackUrl() setCallbackUrl(string $callbackUrl) + * @method string getCreatedAt() + * @method Mage_OAuth_Model_Token setCreatedAt() setCreatedAt(string $createdAt) + * @method string getToken() + * @method Mage_OAuth_Model_Token setToken() setToken(string $token) + * @method string getSecret() + * @method Mage_OAuth_Model_Token setSecret() setSecret(string $tokenSecret) + * @method int getRevoked() + * @method Mage_OAuth_Model_Token setRevoked() setRevoked(int $revoked) + * @method int getAuthorized() + * @method Mage_OAuth_Model_Token setAuthorized() setAuthorized(int $authorized) + */ +class Mage_OAuth_Model_Token extends Mage_Core_Model_Abstract +{ + /**#@+ + * Token types + */ + const TYPE_REQUEST = 'request'; + const TYPE_ACCESS = 'access'; + /**#@- */ + + /**#@+ + * Lengths of token fields + */ + const LENGTH_TOKEN = 32; + const LENGTH_SECRET = 32; + const LENGTH_VERIFIER = 32; + /**#@- */ + + /**#@+ + * Customer types + */ + const USER_TYPE_ADMIN = 'admin'; + const USER_TYPE_CUSTOMER = 'customer'; + /**#@- */ + + /** + * Initialize resource model + * + * @return void + */ + protected function _construct() + { + $this->_init('oauth/token'); + } + + /** + * "After save" actions + * + * @return Mage_OAuth_Model_Token + */ + protected function _afterSave() + { + parent::_afterSave(); + + //Cleanup old entries + /** @var $helper Mage_OAuth_Helper_Data */ + $helper = Mage::helper('oauth'); + if ($helper->isCleanupProbability()) { + $this->_getResource()->deleteOldEntries($helper->getCleanupExpirationPeriod()); + } + return $this; + } + + /** + * Authorize token + * + * @param int $userId Authorization user identifier + * @param string $userType Authorization user type + * @return Mage_OAuth_Model_Token + */ + public function authorize($userId, $userType) + { + if (!$this->getId() || !$this->getConsumerId()) { + Mage::throwException('Token is not ready to be authorized'); + } + if ($this->getAuthorized()) { + Mage::throwException('Token is already authorized'); + } + if (self::USER_TYPE_ADMIN == $userType) { + $this->setAdminId($userId); + } elseif (self::USER_TYPE_CUSTOMER == $userType) { + $this->setCustomerId($userId); + } else { + Mage::throwException('User type is unknown'); + } + /** @var $helper Mage_OAuth_Helper_Data */ + $helper = Mage::helper('oauth'); + + $this->setVerifier($helper->generateVerifier()); + $this->setAuthorized(1); + $this->save(); + + $this->getResource()->cleanOldAuthorizedTokensExcept($this); + + return $this; + } + + /** + * Convert token to access type + * + * @return Mage_OAuth_Model_Token + */ + public function convertToAccess() + { + if (Mage_OAuth_Model_Token::TYPE_REQUEST != $this->getType()) { + Mage::throwException('Can not convert due to token is not request type'); + } + /** @var $helper Mage_OAuth_Helper_Data */ + $helper = Mage::helper('oauth'); + + $this->setType(self::TYPE_ACCESS); + $this->setToken($helper->generateToken()); + $this->setSecret($helper->generateTokenSecret()); + $this->save(); + + return $this; + } + + /** + * Generate and save request token + * + * @param int $consumerId Consumer identifier + * @param string $callbackUrl Callback URL + * @return Mage_OAuth_Model_Token + */ + public function createRequestToken($consumerId, $callbackUrl) + { + /** @var $helper Mage_OAuth_Helper_Data */ + $helper = Mage::helper('oauth'); + + $this->setData(array( + 'consumer_id' => $consumerId, + 'type' => self::TYPE_REQUEST, + 'token' => $helper->generateToken(), + 'secret' => $helper->generateTokenSecret(), + 'callback_url' => $callbackUrl + )); + $this->save(); + + return $this; + } + + /** + * Get OAuth user type + * + * @return string + * @throws Exception + */ + public function getUserType() + { + if ($this->getAdminId()) { + return self::USER_TYPE_ADMIN; + } elseif ($this->getCustomerId()) { + return self::USER_TYPE_CUSTOMER; + } else { + Mage::throwException('User type is unknown'); + } + } + + /** + * Get string representation of token + * + * @param string $format + * @return string + */ + public function toString($format = '') + { + return http_build_query(array('oauth_token' => $this->getToken(), 'oauth_token_secret' => $this->getSecret())); + } + + /** + * Before save actions + * + * @return Mage_OAuth_Model_Consumer + */ + protected function _beforeSave() + { + $this->validate(); + + if ($this->isObjectNew() && null === $this->getCreatedAt()) { + $this->setCreatedAt(Varien_Date::now()); + } + parent::_beforeSave(); + return $this; + } + + /** + * Validate data + * + * @return array|bool + * @throw Mage_Core_Exception|Exception Throw exception on fail validation + */ + public function validate() + { + /** @var $validatorUrl Mage_Core_Model_Url_Validator */ + $validatorUrl = Mage::getSingleton('core/url_validator'); + if (Mage_OAuth_Model_Server::CALLBACK_ESTABLISHED != $this->getCallbackUrl() + && !$validatorUrl->isValid($this->getCallbackUrl()) + ) { + $messages = $validatorUrl->getMessages(); + Mage::throwException(array_shift($messages)); + } + + /** @var $validatorLength Mage_OAuth_Model_Consumer_Validator_KeyLength */ + $validatorLength = Mage::getModel( + 'oauth/consumer_validator_keyLength'); + $validatorLength->setLength(self::LENGTH_SECRET); + $validatorLength->setName('Token Secret Key'); + if (!$validatorLength->isValid($this->getSecret())) { + $messages = $validatorLength->getMessages(); + Mage::throwException(array_shift($messages)); + } + + $validatorLength->setLength(self::LENGTH_TOKEN); + $validatorLength->setName('Token Key'); + if (!$validatorLength->isValid($this->getToken())) { + $messages = $validatorLength->getMessages(); + Mage::throwException(array_shift($messages)); + } + + if (null !== ($verifier = $this->getVerifier())) { + $validatorLength->setLength(self::LENGTH_VERIFIER); + $validatorLength->setName('Verifier Key'); + if (!$validatorLength->isValid($verifier)) { + $messages = $validatorLength->getMessages(); + Mage::throwException(array_shift($messages)); + } + } + return true; + } + + /** + * Get Token Consumer + * + * @return Mage_OAuth_Model_Consumer + */ + public function getConsumer() + { + if (!$this->getData('consumer')) { + /** @var $consumer Mage_OAuth_Model_Consumer */ + $consumer = Mage::getModel('oauth/consumer'); + $consumer->load($this->getConsumerId()); + $this->setData('consumer', $consumer); + } + + return $this->getData('consumer'); + } +} diff --git a/app/code/core/Mage/OAuth/controllers/Adminhtml/OAuth/Admin/TokenController.php b/app/code/core/Mage/OAuth/controllers/Adminhtml/OAuth/Admin/TokenController.php new file mode 100644 index 0000000000..4e6a080454 --- /dev/null +++ b/app/code/core/Mage/OAuth/controllers/Adminhtml/OAuth/Admin/TokenController.php @@ -0,0 +1,174 @@ + + */ +class Mage_OAuth_Adminhtml_OAuth_Admin_TokenController extends Mage_Adminhtml_Controller_Action +{ + /** + * Init titles + * + * @return Mage_OAuth_Adminhtml_OAuth_Admin_TokenController + */ + public function preDispatch() + { + $this->_title($this->__('System')) + ->_title($this->__('Permissions')) + ->_title($this->__('My Applications')); + parent::preDispatch(); + return $this; + } + + /** + * Render grid page + */ + public function indexAction() + { + $this->loadLayout(); + $this->renderLayout(); + } + + /** + * Render grid AJAX request + */ + public function gridAction() + { + $this->loadLayout(); + $this->renderLayout(); + } + + /** + * Update revoke status action + */ + public function revokeAction() + { + $ids = $this->getRequest()->getParam('items'); + $status = $this->getRequest()->getParam('status'); + + if (!is_array($ids) || !$ids) { + // No rows selected + $this->_getSession()->addError($this->__('Please select needed row(s).')); + $this->_redirect('*/*/index'); + return; + } + + if (null === $status) { + // No status selected + $this->_getSession()->addError($this->__('Please select revoke status.')); + $this->_redirect('*/*/index'); + return; + } + + try { + /** @var $user Mage_Admin_Model_User */ + $user = Mage::getSingleton('admin/session')->getData('user'); + + /** @var $collection Mage_OAuth_Model_Resource_Token_Collection */ + $collection = Mage::getModel('oauth/token')->getCollection(); + $collection->joinConsumerAsApplication() + ->addFilterByAdminId($user->getId()) + ->addFilterByType(Mage_OAuth_Model_Token::TYPE_ACCESS) + ->addFilterById($ids) + ->addFilterByRevoked(!$status); + + /** @var $item Mage_OAuth_Model_Token */ + foreach ($collection as $item) { + $item->load($item->getId()); + $item->setRevoked($status)->save(); + } + if ($status) { + $message = $this->__('Selected entries revoked.'); + } else { + $message = $this->__('Selected entries enabled.'); + } + $this->_getSession()->addSuccess($message); + } catch (Mage_Core_Exception $e) { + $this->_getSession()->addError($e->getMessage()); + } catch (Exception $e) { + $this->_getSession()->addError($this->__('An error occurred on update revoke status.')); + Mage::logException($e); + } + $this->_redirect('*/*/index'); + } + + /** + * Delete action + */ + public function deleteAction() + { + $ids = $this->getRequest()->getParam('items'); + + if (!is_array($ids) || !$ids) { + // No rows selected + $this->_getSession()->addError($this->__('Please select needed row(s).')); + $this->_redirect('*/*/index'); + return; + } + + try { + /** @var $user Mage_Admin_Model_User */ + $user = Mage::getSingleton('admin/session')->getData('user'); + + /** @var $collection Mage_OAuth_Model_Resource_Token_Collection */ + $collection = Mage::getModel('oauth/token')->getCollection(); + $collection->joinConsumerAsApplication() + ->addFilterByAdminId($user->getId()) + ->addFilterByType(Mage_OAuth_Model_Token::TYPE_ACCESS) + ->addFilterById($ids); + + /** @var $item Mage_OAuth_Model_Token */ + foreach ($collection as $item) { + $item->delete(); + } + $this->_getSession()->addSuccess($this->__('Selected entries has been deleted.')); + } catch (Mage_Core_Exception $e) { + $this->_getSession()->addError($e->getMessage()); + } catch (Exception $e) { + $this->_getSession()->addError($this->__('An error occurred on delete action.')); + Mage::logException($e); + } + $this->_redirect('*/*/index'); + } + + /** + * Check admin permissions for this controller + * + * @return boolean + */ + protected function _isAllowed() + { + /** @var $session Mage_Admin_Model_Session */ + $session = Mage::getSingleton('admin/session'); + return $session->isAllowed('system/acl/admin_token'); + } +} diff --git a/app/code/core/Mage/OAuth/controllers/Adminhtml/OAuth/AuthorizeController.php b/app/code/core/Mage/OAuth/controllers/Adminhtml/OAuth/AuthorizeController.php new file mode 100644 index 0000000000..0fad0ac13e --- /dev/null +++ b/app/code/core/Mage/OAuth/controllers/Adminhtml/OAuth/AuthorizeController.php @@ -0,0 +1,264 @@ + + */ +class Mage_OAuth_Adminhtml_OAuth_AuthorizeController extends Mage_Adminhtml_Controller_Action +{ + /** + * Session name + * + * @var string + */ + protected $_sessionName = 'admin/session'; + + /** + * Array of actions which can be processed without secret key validation + * + * @var array + */ + public $_publicActions = array('index', 'simple', 'confirm', 'confirmSimple','reject', 'rejectSimple'); + + /** + * Disable showing of login form + * + * @see Mage_Admin_Model_Observer::actionPreDispatchAdmin() method for explanation + * @return void + */ + public function preDispatch() + { + $this->getRequest()->setParam('forwarded', true); + parent::preDispatch(); + } + + /** + * Index action. + * + * @return void + */ + public function indexAction() + { + $this->_initForm(); + + $this->_initLayoutMessages($this->_sessionName); + $this->renderLayout(); + } + + /** + * Index action with a simple design + * + * @return void + */ + public function simpleAction() + { + $this->_initForm(true); + $this->_initLayoutMessages($this->_sessionName); + $this->renderLayout(); + } + + /** + * Init authorize page + * + * @param bool $simple + * @return Mage_OAuth_Adminhtml_OAuth_AuthorizeController + */ + protected function _initForm($simple = false) + { + /** @var $server Mage_OAuth_Model_Server */ + $server = Mage::getModel('oauth/server'); + /** @var $session Mage_Admin_Model_Session */ + $session = Mage::getSingleton($this->_sessionName); + + $isException = false; + try { + $server->checkAuthorizeRequest(); + } catch (Mage_Core_Exception $e) { + $session->addError($e->getMessage()); + } catch (Mage_OAuth_Exception $e) { + $isException = true; + $session->addException($e, $this->__('An error occurred. Your authorization request is invalid.')); + } catch (Exception $e) { + $isException = true; + $session->addException($e, $this->__('An error occurred.')); + } + + $this->loadLayout(); + $layout = $this->getLayout(); + $logged = $session->isLoggedIn(); + + $contentBlock = $layout->getBlock('content'); + if ($logged) { + $contentBlock->unsetChild('oauth.authorize.form'); + /** @var $block Mage_OAuth_Block_Adminhtml_OAuth_Authorize_Button */ + $block = $contentBlock->getChild('oauth.authorize.button'); + } else { + $contentBlock->unsetChild('oauth.authorize.button'); + /** @var $block Mage_OAuth_Block_Adminhtml_OAuth_Authorize */ + $block = $contentBlock->getChild('oauth.authorize.form'); + } + + if ($simple) { + /** @var $style Mage_OAuth_Block_Authorize_Style */ + $style = $layout->getBlock('oauth.authorize.style'); + $style->setIsLogged($logged); + } + + $block->setIsSimple($simple) + ->setToken($this->getRequest()->getQuery('oauth_token')) + ->setHasException($isException); + return $this; + } + + /** + * Init confirm page + * + * @param bool $simple + * @return Mage_OAuth_Adminhtml_OAuth_AuthorizeController + */ + protected function _initConfirmPage($simple = false) + { + /** @var $session Mage_Admin_Model_Session */ + $session = Mage::getSingleton($this->_sessionName); + + /** @var $server Mage_OAuth_Model_Server */ + $server = Mage::getModel('oauth/server'); + + $this->loadLayout(); + + /** @var $block Mage_OAuth_Block_Adminhtml_OAuth_Authorize */ + $block = $this->getLayout()->getBlock('content')->getChild('oauth.authorize.confirm'); + $block->setIsSimple($simple); + + try { + /** @var $user Mage_Admin_Model_User */ + $user = $session->getData('user'); + $token = $server->authorizeToken($user->getId(), Mage_OAuth_Model_Token::USER_TYPE_ADMIN); + + /** @var $helper Mage_OAuth_Helper_Data */ + $helper = Mage::helper('oauth'); + + if (($callback = $helper->getFullCallbackUrl($token))) { //false in case of OOB + $this->getResponse()->setRedirect($callback . ($simple ? '&simple=1' : '')); + return $this; + } else { + $session->addSuccess($this->__('Authorization confirmed.')); + $block->setVerifier($token->getVerifier()); + } + } catch (Mage_Core_Exception $e) { + $block->setHasException(true); + $session->addError($e->getMessage()); + } catch (Exception $e) { + $block->setHasException(true); + $session->addException($e, $this->__('An error occurred on confirm authorize.')); + } + + $this->_initLayoutMessages($this->_sessionName); + $this->renderLayout(); + + return $this; + } + + /** + * Init reject page + * + * @param bool $simple + * @return Mage_OAuth_AuthorizeController + */ + protected function _initRejectPage($simple = false) + { + /** @var $server Mage_OAuth_Model_Server */ + $server = Mage::getModel('oauth/server'); + + /** @var $session Mage_Admin_Model_Session */ + $session = Mage::getSingleton($this->_sessionName); + + $this->loadLayout(); + + /** @var $block Mage_OAuth_Block_Authorize */ + $block = $this->getLayout()->getBlock('oauth.authorize.reject'); + $block->setIsSimple($simple); + + try { + $token = $server->checkAuthorizeRequest(); + /** @var $helper Mage_OAuth_Helper_Data */ + $helper = Mage::helper('oauth'); + + if (($callback = $helper->getFullCallbackUrl($token, true))) { + $this->_redirectUrl($callback . ($simple ? '&simple=1' : '')); + return $this; + } else { + $session->addNotice($this->__('The application access request is rejected.')); + } + } catch (Mage_Core_Exception $e) { + $session->addError($e->getMessage()); + } catch (Exception $e) { + $session->addException($e, $this->__('An error occurred on reject authorize.')); + } + + //display exception + $this->_initLayoutMessages($this->_sessionName); + $this->renderLayout(); + + return $this; + } + + /** + * Confirm token authorization action + */ + public function confirmAction() + { + $this->_initConfirmPage(); + } + + /** + * Confirm token authorization simple page + */ + public function confirmSimpleAction() + { + $this->_initConfirmPage(); + } + + /** + * Reject token authorization action + */ + public function rejectAction() + { + $this->_initRejectPage(); + } + + /** + * Reject token authorization simple page + */ + public function rejectSimpleAction() + { + $this->_initRejectPage(); + } +} diff --git a/app/code/core/Mage/OAuth/controllers/Adminhtml/OAuth/AuthorizedTokensController.php b/app/code/core/Mage/OAuth/controllers/Adminhtml/OAuth/AuthorizedTokensController.php new file mode 100644 index 0000000000..3252bf0ddd --- /dev/null +++ b/app/code/core/Mage/OAuth/controllers/Adminhtml/OAuth/AuthorizedTokensController.php @@ -0,0 +1,203 @@ + + */ +class Mage_OAuth_Adminhtml_OAuth_AuthorizedTokensController extends Mage_Adminhtml_Controller_Action +{ + /** + * Init titles + * + * @return Mage_OAuth_Adminhtml_OAuth_AuthorizedTokensController + */ + public function preDispatch() + { + $this->_title($this->__('System')) + ->_title($this->__('OAuth')) + ->_title($this->__('Authorized Tokens')); + parent::preDispatch(); + return $this; + } + + /** + * Render grid page + */ + public function indexAction() + { + $this->loadLayout()->_setActiveMenu('system/oauth'); + $this->renderLayout(); + } + + /** + * Render grid AJAX request + */ + public function gridAction() + { + $this->loadLayout(); + $this->renderLayout(); + } + + /** + * Update revoke status action + */ + public function revokeAction() + { + $ids = $this->getRequest()->getParam('items'); + $status = $this->getRequest()->getParam('status'); + + if (!is_array($ids) || !$ids) { + // No rows selected + $this->_getSession()->addError($this->__('Please select needed row(s).')); + $this->_redirect('*/*/index'); + return; + } + + if (null === $status) { + // No status selected + $this->_getSession()->addError($this->__('Please select revoke status.')); + $this->_redirect('*/*/index'); + return; + } + + try { + /** @var $collection Mage_OAuth_Model_Resource_Token_Collection */ + $collection = Mage::getModel('oauth/token')->getCollection(); + $collection->joinConsumerAsApplication() + ->addFilterByType(Mage_OAuth_Model_Token::TYPE_ACCESS) + ->addFilterById($ids) + ->addFilterByRevoked(!$status); + + /** @var $item Mage_OAuth_Model_Token */ + foreach ($collection as $item) { + $item->load($item->getId()); + $item->setRevoked($status)->save(); + + $this->_sendTokenStatusChangeNotification($item, $status ? $this->__('revoked') : $this->__('enabled')); + } + if ($status) { + $message = $this->__('Selected entries revoked.'); + } else { + $message = $this->__('Selected entries enabled.'); + } + $this->_getSession()->addSuccess($message); + } catch (Mage_Core_Exception $e) { + $this->_getSession()->addError($e->getMessage()); + } catch (Exception $e) { + $this->_getSession()->addError($this->__('An error occurred on update revoke status.')); + Mage::logException($e); + } + $this->_redirect('*/*/index'); + } + + /** + * Delete action + */ + public function deleteAction() + { + $ids = $this->getRequest()->getParam('items'); + + if (!is_array($ids) || !$ids) { + // No rows selected + $this->_getSession()->addError($this->__('Please select needed row(s).')); + $this->_redirect('*/*/index'); + return; + } + + try { + /** @var $collection Mage_OAuth_Model_Resource_Token_Collection */ + $collection = Mage::getModel('oauth/token')->getCollection(); + $collection->joinConsumerAsApplication() + ->addFilterByType(Mage_OAuth_Model_Token::TYPE_ACCESS) + ->addFilterById($ids); + + /** @var $item Mage_OAuth_Model_Token */ + foreach ($collection as $item) { + $item->delete(); + + $this->_sendTokenStatusChangeNotification($item, $this->__('deleted')); + } + $this->_getSession()->addSuccess($this->__('Selected entries has been deleted.')); + } catch (Mage_Core_Exception $e) { + $this->_getSession()->addError($e->getMessage()); + } catch (Exception $e) { + $this->_getSession()->addError($this->__('An error occurred on delete action.')); + Mage::logException($e); + } + $this->_redirect('*/*/index'); + } + + /** + * Check admin permissions for this controller + * + * @return boolean + */ + protected function _isAllowed() + { + /** @var $session Mage_Admin_Model_Session */ + $session = Mage::getSingleton('admin/session'); + return $session->isAllowed('system/oauth/authorizedTokens'); + } + + /** + * Send email notification to user about token status change + * + * @param Mage_OAuth_Model_Token $token Token object + * @param string $newStatus Name of new token status + */ + protected function _sendTokenStatusChangeNotification($token, $newStatus) + { + if (($adminId = $token->getAdminId())) { + /** @var $session Mage_Admin_Model_Session */ + $session = Mage::getSingleton('admin/session'); + + /** @var $admin Mage_Admin_Model_User */ + $admin = $session->getUser(); + + if ($admin->getId() == $adminId) { // skip own tokens + return; + } + $email = $admin->getEmail(); + $name = $admin->getName(' '); + } else { + /** @var $customer Mage_Customer_Model_Customer */ + $customer = Mage::getModel('customer/customer'); + + $customer->load($token->getCustomerId()); + + $email = $customer->getEmail(); + $name = $customer->getName(); + } + /** @var $helper Mage_OAuth_Helper_Data */ + $helper = Mage::helper('oauth'); + + $helper->sendNotificationOnTokenStatusChange($email, $name, $token->getConsumer()->getName(), $newStatus); + } +} diff --git a/app/code/core/Mage/OAuth/controllers/Adminhtml/OAuth/ConsumerController.php b/app/code/core/Mage/OAuth/controllers/Adminhtml/OAuth/ConsumerController.php new file mode 100644 index 0000000000..f1760c205f --- /dev/null +++ b/app/code/core/Mage/OAuth/controllers/Adminhtml/OAuth/ConsumerController.php @@ -0,0 +1,288 @@ + + */ +class Mage_OAuth_Adminhtml_OAuth_ConsumerController extends Mage_Adminhtml_Controller_Action +{ + /** + * Unset unused data from request + * Skip getting "key" and "secret" because its generated from server side only + * + * @param array $data + * @return array + */ + protected function _filter(array $data) + { + foreach (array('id', 'back', 'form_key', 'key', 'secret') as $field) { + if (isset($data[$field])) { + unset($data[$field]); + } + } + return $data; + } + + /** + * Init titles + * + * @return Mage_OAuth_Adminhtml_OAuth_ConsumerController + */ + public function preDispatch() + { + $this->_title($this->__('System')) + ->_title($this->__('OAuth')) + ->_title($this->__('Consumers')); + parent::preDispatch(); + return $this; + } + + /** + * Render grid page + */ + public function indexAction() + { + $this->loadLayout(); + $this->renderLayout(); + } + + /** + * Render grid AJAX request + */ + public function gridAction() + { + $this->loadLayout(); + $this->renderLayout(); + } + + /** + * Create page action + */ + public function newAction() + { + /** @var $model Mage_OAuth_Model_Consumer */ + $model = Mage::getModel('oauth/consumer'); + + $formData = $this->_getFormData(); + if ($formData) { + $this->_setFormData($formData); + $model->addData($formData); + } else { + /** @var $helper Mage_OAuth_Helper_Data */ + $helper = Mage::helper('oauth'); + $model->setKey($helper->generateConsumerKey()); + $model->setSecret($helper->generateConsumerSecret()); + $this->_setFormData($model->getData()); + } + + Mage::register('current_consumer', $model); + + $this->loadLayout(); + $this->renderLayout(); + } + + /** + * Edit page action + */ + public function editAction() + { + $id = (int) $this->getRequest()->getParam('id'); + + if (!$id) { + $this->_getSession()->addError(Mage::helper('oauth')->__('Invalid ID parameter.')); + $this->_redirect('*/*/index'); + return; + } + + /** @var $model Mage_OAuth_Model_Consumer */ + $model = Mage::getModel('oauth/consumer'); + $model->load($id); + + if (!$model->getId()) { + $this->_getSession()->addError(Mage::helper('oauth')->__('Entry with ID #%s not found.', $id)); + $this->_redirect('*/*/index'); + return; + } + + $model->addData($this->_filter($this->getRequest()->getParams())); + Mage::register('current_consumer', $model); + + $this->loadLayout(); + $this->renderLayout(); + } + + /** + * Render edit page + */ + public function saveAction() + { + $id = $this->getRequest()->getParam('id'); + if (!$this->_validateFormKey()) { + if ($id) { + $this->_redirect('*/*/edit', array('id' => $id)); + } else { + $this->_redirect('*/*/new', array('id' => $id)); + } + return; + } + + $data = $this->_filter($this->getRequest()->getParams()); + + /** @var $model Mage_OAuth_Model_Consumer */ + $model = Mage::getModel('oauth/consumer'); + + if ($id) { + if (!(int) $id) { + $this->_getSession()->addError( + $this->__('Invalid ID parameter.')); + $this->_redirect('*/*/index'); + return; + } + $model->load($id); + + if (!$model->getId()) { + $this->_getSession()->addError( + $this->__('Entry with ID #%s not found.', $id)); + $this->_redirect('*/*/index'); + return; + } + } else { + $dataForm = $this->_getFormData(); + if ($dataForm) { + $data['key'] = $dataForm['key']; + $data['secret'] = $dataForm['secret']; + } else { + // If an admin was started create a new consumer and at this moment he has been edited an existing + // consumer, we save the new consumer with a new key-secret pair + /** @var $helper Mage_OAuth_Helper_Data */ + $helper = Mage::helper('oauth'); + + $data['key'] = $helper->generateConsumerKey(); + $data['secret'] = $helper->generateConsumerSecret(); + } + } + + try { + $model->addData($data); + $model->save(); + $this->_getSession()->addSuccess($this->__('The consumer has been saved.')); + $this->_setFormData(null); + } catch (Mage_Core_Exception $e) { + $this->_setFormData($data); + $this->_getSession()->addError(Mage::helper('core')->escapeHtml($e->getMessage())); + $this->getRequest()->setParam('back', 'edit'); + } catch (Exception $e) { + $this->_setFormData(null); + Mage::logException($e); + $this->_getSession()->addError($this->__('An error occurred on saving consumer data.')); + } + + if ($this->getRequest()->getParam('back')) { + if ($id || $model->getId()) { + $this->_redirect('*/*/edit', array('id' => $model->getId())); + } else { + $this->_redirect('*/*/new'); + } + } else { + $this->_redirect('*/*/index'); + } + } + + /** + * Check admin permissions for this controller + * + * @return boolean + */ + protected function _isAllowed() + { + $action = $this->getRequest()->getActionName(); + if ('index' == $action) { + $action = null; + } else { + if ('new' == $action || 'save' == $action) { + $action = 'edit'; + } + $action = '/' . $action; + } + /** @var $session Mage_Admin_Model_Session */ + $session = Mage::getSingleton('admin/session'); + return $session->isAllowed('system/oauth/consumer' . $action); + } + + /** + * Get form data + * + * @return array + */ + protected function _getFormData() + { + return $this->_getSession()->getData('consumer_data', true); + } + + /** + * Set form data + * + * @param $data + * @return Mage_OAuth_Adminhtml_OAuth_ConsumerController + */ + protected function _setFormData($data) + { + $this->_getSession()->setData('consumer_data', $data); + return $this; + } + + /** + * Delete consumer action + */ + public function deleteAction() + { + $consumerId = (int) $this->getRequest()->getParam('id'); + if ($consumerId) { + try { + /** @var $consumer Mage_OAuth_Model_Consumer */ + $consumer = Mage::getModel('oauth/consumer')->load($consumerId); + if (!$consumer->getId()) { + Mage::throwException(Mage::helper('oauth')->__('Unable to find a consumer.')); + } + + $consumer->delete(); + + $this->_getSession()->addSuccess(Mage::helper('oauth')->__('The consumer has been deleted.')); + } catch (Mage_Core_Exception $e) { + $this->_getSession()->addError($e->getMessage()); + } catch (Exception $e) { + $this->_getSession()->addException( + $e, Mage::helper('oauth')->__('An error occurred while deleting the consumer.') + ); + } + } + $this->_redirect('*/*/index'); + } +} diff --git a/app/code/core/Mage/OAuth/controllers/AuthorizeController.php b/app/code/core/Mage/OAuth/controllers/AuthorizeController.php new file mode 100644 index 0000000000..955a8f5f40 --- /dev/null +++ b/app/code/core/Mage/OAuth/controllers/AuthorizeController.php @@ -0,0 +1,243 @@ + + */ +class Mage_OAuth_AuthorizeController extends Mage_Core_Controller_Front_Action +{ + /** + * Session name + * + * @var string + */ + protected $_sessionName = 'customer/session'; + + /** + * Init authorize page + * + * @param bool $simple Is simple page? + * @return Mage_OAuth_AuthorizeController + */ + protected function _initForm($simple = false) + { + /** @var $server Mage_OAuth_Model_Server */ + $server = Mage::getModel('oauth/server'); + /** @var $session Mage_Customer_Model_Session */ + $session = Mage::getSingleton($this->_sessionName); + + $isException = false; + try { + $server->checkAuthorizeRequest(); + } catch (Mage_Core_Exception $e) { + $session->addError($e->getMessage()); + } catch (Mage_OAuth_Exception $e) { + $isException = true; + $session->addException($e, $this->__('An error occurred. Your authorization request is invalid.')); + } catch (Exception $e) { + $isException = true; + $session->addException($e, $this->__('An error occurred.')); + } + + $this->loadLayout(); + $layout = $this->getLayout(); + $logged = $session->isLoggedIn(); + + $contentBlock = $layout->getBlock('content'); + if ($logged) { + $contentBlock->unsetChild('oauth.authorize.form'); + /** @var $block Mage_OAuth_Block_Authorize_Button */ + $block = $contentBlock->getChild('oauth.authorize.button'); + } else { + $contentBlock->unsetChild('oauth.authorize.button'); + /** @var $block Mage_OAuth_Block_Authorize */ + $block = $contentBlock->getChild('oauth.authorize.form'); + } + + if ($simple) { + $layout->getBlock('oauth.authorize.style')->setData('is_logged', $logged); + } + + /** @var $helper Mage_Core_Helper_Url */ + $helper = Mage::helper('core/url'); + $session->setAfterAuthUrl(Mage::getUrl('customer/account/login', array('_nosid' => true))) + ->setBeforeAuthUrl($helper->getCurrentUrl()); + + $block->setIsSimple($simple) + ->setToken($this->getRequest()->getQuery('oauth_token')) + ->setHasException($isException); + return $this; + } + + /** + * Init confirm page + * + * @param bool $simple Is simple page? + * @return Mage_OAuth_AuthorizeController + */ + protected function _initConfirmPage($simple = false) + { + $this->loadLayout(); + try { + /** @var $session Mage_Customer_Model_Session */ + $session = Mage::getSingleton($this->_sessionName); + /** @var $server Mage_OAuth_Model_Server */ + $server = Mage::getModel('oauth/server'); + + /** @var $block Mage_OAuth_Block_Authorize */ + $block = $this->getLayout()->getBlock('oauth.authorize.confirm'); + $block->setIsSimple($simple); + + /** @var $token Mage_OAuth_Model_Token */ + $token = $server->authorizeToken($session->getCustomerId(), Mage_OAuth_Model_Token::USER_TYPE_CUSTOMER); + + /** @var $helper Mage_OAuth_Helper_Data */ + $helper = Mage::helper('oauth'); + + if (($callback = $helper->getFullCallbackUrl($token))) { //false in case of OOB + $this->_redirectUrl($callback . ($simple ? '&simple=1' : '')); + return $this; + } else { + $block->setVerifier($token->getVerifier()); + $session->addSuccess($this->__('Authorization confirmed.')); + } + } catch (Mage_Core_Exception $e) { + $session->addError($e->getMessage()); + } catch (Mage_OAuth_Exception $e) { + $session->addException($e, $this->__('An error occurred. Your authorization request is invalid.')); + } catch (Exception $e) { + $session->addException($e, $this->__('An error occurred on confirm authorize.')); + } + + $this->_initLayoutMessages($this->_sessionName); + $this->renderLayout(); + + return $this; + } + + /** + * Init reject page + * + * @param bool $simple Is simple page? + * @return Mage_OAuth_AuthorizeController + */ + protected function _initRejectPage($simple = false) + { + $this->loadLayout(); + + /** @var $session Mage_Customer_Model_Session */ + $session = Mage::getSingleton($this->_sessionName); + try { + /** @var $server Mage_OAuth_Model_Server */ + $server = Mage::getModel('oauth/server'); + + /** @var $block Mage_OAuth_Block_Authorize */ + $block = $this->getLayout()->getBlock('oauth.authorize.reject'); + $block->setIsSimple($simple . ($simple ? '&simple=1' : '')); + + /** @var $token Mage_OAuth_Model_Token */ + $token = $server->checkAuthorizeRequest(); + /** @var $helper Mage_OAuth_Helper_Data */ + $helper = Mage::helper('oauth'); + + if (($callback = $helper->getFullCallbackUrl($token, true))) { + $this->_redirectUrl($callback . ($simple ? '&simple=1' : '')); + return $this; + } else { + $session->addNotice($this->__('The application access request is rejected.')); + } + } catch (Mage_Core_Exception $e) { + $session->addError($e->getMessage()); + } catch (Exception $e) { + $session->addException($e, $this->__('An error occurred on reject authorize.')); + } + + $this->_initLayoutMessages($this->_sessionName); + $this->renderLayout(); + + return $this; + } + + /** + * Index action. + * + * @return void + */ + public function indexAction() + { + $this->_initForm(); + $this->_initLayoutMessages($this->_sessionName); + $this->renderLayout(); + } + + /** + * OAuth authorize or allow decline access simple page + * + * @return void + */ + public function simpleAction() + { + $this->_initForm(true); + $this->_initLayoutMessages($this->_sessionName); + $this->renderLayout(); + } + + /** + * Confirm token authorization action + */ + public function confirmAction() + { + $this->_initConfirmPage(); + } + + /** + * Confirm token authorization simple page + */ + public function confirmSimpleAction() + { + $this->_initConfirmPage(true); + } + + /** + * Reject token authorization action + */ + public function rejectAction() + { + $this->_initRejectPage(); + } + + /** + * Reject token authorization simple page + */ + public function rejectSimpleAction() + { + $this->_initRejectPage(true); + } +} diff --git a/app/code/core/Mage/OAuth/controllers/Customer/TokenController.php b/app/code/core/Mage/OAuth/controllers/Customer/TokenController.php new file mode 100644 index 0000000000..bf12802a6c --- /dev/null +++ b/app/code/core/Mage/OAuth/controllers/Customer/TokenController.php @@ -0,0 +1,188 @@ + + */ +class Mage_OAuth_Customer_TokenController extends Mage_Core_Controller_Front_Action +{ + /** + * Customer session model + * + * @var Mage_Customer_Model_Session + */ + protected $_session; + + /** + * Customer session model + * + * @var Mage_Customer_Model_Session + */ + protected $_sessionName = 'customer/session'; + + /** + * Check authentication + * + * Check customer authentication for some actions + */ + public function preDispatch() + { + parent::preDispatch(); + $this->_session = Mage::getSingleton($this->_sessionName); + if (!$this->_session->authenticate($this)) { + $this->setFlag('', self::FLAG_NO_DISPATCH, true); + } + + } + + /** + * Render grid page + */ + public function indexAction() + { + $this->loadLayout(); + $this->_initLayoutMessages($this->_sessionName); + $this->renderLayout(); + } + + /** + * Redirect to referrer URL or otherwise to index page without params + * + * @return Mage_OAuth_Customer_TokenController + */ + protected function _redirectBack() + { + $url = $this->_getRefererUrl(); + if (Mage::app()->getStore()->getBaseUrl() == $url) { + $url = Mage::getUrl('*/*/index'); + } + $this->_redirectUrl($url); + return $this; + } + + /** + * Update revoke status action + */ + public function revokeAction() + { + $id = $this->getRequest()->getParam('id'); + $status = $this->getRequest()->getParam('status'); + + if (0 === (int) $id) { + // No ID + $this->_session->addError($this->__('Invalid entry ID.')); + $this->_redirectBack(); + return; + } + + if (null === $status) { + // No status selected + $this->_session->addError($this->__('Invalid revoke status.')); + $this->_redirectBack(); + return; + } + + try { + /** @var $collection Mage_OAuth_Model_Resource_Token_Collection */ + $collection = Mage::getModel('oauth/token')->getCollection(); + $collection->joinConsumerAsApplication() + ->addFilterByCustomerId($this->_session->getCustomerId()) + ->addFilterById($id) + ->addFilterByType(Mage_OAuth_Model_Token::TYPE_ACCESS) + ->addFilterByRevoked(!$status); + //here is can be load from model, but used from collection for get consumer name + + /** @var $model Mage_OAuth_Model_Token */ + $model = $collection->getFirstItem(); + if ($model->getId()) { + $name = $model->getName(); + $model->load($model->getId()); + $model->setRevoked($status)->save(); + if ($status) { + $message = $this->__('Application "%s" has been revoked.', $name); + } else { + $message = $this->__('Application "%s" has been enabled.', $name); + } + $this->_session->addSuccess($message); + } else { + $this->_session->addError($this->__('Application not found.')); + } + } catch (Mage_Core_Exception $e) { + $this->_session->addError($e->getMessage()); + } catch (Exception $e) { + $this->_session->addError($this->__('An error occurred on update revoke status.')); + Mage::logException($e); + } + $this->_redirectBack(); + } + + /** + * Delete action + */ + public function deleteAction() + { + $id = $this->getRequest()->getParam('id'); + + if (0 === (int) $id) { + // No ID + $this->_session->addError($this->__('Invalid entry ID.')); + $this->_redirectBack(); + return; + } + + try { + /** @var $collection Mage_OAuth_Model_Resource_Token_Collection */ + $collection = Mage::getModel('oauth/token')->getCollection(); + $collection->joinConsumerAsApplication() + ->addFilterByCustomerId($this->_session->getCustomerId()) + ->addFilterByType(Mage_OAuth_Model_Token::TYPE_ACCESS) + ->addFilterById($id); + + /** @var $model Mage_OAuth_Model_Token */ + $model = $collection->getFirstItem(); + if ($model->getId()) { + $name = $model->getName(); + $model->delete(); + $this->_session->addSuccess( + $this->__('Application "%s" has been deleted.', $name)); + } else { + $this->_session->addError($this->__('Application not found.')); + } + } catch (Mage_Core_Exception $e) { + $this->_session->addError($e->getMessage()); + } catch (Exception $e) { + $this->_session->addError($this->__('An error occurred on delete application.')); + Mage::logException($e); + } + $this->_redirectBack(); + } +} diff --git a/app/code/core/Mage/OAuth/controllers/InitiateController.php b/app/code/core/Mage/OAuth/controllers/InitiateController.php new file mode 100644 index 0000000000..58b6700eb7 --- /dev/null +++ b/app/code/core/Mage/OAuth/controllers/InitiateController.php @@ -0,0 +1,61 @@ + + */ +class Mage_OAuth_InitiateController extends Mage_Core_Controller_Front_Action +{ + /** + * Dispatch event before action + * + * @return void + */ + public function preDispatch() + { + $this->setFlag('', self::FLAG_NO_START_SESSION, 1); + $this->setFlag('', self::FLAG_NO_CHECK_INSTALLATION, 1); + $this->setFlag('', self::FLAG_NO_COOKIES_REDIRECT, 0); + $this->setFlag('', self::FLAG_NO_PRE_DISPATCH, 1); + + parent::preDispatch(); + } + + /** + * Index action. Receive initiate request and response OAuth token + */ + public function indexAction() + { + /** @var $server Mage_OAuth_Model_Server */ + $server = Mage::getModel('oauth/server'); + + $server->initiateToken(); + } +} diff --git a/app/code/core/Mage/OAuth/controllers/TokenController.php b/app/code/core/Mage/OAuth/controllers/TokenController.php new file mode 100644 index 0000000000..c85f979b2a --- /dev/null +++ b/app/code/core/Mage/OAuth/controllers/TokenController.php @@ -0,0 +1,61 @@ + + */ +class Mage_OAuth_TokenController extends Mage_Core_Controller_Front_Action +{ + /** + * Dispatch event before action + * + * @return void + */ + public function preDispatch() + { + $this->setFlag('', self::FLAG_NO_START_SESSION, 1); + $this->setFlag('', self::FLAG_NO_CHECK_INSTALLATION, 1); + $this->setFlag('', self::FLAG_NO_COOKIES_REDIRECT, 0); + $this->setFlag('', self::FLAG_NO_PRE_DISPATCH, 1); + + parent::preDispatch(); + } + + /** + * Index action. Process request and response permanent token + */ + public function indexAction() + { + /** @var $server Mage_OAuth_Model_Server */ + $server = Mage::getModel('oauth/server'); + + $server->accessToken(); + } +} diff --git a/app/code/core/Mage/OAuth/etc/adminhtml.xml b/app/code/core/Mage/OAuth/etc/adminhtml.xml new file mode 100644 index 0000000000..3528286afc --- /dev/null +++ b/app/code/core/Mage/OAuth/etc/adminhtml.xml @@ -0,0 +1,100 @@ + + + + + + + + + + + + + OAuth Consumers + 20 + + + Edit + 30 + + + Delete + 40 + + + + + OAuth Authorized Tokens + 30 + + + OAuth Admin My Apps + 40 + + + + + + + OAuth + 20 + + + + + + + + + + + + + + + + REST - OAuth Consumers + 50 + adminhtml/oAuth_consumer + + + REST - OAuth Authorized Tokens + 60 + adminhtml/oAuth_authorizedTokens + + + REST - My Apps + 70 + adminhtml/oAuth_admin_token + + + + + + + diff --git a/app/code/core/Mage/OAuth/etc/config.xml b/app/code/core/Mage/OAuth/etc/config.xml new file mode 100644 index 0000000000..28f3a54870 --- /dev/null +++ b/app/code/core/Mage/OAuth/etc/config.xml @@ -0,0 +1,177 @@ + + + + + + 1.0.0.0 + + + + + + Mage_OAuth_Model + oauth_resource + + + Mage_OAuth_Model_Resource + + +
    + + + - +
     
    - +
    - - + +
    x    x   
    @@ -78,18 +72,18 @@
    {#media_dlg.advanced} - +
    - + - + - + - +
    - @@ -100,9 +94,9 @@ - +
    - +
     
    @@ -111,192 +105,284 @@
    -
    - {#media_dlg.flash_options} +
    + {#media_dlg.html5_video_options} - +
    - + + - + + - + + - + + +
    - + + + + + +
     
    - + + + + + +
     
    - + + + + + +
     
    - + + +
    + - diff --git a/app/design/adminhtml/default/default/template/widget/accordion.phtml b/app/design/adminhtml/default/default/template/widget/accordion.phtml index ea1e4638d8..38a15353a9 100644 --- a/app/design/adminhtml/default/default/template/widget/accordion.phtml +++ b/app/design/adminhtml/default/default/template/widget/accordion.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -29,11 +29,11 @@ * Template for Mage_Adminhtml_Block_Widget_Accordion */ ?> -
    +
    getItems() as $_item): ?> getChildHtml($_item->getId()) ?>
    diff --git a/app/design/adminhtml/default/default/template/widget/breadcrumbs.phtml b/app/design/adminhtml/default/default/template/widget/breadcrumbs.phtml index 4663423e00..14f2490ecb 100644 --- a/app/design/adminhtml/default/default/template/widget/breadcrumbs.phtml +++ b/app/design/adminhtml/default/default/template/widget/breadcrumbs.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/widget/form.phtml b/app/design/adminhtml/default/default/template/widget/form.phtml index c048a166a0..04a297f0ad 100644 --- a/app/design/adminhtml/default/default/template/widget/form.phtml +++ b/app/design/adminhtml/default/default/template/widget/form.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/widget/form/container.phtml b/app/design/adminhtml/default/default/template/widget/form/container.phtml index fc0f9f8191..9fd68966b1 100644 --- a/app/design/adminhtml/default/default/template/widget/form/container.phtml +++ b/app/design/adminhtml/default/default/template/widget/form/container.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/widget/form/element.phtml b/app/design/adminhtml/default/default/template/widget/form/element.phtml index d299e55bce..5ba4dbede2 100644 --- a/app/design/adminhtml/default/default/template/widget/form/element.phtml +++ b/app/design/adminhtml/default/default/template/widget/form/element.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/widget/form/element/gallery.phtml b/app/design/adminhtml/default/default/template/widget/form/element/gallery.phtml index 592ea9f797..68770dce84 100644 --- a/app/design/adminhtml/default/default/template/widget/form/element/gallery.phtml +++ b/app/design/adminhtml/default/default/template/widget/form/element/gallery.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/widget/form/renderer/element.phtml b/app/design/adminhtml/default/default/template/widget/form/renderer/element.phtml index 9f4fb73b85..4348f58618 100644 --- a/app/design/adminhtml/default/default/template/widget/form/renderer/element.phtml +++ b/app/design/adminhtml/default/default/template/widget/form/renderer/element.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/widget/form/renderer/fieldset.phtml b/app/design/adminhtml/default/default/template/widget/form/renderer/fieldset.phtml index 36e698e001..78d7b3c749 100644 --- a/app/design/adminhtml/default/default/template/widget/form/renderer/fieldset.phtml +++ b/app/design/adminhtml/default/default/template/widget/form/renderer/fieldset.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/widget/form/renderer/fieldset/element.phtml b/app/design/adminhtml/default/default/template/widget/form/renderer/fieldset/element.phtml index 8269cda7d4..6b783b76a7 100644 --- a/app/design/adminhtml/default/default/template/widget/form/renderer/fieldset/element.phtml +++ b/app/design/adminhtml/default/default/template/widget/form/renderer/fieldset/element.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/widget/grid.phtml b/app/design/adminhtml/default/default/template/widget/grid.phtml index 15220c0343..0f004f1d83 100644 --- a/app/design/adminhtml/default/default/template/widget/grid.phtml +++ b/app/design/adminhtml/default/default/template/widget/grid.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/widget/grid/container.phtml b/app/design/adminhtml/default/default/template/widget/grid/container.phtml index e8acc20ef9..fb76b3c55b 100644 --- a/app/design/adminhtml/default/default/template/widget/grid/container.phtml +++ b/app/design/adminhtml/default/default/template/widget/grid/container.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/widget/grid/massaction.phtml b/app/design/adminhtml/default/default/template/widget/grid/massaction.phtml index 76be70bad7..1c0855161f 100644 --- a/app/design/adminhtml/default/default/template/widget/grid/massaction.phtml +++ b/app/design/adminhtml/default/default/template/widget/grid/massaction.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -42,7 +42,9 @@
    @@ -124,7 +124,7 @@ helper('wishlist')->isAllow()) : ?> diff --git a/app/design/frontend/base/default/template/catalog/product/compare/sidebar.phtml b/app/design/frontend/base/default/template/catalog/product/compare/sidebar.phtml index 3870c19e9c..2a01b676b8 100644 --- a/app/design/frontend/base/default/template/catalog/product/compare/sidebar.phtml +++ b/app/design/frontend/base/default/template/catalog/product/compare/sidebar.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* @var $this Mage_Catalog_Block_Product_Compare_Sidebar */ diff --git a/app/design/frontend/base/default/template/catalog/product/gallery.phtml b/app/design/frontend/base/default/template/catalog/product/gallery.phtml index 5d9226ef53..7ead5ae534 100644 --- a/app/design/frontend/base/default/template/catalog/product/gallery.phtml +++ b/app/design/frontend/base/default/template/catalog/product/gallery.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/base/default/template/catalog/product/list.phtml b/app/design/frontend/base/default/template/catalog/product/list.phtml index e2fe360c41..54f02eeada 100644 --- a/app/design/frontend/base/default/template/catalog/product/list.phtml +++ b/app/design/frontend/base/default/template/catalog/product/list.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/base/default/template/catalog/product/list/related.phtml b/app/design/frontend/base/default/template/catalog/product/list/related.phtml index d285c81d34..493f8c9241 100644 --- a/app/design/frontend/base/default/template/catalog/product/list/related.phtml +++ b/app/design/frontend/base/default/template/catalog/product/list/related.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/base/default/template/catalog/product/list/toolbar.phtml b/app/design/frontend/base/default/template/catalog/product/list/toolbar.phtml index fb9e2aba88..7d1cb5d1c3 100644 --- a/app/design/frontend/base/default/template/catalog/product/list/toolbar.phtml +++ b/app/design/frontend/base/default/template/catalog/product/list/toolbar.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/base/default/template/catalog/product/list/upsell.phtml b/app/design/frontend/base/default/template/catalog/product/list/upsell.phtml index 0e81880580..e03fb3f632 100644 --- a/app/design/frontend/base/default/template/catalog/product/list/upsell.phtml +++ b/app/design/frontend/base/default/template/catalog/product/list/upsell.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/base/default/template/catalog/product/new.phtml b/app/design/frontend/base/default/template/catalog/product/new.phtml index a45a2ebf2c..eb6e753e38 100644 --- a/app/design/frontend/base/default/template/catalog/product/new.phtml +++ b/app/design/frontend/base/default/template/catalog/product/new.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/base/default/template/catalog/product/price.phtml b/app/design/frontend/base/default/template/catalog/product/price.phtml index 14dfdbbde2..4da9901226 100644 --- a/app/design/frontend/base/default/template/catalog/product/price.phtml +++ b/app/design/frontend/base/default/template/catalog/product/price.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -41,6 +41,7 @@ /* @var $_taxHelper Mage_Tax_Helper_Data */ $_product = $this->getProduct(); + $_storeId = $_product->getStoreId(); $_id = $_product->getId(); $_weeeSeparator = ''; $_simplePricesTax = ($_taxHelper->displayPriceIncludingTax() || $_taxHelper->displayBothPrices()); @@ -50,10 +51,15 @@ isGrouped()): ?> getAmountForDisplay($_product); ?> - typeOfDisplay($_product, array(1,2,4))): ?> + typeOfDisplay($_product, array(Mage_Weee_Model_Tax::DISPLAY_INCL_DESCR, Mage_Weee_Model_Tax::DISPLAY_EXCL_DESCR_INCL, 4))): ?> getAmount($_product); ?> getProductWeeeAttributesForDisplay($_product); ?> + + isTaxable() && !$_taxHelper->priceIncludesTax($_storeId)): ?> + getProductWeeeAttributesForRenderer($_product, null, null, null, true); ?> + getAmountInclTaxes($_attributes); ?> +
    getPrice($_product, $_product->getPrice()) ?> @@ -61,32 +67,32 @@ getPrice($_product, $_product->getFinalPrice()) ?> getPrice($_product, $_product->getFinalPrice(), true) ?> getPriceDisplayType(); ?> - + = $_price): ?> displayBothPrices()): ?> typeOfDisplay($_product, 0)): // including ?> helper('tax')->__('Excl. Tax:') ?> - currency($_price+$_weeeTaxAmount,true,false) ?> + currency($_price + $_weeeTaxAmount, true, false) ?> helper('tax')->__('Incl. Tax:') ?> - currency($_finalPriceInclTax+$_weeeTaxAmount,true,false) ?> + currency($_finalPriceInclTax + $_weeeTaxAmountInclTaxes, true, false) ?> typeOfDisplay($_product, 1)): // incl. + weee ?> helper('tax')->__('Excl. Tax:') ?> - currency($_price+$_weeeTaxAmount,true,false) ?> + currency($_price + $_weeeTaxAmount, true, false) ?> helper('tax')->__('Incl. Tax:') ?> - currency($_finalPriceInclTax+$_weeeTaxAmount,true,false) ?> + currency($_finalPriceInclTax + $_weeeTaxAmountInclTaxes, true, false) ?> ( @@ -100,18 +106,18 @@ helper('tax')->__('Excl. Tax:') ?> - currency($_price+$_weeeTaxAmount,true,false) ?> + currency($_price + $_weeeTaxAmount, true, false) ?> helper('tax')->__('Incl. Tax:') ?> - currency($_finalPriceInclTax+$_weeeTaxAmount,true,false) ?> + currency($_finalPriceInclTax + $_weeeTaxAmountInclTaxes, true, false) ?> ( - getName(); ?>: currency($_weeeTaxAttribute->getAmount()+$_weeeTaxAttribute->getTaxAmount(), true, true); ?> + getName(); ?>: currency($_weeeTaxAttribute->getAmount() + $_weeeTaxAttribute->getTaxAmount(), true, true); ?> ) @@ -120,7 +126,7 @@ helper('tax')->__('Excl. Tax:') ?> - currency($_price,true,false) ?> + currency($_price, true, false) ?> @@ -131,31 +137,35 @@ helper('tax')->__('Incl. Tax:') ?> - currency($_finalPriceInclTax+$_weeeTaxAmount,true,false) ?> + currency($_finalPriceInclTax + $_weeeTaxAmountInclTaxes, true, false) ?> helper('tax')->__('Excl. Tax:') ?> - currency($_price,true,false) ?> + + currency($_price, true, false) ?> + + currency($_finalPrice, true, false) ?> + helper('tax')->__('Incl. Tax:') ?> - currency($_finalPriceInclTax,true,false) ?> + currency($_finalPriceInclTax, true, false) ?> typeOfDisplay($_product, 0)): // including ?> - currency($_price+$_weeeTaxAmount,true,true) ?> + currency($_price + $_weeeTaxAmount, true, true) ?> typeOfDisplay($_product, 1)): // incl. + weee ?> - currency($_price+$_weeeTaxAmount,true,true) ?> + currency($_price + $_weeeTaxAmount, true, true) ?> ( @@ -166,12 +176,12 @@ ) typeOfDisplay($_product, 4)): // incl. + weee ?> - currency($_price+$_weeeTaxAmount,true,true) ?> + currency($_price + $_weeeTaxAmount, true, true) ?> ( - getName(); ?>: currency($_weeeTaxAttribute->getAmount()+$_weeeTaxAttribute->getTaxAmount(), true, true); ?> + getName(); ?>: currency($_weeeTaxAttribute->getAmount() + $_weeeTaxAttribute->getTaxAmount(), true, true); ?> ) @@ -183,11 +193,15 @@ - currency($_price+$_weeeTaxAmount,true,true) ?> + currency($_price + $_weeeTaxAmount, true, true) ?> - currency($_price,true,true) ?> + + currency($_price, true, true) ?> + + currency($_finalPrice, true, true) ?> + @@ -198,7 +212,7 @@

    __('Regular Price:') ?> - currency($_regularPrice+$_originalWeeeTaxAmount,true,false) ?> + currency($_regularPrice + $_originalWeeeTaxAmount, true, false) ?>

    @@ -208,13 +222,13 @@ helper('tax')->__('Excl. Tax:') ?> - currency($_finalPrice+$_weeeTaxAmount,true,false) ?> + currency($_finalPrice + $_weeeTaxAmount, true, false) ?> helper('tax')->__('Incl. Tax:') ?> - currency($_finalPriceInclTax+$_weeeTaxAmount,true,false) ?> + currency($_finalPriceInclTax + $_weeeTaxAmountInclTaxes, true, false) ?>

    @@ -222,7 +236,7 @@

    __('Special Price:') ?> - currency($_finalPrice+$_weeeTaxAmount,true,false) ?> + currency($_finalPrice + $_weeeTaxAmountInclTaxes, true, false) ?>

    @@ -231,7 +245,7 @@

    __('Regular Price:') ?> - currency($_regularPrice+$_originalWeeeTaxAmount,true,false) ?> + currency($_regularPrice + $_originalWeeeTaxAmount, true, false) ?>

    @@ -240,7 +254,7 @@ helper('tax')->__('Excl. Tax:') ?> - currency($_finalPrice+$_weeeTaxAmount,true,false) ?> + currency($_finalPrice + $_weeeTaxAmount, true, false) ?> ( @@ -253,7 +267,7 @@ helper('tax')->__('Incl. Tax:') ?> - currency($_finalPriceInclTax+$_weeeTaxAmount,true,false) ?> + currency($_finalPriceInclTax + $_weeeTaxAmountInclTaxes, true, false) ?>

    @@ -261,7 +275,7 @@

    __('Regular Price:') ?> - currency($_regularPrice+$_originalWeeeTaxAmount,true,false) ?> + currency($_regularPrice + $_originalWeeeTaxAmount, true, false) ?>

    @@ -270,20 +284,20 @@ helper('tax')->__('Excl. Tax:') ?> - currency($_finalPrice+$_weeeTaxAmount,true,false) ?> + currency($_finalPrice + $_weeeTaxAmount, true, false) ?> ( - getName(); ?>: currency($_weeeTaxAttribute->getAmount()+$_weeeTaxAttribute->getTaxAmount(), true, true); ?> + getName(); ?>: currency($_weeeTaxAttribute->getAmount() + $_weeeTaxAttribute->getTaxAmount(), true, true); ?> ) helper('tax')->__('Incl. Tax:') ?> - currency($_finalPriceInclTax+$_weeeTaxAmount,true,false) ?> + currency($_finalPriceInclTax + $_weeeTaxAmountInclTaxes, true, false) ?>

    @@ -291,7 +305,7 @@

    __('Regular Price:') ?> - currency($_regularPrice,true,false) ?> + currency($_regularPrice, true, false) ?>

    @@ -300,7 +314,7 @@ helper('tax')->__('Excl. Tax:') ?> - currency($_finalPrice,true,false) ?> + currency($_finalPrice, true, false) ?> @@ -311,7 +325,7 @@ helper('tax')->__('Incl. Tax:') ?> - currency($_finalPriceInclTax+$_weeeTaxAmount,true,false) ?> + currency($_finalPriceInclTax + $_weeeTaxAmountInclTaxes, true, false) ?>

    @@ -319,7 +333,7 @@

    __('Regular Price:') ?> - currency($_regularPrice,true,false) ?> + currency($_regularPrice, true, false) ?>

    @@ -329,13 +343,13 @@ helper('tax')->__('Excl. Tax:') ?> - currency($_finalPrice,true,false) ?> + currency($_finalPrice, true, false) ?> helper('tax')->__('Incl. Tax:') ?> - currency($_finalPriceInclTax,true,false) ?> + currency($_finalPriceInclTax, true, false) ?>

    @@ -343,7 +357,7 @@

    __('Special Price:') ?> - currency($_finalPrice,true,false) ?> + currency($_finalPrice, true, false) ?>

    @@ -355,7 +369,7 @@ typeOfDisplay($_product, array(0, 1, 4))): ?> - + getUseLinkForAsLowAs()):?> @@ -365,7 +379,7 @@ __('As low as:') ?> - currency($_minimalPriceDisplayValue,true,false) ?> + currency($_minimalPriceDisplayValue, true, false) ?> getUseLinkForAsLowAs()):?> @@ -377,8 +391,8 @@ isGrouped()): */ ?> getPrice($_product, $_minimalPriceValue, $includingTax = null); - $_inclTax = $_taxHelper->getPrice($_product, $_minimalPriceValue, $includingTax = true); + $_exclTax = $_taxHelper->getPrice($_product, $_minimalPriceValue); + $_inclTax = $_taxHelper->getPrice($_product, $_minimalPriceValue, true); ?> getDisplayMinimalPrice() && $_minimalPriceValue): ?>
    diff --git a/app/design/frontend/base/default/template/catalog/product/price_msrp.phtml b/app/design/frontend/base/default/template/catalog/product/price_msrp.phtml index a76d122b82..e8d82efd65 100644 --- a/app/design/frontend/base/default/template/catalog/product/price_msrp.phtml +++ b/app/design/frontend/base/default/template/catalog/product/price_msrp.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/base/default/template/catalog/product/price_msrp_item.phtml b/app/design/frontend/base/default/template/catalog/product/price_msrp_item.phtml index 7937f0abad..20cd3361f3 100644 --- a/app/design/frontend/base/default/template/catalog/product/price_msrp_item.phtml +++ b/app/design/frontend/base/default/template/catalog/product/price_msrp_item.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/base/default/template/catalog/product/price_msrp_noform.phtml b/app/design/frontend/base/default/template/catalog/product/price_msrp_noform.phtml index 5e9de19e04..f144247070 100644 --- a/app/design/frontend/base/default/template/catalog/product/price_msrp_noform.phtml +++ b/app/design/frontend/base/default/template/catalog/product/price_msrp_noform.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/base/default/template/catalog/product/price_msrp_rss.phtml b/app/design/frontend/base/default/template/catalog/product/price_msrp_rss.phtml index db669f6482..b4828b0d53 100644 --- a/app/design/frontend/base/default/template/catalog/product/price_msrp_rss.phtml +++ b/app/design/frontend/base/default/template/catalog/product/price_msrp_rss.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/base/default/template/catalog/product/view.phtml b/app/design/frontend/base/default/template/catalog/product/view.phtml index 4ca4faefe8..38826a69c1 100644 --- a/app/design/frontend/base/default/template/catalog/product/view.phtml +++ b/app/design/frontend/base/default/template/catalog/product/view.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/base/default/template/catalog/product/view/additional.phtml b/app/design/frontend/base/default/template/catalog/product/view/additional.phtml index eade95b3cb..ded93626f7 100644 --- a/app/design/frontend/base/default/template/catalog/product/view/additional.phtml +++ b/app/design/frontend/base/default/template/catalog/product/view/additional.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/base/default/template/catalog/product/view/addto.phtml b/app/design/frontend/base/default/template/catalog/product/view/addto.phtml index 114f6b46d6..ff1aa873be 100644 --- a/app/design/frontend/base/default/template/catalog/product/view/addto.phtml +++ b/app/design/frontend/base/default/template/catalog/product/view/addto.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -30,7 +30,7 @@
    diff --git a/app/design/frontend/base/default/template/checkout/cart/coupon.phtml b/app/design/frontend/base/default/template/checkout/cart/coupon.phtml index fcea4529c4..000df68820 100644 --- a/app/design/frontend/base/default/template/checkout/cart/coupon.phtml +++ b/app/design/frontend/base/default/template/checkout/cart/coupon.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/base/default/template/checkout/cart/crosssell.phtml b/app/design/frontend/base/default/template/checkout/cart/crosssell.phtml index 5982078fc0..295cf381e0 100644 --- a/app/design/frontend/base/default/template/checkout/cart/crosssell.phtml +++ b/app/design/frontend/base/default/template/checkout/cart/crosssell.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/base/default/template/checkout/cart/item/configure/updatecart.phtml b/app/design/frontend/base/default/template/checkout/cart/item/configure/updatecart.phtml index a3b673736a..8f587723af 100644 --- a/app/design/frontend/base/default/template/checkout/cart/item/configure/updatecart.phtml +++ b/app/design/frontend/base/default/template/checkout/cart/item/configure/updatecart.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/base/default/template/checkout/cart/item/default.phtml b/app/design/frontend/base/default/template/checkout/cart/item/default.phtml index c459f1b2a2..6cb237dadf 100644 --- a/app/design/frontend/base/default/template/checkout/cart/item/default.phtml +++ b/app/design/frontend/base/default/template/checkout/cart/item/default.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -62,8 +62,9 @@ $canApplyMsrp = Mage::helper('catalog')->canApplyMsrp($_item->getProduct(), Mage

    *

    - getProductAdditionalInformationBlock()):?> - setItem($_item)->toHtml() ?> + getProductAdditionalInformationBlock(); ?> + + setItem($_item)->toHtml() ?> @@ -180,7 +181,7 @@ $canApplyMsrp = Mage::helper('catalog')->canApplyMsrp($_item->getProduct(), Mage - helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()): ?> + helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()) && !$_item->getNoSubtotal()): ?> - helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()): ?> + helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()) && !$_item->getNoSubtotal()): ?> helper('wishlist')->isAllowInCart()) : ?> helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()): ?> diff --git a/app/design/frontend/base/default/template/checkout/cart/render/simple.phtml b/app/design/frontend/base/default/template/checkout/cart/render/simple.phtml index 74e6c9a0b3..c82971aa03 100644 --- a/app/design/frontend/base/default/template/checkout/cart/render/simple.phtml +++ b/app/design/frontend/base/default/template/checkout/cart/render/simple.phtml @@ -20,10 +20,10 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ - + /** * @deprecated after 1.4.0.0-alpha3 */ @@ -41,7 +41,7 @@ helper('wishlist')->isAllowInCart()) : ?> helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()): ?> diff --git a/app/design/frontend/base/default/template/checkout/cart/shipping.phtml b/app/design/frontend/base/default/template/checkout/cart/shipping.phtml index 19a95e5e63..b8c4e692f4 100644 --- a/app/design/frontend/base/default/template/checkout/cart/shipping.phtml +++ b/app/design/frontend/base/default/template/checkout/cart/shipping.phtml @@ -20,15 +20,11 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> - +

    __('Estimate Shipping and Tax') ?>

    @@ -53,7 +49,7 @@ $('region_id').setAttribute('defaultValue', "getEstimateRegionId() ?>"); //]]> - +
    @@ -61,14 +57,14 @@
  • - +
  • - +
  • @@ -86,16 +82,16 @@
    $_rates): ?> -
    getCarrierName($code) ?>
    +
    escapeHtml($this->getCarrierName($code)) ?>
      getErrorMessage()) echo ' class="error-msg"';?>> getErrorMessage()): ?> - getErrorMessage() ?> + escapeHtml($_rate->getErrorMessage()) ?> - getCode()===$this->getAddressShippingMethod()) echo ' checked="checked"' ?> class="radio" /> -
    helper('wishlist')->isAllowInCart()) : ?> @@ -180,7 +180,7 @@ - helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()): ?> + helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()) && !$_item->getNoSubtotal()): ?> - helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()): ?> + helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()) && !$_item->getNoSubtotal()): ?> - + getCarrierTitle()): ?> - + getErrorMessage()): ?> @@ -66,7 +66,7 @@ getUrl()): ?> - + getStatus()): ?> diff --git a/app/design/frontend/base/default/template/tag/cloud.phtml b/app/design/frontend/base/default/template/tag/cloud.phtml index 1efd6c0d1e..821958812a 100644 --- a/app/design/frontend/base/default/template/tag/cloud.phtml +++ b/app/design/frontend/base/default/template/tag/cloud.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/base/default/template/tag/customer/recent.phtml b/app/design/frontend/base/default/template/tag/customer/recent.phtml index 6a6f1e17e8..d7dd89895b 100644 --- a/app/design/frontend/base/default/template/tag/customer/recent.phtml +++ b/app/design/frontend/base/default/template/tag/customer/recent.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/base/default/template/tag/customer/tags.phtml b/app/design/frontend/base/default/template/tag/customer/tags.phtml index 063407ca7f..7068ae6353 100644 --- a/app/design/frontend/base/default/template/tag/customer/tags.phtml +++ b/app/design/frontend/base/default/template/tag/customer/tags.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/base/default/template/tag/customer/view.phtml b/app/design/frontend/base/default/template/tag/customer/view.phtml index 9ad609059f..23d78092ef 100644 --- a/app/design/frontend/base/default/template/tag/customer/view.phtml +++ b/app/design/frontend/base/default/template/tag/customer/view.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/base/default/template/tag/list.phtml b/app/design/frontend/base/default/template/tag/list.phtml index 3a30733d0b..735ed04981 100644 --- a/app/design/frontend/base/default/template/tag/list.phtml +++ b/app/design/frontend/base/default/template/tag/list.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/base/default/template/tag/popular.phtml b/app/design/frontend/base/default/template/tag/popular.phtml index 150a143b2d..ad0915fff8 100644 --- a/app/design/frontend/base/default/template/tag/popular.phtml +++ b/app/design/frontend/base/default/template/tag/popular.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/base/default/template/tax/checkout/discount.phtml b/app/design/frontend/base/default/template/tax/checkout/discount.phtml index 26a415a950..964a3fa117 100644 --- a/app/design/frontend/base/default/template/tax/checkout/discount.phtml +++ b/app/design/frontend/base/default/template/tax/checkout/discount.phtml @@ -20,6 +20,6 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/base/default/template/tax/checkout/grandtotal.phtml b/app/design/frontend/base/default/template/tax/checkout/grandtotal.phtml index 35fc4eb47e..c313c08c25 100644 --- a/app/design/frontend/base/default/template/tax/checkout/grandtotal.phtml +++ b/app/design/frontend/base/default/template/tax/checkout/grandtotal.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /** diff --git a/app/design/frontend/base/default/template/tax/checkout/shipping.phtml b/app/design/frontend/base/default/template/tax/checkout/shipping.phtml index 241fdb9efb..3f7ad32e20 100644 --- a/app/design/frontend/base/default/template/tax/checkout/shipping.phtml +++ b/app/design/frontend/base/default/template/tax/checkout/shipping.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /** @@ -57,7 +57,7 @@ getIsPlaneMode()):?> style="display:none;"> diff --git a/app/design/frontend/base/default/template/wishlist/sharing.phtml b/app/design/frontend/base/default/template/wishlist/sharing.phtml index 72a72d1580..62e9c460a6 100644 --- a/app/design/frontend/base/default/template/wishlist/sharing.phtml +++ b/app/design/frontend/base/default/template/wishlist/sharing.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -57,7 +57,7 @@

    __('* Required Fields') ?>

    - +
    diff --git a/app/design/frontend/base/default/template/wishlist/sidebar.phtml b/app/design/frontend/base/default/template/wishlist/sidebar.phtml index 50abb0bb19..163bb938dc 100644 --- a/app/design/frontend/base/default/template/wishlist/sidebar.phtml +++ b/app/design/frontend/base/default/template/wishlist/sidebar.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* @var $this Mage_Wishlist_Block_Customer_Sidebar */ @@ -28,7 +28,7 @@ helper('wishlist')->isAllow()) : ?>
    - __('My Wishlist (%d)', $this->getItemCount()) ?> + getTitle(); ?>

    __('Last Added Items') ?>

    diff --git a/app/design/frontend/base/default/template/wishlist/view.phtml b/app/design/frontend/base/default/template/wishlist/view.phtml index 31ec3437aa..dfc4ecf35c 100644 --- a/app/design/frontend/base/default/template/wishlist/view.phtml +++ b/app/design/frontend/base/default/template/wishlist/view.phtml @@ -20,136 +20,57 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* @var $this Mage_Wishlist_Block_Customer_Wishlist */ ?> helper('wishlist')->isAllow()) : ?> -
    -
    - helper('wishlist')->isRssAllow() && $this->hasWishlistItems()): ?> - __('RSS Feed') ?> - -

    __('My Wishlist') ?>

    -
    - getMessagesBlock()->getGroupedHtml() ?> - hasWishlistItems()): ?> -
    -
    - getBlockHtml('formkey')?> -
    - + -
    + - - + +
    - + + + + + +
    + - - + + + +
    +
    + + + + + +
    +
    + + + +
    + + +
    + {#media_dlg.embedded_audio_options} + -
    - + - - + - + diff --git a/app/design/adminhtml/default/default/template/sales/order/view/form.phtml b/app/design/adminhtml/default/default/template/sales/order/view/form.phtml index 9e094c7ce8..226ff5f390 100644 --- a/app/design/adminhtml/default/default/template/sales/order/view/form.phtml +++ b/app/design/adminhtml/default/default/template/sales/order/view/form.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/sales/order/view/giftmessage.phtml b/app/design/adminhtml/default/default/template/sales/order/view/giftmessage.phtml index c1dae05959..bcf15ab60a 100644 --- a/app/design/adminhtml/default/default/template/sales/order/view/giftmessage.phtml +++ b/app/design/adminhtml/default/default/template/sales/order/view/giftmessage.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/sales/order/view/history.phtml b/app/design/adminhtml/default/default/template/sales/order/view/history.phtml index 87fe5b01b1..6498dea1c6 100644 --- a/app/design/adminhtml/default/default/template/sales/order/view/history.phtml +++ b/app/design/adminhtml/default/default/template/sales/order/view/history.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/sales/order/view/info.phtml b/app/design/adminhtml/default/default/template/sales/order/view/info.phtml index a0cc09ed89..dee4af9c34 100644 --- a/app/design/adminhtml/default/default/template/sales/order/view/info.phtml +++ b/app/design/adminhtml/default/default/template/sales/order/view/info.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -81,7 +81,7 @@ $orderStoreDate = $this->formatDate($_order->getCreatedAtStoreDate(), 'medium', - getRemoteIp()): ?> + getRemoteIp() && $this->shouldDisplayCustomerIp()): ?> diff --git a/app/design/adminhtml/default/default/template/sales/order/view/items.phtml b/app/design/adminhtml/default/default/template/sales/order/view/items.phtml index 1dcf6e2f1d..db81bb8a2a 100644 --- a/app/design/adminhtml/default/default/template/sales/order/view/items.phtml +++ b/app/design/adminhtml/default/default/template/sales/order/view/items.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/sales/order/view/items/renderer/default.phtml b/app/design/adminhtml/default/default/template/sales/order/view/items/renderer/default.phtml index 56391f1a4a..8d57af449f 100644 --- a/app/design/adminhtml/default/default/template/sales/order/view/items/renderer/default.phtml +++ b/app/design/adminhtml/default/default/template/sales/order/view/items/renderer/default.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/sales/order/view/tab/history.phtml b/app/design/adminhtml/default/default/template/sales/order/view/tab/history.phtml index 69d5f4c24d..191ecfc4ad 100644 --- a/app/design/adminhtml/default/default/template/sales/order/view/tab/history.phtml +++ b/app/design/adminhtml/default/default/template/sales/order/view/tab/history.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/sales/order/view/tab/info.phtml b/app/design/adminhtml/default/default/template/sales/order/view/tab/info.phtml index 2c3543c512..82c39819a4 100644 --- a/app/design/adminhtml/default/default/template/sales/order/view/tab/info.phtml +++ b/app/design/adminhtml/default/default/template/sales/order/view/tab/info.phtml @@ -20,10 +20,11 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> +getOrder() ?>
    @@ -60,7 +61,7 @@
    getShippingDescription()): ?> - getShippingDescription() ?> + escapeHtml($_order->getShippingDescription()) ?> helper('tax')->displayShippingPriceIncludingTax()): ?> displayShippingPriceInclTax($_order); ?> diff --git a/app/design/adminhtml/default/default/template/sales/order/view/tracking.phtml b/app/design/adminhtml/default/default/template/sales/order/view/tracking.phtml index e49bbbddf3..d543e80500 100644 --- a/app/design/adminhtml/default/default/template/sales/order/view/tracking.phtml +++ b/app/design/adminhtml/default/default/template/sales/order/view/tracking.phtml @@ -20,23 +20,24 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> -getOrder()->getShippingCarrier()->isTrackingAvailable()) : ?> +getOrder()->getShippingCarrier(); ?> +isTrackingAvailable()): ?>
    + - - + +
    - + - -
    + - - + +
    - - - - - - - - - +
    + + + + + +
    +
    -
    - {#media_dlg.flv_options} +
    + {#media_dlg.html5_audio_options} - +
    - + - - - - - - - - + + - - - - + + +
    - + + + + + +
     
    + + + + + +
     
    +
    + +
    + - + - - + '+ ''+ ''+ ''+ ''; diff --git a/app/design/adminhtml/default/default/template/downloadable/product/edit/downloadable/samples.phtml b/app/design/adminhtml/default/default/template/downloadable/product/edit/downloadable/samples.phtml index 100ef7a240..b9cdcfaa3d 100644 --- a/app/design/adminhtml/default/default/template/downloadable/product/edit/downloadable/samples.phtml +++ b/app/design/adminhtml/default/default/template/downloadable/product/edit/downloadable/samples.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -114,7 +114,7 @@ var sampleTemplate = ''+ ''+ ''+ ''+ ''; var sampleItems = { diff --git a/app/design/adminhtml/default/default/template/downloadable/sales/items/column/downloadable/creditmemo/name.phtml b/app/design/adminhtml/default/default/template/downloadable/sales/items/column/downloadable/creditmemo/name.phtml index ae058b604f..bad562c74e 100644 --- a/app/design/adminhtml/default/default/template/downloadable/sales/items/column/downloadable/creditmemo/name.phtml +++ b/app/design/adminhtml/default/default/template/downloadable/sales/items/column/downloadable/creditmemo/name.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/downloadable/sales/items/column/downloadable/invoice/name.phtml b/app/design/adminhtml/default/default/template/downloadable/sales/items/column/downloadable/invoice/name.phtml index 668a3368cd..d64d51461a 100644 --- a/app/design/adminhtml/default/default/template/downloadable/sales/items/column/downloadable/invoice/name.phtml +++ b/app/design/adminhtml/default/default/template/downloadable/sales/items/column/downloadable/invoice/name.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/downloadable/sales/items/column/downloadable/name.phtml b/app/design/adminhtml/default/default/template/downloadable/sales/items/column/downloadable/name.phtml index 7bba1a45c3..5ccb8f626e 100644 --- a/app/design/adminhtml/default/default/template/downloadable/sales/items/column/downloadable/name.phtml +++ b/app/design/adminhtml/default/default/template/downloadable/sales/items/column/downloadable/name.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/downloadable/sales/order/creditmemo/create/items/renderer/downloadable.phtml b/app/design/adminhtml/default/default/template/downloadable/sales/order/creditmemo/create/items/renderer/downloadable.phtml index 666d34b024..564766a672 100644 --- a/app/design/adminhtml/default/default/template/downloadable/sales/order/creditmemo/create/items/renderer/downloadable.phtml +++ b/app/design/adminhtml/default/default/template/downloadable/sales/order/creditmemo/create/items/renderer/downloadable.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/downloadable/sales/order/creditmemo/view/items/renderer/downloadable.phtml b/app/design/adminhtml/default/default/template/downloadable/sales/order/creditmemo/view/items/renderer/downloadable.phtml index 89501f5b52..c079d04670 100644 --- a/app/design/adminhtml/default/default/template/downloadable/sales/order/creditmemo/view/items/renderer/downloadable.phtml +++ b/app/design/adminhtml/default/default/template/downloadable/sales/order/creditmemo/view/items/renderer/downloadable.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/downloadable/sales/order/invoice/create/items/renderer/downloadable.phtml b/app/design/adminhtml/default/default/template/downloadable/sales/order/invoice/create/items/renderer/downloadable.phtml index 019ae5f559..813ac9e789 100644 --- a/app/design/adminhtml/default/default/template/downloadable/sales/order/invoice/create/items/renderer/downloadable.phtml +++ b/app/design/adminhtml/default/default/template/downloadable/sales/order/invoice/create/items/renderer/downloadable.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/downloadable/sales/order/invoice/view/items/renderer/downloadable.phtml b/app/design/adminhtml/default/default/template/downloadable/sales/order/invoice/view/items/renderer/downloadable.phtml index d04f924390..c9138a55f2 100644 --- a/app/design/adminhtml/default/default/template/downloadable/sales/order/invoice/view/items/renderer/downloadable.phtml +++ b/app/design/adminhtml/default/default/template/downloadable/sales/order/invoice/view/items/renderer/downloadable.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/downloadable/sales/order/view/items/renderer/downloadable.phtml b/app/design/adminhtml/default/default/template/downloadable/sales/order/view/items/renderer/downloadable.phtml index 7397b6a419..fb3e35edce 100644 --- a/app/design/adminhtml/default/default/template/downloadable/sales/order/view/items/renderer/downloadable.phtml +++ b/app/design/adminhtml/default/default/template/downloadable/sales/order/view/items/renderer/downloadable.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/eav/attribute/edit/js.phtml b/app/design/adminhtml/default/default/template/eav/attribute/edit/js.phtml index 2acd065758..06b9fcb86a 100644 --- a/app/design/adminhtml/default/default/template/eav/attribute/edit/js.phtml +++ b/app/design/adminhtml/default/default/template/eav/attribute/edit/js.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/email/order/items.phtml b/app/design/adminhtml/default/default/template/email/order/items.phtml index c9c7d352a7..2252344fbb 100644 --- a/app/design/adminhtml/default/default/template/email/order/items.phtml +++ b/app/design/adminhtml/default/default/template/email/order/items.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/example.phtml b/app/design/adminhtml/default/default/template/example.phtml index 9fcd49d1d4..36b4696c4b 100644 --- a/app/design/adminhtml/default/default/template/example.phtml +++ b/app/design/adminhtml/default/default/template/example.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/forgotpassword.phtml b/app/design/adminhtml/default/default/template/forgotpassword.phtml index 94150e9891..efe5129fd0 100644 --- a/app/design/adminhtml/default/default/template/forgotpassword.phtml +++ b/app/design/adminhtml/default/default/template/forgotpassword.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -58,7 +58,7 @@
    « __('Back to Login'); ?> - +
    diff --git a/app/design/adminhtml/default/default/template/formkey.phtml b/app/design/adminhtml/default/default/template/formkey.phtml index a8e94b7d75..5125b47532 100644 --- a/app/design/adminhtml/default/default/template/formkey.phtml +++ b/app/design/adminhtml/default/default/template/formkey.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/giftmessage/form.phtml b/app/design/adminhtml/default/default/template/giftmessage/form.phtml index 6b1c09bbc7..295339bc16 100644 --- a/app/design/adminhtml/default/default/template/giftmessage/form.phtml +++ b/app/design/adminhtml/default/default/template/giftmessage/form.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/giftmessage/giftoptionsform.phtml b/app/design/adminhtml/default/default/template/giftmessage/giftoptionsform.phtml index 5fc0c63013..652a87095a 100644 --- a/app/design/adminhtml/default/default/template/giftmessage/giftoptionsform.phtml +++ b/app/design/adminhtml/default/default/template/giftmessage/giftoptionsform.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/giftmessage/helper.phtml b/app/design/adminhtml/default/default/template/giftmessage/helper.phtml index 55d44648d2..af8c873b5a 100644 --- a/app/design/adminhtml/default/default/template/giftmessage/helper.phtml +++ b/app/design/adminhtml/default/default/template/giftmessage/helper.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/giftmessage/popup.phtml b/app/design/adminhtml/default/default/template/giftmessage/popup.phtml index b892717ca8..5a37b7c889 100644 --- a/app/design/adminhtml/default/default/template/giftmessage/popup.phtml +++ b/app/design/adminhtml/default/default/template/giftmessage/popup.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -37,8 +37,8 @@ getChildHtml();?>
    - - + +
    diff --git a/app/design/adminhtml/default/default/template/giftmessage/sales/order/create/giftoptions.phtml b/app/design/adminhtml/default/default/template/giftmessage/sales/order/create/giftoptions.phtml index 8934bb3df7..f3797aab0d 100644 --- a/app/design/adminhtml/default/default/template/giftmessage/sales/order/create/giftoptions.phtml +++ b/app/design/adminhtml/default/default/template/giftmessage/sales/order/create/giftoptions.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/giftmessage/sales/order/create/items.phtml b/app/design/adminhtml/default/default/template/giftmessage/sales/order/create/items.phtml index 57595cc328..c55719344e 100644 --- a/app/design/adminhtml/default/default/template/giftmessage/sales/order/create/items.phtml +++ b/app/design/adminhtml/default/default/template/giftmessage/sales/order/create/items.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/giftmessage/sales/order/view/giftoptions.phtml b/app/design/adminhtml/default/default/template/giftmessage/sales/order/view/giftoptions.phtml index 4b9d1e554a..e6281f98ee 100644 --- a/app/design/adminhtml/default/default/template/giftmessage/sales/order/view/giftoptions.phtml +++ b/app/design/adminhtml/default/default/template/giftmessage/sales/order/view/giftoptions.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/giftmessage/sales/order/view/items.phtml b/app/design/adminhtml/default/default/template/giftmessage/sales/order/view/items.phtml index 59ccc54359..bf529c4d55 100644 --- a/app/design/adminhtml/default/default/template/giftmessage/sales/order/view/items.phtml +++ b/app/design/adminhtml/default/default/template/giftmessage/sales/order/view/items.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/googlebase/captcha.phtml b/app/design/adminhtml/default/default/template/googlebase/captcha.phtml index 6ea56e8ca1..9255b54814 100644 --- a/app/design/adminhtml/default/default/template/googlebase/captcha.phtml +++ b/app/design/adminhtml/default/default/template/googlebase/captcha.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/googlebase/items.phtml b/app/design/adminhtml/default/default/template/googlebase/items.phtml index 78c58a8351..2c11bb72a8 100644 --- a/app/design/adminhtml/default/default/template/googlebase/items.phtml +++ b/app/design/adminhtml/default/default/template/googlebase/items.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/googlebase/types/edit/attributes.phtml b/app/design/adminhtml/default/default/template/googlebase/types/edit/attributes.phtml index a7029b1de8..7a06ec1617 100644 --- a/app/design/adminhtml/default/default/template/googlebase/types/edit/attributes.phtml +++ b/app/design/adminhtml/default/default/template/googlebase/types/edit/attributes.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/importexport/busy.phtml b/app/design/adminhtml/default/default/template/importexport/busy.phtml index 456a88f946..f15abae09f 100644 --- a/app/design/adminhtml/default/default/template/importexport/busy.phtml +++ b/app/design/adminhtml/default/default/template/importexport/busy.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/importexport/export/form/after.phtml b/app/design/adminhtml/default/default/template/importexport/export/form/after.phtml index 45be749741..f04348a965 100644 --- a/app/design/adminhtml/default/default/template/importexport/export/form/after.phtml +++ b/app/design/adminhtml/default/default/template/importexport/export/form/after.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -33,7 +33,7 @@
    - +
    diff --git a/app/design/adminhtml/default/default/template/report/refresh/statistics.phtml b/app/design/adminhtml/default/default/template/report/refresh/statistics.phtml index c4dc32a97b..683776eb10 100644 --- a/app/design/adminhtml/default/default/template/report/refresh/statistics.phtml +++ b/app/design/adminhtml/default/default/template/report/refresh/statistics.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/report/store/switcher.phtml b/app/design/adminhtml/default/default/template/report/store/switcher.phtml index aec031ccbb..08ea6a430f 100644 --- a/app/design/adminhtml/default/default/template/report/store/switcher.phtml +++ b/app/design/adminhtml/default/default/template/report/store/switcher.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -30,7 +30,7 @@ */ ?> isShow()): ?> -

    +

    +getHintHtml() ?>

    - + -
    + - - + +
    - + + + +
    + + + + + +
    +
    + - - + +
    + + +
    + {#media_dlg.flash_options} + + + + + + + + + + + + + + + + + @@ -304,45 +390,57 @@
    + + + +
    + + + +
    - +
    - - + +
    - +
    - - + +
    - +
    - - + +
    - +
    - - + +
    + + + + + + + + + + + +
    -
    +
    {#media_dlg.qt_options} - +
    @@ -350,19 +448,19 @@ @@ -370,19 +468,19 @@ @@ -390,19 +488,19 @@ @@ -410,27 +508,27 @@ - - + - - + + - - + + - - + + - - + + - - + + - - + + - +
    - +
    - - + +
    - +
    - - + +
    - +
    - - + +
    - +
    - - + +
    - +
    - - + +
    - +
    - - + +
    - +
    - - + +
    - +
    - - + +
    - +
    - - + +
    - +
    - - + +
    - - - - - -
     
    + + + + + +
     
    -
    +
    {#media_dlg.wmp_options} - +
    @@ -504,19 +602,19 @@ @@ -524,19 +622,19 @@ @@ -544,86 +642,86 @@ - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + +
    - +
    - - + +
    - +
    - - + +
    - +
    - - + +
    - +
    - - + +
    - +
    - - + +
    - +
    - - + +
    - +
    - - + +
    - +
    - - + +
    -
    +
    {#media_dlg.rmp_options} - +
    @@ -631,19 +729,19 @@ @@ -651,19 +749,19 @@ @@ -671,19 +769,19 @@ @@ -691,10 +789,10 @@ @@ -705,19 +803,19 @@ - - + + - - + + - - + + - - + +
    - +
    - - + +
    - +
    - - + +
    - +
    - - + +
    - +
    - - + +
    - +
    - - + +
    - +
    - - + +
    - +
    - - + +
    - +
    - - + +
    - +
    - - + +
    @@ -725,11 +823,11 @@
    {#media_dlg.shockwave_options} - +
    - +
    - @@ -738,13 +836,13 @@
    - @@ -754,7 +852,7 @@ - @@ -765,18 +863,18 @@
    - +
    - +
    - +
    - +
    @@ -786,18 +884,18 @@
    - +
    - +
    - +
    - +
    @@ -806,6 +904,13 @@
    + +
    +
    + {#media_dlg.source} + +
    +
    diff --git a/js/tiny_mce/plugins/media/moxieplayer.swf b/js/tiny_mce/plugins/media/moxieplayer.swf new file mode 100644 index 0000000000000000000000000000000000000000..585d772d6d3c23626fddfa58c4220b056783e148 GIT binary patch literal 19980 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 b==_iWodI83J<=N literal 0 HcmV?d00001 diff --git a/js/tiny_mce/plugins/nonbreaking/editor_plugin.js b/js/tiny_mce/plugins/nonbreaking/editor_plugin.js index f2dbbff2bb..687f548669 100644 --- a/js/tiny_mce/plugins/nonbreaking/editor_plugin.js +++ b/js/tiny_mce/plugins/nonbreaking/editor_plugin.js @@ -1 +1 @@ -(function(){tinymce.create("tinymce.plugins.Nonbreaking",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceNonBreaking",function(){a.execCommand("mceInsertContent",false,(a.plugins.visualchars&&a.plugins.visualchars.state)?'·':" ")});a.addButton("nonbreaking",{title:"nonbreaking.nonbreaking_desc",cmd:"mceNonBreaking"});if(a.getParam("nonbreaking_force_tab")){a.onKeyDown.add(function(d,f){if(tinymce.isIE&&f.keyCode==9){d.execCommand("mceNonBreaking");d.execCommand("mceNonBreaking");d.execCommand("mceNonBreaking");tinymce.dom.Event.cancel(f)}})}},getInfo:function(){return{longname:"Nonbreaking space",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/nonbreaking",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("nonbreaking",tinymce.plugins.Nonbreaking)})(); \ No newline at end of file +(function(){tinymce.create("tinymce.plugins.Nonbreaking",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceNonBreaking",function(){a.execCommand("mceInsertContent",false,(a.plugins.visualchars&&a.plugins.visualchars.state)?' ':" ")});a.addButton("nonbreaking",{title:"nonbreaking.nonbreaking_desc",cmd:"mceNonBreaking"});if(a.getParam("nonbreaking_force_tab")){a.onKeyDown.add(function(d,f){if(f.keyCode==9){f.preventDefault();d.execCommand("mceNonBreaking");d.execCommand("mceNonBreaking");d.execCommand("mceNonBreaking")}})}},getInfo:function(){return{longname:"Nonbreaking space",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/nonbreaking",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("nonbreaking",tinymce.plugins.Nonbreaking)})(); \ No newline at end of file diff --git a/js/tiny_mce/plugins/nonbreaking/editor_plugin_src.js b/js/tiny_mce/plugins/nonbreaking/editor_plugin_src.js index e3b078bfae..d492fbefe4 100644 --- a/js/tiny_mce/plugins/nonbreaking/editor_plugin_src.js +++ b/js/tiny_mce/plugins/nonbreaking/editor_plugin_src.js @@ -17,7 +17,7 @@ // Register commands ed.addCommand('mceNonBreaking', function() { - ed.execCommand('mceInsertContent', false, (ed.plugins.visualchars && ed.plugins.visualchars.state) ? '·' : ' '); + ed.execCommand('mceInsertContent', false, (ed.plugins.visualchars && ed.plugins.visualchars.state) ? ' ' : ' '); }); // Register buttons @@ -25,11 +25,12 @@ if (ed.getParam('nonbreaking_force_tab')) { ed.onKeyDown.add(function(ed, e) { - if (tinymce.isIE && e.keyCode == 9) { + if (e.keyCode == 9) { + e.preventDefault(); + ed.execCommand('mceNonBreaking'); ed.execCommand('mceNonBreaking'); ed.execCommand('mceNonBreaking'); - tinymce.dom.Event.cancel(e); } }); } diff --git a/js/tiny_mce/plugins/noneditable/editor_plugin.js b/js/tiny_mce/plugins/noneditable/editor_plugin.js index 9945cd8580..2d60138eec 100644 --- a/js/tiny_mce/plugins/noneditable/editor_plugin.js +++ b/js/tiny_mce/plugins/noneditable/editor_plugin.js @@ -1 +1 @@ -(function(){var a=tinymce.dom.Event;tinymce.create("tinymce.plugins.NonEditablePlugin",{init:function(d,e){var f=this,c,b;f.editor=d;c=d.getParam("noneditable_editable_class","mceEditable");b=d.getParam("noneditable_noneditable_class","mceNonEditable");d.onNodeChange.addToTop(function(h,g,k){var j,i;j=h.dom.getParent(h.selection.getStart(),function(l){return h.dom.hasClass(l,b)});i=h.dom.getParent(h.selection.getEnd(),function(l){return h.dom.hasClass(l,b)});if(j||i){f._setDisabled(1);return false}else{f._setDisabled(0)}})},getInfo:function(){return{longname:"Non editable elements",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/noneditable",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_block:function(c,d){var b=d.keyCode;if((b>32&&b<41)||(b>111&&b<124)){return}return a.cancel(d)},_setDisabled:function(d){var c=this,b=c.editor;tinymce.each(b.controlManager.controls,function(e){e.setDisabled(d)});if(d!==c.disabled){if(d){b.onKeyDown.addToTop(c._block);b.onKeyPress.addToTop(c._block);b.onKeyUp.addToTop(c._block);b.onPaste.addToTop(c._block)}else{b.onKeyDown.remove(c._block);b.onKeyPress.remove(c._block);b.onKeyUp.remove(c._block);b.onPaste.remove(c._block)}c.disabled=d}}});tinymce.PluginManager.add("noneditable",tinymce.plugins.NonEditablePlugin)})(); \ No newline at end of file +(function(){var a=tinymce.dom.Event;tinymce.create("tinymce.plugins.NonEditablePlugin",{init:function(d,e){var f=this,c,b,g;f.editor=d;c=d.getParam("noneditable_editable_class","mceEditable");b=d.getParam("noneditable_noneditable_class","mceNonEditable");d.onNodeChange.addToTop(function(i,h,l){var k,j;k=i.dom.getParent(i.selection.getStart(),function(m){return i.dom.hasClass(m,b)});j=i.dom.getParent(i.selection.getEnd(),function(m){return i.dom.hasClass(m,b)});if(k||j){g=1;f._setDisabled(1);return false}else{if(g==1){f._setDisabled(0);g=0}}})},getInfo:function(){return{longname:"Non editable elements",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/noneditable",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_block:function(c,d){var b=d.keyCode;if((b>32&&b<41)||(b>111&&b<124)){return}return a.cancel(d)},_setDisabled:function(d){var c=this,b=c.editor;tinymce.each(b.controlManager.controls,function(e){e.setDisabled(d)});if(d!==c.disabled){if(d){b.onKeyDown.addToTop(c._block);b.onKeyPress.addToTop(c._block);b.onKeyUp.addToTop(c._block);b.onPaste.addToTop(c._block);b.onContextMenu.addToTop(c._block)}else{b.onKeyDown.remove(c._block);b.onKeyPress.remove(c._block);b.onKeyUp.remove(c._block);b.onPaste.remove(c._block);b.onContextMenu.remove(c._block)}c.disabled=d}}});tinymce.PluginManager.add("noneditable",tinymce.plugins.NonEditablePlugin)})(); \ No newline at end of file diff --git a/js/tiny_mce/plugins/noneditable/editor_plugin_src.js b/js/tiny_mce/plugins/noneditable/editor_plugin_src.js index 656c971b8c..916dce29cf 100644 --- a/js/tiny_mce/plugins/noneditable/editor_plugin_src.js +++ b/js/tiny_mce/plugins/noneditable/editor_plugin_src.js @@ -13,7 +13,7 @@ tinymce.create('tinymce.plugins.NonEditablePlugin', { init : function(ed, url) { - var t = this, editClass, nonEditClass; + var t = this, editClass, nonEditClass, state; t.editor = ed; editClass = ed.getParam("noneditable_editable_class", "mceEditable"); @@ -33,10 +33,13 @@ // Block or unblock if (sc || ec) { + state = 1; t._setDisabled(1); return false; - } else + } else if (state == 1) { t._setDisabled(0); + state = 0; + } }); }, @@ -73,11 +76,13 @@ ed.onKeyPress.addToTop(t._block); ed.onKeyUp.addToTop(t._block); ed.onPaste.addToTop(t._block); + ed.onContextMenu.addToTop(t._block); } else { ed.onKeyDown.remove(t._block); ed.onKeyPress.remove(t._block); ed.onKeyUp.remove(t._block); ed.onPaste.remove(t._block); + ed.onContextMenu.remove(t._block); } t.disabled = s; diff --git a/js/tiny_mce/plugins/pagebreak/editor_plugin.js b/js/tiny_mce/plugins/pagebreak/editor_plugin.js index a212f69633..35085e8adc 100644 --- a/js/tiny_mce/plugins/pagebreak/editor_plugin.js +++ b/js/tiny_mce/plugins/pagebreak/editor_plugin.js @@ -1 +1 @@ -(function(){tinymce.create("tinymce.plugins.PageBreakPlugin",{init:function(b,d){var f='',a="mcePageBreak",c=b.getParam("pagebreak_separator",""),e;e=new RegExp(c.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(g){return"\\"+g}),"g");b.addCommand("mcePageBreak",function(){b.execCommand("mceInsertContent",0,f)});b.addButton("pagebreak",{title:"pagebreak.desc",cmd:a});b.onInit.add(function(){if(b.settings.content_css!==false){b.dom.loadCSS(d+"/css/content.css")}if(b.theme.onResolveName){b.theme.onResolveName.add(function(g,h){if(h.node.nodeName=="IMG"&&b.dom.hasClass(h.node,a)){h.name="pagebreak"}})}});b.onClick.add(function(g,h){h=h.target;if(h.nodeName==="IMG"&&g.dom.hasClass(h,a)){g.selection.select(h)}});b.onNodeChange.add(function(h,g,i){g.setActive("pagebreak",i.nodeName==="IMG"&&h.dom.hasClass(i,a))});b.onBeforeSetContent.add(function(g,h){h.content=h.content.replace(e,f)});b.onPostProcess.add(function(g,h){if(h.get){h.content=h.content.replace(/]+>/g,function(i){if(i.indexOf('class="mcePageBreak')!==-1){i=c}return i})}})},getInfo:function(){return{longname:"PageBreak",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/pagebreak",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("pagebreak",tinymce.plugins.PageBreakPlugin)})(); \ No newline at end of file +(function(){tinymce.create("tinymce.plugins.PageBreakPlugin",{init:function(b,d){var f='',a="mcePageBreak",c=b.getParam("pagebreak_separator",""),e;e=new RegExp(c.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(g){return"\\"+g}),"g");b.addCommand("mcePageBreak",function(){b.execCommand("mceInsertContent",0,f)});b.addButton("pagebreak",{title:"pagebreak.desc",cmd:a});b.onInit.add(function(){if(b.theme.onResolveName){b.theme.onResolveName.add(function(g,h){if(h.node.nodeName=="IMG"&&b.dom.hasClass(h.node,a)){h.name="pagebreak"}})}});b.onClick.add(function(g,h){h=h.target;if(h.nodeName==="IMG"&&g.dom.hasClass(h,a)){g.selection.select(h)}});b.onNodeChange.add(function(h,g,i){g.setActive("pagebreak",i.nodeName==="IMG"&&h.dom.hasClass(i,a))});b.onBeforeSetContent.add(function(g,h){h.content=h.content.replace(e,f)});b.onPostProcess.add(function(g,h){if(h.get){h.content=h.content.replace(/]+>/g,function(i){if(i.indexOf('class="mcePageBreak')!==-1){i=c}return i})}})},getInfo:function(){return{longname:"PageBreak",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/pagebreak",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("pagebreak",tinymce.plugins.PageBreakPlugin)})(); \ No newline at end of file diff --git a/js/tiny_mce/plugins/pagebreak/editor_plugin_src.js b/js/tiny_mce/plugins/pagebreak/editor_plugin_src.js index 4e1eb0a7aa..a094c19162 100644 --- a/js/tiny_mce/plugins/pagebreak/editor_plugin_src.js +++ b/js/tiny_mce/plugins/pagebreak/editor_plugin_src.js @@ -11,7 +11,7 @@ (function() { tinymce.create('tinymce.plugins.PageBreakPlugin', { init : function(ed, url) { - var pb = '', cls = 'mcePageBreak', sep = ed.getParam('pagebreak_separator', ''), pbRE; + var pb = '', cls = 'mcePageBreak', sep = ed.getParam('pagebreak_separator', ''), pbRE; pbRE = new RegExp(sep.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g, function(a) {return '\\' + a;}), 'g'); @@ -24,9 +24,6 @@ ed.addButton('pagebreak', {title : 'pagebreak.desc', cmd : cls}); ed.onInit.add(function() { - if (ed.settings.content_css !== false) - ed.dom.loadCSS(url + "/css/content.css"); - if (ed.theme.onResolveName) { ed.theme.onResolveName.add(function(th, o) { if (o.node.nodeName == 'IMG' && ed.dom.hasClass(o.node, cls)) diff --git a/js/tiny_mce/plugins/paste/editor_plugin.js b/js/tiny_mce/plugins/paste/editor_plugin.js index 3e7b2504f1..e47a5c630a 100644 --- a/js/tiny_mce/plugins/paste/editor_plugin.js +++ b/js/tiny_mce/plugins/paste/editor_plugin.js @@ -1 +1 @@ -(function(){var c=tinymce.each,d=null,a={paste_auto_cleanup_on_paste:true,paste_block_drop:false,paste_retain_style_properties:"none",paste_strip_class_attributes:"mso",paste_remove_spans:false,paste_remove_styles:false,paste_remove_styles_if_webkit:true,paste_convert_middot_lists:true,paste_convert_headers_to_strong:false,paste_dialog_width:"450",paste_dialog_height:"400",paste_text_use_dialog:false,paste_text_sticky:false,paste_text_notifyalways:false,paste_text_linebreaktype:"p",paste_text_replacements:[[/\u2026/g,"..."],[/[\x93\x94\u201c\u201d]/g,'"'],[/[\x60\x91\x92\u2018\u2019]/g,"'"]]};function b(e,f){return e.getParam(f,a[f])}tinymce.create("tinymce.plugins.PastePlugin",{init:function(e,f){var g=this;g.editor=e;g.url=f;g.onPreProcess=new tinymce.util.Dispatcher(g);g.onPostProcess=new tinymce.util.Dispatcher(g);g.onPreProcess.add(g._preProcess);g.onPostProcess.add(g._postProcess);g.onPreProcess.add(function(j,k){e.execCallback("paste_preprocess",j,k)});g.onPostProcess.add(function(j,k){e.execCallback("paste_postprocess",j,k)});e.pasteAsPlainText=false;function i(l,j){var k=e.dom;g.onPreProcess.dispatch(g,l);l.node=k.create("div",0,l.content);g.onPostProcess.dispatch(g,l);l.content=e.serializer.serialize(l.node,{getInner:1});if((!j)&&(e.pasteAsPlainText)){g._insertPlainText(e,k,l.content);if(!b(e,"paste_text_sticky")){e.pasteAsPlainText=false;e.controlManager.setActive("pastetext",false)}}else{if(/<(p|h[1-6]|ul|ol)/.test(l.content)){g._insertBlockContent(e,k,l.content)}else{g._insert(l.content)}}}e.addCommand("mceInsertClipboardContent",function(j,k){i(k,true)});if(!b(e,"paste_text_use_dialog")){e.addCommand("mcePasteText",function(k,j){var l=tinymce.util.Cookie;e.pasteAsPlainText=!e.pasteAsPlainText;e.controlManager.setActive("pastetext",e.pasteAsPlainText);if((e.pasteAsPlainText)&&(!l.get("tinymcePasteText"))){if(b(e,"paste_text_sticky")){e.windowManager.alert(e.translate("paste.plaintext_mode_sticky"))}else{e.windowManager.alert(e.translate("paste.plaintext_mode_sticky"))}if(!b(e,"paste_text_notifyalways")){l.set("tinymcePasteText","1",new Date(new Date().getFullYear()+1,12,31))}}})}e.addButton("pastetext",{title:"paste.paste_text_desc",cmd:"mcePasteText"});e.addButton("selectall",{title:"paste.selectall_desc",cmd:"selectall"});function h(s){var m,q,k,l=e.selection,p=e.dom,r=e.getBody(),j;if(e.pasteAsPlainText&&(s.clipboardData||p.doc.dataTransfer)){s.preventDefault();i({content:(s.clipboardData||p.doc.dataTransfer).getData("Text")},true);return}if(p.get("_mcePaste")){return}m=p.add(r,"div",{id:"_mcePaste","class":"mcePaste"},"\uFEFF");if(r!=e.getDoc().body){j=p.getPos(e.selection.getStart(),r).y}else{j=r.scrollTop}p.setStyles(m,{position:"absolute",left:-10000,top:j,width:1,height:1,overflow:"hidden"});if(tinymce.isIE){k=p.doc.body.createTextRange();k.moveToElementText(m);k.execCommand("Paste");p.remove(m);if(m.innerHTML==="\uFEFF"){e.execCommand("mcePasteWord");s.preventDefault();return}i({content:m.innerHTML});return tinymce.dom.Event.cancel(s)}else{function o(n){n.preventDefault()}p.bind(e.getDoc(),"mousedown",o);p.bind(e.getDoc(),"keydown",o);q=e.selection.getRng();m=m.firstChild;k=e.getDoc().createRange();k.setStart(m,0);k.setEnd(m,1);l.setRng(k);window.setTimeout(function(){var t="",n=p.select("div.mcePaste");c(n,function(u){c(p.select("div.mcePaste",u),function(v){p.remove(v,1)});c(p.select("span.Apple-style-span",u),function(v){p.remove(v,1)});t+=u.innerHTML});c(n,function(u){p.remove(u)});if(q){l.setRng(q)}i({content:t});p.unbind(e.getDoc(),"mousedown",o);p.unbind(e.getDoc(),"keydown",o)},0)}}if(b(e,"paste_auto_cleanup_on_paste")){if(tinymce.isOpera||/Firefox\/2/.test(navigator.userAgent)){e.onKeyDown.add(function(j,k){if(((tinymce.isMac?k.metaKey:k.ctrlKey)&&k.keyCode==86)||(k.shiftKey&&k.keyCode==45)){h(k)}})}else{e.onPaste.addToTop(function(j,k){return h(k)})}}if(b(e,"paste_block_drop")){e.onInit.add(function(){e.dom.bind(e.getBody(),["dragend","dragover","draggesture","dragdrop","drop","drag"],function(j){j.preventDefault();j.stopPropagation();return false})})}g._legacySupport()},getInfo:function(){return{longname:"Paste text/word",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_preProcess:function(i,f){var l=this.editor,k=f.content,q=tinymce.grep,p=tinymce.explode,g=tinymce.trim,m,j;function e(h){c(h,function(o){if(o.constructor==RegExp){k=k.replace(o,"")}else{k=k.replace(o[0],o[1])}})}if(/class="?Mso|style="[^"]*\bmso-|w:WordDocument/i.test(k)||f.wordContent){f.wordContent=true;e([/^\s*( )+/gi,/( |]*>)+\s*$/gi]);if(b(l,"paste_convert_headers_to_strong")){k=k.replace(/

    ]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi,"

    $1

    ")}if(b(l,"paste_convert_middot_lists")){e([[//gi,"$&__MCE_ITEM__"],[/(]+(?:mso-list:|:\s*symbol)[^>]+>)/gi,"$1__MCE_ITEM__"]])}e([//gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/ /gi,"\u00a0"]]);do{m=k.length;k=k.replace(/(<[a-z][^>]*\s)(?:id|name|language|type|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi,"$1")}while(m!=k.length);if(b(l,"paste_retain_style_properties").replace(/^none$/i,"").length==0){k=k.replace(/<\/?span[^>]*>/gi,"")}else{e([[/([\s\u00a0]*)<\/span>/gi,function(o,h){return(h.length>0)?h.replace(/./," ").slice(Math.floor(h.length/2)).split("").join("\u00a0"):""}],[/(<[a-z][^>]*)\sstyle="([^"]*)"/gi,function(u,h,t){var v=[],o=0,r=p(g(t).replace(/"/gi,"'"),";");c(r,function(s){var w,y,z=p(s,":");function x(A){return A+((A!=="0")&&(/\d$/.test(A)))?"px":""}if(z.length==2){w=z[0].toLowerCase();y=z[1].toLowerCase();switch(w){case"mso-padding-alt":case"mso-padding-top-alt":case"mso-padding-right-alt":case"mso-padding-bottom-alt":case"mso-padding-left-alt":case"mso-margin-alt":case"mso-margin-top-alt":case"mso-margin-right-alt":case"mso-margin-bottom-alt":case"mso-margin-left-alt":case"mso-table-layout-alt":case"mso-height":case"mso-width":case"mso-vertical-align-alt":v[o++]=w.replace(/^mso-|-alt$/g,"")+":"+x(y);return;case"horiz-align":v[o++]="text-align:"+y;return;case"vert-align":v[o++]="vertical-align:"+y;return;case"font-color":case"mso-foreground":v[o++]="color:"+y;return;case"mso-background":case"mso-highlight":v[o++]="background:"+y;return;case"mso-default-height":v[o++]="min-height:"+x(y);return;case"mso-default-width":v[o++]="min-width:"+x(y);return;case"mso-padding-between-alt":v[o++]="border-collapse:separate;border-spacing:"+x(y);return;case"text-line-through":if((y=="single")||(y=="double")){v[o++]="text-decoration:line-through"}return;case"mso-zero-height":if(y=="yes"){v[o++]="display:none"}return}if(/^(mso|column|font-emph|lang|layout|line-break|list-image|nav|panose|punct|row|ruby|sep|size|src|tab-|table-border|text-(?!align|decor|indent|trans)|top-bar|version|vnd|word-break)/.test(w)){return}v[o++]=w+":"+z[1]}});if(o>0){return h+' style="'+v.join(";")+'"'}else{return h}}]])}}if(b(l,"paste_convert_headers_to_strong")){e([[/]*>/gi,"

    "],[/<\/h[1-6][^>]*>/gi,"

    "]])}j=b(l,"paste_strip_class_attributes");if(j!=="none"){function n(r,o){if(j==="all"){return""}var h=q(p(o.replace(/^(["'])(.*)\1$/,"$2")," "),function(s){return(/^(?!mso)/i.test(s))});return h.length?' class="'+h.join(" ")+'"':""}k=k.replace(/ class="([^"]+)"/gi,n);k=k.replace(/ class=(\w+)/gi,n)}if(b(l,"paste_remove_spans")){k=k.replace(/<\/?span[^>]*>/gi,"")}f.content=k},_postProcess:function(h,j){var g=this,f=g.editor,i=f.dom,e;if(j.wordContent){c(i.select("a",j.node),function(k){if(!k.href||k.href.indexOf("#_Toc")!=-1){i.remove(k,1)}});if(b(f,"paste_convert_middot_lists")){g._convertLists(h,j)}e=b(f,"paste_retain_style_properties");if((tinymce.is(e,"string"))&&(e!=="all")&&(e!=="*")){e=tinymce.explode(e.replace(/^none$/i,""));c(i.select("*",j.node),function(n){var o={},l=0,m,p,k;if(e){for(m=0;m0){i.setStyles(n,o)}else{if(n.nodeName=="SPAN"&&!n.className){i.remove(n,true)}}})}}if(b(f,"paste_remove_styles")||(b(f,"paste_remove_styles_if_webkit")&&tinymce.isWebKit)){c(i.select("*[style]",j.node),function(k){k.removeAttribute("style");k.removeAttribute("_mce_style")})}else{if(tinymce.isWebKit){c(i.select("*",j.node),function(k){k.removeAttribute("_mce_style")})}}},_convertLists:function(h,f){var j=h.editor.dom,i,m,e=-1,g,n=[],l,k;c(j.select("p",f.node),function(u){var r,v="",t,s,o,q;for(r=u.firstChild;r&&r.nodeType==3;r=r.nextSibling){v+=r.nodeValue}v=u.innerHTML.replace(/<\/?\w+[^>]*>/gi,"").replace(/ /g,"\u00a0");if(/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o]\s*\u00a0*/.test(v)){t="ul"}if(/^__MCE_ITEM__\s*\w+\.\s*\u00a0{2,}/.test(v)){t="ol"}if(t){g=parseFloat(u.style.marginLeft||0);if(g>e){n.push(g)}if(!i||t!=l){i=j.create(t);j.insertAfter(i,u)}else{if(g>e){i=m.appendChild(j.create(t))}else{if(g]*>/gi,"");if(t=="ul"&&/^[\u2022\u00b7\u00a7\u00d8o]/.test(p)){j.remove(w)}else{if(/^[\s\S]*\w+\.( |\u00a0)*\s*/.test(p)){j.remove(w)}}});s=u.innerHTML;if(t=="ul"){s=u.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^[\u2022\u00b7\u00a7\u00d8o]\s*( |\u00a0)+\s*/,"")}else{s=u.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^\s*\w+\.( |\u00a0)+\s*/,"")}m=i.appendChild(j.create("li",0,s));j.remove(u);e=g;l=t}else{i=e=0}});k=f.node.innerHTML;if(k.indexOf("__MCE_ITEM__")!=-1){f.node.innerHTML=k.replace(/__MCE_ITEM__/g,"")}},_insertBlockContent:function(l,h,m){var f,j,g=l.selection,q,n,e,o,i,k="mce_marker";function p(t){var s;if(tinymce.isIE){s=l.getDoc().body.createTextRange();s.moveToElementText(t);s.collapse(false);s.select()}else{g.select(t,1);g.collapse(false)}}this._insert(' ',1);j=h.get(k);f=h.getParent(j,"p,h1,h2,h3,h4,h5,h6,ul,ol,th,td");if(f&&!/TD|TH/.test(f.nodeName)){j=h.split(f,j);c(h.create("div",0,m).childNodes,function(r){q=j.parentNode.insertBefore(r.cloneNode(true),j)});p(q)}else{h.setOuterHTML(j,m);g.select(l.getBody(),1);g.collapse(0)}while(n=h.get(k)){h.remove(n)}n=g.getStart();e=h.getViewPort(l.getWin());o=l.dom.getPos(n).y;i=n.clientHeight;if(oe.y+e.h){l.getDoc().body.scrollTop=o0)){if(!d){d=("34,quot,38,amp,39,apos,60,lt,62,gt,"+j.serializer.settings.entities).split(",")}if(/<(?:p|br|h[1-6]|ul|ol|dl|table|t[rdh]|div|blockquote|fieldset|pre|address|center)[^>]*>/i.test(v)){q([/[\n\r]+/g])}else{q([/\r+/g])}q([[/<\/(?:p|h[1-6]|ul|ol|dl|table|div|blockquote|fieldset|pre|address|center)>/gi,"\n\n"],[/]*>|<\/tr>/gi,"\n"],[/<\/t[dh]>\s*]*>/gi,"\t"],/<[a-z!\/?][^>]*>/gi,[/ /gi," "],[/&(#\d+|[a-z0-9]{1,10});/gi,function(i,h){if(h.charAt(0)==="#"){return String.fromCharCode(h.slice(1))}else{return((i=y(d,h))>0)?String.fromCharCode(d[i-1]):" "}}],[/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi,"$1"],[/\n{3,}/g,"\n\n"],/^\s+|\s+$/g]);v=x.encode(v);if(!s.isCollapsed()){z.execCommand("Delete",false,null)}if(m(o,"array")||(m(o,"array"))){q(o)}else{if(m(o,"string")){q(new RegExp(o,"gi"))}}if(g=="none"){q([[/\n+/g," "]])}else{if(g=="br"){q([[/\n/g,"
    "]])}else{q([/^\s+|\s+$/g,[/\n\n/g,"

    "],[/\n/g,"
    "]])}}if((l=v.indexOf("

    "))!=-1){k=v.lastIndexOf("

    ");r=s.getNode();e=[];do{if(r.nodeType==1){if(r.nodeName=="TD"||r.nodeName=="BODY"){break}e[e.length]=r}}while(r=r.parentNode);if(e.length>0){p=v.substring(0,l);f="";for(t=0,u=e.length;t";f+="<"+e[e.length-t-1].nodeName.toLowerCase()+">"}if(l==k){v=p+f+v.substring(l+7)}else{v=p+v.substring(l+4,k+4)+f+v.substring(k+7)}}}j.execCommand("mceInsertRawHTML",false,v+' ');window.setTimeout(function(){var h=x.get("_plain_text_marker"),B,i,A,w;s.select(h,false);z.execCommand("Delete",false,null);h=null;B=s.getStart();i=x.getViewPort(n);A=x.getPos(B).y;w=B.clientHeight;if((Ai.y+i.h)){z.body.scrollTop=A")});return}}if(o.get("_mcePaste")){return}l=o.add(q,"div",{id:"_mcePaste","class":"mcePaste","data-mce-bogus":"1"},"\uFEFF\uFEFF");if(q!=d.getDoc().body){i=o.getPos(d.selection.getStart(),q).y}else{i=q.scrollTop+o.getViewPort(d.getWin()).y}o.setStyles(l,{position:"absolute",left:tinymce.isGecko?-40:0,top:i-25,width:1,height:1,overflow:"hidden"});if(tinymce.isIE){t=k.getRng();j=o.doc.body.createTextRange();j.moveToElementText(l);j.execCommand("Paste");o.remove(l);if(l.innerHTML==="\uFEFF\uFEFF"){d.execCommand("mcePasteWord");s.preventDefault();return}k.setRng(t);k.setContent("");setTimeout(function(){h({content:l.innerHTML})},0);return tinymce.dom.Event.cancel(s)}else{function m(n){n.preventDefault()}o.bind(d.getDoc(),"mousedown",m);o.bind(d.getDoc(),"keydown",m);p=d.selection.getRng();l=l.firstChild;j=d.getDoc().createRange();j.setStart(l,0);j.setEnd(l,2);k.setRng(j);window.setTimeout(function(){var u="",n;if(!o.select("div.mcePaste > div.mcePaste").length){n=o.select("div.mcePaste");c(n,function(w){var v=w.firstChild;if(v&&v.nodeName=="DIV"&&v.style.marginTop&&v.style.backgroundColor){o.remove(v,1)}c(o.select("span.Apple-style-span",w),function(x){o.remove(x,1)});c(o.select("br[data-mce-bogus]",w),function(x){o.remove(x)});if(w.parentNode.className!="mcePaste"){u+=w.innerHTML}})}else{u="

    "+o.encode(r).replace(/\r?\n\r?\n/g,"

    ").replace(/\r?\n/g,"
    ")+"

    "}c(o.select("div.mcePaste"),function(v){o.remove(v)});if(p){k.setRng(p)}h({content:u});o.unbind(d.getDoc(),"mousedown",m);o.unbind(d.getDoc(),"keydown",m)},0)}}if(b(d,"paste_auto_cleanup_on_paste")){if(tinymce.isOpera||/Firefox\/2/.test(navigator.userAgent)){d.onKeyDown.addToTop(function(i,j){if(((tinymce.isMac?j.metaKey:j.ctrlKey)&&j.keyCode==86)||(j.shiftKey&&j.keyCode==45)){g(j)}})}else{d.onPaste.addToTop(function(i,j){return g(j)})}}d.onInit.add(function(){d.controlManager.setActive("pastetext",d.pasteAsPlainText);if(b(d,"paste_block_drop")){d.dom.bind(d.getBody(),["dragend","dragover","draggesture","dragdrop","drop","drag"],function(i){i.preventDefault();i.stopPropagation();return false})}});f._legacySupport()},getInfo:function(){return{longname:"Paste text/word",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_preProcess:function(g,e){var k=this.editor,j=e.content,p=tinymce.grep,n=tinymce.explode,f=tinymce.trim,l,i;function d(h){c(h,function(o){if(o.constructor==RegExp){j=j.replace(o,"")}else{j=j.replace(o[0],o[1])}})}if(k.settings.paste_enable_default_filters==false){return}if(tinymce.isIE&&document.documentMode>=9){d([[/(?:
     [\s\r\n]+|
    )*(<\/?(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)[^>]*>)(?:
     [\s\r\n]+|
    )*/g,"$1"]]);d([[/

    /g,"

    "],[/
    /g," "],[/

    /g,"
    "]])}if(/class="?Mso|style="[^"]*\bmso-|w:WordDocument/i.test(j)||e.wordContent){e.wordContent=true;d([/^\s*( )+/gi,/( |]*>)+\s*$/gi]);if(b(k,"paste_convert_headers_to_strong")){j=j.replace(/

    ]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi,"

    $1

    ")}if(b(k,"paste_convert_middot_lists")){d([[//gi,"$&__MCE_ITEM__"],[/(]+(?:mso-list:|:\s*symbol)[^>]+>)/gi,"$1__MCE_ITEM__"],[/(]+(?:MsoListParagraph)[^>]+>)/gi,"$1__MCE_ITEM__"]])}d([//gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/ /gi,"\u00a0"]]);do{l=j.length;j=j.replace(/(<[a-z][^>]*\s)(?:id|name|language|type|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi,"$1")}while(l!=j.length);if(b(k,"paste_retain_style_properties").replace(/^none$/i,"").length==0){j=j.replace(/<\/?span[^>]*>/gi,"")}else{d([[/([\s\u00a0]*)<\/span>/gi,function(o,h){return(h.length>0)?h.replace(/./," ").slice(Math.floor(h.length/2)).split("").join("\u00a0"):""}],[/(<[a-z][^>]*)\sstyle="([^"]*)"/gi,function(t,h,r){var u=[],o=0,q=n(f(r).replace(/"/gi,"'"),";");c(q,function(s){var w,y,z=n(s,":");function x(A){return A+((A!=="0")&&(/\d$/.test(A)))?"px":""}if(z.length==2){w=z[0].toLowerCase();y=z[1].toLowerCase();switch(w){case"mso-padding-alt":case"mso-padding-top-alt":case"mso-padding-right-alt":case"mso-padding-bottom-alt":case"mso-padding-left-alt":case"mso-margin-alt":case"mso-margin-top-alt":case"mso-margin-right-alt":case"mso-margin-bottom-alt":case"mso-margin-left-alt":case"mso-table-layout-alt":case"mso-height":case"mso-width":case"mso-vertical-align-alt":u[o++]=w.replace(/^mso-|-alt$/g,"")+":"+x(y);return;case"horiz-align":u[o++]="text-align:"+y;return;case"vert-align":u[o++]="vertical-align:"+y;return;case"font-color":case"mso-foreground":u[o++]="color:"+y;return;case"mso-background":case"mso-highlight":u[o++]="background:"+y;return;case"mso-default-height":u[o++]="min-height:"+x(y);return;case"mso-default-width":u[o++]="min-width:"+x(y);return;case"mso-padding-between-alt":u[o++]="border-collapse:separate;border-spacing:"+x(y);return;case"text-line-through":if((y=="single")||(y=="double")){u[o++]="text-decoration:line-through"}return;case"mso-zero-height":if(y=="yes"){u[o++]="display:none"}return}if(/^(mso|column|font-emph|lang|layout|line-break|list-image|nav|panose|punct|row|ruby|sep|size|src|tab-|table-border|text-(?!align|decor|indent|trans)|top-bar|version|vnd|word-break)/.test(w)){return}u[o++]=w+":"+z[1]}});if(o>0){return h+' style="'+u.join(";")+'"'}else{return h}}]])}}if(b(k,"paste_convert_headers_to_strong")){d([[/]*>/gi,"

    "],[/<\/h[1-6][^>]*>/gi,"

    "]])}d([[/Version:[\d.]+\nStartHTML:\d+\nEndHTML:\d+\nStartFragment:\d+\nEndFragment:\d+/gi,""]]);i=b(k,"paste_strip_class_attributes");if(i!=="none"){function m(q,o){if(i==="all"){return""}var h=p(n(o.replace(/^(["'])(.*)\1$/,"$2")," "),function(r){return(/^(?!mso)/i.test(r))});return h.length?' class="'+h.join(" ")+'"':""}j=j.replace(/ class="([^"]+)"/gi,m);j=j.replace(/ class=([\-\w]+)/gi,m)}if(b(k,"paste_remove_spans")){j=j.replace(/<\/?span[^>]*>/gi,"")}e.content=j},_postProcess:function(g,i){var f=this,e=f.editor,h=e.dom,d;if(e.settings.paste_enable_default_filters==false){return}if(i.wordContent){c(h.select("a",i.node),function(j){if(!j.href||j.href.indexOf("#_Toc")!=-1){h.remove(j,1)}});if(b(e,"paste_convert_middot_lists")){f._convertLists(g,i)}d=b(e,"paste_retain_style_properties");if((tinymce.is(d,"string"))&&(d!=="all")&&(d!=="*")){d=tinymce.explode(d.replace(/^none$/i,""));c(h.select("*",i.node),function(m){var n={},k=0,l,o,j;if(d){for(l=0;l0){h.setStyles(m,n)}else{if(m.nodeName=="SPAN"&&!m.className){h.remove(m,true)}}})}}if(b(e,"paste_remove_styles")||(b(e,"paste_remove_styles_if_webkit")&&tinymce.isWebKit)){c(h.select("*[style]",i.node),function(j){j.removeAttribute("style");j.removeAttribute("data-mce-style")})}else{if(tinymce.isWebKit){c(h.select("*",i.node),function(j){j.removeAttribute("data-mce-style")})}}},_convertLists:function(g,e){var i=g.editor.dom,h,l,d=-1,f,m=[],k,j;c(i.select("p",e.node),function(t){var q,u="",s,r,n,o;for(q=t.firstChild;q&&q.nodeType==3;q=q.nextSibling){u+=q.nodeValue}u=t.innerHTML.replace(/<\/?\w+[^>]*>/gi,"").replace(/ /g,"\u00a0");if(/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*\u00a0*/.test(u)){s="ul"}if(/^__MCE_ITEM__\s*\w+\.\s*\u00a0+/.test(u)){s="ol"}if(s){f=parseFloat(t.style.marginLeft||0);if(f>d){m.push(f)}if(!h||s!=k){h=i.create(s);i.insertAfter(h,t)}else{if(f>d){h=l.appendChild(i.create(s))}else{if(f]*>/gi,"");if(s=="ul"&&/^__MCE_ITEM__[\u2022\u00b7\u00a7\u00d8o\u25CF]/.test(p)){i.remove(v)}else{if(/^__MCE_ITEM__[\s\S]*\w+\.( |\u00a0)*\s*/.test(p)){i.remove(v)}}});r=t.innerHTML;if(s=="ul"){r=t.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*( |\u00a0)+\s*/,"")}else{r=t.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^\s*\w+\.( |\u00a0)+\s*/,"")}l=h.appendChild(i.create("li",0,r));i.remove(t);d=f;k=s}else{h=d=0}});j=e.node.innerHTML;if(j.indexOf("__MCE_ITEM__")!=-1){e.node.innerHTML=j.replace(/__MCE_ITEM__/g,"")}},_insert:function(f,d){var e=this.editor,g=e.selection.getRng();if(!e.selection.isCollapsed()&&g.startContainer!=g.endContainer){e.getDoc().execCommand("Delete",false,null)}e.execCommand("mceInsertContent",false,f,{skip_undo:d})},_insertPlainText:function(g){var d=this.editor,e=b(d,"paste_text_linebreaktype"),i=b(d,"paste_text_replacements"),f=tinymce.is;function h(j){c(j,function(k){if(k.constructor==RegExp){g=g.replace(k,"")}else{g=g.replace(k[0],k[1])}})}if((typeof(g)==="string")&&(g.length>0)){if(/<(?:p|br|h[1-6]|ul|ol|dl|table|t[rdh]|div|blockquote|fieldset|pre|address|center)[^>]*>/i.test(g)){h([/[\n\r]+/g])}else{h([/\r+/g])}h([[/<\/(?:p|h[1-6]|ul|ol|dl|table|div|blockquote|fieldset|pre|address|center)>/gi,"\n\n"],[/]*>|<\/tr>/gi,"\n"],[/<\/t[dh]>\s*]*>/gi,"\t"],/<[a-z!\/?][^>]*>/gi,[/ /gi," "],[/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi,"$1"],[/\n{3,}/g,"\n\n"]]);g=d.dom.decode(tinymce.html.Entities.encodeRaw(g));if(f(i,"array")){h(i)}else{if(f(i,"string")){h(new RegExp(i,"gi"))}}if(e=="none"){h([[/\n+/g," "]])}else{if(e=="br"){h([[/\n/g,"
    "]])}else{if(e=="p"){h([[/\n+/g,"

    "],[/^(.*<\/p>)(

    )$/,"

    $1"]])}else{h([[/\n\n/g,"

    "],[/^(.*<\/p>)(

    )$/,"

    $1"],[/\n/g,"
    "]])}}}d.execCommand("mceInsertContent",false,g)}},_legacySupport:function(){var e=this,d=e.editor;d.addCommand("mcePasteWord",function(){d.windowManager.open({file:e.url+"/pasteword.htm",width:parseInt(b(d,"paste_dialog_width")),height:parseInt(b(d,"paste_dialog_height")),inline:1})});if(b(d,"paste_text_use_dialog")){d.addCommand("mcePasteText",function(){d.windowManager.open({file:e.url+"/pastetext.htm",width:parseInt(b(d,"paste_dialog_width")),height:parseInt(b(d,"paste_dialog_height")),inline:1})})}d.addButton("pasteword",{title:"paste.paste_word_desc",cmd:"mcePasteWord"})}});tinymce.PluginManager.add("paste",tinymce.plugins.PastePlugin)})(); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/editor_plugin_src.js b/js/tiny_mce/plugins/paste/editor_plugin_src.js index 4c3bf6542e..73fe7fe9a4 100644 --- a/js/tiny_mce/plugins/paste/editor_plugin_src.js +++ b/js/tiny_mce/plugins/paste/editor_plugin_src.js @@ -10,9 +10,9 @@ (function() { var each = tinymce.each, - entities = null, defs = { paste_auto_cleanup_on_paste : true, + paste_enable_default_filters : true, paste_block_drop : false, paste_retain_style_properties : "none", paste_strip_class_attributes : "mso", @@ -25,8 +25,9 @@ paste_dialog_height : "400", paste_text_use_dialog : false, paste_text_sticky : false, + paste_text_sticky_default : false, paste_text_notifyalways : false, - paste_text_linebreaktype : "p", + paste_text_linebreaktype : "combined", paste_text_replacements : [ [/\u2026/g, "..."], [/[\x93\x94\u201c\u201d]/g, '"'], @@ -63,13 +64,19 @@ ed.execCallback('paste_postprocess', pl, o); }); + ed.onKeyDown.addToTop(function(ed, e) { + // Block ctrl+v from adding an undo level since the default logic in tinymce.Editor will add that + if (((tinymce.isMac ? e.metaKey : e.ctrlKey) && e.keyCode == 86) || (e.shiftKey && e.keyCode == 45)) + return false; // Stop other listeners + }); + // Initialize plain text flag - ed.pasteAsPlainText = false; + ed.pasteAsPlainText = getParam(ed, 'paste_text_sticky_default'); // This function executes the process handlers and inserts the contents // force_rich overrides plain text mode set by user, important for pasting with execCommand function process(o, force_rich) { - var dom = ed.dom; + var dom = ed.dom, rng; // Execute pre process handlers t.onPreProcess.dispatch(t, o); @@ -77,23 +84,31 @@ // Create DOM structure o.node = dom.create('div', 0, o.content); + // If pasting inside the same element and the contents is only one block + // remove the block and keep the text since Firefox will copy parts of pre and h1-h6 as a pre element + if (tinymce.isGecko) { + rng = ed.selection.getRng(true); + if (rng.startContainer == rng.endContainer && rng.startContainer.nodeType == 3) { + // Is only one block node and it doesn't contain word stuff + if (o.node.childNodes.length === 1 && /^(p|h[1-6]|pre)$/i.test(o.node.firstChild.nodeName) && o.content.indexOf('__MCE_ITEM__') === -1) + dom.remove(o.node.firstChild, true); + } + } + // Execute post process handlers t.onPostProcess.dispatch(t, o); // Serialize content - o.content = ed.serializer.serialize(o.node, {getInner : 1}); + o.content = ed.serializer.serialize(o.node, {getInner : 1, forced_root_block : ''}); // Plain text option active? if ((!force_rich) && (ed.pasteAsPlainText)) { - t._insertPlainText(ed, dom, o.content); + t._insertPlainText(o.content); if (!getParam(ed, "paste_text_sticky")) { ed.pasteAsPlainText = false; ed.controlManager.setActive("pastetext", false); } - } else if (/<(p|h[1-6]|ul|ol)/.test(o.content)) { - // Handle insertion of contents containing block elements separately - t._insertBlockContent(ed, dom, o.content); } else { t._insert(o.content); } @@ -115,7 +130,7 @@ if (getParam(ed, "paste_text_sticky")) { ed.windowManager.alert(ed.translate('paste.plaintext_mode_sticky')); } else { - ed.windowManager.alert(ed.translate('paste.plaintext_mode_sticky')); + ed.windowManager.alert(ed.translate('paste.plaintext_mode')); } if (!getParam(ed, "paste_text_notifyalways")) { @@ -132,38 +147,46 @@ // hidden div and placing the caret inside it and after the browser paste // is done it grabs that contents and processes that function grabContent(e) { - var n, or, rng, sel = ed.selection, dom = ed.dom, body = ed.getBody(), posY; + var n, or, rng, oldRng, sel = ed.selection, dom = ed.dom, body = ed.getBody(), posY, textContent; // Check if browser supports direct plaintext access - if (ed.pasteAsPlainText && (e.clipboardData || dom.doc.dataTransfer)) { - e.preventDefault(); - process({content : (e.clipboardData || dom.doc.dataTransfer).getData('Text')}, true); - return; + if (e.clipboardData || dom.doc.dataTransfer) { + textContent = (e.clipboardData || dom.doc.dataTransfer).getData('Text'); + + if (ed.pasteAsPlainText) { + e.preventDefault(); + process({content : dom.encode(textContent).replace(/\r?\n/g, '
    ')}); + return; + } } if (dom.get('_mcePaste')) return; // Create container to paste into - n = dom.add(body, 'div', {id : '_mcePaste', 'class' : 'mcePaste'}, '\uFEFF'); + n = dom.add(body, 'div', {id : '_mcePaste', 'class' : 'mcePaste', 'data-mce-bogus' : '1'}, '\uFEFF\uFEFF'); // If contentEditable mode we need to find out the position of the closest element if (body != ed.getDoc().body) posY = dom.getPos(ed.selection.getStart(), body).y; else - posY = body.scrollTop; + posY = body.scrollTop + dom.getViewPort(ed.getWin()).y; // Styles needs to be applied after the element is added to the document since WebKit will otherwise remove all styles + // If also needs to be in view on IE or the paste would fail dom.setStyles(n, { position : 'absolute', - left : -10000, - top : posY, + left : tinymce.isGecko ? -40 : 0, // Need to move it out of site on Gecko since it will othewise display a ghost resize rect for the div + top : posY - 25, width : 1, height : 1, overflow : 'hidden' }); if (tinymce.isIE) { + // Store away the old range + oldRng = sel.getRng(); + // Select the container rng = dom.doc.body.createTextRange(); rng.moveToElementText(n); @@ -174,14 +197,23 @@ // Check if the contents was changed, if it wasn't then clipboard extraction failed probably due // to IE security settings so we pass the junk though better than nothing right - if (n.innerHTML === '\uFEFF') { + if (n.innerHTML === '\uFEFF\uFEFF') { ed.execCommand('mcePasteWord'); e.preventDefault(); return; } - // Process contents - process({content : n.innerHTML}); + // Restore the old range and clear the contents before pasting + sel.setRng(oldRng); + sel.setContent(''); + + // For some odd reason we need to detach the the mceInsertContent call from the paste event + // It's like IE has a reference to the parent element that you paste in and the selection gets messed up + // when it tries to restore the selection + setTimeout(function() { + // Process contents + process({content : n.innerHTML}); + }, 0); // Block the real paste event return tinymce.dom.Event.cancel(e); @@ -196,34 +228,52 @@ or = ed.selection.getRng(); - // Move caret into hidden div + // Move select contents inside DIV n = n.firstChild; rng = ed.getDoc().createRange(); rng.setStart(n, 0); - rng.setEnd(n, 1); + rng.setEnd(n, 2); sel.setRng(rng); // Wait a while and grab the pasted contents window.setTimeout(function() { - var h = '', nl = dom.select('div.mcePaste'); + var h = '', nl; - // WebKit will split the div into multiple ones so this will loop through then all and join them to get the whole HTML string - each(nl, function(n) { - // WebKit duplicates the divs so we need to remove them - each(dom.select('div.mcePaste', n), function(n) { - dom.remove(n, 1); - }); + // Paste divs duplicated in paste divs seems to happen when you paste plain text so lets first look for that broken behavior in WebKit + if (!dom.select('div.mcePaste > div.mcePaste').length) { + nl = dom.select('div.mcePaste'); - // Remove apply style spans - each(dom.select('span.Apple-style-span', n), function(n) { - dom.remove(n, 1); - }); + // WebKit will split the div into multiple ones so this will loop through then all and join them to get the whole HTML string + each(nl, function(n) { + var child = n.firstChild; - h += n.innerHTML; - }); + // WebKit inserts a DIV container with lots of odd styles + if (child && child.nodeName == 'DIV' && child.style.marginTop && child.style.backgroundColor) { + dom.remove(child, 1); + } + + // Remove apply style spans + each(dom.select('span.Apple-style-span', n), function(n) { + dom.remove(n, 1); + }); + + // Remove bogus br elements + each(dom.select('br[data-mce-bogus]', n), function(n) { + dom.remove(n); + }); + + // WebKit will make a copy of the DIV for each line of plain text pasted and insert them into the DIV + if (n.parentNode.className != 'mcePaste') + h += n.innerHTML; + }); + } else { + // Found WebKit weirdness so force the content into paragraphs this seems to happen when you paste plain text from Nodepad etc + // So this logic will replace double enter with paragraphs and single enter with br so it kind of looks the same + h = '

    ' + dom.encode(textContent).replace(/\r?\n\r?\n/g, '

    ').replace(/\r?\n/g, '
    ') + '

    '; + } // Remove the nodes - each(nl, function(n) { + each(dom.select('div.mcePaste'), function(n) { dom.remove(n); }); @@ -244,7 +294,7 @@ if (getParam(ed, "paste_auto_cleanup_on_paste")) { // Is it's Opera or older FF use key handler if (tinymce.isOpera || /Firefox\/2/.test(navigator.userAgent)) { - ed.onKeyDown.add(function(ed, e) { + ed.onKeyDown.addToTop(function(ed, e) { if (((tinymce.isMac ? e.metaKey : e.ctrlKey) && e.keyCode == 86) || (e.shiftKey && e.keyCode == 45)) grabContent(e); }); @@ -256,17 +306,19 @@ } } - // Block all drag/drop events - if (getParam(ed, "paste_block_drop")) { - ed.onInit.add(function() { + ed.onInit.add(function() { + ed.controlManager.setActive("pastetext", ed.pasteAsPlainText); + + // Block all drag/drop events + if (getParam(ed, "paste_block_drop")) { ed.dom.bind(ed.getBody(), ['dragend', 'dragover', 'draggesture', 'dragdrop', 'drop', 'drag'], function(e) { e.preventDefault(); e.stopPropagation(); return false; }); - }); - } + } + }); // Add legacy support t._legacySupport(); @@ -283,8 +335,6 @@ }, _preProcess : function(pl, o) { - //console.log('Before preprocess:' + o.content); - var ed = this.editor, h = o.content, grep = tinymce.grep, @@ -292,6 +342,8 @@ trim = tinymce.trim, len, stripClass; + //console.log('Before preprocess:' + o.content); + function process(items) { each(items, function(v) { // Remove or replace @@ -301,6 +353,23 @@ h = h.replace(v[0], v[1]); }); } + + if (ed.settings.paste_enable_default_filters == false) { + return; + } + + // IE9 adds BRs before/after block elements when contents is pasted from word or for example another browser + if (tinymce.isIE && document.documentMode >= 9) { + // IE9 adds BRs before/after block elements when contents is pasted from word or for example another browser + process([[/(?:
     [\s\r\n]+|
    )*(<\/?(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)[^>]*>)(?:
     [\s\r\n]+|
    )*/g, '$1']]); + + // IE9 also adds an extra BR element for each soft-linefeed and it also adds a BR for each word wrap break + process([ + [/

    /g, '

    '], // Replace multiple BR elements with uppercase BR to keep them intact + [/
    /g, ' '], // Replace single br elements with space since they are word wrap BR:s + [/

    /g, '
    '] // Replace back the double brs but into a single BR + ]); + } // Detect Word content and process it more aggressive if (/class="?Mso|style="[^"]*\bmso-|w:WordDocument/i.test(h) || o.wordContent) { @@ -320,7 +389,8 @@ if (getParam(ed, "paste_convert_middot_lists")) { process([ [//gi, '$&__MCE_ITEM__'], // Convert supportLists to a list item marker - [/(]+(?:mso-list:|:\s*symbol)[^>]+>)/gi, '$1__MCE_ITEM__'] // Convert mso-list and symbol spans to item markers + [/(]+(?:mso-list:|:\s*symbol)[^>]+>)/gi, '$1__MCE_ITEM__'], // Convert mso-list and symbol spans to item markers + [/(]+(?:MsoListParagraph)[^>]+>)/gi, '$1__MCE_ITEM__'] // Convert mso-list and symbol paragraphs to item markers (FF) ]); } @@ -472,6 +542,11 @@ ]); } + process([ + // Copy paste from Java like Open Office will produce this junk on FF + [/Version:[\d.]+\nStartHTML:\d+\nEndHTML:\d+\nStartFragment:\d+\nEndFragment:\d+/gi, ''] + ]); + // Class attribute options are: leave all as-is ("none"), remove all ("all"), or remove only those starting with mso ("mso"). // Note:- paste_strip_class_attributes: "none", verify_css_classes: true is also a good variation. stripClass = getParam(ed, "paste_strip_class_attributes"); @@ -491,7 +566,7 @@ }; h = h.replace(/ class="([^"]+)"/gi, removeClasses); - h = h.replace(/ class=(\w+)/gi, removeClasses); + h = h.replace(/ class=([\-\w]+)/gi, removeClasses); } // Remove spans option @@ -510,6 +585,10 @@ _postProcess : function(pl, o) { var t = this, ed = t.editor, dom = ed.dom, styleProps; + if (ed.settings.paste_enable_default_filters == false) { + return; + } + if (o.wordContent) { // Remove named anchors or TOC links each(dom.select('a', o.node), function(a) { @@ -561,14 +640,14 @@ if (getParam(ed, "paste_remove_styles") || (getParam(ed, "paste_remove_styles_if_webkit") && tinymce.isWebKit)) { each(dom.select('*[style]', o.node), function(el) { el.removeAttribute('style'); - el.removeAttribute('_mce_style'); + el.removeAttribute('data-mce-style'); }); } else { if (tinymce.isWebKit) { // We need to compress the styles on WebKit since if you paste it will become // Removing the mce_style that contains the real value will force the Serializer engine to compress the styles each(dom.select('*', o.node), function(el) { - el.removeAttribute('_mce_style'); + el.removeAttribute('data-mce-style'); }); } } @@ -591,11 +670,11 @@ val = p.innerHTML.replace(/<\/?\w+[^>]*>/gi, '').replace(/ /g, '\u00a0'); // Detect unordered lists look for bullets - if (/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o]\s*\u00a0*/.test(val)) + if (/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*\u00a0*/.test(val)) type = 'ul'; // Detect ordered lists 1., a. or ixv. - if (/^__MCE_ITEM__\s*\w+\.\s*\u00a0{2,}/.test(val)) + if (/^__MCE_ITEM__\s*\w+\.\s*\u00a0+/.test(val)) type = 'ol'; // Check if node value matches the list pattern: o   @@ -625,9 +704,9 @@ var html = span.innerHTML.replace(/<\/?\w+[^>]*>/gi, ''); // Remove span with the middot or the number - if (type == 'ul' && /^[\u2022\u00b7\u00a7\u00d8o]/.test(html)) + if (type == 'ul' && /^__MCE_ITEM__[\u2022\u00b7\u00a7\u00d8o\u25CF]/.test(html)) dom.remove(span); - else if (/^[\s\S]*\w+\.( |\u00a0)*\s*/.test(html)) + else if (/^__MCE_ITEM__[\s\S]*\w+\.( |\u00a0)*\s*/.test(html)) dom.remove(span); }); @@ -635,7 +714,7 @@ // Remove middot/list items if (type == 'ul') - html = p.innerHTML.replace(/__MCE_ITEM__/g, '').replace(/^[\u2022\u00b7\u00a7\u00d8o]\s*( |\u00a0)+\s*/, ''); + html = p.innerHTML.replace(/__MCE_ITEM__/g, '').replace(/^[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*( |\u00a0)+\s*/, ''); else html = p.innerHTML.replace(/__MCE_ITEM__/g, '').replace(/^\s*\w+\.( |\u00a0)+\s*/, ''); @@ -655,65 +734,6 @@ o.node.innerHTML = html.replace(/__MCE_ITEM__/g, ''); }, - /** - * This method will split the current block parent and insert the contents inside the split position. - * This logic can be improved so text nodes at the start/end remain in the start/end block elements - */ - _insertBlockContent : function(ed, dom, content) { - var parentBlock, marker, sel = ed.selection, last, elm, vp, y, elmHeight, markerId = 'mce_marker'; - - function select(n) { - var r; - - if (tinymce.isIE) { - r = ed.getDoc().body.createTextRange(); - r.moveToElementText(n); - r.collapse(false); - r.select(); - } else { - sel.select(n, 1); - sel.collapse(false); - } - } - - // Insert a marker for the caret position - this._insert(' ', 1); - marker = dom.get(markerId); - parentBlock = dom.getParent(marker, 'p,h1,h2,h3,h4,h5,h6,ul,ol,th,td'); - - // If it's a parent block but not a table cell - if (parentBlock && !/TD|TH/.test(parentBlock.nodeName)) { - // Split parent block - marker = dom.split(parentBlock, marker); - - // Insert nodes before the marker - each(dom.create('div', 0, content).childNodes, function(n) { - last = marker.parentNode.insertBefore(n.cloneNode(true), marker); - }); - - // Move caret after marker - select(last); - } else { - dom.setOuterHTML(marker, content); - sel.select(ed.getBody(), 1); - sel.collapse(0); - } - - // Remove marker if it's left - while (elm = dom.get(markerId)) - dom.remove(elm); - - // Get element, position and height - elm = sel.getStart(); - vp = dom.getViewPort(ed.getWin()); - y = ed.dom.getPos(elm).y; - elmHeight = elm.clientHeight; - - // Is element within viewport if not then scroll it into view - if (y < vp.y || y + elmHeight > vp.y + vp.h) - ed.getDoc().body.scrollTop = y < vp.y ? y : y - vp.h + 25; - }, - /** * Inserts the specified contents at the caret position. */ @@ -724,8 +744,7 @@ if (!ed.selection.isCollapsed() && r.startContainer != r.endContainer) ed.getDoc().execCommand('Delete', false, null); - // It's better to use the insertHTML method on Gecko since it will combine paragraphs correctly before inserting the contents - ed.execCommand(tinymce.isGecko ? 'insertHTML' : 'mceInsertContent', false, h, {skip_undo : skip_undo}); + ed.execCommand('mceInsertContent', false, h, {skip_undo : skip_undo}); }, /** @@ -737,31 +756,24 @@ * plugin, and requires minimal changes to add the new functionality. * Speednet - June 2009 */ - _insertPlainText : function(ed, dom, h) { - var i, len, pos, rpos, node, breakElms, before, after, - w = ed.getWin(), - d = ed.getDoc(), - sel = ed.selection, - is = tinymce.is, - inArray = tinymce.inArray, + _insertPlainText : function(content) { + var ed = this.editor, linebr = getParam(ed, "paste_text_linebreaktype"), - rl = getParam(ed, "paste_text_replacements"); + rl = getParam(ed, "paste_text_replacements"), + is = tinymce.is; function process(items) { each(items, function(v) { if (v.constructor == RegExp) - h = h.replace(v, ""); + content = content.replace(v, ""); else - h = h.replace(v[0], v[1]); + content = content.replace(v[0], v[1]); }); }; - if ((typeof(h) === "string") && (h.length > 0)) { - if (!entities) - entities = ("34,quot,38,amp,39,apos,60,lt,62,gt," + ed.serializer.settings.entities).split(","); - + if ((typeof(content) === "string") && (content.length > 0)) { // If HTML content with line-breaking tags, then remove all cr/lf chars because only tags will break a line - if (/<(?:p|br|h[1-6]|ul|ol|dl|table|t[rdh]|div|blockquote|fieldset|pre|address|center)[^>]*>/i.test(h)) { + if (/<(?:p|br|h[1-6]|ul|ol|dl|table|t[rdh]|div|blockquote|fieldset|pre|address|center)[^>]*>/i.test(content)) { process([ /[\n\r]+/g ]); @@ -778,128 +790,47 @@ [/<\/t[dh]>\s*]*>/gi, "\t"], // Table cells get tabs betweem them /<[a-z!\/?][^>]*>/gi, // Delete all remaining tags [/ /gi, " "], // Convert non-break spaces to regular spaces (remember, *plain text*) - [ - // HTML entity - /&(#\d+|[a-z0-9]{1,10});/gi, - - // Replace with actual character - function(e, s) { - if (s.charAt(0) === "#") { - return String.fromCharCode(s.slice(1)); - } - else { - return ((e = inArray(entities, s)) > 0)? String.fromCharCode(entities[e-1]) : " "; - } - } - ], - [/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi, "$1"], // Cool little RegExp deletes whitespace around linebreak chars. - [/\n{3,}/g, "\n\n"], // Max. 2 consecutive linebreaks - /^\s+|\s+$/g // Trim the front & back + [/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi, "$1"],// Cool little RegExp deletes whitespace around linebreak chars. + [/\n{3,}/g, "\n\n"] // Max. 2 consecutive linebreaks ]); - h = dom.encode(h); - - // Delete any highlighted text before pasting - if (!sel.isCollapsed()) { - d.execCommand("Delete", false, null); - } + content = ed.dom.decode(tinymce.html.Entities.encodeRaw(content)); // Perform default or custom replacements - if (is(rl, "array") || (is(rl, "array"))) { + if (is(rl, "array")) { process(rl); - } - else if (is(rl, "string")) { + } else if (is(rl, "string")) { process(new RegExp(rl, "gi")); } // Treat paragraphs as specified in the config if (linebr == "none") { + // Convert all line breaks to space process([ [/\n+/g, " "] ]); - } - else if (linebr == "br") { + } else if (linebr == "br") { + // Convert all line breaks to
    process([ [/\n/g, "
    "] ]); - } - else { + } else if (linebr == "p") { + // Convert all line breaks to

    ...

    + process([ + [/\n+/g, "

    "], + [/^(.*<\/p>)(

    )$/, '

    $1'] + ]); + } else { + // defaults to "combined" + // Convert single line breaks to
    and double line breaks to

    ...

    process([ - /^\s+|\s+$/g, [/\n\n/g, "

    "], + [/^(.*<\/p>)(

    )$/, '

    $1'], [/\n/g, "
    "] ]); } - // This next piece of code handles the situation where we're pasting more than one paragraph of plain - // text, and we are pasting the content into the middle of a block node in the editor. The block - // node gets split at the selection point into "Para A" and "Para B" (for the purposes of explaining). - // The first paragraph of the pasted text is appended to "Para A", and the last paragraph of the - // pasted text is prepended to "Para B". Any other paragraphs of pasted text are placed between - // "Para A" and "Para B". This code solves a host of problems with the original plain text plugin and - // now handles styles correctly. (Pasting plain text into a styled paragraph is supposed to make the - // plain text take the same style as the existing paragraph.) - if ((pos = h.indexOf("

    ")) != -1) { - rpos = h.lastIndexOf("

    "); - node = sel.getNode(); - breakElms = []; // Get list of elements to break - - do { - if (node.nodeType == 1) { - // Don't break tables and break at body - if (node.nodeName == "TD" || node.nodeName == "BODY") { - break; - } - - breakElms[breakElms.length] = node; - } - } while (node = node.parentNode); - - // Are we in the middle of a block node? - if (breakElms.length > 0) { - before = h.substring(0, pos); - after = ""; - - for (i=0, len=breakElms.length; i"; - after += "<" + breakElms[breakElms.length-i-1].nodeName.toLowerCase() + ">"; - } - - if (pos == rpos) { - h = before + after + h.substring(pos+7); - } - else { - h = before + h.substring(pos+4, rpos+4) + after + h.substring(rpos+7); - } - } - } - - // Insert content at the caret, plus add a marker for repositioning the caret - ed.execCommand("mceInsertRawHTML", false, h + ' '); - - // Reposition the caret to the marker, which was placed immediately after the inserted content. - // Needs to be done asynchronously (in window.setTimeout) or else it doesn't work in all browsers. - // The second part of the code scrolls the content up if the caret is positioned off-screen. - // This is only necessary for WebKit browsers, but it doesn't hurt to use for all. - window.setTimeout(function() { - var marker = dom.get('_plain_text_marker'), - elm, vp, y, elmHeight; - - sel.select(marker, false); - d.execCommand("Delete", false, null); - marker = null; - - // Get element, position and height - elm = sel.getStart(); - vp = dom.getViewPort(w); - y = dom.getPos(elm).y; - elmHeight = elm.clientHeight; - - // Is element within viewport if not then scroll it into view - if ((y < vp.y) || (y + elmHeight > vp.y + vp.h)) { - d.body.scrollTop = y < vp.y ? y : y - vp.h + 25; - } - }, 0); + ed.execCommand('mceInsertContent', false, content); } }, diff --git a/js/tiny_mce/plugins/paste/langs/en_dlg.js b/js/tiny_mce/plugins/paste/langs/en_dlg.js index eeac778960..bc74daf85c 100644 --- a/js/tiny_mce/plugins/paste/langs/en_dlg.js +++ b/js/tiny_mce/plugins/paste/langs/en_dlg.js @@ -1,5 +1 @@ -tinyMCE.addI18n('en.paste_dlg',{ -text_title:"Use CTRL+V on your keyboard to paste the text into the window.", -text_linebreaks:"Keep linebreaks", -word_title:"Use CTRL+V on your keyboard to paste the text into the window." -}); \ No newline at end of file +tinyMCE.addI18n('en.paste_dlg',{"word_title":"Use Ctrl+V on your keyboard to paste the text into the window.","text_linebreaks":"Keep Linebreaks","text_title":"Use Ctrl+V on your keyboard to paste the text into the window."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/editor_plugin.js b/js/tiny_mce/plugins/searchreplace/editor_plugin.js index cd9c985b7a..165bc12df5 100644 --- a/js/tiny_mce/plugins/searchreplace/editor_plugin.js +++ b/js/tiny_mce/plugins/searchreplace/editor_plugin.js @@ -1 +1 @@ -(function(){tinymce.create("tinymce.plugins.SearchReplacePlugin",{init:function(a,c){function b(d){a.windowManager.open({file:c+"/searchreplace.htm",width:420+parseInt(a.getLang("searchreplace.delta_width",0)),height:170+parseInt(a.getLang("searchreplace.delta_height",0)),inline:1,auto_focus:0},{mode:d,search_string:a.selection.getContent({format:"text"}),plugin_url:c})}a.addCommand("mceSearch",function(){b("search")});a.addCommand("mceReplace",function(){b("replace")});a.addButton("search",{title:"searchreplace.search_desc",cmd:"mceSearch"});a.addButton("replace",{title:"searchreplace.replace_desc",cmd:"mceReplace"});a.addShortcut("ctrl+f","searchreplace.search_desc","mceSearch")},getInfo:function(){return{longname:"Search/Replace",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("searchreplace",tinymce.plugins.SearchReplacePlugin)})(); \ No newline at end of file +(function(){tinymce.create("tinymce.plugins.SearchReplacePlugin",{init:function(a,c){function b(d){window.focus();a.windowManager.open({file:c+"/searchreplace.htm",width:420+parseInt(a.getLang("searchreplace.delta_width",0)),height:170+parseInt(a.getLang("searchreplace.delta_height",0)),inline:1,auto_focus:0},{mode:d,search_string:a.selection.getContent({format:"text"}),plugin_url:c})}a.addCommand("mceSearch",function(){b("search")});a.addCommand("mceReplace",function(){b("replace")});a.addButton("search",{title:"searchreplace.search_desc",cmd:"mceSearch"});a.addButton("replace",{title:"searchreplace.replace_desc",cmd:"mceReplace"});a.addShortcut("ctrl+f","searchreplace.search_desc","mceSearch")},getInfo:function(){return{longname:"Search/Replace",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("searchreplace",tinymce.plugins.SearchReplacePlugin)})(); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/editor_plugin_src.js b/js/tiny_mce/plugins/searchreplace/editor_plugin_src.js index 1433a06a4a..4c87e8fa79 100644 --- a/js/tiny_mce/plugins/searchreplace/editor_plugin_src.js +++ b/js/tiny_mce/plugins/searchreplace/editor_plugin_src.js @@ -12,6 +12,10 @@ tinymce.create('tinymce.plugins.SearchReplacePlugin', { init : function(ed, url) { function open(m) { + // Keep IE from writing out the f/r character to the editor + // instance while initializing a new dialog. See: #3131190 + window.focus(); + ed.windowManager.open({ file : url + '/searchreplace.htm', width : 420 + parseInt(ed.getLang('searchreplace.delta_width', 0)), diff --git a/js/tiny_mce/plugins/searchreplace/js/searchreplace.js b/js/tiny_mce/plugins/searchreplace/js/searchreplace.js index c0a6243297..80284b9f3f 100644 --- a/js/tiny_mce/plugins/searchreplace/js/searchreplace.js +++ b/js/tiny_mce/plugins/searchreplace/js/searchreplace.js @@ -2,14 +2,18 @@ tinyMCEPopup.requireLangPack(); var SearchReplaceDialog = { init : function(ed) { - var f = document.forms[0], m = tinyMCEPopup.getWindowArg("mode"); + var t = this, f = document.forms[0], m = tinyMCEPopup.getWindowArg("mode"); - this.switchMode(m); + t.switchMode(m); f[m + '_panel_searchstring'].value = tinyMCEPopup.getWindowArg("search_string"); // Focus input field f[m + '_panel_searchstring'].focus(); + + mcTabs.onChange.add(function(tab_id, panel_id) { + t.switchMode(tab_id.substring(0, tab_id.indexOf('_'))); + }); }, switchMode : function(m) { @@ -42,21 +46,23 @@ var SearchReplaceDialog = { ca = f[m + '_panel_casesensitivebox'].checked; rs = f['replace_panel_replacestring'].value; + if (tinymce.isIE) { + r = ed.getDoc().selection.createRange(); + } + if (s == '') return; function fix() { // Correct Firefox graphics glitches + // TODO: Verify if this is actually needed any more, maybe it was for very old FF versions? r = se.getRng().cloneRange(); ed.getDoc().execCommand('SelectAll', false, null); se.setRng(r); }; function replace() { - if (tinymce.isIE) - ed.selection.getRng().duplicate().pasteHTML(rs); // Needs to be duplicated due to selection bug in IE - else - ed.getDoc().execCommand('InsertHTML', false, rs); + ed.selection.setContent(rs); // Needs to be duplicated due to selection bug in IE }; // IE flags @@ -70,6 +76,9 @@ var SearchReplaceDialog = { ed.selection.collapse(true); if (tinymce.isIE) { + ed.focus(); + r = ed.getDoc().selection.createRange(); + while (r.findText(s, b ? -1 : 1, fl)) { r.scrollIntoView(); r.select(); @@ -111,6 +120,9 @@ var SearchReplaceDialog = { return; if (tinymce.isIE) { + ed.focus(); + r = ed.getDoc().selection.createRange(); + if (r.findText(s, b ? -1 : 1, fl)) { r.scrollIntoView(); r.select(); diff --git a/js/tiny_mce/plugins/searchreplace/langs/en_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/en_dlg.js index 370959afa3..8a65900977 100644 --- a/js/tiny_mce/plugins/searchreplace/langs/en_dlg.js +++ b/js/tiny_mce/plugins/searchreplace/langs/en_dlg.js @@ -1,16 +1 @@ -tinyMCE.addI18n('en.searchreplace_dlg',{ -searchnext_desc:"Find again", -notfound:"The search has been completed. The search string could not be found.", -search_title:"Find", -replace_title:"Find/Replace", -allreplaced:"All occurrences of the search string were replaced.", -findwhat:"Find what", -replacewith:"Replace with", -direction:"Direction", -up:"Up", -down:"Down", -mcase:"Match case", -findnext:"Find next", -replace:"Replace", -replaceall:"Replace all" -}); \ No newline at end of file +tinyMCE.addI18n('en.searchreplace_dlg',{findwhat:"Find What",replacewith:"Replace with",direction:"Direction",up:"Up",down:"Down",mcase:"Match Case",findnext:"Find Next",allreplaced:"All occurrences of the search string were replaced.","searchnext_desc":"Find Again",notfound:"The search has been completed. The search string could not be found.","search_title":"Find","replace_title":"Find/Replace",replaceall:"Replace All",replace:"Replace"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/searchreplace.htm b/js/tiny_mce/plugins/searchreplace/searchreplace.htm index d0424cfc9b..5a22d8aa4d 100644 --- a/js/tiny_mce/plugins/searchreplace/searchreplace.htm +++ b/js/tiny_mce/plugins/searchreplace/searchreplace.htm @@ -8,27 +8,28 @@ - + +

    - +
    - + ' + '' + '' + + '__("Delete") ?>' + ''; var tierPriceControl = { diff --git a/app/design/adminhtml/default/default/template/catalog/product/edit/serializer.phtml b/app/design/adminhtml/default/default/template/catalog/product/edit/serializer.phtml index 00d66f8c15..cf46170036 100644 --- a/app/design/adminhtml/default/default/template/catalog/product/edit/serializer.phtml +++ b/app/design/adminhtml/default/default/template/catalog/product/edit/serializer.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/catalog/product/edit/super/config.phtml b/app/design/adminhtml/default/default/template/catalog/product/edit/super/config.phtml index 9c679082f6..741e5c14b5 100644 --- a/app/design/adminhtml/default/default/template/catalog/product/edit/super/config.phtml +++ b/app/design/adminhtml/default/default/template/catalog/product/edit/super/config.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/catalog/product/edit/websites.phtml b/app/design/adminhtml/default/default/template/catalog/product/edit/websites.phtml index b0c7a1bc95..3d19caf33b 100644 --- a/app/design/adminhtml/default/default/template/catalog/product/edit/websites.phtml +++ b/app/design/adminhtml/default/default/template/catalog/product/edit/websites.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -38,35 +38,38 @@ - getWebsiteCollection() as $_website): ?> -
    -
    - isReadonly()):?> disabled="disabled" class="checkbox website-checkbox" id="product_website_getId() ?>" type="checkbox"hasWebsite($_website->getId())): ?> checked="checked" /> - -
    -
    - getGroupCollection($_website) as $_group): ?> -

    escapeHtml($_group->getName()) ?>

    -
    -
    - - - +
    + + @@ -39,7 +40,7 @@ - - - - - -
    {#style_dlg.padding} - +
    @@ -288,11 +330,14 @@ @@ -300,11 +345,14 @@ @@ -312,11 +360,14 @@ @@ -324,11 +375,14 @@ @@ -341,7 +395,7 @@
    {#style_dlg.margin} -
     
    - +
    - +
      + + +
    - +
    - +
      + + +
    - +
    - +
      + + +
    - +
    - +
      + + +
    +
    @@ -349,11 +403,14 @@ @@ -361,11 +418,14 @@ @@ -373,11 +433,14 @@ @@ -385,11 +448,14 @@ @@ -401,131 +467,148 @@
    -
     
    - +
    - +
      + + +
    - +
    - +
      + + +
    - +
    - +
      + + +
    - +
    - +
      + + +
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      {#style_dlg.style} {#style_dlg.width} {#style_dlg.color}
          
    {#style_dlg.top}   - - - - - - -
     
    -
      - - - - - -
     
    -
    {#style_dlg.right}   - - - - - - -
     
    -
      - - - - - -
     
    -
    {#style_dlg.bottom}   - - - - - - -
     
    -
      - - - - - -
     
    -
    {#style_dlg.left}   - - - - - - -
     
    -
      - - - - - +
    + {#style_dlg.border} +
     
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      {#style_dlg.style} {#style_dlg.width} {#style_dlg.color}
          
    {#style_dlg.top}   + + + + + + +
      + + +
    +
      + + + + + +
     
    +
    {#style_dlg.right}   + + + + + + +
      + + +
    +
      + + + + + +
     
    +
    {#style_dlg.bottom}   + + + + + + +
      + + +
    +
      + + + + + +
     
    +
    {#style_dlg.left}   + + + + + + +
      + + +
    +
      + + + + + +
     
    +
    -
    +
    - +
    + {#style_dlg.list} +
    @@ -541,10 +624,13 @@
    +
    - +
    + {#style_dlg.position} +
    @@ -555,11 +641,14 @@ @@ -570,11 +659,14 @@ @@ -582,12 +674,13 @@
    - +
    - +
      + + +
    - +
    - +
      + + +
    +
    {#style_dlg.placement} - +
    @@ -595,11 +688,14 @@ @@ -607,11 +703,14 @@ @@ -619,11 +718,14 @@ @@ -631,11 +733,14 @@ @@ -648,7 +753,7 @@
    {#style_dlg.clip} -
     
    {#style_dlg.top} - +
    - +
      + + +
    {#style_dlg.right} - +
    - +
      + + +
    {#style_dlg.bottom} - +
    - +
      + + +
    {#style_dlg.left} - +
    - +
      + + +
    +
    @@ -656,11 +761,14 @@ @@ -668,11 +776,14 @@ @@ -680,11 +791,14 @@ @@ -692,11 +806,14 @@ diff --git a/js/tiny_mce/plugins/tabfocus/editor_plugin.js b/js/tiny_mce/plugins/tabfocus/editor_plugin.js index 27d2440222..42a82d112c 100644 --- a/js/tiny_mce/plugins/tabfocus/editor_plugin.js +++ b/js/tiny_mce/plugins/tabfocus/editor_plugin.js @@ -1 +1 @@ -(function(){var c=tinymce.DOM,a=tinymce.dom.Event,d=tinymce.each,b=tinymce.explode;tinymce.create("tinymce.plugins.TabFocusPlugin",{init:function(f,g){function e(i,j){if(j.keyCode===9){return a.cancel(j)}}function h(l,p){var j,m,o,n,k;function q(i){o=c.getParent(l.id,"form");n=o.elements;if(o){d(n,function(s,r){if(s.id==l.id){j=r;return false}});if(i>0){for(m=j+1;m=0;m--){if(n[m].type!="hidden"){return n[m]}}}}return null}if(p.keyCode===9){k=b(l.getParam("tab_focus",l.getParam("tabfocus_elements",":prev,:next")));if(k.length==1){k[1]=k[0];k[0]=":prev"}if(p.shiftKey){if(k[0]==":prev"){n=q(-1)}else{n=c.get(k[0])}}else{if(k[1]==":next"){n=q(1)}else{n=c.get(k[1])}}if(n){if(l=tinymce.get(n.id||n.name)){l.focus()}else{window.setTimeout(function(){window.focus();n.focus()},10)}return a.cancel(p)}}}f.onKeyUp.add(e);if(tinymce.isGecko){f.onKeyPress.add(h);f.onKeyDown.add(e)}else{f.onKeyDown.add(h)}f.onInit.add(function(){d(c.select("a:first,a:last",f.getContainer()),function(i){a.add(i,"focus",function(){f.focus()})})})},getInfo:function(){return{longname:"Tabfocus",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/tabfocus",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("tabfocus",tinymce.plugins.TabFocusPlugin)})(); \ No newline at end of file +(function(){var c=tinymce.DOM,a=tinymce.dom.Event,d=tinymce.each,b=tinymce.explode;tinymce.create("tinymce.plugins.TabFocusPlugin",{init:function(f,g){function e(i,j){if(j.keyCode===9){return a.cancel(j)}}function h(l,p){var j,m,o,n,k;function q(t){n=c.select(":input:enabled,*[tabindex]");function s(v){return v.nodeName==="BODY"||(v.type!="hidden"&&!(v.style.display=="none")&&!(v.style.visibility=="hidden")&&s(v.parentNode))}function i(v){return v.attributes.tabIndex.specified||v.nodeName=="INPUT"||v.nodeName=="TEXTAREA"}function u(){return tinymce.isIE6||tinymce.isIE7}function r(v){return((!u()||i(v)))&&v.getAttribute("tabindex")!="-1"&&s(v)}d(n,function(w,v){if(w.id==l.id){j=v;return false}});if(t>0){for(m=j+1;m=0;m--){if(r(n[m])){return n[m]}}}return null}if(p.keyCode===9){k=b(l.getParam("tab_focus",l.getParam("tabfocus_elements",":prev,:next")));if(k.length==1){k[1]=k[0];k[0]=":prev"}if(p.shiftKey){if(k[0]==":prev"){n=q(-1)}else{n=c.get(k[0])}}else{if(k[1]==":next"){n=q(1)}else{n=c.get(k[1])}}if(n){if(n.id&&(l=tinymce.get(n.id||n.name))){l.focus()}else{window.setTimeout(function(){if(!tinymce.isWebKit){window.focus()}n.focus()},10)}return a.cancel(p)}}}f.onKeyUp.add(e);if(tinymce.isGecko){f.onKeyPress.add(h);f.onKeyDown.add(e)}else{f.onKeyDown.add(h)}},getInfo:function(){return{longname:"Tabfocus",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/tabfocus",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("tabfocus",tinymce.plugins.TabFocusPlugin)})(); \ No newline at end of file diff --git a/js/tiny_mce/plugins/tabfocus/editor_plugin_src.js b/js/tiny_mce/plugins/tabfocus/editor_plugin_src.js index c2be2f40a6..a1579c85f2 100644 --- a/js/tiny_mce/plugins/tabfocus/editor_plugin_src.js +++ b/js/tiny_mce/plugins/tabfocus/editor_plugin_src.js @@ -1,112 +1,122 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, explode = tinymce.explode; - - tinymce.create('tinymce.plugins.TabFocusPlugin', { - init : function(ed, url) { - function tabCancel(ed, e) { - if (e.keyCode === 9) - return Event.cancel(e); - }; - - function tabHandler(ed, e) { - var x, i, f, el, v; - - function find(d) { - f = DOM.getParent(ed.id, 'form'); - el = f.elements; - - if (f) { - each(el, function(e, i) { - if (e.id == ed.id) { - x = i; - return false; - } - }); - - if (d > 0) { - for (i = x + 1; i < el.length; i++) { - if (el[i].type != 'hidden') - return el[i]; - } - } else { - for (i = x - 1; i >= 0; i--) { - if (el[i].type != 'hidden') - return el[i]; - } - } - } - - return null; - }; - - if (e.keyCode === 9) { - v = explode(ed.getParam('tab_focus', ed.getParam('tabfocus_elements', ':prev,:next'))); - - if (v.length == 1) { - v[1] = v[0]; - v[0] = ':prev'; - } - - // Find element to focus - if (e.shiftKey) { - if (v[0] == ':prev') - el = find(-1); - else - el = DOM.get(v[0]); - } else { - if (v[1] == ':next') - el = find(1); - else - el = DOM.get(v[1]); - } - - if (el) { - if (ed = tinymce.get(el.id || el.name)) - ed.focus(); - else - window.setTimeout(function() {window.focus();el.focus();}, 10); - - return Event.cancel(e); - } - } - }; - - ed.onKeyUp.add(tabCancel); - - if (tinymce.isGecko) { - ed.onKeyPress.add(tabHandler); - ed.onKeyDown.add(tabCancel); - } else - ed.onKeyDown.add(tabHandler); - - ed.onInit.add(function() { - each(DOM.select('a:first,a:last', ed.getContainer()), function(n) { - Event.add(n, 'focus', function() {ed.focus();}); - }); - }); - }, - - getInfo : function() { - return { - longname : 'Tabfocus', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/tabfocus', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('tabfocus', tinymce.plugins.TabFocusPlugin); -})(); \ No newline at end of file +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, explode = tinymce.explode; + + tinymce.create('tinymce.plugins.TabFocusPlugin', { + init : function(ed, url) { + function tabCancel(ed, e) { + if (e.keyCode === 9) + return Event.cancel(e); + } + + function tabHandler(ed, e) { + var x, i, f, el, v; + + function find(d) { + el = DOM.select(':input:enabled,*[tabindex]'); + + function canSelectRecursive(e) { + return e.nodeName==="BODY" || (e.type != 'hidden' && + !(e.style.display == "none") && + !(e.style.visibility == "hidden") && canSelectRecursive(e.parentNode)); + } + function canSelectInOldIe(el) { + return el.attributes["tabIndex"].specified || el.nodeName == "INPUT" || el.nodeName == "TEXTAREA"; + } + function isOldIe() { + return tinymce.isIE6 || tinymce.isIE7; + } + function canSelect(el) { + return ((!isOldIe() || canSelectInOldIe(el))) && el.getAttribute("tabindex") != '-1' && canSelectRecursive(el); + } + + each(el, function(e, i) { + if (e.id == ed.id) { + x = i; + return false; + } + }); + if (d > 0) { + for (i = x + 1; i < el.length; i++) { + if (canSelect(el[i])) + return el[i]; + } + } else { + for (i = x - 1; i >= 0; i--) { + if (canSelect(el[i])) + return el[i]; + } + } + + return null; + } + + if (e.keyCode === 9) { + v = explode(ed.getParam('tab_focus', ed.getParam('tabfocus_elements', ':prev,:next'))); + + if (v.length == 1) { + v[1] = v[0]; + v[0] = ':prev'; + } + + // Find element to focus + if (e.shiftKey) { + if (v[0] == ':prev') + el = find(-1); + else + el = DOM.get(v[0]); + } else { + if (v[1] == ':next') + el = find(1); + else + el = DOM.get(v[1]); + } + + if (el) { + if (el.id && (ed = tinymce.get(el.id || el.name))) + ed.focus(); + else + window.setTimeout(function() { + if (!tinymce.isWebKit) + window.focus(); + el.focus(); + }, 10); + + return Event.cancel(e); + } + } + } + + ed.onKeyUp.add(tabCancel); + + if (tinymce.isGecko) { + ed.onKeyPress.add(tabHandler); + ed.onKeyDown.add(tabCancel); + } else + ed.onKeyDown.add(tabHandler); + + }, + + getInfo : function() { + return { + longname : 'Tabfocus', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/tabfocus', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('tabfocus', tinymce.plugins.TabFocusPlugin); +})(); diff --git a/js/tiny_mce/plugins/table/cell.htm b/js/tiny_mce/plugins/table/cell.htm index d243e1d833..a72a8d6973 100644 --- a/js/tiny_mce/plugins/table/cell.htm +++ b/js/tiny_mce/plugins/table/cell.htm @@ -5,16 +5,17 @@ + - + @@ -23,7 +24,7 @@
    {#table_dlg.general_props} -
     
    {#style_dlg.top} - +
    - +
      + + +
    {#style_dlg.right} - +
    - +
      + + +
    {#style_dlg.bottom} - +
    - +
      + + +
    {#style_dlg.left} - +
    - +
      + + +
    +
    - + - + @@ -92,7 +93,7 @@
    {#table_dlg.advanced_props} -
    @@ -70,10 +71,10 @@
    +
    @@ -124,7 +125,7 @@
    - +
    @@ -133,10 +134,10 @@ - - + +
     
    - +
    @@ -145,10 +146,10 @@ - - + + '; if (s.image) - h1 = DOM.createHTML('img ', {src : s.image, 'class' : 'mceAction ' + s['class']}); + h1 = DOM.createHTML('img ', {src : s.image, role: 'presentation', 'class' : 'mceAction ' + s['class']}); else h1 = DOM.createHTML('span', {'class' : 'mceAction ' + s['class']}, ''); - h += ''; + h1 += DOM.createHTML('span', {'class': 'mceVoiceLabel mceIconOnly', id: t.id + '_voice', style: 'display:none;'}, s.title); + h += ''; - h1 = DOM.createHTML('span', {'class' : 'mceOpen ' + s['class']}); - h += ''; + h1 = DOM.createHTML('span', {'class' : 'mceOpen ' + s['class']}, ''); + h += ''; h += ''; - - return DOM.createHTML('table', {id : t.id, 'class' : 'mceSplitButton mceSplitButtonEnabled ' + s['class'], cellpadding : '0', cellspacing : '0', onmousedown : 'return false;', title : s.title}, h); + h = DOM.createHTML('table', { role: 'presentation', 'class' : 'mceSplitButton mceSplitButtonEnabled ' + s['class'], cellpadding : '0', cellspacing : '0', title : s.title}, h); + return DOM.createHTML('div', {id : t.id, role: 'button', tabindex: '0', 'aria-labelledby': t.id + '_voice', 'aria-haspopup': 'true'}, h); }, postRender : function() { - var t = this, s = t.settings; + var t = this, s = t.settings, activate; if (s.onclick) { - Event.add(t.id + '_action', 'click', function() { - if (!t.isDisabled()) + activate = function(evt) { + if (!t.isDisabled()) { s.onclick(t.value); + Event.cancel(evt); + } + }; + Event.add(t.id + '_action', 'click', activate); + Event.add(t.id, ['click', 'keydown'], function(evt) { + var DOM_VK_SPACE = 32, DOM_VK_ENTER = 14, DOM_VK_RETURN = 13, DOM_VK_UP = 38, DOM_VK_DOWN = 40; + if ((evt.keyCode === 32 || evt.keyCode === 13 || evt.keyCode === 14) && !evt.altKey && !evt.ctrlKey && !evt.metaKey) { + activate(); + Event.cancel(evt); + } else if (evt.type === 'click' || evt.keyCode === DOM_VK_DOWN) { + t.showMenu(); + Event.cancel(evt); + } }); } - Event.add(t.id + '_open', 'click', t.showMenu, t); - Event.add(t.id + '_open', 'focus', function() {t._focused = 1;}); - Event.add(t.id + '_open', 'blur', function() {t._focused = 0;}); + Event.add(t.id + '_open', 'click', function (evt) { + t.showMenu(); + Event.cancel(evt); + }); + Event.add([t.id, t.id + '_open'], 'focus', function() {t._focused = 1;}); + Event.add([t.id, t.id + '_open'], 'blur', function() {t._focused = 0;}); // Old IE doesn't have hover on all elements if (tinymce.isIE6 || !DOM.boxModel) { @@ -8562,6 +10393,7 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', { Event.clear(this.id + '_action'); Event.clear(this.id + '_open'); + Event.clear(this.id); } }); })(tinymce); @@ -8570,10 +10402,10 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', { var DOM = tinymce.DOM, Event = tinymce.dom.Event, is = tinymce.is, each = tinymce.each; tinymce.create('tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton', { - ColorSplitButton : function(id, s) { + ColorSplitButton : function(id, s, ed) { var t = this; - t.parent(id, s); + t.parent(id, s, ed); t.settings = s = tinymce.extend({ colors : '000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF', @@ -8631,30 +10463,31 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', { hideMenu : function(e) { var t = this; - // Prevent double toogles by canceling the mouse click event to the button - if (e && e.type == "mousedown" && DOM.getParent(e.target, function(e) {return e.id === t.id + '_open';})) - return; - - if (!e || !DOM.getParent(e.target, '.mceSplitButtonMenu')) { - DOM.removeClass(t.id, 'mceSplitButtonSelected'); - Event.remove(DOM.doc, 'mousedown', t.hideMenu, t); - Event.remove(t.id + '_menu', 'keydown', t._keyHandler); - DOM.hide(t.id + '_menu'); - } + if (t.isMenuVisible) { + // Prevent double toogles by canceling the mouse click event to the button + if (e && e.type == "mousedown" && DOM.getParent(e.target, function(e) {return e.id === t.id + '_open';})) + return; - t.onHideMenu.dispatch(t); + if (!e || !DOM.getParent(e.target, '.mceSplitButtonMenu')) { + DOM.removeClass(t.id, 'mceSplitButtonSelected'); + Event.remove(DOM.doc, 'mousedown', t.hideMenu, t); + Event.remove(t.id + '_menu', 'keydown', t._keyHandler); + DOM.hide(t.id + '_menu'); + } - t.isMenuVisible = 0; + t.isMenuVisible = 0; + t.onHideMenu.dispatch(); + } }, renderMenu : function() { - var t = this, m, i = 0, s = t.settings, n, tb, tr, w; + var t = this, m, i = 0, s = t.settings, n, tb, tr, w, context; - w = DOM.add(s.menu_container, 'div', {id : t.id + '_menu', 'class' : s['menu_class'] + ' ' + s['class'], style : 'position:absolute;left:0;top:-1000px;'}); + w = DOM.add(s.menu_container, 'div', {role: 'listbox', id : t.id + '_menu', 'class' : s['menu_class'] + ' ' + s['class'], style : 'position:absolute;left:0;top:-1000px;'}); m = DOM.add(w, 'div', {'class' : s['class'] + ' mceSplitButtonMenu'}); DOM.add(m, 'span', {'class' : 'mceMenuLine'}); - n = DOM.add(m, 'table', {'class' : 'mceColorSplitMenu'}); + n = DOM.add(m, 'table', {role: 'presentation', 'class' : 'mceColorSplitMenu'}); tb = DOM.add(n, 'tbody'); // Generate color grid @@ -8668,20 +10501,32 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', { } n = DOM.add(tr, 'td'); - n = DOM.add(n, 'a', { + role : 'option', href : 'javascript:;', style : { backgroundColor : '#' + c }, - _mce_color : '#' + c + 'title': t.editor.getLang('colors.' + c, c), + 'data-mce-color' : '#' + c }); + + if (t.editor.forcedHighContrastMode) { + n = DOM.add(n, 'canvas', { width: 16, height: 16, 'aria-hidden': 'true' }); + if (n.getContext && (context = n.getContext("2d"))) { + context.fillStyle = '#' + c; + context.fillRect(0, 0, 16, 16); + } else { + // No point leaving a canvas element around if it's not supported for drawing on anyway. + DOM.remove(n); + } + } }); if (s.more_colors_func) { n = DOM.add(tb, 'tr'); n = DOM.add(n, 'td', {colspan : s.grid_width, 'class' : 'mceMoreColors'}); - n = DOM.add(n, 'a', {id : t.id + '_more', href : 'javascript:;', onclick : 'return false;', 'class' : 'mceMoreColors'}, s.more_colors_title); + n = DOM.add(n, 'a', {role: 'option', id : t.id + '_more', href : 'javascript:;', onclick : 'return false;', 'class' : 'mceMoreColors'}, s.more_colors_title); Event.add(n, 'click', function(e) { s.more_colors_func.call(s.more_colors_scope || this); @@ -8690,13 +10535,25 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', { } DOM.addClass(m, 'mceColorSplitMenu'); + + new tinymce.ui.KeyboardNavigation({ + root: t.id + '_menu', + items: DOM.select('a', t.id + '_menu'), + onCancel: function() { + t.hideMenu(); + t.focus(); + } + }); + + // Prevent IE from scrolling and hindering click to occur #4019 + Event.add(t.id + '_menu', 'mousedown', function(e) {return Event.cancel(e);}); Event.add(t.id + '_menu', 'click', function(e) { var c; - e = e.target; + e = DOM.getParent(e.target, 'a', tb); - if (e.nodeName == 'A' && (c = e.getAttribute('_mce_color'))) + if (e && e.nodeName.toLowerCase() == 'a' && (c = e.getAttribute('data-mce-color'))) t.setColor(c); return Event.cancel(e); // Prevent IE auto save warning @@ -8706,13 +10563,17 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', { }, setColor : function(c) { + this.displayColor(c); + this.hideMenu(); + this.settings.onselect(c); + }, + + displayColor : function(c) { var t = this; DOM.setStyle(t.id + '_preview', 'backgroundColor', c); t.value = c; - t.hideMenu(); - t.settings.onselect(c); }, postRender : function() { @@ -8733,9 +10594,72 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', { }); })(tinymce); +(function(tinymce) { +// Shorten class names +var dom = tinymce.DOM, each = tinymce.each, Event = tinymce.dom.Event; +tinymce.create('tinymce.ui.ToolbarGroup:tinymce.ui.Container', { + renderHTML : function() { + var t = this, h = [], controls = t.controls, each = tinymce.each, settings = t.settings; + + h.push('
    '); + //TODO: ACC test this out - adding a role = application for getting the landmarks working well. + h.push(""); + h.push(''); + each(controls, function(toolbar) { + h.push(toolbar.renderHTML()); + }); + h.push(""); + h.push('
    '); + + return h.join(''); + }, + + focus : function() { + var t = this; + dom.get(t.id).focus(); + }, + + postRender : function() { + var t = this, items = []; + + each(t.controls, function(toolbar) { + each (toolbar.controls, function(control) { + if (control.id) { + items.push(control); + } + }); + }); + + t.keyNav = new tinymce.ui.KeyboardNavigation({ + root: t.id, + items: items, + onCancel: function() { + //Move focus if webkit so that navigation back will read the item. + if (tinymce.isWebKit) { + dom.get(t.editor.id+"_ifr").focus(); + } + t.editor.focus(); + }, + excludeFromTabOrder: !t.settings.tab_focus_toolbar + }); + }, + + destroy : function() { + var self = this; + + self.parent(); + self.keyNav.destroy(); + Event.clear(self.id); + } +}); +})(tinymce); + +(function(tinymce) { +// Shorten class names +var dom = tinymce.DOM, each = tinymce.each; tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { renderHTML : function() { - var t = this, h = '', c, co, dom = tinymce.DOM, s = t.settings, i, pr, nx, cl; + var t = this, h = '', c, co, s = t.settings, i, pr, nx, cl; cl = t.controls; for (i=0; i')); - return dom.createHTML('table', {id : t.id, 'class' : 'mceToolbar' + (s['class'] ? ' ' + s['class'] : ''), cellpadding : '0', cellspacing : '0', align : t.settings.align || ''}, '' + h + ''); + return dom.createHTML('table', {id : t.id, 'class' : 'mceToolbar' + (s['class'] ? ' ' + s['class'] : ''), cellpadding : '0', cellspacing : '0', align : t.settings.align || '', role: 'presentation', tabindex: '-1'}, '' + h + ''); } }); +})(tinymce); (function(tinymce) { var Dispatcher = tinymce.util.Dispatcher, each = tinymce.each; tinymce.create('tinymce.AddOnManager', { - items : [], - urls : {}, - lookup : {}, + AddOnManager : function() { + var self = this; - onAdd : new Dispatcher(this), + self.items = []; + self.urls = {}; + self.lookup = {}; + self.onAdd = new Dispatcher(self); + }, get : function(n) { - return this.lookup[n]; + if (this.lookup[n]) { + return this.lookup[n].instance; + } else { + return undefined; + } + }, + + dependencies : function(n) { + var result; + if (this.lookup[n]) { + result = this.lookup[n].dependencies; + } + return result || []; }, requireLangPack : function(n) { var s = tinymce.settings; - if (s && s.language) + if (s && s.language && s.language_load !== false) tinymce.ScriptLoader.add(this.urls[n] + '/langs/' + s.language + '.js'); }, - add : function(id, o) { + add : function(id, o, dependencies) { this.items.push(o); - this.lookup[id] = o; + this.lookup[id] = {instance:o, dependencies:dependencies}; this.onAdd.dispatch(this, id, o); return o; }, + createUrl: function(baseUrl, dep) { + if (typeof dep === "object") { + return dep + } else { + return {prefix: baseUrl.prefix, resource: dep, suffix: baseUrl.suffix}; + } + }, + + addComponents: function(pluginName, scripts) { + var pluginUrl = this.urls[pluginName]; + tinymce.each(scripts, function(script){ + tinymce.ScriptLoader.add(pluginUrl+"/"+script); + }); + }, load : function(n, u, cb, s) { - var t = this; + var t = this, url = u; + + function loadDependencies() { + var dependencies = t.dependencies(n); + tinymce.each(dependencies, function(dep) { + var newUrl = t.createUrl(u, dep); + t.load(newUrl.resource, newUrl, undefined, undefined); + }); + if (cb) { + if (s) { + cb.call(s); + } else { + cb.call(tinymce.ScriptLoader); + } + } + } if (t.urls[n]) return; + if (typeof u === "object") + url = u.prefix + u.resource + u.suffix; - if (u.indexOf('/') != 0 && u.indexOf('://') == -1) - u = tinymce.baseURL + '/' + u; + if (url.indexOf('/') != 0 && url.indexOf('://') == -1) + url = tinymce.baseURL + '/' + url; - t.urls[n] = u.substring(0, u.lastIndexOf('/')); - tinymce.ScriptLoader.add(u, cb, s); + t.urls[n] = url.substring(0, url.lastIndexOf('/')); + + if (t.lookup[n]) { + loadDependencies(); + } else { + tinymce.ScriptLoader.add(url, loadDependencies, s); + } } }); @@ -9289,10 +11265,10 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { visual_table_class : 'mceItemTable', visual : 1, font_size_style_values : 'xx-small,x-small,small,medium,large,x-large,xx-large', + font_size_legacy_values : 'xx-small,small,medium,large,x-large,xx-large,300%', // See: http://www.w3.org/TR/CSS2/fonts.html#propdef-font-size apply_source_formatting : 1, directionality : 'ltr', forced_root_block : 'p', - valid_elements : '@[id|class|style|title|dir'; $element->setClass('input-text'); - $html.= '' . "\n"; - $html.= ''."\n"; return $html; } } diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Account.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Account.php index 8e33cc0ffd..ade577960c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Account.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Account.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -66,6 +66,8 @@ public function initForm() $attributes = $customerForm->getAttributes(); foreach ($attributes as $attribute) { + /* @var $attribute Mage_Eav_Model_Entity_Attribute */ + $attribute->setFrontendLabel(Mage::helper('customer')->__($attribute->getFrontend()->getLabel())); $attribute->unsIsVisible(); } @@ -108,6 +110,17 @@ function(v, elem){ . '' ); } + $form->getElement('website_id')->setAfterElementHtml( + Mage::getBlockSingleton('adminhtml/store_switcher')->getHintHtml() + ); + +// if (Mage::app()->isSingleStoreMode()) { +// $fieldset->removeField('website_id'); +// $fieldset->addField('website_id', 'hidden', array( +// 'name' => 'website_id' +// )); +// $customer->setWebsiteId(Mage::app()->getStore(true)->getWebsiteId()); +// } $customerStoreId = null; if ($customer->getId()) { diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Addresses.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Addresses.php index 1f63a781e1..4cb8dc6049 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Addresses.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Addresses.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -128,11 +128,14 @@ public function initForm() ->processStreetAttribute($attributes['street']); } foreach ($attributes as $attribute) { + /* @var $attribute Mage_Eav_Model_Entity_Attribute */ + $attribute->setFrontendLabel(Mage::helper('customer')->__($attribute->getFrontend()->getLabel())); $attribute->unsIsVisible(); } $this->_setFieldset($attributes, $fieldset); $regionElement = $form->getElement('region'); + $regionElement->setRequired(true); if ($regionElement) { $regionElement->setRenderer(Mage::getModel('adminhtml/customer_renderer_region')); } diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Cart.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Cart.php index 82830f1d57..67ba2a9bcf 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Cart.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Cart.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Carts.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Carts.php index 92f8dbdad8..234eaaee1d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Carts.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Carts.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter.php index 286fcbeadd..a155fb616a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter/Grid.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter/Grid.php index 9b336eea3c..4f73eb6f51 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter/Grid/Filter/Status.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter/Grid/Filter/Status.php index a0245b43d4..2fa90106a2 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter/Grid/Filter/Status.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter/Grid/Filter/Status.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter/Grid/Renderer/Action.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter/Grid/Renderer/Action.php index 9fd29017ee..cdc84b1704 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter/Grid/Renderer/Action.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter/Grid/Renderer/Action.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter/Grid/Renderer/Status.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter/Grid/Renderer/Status.php index 4fd13bc623..667db667d7 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter/Grid/Renderer/Status.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter/Grid/Renderer/Status.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Orders.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Orders.php index f028041df0..9990cf0759 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Orders.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Orders.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Reviews.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Reviews.php index c07a0e60fd..c3f6db5427 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Reviews.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Reviews.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Tag.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Tag.php index 716499ae0f..ac2fe8e8ac 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Tag.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Tag.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Tags.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Tags.php index f7959b89bf..c47e39ade0 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Tags.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Tags.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View.php index 298d3c347b..be8efc5396 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Accordion.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Accordion.php index 7e1d587644..aee7be39a2 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Accordion.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Accordion.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -70,10 +70,8 @@ protected function _prepareLayout() } // count wishlist items - $wishlist = Mage::getModel('wishlist/wishlist'); - $wishlistCount = $wishlist->loadByCustomer($customer) - ->setSharedStoreIds($wishlist->getSharedStoreIds(false)) - ->getItemCollection() + $wishlistCount = Mage::getModel('wishlist/item')->getCollection() + ->addCustomerIdFilter($customer->getId()) ->addStoreData() ->getSize(); // add wishlist ajax accordion diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Cart.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Cart.php index b9c2bc7f87..8b9746fb9d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Cart.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Cart.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Grid/Renderer/Item.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Grid/Renderer/Item.php index 0b76d63e2e..4614547a66 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Grid/Renderer/Item.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Grid/Renderer/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Orders.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Orders.php index 48187523cb..2abf9a8bf8 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Orders.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Orders.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Sales.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Sales.php index fa44c1c009..f9cd3d3b5c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Sales.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Sales.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Wishlist.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Wishlist.php index 5913958086..feee69c188 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Wishlist.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Wishlist.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -55,10 +55,8 @@ public function __construct() */ protected function _prepareCollection() { - $wishlist = Mage::getModel('wishlist/wishlist'); - $collection = $wishlist->loadByCustomer(Mage::registry('current_customer')) - ->setSharedStoreIds($wishlist->getSharedStoreIds(false)) - ->getItemCollection() + $collection = Mage::getModel('wishlist/item')->getCollection() + ->addCustomerIdFilter(Mage::registry('current_customer')->getId()) ->addDaysInWishlist(true) ->addStoreData() ->setInStockFilter(true); diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Wishlist.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Wishlist.php index 6fdbf6add5..7c6e9c2087 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Wishlist.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Wishlist.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -41,6 +41,7 @@ class Mage_Adminhtml_Block_Customer_Edit_Tab_Wishlist extends Mage_Adminhtml_Blo */ protected $_defaultSort = 'added_at'; + /** * Parent template name * @@ -78,6 +79,16 @@ protected function _getCustomer() return Mage::registry('current_customer'); } + /** + * Create customer wishlist item collection + * + * @return Mage_Wishlist_Model_Resource_Item_Collection + */ + protected function _createCollection() + { + return Mage::getModel('wishlist/item')->getCollection(); + } + /** * Prepare customer wishlist product collection * @@ -85,14 +96,10 @@ protected function _getCustomer() */ protected function _prepareCollection() { - $wishlist = Mage::getModel('wishlist/wishlist'); - $collection = $wishlist->loadByCustomer($this->_getCustomer()) - ->setSharedStoreIds($wishlist->getSharedStoreIds(false)) - ->getItemCollection() + $collection = $this->_createCollection()->addCustomerIdFilter($this->_getCustomer()->getId()) ->resetSortOrder() ->addDaysInWishlist() ->addStoreData(); - $this->setCollection($collection); return parent::_prepareCollection(); diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Wishlist/Grid/Renderer/Description.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Wishlist/Grid/Renderer/Description.php index 677449514d..3b9d22ee26 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Wishlist/Grid/Renderer/Description.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Wishlist/Grid/Renderer/Description.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tabs.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tabs.php index 926907943e..6e439641d9 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tabs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Form/Element/Boolean.php b/app/code/core/Mage/Adminhtml/Block/Customer/Form/Element/Boolean.php index b5e2e95629..b12b6ad16a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Form/Element/Boolean.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Form/Element/Boolean.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Form/Element/File.php b/app/code/core/Mage/Adminhtml/Block/Customer/Form/Element/File.php index 4c114eec5c..5650322ebf 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Form/Element/File.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Form/Element/File.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Form/Element/Image.php b/app/code/core/Mage/Adminhtml/Block/Customer/Form/Element/Image.php index 196c8f5f39..ea3df0f5e4 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Form/Element/Image.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Form/Element/Image.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Grid.php b/app/code/core/Mage/Adminhtml/Block/Customer/Grid.php index bfe4474a5c..09eddb264d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Grid/Filter/Country.php b/app/code/core/Mage/Adminhtml/Block/Customer/Grid/Filter/Country.php index ccd60f65a8..6a29d682b9 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Grid/Filter/Country.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Grid/Filter/Country.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Grid/Renderer/Multiaction.php b/app/code/core/Mage/Adminhtml/Block/Customer/Grid/Renderer/Multiaction.php index 8663e9dae6..9d0bb5d53f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Grid/Renderer/Multiaction.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Grid/Renderer/Multiaction.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Group.php b/app/code/core/Mage/Adminhtml/Block/Customer/Group.php index 44cd213d24..a67da7c98e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Group.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Group.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Group/Edit.php b/app/code/core/Mage/Adminhtml/Block/Customer/Group/Edit.php index 237c262b5f..a6dba63d57 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Group/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Group/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Group/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Customer/Group/Edit/Form.php index 7373461523..3eed85e3e5 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Group/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Group/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Group/Grid.php b/app/code/core/Mage/Adminhtml/Block/Customer/Group/Grid.php index e037431450..29f1ce386f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Group/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Group/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Online.php b/app/code/core/Mage/Adminhtml/Block/Customer/Online.php index 9bd2b8b722..15e36bc76b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Online.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Online.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Online/Filter.php b/app/code/core/Mage/Adminhtml/Block/Customer/Online/Filter.php index 097ff27059..916372d3d3 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Online/Filter.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Online/Filter.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Online/Grid.php b/app/code/core/Mage/Adminhtml/Block/Customer/Online/Grid.php index a01fad94eb..b2aff54257 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Online/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Online/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Online/Grid/Renderer/Ip.php b/app/code/core/Mage/Adminhtml/Block/Customer/Online/Grid/Renderer/Ip.php index a86421137a..de30d6d84e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Online/Grid/Renderer/Ip.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Online/Grid/Renderer/Ip.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Online/Grid/Renderer/Type.php b/app/code/core/Mage/Adminhtml/Block/Customer/Online/Grid/Renderer/Type.php index 1d6930a59d..353803c2f3 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Online/Grid/Renderer/Type.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Online/Grid/Renderer/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Online/Grid/Renderer/Url.php b/app/code/core/Mage/Adminhtml/Block/Customer/Online/Grid/Renderer/Url.php index 1cb7bab9ef..70853370d7 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Online/Grid/Renderer/Url.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Online/Grid/Renderer/Url.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Sales/Order/Address/Form/Billing/Renderer/Vat.php b/app/code/core/Mage/Adminhtml/Block/Customer/Sales/Order/Address/Form/Renderer/Vat.php similarity index 59% rename from app/code/core/Mage/Adminhtml/Block/Customer/Sales/Order/Address/Form/Billing/Renderer/Vat.php rename to app/code/core/Mage/Adminhtml/Block/Customer/Sales/Order/Address/Form/Renderer/Vat.php index 607a1fe9af..aaa6f2d7e3 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Sales/Order/Address/Form/Billing/Renderer/Vat.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Sales/Order/Address/Form/Renderer/Vat.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -31,7 +31,7 @@ * @package Mage_Adminhtml * @author Magento Core Team */ -class Mage_Adminhtml_Block_Customer_Sales_Order_Address_Form_Billing_Renderer_Vat +class Mage_Adminhtml_Block_Customer_Sales_Order_Address_Form_Renderer_Vat extends Mage_Adminhtml_Block_Widget_Form_Renderer_Fieldset_Element { /** @@ -46,7 +46,7 @@ class Mage_Adminhtml_Block_Customer_Sales_Order_Address_Form_Billing_Renderer_Va */ protected function _construct() { - $this->setTemplate('customer/sales/order/create/billing/form/renderer/vat.phtml'); + $this->setTemplate('customer/sales/order/create/address/form/renderer/vat.phtml'); } /** @@ -62,34 +62,35 @@ public function getValidateButton() $vatElementId = $this->_element->getHtmlId(); - /** @var $formAccountBlock Mage_Adminhtml_Block_Sales_Order_Create_Form_Account */ - $formAccountBlock = $this->getLayout()->getBlock('form_account'); - $groupIdHtmlId = $formAccountBlock->getForm()->getElement('group_id')->getHtmlId(); - $countryElementId = $form->getElement('country_id')->getHtmlId(); $validateUrl = Mage::getSingleton('adminhtml/url') ->getUrl('*/customer_system_config_validatevat/validateAdvanced'); + $groupSuggestionMessage = Mage::helper('customer')->__('The customer is currently assigned to Customer Group %s.') + . ' ' . Mage::helper('customer')->__('Would you like to change the Customer Group for this order?'); + $vatValidateOptions = Mage::helper('core')->jsonEncode(array( - 'vatElementId' => $vatElementId, - 'countryElementId' => $countryElementId, - 'groupIdHtmlId' => $groupIdHtmlId, - 'validateUrl' => $validateUrl, - 'vatValidMessage' => Mage::helper('customer')->__('The VAT ID is valid. The current Customer Group will be used.'), - 'vatValidAndGroupChangeMessage' => - Mage::helper('customer')->__('Based on the VAT ID, the customer would belong to Customer Group %s.') . "\n" - . Mage::helper('customer')->__('The customer is currently assigned to Customer Group %s.') . ' ' - . Mage::helper('customer')->__('Would you like to change the Customer Group for this order?'), - 'vatInvalidMessage' => Mage::helper('customer')->__('The VAT ID entered (%s) is not valid VAT ID.'), - 'vatValidationFailedMessage' => Mage::helper('customer')->__('There was an error validating the VAT ID. Please try again later.'), + 'vatElementId' => $vatElementId, + 'countryElementId' => $countryElementId, + 'groupIdHtmlId' => 'group_id', + 'validateUrl' => $validateUrl, + 'vatValidMessage' => Mage::helper('customer')->__('The VAT ID is valid. The current Customer Group will be used.'), + 'vatValidAndGroupChangeMessage' => Mage::helper('customer')->__('Based on the VAT ID, the customer would belong to the Customer Group %s.') + . "\n" . $groupSuggestionMessage, + 'vatInvalidMessage' => Mage::helper('customer')->__('The VAT ID entered (%s) is not a valid VAT ID. The customer would belong to Customer Group %s.') + . "\n" . $groupSuggestionMessage, + 'vatValidationFailedMessage' => Mage::helper('customer')->__('There was an error validating the VAT ID. The customer would belong to Customer Group %s.') + . "\n" . $groupSuggestionMessage, + 'vatErrorMessage' => Mage::helper('customer')->__('There was an error validating the VAT ID.') )); - $beforeHtml = ''; + $optionsVarName = $this->getJsVariablePrefix() . 'VatParameters'; + $beforeHtml = ''; $this->_validateButton = $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array( 'label' => Mage::helper('customer')->__('Validate VAT Number'), 'before_html' => $beforeHtml, - 'onclick' => "order.validateVat(vatValidateOptions)" + 'onclick' => 'order.validateVat(' . $optionsVarName . ')' )); } return $this->_validateButton; diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/System/Config/Validatevat.php b/app/code/core/Mage/Adminhtml/Block/Customer/System/Config/Validatevat.php index 43d675169a..2e2f4d76f1 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/System/Config/Validatevat.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/System/Config/Validatevat.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard.php b/app/code/core/Mage/Adminhtml/Block/Dashboard.php index d9fb3919ab..f1d4feaa77 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Abstract.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Abstract.php index 93ccbd1bd4..1f134e5e0c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Bar.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Bar.php index 2de2302f52..b28909bc5d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Bar.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Bar.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Diagrams.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Diagrams.php index f69318ed19..05a5841acc 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Diagrams.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Diagrams.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php index b1a82c2253..3cc112117e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Grid.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Grid.php index f101d7440d..17abc4ddcb 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Grids.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Grids.php index 0f00305e00..a70f64c441 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Grids.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Grids.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Orders/Grid.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Orders/Grid.php index fcb6ced829..1298ad5a1e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Orders/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Orders/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Sales.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Sales.php index 2941ab8d0f..781fc5096b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Sales.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Sales.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Searches/Last.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Searches/Last.php index be3fcb3827..61d8110643 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Searches/Last.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Searches/Last.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Searches/Renderer/Searchquery.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Searches/Renderer/Searchquery.php index 3dce83ab43..45f269e080 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Searches/Renderer/Searchquery.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Searches/Renderer/Searchquery.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Searches/Top.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Searches/Top.php index 61ed0d554a..1642fcccb7 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Searches/Top.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Searches/Top.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Amounts.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Amounts.php index a60b5f4523..439e540316 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Amounts.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Amounts.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Customers/Most.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Customers/Most.php index 61bd2cde3c..0deae7ba9b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Customers/Most.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Customers/Most.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Customers/Newest.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Customers/Newest.php index d5e23d300f..bf6c89cb23 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Customers/Newest.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Customers/Newest.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Orders.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Orders.php index 0d3ae3914f..53f43acabe 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Orders.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Orders.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Products/Ordered.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Products/Ordered.php index 753436aea9..e636e907d8 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Products/Ordered.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Products/Ordered.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Products/Viewed.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Products/Viewed.php index 3e304a04be..577ceb8a0a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Products/Viewed.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Products/Viewed.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Totals.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Totals.php index 0741865246..a48ce71cd7 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Totals.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Totals.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Denied.php b/app/code/core/Mage/Adminhtml/Block/Denied.php index 16693aed65..a1c5fafe02 100644 --- a/app/code/core/Mage/Adminhtml/Block/Denied.php +++ b/app/code/core/Mage/Adminhtml/Block/Denied.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Html/Date.php b/app/code/core/Mage/Adminhtml/Block/Html/Date.php index 923dd44788..5df7455edb 100644 --- a/app/code/core/Mage/Adminhtml/Block/Html/Date.php +++ b/app/code/core/Mage/Adminhtml/Block/Html/Date.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Html/Select.php b/app/code/core/Mage/Adminhtml/Block/Html/Select.php index 7c9e6f0008..e421aebd99 100644 --- a/app/code/core/Mage/Adminhtml/Block/Html/Select.php +++ b/app/code/core/Mage/Adminhtml/Block/Html/Select.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Media/Editor.php b/app/code/core/Mage/Adminhtml/Block/Media/Editor.php index 232a139185..0741c87810 100644 --- a/app/code/core/Mage/Adminhtml/Block/Media/Editor.php +++ b/app/code/core/Mage/Adminhtml/Block/Media/Editor.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Media/Uploader.php b/app/code/core/Mage/Adminhtml/Block/Media/Uploader.php index 177f6ec3c0..033ece1446 100644 --- a/app/code/core/Mage/Adminhtml/Block/Media/Uploader.php +++ b/app/code/core/Mage/Adminhtml/Block/Media/Uploader.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Messages.php b/app/code/core/Mage/Adminhtml/Block/Messages.php index 87546c9489..749bfe6867 100644 --- a/app/code/core/Mage/Adminhtml/Block/Messages.php +++ b/app/code/core/Mage/Adminhtml/Block/Messages.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Problem.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Problem.php index 8339ac5641..5ef078a17d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Problem.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Problem.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Problem/Grid.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Problem/Grid.php index 1374d377c8..243884d3e9 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Problem/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Problem/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Problem/Grid/Filter/Checkbox.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Problem/Grid/Filter/Checkbox.php index bb10bace3a..82043530b9 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Problem/Grid/Filter/Checkbox.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Problem/Grid/Filter/Checkbox.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Problem/Grid/Renderer/Checkbox.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Problem/Grid/Renderer/Checkbox.php index 8e4d0238e5..1a45eb91dc 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Problem/Grid/Renderer/Checkbox.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Problem/Grid/Renderer/Checkbox.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue.php index 43dfeff276..77f63ab30b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Edit.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Edit.php index ee61b385dc..d1bfdf5334 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Edit/Form.php index c22aa8d20f..79cf05d384 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Grid.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Grid.php index 0b81e32d02..ac69f0025e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Grid/Renderer/Action.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Grid/Renderer/Action.php index b0d3360147..1088665f64 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Grid/Renderer/Action.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Grid/Renderer/Action.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Preview.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Preview.php index 111dcbbea8..be865af6b7 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Preview.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Preview.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Preview/Form.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Preview/Form.php index 5939a0c203..9fbc38a8e6 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Preview/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Preview/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber.php index 12d40e1dd5..ff007e186b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber/Grid.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber/Grid.php index 2dd73df121..a8116d2c6b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber/Grid/Filter/Checkbox.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber/Grid/Filter/Checkbox.php index b154ea8433..9a3a1b9a8c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber/Grid/Filter/Checkbox.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber/Grid/Filter/Checkbox.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber/Grid/Filter/Website.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber/Grid/Filter/Website.php index 458ea12e84..9befdb792c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber/Grid/Filter/Website.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber/Grid/Filter/Website.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber/Grid/Renderer/Checkbox.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber/Grid/Renderer/Checkbox.php index 66e841e03c..1cfdc93dc1 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber/Grid/Renderer/Checkbox.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber/Grid/Renderer/Checkbox.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Template.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Template.php index 7291521675..514e49a528 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Template.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Template.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Edit.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Edit.php index 50205e187f..e8b2bf662e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Edit/Form.php index 368c0cea03..eadc2145f0 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Grid.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Grid.php index fbcb522c12..2541d4d7d2 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Grid/Renderer/Action.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Grid/Renderer/Action.php index 8e6b4ec483..040bb9a48b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Grid/Renderer/Action.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Grid/Renderer/Action.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Grid/Renderer/Sender.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Grid/Renderer/Sender.php index 8f5bb82d78..ad90b21190 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Grid/Renderer/Sender.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Grid/Renderer/Sender.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Preview.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Preview.php index b0ec65ceb5..0612e0ce16 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Preview.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Preview.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Preview/Form.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Preview/Form.php index ef39ea765f..5b7d506dff 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Preview/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Preview/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Notification/Baseurl.php b/app/code/core/Mage/Adminhtml/Block/Notification/Baseurl.php index 299f55c4c3..99bb8b55f0 100644 --- a/app/code/core/Mage/Adminhtml/Block/Notification/Baseurl.php +++ b/app/code/core/Mage/Adminhtml/Block/Notification/Baseurl.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Notification/Grid.php b/app/code/core/Mage/Adminhtml/Block/Notification/Grid.php index 3c170c62fe..32ee28a168 100644 --- a/app/code/core/Mage/Adminhtml/Block/Notification/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Notification/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Notification/Grid/Renderer/Actions.php b/app/code/core/Mage/Adminhtml/Block/Notification/Grid/Renderer/Actions.php index 1d43790e68..7a78776fe8 100644 --- a/app/code/core/Mage/Adminhtml/Block/Notification/Grid/Renderer/Actions.php +++ b/app/code/core/Mage/Adminhtml/Block/Notification/Grid/Renderer/Actions.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Notification/Grid/Renderer/Notice.php b/app/code/core/Mage/Adminhtml/Block/Notification/Grid/Renderer/Notice.php index 6243ddf030..5b0f34580d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Notification/Grid/Renderer/Notice.php +++ b/app/code/core/Mage/Adminhtml/Block/Notification/Grid/Renderer/Notice.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Notification/Grid/Renderer/Severity.php b/app/code/core/Mage/Adminhtml/Block/Notification/Grid/Renderer/Severity.php index 74850b8ad7..3138ac50d5 100644 --- a/app/code/core/Mage/Adminhtml/Block/Notification/Grid/Renderer/Severity.php +++ b/app/code/core/Mage/Adminhtml/Block/Notification/Grid/Renderer/Severity.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Notification/Inbox.php b/app/code/core/Mage/Adminhtml/Block/Notification/Inbox.php index 45004eeb92..53b5bb6ea3 100644 --- a/app/code/core/Mage/Adminhtml/Block/Notification/Inbox.php +++ b/app/code/core/Mage/Adminhtml/Block/Notification/Inbox.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Notification/Security.php b/app/code/core/Mage/Adminhtml/Block/Notification/Security.php index 9459a83045..7e524804d6 100644 --- a/app/code/core/Mage/Adminhtml/Block/Notification/Security.php +++ b/app/code/core/Mage/Adminhtml/Block/Notification/Security.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Notification/Survey.php b/app/code/core/Mage/Adminhtml/Block/Notification/Survey.php index d613cd9d5b..101c48c051 100644 --- a/app/code/core/Mage/Adminhtml/Block/Notification/Survey.php +++ b/app/code/core/Mage/Adminhtml/Block/Notification/Survey.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Notification/Toolbar.php b/app/code/core/Mage/Adminhtml/Block/Notification/Toolbar.php index c490c08bb7..649f281187 100644 --- a/app/code/core/Mage/Adminhtml/Block/Notification/Toolbar.php +++ b/app/code/core/Mage/Adminhtml/Block/Notification/Toolbar.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Notification/Window.php b/app/code/core/Mage/Adminhtml/Block/Notification/Window.php index d5c3fe2c90..f442f7657a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Notification/Window.php +++ b/app/code/core/Mage/Adminhtml/Block/Notification/Window.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -53,17 +53,17 @@ protected function _construct() { parent::_construct(); - $this->setHeaderText(addslashes($this->__('Incoming Message'))); - $this->setCloseText(addslashes($this->__('close'))); - $this->setReadDetailsText(addslashes($this->__('Read details'))); - $this->setNoticeText(addslashes($this->__('NOTICE'))); - $this->setMinorText(addslashes($this->__('MINOR'))); - $this->setMajorText(addslashes($this->__('MAJOR'))); - $this->setCriticalText(addslashes($this->__('CRITICAL'))); + $this->setHeaderText($this->escapeHtml($this->__('Incoming Message'))); + $this->setCloseText($this->escapeHtml($this->__('close'))); + $this->setReadDetailsText($this->escapeHtml($this->__('Read details'))); + $this->setNoticeText($this->escapeHtml($this->__('NOTICE'))); + $this->setMinorText($this->escapeHtml($this->__('MINOR'))); + $this->setMajorText($this->escapeHtml($this->__('MAJOR'))); + $this->setCriticalText($this->escapeHtml($this->__('CRITICAL'))); - $this->setNoticeMessageText(addslashes($this->getLastNotice()->getTitle())); - $this->setNoticeMessageUrl(addslashes($this->getLastNotice()->getUrl())); + $this->setNoticeMessageText($this->escapeHtml($this->getLastNotice()->getTitle())); + $this->setNoticeMessageUrl($this->escapeUrl($this->getLastNotice()->getUrl())); switch ($this->getLastNotice()->getSeverity()) { default: diff --git a/app/code/core/Mage/Adminhtml/Block/Page.php b/app/code/core/Mage/Adminhtml/Block/Page.php index e94d14d789..9d0ba5e6d9 100644 --- a/app/code/core/Mage/Adminhtml/Block/Page.php +++ b/app/code/core/Mage/Adminhtml/Block/Page.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Page/Footer.php b/app/code/core/Mage/Adminhtml/Block/Page/Footer.php index 75b3dd56b6..f68da9c154 100644 --- a/app/code/core/Mage/Adminhtml/Block/Page/Footer.php +++ b/app/code/core/Mage/Adminhtml/Block/Page/Footer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Page/Head.php b/app/code/core/Mage/Adminhtml/Block/Page/Head.php index 73c7e73c11..33919334c1 100644 --- a/app/code/core/Mage/Adminhtml/Block/Page/Head.php +++ b/app/code/core/Mage/Adminhtml/Block/Page/Head.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Page/Header.php b/app/code/core/Mage/Adminhtml/Block/Page/Header.php index 4976a165a2..43f6f8523e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Page/Header.php +++ b/app/code/core/Mage/Adminhtml/Block/Page/Header.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Page/Menu.php b/app/code/core/Mage/Adminhtml/Block/Page/Menu.php index 3b2d86e386..c551e023ac 100644 --- a/app/code/core/Mage/Adminhtml/Block/Page/Menu.php +++ b/app/code/core/Mage/Adminhtml/Block/Page/Menu.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Page/Notices.php b/app/code/core/Mage/Adminhtml/Block/Page/Notices.php index 4b9c4a9956..0ae1c05099 100644 --- a/app/code/core/Mage/Adminhtml/Block/Page/Notices.php +++ b/app/code/core/Mage/Adminhtml/Block/Page/Notices.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/Buttons.php b/app/code/core/Mage/Adminhtml/Block/Permissions/Buttons.php index 776cda97f5..a3cd5bc6c7 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/Buttons.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/Buttons.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/Editroles.php b/app/code/core/Mage/Adminhtml/Block/Permissions/Editroles.php index 659674dfbc..e9bbc97d54 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/Editroles.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/Editroles.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/Edituser.php b/app/code/core/Mage/Adminhtml/Block/Permissions/Edituser.php index 8269e32938..0aa0574e78 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/Edituser.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/Edituser.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/Grid/Role.php b/app/code/core/Mage/Adminhtml/Block/Permissions/Grid/Role.php index 7d46139773..89c01a1dba 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/Grid/Role.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/Grid/Role.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/Grid/User.php b/app/code/core/Mage/Adminhtml/Block/Permissions/Grid/User.php index cf6bd8e279..f1ae1fc174 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/Grid/User.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/Grid/User.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/Role.php b/app/code/core/Mage/Adminhtml/Block/Permissions/Role.php index ac4619967c..5c4a7664f4 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/Role.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/Role.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/Role/Grid/User.php b/app/code/core/Mage/Adminhtml/Block/Permissions/Role/Grid/User.php index a923281261..00a2d1d3e8 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/Role/Grid/User.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/Role/Grid/User.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/Roles.php b/app/code/core/Mage/Adminhtml/Block/Permissions/Roles.php index 949593c76c..dfda51c897 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/Roles.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/Roles.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/Tab/Roleinfo.php b/app/code/core/Mage/Adminhtml/Block/Permissions/Tab/Roleinfo.php index 81f589735b..17ff998879 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/Tab/Roleinfo.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/Tab/Roleinfo.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/Tab/Rolesedit.php b/app/code/core/Mage/Adminhtml/Block/Permissions/Tab/Rolesedit.php index d325516c52..2afc73b3e1 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/Tab/Rolesedit.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/Tab/Rolesedit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/Tab/Rolesusers.php b/app/code/core/Mage/Adminhtml/Block/Permissions/Tab/Rolesusers.php index dc21eb4146..c22b78bd66 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/Tab/Rolesusers.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/Tab/Rolesusers.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/Tab/Useredit.php b/app/code/core/Mage/Adminhtml/Block/Permissions/Tab/Useredit.php index 32d858cb87..1e3b4d8af5 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/Tab/Useredit.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/Tab/Useredit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Adminhtml_Block_Permissions_Tab_Useredit extends Mage_Adminhtml_Block_Widget_Form diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/Tab/Userroles.php b/app/code/core/Mage/Adminhtml/Block/Permissions/Tab/Userroles.php index 09f5b915d3..93227973c5 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/Tab/Userroles.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/Tab/Userroles.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Adminhtml_Block_Permissions_Tab_Userroles extends Mage_Adminhtml_Block_Widget_Tabs diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/User.php b/app/code/core/Mage/Adminhtml/Block/Permissions/User.php index b97b911e14..8265c5ece9 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/User.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/User.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -42,4 +42,14 @@ public function __construct() parent::__construct(); } + /** + * Prepare output HTML + * + * @return string + */ + protected function _toHtml() + { + Mage::dispatchEvent('permissions_user_html_before', array('block' => $this)); + return parent::_toHtml(); + } } diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/User/Edit.php b/app/code/core/Mage/Adminhtml/Block/Permissions/User/Edit.php index 2fadbc09c4..364074f7ab 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/User/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/User/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/User/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Permissions/User/Edit/Form.php index 30a834336f..9dee15e755 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/User/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/User/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/User/Edit/Tab/Main.php b/app/code/core/Mage/Adminhtml/Block/Permissions/User/Edit/Tab/Main.php index f652934a07..f6565f5d2c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/User/Edit/Tab/Main.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/User/Edit/Tab/Main.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/User/Edit/Tab/Roles.php b/app/code/core/Mage/Adminhtml/Block/Permissions/User/Edit/Tab/Roles.php index 536bb7548d..670d91fcfd 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/User/Edit/Tab/Roles.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/User/Edit/Tab/Roles.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/User/Edit/Tabs.php b/app/code/core/Mage/Adminhtml/Block/Permissions/User/Edit/Tabs.php index 1fe8683554..16d33554df 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/User/Edit/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/User/Edit/Tabs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/User/Grid.php b/app/code/core/Mage/Adminhtml/Block/Permissions/User/Grid.php index 5b5390dd8e..80b91c1d45 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/User/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/User/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/Usernroles.php b/app/code/core/Mage/Adminhtml/Block/Permissions/Usernroles.php index d4781cacf9..4cb8cef133 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/Usernroles.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/Usernroles.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Adminhtml_Block_Permissions_UsernRoles extends Mage_Adminhtml_Block_Template diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/Users.php b/app/code/core/Mage/Adminhtml/Block/Permissions/Users.php index 96468d2610..2000f4e194 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/Users.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/Users.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Poll/Answer/Edit.php b/app/code/core/Mage/Adminhtml/Block/Poll/Answer/Edit.php index 1d24d7b1ea..88ef63e353 100644 --- a/app/code/core/Mage/Adminhtml/Block/Poll/Answer/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Poll/Answer/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Poll/Answer/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Poll/Answer/Edit/Form.php index 9d81d4685c..af2bafac8d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Poll/Answer/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Poll/Answer/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Poll/Edit.php b/app/code/core/Mage/Adminhtml/Block/Poll/Edit.php index e812468a68..fc8ccf5df6 100644 --- a/app/code/core/Mage/Adminhtml/Block/Poll/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Poll/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Form.php index 51bc2dc972..476bfc7f9c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tab/Answers.php b/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tab/Answers.php index 5935a96294..8d344d5b2a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tab/Answers.php +++ b/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tab/Answers.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tab/Answers/Form.php b/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tab/Answers/Form.php index b24d5c6159..11f78a4996 100644 --- a/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tab/Answers/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tab/Answers/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tab/Answers/Grid.php b/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tab/Answers/Grid.php index c77ebde300..09cf201a47 100644 --- a/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tab/Answers/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tab/Answers/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tab/Answers/List.php b/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tab/Answers/List.php index 2d48ba2bc9..ea68bfcdcf 100644 --- a/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tab/Answers/List.php +++ b/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tab/Answers/List.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tab/Form.php b/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tab/Form.php index ed3efdd119..9c58792166 100644 --- a/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tab/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tab/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -68,7 +68,8 @@ protected function _prepareForm() 'required' => true, 'name' => 'store_ids[]', 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(), - 'value' => Mage::registry('poll_data')->getStoreIds() + 'value' => Mage::registry('poll_data')->getStoreIds(), + 'after_element_html' => Mage::getBlockSingleton('adminhtml/store_switcher')->getHintHtml() )); } else { diff --git a/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tabs.php b/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tabs.php index d02f02edd9..6e29a43bba 100644 --- a/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tabs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Poll/Grid.php b/app/code/core/Mage/Adminhtml/Block/Poll/Grid.php index 40fefe9533..d1c87ce63f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Poll/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Poll/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Poll/Poll.php b/app/code/core/Mage/Adminhtml/Block/Poll/Poll.php index 2c4c21c6d0..02ecc11821 100644 --- a/app/code/core/Mage/Adminhtml/Block/Poll/Poll.php +++ b/app/code/core/Mage/Adminhtml/Block/Poll/Poll.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Catalog.php b/app/code/core/Mage/Adminhtml/Block/Promo/Catalog.php index 2bc43d8d5c..ea8fcf9b10 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Catalog.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Catalog.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit.php b/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit.php index 031613e463..f302cf66da 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit.php @@ -20,22 +20,22 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** - * description - * - * @category Mage - * @category Mage - * @package Mage_Adminhtml - * @author Magento Core Team + * Catalog rule edit form block */ class Mage_Adminhtml_Block_Promo_Catalog_Edit extends Mage_Adminhtml_Block_Widget_Form_Container { - + /** + * Initialize form + * Add standard buttons + * Add "Save and Apply" button + * Add "Save and Continue" button + */ public function __construct() { $this->_objectId = 'id'; @@ -43,38 +43,29 @@ public function __construct() parent::__construct(); - $this->_updateButton('save', 'label', Mage::helper('catalogrule')->__('Save Rule')); - $this->_updateButton('delete', 'label', Mage::helper('catalogrule')->__('Delete Rule')); - - $rule = Mage::registry('current_promo_catalog_rule'); - - if (!$rule->isDeleteable()) { - $this->_removeButton('delete'); - } + $this->_addButton('save_apply', array( + 'class' => 'save', + 'label' => Mage::helper('catalogrule')->__('Save and Apply'), + 'onclick' => "$('rule_auto_apply').value=1; editForm.submit()", + )); - if (!$rule->isReadonly()) { - $this->_addButton('save_apply', array( - 'class'=>'save', - 'label'=>Mage::helper('catalogrule')->__('Save and Apply'), - 'onclick'=>"$('rule_auto_apply').value=1; editForm.submit()", - )); - $this->_addButton('save_and_continue', array( - 'label' => Mage::helper('catalogrule')->__('Save and Continue Edit'), - 'onclick' => 'saveAndContinueEdit()', - 'class' => 'save' - ), 10); - $this->_formScripts[] = " function saveAndContinueEdit(){ editForm.submit($('edit_form').action + 'back/edit/') } "; - } else { - $this->_removeButton('reset'); - $this->_removeButton('save'); - } + $this->_addButton('save_and_continue_edit', array( + 'class' => 'save', + 'label' => Mage::helper('catalogrule')->__('Save and Continue Edit'), + 'onclick' => 'editForm.submit($(\'edit_form\').action + \'back/edit/\')', + ), 10); } + /** + * Getter for form header text + * + * @return string + */ public function getHeaderText() { $rule = Mage::registry('current_promo_catalog_rule'); if ($rule->getRuleId()) { - return Mage::helper('catalogrule')->__("Edit Rule '%s'", $this->htmlEscape($rule->getName())); + return Mage::helper('catalogrule')->__("Edit Rule '%s'", $this->escapeHtml($rule->getName())); } else { return Mage::helper('catalogrule')->__('New Rule'); diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Form.php index d4fdd4c99d..c89c46c235 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Js.php b/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Js.php index 34cee5950f..5cfdd3dee0 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Js.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Js.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Tab/Actions.php b/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Tab/Actions.php index ec29c1ca1c..1d49cf85f9 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Tab/Actions.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Tab/Actions.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Tab/Conditions.php b/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Tab/Conditions.php index 25919f135f..54ed0f8d90 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Tab/Conditions.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Tab/Conditions.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Tab/Main.php b/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Tab/Main.php index cc60d2e9c3..dc6e9a0980 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Tab/Main.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Tab/Main.php @@ -20,17 +20,16 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** - * description + * Catalog Rule General Information Tab * - * @category Mage - * @category Mage - * @package Mage_Adminhtml - * @author Magento Core Team + * @category Mage + * @package Mage_Adminhtml + * @author Magento Core Team */ class Mage_Adminhtml_Block_Promo_Catalog_Edit_Tab_Main extends Mage_Adminhtml_Block_Widget_Form @@ -57,7 +56,7 @@ public function getTabTitle() } /** - * Returns status flag about this tab can be showen or not + * Returns status flag about this tab can be showed or not * * @return true */ @@ -84,7 +83,9 @@ protected function _prepareForm() $form->setHtmlIdPrefix('rule_'); - $fieldset = $form->addFieldset('base_fieldset', array('legend'=>Mage::helper('catalogrule')->__('General Information'))); + $fieldset = $form->addFieldset('base_fieldset', + array('legend '=> Mage::helper('catalogrule')->__('General Information')) + ); $fieldset->addField('auto_apply', 'hidden', array( 'name' => 'auto_apply', @@ -121,34 +122,22 @@ protected function _prepareForm() ), )); - if (!Mage::app()->isSingleStoreMode()) { + if (Mage::app()->isSingleStoreMode()) { + $websiteId = Mage::app()->getStore(true)->getWebsiteId(); + $fieldset->addField('website_ids', 'hidden', array( + 'name' => 'website_ids[]', + 'value' => $websiteId + )); + $model->setWebsiteIds($websiteId); + } else { $fieldset->addField('website_ids', 'multiselect', array( - 'name' => 'website_ids[]', + 'name' => 'website_ids[]', 'label' => Mage::helper('catalogrule')->__('Websites'), 'title' => Mage::helper('catalogrule')->__('Websites'), - 'required' => true, - 'values' => Mage::getSingleton('adminhtml/system_config_source_website')->toOptionArray(), - )); - } - else { - $fieldset->addField('website_ids', 'hidden', array( - 'name' => 'website_ids[]', - 'value' => Mage::app()->getStore(true)->getWebsiteId() + 'required' => true, + 'values' => Mage::getSingleton('adminhtml/system_store')->getWebsiteValuesForForm(), + 'after_element_html' => Mage::getBlockSingleton('adminhtml/store_switcher')->getHintHtml() )); - $model->setWebsiteIds(Mage::app()->getStore(true)->getWebsiteId()); - } - - $customerGroups = Mage::getResourceModel('customer/group_collection') - ->load()->toOptionArray(); - - $found = false; - foreach ($customerGroups as $group) { - if ($group['value']==0) { - $found = true; - } - } - if (!$found) { - array_unshift($customerGroups, array('value'=>0, 'label'=>Mage::helper('catalogrule')->__('NOT LOGGED IN'))); } $fieldset->addField('customer_group_ids', 'multiselect', array( @@ -156,7 +145,7 @@ protected function _prepareForm() 'label' => Mage::helper('catalogrule')->__('Customer Groups'), 'title' => Mage::helper('catalogrule')->__('Customer Groups'), 'required' => true, - 'values' => $customerGroups, + 'values' => Mage::getResourceModel('customer/group_collection')->toOptionArray() )); $dateFormatIso = Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT); diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Tabs.php b/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Tabs.php index f901abd925..061d0fbf74 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Tabs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Grid.php b/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Grid.php index 3aa5404338..e5261e5456 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Grid.php @@ -20,21 +20,23 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** - * description + * Catalog Rules Grid * - * @category Mage - * @category Mage - * @package Mage_Adminhtml - * @author Magento Core Team + * @category Mage + * @package Mage_Adminhtml + * @author Magento Core Team */ class Mage_Adminhtml_Block_Promo_Catalog_Grid extends Mage_Adminhtml_Block_Widget_Grid { - + /** + * Initialize grid + * Set sort settings + */ public function __construct() { parent::__construct(); @@ -44,14 +46,29 @@ public function __construct() $this->setSaveParametersInSession(true); } + /** + * Add websites to catalog rules collection + * Set collection + * + * @return Mage_Adminhtml_Block_Promo_Catalog_Grid + */ protected function _prepareCollection() { + /** @var $collection Mage_CatalogRule_Model_Mysql4_Rule_Collection */ $collection = Mage::getModel('catalogrule/rule') ->getResourceCollection(); + $collection->addWebsitesToResult(); $this->setCollection($collection); - return parent::_prepareCollection(); + + parent::_prepareCollection(); + return $this; } + /** + * Add grid columns + * + * @return Mage_Adminhtml_Block_Promo_Catalog_Grid + */ protected function _prepareColumns() { $this->addColumn('rule_id', array( @@ -91,14 +108,34 @@ protected function _prepareColumns() 'index' => 'is_active', 'type' => 'options', 'options' => array( - 1 => 'Active', - 0 => 'Inactive', + 1 => Mage::helper('catalogrule')->__('Active'), + 0 => Mage::helper('catalogrule')->__('Inactive') ), )); - return parent::_prepareColumns(); + if (!Mage::app()->isSingleStoreMode()) { + $this->addColumn('rule_website', array( + 'header' => Mage::helper('catalogrule')->__('Website'), + 'align' =>'left', + 'index' => 'website_ids', + 'type' => 'options', + 'sortable' => false, + 'options' => Mage::getSingleton('adminhtml/system_store')->getWebsiteOptionHash(), + 'width' => 200, + )); + } + + parent::_prepareColumns(); + return $this; } + /** + * Retrieve row click URL + * + * @param Varien_Object $row + * + * @return string + */ public function getRowUrl($row) { return $this->getUrl('*/*/edit', array('id' => $row->getRuleId())); diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Quote.php b/app/code/core/Mage/Adminhtml/Block/Promo/Quote.php index 4c5a0c8d79..1bb0c8ff0d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Quote.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Quote.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit.php b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit.php index 51975499af..78b5c67884 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit.php @@ -20,22 +20,22 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** - * description - * - * @category Mage - * @category Mage - * @package Mage_Adminhtml - * @author Magento Core Team + * Shopping cart rule edit form block */ class Mage_Adminhtml_Block_Promo_Quote_Edit extends Mage_Adminhtml_Block_Widget_Form_Container { + /** + * Initialize form + * Add standard buttons + * Add "Save and Continue" button + */ public function __construct() { $this->_objectId = 'id'; @@ -43,41 +43,34 @@ public function __construct() parent::__construct(); - $this->_updateButton('save', 'label', Mage::helper('salesrule')->__('Save Rule')); - $this->_updateButton('delete', 'label', Mage::helper('salesrule')->__('Delete Rule')); - - $rule = Mage::registry('current_promo_quote_rule'); - - if (!$rule->isDeleteable()) { - $this->_removeButton('delete'); - } - - if ($rule->isReadonly()) { - $this->_removeButton('save'); - $this->_removeButton('reset'); - } else { - $this->_addButton('save_and_continue', array( - 'label' => Mage::helper('salesrule')->__('Save and Continue Edit'), - 'onclick' => 'saveAndContinueEdit()', - 'class' => 'save' - ), 10); - $this->_formScripts[] = " function saveAndContinueEdit(){ editForm.submit($('edit_form').action + 'back/edit/') } "; - } - - #$this->setTemplate('promo/quote/edit.phtml'); + $this->_addButton('save_and_continue_edit', array( + 'class' => 'save', + 'label' => Mage::helper('salesrule')->__('Save and Continue Edit'), + 'onclick' => 'editForm.submit($(\'edit_form\').action + \'back/edit/\')', + ), 10); } + /** + * Getter for form header text + * + * @return string + */ public function getHeaderText() { $rule = Mage::registry('current_promo_quote_rule'); if ($rule->getRuleId()) { - return Mage::helper('salesrule')->__("Edit Rule '%s'", $this->htmlEscape($rule->getName())); + return Mage::helper('salesrule')->__("Edit Rule '%s'", $this->escapeHtml($rule->getName())); } else { return Mage::helper('salesrule')->__('New Rule'); } } + /** + * Retrieve products JSON + * + * @return string + */ public function getProductsJson() { return '{}'; diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Form.php index 61bbd7d5da..56e45c2317 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Actions.php b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Actions.php index 194f8faa68..dae36f3794 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Actions.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Actions.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Conditions.php b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Conditions.php index 50f8136938..68acbf23a0 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Conditions.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Conditions.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons.php b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons.php index 2511c15374..a7c35648a3 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -42,7 +42,7 @@ class Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Coupons */ public function getTabLabel() { - return Mage::helper('salesrule')->__('Manage Coupons Codes'); + return Mage::helper('salesrule')->__('Manage Coupon Codes'); } /** @@ -52,7 +52,7 @@ public function getTabLabel() */ public function getTabTitle() { - return Mage::helper('salesrule')->__('Manage Coupons Codes'); + return Mage::helper('salesrule')->__('Manage Coupon Codes'); } /** diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons/Form.php b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons/Form.php index 99c8fc8a3e..27674b5cb0 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -71,7 +71,8 @@ protected function _prepareForm() 'name' => 'qty', 'label' => Mage::helper('salesrule')->__('Coupon Qty'), 'title' => Mage::helper('salesrule')->__('Coupon Qty'), - 'required' => true + 'required' => true, + 'class' => 'validate-digits validate-greater-than-zero' )); $fieldset->addField('length', 'text', array( @@ -80,7 +81,8 @@ protected function _prepareForm() 'title' => Mage::helper('salesrule')->__('Code Length'), 'required' => true, 'note' => Mage::helper('salesrule')->__('Excluding prefix, suffix and separators.'), - 'value' => $couponHelper->getDefaultLength() + 'value' => $couponHelper->getDefaultLength(), + 'class' => 'validate-digits validate-greater-than-zero' )); $fieldset->addField('format', 'select', array( @@ -110,7 +112,8 @@ protected function _prepareForm() 'label' => Mage::helper('salesrule')->__('Dash Every X Characters'), 'title' => Mage::helper('salesrule')->__('Dash Every X Characters'), 'note' => Mage::helper('salesrule')->__('If empty no separation.'), - 'value' => $couponHelper->getDefaultDashInterval() + 'value' => $couponHelper->getDefaultDashInterval(), + 'class' => 'validate-digits' )); $idPrefix = $form->getHtmlIdPrefix(); diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons/Grid.php b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons/Grid.php index 8e8288b88a..fadc200668 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -121,6 +121,7 @@ protected function _prepareMassaction() $this->setMassactionIdField('coupon_id'); $this->getMassactionBlock()->setFormFieldName('ids'); $this->getMassactionBlock()->setUseAjax(true); + $this->getMassactionBlock()->setHideFormElement(true); $this->getMassactionBlock()->addItem('delete', array( 'label'=> Mage::helper('adminhtml')->__('Delete'), diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons/Grid/Column/Renderer/Used.php b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons/Grid/Column/Renderer/Used.php index b289d54adf..2de347cbb6 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons/Grid/Column/Renderer/Used.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons/Grid/Column/Renderer/Used.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Labels.php b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Labels.php index 1d689c5fb4..3ee6b0bc7a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Labels.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Labels.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -89,6 +89,9 @@ protected function _prepareForm() 'legend' => Mage::helper('salesrule')->__('Store View Specific Labels'), 'table_class' => 'form-list stores-tree', )); + $renderer = $this->getLayout()->createBlock('adminhtml/store_switcher_form_renderer_fieldset'); + $fieldset->setRenderer($renderer); + foreach (Mage::app()->getWebsites() as $website) { $fieldset->addField("w_{$website->getId()}_label", 'note', array( 'label' => $website->getName(), diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Main.php b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Main.php index d474d831f0..9a7f6df0ed 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Main.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Main.php @@ -20,17 +20,16 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** - * description + * Shopping Cart Price Rule General Information Tab * - * @category Mage - * @category Mage - * @package Mage_Adminhtml - * @author Magento Core Team + * @category Mage + * @package Mage_Adminhtml + * @author Magento Core Team */ class Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Main extends Mage_Adminhtml_Block_Widget_Form @@ -57,7 +56,7 @@ public function getTabTitle() } /** - * Returns status flag about this tab can be showen or not + * Returns status flag about this tab can be showed or not * * @return true */ @@ -121,32 +120,33 @@ protected function _prepareForm() '0' => Mage::helper('salesrule')->__('Inactive'), ), )); + if (!$model->getId()) { $model->setData('is_active', '1'); } - - if (!Mage::app()->isSingleStoreMode()) { - $fieldset->addField('website_ids', 'multiselect', array( - 'name' => 'website_ids[]', - 'label' => Mage::helper('catalogrule')->__('Websites'), - 'title' => Mage::helper('catalogrule')->__('Websites'), - 'required' => true, - 'values' => Mage::getSingleton('adminhtml/system_config_source_website')->toOptionArray(), - )); - } - else { + if (Mage::app()->isSingleStoreMode()) { + $websiteId = Mage::app()->getStore(true)->getWebsiteId(); $fieldset->addField('website_ids', 'hidden', array( - 'name' => 'website_ids[]', - 'value' => Mage::app()->getStore(true)->getWebsiteId() + 'name' => 'website_ids[]', + 'value' => $websiteId, + 'after_element_html' => Mage::getBlockSingleton('adminhtml/store_switcher')->getHintHtml() + )); + $model->setWebsiteIds($websiteId); + } else { + $fieldset->addField('website_ids', 'multiselect', array( + 'name' => 'website_ids[]', + 'label' => Mage::helper('salesrule')->__('Websites'), + 'title' => Mage::helper('salesrule')->__('Websites'), + 'required' => true, + 'values' => Mage::getSingleton('adminhtml/system_store')->getWebsiteValuesForForm(), + 'after_element_html' => Mage::getBlockSingleton('adminhtml/store_switcher')->getHintHtml() )); - $model->setWebsiteIds(Mage::app()->getStore(true)->getWebsiteId()); } - $customerGroups = Mage::getResourceModel('customer/group_collection') - ->load()->toOptionArray(); - + $customerGroups = Mage::getResourceModel('customer/group_collection')->load()->toOptionArray(); $found = false; + foreach ($customerGroups as $group) { if ($group['value']==0) { $found = true; @@ -164,7 +164,7 @@ protected function _prepareForm() 'label' => Mage::helper('salesrule')->__('Customer Groups'), 'title' => Mage::helper('salesrule')->__('Customer Groups'), 'required' => true, - 'values' => $customerGroups, + 'values' => Mage::getResourceModel('customer/group_collection')->toOptionArray(), )); $couponTypeFiled = $fieldset->addField('coupon_type', 'select', array( @@ -183,7 +183,7 @@ protected function _prepareForm() $autoGenerationCheckbox = $fieldset->addField('use_auto_generation', 'checkbox', array( 'name' => 'use_auto_generation', 'label' => Mage::helper('salesrule')->__('Use Auto Generation'), - 'note' => Mage::helper('salesrule')->__('If you select and save the rule you will be able to generate multiple coupon codes'), + 'note' => Mage::helper('salesrule')->__('If you select and save the rule you will be able to generate multiple coupon codes.'), 'onclick' => 'handleCouponsTabContentActivity()', 'checked' => (int)$model->getUseAutoGeneration() > 0 ? 'checked' : '' )); diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Main/Renderer/Checkbox.php b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Main/Renderer/Checkbox.php index d6ffbbe3de..b922bb526e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Main/Renderer/Checkbox.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Main/Renderer/Checkbox.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tabs.php b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tabs.php index d2a07abcc4..cbb820cef6 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tabs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Grid.php b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Grid.php index 1240a0e71c..6b662db3f8 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Grid.php @@ -20,21 +20,23 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** - * description + * Shopping Cart Rules Grid * - * @category Mage - * @category Mage - * @package Mage_Adminhtml - * @author Magento Core Team + * @category Mage + * @package Mage_Adminhtml + * @author Magento Core Team */ class Mage_Adminhtml_Block_Promo_Quote_Grid extends Mage_Adminhtml_Block_Widget_Grid { - + /** + * Initialize grid + * Set sort settings + */ public function __construct() { parent::__construct(); @@ -44,14 +46,29 @@ public function __construct() $this->setSaveParametersInSession(true); } + /** + * Add websites to sales rules collection + * Set collection + * + * @return Mage_Adminhtml_Block_Promo_Quote_Grid + */ protected function _prepareCollection() { + /** @var $collection Mage_SalesRule_Model_Mysql4_Rule_Collection */ $collection = Mage::getModel('salesrule/rule') ->getResourceCollection(); + $collection->addWebsitesToResult(); $this->setCollection($collection); - return parent::_prepareCollection(); + + parent::_prepareCollection(); + return $this; } + /** + * Add grid columns + * + * @return Mage_Adminhtml_Block_Promo_Quote_Grid + */ protected function _prepareColumns() { $this->addColumn('rule_id', array( @@ -103,15 +120,36 @@ protected function _prepareColumns() ), )); + if (!Mage::app()->isSingleStoreMode()) { + $this->addColumn('rule_website', array( + 'header' => Mage::helper('salesrule')->__('Website'), + 'align' =>'left', + 'index' => 'website_ids', + 'type' => 'options', + 'sortable' => false, + 'options' => Mage::getSingleton('adminhtml/system_store')->getWebsiteOptionHash(), + 'width' => 200, + )); + } + $this->addColumn('sort_order', array( 'header' => Mage::helper('salesrule')->__('Priority'), 'align' => 'right', 'index' => 'sort_order', + 'width' => 100, )); - return parent::_prepareColumns(); + parent::_prepareColumns(); + return $this; } + /** + * Retrieve row click URL + * + * @param Varien_Object $row + * + * @return string + */ public function getRowUrl($row) { return $this->getUrl('*/*/edit', array('id' => $row->getRuleId())); diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Widget/Chooser.php b/app/code/core/Mage/Adminhtml/Block/Promo/Widget/Chooser.php index 871aec3c72..2f94ec52fd 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Widget/Chooser.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Widget/Chooser.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Widget/Chooser/Daterange.php b/app/code/core/Mage/Adminhtml/Block/Promo/Widget/Chooser/Daterange.php index b8660d8fdf..e72eb12d1d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Widget/Chooser/Daterange.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Widget/Chooser/Daterange.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Widget/Chooser/Sku.php b/app/code/core/Mage/Adminhtml/Block/Promo/Widget/Chooser/Sku.php index f4f33c6501..88ac60bcd4 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Widget/Chooser/Sku.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Widget/Chooser/Sku.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Rating/Edit.php b/app/code/core/Mage/Adminhtml/Block/Rating/Edit.php index cbfdec826b..9d7d6d0188 100644 --- a/app/code/core/Mage/Adminhtml/Block/Rating/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Rating/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Rating/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Rating/Edit/Form.php index 9a05c7a3b4..85c5d7111e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Rating/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Rating/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Rating/Edit/Tab/Form.php b/app/code/core/Mage/Adminhtml/Block/Rating/Edit/Tab/Form.php index ac72698a66..60ecf278ff 100644 --- a/app/code/core/Mage/Adminhtml/Block/Rating/Edit/Tab/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Rating/Edit/Tab/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -34,32 +34,33 @@ class Mage_Adminhtml_Block_Rating_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form { + /** + * Prepare rating edit form + * + * @return Mage_Adminhtml_Block_Rating_Edit_Tab_Form + */ protected function _prepareForm() { $form = new Varien_Data_Form(); $this->setForm($form); - $defaultStore = Mage::app()->getStore(0); $fieldset = $form->addFieldset('rating_form', array( 'legend'=>Mage::helper('rating')->__('Rating Title') )); $fieldset->addField('rating_code', 'text', array( - 'name' => 'rating_code', - 'label' => Mage::helper('rating')->__('Default Value'), - 'class' => 'required-entry', - 'required' => true, - + 'name' => 'rating_code', + 'label' => Mage::helper('rating')->__('Default Value'), + 'class' => 'required-entry', + 'required' => true, )); -// if (!Mage::app()->isSingleStoreMode()) { - foreach(Mage::getSingleton('adminhtml/system_store')->getStoreCollection() as $store) { - $fieldset->addField('rating_code_' . $store->getId(), 'text', array( - 'label' => $store->getName(), - 'name' => 'rating_codes['. $store->getId() .']', - )); - } -// } + foreach (Mage::getSingleton('adminhtml/system_store')->getStoreCollection() as $store) { + $fieldset->addField('rating_code_' . $store->getId(), 'text', array( + 'label' => $store->getName(), + 'name' => 'rating_codes[' . $store->getId() . ']', + )); + } if (Mage::getSingleton('adminhtml/session')->getRatingData()) { $form->setValues(Mage::getSingleton('adminhtml/session')->getRatingData()); @@ -68,8 +69,7 @@ protected function _prepareForm() $this->_setRatingCodes($data['rating_codes']); } Mage::getSingleton('adminhtml/session')->setRatingData(null); - } - elseif (Mage::registry('rating_data')) { + } elseif (Mage::registry('rating_data')) { $form->setValues(Mage::registry('rating_data')->getData()); if (Mage::registry('rating_data')->getRatingCodes()) { $this->_setRatingCodes(Mage::registry('rating_data')->getRatingCodes()); @@ -85,45 +85,43 @@ protected function _prepareForm() $i = 1; foreach ($collection->getItems() as $item) { $fieldset->addField('option_code_' . $item->getId() , 'hidden', array( - 'required' => true, - 'name' => 'option_title[' . $item->getId() . ']', - 'value' => ($item->getCode()) ? $item->getCode() : $i, + 'required' => true, + 'name' => 'option_title[' . $item->getId() . ']', + 'value' => ($item->getCode()) ? $item->getCode() : $i, )); $i ++; } - } - else { - for ($i=1; $i<=5; $i++ ) { + } else { + for ($i = 1; $i <= 5; $i++) { $fieldset->addField('option_code_' . $i, 'hidden', array( - 'required' => true, - 'name' => 'option_title[add_' . $i . ']', - 'value' => $i, + 'required' => true, + 'name' => 'option_title[add_' . $i . ']', + 'value' => $i, )); } } -// if (!Mage::app()->isSingleStoreMode()) { - $fieldset = $form->addFieldset('visibility_form', array( - 'legend' => Mage::helper('rating')->__('Rating Visibility')) - ); - $fieldset->addField('stores', 'multiselect', array( - 'label' => Mage::helper('rating')->__('Visible In'), -// 'required' => true, - 'name' => 'stores[]', - 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm() - )); + $fieldset = $form->addFieldset('visibility_form', array( + 'legend' => Mage::helper('rating')->__('Rating Visibility') + )); - if (Mage::registry('rating_data')) { - $form->getElement('stores')->setValue(Mage::registry('rating_data')->getStores()); - } -// } -// else { -// $fieldset->addField('stores', 'hidden', array( -// 'name' => 'stores[]', -// 'value' => Mage::app()->getStore(true)->getId() -// )); -// } + $fieldset->addField('stores', 'multiselect', array( + 'label' => Mage::helper('rating')->__('Visible In'), + 'name' => 'stores[]', + 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(), + 'after_element_html' => Mage::getBlockSingleton('adminhtml/store_switcher')->getHintHtml() + )); + + $fieldset->addField('position', 'text', array( + 'label' => Mage::helper('rating')->__('Sort Order'), + 'name' => 'position', + )); + + if (Mage::registry('rating_data')) { + $form->getElement('position')->setValue(Mage::registry('rating_data')->getPosition()); + $form->getElement('stores')->setValue(Mage::registry('rating_data')->getStores()); + } return parent::_prepareForm(); } diff --git a/app/code/core/Mage/Adminhtml/Block/Rating/Edit/Tab/Options.php b/app/code/core/Mage/Adminhtml/Block/Rating/Edit/Tab/Options.php index f7daf0c4d9..2313cd522e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Rating/Edit/Tab/Options.php +++ b/app/code/core/Mage/Adminhtml/Block/Rating/Edit/Tab/Options.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Rating/Edit/Tabs.php b/app/code/core/Mage/Adminhtml/Block/Rating/Edit/Tabs.php index 4d5a54bc19..00e7174337 100644 --- a/app/code/core/Mage/Adminhtml/Block/Rating/Edit/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/Rating/Edit/Tabs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Rating/Grid.php b/app/code/core/Mage/Adminhtml/Block/Rating/Grid.php index 3e604d5807..fc0edd9ea3 100644 --- a/app/code/core/Mage/Adminhtml/Block/Rating/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Rating/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -52,6 +52,11 @@ protected function _prepareCollection() return parent::_prepareCollection(); } + /** + * Prepare Rating Grid colunms + * + * @return Mage_Adminhtml_Block_Rating_Grid + */ protected function _prepareColumns() { $this->addColumn('rating_id', array( @@ -63,10 +68,16 @@ protected function _prepareColumns() $this->addColumn('rating_code', array( 'header' => Mage::helper('rating')->__('Rating Name'), - 'align' =>'left', 'index' => 'rating_code', )); + $this->addColumn('position', array( + 'header' => Mage::helper('rating')->__('Sort Order'), + 'align' => 'left', + 'width' => '100px', + 'index' => 'position', + )); + return parent::_prepareColumns(); } diff --git a/app/code/core/Mage/Adminhtml/Block/Rating/Rating.php b/app/code/core/Mage/Adminhtml/Block/Rating/Rating.php index 06874e3998..683d7e4452 100644 --- a/app/code/core/Mage/Adminhtml/Block/Rating/Rating.php +++ b/app/code/core/Mage/Adminhtml/Block/Rating/Rating.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Config/Form/Field/MtdStart.php b/app/code/core/Mage/Adminhtml/Block/Report/Config/Form/Field/MtdStart.php index 224f1e951f..a1f5160b8d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Config/Form/Field/MtdStart.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Config/Form/Field/MtdStart.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Config/Form/Field/YtdStart.php b/app/code/core/Mage/Adminhtml/Block/Report/Config/Form/Field/YtdStart.php index 612ce30826..cf16cab47e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Config/Form/Field/YtdStart.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Config/Form/Field/YtdStart.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Customer/Accounts.php b/app/code/core/Mage/Adminhtml/Block/Report/Customer/Accounts.php index 01595fa742..fe1fe981c0 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Customer/Accounts.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Customer/Accounts.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Customer/Accounts/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Customer/Accounts/Grid.php index f26f477a27..d6ef3d4542 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Customer/Accounts/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Customer/Accounts/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Customer/Orders.php b/app/code/core/Mage/Adminhtml/Block/Report/Customer/Orders.php index 28e0040e32..65020c1827 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Customer/Orders.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Customer/Orders.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Customer/Orders/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Customer/Orders/Grid.php index 77983e86af..a754e76afd 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Customer/Orders/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Customer/Orders/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Customer/Totals.php b/app/code/core/Mage/Adminhtml/Block/Report/Customer/Totals.php index 206fee93d0..9f327f2d80 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Customer/Totals.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Customer/Totals.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Customer/Totals/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Customer/Totals/Grid.php index 277f1f9175..6f6cd2789e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Customer/Totals/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Customer/Totals/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Filter/Form.php b/app/code/core/Mage/Adminhtml/Block/Report/Filter/Form.php index f1eb36febd..b6cb230e9d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Filter/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Filter/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -189,7 +189,13 @@ protected function _prepareForm() */ protected function _initFormValues() { - $this->getForm()->addValues($this->getFilterData()->getData()); + $data = $this->getFilterData()->getData(); + foreach ($data as $key => $value) { + if (is_array($value) && isset($value[0])) { + $data[$key] = explode(',', $value[0]); + } + } + $this->getForm()->addValues($data); return parent::_initFormValues(); } diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Grid.php index 6d9720f780..33890e5f7c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Grid/Abstract.php b/app/code/core/Mage/Adminhtml/Block/Report/Grid/Abstract.php index 53ca31c398..e0c5bb0d3d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Grid/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Grid/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -191,6 +191,7 @@ protected function _prepareCollection() ->isTotals(true); $this->_addOrderStatusFilter($totalsCollection, $filterData); + $this->_addCustomFilter($totalsCollection, $filterData); foreach ($totalsCollection as $item) { $this->setTotals($item); @@ -240,6 +241,7 @@ public function getSubTotals() ->isSubTotals(true); $this->_addOrderStatusFilter($subTotalsCollection, $filterData); + $this->_addCustomFilter($subTotalsCollection, $filterData); $this->setSubTotals($subTotalsCollection->getItems()); return parent::getSubTotals(); diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Grid/Column/Renderer/Blanknumber.php b/app/code/core/Mage/Adminhtml/Block/Report/Grid/Column/Renderer/Blanknumber.php index 112f47439e..d6d780e24c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Grid/Column/Renderer/Blanknumber.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Grid/Column/Renderer/Blanknumber.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Grid/Column/Renderer/Currency.php b/app/code/core/Mage/Adminhtml/Block/Report/Grid/Column/Renderer/Currency.php index c22a7d3ba0..6a11bd9ad5 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Grid/Column/Renderer/Currency.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Grid/Column/Renderer/Currency.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Grid/Column/Renderer/Customer.php b/app/code/core/Mage/Adminhtml/Block/Report/Grid/Column/Renderer/Customer.php index e0aff6071f..eaadd95d0b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Grid/Column/Renderer/Customer.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Grid/Column/Renderer/Customer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Grid/Column/Renderer/Product.php b/app/code/core/Mage/Adminhtml/Block/Report/Grid/Column/Renderer/Product.php index 7eb1feffde..e8c90e0e42 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Grid/Column/Renderer/Product.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Grid/Column/Renderer/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Grid/Shopcart.php b/app/code/core/Mage/Adminhtml/Block/Report/Grid/Shopcart.php index ad56636771..2cc8d48efe 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Grid/Shopcart.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Grid/Shopcart.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Product.php b/app/code/core/Mage/Adminhtml/Block/Report/Product.php index 60dc8165a5..829e45a40a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Product.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Product/Downloads.php b/app/code/core/Mage/Adminhtml/Block/Report/Product/Downloads.php index f51c98abe6..55757ded7d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Product/Downloads.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Product/Downloads.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Product/Downloads/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Product/Downloads/Grid.php index d6f18bc54a..294f4a9b50 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Product/Downloads/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Product/Downloads/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Product/Downloads/Renderer/Purchases.php b/app/code/core/Mage/Adminhtml/Block/Report/Product/Downloads/Renderer/Purchases.php index cb0f6f5aa3..62dffc5769 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Product/Downloads/Renderer/Purchases.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Product/Downloads/Renderer/Purchases.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Product/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Product/Grid.php index 273aacc768..8ec53a3427 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Product/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Product/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Product/Lowstock.php b/app/code/core/Mage/Adminhtml/Block/Report/Product/Lowstock.php index eb2bf0400e..d68f68eaea 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Product/Lowstock.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Product/Lowstock.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Product/Lowstock/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Product/Lowstock/Grid.php index a2ec8ea05b..5dd9d1f537 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Product/Lowstock/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Product/Lowstock/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Product/Ordered.php b/app/code/core/Mage/Adminhtml/Block/Report/Product/Ordered.php index 9a12b17184..d133b65f53 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Product/Ordered.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Product/Ordered.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Product/Ordered/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Product/Ordered/Grid.php index d70b696e34..139bdbe552 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Product/Ordered/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Product/Ordered/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Product/Sold.php b/app/code/core/Mage/Adminhtml/Block/Report/Product/Sold.php index 8fbc99b6f9..4f84fa6ace 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Product/Sold.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Product/Sold.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Product/Sold/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Product/Sold/Grid.php index 59088840bf..ca77a7598b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Product/Sold/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Product/Sold/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Product/Viewed.php b/app/code/core/Mage/Adminhtml/Block/Report/Product/Viewed.php index b7ae0c1b2c..0111b5d3e9 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Product/Viewed.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Product/Viewed.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Product/Viewed/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Product/Viewed/Grid.php index 786cb2e776..f06cda51cd 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Product/Viewed/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Product/Viewed/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Refresh/Statistics.php b/app/code/core/Mage/Adminhtml/Block/Report/Refresh/Statistics.php index 9b5dd97be9..c8bfd56bc9 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Refresh/Statistics.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Refresh/Statistics.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Refresh/Statistics/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Refresh/Statistics/Grid.php index da8e0f2da7..0160cdb03b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Refresh/Statistics/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Refresh/Statistics/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Review/Customer.php b/app/code/core/Mage/Adminhtml/Block/Report/Review/Customer.php index b20a71df89..a6642368ee 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Review/Customer.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Review/Customer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Review/Customer/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Review/Customer/Grid.php index c618dd53dd..c3158aa82a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Review/Customer/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Review/Customer/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Review/Detail.php b/app/code/core/Mage/Adminhtml/Block/Report/Review/Detail.php index f624385857..bde2429d32 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Review/Detail.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Review/Detail.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Review/Detail/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Review/Detail/Grid.php index e3569b8d57..90a26d4564 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Review/Detail/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Review/Detail/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Review/Product.php b/app/code/core/Mage/Adminhtml/Block/Report/Review/Product.php index 360cbb6e3d..e4672f55ce 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Review/Product.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Review/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Review/Product/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Review/Product/Grid.php index 7bf61a6dc1..ce0e7d723b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Review/Product/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Review/Product/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Bestsellers.php b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Bestsellers.php index bd698abf33..3528146497 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Bestsellers.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Bestsellers.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Bestsellers/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Bestsellers/Grid.php index 2dbc84d965..29934baeb7 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Bestsellers/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Bestsellers/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Coupons.php b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Coupons.php index e5db6c62ad..89728578b9 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Coupons.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Coupons.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Coupons/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Coupons/Grid.php index 6052969aee..505b67b190 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Coupons/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Coupons/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Grid/Column/Renderer/Date.php b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Grid/Column/Renderer/Date.php index ae4215a60b..49342bb2f8 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Grid/Column/Renderer/Date.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Grid/Column/Renderer/Date.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Invoiced.php b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Invoiced.php index 8b8f7c22bf..d155cc7ef9 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Invoiced.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Invoiced.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Invoiced/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Invoiced/Grid.php index 96e94e9c56..fb00a2e6de 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Invoiced/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Invoiced/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Refunded.php b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Refunded.php index ab1993e929..ca6c9112d7 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Refunded.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Refunded.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Refunded/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Refunded/Grid.php index 837881e39f..75e8f27d0a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Refunded/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Refunded/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Sales.php b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Sales.php index 7042f7a1e0..89fb0975dc 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Sales.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Sales.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Sales/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Sales/Grid.php index f887cb4756..e7f1adb9b0 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Sales/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Sales/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Shipping.php b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Shipping.php index 0fc5268266..b1da305424 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Shipping.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Shipping.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Shipping/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Shipping/Grid.php index d9a0703ced..1c6ca2ba64 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Shipping/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Shipping/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Tax.php b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Tax.php index b35c1d3541..f6b72ad6e6 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Tax.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Tax/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Tax/Grid.php index bee1385f01..e47c545cb4 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Tax/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Tax/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Search.php b/app/code/core/Mage/Adminhtml/Block/Report/Search.php index 091e07e991..ff68fe9c93 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Search.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Search.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Search/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Search/Grid.php index a56108e55a..25589b958e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Search/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Search/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Abandoned.php b/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Abandoned.php index bbc3a541cd..d6d482ee59 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Abandoned.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Abandoned.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Abandoned/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Abandoned/Grid.php index 7725ae799a..5b807b95fb 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Abandoned/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Abandoned/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Customer.php b/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Customer.php index 998eeb0b79..42b5033f2a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Customer.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Customer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Customer/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Customer/Grid.php index a4ffa4e6d3..687b7ab906 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Customer/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Customer/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Product.php b/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Product.php index 36d53d01aa..428e14e658 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Product.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Product/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Product/Grid.php index 526f13e3df..f30272e6e1 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Product/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Product/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Tag/Customer.php b/app/code/core/Mage/Adminhtml/Block/Report/Tag/Customer.php index 86fb450b06..4ad99b5fb2 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Tag/Customer.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Tag/Customer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Tag/Customer/Detail.php b/app/code/core/Mage/Adminhtml/Block/Report/Tag/Customer/Detail.php index e3456a27d0..abd6ee4745 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Tag/Customer/Detail.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Tag/Customer/Detail.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Tag/Customer/Detail/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Tag/Customer/Detail/Grid.php index e5354c6ccd..a6263a8b82 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Tag/Customer/Detail/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Tag/Customer/Detail/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Tag/Customer/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Tag/Customer/Grid.php index 005102ab28..0e9bd0d9e9 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Tag/Customer/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Tag/Customer/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Tag/Popular.php b/app/code/core/Mage/Adminhtml/Block/Report/Tag/Popular.php index 1fbe023344..77b4130760 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Tag/Popular.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Tag/Popular.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Tag/Popular/Detail.php b/app/code/core/Mage/Adminhtml/Block/Report/Tag/Popular/Detail.php index 4f27b64108..e945dbc3e9 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Tag/Popular/Detail.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Tag/Popular/Detail.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Tag/Popular/Detail/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Tag/Popular/Detail/Grid.php index 5067ac356c..93cf141ea9 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Tag/Popular/Detail/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Tag/Popular/Detail/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Tag/Popular/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Tag/Popular/Grid.php index 28d53c80c0..7cda22744b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Tag/Popular/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Tag/Popular/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Tag/Product.php b/app/code/core/Mage/Adminhtml/Block/Report/Tag/Product.php index a009c78247..37066ff859 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Tag/Product.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Tag/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Tag/Product/Detail.php b/app/code/core/Mage/Adminhtml/Block/Report/Tag/Product/Detail.php index d6fbe731e7..18d3e334fc 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Tag/Product/Detail.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Tag/Product/Detail.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Tag/Product/Detail/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Tag/Product/Detail/Grid.php index 76a6a6f7b1..46a4dc9eae 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Tag/Product/Detail/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Tag/Product/Detail/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Tag/Product/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Tag/Product/Grid.php index ad882d6e31..63fe2b84ac 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Tag/Product/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Tag/Product/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Wishlist.php b/app/code/core/Mage/Adminhtml/Block/Report/Wishlist.php index 1a7b2a5a73..a73cfedb8e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Wishlist.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Wishlist.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Wishlist/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Wishlist/Grid.php index 5b10850203..139adf7898 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Wishlist/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Wishlist/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Review/Add.php b/app/code/core/Mage/Adminhtml/Block/Review/Add.php index f13f2b4861..2282aa3e21 100644 --- a/app/code/core/Mage/Adminhtml/Block/Review/Add.php +++ b/app/code/core/Mage/Adminhtml/Block/Review/Add.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Review/Add/Form.php b/app/code/core/Mage/Adminhtml/Block/Review/Add/Form.php index 692889cd7b..54d28bd2a2 100644 --- a/app/code/core/Mage/Adminhtml/Block/Review/Add/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Review/Add/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -53,7 +53,8 @@ protected function _prepareForm() $fieldset->addField('detailed_rating', 'note', array( 'label' => Mage::helper('review')->__('Product Rating'), 'required' => true, - 'text' => '
    ' . $this->getLayout()->createBlock('adminhtml/review_rating_detailed')->toHtml() . '
    ', + 'text' => '
    ' + . $this->getLayout()->createBlock('adminhtml/review_rating_detailed')->toHtml() . '
    ', )); $fieldset->addField('status_id', 'select', array( @@ -71,7 +72,8 @@ protected function _prepareForm() 'label' => Mage::helper('review')->__('Visible In'), 'required' => true, 'name' => 'select_stores[]', - 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm() + 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(), + 'after_element_html' => Mage::getBlockSingleton('adminhtml/store_switcher')->getHintHtml() )); } diff --git a/app/code/core/Mage/Adminhtml/Block/Review/Edit.php b/app/code/core/Mage/Adminhtml/Block/Review/Edit.php index 95421c77a2..1078043ffb 100644 --- a/app/code/core/Mage/Adminhtml/Block/Review/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Review/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Review/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Review/Edit/Form.php index 9d316785e1..4646545bd2 100644 --- a/app/code/core/Mage/Adminhtml/Block/Review/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Review/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -100,7 +100,8 @@ protected function _prepareForm() 'label' => Mage::helper('review')->__('Visible In'), 'required' => true, 'name' => 'stores[]', - 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm() + 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(), + 'after_element_html' => Mage::getBlockSingleton('adminhtml/store_switcher')->getHintHtml() )); $review->setSelectStores($review->getStores()); } diff --git a/app/code/core/Mage/Adminhtml/Block/Review/Grid.php b/app/code/core/Mage/Adminhtml/Block/Review/Grid.php index d1296c7b45..811811080f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Review/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Review/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -47,12 +47,20 @@ protected function _prepareCollection() $collection = $model->getProductCollection(); if ($this->getProductId() || $this->getRequest()->getParam('productId', false)) { - $this->setProductId(($this->getProductId() ? $this->getProductId() : $this->getRequest()->getParam('productId'))); + $productId = $this->getProductId(); + if (!$productId) { + $productId = $this->getRequest()->getParam('productId'); + } + $this->setProductId($productId); $collection->addEntityFilter($this->getProductId()); } if ($this->getCustomerId() || $this->getRequest()->getParam('customerId', false)) { - $this->setCustomerId(($this->getCustomerId() ? $this->getCustomerId() : $this->getRequest()->getParam('customerId'))); + $customerId = $this->getCustomerId(); + if (!$customerId){ + $customerId = $this->getRequest()->getParam('customerId'); + } + $this->setCustomerId($customerId); $collection->addCustomerFilter($this->getCustomerId()); } @@ -211,12 +219,16 @@ protected function _prepareColumns() protected function _prepareMassaction() { $this->setMassactionIdField('review_id'); + $this->setMassactionIdFilter('rt.review_id'); $this->setMassactionIdFieldOnlyIndexValue(true); $this->getMassactionBlock()->setFormFieldName('reviews'); $this->getMassactionBlock()->addItem('delete', array( 'label'=> Mage::helper('review')->__('Delete'), - 'url' => $this->getUrl('*/*/massDelete', array('ret' => Mage::registry('usePendingFilter') ? 'pending' : 'index')), + 'url' => $this->getUrl( + '*/*/massDelete', + array('ret' => Mage::registry('usePendingFilter') ? 'pending' : 'index') + ), 'confirm' => Mage::helper('review')->__('Are you sure?') )); @@ -227,7 +239,10 @@ protected function _prepareMassaction() array_unshift($statuses, array('label'=>'', 'value'=>'')); $this->getMassactionBlock()->addItem('update_status', array( 'label' => Mage::helper('review')->__('Update Status'), - 'url' => $this->getUrl('*/*/massUpdateStatus', array('ret' => Mage::registry('usePendingFilter') ? 'pending' : 'index')), + 'url' => $this->getUrl( + '*/*/massUpdateStatus', + array('ret' => Mage::registry('usePendingFilter') ? 'pending' : 'index') + ), 'additional' => array( 'status' => array( 'name' => 'status', @@ -253,10 +268,13 @@ public function getRowUrl($row) public function getGridUrl() { if( $this->getProductId() || $this->getCustomerId() ) { - return $this->getUrl('*/catalog_product_review/' . (Mage::registry('usePendingFilter') ? 'pending' : ''), array( - 'productId' => $this->getProductId(), - 'customerId' => $this->getCustomerId(), - )); + return $this->getUrl( + '*/catalog_product_review/' . (Mage::registry('usePendingFilter') ? 'pending' : ''), + array( + 'productId' => $this->getProductId(), + 'customerId' => $this->getCustomerId(), + ) + ); } else { return $this->getCurrentUrl(); } diff --git a/app/code/core/Mage/Adminhtml/Block/Review/Grid/Filter/Type.php b/app/code/core/Mage/Adminhtml/Block/Review/Grid/Filter/Type.php index cf34ee79d9..e032ad3994 100644 --- a/app/code/core/Mage/Adminhtml/Block/Review/Grid/Filter/Type.php +++ b/app/code/core/Mage/Adminhtml/Block/Review/Grid/Filter/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Review/Grid/Renderer/Type.php b/app/code/core/Mage/Adminhtml/Block/Review/Grid/Renderer/Type.php index 7e7069d010..08ff349743 100644 --- a/app/code/core/Mage/Adminhtml/Block/Review/Grid/Renderer/Type.php +++ b/app/code/core/Mage/Adminhtml/Block/Review/Grid/Renderer/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Review/Main.php b/app/code/core/Mage/Adminhtml/Block/Review/Main.php index 742d3d2362..d5713c27ca 100644 --- a/app/code/core/Mage/Adminhtml/Block/Review/Main.php +++ b/app/code/core/Mage/Adminhtml/Block/Review/Main.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -49,6 +49,12 @@ public function __construct() $customerName = $customer->getFirstname() . ' ' . $customer->getLastname(); $customerName = $this->escapeHtml($customerName); } + $productId = $this->getRequest()->getParam('productId', false); + $productName = null; + if ($productId) { + $product = Mage::getModel('catalog/product')->load($productId); + $productName = $this->escapeHtml($product->getName()); + } if( Mage::registry('usePendingFilter') === true ) { if ($customerName) { @@ -60,6 +66,8 @@ public function __construct() } else { if ($customerName) { $this->_headerText = Mage::helper('review')->__('All Reviews of Customer `%s`', $customerName); + } elseif ($productName) { + $this->_headerText = Mage::helper('review')->__('All Reviews of Product `%s`', $productName); } else { $this->_headerText = Mage::helper('review')->__('All Reviews'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Review/Product/Grid.php b/app/code/core/Mage/Adminhtml/Block/Review/Product/Grid.php index e035732cb9..6e05eb446a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Review/Product/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Review/Product/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Review/Rating/Detailed.php b/app/code/core/Mage/Adminhtml/Block/Review/Rating/Detailed.php index 88b19ff4fc..bb07cd5ad2 100644 --- a/app/code/core/Mage/Adminhtml/Block/Review/Rating/Detailed.php +++ b/app/code/core/Mage/Adminhtml/Block/Review/Rating/Detailed.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Review/Rating/Summary.php b/app/code/core/Mage/Adminhtml/Block/Review/Rating/Summary.php index ff17881e2a..7e5781587e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Review/Rating/Summary.php +++ b/app/code/core/Mage/Adminhtml/Block/Review/Rating/Summary.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales.php b/app/code/core/Mage/Adminhtml/Block/Sales.php index d0dc61ab79..fc2d5cb2b1 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Creditmemo.php b/app/code/core/Mage/Adminhtml/Block/Sales/Creditmemo.php index 121a29d7ef..74c0197105 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Creditmemo.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Creditmemo.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Creditmemo/Grid.php b/app/code/core/Mage/Adminhtml/Block/Sales/Creditmemo/Grid.php index fa384cdc9e..2054d2c772 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Creditmemo/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Creditmemo/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Invoice.php b/app/code/core/Mage/Adminhtml/Block/Sales/Invoice.php index 96f3c910e4..4766f5a32a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Invoice.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Invoice.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Invoice/Grid.php b/app/code/core/Mage/Adminhtml/Block/Sales/Invoice/Grid.php index 710da8e281..fb74a8f539 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Invoice/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Invoice/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Items/Abstract.php b/app/code/core/Mage/Adminhtml/Block/Sales/Items/Abstract.php index 090d885557..647b32f3dc 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Items/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Items/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Items/Column/Default.php b/app/code/core/Mage/Adminhtml/Block/Sales/Items/Column/Default.php index 6c3a2d0d0f..b553b2c30e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Items/Column/Default.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Items/Column/Default.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Items/Column/Name.php b/app/code/core/Mage/Adminhtml/Block/Sales/Items/Column/Name.php index 7de3d48584..3943f5fe60 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Items/Column/Name.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Items/Column/Name.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Items/Column/Name/Grouped.php b/app/code/core/Mage/Adminhtml/Block/Sales/Items/Column/Name/Grouped.php index a216d92eeb..849a342a89 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Items/Column/Name/Grouped.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Items/Column/Name/Grouped.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Items/Column/Qty.php b/app/code/core/Mage/Adminhtml/Block/Sales/Items/Column/Qty.php index 6a5294d9cc..3e85a97fa7 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Items/Column/Qty.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Items/Column/Qty.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Items/Renderer/Configurable.php b/app/code/core/Mage/Adminhtml/Block/Sales/Items/Renderer/Configurable.php index e7d281dc70..19ac5d6b04 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Items/Renderer/Configurable.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Items/Renderer/Configurable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Items/Renderer/Default.php b/app/code/core/Mage/Adminhtml/Block/Sales/Items/Renderer/Default.php index 6f17e08eba..7ec8e74241 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Items/Renderer/Default.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Items/Renderer/Default.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order.php index 0fd7c73a65..6304e0c940 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Abstract.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Abstract.php index 2a8fc01847..345ab7b7cc 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Address.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Address.php index 7e2d6adb0b..f14f212b5a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Address.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Address.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Address/Form.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Address/Form.php index 146763e76a..b4abf42710 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Address/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Address/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Comments/View.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Comments/View.php index 6797628963..36cd31e88a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Comments/View.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Comments/View.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create.php index 78aaa25cbb..f85d3d5e69 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Abstract.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Abstract.php index 9c32d7bba5..732b94c295 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Billing/Address.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Billing/Address.php index 6e265807c2..11284f6f59 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Billing/Address.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Billing/Address.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -62,13 +62,13 @@ public function getHeaderCssClass() */ protected function _prepareForm() { + $this->setJsVariablePrefix('billingAddress'); parent::_prepareForm(); $this->_form->addFieldNameSuffix('order[billing_address]'); $this->_form->setHtmlNamePrefix('order[billing_address]'); $this->_form->setHtmlIdPrefix('order-billing_address_'); - Mage::dispatchEvent('adminhtml_sales_order_billing_address_prepare_form_after', array('form' => $this)); return $this; } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Billing/Method.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Billing/Method.php index 736402dc9b..36cf69ee79 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Billing/Method.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Billing/Method.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Billing/Method/Form.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Billing/Method/Form.php index 7dcfa4a23e..f2986db459 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Billing/Method/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Billing/Method/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Comment.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Comment.php index a239828b67..c570d12ee5 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Comment.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Comment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Coupons.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Coupons.php index a86a02662e..576cffc3a8 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Coupons.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Coupons.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Coupons/Form.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Coupons/Form.php index 5d25132133..ac37cfe6ef 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Coupons/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Coupons/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Customer.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Customer.php index f5378e7675..ac1d776565 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Customer.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Customer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Customer/Grid.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Customer/Grid.php index cfff77a86f..879c69ba35 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Customer/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Customer/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Data.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Data.php index 2ac6f854e3..7c26270eed 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Data.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form.php index 23b8185290..8b752b6a01 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form/Abstract.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form/Abstract.php index 5b29721c3d..73fa1086ab 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -148,7 +148,7 @@ protected function _addAttributesToForm($attributes, Varien_Data_Form_Abstract $ if ($inputType) { $element = $form->addField($attribute->getAttributeCode(), $inputType, array( 'name' => $attribute->getAttributeCode(), - 'label' => $attribute->getStoreLabel(), + 'label' => $this->__($attribute->getStoreLabel()), 'class' => $attribute->getFrontend()->getClass(), 'required' => $attribute->getIsRequired(), )); diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form/Account.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form/Account.php index 614ce10ecb..5e9ebd7274 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form/Account.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form/Account.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form/Address.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form/Address.php index 5d0b2b432f..b9b5694486 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form/Address.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form/Address.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -31,7 +31,8 @@ * @package Mage_Adminhtml * @author Magento Core Team */ -class Mage_Adminhtml_Block_Sales_Order_Create_Form_Address extends Mage_Adminhtml_Block_Sales_Order_Create_Form_Abstract +class Mage_Adminhtml_Block_Sales_Order_Create_Form_Address + extends Mage_Adminhtml_Block_Sales_Order_Create_Form_Abstract { /** * Customer Address Form instance @@ -83,7 +84,9 @@ public function getAddressCollectionJson() foreach ($this->getAddressCollection() as $address) { $addressForm->setEntity($address); - $data[$address->getId()] = $addressForm->outputData(Mage_Customer_Model_Attribute_Data::OUTPUT_FORMAT_JSON); + $data[$address->getId()] = $addressForm->outputData( + Mage_Customer_Model_Attribute_Data::OUTPUT_FORMAT_JSON + ); } return Mage::helper('core')->jsonEncode($data); } @@ -169,6 +172,15 @@ protected function _prepareForm() ); } + // Set custom renderer for VAT field if needed + $vatIdElement = $this->_form->getElement('vat_id'); + if ($vatIdElement && $this->getDisplayVatValidationButton() !== false) { + $vatIdElement->setRenderer( + $this->getLayout()->createBlock('adminhtml/customer_sales_order_address_form_renderer_vat') + ->setJsVariablePrefix($this->getJsVariablePrefix()) + ); + } + return $this; } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Giftmessage.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Giftmessage.php index 3d63baa322..6c47a80a8f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Giftmessage.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Giftmessage.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Giftmessage/Form.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Giftmessage/Form.php index 6848bb0e48..27cfebb692 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Giftmessage/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Giftmessage/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Header.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Header.php index 12eb496226..ff2cbf72c0 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Header.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Header.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Items.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Items.php index 567ab9f3e9..4cf4bf10e4 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Items.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Items.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -29,38 +29,78 @@ * * @category Mage * @package Mage_Adminhtml - * @author Magento Core Team + * @author Magento Core Team */ class Mage_Adminhtml_Block_Sales_Order_Create_Items extends Mage_Adminhtml_Block_Sales_Order_Create_Abstract { + /** + * Contains button descriptions to be shown at the top of accordion + * @var array + */ + protected $_buttons = array(); + + /** + * Define block ID + */ public function __construct() { parent::__construct(); $this->setId('sales_order_create_items'); } + /** + * Accordion header text + * + * @return string + */ public function getHeaderText() { return Mage::helper('sales')->__('Items Ordered'); } + /** + * Returns all visible items + * + * @return array + */ public function getItems() { -// return $this->getQuote()->getAllItems(); return $this->getQuote()->getAllVisibleItems(); } + /** + * Add button to the items header + * + * @param $args array + */ + public function addButton($args) + { + $this->_buttons[] = $args; + } + + /** + * Render buttons and return HTML code + * + * @return string + */ public function getButtonsHtml() { - $addButtonData = array( - 'label' => Mage::helper('sales')->__('Add Products'), - 'onclick' => "order.productGridShow(this)", - 'class' => 'add', - ); - return $this->getLayout()->createBlock('adminhtml/widget_button')->setData($addButtonData)->toHtml(); + $html = ''; + // Make buttons to be rendered in opposite order of addition. This makes "Add products" the last one. + $this->_buttons = array_reverse($this->_buttons); + foreach ($this->_buttons as $buttonData) { + $html .= $this->getLayout()->createBlock('adminhtml/widget_button')->setData($buttonData)->toHtml(); + } + + return $html; } + /** + * Return HTML code of the block + * + * @return string + */ protected function _toHtml() { if ($this->getStoreId()) { diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Items/Grid.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Items/Grid.php index ca65d53c32..73ac1e1a8a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Items/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Items/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -357,4 +357,16 @@ public function isMoveToWishlistAllowed($item) { return $item->getProduct()->isVisibleInSiteVisibility(); } + + + /** + * Retrieve collection of customer wishlists + * + * @return Mage_Wishlist_Model_Resource_Wishlist_Collection + */ + public function getCustomerWishlists() + { + return Mage::getModel("wishlist/wishlist")->getCollection() + ->filterByCustomerId($this->getCustomerId()); + } } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Load.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Load.php index 258812b440..9143ecf5f2 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Load.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Load.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Messages.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Messages.php index 2fd7e2c3fa..9aadfa6474 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Messages.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Messages.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Newsletter.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Newsletter.php index d1783117b3..87506fc91b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Newsletter.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Newsletter.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Newsletter/Form.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Newsletter/Form.php index 623a7cb054..e2bebac3e4 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Newsletter/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Newsletter/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Search.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Search.php index 65e54bdd97..f11a973536 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Search.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Search.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Search/Grid.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Search/Grid.php index df9604407d..987398c623 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Search/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Search/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Search/Grid/Renderer/Giftmessage.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Search/Grid/Renderer/Giftmessage.php index 0b97fe6518..362c4da625 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Search/Grid/Renderer/Giftmessage.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Search/Grid/Renderer/Giftmessage.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Search/Grid/Renderer/Price.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Search/Grid/Renderer/Price.php index 2ba1493ea6..49c7e65389 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Search/Grid/Renderer/Price.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Search/Grid/Renderer/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -31,7 +31,8 @@ * @package Mage_Adminhtml * @author Magento Core Team */ -class Mage_Adminhtml_Block_Sales_Order_Create_Search_Grid_Renderer_Price extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Price +class Mage_Adminhtml_Block_Sales_Order_Create_Search_Grid_Renderer_Price extends + Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Price { /** * Render minimal price for downloadable products @@ -41,7 +42,7 @@ class Mage_Adminhtml_Block_Sales_Order_Create_Search_Grid_Renderer_Price extends */ public function render(Varien_Object $row) { - if ($row->getTypeId() == Mage_Downloadable_Model_Product_Type::TYPE_DOWNLOADABLE) { + if ($row->getTypeId() == 'downloadable') { $row->setPrice($row->getPrice()); } return parent::render($row); diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Search/Grid/Renderer/Product.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Search/Grid/Renderer/Product.php index c285f2df9f..52483e583c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Search/Grid/Renderer/Product.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Search/Grid/Renderer/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Search/Grid/Renderer/Qty.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Search/Grid/Renderer/Qty.php index 206279dd54..98ee55f9b3 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Search/Grid/Renderer/Qty.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Search/Grid/Renderer/Qty.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Shipping/Address.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Shipping/Address.php index 5c8e9998c4..49d8470f48 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Shipping/Address.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Shipping/Address.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -62,6 +62,7 @@ public function getHeaderCssClass() */ protected function _prepareForm() { + $this->setJsVariablePrefix('shippingAddress'); parent::_prepareForm(); $this->_form->addFieldNameSuffix('order[shipping_address]'); diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Shipping/Method.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Shipping/Method.php index 264515e056..f1cfd6731c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Shipping/Method.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Shipping/Method.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Shipping/Method/Form.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Shipping/Method/Form.php index 60a0ecb44a..32e94c3f06 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Shipping/Method/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Shipping/Method/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar.php index e8fb64646a..6ad01e9a07 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Abstract.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Abstract.php index 7a6d76ddf6..c34c0a148b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Cart.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Cart.php index 7d5f718c60..250c630052 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Cart.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Cart.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -104,9 +104,10 @@ public function getProductId($item) */ protected function _prepareLayout() { + $deleteAllConfirmString = Mage::helper('sales')->__('Are you sure you want to delete all items from shopping cart?'); $button = $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array( 'label' => Mage::helper('sales')->__('Clear Shopping Cart'), - 'onclick' => 'order.sidebarApplyChanges({\'sidebar[empty_customer_cart]\': 1})', + 'onclick' => 'order.clearShoppingCart(\'' . $deleteAllConfirmString . '\')', 'style' => 'float: right;' )); $this->setChild('empty_customer_cart_button', $button); diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Compared.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Compared.php index 0cab434d06..525542d563 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Compared.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Compared.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Pcompared.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Pcompared.php index e9c5cd5e8b..83569eef30 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Pcompared.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Pcompared.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Pviewed.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Pviewed.php index f8a0c412ee..ce8a23845e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Pviewed.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Pviewed.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Reorder.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Reorder.php index f26b4ff407..5cfeb1a00f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Reorder.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Reorder.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Viewed.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Viewed.php index 65efb3085c..b50478fbda 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Viewed.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Viewed.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Wishlist.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Wishlist.php index 267542eb34..239afbb9a9 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Wishlist.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Wishlist.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Store.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Store.php index b27de43174..ada333571e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Store.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Store.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Store/Select.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Store/Select.php index f18ecbedd9..323f0d1710 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Store/Select.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Store/Select.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals.php index aecf5e35b0..5f70496965 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -97,13 +97,6 @@ public function renderTotals($area = null, $colspan = 1) $html .= $this->renderTotal($total, $area, $colspan); } return $html; - - $html = ''; - foreach($this->getTotals() as $total) { - $html .= $this->renderTotal($total, $area, $colspan); - } - - return $html; } public function canSendNewOrderConfirmationEmail() diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Default.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Default.php index 6338229c46..b74cf0f6fd 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Default.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Default.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Discount.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Discount.php index 5fd3546a93..bf435a7100 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Discount.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Discount.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Grandtotal.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Grandtotal.php index ff2178e61b..69c2f63604 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Grandtotal.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Grandtotal.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Shipping.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Shipping.php index f94d593f25..b4be25c478 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Shipping.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Shipping.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Subtotal.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Subtotal.php index 40560081c8..fa62bc2982 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Subtotal.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Subtotal.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Table.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Table.php index 934a90ba12..c21d1eec12 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Table.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Table.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Tax.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Tax.php index 9ca77ed307..da376ed16e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Tax.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Create.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Create.php index c27b6e8650..952f116126 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Create.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Create.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Create/Adjustments.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Create/Adjustments.php index 4fe3e0dfbb..f62c41ebb3 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Create/Adjustments.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Create/Adjustments.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Adminhtml_Block_Sales_Order_Creditmemo_Create_Adjustments extends Mage_Adminhtml_Block_Template diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Create/Form.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Create/Form.php index b103c01d87..5e564020d6 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Create/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Create/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Create/Items.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Create/Items.php index 278a495002..621b1517c3 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Create/Items.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Create/Items.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Totals.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Totals.php index 3394a2ae5a..75326153d7 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Totals.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Totals.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/View.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/View.php index 56314c13c0..e6ad57b441 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/View.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/View.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/View/Comments.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/View/Comments.php index fbade9489a..236535dbd8 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/View/Comments.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/View/Comments.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/View/Form.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/View/Form.php index 9cb807da15..64a56489a0 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/View/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/View/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/View/Items.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/View/Items.php index 4a6951578f..2b7e2ed8b9 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/View/Items.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/View/Items.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Grid.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Grid.php index 6cf4824e11..a835e2c2f7 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/Create.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/Create.php index 7ab923ce02..bf0023f6fe 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/Create.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/Create.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/Create/Form.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/Create/Form.php index 534797adb9..a00cc94a82 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/Create/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/Create/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/Create/Items.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/Create/Items.php index 3eb60db62e..11e8b86cd1 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/Create/Items.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/Create/Items.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/Create/Tracking.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/Create/Tracking.php index e06451397e..ba497e5b41 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/Create/Tracking.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/Create/Tracking.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/Totals.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/Totals.php index 2461dfd0c0..af6f2c5985 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/Totals.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/Totals.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/View.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/View.php index 46ffaec1bd..675945b0ad 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/View.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/View.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/View/Comments.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/View/Comments.php index c3bb5d9eee..510ae32ad6 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/View/Comments.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/View/Comments.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/View/Form.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/View/Form.php index 870c390602..47b29fb3bf 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/View/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/View/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/View/Items.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/View/Items.php index 0a3ed08628..1cc3ecb4f6 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/View/Items.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/View/Items.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Payment.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Payment.php index 4b41da94f9..1265f5a352 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Payment.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Payment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Create.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Create.php index c52ec0e9d9..8fe63a73e7 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Create.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Create.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Create/Form.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Create/Form.php index 8e1c2ccce2..cd7dabee9e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Create/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Create/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Create/Items.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Create/Items.php index 7385ed89a0..8dbef4a8a9 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Create/Items.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Create/Items.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -129,6 +129,7 @@ public function canSendShipmentEmail() */ public function canCreateShippingLabel() { - return $this->getOrder()->getShippingCarrier()->isShippingLabelsAvailable(); + $shippingCarrier = $this->getOrder()->getShippingCarrier(); + return $shippingCarrier && $shippingCarrier->isShippingLabelsAvailable(); } } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Create/Tracking.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Create/Tracking.php index cc71e735cf..f3ab391777 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Create/Tracking.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Create/Tracking.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Packaging.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Packaging.php index 7b12d64e53..d12b37ddad 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Packaging.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Packaging.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -327,7 +327,8 @@ public function getContentTypes() */ public function getCustomValueCurrencyCode() { - return Mage::app()->getStore()->getBaseCurrencyCode(); + $orderInfo = $this->getShipment()->getOrder(); + return $orderInfo->getBaseCurrency()->getCurrencyCode(); } /** @@ -341,6 +342,18 @@ public function displayPrice($price) return $this->getShipment()->getOrder()->formatPriceTxt($price); } + /** + * Display formatted customs price + * + * @param float $price + * @return string + */ + public function displayCustomsPrice($price) + { + $orderInfo = $this->getShipment()->getOrder(); + return $orderInfo->getBaseCurrency()->formatTxt($price); + } + /** * Get ordered qty of item * diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Packaging/Grid.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Packaging/Grid.php index aecf1da6db..9a4432955f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Packaging/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Packaging/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Tracking/Info.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Tracking/Info.php index 5d2122cb73..aeae658c07 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Tracking/Info.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Tracking/Info.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/View.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/View.php index feec1bdc25..b2e60fa798 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/View.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/View.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/View/Comments.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/View/Comments.php index ebe389ee51..d4c9935462 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/View/Comments.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/View/Comments.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/View/Form.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/View/Form.php index 4417ee1930..f1733905c8 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/View/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/View/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -118,10 +118,11 @@ public function getShowPackagesButton() /** * Check is carrier has functionality of creation shipping labels * - * @return boolean + * @return bool */ public function canCreateShippingLabel() { - return $this->getOrder()->getShippingCarrier()->isShippingLabelsAvailable(); + $shippingCarrier = $this->getOrder()->getShippingCarrier(); + return $shippingCarrier && $shippingCarrier->isShippingLabelsAvailable(); } } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/View/Items.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/View/Items.php index 02ed083cd1..8023a12b4a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/View/Items.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/View/Items.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/View/Tracking.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/View/Tracking.php index c16a069449..4e82325402 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/View/Tracking.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/View/Tracking.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status.php index 314b9bd9df..912703588b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Assign.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Assign.php index 8475fb8519..c3b4487c7c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Assign.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Assign.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Assign/Form.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Assign/Form.php index 1b303e9673..778e61540a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Assign/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Assign/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Edit.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Edit.php index 9c120fdc1b..1cc38ace9d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Edit/Form.php index a168cc8333..b6b8dbe862 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Grid.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Grid.php index 1fa569bad8..483bcae419 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/New.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/New.php index 916ecd425c..bba186508e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/New.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/New.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/New/Form.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/New/Form.php index 075dc18602..7d9f6d49f5 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/New/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/New/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -80,6 +80,8 @@ protected function _prepareForm() 'legend' => Mage::helper('sales')->__('Store View Specific Labels'), 'table_class' => 'form-list stores-tree', )); + $renderer = $this->getLayout()->createBlock('adminhtml/store_switcher_form_renderer_fieldset'); + $fieldset->setRenderer($renderer); foreach (Mage::app()->getWebsites() as $website) { $fieldset->addField("w_{$website->getId()}_label", 'note', array( diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Totalbar.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Totalbar.php index 7e895b19c6..d6242dcbc9 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Totalbar.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Totalbar.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Totals.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Totals.php index 31f69255b8..dff73e92b6 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Totals.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Totals.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Totals/Item.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Totals/Item.php index 4956af823a..da8d7fd2d5 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Totals/Item.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Totals/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Totals/Tax.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Totals/Tax.php index fc89023963..3a209c65cc 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Totals/Tax.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Totals/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View.php index 13296a7c69..ac41314314 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -168,7 +168,7 @@ public function __construct() if ($this->_isAllowedAction('reorder') && $this->helper('sales/reorder')->isAllowed($order->getStore()) - && $order->canReorder() + && $order->canReorderIgnoreSalable() ) { $this->_addButton('order_reorder', array( 'label' => Mage::helper('sales')->__('Reorder'), diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Form.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Form.php index 3b4ab89523..6eedbaa4a2 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Giftmessage.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Giftmessage.php index 3c9979b47e..1173ef191d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Giftmessage.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Giftmessage.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/History.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/History.php index bcc7824e8d..b98f632e17 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/History.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/History.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Info.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Info.php index 4adcd860bd..e93731e88a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Info.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Info.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -161,4 +161,13 @@ public function getAddressEditLink($address, $label='') $url = $this->getUrl('*/sales_order/address', array('address_id'=>$address->getId())); return '
    ' . $label . ''; } + + /** + * Whether Customer IP address should be displayed on sales documents + * @return bool + */ + public function shouldDisplayCustomerIp() + { + return !Mage::getStoreConfigFlag('sales/general/hide_customer_ip', $this->getOrder()->getStoreId()); + } } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Items.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Items.php index d87b1f53ef..0f278756bd 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Items.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Items.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Items/Renderer/Default.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Items/Renderer/Default.php index 11a3531257..fc3bcbb4f1 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Items/Renderer/Default.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Items/Renderer/Default.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Messages.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Messages.php index 146235cf83..d5371dbce1 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Messages.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Messages.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Creditmemos.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Creditmemos.php index 003b8e2c36..5227b881a6 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Creditmemos.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Creditmemos.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/History.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/History.php index dc42deee2d..5b4eb49ad9 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/History.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/History.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Info.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Info.php index 48f56b0e64..2a08478d14 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Info.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Info.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Invoices.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Invoices.php index 4d18b20b94..a6fe82a324 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Invoices.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Invoices.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Shipments.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Shipments.php index 458372ff47..a3bf399b33 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Shipments.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Shipments.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Transactions.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Transactions.php index 2166cb0807..b3d86c57db 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Transactions.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Transactions.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tabs.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tabs.php index 848cf83a3e..7415be518e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tabs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Reorder/Renderer/Action.php b/app/code/core/Mage/Adminhtml/Block/Sales/Reorder/Renderer/Action.php index 0d8e31a683..3b1023ed59 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Reorder/Renderer/Action.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Reorder/Renderer/Action.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Shipment.php b/app/code/core/Mage/Adminhtml/Block/Sales/Shipment.php index b42692a015..645544815f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Shipment.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Shipment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Shipment/Grid.php b/app/code/core/Mage/Adminhtml/Block/Sales/Shipment/Grid.php index a335862488..1ffe3ba13a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Shipment/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Shipment/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Totals.php b/app/code/core/Mage/Adminhtml/Block/Sales/Totals.php index 9fd5743d88..8fd1570493 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Totals.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Totals.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Transactions.php b/app/code/core/Mage/Adminhtml/Block/Sales/Transactions.php index 3f97dff648..2a03f84803 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Transactions.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Transactions.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Child/Grid.php b/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Child/Grid.php index 42328d0d37..3a445d02ee 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Child/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Child/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Detail.php b/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Detail.php index 2a6041227d..bb120b5460 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Detail.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Detail.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Detail/Grid.php b/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Detail/Grid.php index 98e8e72b02..f22222739d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Detail/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Detail/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Grid.php b/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Grid.php index e985cdad25..c8f8fe5fe1 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Shipping/Carrier/Tablerate/Grid.php b/app/code/core/Mage/Adminhtml/Block/Shipping/Carrier/Tablerate/Grid.php index b3a792f0d7..1d58505cf7 100644 --- a/app/code/core/Mage/Adminhtml/Block/Shipping/Carrier/Tablerate/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Shipping/Carrier/Tablerate/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sitemap.php b/app/code/core/Mage/Adminhtml/Block/Sitemap.php index 7746a8afc4..6041ee9fb1 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sitemap.php +++ b/app/code/core/Mage/Adminhtml/Block/Sitemap.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sitemap/Edit.php b/app/code/core/Mage/Adminhtml/Block/Sitemap/Edit.php index 490772ced9..f12ce5f2aa 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sitemap/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Sitemap/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sitemap/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Sitemap/Edit/Form.php index 443e082bf8..ced91e6be8 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sitemap/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Sitemap/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -87,7 +87,8 @@ protected function _prepareForm() 'name' => 'store_id', 'required' => true, 'value' => $model->getStoreId(), - 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm() + 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(), + 'after_element_html' => Mage::getBlockSingleton('adminhtml/store_switcher')->getHintHtml() )); } else { diff --git a/app/code/core/Mage/Adminhtml/Block/Sitemap/Grid.php b/app/code/core/Mage/Adminhtml/Block/Sitemap/Grid.php index 841fec3b61..c6c655c48c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sitemap/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Sitemap/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sitemap/Grid/Renderer/Action.php b/app/code/core/Mage/Adminhtml/Block/Sitemap/Grid/Renderer/Action.php index 3c0772f94a..8be78b41f6 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sitemap/Grid/Renderer/Action.php +++ b/app/code/core/Mage/Adminhtml/Block/Sitemap/Grid/Renderer/Action.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sitemap/Grid/Renderer/Link.php b/app/code/core/Mage/Adminhtml/Block/Sitemap/Grid/Renderer/Link.php index da544aff73..2032329fc0 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sitemap/Grid/Renderer/Link.php +++ b/app/code/core/Mage/Adminhtml/Block/Sitemap/Grid/Renderer/Link.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sitemap/Grid/Renderer/Time.php b/app/code/core/Mage/Adminhtml/Block/Sitemap/Grid/Renderer/Time.php index 7cbd8999e0..5f3100b51b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sitemap/Grid/Renderer/Time.php +++ b/app/code/core/Mage/Adminhtml/Block/Sitemap/Grid/Renderer/Time.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Store/Switcher.php b/app/code/core/Mage/Adminhtml/Block/Store/Switcher.php index ae05eb96e1..df939db2f1 100644 --- a/app/code/core/Mage/Adminhtml/Block/Store/Switcher.php +++ b/app/code/core/Mage/Adminhtml/Block/Store/Switcher.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -29,17 +29,34 @@ * * @category Mage * @package Mage_Adminhtml - * @author Magento Core Team + * @author Magento Core Team */ class Mage_Adminhtml_Block_Store_Switcher extends Mage_Adminhtml_Block_Template { + /** + * Key in config for store switcher hint + */ + const XPATH_HINT_KEY = 'store_switcher'; + /** * @var array */ protected $_storeIds; + /** + * Name of store variable + * + * @var string + */ protected $_storeVarName = 'store'; + /** + * Url for store switcher hint + * + * @var string + */ + protected $_hintUrl; + /** * @var bool */ @@ -206,4 +223,38 @@ public function hasDefaultOption($hasDefaultOption = null) } return $this->_hasDefaultOption; } + + /** + * Return url for store switcher hint + * + * @return string + */ + public function getHintUrl() + { + if (null === $this->_hintUrl) { + $this->_hintUrl = Mage::helper('core/hint')->getHintByCode(self::XPATH_HINT_KEY); + } + return $this->_hintUrl; + } + + /** + * Return store switcher hint html + * + * @return string + */ + public function getHintHtml() + { + $html = ''; + $url = $this->getHintUrl(); + if ($url) { + $html = '' + . $this->__('What is this?') + . ''; + } + return $html; + } } diff --git a/app/code/core/Mage/Adminhtml/Block/Store/Switcher/Form/Renderer/Fieldset.php b/app/code/core/Mage/Adminhtml/Block/Store/Switcher/Form/Renderer/Fieldset.php new file mode 100644 index 0000000000..7fde2104eb --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Block/Store/Switcher/Form/Renderer/Fieldset.php @@ -0,0 +1,83 @@ + + */ +class Mage_Adminhtml_Block_Store_Switcher_Form_Renderer_Fieldset + extends Mage_Adminhtml_Block_Template implements Varien_Data_Form_Element_Renderer_Interface +{ + /** + * Form element which re-rendering + * + * @var Varien_Data_Form_Element_Fieldset + */ + protected $_element; + + /** + * Constructor + */ + protected function _construct() + { + $this->setTemplate('store/switcher/form/renderer/fieldset.phtml'); + } + + /** + * Retrieve an element + * + * @return Varien_Data_Form_Element_Fieldset + */ + public function getElement() + { + return $this->_element; + } + + /** + * Render element + * + * @param Varien_Data_Form_Element_Abstract $element + * @return string + */ + public function render(Varien_Data_Form_Element_Abstract $element) + { + $this->_element = $element; + return $this->toHtml(); + } + + /** + * Return html for store switcher hint + * + * @return string + */ + public function getHintHtml() + { + return Mage::getBlockSingleton('adminhtml/store_switcher')->getHintHtml(); + } +} diff --git a/app/code/core/Mage/Adminhtml/Block/System/Account/Edit.php b/app/code/core/Mage/Adminhtml/Block/System/Account/Edit.php index 15ded0aa6f..de4677e766 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Account/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Account/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Account/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/System/Account/Edit/Form.php index c0feba5dbc..d4a519af6a 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Account/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Account/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Cache/Edit.php b/app/code/core/Mage/Adminhtml/Block/System/Cache/Edit.php index d5801a9f88..99d6b16a29 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Cache/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Cache/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Cache/Form.php b/app/code/core/Mage/Adminhtml/Block/System/Cache/Form.php index f67966c95e..dbc59b6758 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Cache/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Cache/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Dwstree.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Dwstree.php index fb5763cdd2..4b7c2809ee 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Dwstree.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Dwstree.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Edit.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Edit.php index 6b520894dc..b49ecb0853 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Form.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Form.php index b7e9d5ff1d..681d188658 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -332,12 +332,16 @@ public function initFields($fieldset, $group, $section, $fieldPrefix='', $labelP if ($e->depends) { foreach ($e->depends->children() as $dependent) { + /* @var $dependent Mage_Core_Model_Config_Element */ $dependentId = $section->getName() . '_' . $group->getName() . '_' . $fieldPrefix . $dependent->getName(); $shouldBeAddedDependence = true; $dependentValue = (string) $dependent; + if (isset($dependent['separator'])) { + $dependentValue = explode((string)$dependent['separator'], $dependentValue); + } $dependentFieldName = $fieldPrefix . $dependent->getName(); $dependentField = $group->fields->$dependentFieldName; /* @@ -350,10 +354,12 @@ public function initFields($fieldset, $group, $section, $fieldPrefix='', $labelP . '/' . $group->getName() . '/' . $fieldPrefix . $dependent->getName(); - $shouldBeAddedDependence = $dependentValue != Mage::getStoreConfig( - $dependentFullPath, - $this->getStoreCode() - ); + $dependentValueInStore = Mage::getStoreConfig($dependentFullPath, $this->getStoreCode()); + if (is_array($dependentValue)) { + $shouldBeAddedDependence = !in_array($dependentValueInStore, $dependentValue); + } else { + $shouldBeAddedDependence = $dependentValue != $dependentValueInStore; + } } if($shouldBeAddedDependence) { $this->_getDependence() diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field.php index ee39b4190f..6dd336957a 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Array/Abstract.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Array/Abstract.php index b3491b94dc..f3cfb39dda 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Array/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Array/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Datetime.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Datetime.php index fcd7e9e783..f51bd9ab6c 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Datetime.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Datetime.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Export.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Export.php index 07214232b3..6df56e0c11 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Export.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Export.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/File.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/File.php index 70a020954e..23e9ec21bf 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/File.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/File.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Heading.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Heading.php index 30676a9387..1b3188340b 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Heading.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Heading.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Image.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Image.php index 801918ac60..f6405a2327 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Image.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Image.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Import.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Import.php index 3c39041620..73783c155e 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Import.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Import.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Notification.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Notification.php index 395c5ed4d9..db3f2e551b 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Notification.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Notification.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Regexceptions.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Regexceptions.php index d2cbe73362..e708129a58 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Regexceptions.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Regexceptions.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Select/Allowspecific.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Select/Allowspecific.php index e2d053f4ac..630dc0c10f 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Select/Allowspecific.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Select/Allowspecific.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Select/Flatcatalog.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Select/Flatcatalog.php index 33203c33ed..c0e26de63b 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Select/Flatcatalog.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Select/Flatcatalog.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Select/Flatproduct.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Select/Flatproduct.php index 5009fe4742..0887eaca26 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Select/Flatproduct.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Select/Flatproduct.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Fieldset.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Fieldset.php index c363fca180..ff53c4df81 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Fieldset.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Fieldset.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Fieldset/Modules/DisableOutput.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Fieldset/Modules/DisableOutput.php index c26c626f60..bbc50d5935 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Fieldset/Modules/DisableOutput.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Fieldset/Modules/DisableOutput.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -38,6 +38,13 @@ public function render(Varien_Data_Form_Element_Abstract $element) $modules = array_keys((array)Mage::getConfig()->getNode('modules')->children()); + $dispatchResult = new Varien_Object($modules); + Mage::dispatchEvent( + 'adminhtml_system_config_advanced_disableoutput_render_before', + array('modules' => $dispatchResult) + ); + $modules = $dispatchResult->toArray(); + sort($modules); foreach ($modules as $moduleName) { diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Fieldset/Order/Statuses.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Fieldset/Order/Statuses.php index 2f280752b2..ada70dc595 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Fieldset/Order/Statuses.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Fieldset/Order/Statuses.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Switcher.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Switcher.php index 578c564062..176fc5ee20 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Switcher.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Switcher.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -106,4 +106,13 @@ public function getStoreSelectOptions() return $options; } + /** + * Return store switcher hint html + * + * @return mixed + */ + public function getHintHtml() + { + return Mage::getBlockSingleton('adminhtml/store_switcher')->getHintHtml(); + } } diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/System/Storage/Media/Synchronize.php b/app/code/core/Mage/Adminhtml/Block/System/Config/System/Storage/Media/Synchronize.php index 19ccd4afa6..805dbe94d6 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/System/Storage/Media/Synchronize.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/System/Storage/Media/Synchronize.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Tabs.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Tabs.php index 7beee409df..874406866c 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Tabs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -80,7 +80,7 @@ public function initTabs() $configFields = Mage::getSingleton('adminhtml/config'); $sections = $configFields->getSections($current); $tabs = (array)$configFields->getTabs()->children(); - + $sections = (array)$sections; @@ -99,7 +99,7 @@ public function initTabs() foreach ($sections as $section) { - + Mage::dispatchEvent('adminhtml_block_system_config_init_tab_sections_before', array('section' => $section)); $hasChildren = $configFields->hasChildren($section, $websiteCode, $storeCode); //$code = $section->getPath(); diff --git a/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui.php b/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui.php index 8a737b87ff..5b4eba668b 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit.php b/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit.php index 8b7e915746..447ba3036d 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Form.php index f55accf7d5..78696eab00 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Tab/Upload.php b/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Tab/Upload.php index d44555aa54..f3fcc14009 100755 --- a/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Tab/Upload.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Tab/Upload.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Tab/View.php b/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Tab/View.php index 5c001b866e..7e3f537a71 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Tab/View.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Tab/View.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Tab/Wizard.php b/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Tab/Wizard.php index 16d067de7b..a74bd20098 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Tab/Wizard.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Tab/Wizard.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Tabs.php b/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Tabs.php index af84495e20..4a0845f331 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Tabs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Grid.php b/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Grid.php index 47d4c9dd2b..41b28008df 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile.php b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile.php index 55546894ab..78319fbbfc 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit.php b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit.php index 44cf0f5287..fc12b550dd 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Filter/Action.php b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Filter/Action.php index 793fd36832..5ff4269559 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Filter/Action.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Filter/Action.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Form.php index b11dffbe13..14932689ff 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Renderer/Action.php b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Renderer/Action.php index d09cc1225c..3b59e298ce 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Renderer/Action.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Renderer/Action.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Tab/Edit.php b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Tab/Edit.php index 72555665c7..fb6d582a38 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Tab/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Tab/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Tab/History.php b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Tab/History.php index 69f6c79bbb..a4081197b6 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Tab/History.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Tab/History.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Tab/Run.php b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Tab/Run.php index 23631303b5..fa6fb01982 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Tab/Run.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Tab/Run.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Tabs.php b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Tabs.php index 4ce76c9443..c08333b65f 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Tabs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Grid.php b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Grid.php index a412ffb04f..65e3032f3c 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Run.php b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Run.php index 13931bdf15..4f8ed6cf94 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Run.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Run.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Currency.php b/app/code/core/Mage/Adminhtml/Block/System/Currency.php index da2e944f88..fbeddc3640 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Currency.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Currency.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Currency/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/System/Currency/Edit/Form.php index 17defd51ea..c983cf388c 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Currency/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Currency/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Currency/Edit/Tab/Main.php b/app/code/core/Mage/Adminhtml/Block/System/Currency/Edit/Tab/Main.php index d5412d8183..79ab475feb 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Currency/Edit/Tab/Main.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Currency/Edit/Tab/Main.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Currency/Edit/Tab/Rates.php b/app/code/core/Mage/Adminhtml/Block/System/Currency/Edit/Tab/Rates.php index 882c00c37a..d4cbaa4ace 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Currency/Edit/Tab/Rates.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Currency/Edit/Tab/Rates.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Currency/Edit/Tabs.php b/app/code/core/Mage/Adminhtml/Block/System/Currency/Edit/Tabs.php index 0ec0581d29..b61eb97188 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Currency/Edit/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Currency/Edit/Tabs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Currency/Rate/Matrix.php b/app/code/core/Mage/Adminhtml/Block/System/Currency/Rate/Matrix.php index 58974f8da0..42fbb793a8 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Currency/Rate/Matrix.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Currency/Rate/Matrix.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Currency/Rate/Services.php b/app/code/core/Mage/Adminhtml/Block/System/Currency/Rate/Services.php index 22dc55b554..ccb20b9d21 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Currency/Rate/Services.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Currency/Rate/Services.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Design.php b/app/code/core/Mage/Adminhtml/Block/System/Design.php index 36a8fe25b7..10bdff989d 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Design.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Design.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Design/Edit.php b/app/code/core/Mage/Adminhtml/Block/System/Design/Edit.php index c8a5e6835c..c312efd581 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Design/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Design/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Design/Edit/Tab/General.php b/app/code/core/Mage/Adminhtml/Block/System/Design/Edit/Tab/General.php index d25aabc19c..6035f890a2 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Design/Edit/Tab/General.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Design/Edit/Tab/General.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Adminhtml_Block_System_Design_Edit_Tab_General extends Mage_Adminhtml_Block_Widget_Form @@ -39,6 +39,7 @@ protected function _prepareForm() 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(), 'name' => 'store_id', 'required' => true, + 'after_element_html' => Mage::getBlockSingleton('adminhtml/store_switcher')->getHintHtml() )); } else { $fieldset->addField('store_id', 'hidden', array( diff --git a/app/code/core/Mage/Adminhtml/Block/System/Design/Edit/Tabs.php b/app/code/core/Mage/Adminhtml/Block/System/Design/Edit/Tabs.php index 66c6f13d2a..df764dea22 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Design/Edit/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Design/Edit/Tabs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Design/Grid.php b/app/code/core/Mage/Adminhtml/Block/System/Design/Grid.php index c14656cf3e..103523288c 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Design/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Design/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Email/Template.php b/app/code/core/Mage/Adminhtml/Block/System/Email/Template.php index 439cb935e3..21553f2c34 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Email/Template.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Email/Template.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Edit.php b/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Edit.php index 04fecd032b..2746c63910 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Edit/Form.php index 18537ab2d5..90bd3219d4 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -45,7 +45,7 @@ protected function _prepareLayout() if ($head = $this->getLayout()->getBlock('head')) { $head->addItem('js', 'prototype/window.js') ->addItem('js_css', 'prototype/windows/themes/default.css') - ->addItem('js_css', 'prototype/windows/themes/magento.css') + ->addCss('lib/prototype/windows/themes/magento.css') ->addItem('js', 'mage/adminhtml/variables.js'); } return parent::_prepareLayout(); @@ -72,7 +72,8 @@ protected function _prepareForm() 'container_id' => 'used_currently_for', 'after_element_html' => '', )); } @@ -83,7 +84,8 @@ protected function _prepareForm() 'container_id' => 'used_default_for', 'after_element_html' => '', )); } diff --git a/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Grid.php b/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Grid.php index 635c090696..bae0cba979 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Grid/Filter/Type.php b/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Grid/Filter/Type.php index 8b7109b313..cbb040133e 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Grid/Filter/Type.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Grid/Filter/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Grid/Renderer/Action.php b/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Grid/Renderer/Action.php index f7e800e8f0..ee494a4286 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Grid/Renderer/Action.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Grid/Renderer/Action.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Grid/Renderer/Sender.php b/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Grid/Renderer/Sender.php index 374a69cce8..7e71a41feb 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Grid/Renderer/Sender.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Grid/Renderer/Sender.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Grid/Renderer/Type.php b/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Grid/Renderer/Type.php index 8973b34142..308d08f170 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Grid/Renderer/Type.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Grid/Renderer/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Preview.php b/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Preview.php index 418688e4f3..80cdb05fe1 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Preview.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Preview.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -33,11 +33,17 @@ */ class Mage_Adminhtml_Block_System_Email_Template_Preview extends Mage_Adminhtml_Block_Widget { + /** + * Prepare html output + * + * @return string + */ protected function _toHtml() { - /* @var $template Mage_Core_Model_Email_Template */ + /** @var $template Mage_Core_Model_Email_Template */ $template = Mage::getModel('core/email_template'); - if ($id = (int)$this->getRequest()->getParam('id')) { + $id = (int)$this->getRequest()->getParam('id'); + if ($id) { $template->load($id); } else { $template->setTemplateType($this->getRequest()->getParam('type')); diff --git a/app/code/core/Mage/Adminhtml/Block/System/Store/Delete.php b/app/code/core/Mage/Adminhtml/Block/System/Store/Delete.php index 1e332c7fd6..75c9743648 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Store/Delete.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Store/Delete.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Store/Delete/Form.php b/app/code/core/Mage/Adminhtml/Block/System/Store/Delete/Form.php index 09c98ce8ed..37ecbb1afe 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Store/Delete/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Store/Delete/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Store/Delete/Group.php b/app/code/core/Mage/Adminhtml/Block/System/Store/Delete/Group.php index b09d95f53d..6b4d98b433 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Store/Delete/Group.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Store/Delete/Group.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Store/Delete/Website.php b/app/code/core/Mage/Adminhtml/Block/System/Store/Delete/Website.php index 42aee1a081..3b8b65cd43 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Store/Delete/Website.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Store/Delete/Website.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Store/Edit.php b/app/code/core/Mage/Adminhtml/Block/System/Store/Edit.php index f3e72aa850..351efd198a 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Store/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Store/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Store/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/System/Store/Edit/Form.php index 6f0a23f5b4..6312c52176 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Store/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Store/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -109,8 +109,11 @@ protected function _prepareForm() )); if (Mage::registry('store_action') == 'edit') { - $groups = Mage::getModel('core/store_group')->getCollection()->addWebsiteFilter($websiteModel->getId())->toOptionArray(); - //array_unshift($groups, array('label'=>'', 'value'=>0)); + $groups = Mage::getModel('core/store_group')->getCollection() + ->addWebsiteFilter($websiteModel->getId()) + ->setWithoutStoreViewFilter() + ->toOptionArray(); + $fieldset->addField('website_default_group_id', 'select', array( 'name' => 'website[default_group_id]', 'label' => Mage::helper('core')->__('Default Store'), @@ -202,7 +205,8 @@ protected function _prepareForm() )); if (Mage::registry('store_action') == 'edit') { - $stores = Mage::getModel('core/store')->getCollection()->addGroupFilter($groupModel->getId())->toOptionArray(); + $stores = Mage::getModel('core/store')->getCollection() + ->addGroupFilter($groupModel->getId())->toOptionArray(); //array_unshift($stores, array('label'=>'', 'value'=>0)); $fieldset->addField('group_default_store_id', 'select', array( 'name' => 'group[default_store_id]', @@ -335,6 +339,8 @@ protected function _prepareForm() $form->setUseContainer(true); $this->setForm($form); + Mage::dispatchEvent('adminhtml_store_edit_form_prepare_form', array('block' => $this)); + return parent::_prepareForm(); } } diff --git a/app/code/core/Mage/Adminhtml/Block/System/Store/Grid.php b/app/code/core/Mage/Adminhtml/Block/System/Store/Grid.php index fcd3670000..eb529c19d5 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Store/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Store/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Store/Grid/Render/Group.php b/app/code/core/Mage/Adminhtml/Block/System/Store/Grid/Render/Group.php index f26806e573..2b257c1b94 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Store/Grid/Render/Group.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Store/Grid/Render/Group.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -32,13 +32,16 @@ * @author Magento Core Team */ -class Mage_Adminhtml_Block_System_Store_Grid_Render_Group extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract +class Mage_Adminhtml_Block_System_Store_Grid_Render_Group + extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract { public function render(Varien_Object $row) { if (!$row->getData($this->getColumn()->getIndex())) { return null; } - return '' . $row->getData($this->getColumn()->getIndex()) . ''; + return '' + . $this->escapeHtml($row->getData($this->getColumn()->getIndex())) . ''; } } diff --git a/app/code/core/Mage/Adminhtml/Block/System/Store/Grid/Render/Store.php b/app/code/core/Mage/Adminhtml/Block/System/Store/Grid/Render/Store.php index 4519ee38ba..f173cf55e7 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Store/Grid/Render/Store.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Store/Grid/Render/Store.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -32,13 +32,16 @@ * @author Magento Core Team */ -class Mage_Adminhtml_Block_System_Store_Grid_Render_Store extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract +class Mage_Adminhtml_Block_System_Store_Grid_Render_Store + extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract { public function render(Varien_Object $row) { if (!$row->getData($this->getColumn()->getIndex())) { return null; } - return '' . $row->getData($this->getColumn()->getIndex()) . ''; + return '' + . $this->escapeHtml($row->getData($this->getColumn()->getIndex())) . ''; } } diff --git a/app/code/core/Mage/Adminhtml/Block/System/Store/Grid/Render/Website.php b/app/code/core/Mage/Adminhtml/Block/System/Store/Grid/Render/Website.php index 5fea8dd67e..5061475d5e 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Store/Grid/Render/Website.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Store/Grid/Render/Website.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -31,12 +31,16 @@ * @package Mage_Adminhtml * @author Magento Core Team */ -class Mage_Adminhtml_Block_System_Store_Grid_Render_Website extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract + +class Mage_Adminhtml_Block_System_Store_Grid_Render_Website + extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract { public function render(Varien_Object $row) { - return '' . $row->getData($this->getColumn()->getIndex()) . ''; + return '' + . $this->escapeHtml($row->getData($this->getColumn()->getIndex())) . ''; } } diff --git a/app/code/core/Mage/Adminhtml/Block/System/Store/Store.php b/app/code/core/Mage/Adminhtml/Block/System/Store/Store.php index e6ce2d137a..d387266715 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Store/Store.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Store/Store.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Variable.php b/app/code/core/Mage/Adminhtml/Block/System/Variable.php index f0731c4620..7fb3a5bdba 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Variable.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Variable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Variable/Edit.php b/app/code/core/Mage/Adminhtml/Block/System/Variable/Edit.php index 5f7fec40e2..f82065597d 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Variable/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Variable/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Variable/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/System/Variable/Edit/Form.php index 780c46695e..fe4cd08a9b 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Variable/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Variable/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Variable/Grid.php b/app/code/core/Mage/Adminhtml/Block/System/Variable/Grid.php index 6ba3b30c5f..ef2a04b01e 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Variable/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Variable/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tag.php b/app/code/core/Mage/Adminhtml/Block/Tag.php index aecaac9dab..05cc554a5e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tag.php +++ b/app/code/core/Mage/Adminhtml/Block/Tag.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tag/Assigned/Grid.php b/app/code/core/Mage/Adminhtml/Block/Tag/Assigned/Grid.php index e4f6a8dd37..9cfb28c646 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tag/Assigned/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Tag/Assigned/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tag/Customer.php b/app/code/core/Mage/Adminhtml/Block/Tag/Customer.php index 2f2a08efd2..d57254688d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tag/Customer.php +++ b/app/code/core/Mage/Adminhtml/Block/Tag/Customer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tag/Customer/Grid.php b/app/code/core/Mage/Adminhtml/Block/Tag/Customer/Grid.php index e6dc2556bb..40c508eb4d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tag/Customer/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Tag/Customer/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tag/Edit.php b/app/code/core/Mage/Adminhtml/Block/Tag/Edit.php index 6891c314aa..24526307e2 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tag/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Tag/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tag/Edit/Accordion.php b/app/code/core/Mage/Adminhtml/Block/Tag/Edit/Accordion.php index d44ecbf4eb..dfbdaf8856 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tag/Edit/Accordion.php +++ b/app/code/core/Mage/Adminhtml/Block/Tag/Edit/Accordion.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tag/Edit/Assigned.php b/app/code/core/Mage/Adminhtml/Block/Tag/Edit/Assigned.php index 790a6780f3..6ea6d2ac0a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tag/Edit/Assigned.php +++ b/app/code/core/Mage/Adminhtml/Block/Tag/Edit/Assigned.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tag/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Tag/Edit/Form.php index 7d14ac5d60..afd459614c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tag/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Tag/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tag/Grid/All.php b/app/code/core/Mage/Adminhtml/Block/Tag/Grid/All.php index 836a2af2a8..5b6aa6574e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tag/Grid/All.php +++ b/app/code/core/Mage/Adminhtml/Block/Tag/Grid/All.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tag/Grid/Customers.php b/app/code/core/Mage/Adminhtml/Block/Tag/Grid/Customers.php index 21386c7a28..7d308f6842 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tag/Grid/Customers.php +++ b/app/code/core/Mage/Adminhtml/Block/Tag/Grid/Customers.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tag/Grid/Pending.php b/app/code/core/Mage/Adminhtml/Block/Tag/Grid/Pending.php index e3a20562d9..5bbd0533f4 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tag/Grid/Pending.php +++ b/app/code/core/Mage/Adminhtml/Block/Tag/Grid/Pending.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tag/Grid/Products.php b/app/code/core/Mage/Adminhtml/Block/Tag/Grid/Products.php index f49d515515..5c9dc92bf3 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tag/Grid/Products.php +++ b/app/code/core/Mage/Adminhtml/Block/Tag/Grid/Products.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tag/Pending.php b/app/code/core/Mage/Adminhtml/Block/Tag/Pending.php index 3e3e4ea1a9..0d3385f18f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tag/Pending.php +++ b/app/code/core/Mage/Adminhtml/Block/Tag/Pending.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tag/Product.php b/app/code/core/Mage/Adminhtml/Block/Tag/Product.php index 86a3b25cf4..31d27bb64e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tag/Product.php +++ b/app/code/core/Mage/Adminhtml/Block/Tag/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tag/Product/Grid.php b/app/code/core/Mage/Adminhtml/Block/Tag/Product/Grid.php index 8064060055..66e4d8820a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tag/Product/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Tag/Product/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tag/Store/Switcher.php b/app/code/core/Mage/Adminhtml/Block/Tag/Store/Switcher.php index 0edafe3049..975c049c38 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tag/Store/Switcher.php +++ b/app/code/core/Mage/Adminhtml/Block/Tag/Store/Switcher.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tag/Tag.php b/app/code/core/Mage/Adminhtml/Block/Tag/Tag.php index abf54ed10b..22f2336cc6 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tag/Tag.php +++ b/app/code/core/Mage/Adminhtml/Block/Tag/Tag.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tag/Tag/Edit.php b/app/code/core/Mage/Adminhtml/Block/Tag/Tag/Edit.php index 2381e0f8b4..f3d12669f0 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tag/Tag/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Tag/Tag/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tag/Tag/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Tag/Tag/Edit/Form.php index d860f30607..0c835a5f83 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tag/Tag/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Tag/Tag/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tag/Tag/Grid.php b/app/code/core/Mage/Adminhtml/Block/Tag/Tag/Grid.php index 0959a74302..6c7ccb5a30 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tag/Tag/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Tag/Tag/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tax/Class.php b/app/code/core/Mage/Adminhtml/Block/Tax/Class.php index f9a70abb30..0efede7e80 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tax/Class.php +++ b/app/code/core/Mage/Adminhtml/Block/Tax/Class.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tax/Class/Edit.php b/app/code/core/Mage/Adminhtml/Block/Tax/Class/Edit.php index 38877bf482..4555c276bf 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tax/Class/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Tax/Class/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tax/Class/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Tax/Class/Edit/Form.php index 5219e4f0a4..43f34ed494 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tax/Class/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Tax/Class/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tax/Class/Grid.php b/app/code/core/Mage/Adminhtml/Block/Tax/Class/Grid.php index 1b41635df2..eb19c707ff 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tax/Class/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Tax/Class/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Form.php b/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Form.php index e38cab87a0..86d77e3c93 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -158,6 +158,7 @@ protected function _prepareForm() 'label' => Mage::helper('tax')->__('Range From'), 'value' => $rateObject->getZipFrom(), 'required' => true, + 'maxlength' => 9, 'class' => 'validate-digits' ) ); @@ -168,6 +169,7 @@ protected function _prepareForm() 'label' => Mage::helper('tax')->__('Range To'), 'value' => $rateObject->getZipTo(), 'required' => true, + 'maxlength' => 9, 'class' => 'validate-digits' ) ); diff --git a/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Grid.php b/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Grid.php index 2fceff4122..67aa829855 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Adminhtml_Block_Tax_Rate_Grid extends Mage_Adminhtml_Block_Widget_Grid diff --git a/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Grid/Renderer/Country.php b/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Grid/Renderer/Country.php index b114afc8d0..efda945e45 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Grid/Renderer/Country.php +++ b/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Grid/Renderer/Country.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Grid/Renderer/Data.php b/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Grid/Renderer/Data.php index 53563b70ad..2523b38f29 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Grid/Renderer/Data.php +++ b/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Grid/Renderer/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tax/Rate/ImportExport.php b/app/code/core/Mage/Adminhtml/Block/Tax/Rate/ImportExport.php index 8a7ce77a22..d0a2d48898 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tax/Rate/ImportExport.php +++ b/app/code/core/Mage/Adminhtml/Block/Tax/Rate/ImportExport.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Title.php b/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Title.php index 1e541c2b4d..eea960bde6 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Title.php +++ b/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Title.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Title/Fieldset.php b/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Title/Fieldset.php index 8a86262cfa..7e3ec0cab3 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Title/Fieldset.php +++ b/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Title/Fieldset.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Toolbar/Add.php b/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Toolbar/Add.php index 402b21bf7c..c9218affc7 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Toolbar/Add.php +++ b/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Toolbar/Add.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Toolbar/Save.php b/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Toolbar/Save.php index 72dfd5e9cc..1b88b273f1 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Toolbar/Save.php +++ b/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Toolbar/Save.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tax/Rule.php b/app/code/core/Mage/Adminhtml/Block/Tax/Rule.php index 94edbe5924..8dc68a234c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tax/Rule.php +++ b/app/code/core/Mage/Adminhtml/Block/Tax/Rule.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tax/Rule/Edit.php b/app/code/core/Mage/Adminhtml/Block/Tax/Rule/Edit.php index 34b3f55b98..09bb8f08e2 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tax/Rule/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Tax/Rule/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tax/Rule/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Tax/Rule/Edit/Form.php index cfab638cc8..ba8b3c20d6 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tax/Rule/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Tax/Rule/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tax/Rule/Grid.php b/app/code/core/Mage/Adminhtml/Block/Tax/Rule/Grid.php index ad6fcb4100..b33b4e888c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tax/Rule/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Tax/Rule/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Adminhtml_Block_Tax_Rule_Grid extends Mage_Adminhtml_Block_Widget_Grid diff --git a/app/code/core/Mage/Adminhtml/Block/Template.php b/app/code/core/Mage/Adminhtml/Block/Template.php index da6ffabf23..a750e7f3b1 100644 --- a/app/code/core/Mage/Adminhtml/Block/Template.php +++ b/app/code/core/Mage/Adminhtml/Block/Template.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Text/List.php b/app/code/core/Mage/Adminhtml/Block/Text/List.php index 0d4ca04dd3..85cd2bea04 100644 --- a/app/code/core/Mage/Adminhtml/Block/Text/List.php +++ b/app/code/core/Mage/Adminhtml/Block/Text/List.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Urlrewrite.php b/app/code/core/Mage/Adminhtml/Block/Urlrewrite.php index f277bd6f18..8fa04f0920 100644 --- a/app/code/core/Mage/Adminhtml/Block/Urlrewrite.php +++ b/app/code/core/Mage/Adminhtml/Block/Urlrewrite.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Category/Tree.php b/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Category/Tree.php index 519d59e98f..8483bf6e3c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Category/Tree.php +++ b/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Category/Tree.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit.php b/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit.php index 9d91f164ce..b48bcc4067 100644 --- a/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit/Form.php index fdf120e66f..f47cc35fce 100644 --- a/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -157,6 +157,7 @@ protected function _prepareForm() 'values' => $stores, 'disabled' => true, 'value' => $formValues['store_id'], + 'after_element_html' => Mage::getBlockSingleton('adminhtml/store_switcher')->getHintHtml() )); if ($noStoreError) { $element->setAfterElementHtml($noStoreError); diff --git a/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Grid.php b/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Grid.php index 740deae50a..45c3a56f90 100644 --- a/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Link.php b/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Link.php index 2d71e09b46..545566c608 100644 --- a/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Link.php +++ b/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Link.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Product/Grid.php b/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Product/Grid.php index 7a184b8bf9..90bdde6fd4 100644 --- a/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Product/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Product/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Selector.php b/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Selector.php index f4515f14f1..38ed646818 100644 --- a/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Selector.php +++ b/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Selector.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget.php b/app/code/core/Mage/Adminhtml/Block/Widget.php index af71632e9a..383a00499a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Accordion.php b/app/code/core/Mage/Adminhtml/Block/Widget/Accordion.php index e746c1bcd4..68ab48fbbf 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Accordion.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Accordion.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Accordion/Item.php b/app/code/core/Mage/Adminhtml/Block/Widget/Accordion/Item.php index bd74b6e2d8..e694b938f3 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Accordion/Item.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Accordion/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Breadcrumbs.php b/app/code/core/Mage/Adminhtml/Block/Widget/Breadcrumbs.php index 720f419568..776e296af7 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Breadcrumbs.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Breadcrumbs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Button.php b/app/code/core/Mage/Adminhtml/Block/Widget/Button.php index 702616bb8d..0bb48a08f5 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Button.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Button.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -56,14 +56,16 @@ protected function _toHtml() $html = $this->getBeforeHtml().''.$this->getAfterHtml(); + . '>' .$this->getLabel().''.$this->getAfterHtml(); return $html; } diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Container.php b/app/code/core/Mage/Adminhtml/Block/Widget/Container.php index 6a46f151aa..d3b8413263 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Container.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Container.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Form.php b/app/code/core/Mage/Adminhtml/Block/Widget/Form.php index f70f3f04f8..a0de4aad47 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -204,9 +204,7 @@ protected function _setFieldset($attributes, $fieldset, $exclude=array()) $element->setCanBeEmpty(true); } else if ($inputType == 'date') { $element->setImage($this->getSkinUrl('images/grid-cal.gif')); - $element->setFormat( - Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT) - ); + $element->setFormat(Mage::app()->getLocale()->getDateFormatWithLongYear()); } else if ($inputType == 'multiline') { $element->setLineCount($attribute->getMultilineCount()); } diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Form/Container.php b/app/code/core/Mage/Adminhtml/Block/Widget/Form/Container.php index 8756f3ffa6..6730a3733d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Form/Container.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Form/Container.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Form/Element.php b/app/code/core/Mage/Adminhtml/Block/Widget/Form/Element.php index 63cc4fe4d5..eedbbe6316 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Form/Element.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Form/Element.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Form/Element/Dependence.php b/app/code/core/Mage/Adminhtml/Block/Widget/Form/Element/Dependence.php index 5f56648ff6..d4d53e750e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Form/Element/Dependence.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Form/Element/Dependence.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -73,8 +73,6 @@ public function addFieldMap($fieldId, $fieldName) /** * Register field name dependence one from each other by specified values * - * @TODO: multiple values per dependency is not implemented. The values OR comparison is anticipated - * * @param string $fieldName * @param string $fieldNameFrom * @param string|array $refValues @@ -82,9 +80,6 @@ public function addFieldMap($fieldId, $fieldName) */ public function addFieldDependence($fieldName, $fieldNameFrom, $refValues) { - if (is_array($refValues)) { - Mage::throwException('Dependency from multiple values is not implemented yet. Please fix to your widget.xml'); - } $this->_depends[$fieldName][$fieldNameFrom] = $refValues; return $this; } diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Form/Element/Gallery.php b/app/code/core/Mage/Adminhtml/Block/Widget/Form/Element/Gallery.php index d476b06dfb..dcec7f966b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Form/Element/Gallery.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Form/Element/Gallery.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Form/Renderer/Element.php b/app/code/core/Mage/Adminhtml/Block/Widget/Form/Renderer/Element.php index 1cceb8e257..7883424759 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Form/Renderer/Element.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Form/Renderer/Element.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Form/Renderer/Fieldset.php b/app/code/core/Mage/Adminhtml/Block/Widget/Form/Renderer/Fieldset.php index 052538072b..e32cd21cca 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Form/Renderer/Fieldset.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Form/Renderer/Fieldset.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Form/Renderer/Fieldset/Element.php b/app/code/core/Mage/Adminhtml/Block/Widget/Form/Renderer/Fieldset/Element.php index b1bd89841a..9e3a39dc6e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Form/Renderer/Fieldset/Element.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Form/Renderer/Fieldset/Element.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php index 7c58ced2f1..915e6dc9a4 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -175,6 +175,13 @@ class Mage_Adminhtml_Block_Widget_Grid extends Mage_Adminhtml_Block_Widget */ protected $_massactionIdField = null; + /** + * Massaction row id filter + * + * @var string + */ + protected $_massactionIdFilter = null; + /** * Massaction block name * @@ -589,11 +596,12 @@ protected function _prepareMassactionColumn() $columnId = 'massaction'; $massactionColumn = $this->getLayout()->createBlock('adminhtml/widget_grid_column') ->setData(array( - 'index' => $this->getMassactionIdField(), - 'type' => 'massaction', - 'name' => $this->getMassactionBlock()->getFormFieldName(), - 'align' => 'center', - 'is_system' => true + 'index' => $this->getMassactionIdField(), + 'filter_index' => $this->getMassactionIdFilter(), + 'type' => 'massaction', + 'name' => $this->getMassactionBlock()->getFormFieldName(), + 'align' => 'center', + 'is_system' => true )); if ($this->getNoFilterMassactionColumn()) { @@ -1287,7 +1295,7 @@ public function getRowId($row) } /** - * Retrive massaction row identifier field + * Retrieve massaction row identifier field * * @return string */ @@ -1308,6 +1316,28 @@ public function setMassactionIdField($idField) return $this; } + /** + * Retrieve massaction row identifier filter + * + * @return string + */ + public function getMassactionIdFilter() + { + return $this->_massactionIdFilter; + } + + /** + * Set massaction row identifier filter + * + * @param string $idFilter + * @return Mage_Adminhtml_Block_Widget_Grid + */ + public function setMassactionIdFilter($idFilter) + { + $this->_massactionIdFilter = $idFilter; + return $this; + } + /** * Retrive massaction block name * diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Block.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Block.php index 89e504a8fd..1b1ee2cf88 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Block.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Block.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column.php index 54d4090a1f..0ef258bf7e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Abstract.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Abstract.php index 9e4d2d0488..c84bfd68a6 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Checkbox.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Checkbox.php index 3b720cf06d..ffa8effd34 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Checkbox.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Checkbox.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Country.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Country.php index 36687851e3..2323bff210 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Country.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Country.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Date.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Date.php index 6d11247607..a25feddcd8 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Date.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Date.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Datetime.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Datetime.php index 082c97f50a..89f4eab90a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Datetime.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Datetime.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Interface.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Interface.php index b50aaed12b..3458a3f62d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Interface.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Massaction.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Massaction.php index ee80e33778..5b25af02bc 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Massaction.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Massaction.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Price.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Price.php index 717bea8b12..845241db95 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Price.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Radio.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Radio.php index fcaeab469e..5ed44ff0cb 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Radio.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Radio.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Range.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Range.php index 2bfa0c40fb..2ca40bb49f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Range.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Range.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Select.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Select.php index 656080838e..1b54ddc9e8 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Select.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Select.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Store.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Store.php index 2e6bd8f5e2..1c0893355e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Store.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Store.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -30,11 +30,17 @@ * * @category Mage * @package Mage_Adminhtml - * @author Magento Core Team + * @author Magento Core Team */ -class Mage_Adminhtml_Block_Widget_Grid_Column_Filter_Store extends Mage_Adminhtml_Block_Widget_Grid_Column_Filter_Abstract +class Mage_Adminhtml_Block_Widget_Grid_Column_Filter_Store + extends Mage_Adminhtml_Block_Widget_Grid_Column_Filter_Abstract { + /** + * Render HTML of the element + * + * @return string + */ public function getHtml() { $storeModel = Mage::getSingleton('adminhtml/system_store'); @@ -45,10 +51,12 @@ public function getHtml() $allShow = $this->getColumn()->getStoreAll(); - $html = 'getColumn()->getValidateClass() . '>'; $value = $this->getColumn()->getValue(); if ($allShow) { - $html .= ''; + $html .= ''; } else { $html .= ''; } @@ -65,14 +73,17 @@ public function getHtml() } if (!$websiteShow) { $websiteShow = true; - $html .= ''; + $html .= ''; } if (!$groupShow) { $groupShow = true; - $html .= ''; + $html .= ''; } $value = $this->getValue(); - $html .= ''; + $selected = $value == $store->getId() ? ' selected="selected"' : ''; + $html .= ''; } if ($groupShow) { $html .= ''; @@ -87,6 +98,11 @@ public function getHtml() return $html; } + /** + * Form condition from element's value + * + * @return array|null + */ public function getCondition() { if (is_null($this->getValue())) { @@ -94,8 +110,7 @@ public function getCondition() } if ($this->getValue() == '_deleted_') { return array('null' => true); - } - else { + } else { return array('eq' => $this->getValue()); } } diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Text.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Text.php index 705fd08f22..533d326fa4 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Text.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Text.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Theme.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Theme.php index c1eed61923..7e48fd4de6 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Theme.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Theme.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Abstract.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Abstract.php index 37b6cf692f..786864e37a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -105,7 +105,6 @@ protected function _getInputValue(Varien_Object $row) public function renderHeader() { - $out = ''; if (false !== $this->getColumn()->getGrid()->getSortable() && false !== $this->getColumn()->getSortable()) { $className = 'not-sort'; $dir = strtolower($this->getColumn()->getDir()); @@ -116,8 +115,7 @@ public function renderHeader() $out = '' . $this->getColumn()->getHeader().''; - } - else { + } else { $out = $this->getColumn()->getHeader(); } return $out; @@ -126,13 +124,6 @@ public function renderHeader() public function renderProperty() { $out = ''; - /** - * Now we generate 2 "col" definition instead span=2 - */ -// if ($this->getColumn()->getEditable() && !$this->getColumn()->getEditOnly()) { -// $out .= ' span="2"'; -// } - $width = $this->_defaultWidth; if ($this->getColumn()->hasData('width')) { diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Action.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Action.php index 5f080fee93..0225342651 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Action.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Action.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -29,9 +29,10 @@ * * @category Mage * @package Mage_Adminhtml - * @author Magento Core Team + * @author Magento Core Team */ -class Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Action extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Text +class Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Action + extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Text { /** @@ -82,7 +83,7 @@ protected function _toOptionHtml($action, Varien_Object $row) $actionCaption = ''; $this->_transformActionData($action, $actionCaption, $row); - $htmlAttibutes = array('value'=>$this->htmlEscape(Mage::helper('core')->jsonEncode($action))); + $htmlAttibutes = array('value'=>$this->escapeHtml(Mage::helper('core')->jsonEncode($action))); $actionAttributes->setData($htmlAttibutes); return ''; } @@ -103,7 +104,7 @@ protected function _toLinkHtml($action, Varien_Object $row) if(isset($action['confirm'])) { $action['onclick'] = 'return window.confirm(\'' - . addslashes($this->htmlEscape($action['confirm'])) + . addslashes($this->escapeHtml($action['confirm'])) . '\')'; unset($action['confirm']); } @@ -122,15 +123,15 @@ protected function _toLinkHtml($action, Varien_Object $row) */ protected function _transformActionData(&$action, &$actionCaption, Varien_Object $row) { - foreach ( $action as $attibute => $value ) { - if(isset($action[$attibute]) && !is_array($action[$attibute])) { - $this->getColumn()->setFormat($action[$attibute]); - $action[$attibute] = parent::render($row); + foreach ( $action as $attribute => $value ) { + if(isset($action[$attribute]) && !is_array($action[$attribute])) { + $this->getColumn()->setFormat($action[$attribute]); + $action[$attribute] = parent::render($row); } else { $this->getColumn()->setFormat(null); } - switch ($attibute) { + switch ($attribute) { case 'caption': $actionCaption = $action['caption']; unset($action['caption']); @@ -151,7 +152,8 @@ protected function _transformActionData(&$action, &$actionCaption, Varien_Object break; case 'popup': - $action['onclick'] = 'popWin(this.href, \'_blank\', \'width=800,height=700,resizable=1,scrollbars=1\');return false;'; + $action['onclick'] = + 'popWin(this.href,\'_blank\',\'width=800,height=700,resizable=1,scrollbars=1\');return false;'; break; } diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Checkbox.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Checkbox.php index 2a71abddfd..7d3861f540 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Checkbox.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Checkbox.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -29,13 +29,19 @@ * * @category Mage * @package Mage_Adminhtml - * @author Magento Core Team + * @author Magento Core Team */ -class Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Checkbox extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract +class Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Checkbox + extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract { protected $_defaultWidth = 55; protected $_values; + /** + * Returns values of the column + * + * @return array + */ public function getValues() { if (is_null($this->_values)) { @@ -79,11 +85,26 @@ public function render(Varien_Object $row) return $this->_getCheckboxHtml($v, $checked); } + /** + * @param string $value Value of the element + * @param bool $checked Whether it is checked + * @return string + */ protected function _getCheckboxHtml($value, $checked) { - return 'getDisabled().'/>'; + $html = 'getColumn()->getFieldName() . '" '; + $html .= 'value="' . $this->escapeHtml($value) . '" '; + $html .= 'class="'. ($this->getColumn()->getInlineCss() ? $this->getColumn()->getInlineCss() : 'checkbox') .'"'; + $html .= $checked . $this->getDisabled() . '/>'; + return $html; } + /** + * Renders header of the column + * + * @return string + */ public function renderHeader() { if($this->getColumn()->getHeader()) { @@ -99,6 +120,11 @@ public function renderHeader() if ($this->getColumn()->getDisabled()) { $disabled = ' disabled="disabled"'; } - return ''; + $html = 'getColumn()->getFieldName() . '" '; + $html .= 'onclick="' . $this->getColumn()->getGrid()->getJsObjectName() . '.checkCheckboxes(this)" '; + $html .= 'class="checkbox"' . $checked . $disabled . ' '; + $html .= 'title="'.Mage::helper('adminhtml')->__('Select All') . '"/>'; + return $html; } } diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Concat.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Concat.php index 02403b06d2..bb1dae1bd0 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Concat.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Concat.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -29,10 +29,11 @@ * * @category Mage * @package Mage_Adminhtml - * @author Magento Core Team + * @author Magento Core Team */ -class Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Concat extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract +class Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Concat + extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract { /** diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Country.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Country.php index 304035ae45..3f76302ef9 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Country.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Country.php @@ -20,16 +20,19 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** * Country column renderer * - * @author Magento Core Team + * @category Mage + * @package Mage_Adminhtml + * @author Magento Core Team */ -class Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Country extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract +class Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Country + extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract { /** * Render country grid column diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Currency.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Currency.php index 26d281102c..f27ec269e4 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Currency.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Currency.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -29,10 +29,11 @@ * * @category Mage * @package Mage_Adminhtml - * @author Magento Core Team + * @author Magento Core Team */ -class Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Currency extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract +class Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Currency + extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract { protected $_defaultWidth = 100; @@ -65,6 +66,12 @@ public function render(Varien_Object $row) return $this->getColumn()->getDefault(); } + /** + * Returns currency code, false on error + * + * @param $row + * @return string|false + */ protected function _getCurrencyCode($row) { if ($code = $this->getColumn()->getCurrencyCode()) { @@ -76,6 +83,12 @@ protected function _getCurrencyCode($row) return false; } + /** + * Get rate for current row, 1 by default + * + * @param $row + * @return float|int + */ protected function _getRate($row) { if ($rate = $this->getColumn()->getRate()) { @@ -87,6 +100,11 @@ protected function _getRate($row) return 1; } + /** + * Returns HTML for CSS + * + * @return string + */ public function renderCss() { return parent::renderCss() . ' a-right'; diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Date.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Date.php index 395401af1d..1d911635e9 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Date.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Date.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -29,10 +29,11 @@ * * @category Mage * @package Mage_Adminhtml - * @author Magento Core Team + * @author Magento Core Team */ -class Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Date extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract +class Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Date + extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract { protected $_defaultWidth = 160; /** @@ -56,7 +57,7 @@ protected function _getFormat() ); } catch (Exception $e) { - + Mage::logException($e); } } $format = self::$_format; @@ -76,15 +77,18 @@ public function render(Varien_Object $row) $format = $this->_getFormat(); try { if($this->getColumn()->getGmtoffset()) { - $data = Mage::app()->getLocale()->date($data, Varien_Date::DATETIME_INTERNAL_FORMAT)->toString($format); + $data = Mage::app()->getLocale() + ->date($data, Varien_Date::DATETIME_INTERNAL_FORMAT)->toString($format); } else { - $data = Mage::getSingleton('core/locale')->date($data, Zend_Date::ISO_8601, null, false)->toString($format); + $data = Mage::getSingleton('core/locale') + ->date($data, Zend_Date::ISO_8601, null, false)->toString($format); } } catch (Exception $e) { if($this->getColumn()->getTimezone()) { - $data = Mage::app()->getLocale()->date($data, Varien_Date::DATETIME_INTERNAL_FORMAT)->toString($format); + $data = Mage::app()->getLocale() + ->date($data, Varien_Date::DATETIME_INTERNAL_FORMAT)->toString($format); } else { $data = Mage::getSingleton('core/locale')->date($data, null, null, false)->toString($format); } diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Datetime.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Datetime.php index 5ed7daeea9..863c0731fc 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Datetime.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Datetime.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -29,10 +29,11 @@ * * @category Mage * @package Mage_Adminhtml - * @author Magento Core Team + * @author Magento Core Team */ -class Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Datetime extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract +class Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Datetime + extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract { /** * Date format string @@ -55,7 +56,7 @@ protected function _getFormat() ); } catch (Exception $e) { - + Mage::logException($e); } } $format = self::$_format; @@ -74,11 +75,13 @@ public function render(Varien_Object $row) if ($data = $this->_getValue($row)) { $format = $this->_getFormat(); try { - $data = Mage::app()->getLocale()->date($data, Varien_Date::DATETIME_INTERNAL_FORMAT)->toString($format); + $data = Mage::app()->getLocale() + ->date($data, Varien_Date::DATETIME_INTERNAL_FORMAT)->toString($format); } catch (Exception $e) { - $data = Mage::app()->getLocale()->date($data, Varien_Date::DATETIME_INTERNAL_FORMAT)->toString($format); + $data = Mage::app()->getLocale() + ->date($data, Varien_Date::DATETIME_INTERNAL_FORMAT)->toString($format); } return $data; } diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Input.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Input.php index b79ebc3fa2..395ecaf20e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Input.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Input.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -29,9 +29,10 @@ * * @category Mage * @package Mage_Adminhtml - * @author Magento Core Team + * @author Magento Core Team */ -class Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Input extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract +class Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Input + extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract { protected $_values; diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Interface.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Interface.php index 9fdfa22ace..baaa488a31 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Interface.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -29,13 +29,26 @@ * * @category Mage * @package Mage_Adminhtml - * @author Magento Core Team + * @author Magento Core Team */ interface Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Interface { + /** + * Set column for renderer + * + * @abstract + * @param $column + * @return void + */ public function setColumn($column); + /** + * Returns row associated with the renderer + * + * @abstract + * @return void + */ public function getColumn(); /** diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Ip.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Ip.php index 34336094c0..d24a31938a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Ip.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Ip.php @@ -20,12 +20,16 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** * Long INT to IP renderer + * + * @category Mage + * @package Mage_Adminhtml + * @author Magento Core Team */ class Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Ip extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Longtext.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Longtext.php index e8c54f58e8..d21a36b145 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Longtext.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Longtext.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -29,9 +29,10 @@ * * @category Mage * @package Mage_Adminhtml - * @author Magento Core Team + * @author Magento Core Team */ -class Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Longtext extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract +class Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Longtext + extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract { /** * Render contents as a long text @@ -40,7 +41,7 @@ class Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Longtext extends Mage_Adm * Also it can be html-escaped and nl2br() * * @param Varien_Object $row - * @return unknown + * @return string */ public function render(Varien_Object $row) { @@ -54,7 +55,7 @@ public function render(Varien_Object $row) } $text = Mage::helper('core/string')->truncate(parent::_getValue($row), $truncateLength); if ($this->getColumn()->getEscape()) { - $text = $this->htmlEscape($text); + $text = $this->escapeHtml($text); } if ($this->getColumn()->getNl2br()) { $text = nl2br($text); diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Massaction.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Massaction.php index 507006e7f6..ea9f3c6531 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Massaction.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Massaction.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -30,17 +30,28 @@ * * @category Mage * @package Mage_Adminhtml - * @author Magento Core Team + * @author Magento Core Team */ -class Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Massaction extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Checkbox +class Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Massaction + extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Checkbox { protected $_defaultWidth = 20; + /** + * Render header of the row + * + * @return string + */ public function renderHeader() { return ' '; } + /** + * Render HTML properties + * + * @return string + */ public function renderProperty() { $out = parent::renderProperty(); @@ -49,18 +60,32 @@ public function renderProperty() return $out; } + /** + * Returns HTML of the object + * + * @param Varien_Object $row + * @return string + */ public function render(Varien_Object $row) { - if ($this->getColumn()->getGrid()->getMassactionIdFieldOnlyIndexValue()){ - $this->setNoObjectId(true); - } + if ($this->getColumn()->getGrid()->getMassactionIdFieldOnlyIndexValue()) { + $this->setNoObjectId(true); + } return parent::render($row); } - // + /** + * Returns HTML of the checkbox + * + * @param string $value + * @param bool $checked + * @return string + */ protected function _getCheckboxHtml($value, $checked) { - return ''; + $html = 'escapeHtml($value) . '" class="massaction-checkbox"' . $checked . '/>'; + return $html; } } diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Number.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Number.php index 93473509b9..5fd161105d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Number.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Number.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -29,13 +29,19 @@ * * @category Mage * @package Mage_Adminhtml - * @author Magento Core Team + * @author Magento Core Team */ - -class Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Number extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract +class Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Number + extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract { protected $_defaultWidth = 100; + /** + * Returns value of the row + * + * @param Varien_Object $row + * @return mixed|string + */ protected function _getValue(Varien_Object $row) { $data = parent::_getValue($row); @@ -50,6 +56,11 @@ protected function _getValue(Varien_Object $row) return $this->getColumn()->getDefault(); } + /** + * Renders CSS + * + * @return string + */ public function renderCss() { return parent::renderCss() . ' a-right'; diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Options.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Options.php index 1a1d984c0b..6c0238bcdc 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Options.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Options.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -29,9 +29,10 @@ * * @category Mage * @package Mage_Adminhtml - * @author Magento Core Team + * @author Magento Core Team */ -class Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Options extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Text +class Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Options + extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Text { /** * Render a grid cell as options @@ -49,19 +50,18 @@ public function render(Varien_Object $row) $res = array(); foreach ($value as $item) { if (isset($options[$item])) { - $res[] = $options[$item]; + $res[] = $this->escapeHtml($options[$item]); } elseif ($showMissingOptionValues) { - $res[] = $item; + $res[] = $this->escapeHtml($item); } } return implode(', ', $res); } elseif (isset($options[$value])) { - return $options[$value]; + return $this->escapeHtml($options[$value]); } elseif (in_array($value, $options)) { - return $value; + return $this->escapeHtml($value); } - return ''; } } } diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Price.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Price.php index abff0f9c9c..c647cf71cc 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Price.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -29,10 +29,10 @@ * * @category Mage * @package Mage_Adminhtml - * @author Magento Core Team + * @author Magento Core Team */ - -class Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Price extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract +class Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Price + extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract { protected $_defaultWidth = 100; /** @@ -63,6 +63,12 @@ public function render(Varien_Object $row) return $this->getColumn()->getDefault(); } + /** + * Returns currency code for the row, false on error + * + * @param Varien_Object $row + * @return string|bool + */ protected function _getCurrencyCode($row) { if ($code = $this->getColumn()->getCurrencyCode()) { @@ -74,6 +80,12 @@ protected function _getCurrencyCode($row) return false; } + /** + * Returns rate for the row, 1 by default + * + * @param Varien_Object $row + * @return float|int + */ protected function _getRate($row) { if ($rate = $this->getColumn()->getRate()) { @@ -85,6 +97,11 @@ protected function _getRate($row) return 1; } + /** + * Renders CSS + * + * @return string + */ public function renderCss() { return parent::renderCss() . ' a-right'; diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Radio.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Radio.php index 6dfd4fe1ff..a14b00768f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Radio.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Radio.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -29,13 +29,19 @@ * * @category Mage * @package Mage_Adminhtml - * @author Magento Core Team + * @author Magento Core Team */ -class Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Radio extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract +class Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Radio + extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract { protected $_defaultWidth = 55; protected $_values; + /** + * Returns all values for the column + * + * @return array + */ public function getValues() { if (is_null($this->_values)) { @@ -55,11 +61,12 @@ public function render(Varien_Object $row) $value = $row->getData($this->getColumn()->getIndex()); if (is_array($values)) { $checked = in_array($value, $values) ? ' checked="checked"' : ''; - } - else { + } else { $checked = ($value === $this->getColumn()->getValue()) ? ' checked="checked"' : ''; } - return ''; + $html = 'getId() . '" class="radio"' . $checked . '/>'; + return $html; } /* diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Select.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Select.php index cf62701875..f63c5dcd39 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Select.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Select.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -29,10 +29,11 @@ * * @category Mage * @package Mage_Adminhtml - * @author Magento Core Team + * @author Magento Core Team */ -class Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Select extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract +class Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Select + extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract { /** @@ -43,11 +44,13 @@ class Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Select extends Mage_Admin */ public function render(Varien_Object $row) { - $html = 'getColumn()->getValidateClass() . '>'; $value = $row->getData($this->getColumn()->getIndex()); foreach ($this->getColumn()->getOptions() as $val => $label){ $selected = ( ($val == $value && (!is_null($value))) ? ' selected="selected"' : '' ); - $html.= ''; + $html .= ''; } $html.=''; return $html; diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Store.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Store.php index 8efbc35ca6..69850cff3c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Store.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Store.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -30,9 +30,10 @@ * * @category Mage * @package Mage_Adminhtml - * @author Magento Core Team + * @author Magento Core Team */ -class Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Store extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract +class Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Store + extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract { protected $_skipAllStoresLabel = false; protected $_skipEmptyStoresLabel = false; @@ -93,7 +94,7 @@ public function render(Varien_Object $row) return $out; } - if (empty($origStores)&& !$skipEmptyStoresLabel) { + if (empty($origStores) && !$skipEmptyStoresLabel) { return ''; } if (!is_array($origStores)) { diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Text.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Text.php index bbf38f1262..691bf7416c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Text.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Text.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -29,10 +29,11 @@ * * @category Mage * @package Mage_Adminhtml - * @author Magento Core Team + * @author Magento Core Team */ -class Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Text extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract +class Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Text + extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract { /** * Format variables pattern @@ -55,18 +56,18 @@ public function _getValue(Varien_Object $row) // If no format and it column not filtered specified return data as is. $data = parent::_getValue($row); $string = is_null($data) ? $defaultValue : $data; - return htmlspecialchars($string); + return $this->escapeHtml($string); } elseif (preg_match_all($this->_variablePattern, $format, $matches)) { // Parsing of format string - $formatedString = $format; + $formattedString = $format; foreach ($matches[0] as $matchIndex=>$match) { $value = $row->getData($matches[1][$matchIndex]); - $formatedString = str_replace($match, $value, $formatedString); + $formattedString = str_replace($match, $value, $formattedString); } - return $formatedString; + return $formattedString; } else { - return htmlspecialchars($format); + return $this->escapeHtml($format); } } } diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Theme.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Theme.php index 8cbc546f31..85d2a882e8 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Theme.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Theme.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -31,7 +31,8 @@ * @package Mage_Adminhtml * @author Magento Core Team */ -class Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Theme extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract +class Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Theme + extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract { /** * Renders grid column @@ -47,7 +48,7 @@ public function render(Varien_Object $row) $value = 'all'; } - return $this->_getValueLabel($options, $value); + return $this->escapeHtml($this->_getValueLabel($options, $value)); } /** diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Wrapline.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Wrapline.php index 36cf3bbb6c..e593b17820 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Wrapline.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Wrapline.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -29,9 +29,10 @@ * * @category Mage * @package Mage_Adminhtml + * @author Magento Core Team */ - -class Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Wrapline extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract +class Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Wrapline + extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract { /** * Default max length of a line at one row @@ -50,9 +51,11 @@ public function render(Varien_Object $row) { $line = parent::_getValue($row); $wrappedLine = ''; - $lineLength = ($this->getColumn()->getData('lineLength')?$this->getColumn()->getData('lineLength'):$this->_defaultMaxLineLength); - for($i=0, $n=floor(Mage::helper('core/string')->strlen($line)/$lineLength); $i<=$n; $i++) { - $wrappedLine .= Mage::helper('core/string')->substr($line, ($lineLength*$i), $lineLength)."
    "; + $lineLength = $this->getColumn()->getData('lineLength') + ? $this->getColumn()->getData('lineLength') + : $this->_defaultMaxLineLength; + for($i = 0, $n = floor(Mage::helper('core/string')->strlen($line) / $lineLength); $i <= $n; $i++) { + $wrappedLine .= Mage::helper('core/string')->substr($line, ($lineLength * $i), $lineLength) . "
    "; } return $wrappedLine; } diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Container.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Container.php index 7835ae7c65..dae7990d4a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Container.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Container.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Massaction.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Massaction.php index ff8b246b07..51a2db9cb4 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Massaction.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Massaction.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Massaction/Abstract.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Massaction/Abstract.php index 7b794e8fb2..974d53cebb 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Massaction/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Massaction/Abstract.php @@ -20,13 +20,15 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** * Grid widget massaction block * + * @method Mage_Sales_Model_Quote setHideFormElement(boolean $value) Hide Form element to prevent IE errors + * @method boolean getHideFormElement() * @category Mage * @package Mage_Adminhtml * @author Magento Core Team @@ -40,6 +42,9 @@ abstract class Mage_Adminhtml_Block_Widget_Grid_Massaction_Abstract extends Mage */ protected $_items = array(); + /** + * Sets Massaction template + */ public function __construct() { parent::__construct(); @@ -187,10 +192,8 @@ public function getSelectedJson() if($selected = $this->getRequest()->getParam($this->getFormFieldNameInternal())) { $selected = explode(',', $selected); return join(',', $selected); -// return Mage::helper('core')->jsonEncode($selected); } else { return ''; -// return '[]'; } } @@ -221,13 +224,14 @@ public function getApplyButtonHtml() public function getJavaScript() { - return " - var {$this->getJsObjectName()} = new varienGridMassaction('{$this->getHtmlId()}', {$this->getGridJsObjectName()}, '{$this->getSelectedJson()}', '{$this->getFormFieldNameInternal()}', '{$this->getFormFieldName()}'); - {$this->getJsObjectName()}.setItems({$this->getItemsJson()}); - {$this->getJsObjectName()}.setGridIds('{$this->getGridIdsJson()}'); - ". ($this->getUseAjax() ? "{$this->getJsObjectName()}.setUseAjax(true);" : '') . " - ". ($this->getUseSelectAll() ? "{$this->getJsObjectName()}.setUseSelectAll(true);" : '') . - "{$this->getJsObjectName()}.errorText = '{$this->getErrorText()}';"; + return " var {$this->getJsObjectName()} = new varienGridMassaction('{$this->getHtmlId()}', " + . "{$this->getGridJsObjectName()}, '{$this->getSelectedJson()}'" + . ", '{$this->getFormFieldNameInternal()}', '{$this->getFormFieldName()}');" + . "{$this->getJsObjectName()}.setItems({$this->getItemsJson()}); " + . "{$this->getJsObjectName()}.setGridIds('{$this->getGridIdsJson()}');" + . ($this->getUseAjax() ? "{$this->getJsObjectName()}.setUseAjax(true);" : '') + . ($this->getUseSelectAll() ? "{$this->getJsObjectName()}.setUseSelectAll(true);" : '') + . "{$this->getJsObjectName()}.errorText = '{$this->getErrorText()}';"; } public function getGridIdsJson() @@ -240,10 +244,8 @@ public function getGridIdsJson() if(!empty($gridIds)) { return join(",", $gridIds); - //return Mage::helper('core')->jsonEncode($gridIds); } return ''; - //return '[]'; } public function getHtmlId() @@ -288,4 +290,3 @@ public function setUseSelectAll($flag) return $this; } } - // Class Mage_Adminhtml_Block_Widget_Grid_Massaction_Abstract End diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Massaction/Item.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Massaction/Item.php index d472af91a5..28a6d25fd2 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Massaction/Item.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Massaction/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Massaction/Item/Additional/Default.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Massaction/Item/Additional/Default.php index e6042f8bf8..f6a27990c4 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Massaction/Item/Additional/Default.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Massaction/Item/Additional/Default.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Massaction/Item/Additional/Interface.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Massaction/Item/Additional/Interface.php index d07a8dd253..222c39f82c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Massaction/Item/Additional/Interface.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Massaction/Item/Additional/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Serializer.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Serializer.php index 245f14c9d5..4719093753 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Serializer.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Serializer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Tab/Interface.php b/app/code/core/Mage/Adminhtml/Block/Widget/Tab/Interface.php index a11b346b7b..716b4173a1 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Tab/Interface.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Tab/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Tabs.php b/app/code/core/Mage/Adminhtml/Block/Widget/Tabs.php index af252a0bb5..db804f336c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Tabs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Tree.php b/app/code/core/Mage/Adminhtml/Block/Widget/Tree.php index 52a15bcc0f..7b64855371 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Tree.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Tree.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/View/Container.php b/app/code/core/Mage/Adminhtml/Block/Widget/View/Container.php index 2969baa413..5965bb10e7 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/View/Container.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/View/Container.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Controller/Action.php b/app/code/core/Mage/Adminhtml/Controller/Action.php index cf716278a1..b569f12921 100644 --- a/app/code/core/Mage/Adminhtml/Controller/Action.php +++ b/app/code/core/Mage/Adminhtml/Controller/Action.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -33,8 +33,16 @@ */ class Mage_Adminhtml_Controller_Action extends Mage_Core_Controller_Varien_Action { + /** + * Name of "is URLs checked" flag + */ const FLAG_IS_URLS_CHECKED = 'check_url_settings'; + /** + * Session namespace to refer in other places + */ + const SESSION_NAMESPACE = 'adminhtml'; + /** * Array of actions which can be processed without secret key validation * @@ -59,7 +67,7 @@ class Mage_Adminhtml_Controller_Action extends Mage_Core_Controller_Varien_Actio * * @var string */ - protected $_sessionNamespace = 'adminhtml'; + protected $_sessionNamespace = self::SESSION_NAMESPACE; protected function _isAllowed() { @@ -213,8 +221,12 @@ protected function _checkUrlSettings() $configData = Mage::getModel('core/config_data'); - $defaultUnsecure= (string) Mage::getConfig()->getNode('default/'.Mage_Core_Model_Store::XML_PATH_UNSECURE_BASE_URL); - $defaultSecure = (string) Mage::getConfig()->getNode('default/'.Mage_Core_Model_Store::XML_PATH_SECURE_BASE_URL); + $defaultUnsecure = (string)Mage::getConfig()->getNode( + 'default/' . Mage_Core_Model_Store::XML_PATH_UNSECURE_BASE_URL + ); + $defaultSecure = (string)Mage::getConfig()->getNode( + 'default/' . Mage_Core_Model_Store::XML_PATH_SECURE_BASE_URL + ); if ($defaultSecure == '{{base_url}}' || $defaultUnsecure == '{{base_url}}') { $this->_getSession()->addNotice( diff --git a/app/code/core/Mage/Adminhtml/Controller/Report/Abstract.php b/app/code/core/Mage/Adminhtml/Controller/Report/Abstract.php index 598a5f5512..41bdd3b2c9 100644 --- a/app/code/core/Mage/Adminhtml/Controller/Report/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Controller/Report/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Controller/Sales/Creditmemo.php b/app/code/core/Mage/Adminhtml/Controller/Sales/Creditmemo.php index 1f0fb53b67..354dd77cbb 100644 --- a/app/code/core/Mage/Adminhtml/Controller/Sales/Creditmemo.php +++ b/app/code/core/Mage/Adminhtml/Controller/Sales/Creditmemo.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Controller/Sales/Invoice.php b/app/code/core/Mage/Adminhtml/Controller/Sales/Invoice.php index b884ba4dd0..b74c604e1d 100644 --- a/app/code/core/Mage/Adminhtml/Controller/Sales/Invoice.php +++ b/app/code/core/Mage/Adminhtml/Controller/Sales/Invoice.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Controller/Sales/Shipment.php b/app/code/core/Mage/Adminhtml/Controller/Sales/Shipment.php index 22eecfa699..861005e53a 100644 --- a/app/code/core/Mage/Adminhtml/Controller/Sales/Shipment.php +++ b/app/code/core/Mage/Adminhtml/Controller/Sales/Shipment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Exception.php b/app/code/core/Mage/Adminhtml/Exception.php index aec29c1ea2..62a57f0379 100644 --- a/app/code/core/Mage/Adminhtml/Exception.php +++ b/app/code/core/Mage/Adminhtml/Exception.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Helper/Addresses.php b/app/code/core/Mage/Adminhtml/Helper/Addresses.php index 6ccfb65b63..bd9225aebf 100644 --- a/app/code/core/Mage/Adminhtml/Helper/Addresses.php +++ b/app/code/core/Mage/Adminhtml/Helper/Addresses.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Helper/Catalog.php b/app/code/core/Mage/Adminhtml/Helper/Catalog.php index b428d9816b..f0cd183a54 100644 --- a/app/code/core/Mage/Adminhtml/Helper/Catalog.php +++ b/app/code/core/Mage/Adminhtml/Helper/Catalog.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Helper/Catalog/Product/Composite.php b/app/code/core/Mage/Adminhtml/Helper/Catalog/Product/Composite.php index 87ff988638..3fb0bf2f19 100644 --- a/app/code/core/Mage/Adminhtml/Helper/Catalog/Product/Composite.php +++ b/app/code/core/Mage/Adminhtml/Helper/Catalog/Product/Composite.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Helper/Catalog/Product/Edit/Action/Attribute.php b/app/code/core/Mage/Adminhtml/Helper/Catalog/Product/Edit/Action/Attribute.php index 0c447dbcd6..ef2e758064 100644 --- a/app/code/core/Mage/Adminhtml/Helper/Catalog/Product/Edit/Action/Attribute.php +++ b/app/code/core/Mage/Adminhtml/Helper/Catalog/Product/Edit/Action/Attribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Helper/Dashboard/Abstract.php b/app/code/core/Mage/Adminhtml/Helper/Dashboard/Abstract.php index 7b851d3e7a..66c59d0e40 100644 --- a/app/code/core/Mage/Adminhtml/Helper/Dashboard/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Helper/Dashboard/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Helper/Dashboard/Data.php b/app/code/core/Mage/Adminhtml/Helper/Dashboard/Data.php index d395d20a49..6119ac7c2a 100644 --- a/app/code/core/Mage/Adminhtml/Helper/Dashboard/Data.php +++ b/app/code/core/Mage/Adminhtml/Helper/Dashboard/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Helper/Dashboard/Order.php b/app/code/core/Mage/Adminhtml/Helper/Dashboard/Order.php index 6789c69855..e226d4eeb1 100644 --- a/app/code/core/Mage/Adminhtml/Helper/Dashboard/Order.php +++ b/app/code/core/Mage/Adminhtml/Helper/Dashboard/Order.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Helper/Data.php b/app/code/core/Mage/Adminhtml/Helper/Data.php index 0db41a94c6..31744a3994 100644 --- a/app/code/core/Mage/Adminhtml/Helper/Data.php +++ b/app/code/core/Mage/Adminhtml/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Helper/Js.php b/app/code/core/Mage/Adminhtml/Helper/Js.php index e3ddc85c74..9b30e7f8e6 100644 --- a/app/code/core/Mage/Adminhtml/Helper/Js.php +++ b/app/code/core/Mage/Adminhtml/Helper/Js.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Helper/Media/Js.php b/app/code/core/Mage/Adminhtml/Helper/Media/Js.php index 9e274513c1..523da5baca 100644 --- a/app/code/core/Mage/Adminhtml/Helper/Media/Js.php +++ b/app/code/core/Mage/Adminhtml/Helper/Media/Js.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -28,9 +28,10 @@ /** * Media library js helper * + * @deprecated since 1.7.0.0 * @category Mage * @package Mage_Adminhtml - * @author Magento Core Team + * @author Magento Core Team */ class Mage_Adminhtml_Helper_Media_Js extends Mage_Core_Helper_Js { diff --git a/app/code/core/Mage/Adminhtml/Helper/Rss.php b/app/code/core/Mage/Adminhtml/Helper/Rss.php index 1fb9b924ac..a020cc2da2 100644 --- a/app/code/core/Mage/Adminhtml/Helper/Rss.php +++ b/app/code/core/Mage/Adminhtml/Helper/Rss.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Helper/Sales.php b/app/code/core/Mage/Adminhtml/Helper/Sales.php index ea23e9312b..f80cbd1b84 100644 --- a/app/code/core/Mage/Adminhtml/Helper/Sales.php +++ b/app/code/core/Mage/Adminhtml/Helper/Sales.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/Config.php b/app/code/core/Mage/Adminhtml/Model/Config.php index c26edb9c83..a083219701 100644 --- a/app/code/core/Mage/Adminhtml/Model/Config.php +++ b/app/code/core/Mage/Adminhtml/Model/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/Config/Data.php b/app/code/core/Mage/Adminhtml/Model/Config/Data.php index d28d0f7546..43f8a06b8a 100644 --- a/app/code/core/Mage/Adminhtml/Model/Config/Data.php +++ b/app/code/core/Mage/Adminhtml/Model/Config/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -45,6 +45,8 @@ public function save() $this->_validate(); $this->_getScope(); + Mage::dispatchEvent('model_config_data_save_before', array('object' => $this)); + $section = $this->getSection(); $website = $this->getWebsite(); $store = $this->getStore(); diff --git a/app/code/core/Mage/Adminhtml/Model/Customer/Renderer/Region.php b/app/code/core/Mage/Adminhtml/Model/Customer/Renderer/Region.php index 7380416424..7f20e0013e 100644 --- a/app/code/core/Mage/Adminhtml/Model/Customer/Renderer/Region.php +++ b/app/code/core/Mage/Adminhtml/Model/Customer/Renderer/Region.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/Email/Template.php b/app/code/core/Mage/Adminhtml/Model/Email/Template.php index e0d5034a93..8be9b26551 100644 --- a/app/code/core/Mage/Adminhtml/Model/Email/Template.php +++ b/app/code/core/Mage/Adminhtml/Model/Email/Template.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/Extension.php b/app/code/core/Mage/Adminhtml/Model/Extension.php index ffbdd1204e..959b667569 100644 --- a/app/code/core/Mage/Adminhtml/Model/Extension.php +++ b/app/code/core/Mage/Adminhtml/Model/Extension.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/Giftmessage/Save.php b/app/code/core/Mage/Adminhtml/Model/Giftmessage/Save.php index 77116dea28..c3fe1aa977 100644 --- a/app/code/core/Mage/Adminhtml/Model/Giftmessage/Save.php +++ b/app/code/core/Mage/Adminhtml/Model/Giftmessage/Save.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/LayoutUpdate/Validator.php b/app/code/core/Mage/Adminhtml/Model/LayoutUpdate/Validator.php index d9486353c2..cada0ebcf4 100644 --- a/app/code/core/Mage/Adminhtml/Model/LayoutUpdate/Validator.php +++ b/app/code/core/Mage/Adminhtml/Model/LayoutUpdate/Validator.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/Newsletter/Renderer/Text.php b/app/code/core/Mage/Adminhtml/Model/Newsletter/Renderer/Text.php index 06aef2f20b..b679b993c9 100644 --- a/app/code/core/Mage/Adminhtml/Model/Newsletter/Renderer/Text.php +++ b/app/code/core/Mage/Adminhtml/Model/Newsletter/Renderer/Text.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/Observer.php b/app/code/core/Mage/Adminhtml/Model/Observer.php index ac7c083f0e..1d6c3e6785 100644 --- a/app/code/core/Mage/Adminhtml/Model/Observer.php +++ b/app/code/core/Mage/Adminhtml/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/Report/Item.php b/app/code/core/Mage/Adminhtml/Model/Report/Item.php index 8bd7756813..44b86db696 100644 --- a/app/code/core/Mage/Adminhtml/Model/Report/Item.php +++ b/app/code/core/Mage/Adminhtml/Model/Report/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Adminhtml_Model_Report_Item extends Varien_Object diff --git a/app/code/core/Mage/Adminhtml/Model/Sales/Order.php b/app/code/core/Mage/Adminhtml/Model/Sales/Order.php index 194d99415c..77230a55a8 100644 --- a/app/code/core/Mage/Adminhtml/Model/Sales/Order.php +++ b/app/code/core/Mage/Adminhtml/Model/Sales/Order.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php b/app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php index f34da5e269..48ef1463ea 100644 --- a/app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php +++ b/app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -32,7 +32,7 @@ * @package Mage_Adminhtml * @author Magento Core Team */ -class Mage_Adminhtml_Model_Sales_Order_Create extends Varien_Object +class Mage_Adminhtml_Model_Sales_Order_Create extends Varien_Object implements Mage_Checkout_Model_Cart_Interface { /** * Quote session object @@ -111,6 +111,13 @@ class Mage_Adminhtml_Model_Sales_Order_Create extends Varien_Object */ protected $_errors = array(); + /** + * Quote associated with the model + * + * @var Mage_Sales_Model_Quote + */ + protected $_quote; + public function __construct() { $this->_session = Mage::getSingleton('adminhtml/session_quote'); @@ -233,7 +240,22 @@ public function getSession() */ public function getQuote() { - return $this->getSession()->getQuote(); + if (!$this->_quote) { + $this->_quote = $this->getSession()->getQuote(); + } + return $this->_quote; + } + + /** + * Set quote object + * + * @param Mage_Sales_Model_Quote $quote + * @return Mage_Adminhtml_Model_Sales_Order_Create + */ + public function setQuote(Mage_Sales_Model_Quote $quote) + { + $this->_quote = $quote; + return $this; } /** @@ -510,7 +532,8 @@ public function moveQuoteItem($item, $moveTo, $qty) $item = $this->_getQuoteItem($item); if ($item) { $removeItem = false; - switch ($moveTo) { + $moveTo = explode('_', $moveTo); + switch ($moveTo[0]) { case 'order': $info = $item->getBuyRequest(); $info->setOptions($this->_prepareOptionsForRequest($item)) @@ -563,8 +586,27 @@ public function moveQuoteItem($item, $moveTo, $qty) } break; case 'wishlist': - $wishlist = $this->getCustomerWishlist(); - if ($wishlist && $item->getProduct()->isVisibleInSiteVisibility()) { + $wishlist = null; + if (!isset($moveTo[1])) { + $wishlist = Mage::getModel('wishlist/wishlist')->loadByCustomer( + $this->getSession()->getCustomer(), + true + ); + } else { + $wishlist = Mage::getModel('wishlist/wishlist')->load($moveTo[1]); + if (!$wishlist->getId() + || $wishlist->getCustomerId() != $this->getSession()->getCustomerId() + ) { + $wishlist = null; + } + } + if (!$wishlist) { + Mage::throwException(Mage::helper('wishlist')->__('Could not find wishlist')); + } + $wishlist->setStore($this->getSession()->getStore()) + ->setSharedStoreIds($this->getSession()->getStore()->getWebsite()->getStoreIds()); + + if ($wishlist->getId() && $item->getProduct()->isVisibleInSiteVisibility()) { $info = $item->getBuyRequest(); $info->setOptions($this->_prepareOptionsForRequest($item)) ->setQty($qty) diff --git a/app/code/core/Mage/Adminhtml/Model/Sales/Order/Random.php b/app/code/core/Mage/Adminhtml/Model/Sales/Order/Random.php index 2ad4968e9b..65350fd3a5 100644 --- a/app/code/core/Mage/Adminhtml/Model/Sales/Order/Random.php +++ b/app/code/core/Mage/Adminhtml/Model/Sales/Order/Random.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/Search/Catalog.php b/app/code/core/Mage/Adminhtml/Model/Search/Catalog.php index c9bc80defa..be635dbad5 100644 --- a/app/code/core/Mage/Adminhtml/Model/Search/Catalog.php +++ b/app/code/core/Mage/Adminhtml/Model/Search/Catalog.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/Search/Customer.php b/app/code/core/Mage/Adminhtml/Model/Search/Customer.php index a0664cc8a8..d90a52479d 100644 --- a/app/code/core/Mage/Adminhtml/Model/Search/Customer.php +++ b/app/code/core/Mage/Adminhtml/Model/Search/Customer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/Search/Order.php b/app/code/core/Mage/Adminhtml/Model/Search/Order.php index a4920502f1..4079877ab8 100644 --- a/app/code/core/Mage/Adminhtml/Model/Search/Order.php +++ b/app/code/core/Mage/Adminhtml/Model/Search/Order.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/Session.php b/app/code/core/Mage/Adminhtml/Model/Session.php index 401136d239..7ebb30e7ad 100644 --- a/app/code/core/Mage/Adminhtml/Model/Session.php +++ b/app/code/core/Mage/Adminhtml/Model/Session.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/Session/Quote.php b/app/code/core/Mage/Adminhtml/Model/Session/Quote.php index 0d5d0854c3..969e81be05 100644 --- a/app/code/core/Mage/Adminhtml/Model/Session/Quote.php +++ b/app/code/core/Mage/Adminhtml/Model/Session/Quote.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Custom.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Custom.php index 57a4a5fee5..36c769f43a 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Custom.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Custom.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -86,17 +86,6 @@ public function _afterSave() self::CONFIG_SCOPE, self::CONFIG_SCOPE_ID ); - } else { - Mage::getConfig()->deleteConfig( - self::XML_PATH_SECURE_BASE_URL, - self::CONFIG_SCOPE, - self::CONFIG_SCOPE_ID - ); - Mage::getConfig()->deleteConfig( - self::XML_PATH_UNSECURE_BASE_URL, - self::CONFIG_SCOPE, - self::CONFIG_SCOPE_ID - ); } return $this; diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Custompath.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Custompath.php index 5c02fa82b4..e147553917 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Custompath.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Custompath.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Observer.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Observer.php index e1d497bc27..75e9b3323f 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Observer.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Password/Link/Expirationperiod.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Password/Link/Expirationperiod.php index c0b48d180a..55d59675fe 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Password/Link/Expirationperiod.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Password/Link/Expirationperiod.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -42,12 +42,12 @@ class Mage_Adminhtml_Model_System_Config_Backend_Admin_Password_Link_Expirationp protected function _beforeSave() { parent::_beforeSave(); - $resetPasswordLinkExpirationPeriod = (int) $this->getValue(); - // This value must be greater than 0 + $resetPasswordLinkExpirationPeriod = (int)$this->getValue(); + if ($resetPasswordLinkExpirationPeriod < 1) { - $resetPasswordLinkExpirationPeriod = (int) $this->getOldValue(); + $resetPasswordLinkExpirationPeriod = (int)$this->getOldValue(); } - $this->setValue((string) $resetPasswordLinkExpirationPeriod); + $this->setValue((string)$resetPasswordLinkExpirationPeriod); return $this; } } diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Usecustom.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Usecustom.php index 5650064ce1..5e1c6c481b 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Usecustom.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Usecustom.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -51,4 +51,29 @@ protected function _beforeSave() return $this; } + + /** + * Delete custom admin url from configuration if "Use Custom Admin Url" option disabled + * + * @return Mage_Adminhtml_Model_System_Config_Backend_Admin_Usecustom + */ + protected function _afterSave() + { + $value = $this->getValue(); + + if (!$value) { + Mage::getConfig()->deleteConfig( + Mage_Adminhtml_Model_System_Config_Backend_Admin_Custom::XML_PATH_SECURE_BASE_URL, + Mage_Adminhtml_Model_System_Config_Backend_Admin_Custom::CONFIG_SCOPE, + Mage_Adminhtml_Model_System_Config_Backend_Admin_Custom::CONFIG_SCOPE_ID + ); + Mage::getConfig()->deleteConfig( + Mage_Adminhtml_Model_System_Config_Backend_Admin_Custom::XML_PATH_UNSECURE_BASE_URL, + Mage_Adminhtml_Model_System_Config_Backend_Admin_Custom::CONFIG_SCOPE, + Mage_Adminhtml_Model_System_Config_Backend_Admin_Custom::CONFIG_SCOPE_ID + ); + } + + return $this; + } } diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Usecustompath.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Usecustompath.php index 5b5040bd18..bcdcc7e0b4 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Usecustompath.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Usecustompath.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Usesecretkey.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Usesecretkey.php index dea21e90c6..4e3d701fbc 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Usesecretkey.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Usesecretkey.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Baseurl.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Baseurl.php index 6b4e96bedf..9e2563a0e1 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Baseurl.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Baseurl.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Cache.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Cache.php index 6a3204fc5f..f9f6af5e63 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Cache.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Cache.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Catalog/Inventory/Managestock.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Catalog/Inventory/Managestock.php index b7a82f5e56..43bc48707a 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Catalog/Inventory/Managestock.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Catalog/Inventory/Managestock.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Catalog/Search/Type.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Catalog/Search/Type.php index ac12f2452f..743ee9fdd3 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Catalog/Search/Type.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Catalog/Search/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Category.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Category.php index 445cb47262..71213d618a 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Category.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Category.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Currency/Abstract.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Currency/Abstract.php index 25c14e4b3b..c8e8deabf3 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Currency/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Currency/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Currency/Allow.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Currency/Allow.php index 39b39edb08..f7225170b8 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Currency/Allow.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Currency/Allow.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Currency/Base.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Currency/Base.php index 1fe2460808..59208878a3 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Currency/Base.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Currency/Base.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Currency/Cron.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Currency/Cron.php index 2b39e13b9d..c3e359b5a3 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Currency/Cron.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Currency/Cron.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Currency/Default.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Currency/Default.php index 1cfea0d350..61bc5aefe7 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Currency/Default.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Currency/Default.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Customer/Address/Street.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Customer/Address/Street.php index 67d180afd0..a07c8503ee 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Customer/Address/Street.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Customer/Address/Street.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Customer/GroupAutoAssign.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Customer/GroupAutoAssign.php index b2c7c22d26..84c37fe375 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Customer/GroupAutoAssign.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Customer/GroupAutoAssign.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Customer/Password/Link/Expirationperiod.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Customer/Password/Link/Expirationperiod.php index c64ddee4d1..3b07d81356 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Customer/Password/Link/Expirationperiod.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Customer/Password/Link/Expirationperiod.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -43,12 +43,12 @@ class Mage_Adminhtml_Model_System_Config_Backend_Customer_Password_Link_Expirati protected function _beforeSave() { parent::_beforeSave(); - $resetPasswordLinkExpirationPeriod = (int) $this->getValue(); - // This value must be greater than 0 + $resetPasswordLinkExpirationPeriod = (int)$this->getValue(); + if ($resetPasswordLinkExpirationPeriod < 1) { - $resetPasswordLinkExpirationPeriod = (int) $this->getOldValue(); + $resetPasswordLinkExpirationPeriod = (int)$this->getOldValue(); } - $this->setValue((string) $resetPasswordLinkExpirationPeriod); + $this->setValue((string)$resetPasswordLinkExpirationPeriod); return $this; } } diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Customer/Show/Address.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Customer/Show/Address.php index 91f55f9d9a..e6e8ff5cef 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Customer/Show/Address.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Customer/Show/Address.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Customer/Show/Customer.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Customer/Show/Customer.php index dc330f4235..b5fecf0ddb 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Customer/Show/Customer.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Customer/Show/Customer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Datashare.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Datashare.php index 42430935f1..7c472a0b7a 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Datashare.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Datashare.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Design/Exception.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Design/Exception.php index 21c08ca4b0..a1648d1c03 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Design/Exception.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Design/Exception.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Design/Package.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Design/Package.php index 35f6adbf2d..bb2b9206ed 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Design/Package.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Design/Package.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Email/Address.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Email/Address.php index f98d75871c..ced3a36960 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Email/Address.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Email/Address.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Email/Logo.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Email/Logo.php new file mode 100644 index 0000000000..a02a2f024f --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Email/Logo.php @@ -0,0 +1,92 @@ + + */ +class Mage_Adminhtml_Model_System_Config_Backend_Email_Logo extends Mage_Adminhtml_Model_System_Config_Backend_Image +{ + /** + * The tail part of directory path for uploading + */ + const UPLOAD_DIR = 'email/logo'; + + /** + * Token for the root part of directory path for uploading + */ + const UPLOAD_ROOT_TOKEN = 'system/filesystem/media'; + + /** + * Upload max file size in kilobytes + * + * @var int + */ + protected $_maxFileSize = 2048; + + /** + * Return path to directory for upload file + * + * @return string + */ + protected function _getUploadDir() + { + $uploadDir = $this->_appendScopeInfo(self::UPLOAD_DIR); + $uploadRoot = $this->_getUploadRoot(self::UPLOAD_ROOT_TOKEN); + $uploadDir = $uploadRoot . DS . $uploadDir; + return $uploadDir; + } + + /** + * Makes a decision about whether to add info about the scope + * + * @return boolean + */ + protected function _addWhetherScopeInfo() + { + return true; + } + + /** + * Save uploaded file before saving config value + * + * Save changes and delete file if "delete" option passed + * + * @return Mage_Adminhtml_Model_System_Config_Backend_Email_logo + */ + protected function _beforeSave() + { + $value = $this->getValue(); + if (is_array($value) && !empty($value['delete'])) { + $io = new Varien_Io_File(); + $io->rm($this->_getUploadRoot(self::UPLOAD_ROOT_TOKEN) . DS . self::UPLOAD_DIR . DS . $value['value']); + } + return parent::_beforeSave(); + } +} diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Email/Sender.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Email/Sender.php index 345fc0766c..5b8e8b432c 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Email/Sender.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Email/Sender.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Encrypted.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Encrypted.php index 56f3c3d3e9..f971146c29 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Encrypted.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Encrypted.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/File.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/File.php index a27d8b2f98..df8607c06d 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/File.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/File.php @@ -20,11 +20,10 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - /** * System config file field backend model * @@ -34,6 +33,12 @@ */ class Mage_Adminhtml_Model_System_Config_Backend_File extends Mage_Core_Model_Config_Data { + /** + * Upload max file size in kilobytes + * + * @var int + */ + protected $_maxFileSize = 0; /** * Save uploaded file before saving config value @@ -60,6 +65,7 @@ protected function _beforeSave() $uploader = new Mage_Core_Model_File_Uploader($file); $uploader->setAllowedExtensions($this->_getAllowedExtensions()); $uploader->setAllowRenameFiles(true); + $uploader->addValidateCallback('size', $this, 'validateMaxSize'); $result = $uploader->save($uploadDir); } catch (Exception $e) { @@ -79,6 +85,19 @@ protected function _beforeSave() return $this; } + /** + * Validation callback for checking max file size + * + * @param string $filePath Path to temporary uploaded file + * @throws Mage_Core_Exception + */ + public function validateMaxSize($filePath) + { + if ($this->_maxFileSize > 0 && filesize($filePath) > ($this->_maxFileSize * 1024)) { + throw Mage::exception('Mage_Core', Mage::helper('adminhtml')->__('Uploaded file is larger than %.2f kilobytes allowed by server', $this->_maxFileSize)); + } + } + /** * Makes a decision about whether to add info about the scope. * diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Filename.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Filename.php index 95a11f853a..83a0c76ccb 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Filename.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Filename.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Image.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Image.php index ad148be31c..02c402377c 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Image.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Image.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Image/Favicon.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Image/Favicon.php index dfa5d057e5..a5621168a9 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Image/Favicon.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Image/Favicon.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -77,7 +77,7 @@ protected function _addWhetherScopeInfo() */ protected function _getAllowedExtensions() { - return array('ico', 'png', 'gif', 'jpeg', 'apng', 'svg'); + return array('ico', 'png', 'gif', 'jpg', 'jpeg', 'apng', 'svg'); } /** diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Image/Pdf.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Image/Pdf.php index f393bd4d2a..575dffbb0c 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Image/Pdf.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Image/Pdf.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Layer/Children.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Layer/Children.php index 0209e30db2..005643e5ee 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Layer/Children.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Layer/Children.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Locale.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Locale.php index bf230e8af3..19ee8d6d79 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Locale.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Locale.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Locale/Timezone.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Locale/Timezone.php index b13a692c64..4c8e7951ea 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Locale/Timezone.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Locale/Timezone.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -34,9 +34,22 @@ */ class Mage_Adminhtml_Model_System_Config_Backend_Locale_Timezone extends Mage_Core_Model_Config_Data { + /** + * Const for PHP 5.3+ compatibility + * This value copied from DateTimeZone::ALL_WITH_BC in PHP 5.3+ + * + * @constant ALL_WITH_BC + */ + const ALL_WITH_BC = 4095; + protected function _beforeSave() { - if (!in_array($this->getValue(), DateTimeZone::listIdentifiers())) { + $allWithBc = self::ALL_WITH_BC; + if (defined('DateTimeZone::ALL_WITH_BC')) { + $allWithBc = DateTimeZone::ALL_WITH_BC; + } + + if (!in_array($this->getValue(), DateTimeZone::listIdentifiers($allWithBc))) { Mage::throwException(Mage::helper('adminhtml')->__('Invalid timezone')); } diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Log/Cron.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Log/Cron.php index 887055c126..b41013def2 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Log/Cron.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Log/Cron.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Price/Scope.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Price/Scope.php index d627818b58..3c22b87e92 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Price/Scope.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Price/Scope.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Product/Alert/Cron.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Product/Alert/Cron.php index 13b157f6cb..edafc7dad8 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Product/Alert/Cron.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Product/Alert/Cron.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Secure.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Secure.php index ad1ffcfda8..7f668bd351 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Secure.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Secure.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Seo/Product.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Seo/Product.php index 540c9e24c1..9a1165a468 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Seo/Product.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Seo/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Serialized.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Serialized.php index 26c60859f0..3355f1776c 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Serialized.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Serialized.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Serialized/Array.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Serialized/Array.php index 83f8d18595..df16b1a1e3 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Serialized/Array.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Serialized/Array.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Shipping/Tablerate.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Shipping/Tablerate.php index 7a36e3ebdc..160fbbaeb8 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Shipping/Tablerate.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Shipping/Tablerate.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Sitemap.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Sitemap.php index 4a6b9b18b0..be8cbaadfd 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Sitemap.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Sitemap.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Sitemap/Cron.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Sitemap/Cron.php index cb5476c18e..375940e6f9 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Sitemap/Cron.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Sitemap/Cron.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Storage/Media/Database.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Storage/Media/Database.php index e2cb158b8e..780926da0b 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Storage/Media/Database.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Storage/Media/Database.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Store.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Store.php index f4d51d7668..95ed09a1f5 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Store.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Store.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Translate.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Translate.php index c01da5d67c..f92dd2d7ba 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Translate.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Translate.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Clone/Media/Image.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Clone/Media/Image.php index 90dd6fe41f..1c1f8b524f 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Clone/Media/Image.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Clone/Media/Image.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Admin/Page.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Admin/Page.php index 44fc4fb394..40623b7e70 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Admin/Page.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Admin/Page.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -94,8 +94,9 @@ protected function _buildMenuArray(Varien_Simplexml_Element $parent=null, $path= $parentArr = array(); $sortOrder = 0; foreach ($parent->children() as $childName=>$child) { - - if ($child->depends && !$this->_checkDepends($child->depends)) { + if ((1 == $child->disabled) + || ($child->depends && !$this->_checkDepends($child->depends)) + ) { continue; } diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Allregion.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Allregion.php index 7bafd08207..b47a524f20 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Allregion.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Allregion.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Catalog/GridPerPage.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Catalog/GridPerPage.php index 26885ebf18..85e1c9f9bd 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Catalog/GridPerPage.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Catalog/GridPerPage.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Catalog/ListMode.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Catalog/ListMode.php index d861064f07..f8fd328b8f 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Catalog/ListMode.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Catalog/ListMode.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Catalog/ListPerPage.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Catalog/ListPerPage.php index 553dab939e..ea43374eaf 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Catalog/ListPerPage.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Catalog/ListPerPage.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Catalog/ListSort.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Catalog/ListSort.php index d1544f2e91..66688c7736 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Catalog/ListSort.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Catalog/ListSort.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Catalog/Search/Type.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Catalog/Search/Type.php index 833277380e..594837eeb4 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Catalog/Search/Type.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Catalog/Search/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Catalog/TimeFormat.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Catalog/TimeFormat.php index 0da01ea29b..dd7abd8928 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Catalog/TimeFormat.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Catalog/TimeFormat.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Category.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Category.php index bc7fb39428..faebc94f7e 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Category.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Category.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Checktype.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Checktype.php index e8cc318b56..2c33b7d52c 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Checktype.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Checktype.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Cms/Page.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Cms/Page.php index a7c82beb71..9e340abe4e 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Cms/Page.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Cms/Page.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Adminhtml_Model_System_Config_Source_Cms_Page diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Cms/Wysiwyg/Enabled.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Cms/Wysiwyg/Enabled.php index d6cfc608b6..e5a2e978c6 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Cms/Wysiwyg/Enabled.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Cms/Wysiwyg/Enabled.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Country.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Country.php index 5ccb5d9e85..43a059a1ff 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Country.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Country.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Country/Full.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Country/Full.php index f2b8048d93..f1e4a7be5f 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Country/Full.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Country/Full.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Cron/Frequency.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Cron/Frequency.php index a7854163b4..4b6897fb3f 100755 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Cron/Frequency.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Cron/Frequency.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Currency.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Currency.php index b24ed935a9..44d0862e43 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Currency.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Currency.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Currency/Service.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Currency/Service.php index bb2b913d8b..b15df5aac2 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Currency/Service.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Currency/Service.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Customer/Address/Type.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Customer/Address/Type.php new file mode 100644 index 0000000000..84b5d9caf7 --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Customer/Address/Type.php @@ -0,0 +1,48 @@ + + */ +class Mage_Adminhtml_Model_System_Config_Source_Customer_Address_Type +{ + /** + * Retrieve possible customer address types + * + * @return array + */ + public function toOptionArray() + { + return array( + Mage_Customer_Model_Address_Abstract::TYPE_BILLING => Mage::helper('adminhtml')->__('Billing Address'), + Mage_Customer_Model_Address_Abstract::TYPE_SHIPPING => Mage::helper('adminhtml')->__('Shipping Address') + ); + } +} diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Customer/Group.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Customer/Group.php index 4ee238557d..74986377f9 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Customer/Group.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Customer/Group.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Customer/Group/Multiselect.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Customer/Group/Multiselect.php new file mode 100644 index 0000000000..65b8ff5b22 --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Customer/Group/Multiselect.php @@ -0,0 +1,50 @@ +_options) { + $this->_options = Mage::getResourceModel('customer/group_collection') + ->setRealGroupsFilter() + ->loadData()->toOptionArray(); + } + return $this->_options; + } +} diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Date/Short.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Date/Short.php index b4d62ce428..b0d9bee836 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Date/Short.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Date/Short.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Design/Package.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Design/Package.php index 04b993ddcd..dba7cb508e 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Design/Package.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Design/Package.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Adminhtml_Model_System_Config_Source_Package diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Design/Robots.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Design/Robots.php index 11090da9b5..2b63840fac 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Design/Robots.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Design/Robots.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Dev/Dbautoup.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Dev/Dbautoup.php index c30d1cba54..d57fd58472 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Dev/Dbautoup.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Dev/Dbautoup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Adminhtml_Model_System_Config_Source_Dev_Dbautoup diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Email/Identity.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Email/Identity.php index bcc5861031..a5f98efd22 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Email/Identity.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Email/Identity.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Email/Method.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Email/Method.php index 2ae914a288..b077a25e13 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Email/Method.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Email/Method.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Email/Smtpauth.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Email/Smtpauth.php index a806cad68e..4918cbe6c2 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Email/Smtpauth.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Email/Smtpauth.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Email/Template.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Email/Template.php index 78fc2add18..3bf9a70d0b 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Email/Template.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Email/Template.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Enabledisable.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Enabledisable.php index 98ccd0b6ca..0bb530fd49 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Enabledisable.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Enabledisable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Frequency.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Frequency.php index f69dc40515..bedd0db5d9 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Frequency.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Frequency.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Language.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Language.php index e5e422af69..fbe38454b4 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Language.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Language.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Locale.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Locale.php index e892ba8f61..f2d2ab830c 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Locale.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Locale.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Locale/Country.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Locale/Country.php index ac26271a5d..cb509591d2 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Locale/Country.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Locale/Country.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Locale/Currency.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Locale/Currency.php index 0635ed8339..ab5b2dfadf 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Locale/Currency.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Locale/Currency.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Locale/Currency/All.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Locale/Currency/All.php index e346ec5911..ff1a617b39 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Locale/Currency/All.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Locale/Currency/All.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Locale/Timezone.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Locale/Timezone.php index 0e409f7f9f..9a319c1134 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Locale/Timezone.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Locale/Timezone.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Locale/Weekdays.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Locale/Weekdays.php index 66d041f336..d5905b739b 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Locale/Weekdays.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Locale/Weekdays.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Nooptreq.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Nooptreq.php index a0c903e1a9..ad41c586ea 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Nooptreq.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Nooptreq.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Adminhtml_Model_System_Config_Source_Nooptreq diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Notification/Frequency.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Notification/Frequency.php index 5a0569957b..55bd4c241f 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Notification/Frequency.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Notification/Frequency.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Order/Status.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Order/Status.php index c2da7e99ca..d4a5874cf9 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Order/Status.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Order/Status.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Order/Status/New.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Order/Status/New.php index d18071c8c1..4f87b182f3 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Order/Status/New.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Order/Status/New.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Order/Status/Newprocessing.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Order/Status/Newprocessing.php index 7a51d1c77c..7a71d272de 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Order/Status/Newprocessing.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Order/Status/Newprocessing.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Order/Status/Processing.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Order/Status/Processing.php index 76852c533f..4289235924 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Order/Status/Processing.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Order/Status/Processing.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Payment/Allmethods.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Payment/Allmethods.php index 2e8c548ee8..beec33969a 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Payment/Allmethods.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Payment/Allmethods.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Payment/Allowedmethods.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Payment/Allowedmethods.php index 7c6093d9d0..151ca143e7 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Payment/Allowedmethods.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Payment/Allowedmethods.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Payment/Allspecificcountries.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Payment/Allspecificcountries.php index 2e47bc1540..001843d62e 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Payment/Allspecificcountries.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Payment/Allspecificcountries.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Payment/Cctype.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Payment/Cctype.php index cc51c8d09f..bf12bd257c 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Payment/Cctype.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Payment/Cctype.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Price/Scope.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Price/Scope.php index 6473353ee1..96168b4c51 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Price/Scope.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Price/Scope.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Price/Step.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Price/Step.php index f17ff55c9a..44e9cca44b 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Price/Step.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Price/Step.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -33,6 +33,10 @@ public function toOptionArray() 'value' => Mage_Catalog_Model_Layer_Filter_Price::RANGE_CALCULATION_AUTO, 'label' => Mage::helper('adminhtml')->__('Automatic') ), + array( + 'value' => Mage_Catalog_Model_Layer_Filter_Price::RANGE_CALCULATION_IMPROVED, + 'label' => Mage::helper('adminhtml')->__('Continuous') + ), array( 'value' => Mage_Catalog_Model_Layer_Filter_Price::RANGE_CALCULATION_MANUAL, 'label' => Mage::helper('adminhtml')->__('Manual') diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Product/Options/Price.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Product/Options/Price.php index b0df449df3..710a0066c6 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Product/Options/Price.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Product/Options/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Product/Options/Type.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Product/Options/Type.php index 0920ebc6ae..60c4e7b9e1 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Product/Options/Type.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Product/Options/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -41,13 +41,16 @@ public function toOptionArray() array('value' => '', 'label' => Mage::helper('adminhtml')->__('-- Please select --')) ); + $helper = Mage::helper('catalog'); + foreach (Mage::getConfig()->getNode(self::PRODUCT_OPTIONS_GROUPS_PATH)->children() as $group) { $types = array(); $typesPath = self::PRODUCT_OPTIONS_GROUPS_PATH . '/' . $group->getName() . '/types'; foreach (Mage::getConfig()->getNode($typesPath)->children() as $type) { - $labelPath = self::PRODUCT_OPTIONS_GROUPS_PATH . '/' . $group->getName() . '/types/' . $type->getName() . '/label'; + $labelPath = self::PRODUCT_OPTIONS_GROUPS_PATH . '/' . $group->getName() . '/types/' . $type->getName() + . '/label'; $types[] = array( - 'label' => (string) Mage::getConfig()->getNode($labelPath), + 'label' => $helper->__((string) Mage::getConfig()->getNode($labelPath)), 'value' => $type->getName() ); } @@ -55,7 +58,7 @@ public function toOptionArray() $labelPath = self::PRODUCT_OPTIONS_GROUPS_PATH . '/' . $group->getName() . '/label'; $groups[] = array( - 'label' => (string) Mage::getConfig()->getNode($labelPath), + 'label' => $helper->__((string) Mage::getConfig()->getNode($labelPath)), 'value' => $types ); } diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Product/Thumbnail.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Product/Thumbnail.php index 1228f6d688..dfea7c333e 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Product/Thumbnail.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Product/Thumbnail.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Reports/Scope.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Reports/Scope.php index 70c619ca2a..c72be4b75b 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Reports/Scope.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Reports/Scope.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Shipping/Allmethods.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Shipping/Allmethods.php index 69608cdac4..088636e216 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Shipping/Allmethods.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Shipping/Allmethods.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Shipping/Allowedmethods.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Shipping/Allowedmethods.php index 19d3f79945..7bd6008898 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Shipping/Allowedmethods.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Shipping/Allowedmethods.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Shipping/Allspecificcountries.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Shipping/Allspecificcountries.php index dd832af9ae..17464741e0 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Shipping/Allspecificcountries.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Shipping/Allspecificcountries.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Shipping/Flatrate.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Shipping/Flatrate.php index cbc36a325e..09786f8783 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Shipping/Flatrate.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Shipping/Flatrate.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Shipping/Tablerate.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Shipping/Tablerate.php index 3a91cfcc26..8e89773629 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Shipping/Tablerate.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Shipping/Tablerate.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Shipping/Taxclass.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Shipping/Taxclass.php index 5b27b70398..cc570807f8 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Shipping/Taxclass.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Shipping/Taxclass.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Adminhtml_Model_System_Config_Source_Shipping_Taxclass diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Storage/Media/Database.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Storage/Media/Database.php index 81e39b8989..c2670add3d 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Storage/Media/Database.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Storage/Media/Database.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Storage/Media/Storage.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Storage/Media/Storage.php index 9766d91c92..a2f100ae25 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Storage/Media/Storage.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Storage/Media/Storage.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Store.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Store.php index 1acd37a6e7..5b85b3b946 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Store.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Store.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Tax/Apply/On.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Tax/Apply/On.php index 3a214a6621..43659f687b 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Tax/Apply/On.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Tax/Apply/On.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Adminhtml_Model_System_Config_Source_Tax_Apply_On diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Tax/Basedon.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Tax/Basedon.php index df423f6cc7..7ee509df2e 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Tax/Basedon.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Tax/Basedon.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Adminhtml_Model_System_Config_Source_Tax_Basedon diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Tax/Catalog.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Tax/Catalog.php index 8f982ef390..80b23451ed 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Tax/Catalog.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Tax/Catalog.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Adminhtml_Model_System_Config_Source_Tax_Catalog diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Watermark/Position.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Watermark/Position.php index 6e75c6c488..8105862614 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Watermark/Position.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Watermark/Position.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Web/Protocol.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Web/Protocol.php index b300a2688e..5ecb4795ae 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Web/Protocol.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Web/Protocol.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Adminhtml_Model_System_Config_Source_Web_Protocol diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Web/Redirect.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Web/Redirect.php index c710e64250..a5612e5cb1 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Web/Redirect.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Web/Redirect.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Adminhtml_Model_System_Config_Source_Web_Redirect diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Website.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Website.php index d3c30777f6..1cd91b35bf 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Website.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Website.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Yesno.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Yesno.php index fd3e83fc1a..aec989e7bc 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Yesno.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Yesno.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Yesnocustom.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Yesnocustom.php index a8fb3d6900..b9c474cd57 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Yesnocustom.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Yesnocustom.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Store.php b/app/code/core/Mage/Adminhtml/Model/System/Store.php index 2e36c7ad1b..0a5ee6ad44 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Store.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Store.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/Url.php b/app/code/core/Mage/Adminhtml/Model/Url.php index 46fbac2d88..6fdde6b9f2 100644 --- a/app/code/core/Mage/Adminhtml/Model/Url.php +++ b/app/code/core/Mage/Adminhtml/Model/Url.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Adminhtml_Model_Url extends Mage_Core_Model_Url diff --git a/app/code/core/Mage/Adminhtml/controllers/AjaxController.php b/app/code/core/Mage/Adminhtml/controllers/AjaxController.php index f6228de02b..55f54862f6 100644 --- a/app/code/core/Mage/Adminhtml/controllers/AjaxController.php +++ b/app/code/core/Mage/Adminhtml/controllers/AjaxController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Api/RoleController.php b/app/code/core/Mage/Adminhtml/controllers/Api/RoleController.php index f348e096c1..1724e68252 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Api/RoleController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Api/RoleController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Api/UserController.php b/app/code/core/Mage/Adminhtml/controllers/Api/UserController.php index 5931e6f5ed..b1b358865f 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Api/UserController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Api/UserController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Adminhtml_Api_UserController extends Mage_Adminhtml_Controller_Action diff --git a/app/code/core/Mage/Adminhtml/controllers/CacheController.php b/app/code/core/Mage/Adminhtml/controllers/CacheController.php index 3aa90fc10e..e2e1154e57 100644 --- a/app/code/core/Mage/Adminhtml/controllers/CacheController.php +++ b/app/code/core/Mage/Adminhtml/controllers/CacheController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Catalog/Category/WidgetController.php b/app/code/core/Mage/Adminhtml/controllers/Catalog/Category/WidgetController.php index d28ca4fd8d..51473230e9 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Catalog/Category/WidgetController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Catalog/Category/WidgetController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Catalog/CategoryController.php b/app/code/core/Mage/Adminhtml/controllers/Catalog/CategoryController.php index 0d040515fb..901c36b25e 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Catalog/CategoryController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Catalog/CategoryController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -178,13 +178,23 @@ public function editAction() ->setLastEditedCategory($category->getId()); // $this->_initLayoutMessages('adminhtml/session'); $this->loadLayout(); - $this->getResponse()->setBody(Mage::helper('core')->jsonEncode(array( - 'messages' => $this->getLayout()->getMessagesBlock()->getGroupedHtml(), - 'content' => - $this->getLayout()->getBlock('category.edit')->getFormHtml() + + $eventResponse = new Varien_Object(array( + 'content' => $this->getLayout()->getBlock('category.edit')->getFormHtml() . $this->getLayout()->getBlock('category.tree') - ->getBreadcrumbsJavascript($breadcrumbsPath, 'editingCategoryBreadcrumbs') - ))); + ->getBreadcrumbsJavascript($breadcrumbsPath, 'editingCategoryBreadcrumbs'), + 'messages' => $this->getLayout()->getMessagesBlock()->getGroupedHtml(), + )); + + Mage::dispatchEvent('category_prepare_ajax_response', array( + 'response' => $eventResponse, + 'controller' => $this + )); + + $this->getResponse()->setBody( + Mage::helper('core')->jsonEncode($eventResponse->getData()) + ); + return; } diff --git a/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/Action/AttributeController.php b/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/Action/AttributeController.php index 45bdca7127..d1217a7a2f 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/Action/AttributeController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/Action/AttributeController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -51,6 +51,9 @@ public function editAction() $this->renderLayout(); } + /** + * Update product attributes + */ public function saveAction() { if (!$this->_validateProducts()) { @@ -95,7 +98,13 @@ public function saveAction() $value = null; } $attributesData[$attributeCode] = $value; - } else if ($attribute->getFrontendInput() == 'multiselect') { + } elseif ($attribute->getFrontendInput() == 'multiselect') { + // Check if 'Change' checkbox has been checked by admin for this attribute + $isChanged = (bool)$this->getRequest()->getPost($attributeCode . '_checkbox'); + if (!$isChanged) { + unset($attributesData[$attributeCode]); + continue; + } if (is_array($value)) { $value = implode(',', $value); } diff --git a/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/AttributeController.php b/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/AttributeController.php index fe4ee451e1..cd14cb9fdb 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/AttributeController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/AttributeController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/DatafeedsController.php b/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/DatafeedsController.php index 6168cc499c..178df4f139 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/DatafeedsController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/DatafeedsController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/GalleryController.php b/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/GalleryController.php index 75e8838062..186d4b7fc1 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/GalleryController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/GalleryController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -46,6 +46,11 @@ public function uploadAction() Mage::getSingleton('catalog/product_media_config')->getBaseTmpMediaPath() ); + Mage::dispatchEvent('catalog_product_gallery_upload_image_after', array( + 'result' => $result, + 'action' => $this + )); + /** * Workaround for prototype 1.7 methods "isJSON", "evalJSON" on Windows OS */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/GroupController.php b/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/GroupController.php index a746889206..f56fbee879 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/GroupController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/GroupController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/ReviewController.php b/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/ReviewController.php index c09c0eab86..31bc6017f4 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/ReviewController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/ReviewController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -311,7 +311,9 @@ public function postAction() $session = Mage::getSingleton('adminhtml/session'); if ($data = $this->getRequest()->getPost()) { - if(isset($data['select_stores'])) { + if (Mage::app()->isSingleStoreMode()) { + $data['stores'] = array(Mage::app()->getStore(true)->getId()); + } else if (isset($data['select_stores'])) { $data['stores'] = $data['select_stores']; } diff --git a/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/SetController.php b/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/SetController.php index c1882abe82..aa2bdbf50a 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/SetController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/SetController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/WidgetController.php b/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/WidgetController.php index b4509531f7..77fe8a8515 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/WidgetController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/WidgetController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php b/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php index 4917332e54..5c3fb57ed9 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -679,6 +679,9 @@ protected function _filterStockData(&$stockData) { if (isset($stockData['min_qty']) && (int)$stockData['min_qty'] < 0) { $stockData['min_qty'] = 0; } + if (!isset($stockData['is_decimal_divided']) || $stockData['is_qty_decimal'] == 0) { + $stockData['is_decimal_divided'] = 0; + } } public function categoriesJsonAction() diff --git a/app/code/core/Mage/Adminhtml/controllers/Catalog/SearchController.php b/app/code/core/Mage/Adminhtml/controllers/Catalog/SearchController.php index 62a413db3b..aee781b187 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Catalog/SearchController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Catalog/SearchController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/CatalogController.php b/app/code/core/Mage/Adminhtml/controllers/CatalogController.php index 841b6636db..5d473b48ac 100644 --- a/app/code/core/Mage/Adminhtml/controllers/CatalogController.php +++ b/app/code/core/Mage/Adminhtml/controllers/CatalogController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Checkout/AgreementController.php b/app/code/core/Mage/Adminhtml/controllers/Checkout/AgreementController.php index a92e91c0be..12483a0b81 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Checkout/AgreementController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Checkout/AgreementController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Cms/Block/WidgetController.php b/app/code/core/Mage/Adminhtml/controllers/Cms/Block/WidgetController.php index 56ff0c556a..8843262115 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Cms/Block/WidgetController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Cms/Block/WidgetController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Cms/BlockController.php b/app/code/core/Mage/Adminhtml/controllers/Cms/BlockController.php index 4c99d0fb4d..8098daace9 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Cms/BlockController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Cms/BlockController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Cms/Page/WidgetController.php b/app/code/core/Mage/Adminhtml/controllers/Cms/Page/WidgetController.php index 8d1ad3d0ec..200866dce6 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Cms/Page/WidgetController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Cms/Page/WidgetController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Cms/PageController.php b/app/code/core/Mage/Adminhtml/controllers/Cms/PageController.php index fa8d591dc3..c600585c0e 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Cms/PageController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Cms/PageController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Cms/Wysiwyg/ImagesController.php b/app/code/core/Mage/Adminhtml/controllers/Cms/Wysiwyg/ImagesController.php index 06f9e112e1..92a1bd3f24 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Cms/Wysiwyg/ImagesController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Cms/Wysiwyg/ImagesController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Cms/WysiwygController.php b/app/code/core/Mage/Adminhtml/controllers/Cms/WysiwygController.php index 6aa9a44e2b..595ed689ee 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Cms/WysiwygController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Cms/WysiwygController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Customer/Cart/Product/Composite/CartController.php b/app/code/core/Mage/Adminhtml/controllers/Customer/Cart/Product/Composite/CartController.php index 0d10aea41a..636f41bd2b 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Customer/Cart/Product/Composite/CartController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Customer/Cart/Product/Composite/CartController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Customer/ConfigController.php b/app/code/core/Mage/Adminhtml/controllers/Customer/ConfigController.php index 7e2135e045..146a310cb1 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Customer/ConfigController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Customer/ConfigController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Customer/GroupController.php b/app/code/core/Mage/Adminhtml/controllers/Customer/GroupController.php index ac24e8edfc..9f3eec68ea 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Customer/GroupController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Customer/GroupController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Customer/OnlineController.php b/app/code/core/Mage/Adminhtml/controllers/Customer/OnlineController.php index 4a2d40a728..57bb9f296a 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Customer/OnlineController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Customer/OnlineController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Adminhtml_Customer_OnlineController extends Mage_Adminhtml_Controller_Action diff --git a/app/code/core/Mage/Adminhtml/controllers/Customer/System/Config/ValidatevatController.php b/app/code/core/Mage/Adminhtml/controllers/Customer/System/Config/ValidatevatController.php index 75be29f450..e403ba34be 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Customer/System/Config/ValidatevatController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Customer/System/Config/ValidatevatController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -70,9 +70,15 @@ public function validateAdvancedAction() $result = $this->_validate(); $valid = $result->getIsValid(); $success = $result->getRequestSuccess(); + // ID of the store where order is placed + $storeId = $this->getRequest()->getParam('store_id'); + // Sanitize value if needed + if (!is_null($storeId)) { + $storeId = (int)$storeId; + } $groupId = Mage::helper('customer')->getCustomerGroupIdBasedOnVatNumber( - $this->getRequest()->getParam('country'), $result + $this->getRequest()->getParam('country'), $result, $storeId ); $body = $coreHelper->jsonEncode(array( diff --git a/app/code/core/Mage/Adminhtml/controllers/Customer/Wishlist/Product/Composite/WishlistController.php b/app/code/core/Mage/Adminhtml/controllers/Customer/Wishlist/Product/Composite/WishlistController.php index 4098ef4d63..16449b4ce6 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Customer/Wishlist/Product/Composite/WishlistController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Customer/Wishlist/Product/Composite/WishlistController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/CustomerController.php b/app/code/core/Mage/Adminhtml/controllers/CustomerController.php index c5296bbb9c..8aa4a63206 100644 --- a/app/code/core/Mage/Adminhtml/controllers/CustomerController.php +++ b/app/code/core/Mage/Adminhtml/controllers/CustomerController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -232,14 +232,20 @@ public function saveAction() foreach (array_keys($data['address']) as $index) { $address = $customer->getAddressItemById($index); if (!$address) { - $address = Mage::getModel('customer/address'); + $address = Mage::getModel('customer/address'); } $requestScope = sprintf('address/%s', $index); $formData = $addressForm->setEntity($address) ->extractData($this->getRequest(), $requestScope); - $address->setIsDefaultBilling($data['account']['default_billing'] == $index); + // Set default billing and shipping flags to address + $isDefaultBilling = isset($data['account']['default_billing']) + && $data['account']['default_billing'] == $index; + $address->setIsDefaultBilling($isDefaultBilling); + $isDefaultShipping = isset($data['account']['default_shipping']) + && $data['account']['default_shipping'] == $index; + $address->setIsDefaultShipping($isDefaultShipping); $errors = $addressForm->validateData($formData); if ($errors !== true) { diff --git a/app/code/core/Mage/Adminhtml/controllers/DashboardController.php b/app/code/core/Mage/Adminhtml/controllers/DashboardController.php index 709d5095a2..8afc56e76b 100644 --- a/app/code/core/Mage/Adminhtml/controllers/DashboardController.php +++ b/app/code/core/Mage/Adminhtml/controllers/DashboardController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/IndexController.php b/app/code/core/Mage/Adminhtml/controllers/IndexController.php index 7bf1be892f..78d2845b39 100644 --- a/app/code/core/Mage/Adminhtml/controllers/IndexController.php +++ b/app/code/core/Mage/Adminhtml/controllers/IndexController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/JsonController.php b/app/code/core/Mage/Adminhtml/controllers/JsonController.php index d1b498253c..9008f236e3 100644 --- a/app/code/core/Mage/Adminhtml/controllers/JsonController.php +++ b/app/code/core/Mage/Adminhtml/controllers/JsonController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Media/EditorController.php b/app/code/core/Mage/Adminhtml/controllers/Media/EditorController.php index 234981a244..7982ec7ccb 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Media/EditorController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Media/EditorController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Media/UploaderController.php b/app/code/core/Mage/Adminhtml/controllers/Media/UploaderController.php index bdc439415a..940e97cda9 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Media/UploaderController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Media/UploaderController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Newsletter/ProblemController.php b/app/code/core/Mage/Adminhtml/controllers/Newsletter/ProblemController.php index cf346579a5..41e6508be1 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Newsletter/ProblemController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Newsletter/ProblemController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Newsletter/QueueController.php b/app/code/core/Mage/Adminhtml/controllers/Newsletter/QueueController.php index de587c4946..c585eee71a 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Newsletter/QueueController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Newsletter/QueueController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Newsletter/SubscriberController.php b/app/code/core/Mage/Adminhtml/controllers/Newsletter/SubscriberController.php index 580512668f..faefab5a2e 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Newsletter/SubscriberController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Newsletter/SubscriberController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Newsletter/TemplateController.php b/app/code/core/Mage/Adminhtml/controllers/Newsletter/TemplateController.php index 9455b7fea3..041291875f 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Newsletter/TemplateController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Newsletter/TemplateController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** diff --git a/app/code/core/Mage/Adminhtml/controllers/NotificationController.php b/app/code/core/Mage/Adminhtml/controllers/NotificationController.php index 2f8c5d41e6..fd0f92bc89 100644 --- a/app/code/core/Mage/Adminhtml/controllers/NotificationController.php +++ b/app/code/core/Mage/Adminhtml/controllers/NotificationController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Permissions/RoleController.php b/app/code/core/Mage/Adminhtml/controllers/Permissions/RoleController.php index 7e8efef410..3ff5a131e5 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Permissions/RoleController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Permissions/RoleController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -218,7 +218,7 @@ public function saveRoleAction() } //$this->getResponse()->setRedirect($this->getUrl("*/*/editrole/rid/$rid")); - $this->_redirect('*/*/editrole', array('rid' => $rid)); + $this->_redirect('*/*/'); return; } diff --git a/app/code/core/Mage/Adminhtml/controllers/Permissions/UserController.php b/app/code/core/Mage/Adminhtml/controllers/Permissions/UserController.php index fa201c2860..d2051269b2 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Permissions/UserController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Permissions/UserController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Adminhtml_Permissions_UserController extends Mage_Adminhtml_Controller_Action @@ -81,12 +81,25 @@ public function editAction() Mage::register('permissions_user', $model); + if (isset($id)) { + $breadcrumb = $this->__('Edit User'); + } else { + $breadcrumb = $this->__('New User'); + } $this->_initAction() - ->_addBreadcrumb($id ? $this->__('Edit User') : $this->__('New User'), $id ? $this->__('Edit User') : $this->__('New User')) - ->_addContent($this->getLayout()->createBlock('adminhtml/permissions_user_edit')->setData('action', $this->getUrl('*/permissions_user/save'))) + ->_addBreadcrumb($breadcrumb, $breadcrumb) + ->_addContent( + $this->getLayout() + ->createBlock('adminhtml/permissions_user_edit') + ->setData('action', $this->getUrl('*/permissions_user/save')) + ) ->_addLeft($this->getLayout()->createBlock('adminhtml/permissions_user_edit_tabs')); - $this->_addJs($this->getLayout()->createBlock('adminhtml/template')->setTemplate('permissions/user_roles_grid_js.phtml')); + $this->_addJs( + $this->getLayout() + ->createBlock('adminhtml/template') + ->setTemplate('permissions/user_roles_grid_js.phtml') + ); $this->renderLayout(); } @@ -142,7 +155,7 @@ public function saveAction() } Mage::getSingleton('adminhtml/session')->addSuccess($this->__('The user has been saved.')); Mage::getSingleton('adminhtml/session')->setUserData(false); - $this->_redirect('*/*/edit', array('user_id' => $model->getUserId())); + $this->_redirect('*/*/'); return; } catch (Mage_Core_Exception $e) { Mage::getSingleton('adminhtml/session')->addError($e->getMessage()); @@ -192,7 +205,11 @@ public function rolesGridAction() } Mage::register('permissions_user', $model); - $this->getResponse()->setBody($this->getLayout()->createBlock('adminhtml/permissions_user_edit_tab_roles')->toHtml()); + $this->getResponse()->setBody( + $this->getLayout() + ->createBlock('adminhtml/permissions_user_edit_tab_roles') + ->toHtml() + ); } public function roleGridAction() diff --git a/app/code/core/Mage/Adminhtml/controllers/Poll/AnswerController.php b/app/code/core/Mage/Adminhtml/controllers/Poll/AnswerController.php index 853a27cef5..36dc8671cc 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Poll/AnswerController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Poll/AnswerController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/PollController.php b/app/code/core/Mage/Adminhtml/controllers/PollController.php index a380ee944e..fd5fc81d55 100644 --- a/app/code/core/Mage/Adminhtml/controllers/PollController.php +++ b/app/code/core/Mage/Adminhtml/controllers/PollController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Promo/CatalogController.php b/app/code/core/Mage/Adminhtml/controllers/Promo/CatalogController.php index 1141958a1e..f5346f5ba3 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Promo/CatalogController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Promo/CatalogController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -33,6 +33,13 @@ */ class Mage_Adminhtml_Promo_CatalogController extends Mage_Adminhtml_Controller_Action { + /** + * Dirty rules notice message + * + * @var string + */ + protected $_dirtyRulesNoticeMessage; + protected function _initAction() { $this->loadLayout() @@ -48,10 +55,9 @@ public function indexAction() { $this->_title($this->__('Promotions'))->_title($this->__('Catalog Price Rules')); - if (Mage::app()->loadCache('catalog_rules_dirty')) { - Mage::getSingleton('adminhtml/session')->addNotice( - Mage::helper('catalogrule')->__('There are rules that have been changed but were not applied. Please, click Apply Rules in order to see immediate effect in the catalog.') - ); + $dirtyRules = Mage::getModel('catalogrule/flag')->loadSelf(); + if ($dirtyRules->getState()) { + Mage::getSingleton('adminhtml/session')->addNotice($this->getDirtyRulesNoticeMessage()); } $this->_initAction() @@ -137,11 +143,10 @@ public function saveAction() $data['conditions'] = $data['rule']['conditions']; unset($data['rule']); + $autoApply = false; if (!empty($data['auto_apply'])) { $autoApply = true; unset($data['auto_apply']); - } else { - $autoApply = false; } $model->loadPost($data); @@ -158,7 +163,9 @@ public function saveAction() $this->getRequest()->setParam('rule_id', $model->getId()); $this->_forward('applyRules'); } else { - Mage::app()->saveCache(1, 'catalog_rules_dirty'); + Mage::getModel('catalogrule/flag')->loadSelf() + ->setState(1) + ->save(); if ($this->getRequest()->getParam('back')) { $this->_redirect('*/*/edit', array('id' => $model->getId())); return; @@ -188,7 +195,9 @@ public function deleteAction() $model = Mage::getModel('catalogrule/rule'); $model->load($id); $model->delete(); - Mage::app()->saveCache(1, 'catalog_rules_dirty'); + Mage::getModel('catalogrule/flag')->loadSelf() + ->setState(1) + ->save(); Mage::getSingleton('adminhtml/session')->addSuccess( Mage::helper('catalogrule')->__('The rule has been deleted.') ); @@ -286,7 +295,9 @@ public function applyRulesAction() $errorMessage = Mage::helper('catalogrule')->__('Unable to apply rules.'); try { Mage::getModel('catalogrule/rule')->applyAll(); - Mage::app()->removeCache('catalog_rules_dirty'); + Mage::getModel('catalogrule/flag')->loadSelf() + ->setState(0) + ->save(); $this->_getSession()->addSuccess(Mage::helper('catalogrule')->__('The rules have been applied.')); } catch (Mage_Core_Exception $e) { $this->_getSession()->addError($errorMessage . ' ' . $e->getMessage()); @@ -307,4 +318,25 @@ protected function _isAllowed() { return Mage::getSingleton('admin/session')->isAllowed('promo/catalog'); } + + /** + * Set dirty rules notice message + * + * @param string $dirtyRulesNoticeMessage + */ + public function setDirtyRulesNoticeMessage($dirtyRulesNoticeMessage) + { + $this->_dirtyRulesNoticeMessage = $dirtyRulesNoticeMessage; + } + + /** + * Get dirty rules notice message + * + * @return string + */ + public function getDirtyRulesNoticeMessage() + { + $defaultMessage = Mage::helper('catalogrule')->__('There are rules that have been changed but were not applied. Please, click Apply Rules in order to see immediate effect in the catalog.'); + return $this->_dirtyRulesNoticeMessage ? $this->_dirtyRulesNoticeMessage : $defaultMessage; + } } diff --git a/app/code/core/Mage/Adminhtml/controllers/Promo/QuoteController.php b/app/code/core/Mage/Adminhtml/controllers/Promo/QuoteController.php index f222b22566..5db2a56b3d 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Promo/QuoteController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Promo/QuoteController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -121,16 +121,6 @@ public function saveAction() 'adminhtml_controller_salesrule_prepare_save', array('request' => $this->getRequest())); $data = $this->getRequest()->getPost(); - - //filter HTML tags - /** @var $helper Mage_Adminhtml_Helper_Data */ - $helper = Mage::helper('adminhtml'); - $data['name'] = $helper->stripTags($data['name']); - $data['description'] = $helper->stripTags($data['description']); - foreach ($data['store_labels'] as &$label) { - $label = $helper->stripTags($label); - } - $data = $this->_filterDates($data, array('from_date', 'to_date')); $id = $this->getRequest()->getParam('rule_id'); if ($id) { @@ -181,12 +171,20 @@ public function saveAction() return; } catch (Mage_Core_Exception $e) { $this->_getSession()->addError($e->getMessage()); + $id = (int)$this->getRequest()->getParam('rule_id'); + if (!empty($id)) { + $this->_redirect('*/*/edit', array('id' => $id)); + } else { + $this->_redirect('*/*/new'); + } + return; + } catch (Exception $e) { $this->_getSession()->addError( Mage::helper('catalogrule')->__('An error occurred while saving the rule data. Please review the log and try again.')); Mage::logException($e); Mage::getSingleton('adminhtml/session')->setPageData($data); - $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('rule_id'))); + $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('rule_id'))); return; } } @@ -386,7 +384,7 @@ public function generateAction() $generator->setData($data); $generator->generatePool(); $generated = $generator->getGeneratedCount(); - $this->_getSession()->addSuccess(Mage::helper('salesrule')->__('%s Coupon(s) generated successfully', $generated)); + $this->_getSession()->addSuccess(Mage::helper('salesrule')->__('%s Coupon(s) have been generated', $generated)); $this->_initLayoutMessages('adminhtml/session'); $result['messages'] = $this->getLayout()->getMessagesBlock()->getGroupedHtml(); } diff --git a/app/code/core/Mage/Adminhtml/controllers/Promo/WidgetController.php b/app/code/core/Mage/Adminhtml/controllers/Promo/WidgetController.php index bb385cf28e..3b1a4f484b 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Promo/WidgetController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Promo/WidgetController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/PromoController.php b/app/code/core/Mage/Adminhtml/controllers/PromoController.php index c5405cf9cf..359cf3f997 100644 --- a/app/code/core/Mage/Adminhtml/controllers/PromoController.php +++ b/app/code/core/Mage/Adminhtml/controllers/PromoController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/RatingController.php b/app/code/core/Mage/Adminhtml/controllers/RatingController.php index 3b2917f6ed..1b107695b0 100644 --- a/app/code/core/Mage/Adminhtml/controllers/RatingController.php +++ b/app/code/core/Mage/Adminhtml/controllers/RatingController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -71,30 +71,35 @@ public function newAction() $this->_forward('edit'); } + /** + * Save rating + */ public function saveAction() { $this->_initEnityId(); - if ( $this->getRequest()->getPost() ) { + if ($this->getRequest()->getPost()) { try { $ratingModel = Mage::getModel('rating/rating'); $stores = $this->getRequest()->getParam('stores'); + $position = (int)$this->getRequest()->getParam('position'); $stores[] = 0; $ratingModel->setRatingCode($this->getRequest()->getParam('rating_code')) - ->setRatingCodes($this->getRequest()->getParam('rating_codes')) - ->setStores($stores) - ->setId($this->getRequest()->getParam('id')) - ->setEntityId(Mage::registry('entityId')) - ->save(); + ->setRatingCodes($this->getRequest()->getParam('rating_codes')) + ->setStores($stores) + ->setPosition($position) + ->setId($this->getRequest()->getParam('id')) + ->setEntityId(Mage::registry('entityId')) + ->save(); $options = $this->getRequest()->getParam('option_title'); - if( is_array($options) ) { + if (is_array($options)) { $i = 1; - foreach( $options as $key => $optionCode ) { + foreach ($options as $key => $optionCode) { $optionModel = Mage::getModel('rating/rating_option'); - if( !preg_match("/^add_([0-9]*?)$/", $key) ) { + if (!preg_match("/^add_([0-9]*?)$/", $key)) { $optionModel->setId($key); } diff --git a/app/code/core/Mage/Adminhtml/controllers/Report/CustomerController.php b/app/code/core/Mage/Adminhtml/controllers/Report/CustomerController.php index b1758d4315..1353df18c9 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Report/CustomerController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Report/CustomerController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Report/ProductController.php b/app/code/core/Mage/Adminhtml/controllers/Report/ProductController.php index 80d56c5518..2d2cc251d1 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Report/ProductController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Report/ProductController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Report/ReviewController.php b/app/code/core/Mage/Adminhtml/controllers/Report/ReviewController.php index 536e38006c..709ef8f297 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Report/ReviewController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Report/ReviewController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Report/SalesController.php b/app/code/core/Mage/Adminhtml/controllers/Report/SalesController.php index ab97eb8df7..06e572d4f0 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Report/SalesController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Report/SalesController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Report/ShopcartController.php b/app/code/core/Mage/Adminhtml/controllers/Report/ShopcartController.php index 04100be59e..dee864fd6e 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Report/ShopcartController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Report/ShopcartController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Report/StatisticsController.php b/app/code/core/Mage/Adminhtml/controllers/Report/StatisticsController.php index 0ae974edc6..336770a708 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Report/StatisticsController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Report/StatisticsController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Report/TagController.php b/app/code/core/Mage/Adminhtml/controllers/Report/TagController.php index e2c3617d67..e4fc310a4a 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Report/TagController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Report/TagController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/ReportController.php b/app/code/core/Mage/Adminhtml/controllers/ReportController.php index d7b576fa1c..ad046a9b38 100644 --- a/app/code/core/Mage/Adminhtml/controllers/ReportController.php +++ b/app/code/core/Mage/Adminhtml/controllers/ReportController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Rss/CatalogController.php b/app/code/core/Mage/Adminhtml/controllers/Rss/CatalogController.php index 60abbf28eb..33b528142e 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Rss/CatalogController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Rss/CatalogController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Rss/OrderController.php b/app/code/core/Mage/Adminhtml/controllers/Rss/OrderController.php index 33fd980824..d39da8ec59 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Rss/OrderController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Rss/OrderController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Sales/Billing/AgreementController.php b/app/code/core/Mage/Adminhtml/controllers/Sales/Billing/AgreementController.php index b2510d245b..5c55e61f61 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Sales/Billing/AgreementController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Sales/Billing/AgreementController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Sales/CreditmemoController.php b/app/code/core/Mage/Adminhtml/controllers/Sales/CreditmemoController.php index d9e4704b94..5318f4c653 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Sales/CreditmemoController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Sales/CreditmemoController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Sales/InvoiceController.php b/app/code/core/Mage/Adminhtml/controllers/Sales/InvoiceController.php index 93af9ad173..33ae47a9fe 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Sales/InvoiceController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Sales/InvoiceController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/CreateController.php b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/CreateController.php index 5420a578b2..376afd7bf1 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/CreateController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/CreateController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -40,6 +40,9 @@ class Mage_Adminhtml_Sales_Order_CreateController extends Mage_Adminhtml_Control protected function _construct() { $this->setUsedModuleName('Mage_Sales'); + + // During order creation in the backend admin has ability to add any products to order + Mage::helper('catalog/product')->setSkipSaleableCheck(true); } /** @@ -131,6 +134,14 @@ protected function _processData() */ protected function _processActionData($action = null) { + $eventData = array( + 'order_create_model' => $this->_getOrderCreateModel(), + 'request_model' => $this->getRequest(), + 'session' => $this->_getSession(), + ); + + Mage::dispatchEvent('adminhtml_sales_order_create_process_data_before', $eventData); + /** * Saving order data */ @@ -153,9 +164,10 @@ protected function _processActionData($action = null) */ if (!$this->_getOrderCreateModel()->getQuote()->isVirtual()) { $syncFlag = $this->getRequest()->getPost('shipping_as_billing'); + $shippingMethod = $this->_getOrderCreateModel()->getShippingAddress()->getShippingMethod(); if (is_null($syncFlag) && $this->_getOrderCreateModel()->getShippingAddress()->getSameAsBilling() - && is_null($this->_getOrderCreateModel()->getShippingMethod()) + && empty($shippingMethod) ) { $this->_getOrderCreateModel()->setShippingAsBilling(1); } else { @@ -277,10 +289,14 @@ protected function _processActionData($action = null) } $data = $this->getRequest()->getPost('order'); - if (!empty($data['coupon']['code'])) { - if ($this->_getQuote()->getCouponCode() !== $data['coupon']['code']) { + $couponCode = ''; + if (isset($data) && isset($data['coupon']['code'])) { + $couponCode = trim($data['coupon']['code']); + } + if (!empty($couponCode)) { + if ($this->_getQuote()->getCouponCode() !== $couponCode) { $this->_getSession()->addError( - $this->__('"%s" coupon code is not valid.', $this->_getHelper()->escapeHtml($data['coupon']['code']))); + $this->__('"%s" coupon code is not valid.', $this->_getHelper()->escapeHtml($couponCode))); } else { $this->_getSession()->addSuccess($this->__('The coupon code has been accepted.')); } @@ -612,4 +628,14 @@ public function showUpdateResultAction() return false; } } + + /** + * Process data and display index page + */ + public function processDataAction() + { + $this->_initSession(); + $this->_processData(); + $this->_forward('index'); + } } diff --git a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/CreditmemoController.php b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/CreditmemoController.php index 34c5955838..a8cbfc2af8 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/CreditmemoController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/CreditmemoController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/EditController.php b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/EditController.php index 357d250202..08d36bf92c 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/EditController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/EditController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -34,15 +34,6 @@ */ class Mage_Adminhtml_Sales_Order_EditController extends Mage_Adminhtml_Sales_Order_CreateController { - /** - * Additional initialization - * - */ - protected function _construct() - { - $this->setUsedModuleName('Mage_Sales'); - } - /** * Start edit order initialization */ @@ -52,13 +43,21 @@ public function startAction() $orderId = $this->getRequest()->getParam('order_id'); $order = Mage::getModel('sales/order')->load($orderId); - if ($order->getId()) { - $this->_getSession()->setUseOldShippingMethod(true); - $this->_getOrderCreateModel()->initFromOrder($order); - $this->_redirect('*/*'); - } - else { - $this->_redirect('*/sales_order/'); + try { + if ($order->getId()) { + $this->_getSession()->setUseOldShippingMethod(true); + $this->_getOrderCreateModel()->initFromOrder($order); + $this->_redirect('*/*'); + } + else { + $this->_redirect('*/sales_order/'); + } + } catch (Mage_Core_Exception $e) { + Mage::getSingleton('adminhtml/session')->addError($e->getMessage()); + $this->_redirect('*/sales_order/view', array('order_id' => $orderId)); + } catch (Exception $e) { + Mage::getSingleton('adminhtml/session')->addException($e, $e->getMessage()); + $this->_redirect('*/sales_order/view', array('order_id' => $orderId)); } } @@ -74,7 +73,7 @@ public function indexAction() ->_setActiveMenu('sales/order') ->renderLayout(); } - + /** * Acl check for admin * @@ -83,5 +82,5 @@ public function indexAction() protected function _isAllowed() { return Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/edit'); - } + } } diff --git a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/InvoiceController.php b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/InvoiceController.php index 5296e92272..c1cea42128 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/InvoiceController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/InvoiceController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/ShipmentController.php b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/ShipmentController.php index dc9a37f663..c6188db0df 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/ShipmentController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/ShipmentController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/StatusController.php b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/StatusController.php index 4e24919bc3..23352cc3fa 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/StatusController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/StatusController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/View/GiftmessageController.php b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/View/GiftmessageController.php index 4359bfaae7..467fa209e3 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/View/GiftmessageController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/View/GiftmessageController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Sales/OrderController.php b/app/code/core/Mage/Adminhtml/controllers/Sales/OrderController.php index e9f934f96d..3a59b81a2a 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Sales/OrderController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Sales/OrderController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -727,6 +727,12 @@ public function addressAction() if ($address) { Mage::register('order_address', $address); $this->loadLayout(); + // Do not display VAT validation button on edit order address form + $addressFormContainer = $this->getLayout()->getBlock('sales_order_address.form.container'); + if ($addressFormContainer) { + $addressFormContainer->getChild('form')->setDisplayVatValidationButton(false); + } + $this->renderLayout(); } else { $this->_redirect('*/*/'); diff --git a/app/code/core/Mage/Adminhtml/controllers/Sales/Recurring/ProfileController.php b/app/code/core/Mage/Adminhtml/controllers/Sales/Recurring/ProfileController.php index 9a34591f47..3650bc2473 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Sales/Recurring/ProfileController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Sales/Recurring/ProfileController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Sales/ShipmentController.php b/app/code/core/Mage/Adminhtml/controllers/Sales/ShipmentController.php index bec34d920b..8114cb45d6 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Sales/ShipmentController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Sales/ShipmentController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Sales/TransactionsController.php b/app/code/core/Mage/Adminhtml/controllers/Sales/TransactionsController.php index c565cdaa1b..636728486b 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Sales/TransactionsController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Sales/TransactionsController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/SalesController.php b/app/code/core/Mage/Adminhtml/controllers/SalesController.php index a93f8b5382..24e17b520f 100644 --- a/app/code/core/Mage/Adminhtml/controllers/SalesController.php +++ b/app/code/core/Mage/Adminhtml/controllers/SalesController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/SitemapController.php b/app/code/core/Mage/Adminhtml/controllers/SitemapController.php index d5c435020d..0426ad9ea8 100644 --- a/app/code/core/Mage/Adminhtml/controllers/SitemapController.php +++ b/app/code/core/Mage/Adminhtml/controllers/SitemapController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/SurveyController.php b/app/code/core/Mage/Adminhtml/controllers/SurveyController.php index 0ee718343c..307b20dbe4 100644 --- a/app/code/core/Mage/Adminhtml/controllers/SurveyController.php +++ b/app/code/core/Mage/Adminhtml/controllers/SurveyController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/System/AccountController.php b/app/code/core/Mage/Adminhtml/controllers/System/AccountController.php index 9e92d3409b..15fd45126c 100644 --- a/app/code/core/Mage/Adminhtml/controllers/System/AccountController.php +++ b/app/code/core/Mage/Adminhtml/controllers/System/AccountController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/System/BackupController.php b/app/code/core/Mage/Adminhtml/controllers/System/BackupController.php index d7b46e2d4c..0267626e67 100644 --- a/app/code/core/Mage/Adminhtml/controllers/System/BackupController.php +++ b/app/code/core/Mage/Adminhtml/controllers/System/BackupController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -76,16 +76,28 @@ public function createAction() } $response = new Varien_Object(); + + /** + * @var Mage_Backup_Helper_Data $helper + */ $helper = Mage::helper('backup'); try { $type = $this->getRequest()->getParam('type'); + if ($type == Mage_Backup_Helper_Data::TYPE_SYSTEM_SNAPSHOT + && $this->getRequest()->getParam('exclude_media') + ) { + $type = Mage_Backup_Helper_Data::TYPE_SNAPSHOT_WITHOUT_MEDIA; + } + $backupManager = Mage_Backup::getBackupInstance($type) ->setBackupExtension($helper->getExtensionByType($type)) ->setTime(time()) ->setBackupsDir($helper->getBackupsDir()); + $backupManager->setName($this->getRequest()->getParam('backup_name')); + Mage::register('backup_manager', $backupManager); if ($this->getRequest()->getParam('maintenance_mode')) { @@ -112,10 +124,6 @@ public function createAction() $this->_getSession()->addSuccess($successMessage); - if ($this->getRequest()->getParam('maintenance_mode')) { - $helper->turnOffMaintenanceMode(); - } - $response->setRedirectUrl($this->getUrl('*/*/index')); } catch (Mage_Backup_Exception_NotEnoughFreeSpace $e) { $errorMessage = Mage::helper('backup')->__('Not enough free space to create backup.'); @@ -132,6 +140,10 @@ public function createAction() $backupManager->setErrorMessage($errorMessage); } + if ($this->getRequest()->getParam('maintenance_mode')) { + $helper->turnOffMaintenanceMode(); + } + $this->getResponse()->setBody($response->toJson()); } @@ -142,13 +154,13 @@ public function createAction() */ public function downloadAction() { - $backup = Mage::getModel('backup/backup') - ->setTime((int)$this->getRequest()->getParam('time')) - ->setType($this->getRequest()->getParam('type')) - ->setPath(Mage::helper('backup')->getBackupsDir()); /* @var $backup Mage_Backup_Model_Backup */ + $backup = Mage::getModel('backup/backup')->loadByTimeAndType( + $this->getRequest()->getParam('time'), + $this->getRequest()->getParam('type') + ); - if (!$backup->exists()) { + if (!$backup->getTime() || !$backup->exists()) { return $this->_redirect('*/*'); } @@ -181,12 +193,27 @@ public function rollbackAction() $response = new Varien_Object(); try { - $type = $this->getRequest()->getParam('type'); + /* @var $backup Mage_Backup_Model_Backup */ + $backup = Mage::getModel('backup/backup')->loadByTimeAndType( + $this->getRequest()->getParam('time'), + $this->getRequest()->getParam('type') + ); + + if (!$backup->getTime() || !$backup->exists()) { + return $this->_redirect('*/*'); + } + + if (!$backup->getTime()) { + throw new Mage_Backup_Exception_CantLoadSnapshot(); + } + + $type = $backup->getType(); $backupManager = Mage_Backup::getBackupInstance($type) ->setBackupExtension($helper->getExtensionByType($type)) - ->setTime($this->getRequest()->getParam('time')) + ->setTime($backup->getTime()) ->setBackupsDir($helper->getBackupsDir()) + ->setName($backup->getName(), false) ->setResourceModel(Mage::getResourceModel('backup/db')); Mage::register('backup_manager', $backupManager); @@ -237,12 +264,7 @@ public function rollbackAction() $adminSession->unsetAll(); $adminSession->getCookie()->delete($adminSession->getSessionName()); - if ($this->getRequest()->getParam('maintenance_mode')) { - $helper->turnOffMaintenanceMode(); - } - $response->setRedirectUrl($this->getUrl('*')); - } catch (Mage_Backup_Exception_CantLoadSnapshot $e) { $errorMsg = Mage::helper('backup')->__('Backup file not found'); } catch (Mage_Backup_Exception_FtpConnectionFailed $e) { @@ -262,6 +284,10 @@ public function rollbackAction() $backupManager->setErrorMessage($errorMsg); } + if ($this->getRequest()->getParam('maintenance_mode')) { + $helper->turnOffMaintenanceMode(); + } + $this->getResponse()->setBody($response->toJson()); } @@ -292,10 +318,8 @@ public function massDeleteAction() foreach ($backupIds as $id) { list($time, $type) = explode('_', $id); - - $backupModel->setTime((int)$time) - ->setType($type) - ->setPath(Mage::helper('backup')->getBackupsDir()) + $backupModel + ->loadByTimeAndType($time, $type) ->deleteFile(); if ($backupModel->exists()) { diff --git a/app/code/core/Mage/Adminhtml/controllers/System/CacheController.php b/app/code/core/Mage/Adminhtml/controllers/System/CacheController.php index 084e44e38c..85bd35c5eb 100644 --- a/app/code/core/Mage/Adminhtml/controllers/System/CacheController.php +++ b/app/code/core/Mage/Adminhtml/controllers/System/CacheController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/System/Config/System/StorageController.php b/app/code/core/Mage/Adminhtml/controllers/System/Config/System/StorageController.php index f525f522b9..12c107201c 100644 --- a/app/code/core/Mage/Adminhtml/controllers/System/Config/System/StorageController.php +++ b/app/code/core/Mage/Adminhtml/controllers/System/Config/System/StorageController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/System/ConfigController.php b/app/code/core/Mage/Adminhtml/controllers/System/ConfigController.php index 5068421254..414ffd02fa 100644 --- a/app/code/core/Mage/Adminhtml/controllers/System/ConfigController.php +++ b/app/code/core/Mage/Adminhtml/controllers/System/ConfigController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -161,6 +161,11 @@ public function saveAction() // reinit configuration Mage::getConfig()->reinit(); + Mage::dispatchEvent('admin_system_config_section_save_after', array( + 'website' => $website, + 'store' => $store, + 'section' => $section + )); Mage::app()->reinitStores(); // website and store codes can be used in event implementation, so set them as well diff --git a/app/code/core/Mage/Adminhtml/controllers/System/Convert/GuiController.php b/app/code/core/Mage/Adminhtml/controllers/System/Convert/GuiController.php index d7e444f772..967c98666f 100644 --- a/app/code/core/Mage/Adminhtml/controllers/System/Convert/GuiController.php +++ b/app/code/core/Mage/Adminhtml/controllers/System/Convert/GuiController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/System/Convert/ProfileController.php b/app/code/core/Mage/Adminhtml/controllers/System/Convert/ProfileController.php index f87a783926..84d852ad30 100644 --- a/app/code/core/Mage/Adminhtml/controllers/System/Convert/ProfileController.php +++ b/app/code/core/Mage/Adminhtml/controllers/System/Convert/ProfileController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/System/CurrencyController.php b/app/code/core/Mage/Adminhtml/controllers/System/CurrencyController.php index 3d6c4f9d68..8d65bc1315 100644 --- a/app/code/core/Mage/Adminhtml/controllers/System/CurrencyController.php +++ b/app/code/core/Mage/Adminhtml/controllers/System/CurrencyController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -70,7 +70,9 @@ public function fetchRatesAction() throw new Exception(Mage::helper('adminhtml')->__('Invalid Import Service Specified')); } try { - $importModel = Mage::getModel(Mage::getConfig()->getNode('global/currency/import/services/' . $service . '/model')->asArray()); + $importModel = Mage::getModel( + Mage::getConfig()->getNode('global/currency/import/services/' . $service . '/model')->asArray() + ); } catch (Exception $e) { Mage::throwException(Mage::helper('adminhtml')->__('Unable to initialize import model')); } @@ -120,6 +122,6 @@ public function saveRatesAction() protected function _isAllowed() { - return Mage::getSingleton('admin/session')->isAllowed('system/currency'); + return Mage::getSingleton('admin/session')->isAllowed('system/currency/rates'); } } diff --git a/app/code/core/Mage/Adminhtml/controllers/System/DesignController.php b/app/code/core/Mage/Adminhtml/controllers/System/DesignController.php index d1a4ca900b..41e2e8fc54 100644 --- a/app/code/core/Mage/Adminhtml/controllers/System/DesignController.php +++ b/app/code/core/Mage/Adminhtml/controllers/System/DesignController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/System/Email/TemplateController.php b/app/code/core/Mage/Adminhtml/controllers/System/Email/TemplateController.php index ec57fcaee5..1310399fc4 100644 --- a/app/code/core/Mage/Adminhtml/controllers/System/Email/TemplateController.php +++ b/app/code/core/Mage/Adminhtml/controllers/System/Email/TemplateController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/System/StoreController.php b/app/code/core/Mage/Adminhtml/controllers/System/StoreController.php index 939bce68ef..e00fcd89a9 100644 --- a/app/code/core/Mage/Adminhtml/controllers/System/StoreController.php +++ b/app/code/core/Mage/Adminhtml/controllers/System/StoreController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -172,6 +172,7 @@ public function saveAction() try { switch ($postData['store_type']) { case 'website': + $postData['website']['name'] = $this->_getHelper()->removeTags($postData['website']['name']); $websiteModel = Mage::getModel('core/website'); if ($postData['website']['website_id']) { $websiteModel->load($postData['website']['website_id']); @@ -186,6 +187,7 @@ public function saveAction() break; case 'group': + $postData['group']['name'] = $this->_getHelper()->removeTags($postData['group']['name']); $groupModel = Mage::getModel('core/store_group'); if ($postData['group']['group_id']) { $groupModel->load($postData['group']['group_id']); @@ -205,6 +207,7 @@ public function saveAction() case 'store': $eventName = 'store_edit'; $storeModel = Mage::getModel('core/store'); + $postData['store']['name'] = $this->_getHelper()->removeTags($postData['store']['name']); if ($postData['store']['store_id']) { $storeModel->load($postData['store']['store_id']); } diff --git a/app/code/core/Mage/Adminhtml/controllers/System/VariableController.php b/app/code/core/Mage/Adminhtml/controllers/System/VariableController.php index 85b1bfdf7b..dde9268d86 100644 --- a/app/code/core/Mage/Adminhtml/controllers/System/VariableController.php +++ b/app/code/core/Mage/Adminhtml/controllers/System/VariableController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/SystemController.php b/app/code/core/Mage/Adminhtml/controllers/SystemController.php index 612b0c4d69..7a4e11f090 100644 --- a/app/code/core/Mage/Adminhtml/controllers/SystemController.php +++ b/app/code/core/Mage/Adminhtml/controllers/SystemController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/TagController.php b/app/code/core/Mage/Adminhtml/controllers/TagController.php index 5fff4c6eed..1241a96973 100644 --- a/app/code/core/Mage/Adminhtml/controllers/TagController.php +++ b/app/code/core/Mage/Adminhtml/controllers/TagController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Tax/Class/CustomerController.php b/app/code/core/Mage/Adminhtml/controllers/Tax/Class/CustomerController.php index 6ea3ff3f67..b664acd810 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Tax/Class/CustomerController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Tax/Class/CustomerController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Tax/Class/ProductController.php b/app/code/core/Mage/Adminhtml/controllers/Tax/Class/ProductController.php index 3e54230c77..ffdcfe96ef 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Tax/Class/ProductController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Tax/Class/ProductController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Tax/ClassController.php b/app/code/core/Mage/Adminhtml/controllers/Tax/ClassController.php index 50ec6e9de1..5474266f04 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Tax/ClassController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Tax/ClassController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -41,9 +41,6 @@ public function saveAction() { if ($postData = $this->getRequest()->getPost()) { - //filtering - $postData['class_name'] = Mage::helper('adminhtml')->stripTags($postData['class_name']); - $model = Mage::getModel('tax/class')->setData($postData); try { diff --git a/app/code/core/Mage/Adminhtml/controllers/Tax/RateController.php b/app/code/core/Mage/Adminhtml/controllers/Tax/RateController.php index 1b07be9157..5ba26a8d42 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Tax/RateController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Tax/RateController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -93,16 +93,6 @@ public function saveAction() { $ratePost = $this->getRequest()->getPost(); if ($ratePost) { - //filter tags in titles - /** @var $helper Mage_Adminhtml_Helper_Data */ - $helper = Mage::helper('adminhtml'); - $ratePost['code'] = $helper->stripTags($ratePost['code']); - if (!empty($ratePost['title'])) { - foreach ($ratePost['title'] as &$title) { - $title = $helper->stripTags($title); - } - } - $rateId = $this->getRequest()->getParam('tax_calculation_rate_id'); if ($rateId) { $rateModel = Mage::getSingleton('tax/calculation_rate')->load($rateId); @@ -302,7 +292,9 @@ protected function _importRates() $stores = array(); $unset = array(); $storeCollection = Mage::getModel('core/store')->getCollection()->setLoadDefault(false); - for ($i = count($csvFields); $i < count($csvData[0]); $i++) { + $cvsFieldsNum = count($csvFields); + $cvsDataNum = count($csvData[0]); + for ($i = $cvsFieldsNum; $i < $cvsDataNum; $i++) { $header = $csvData[0][$i]; $found = false; foreach ($storeCollection as $store) { @@ -367,7 +359,7 @@ protected function _importRates() if (!empty($regions[$v[1]][$v[2]])) { $rateData = array( - 'code' => $helper->stripTags($v[0]), + 'code' => $v[0], 'tax_country_id' => $v[1], 'tax_region_id' => ($regions[$v[1]][$v[2]] == '*') ? 0 : $regions[$v[1]][$v[2]], 'tax_postcode' => (empty($v[3]) || $v[3]=='*') ? null : $v[3], @@ -387,11 +379,6 @@ protected function _importRates() $titles[$id] = $v[$field]; } - //filter tags in titles - foreach ($titles as &$title) { - $title = $helper->stripTags($title); - } - $rateModel->setTitle($titles); $rateModel->save(); } diff --git a/app/code/core/Mage/Adminhtml/controllers/Tax/RuleController.php b/app/code/core/Mage/Adminhtml/controllers/Tax/RuleController.php index bdd9c2b8e5..2a3c7e3bc7 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Tax/RuleController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Tax/RuleController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -87,11 +87,6 @@ public function saveAction() { if ($postData = $this->getRequest()->getPost()) { - //filtering - /** @var $helper Mage_Adminhtml_Helper_Data */ - $helper = Mage::helper('adminhtml'); - $postData['code'] = $helper->stripTags($postData['code']); - $ruleModel = Mage::getSingleton('tax/calculation_rule'); $ruleModel->setData($postData); diff --git a/app/code/core/Mage/Adminhtml/controllers/UrlrewriteController.php b/app/code/core/Mage/Adminhtml/controllers/UrlrewriteController.php index cd4714c918..7e711d38c1 100644 --- a/app/code/core/Mage/Adminhtml/controllers/UrlrewriteController.php +++ b/app/code/core/Mage/Adminhtml/controllers/UrlrewriteController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/etc/adminhtml.xml b/app/code/core/Mage/Adminhtml/etc/adminhtml.xml index e1b1c761e9..8bb0440246 100644 --- a/app/code/core/Mage/Adminhtml/etc/adminhtml.xml +++ b/app/code/core/Mage/Adminhtml/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Adminhtml/etc/config.xml b/app/code/core/Mage/Adminhtml/etc/config.xml index 569b189ee5..16d9da1205 100644 --- a/app/code/core/Mage/Adminhtml/etc/config.xml +++ b/app/code/core/Mage/Adminhtml/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -199,6 +199,12 @@ + + + + 1 + + diff --git a/app/code/core/Mage/Adminhtml/etc/jstranslator.xml b/app/code/core/Mage/Adminhtml/etc/jstranslator.xml new file mode 100644 index 0000000000..5b5c3b35ce --- /dev/null +++ b/app/code/core/Mage/Adminhtml/etc/jstranslator.xml @@ -0,0 +1,65 @@ + + + + + + Complete + + + Upload Security Error + + + Upload HTTP Error + + + Upload I/O Error + + + SSL Error: Invalid or self-signed certificate + + + Tb + + + Gb + + + Mb + + + Kb + + + b + + + + Add Products + + + diff --git a/app/code/core/Mage/Api/Controller/Action.php b/app/code/core/Mage/Api/Controller/Action.php index 393ef72b11..08d6f7728d 100644 --- a/app/code/core/Mage/Api/Controller/Action.php +++ b/app/code/core/Mage/Api/Controller/Action.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Exception.php b/app/code/core/Mage/Api/Exception.php index 2e52caaa08..ebd3fd8de6 100644 --- a/app/code/core/Mage/Api/Exception.php +++ b/app/code/core/Mage/Api/Exception.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Helper/Data.php b/app/code/core/Mage/Api/Helper/Data.php index 0ededf8474..b604fc672b 100644 --- a/app/code/core/Mage/Api/Helper/Data.php +++ b/app/code/core/Mage/Api/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Acl.php b/app/code/core/Mage/Api/Model/Acl.php index 1628ac3626..3b1553f3c8 100644 --- a/app/code/core/Mage/Api/Model/Acl.php +++ b/app/code/core/Mage/Api/Model/Acl.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Acl/Assert/Ip.php b/app/code/core/Mage/Api/Model/Acl/Assert/Ip.php index 658ba81f7b..9fdd35910f 100644 --- a/app/code/core/Mage/Api/Model/Acl/Assert/Ip.php +++ b/app/code/core/Mage/Api/Model/Acl/Assert/Ip.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Acl/Assert/Time.php b/app/code/core/Mage/Api/Model/Acl/Assert/Time.php index a3ed54283e..b72f281d8a 100644 --- a/app/code/core/Mage/Api/Model/Acl/Assert/Time.php +++ b/app/code/core/Mage/Api/Model/Acl/Assert/Time.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Acl/Resource.php b/app/code/core/Mage/Api/Model/Acl/Resource.php index 514819c0be..1157e6da21 100644 --- a/app/code/core/Mage/Api/Model/Acl/Resource.php +++ b/app/code/core/Mage/Api/Model/Acl/Resource.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Acl/Role.php b/app/code/core/Mage/Api/Model/Acl/Role.php index c02e51eb41..e2e98de946 100644 --- a/app/code/core/Mage/Api/Model/Acl/Role.php +++ b/app/code/core/Mage/Api/Model/Acl/Role.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Acl/Role/Generic.php b/app/code/core/Mage/Api/Model/Acl/Role/Generic.php index 3a145bd249..4323e48c1e 100644 --- a/app/code/core/Mage/Api/Model/Acl/Role/Generic.php +++ b/app/code/core/Mage/Api/Model/Acl/Role/Generic.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Acl/Role/Group.php b/app/code/core/Mage/Api/Model/Acl/Role/Group.php index ebb710d7b0..fc6ca50bb7 100644 --- a/app/code/core/Mage/Api/Model/Acl/Role/Group.php +++ b/app/code/core/Mage/Api/Model/Acl/Role/Group.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Acl/Role/Registry.php b/app/code/core/Mage/Api/Model/Acl/Role/Registry.php index 6744f5ef53..0a42cc0efb 100644 --- a/app/code/core/Mage/Api/Model/Acl/Role/Registry.php +++ b/app/code/core/Mage/Api/Model/Acl/Role/Registry.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Acl/Role/User.php b/app/code/core/Mage/Api/Model/Acl/Role/User.php index dde5d2b311..bade58da92 100644 --- a/app/code/core/Mage/Api/Model/Acl/Role/User.php +++ b/app/code/core/Mage/Api/Model/Acl/Role/User.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Config.php b/app/code/core/Mage/Api/Model/Config.php index 17493ea4e3..625cc3af01 100644 --- a/app/code/core/Mage/Api/Model/Config.php +++ b/app/code/core/Mage/Api/Model/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Mysql4/Acl.php b/app/code/core/Mage/Api/Model/Mysql4/Acl.php index 9ff943da8f..1d8d0229fa 100644 --- a/app/code/core/Mage/Api/Model/Mysql4/Acl.php +++ b/app/code/core/Mage/Api/Model/Mysql4/Acl.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Mysql4/Acl/Role.php b/app/code/core/Mage/Api/Model/Mysql4/Acl/Role.php index a50733e659..50aa5a3776 100644 --- a/app/code/core/Mage/Api/Model/Mysql4/Acl/Role.php +++ b/app/code/core/Mage/Api/Model/Mysql4/Acl/Role.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Mysql4/Acl/Role/Collection.php b/app/code/core/Mage/Api/Model/Mysql4/Acl/Role/Collection.php index 7598e6b0d9..d5262cb24b 100644 --- a/app/code/core/Mage/Api/Model/Mysql4/Acl/Role/Collection.php +++ b/app/code/core/Mage/Api/Model/Mysql4/Acl/Role/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Mysql4/Permissions/Collection.php b/app/code/core/Mage/Api/Model/Mysql4/Permissions/Collection.php index e6015d197e..05144cb41e 100644 --- a/app/code/core/Mage/Api/Model/Mysql4/Permissions/Collection.php +++ b/app/code/core/Mage/Api/Model/Mysql4/Permissions/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Mysql4/Role.php b/app/code/core/Mage/Api/Model/Mysql4/Role.php index ca8f5cc5c4..c707b68ef8 100644 --- a/app/code/core/Mage/Api/Model/Mysql4/Role.php +++ b/app/code/core/Mage/Api/Model/Mysql4/Role.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Mysql4/Role/Collection.php b/app/code/core/Mage/Api/Model/Mysql4/Role/Collection.php index 2c94348a7d..f59a5d8281 100644 --- a/app/code/core/Mage/Api/Model/Mysql4/Role/Collection.php +++ b/app/code/core/Mage/Api/Model/Mysql4/Role/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Mysql4/Roles.php b/app/code/core/Mage/Api/Model/Mysql4/Roles.php index 209c985815..bffa047717 100644 --- a/app/code/core/Mage/Api/Model/Mysql4/Roles.php +++ b/app/code/core/Mage/Api/Model/Mysql4/Roles.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Mysql4/Roles/Collection.php b/app/code/core/Mage/Api/Model/Mysql4/Roles/Collection.php index 0f6c513b41..f8e5affa13 100644 --- a/app/code/core/Mage/Api/Model/Mysql4/Roles/Collection.php +++ b/app/code/core/Mage/Api/Model/Mysql4/Roles/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Mysql4/Roles/User/Collection.php b/app/code/core/Mage/Api/Model/Mysql4/Roles/User/Collection.php index be7bbf97d0..4d243aeaec 100644 --- a/app/code/core/Mage/Api/Model/Mysql4/Roles/User/Collection.php +++ b/app/code/core/Mage/Api/Model/Mysql4/Roles/User/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Mysql4/Rules.php b/app/code/core/Mage/Api/Model/Mysql4/Rules.php index 3237831e64..6246f8b9aa 100644 --- a/app/code/core/Mage/Api/Model/Mysql4/Rules.php +++ b/app/code/core/Mage/Api/Model/Mysql4/Rules.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Mysql4/Rules/Collection.php b/app/code/core/Mage/Api/Model/Mysql4/Rules/Collection.php index b6c66248f7..88acda2fa1 100644 --- a/app/code/core/Mage/Api/Model/Mysql4/Rules/Collection.php +++ b/app/code/core/Mage/Api/Model/Mysql4/Rules/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Mysql4/User.php b/app/code/core/Mage/Api/Model/Mysql4/User.php index 86220cbb98..6e57f86ce1 100644 --- a/app/code/core/Mage/Api/Model/Mysql4/User.php +++ b/app/code/core/Mage/Api/Model/Mysql4/User.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Mysql4/User/Collection.php b/app/code/core/Mage/Api/Model/Mysql4/User/Collection.php index 034cf40feb..f7e1abe42b 100644 --- a/app/code/core/Mage/Api/Model/Mysql4/User/Collection.php +++ b/app/code/core/Mage/Api/Model/Mysql4/User/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Resource/Abstract.php b/app/code/core/Mage/Api/Model/Resource/Abstract.php index 7bbbc3dac3..f5be48b1db 100644 --- a/app/code/core/Mage/Api/Model/Resource/Abstract.php +++ b/app/code/core/Mage/Api/Model/Resource/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Resource/Acl.php b/app/code/core/Mage/Api/Model/Resource/Acl.php index 1227dd81db..7dd755de5e 100755 --- a/app/code/core/Mage/Api/Model/Resource/Acl.php +++ b/app/code/core/Mage/Api/Model/Resource/Acl.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Resource/Acl/Role.php b/app/code/core/Mage/Api/Model/Resource/Acl/Role.php index e08ee84138..cc357cc4cf 100755 --- a/app/code/core/Mage/Api/Model/Resource/Acl/Role.php +++ b/app/code/core/Mage/Api/Model/Resource/Acl/Role.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Resource/Acl/Role/Collection.php b/app/code/core/Mage/Api/Model/Resource/Acl/Role/Collection.php index 7e22a04e53..2cf5fed260 100755 --- a/app/code/core/Mage/Api/Model/Resource/Acl/Role/Collection.php +++ b/app/code/core/Mage/Api/Model/Resource/Acl/Role/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Resource/Permissions/Collection.php b/app/code/core/Mage/Api/Model/Resource/Permissions/Collection.php index 70b71f3495..a2a410b0a8 100755 --- a/app/code/core/Mage/Api/Model/Resource/Permissions/Collection.php +++ b/app/code/core/Mage/Api/Model/Resource/Permissions/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Resource/Role.php b/app/code/core/Mage/Api/Model/Resource/Role.php index 72524dc513..49fa7949e7 100755 --- a/app/code/core/Mage/Api/Model/Resource/Role.php +++ b/app/code/core/Mage/Api/Model/Resource/Role.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Resource/Role/Collection.php b/app/code/core/Mage/Api/Model/Resource/Role/Collection.php index 5c81104446..48a44d8383 100755 --- a/app/code/core/Mage/Api/Model/Resource/Role/Collection.php +++ b/app/code/core/Mage/Api/Model/Resource/Role/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Resource/Roles.php b/app/code/core/Mage/Api/Model/Resource/Roles.php index 32eadd0844..61578c7cf4 100755 --- a/app/code/core/Mage/Api/Model/Resource/Roles.php +++ b/app/code/core/Mage/Api/Model/Resource/Roles.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Resource/Roles/Collection.php b/app/code/core/Mage/Api/Model/Resource/Roles/Collection.php index 19b7079af3..c9f28635e7 100755 --- a/app/code/core/Mage/Api/Model/Resource/Roles/Collection.php +++ b/app/code/core/Mage/Api/Model/Resource/Roles/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Resource/Roles/User/Collection.php b/app/code/core/Mage/Api/Model/Resource/Roles/User/Collection.php index 5097f691f4..4f86e35393 100755 --- a/app/code/core/Mage/Api/Model/Resource/Roles/User/Collection.php +++ b/app/code/core/Mage/Api/Model/Resource/Roles/User/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Resource/Rules.php b/app/code/core/Mage/Api/Model/Resource/Rules.php index 8a5047ae5a..16311f1dcf 100755 --- a/app/code/core/Mage/Api/Model/Resource/Rules.php +++ b/app/code/core/Mage/Api/Model/Resource/Rules.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Resource/Rules/Collection.php b/app/code/core/Mage/Api/Model/Resource/Rules/Collection.php index 311c947c35..96359c3ddc 100755 --- a/app/code/core/Mage/Api/Model/Resource/Rules/Collection.php +++ b/app/code/core/Mage/Api/Model/Resource/Rules/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Resource/User.php b/app/code/core/Mage/Api/Model/Resource/User.php index 51c41346db..b137f8a9fb 100755 --- a/app/code/core/Mage/Api/Model/Resource/User.php +++ b/app/code/core/Mage/Api/Model/Resource/User.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Resource/User/Collection.php b/app/code/core/Mage/Api/Model/Resource/User/Collection.php index 172cba76c2..daccae70c6 100755 --- a/app/code/core/Mage/Api/Model/Resource/User/Collection.php +++ b/app/code/core/Mage/Api/Model/Resource/User/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Role.php b/app/code/core/Mage/Api/Model/Role.php index 86ad97c3e6..70268c7667 100644 --- a/app/code/core/Mage/Api/Model/Role.php +++ b/app/code/core/Mage/Api/Model/Role.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Roles.php b/app/code/core/Mage/Api/Model/Roles.php index 734eb9dca6..3b4173608f 100644 --- a/app/code/core/Mage/Api/Model/Roles.php +++ b/app/code/core/Mage/Api/Model/Roles.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Rules.php b/app/code/core/Mage/Api/Model/Rules.php index 8e24e21b67..38d2649c71 100644 --- a/app/code/core/Mage/Api/Model/Rules.php +++ b/app/code/core/Mage/Api/Model/Rules.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Server.php b/app/code/core/Mage/Api/Model/Server.php index 2f77af4e7d..9a24a319ac 100644 --- a/app/code/core/Mage/Api/Model/Server.php +++ b/app/code/core/Mage/Api/Model/Server.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Server/Adapter/Interface.php b/app/code/core/Mage/Api/Model/Server/Adapter/Interface.php index f5ee1916e7..e48430c4f6 100644 --- a/app/code/core/Mage/Api/Model/Server/Adapter/Interface.php +++ b/app/code/core/Mage/Api/Model/Server/Adapter/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Server/Adapter/Soap.php b/app/code/core/Mage/Api/Model/Server/Adapter/Soap.php index aca1f93179..7f84c82a99 100644 --- a/app/code/core/Mage/Api/Model/Server/Adapter/Soap.php +++ b/app/code/core/Mage/Api/Model/Server/Adapter/Soap.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Server/Adapter/Xmlrpc.php b/app/code/core/Mage/Api/Model/Server/Adapter/Xmlrpc.php index e5dfdf8ebc..18b8bebeaf 100644 --- a/app/code/core/Mage/Api/Model/Server/Adapter/Xmlrpc.php +++ b/app/code/core/Mage/Api/Model/Server/Adapter/Xmlrpc.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Server/Handler.php b/app/code/core/Mage/Api/Model/Server/Handler.php index 29b42ef0cf..4c4181b77e 100644 --- a/app/code/core/Mage/Api/Model/Server/Handler.php +++ b/app/code/core/Mage/Api/Model/Server/Handler.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Server/Handler/Abstract.php b/app/code/core/Mage/Api/Model/Server/Handler/Abstract.php index d379edd75a..366e4b2ccd 100644 --- a/app/code/core/Mage/Api/Model/Server/Handler/Abstract.php +++ b/app/code/core/Mage/Api/Model/Server/Handler/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Server/V2/Adapter/Soap.php b/app/code/core/Mage/Api/Model/Server/V2/Adapter/Soap.php index 76525dea76..b14c14db5f 100644 --- a/app/code/core/Mage/Api/Model/Server/V2/Adapter/Soap.php +++ b/app/code/core/Mage/Api/Model/Server/V2/Adapter/Soap.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Server/V2/Handler.php b/app/code/core/Mage/Api/Model/Server/V2/Handler.php index 37dd4da8e9..a593dcf5cf 100644 --- a/app/code/core/Mage/Api/Model/Server/V2/Handler.php +++ b/app/code/core/Mage/Api/Model/Server/V2/Handler.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Server/Wsi/Adapter/Soap.php b/app/code/core/Mage/Api/Model/Server/Wsi/Adapter/Soap.php index 846342c6e5..f4badbaf8e 100644 --- a/app/code/core/Mage/Api/Model/Server/Wsi/Adapter/Soap.php +++ b/app/code/core/Mage/Api/Model/Server/Wsi/Adapter/Soap.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Server/Wsi/Handler.php b/app/code/core/Mage/Api/Model/Server/Wsi/Handler.php index 4c4b560ed3..fa829c3e18 100644 --- a/app/code/core/Mage/Api/Model/Server/Wsi/Handler.php +++ b/app/code/core/Mage/Api/Model/Server/Wsi/Handler.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Session.php b/app/code/core/Mage/Api/Model/Session.php index c65a00ec91..c97d4b38f2 100644 --- a/app/code/core/Mage/Api/Model/Session.php +++ b/app/code/core/Mage/Api/Model/Session.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/User.php b/app/code/core/Mage/Api/Model/User.php index bab0b0d3be..acd296e40f 100644 --- a/app/code/core/Mage/Api/Model/User.php +++ b/app/code/core/Mage/Api/Model/User.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -56,6 +56,13 @@ */ class Mage_Api_Model_User extends Mage_Core_Model_Abstract { + /** + * Prefix of model events names + * + * @var string + */ + protected $_eventPrefix = 'api_user'; + protected function _construct() { $this->_init('api/user'); diff --git a/app/code/core/Mage/Api/Model/Wsdl/Config.php b/app/code/core/Mage/Api/Model/Wsdl/Config.php index b7921a624e..3db7bbf357 100644 --- a/app/code/core/Mage/Api/Model/Wsdl/Config.php +++ b/app/code/core/Mage/Api/Model/Wsdl/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Wsdl/Config/Base.php b/app/code/core/Mage/Api/Model/Wsdl/Config/Base.php index a4dc792db2..fbe95f1f70 100644 --- a/app/code/core/Mage/Api/Model/Wsdl/Config/Base.php +++ b/app/code/core/Mage/Api/Model/Wsdl/Config/Base.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Wsdl/Config/Element.php b/app/code/core/Mage/Api/Model/Wsdl/Config/Element.php index 77936b6dcb..3db75353b0 100644 --- a/app/code/core/Mage/Api/Model/Wsdl/Config/Element.php +++ b/app/code/core/Mage/Api/Model/Wsdl/Config/Element.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/controllers/IndexController.php b/app/code/core/Mage/Api/controllers/IndexController.php index fb72455997..39753e5924 100644 --- a/app/code/core/Mage/Api/controllers/IndexController.php +++ b/app/code/core/Mage/Api/controllers/IndexController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/controllers/SoapController.php b/app/code/core/Mage/Api/controllers/SoapController.php index 3674c65c25..91f4ec7b8c 100644 --- a/app/code/core/Mage/Api/controllers/SoapController.php +++ b/app/code/core/Mage/Api/controllers/SoapController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/controllers/V2/SoapController.php b/app/code/core/Mage/Api/controllers/V2/SoapController.php index f9516d7d13..e75b8fa674 100644 --- a/app/code/core/Mage/Api/controllers/V2/SoapController.php +++ b/app/code/core/Mage/Api/controllers/V2/SoapController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/controllers/XmlrpcController.php b/app/code/core/Mage/Api/controllers/XmlrpcController.php index 29a0edb8b4..1573ed5906 100644 --- a/app/code/core/Mage/Api/controllers/XmlrpcController.php +++ b/app/code/core/Mage/Api/controllers/XmlrpcController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/etc/adminhtml.xml b/app/code/core/Mage/Api/etc/adminhtml.xml index 937d456279..10bbb8116b 100644 --- a/app/code/core/Mage/Api/etc/adminhtml.xml +++ b/app/code/core/Mage/Api/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Api/etc/api.xml b/app/code/core/Mage/Api/etc/api.xml index c1a87b83b2..6c33f82659 100644 --- a/app/code/core/Mage/Api/etc/api.xml +++ b/app/code/core/Mage/Api/etc/api.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Api/etc/config.xml b/app/code/core/Mage/Api/etc/config.xml index bd8f5dec55..695d6d6ae9 100644 --- a/app/code/core/Mage/Api/etc/config.xml +++ b/app/code/core/Mage/Api/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Api/etc/system.xml b/app/code/core/Mage/Api/etc/system.xml index 74ce1d8a92..6e37ba6db0 100644 --- a/app/code/core/Mage/Api/etc/system.xml +++ b/app/code/core/Mage/Api/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Api/sql/api_setup/install-1.6.0.0.php b/app/code/core/Mage/Api/sql/api_setup/install-1.6.0.0.php index 361b29a5ef..eed4483e8b 100644 --- a/app/code/core/Mage/Api/sql/api_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Api/sql/api_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/sql/api_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/Api/sql/api_setup/mysql4-install-0.7.0.php index ac5ce1694d..95c14b21d9 100644 --- a/app/code/core/Mage/Api/sql/api_setup/mysql4-install-0.7.0.php +++ b/app/code/core/Mage/Api/sql/api_setup/mysql4-install-0.7.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/sql/api_setup/mysql4-upgrade-0.7.0-0.7.1.php b/app/code/core/Mage/Api/sql/api_setup/mysql4-upgrade-0.7.0-0.7.1.php index 156f9ee277..08eb72fc2e 100644 --- a/app/code/core/Mage/Api/sql/api_setup/mysql4-upgrade-0.7.0-0.7.1.php +++ b/app/code/core/Mage/Api/sql/api_setup/mysql4-upgrade-0.7.0-0.7.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/sql/api_setup/mysql4-upgrade-0.8.0-0.8.1.php b/app/code/core/Mage/Api/sql/api_setup/mysql4-upgrade-0.8.0-0.8.1.php index dc6fbf5183..e83ccbb695 100644 --- a/app/code/core/Mage/Api/sql/api_setup/mysql4-upgrade-0.8.0-0.8.1.php +++ b/app/code/core/Mage/Api/sql/api_setup/mysql4-upgrade-0.8.0-0.8.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/sql/api_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/Api/sql/api_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php index 993eb145eb..1081ffb9b4 100644 --- a/app/code/core/Mage/Api/sql/api_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ b/app/code/core/Mage/Api/sql/api_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Authorizenet/Block/Directpost/Form.php b/app/code/core/Mage/Authorizenet/Block/Directpost/Form.php index 0890f9dd96..25841f4cbb 100644 --- a/app/code/core/Mage/Authorizenet/Block/Directpost/Form.php +++ b/app/code/core/Mage/Authorizenet/Block/Directpost/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Authorizenet - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Authorizenet/Block/Directpost/Iframe.php b/app/code/core/Mage/Authorizenet/Block/Directpost/Iframe.php index 3457324bdb..7ee81765b1 100644 --- a/app/code/core/Mage/Authorizenet/Block/Directpost/Iframe.php +++ b/app/code/core/Mage/Authorizenet/Block/Directpost/Iframe.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Authorizenet - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Authorizenet/Helper/Data.php b/app/code/core/Mage/Authorizenet/Helper/Data.php index ea24707acf..2786189a44 100755 --- a/app/code/core/Mage/Authorizenet/Helper/Data.php +++ b/app/code/core/Mage/Authorizenet/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Authorizenet - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Authorizenet/Model/Directpost.php b/app/code/core/Mage/Authorizenet/Model/Directpost.php index 4594259026..c6346365ae 100644 --- a/app/code/core/Mage/Authorizenet/Model/Directpost.php +++ b/app/code/core/Mage/Authorizenet/Model/Directpost.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Authorizenet - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Authorizenet/Model/Directpost/Observer.php b/app/code/core/Mage/Authorizenet/Model/Directpost/Observer.php index ed88cc1d49..92436826e2 100644 --- a/app/code/core/Mage/Authorizenet/Model/Directpost/Observer.php +++ b/app/code/core/Mage/Authorizenet/Model/Directpost/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Authorizenet - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Authorizenet/Model/Directpost/Request.php b/app/code/core/Mage/Authorizenet/Model/Directpost/Request.php index 2d66651dff..57fcd15eeb 100644 --- a/app/code/core/Mage/Authorizenet/Model/Directpost/Request.php +++ b/app/code/core/Mage/Authorizenet/Model/Directpost/Request.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Authorizenet - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Authorizenet/Model/Directpost/Response.php b/app/code/core/Mage/Authorizenet/Model/Directpost/Response.php index 4f47518cae..9486793f88 100644 --- a/app/code/core/Mage/Authorizenet/Model/Directpost/Response.php +++ b/app/code/core/Mage/Authorizenet/Model/Directpost/Response.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Authorizenet - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Authorizenet/Model/Directpost/Session.php b/app/code/core/Mage/Authorizenet/Model/Directpost/Session.php index b7b9d53be1..a827b6deb3 100644 --- a/app/code/core/Mage/Authorizenet/Model/Directpost/Session.php +++ b/app/code/core/Mage/Authorizenet/Model/Directpost/Session.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Authorizenet - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Authorizenet/controllers/Adminhtml/Authorizenet/Directpost/PaymentController.php b/app/code/core/Mage/Authorizenet/controllers/Adminhtml/Authorizenet/Directpost/PaymentController.php index 87a0c56529..0243186fea 100644 --- a/app/code/core/Mage/Authorizenet/controllers/Adminhtml/Authorizenet/Directpost/PaymentController.php +++ b/app/code/core/Mage/Authorizenet/controllers/Adminhtml/Authorizenet/Directpost/PaymentController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Authorizenet - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Authorizenet/controllers/Directpost/PaymentController.php b/app/code/core/Mage/Authorizenet/controllers/Directpost/PaymentController.php index 99bdaf27ad..a2c53d479d 100644 --- a/app/code/core/Mage/Authorizenet/controllers/Directpost/PaymentController.php +++ b/app/code/core/Mage/Authorizenet/controllers/Directpost/PaymentController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Authorizenet - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Authorizenet/etc/config.xml b/app/code/core/Mage/Authorizenet/etc/config.xml index d2a7ff547d..1a611ad073 100755 --- a/app/code/core/Mage/Authorizenet/etc/config.xml +++ b/app/code/core/Mage/Authorizenet/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Authorizenet - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Authorizenet/etc/system.xml b/app/code/core/Mage/Authorizenet/etc/system.xml index 951b1e4a06..e487f8a589 100755 --- a/app/code/core/Mage/Authorizenet/etc/system.xml +++ b/app/code/core/Mage/Authorizenet/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Authorizenet - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Backup/Exception.php b/app/code/core/Mage/Backup/Exception.php index 8be06068a2..cbdfdc8a4e 100644 --- a/app/code/core/Mage/Backup/Exception.php +++ b/app/code/core/Mage/Backup/Exception.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Backup - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Backup/Helper/Data.php b/app/code/core/Mage/Backup/Helper/Data.php index c937758309..f08d8f23be 100644 --- a/app/code/core/Mage/Backup/Helper/Data.php +++ b/app/code/core/Mage/Backup/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Backup - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -31,31 +31,28 @@ class Mage_Backup_Helper_Data extends Mage_Core_Helper_Abstract { /** * Backup type constant for database backup - * - * @const string */ - const TYPE_DB = 'db'; + const TYPE_DB = 'db'; /** * Backup type constant for filesystem backup - * - * @const string */ - const TYPE_FILESYSTEM = 'filesystem'; + const TYPE_FILESYSTEM = 'filesystem'; /** * Backup type constant for full system backup(database + filesystem) - * - * @const string */ const TYPE_SYSTEM_SNAPSHOT = 'snapshot'; /** * Backup type constant for media and database backup - * - * @const string */ - const TYPE_MEDIA = 'media'; + const TYPE_MEDIA = 'media'; + + /** + * Backup type constant for full system backup excluding media folder + */ + const TYPE_SNAPSHOT_WITHOUT_MEDIA = 'nomedia'; /** * Get all possible backup type values with descriptive title @@ -67,7 +64,8 @@ public function getBackupTypes() return array( self::TYPE_DB => self::__('Database'), self::TYPE_MEDIA => self::__('Database and Media'), - self::TYPE_SYSTEM_SNAPSHOT => self::__('System') + self::TYPE_SYSTEM_SNAPSHOT => self::__('System'), + self::TYPE_SNAPSHOT_WITHOUT_MEDIA => self::__('System (excluding Media)') ); } @@ -81,6 +79,7 @@ public function getBackupTypesList() return array( self::TYPE_DB, self::TYPE_SYSTEM_SNAPSHOT, + self::TYPE_SNAPSHOT_WITHOUT_MEDIA, self::TYPE_MEDIA ); } @@ -126,6 +125,7 @@ public function getExtensions() { return array( self::TYPE_SYSTEM_SNAPSHOT => 'tgz', + self::TYPE_SNAPSHOT_WITHOUT_MEDIA => 'tgz', self::TYPE_MEDIA => 'tgz', self::TYPE_DB => 'gz' ); @@ -224,6 +224,7 @@ public function getCreateSuccessMessageByType($type) { $messagesMap = array( self::TYPE_SYSTEM_SNAPSHOT => $this->__('The system backup has been created.'), + self::TYPE_SNAPSHOT_WITHOUT_MEDIA => $this->__('The system backup has been created.'), self::TYPE_MEDIA => $this->__('The database and media backup has been created.'), self::TYPE_DB => $this->__('The database backup has been created.') ); @@ -270,4 +271,53 @@ public function invalidateIndexer() } return $this; } + + /** + * Creates backup's display name from it's name + * + * @param string $name + * @return string + */ + public function nameToDisplayName($name) + { + return str_replace('_', ' ', $name); + } + + /** + * Extracts information from backup's filename + * + * @param string $filename + * @return Varien_Object + */ + public function extractDataFromFilename($filename) + { + $extensions = $this->getExtensions(); + + $filenameWithoutExtension = $filename; + + foreach ($extensions as $extension) { + $filenameWithoutExtension = preg_replace('/' . preg_quote($extension, '/') . '$/', '', + $filenameWithoutExtension + ); + } + + $filenameWithoutExtension = substr($filenameWithoutExtension, 0, strrpos($filenameWithoutExtension, ".")); + + list($time, $type) = explode("_", $filenameWithoutExtension); + + $name = str_replace($time . '_' . $type, '', $filenameWithoutExtension); + + if (!empty($name)) { + $name = substr($name, 1); + } + + $result = new Varien_Object(); + $result->addData(array( + 'name' => $name, + 'type' => $type, + 'time' => $time + )); + + return $result; + } } diff --git a/app/code/core/Mage/Backup/Model/Backup.php b/app/code/core/Mage/Backup/Model/Backup.php index 84cf07818c..17ecaa3a44 100644 --- a/app/code/core/Mage/Backup/Model/Backup.php +++ b/app/code/core/Mage/Backup/Model/Backup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Backup - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -59,28 +59,19 @@ class Mage_Backup_Model_Backup extends Varien_Object */ public function load($fileName, $filePath) { - $extensions = Mage::helper('backup')->getExtensions(); - - $fileNameWithoutExtension = $fileName; - - foreach ($extensions as $extension) { - $fileNameWithoutExtension = preg_replace('/' . preg_quote($extension, '/') . '$/', '', - $fileNameWithoutExtension - ); - } - - list ($time, $type) = explode("_", substr($fileNameWithoutExtension, 0, - strrpos($fileNameWithoutExtension, ".") - )); + $backupData = Mage::helper('backup')->extractDataFromFilename($fileName); $this->addData(array( 'id' => $filePath . DS . $fileName, - 'time' => (int)$time, + 'time' => (int)$backupData->getTime(), 'path' => $filePath, - 'extension' => Mage::helper('backup')->getExtensionByType($type), - 'date_object' => new Zend_Date((int)$time, Mage::app()->getLocale()->getLocaleCode()) + 'extension' => Mage::helper('backup')->getExtensionByType($backupData->getType()), + 'display_name' => Mage::helper('backup')->nameToDisplayName($backupData->getName()), + 'name' => $backupData->getName(), + 'date_object' => new Zend_Date((int)$backupData->getTime(), Mage::app()->getLocale()->getLocaleCode()) )); - $this->setType($type); + + $this->setType($backupData->getType()); return $this; } @@ -101,14 +92,23 @@ public function exists() */ public function getFileName() { - return $this->getTime() . "_" . $this->getType() - . "." . Mage::helper('backup')->getExtensionByType($this->getType()); + $filename = $this->getTime() . "_" . $this->getType(); + $backupName = $this->getName(); + + if (!empty($backupName)) { + $filename .= '_' . $backupName; + } + + $filename .= '.' . Mage::helper('backup')->getExtensionByType($this->getType()); + + return $filename; } /** * Sets type of file * * @param string $value + * @return Mage_Backup_Model_Backup */ public function setType($value='db') { @@ -214,6 +214,7 @@ public function &getFile() * Delete backup file * * @throws Mage_Backup_Exception + * @return Mage_Backup_Model_Backup */ public function deleteFile() { @@ -373,4 +374,29 @@ public function validateUserPassword($password) $userPasswordHash = Mage::getModel('admin/session')->getUser()->getPassword(); return Mage::helper('core')->validateHash($password, $userPasswordHash); } + + /** + * Load backup by it's type and creation timestamp + * + * @param int $timestamp + * @param string $type + * @return Mage_Backup_Model_Backup + */ + public function loadByTimeAndType($timestamp, $type) + { + $backupsCollection = Mage::getSingleton('backup/fs_collection'); + $backupId = $timestamp . '_' . $type; + + foreach ($backupsCollection as $backup) { + if ($backup->getId() == $backupId) { + $this->setType($backup->getType()) + ->setTime($backup->getTime()) + ->setName($backup->getName()) + ->setPath($backup->getPath()); + break; + } + } + + return $this; + } } diff --git a/app/code/core/Mage/Backup/Model/Config/Backend/Cron.php b/app/code/core/Mage/Backup/Model/Config/Backend/Cron.php index 34dbf9d066..622ffd4c44 100644 --- a/app/code/core/Mage/Backup/Model/Config/Backend/Cron.php +++ b/app/code/core/Mage/Backup/Model/Config/Backend/Cron.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Backup - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Backup/Model/Config/Source/Type.php b/app/code/core/Mage/Backup/Model/Config/Source/Type.php index 75234eeb14..865d9c61e9 100644 --- a/app/code/core/Mage/Backup/Model/Config/Source/Type.php +++ b/app/code/core/Mage/Backup/Model/Config/Source/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Backup - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Backup/Model/Db.php b/app/code/core/Mage/Backup/Model/Db.php index 92818ae037..22e11e59e7 100644 --- a/app/code/core/Mage/Backup/Model/Db.php +++ b/app/code/core/Mage/Backup/Model/Db.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Backup - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -37,10 +37,19 @@ class Mage_Backup_Model_Db /** * Buffer length for multi rows - * default 512 Kb + * default 100 Kb * */ - const BUFFER_LENGTH = 524288; + const BUFFER_LENGTH = 102400; + + /** + * List of tables which data should not be backed up + * + * @var array + */ + protected $_ignoreDataTablesList = array( + 'importexport/importdata' + ); /** * Retrieve resource model @@ -108,13 +117,16 @@ public function createBackup(Mage_Backup_Model_Backup $backup) $backup->write($this->getResource()->getHeader()); + $ignoreDataTablesList = $this->getIgnoreDataTablesList(); + foreach ($tables as $table) { - $backup->write($this->getResource()->getTableHeader($table) . $this->getResource()->getTableDropSql($table) . "\n"); + $backup->write($this->getResource()->getTableHeader($table) + . $this->getResource()->getTableDropSql($table) . "\n"); $backup->write($this->getResource()->getTableCreateSql($table, false) . "\n"); $tableStatus = $this->getResource()->getTableStatus($table); - if ($tableStatus->getRows()) { + if ($tableStatus->getRows() && !in_array($table, $ignoreDataTablesList)) { $backup->write($this->getResource()->getTableDataBeforeSql($table)); if ($tableStatus->getDataLength() > self::BUFFER_LENGTH) { @@ -149,4 +161,20 @@ public function createBackup(Mage_Backup_Model_Backup $backup) return $this; } + /**. + * Returns the list of tables which data should not be backed up + * + * @return array + */ + public function getIgnoreDataTablesList() + { + $result = array(); + $resource = Mage::getSingleton('core/resource'); + + foreach ($this->_ignoreDataTablesList as $table) { + $result[] = $resource->getTableName($table); + } + + return $result; + } } diff --git a/app/code/core/Mage/Backup/Model/Fs/Collection.php b/app/code/core/Mage/Backup/Model/Fs/Collection.php index c95398fbde..38e45dc375 100644 --- a/app/code/core/Mage/Backup/Model/Fs/Collection.php +++ b/app/code/core/Mage/Backup/Model/Fs/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Backup - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Backup/Model/Mysql4/Db.php b/app/code/core/Mage/Backup/Model/Mysql4/Db.php index f93c45100b..12266fffde 100644 --- a/app/code/core/Mage/Backup/Model/Mysql4/Db.php +++ b/app/code/core/Mage/Backup/Model/Mysql4/Db.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Backup - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Backup/Model/Observer.php b/app/code/core/Mage/Backup/Model/Observer.php index ff773d637e..c2eb1f2167 100644 --- a/app/code/core/Mage/Backup/Model/Observer.php +++ b/app/code/core/Mage/Backup/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Backup - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Backup/Model/Resource/Db.php b/app/code/core/Mage/Backup/Model/Resource/Db.php index bf2a9ce325..07d66e92c2 100755 --- a/app/code/core/Mage/Backup/Model/Resource/Db.php +++ b/app/code/core/Mage/Backup/Model/Resource/Db.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Backup - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Backup/Model/Resource/Helper/Mysql4.php b/app/code/core/Mage/Backup/Model/Resource/Helper/Mysql4.php index 1693b188b3..28a1e63fc9 100644 --- a/app/code/core/Mage/Backup/Model/Resource/Helper/Mysql4.php +++ b/app/code/core/Mage/Backup/Model/Resource/Helper/Mysql4.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Backup - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Backup/etc/adminhtml.xml b/app/code/core/Mage/Backup/etc/adminhtml.xml index 51481326a1..7f55c38ffb 100644 --- a/app/code/core/Mage/Backup/etc/adminhtml.xml +++ b/app/code/core/Mage/Backup/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Backup - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Backup/etc/config.xml b/app/code/core/Mage/Backup/etc/config.xml index 295c8a35cd..ab19ccd949 100644 --- a/app/code/core/Mage/Backup/etc/config.xml +++ b/app/code/core/Mage/Backup/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Backup - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Backup/etc/system.xml b/app/code/core/Mage/Backup/etc/system.xml index 29cf2beedf..76b98b11e5 100644 --- a/app/code/core/Mage/Backup/etc/system.xml +++ b/app/code/core/Mage/Backup/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Backup - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Bundle.php b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Bundle.php index 6dd6271b6f..5abc8afaa3 100644 --- a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Bundle.php +++ b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Bundle.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Checkbox.php b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Checkbox.php index 987c0f3c96..ad7a315f77 100644 --- a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Checkbox.php +++ b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Checkbox.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Multi.php b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Multi.php index 1ea2d12899..5bae597198 100644 --- a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Multi.php +++ b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Multi.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Radio.php b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Radio.php index 810fc9e43b..512cff351d 100644 --- a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Radio.php +++ b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Radio.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Select.php b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Select.php index 5f286d2db1..ef351d929a 100644 --- a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Select.php +++ b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Select.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes.php b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes.php index a01f8992bd..7e929eb9b2 100644 --- a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes.php +++ b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Extend.php b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Extend.php index 3d91882254..41911a4297 100644 --- a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Extend.php +++ b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Extend.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Special.php b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Special.php index 0a4963b01d..751c51851d 100644 --- a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Special.php +++ b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Special.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle.php b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle.php index aad8beccfd..5617d100ba 100644 --- a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle.php +++ b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.php b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.php index 6f96703603..9970e7dff5 100644 --- a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.php +++ b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Search.php b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Search.php index 0df45b2d29..cb5d2b6cd4 100644 --- a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Search.php +++ b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Search.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Search/Grid.php b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Search/Grid.php index cddd1224d8..959160b2bb 100644 --- a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Search/Grid.php +++ b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Search/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Selection.php b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Selection.php index c5dda6e7e7..9893597d51 100644 --- a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Selection.php +++ b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Selection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tabs.php b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tabs.php index 058571f376..c540b32020 100644 --- a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tabs.php +++ b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tabs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Block/Adminhtml/Sales/Order/Items/Renderer.php b/app/code/core/Mage/Bundle/Block/Adminhtml/Sales/Order/Items/Renderer.php index 6be1d07cf7..6444592cca 100644 --- a/app/code/core/Mage/Bundle/Block/Adminhtml/Sales/Order/Items/Renderer.php +++ b/app/code/core/Mage/Bundle/Block/Adminhtml/Sales/Order/Items/Renderer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Block/Adminhtml/Sales/Order/View/Items/Renderer.php b/app/code/core/Mage/Bundle/Block/Adminhtml/Sales/Order/View/Items/Renderer.php index b32844d9f8..d4c842c05e 100644 --- a/app/code/core/Mage/Bundle/Block/Adminhtml/Sales/Order/View/Items/Renderer.php +++ b/app/code/core/Mage/Bundle/Block/Adminhtml/Sales/Order/View/Items/Renderer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Block/Catalog/Product/List/Partof.php b/app/code/core/Mage/Bundle/Block/Catalog/Product/List/Partof.php index af362e147f..2c39602588 100644 --- a/app/code/core/Mage/Bundle/Block/Catalog/Product/List/Partof.php +++ b/app/code/core/Mage/Bundle/Block/Catalog/Product/List/Partof.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Block/Catalog/Product/Price.php b/app/code/core/Mage/Bundle/Block/Catalog/Product/Price.php index 571e6a8817..8e7fea8f61 100644 --- a/app/code/core/Mage/Bundle/Block/Catalog/Product/Price.php +++ b/app/code/core/Mage/Bundle/Block/Catalog/Product/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Block/Catalog/Product/View.php b/app/code/core/Mage/Bundle/Block/Catalog/Product/View.php index dc76000f14..0cc7241fb6 100644 --- a/app/code/core/Mage/Bundle/Block/Catalog/Product/View.php +++ b/app/code/core/Mage/Bundle/Block/Catalog/Product/View.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle.php b/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle.php index 0043282b9c..2ded2182c5 100644 --- a/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle.php +++ b/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -58,7 +58,9 @@ public function getOptions() $product ); - $this->_options = $optionCollection->appendSelections($selectionCollection, false, false); + $this->_options = $optionCollection->appendSelections($selectionCollection, false, + Mage::helper('catalog/product')->getSkipSaleableCheck() + ); } return $this->_options; @@ -122,7 +124,8 @@ public function getJsonConfig() unset($tierPriceInfo); // break the reference with the last element $itemPrice = $bundlePriceModel->getSelectionFinalTotalPrice($currentProduct, $_selection, - $currentProduct->getQty(), $_selection->getQty(), false); + $currentProduct->getQty(), $_selection->getQty(), false, false + ); $canApplyMAP = false; diff --git a/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option.php b/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option.php index 3541ac0e89..602810a7cd 100644 --- a/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option.php +++ b/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -163,6 +163,11 @@ protected function _getSelectedQty() return $selectedQty; } + /** + * Get product model + * + * @return Mage_Catalog_Model_Product + */ public function getProduct() { if (!$this->hasData('product')) { @@ -175,7 +180,7 @@ public function getSelectionQtyTitlePrice($_selection, $includeContainer = true) { $price = $this->getProduct()->getPriceModel()->getSelectionPreFinalPrice($this->getProduct(), $_selection); $this->setFormatProduct($_selection); - $priceTitle = $_selection->getSelectionQty()*1 . ' x ' . $_selection->getName(); + $priceTitle = $_selection->getSelectionQty()*1 . ' x ' . $this->escapeHtml($_selection->getName()); $priceTitle .= '   ' . ($includeContainer ? '' : '') . '+' . $this->formatPriceString($price, $includeContainer) @@ -214,7 +219,7 @@ public function getSelectionTitlePrice($_selection, $includeContainer = true) { $price = $this->getProduct()->getPriceModel()->getSelectionPreFinalPrice($this->getProduct(), $_selection, 1); $this->setFormatProduct($_selection); - $priceTitle = $_selection->getName(); + $priceTitle = $this->escapeHtml($_selection->getName()); $priceTitle .= '   ' . ($includeContainer ? '' : '') . '+' . $this->formatPriceString($price, $includeContainer) . ($includeContainer ? '' : ''); diff --git a/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Checkbox.php b/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Checkbox.php index 874bf5d0d2..c6976eaec6 100644 --- a/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Checkbox.php +++ b/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Checkbox.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Multi.php b/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Multi.php index 2162a5de4e..ddfefaae65 100644 --- a/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Multi.php +++ b/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Multi.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Radio.php b/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Radio.php index 290d1741a0..3b3cb2b8bb 100644 --- a/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Radio.php +++ b/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Radio.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Select.php b/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Select.php index 6e4ce82ccf..511075315b 100644 --- a/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Select.php +++ b/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Select.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Block/Checkout/Cart/Item/Renderer.php b/app/code/core/Mage/Bundle/Block/Checkout/Cart/Item/Renderer.php index 284e9c6832..a2d6f5b1a2 100644 --- a/app/code/core/Mage/Bundle/Block/Checkout/Cart/Item/Renderer.php +++ b/app/code/core/Mage/Bundle/Block/Checkout/Cart/Item/Renderer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Block/Sales/Order/Items/Renderer.php b/app/code/core/Mage/Bundle/Block/Sales/Order/Items/Renderer.php index 496026d16b..22260a7195 100644 --- a/app/code/core/Mage/Bundle/Block/Sales/Order/Items/Renderer.php +++ b/app/code/core/Mage/Bundle/Block/Sales/Order/Items/Renderer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Helper/Catalog/Product/Configuration.php b/app/code/core/Mage/Bundle/Helper/Catalog/Product/Configuration.php index 6e83845de9..96223a960f 100644 --- a/app/code/core/Mage/Bundle/Helper/Catalog/Product/Configuration.php +++ b/app/code/core/Mage/Bundle/Helper/Catalog/Product/Configuration.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -57,12 +57,17 @@ public function getSelectionQty($product, $selectionId) * @param Mage_Catalog_Model_Product $selectionProduct * @return decimal */ - public function getSelectionFinalPrice(Mage_Catalog_Model_Product_Configuration_Item_Interface $item, $selectionProduct) + public function getSelectionFinalPrice(Mage_Catalog_Model_Product_Configuration_Item_Interface $item, + $selectionProduct) { - return $item->getProduct()->getPriceModel()->getSelectionFinalPrice( - $item->getProduct(), $selectionProduct, + $selectionProduct->unsetData('final_price'); + return $item->getProduct()->getPriceModel()->getSelectionFinalTotalPrice( + $item->getProduct(), + $selectionProduct, $item->getQty() * 1, - $this->getSelectionQty($item->getProduct(), $selectionProduct->getSelectionId()) + $this->getSelectionQty($item->getProduct(), $selectionProduct->getSelectionId()), + false, + true ); } @@ -86,7 +91,7 @@ public function getBundleOptions(Mage_Catalog_Model_Product_Configuration_Item_I // get bundle options $optionsQuoteItemOption = $item->getOptionByCode('bundle_option_ids'); - $bundleOptionsIds = unserialize($optionsQuoteItemOption->getValue()); + $bundleOptionsIds = $optionsQuoteItemOption ? unserialize($optionsQuoteItemOption->getValue()) : array(); if ($bundleOptionsIds) { /** * @var Mage_Bundle_Model_Mysql4_Option_Collection @@ -115,7 +120,9 @@ public function getBundleOptions(Mage_Catalog_Model_Product_Configuration_Item_I $qty = $this->getSelectionQty($product, $bundleSelection->getSelectionId()) * 1; if ($qty) { $option['value'][] = $qty . ' x ' . $this->escapeHtml($bundleSelection->getName()) - . ' ' . Mage::helper('core')->currency($this->getSelectionFinalPrice($item, $bundleSelection)); + . ' ' . Mage::helper('core')->currency( + $this->getSelectionFinalPrice($item, $bundleSelection) + ); } } diff --git a/app/code/core/Mage/Bundle/Helper/Data.php b/app/code/core/Mage/Bundle/Helper/Data.php index 12a0524a30..26325296fa 100644 --- a/app/code/core/Mage/Bundle/Helper/Data.php +++ b/app/code/core/Mage/Bundle/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Model/CatalogIndex/Data/Bundle.php b/app/code/core/Mage/Bundle/Model/CatalogIndex/Data/Bundle.php index de618c82d3..ce1e5852ef 100644 --- a/app/code/core/Mage/Bundle/Model/CatalogIndex/Data/Bundle.php +++ b/app/code/core/Mage/Bundle/Model/CatalogIndex/Data/Bundle.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Model/Mysql4/Bundle.php b/app/code/core/Mage/Bundle/Model/Mysql4/Bundle.php index 46066631e2..7ea7793694 100644 --- a/app/code/core/Mage/Bundle/Model/Mysql4/Bundle.php +++ b/app/code/core/Mage/Bundle/Model/Mysql4/Bundle.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Model/Mysql4/Indexer/Price.php b/app/code/core/Mage/Bundle/Model/Mysql4/Indexer/Price.php index a95c9fd418..05a3450f8e 100644 --- a/app/code/core/Mage/Bundle/Model/Mysql4/Indexer/Price.php +++ b/app/code/core/Mage/Bundle/Model/Mysql4/Indexer/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Model/Mysql4/Indexer/Stock.php b/app/code/core/Mage/Bundle/Model/Mysql4/Indexer/Stock.php index 1512914af7..9c93365e30 100644 --- a/app/code/core/Mage/Bundle/Model/Mysql4/Indexer/Stock.php +++ b/app/code/core/Mage/Bundle/Model/Mysql4/Indexer/Stock.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Model/Mysql4/Option.php b/app/code/core/Mage/Bundle/Model/Mysql4/Option.php index a238ecd0f4..a74d60c4fe 100644 --- a/app/code/core/Mage/Bundle/Model/Mysql4/Option.php +++ b/app/code/core/Mage/Bundle/Model/Mysql4/Option.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Model/Mysql4/Option/Collection.php b/app/code/core/Mage/Bundle/Model/Mysql4/Option/Collection.php index 527ac9867c..0262810a73 100644 --- a/app/code/core/Mage/Bundle/Model/Mysql4/Option/Collection.php +++ b/app/code/core/Mage/Bundle/Model/Mysql4/Option/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Model/Mysql4/Price/Index.php b/app/code/core/Mage/Bundle/Model/Mysql4/Price/Index.php index 9e752aa4f8..97e7ec80b8 100644 --- a/app/code/core/Mage/Bundle/Model/Mysql4/Price/Index.php +++ b/app/code/core/Mage/Bundle/Model/Mysql4/Price/Index.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Model/Mysql4/Selection.php b/app/code/core/Mage/Bundle/Model/Mysql4/Selection.php index 76ff30cd6c..ea4b54ce36 100644 --- a/app/code/core/Mage/Bundle/Model/Mysql4/Selection.php +++ b/app/code/core/Mage/Bundle/Model/Mysql4/Selection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Model/Mysql4/Selection/Collection.php b/app/code/core/Mage/Bundle/Model/Mysql4/Selection/Collection.php index fdce3aeb2f..04e67aacb4 100644 --- a/app/code/core/Mage/Bundle/Model/Mysql4/Selection/Collection.php +++ b/app/code/core/Mage/Bundle/Model/Mysql4/Selection/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Model/Observer.php b/app/code/core/Mage/Bundle/Model/Observer.php index 61943827ca..33021cd03b 100644 --- a/app/code/core/Mage/Bundle/Model/Observer.php +++ b/app/code/core/Mage/Bundle/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -256,6 +256,19 @@ public function setAttributeTabBlock($observer) return $this; } + /** + * Initialize product options renderer with bundle specific params + * + * @param Varien_Event_Observer $observer + * @return Mage_Bundle_Model_Observer + */ + public function initOptionRenderer(Varien_Event_Observer $observer) + { + $block = $observer->getBlock(); + $block->addOptionsRenderCfg('bundle', 'bundle/catalog_product_configuration'); + return $this; + } + /** * Add price index to bundle product after load * diff --git a/app/code/core/Mage/Bundle/Model/Option.php b/app/code/core/Mage/Bundle/Model/Option.php index 94cecda1e4..e058129b53 100644 --- a/app/code/core/Mage/Bundle/Model/Option.php +++ b/app/code/core/Mage/Bundle/Model/Option.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Model/Price/Index.php b/app/code/core/Mage/Bundle/Model/Price/Index.php index 40315f48c2..d50e393a10 100644 --- a/app/code/core/Mage/Bundle/Model/Price/Index.php +++ b/app/code/core/Mage/Bundle/Model/Price/Index.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Model/Product/Attribute/Source/Price/View.php b/app/code/core/Mage/Bundle/Model/Product/Attribute/Source/Price/View.php index 987deb5cc0..ca3086cf60 100644 --- a/app/code/core/Mage/Bundle/Model/Product/Attribute/Source/Price/View.php +++ b/app/code/core/Mage/Bundle/Model/Product/Attribute/Source/Price/View.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Model/Product/Price.php b/app/code/core/Mage/Bundle/Model/Product/Price.php index f296ce8437..1c63b5111b 100644 --- a/app/code/core/Mage/Bundle/Model/Product/Price.php +++ b/app/code/core/Mage/Bundle/Model/Product/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -68,6 +68,40 @@ public function getPrice($product) } } + /** + * Get Total price for Bundle items + * + * @param Mage_Catalog_Model_Product $product + * @param null|float $qty + * @return float + */ + public function getTotalBundleItemsPrice($product, $qty = null) + { + $price = 0.0; + if ($product->hasCustomOptions()) { + $customOption = $product->getCustomOption('bundle_selection_ids'); + if ($customOption) { + $selectionIds = unserialize($customOption->getValue()); + $selections = $product->getTypeInstance(true)->getSelectionsByIds($selectionIds, $product); + $selections->addTierPriceData(); + Mage::dispatchEvent('prepare_catalog_product_collection_prices', array( + 'collection' => $selections, + 'store_id' => $product->getStoreId(), + )); + foreach ($selections->getItems() as $selection) { + if ($selection->isSalable()) { + $selectionQty = $product->getCustomOption('selection_qty_' . $selection->getSelectionId()); + if ($selectionQty) { + $price += $this->getSelectionFinalTotalPrice($product, $selection, $qty, + $selectionQty->getValue()); + } + } + } + } + } + return $price; + } + /** * Get product final price * @@ -81,46 +115,15 @@ public function getFinalPrice($qty = null, $product) return $product->getCalculatedFinalPrice(); } - $finalPrice = $product->getPrice(); - - /** - * Just product with fixed price calculation has price - */ - if ($finalPrice) { - $groupPrice = $this->_applyGroupPrice($product, $finalPrice); - $tierPrice = $this->_applyTierPrice($product, $qty, $finalPrice); - $specialPrice = $this->_applySpecialPrice($product, $finalPrice); - $finalPrice = min(array($groupPrice, $tierPrice, $specialPrice)); - - $product->setFinalPrice($finalPrice); - Mage::dispatchEvent('catalog_product_get_final_price', array('product' => $product)); - $finalPrice = $product->getData('final_price'); - } - $basePrice = $finalPrice; + $finalPrice = $this->getBasePrice($product, $qty); + $product->setFinalPrice($finalPrice); + Mage::dispatchEvent('catalog_product_get_final_price', array('product' => $product, 'qty' => $qty)); + $finalPrice = $product->getData('final_price'); - if ($product->hasCustomOptions()) { - $customOption = $product->getCustomOption('bundle_selection_ids'); - $selectionIds = unserialize($customOption->getValue()); - $selections = $product->getTypeInstance(true)->getSelectionsByIds($selectionIds, $product); - $selections->addTierPriceData(); - Mage::dispatchEvent('prepare_catalog_product_collection_prices', array( - 'collection' => $selections, - 'store_id' => $product->getStoreId(), - )); - foreach ($selections->getItems() as $selection) { - if ($selection->isSalable()) { - $selectionQty = $product->getCustomOption('selection_qty_' . $selection->getSelectionId()); - if ($selectionQty) { - $finalPrice += $this->getSelectionFinalPrice($product, $selection, $qty, - $selectionQty->getValue()); - } - } - } - } + $finalPrice = $this->_applyOptionsPrice($product, $qty, $finalPrice); + $finalPrice += $this->getTotalBundleItemsPrice($product, $qty); - $finalPrice = $finalPrice + $this->_applyOptionsPrice($product, $qty, $basePrice) - $basePrice; $product->setFinalPrice($finalPrice); - return max(0, $product->getData('final_price')); } @@ -135,13 +138,13 @@ public function getFinalPrice($qty = null, $product) */ public function getChildFinalPrice($product, $productQty, $childProduct, $childProductQty) { - return $this->getSelectionFinalPrice($product, $childProduct, $productQty, $childProductQty, false); + return $this->getSelectionFinalTotalPrice($product, $childProduct, $productQty, $childProductQty, false); } /** * Retrieve Price * - * @deprecated after 1.10.1.1 + * @deprecated after 1.5.1.0 * @see Mage_Bundle_Model_Product_Price::getTotalPrices() * * @param Mage_Catalog_Model_Product $product @@ -156,7 +159,7 @@ public function getPrices($product, $which = null) /** * Retrieve Prices depending on tax * - * @deprecated after 1.10.1.1 + * @deprecated after 1.5.1.0 * @see Mage_Bundle_Model_Product_Price::getTotalPrices() * * @param Mage_Catalog_Model_Product $product @@ -180,10 +183,8 @@ public function getPricesDependingOnTax($product, $which = null, $includeTax = n */ public function getTotalPrices($product, $which = null, $includeTax = null, $takeTierPrice = true) { - // check if required price is stored in product data - $forceRecalculation = $includeTax xor Mage::helper('tax')->priceIncludesTax(Mage::app()->getStore()); // check calculated price index - if ($product->getData('min_price') && $product->getData('max_price') && !$forceRecalculation) { + if ($product->getData('min_price') && $product->getData('max_price')) { $minimalPrice = Mage::helper('tax')->getPrice($product, $product->getData('min_price'), $includeTax); $maximalPrice = Mage::helper('tax')->getPrice($product, $product->getData('max_price'), $includeTax); $this->_isPricesCalculatedByIndex = true; @@ -361,6 +362,9 @@ public function getOptions($product) /** * Calculate price of selection * + * @deprecated after 1.6.2.0 + * @see Mage_Bundle_Model_Product_Price::getSelectionFinalTotalPrice() + * * @param Mage_Catalog_Model_Product $bundleProduct * @param Mage_Catalog_Model_Product $selectionProduct * @param float|null $selectionQty @@ -369,27 +373,7 @@ public function getOptions($product) */ public function getSelectionPrice($bundleProduct, $selectionProduct, $selectionQty = null, $multiplyQty = true) { - if (is_null($selectionQty)) { - $selectionQty = $selectionProduct->getSelectionQty(); - } - - if ($bundleProduct->getPriceType() == self::PRICE_TYPE_DYNAMIC) { - if ($multiplyQty) { - return $selectionProduct->getFinalPrice($selectionQty) * $selectionQty; - } else { - return $selectionProduct->getFinalPrice($selectionQty); - } - } else { - if ($selectionProduct->getSelectionPriceType()) { // percent - $price = $bundleProduct->getPrice() * ($selectionProduct->getSelectionPriceValue() / 100); - } else { // fixed - $price = $selectionProduct->getSelectionPriceValue(); - } - if ($multiplyQty) { - $price *= $selectionQty; - } - return $price; - } + return $this->getSelectionFinalTotalPrice($bundleProduct, $selectionProduct, 0, $selectionQty, $multiplyQty); } /** @@ -402,16 +386,13 @@ public function getSelectionPrice($bundleProduct, $selectionProduct, $selectionQ */ public function getSelectionPreFinalPrice($bundleProduct, $selectionProduct, $qty = null) { - $selectionPrice = $this->getSelectionPrice($bundleProduct, $selectionProduct, $qty); - $specialPrice = $this->_applySpecialPrice($bundleProduct, $selectionPrice); - $groupPrice = $this->_applyGroupPrice($bundleProduct, $selectionPrice); - return min($specialPrice, $groupPrice); + return $this->getSelectionPrice($bundleProduct, $selectionProduct, $qty); } /** * Calculate final price of selection * - * @deprecated after 1.10.1.1 + * @deprecated after 1.5.1.0 * @see Mage_Bundle_Model_Product_Price::getSelectionFinalTotalPrice() * * @param Mage_Catalog_Model_Product $bundleProduct @@ -443,20 +424,36 @@ public function getSelectionFinalPrice($bundleProduct, $selectionProduct, $bundl public function getSelectionFinalTotalPrice($bundleProduct, $selectionProduct, $bundleQty, $selectionQty, $multiplyQty = true, $takeTierPrice = true) { - $selectionPrice = $this->getSelectionPrice($bundleProduct, $selectionProduct, $selectionQty, $multiplyQty); - - // apply bundle special price - $specialPrice = $this->_applySpecialPrice($bundleProduct, $selectionPrice); - // apply bundle group price - $groupPrice = $this->_applyGroupPrice($bundleProduct, $selectionPrice); + if (is_null($selectionQty)) { + $selectionQty = $selectionProduct->getSelectionQty(); + } - if ($takeTierPrice) { - // apply bundle tier price - $tierPrice = $this->_applyTierPrice($bundleProduct, $bundleQty, $selectionPrice); - return min(array($groupPrice, $tierPrice, $specialPrice)); + if ($bundleProduct->getPriceType() == self::PRICE_TYPE_DYNAMIC) { + $price = $selectionProduct->getFinalPrice($takeTierPrice ? $selectionQty : 1); } else { - return min(array($groupPrice, $specialPrice)); + if ($selectionProduct->getSelectionPriceType()) { // percent + $product = clone $bundleProduct; + $product->setFinalPrice($this->getPrice($product)); + Mage::dispatchEvent( + 'catalog_product_get_final_price', + array('product' => $product, 'qty' => $bundleQty) + ); + $price = $product->getData('final_price') * ($selectionProduct->getSelectionPriceValue() / 100); + + } else { // fixed + $price = $selectionProduct->getSelectionPriceValue(); + } } + + if ($multiplyQty) { + $price *= $selectionQty; + } + + return min($price, + $this->_applyGroupPrice($bundleProduct, $price), + $this->_applyTierPrice($bundleProduct, $bundleQty, $price), + $this->_applySpecialPrice($bundleProduct, $price) + ); } /** diff --git a/app/code/core/Mage/Bundle/Model/Product/Type.php b/app/code/core/Mage/Bundle/Model/Product/Type.php index a63111940d..04a37b8a71 100644 --- a/app/code/core/Mage/Bundle/Model/Product/Type.php +++ b/app/code/core/Mage/Bundle/Model/Product/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -535,7 +535,9 @@ protected function _prepareProduct(Varien_Object $buyRequest, $product, $process $selections = array(); $product = $this->getProduct($product); $isStrictProcessMode = $this->_isStrictProcessMode($processMode); - $_appendAllSelections = (bool)$product->getSkipCheckRequiredOption(); + + $skipSaleableCheck = Mage::helper('catalog/product')->getSkipSaleableCheck(); + $_appendAllSelections = (bool)$product->getSkipCheckRequiredOption() || $skipSaleableCheck; $options = $buyRequest->getBundleOption(); if (is_array($options)) { @@ -582,7 +584,7 @@ protected function _prepareProduct(Varien_Object $buyRequest, $product, $process // Check if added selections are still on sale foreach ($selections->getItems() as $key => $selection) { - if (!$selection->isSalable()) { + if (!$selection->isSalable() && !$skipSaleableCheck) { $_option = $optionsCollection->getItemById($selection->getOptionId()); if (is_array($options[$_option->getId()]) && count($options[$_option->getId()]) > 1) { $moreSelections = true; @@ -658,7 +660,7 @@ protected function _prepareProduct(Varien_Object $buyRequest, $product, $process * Create extra attributes that will be converted to product options in order item * for selection (not for all bundle) */ - $price = $product->getPriceModel()->getSelectionPrice($product, $selection, $qty); + $price = $product->getPriceModel()->getSelectionFinalTotalPrice($product, $selection, 0, $qty); $attributes = array( 'price' => Mage::app()->getStore()->convertPrice($price), 'qty' => $qty, @@ -799,9 +801,7 @@ public function getOrderOptions($product = null) if ($selection->isSalable()) { $selectionQty = $product->getCustomOption('selection_qty_' . $selection->getSelectionId()); if ($selectionQty) { - $price = $product->getPriceModel()->getSelectionPrice( - $product, - $selection, + $price = $product->getPriceModel()->getSelectionFinalTotalPrice($product, $selection, 0, $selectionQty->getValue() ); @@ -901,6 +901,16 @@ public function getForceChildItemQtyChanges($product = null) return true; } + /** + * Force apply discount for parent item + * + * @return bool + */ + public function getForceApplyDiscountToParentItem() + { + return true; + } + /** * Retrieve additional searchable data from type instance * Using based on product id and store_id data @@ -945,10 +955,11 @@ public function checkProductBuyState($product = null) Mage::throwException($this->getSpecifyOptionMessage()); } + $skipSaleableCheck = Mage::helper('catalog/product')->getSkipSaleableCheck(); foreach ($selectionIds as $selectionId) { /* @var $selection Mage_Bundle_Model_Selection */ $selection = $productSelections->getItemById($selectionId); - if (!$selection || !$selection->isSalable()) { + if (!$selection || (!$selection->isSalable() && !$skipSaleableCheck)) { Mage::throwException( Mage::helper('bundle')->__('Selected required options are not available.') ); diff --git a/app/code/core/Mage/Bundle/Model/Resource/Bundle.php b/app/code/core/Mage/Bundle/Model/Resource/Bundle.php index 44ee453866..ac29585957 100755 --- a/app/code/core/Mage/Bundle/Model/Resource/Bundle.php +++ b/app/code/core/Mage/Bundle/Model/Resource/Bundle.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Model/Resource/Indexer/Price.php b/app/code/core/Mage/Bundle/Model/Resource/Indexer/Price.php index b04b26ef70..201daa57bb 100755 --- a/app/code/core/Mage/Bundle/Model/Resource/Indexer/Price.php +++ b/app/code/core/Mage/Bundle/Model/Resource/Indexer/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Model/Resource/Indexer/Stock.php b/app/code/core/Mage/Bundle/Model/Resource/Indexer/Stock.php index b2d3e03169..c7f156a339 100755 --- a/app/code/core/Mage/Bundle/Model/Resource/Indexer/Stock.php +++ b/app/code/core/Mage/Bundle/Model/Resource/Indexer/Stock.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Model/Resource/Option.php b/app/code/core/Mage/Bundle/Model/Resource/Option.php index c8e4dbac58..dd0cb3a5ff 100755 --- a/app/code/core/Mage/Bundle/Model/Resource/Option.php +++ b/app/code/core/Mage/Bundle/Model/Resource/Option.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Model/Resource/Option/Collection.php b/app/code/core/Mage/Bundle/Model/Resource/Option/Collection.php index 9dacb3436e..8320298e74 100755 --- a/app/code/core/Mage/Bundle/Model/Resource/Option/Collection.php +++ b/app/code/core/Mage/Bundle/Model/Resource/Option/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Model/Resource/Price/Index.php b/app/code/core/Mage/Bundle/Model/Resource/Price/Index.php index b520f9a78a..971b04311b 100755 --- a/app/code/core/Mage/Bundle/Model/Resource/Price/Index.php +++ b/app/code/core/Mage/Bundle/Model/Resource/Price/Index.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Model/Resource/Selection.php b/app/code/core/Mage/Bundle/Model/Resource/Selection.php index ae06a5bbd6..161ddde916 100755 --- a/app/code/core/Mage/Bundle/Model/Resource/Selection.php +++ b/app/code/core/Mage/Bundle/Model/Resource/Selection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Model/Resource/Selection/Collection.php b/app/code/core/Mage/Bundle/Model/Resource/Selection/Collection.php index fe44eb5052..bfe8934fd1 100755 --- a/app/code/core/Mage/Bundle/Model/Resource/Selection/Collection.php +++ b/app/code/core/Mage/Bundle/Model/Resource/Selection/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Abstract.php b/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Abstract.php index e4fc0834dd..a2810309cd 100644 --- a/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Abstract.php +++ b/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Creditmemo.php b/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Creditmemo.php index 2540f20065..4021fc9274 100644 --- a/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Creditmemo.php +++ b/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Creditmemo.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Invoice.php b/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Invoice.php index 2efa373859..58747a7f30 100644 --- a/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Invoice.php +++ b/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Invoice.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Shipment.php b/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Shipment.php index 72d4558c67..93d15661f0 100644 --- a/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Shipment.php +++ b/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Shipment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Model/Selection.php b/app/code/core/Mage/Bundle/Model/Selection.php index 6a7150bbce..f36328870a 100644 --- a/app/code/core/Mage/Bundle/Model/Selection.php +++ b/app/code/core/Mage/Bundle/Model/Selection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Model/Source/Option/Selection/Price/Type.php b/app/code/core/Mage/Bundle/Model/Source/Option/Selection/Price/Type.php index eded2e9612..dca0ec0816 100644 --- a/app/code/core/Mage/Bundle/Model/Source/Option/Selection/Price/Type.php +++ b/app/code/core/Mage/Bundle/Model/Source/Option/Selection/Price/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Model/Source/Option/Type.php b/app/code/core/Mage/Bundle/Model/Source/Option/Type.php index b283eda0a2..c4cb9d6047 100644 --- a/app/code/core/Mage/Bundle/Model/Source/Option/Type.php +++ b/app/code/core/Mage/Bundle/Model/Source/Option/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/controllers/Adminhtml/Bundle/Product/EditController.php b/app/code/core/Mage/Bundle/controllers/Adminhtml/Bundle/Product/EditController.php index 620757dffd..43e843caca 100644 --- a/app/code/core/Mage/Bundle/controllers/Adminhtml/Bundle/Product/EditController.php +++ b/app/code/core/Mage/Bundle/controllers/Adminhtml/Bundle/Product/EditController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/controllers/Adminhtml/Bundle/SelectionController.php b/app/code/core/Mage/Bundle/controllers/Adminhtml/Bundle/SelectionController.php index a429813178..57a8ef687a 100644 --- a/app/code/core/Mage/Bundle/controllers/Adminhtml/Bundle/SelectionController.php +++ b/app/code/core/Mage/Bundle/controllers/Adminhtml/Bundle/SelectionController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/controllers/Product/EditController.php b/app/code/core/Mage/Bundle/controllers/Product/EditController.php index de53faf5a5..0e09268f95 100644 --- a/app/code/core/Mage/Bundle/controllers/Product/EditController.php +++ b/app/code/core/Mage/Bundle/controllers/Product/EditController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/controllers/SelectionController.php b/app/code/core/Mage/Bundle/controllers/SelectionController.php index e3e1b24481..7adecca746 100644 --- a/app/code/core/Mage/Bundle/controllers/SelectionController.php +++ b/app/code/core/Mage/Bundle/controllers/SelectionController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/data/bundle_setup/data-install-1.6.0.0.php b/app/code/core/Mage/Bundle/data/bundle_setup/data-install-1.6.0.0.php index f11710d34b..be8f0baefc 100644 --- a/app/code/core/Mage/Bundle/data/bundle_setup/data-install-1.6.0.0.php +++ b/app/code/core/Mage/Bundle/data/bundle_setup/data-install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/etc/config.xml b/app/code/core/Mage/Bundle/etc/config.xml index 9c9d35d843..4b43e2e7c6 100644 --- a/app/code/core/Mage/Bundle/etc/config.xml +++ b/app/code/core/Mage/Bundle/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -216,6 +216,14 @@ + + + + bundle/observer + initOptionRenderer + + + diff --git a/app/code/core/Mage/Bundle/sql/bundle_setup/install-1.6.0.0.php b/app/code/core/Mage/Bundle/sql/bundle_setup/install-1.6.0.0.php index f2a74643df..007f096d12 100644 --- a/app/code/core/Mage/Bundle/sql/bundle_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Bundle/sql/bundle_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-data-upgrade-0.1.13-0.1.14.php b/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-data-upgrade-0.1.13-0.1.14.php index 616e7504c8..2dc72bd4eb 100644 --- a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-data-upgrade-0.1.13-0.1.14.php +++ b/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-data-upgrade-0.1.13-0.1.14.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-install-0.1.0.php b/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-install-0.1.0.php index 3270a15b60..60c4a7f3a0 100644 --- a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-install-0.1.0.php +++ b/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-install-0.1.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.0-0.1.1.php b/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.0-0.1.1.php index 037721fed7..2a2ee0a417 100644 --- a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.0-0.1.1.php +++ b/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.0-0.1.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.1-0.1.2.php b/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.1-0.1.2.php index 8f081bcfcc..71e640c9b4 100644 --- a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.1-0.1.2.php +++ b/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.1-0.1.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.10-0.1.11.php b/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.10-0.1.11.php index d430bbabfc..503e6a132a 100644 --- a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.10-0.1.11.php +++ b/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.10-0.1.11.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.11-0.1.12.php b/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.11-0.1.12.php index f967ca958d..013001bad6 100644 --- a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.11-0.1.12.php +++ b/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.11-0.1.12.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.12-0.1.13.php b/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.12-0.1.13.php index 7fabe4683a..62c0428456 100644 --- a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.12-0.1.13.php +++ b/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.12-0.1.13.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.2-0.1.3.php b/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.2-0.1.3.php index cc49c1e062..2200e3d7d4 100644 --- a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.2-0.1.3.php +++ b/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.2-0.1.3.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.3-0.1.4.php b/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.3-0.1.4.php index aaf97d9afc..66439ccd85 100644 --- a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.3-0.1.4.php +++ b/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.3-0.1.4.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.4-0.1.5.php b/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.4-0.1.5.php index c7e17e3848..7d0dcfc24b 100644 --- a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.4-0.1.5.php +++ b/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.4-0.1.5.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.5-0.1.6.php b/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.5-0.1.6.php index 3b1300b133..7a4073ef2f 100644 --- a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.5-0.1.6.php +++ b/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.5-0.1.6.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.6-0.1.7.php b/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.6-0.1.7.php index b5ac6834c7..aeef28e1bd 100644 --- a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.6-0.1.7.php +++ b/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.6-0.1.7.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.7-0.1.8.php b/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.7-0.1.8.php index b76221c4ff..06941f9cce 100644 --- a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.7-0.1.8.php +++ b/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.7-0.1.8.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.8-0.1.9.php b/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.8-0.1.9.php index a58b234f85..a2889ea852 100644 --- a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.8-0.1.9.php +++ b/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.8-0.1.9.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.9-0.1.10.php b/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.9-0.1.10.php index 942f5ec95b..bd50518a2c 100644 --- a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.9-0.1.10.php +++ b/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-0.1.9-0.1.10.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php index 6638007ca5..9f5fdc14de 100644 --- a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ b/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-1.6.0.0-1.6.0.0.1.php b/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-1.6.0.0-1.6.0.0.1.php index b56fc79f5c..12de6c9356 100644 --- a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-1.6.0.0-1.6.0.0.1.php +++ b/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-1.6.0.0-1.6.0.0.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/sql/bundle_setup/upgrade-1.6.0.0-1.6.0.0.1.php b/app/code/core/Mage/Bundle/sql/bundle_setup/upgrade-1.6.0.0-1.6.0.0.1.php index c715cca8d4..15b9fe09b2 100644 --- a/app/code/core/Mage/Bundle/sql/bundle_setup/upgrade-1.6.0.0-1.6.0.0.1.php +++ b/app/code/core/Mage/Bundle/sql/bundle_setup/upgrade-1.6.0.0-1.6.0.0.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Captcha/Block/Captcha.php b/app/code/core/Mage/Captcha/Block/Captcha.php index b934ed1dca..e5cdbbc6dd 100755 --- a/app/code/core/Mage/Captcha/Block/Captcha.php +++ b/app/code/core/Mage/Captcha/Block/Captcha.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Captcha - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Captcha/Block/Captcha/Zend.php b/app/code/core/Mage/Captcha/Block/Captcha/Zend.php index 02e1c78cf5..ff9bec2da9 100755 --- a/app/code/core/Mage/Captcha/Block/Captcha/Zend.php +++ b/app/code/core/Mage/Captcha/Block/Captcha/Zend.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Captcha - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Captcha/Helper/Data.php b/app/code/core/Mage/Captcha/Helper/Data.php index ff9f08bb3b..99d6b6ca77 100755 --- a/app/code/core/Mage/Captcha/Helper/Data.php +++ b/app/code/core/Mage/Captcha/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Captcha - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Captcha/Model/Captcha.php b/app/code/core/Mage/Captcha/Model/Captcha.php deleted file mode 100755 index 2cfb2031b7..0000000000 --- a/app/code/core/Mage/Captcha/Model/Captcha.php +++ /dev/null @@ -1,149 +0,0 @@ - - */ -class Mage_Captcha_Model_Captcha implements Mage_Captcha_Model_Interface -{ - protected $_model; - - /** - * Zend captcha constructor - * - * @param array $params - */ - public function __construct($params) - { - $type = Mage::helper('captcha')->getConfigNode('type'); - $this->_model = Mage::getModel('captcha/' . $type, $params); - } - - /** - * Whether to respect case while checking the answer - * - * @return bool - */ - public function isCaseSensitive() - { - return $this->_model->isCaseSensitive(); - } - - /** - * Generates captcha - * - */ - public function generate() - { - $this->_model->generate(); - } - - /** - * Checks whether word entered by user corresponds to the one generated by generate() - * - * @param string $word - * @return void - */ - public function isCorrect($word) - { - return $this->_model->isCorrect($word); - } - - /** - * Get captcha image base URL - * - * @return string - */ - public function getImgUrl() - { - return $this->_model->getImgUrl(); - } - - /** - * Return full URL to captcha image - * - * @return string - */ - public function getImgSrc() - { - return $this->_model->getImgSrc(); - } - - - /** - * Returns session instance - * - * @return Captcha_Zend_Model_Session - */ - public function getSession() - { - return $this->_model->getSession(); - } - - /** - * Returns Captcha Width - * - * @return string - */ - public function getWidth() - { - return $this->_model->getWidth(); - } - - /** - * Returns Captcha Height - * - * @return string - */ - public function getHeight() - { - return $this->_model->getHeight(); - } - - /** - * Returns Captcha Height - * - * @return string - */ - public function getImgAlt() - { - return $this->_model->getImgAlt(); - } - - /** - * Returns Template Path - * - * @return string - */ - public function getTemplatePath() - { - return $this->_model->getTemplatePath(); - } -} diff --git a/app/code/core/Mage/Captcha/Model/Config/Font.php b/app/code/core/Mage/Captcha/Model/Config/Font.php index cbba443fc9..e369a1144a 100755 --- a/app/code/core/Mage/Captcha/Model/Config/Font.php +++ b/app/code/core/Mage/Captcha/Model/Config/Font.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Captcha - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Captcha/Model/Config/Form/Abstract.php b/app/code/core/Mage/Captcha/Model/Config/Form/Abstract.php index 0a12ed2908..444b5d3a1f 100755 --- a/app/code/core/Mage/Captcha/Model/Config/Form/Abstract.php +++ b/app/code/core/Mage/Captcha/Model/Config/Form/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Captcha - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Captcha/Model/Config/Form/Backend.php b/app/code/core/Mage/Captcha/Model/Config/Form/Backend.php index e469ee9ef3..568c70ddb0 100755 --- a/app/code/core/Mage/Captcha/Model/Config/Form/Backend.php +++ b/app/code/core/Mage/Captcha/Model/Config/Form/Backend.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Captcha - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Captcha/Model/Config/Form/Frontend.php b/app/code/core/Mage/Captcha/Model/Config/Form/Frontend.php index 131402e323..112903c303 100755 --- a/app/code/core/Mage/Captcha/Model/Config/Form/Frontend.php +++ b/app/code/core/Mage/Captcha/Model/Config/Form/Frontend.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Captcha - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Captcha/Model/Config/Mode.php b/app/code/core/Mage/Captcha/Model/Config/Mode.php index 4bfe1a409f..73e6bc0229 100755 --- a/app/code/core/Mage/Captcha/Model/Config/Mode.php +++ b/app/code/core/Mage/Captcha/Model/Config/Mode.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Captcha - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Captcha/Model/Interface.php b/app/code/core/Mage/Captcha/Model/Interface.php index 90b2290bc2..2fa086c8be 100755 --- a/app/code/core/Mage/Captcha/Model/Interface.php +++ b/app/code/core/Mage/Captcha/Model/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Captcha - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Captcha/Model/Observer.php b/app/code/core/Mage/Captcha/Model/Observer.php index ebaf827b18..af5c45b33e 100755 --- a/app/code/core/Mage/Captcha/Model/Observer.php +++ b/app/code/core/Mage/Captcha/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Captcha - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -174,6 +174,16 @@ public function checkUserLoginBackend($observer) return $this; } + /** + * Returns backend session + * + * @return Mage_Adminhtml_Model_Session + */ + protected function _getBackendSession() + { + return Mage::getSingleton('adminhtml/session'); + } + /** * Check Captcha On User Login Backend Page * @@ -191,9 +201,9 @@ public function checkUserForgotPasswordBackend($observer) if (!empty($email) && !empty($params)){ if ($captchaModel->isRequired()){ if (!$captchaModel->isCorrect($this->_getCaptchaString($controller->getRequest(), $formId))) { - $this->_getSession()->setEmail((string) $controller->getRequest()->getPost('email')); + $this->_getBackendSession()->setEmail((string) $controller->getRequest()->getPost('email')); $controller->setFlag('', Mage_Core_Controller_Varien_Action::FLAG_NO_DISPATCH, true); - $this->_getSession()->addError(Mage::helper('captcha')->__('Incorrect CAPTCHA.')); + $this->_getBackendSession()->addError(Mage::helper('captcha')->__('Incorrect CAPTCHA.')); $controller->getResponse()->setRedirect(Mage::getUrl('*/*/forgotpassword')); } } diff --git a/app/code/core/Mage/Captcha/Model/Resource/Log.php b/app/code/core/Mage/Captcha/Model/Resource/Log.php index beef4f1884..cedeac698d 100755 --- a/app/code/core/Mage/Captcha/Model/Resource/Log.php +++ b/app/code/core/Mage/Captcha/Model/Resource/Log.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Captcha - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -38,6 +38,7 @@ class Mage_Captcha_Model_Resource_Log extends Mage_Core_Model_Resource_Db_Abstra * Type Remote Address */ const TYPE_REMOTE_ADDRESS = 1; + /** * Type User Login Name */ @@ -49,7 +50,7 @@ class Mage_Captcha_Model_Resource_Log extends Mage_Core_Model_Resource_Db_Abstra */ protected function _construct() { - $this->_init('captcha/log', array('type','value')); + $this->_setMainTable('captcha/log'); } /** diff --git a/app/code/core/Mage/Captcha/Model/Resource/LoginAttempt.php b/app/code/core/Mage/Captcha/Model/Resource/LoginAttempt.php deleted file mode 100755 index 3771a3953f..0000000000 --- a/app/code/core/Mage/Captcha/Model/Resource/LoginAttempt.php +++ /dev/null @@ -1,160 +0,0 @@ - - */ -class Mage_Captcha_Model_Resource_LoginAttempt extends Mage_Core_Model_Resource_Db_Abstract -{ - /** - * Define main table - * - */ - protected function _construct() - { - $this->_init('captcha/login_attempt', array('type','value')); - } - - /** - * Log Login - * - * @param string|null $login - * @return Mage_Captcha_Model_Resource_LoginAttempt - */ - public function logUserLogin($login){ - if ($login != null){ - - $this->_getWriteAdapter()->insertOnDuplicate( - $this->getMainTable(), - array( - 'type' => Mage_Captcha_Model_LoginAttempt::TYPE_LOGIN, - 'value' => md5($login), 'count' => 1, 'updated_at' => Mage::getSingleton('core/date')->gmtDate() - ), - array('count' => new Zend_Db_Expr('count+1'), 'updated_at') - ); - } - return $this; - } - - /** - * Log Ip - * - * @param string|null $ip - * @return Mage_Captcha_Model_Resource_LoginAttempt - */ - public function logRemoteAddress($ip){ - if ($ip != null) { - $this->_getWriteAdapter()->insertOnDuplicate( - $this->getMainTable(), - array( - 'type' => Mage_Captcha_Model_LoginAttempt::TYPE_REMOTE_ADDRESS, - 'value' => md5($ip), 'count' => 1, 'updated_at' => Mage::getSingleton('core/date')->gmtDate() - ), - array('count' => new Zend_Db_Expr('count+1'), 'updated_at') - ); - } - return $this; - } - - /** - * Delete attempts by remote address - * @param $ip - * @return Mage_Captcha_Model_Resource_LoginAttempt - */ - public function deleteByRemoteAddress($ip){ - if ($ip != null) { - $this->_getWriteAdapter()->delete( - $this->getMainTable(), - array('type = ?' => Mage_Captcha_Model_LoginAttempt::TYPE_REMOTE_ADDRESS, 'value = ?' => md5($ip)) - ); - } - return $this; - } - - /** - * Delete attempts by login - * - * @param $login - * @return Mage_Captcha_Model_Resource_LoginAttempt - */ - public function deleteByUserName($login){ - if ($login != null) { - $this->_getWriteAdapter()->delete( - $this->getMainTable(), - array('type = ?' => Mage_Captcha_Model_LoginAttempt::TYPE_LOGIN, 'value = ?' => md5($login)) - ); - } - return $this; - } - - /** - * Get count attempts by ip - * - * @param string $ip - * @return null|Mage_Captcha_Model_LoginAttempt - */ - public function countAttemptsByRemoteAddress($ip){ - if (!$ip) { - return 0; - } - $read = $this->_getReadAdapter(); - $select = $read->select() - ->from($this->getMainTable(), 'count') - ->where('type = ?', Mage_Captcha_Model_LoginAttempt::TYPE_REMOTE_ADDRESS) - ->where('value = ?', md5($ip)); - return $read->fetchOne($select); - } - - /** - * Get count attempts by user login - * - * @param string $login - * @return null|Mage_Captcha_Model_LoginAttempt - */ - public function countAttemptsByUserLogin($login){ - if (!$login) { - return 0; - } - $read = $this->_getReadAdapter(); - $select = $read->select() - ->from($this->getMainTable(), 'count') - ->where('type = ?', Mage_Captcha_Model_LoginAttempt::TYPE_LOGIN) - ->where('value = ?', md5($login)); - return $read->fetchOne($select); - } - - public function deleteOldAttempts(){ - $this->_getWriteAdapter()->delete( - $this->getMainTable(), - array('updated_at < ?' => Mage::getSingleton('core/date')->gmtDate(null, time() - 60*30)) - ); - } -} diff --git a/app/code/core/Mage/Captcha/Model/Zend.php b/app/code/core/Mage/Captcha/Model/Zend.php index 26cdfe2b48..be7d4ee64b 100755 --- a/app/code/core/Mage/Captcha/Model/Zend.php +++ b/app/code/core/Mage/Captcha/Model/Zend.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Captcha - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -48,11 +48,6 @@ class Mage_Captcha_Model_Zend extends Zend_Captcha_Image implements Mage_Captcha */ const DEFAULT_WORD_LENGTH_TO = 5; - /** - * Key in session for keeping captcha attempts - */ - const SESSION_FAILED_ATTEMPTS = 'failed_attempts'; - /** * Helper Instance * @var Mage_Captcha_Helper_Data @@ -92,6 +87,17 @@ public function __construct($params) $this->setExpiration($this->getTimeout()); } + /** + * Returns key with respect of current form ID + * + * @param string $key + * @return string + */ + protected function _getFormIdKey($key) + { + return $this->_formId . '_' . $key; + } + /** * Get Block Name * @@ -115,7 +121,9 @@ public function isRequired($login = null) return false; } - return ($this->_isShowAlways() || $this->_isOverLimitAttempts($login)); + return ($this->_isShowAlways() || $this->_isOverLimitAttempts($login) + || $this->getSession()->getData($this->_getFormIdKey('show_captcha')) + ); } /** @@ -126,19 +134,27 @@ public function isRequired($login = null) */ protected function _isOverLimitAttempts($login) { - return ($this->_isOverLimitSessionAttempt() || $this->_isOverLimitIpAttempt() - || $this->_isOverLimitLoginAttempts($login)); + return ($this->_isOverLimitIpAttempt() || $this->_isOverLimitLoginAttempts($login)); } /** - * Check is overlimit saved in session attempts + * Returns number of allowed attempts for same login * - * @return bool + * @return int */ - protected function _isOverLimitSessionAttempt() + protected function _getAllowedAttemptsForSameLogin() { - $key = $this->_formId . '_' . self::SESSION_FAILED_ATTEMPTS; - return $this->getSession()->getData($key) >= $this->_getHelper()->getConfigNode('failed_attempts'); + return (int)$this->_getHelper()->getConfigNode('failed_attempts_login'); + } + + /** + * Returns number of allowed attempts from same IP + * + * @return int + */ + protected function _getAllowedAttemptsFromSameIp() + { + return (int)$this->_getHelper()->getConfigNode('failed_attempts_ip'); } /** @@ -149,10 +165,7 @@ protected function _isOverLimitSessionAttempt() protected function _isOverLimitIpAttempt() { $countAttemptsByIp = Mage::getResourceModel('captcha/log')->countAttemptsByRemoteAddress(); - if ($countAttemptsByIp >= $this->_getHelper()->getConfigNode('failed_attempts')) { - return true; - } - return false; + return $countAttemptsByIp >= $this->_getAllowedAttemptsFromSameIp(); } /** @@ -165,12 +178,7 @@ protected function _isOverLimitLoginAttempts($login) { if ($login != false) { $countAttemptsByLogin = Mage::getResourceModel('captcha/log')->countAttemptsByUserLogin($login); - if ($countAttemptsByLogin >= $this->_getHelper()->getConfigNode('failed_attempts')) { - $this->getSession()->setData( - $this->_formId . '_' . self::SESSION_FAILED_ATTEMPTS, $countAttemptsByLogin - ); - return true; - } + return ($countAttemptsByLogin >= $this->_getAllowedAttemptsForSameLogin()); } return false; } @@ -269,7 +277,7 @@ public function isCorrect($word) /** * Returns session instance * - * @return Mage_Captcha_Model_Session + * @return Mage_Customer_Model_Session */ public function getSession() { @@ -295,10 +303,10 @@ public function getImgSrc() public function logAttempt($login) { if ($this->_isEnabled() && in_array($this->_formId, $this->_getTargetForms())) { - $attemptCount = (int)$this->getSession()->getData($this->_formId . '_' . self::SESSION_FAILED_ATTEMPTS); - $attemptCount++; - $this->getSession()->setData($this->_formId . '_' . self::SESSION_FAILED_ATTEMPTS, $attemptCount); Mage::getResourceModel('captcha/log')->logAttempt($login); + if ($this->_isOverLimitLoginAttempts($login)) { + $this->getSession()->setData($this->_getFormIdKey('show_captcha'), 1); + } } return $this; } @@ -326,7 +334,7 @@ protected function _getFontPath() /** * Returns captcha helper * - * @return Mage_Captcha_Helper_Interface + * @return Mage_Captcha_Helper_Data */ protected function _getHelper() { @@ -397,7 +405,7 @@ protected function _getWordLen() */ protected function _isShowAlways() { - if ((string)$this->_getHelper()->getConfigNode('mode') == Mage_Captcha_Helper_Data::MODE_ALWAYS){ + if ((string)$this->_getHelper()->getConfigNode('mode') == Mage_Captcha_Helper_Data::MODE_ALWAYS) { return true; } @@ -441,7 +449,7 @@ protected function _getTargetForms() */ public function getWord() { - $sessionData = $this->getSession()->getData($this->_formId . '_' . self::SESSION_WORD); + $sessionData = $this->getSession()->getData($this->_getFormIdKey(self::SESSION_WORD)); return time() < $sessionData['expires'] ? $sessionData['data'] : null; } @@ -453,7 +461,7 @@ public function getWord() */ protected function _setWord($word) { - $this->getSession()->setData($this->_formId . '_' . self::SESSION_WORD, + $this->getSession()->setData($this->_getFormIdKey(self::SESSION_WORD), array('data' => $word, 'expires' => time() + $this->getTimeout()) ); $this->_word = $word; @@ -467,7 +475,7 @@ protected function _setWord($word) */ protected function _clearWord() { - $this->getSession()->unsetData($this->_formId . '_' . self::SESSION_WORD); + $this->getSession()->unsetData($this->_getFormIdKey(self::SESSION_WORD)); $this->_word = null; return $this; } diff --git a/app/code/core/Mage/Captcha/controllers/Adminhtml/RefreshController.php b/app/code/core/Mage/Captcha/controllers/Adminhtml/RefreshController.php index 1184e1af0d..36851cf929 100755 --- a/app/code/core/Mage/Captcha/controllers/Adminhtml/RefreshController.php +++ b/app/code/core/Mage/Captcha/controllers/Adminhtml/RefreshController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Captcha - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Captcha/controllers/RefreshController.php b/app/code/core/Mage/Captcha/controllers/RefreshController.php index 476c80baa9..2bf7d9f746 100755 --- a/app/code/core/Mage/Captcha/controllers/RefreshController.php +++ b/app/code/core/Mage/Captcha/controllers/RefreshController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Captcha - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Captcha/etc/config.xml b/app/code/core/Mage/Captcha/etc/config.xml index 9151e538f5..ee3251ded8 100755 --- a/app/code/core/Mage/Captcha/etc/config.xml +++ b/app/code/core/Mage/Captcha/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Captcha - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -74,7 +74,7 @@ captcha/observer - createUser + checkUserCreate @@ -170,7 +170,8 @@ linlibertine after_fail backend_forgotpassword - 3 + 3 + 1000 7 4-5 ABCDEFGHJKMnpqrstuvwxyz23456789 @@ -187,7 +188,8 @@ linlibertine after_fail user_forgotpassword - 3 + 3 + 1000 7 4-5 ABCDEFGHJKMnpqrstuvwxyz23456789 diff --git a/app/code/core/Mage/Captcha/etc/system.xml b/app/code/core/Mage/Captcha/etc/system.xml index b0e5851655..274a8dc482 100755 --- a/app/code/core/Mage/Captcha/etc/system.xml +++ b/app/code/core/Mage/Captcha/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Captcha - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -76,7 +76,7 @@ 0 1 - + text If 0 is specified, CAPTCHA on the Login form will be always available. @@ -89,7 +89,7 @@ 1 required-entry validate-digits - + text @@ -186,7 +186,7 @@ 0 1 - + text If 0 is specified, CAPTCHA on the Login form will be always available. @@ -199,7 +199,7 @@ after_fail required-entry validate-digits - + text diff --git a/app/code/core/Mage/Captcha/sql/captcha_setup/install-1.7.0.0.0.php b/app/code/core/Mage/Captcha/sql/captcha_setup/install-1.7.0.0.0.php index 966630c917..19027796dc 100644 --- a/app/code/core/Mage/Captcha/sql/captcha_setup/install-1.7.0.0.0.php +++ b/app/code/core/Mage/Captcha/sql/captcha_setup/install-1.7.0.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Captcha - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /* @var $installer Mage_Core_Model_Resource_Setup */ diff --git a/app/code/core/Mage/Catalog/Block/Breadcrumbs.php b/app/code/core/Mage/Catalog/Block/Breadcrumbs.php index 4bb84b266b..84bc8e24d8 100644 --- a/app/code/core/Mage/Catalog/Block/Breadcrumbs.php +++ b/app/code/core/Mage/Catalog/Block/Breadcrumbs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Category/View.php b/app/code/core/Mage/Catalog/Block/Category/View.php index 0db6634295..d1f54b3e5e 100644 --- a/app/code/core/Mage/Catalog/Block/Category/View.php +++ b/app/code/core/Mage/Catalog/Block/Category/View.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Category/Widget/Link.php b/app/code/core/Mage/Catalog/Block/Category/Widget/Link.php index 16f8e41537..88015319f6 100644 --- a/app/code/core/Mage/Catalog/Block/Category/Widget/Link.php +++ b/app/code/core/Mage/Catalog/Block/Category/Widget/Link.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Layer/Filter/Abstract.php b/app/code/core/Mage/Catalog/Block/Layer/Filter/Abstract.php index 60078cfae5..487d1ba7f3 100644 --- a/app/code/core/Mage/Catalog/Block/Layer/Filter/Abstract.php +++ b/app/code/core/Mage/Catalog/Block/Layer/Filter/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -47,6 +47,12 @@ abstract class Mage_Catalog_Block_Layer_Filter_Abstract extends Mage_Core_Block_ */ protected $_filterModelName; + /** + * Whether to display product count for layer navigation items + * @var bool + */ + protected $_displayProductCount = null; + /** * Initialize filter template * @@ -126,6 +132,18 @@ public function getItemsCount() return $this->_filter->getItemsCount(); } + /** + * Getter for $_displayProductCount + * @return bool + */ + public function shouldDisplayProductCount() + { + if ($this->_displayProductCount === null) { + $this->_displayProductCount = Mage::helper('catalog')->shouldDisplayProductCountOnLayer(); + } + return $this->_displayProductCount; + } + /** * Retrieve block html * diff --git a/app/code/core/Mage/Catalog/Block/Layer/Filter/Attribute.php b/app/code/core/Mage/Catalog/Block/Layer/Filter/Attribute.php index 8033b3885d..a56b4ee0da 100644 --- a/app/code/core/Mage/Catalog/Block/Layer/Filter/Attribute.php +++ b/app/code/core/Mage/Catalog/Block/Layer/Filter/Attribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Layer/Filter/Category.php b/app/code/core/Mage/Catalog/Block/Layer/Filter/Category.php index 1e84bf7f2f..8d19434c0a 100644 --- a/app/code/core/Mage/Catalog/Block/Layer/Filter/Category.php +++ b/app/code/core/Mage/Catalog/Block/Layer/Filter/Category.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Layer/Filter/Decimal.php b/app/code/core/Mage/Catalog/Block/Layer/Filter/Decimal.php index 092533ddec..ca7f961ad2 100644 --- a/app/code/core/Mage/Catalog/Block/Layer/Filter/Decimal.php +++ b/app/code/core/Mage/Catalog/Block/Layer/Filter/Decimal.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Layer/Filter/Price.php b/app/code/core/Mage/Catalog/Block/Layer/Filter/Price.php index 876069131d..db32739251 100644 --- a/app/code/core/Mage/Catalog/Block/Layer/Filter/Price.php +++ b/app/code/core/Mage/Catalog/Block/Layer/Filter/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Layer/State.php b/app/code/core/Mage/Catalog/Block/Layer/State.php index 67ed9f97b1..3fe45916f6 100644 --- a/app/code/core/Mage/Catalog/Block/Layer/State.php +++ b/app/code/core/Mage/Catalog/Block/Layer/State.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Layer/View.php b/app/code/core/Mage/Catalog/Block/Layer/View.php index 444e75ef83..0ab2d0078e 100644 --- a/app/code/core/Mage/Catalog/Block/Layer/View.php +++ b/app/code/core/Mage/Catalog/Block/Layer/View.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -242,4 +242,14 @@ protected function _getPriceFilter() { return $this->getChild('_price_filter'); } + + /** + * Get url for 'Clear All' link + * + * @return string + */ + public function getClearUrl() + { + return $this->getChild('layer_state')->getClearUrl(); + } } diff --git a/app/code/core/Mage/Catalog/Block/Navigation.php b/app/code/core/Mage/Catalog/Block/Navigation.php index 69789dd619..3ce6c72198 100644 --- a/app/code/core/Mage/Catalog/Block/Navigation.php +++ b/app/code/core/Mage/Catalog/Block/Navigation.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Product.php b/app/code/core/Mage/Catalog/Block/Product.php index aa83fda8f7..bcb3934fe2 100644 --- a/app/code/core/Mage/Catalog/Block/Product.php +++ b/app/code/core/Mage/Catalog/Block/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Product/Abstract.php b/app/code/core/Mage/Catalog/Block/Product/Abstract.php index edecb0d2c2..f2dce13bc7 100644 --- a/app/code/core/Mage/Catalog/Block/Product/Abstract.php +++ b/app/code/core/Mage/Catalog/Block/Product/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Product/Compare/Abstract.php b/app/code/core/Mage/Catalog/Block/Product/Compare/Abstract.php index 5d75a8b480..d486caf528 100644 --- a/app/code/core/Mage/Catalog/Block/Product/Compare/Abstract.php +++ b/app/code/core/Mage/Catalog/Block/Product/Compare/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Product/Compare/List.php b/app/code/core/Mage/Catalog/Block/Product/Compare/List.php index 1f7769d0bf..24fa4a1ebf 100644 --- a/app/code/core/Mage/Catalog/Block/Product/Compare/List.php +++ b/app/code/core/Mage/Catalog/Block/Product/Compare/List.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Product/Compare/Sidebar.php b/app/code/core/Mage/Catalog/Block/Product/Compare/Sidebar.php index 2e61898f45..640d98cf09 100644 --- a/app/code/core/Mage/Catalog/Block/Product/Compare/Sidebar.php +++ b/app/code/core/Mage/Catalog/Block/Product/Compare/Sidebar.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Product/Gallery.php b/app/code/core/Mage/Catalog/Block/Product/Gallery.php index c8bd70b7c3..75c47245a5 100644 --- a/app/code/core/Mage/Catalog/Block/Product/Gallery.php +++ b/app/code/core/Mage/Catalog/Block/Product/Gallery.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Product/List.php b/app/code/core/Mage/Catalog/Block/Product/List.php index b1764e8f21..f5c2833332 100644 --- a/app/code/core/Mage/Catalog/Block/Product/List.php +++ b/app/code/core/Mage/Catalog/Block/Product/List.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Product/List/Crosssell.php b/app/code/core/Mage/Catalog/Block/Product/List/Crosssell.php index bea9cd8eb0..fc460f7cb0 100644 --- a/app/code/core/Mage/Catalog/Block/Product/List/Crosssell.php +++ b/app/code/core/Mage/Catalog/Block/Product/List/Crosssell.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -61,7 +61,7 @@ protected function _prepareData() $this->_itemCollection = $product->getCrossSellProductCollection() ->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes()) - ->addAttributeToSort('position', 'asc') + ->setPositionOrder() ->addStoreFilter(); // Mage::getSingleton('catalog/product_status')->addSaleableFilterToCollection($this->_itemCollection); diff --git a/app/code/core/Mage/Catalog/Block/Product/List/Promotion.php b/app/code/core/Mage/Catalog/Block/Product/List/Promotion.php index 08cf1c6dee..37e630ea41 100755 --- a/app/code/core/Mage/Catalog/Block/Product/List/Promotion.php +++ b/app/code/core/Mage/Catalog/Block/Product/List/Promotion.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Catalog_Block_Product_List_Promotion extends Mage_Catalog_Block_Product_List diff --git a/app/code/core/Mage/Catalog/Block/Product/List/Random.php b/app/code/core/Mage/Catalog/Block/Product/List/Random.php index 986f405bfd..a5a2665659 100644 --- a/app/code/core/Mage/Catalog/Block/Product/List/Random.php +++ b/app/code/core/Mage/Catalog/Block/Product/List/Random.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Product/List/Related.php b/app/code/core/Mage/Catalog/Block/Product/List/Related.php index 5378e32700..2732aefb2a 100644 --- a/app/code/core/Mage/Catalog/Block/Product/List/Related.php +++ b/app/code/core/Mage/Catalog/Block/Product/List/Related.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -50,7 +50,7 @@ protected function _prepareData() $this->_itemCollection = $product->getRelatedProductCollection() ->addAttributeToSelect('required_options') - ->addAttributeToSort('position', Varien_Db_Select::SQL_ASC) + ->setPositionOrder() ->addStoreFilter() ; diff --git a/app/code/core/Mage/Catalog/Block/Product/List/Toolbar.php b/app/code/core/Mage/Catalog/Block/Product/List/Toolbar.php index a5b106c045..1887c786d0 100644 --- a/app/code/core/Mage/Catalog/Block/Product/List/Toolbar.php +++ b/app/code/core/Mage/Catalog/Block/Product/List/Toolbar.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Product/List/Upsell.php b/app/code/core/Mage/Catalog/Block/Product/List/Upsell.php index cc64790ed3..fbc294a868 100644 --- a/app/code/core/Mage/Catalog/Block/Product/List/Upsell.php +++ b/app/code/core/Mage/Catalog/Block/Product/List/Upsell.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -54,7 +54,7 @@ protected function _prepareData() $product = Mage::registry('product'); /* @var $product Mage_Catalog_Model_Product */ $this->_itemCollection = $product->getUpSellProductCollection() - ->addAttributeToSort('position', Varien_Db_Select::SQL_ASC) + ->setPositionOrder() ->addStoreFilter() ; if (Mage::helper('catalog')->isModuleEnabled('Mage_Checkout')) { diff --git a/app/code/core/Mage/Catalog/Block/Product/New.php b/app/code/core/Mage/Catalog/Block/Product/New.php index 98503c8b4a..3125809f64 100644 --- a/app/code/core/Mage/Catalog/Block/Product/New.php +++ b/app/code/core/Mage/Catalog/Block/Product/New.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Product/Price.php b/app/code/core/Mage/Catalog/Block/Product/Price.php index 44521c711a..0149979ea4 100644 --- a/app/code/core/Mage/Catalog/Block/Product/Price.php +++ b/app/code/core/Mage/Catalog/Block/Product/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -36,6 +36,11 @@ class Mage_Catalog_Block_Product_Price extends Mage_Core_Block_Template protected $_priceDisplayType = null; protected $_idSuffix = ''; + /** + * Retrieve product + * + * @return Mage_Catalog_Model_Product + */ public function getProduct() { $product = $this->_getData('product'); diff --git a/app/code/core/Mage/Catalog/Block/Product/Price/Template.php b/app/code/core/Mage/Catalog/Block/Product/Price/Template.php index 8ae93ac6c2..10f03d6d07 100644 --- a/app/code/core/Mage/Catalog/Block/Product/Price/Template.php +++ b/app/code/core/Mage/Catalog/Block/Product/Price/Template.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Product/Send.php b/app/code/core/Mage/Catalog/Block/Product/Send.php index 5c0ca4bb5f..b9689a9834 100644 --- a/app/code/core/Mage/Catalog/Block/Product/Send.php +++ b/app/code/core/Mage/Catalog/Block/Product/Send.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Product/View.php b/app/code/core/Mage/Catalog/Block/Product/View.php index 337f43224c..f641f24ec2 100644 --- a/app/code/core/Mage/Catalog/Block/Product/View.php +++ b/app/code/core/Mage/Catalog/Block/Product/View.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -183,10 +183,11 @@ public function getJsonConfig() 'idSuffix' => '_clone', 'oldPlusDisposition' => 0, 'plusDisposition' => 0, + 'plusDispositionTax' => 0, 'oldMinusDisposition' => 0, 'minusDisposition' => 0, 'tierPrices' => $_tierPrices, - 'tierPricesInclTax' => $_tierPricesInclTax, + 'tierPricesInclTax' => $_tierPricesInclTax, ); $responseObject = new Varien_Object(); diff --git a/app/code/core/Mage/Catalog/Block/Product/View/Abstract.php b/app/code/core/Mage/Catalog/Block/Product/View/Abstract.php index e345f89e2d..bc82ae6495 100644 --- a/app/code/core/Mage/Catalog/Block/Product/View/Abstract.php +++ b/app/code/core/Mage/Catalog/Block/Product/View/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Product/View/Additional.php b/app/code/core/Mage/Catalog/Block/Product/View/Additional.php index 29a731c653..86da65e04e 100644 --- a/app/code/core/Mage/Catalog/Block/Product/View/Additional.php +++ b/app/code/core/Mage/Catalog/Block/Product/View/Additional.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Product/View/Attributes.php b/app/code/core/Mage/Catalog/Block/Product/View/Attributes.php index 6f1704e179..4b1e6d22e4 100644 --- a/app/code/core/Mage/Catalog/Block/Product/View/Attributes.php +++ b/app/code/core/Mage/Catalog/Block/Product/View/Attributes.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Product/View/Description.php b/app/code/core/Mage/Catalog/Block/Product/View/Description.php index 27bd2f2f8a..223f1268ad 100644 --- a/app/code/core/Mage/Catalog/Block/Product/View/Description.php +++ b/app/code/core/Mage/Catalog/Block/Product/View/Description.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Product/View/Media.php b/app/code/core/Mage/Catalog/Block/Product/View/Media.php index 93456f5ee3..f5c5c40072 100644 --- a/app/code/core/Mage/Catalog/Block/Product/View/Media.php +++ b/app/code/core/Mage/Catalog/Block/Product/View/Media.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Product/View/Options.php b/app/code/core/Mage/Catalog/Block/Product/View/Options.php index 29b32cf71b..8519f7ab76 100644 --- a/app/code/core/Mage/Catalog/Block/Product/View/Options.php +++ b/app/code/core/Mage/Catalog/Block/Product/View/Options.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -135,6 +135,29 @@ public function hasOptions() return false; } + /** + * Get price configuration + * + * @param Mage_Catalog_Model_Product_Option_Value|Mage_Catalog_Model_Product_Option $option + * @return array + */ + protected function _getPriceConfiguration($option) + { + $data = array(); + $data['price'] = Mage::helper('core')->currency($option->getPrice(true), false, false); + $data['oldPrice'] = Mage::helper('core')->currency($option->getPrice(false), false, false); + $data['priceValue'] = $option->getPrice(false); + $data['type'] = $option->getPriceType(); + $data['excludeTax'] = $price = Mage::helper('tax')->getPrice($option->getProduct(), $data['price'], false); + $data['includeTax'] = $price = Mage::helper('tax')->getPrice($option->getProduct(), $data['price'], true); + return $data; + } + + /** + * Get json representation of + * + * @return string + */ public function getJsonConfig() { $config = array(); @@ -147,14 +170,11 @@ public function getJsonConfig() foreach ($option->getValues() as $value) { /* @var $value Mage_Catalog_Model_Product_Option_Value */ $id = $value->getId(); - $_tmpPriceValues[$id]['price'] = Mage::helper('core')->currency($value->getPrice(true), false, - false); - $_tmpPriceValues[$id]['oldPrice'] = Mage::helper('core')->currency($value->getPrice(false), false, - false); + $_tmpPriceValues[$id] = $this->_getPriceConfiguration($value); } $priceValue = $_tmpPriceValues; } else { - $priceValue = Mage::helper('core')->currency($option->getPrice(true), false, false); + $priceValue = $this->_getPriceConfiguration($option); } $config[$option->getId()] = $priceValue; } diff --git a/app/code/core/Mage/Catalog/Block/Product/View/Options/Abstract.php b/app/code/core/Mage/Catalog/Block/Product/View/Options/Abstract.php index 1e55184076..c75853938e 100644 --- a/app/code/core/Mage/Catalog/Block/Product/View/Options/Abstract.php +++ b/app/code/core/Mage/Catalog/Block/Product/View/Options/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -96,8 +96,8 @@ public function getFormatedPrice() { if ($option = $this->getOption()) { return $this->_formatPrice(array( - 'is_percent' => ($option->getPriceType() == 'percent') ? true : false, - 'pricing_value' => $option->getPrice(true) + 'is_percent' => ($option->getPriceType() == 'percent'), + 'pricing_value' => $option->getPrice($option->getPriceType() == 'percent') )); } return ''; diff --git a/app/code/core/Mage/Catalog/Block/Product/View/Options/Type/Date.php b/app/code/core/Mage/Catalog/Block/Product/View/Options/Type/Date.php index 18db26162c..c6cf94c9db 100644 --- a/app/code/core/Mage/Catalog/Block/Product/View/Options/Type/Date.php +++ b/app/code/core/Mage/Catalog/Block/Product/View/Options/Type/Date.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Product/View/Options/Type/Default.php b/app/code/core/Mage/Catalog/Block/Product/View/Options/Type/Default.php index 8d683d7ef6..f84c026a86 100644 --- a/app/code/core/Mage/Catalog/Block/Product/View/Options/Type/Default.php +++ b/app/code/core/Mage/Catalog/Block/Product/View/Options/Type/Default.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Product/View/Options/Type/File.php b/app/code/core/Mage/Catalog/Block/Product/View/Options/Type/File.php index 3a2c96f944..e36bb882e5 100644 --- a/app/code/core/Mage/Catalog/Block/Product/View/Options/Type/File.php +++ b/app/code/core/Mage/Catalog/Block/Product/View/Options/Type/File.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Product/View/Options/Type/Select.php b/app/code/core/Mage/Catalog/Block/Product/View/Options/Type/Select.php index abdb1ca2ef..5dd4aeb4b1 100644 --- a/app/code/core/Mage/Catalog/Block/Product/View/Options/Type/Select.php +++ b/app/code/core/Mage/Catalog/Block/Product/View/Options/Type/Select.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -64,8 +64,8 @@ public function getValuesHtml() } foreach ($_option->getValues() as $_value) { $priceStr = $this->_formatPrice(array( - 'is_percent' => ($_value->getPriceType() == 'percent') ? true : false, - 'pricing_value' => $_value->getPrice(true) + 'is_percent' => ($_value->getPriceType() == 'percent'), + 'pricing_value' => $_value->getPrice(($_value->getPriceType() == 'percent')) ), false); $select->addOption( $_value->getOptionTypeId(), @@ -99,7 +99,11 @@ public function getValuesHtml() $type = 'radio'; $class = 'radio'; if (!$_option->getIsRequire()) { - $selectHtml .= '
  • getSkipJsReloadPrice() ? '' : ' onclick="opConfig.reloadPrice()"') . ' value="" checked="checked" />
  • '; + $selectHtml .= '
  • getSkipJsReloadPrice() ? '' : ' onclick="opConfig.reloadPrice()"') + . ' value="" checked="checked" />
  • '; } break; case Mage_Catalog_Model_Product_Option::OPTION_TYPE_CHECKBOX: @@ -113,8 +117,8 @@ public function getValuesHtml() $count++; $priceStr = $this->_formatPrice(array( - 'is_percent' => ($_value->getPriceType() == 'percent') ? true : false, - 'pricing_value' => $_value->getPrice(true) + 'is_percent' => ($_value->getPriceType() == 'percent'), + 'pricing_value' => $_value->getPrice($_value->getPriceType() == 'percent') )); $htmlValue = $_value->getOptionTypeId(); @@ -124,14 +128,19 @@ public function getValuesHtml() $checked = $configValue == $htmlValue ? 'checked' : ''; } - $selectHtml .= '
  • ' . - 'getSkipJsReloadPrice() ? '' : ' onclick="opConfig.reloadPrice()"') . ' name="options['.$_option->getId().']'.$arraySign.'" id="options_'.$_option->getId().'_'.$count.'" value="' . $htmlValue . '" ' . $checked . ' price="' . $this->helper('core')->currencyByStore($_value->getPrice(true), $store, false) . '" />' . - ''; + $selectHtml .= '
  • ' . 'getSkipJsReloadPrice() ? '' : ' onclick="opConfig.reloadPrice()"') + . ' name="options[' . $_option->getId() . ']' . $arraySign . '" id="options_' . $_option->getId() + . '_' . $count . '" value="' . $htmlValue . '" ' . $checked . ' price="' + . $this->helper('core')->currencyByStore($_value->getPrice(true), $store, false) . '" />' + . ''; if ($_option->getIsRequire()) { - $selectHtml .= ''; + $selectHtml .= ''; } $selectHtml .= '
  • '; } diff --git a/app/code/core/Mage/Catalog/Block/Product/View/Options/Type/Text.php b/app/code/core/Mage/Catalog/Block/Product/View/Options/Type/Text.php index 697a12f317..597d145d43 100644 --- a/app/code/core/Mage/Catalog/Block/Product/View/Options/Type/Text.php +++ b/app/code/core/Mage/Catalog/Block/Product/View/Options/Type/Text.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Product/View/Price.php b/app/code/core/Mage/Catalog/Block/Product/View/Price.php index a3359f11c1..d8bca253b8 100644 --- a/app/code/core/Mage/Catalog/Block/Product/View/Price.php +++ b/app/code/core/Mage/Catalog/Block/Product/View/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Product/View/Tabs.php b/app/code/core/Mage/Catalog/Block/Product/View/Tabs.php index e2212d40c6..5c6107cd96 100644 --- a/app/code/core/Mage/Catalog/Block/Product/View/Tabs.php +++ b/app/code/core/Mage/Catalog/Block/Product/View/Tabs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Product/View/Type/Configurable.php b/app/code/core/Mage/Catalog/Block/Product/View/Type/Configurable.php index eb0ff63514..8892fcc563 100644 --- a/app/code/core/Mage/Catalog/Block/Product/View/Type/Configurable.php +++ b/app/code/core/Mage/Catalog/Block/Product/View/Type/Configurable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -34,20 +34,41 @@ */ class Mage_Catalog_Block_Product_View_Type_Configurable extends Mage_Catalog_Block_Product_View_Abstract { + /** + * Prices + * + * @var array + */ protected $_prices = array(); + + /** + * Prepared prices + * + * @var array + */ protected $_resPrices = array(); + /** + * Get allowed attributes + * + * @return array + */ public function getAllowAttributes() { return $this->getProduct()->getTypeInstance(true) ->getConfigurableAttributes($this->getProduct()); } + /** + * Check if allowed attributes have options + * + * @return bool + */ public function hasOptions() { $attributes = $this->getAllowAttributes(); if (count($attributes)) { - foreach ($attributes as $key => $attribute) { + foreach ($attributes as $attribute) { /** @var Mage_Catalog_Model_Product_Type_Configurable_Attribute $attribute */ if ($attribute->getData('prices')) { return true; @@ -57,14 +78,20 @@ public function hasOptions() return false; } + /** + * Get Allowed Products + * + * @return array + */ public function getAllowProducts() { if (!$this->hasAllowProducts()) { $products = array(); + $skipSaleableCheck = Mage::helper('catalog/product')->getSkipSaleableCheck(); $allProducts = $this->getProduct()->getTypeInstance(true) ->getUsedProducts(null, $this->getProduct()); foreach ($allProducts as $product) { - if ($product->isSaleable()) { + if ($product->isSaleable() || $skipSaleableCheck) { $products[] = $product; } } @@ -171,11 +198,10 @@ public function getJsonConfig() 'id' => $value['value_index'], 'label' => $value['label'], 'price' => $configurablePrice, - 'oldPrice' => $this->_preparePrice($value['pricing_value'], $value['is_percent']), + 'oldPrice' => $this->_prepareOldPrice($value['pricing_value'], $value['is_percent']), 'products' => $productsIndex, ); $optionPrices[] = $configurablePrice; - //$this->_registerAdditionalJsPrice($value['pricing_value'], $value['is_percent']); } } /** @@ -224,7 +250,6 @@ public function getJsonConfig() $config = array( 'attributes' => $attributes, 'template' => str_replace('%s', '#{price}', $store->getCurrentCurrency()->getOutputFormat()), -// 'prices' => $this->_prices, 'basePrice' => $this->_registerJsPrice($this->_convertPrice($currentProduct->getFinalPrice())), 'oldPrice' => $this->_registerJsPrice($this->_convertPrice($currentProduct->getPrice())), 'productId' => $currentProduct->getId(), @@ -244,7 +269,7 @@ public function getJsonConfig() /** * Validating of super product option value * - * @param array $attribute + * @param array $attributeId * @param array $value * @param array $options * @return boolean @@ -272,26 +297,57 @@ protected function _validateAttributeInfo(&$info) return false; } - protected function _preparePrice($price, $isPercent=false) + /** + * Calculation real price + * + * @param float $price + * @param bool $isPercent + * @return mixed + */ + protected function _preparePrice($price, $isPercent = false) { if ($isPercent && !empty($price)) { - $price = $this->getProduct()->getFinalPrice()*$price/100; + $price = $this->getProduct()->getFinalPrice() * $price / 100; } return $this->_registerJsPrice($this->_convertPrice($price, true)); } - protected function _registerJsPrice($price) + /** + * Calculation price before special price + * + * @param float $price + * @param bool $isPercent + * @return mixed + */ + protected function _prepareOldPrice($price, $isPercent = false) { - $jsPrice = str_replace(',', '.', $price); + if ($isPercent && !empty($price)) { + $price = $this->getProduct()->getPrice() * $price / 100; + } -// if (!isset($this->_prices[$jsPrice])) { -// $this->_prices[$jsPrice] = strip_tags(Mage::app()->getStore()->formatPrice($price)); -// } - return $jsPrice; + return $this->_registerJsPrice($this->_convertPrice($price, true)); + } + + /** + * Replace ',' on '.' for js + * + * @param float $price + * @return string + */ + protected function _registerJsPrice($price) + { + return str_replace(',', '.', $price); } - protected function _convertPrice($price, $round=false) + /** + * Convert price from default currency to current currency + * + * @param float $price + * @param boolean $round + * @return float + */ + protected function _convertPrice($price, $round = false) { if (empty($price)) { return 0; @@ -302,32 +358,6 @@ protected function _convertPrice($price, $round=false) $price = $this->getCurrentStore()->roundPrice($price); } - return $price; } - -// protected function _registerAdditionalJsPrice($price, $isPercent=false) -// { -// if (empty($price) && isset($this->_prices[0])) { -// return $this; -// } -// -// $basePrice = $this->getProduct()->getFinalPrice(); -// if ($isPercent) { -// $price = $basePrice*$price/100; -// } -// else { -// $price = $price; -// } -// -// $price = $this->_convertPrice($price); -// -// foreach ($this->_resPrices as $prevPrice) { -// $additionalPrice = $prevPrice + $price; -// $this->_resPrices[] = $additionalPrice; -// $jsAdditionalPrice = str_replace(',', '.', $additionalPrice); -// $this->_prices[$jsAdditionalPrice] = strip_tags(Mage::app()->getStore()->formatPrice($additionalPrice)); -// } -// return $this; -// } } diff --git a/app/code/core/Mage/Catalog/Block/Product/View/Type/Grouped.php b/app/code/core/Mage/Catalog/Block/Product/View/Type/Grouped.php index dd972c7e5f..91c726febb 100644 --- a/app/code/core/Mage/Catalog/Block/Product/View/Type/Grouped.php +++ b/app/code/core/Mage/Catalog/Block/Product/View/Type/Grouped.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Product/View/Type/Simple.php b/app/code/core/Mage/Catalog/Block/Product/View/Type/Simple.php index e2bf595398..fb4f9bb2eb 100644 --- a/app/code/core/Mage/Catalog/Block/Product/View/Type/Simple.php +++ b/app/code/core/Mage/Catalog/Block/Product/View/Type/Simple.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Product/View/Type/Virtual.php b/app/code/core/Mage/Catalog/Block/Product/View/Type/Virtual.php index f8f503579c..65f1c14fa1 100644 --- a/app/code/core/Mage/Catalog/Block/Product/View/Type/Virtual.php +++ b/app/code/core/Mage/Catalog/Block/Product/View/Type/Virtual.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Product/Widget/Link.php b/app/code/core/Mage/Catalog/Block/Product/Widget/Link.php index 88bc92630c..f5542bb217 100644 --- a/app/code/core/Mage/Catalog/Block/Product/Widget/Link.php +++ b/app/code/core/Mage/Catalog/Block/Product/Widget/Link.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Product/Widget/New.php b/app/code/core/Mage/Catalog/Block/Product/Widget/New.php index 5d1a09e551..c277e03049 100644 --- a/app/code/core/Mage/Catalog/Block/Product/Widget/New.php +++ b/app/code/core/Mage/Catalog/Block/Product/Widget/New.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Seo/Sitemap/Abstract.php b/app/code/core/Mage/Catalog/Block/Seo/Sitemap/Abstract.php index fd1c7e7db5..efc7f64167 100644 --- a/app/code/core/Mage/Catalog/Block/Seo/Sitemap/Abstract.php +++ b/app/code/core/Mage/Catalog/Block/Seo/Sitemap/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Seo/Sitemap/Category.php b/app/code/core/Mage/Catalog/Block/Seo/Sitemap/Category.php index cecaf1c6a8..74a56b5b2c 100644 --- a/app/code/core/Mage/Catalog/Block/Seo/Sitemap/Category.php +++ b/app/code/core/Mage/Catalog/Block/Seo/Sitemap/Category.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Seo/Sitemap/Product.php b/app/code/core/Mage/Catalog/Block/Seo/Sitemap/Product.php index 9b50d101de..a4e5c0e139 100644 --- a/app/code/core/Mage/Catalog/Block/Seo/Sitemap/Product.php +++ b/app/code/core/Mage/Catalog/Block/Seo/Sitemap/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Seo/Sitemap/Tree/Category.php b/app/code/core/Mage/Catalog/Block/Seo/Sitemap/Tree/Category.php index d61709a1d8..05ab5b2307 100644 --- a/app/code/core/Mage/Catalog/Block/Seo/Sitemap/Tree/Category.php +++ b/app/code/core/Mage/Catalog/Block/Seo/Sitemap/Tree/Category.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Seo/Sitemap/Tree/Pager.php b/app/code/core/Mage/Catalog/Block/Seo/Sitemap/Tree/Pager.php index a628139e7f..2690d6060f 100644 --- a/app/code/core/Mage/Catalog/Block/Seo/Sitemap/Tree/Pager.php +++ b/app/code/core/Mage/Catalog/Block/Seo/Sitemap/Tree/Pager.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Widget/Link.php b/app/code/core/Mage/Catalog/Block/Widget/Link.php index 40483c2b92..61a2661de3 100644 --- a/app/code/core/Mage/Catalog/Block/Widget/Link.php +++ b/app/code/core/Mage/Catalog/Block/Widget/Link.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Exception.php b/app/code/core/Mage/Catalog/Exception.php index 7a572a962a..724265ed90 100644 --- a/app/code/core/Mage/Catalog/Exception.php +++ b/app/code/core/Mage/Catalog/Exception.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Helper/Category.php b/app/code/core/Mage/Catalog/Helper/Category.php index 465e7ed2a2..4c3e9d18be 100644 --- a/app/code/core/Mage/Catalog/Helper/Category.php +++ b/app/code/core/Mage/Catalog/Helper/Category.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Helper/Category/Flat.php b/app/code/core/Mage/Catalog/Helper/Category/Flat.php index 3e8ac5405a..aaba1d7ed6 100644 --- a/app/code/core/Mage/Catalog/Helper/Category/Flat.php +++ b/app/code/core/Mage/Catalog/Helper/Category/Flat.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Helper/Data.php b/app/code/core/Mage/Catalog/Helper/Data.php index f464e4b9ef..cc5383c005 100644 --- a/app/code/core/Mage/Catalog/Helper/Data.php +++ b/app/code/core/Mage/Catalog/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -41,6 +41,7 @@ class Mage_Catalog_Helper_Data extends Mage_Core_Helper_Abstract const CONFIG_USE_STATIC_URLS = 'cms/wysiwyg/use_static_urls_in_catalog'; const CONFIG_PARSE_URL_DIRECTIVES = 'catalog/frontend/parse_url_directives'; const XML_PATH_CONTENT_TEMPLATE_FILTER = 'global/catalog/content/tempate_filter'; + const XML_PATH_DISPLAY_PRODUCT_COUNT = 'catalog/layered_navigation/display_product_count'; /** * Minimum advertise price constants @@ -464,4 +465,14 @@ public function isShowPriceOnGesture($product) Mage_Catalog_Model_Product_Attribute_Source_Msrp_Type::TYPE_ON_GESTURE ); } + + /** + * Whether to display items count for each filter option + * @param int $storeId Store view ID + * @return bool + */ + public function shouldDisplayProductCountOnLayer($storeId = null) + { + return Mage::getStoreConfigFlag(self::XML_PATH_DISPLAY_PRODUCT_COUNT, $storeId); + } } diff --git a/app/code/core/Mage/Catalog/Helper/Image.php b/app/code/core/Mage/Catalog/Helper/Image.php index 345da6abd3..cafed95f77 100644 --- a/app/code/core/Mage/Catalog/Helper/Image.php +++ b/app/code/core/Mage/Catalog/Helper/Image.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Helper/Map.php b/app/code/core/Mage/Catalog/Helper/Map.php index 3ecff8dab9..e819ffb486 100644 --- a/app/code/core/Mage/Catalog/Helper/Map.php +++ b/app/code/core/Mage/Catalog/Helper/Map.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Helper/Output.php b/app/code/core/Mage/Catalog/Helper/Output.php index 15d277d732..2908985c01 100644 --- a/app/code/core/Mage/Catalog/Helper/Output.php +++ b/app/code/core/Mage/Catalog/Helper/Output.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Helper/Product.php b/app/code/core/Mage/Catalog/Helper/Product.php old mode 100644 new mode 100755 index 14130e20b1..3b2659bcf0 --- a/app/code/core/Mage/Catalog/Helper/Product.php +++ b/app/code/core/Mage/Catalog/Helper/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -35,6 +35,13 @@ class Mage_Catalog_Helper_Product extends Mage_Core_Helper_Url const XML_PATH_PRODUCT_URL_USE_CATEGORY = 'catalog/seo/product_use_categories'; const XML_PATH_USE_PRODUCT_CANONICAL_TAG = 'catalog/seo/product_canonical_tag'; + /** + * Flag that shows if Magento has to check product to be saleable (enabled and/or inStock) + * + * @var boolean + */ + protected $_skipSaleableCheck = false; + /** * Cache for product rewrite suffix * @@ -307,6 +314,8 @@ public function initProduct($productId, $controller, $params = null) if ($product->canBeShowInCategory($lastId)) { $categoryId = $lastId; } + } elseif (!$product->canBeShowInCategory($categoryId)) { + $categoryId = null; } if ($categoryId) { @@ -436,4 +445,27 @@ public function getProduct($productId, $store, $identifierType = null) return $product; } + /** + * Set flag that shows if Magento has to check product to be saleable (enabled and/or inStock) + * + * For instance, during order creation in the backend admin has ability to add any products to order + * + * @param bool $skipSaleableCheck + * @return Mage_Catalog_Helper_Product + */ + public function setSkipSaleableCheck($skipSaleableCheck = false) + { + $this->_skipSaleableCheck = $skipSaleableCheck; + return $this; + } + + /** + * Get flag that shows if Magento has to check product to be saleable (enabled and/or inStock) + * + * @return boolean + */ + public function getSkipSaleableCheck() + { + return $this->_skipSaleableCheck; + } } diff --git a/app/code/core/Mage/Catalog/Helper/Product/Compare.php b/app/code/core/Mage/Catalog/Helper/Product/Compare.php index 31e9a74e58..d38d2ba694 100644 --- a/app/code/core/Mage/Catalog/Helper/Product/Compare.php +++ b/app/code/core/Mage/Catalog/Helper/Product/Compare.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Helper/Product/Configuration.php b/app/code/core/Mage/Catalog/Helper/Product/Configuration.php index ce9e98360a..2e730c1c57 100644 --- a/app/code/core/Mage/Catalog/Helper/Product/Configuration.php +++ b/app/code/core/Mage/Catalog/Helper/Product/Configuration.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Helper/Product/Configuration/Interface.php b/app/code/core/Mage/Catalog/Helper/Product/Configuration/Interface.php index 4352261c41..f5575f1646 100644 --- a/app/code/core/Mage/Catalog/Helper/Product/Configuration/Interface.php +++ b/app/code/core/Mage/Catalog/Helper/Product/Configuration/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Helper/Product/Flat.php b/app/code/core/Mage/Catalog/Helper/Product/Flat.php index 0142e66516..4eacef653f 100644 --- a/app/code/core/Mage/Catalog/Helper/Product/Flat.php +++ b/app/code/core/Mage/Catalog/Helper/Product/Flat.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Helper/Product/Options.php b/app/code/core/Mage/Catalog/Helper/Product/Options.php index f57ea7a23b..53aaa083d4 100644 --- a/app/code/core/Mage/Catalog/Helper/Product/Options.php +++ b/app/code/core/Mage/Catalog/Helper/Product/Options.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Helper/Product/Url.php b/app/code/core/Mage/Catalog/Helper/Product/Url.php index 8a3a77ea78..3b9bb2507b 100644 --- a/app/code/core/Mage/Catalog/Helper/Product/Url.php +++ b/app/code/core/Mage/Catalog/Helper/Product/Url.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Helper/Product/View.php b/app/code/core/Mage/Catalog/Helper/Product/View.php index acdb9ea1c1..d86a7adb6d 100644 --- a/app/code/core/Mage/Catalog/Helper/Product/View.php +++ b/app/code/core/Mage/Catalog/Helper/Product/View.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Abstract.php b/app/code/core/Mage/Catalog/Model/Abstract.php index 099cad5956..d5734c71d4 100644 --- a/app/code/core/Mage/Catalog/Model/Abstract.php +++ b/app/code/core/Mage/Catalog/Model/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Api/Resource.php b/app/code/core/Mage/Catalog/Model/Api/Resource.php index bfe7e715ff..9d47435976 100644 --- a/app/code/core/Mage/Catalog/Model/Api/Resource.php +++ b/app/code/core/Mage/Catalog/Model/Api/Resource.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Attribute/Backend/Customlayoutupdate.php b/app/code/core/Mage/Catalog/Model/Attribute/Backend/Customlayoutupdate.php index 6a23b8638d..6c4249c2ca 100644 --- a/app/code/core/Mage/Catalog/Model/Attribute/Backend/Customlayoutupdate.php +++ b/app/code/core/Mage/Catalog/Model/Attribute/Backend/Customlayoutupdate.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Category.php b/app/code/core/Mage/Catalog/Model/Category.php index 6b969a85dc..90baa36883 100644 --- a/app/code/core/Mage/Catalog/Model/Category.php +++ b/app/code/core/Mage/Catalog/Model/Category.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -934,16 +934,16 @@ public function validate() } /** - * Init indexing process after category data commit + * Init indexing process after category save * * @return Mage_Catalog_Model_Category */ - public function afterCommitCallback() + protected function _afterSave() { - parent::afterCommitCallback(); + $result = parent::_afterSave(); Mage::getSingleton('index/indexer')->processEntityAction( $this, self::ENTITY, Mage_Index_Model_Event::TYPE_SAVE ); - return $this; + return $result; } } diff --git a/app/code/core/Mage/Catalog/Model/Category/Api.php b/app/code/core/Mage/Catalog/Model/Category/Api.php index 1aaddbbb35..cd5c60b1f9 100644 --- a/app/code/core/Mage/Catalog/Model/Category/Api.php +++ b/app/code/core/Mage/Catalog/Model/Category/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Category/Api/V2.php b/app/code/core/Mage/Catalog/Model/Category/Api/V2.php index d512106567..540d0b9719 100644 --- a/app/code/core/Mage/Catalog/Model/Category/Api/V2.php +++ b/app/code/core/Mage/Catalog/Model/Category/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Category/Attribute/Api.php b/app/code/core/Mage/Catalog/Model/Category/Attribute/Api.php index 04058ec294..a57a6245f9 100644 --- a/app/code/core/Mage/Catalog/Model/Category/Attribute/Api.php +++ b/app/code/core/Mage/Catalog/Model/Category/Attribute/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Category/Attribute/Api/V2.php b/app/code/core/Mage/Catalog/Model/Category/Attribute/Api/V2.php index ddd8489b9b..3328b324e0 100644 --- a/app/code/core/Mage/Catalog/Model/Category/Attribute/Api/V2.php +++ b/app/code/core/Mage/Catalog/Model/Category/Attribute/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Category/Attribute/Backend/Image.php b/app/code/core/Mage/Catalog/Model/Category/Attribute/Backend/Image.php index 1d67a5098c..b9f07718ea 100644 --- a/app/code/core/Mage/Catalog/Model/Category/Attribute/Backend/Image.php +++ b/app/code/core/Mage/Catalog/Model/Category/Attribute/Backend/Image.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Category/Attribute/Backend/Sortby.php b/app/code/core/Mage/Catalog/Model/Category/Attribute/Backend/Sortby.php index 93e8845e75..cf118acfac 100644 --- a/app/code/core/Mage/Catalog/Model/Category/Attribute/Backend/Sortby.php +++ b/app/code/core/Mage/Catalog/Model/Category/Attribute/Backend/Sortby.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Category/Attribute/Backend/Urlkey.php b/app/code/core/Mage/Catalog/Model/Category/Attribute/Backend/Urlkey.php index 9496856da1..501115fe43 100644 --- a/app/code/core/Mage/Catalog/Model/Category/Attribute/Backend/Urlkey.php +++ b/app/code/core/Mage/Catalog/Model/Category/Attribute/Backend/Urlkey.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Category/Attribute/Source/Layout.php b/app/code/core/Mage/Catalog/Model/Category/Attribute/Source/Layout.php index d3511b020a..dedbe0be12 100644 --- a/app/code/core/Mage/Catalog/Model/Category/Attribute/Source/Layout.php +++ b/app/code/core/Mage/Catalog/Model/Category/Attribute/Source/Layout.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Category/Attribute/Source/Mode.php b/app/code/core/Mage/Catalog/Model/Category/Attribute/Source/Mode.php index 6c0c1a355b..7f8255f12e 100644 --- a/app/code/core/Mage/Catalog/Model/Category/Attribute/Source/Mode.php +++ b/app/code/core/Mage/Catalog/Model/Category/Attribute/Source/Mode.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Category/Attribute/Source/Page.php b/app/code/core/Mage/Catalog/Model/Category/Attribute/Source/Page.php index d420450244..c039f3ddf1 100644 --- a/app/code/core/Mage/Catalog/Model/Category/Attribute/Source/Page.php +++ b/app/code/core/Mage/Catalog/Model/Category/Attribute/Source/Page.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Category/Attribute/Source/Sortby.php b/app/code/core/Mage/Catalog/Model/Category/Attribute/Source/Sortby.php index c69122644a..083399e5f5 100644 --- a/app/code/core/Mage/Catalog/Model/Category/Attribute/Source/Sortby.php +++ b/app/code/core/Mage/Catalog/Model/Category/Attribute/Source/Sortby.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Category/Indexer/Flat.php b/app/code/core/Mage/Catalog/Model/Category/Indexer/Flat.php index 9a3e140caa..f13b469028 100644 --- a/app/code/core/Mage/Catalog/Model/Category/Indexer/Flat.php +++ b/app/code/core/Mage/Catalog/Model/Category/Indexer/Flat.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Category/Indexer/Product.php b/app/code/core/Mage/Catalog/Model/Category/Indexer/Product.php index 1c84e4541a..da8acff290 100644 --- a/app/code/core/Mage/Catalog/Model/Category/Indexer/Product.php +++ b/app/code/core/Mage/Catalog/Model/Category/Indexer/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Config.php b/app/code/core/Mage/Catalog/Model/Config.php index 51e50c6b7d..a1464ccfda 100644 --- a/app/code/core/Mage/Catalog/Model/Config.php +++ b/app/code/core/Mage/Catalog/Model/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Convert.php b/app/code/core/Mage/Catalog/Model/Convert.php index c1f120ee1a..8f2eebbe6f 100644 --- a/app/code/core/Mage/Catalog/Model/Convert.php +++ b/app/code/core/Mage/Catalog/Model/Convert.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Convert/Adapter/Catalog.php b/app/code/core/Mage/Catalog/Model/Convert/Adapter/Catalog.php index aab00fa0da..e1cad461a6 100644 --- a/app/code/core/Mage/Catalog/Model/Convert/Adapter/Catalog.php +++ b/app/code/core/Mage/Catalog/Model/Convert/Adapter/Catalog.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Convert/Adapter/Product.php b/app/code/core/Mage/Catalog/Model/Convert/Adapter/Product.php index 2af60b468d..2a9987e560 100644 --- a/app/code/core/Mage/Catalog/Model/Convert/Adapter/Product.php +++ b/app/code/core/Mage/Catalog/Model/Convert/Adapter/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Convert/Parser/Product.php b/app/code/core/Mage/Catalog/Model/Convert/Parser/Product.php index 8a74d1e507..ca0efb8014 100644 --- a/app/code/core/Mage/Catalog/Model/Convert/Parser/Product.php +++ b/app/code/core/Mage/Catalog/Model/Convert/Parser/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Design.php b/app/code/core/Mage/Catalog/Model/Design.php index a531614b2a..00a2b56198 100644 --- a/app/code/core/Mage/Catalog/Model/Design.php +++ b/app/code/core/Mage/Catalog/Model/Design.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Entity/Attribute.php b/app/code/core/Mage/Catalog/Model/Entity/Attribute.php index 74037c874f..433b4c653e 100644 --- a/app/code/core/Mage/Catalog/Model/Entity/Attribute.php +++ b/app/code/core/Mage/Catalog/Model/Entity/Attribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Entity/Product/Attribute/Design/Options/Container.php b/app/code/core/Mage/Catalog/Model/Entity/Product/Attribute/Design/Options/Container.php index 58028a8383..d7ab088c0c 100644 --- a/app/code/core/Mage/Catalog/Model/Entity/Product/Attribute/Design/Options/Container.php +++ b/app/code/core/Mage/Catalog/Model/Entity/Product/Attribute/Design/Options/Container.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Entity/Product/Attribute/Frontend/Image.php b/app/code/core/Mage/Catalog/Model/Entity/Product/Attribute/Frontend/Image.php index 0917b98203..cd2c03aafb 100644 --- a/app/code/core/Mage/Catalog/Model/Entity/Product/Attribute/Frontend/Image.php +++ b/app/code/core/Mage/Catalog/Model/Entity/Product/Attribute/Frontend/Image.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Index.php b/app/code/core/Mage/Catalog/Model/Index.php index 7c347ec6be..25bc5e942a 100644 --- a/app/code/core/Mage/Catalog/Model/Index.php +++ b/app/code/core/Mage/Catalog/Model/Index.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Indexer/Url.php b/app/code/core/Mage/Catalog/Model/Indexer/Url.php index d84aef427a..88af0ccf51 100644 --- a/app/code/core/Mage/Catalog/Model/Indexer/Url.php +++ b/app/code/core/Mage/Catalog/Model/Indexer/Url.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -222,6 +222,7 @@ protected function _processEvent(Mage_Index_Model_Event $event) $this->reindexAll(); } + /* @var $urlModel Mage_Catalog_Model_Url */ $urlModel = Mage::getSingleton('catalog/url'); // Force rewrites history saving diff --git a/app/code/core/Mage/Catalog/Model/Layer.php b/app/code/core/Mage/Catalog/Model/Layer.php index ee17087000..01832bf537 100644 --- a/app/code/core/Mage/Catalog/Model/Layer.php +++ b/app/code/core/Mage/Catalog/Model/Layer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -120,7 +120,6 @@ public function prepareProductCollection($collection) ->addMinimalPrice() ->addFinalPrice() ->addTaxPercents() - //->addStoreFilter() ->addUrlRewrite($this->getCurrentCategory()->getId()); Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($collection); diff --git a/app/code/core/Mage/Catalog/Model/Layer/Filter/Abstract.php b/app/code/core/Mage/Catalog/Model/Layer/Filter/Abstract.php index 29fb8fcfda..1694b4b989 100644 --- a/app/code/core/Mage/Catalog/Model/Layer/Filter/Abstract.php +++ b/app/code/core/Mage/Catalog/Model/Layer/Filter/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -300,4 +300,14 @@ public function setWebsiteId($websiteId) { return $this->setData('website_id', $websiteId); } + + /** + * Clear current element link text, for example 'Clear Price' + * + * @return false|string + */ + public function getClearLinkText() + { + return false; + } } diff --git a/app/code/core/Mage/Catalog/Model/Layer/Filter/Attribute.php b/app/code/core/Mage/Catalog/Model/Layer/Filter/Attribute.php index 8f5be3c794..cee75d9d40 100644 --- a/app/code/core/Mage/Catalog/Model/Layer/Filter/Attribute.php +++ b/app/code/core/Mage/Catalog/Model/Layer/Filter/Attribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -126,7 +126,6 @@ protected function _getItemsData() $options = $attribute->getFrontend()->getSelectOptions(); $optionsCount = $this->_getResource()->getCount($this); $data = array(); - foreach ($options as $option) { if (is_array($option['value'])) { continue; diff --git a/app/code/core/Mage/Catalog/Model/Layer/Filter/Category.php b/app/code/core/Mage/Catalog/Model/Layer/Filter/Category.php index 969184a993..f7391fb59a 100644 --- a/app/code/core/Mage/Catalog/Model/Layer/Filter/Category.php +++ b/app/code/core/Mage/Catalog/Model/Layer/Filter/Category.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Layer/Filter/Decimal.php b/app/code/core/Mage/Catalog/Model/Layer/Filter/Decimal.php index d656cd3977..c4d65b5ff1 100644 --- a/app/code/core/Mage/Catalog/Model/Layer/Filter/Decimal.php +++ b/app/code/core/Mage/Catalog/Model/Layer/Filter/Decimal.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Layer/Filter/Item.php b/app/code/core/Mage/Catalog/Model/Layer/Filter/Item.php index 50cc94afd7..74fad747bb 100644 --- a/app/code/core/Mage/Catalog/Model/Layer/Filter/Item.php +++ b/app/code/core/Mage/Catalog/Model/Layer/Filter/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -78,6 +78,27 @@ public function getRemoveUrl() return Mage::getUrl('*/*/*', $params); } + /** + * Get url for "clear" link + * + * @return false|string + */ + public function getClearLinkUrl() + { + $clearLinkText = $this->getFilter()->getClearLinkText(); + if (!$clearLinkText) { + return false; + } + + $urlParams = array( + '_current' => true, + '_use_rewrite' => true, + '_query' => array($this->getFilter()->getRequestVar() => null), + '_escape' => true, + ); + return Mage::getUrl('*/*/*', $urlParams); + } + /** * Get item filter name * diff --git a/app/code/core/Mage/Catalog/Model/Layer/Filter/Price.php b/app/code/core/Mage/Catalog/Model/Layer/Filter/Price.php index 90c36aa453..2250423714 100644 --- a/app/code/core/Mage/Catalog/Model/Layer/Filter/Price.php +++ b/app/code/core/Mage/Catalog/Model/Layer/Filter/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -38,12 +38,25 @@ */ class Mage_Catalog_Model_Layer_Filter_Price extends Mage_Catalog_Model_Layer_Filter_Abstract { + /** + * XML configuration paths for Price Layered Navigation + */ const XML_PATH_RANGE_CALCULATION = 'catalog/layered_navigation/price_range_calculation'; const XML_PATH_RANGE_STEP = 'catalog/layered_navigation/price_range_step'; const XML_PATH_RANGE_MAX_INTERVALS = 'catalog/layered_navigation/price_range_max_intervals'; + const XML_PATH_ONE_PRICE_INTERVAL = 'catalog/layered_navigation/one_price_interval'; + const XML_PATH_INTERVAL_DIVISION_LIMIT = 'catalog/layered_navigation/interval_division_limit'; - const RANGE_CALCULATION_AUTO = 'auto'; + /** + * Price layered navigation mode: Automatic, Continuous, Manual + */ + const RANGE_CALCULATION_AUTO = 'auto'; + const RANGE_CALCULATION_IMPROVED = 'improved'; const RANGE_CALCULATION_MANUAL = 'manual'; + + /** + * Minimal size of the range + */ const MIN_RANGE_POWER = 10; /** @@ -104,7 +117,7 @@ public function getPriceRange() } while($range > self::MIN_RANGE_POWER && count($items) < 2); } else { - $range = Mage::app()->getStore()->getConfig(self::XML_PATH_RANGE_STEP); + $range = (float)Mage::app()->getStore()->getConfig(self::XML_PATH_RANGE_STEP); } } @@ -123,7 +136,7 @@ public function getMaxPriceInt() { $maxPrice = $this->getData('max_price_int'); if (is_null($maxPrice)) { - $maxPrice = $this->_getResource()->getMaxPrice($this); + $maxPrice = $this->getLayer()->getProductCollection()->getMaxPrice(); $maxPrice = floor($maxPrice); $this->setData('max_price_int', $maxPrice); } @@ -147,9 +160,10 @@ public function getRangeItemCounts($range) $i = 0; $lastIndex = null; $maxIntervalsNumber = $this->getMaxIntervalsNumber(); + $calculation = Mage::app()->getStore()->getConfig(self::XML_PATH_RANGE_CALCULATION); foreach ($items as $k => $v) { ++$i; - if ($i > 1 && $i > $maxIntervalsNumber) { + if ($calculation == self::RANGE_CALCULATION_MANUAL && $i > 1 && $i > $maxIntervalsNumber) { $items[$lastIndex] += $v; unset($items[$k]); } else { @@ -190,12 +204,15 @@ protected function _renderRangeLabel($fromPrice, $toPrice) { $store = Mage::app()->getStore(); $formattedFromPrice = $store->formatPrice($fromPrice); - if (empty($toPrice)) { + if ($toPrice === '') { return Mage::helper('catalog')->__('%s and above', $formattedFromPrice); - } elseif ($fromPrice == $toPrice) { + } elseif ($fromPrice == $toPrice && Mage::app()->getStore()->getConfig(self::XML_PATH_ONE_PRICE_INTERVAL)) { return $formattedFromPrice; } else { - return Mage::helper('catalog')->__('%s - %s', $formattedFromPrice, $store->formatPrice($toPrice - .01)); + if ($fromPrice != $toPrice) { + $toPrice -= .01; + } + return Mage::helper('catalog')->__('%s - %s', $formattedFromPrice, $store->formatPrice($toPrice)); } } @@ -219,26 +236,58 @@ protected function _getCacheKey() } /** - * Get data generated by algorithm for build price filter items + * Get additional request param data * - * @return array + * @return string */ - protected function _getCalculatedItemsData() + protected function _getAdditionalRequestData() { + $result = ''; $appliedInterval = $this->getInterval(); if ($appliedInterval) { - return array(); + $result = ',' . $appliedInterval[0] . '-' . $appliedInterval[1]; + $priorIntervals = $this->getResetValue(); + if ($priorIntervals) { + $result .= ',' . $priorIntervals; + } } + return $result; + } + + /** + * Get data generated by algorithm for build price filter items + * + * @return array + */ + protected function _getCalculatedItemsData() + { /** @var $algorithmModel Mage_Catalog_Model_Layer_Filter_Price_Algorithm */ $algorithmModel = Mage::getSingleton('catalog/layer_filter_price_algorithm'); - $this->_getResource()->loadAllPrices($algorithmModel, $this); + $collection = $this->getLayer()->getProductCollection(); + if ($collection->getPricesCount() <= $this->getIntervalDivisionLimit()) { + return array(); + } + $algorithmModel->setPricesModel($this)->setStatistics( + $collection->getMinPrice(), + $collection->getMaxPrice(), + $collection->getPriceStandardDeviation(), + $collection->getPricesCount() + ); + $appliedInterval = $this->getInterval(); + if ($appliedInterval) { + if ($appliedInterval[0] == $appliedInterval[1]) { + return array(); + } + $algorithmModel->setLimits($appliedInterval[0], $appliedInterval[1]); + } $items = array(); foreach ($algorithmModel->calculateSeparators() as $separator) { $items[] = array( 'label' => $this->_renderRangeLabel($separator['from'], $separator['to']), - 'value' => (($separator['from'] == 0) ? '' : $separator['from']) . '-' . $separator['to'], + 'value' => (($separator['from'] == 0) ? '' : $separator['from']) + . '-' . $separator['to'] . $this->_getAdditionalRequestData(), 'count' => $separator['count'], ); } @@ -253,13 +302,10 @@ protected function _getCalculatedItemsData() */ protected function _getItemsData() { - // check if filter is already applied - if ($this->getInterval()) { - return array(); - } - - if (Mage::app()->getStore()->getConfig(self::XML_PATH_RANGE_CALCULATION) == self::RANGE_CALCULATION_AUTO) { + if (Mage::app()->getStore()->getConfig(self::XML_PATH_RANGE_CALCULATION) == self::RANGE_CALCULATION_IMPROVED) { return $this->_getCalculatedItemsData(); + } elseif ($this->getInterval()) { + return array(); } $range = $this->getPriceRange(); @@ -296,6 +342,27 @@ protected function _applyPriceRange() return $this; } + /** + * Validate and parse filter request param + * + * @param string $filter + * @return array|bool + */ + protected function _validateFilter($filter) + { + $filter = explode('-', $filter); + if (count($filter) != 2) { + return false; + } + foreach ($filter as $v) { + if (($v !== '' && $v !== '0' && (float)$v <= 0) || is_infinite((float)$v)) { + return false; + } + } + + return $filter; + } + /** * Apply price range filter * @@ -315,20 +382,31 @@ public function apply(Zend_Controller_Request_Abstract $request, $filterBlock) } //validate filter - $filter = explode('-', $filter); - if (count($filter) != 2) { + $filterParams = explode(',', $filter); + $filter = $this->_validateFilter($filterParams[0]); + if (!$filter) { return $this; } - foreach ($filter as $v) { - if ($v !== '' && (float)$v <= 0) { - return $this; - } - } list($from, $to) = $filter; $this->setInterval(array($from, $to)); + $priorFilters = array(); + for ($i = 1; $i < count($filterParams); ++$i) { + $priorFilter = $this->_validateFilter($filterParams[$i]); + if ($priorFilter) { + $priorFilters[] = $priorFilter; + } else { + //not valid data + $priorFilters = array(); + break; + } + } + if ($priorFilters) { + $this->setPriorIntervals($priorFilters); + } + $this->_applyPriceRange(); $this->getLayer()->getState()->addFilter($this->_createItem( $this->_renderRangeLabel(empty($from) ? 0 : $from, $to), @@ -414,4 +492,103 @@ public function getMaxIntervalsNumber() { return (int)Mage::app()->getStore()->getConfig(self::XML_PATH_RANGE_MAX_INTERVALS); } + + /** + * Get interval division limit + * + * @return int + */ + public function getIntervalDivisionLimit() + { + return (int)Mage::app()->getStore()->getConfig(self::XML_PATH_INTERVAL_DIVISION_LIMIT); + } + + /** + * Get filter value for reset current filter state + * + * @return null|string + */ + public function getResetValue() + { + $priorIntervals = $this->getPriorIntervals(); + $value = array(); + if ($priorIntervals) { + foreach ($priorIntervals as $priorInterval) { + $value[] = implode('-', $priorInterval); + } + return implode(',', $value); + } + return parent::getResetValue(); + } + + /** + * Get 'clear price' link text + * + * @return false|string + */ + public function getClearLinkText() + { + if (Mage::app()->getStore()->getConfig(self::XML_PATH_RANGE_CALCULATION) == self::RANGE_CALCULATION_IMPROVED + && $this->getPriorIntervals() + ) { + return Mage::helper('catalog')->__('Clear Price'); + } + + return parent::getClearLinkText(); + } + + /** + * Load range of product prices + * + * @param int $limit + * @param null|int $offset + * @param null|int $lowerPrice + * @param null|int $upperPrice + * @return array|false + */ + public function loadPrices($limit, $offset = null, $lowerPrice = null, $upperPrice = null) + { + $prices = $this->_getResource()->loadPrices($this, $limit, $offset, $lowerPrice, $upperPrice); + if ($prices) { + $prices = array_map('floatval', $prices); + } + + return $prices; + } + + /** + * Load range of product prices, preceding the price + * + * @param float $price + * @param int $index + * @param null|int $lowerPrice + * @return array|false + */ + public function loadPreviousPrices($price, $index, $lowerPrice = null) + { + $prices = $this->_getResource()->loadPreviousPrices($this, $price, $index, $lowerPrice); + if ($prices) { + $prices = array_map('floatval', $prices); + } + + return $prices; + } + + /** + * Load range of product prices, next to the price + * + * @param float $price + * @param int $rightIndex + * @param null|int $upperPrice + * @return array|false + */ + public function loadNextPrices($price, $rightIndex, $upperPrice = null) + { + $prices = $this->_getResource()->loadNextPrices($this, $price, $rightIndex, $upperPrice); + if ($prices) { + $prices = array_map('floatval', $prices); + } + + return $prices; + } } diff --git a/app/code/core/Mage/Catalog/Model/Layer/Filter/Price/Algorithm.php b/app/code/core/Mage/Catalog/Model/Layer/Filter/Price/Algorithm.php index 0a060376df..82b61a5551 100644 --- a/app/code/core/Mage/Catalog/Model/Layer/Filter/Price/Algorithm.php +++ b/app/code/core/Mage/Catalog/Model/Layer/Filter/Price/Algorithm.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -33,15 +33,41 @@ */ class Mage_Catalog_Model_Layer_Filter_Price_Algorithm { - const MIN_POSSIBLE_PRICE = .01; + /** + * Rounding factor coefficient + */ const TEN_POWER_ROUNDING_FACTOR = 4; /** - * Sorted array of all products prices + * Interval deflection coefficient + */ + const INTERVAL_DEFLECTION_LIMIT = .3; + + /** + * Standard normal distribution's a/2 quantile + * Depends on predefined a. In case of a=0.05 + */ + const STANDARD_NORMAL_DISTRIBUTION = 1.96; + + /** + * Min and Max number of intervals + */ + const MIN_INTERVALS_NUMBER = 2; + const MAX_INTERVALS_NUMBER = 10; + + /** + * Upper prices limit * - * @var array + * @var null|float + */ + protected $_upperLimit = null; + + /** + * Lower prices limit + * + * @var null|float */ - protected $_prices = null; + protected $_lowerLimit = null; /** * Number of segmentation intervals @@ -58,39 +84,152 @@ class Mage_Catalog_Model_Layer_Filter_Price_Algorithm protected $_skippedQuantilesUpperLimits = array(); /** - * Set products prices + * Total count of prices + * + * @var int + */ + protected $_count = 0; + + /** + * Prices model + * + * @var null|Mage_Catalog_Model_Layer_Filter_Price + */ + protected $_pricesModel = null; + + /** + * Current quantile interval + * + * @var array [from, to] + */ + protected $_quantileInterval = array(0, 0); + + /** + * Prices of current quantile + * + * @var array + */ + protected $_prices = array(); + + /** + * Max price + * + * @var float + */ + protected $_maxPrice = 0; + + /** + * Min price + * + * @var float + */ + protected $_minPrice = 0; + + /** + * Last price query limiter * - * @param array $prices + * @var array [index, value] + */ + protected $_lastPriceLimiter = array(null, 0); + + /** + * Set lower and upper limit for algorithm + * + * @param null|float $lowerLimit + * @param null|float $upperLimit * @return Mage_Catalog_Model_Layer_Filter_Price_Algorithm */ - public function setPrices(array $prices) + public function setLimits($lowerLimit = null, $upperLimit = null) { - $this->_prices = $prices; - sort($this->_prices); - $this->_intervalsNumber = null; - $this->_skippedQuantilesUpperLimits = array(); - + $this->_lowerLimit = empty($lowerLimit) ? null : (float)$lowerLimit; + $this->_upperLimit = empty($upperLimit) ? null : (float)$upperLimit; return $this; } /** - * Get min price + * Search first index of price, that satisfy conditions to be 'greater or equal' than $value + * Returns -1 if index was not found + * + * @param float $value + * @param null|array $limits search [from, to] + * @return int + */ + protected function _binarySearch($value, $limits = null) + { + if (empty($this->_prices)) { + return -1; + } + + if (!is_array($limits)) { + $limits = array(); + } + if (!isset($limits[0])) { + $limits[0] = 0; + } + if (!isset($limits[1])) { + $limits[1] = count($this->_prices) - 1; + } + + if ($limits[0] > $limits[1] || $this->_prices[$limits[1]] < $value) { + return -1; + } + + if ($limits[1] - $limits[0] <= 1) { + return ($this->_prices[$limits[0]] < $value) ? $limits[1] : $limits[0]; + } + + $separator = floor(($limits[0] + $limits[1]) / 2); + if ($this->_prices[$separator] < $value) { + $limits[0] = $separator + 1; + } else { + $limits[1] = $separator; + } + + return $this->_binarySearch($value, array($limits[0], $limits[1])); + } + + /** + * Set prices statistics * - * @return float + * @param float $min + * @param float $max + * @param float $standardDeviation + * @param int $count + * @return Mage_Catalog_Model_Layer_Filter_Price_Algorithm */ - public function getMinPrice() + public function setStatistics($min, $max, $standardDeviation, $count) { - return empty($this->_prices) ? 0 : $this->_prices[0]; + $this->_count = $count; + $this->_minPrice = $min; + $this->_maxPrice = $max; + $priceRange = $max - $min; + if ($count < 2 || ($priceRange <= 0)) { + //Same price couldn't be separated with several intervals + $this->_intervalsNumber = 1; + return $this; + } + + if ($standardDeviation <= 0) { + $intervalsNumber = pow(10, self::TEN_POWER_ROUNDING_FACTOR); + } else { + $intervalsNumber = $priceRange * pow($count, 1 / 3) / (3.5 * $standardDeviation); + } + $this->_intervalsNumber = max(ceil($intervalsNumber), self::MIN_INTERVALS_NUMBER); + $this->_intervalsNumber = (int)min($this->_intervalsNumber, self::MAX_INTERVALS_NUMBER); + + return $this; } /** - * Get max price + * Set prices model * - * @return float + * @param Mage_Catalog_Model_Layer_Filter_Price $pricesModel + * @return Mage_Catalog_Model_Layer_Filter_Price_Algorithm */ - public function getMaxPrice() + public function setPricesModel($pricesModel) { - return (empty($this->_prices)) ? 0 : $this->_prices[count($this->_prices) - 1]; + $this->_pricesModel = $pricesModel; + return $this; } /** @@ -104,29 +243,17 @@ public function getIntervalsNumber() return $this->_intervalsNumber; } - $pricesCount = count($this->_prices); - if ($pricesCount < 2 || ($this->getMaxPrice() - $this->getMinPrice() == 0)) { - //Same price couldn't be separated with several intervals - $this->_intervalsNumber = 1; - return $this->_intervalsNumber; - } - - $sum = 0; - $sumSquares = 0; - foreach ($this->_prices as $price) { - $sum += $price; - $sumSquares += $price * $price; - } - - if ($pricesCount * $sumSquares - $sum * $sum <= 0) { - $intervalsNumber = 1000; - } else { - $intervalsNumber = ($this->getMaxPrice() - $this->getMinPrice()) * pow($pricesCount, 5 / 6) - * sqrt(($pricesCount - 1) / ($pricesCount * $sumSquares - $sum * $sum)) / 3.5; - } - $this->_intervalsNumber = min(max(ceil($intervalsNumber), 2), 10); + return 1; + } - return $this->_intervalsNumber; + /** + * Get intervals number with checking skipped quantiles + * + * @return int + */ + protected function _getCalculatedIntervalsNumber() + { + return max(1, $this->getIntervalsNumber() - count($this->_skippedQuantilesUpperLimits)); } /** @@ -141,7 +268,7 @@ protected function _getQuantile($quantileNumber) return 0; } - return $quantileNumber * count($this->_prices) / $this->getIntervalsNumber() - .5; + return $quantileNumber * $this->_count / $this->getIntervalsNumber() - .5; } /** @@ -155,16 +282,15 @@ protected function _getQuantileInterval($quantileNumber) if ($quantileNumber < 1 || $quantileNumber >= $this->getIntervalsNumber()) { return null; } - $pricesCount = count($this->_prices); $quantile = $this->_getQuantile($quantileNumber); - $deflectionLimit = floor($pricesCount / 2 / $this->getIntervalsNumber()); + $deflectionLimit = floor($this->_count / 2 / $this->getIntervalsNumber()); $limits = array( min(floor($quantile - $deflectionLimit), floor($quantile)), max(ceil($quantile + $deflectionLimit - 1), ceil($quantile)), ); - $deflection = $this->_getStandardNormalDistribution() - * sqrt($pricesCount * $quantileNumber * ($this->getIntervalsNumber() - $quantileNumber)) + $deflection = self::STANDARD_NORMAL_DISTRIBUTION + * sqrt($this->_count * $quantileNumber * ($this->getIntervalsNumber() - $quantileNumber)) / $this->getIntervalsNumber(); $left = max(floor($quantile - $deflection - 1), $limits[0], 0); if (array_key_exists($quantileNumber - 1, $this->_skippedQuantilesUpperLimits) @@ -172,18 +298,141 @@ protected function _getQuantileInterval($quantileNumber) ) { $left = $this->_skippedQuantilesUpperLimits[$quantileNumber - 1]; } - $right = min(ceil($quantile + $deflection), $limits[1], $pricesCount - 1); + $right = min(ceil($quantile + $deflection), $limits[1], $this->_count - 1); return array($left, $right); - } + } + + /** + * Merge new round prices with old ones + * + * @param array $oldRoundPrices + * @param array $newRoundPrices + * @return void + */ + protected function _mergeRoundPrices(&$oldRoundPrices, &$newRoundPrices) + { + foreach ($newRoundPrices as $roundingFactor => $roundPriceValues) { + if (array_key_exists($roundingFactor, $oldRoundPrices)) { + $oldRoundPrices[$roundingFactor] = array_unique(array_merge( + $oldRoundPrices[$roundingFactor], + $roundPriceValues + )); + } else { + $oldRoundPrices[$roundingFactor] = $roundPriceValues; + } + } + } /** - * Get standard normal distribution + * Find price separator for the quantile * - * @return float + * @param int $quantileNumber should be from 1 to n-1 where n is number of intervals + * @return array|null */ - protected function _getStandardNormalDistribution() + protected function _findPriceSeparator($quantileNumber) { - return 1.96; + if ($quantileNumber < 1 || $quantileNumber >= $this->getIntervalsNumber()) { + return null; + } + + $prices = array(); + $quantileInterval = $this->_getQuantileInterval($quantileNumber); + $intervalPricesCount = $quantileInterval[1] - $quantileInterval[0] + 1; + $offset = $quantileInterval[0]; + if (!is_null($this->_lastPriceLimiter[0])) { + $offset -= $this->_lastPriceLimiter[0]; + } + if ($offset < 0) { + $intervalPricesCount += $offset; + $prices = array_slice( + $this->_prices, + $this->_lastPriceLimiter[0] + $offset - $this->_quantileInterval[0], + -$offset + ); + $offset = 0; + } + $lowerPrice = $this->_lastPriceLimiter[1]; + if (!is_null($this->_lowerLimit)) { + $lowerPrice = max($lowerPrice, $this->_lowerLimit); + } + if ($intervalPricesCount >= 0) { + $prices = array_merge($prices, $this->_pricesModel->loadPrices( + $intervalPricesCount + 1, + $offset, + $lowerPrice, + $this->_upperLimit + )); + } + $lastPrice = $prices[$intervalPricesCount - 1]; + $bestRoundPrice = array(); + if ($lastPrice == $prices[0]) { + if ($quantileNumber == 1 && $offset) { + $additionalPrices = $this->_pricesModel + ->loadPreviousPrices($lastPrice, $quantileInterval[0], $this->_lowerLimit); + if ($additionalPrices) { + $quantileInterval[0] -= count($additionalPrices); + $prices = array_merge($additionalPrices, $prices); + $bestRoundPrice = $this->_findRoundPrice( + $prices[0] + Mage_Catalog_Model_Resource_Layer_Filter_Price::MIN_POSSIBLE_PRICE / 10, + $lastPrice, + false + ); + } + } + if ($quantileNumber == $this->getIntervalsNumber() - 1) { + $pricesCount = count($prices); + if ($prices[$pricesCount - 1] > $lastPrice) { + $additionalPrices = array($prices[$pricesCount - 1]); + } else { + $additionalPrices = $this->_pricesModel->loadNextPrices( + $lastPrice, + $this->_count - $quantileInterval[0] - count($prices), + $this->_upperLimit + ); + } + if ($additionalPrices) { + $quantileInterval[1] = $quantileInterval[0] + count($prices) - 1; + if ($prices[$pricesCount - 1] <= $lastPrice) { + $quantileInterval[1] += count($additionalPrices); + $prices = array_merge($prices, $additionalPrices); + } + $upperBestRoundPrice = $this->_findRoundPrice( + $lastPrice + Mage_Catalog_Model_Resource_Layer_Filter_Price::MIN_POSSIBLE_PRICE / 10, + $prices[count($prices) - 1], + false + ); + $this->_mergeRoundPrices($bestRoundPrice, $upperBestRoundPrice); + } + } + } else { + $bestRoundPrice = $this->_findRoundPrice( + $prices[0] + Mage_Catalog_Model_Resource_Layer_Filter_Price::MIN_POSSIBLE_PRICE / 10, + $lastPrice + ); + } + + $this->_quantileInterval = $quantileInterval; + $this->_prices = $prices; + + if (empty($bestRoundPrice)) { + $this->_skippedQuantilesUpperLimits[$quantileNumber] = $quantileInterval[1]; + return $bestRoundPrice; + } + + $pricesCount = count($prices); + if ($prices[$pricesCount - 1] > $lastPrice) { + $this->_lastPriceLimiter = array($quantileInterval[0] + $pricesCount - 1, $prices[$pricesCount - 1]); + } + + ksort($bestRoundPrice, SORT_NUMERIC); + foreach ($bestRoundPrice as $index => &$bestRoundPriceValues) { + if (empty($bestRoundPriceValues)) { + unset($bestRoundPrice[$index]); + } else { + sort($bestRoundPriceValues); + } + } + return array_reverse($bestRoundPrice); } /** @@ -210,23 +459,24 @@ protected function _findRoundPrice($lowerPrice, $upperPrice, $returnEmpty = true // round is used for such examples: (1194.32 / 0.02) or (5 / 100000) $lowerDivision = ceil(round($lowerPrice / $roundingFactor, self::TEN_POWER_ROUNDING_FACTOR + 3)); $upperDivision = floor(round($upperPrice / $roundingFactor, self::TEN_POWER_ROUNDING_FACTOR + 3)); - if ($lowerDivision > $upperDivision) { - return false; + + $result = array(); + if ($upperDivision <= 0 || $upperDivision - $lowerDivision > 10) { + return $result; } - $averageDivision = ($lowerDivision + $upperDivision) / 2; - $lowerAverageDivision = floor($averageDivision); - $result = array(round($lowerAverageDivision * $roundingFactor, 2)); - if ($averageDivision != $lowerAverageDivision) { - $upperAverageDivision = ceil($averageDivision); - $result[] = round($upperAverageDivision * $roundingFactor, 2); + + for ($i = $lowerDivision; $i <= $upperDivision; ++$i) { + $result[] = round($i * $roundingFactor, 2); } + return $result; } + $result = array(); $tenPower = pow(10, self::TEN_POWER_ROUNDING_FACTOR); $roundingFactorCoefficients = array(10, 5, 2); - while ($tenPower >= self::MIN_POSSIBLE_PRICE) { - if ($tenPower == self::MIN_POSSIBLE_PRICE) { + while ($tenPower >= Mage_Catalog_Model_Resource_Layer_Filter_Price::MIN_POSSIBLE_PRICE) { + if ($tenPower == Mage_Catalog_Model_Resource_Layer_Filter_Price::MIN_POSSIBLE_PRICE) { $roundingFactorCoefficients[] = 1; } foreach ($roundingFactorCoefficients as $roundingFactorCoefficient) { @@ -235,105 +485,46 @@ protected function _findRoundPrice($lowerPrice, $upperPrice, $returnEmpty = true $lowerPrice, $upperPrice, $returnEmpty, $roundingFactorCoefficient ); if ($roundPrices) { - return array($roundingFactorCoefficient, $roundPrices); + $index = round($roundingFactorCoefficient + / Mage_Catalog_Model_Resource_Layer_Filter_Price::MIN_POSSIBLE_PRICE); + $result[$index] = $roundPrices; } } $tenPower /= 10; } - return array(self::MIN_POSSIBLE_PRICE, array()); + return empty($result) ? array(1 => array()) : $result; } /** - * Find price separator for the quantile + * Get separator nearest to quantile among the separators * - * @param int $quantileNumber should be from 1 to n-1 where n is number of intervals - * @return array|null + * @param int $quantileNumber + * @param array $separators + * @return bool|array [deflection, separatorPrice, $priceIndex] */ - protected function _findPriceSeparator($quantileNumber) + protected function _findBestSeparator($quantileNumber, $separators) { - if ($quantileNumber < 1 || $quantileNumber >= $this->getIntervalsNumber()) { - return null; - } - $quantile = $this->_getQuantile($quantileNumber); - $lowerQuantile = floor($quantile); - $upperQuantile = ceil($quantile); + $result = false; - $quantileInterval = $this->_getQuantileInterval($quantileNumber); - $quantileDeflection = 0; - $maxRoundingFactor = self::MIN_POSSIBLE_PRICE; - $bestRoundPrice = array(); - - if ($this->_prices[$quantileInterval[0]] == $this->_prices[$quantileInterval[1]]) { - if ($quantileNumber == 1) { - $i = $quantileInterval[0]; - while ($i >= 0 && ($this->_prices[$i] == $this->_prices[$quantileInterval[1]])) { - --$i; - } - if ($i >= 0) { - list($roundingFactor, $bestRoundPrice) = $this->_findRoundPrice( - $this->_prices[$i] + self::MIN_POSSIBLE_PRICE / 10, - $this->_prices[$quantileInterval[1]], - false - ); - } - } - if ($quantileNumber == $this->getIntervalsNumber() - 1) { - $pricesCount = count($this->_prices); - $i = $quantileInterval[1]; - while ($i < $pricesCount && ($this->_prices[$quantileInterval[0]] == $this->_prices[$i])) { - ++$i; - } - if ($i < $pricesCount) { - list($upperRoundingFactor, $upperBestRoundPrice) = $this->_findRoundPrice( - $this->_prices[$quantileInterval[0]] + self::MIN_POSSIBLE_PRICE / 10, - $this->_prices[$i], - false - ); - if (!empty($bestRoundPrice)) { - if ($upperRoundingFactor >= $roundingFactor) { - if ($upperRoundingFactor > $roundingFactor) { - $bestRoundPrice = $upperBestRoundPrice; - } else { - $bestRoundPrice = array_merge($bestRoundPrice, $upperBestRoundPrice); - } - } - } else { - $bestRoundPrice = $upperBestRoundPrice; - } - } + $i = 0; + $pricesCount = count($this->_prices); + while ($i < $pricesCount && !empty($separators)) { + $i = $this->_binarySearch($separators[0], array($i)); + if ($i == -1) { + break; } - } else { - while ($lowerQuantile - $quantileDeflection >= $quantileInterval[0] - || $upperQuantile + $quantileDeflection <= $quantileInterval[1] - ) { - $leftIndex = max($quantileInterval[0], $lowerQuantile - $quantileDeflection); - $rightIndex = min($quantileInterval[1], $upperQuantile + $quantileDeflection); - - list($roundingFactor, $roundPrice) = $this->_findRoundPrice( - $this->_prices[$leftIndex] + self::MIN_POSSIBLE_PRICE / 10, - $this->_prices[$rightIndex] - ); - if ($roundingFactor >= $maxRoundingFactor) { - if ($roundingFactor == $maxRoundingFactor) { - $bestRoundPrice = array_unique(array_merge($bestRoundPrice, $roundPrice)); - } else { - $bestRoundPrice = $roundPrice; - $maxRoundingFactor = $roundingFactor; - } - } - ++$quantileDeflection; - } - } + $separator = array_shift($separators); - if (empty($bestRoundPrice)) { - $this->_skippedQuantilesUpperLimits[$quantileNumber] = $quantileInterval[1]; - return $bestRoundPrice; + $deflection = abs($quantileNumber * $this->_count + - ($this->_quantileInterval[0] + $i) * $this->_getCalculatedIntervalsNumber()); + if (!$result || $deflection < $result[0]) { + $result = array($deflection, $separator, $i); + } } - sort($bestRoundPrice); - return $bestRoundPrice; + return $result ? $result : false; } /** @@ -343,77 +534,76 @@ protected function _findPriceSeparator($quantileNumber) */ public function calculateSeparators() { - $separators = array(); - for ($i = 1; $i < $this->getIntervalsNumber(); ++$i) { - $separators[] = $this->_findPriceSeparator($i); - } - $pricesCount = count($this->_prices); - - $i = 0; $result = array(); - $lastSeparator = 0; - $quantile = 0; - while (!empty($separators) && ($i < $pricesCount)) { - while (!empty($separators) && empty($separators[0])) { - array_shift($separators); + $lastCount = 0; + $intervalFirstPrice = $this->_minPrice; + $lastSeparator = is_null($this->_lowerLimit) ? 0 : $this->_lowerLimit; + + for ($i = 1; $i < $this->getIntervalsNumber(); ++$i) { + $separator = $this->_findPriceSeparator($i); + if (empty($separator)) { + continue; } - if (empty($separators)) { - break; + if ($this->_quantileInterval[0] == 0) { + $intervalFirstPrice = $this->_prices[0]; } - if ($this->_prices[$i] < $separators[0][0]) { - ++$i; - } else { - $separator = array_shift($separators[0]); - $separatorData = array( - 'from' => $lastSeparator, - 'to' => $separator, - 'count' => $i, - ); - - $deflection = abs(($quantile + 1) / $this->getIntervalsNumber() - $i / $pricesCount); - if (!array_key_exists($quantile, $result)) { - $result[$quantile] = array($deflection, $separatorData); - } elseif ($deflection < $result[$quantile][0]) { - $result[$quantile] = array($deflection, $separatorData); - } - - if (empty($separators[0])) { - array_shift($separators); - if (!array_key_exists($quantile - 1, $result) - || $result[$quantile - 1][1]['count'] < $result[$quantile][1]['count'] - ) { - $lastSeparator = $result[$quantile][1]['to']; + $separatorCandidate = false; + $newIntervalFirstPrice = $intervalFirstPrice; + $newLastSeparator = $lastSeparator; + + $pricesPerInterval = $this->_count / $this->_getCalculatedIntervalsNumber(); + while (!empty($separator) && !array_key_exists($i, $result)) { + $separatorsPortion = array_shift($separator); + $bestSeparator = $this->_findBestSeparator($i, $separatorsPortion); + if ($bestSeparator && $bestSeparator[2] > 0) { + $isEqualPrice = ($intervalFirstPrice == $this->_prices[$bestSeparator[2] - 1]) + ? $this->_prices[0] + : false; + $count = $bestSeparator[2] + $this->_quantileInterval[0] - $lastCount; + $separatorData = array( + 'from' => ($isEqualPrice !== false) ? $isEqualPrice : $lastSeparator, + 'to' => ($isEqualPrice !== false) ? $isEqualPrice : $bestSeparator[1], + 'count' => $count, + ); + if (abs(1 - $count / $pricesPerInterval) <= self::INTERVAL_DEFLECTION_LIMIT) { + $newLastSeparator = $bestSeparator[1]; + $newIntervalFirstPrice = $this->_prices[$bestSeparator[2]]; + $result[$i] = $separatorData; + } elseif (!$separatorCandidate || $bestSeparator[0] < $separatorCandidate[0]) { + $separatorCandidate = array( + $bestSeparator[0], + $separatorData, + $bestSeparator[1], + $this->_prices[$bestSeparator[2]] + ); } - ++$quantile; } } - } - if ($i < $pricesCount || empty($result)) { - $result[$quantile] = array(0, array( - 'from' => $lastSeparator, - 'to' => '', - 'count' => $pricesCount, - )); - } - for ($i = count($result) - 1; $i >= 0; --$i) { - $rangeCount = ($i == 0) ? $result[$i][1]['count'] : ($result[$i][1]['count'] - $result[$i-1][1]['count']); - if ($rangeCount > 0) { - $result[$i] = $result[$i][1]; - $firstPriceInRange = $this->_prices[$result[$i]['count'] - $rangeCount]; - if ($this->_prices[$result[$i]['count'] - 1] == $firstPriceInRange) { - $result[$i]['from'] = $firstPriceInRange; - $result[$i]['to'] = $firstPriceInRange; - } - $result[$i]['from'] = round($result[$i]['from'], 2); - if (!empty($result[$i]['to'])) { - $result[$i]['to'] = round($result[$i]['to'], 2); + if (!array_key_exists($i, $result) && $separatorCandidate) { + $newLastSeparator = $separatorCandidate[2]; + $newIntervalFirstPrice = $separatorCandidate[3]; + $result[$i] = $separatorCandidate[1]; + } + + if (array_key_exists($i, $result)) { + $lastSeparator = $newLastSeparator; + $intervalFirstPrice = $newIntervalFirstPrice; + $priceIndex = $this->_binarySearch($lastSeparator); + $lastCount += $result[$i]['count']; + if ($priceIndex != -1 && $lastSeparator > $this->_lastPriceLimiter[1]) { + $this->_lastPriceLimiter = array($priceIndex + $this->_quantileInterval[0], $lastSeparator); } - $result[$i]['count'] = $rangeCount; - } else { - unset($result[$i]); } } + if ($this->_lastPriceLimiter[0] < $this->_count) { + $isEqualPrice = ($intervalFirstPrice == $this->_maxPrice) ? $intervalFirstPrice : false; + $result[$this->getIntervalsNumber()] = array( + 'from' => $isEqualPrice ? $isEqualPrice : $lastSeparator, + 'to' => $isEqualPrice ? $isEqualPrice : (is_null($this->_upperLimit) ? '' : $this->_upperLimit), + 'count' => $this->_count - $lastCount, + ); + } return array_values($result); } diff --git a/app/code/core/Mage/Catalog/Model/Layer/State.php b/app/code/core/Mage/Catalog/Model/Layer/State.php index 7b592fb3f5..a435745607 100644 --- a/app/code/core/Mage/Catalog/Model/Layer/State.php +++ b/app/code/core/Mage/Catalog/Model/Layer/State.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Observer.php b/app/code/core/Mage/Catalog/Model/Observer.php index 5551a354a9..6b6452bfb0 100644 --- a/app/code/core/Mage/Catalog/Model/Observer.php +++ b/app/code/core/Mage/Catalog/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -244,4 +244,71 @@ public function reindexProductPrices(Mage_Cron_Model_Schedule $schedule) $indexProcess->reindexAll(); } } + + /** + * Adds catalog categories to top menu + * + * @param Varien_Event_Observer $observer + */ + public function addCatalogToTopmenuItems(Varien_Event_Observer $observer) + { + $this->_addCategoriesToMenu(Mage::helper('catalog/category')->getStoreCategories(), $observer->getMenu()); + } + + /** + * Recursively adds categories to top menu + * + * @param Varien_Data_Tree_Node_Collection|array $categories + * @param Varien_Data_Tree_Node $parentCategoryNode + */ + protected function _addCategoriesToMenu($categories, $parentCategoryNode) + { + foreach ($categories as $category) { + if (!$category->getIsActive()) { + continue; + } + + $nodeId = 'category-node-' . $category->getId(); + + $tree = $parentCategoryNode->getTree(); + $categoryData = array( + 'name' => $category->getName(), + 'id' => $nodeId, + 'url' => Mage::helper('catalog/category')->getCategoryUrl($category), + 'is_active' => $this->_isActiveMenuCategory($category) + ); + $categoryNode = new Varien_Data_Tree_Node($categoryData, 'id', $tree, $parentCategoryNode); + $parentCategoryNode->addChild($categoryNode); + + if (Mage::helper('catalog/category_flat')->isEnabled()) { + $subcategories = (array)$category->getChildrenNodes(); + } else { + $subcategories = $category->getChildren(); + } + + $this->_addCategoriesToMenu($subcategories, $categoryNode); + } + } + + /** + * Checks whether category belongs to active category's path + * + * @param Varien_Data_Tree_Node $category + * @return bool + */ + protected function _isActiveMenuCategory($category) + { + $catalogLayer = Mage::getSingleton('catalog/layer'); + if (!$catalogLayer) { + return false; + } + + $currentCategory = $catalogLayer->getCurrentCategory(); + if (!$currentCategory) { + return false; + } + + $categoryPathIds = explode(',', $currentCategory->getPathInStore()); + return in_array($category->getId(), $categoryPathIds); + } } diff --git a/app/code/core/Mage/Catalog/Model/Product.php b/app/code/core/Mage/Catalog/Model/Product.php index e0620dfb69..418c502fad 100644 --- a/app/code/core/Mage/Catalog/Model/Product.php +++ b/app/code/core/Mage/Catalog/Model/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -530,7 +530,7 @@ public function canAffectOptions($value = null) } /** - * Saving product type related data + * Saving product type related data and init index * * @return Mage_Catalog_Model_Product */ @@ -544,21 +544,13 @@ protected function _afterSave() */ $this->getOptionInstance()->setProduct($this) ->saveOptions(); - return parent::_afterSave(); - } - /** - * Init indexing process after product data commit - * - * @return Mage_Catalog_Model_Product - */ - public function afterCommitCallback() - { - parent::afterCommitCallback(); + $result = parent::_afterSave(); + Mage::getSingleton('index/indexer')->processEntityAction( $this, self::ENTITY, Mage_Index_Model_Event::TYPE_SAVE ); - return $this; + return $result; } /** @@ -1075,6 +1067,7 @@ public function duplicate() $this->getWebsiteIds(); $this->getCategoryIds(); + /* @var $newProduct Mage_Catalog_Model_Product */ $newProduct = Mage::getModel('catalog/product')->setData($this->getData()) ->setIsDuplicate(true) ->setOriginalId($this->getId()) @@ -1090,16 +1083,6 @@ public function duplicate() array('current_product' => $this, 'new_product' => $newProduct) ); - /* @var $newProduct Mage_Catalog_Model_Product */ - - $newOptionsArray = array(); - $newProduct->setCanSaveCustomOptions(true); - foreach ($this->getOptions() as $_option) { - /* @var $_option Mage_Catalog_Model_Product_Option */ - $newOptionsArray[] = $_option->prepareOptionForDuplicate(); - } - $newProduct->setProductOptions($newOptionsArray); - /* Prepare Related*/ $data = array(); $this->getLinkInstance()->useRelatedLinks(); @@ -1330,7 +1313,8 @@ public function isSalable() */ public function isAvailable() { - return $this->getTypeInstance(true)->isSalable($this); + return $this->getTypeInstance(true)->isSalable($this) + || Mage::helper('catalog/product')->getSkipSaleableCheck(); } /** @@ -1896,6 +1880,7 @@ public function setOrigData($key=null, $data=null) */ public function reset() { + $this->unlockAttributes(); $this->_clearData(); return $this; } @@ -2062,4 +2047,14 @@ public function getProductEntitiesInfo($columns = null) { return $this->_getResource()->getProductEntitiesInfo($columns); } + + /** + * Checks whether product has disabled status + * + * @return bool + */ + public function isDisabled() + { + return $this->getStatus() == Mage_Catalog_Model_Product_Status::STATUS_DISABLED; + } } diff --git a/app/code/core/Mage/Catalog/Model/Product/Action.php b/app/code/core/Mage/Catalog/Model/Product/Action.php index 15a2d6fe84..59994c5d6e 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Action.php +++ b/app/code/core/Mage/Catalog/Model/Product/Action.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Api.php b/app/code/core/Mage/Catalog/Model/Product/Api.php index b23698f02f..d2a79af58e 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Api.php +++ b/app/code/core/Mage/Catalog/Model/Product/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -182,6 +182,11 @@ public function create($type, $set, $sku, $productData, $store = null) ->setTypeId($type) ->setSku($sku); + if (!isset($productData['stock_data']) || !is_array($productData['stock_data'])) { + //Set default stock_data if not exist in product data + $product->setStockData(array('use_config_manage_stock' => 0)); + } + $this->_prepareDataForSave($product, $productData); try { @@ -262,6 +267,14 @@ protected function _prepareDataForSave($product, $productData) } foreach ($product->getTypeInstance(true)->getEditableAttributes($product) as $attribute) { + //Unset data if object attribute has no value in current store + if (Mage_Catalog_Model_Abstract::DEFAULT_STORE_ID !== $product->getStoreId() + && !$product->getExistsStoreValueFlag($attribute->getAttributeCode()) + && !$attribute->isScopeGlobal() + ) { + $product->setData($attribute->getAttributeCode(), false); + } + if ($this->_isAllowedAttribute($attribute)) { if (isset($productData[$attribute->getAttributeCode()])) { $product->setData( @@ -303,8 +316,6 @@ protected function _prepareDataForSave($product, $productData) if (isset($productData['stock_data']) && is_array($productData['stock_data'])) { $product->setStockData($productData['stock_data']); - } else { - $product->setStockData(array('use_config_manage_stock' => 0)); } if (isset($productData['tier_price']) && is_array($productData['tier_price'])) { diff --git a/app/code/core/Mage/Catalog/Model/Product/Api/V2.php b/app/code/core/Mage/Catalog/Model/Product/Api/V2.php index 3395546044..22d507a401 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Api/V2.php +++ b/app/code/core/Mage/Catalog/Model/Product/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -176,6 +176,12 @@ public function create($type, $set, $sku, $productData, $store = null) ->setTypeId($type) ->setSku($sku); + if (!property_exists($productData, 'stock_data')) { + //Set default stock_data if not exist in product data + $_stockData = array('use_config_manage_stock' => 0); + $product->setStockData($_stockData); + } + $this->_prepareDataForSave($product, $productData); try { @@ -273,9 +279,18 @@ protected function _prepareDataForSave ($product, $productData) foreach ($product->getTypeInstance(true)->getEditableAttributes($product) as $attribute) { $_attrCode = $attribute->getAttributeCode(); + + //Unset data if object attribute has no value in current store + if (Mage_Catalog_Model_Abstract::DEFAULT_STORE_ID !== (int) $product->getStoreId() + && !$product->getExistsStoreValueFlag($_attrCode) + && !$attribute->isScopeGlobal() + ) { + $product->setData($_attrCode, false); + } + if ($this->_isAllowedAttribute($attribute) && (isset($productData->$_attrCode))) { $product->setData( - $attribute->getAttributeCode(), + $_attrCode, $productData->$_attrCode ); } @@ -305,10 +320,8 @@ protected function _prepareDataForSave ($product, $productData) foreach ($productData->stock_data as $key => $value) { $_stockData[$key] = $value; } - } else { - $_stockData = array('use_config_manage_stock' => 0); + $product->setStockData($_stockData); } - $product->setStockData($_stockData); if (property_exists($productData, 'tier_price')) { $tierPrices = Mage::getModel('catalog/product_attribute_tierprice_api_V2') diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Api.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Api.php index 0357dc3d3f..9e37188ba0 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Api.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Api/V2.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Api/V2.php index 6a0dbba1c9..9e035509ac 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Api/V2.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Boolean.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Boolean.php index 97657baac2..dbd87d3ef9 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Boolean.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Boolean.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Groupprice.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Groupprice.php index 437bf449a6..186e796fc5 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Groupprice.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Groupprice.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Groupprice/Abstract.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Groupprice/Abstract.php index b6ce55439b..22a4c4163c 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Groupprice/Abstract.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Groupprice/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Media.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Media.php index 39dbbaa77c..77d98ab571 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Media.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Media.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -163,6 +163,8 @@ public function beforeSave($object) } } + Mage::dispatchEvent('catalog_product_media_save_before', array('product' => $object, 'images' => $value)); + $object->setData($attrCode, $value); return $this; @@ -267,6 +269,9 @@ public function addImage(Mage_Catalog_Model_Product $product, $file, if (!$file || !file_exists($file)) { Mage::throwException(Mage::helper('catalog')->__('Image does not exist.')); } + + Mage::dispatchEvent('catalog_product_media_add_image', array('product' => $product, 'image' => $file)); + $pathinfo = pathinfo($file); $imgExtensions = array('jpg','jpeg','gif','png'); if (!isset($pathinfo['extension']) || !in_array(strtolower($pathinfo['extension']), $imgExtensions)) { diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Msrp.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Msrp.php index be41e50298..dfaba2a802 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Msrp.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Msrp.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Price.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Price.php index 04dd6f788d..d6b07bef20 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Price.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Recurring.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Recurring.php index d93615a549..eb4fd4a8d6 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Recurring.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Recurring.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Sku.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Sku.php index 528115947f..5c9ce52be6 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Sku.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Sku.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Startdate.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Startdate.php index 95994762aa..a3634a2ee9 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Startdate.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Startdate.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Tierprice.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Tierprice.php index aa0b2b0e4a..2acdd9e221 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Tierprice.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Tierprice.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Urlkey.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Urlkey.php index 49cb401183..06f5802631 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Urlkey.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Urlkey.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Frontend/Image.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Frontend/Image.php index 0f8c27669b..1ed56c1b42 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Frontend/Image.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Frontend/Image.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Group.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Group.php index cf2dd5ef39..7d3832f30f 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Group.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Group.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Media/Api.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Media/Api.php index 01311b3922..e1ab5900d2 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Media/Api.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Media/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Media/Api/V2.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Media/Api/V2.php index e0f2ba5e8c..c150248937 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Media/Api/V2.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Media/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Set/Api.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Set/Api.php index c37e659a39..df1d3cd797 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Set/Api.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Set/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Set/Api/V2.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Set/Api/V2.php index 517251b6e5..34b7fce655 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Set/Api/V2.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Set/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Boolean.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Boolean.php index 5a9219df6a..23ecb00cf6 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Boolean.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Boolean.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Countryofmanufacture.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Countryofmanufacture.php index 2efb512a13..019bdd1fce 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Countryofmanufacture.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Countryofmanufacture.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Inputtype.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Inputtype.php index ca058436ac..b77636c384 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Inputtype.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Inputtype.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Layout.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Layout.php index 1601ffa457..ed16d7df31 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Layout.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Layout.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Msrp/Type.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Msrp/Type.php index 254432c98c..b3b71868cf 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Msrp/Type.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Msrp/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Msrp/Type/Enabled.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Msrp/Type/Enabled.php index 30dcf7e6b0..8dbec5e29e 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Msrp/Type/Enabled.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Msrp/Type/Enabled.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Msrp/Type/Price.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Msrp/Type/Price.php index a881904aea..f617515557 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Msrp/Type/Price.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Msrp/Type/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Tierprice/Api.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Tierprice/Api.php index ac35e7d4ca..79408964cc 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Tierprice/Api.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Tierprice/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Tierprice/Api/V2.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Tierprice/Api/V2.php index f44d53ca33..148f4e6f07 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Tierprice/Api/V2.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Tierprice/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Compare/Item.php b/app/code/core/Mage/Catalog/Model/Product/Compare/Item.php index f309dae8bf..e0a75647f7 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Compare/Item.php +++ b/app/code/core/Mage/Catalog/Model/Product/Compare/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Compare/List.php b/app/code/core/Mage/Catalog/Model/Product/Compare/List.php index ca44cc9ee6..8b5946de63 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Compare/List.php +++ b/app/code/core/Mage/Catalog/Model/Product/Compare/List.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Condition.php b/app/code/core/Mage/Catalog/Model/Product/Condition.php index e814f71221..463d4b0a33 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Condition.php +++ b/app/code/core/Mage/Catalog/Model/Product/Condition.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Condition/Interface.php b/app/code/core/Mage/Catalog/Model/Product/Condition/Interface.php index df5a4ef6d0..f6d6104615 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Condition/Interface.php +++ b/app/code/core/Mage/Catalog/Model/Product/Condition/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Configuration/Item/Interface.php b/app/code/core/Mage/Catalog/Model/Product/Configuration/Item/Interface.php index 0b4aebfaa4..9aa55caeb3 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Configuration/Item/Interface.php +++ b/app/code/core/Mage/Catalog/Model/Product/Configuration/Item/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Configuration/Item/Option.php b/app/code/core/Mage/Catalog/Model/Product/Configuration/Item/Option.php index acb9492bde..65d83bc7a7 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Configuration/Item/Option.php +++ b/app/code/core/Mage/Catalog/Model/Product/Configuration/Item/Option.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Configuration/Item/Option/Interface.php b/app/code/core/Mage/Catalog/Model/Product/Configuration/Item/Option/Interface.php index 146cf4e9b3..8e542c2d7c 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Configuration/Item/Option/Interface.php +++ b/app/code/core/Mage/Catalog/Model/Product/Configuration/Item/Option/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Flat/Flag.php b/app/code/core/Mage/Catalog/Model/Product/Flat/Flag.php index 9eaf1058f4..d12d4a45fa 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Flat/Flag.php +++ b/app/code/core/Mage/Catalog/Model/Product/Flat/Flag.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Flat/Indexer.php b/app/code/core/Mage/Catalog/Model/Product/Flat/Indexer.php index 2221908129..f79a7c269f 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Flat/Indexer.php +++ b/app/code/core/Mage/Catalog/Model/Product/Flat/Indexer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Flat/Observer.php b/app/code/core/Mage/Catalog/Model/Product/Flat/Observer.php index 090924e6c6..3c3975c96c 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Flat/Observer.php +++ b/app/code/core/Mage/Catalog/Model/Product/Flat/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Image.php b/app/code/core/Mage/Catalog/Model/Product/Image.php index e2cdd81069..1708e22e5b 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Image.php +++ b/app/code/core/Mage/Catalog/Model/Product/Image.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Indexer/Eav.php b/app/code/core/Mage/Catalog/Model/Product/Indexer/Eav.php index db04c126ed..0b145c07c4 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Indexer/Eav.php +++ b/app/code/core/Mage/Catalog/Model/Product/Indexer/Eav.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Indexer/Flat.php b/app/code/core/Mage/Catalog/Model/Product/Indexer/Flat.php index 6d0665a4db..31b8da1a4e 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Indexer/Flat.php +++ b/app/code/core/Mage/Catalog/Model/Product/Indexer/Flat.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Catalog_Model_Product_Indexer_Flat extends Mage_Index_Model_Indexer_Abstract diff --git a/app/code/core/Mage/Catalog/Model/Product/Indexer/Price.php b/app/code/core/Mage/Catalog/Model/Product/Indexer/Price.php index 95f726c236..104b7fcb94 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Indexer/Price.php +++ b/app/code/core/Mage/Catalog/Model/Product/Indexer/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** diff --git a/app/code/core/Mage/Catalog/Model/Product/Link.php b/app/code/core/Mage/Catalog/Model/Product/Link.php index 3c7bfea250..9eed0437e8 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Link.php +++ b/app/code/core/Mage/Catalog/Model/Product/Link.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Link/Api.php b/app/code/core/Mage/Catalog/Model/Product/Link/Api.php index d49fc4e25d..0bf6aa588a 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Link/Api.php +++ b/app/code/core/Mage/Catalog/Model/Product/Link/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Link/Api/V2.php b/app/code/core/Mage/Catalog/Model/Product/Link/Api/V2.php index 1f0aa83ae7..7dfc6eaf33 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Link/Api/V2.php +++ b/app/code/core/Mage/Catalog/Model/Product/Link/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Media/Config.php b/app/code/core/Mage/Catalog/Model/Product/Media/Config.php index 0f1f7e43dd..76022f467b 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Media/Config.php +++ b/app/code/core/Mage/Catalog/Model/Product/Media/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Option.php b/app/code/core/Mage/Catalog/Model/Product/Option.php index c7b011cec3..842f76d6a1 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Option.php +++ b/app/code/core/Mage/Catalog/Model/Product/Option.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -266,7 +266,11 @@ public function saveOptions() } else { if ($this->getData('previous_type') != '') { $previousType = $this->getData('previous_type'); - //if previous option has dfferent group from one is came now need to remove all data of previous group + + /** + * if previous option has different group from one is came now + * need to remove all data of previous group + */ if ($this->getGroupByType($previousType) != $this->getGroupByType($this->getData('type'))) { switch ($this->getGroupByType($previousType)) { @@ -364,7 +368,7 @@ public function deleteTitles($option_id) * get Product Option Collection * * @param Mage_Catalog_Model_Product $product - * @return Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Option_Collection + * @return Mage_Catalog_Model_Resource_Product_Option_Collection */ public function getProductOptionCollection(Mage_Catalog_Model_Product $product) { @@ -373,9 +377,13 @@ public function getProductOptionCollection(Mage_Catalog_Model_Product $product) ->addTitleToResult($product->getStoreId()) ->addPriceToResult($product->getStoreId()) ->setOrder('sort_order', 'asc') - ->setOrder('title', 'asc') - ->addValuesToResult($product->getStoreId()); + ->setOrder('title', 'asc'); + + if ($this->getAddRequiredFilter()) { + $collection->addRequiredFilter($this->getAddRequiredFilterValue()); + } + $collection->addValuesToResult($product->getStoreId()); return $collection; } diff --git a/app/code/core/Mage/Catalog/Model/Product/Option/Api.php b/app/code/core/Mage/Catalog/Model/Product/Option/Api.php index 6718827bed..11a781301b 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Option/Api.php +++ b/app/code/core/Mage/Catalog/Model/Product/Option/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Option/Api/V2.php b/app/code/core/Mage/Catalog/Model/Product/Option/Api/V2.php index d0e1c323ea..31da13eb95 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Option/Api/V2.php +++ b/app/code/core/Mage/Catalog/Model/Product/Option/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Option/Observer.php b/app/code/core/Mage/Catalog/Model/Product/Option/Observer.php index 64885d4e37..1bd2a3b6a3 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Option/Observer.php +++ b/app/code/core/Mage/Catalog/Model/Product/Option/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Option/Type/Date.php b/app/code/core/Mage/Catalog/Model/Product/Option/Type/Date.php index bdd2b8523a..98cbce335b 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Option/Type/Date.php +++ b/app/code/core/Mage/Catalog/Model/Product/Option/Type/Date.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Option/Type/Default.php b/app/code/core/Mage/Catalog/Model/Product/Option/Type/Default.php index 9d3f83e22c..602fc68905 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Option/Type/Default.php +++ b/app/code/core/Mage/Catalog/Model/Product/Option/Type/Default.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Option/Type/File.php b/app/code/core/Mage/Catalog/Model/Product/Option/Type/File.php index 2ce93af2ac..5e9bdea59b 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Option/Type/File.php +++ b/app/code/core/Mage/Catalog/Model/Product/Option/Type/File.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Option/Type/Select.php b/app/code/core/Mage/Catalog/Model/Product/Option/Type/Select.php index f620bb624f..927293c20a 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Option/Type/Select.php +++ b/app/code/core/Mage/Catalog/Model/Product/Option/Type/Select.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Option/Type/Text.php b/app/code/core/Mage/Catalog/Model/Product/Option/Type/Text.php index 60a98d530f..ab048547a2 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Option/Type/Text.php +++ b/app/code/core/Mage/Catalog/Model/Product/Option/Type/Text.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Option/Value.php b/app/code/core/Mage/Catalog/Model/Product/Option/Value.php index 71afa4afef..b78e8c5503 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Option/Value.php +++ b/app/code/core/Mage/Catalog/Model/Product/Option/Value.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Option/Value/Api.php b/app/code/core/Mage/Catalog/Model/Product/Option/Value/Api.php index 669fa8aa2e..f7fb75cd5e 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Option/Value/Api.php +++ b/app/code/core/Mage/Catalog/Model/Product/Option/Value/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Option/Value/Api/V2.php b/app/code/core/Mage/Catalog/Model/Product/Option/Value/Api/V2.php index 3d0c0d4f43..e01b51caa7 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Option/Value/Api/V2.php +++ b/app/code/core/Mage/Catalog/Model/Product/Option/Value/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Status.php b/app/code/core/Mage/Catalog/Model/Product/Status.php index e96e0cd18a..04fac9bdbe 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Status.php +++ b/app/code/core/Mage/Catalog/Model/Product/Status.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Type.php b/app/code/core/Mage/Catalog/Model/Product/Type.php index ea32bae4c0..4374e8ad10 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Type.php +++ b/app/code/core/Mage/Catalog/Model/Product/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Type/Abstract.php b/app/code/core/Mage/Catalog/Model/Product/Type/Abstract.php index 25839fba41..5c9c4b06c4 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Type/Abstract.php +++ b/app/code/core/Mage/Catalog/Model/Product/Type/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -863,6 +863,16 @@ public function getForceChildItemQtyChanges($product = null) return false; } + /** + * Force apply discount for parent item + * + * @return bool + */ + public function getForceApplyDiscountToParentItem() + { + return false; + } + /** * Prepare Quote Item Quantity * diff --git a/app/code/core/Mage/Catalog/Model/Product/Type/Api.php b/app/code/core/Mage/Catalog/Model/Product/Type/Api.php index 7b15e4be37..1fadfd95e7 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Type/Api.php +++ b/app/code/core/Mage/Catalog/Model/Product/Type/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Type/Api/V2.php b/app/code/core/Mage/Catalog/Model/Product/Type/Api/V2.php index 95f2e73360..28d7ac63e0 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Type/Api/V2.php +++ b/app/code/core/Mage/Catalog/Model/Product/Type/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Type/Configurable.php b/app/code/core/Mage/Catalog/Model/Product/Type/Configurable.php index c45a79cb9a..7d3d659cba 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Type/Configurable.php +++ b/app/code/core/Mage/Catalog/Model/Product/Type/Configurable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -31,7 +31,7 @@ * * @category Mage * @package Mage_Catalog - * @author Magento Core Team + * @author Magento Core Team */ class Mage_Catalog_Model_Product_Type_Configurable extends Mage_Catalog_Model_Product_Type_Abstract { @@ -124,7 +124,7 @@ public function getChildrenIds($parentId, $required = true) } /** - * Retrieve parent ids array by requered child + * Retrieve parent ids array by required child * * @param int|array $childId * @return array @@ -173,7 +173,7 @@ public function canUseAttribute(Mage_Eav_Model_Entity_Attribute $attribute) } /** - * Declare attribute identifiers used for asign subproducts + * Declare attribute identifiers used for assign subproducts * * @param array $ids * @param Mage_Catalog_Model_Product $product @@ -239,7 +239,7 @@ public function getUsedProductAttributes($product = null) } /** - * Retrieve configurable attrbutes data + * Retrieve configurable attributes data * * @param Mage_Catalog_Model_Product $product * @return array @@ -283,7 +283,7 @@ public function getConfigurableAttributesAsArray($product = null) } /** - * Retrieve configurable atrribute collection + * Retrieve configurable attribute collection * * @param Mage_Catalog_Model_Product $product * @return Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Type_Configurable_Attribute_Collection @@ -389,18 +389,20 @@ public function beforeSave($product = null) if ($this->getProduct($product)->getCanSaveConfigurableAttributes()) { $this->getProduct($product)->canAffectOptions(true); - if ($data = $this->getProduct($product)->getConfigurableAttributesData()) { - if (!empty($data)) { - foreach ($data as $attribute) { - if (!empty($attribute['values'])) { - $this->getProduct($product)->setTypeHasOptions(true); - $this->getProduct($product)->setTypeHasRequiredOptions(true); - break; - } + $data = $this->getProduct($product)->getConfigurableAttributesData(); + if (!empty($data)) { + foreach ($data as $attribute) { + if (!empty($attribute['values'])) { + $this->getProduct($product)->setTypeHasOptions(true); + $this->getProduct($product)->setTypeHasRequiredOptions(true); + break; } } } } + foreach ($this->getConfigurableAttributes($product) as $attribute) { + $this->getProduct($product)->setData($attribute->getProductAttribute()->getAttributeCode(), null); + } return $this; } @@ -444,6 +446,7 @@ public function save($product = null) /** * Check is product available for sale * + * @param Mage_Catalog_Model_Product $product * @return bool */ public function isSalable($product = null) @@ -470,6 +473,7 @@ public function isSalable($product = null) * Check whether the product is available for sale * is alias to isSalable for compatibility * + * @param Mage_Catalog_Model_Product $product * @return bool */ public function getIsSalable($product = null) @@ -483,14 +487,14 @@ public function getIsSalable($product = null) * $attributeId => $attributeValue * ) * - * @param array $attrbutesInfo + * @param array $attributesInfo * @param Mage_Catalog_Model_Product $product * @return Mage_Catalog_Model_Product|null */ public function getProductByAttributes($attributesInfo, $product = null) { if (is_array($attributesInfo) && !empty($attributesInfo)) { - $productCollection = $this->getUsedProductCollection($product); + $productCollection = $this->getUsedProductCollection($product)->addAttributeToSelect('name'); foreach ($attributesInfo as $attributeId => $attributeValue) { $productCollection->addAttributeToFilter($attributeId, $attributeValue); } @@ -585,6 +589,7 @@ protected function _prepareProduct(Varien_Object $buyRequest, $product, $process $subProduct = true; if ($this->_isStrictProcessMode($processMode)) { foreach($this->getConfigurableAttributes($product) as $attributeItem){ + /* @var $attributeItem Varien_Object */ $attrId = $attributeItem->getData('attribute_id'); if(!isset($attributes[$attrId]) || empty($attributes[$attrId])) { $subProduct = null; @@ -709,6 +714,7 @@ public function getOrderOptions($product = null) /** * Check is virtual product * + * @param Mage_Catalog_Model_Product $product * @return bool */ public function isVirtual($product = null) @@ -810,7 +816,6 @@ public function getProductsToPurchaseByReqGroups($product = null) */ public function getSku($product = null) { - $sku = $this->getProduct($product)->getData('sku'); $simpleOption = $this->getProduct($product)->getCustomOption('simple_product'); if($simpleOption) { $optionProduct = $simpleOption->getProduct($product); diff --git a/app/code/core/Mage/Catalog/Model/Product/Type/Configurable/Attribute.php b/app/code/core/Mage/Catalog/Model/Product/Type/Configurable/Attribute.php index ce67f1a1af..78408e9684 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Type/Configurable/Attribute.php +++ b/app/code/core/Mage/Catalog/Model/Product/Type/Configurable/Attribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Type/Configurable/Price.php b/app/code/core/Mage/Catalog/Model/Product/Type/Configurable/Price.php index e9adb8ee82..f2cfa5ce0e 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Type/Configurable/Price.php +++ b/app/code/core/Mage/Catalog/Model/Product/Type/Configurable/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -46,18 +46,42 @@ public function getFinalPrice($qty=null, $product) return $product->getCalculatedFinalPrice(); } - $finalPrice = parent::getFinalPrice($qty, $product); + $basePrice = $this->getBasePrice($product, $qty); + $finalPrice = $basePrice; + $product->setFinalPrice($finalPrice); + Mage::dispatchEvent('catalog_product_get_final_price', array('product' => $product, 'qty' => $qty)); + $finalPrice = $product->getData('final_price'); + + $finalPrice += $this->getTotalConfigurableItemsPrice($product, $qty); + $finalPrice += $this->_applyOptionsPrice($product, $qty, $basePrice) - $basePrice; + $finalPrice = max(0, $finalPrice); + + $product->setFinalPrice($finalPrice); + return $finalPrice; + } + + /** + * Get Total price for configurable items + * + * @param Mage_Catalog_Model_Product $product + * @param null|float $qty + * @return float + */ + public function getTotalConfigurableItemsPrice($product, $qty = null) + { + $price = 0.0; + $product->getTypeInstance(true) - ->setStoreFilter($product->getStore(), $product); + ->setStoreFilter($product->getStore(), $product); $attributes = $product->getTypeInstance(true) - ->getConfigurableAttributes($product); + ->getConfigurableAttributes($product); $selectedAttributes = array(); if ($product->getCustomOption('attributes')) { $selectedAttributes = unserialize($product->getCustomOption('attributes')->getValue()); } - $basePrice = $finalPrice; + $basePrice = $this->getBasePrice($product, $qty); foreach ($attributes as $attribute) { $attributeId = $attribute->getProductAttribute()->getId(); $value = $this->_getValueByIndex( @@ -65,19 +89,18 @@ public function getFinalPrice($qty=null, $product) isset($selectedAttributes[$attributeId]) ? $selectedAttributes[$attributeId] : null ); $product->setParentId(true); - if($value) { - if($value['pricing_value'] != 0) { + if ($value) { + if ($value['pricing_value'] != 0) { $product->setConfigurablePrice($this->_calcSelectionPrice($value, $basePrice)); Mage::dispatchEvent( 'catalog_product_type_configurable_price', array('product' => $product) ); - $finalPrice += $product->getConfigurablePrice(); + $price += $product->getConfigurablePrice(); } } } - $product->setFinalPrice($finalPrice); - return max(0, $product->getData('final_price')); + return $price; } /** diff --git a/app/code/core/Mage/Catalog/Model/Product/Type/Grouped.php b/app/code/core/Mage/Catalog/Model/Product/Type/Grouped.php index 2de6fc5756..ef9f44d6c4 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Type/Grouped.php +++ b/app/code/core/Mage/Catalog/Model/Product/Type/Grouped.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Type/Grouped/Price.php b/app/code/core/Mage/Catalog/Model/Product/Type/Grouped/Price.php index d670f12962..ca9cfccf84 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Type/Grouped/Price.php +++ b/app/code/core/Mage/Catalog/Model/Product/Type/Grouped/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Type/Price.php b/app/code/core/Mage/Catalog/Model/Product/Type/Price.php index 147a63e3c2..c05a1f7654 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Type/Price.php +++ b/app/code/core/Mage/Catalog/Model/Product/Type/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -47,6 +47,23 @@ public function getPrice($product) return $product->getData('price'); } + /** + * Get base price with apply Group, Tier, Special prises + * + * @param Mage_Catalog_Model_Product $product + * @param float|null $qty + * + * @return float + */ + public function getBasePrice($product, $qty = null) + { + $price = (float)$product->getPrice(); + return min($this->_applyGroupPrice($product, $price), $this->_applyTierPrice($product, $qty, $price), + $this->_applySpecialPrice($product, $price) + ); + } + + /** * Retrieve product final price * @@ -60,19 +77,17 @@ public function getFinalPrice($qty = null, $product) return $product->getCalculatedFinalPrice(); } - $finalPrice = $product->getPrice(); - - $finalPrice = $this->_applyGroupPrice($product, $finalPrice); - $finalPrice = $this->_applyTierPrice($product, $qty, $finalPrice); - $finalPrice = $this->_applySpecialPrice($product, $finalPrice); + $finalPrice = $this->getBasePrice($product, $qty); $product->setFinalPrice($finalPrice); Mage::dispatchEvent('catalog_product_get_final_price', array('product' => $product, 'qty' => $qty)); $finalPrice = $product->getData('final_price'); $finalPrice = $this->_applyOptionsPrice($product, $qty, $finalPrice); + $finalPrice = max(0, $finalPrice); + $product->setFinalPrice($finalPrice); - return max(0, $finalPrice); + return $finalPrice; } public function getChildFinalPrice($product, $productQty, $childProduct, $childProductQty) @@ -136,9 +151,9 @@ public function getGroupPrice($product) * Apply tier price for product if not return price that was before * * @param Mage_Catalog_Model_Product $product - * @param double $qty - * @param double $finalPrice - * @return double + * @param float $qty + * @param float $finalPrice + * @return float */ protected function _applyTierPrice($product, $qty, $finalPrice) { @@ -156,9 +171,9 @@ protected function _applyTierPrice($product, $qty, $finalPrice) /** * Get product tier price by qty * - * @param double $qty + * @param float $qty * @param Mage_Catalog_Model_Product $product - * @return double + * @return float */ public function getTierPrice($qty = null, $product) { @@ -249,12 +264,14 @@ protected function _getCustomerGroupId($product) * Apply special price for product if not return price that was before * * @param Mage_Catalog_Model_Product $product - * @param double $finalPrice - * @return double + * @param float $finalPrice + * @return float */ protected function _applySpecialPrice($product, $finalPrice) { - return $this->calculateSpecialPrice($finalPrice, $product->getSpecialPrice(), $product->getSpecialFromDate(), $product->getSpecialToDate(), $product->getStore()); + return $this->calculateSpecialPrice($finalPrice, $product->getSpecialPrice(), $product->getSpecialFromDate(), + $product->getSpecialToDate(), $product->getStore() + ); } /** @@ -270,18 +287,20 @@ public function getTierPriceCount($product) } /** - * Get formated by currency tier price + * Get formatted by currency tier price * - * @param double $qty + * @param float $qty * @param Mage_Catalog_Model_Product $product - * @return array || double + * @return array || float */ public function getFormatedTierPrice($qty=null, $product) { $price = $product->getTierPrice($qty); if (is_array($price)) { foreach ($price as $index => $value) { - $price[$index]['formated_price'] = Mage::app()->getStore()->convertPrice($price[$index]['website_price'], true); + $price[$index]['formated_price'] = Mage::app()->getStore()->convertPrice( + $price[$index]['website_price'], true + ); } } else { @@ -292,10 +311,10 @@ public function getFormatedTierPrice($qty=null, $product) } /** - * Get formated by currency product price + * Get formatted by currency product price * * @param Mage_Catalog_Model_Product $product - * @return array || double + * @return array || float */ public function getFormatedPrice($product) { @@ -307,8 +326,8 @@ public function getFormatedPrice($product) * * @param Mage_Catalog_Model_Product $product * @param int $qty - * @param double $finalPrice - * @return double + * @param float $finalPrice + * @return float */ protected function _applyOptionsPrice($product, $qty, $finalPrice) { @@ -316,12 +335,11 @@ protected function _applyOptionsPrice($product, $qty, $finalPrice) $basePrice = $finalPrice; foreach (explode(',', $optionIds->getValue()) as $optionId) { if ($option = $product->getOptionById($optionId)) { - $confItemOption = $product->getCustomOption('option_'.$option->getId()); + $group = $option->groupFactory($option->getType()) ->setOption($option) ->setConfigurationItemOption($confItemOption); - $finalPrice += $group->getOptionPrice($confItemOption->getValue(), $basePrice); } } @@ -343,7 +361,8 @@ protected function _applyOptionsPrice($product, $qty, $finalPrice) * @param null|int $productId * @return float */ - public static function calculatePrice($basePrice, $specialPrice, $specialPriceFrom, $specialPriceTo, $rulePrice = false, $wId = null, $gId = null, $productId = null) + public static function calculatePrice($basePrice, $specialPrice, $specialPriceFrom, $specialPriceTo, + $rulePrice = false, $wId = null, $gId = null, $productId = null) { Varien_Profiler::start('__PRODUCT_CALCULATE_PRICE__'); if ($wId instanceof Mage_Core_Model_Store) { @@ -385,7 +404,8 @@ public static function calculatePrice($basePrice, $specialPrice, $specialPriceFr * @param mixed $store * @return float */ - public static function calculateSpecialPrice($finalPrice, $specialPrice, $specialPriceFrom, $specialPriceTo, $store = null) + public static function calculateSpecialPrice($finalPrice, $specialPrice, $specialPriceFrom, $specialPriceTo, + $store = null) { if (!is_null($specialPrice) && $specialPrice != false) { if (Mage::app()->getLocale()->isStoreDateInInterval($store, $specialPriceFrom, $specialPriceTo)) { diff --git a/app/code/core/Mage/Catalog/Model/Product/Type/Simple.php b/app/code/core/Mage/Catalog/Model/Product/Type/Simple.php index f527948789..9e8ca639b6 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Type/Simple.php +++ b/app/code/core/Mage/Catalog/Model/Product/Type/Simple.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Type/Virtual.php b/app/code/core/Mage/Catalog/Model/Product/Type/Virtual.php index 17cd87564b..b35e449dc6 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Type/Virtual.php +++ b/app/code/core/Mage/Catalog/Model/Product/Type/Virtual.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Url.php b/app/code/core/Mage/Catalog/Model/Product/Url.php index 2076ff9dcc..627dca1dab 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Url.php +++ b/app/code/core/Mage/Catalog/Model/Product/Url.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Visibility.php b/app/code/core/Mage/Catalog/Model/Product/Visibility.php index ffa9aef7ee..40192bbbf9 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Visibility.php +++ b/app/code/core/Mage/Catalog/Model/Product/Visibility.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Website.php b/app/code/core/Mage/Catalog/Model/Product/Website.php index 6329605461..2d4e7c281b 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Website.php +++ b/app/code/core/Mage/Catalog/Model/Product/Website.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Abstract.php b/app/code/core/Mage/Catalog/Model/Resource/Abstract.php index 0152ccb744..d7949cbe96 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Abstract.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Attribute.php b/app/code/core/Mage/Catalog/Model/Resource/Attribute.php index 5f9a681a41..a89f17bfcd 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Attribute.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Attribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Category.php b/app/code/core/Mage/Catalog/Model/Resource/Category.php index 159d2a1351..23ffc38e8b 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Category.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Category.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Category/Attribute/Collection.php b/app/code/core/Mage/Catalog/Model/Resource/Category/Attribute/Collection.php index e815b67513..29b8ff8628 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Category/Attribute/Collection.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Category/Attribute/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Category/Attribute/Frontend/Image.php b/app/code/core/Mage/Catalog/Model/Resource/Category/Attribute/Frontend/Image.php index 890af7ec37..44787591df 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Category/Attribute/Frontend/Image.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Category/Attribute/Frontend/Image.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Category/Attribute/Source/Layout.php b/app/code/core/Mage/Catalog/Model/Resource/Category/Attribute/Source/Layout.php index fd6ef05c2e..b9cc6a24d6 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Category/Attribute/Source/Layout.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Category/Attribute/Source/Layout.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Category/Attribute/Source/Mode.php b/app/code/core/Mage/Catalog/Model/Resource/Category/Attribute/Source/Mode.php index c505181b0b..c2a51372f6 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Category/Attribute/Source/Mode.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Category/Attribute/Source/Mode.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Category/Attribute/Source/Page.php b/app/code/core/Mage/Catalog/Model/Resource/Category/Attribute/Source/Page.php index aa92cec95d..ef8fd447d0 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Category/Attribute/Source/Page.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Category/Attribute/Source/Page.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Category/Collection.php b/app/code/core/Mage/Catalog/Model/Resource/Category/Collection.php index ddbbcb0985..c04ea83769 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Category/Collection.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Category/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Category/Flat.php b/app/code/core/Mage/Catalog/Model/Resource/Category/Flat.php index 06ac767fbf..8a806ca98f 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Category/Flat.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Category/Flat.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -223,7 +223,7 @@ public function getInactiveCategoryIds() /** * Load nodes by parent id * - * @param unknown_type $parentNode + * @param Mage_Catalog_Model_Category|int $parentNode * @param integer $recursionLevel * @param integer $storeId * @return Mage_Catalog_Model_Resource_Category_Flat @@ -241,7 +241,8 @@ protected function _loadNodes($parentNode = null, $recursionLevel = 0, $storeId ->from($this->getMainStoreTable($storeId)) ->where('entity_id = ?', $parentNode) ->where('store_id = ?', $storeId); - if ($parentNode = $_conn->fetchRow($selectParent)) { + $parentNode = $_conn->fetchRow($selectParent); + if ($parentNode) { $parentPath = $parentNode['path']; $startLevel = $parentNode['level']; } @@ -280,6 +281,9 @@ protected function _loadNodes($parentNode = null, $recursionLevel = 0, $storeId $select->where('main_table.entity_id NOT IN (?)', $inactiveCategories); } + // Allow extensions to modify select (e.g. add custom category attributes to select) + Mage::dispatchEvent('catalog_category_flat_loadnodes_before', array('select' => $select)); + $arrNodes = $_conn->fetchAll($select); $nodes = array(); foreach ($arrNodes as $node) { @@ -572,7 +576,9 @@ protected function _createTable($store) // Adding indexes $table->addIndex( - $_writeAdapter->getIndexName($tableName, array('entity_id')), array('entity_id'), array('type' => 'primary') + $_writeAdapter->getIndexName($tableName, array('entity_id')), + array('entity_id'), + array('type' => 'primary') ); $table->addIndex( $_writeAdapter->getIndexName($tableName, array('store_id')), array('store_id'), array('type' => 'index') @@ -1096,7 +1102,7 @@ public function moveold($categoryId, $prevParentId, $parentId) * 'field_name' => 'value' * ) * - * @param Mage_Catalog_Model_Category $category + * @param Varien_Object $category * @param array $replaceFields * @return array */ @@ -1106,8 +1112,9 @@ protected function _prepareDataForAllFields($category, $replaceFields = array()) $this->_getWriteAdapter()->resetDdlCache($table); $table = $this->_getWriteAdapter()->describeTable($table); $data = array(); - foreach ($table as $column=>$columnData) { - if (null !== $category->getData($column)) { + $idFieldName = Mage::getSingleton('catalog/category')->getIdFieldName(); + foreach ($table as $column => $columnData) { + if ($column != $idFieldName || null !== $category->getData($column)) { if (key_exists($column, $replaceFields)) { $value = $category->getData($replaceFields[$column]); } else { diff --git a/app/code/core/Mage/Catalog/Model/Resource/Category/Flat/Collection.php b/app/code/core/Mage/Catalog/Model/Resource/Category/Flat/Collection.php index f81132c48a..e501d1cc1b 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Category/Flat/Collection.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Category/Flat/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Category/Indexer/Product.php b/app/code/core/Mage/Catalog/Model/Resource/Category/Indexer/Product.php index 621494629e..880f995a95 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Category/Indexer/Product.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Category/Indexer/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Category/Tree.php b/app/code/core/Mage/Catalog/Model/Resource/Category/Tree.php index 0e73fad4ad..11638f815d 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Category/Tree.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Category/Tree.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Collection/Abstract.php b/app/code/core/Mage/Catalog/Model/Resource/Collection/Abstract.php index db6a168611..e4b8e4bb7f 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Collection/Abstract.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Collection/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Config.php b/app/code/core/Mage/Catalog/Model/Resource/Config.php index 541040d54f..06a249700a 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Config.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Attribute.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Attribute.php index 84298c835b..74687dbf0b 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Attribute.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Attribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -149,22 +149,11 @@ protected function _afterSave() * Fix saving attribute in admin */ Mage::getSingleton('eav/config')->clear(); - return parent::_afterSave(); - } - - /** - * Init indexing process after attribute data commit - * - * @return Mage_Catalog_Model_Resource_Eav_Attribute - */ - public function afterCommitCallback() - { - parent::afterCommitCallback(); Mage::getSingleton('index/indexer')->processEntityAction( $this, self::ENTITY, Mage_Index_Model_Event::TYPE_SAVE ); - return $this; + return parent::_afterSave(); } /** @@ -337,7 +326,8 @@ public static function initLabels($storeId = null) } } - self::$_labels = Mage::app()->getTranslator()->getResource()->getTranslationArrayByStrings($attributeLabels, $storeId); + self::$_labels = Mage::app()->getTranslator()->getResource() + ->getTranslationArrayByStrings($attributeLabels, $storeId); } } diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Abstract.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Abstract.php index b5fe4fc8a0..eaaea4eb61 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Abstract.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Attribute.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Attribute.php index 77dd9a0629..6cb93ff07e 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Attribute.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Attribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category.php index a8f014f514..c8fe2809dc 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category/Attribute/Collection.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category/Attribute/Collection.php index 50c7f3b2ad..3f85296c86 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category/Attribute/Collection.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category/Attribute/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category/Attribute/Frontend/Image.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category/Attribute/Frontend/Image.php index 5b9f4f8b2c..eb05bb8a2f 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category/Attribute/Frontend/Image.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category/Attribute/Frontend/Image.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category/Attribute/Source/Layout.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category/Attribute/Source/Layout.php index d3e2823f62..dac27f4730 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category/Attribute/Source/Layout.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category/Attribute/Source/Layout.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category/Attribute/Source/Mode.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category/Attribute/Source/Mode.php index c59b93ccea..7c721394e0 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category/Attribute/Source/Mode.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category/Attribute/Source/Mode.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category/Attribute/Source/Page.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category/Attribute/Source/Page.php index 8df7860b7a..c112548367 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category/Attribute/Source/Page.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category/Attribute/Source/Page.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category/Collection.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category/Collection.php index 5932849077..5a8fc68fe3 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category/Collection.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category/Flat.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category/Flat.php index 77c894e85f..b68de3e510 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category/Flat.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category/Flat.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category/Flat/Collection.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category/Flat/Collection.php index 434d2793e1..a13f7668d8 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category/Flat/Collection.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category/Flat/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category/Indexer/Product.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category/Indexer/Product.php index 048e3b56a9..bd38a8f2b9 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category/Indexer/Product.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category/Indexer/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category/Tree.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category/Tree.php index c2da19207f..bb268e23d9 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category/Tree.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category/Tree.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Collection/Abstract.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Collection/Abstract.php index 1d7ca29388..9bbdb79562 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Collection/Abstract.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Collection/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Config.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Config.php index 26c9a3113f..2e2115ee45 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Config.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Layer/Filter/Attribute.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Layer/Filter/Attribute.php index 7596c69f20..fa62684906 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Layer/Filter/Attribute.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Layer/Filter/Attribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Layer/Filter/Decimal.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Layer/Filter/Decimal.php index 0f5a04f16d..8679b24e7a 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Layer/Filter/Decimal.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Layer/Filter/Decimal.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Layer/Filter/Price.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Layer/Filter/Price.php index 493e5a230c..4fdfd1399a 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Layer/Filter/Price.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Layer/Filter/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product.php index e6456e2f4a..c856a00d7d 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Action.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Action.php index c3d2b111ea..beb8e17a48 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Action.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Action.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Attribute/Backend/Image.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Attribute/Backend/Image.php index b646217923..f305010f29 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Attribute/Backend/Image.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Attribute/Backend/Image.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Attribute/Backend/Media.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Attribute/Backend/Media.php index dcb633ab18..662bb69ff5 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Attribute/Backend/Media.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Attribute/Backend/Media.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Attribute/Backend/Tierprice.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Attribute/Backend/Tierprice.php index 6c7c64bb2e..d183b18533 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Attribute/Backend/Tierprice.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Attribute/Backend/Tierprice.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Attribute/Backend/Urlkey.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Attribute/Backend/Urlkey.php index f8f455bbff..7a39312481 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Attribute/Backend/Urlkey.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Attribute/Backend/Urlkey.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Attribute/Collection.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Attribute/Collection.php index f8482c7dfe..a449f892d8 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Attribute/Collection.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Attribute/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Attribute/Frontend/Image.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Attribute/Frontend/Image.php index f2bd5aa734..6bcd115f6c 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Attribute/Frontend/Image.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Attribute/Frontend/Image.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Attribute/Frontend/Tierprice.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Attribute/Frontend/Tierprice.php index 841b643d05..3a7bfe3310 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Attribute/Frontend/Tierprice.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Attribute/Frontend/Tierprice.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Collection.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Collection.php index 27e245a592..0dc6024230 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Collection.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Compare/Item.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Compare/Item.php index f05cc12a45..77504197d0 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Compare/Item.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Compare/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Compare/Item/Collection.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Compare/Item/Collection.php index dce5b4dada..603f99588f 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Compare/Item/Collection.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Compare/Item/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Flat.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Flat.php index d27604e3cf..78af3c1a31 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Flat.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Flat.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Flat/Indexer.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Flat/Indexer.php index 65e27f11f2..6e7b1c8cf7 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Flat/Indexer.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Flat/Indexer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Abstract.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Abstract.php index e42f750385..3263a3a15e 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Abstract.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Eav.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Eav.php index f2c0ad3cec..4e3a97bc28 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Eav.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Eav.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Eav/Abstract.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Eav/Abstract.php index 268c6b6861..20f443f9c2 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Eav/Abstract.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Eav/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Eav/Decimal.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Eav/Decimal.php index 0cc14b2c1a..47008c9666 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Eav/Decimal.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Eav/Decimal.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Eav/Source.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Eav/Source.php index 4698d34979..8437ab7a44 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Eav/Source.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Eav/Source.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price.php index 65be56043b..460b502d87 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price/Configurable.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price/Configurable.php index 9e78d2e5ee..c01444c74a 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price/Configurable.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price/Configurable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price/Default.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price/Default.php index a6a7af4946..6ff33f5643 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price/Default.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price/Default.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price/Grouped.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price/Grouped.php index d88ee8fd93..f81710fcdd 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price/Grouped.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price/Grouped.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price/Interface.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price/Interface.php index 458f3cbada..33a0c4a552 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price/Interface.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Link.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Link.php index 7b041843a0..e0615f0e17 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Link.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Link.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Link/Collection.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Link/Collection.php index 85821ec8e5..de6bbb1b04 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Link/Collection.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Link/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Link/Product/Collection.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Link/Product/Collection.php index 27d10354e6..76dbf49132 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Link/Product/Collection.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Link/Product/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Option.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Option.php index fe8dbb5252..9bd1d59ad3 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Option.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Option.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Option/Collection.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Option/Collection.php index 1899eaf2a6..2c05af2816 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Option/Collection.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Option/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Option/Value.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Option/Value.php index d5958bab95..3a62733a93 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Option/Value.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Option/Value.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Option/Value/Collection.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Option/Value/Collection.php index 8ca73da953..8eb7a5cf89 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Option/Value/Collection.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Option/Value/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Relation.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Relation.php index 6d6e863c87..0024e1f12f 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Relation.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Relation.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Status.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Status.php index 09974656a1..017e8d1f18 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Status.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Status.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Type/Configurable.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Type/Configurable.php index c8c40901b8..d1576cb678 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Type/Configurable.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Type/Configurable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Type/Configurable/Attribute.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Type/Configurable/Attribute.php index e4193228ed..0b9c4d29fa 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Type/Configurable/Attribute.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Type/Configurable/Attribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Type/Configurable/Attribute/Collection.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Type/Configurable/Attribute/Collection.php index 4be0e95eb6..6ee95a56f0 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Type/Configurable/Attribute/Collection.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Type/Configurable/Attribute/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Type/Configurable/Product/Collection.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Type/Configurable/Product/Collection.php index ec74d35735..dbbc5cb8a6 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Type/Configurable/Product/Collection.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Type/Configurable/Product/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Website.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Website.php index 9a49a3fc28..62b09b0b1d 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Website.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Website.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Sendfriend.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Sendfriend.php index afb13e3ec2..b19fa68348 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Sendfriend.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Sendfriend.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Sendfriend/Collection.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Sendfriend/Collection.php index 924857418b..85c7d55c41 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Sendfriend/Collection.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Sendfriend/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Setup.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Setup.php index 3088ac99b7..616f7670ae 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Setup.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Setup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Url.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Url.php index dffeff94ad..486c7b4cf1 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Url.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Url.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Helper/Mysql4.php b/app/code/core/Mage/Catalog/Model/Resource/Helper/Mysql4.php index 76d1ea88fe..69723d77b9 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Helper/Mysql4.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Helper/Mysql4.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Attribute.php b/app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Attribute.php index 3043ffab85..581d361589 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Attribute.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Attribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Decimal.php b/app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Decimal.php index 1489e2837c..dfac4793b8 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Decimal.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Decimal.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -71,8 +71,7 @@ public function applyFilterToCollection($filter, $range, $index) $collection->getSelect() ->where("{$tableAlias}.value >= ?", ($range * ($index - 1))) - ->where("{$tableAlias}.value < ?", ($range * $index)) - ->group('e.entity_id'); + ->where("{$tableAlias}.value < ?", ($range * $index)); return $this; } @@ -143,7 +142,7 @@ public function getCount($filter, $range) $select = $this->_getSelect($filter); $adapter = $this->_getReadAdapter(); - $countExpr = new Zend_Db_Expr("COUNT(DISTINCT e.entity_id)"); + $countExpr = new Zend_Db_Expr("COUNT(*)"); $rangeExpr = new Zend_Db_Expr("FLOOR(decimal_index.value / {$range}) + 1"); $select->columns(array( diff --git a/app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Price.php b/app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Price.php index a964c2af26..3d1389560f 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Price.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -34,6 +34,11 @@ */ class Mage_Catalog_Model_Resource_Layer_Filter_Price extends Mage_Core_Model_Resource_Db_Abstract { + /** + * Minimal possible price + */ + const MIN_POSSIBLE_PRICE = .0001; + /** * Initialize connection and define main table name * @@ -53,6 +58,29 @@ protected function _getIndexTableAlias() return 'price_index'; } + /** + * Replace table alias in condition string + * + * @param string|null $conditionString + * @return string|null + */ + protected function _replaceTableAlias($conditionString) + { + if (is_null($conditionString)) { + return null; + } + $adapter = $this->_getReadAdapter(); + $oldAlias = array( + Mage_Catalog_Model_Resource_Product_Collection::INDEX_TABLE_ALIAS . '.', + $adapter->quoteIdentifier(Mage_Catalog_Model_Resource_Product_Collection::INDEX_TABLE_ALIAS) . '.', + ); + $newAlias = array( + Mage_Catalog_Model_Resource_Product_Collection::MAIN_TABLE_ALIAS . '.', + $adapter->quoteIdentifier(Mage_Catalog_Model_Resource_Product_Collection::MAIN_TABLE_ALIAS) . '.', + ); + return str_replace($oldAlias, $newAlias, $conditionString); + } + /** * Retrieve clean select with joined price index table * @@ -64,14 +92,54 @@ protected function _getSelect($filter) $collection = $filter->getLayer()->getProductCollection(); $collection->addPriceData($filter->getCustomerGroupId(), $filter->getWebsiteId()); - // clone select from collection with filters - $select = clone $collection->getSelect(); + if (!is_null($collection->getCatalogPreparedSelect())) { + $select = clone $collection->getCatalogPreparedSelect(); + } else { + $select = clone $collection->getSelect(); + } + // reset columns, order and limitation conditions $select->reset(Zend_Db_Select::COLUMNS); $select->reset(Zend_Db_Select::ORDER); $select->reset(Zend_Db_Select::LIMIT_COUNT); $select->reset(Zend_Db_Select::LIMIT_OFFSET); + // remove join with main table + $fromPart = $select->getPart(Zend_Db_Select::FROM); + if (!isset($fromPart[Mage_Catalog_Model_Resource_Product_Collection::INDEX_TABLE_ALIAS]) + || !isset($fromPart[Mage_Catalog_Model_Resource_Product_Collection::MAIN_TABLE_ALIAS]) + ) { + return $select; + } + + // processing FROM part + $priceIndexJoinPart = $fromPart[Mage_Catalog_Model_Resource_Product_Collection::INDEX_TABLE_ALIAS]; + $priceIndexJoinConditions = explode('AND', $priceIndexJoinPart['joinCondition']); + $priceIndexJoinPart['joinType'] = Zend_Db_Select::FROM; + $priceIndexJoinPart['joinCondition'] = null; + $fromPart[Mage_Catalog_Model_Resource_Product_Collection::MAIN_TABLE_ALIAS] = $priceIndexJoinPart; + unset($fromPart[Mage_Catalog_Model_Resource_Product_Collection::INDEX_TABLE_ALIAS]); + $select->setPart(Zend_Db_Select::FROM, $fromPart); + foreach ($fromPart as $key => $fromJoinItem) { + $fromPart[$key]['joinCondition'] = $this->_replaceTableAlias($fromJoinItem['joinCondition']); + } + $select->setPart(Zend_Db_Select::FROM, $fromPart); + + // processing WHERE part + $wherePart = $select->getPart(Zend_Db_Select::WHERE); + foreach ($wherePart as $key => $wherePartItem) { + $wherePart[$key] = $this->_replaceTableAlias($wherePartItem); + } + $select->setPart(Zend_Db_Select::WHERE, $wherePart); + $excludeJoinPart = Mage_Catalog_Model_Resource_Product_Collection::MAIN_TABLE_ALIAS . '.entity_id'; + foreach ($priceIndexJoinConditions as $condition) { + if (strpos($condition, $excludeJoinPart) !== false) { + continue; + } + $select->where($this->_replaceTableAlias($condition)); + } + $select->where($this->_getPriceExpression($filter, $select) . ' IS NOT NULL'); + return $select; } @@ -79,6 +147,7 @@ protected function _getSelect($filter) * Prepare response object and dispatch prepare price event * Return response object * + * @deprecated since 1.7.0.0 * @param Mage_Catalog_Model_Layer_Filter_Price $filter * @param Varien_Db_Select $select * @return Varien_Object @@ -113,23 +182,65 @@ protected function _dispatchPreparePriceEvent($filter, $select) /** * Retrieve maximal price for attribute * + * @deprecated since 1.7.0.0 * @param Mage_Catalog_Model_Layer_Filter_Price $filter * @return float */ public function getMaxPrice($filter) { - $select = $this->_getSelect($filter); - $connection = $this->_getReadAdapter(); - $response = $this->_dispatchPreparePriceEvent($filter, $select); + return $filter->getLayer()->getProductCollection()->getMaxPrice(); + } - $table = $this->_getIndexTableAlias(); + /** + * Price expression generated by products collection + * + * @param Mage_Catalog_Model_Layer_Filter_Price $filter + * @param Varien_Db_Select $select + * @param bool $replaceAlias + * @return string + */ + protected function _getPriceExpression($filter, $select, $replaceAlias = true) + { + $priceExpression = $filter->getLayer()->getProductCollection()->getPriceExpression($select); + $additionalPriceExpression = $filter->getLayer()->getProductCollection()->getAdditionalPriceExpression($select); + $result = empty($additionalPriceExpression) + ? $priceExpression + : "({$priceExpression} {$additionalPriceExpression})"; + if ($replaceAlias) { + $result = $this->_replaceTableAlias($result); + } - $additional = join('', $response->getAdditionalCalculations()); - $maxPriceExpr = new Zend_Db_Expr("MAX({$table}.min_price {$additional})"); + return $result; + } - $select->columns(array($maxPriceExpr)); + /** + * Get comparing value sql part + * + * @param float $price + * @param Mage_Catalog_Model_Layer_Filter_Price $filter + * @param bool $decrease + * @return float + */ + protected function _getComparingValue($price, $filter, $decrease = true) + { + $currencyRate = $filter->getLayer()->getProductCollection()->getCurrencyRate(); + if ($decrease) { + return round(($price - (self::MIN_POSSIBLE_PRICE / 2)) / $currencyRate, 3); + } + return round(($price + (self::MIN_POSSIBLE_PRICE / 2)) / $currencyRate, 3); + } - return $connection->fetchOne($select) * $filter->getCurrencyRate(); + /** + * Get full price expression generated by products collection + * + * @param Mage_Catalog_Model_Layer_Filter_Price $filter + * @param Varien_Db_Select $select + * @return Zend_Db_Expr + */ + protected function _getFullPriceExpression($filter, $select) + { + return new Zend_Db_Expr('ROUND((' . $this->_getPriceExpression($filter, $select) . ') * ' + . $filter->getLayer()->getProductCollection()->getCurrencyRate() . ', 2)'); } /** @@ -141,24 +252,20 @@ public function getMaxPrice($filter) */ public function getCount($filter, $range) { - $select = $this->_getSelect($filter); - $connection = $this->_getReadAdapter(); - $response = $this->_dispatchPreparePriceEvent($filter, $select); - $table = $this->_getIndexTableAlias(); - - $additional = join('', $response->getAdditionalCalculations()); - $rate = $filter->getCurrencyRate(); + $select = $this->_getSelect($filter); + $priceExpression = $this->_getPriceExpression($filter, $select); + $rate = $filter->getCurrencyRate(); /** * Check and set correct variable values to prevent SQL-injections */ - $rate = floatval($rate); - $range = floatval($range); + $rate = floatval($rate); + $range = floatval($range) / $rate; if ($range == 0) { $range = 1; } - $countExpr = new Zend_Db_Expr('COUNT(*)'); - $rangeExpr = new Zend_Db_Expr("FLOOR((({$table}.min_price {$additional}) * {$rate}) / {$range}) + 1"); + $countExpr = new Zend_Db_Expr('COUNT(*)'); + $rangeExpr = new Zend_Db_Expr("FLOOR(({$priceExpression}) / {$range}) + 1"); $select->columns(array( 'range' => $rangeExpr, @@ -166,75 +273,113 @@ public function getCount($filter, $range) )); $select->group($rangeExpr)->order("$rangeExpr ASC"); - return $connection->fetchPairs($select); + return $this->_getReadAdapter()->fetchPairs($select); } /** - * Prepare filter apply + * Apply attribute filter to product collection * + * @deprecated since 1.7.0.0 * @param Mage_Catalog_Model_Layer_Filter_Price $filter - * @return array + * @param int $range + * @param int $index the range factor + * @return Mage_Catalog_Model_Resource_Layer_Filter_Price */ - protected function _prepareApply($filter) + public function applyFilterToCollection($filter, $range, $index) { - $collection = $filter->getLayer()->getProductCollection(); - $collection->addPriceData($filter->getCustomerGroupId(), $filter->getWebsiteId()); + $priceExpr = $this->_getPriceExpression($filter); + $filter->getLayer()->getProductCollection() + ->getSelect() + ->where($priceExpr . ' >= ' . $this->_getComparingValue(($range * ($index - 1)), $filter)) + ->where($priceExpr . ' < ' . $this->_getComparingValue(($range * $index), $filter)); - $select = $collection->getSelect(); - $response = $this->_dispatchPreparePriceEvent($filter, $select); + return $this; + } - $table = $this->_getIndexTableAlias(); - $additional = join('', $response->getAdditionalCalculations()); - $rate = $filter->getCurrencyRate(); - $priceExpr = new Zend_Db_Expr("ROUND(({$table}.min_price {$additional}) * {$rate}, 2)"); + /** + * Load range of product prices + * + * @param Mage_Catalog_Model_Layer_Filter_Price $filter + * @param int $limit + * @param null|int $offset + * @param null|int $lowerPrice + * @param null|int $upperPrice + * @return array + */ + public function loadPrices($filter, $limit, $offset = null, $lowerPrice = null, $upperPrice = null) + { + $select = $this->_getSelect($filter); + $priceExpression = $this->_getPriceExpression($filter, $select); + $select->columns(array($this->_getFullPriceExpression($filter, $select))); + if (!is_null($lowerPrice)) { + $select->where("$priceExpression >= " . $this->_getComparingValue($lowerPrice, $filter)); + } + if (!is_null($upperPrice)) { + $select->where("$priceExpression < " . $this->_getComparingValue($upperPrice, $filter)); + } + $select->order("$priceExpression ASC")->limit($limit, $offset); - return array($select, $priceExpr); + return $this->_getReadAdapter()->fetchCol($select); } /** - * Apply attribute filter to product collection + * Load range of product prices, preceding the price * * @param Mage_Catalog_Model_Layer_Filter_Price $filter - * @param int $range - * @param int $index the range factor - * @return Mage_Catalog_Model_Resource_Layer_Filter_Price + * @param float $price + * @param int $index + * @return array|false */ - public function applyFilterToCollection($filter, $range, $index) + public function loadPreviousPrices($filter, $price, $index, $lowerPrice = null) { - list($select, $priceExpr) = $this->_prepareApply($filter); - $select - ->where($priceExpr . ' >= ?', ($range * ($index - 1))) - ->where($priceExpr . ' < ?', ($range * $index)); + $select = $this->_getSelect($filter); + $priceExpression = $this->_getPriceExpression($filter, $select); + $select->columns('COUNT(*)')->where("$priceExpression < " . $this->_getComparingValue($price, $filter)); + if (!is_null($lowerPrice)) { + $select->where("$priceExpression >= " . $this->_getComparingValue($lowerPrice, $filter)); + } + $offset = $this->_getReadAdapter()->fetchOne($select); + if (!$offset) { + return false; + } - return $this; + return $this->loadPrices($filter, $index - $offset + 1, $offset - 1, $lowerPrice); } /** - * Load all product prices to algorithm model + * Load range of product prices, next to the price * - * @param Mage_Catalog_Model_Layer_Filter_Price_Algorithm $algorithm * @param Mage_Catalog_Model_Layer_Filter_Price $filter + * @param float $price + * @param int $rightIndex + * @param null|int $upperPrice * @return array */ - public function loadAllPrices($algorithm, $filter) + public function loadNextPrices($filter, $price, $rightIndex, $upperPrice = null) { - $select = $this->_getSelect($filter); - $connection = $this->_getReadAdapter(); - $response = $this->_dispatchPreparePriceEvent($filter, $select); + $select = $this->_getSelect($filter); - $table = $this->_getIndexTableAlias(); + $pricesSelect = clone $select; + $priceExpression = $this->_getPriceExpression($filter, $pricesSelect); - $additional = join('', $response->getAdditionalCalculations()); - $maxPriceExpr = new Zend_Db_Expr( - "ROUND(({$table}.min_price {$additional}) * " . $connection->quote($filter->getCurrencyRate()) . ", 2)" - ); - - $select->columns(array($maxPriceExpr)); + $select->columns('COUNT(*)')->where("$priceExpression > " . $this->_getComparingValue($price, $filter, false)); + if (!is_null($upperPrice)) { + $select->where("$priceExpression < " . $this->_getComparingValue($upperPrice, $filter)); + } + $offset = $this->_getReadAdapter()->fetchOne($select); + if (!$offset) { + return false; + } - $prices = $connection->fetchCol($select); - $algorithm->setPrices($prices); + $pricesSelect + ->columns(array($this->_getFullPriceExpression($filter, $pricesSelect))) + ->where("$priceExpression >= " . $this->_getComparingValue($price, $filter)); + if (!is_null($upperPrice)) { + $pricesSelect->where("$priceExpression < " . $this->_getComparingValue($upperPrice, $filter)); + } + $pricesSelect->order("$priceExpression DESC")->limit($rightIndex - $offset + 1, $offset - 1); - return $prices; + return array_reverse($this->_getReadAdapter()->fetchCol($pricesSelect)); } /** @@ -255,19 +400,23 @@ public function applyPriceRange($filter) return $this; } - list($select, $priceExpr) = $this->_prepareApply($filter); + $select = $filter->getLayer()->getProductCollection()->getSelect(); + $priceExpr = $this->_getPriceExpression($filter, $select, false); - if ($from == $to && !empty($to)) { - $select->where($priceExpr . ' = ?', $from); - } else { - if ($from !== '') { - $select->where($priceExpr . ' >= ?', $from); - } - if ($to !== '') { - $select->where($priceExpr . ' < ?', $to); + if ($to !== '') { + $to = (float)$to; + if ($from == $to) { + $to += self::MIN_POSSIBLE_PRICE; } } + if ($from !== '') { + $select->where($priceExpr . ' >= ' . $this->_getComparingValue($from, $filter)); + } + if ($to !== '') { + $select->where($priceExpr . ' < ' . $this->_getComparingValue($to, $filter)); + } + return $this; } diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product.php b/app/code/core/Mage/Catalog/Model/Resource/Product.php index 526bc37b5c..3aee887515 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -102,11 +102,19 @@ public function getWebsiteIds($product) public function getWebsiteIdsByProductIds($productIds) { $select = $this->_getWriteAdapter()->select() - ->from($this->_productWebsiteTable, array('product_id', 'website_ids' =>'GROUP_CONCAT(website_id)')) - ->where('product_id IN (?)', $productIds) - ->group('product_id'); + ->from($this->_productWebsiteTable, array('product_id', 'website_id')) + ->where('product_id IN (?)', $productIds); + $productsWebsites = array(); + foreach ($this->_getWriteAdapter()->fetchAll($select) as $productInfo) { + $productId = $productInfo['product_id']; + if (!isset($productsWebsites[$productId])) { + $productsWebsites[$productId] = array(); + } + $productsWebsites[$productId][] = $productInfo['website_id']; + + } - return $this->_getWriteAdapter()->fetchAll($select); + return $productsWebsites; } /** @@ -640,6 +648,7 @@ public function getParentProductIds($object) /** * Retrieve product entities info * + * @param array|string|null $columns * @return array */ public function getProductEntitiesInfo($columns = null) @@ -650,9 +659,12 @@ public function getProductEntitiesInfo($columns = null) if (empty($columns) || !is_array($columns)) { $columns = $this->_getDefaultAttributes(); } - $select = $this->_getReadAdapter()->select() + + $adapter = $this->_getReadAdapter(); + $select = $adapter->select() ->from($this->getTable('catalog/product'), $columns); - return $this->_getReadAdapter()->fetchAll($select); + + return $adapter->fetchAll($select); } /** diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Action.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Action.php index 4e341996fe..70381ea254 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Action.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Action.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Groupprice.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Groupprice.php index 06a2c3f593..ce453a52e6 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Groupprice.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Groupprice.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Groupprice/Abstract.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Groupprice/Abstract.php index 3498c02774..e3786d0e1a 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Groupprice/Abstract.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Groupprice/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Image.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Image.php index 6ea707808c..9ab82537d0 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Image.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Image.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Media.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Media.php index 326d60844c..c6a1386ced 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Media.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Media.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Tierprice.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Tierprice.php index b86300c7d7..f10d0cf311 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Tierprice.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Tierprice.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Urlkey.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Urlkey.php index a5183d0c8c..c1e23216e3 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Urlkey.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Urlkey.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Collection.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Collection.php index 9e83df6ba7..b2217b65e4 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Collection.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -72,9 +72,10 @@ protected function _initSelect() } /** - * Specify attribute entity type filter + * Specify attribute entity type filter. + * Entity type is defined. * - * @param int $typeId + * @param int $typeId * @return Mage_Catalog_Model_Resource_Product_Attribute_Collection */ public function setEntityTypeFilter($typeId) @@ -174,7 +175,7 @@ public function addToIndexFilter($addRequiredCodes = false) 'additional_table.is_visible_in_advanced_search = 1', 'additional_table.is_filterable > 0', 'additional_table.is_filterable_in_search = 1', - 'used_for_sort_by = 1' + 'additional_table.used_for_sort_by = 1' ); if ($addRequiredCodes) { diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Frontend/Image.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Frontend/Image.php index bfa659512b..baee8ce50a 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Frontend/Image.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Frontend/Image.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Frontend/Tierprice.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Frontend/Tierprice.php index f2db4451b4..665cf50d4f 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Frontend/Tierprice.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Frontend/Tierprice.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Collection.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Collection.php index df5ed002a2..f3c8b5d4a5 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Collection.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -34,6 +34,16 @@ */ class Mage_Catalog_Model_Resource_Product_Collection extends Mage_Catalog_Model_Resource_Collection_Abstract { + /** + * Alias for index table + */ + const INDEX_TABLE_ALIAS = 'price_index'; + + /** + * Alias for main table + */ + const MAIN_TABLE_ALIAS = 'e'; + /** * Catalog Product Flat is enabled cache per store * @@ -149,6 +159,134 @@ class Mage_Catalog_Model_Resource_Product_Collection extends Mage_Catalog_Model_ 'special_price' => 'price_index.special_price', )); + /** + * Price expression sql + * + * @var string|null + */ + protected $_priceExpression; + + /** + * Additional price expression sql part + * + * @var string|null + */ + protected $_additionalPriceExpression; + + /** + * Max prise (statistics data) + * + * @var float + */ + protected $_maxPrice; + + /** + * Min prise (statistics data) + * + * @var float + */ + protected $_minPrice; + + /** + * Prise standard deviation (statistics data) + * + * @var float + */ + protected $_priceStandardDeviation; + + /** + * Prises count (statistics data) + * + * @var int + */ + protected $_pricesCount = null; + + /** + * Cloned Select after dispatching 'catalog_prepare_price_select' event + * + * @var Varien_Db_Select + */ + protected $_catalogPreparePriceSelect = null; + + /** + * Get cloned Select after dispatching 'catalog_prepare_price_select' event + * + * @return Varien_Db_Select + */ + public function getCatalogPreparedSelect() + { + return $this->_catalogPreparePriceSelect; + } + + /** + * Prepare additional price expression sql part + * + * @param Varien_Db_Select $select + * @return Mage_Catalog_Model_Resource_Product_Collection + */ + protected function _preparePriceExpressionParameters($select) + { + // prepare response object for event + $response = new Varien_Object(); + $response->setAdditionalCalculations(array()); + $table = self::INDEX_TABLE_ALIAS; + + // prepare event arguments + $eventArgs = array( + 'select' => $select, + 'table' => $table, + 'store_id' => $this->getStoreId(), + 'response_object' => $response + ); + + Mage::dispatchEvent('catalog_prepare_price_select', $eventArgs); + + $additional = join('', $response->getAdditionalCalculations()); + $this->_priceExpression = $table . '.min_price'; + $this->_additionalPriceExpression = $additional; + $this->_catalogPreparePriceSelect = clone $select; + + return $this; + } + + /** + * Get price expression sql part + * + * @param Varien_Db_Select $select + * @return string + */ + public function getPriceExpression($select) + { + if (is_null($this->_priceExpression)) { + $this->_preparePriceExpressionParameters($select); + } + return $this->_priceExpression; + } + + /** + * Get additional price expression sql part + * + * @param Varien_Db_Select $select + * @return string + */ + public function getAdditionalPriceExpression($select) + { + if (is_null($this->_additionalPriceExpression)) { + $this->_preparePriceExpressionParameters($select); + } + return $this->_additionalPriceExpression; + } + + /** + * Get currency rate + * + * @return float + */ + public function getCurrencyRate() + { + return Mage::app()->getStore($this->getStoreId())->getCurrentCurrencyRate(); + } + /** * Retrieve Catalog Product Flat Helper object * @@ -287,7 +425,7 @@ protected function _initSelect() { if ($this->isEnabledFlat()) { $this->getSelect() - ->from(array('e' => $this->getEntity()->getFlatTableName()), null) + ->from(array(self::MAIN_TABLE_ALIAS => $this->getEntity()->getFlatTableName()), null) ->columns(array('status' => new Zend_Db_Expr(Mage_Catalog_Model_Product_Status::STATUS_ENABLED))); $this->addAttributeToSelect(array('entity_id', 'type_id', 'attribute_set_id')); if ($this->getFlatHelper()->isAddChildData()) { @@ -296,7 +434,7 @@ protected function _initSelect() $this->addAttributeToSelect(array('child_id', 'is_child')); } } else { - $this->getSelect()->from(array('e'=>$this->getEntity()->getEntityTable())); + $this->getSelect()->from(array(self::MAIN_TABLE_ALIAS => $this->getEntity()->getEntityTable())); } return $this; } @@ -723,20 +861,58 @@ public function getAllAttributeValues($attribute) } /** - * Get SQL for get record count + * Get SQL for get record count without left JOINs * * @return Varien_Db_Select */ public function getSelectCountSql() { - $this->_renderFilters(); + return $this->_getSelectCountSql(); + } - $countSelect = $this->_getClearSelect() - ->columns('COUNT(DISTINCT e.entity_id)') - ->resetJoinLeft(); + /** + * Get SQL for get record count + * + * @param bool $resetLeftJoins + * @return Varien_Db_Select + */ + protected function _getSelectCountSql($select = null, $resetLeftJoins = true) + { + $this->_renderFilters(); + $countSelect = (is_null($select)) ? + $this->_getClearSelect() : + $this->_buildClearSelect($select); + $countSelect->columns('COUNT(DISTINCT e.entity_id)'); + if ($resetLeftJoins) { + $countSelect->resetJoinLeft(); + } return $countSelect; } + /** + * Prepare statistics data + * + * @return Mage_Catalog_Model_Resource_Product_Collection + */ + protected function _prepareStatisticsData() + { + $select = clone $this->getSelect(); + $priceExpression = $this->getPriceExpression($select) . ' ' . $this->getAdditionalPriceExpression($select); + $sqlEndPart = ') * ' . $this->getCurrencyRate() . ', 2)'; + $select = $this->_getSelectCountSql($select, false); + $select->columns('ROUND(MAX(' . $priceExpression . $sqlEndPart); + $select->columns('ROUND(MIN(' . $priceExpression . $sqlEndPart); + $select->columns($this->getConnection()->getStandardDeviationSql('ROUND((' . $priceExpression . $sqlEndPart)); + $select->where($this->getPriceExpression($select) . ' IS NOT NULL'); + $row = $this->getConnection()->fetchRow($select, $this->_bindParams, Zend_Db::FETCH_NUM); + $this->_pricesCount = (int)$row[0]; + $this->_maxPrice = (float)$row[1]; + $this->_minPrice = (float)$row[2]; + $this->_priceStandardDeviation = (float)$row[3]; + + return $this; + } + /** * Retreive clear select * @@ -744,7 +920,20 @@ public function getSelectCountSql() */ protected function _getClearSelect() { - $select = clone $this->getSelect(); + return $this->_buildClearSelect(); + } + + /** + * Build clear select + * + * @param Varien_Db_Select $select + * @return Varien_Db_Select + */ + protected function _buildClearSelect($select = null) + { + if (is_null($select)) { + $select = clone $this->getSelect(); + } $select->reset(Zend_Db_Select::ORDER); $select->reset(Zend_Db_Select::LIMIT_COUNT); $select->reset(Zend_Db_Select::LIMIT_OFFSET); @@ -752,6 +941,7 @@ protected function _getClearSelect() return $select; } + /** * Retrive all ids for collection * @@ -1537,6 +1727,17 @@ protected function _productLimitationJoinStore() * @return Mage_Catalog_Model_Resource_Product_Collection */ protected function _productLimitationJoinPrice() + { + return $this->_productLimitationPrice(); + } + + /** + * Join Product Price Table with left-join possibility + * + * @see Mage_Catalog_Model_Resource_Product_Collection::_productLimitationJoinPrice() + * @return Mage_Catalog_Model_Resource_Product_Collection + */ + protected function _productLimitationPrice($joinLeft = false) { $filters = $this->_productLimitationFilters; if (empty($filters['use_price_index'])) { @@ -1559,11 +1760,12 @@ protected function _productLimitationJoinPrice() $least, 'price_index.min_price'); $colls = array('price', 'tax_class_id', 'final_price', 'minimal_price' => $minimalExpr , 'min_price', 'max_price', 'tier_price'); - $select->join( - array('price_index' => $this->getTable('catalog/product_index_price')), - $joinCond, - $colls - ); + $tableName = array('price_index' => $this->getTable('catalog/product_index_price')); + if ($joinLeft) { + $select->joinLeft($tableName, $joinCond, $colls); + } else { + $select->join($tableName, $joinCond, $colls); + } // Set additional field filters foreach ($this->_priceDataFieldFilters as $filterData) { $select->where(call_user_func_array('sprintf', $filterData)); @@ -1863,4 +2065,77 @@ public function clear() return parent::clear(); } + /** + * Set Order field + * + * @param string $attribute + * @param string $dir + * @return Mage_Catalog_Model_Resource_Product_Collection + */ + public function setOrder($attribute, $dir = 'desc') + { + if ($attribute == 'price') { + $this->addAttributeToSort($attribute, $dir); + } else { + parent::setOrder($attribute, $dir); + } + return $this; + } + + /** + * Get products max price + * + * @return float + */ + public function getMaxPrice() + { + if (is_null($this->_maxPrice)) { + $this->_prepareStatisticsData(); + } + + return $this->_maxPrice; + } + + /** + * Get products min price + * + * @return float + */ + public function getMinPrice() + { + if (is_null($this->_minPrice)) { + $this->_prepareStatisticsData(); + } + + return $this->_minPrice; + } + + /** + * Get standard deviation of products price + * + * @return float + */ + public function getPriceStandardDeviation() + { + if (is_null($this->_priceStandardDeviation)) { + $this->_prepareStatisticsData(); + } + + return $this->_priceStandardDeviation; + } + + + /** + * Get count of product prices + * + * @return int + */ + public function getPricesCount() + { + if (is_null($this->_pricesCount)) { + $this->_prepareStatisticsData(); + } + + return $this->_pricesCount; + } } diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Compare/Item.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Compare/Item.php index fec7641a0b..a6029fbcc1 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Compare/Item.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Compare/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Compare/Item/Collection.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Compare/Item/Collection.php index 2487eba8ec..8e5311ffba 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Compare/Item/Collection.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Compare/Item/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Flat.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Flat.php index 84fb0d8ceb..7fb6d62073 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Flat.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Flat.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Flat/Indexer.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Flat/Indexer.php index c09d5d48dc..6d73df7317 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Flat/Indexer.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Flat/Indexer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Abstract.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Abstract.php index c225408cb6..90977fc2de 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Abstract.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav.php index cfdcca1c13..8d95774d28 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav/Abstract.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav/Abstract.php index aeb9ad7dd1..92aad27969 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav/Abstract.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -83,7 +83,7 @@ public function reindexEntities($processIds) if ($parentIds) { $processIds = array_unique(array_merge($processIds, $parentIds)); } - $childIds = $this->getRelationsByParent($parentIds); + $childIds = $this->getRelationsByParent($processIds); if ($childIds) { $processIds = array_unique(array_merge($processIds, $childIds)); } diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav/Decimal.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav/Decimal.php index 5fe0f2c3e9..79edd255e5 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav/Decimal.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav/Decimal.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav/Source.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav/Source.php index e3cd627844..5919d2a01f 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav/Source.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav/Source.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -121,6 +121,10 @@ protected function _prepareSelectIndex($entityIds = null, $attributeId = null) ) ->where('s.store_id != 0'); + if (!is_null($entityIds)) { + $subSelect->where('d.entity_id IN(?)', $entityIds); + } + /**@var $select Varien_Db_Select*/ $select = $adapter->select() ->from( @@ -144,10 +148,6 @@ protected function _prepareSelectIndex($entityIds = null, $attributeId = null) $select->where(Mage::getResourceHelper('catalog')->getIsNullNotNullCondition('pis.value', 'pid.value')); - if (!is_null($entityIds)) { - $select->where('pid.entity_id IN(?)', $entityIds); - } - /** * Add additional external limitation */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price.php index 101a364745..84d6b686a9 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Configurable.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Configurable.php index 964b149865..8996c48a95 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Configurable.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Configurable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Default.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Default.php index 2684566b53..2ea67cbbf8 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Default.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Default.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Grouped.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Grouped.php index a5f9754f81..899f6deb65 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Grouped.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Grouped.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Interface.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Interface.php index f590e1b3b4..f0b2221031 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Interface.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Link.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Link.php index adf3a329e8..b71c9a42c5 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Link.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Link.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Link/Collection.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Link/Collection.php index 97ad1ab3b7..8c4632f428 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Link/Collection.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Link/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Link/Product/Collection.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Link/Product/Collection.php index 6353f56781..3ddc3928e0 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Link/Product/Collection.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Link/Product/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Option.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Option.php index 8d39f643e4..e3429b7569 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Option.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Option.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Option/Collection.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Option/Collection.php index 985b497f19..661badc90a 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Option/Collection.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Option/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -66,14 +66,20 @@ public function addTitleToResult($storeId) { $productOptionTitleTable = $this->getTable('catalog/product_option_title'); $adapter = $this->getConnection(); - $titleExpr = $adapter->getCheckSql('store_option_title.title IS NULL', 'default_option_title.title', 'store_option_title.title'); + $titleExpr = $adapter->getCheckSql( + 'store_option_title.title IS NULL', + 'default_option_title.title', + 'store_option_title.title' + ); $this->getSelect() ->join(array('default_option_title' => $productOptionTitleTable), 'default_option_title.option_id = main_table.option_id', array('default_title' => 'title')) - ->joinLeft(array('store_option_title' => $productOptionTitleTable), - 'store_option_title.option_id = main_table.option_id AND ' . $adapter->quoteInto('store_option_title.store_id = ?', $storeId), + ->joinLeft( + array('store_option_title' => $productOptionTitleTable), + 'store_option_title.option_id = main_table.option_id AND ' + . $adapter->quoteInto('store_option_title.store_id = ?', $storeId), array( 'store_title' => 'title', 'title' => $titleExpr @@ -93,18 +99,33 @@ public function addPriceToResult($storeId) { $productOptionPriceTable = $this->getTable('catalog/product_option_price'); $adapter = $this->getConnection(); - $priceExpr = $adapter->getCheckSql('store_option_price.price IS NULL', 'default_option_price.price', 'store_option_price.price'); - $priceTypeExpr = $adapter->getCheckSql('store_option_price.price_type IS NULL', 'default_option_price.price_type', 'store_option_price.price_type'); + $priceExpr = $adapter->getCheckSql( + 'store_option_price.price IS NULL', + 'default_option_price.price', + 'store_option_price.price' + ); + $priceTypeExpr = $adapter->getCheckSql( + 'store_option_price.price_type IS NULL', + 'default_option_price.price_type', + 'store_option_price.price_type' + ); $this->getSelect() - ->joinLeft(array('default_option_price' => $productOptionPriceTable), - 'default_option_price.option_id = main_table.option_id AND ' . $adapter->quoteInto('default_option_price.store_id = ?', Mage_Catalog_Model_Abstract::DEFAULT_STORE_ID), + ->joinLeft( + array('default_option_price' => $productOptionPriceTable), + 'default_option_price.option_id = main_table.option_id AND ' + . $adapter->quoteInto( + 'default_option_price.store_id = ?', + Mage_Catalog_Model_Abstract::DEFAULT_STORE_ID + ), array( 'default_price' => 'price', 'default_price_type' => 'price_type' )) - ->joinLeft(array('store_option_price' => $productOptionPriceTable), - 'store_option_price.option_id = main_table.option_id AND ' . $adapter->quoteInto('store_option_price.store_id = ?', $storeId), + ->joinLeft( + array('store_option_price' => $productOptionPriceTable), + 'store_option_price.option_id = main_table.option_id AND ' + . $adapter->quoteInto('store_option_price.store_id = ?', $storeId), array( 'store_price' => 'price', 'store_price_type' => 'price_type', @@ -173,6 +194,18 @@ public function addProductToFilter($product) return $this; } + /** + * Add is_required filter to select + * + * @param bool $required + * @return Mage_Catalog_Model_Resource_Product_Option_Collection + */ + public function addRequiredFilter($required = true) + { + $this->addFieldToFilter('main_table.is_require', (string)$required); + return $this; + } + /** * Add filtering by option ids * diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Option/Value.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Option/Value.php index 5b1ed9208f..bf428d0606 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Option/Value.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Option/Value.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Option/Value/Collection.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Option/Value/Collection.php index 6226d30823..aee7495383 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Option/Value/Collection.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Option/Value/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Relation.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Relation.php index 6b02d2f703..d7aac27c03 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Relation.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Relation.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Status.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Status.php index 873c1afc01..5828ba9bc4 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Status.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Status.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Type/Configurable.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Type/Configurable.php index 5e041a3387..186195531c 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Type/Configurable.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Type/Configurable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -59,10 +59,7 @@ public function saveProducts($mainProduct, $productIds) } else { $mainProductId = $mainProduct; } - $select = $this->_getReadAdapter()->select() - ->from($this->getMainTable(), 'product_id') - ->where('parent_id = ?', $mainProductId); - $old = $this->_getReadAdapter()->fetchCol($select); + $old = $mainProduct->getTypeInstance()->getUsedProductIds(); $insert = array_diff($productIds, $old); $delete = array_diff($old, $productIds); diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Type/Configurable/Attribute.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Type/Configurable/Attribute.php index 23ba8222fc..6a77cc4f09 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Type/Configurable/Attribute.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Type/Configurable/Attribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Type/Configurable/Attribute/Collection.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Type/Configurable/Attribute/Collection.php index 6d5ef31f89..67187feaee 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Type/Configurable/Attribute/Collection.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Type/Configurable/Attribute/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Type/Configurable/Product/Collection.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Type/Configurable/Product/Collection.php index fd4dd4f18c..c58c164221 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Type/Configurable/Product/Collection.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Type/Configurable/Product/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Website.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Website.php index b8e48ba586..233b466a4a 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Website.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Website.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Setup.php b/app/code/core/Mage/Catalog/Model/Resource/Setup.php index 86938e6f6a..89fcbfd34e 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Setup.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Setup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Url.php b/app/code/core/Mage/Catalog/Model/Resource/Url.php index 0e81fa03dc..8cedda6d83 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Url.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Url.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -173,6 +173,40 @@ public function getRewriteByRequestPath($requestPath, $storeId) return $rewrite; } + /** + * Get last used increment part of rewrite request path + * + * @param string $prefix + * @param string $suffix + * @param int $storeId + * @return int + */ + public function getLastUsedRewriteRequestIncrement($prefix, $suffix, $storeId) + { + $adapter = $this->_getWriteAdapter(); + $requestPathField = new Zend_Db_Expr($adapter->quoteIdentifier('request_path')); + //select increment part of request path and cast expression to integer + $urlIncrementPartExpression = Mage::getResourceHelper('eav') + ->getCastToIntExpression($adapter->getSubstringSql( + $requestPathField, + strlen($prefix) + 1, + $adapter->getLengthSql($requestPathField) . ' - ' . strlen($prefix) . ' - ' . strlen($suffix) + )); + $select = $adapter->select() + ->from($this->getMainTable(), new Zend_Db_Expr('MAX(' . $urlIncrementPartExpression . ')')) + ->where('store_id = :store_id') + ->where('request_path LIKE :request_path') + ->where($adapter->prepareSqlCondition('request_path', array( + 'regexp' => '^' . preg_quote($prefix) . '[0-9]*' . preg_quote($suffix) . '$' + ))); + $bind = array( + 'store_id' => (int)$storeId, + 'request_path' => $prefix . '%' . $suffix, + ); + + return (int)$adapter->fetchOne($select, $bind); + } + /** * Validate array of request paths. Return first not used path in case if validations passed * @@ -208,7 +242,7 @@ public function checkRequestPaths($paths, $storeId) public function prepareRewrites($storeId, $categoryIds = null, $productIds = null) { $rewrites = array(); - $adapter = $this->_getReadAdapter(); + $adapter = $this->_getWriteAdapter(); $select = $adapter->select() ->from($this->getMainTable()) ->where('store_id = :store_id') diff --git a/app/code/core/Mage/Catalog/Model/Session.php b/app/code/core/Mage/Catalog/Model/Session.php index f36cb475c5..d859a9e2cc 100644 --- a/app/code/core/Mage/Catalog/Model/Session.php +++ b/app/code/core/Mage/Catalog/Model/Session.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/System/Config/Backend/Catalog/Category/Flat.php b/app/code/core/Mage/Catalog/Model/System/Config/Backend/Catalog/Category/Flat.php index 1f273bf6f3..5c593c6dd1 100644 --- a/app/code/core/Mage/Catalog/Model/System/Config/Backend/Catalog/Category/Flat.php +++ b/app/code/core/Mage/Catalog/Model/System/Config/Backend/Catalog/Category/Flat.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/System/Config/Backend/Catalog/Product/Flat.php b/app/code/core/Mage/Catalog/Model/System/Config/Backend/Catalog/Product/Flat.php index 7452f08687..b5e3e4513a 100644 --- a/app/code/core/Mage/Catalog/Model/System/Config/Backend/Catalog/Product/Flat.php +++ b/app/code/core/Mage/Catalog/Model/System/Config/Backend/Catalog/Product/Flat.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/System/Config/Backend/Catalog/Url/Rewrite/Suffix.php b/app/code/core/Mage/Catalog/Model/System/Config/Backend/Catalog/Url/Rewrite/Suffix.php index 7b441286bf..4145d28eb7 100644 --- a/app/code/core/Mage/Catalog/Model/System/Config/Backend/Catalog/Url/Rewrite/Suffix.php +++ b/app/code/core/Mage/Catalog/Model/System/Config/Backend/Catalog/Url/Rewrite/Suffix.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Template/Filter.php b/app/code/core/Mage/Catalog/Model/Template/Filter.php index 220bc994b0..7da080b2a1 100644 --- a/app/code/core/Mage/Catalog/Model/Template/Filter.php +++ b/app/code/core/Mage/Catalog/Model/Template/Filter.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Url.php b/app/code/core/Mage/Catalog/Model/Url.php index 39cfc4b643..a2e6bf292c 100644 --- a/app/code/core/Mage/Catalog/Model/Url.php +++ b/app/code/core/Mage/Catalog/Model/Url.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -645,11 +645,21 @@ public function getUnusedPath($storeId, $requestPath, $idPath) } // match request_url abcdef1234(-12)(.html) pattern $match = array(); - if (!preg_match('#^([0-9a-z/-]+?)(-([0-9]+))?('.preg_quote($suffix).')?$#i', $requestPath, $match)) { + $regularExpression = '#^([0-9a-z/-]+?)(-([0-9]+))?('.preg_quote($suffix).')?$#i'; + if (!preg_match($regularExpression, $requestPath, $match)) { return $this->getUnusedPath($storeId, '-', $idPath); } - $requestPath = $match[1].(isset($match[3])?'-'.($match[3]+1):'-1').(isset($match[4])?$match[4]:''); - return $this->getUnusedPath($storeId, $requestPath, $idPath); + $match[1] = $match[1] . '-'; + $match[4] = isset($match[4]) ? $match[4] : ''; + + $lastRequestPath = $this->getResource() + ->getLastUsedRewriteRequestIncrement($match[1], $match[4], $storeId); + if ($lastRequestPath) { + $match[3] = $lastRequestPath; + } + return $match[1] + . (isset($match[3]) ? ($match[3]+1) : '1') + . $match[4]; } else { return $requestPath; diff --git a/app/code/core/Mage/Catalog/controllers/CategoryController.php b/app/code/core/Mage/Catalog/controllers/CategoryController.php index 160a8ed5c8..ca486e6ebf 100644 --- a/app/code/core/Mage/Catalog/controllers/CategoryController.php +++ b/app/code/core/Mage/Catalog/controllers/CategoryController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/controllers/IndexController.php b/app/code/core/Mage/Catalog/controllers/IndexController.php index e62be35372..eb7be117fa 100644 --- a/app/code/core/Mage/Catalog/controllers/IndexController.php +++ b/app/code/core/Mage/Catalog/controllers/IndexController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/controllers/Product/CompareController.php b/app/code/core/Mage/Catalog/controllers/Product/CompareController.php index 78b9e73313..9354b2c2cc 100644 --- a/app/code/core/Mage/Catalog/controllers/Product/CompareController.php +++ b/app/code/core/Mage/Catalog/controllers/Product/CompareController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/controllers/ProductController.php b/app/code/core/Mage/Catalog/controllers/ProductController.php index b6b35dc3f5..4e0355a940 100644 --- a/app/code/core/Mage/Catalog/controllers/ProductController.php +++ b/app/code/core/Mage/Catalog/controllers/ProductController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -168,33 +168,9 @@ public function galleryAction() */ public function imageAction() { - $size = (string) $this->getRequest()->getParam('size'); - if ($size) { - $imageFile = preg_replace("#.*/catalog/product/image/size/[0-9]*x[0-9]*#", '', - $this->getRequest()->getRequestUri()); - } else { - $imageFile = preg_replace("#.*/catalog/product/image#", '', - $this->getRequest()->getRequestUri()); - } - - if (!strstr($imageFile, '.')) { - $this->_forward('noRoute'); - return; - } - - try { - $imageModel = Mage::getModel('catalog/product_image'); - $imageModel->setSize($size) - ->setBaseFile($imageFile) - /** - * Resizing has been commented because this one method are deprecated - */ - //->resize() - ->setWatermark( Mage::getStoreConfig('catalog/watermark/image') ) - ->saveFile() - ->push(); - } catch( Exception $e ) { - $this->_forward('noRoute'); - } + /* + * All logic has been cut to avoid possible malicious usage of the method + */ + $this->_forward('noRoute'); } } diff --git a/app/code/core/Mage/Catalog/controllers/Seo/SitemapController.php b/app/code/core/Mage/Catalog/controllers/Seo/SitemapController.php index 9c0d2e7b17..4286fe807d 100644 --- a/app/code/core/Mage/Catalog/controllers/Seo/SitemapController.php +++ b/app/code/core/Mage/Catalog/controllers/Seo/SitemapController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/data/catalog_setup/data-install-1.6.0.0.php b/app/code/core/Mage/Catalog/data/catalog_setup/data-install-1.6.0.0.php index ed19de87ba..51ac7c0965 100644 --- a/app/code/core/Mage/Catalog/data/catalog_setup/data-install-1.6.0.0.php +++ b/app/code/core/Mage/Catalog/data/catalog_setup/data-install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/data/catalog_setup/data-upgrade-1.6.0.0.12-1.6.0.0.13.php b/app/code/core/Mage/Catalog/data/catalog_setup/data-upgrade-1.6.0.0.12-1.6.0.0.13.php new file mode 100644 index 0000000000..1f4404eae3 --- /dev/null +++ b/app/code/core/Mage/Catalog/data/catalog_setup/data-upgrade-1.6.0.0.12-1.6.0.0.13.php @@ -0,0 +1,54 @@ +getAttribute('catalog_product', 'group_price', 'attribute_id'); +$priceAttrId = $installer->getAttribute('catalog_product', 'price', 'attribute_id'); +$connection = $installer->getConnection(); + +// update sort_order of Group Price attribute to be after Price +$select = $connection->select() + ->join( + array('t2' => $installer->getTable('eav/entity_attribute')), + 't1.attribute_group_id = t2.attribute_group_id', + array('sort_order' => new Zend_Db_Expr('t2.sort_order + 1')) + )->where('t1.attribute_id = ?', $groupPriceAttrId) + ->where('t2.attribute_id = ?', $priceAttrId); +$query = $select->crossUpdateFromSelect(array('t1' => $installer->getTable('eav/entity_attribute'))); +$connection->query($query); + +// update sort_order of all other attributes to be after Group Price +$select = $connection->select() + ->join( + array('t2' => $installer->getTable('eav/entity_attribute')), + 't1.attribute_group_id = t2.attribute_group_id', + array('sort_order' => new Zend_Db_Expr('t1.sort_order + 1')) + )->where('t1.attribute_id != ?', $groupPriceAttrId) + ->where('t1.sort_order >= t2.sort_order') + ->where('t2.attribute_id = ?', $groupPriceAttrId); +$query = $select->crossUpdateFromSelect(array('t1' => $installer->getTable('eav/entity_attribute'))); +$connection->query($query); diff --git a/app/code/core/Mage/Catalog/data/catalog_setup/data-upgrade-1.6.0.0.4-1.6.0.0.5.php b/app/code/core/Mage/Catalog/data/catalog_setup/data-upgrade-1.6.0.0.4-1.6.0.0.5.php index 9baaf4198c..f821a80ef0 100644 --- a/app/code/core/Mage/Catalog/data/catalog_setup/data-upgrade-1.6.0.0.4-1.6.0.0.5.php +++ b/app/code/core/Mage/Catalog/data/catalog_setup/data-upgrade-1.6.0.0.4-1.6.0.0.5.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/data/catalog_setup/data-upgrade-1.6.0.0.8-1.6.0.0.9.php b/app/code/core/Mage/Catalog/data/catalog_setup/data-upgrade-1.6.0.0.8-1.6.0.0.9.php index 50802de0de..2345ce06ef 100644 --- a/app/code/core/Mage/Catalog/data/catalog_setup/data-upgrade-1.6.0.0.8-1.6.0.0.9.php +++ b/app/code/core/Mage/Catalog/data/catalog_setup/data-upgrade-1.6.0.0.8-1.6.0.0.9.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/etc/adminhtml.xml b/app/code/core/Mage/Catalog/etc/adminhtml.xml index a4bd242d21..e68afaada8 100644 --- a/app/code/core/Mage/Catalog/etc/adminhtml.xml +++ b/app/code/core/Mage/Catalog/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -107,7 +107,7 @@ Update Attributes - Url Rewrite Management + URL Rewrite Management diff --git a/app/code/core/Mage/Catalog/etc/api.xml b/app/code/core/Mage/Catalog/etc/api.xml index 07044afebb..320adbd2f0 100644 --- a/app/code/core/Mage/Catalog/etc/api.xml +++ b/app/code/core/Mage/Catalog/etc/api.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Catalog/etc/config.xml b/app/code/core/Mage/Catalog/etc/config.xml index d7cda0baa2..b206ba92ac 100644 --- a/app/code/core/Mage/Catalog/etc/config.xml +++ b/app/code/core/Mage/Catalog/etc/config.xml @@ -21,14 +21,14 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> - 1.6.0.0.10 + 1.6.0.0.13 @@ -58,6 +58,13 @@ + + 1 + + + + + 1 1 @@ -452,6 +459,14 @@ + + + + catalog/observer + addCatalogToTopmenuItems + + + @@ -774,6 +789,9 @@ auto 100 10 + 0 + 9 + 1 diff --git a/app/code/core/Mage/Catalog/etc/convert.xml b/app/code/core/Mage/Catalog/etc/convert.xml index d661e84f4a..0c4face84f 100644 --- a/app/code/core/Mage/Catalog/etc/convert.xml +++ b/app/code/core/Mage/Catalog/etc/convert.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Catalog/etc/system.xml b/app/code/core/Mage/Catalog/etc/system.xml index 795301ec57..40268ec48e 100644 --- a/app/code/core/Mage/Catalog/etc/system.xml +++ b/app/code/core/Mage/Catalog/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -312,11 +312,20 @@ 1 1 + + + select + 5 + adminhtml/system_config_source_yesno + 1 + 1 + 1 + select adminhtml/system_config_source_price_step - 1 + 10 1 1 1 @@ -325,7 +334,7 @@ text validate-number validate-number-range number-range-0.01-1000000000 - 2 + 15 1 1 1 @@ -336,12 +345,34 @@ Maximum number of price intervals is 100 text validate-digits validate-digits-range digits-range-2-100 - 3 + 20 1 1 1 manual + + + This setting will be applied when all prices in the specific price interval are equal. + select + adminhtml/system_config_source_yesno + 15 + 1 + 1 + 1 + improved + + + + Please specify the number of products, that will not be divided into subintervals. + text + 20 + 1 + 1 + 1 + validate-digits validate-digits-range digits-range-1-10000 + improved + diff --git a/app/code/core/Mage/Catalog/etc/widget.xml b/app/code/core/Mage/Catalog/etc/widget.xml index e9e644136d..302a77148e 100644 --- a/app/code/core/Mage/Catalog/etc/widget.xml +++ b/app/code/core/Mage/Catalog/etc/widget.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/install-1.6.0.0.php b/app/code/core/Mage/Catalog/sql/catalog_setup/install-1.6.0.0.php index ab6cdbd098..6a4a5f0f41 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-data-upgrade-0.7.57-0.7.58.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-data-upgrade-0.7.57-0.7.58.php index 6feaaf30e9..3b3451c6a7 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-data-upgrade-0.7.57-0.7.58.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-data-upgrade-0.7.57-0.7.58.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-data-upgrade-0.7.63-0.7.64.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-data-upgrade-0.7.63-0.7.64.php index 1c76eae2e2..6c659b0c2f 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-data-upgrade-0.7.63-0.7.64.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-data-upgrade-0.7.63-0.7.64.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-data-upgrade-1.4.0.0.28-1.4.0.0.29.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-data-upgrade-1.4.0.0.28-1.4.0.0.29.php index 3f05909063..20eb53a776 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-data-upgrade-1.4.0.0.28-1.4.0.0.29.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-data-upgrade-1.4.0.0.28-1.4.0.0.29.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-data-upgrade-1.4.0.0.42-1.4.0.0.43.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-data-upgrade-1.4.0.0.42-1.4.0.0.43.php index deddc36d25..76fecb3089 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-data-upgrade-1.4.0.0.42-1.4.0.0.43.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-data-upgrade-1.4.0.0.42-1.4.0.0.43.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-install-0.7.0.php index 6bf2c410ec..f3b485495f 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-install-0.7.0.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-install-0.7.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-install-1.4.0.0.0.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-install-1.4.0.0.0.php index 88d6979554..143af14c39 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-install-1.4.0.0.0.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-install-1.4.0.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.6.40-0.7.0.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.6.40-0.7.0.php index 6e31c3ecb6..c5e091bb8a 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.6.40-0.7.0.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.6.40-0.7.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.0-0.7.1.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.0-0.7.1.php index 78c7d35ee4..2e0a207baf 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.0-0.7.1.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.0-0.7.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.1-0.7.2.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.1-0.7.2.php index 01fd6b9bf2..d793e638f8 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.1-0.7.2.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.1-0.7.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.11-0.7.12.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.11-0.7.12.php index 53f4ae982c..6b159ba117 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.11-0.7.12.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.11-0.7.12.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.12-0.7.13.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.12-0.7.13.php index 540e2fbef1..61d15ba239 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.12-0.7.13.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.12-0.7.13.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ $installer = $this; diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.13-0.7.14.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.13-0.7.14.php index 7f2be06fa1..3d6c8178a9 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.13-0.7.14.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.13-0.7.14.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.14-0.7.15.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.14-0.7.15.php index abe09fc0c9..4d6e2c945d 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.14-0.7.15.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.14-0.7.15.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ $this->startSetup()->run(" diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.15-0.7.16.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.15-0.7.16.php index 69a837124e..fac23da903 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.15-0.7.16.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.15-0.7.16.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.16-0.7.17.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.16-0.7.17.php index 540e2fbef1..61d15ba239 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.16-0.7.17.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.16-0.7.17.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ $installer = $this; diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.17-0.7.18.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.17-0.7.18.php index 7c31310eb2..5329a8ac37 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.17-0.7.18.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.17-0.7.18.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.18-0.7.19.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.18-0.7.19.php index d745f64557..c6cae6bc5c 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.18-0.7.19.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.18-0.7.19.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.19-0.7.20.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.19-0.7.20.php index 53f4ae982c..6b159ba117 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.19-0.7.20.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.19-0.7.20.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.2-0.7.3.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.2-0.7.3.php index fe4f27dcd1..baf82a1a2d 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.2-0.7.3.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.2-0.7.3.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.20-0.7.21.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.20-0.7.21.php index 72d8a63b4c..21b04bd370 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.20-0.7.21.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.20-0.7.21.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.21-0.7.22.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.21-0.7.22.php index cb62213b4d..8dc1526459 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.21-0.7.22.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.21-0.7.22.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.22-0.7.23.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.22-0.7.23.php index b8ea5e46a3..108b93da32 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.22-0.7.23.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.22-0.7.23.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.23-0.7.24.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.23-0.7.24.php index 9fbe3d7a11..24a2b0a262 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.23-0.7.24.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.23-0.7.24.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.24-0.7.25.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.24-0.7.25.php index dbdf53a88d..74219bdf96 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.24-0.7.25.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.24-0.7.25.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.25-0.7.26.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.25-0.7.26.php index dbdf53a88d..74219bdf96 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.25-0.7.26.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.25-0.7.26.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.26-0.7.27.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.26-0.7.27.php index 01edee2106..dcd5b143ba 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.26-0.7.27.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.26-0.7.27.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.27-0.7.28.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.27-0.7.28.php index de04c9e51f..2baf9aa414 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.27-0.7.28.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.27-0.7.28.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.28-0.7.29.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.28-0.7.29.php index 0ba063d5c7..48ad2d469b 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.28-0.7.29.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.28-0.7.29.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.29-0.7.30.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.29-0.7.30.php index 8c93dcf8dc..263efe4a44 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.29-0.7.30.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.29-0.7.30.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.30-0.7.31.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.30-0.7.31.php index a72ce9b841..f2a8cc3594 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.30-0.7.31.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.30-0.7.31.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.31-0.7.32.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.31-0.7.32.php index 51d2b37087..234be5041f 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.31-0.7.32.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.31-0.7.32.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.32-0.7.33.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.32-0.7.33.php index d92a1e2c51..8a0ffdffca 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.32-0.7.33.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.32-0.7.33.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.33-0.7.34.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.33-0.7.34.php index 8b9b6be773..9efcefdfe0 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.33-0.7.34.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.33-0.7.34.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.34-0.7.35.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.34-0.7.35.php index e1f48535d0..740f9ba7d1 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.34-0.7.35.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.34-0.7.35.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.35-0.7.36.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.35-0.7.36.php index a3789d007d..d8ac951111 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.35-0.7.36.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.35-0.7.36.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.36-0.7.37.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.36-0.7.37.php index 31dc90572d..6ae8bb5332 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.36-0.7.37.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.36-0.7.37.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.37-0.7.38.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.37-0.7.38.php index 3155815a04..43a8bd28cc 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.37-0.7.38.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.37-0.7.38.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.38-0.7.39.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.38-0.7.39.php index fd32195db2..7b070f0ff9 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.38-0.7.39.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.38-0.7.39.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.39-0.7.40.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.39-0.7.40.php index 2ab0af7b32..328f1243d7 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.39-0.7.40.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.39-0.7.40.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.4-0.7.5.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.4-0.7.5.php index 35b3cc6ef8..ddb10864c6 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.4-0.7.5.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.4-0.7.5.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.40-0.7.41.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.40-0.7.41.php index d1cf0d4c52..6ba40bd528 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.40-0.7.41.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.40-0.7.41.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.41-0.7.42.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.41-0.7.42.php index da47025772..6a2c44954a 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.41-0.7.42.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.41-0.7.42.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.43-0.7.44.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.43-0.7.44.php index 0034e6b0d4..5c50845669 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.43-0.7.44.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.43-0.7.44.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.44-0.7.45.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.44-0.7.45.php index 89f50a37c9..7fdf54e2dd 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.44-0.7.45.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.44-0.7.45.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.45-0.7.46.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.45-0.7.46.php index 74447cf2f6..04184ee554 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.45-0.7.46.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.45-0.7.46.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.46-0.7.47.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.46-0.7.47.php index 60408d785c..b4eae3c6e3 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.46-0.7.47.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.46-0.7.47.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.47-0.7.48.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.47-0.7.48.php index bda58a54f0..6f83b92420 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.47-0.7.48.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.47-0.7.48.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.48-0.7.49.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.48-0.7.49.php index 78b85584a4..234e74dffc 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.48-0.7.49.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.48-0.7.49.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.49-0.7.50.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.49-0.7.50.php index bf781a972d..e4c25d3fa4 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.49-0.7.50.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.49-0.7.50.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.5-0.7.6.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.5-0.7.6.php index 67e9e1381d..e0d42bd896 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.5-0.7.6.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.5-0.7.6.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.50-0.7.51.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.50-0.7.51.php index df5054c58e..1d6581dd59 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.50-0.7.51.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.50-0.7.51.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.51-0.7.52.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.51-0.7.52.php index 8ae585a8fe..6141026831 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.51-0.7.52.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.51-0.7.52.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.52-0.7.53.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.52-0.7.53.php index 4eb59833f2..8b6c35e167 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.52-0.7.53.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.52-0.7.53.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.53-0.7.54.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.53-0.7.54.php index af53b6ec0a..e18ce073d1 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.53-0.7.54.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.53-0.7.54.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.54-0.7.55.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.54-0.7.55.php index 843366d7fb..fa454443ca 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.54-0.7.55.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.54-0.7.55.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.55-0.7.56.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.55-0.7.56.php index 134c00b270..65d9764fd6 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.55-0.7.56.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.55-0.7.56.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.56-0.7.57.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.56-0.7.57.php index c005fce7c7..d25d7c4a24 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.56-0.7.57.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.56-0.7.57.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.57-0.7.58.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.57-0.7.58.php index 4a87a3785b..7c3384e801 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.57-0.7.58.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.57-0.7.58.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.58-0.7.59.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.58-0.7.59.php index 8ff901af30..332eb1c9b7 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.58-0.7.59.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.58-0.7.59.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.59-0.7.60.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.59-0.7.60.php index d498d02ba2..1eac66cf78 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.59-0.7.60.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.59-0.7.60.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.6-0.7.7.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.6-0.7.7.php index 53f4ae982c..6b159ba117 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.6-0.7.7.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.6-0.7.7.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.60-0.7.61.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.60-0.7.61.php index b6a529848c..99884744c1 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.60-0.7.61.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.60-0.7.61.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.61-0.7.62.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.61-0.7.62.php index 439a634622..79931d1d5b 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.61-0.7.62.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.61-0.7.62.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.62-0.7.63.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.62-0.7.63.php index 1941f598bc..07256041c6 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.62-0.7.63.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.62-0.7.63.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.63-0.7.64.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.63-0.7.64.php index 13cd7213cc..f0a2b1e1da 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.63-0.7.64.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.63-0.7.64.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.64-0.7.65.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.64-0.7.65.php index 3ae3beda42..93bef0550a 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.64-0.7.65.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.64-0.7.65.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.65-0.7.66.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.65-0.7.66.php index 064a314d71..b007ad0bc2 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.65-0.7.66.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.65-0.7.66.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.66-0.7.67.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.66-0.7.67.php index 037affdb44..584513525b 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.66-0.7.67.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.66-0.7.67.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.67-0.7.68.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.67-0.7.68.php index 3e5faed8eb..2398a3006e 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.67-0.7.68.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.67-0.7.68.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.68-0.7.69.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.68-0.7.69.php index 1116f829b5..8502435ef1 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.68-0.7.69.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.68-0.7.69.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.69-0.7.70.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.69-0.7.70.php index 2cf711ebb5..ee6ce6bcbf 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.69-0.7.70.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.69-0.7.70.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.7-0.7.8.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.7-0.7.8.php index 690f41ec23..94650ae427 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.7-0.7.8.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.7-0.7.8.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.70-0.7.71.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.70-0.7.71.php index 52699ea1c1..bef4ac8f77 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.70-0.7.71.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.70-0.7.71.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.71-0.7.72.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.71-0.7.72.php index 371602cbdd..e4990a2964 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.71-0.7.72.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.71-0.7.72.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.72-0.7.73.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.72-0.7.73.php index 43b803768a..c32820f650 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.72-0.7.73.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.72-0.7.73.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.73-1.4.0.0.0.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.73-1.4.0.0.0.php index 279ac3e1c2..da8816126f 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.73-1.4.0.0.0.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.73-1.4.0.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.8-0.7.9.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.8-0.7.9.php index 90e011788f..0178e98668 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.8-0.7.9.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.8-0.7.9.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.0-1.4.0.0.1.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.0-1.4.0.0.1.php index a9841093ac..d4cbcf0251 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.0-1.4.0.0.1.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.0-1.4.0.0.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.1-1.4.0.0.2.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.1-1.4.0.0.2.php index 104b1405db..8788486fbd 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.1-1.4.0.0.2.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.1-1.4.0.0.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.10-1.4.0.0.11.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.10-1.4.0.0.11.php index 2477bba491..23d58699c2 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.10-1.4.0.0.11.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.10-1.4.0.0.11.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.11-1.4.0.0.12.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.11-1.4.0.0.12.php index 8db9134557..ffd7a2b450 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.11-1.4.0.0.12.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.11-1.4.0.0.12.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.12-1.4.0.0.13.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.12-1.4.0.0.13.php index 9d59d50359..4f4a78be6f 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.12-1.4.0.0.13.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.12-1.4.0.0.13.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.13-1.4.0.0.14.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.13-1.4.0.0.14.php index c8013e91bd..d3a6f2ebeb 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.13-1.4.0.0.14.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.13-1.4.0.0.14.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.14-1.4.0.0.15.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.14-1.4.0.0.15.php index 76dfc35c19..8d066ea7f2 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.14-1.4.0.0.15.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.14-1.4.0.0.15.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.15-1.4.0.0.16.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.15-1.4.0.0.16.php index c3e37708f7..c398ceb406 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.15-1.4.0.0.16.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.15-1.4.0.0.16.php @@ -20,6 +20,6 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.16-1.4.0.0.17.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.16-1.4.0.0.17.php index de686afb13..d20800cc5b 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.16-1.4.0.0.17.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.16-1.4.0.0.17.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.17-1.4.0.0.18.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.17-1.4.0.0.18.php index 3071c0117a..cbd6fca98b 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.17-1.4.0.0.18.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.17-1.4.0.0.18.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.18-1.4.0.0.19.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.18-1.4.0.0.19.php index 25feae14c4..6a09b547dc 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.18-1.4.0.0.19.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.18-1.4.0.0.19.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.19-1.4.0.0.20.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.19-1.4.0.0.20.php index 88f3d1ac7e..855eb62d51 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.19-1.4.0.0.20.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.19-1.4.0.0.20.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.2-1.4.0.0.3.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.2-1.4.0.0.3.php index 8ab4cfc1d6..49251502e7 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.2-1.4.0.0.3.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.2-1.4.0.0.3.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.20-1.4.0.0.21.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.20-1.4.0.0.21.php index 5ca7ebe451..823bcd4665 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.20-1.4.0.0.21.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.20-1.4.0.0.21.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.21-1.4.0.0.22.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.21-1.4.0.0.22.php index 6fbc9cf2eb..b9a6731121 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.21-1.4.0.0.22.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.21-1.4.0.0.22.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.22-1.4.0.0.23.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.22-1.4.0.0.23.php index 3216db631a..45c2e1bb05 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.22-1.4.0.0.23.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.22-1.4.0.0.23.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.23-1.4.0.0.24.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.23-1.4.0.0.24.php index 9f9ccbe190..529666bac2 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.23-1.4.0.0.24.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.23-1.4.0.0.24.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.24-1.4.0.0.25.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.24-1.4.0.0.25.php index 4d33dba8f5..43e35eb752 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.24-1.4.0.0.25.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.24-1.4.0.0.25.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.25-1.4.0.0.26.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.25-1.4.0.0.26.php index b40ff8e5f9..63964214fb 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.25-1.4.0.0.26.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.25-1.4.0.0.26.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.26-1.4.0.0.27.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.26-1.4.0.0.27.php index a289453e05..0997f08a0f 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.26-1.4.0.0.27.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.26-1.4.0.0.27.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.27-1.4.0.0.28.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.27-1.4.0.0.28.php index 02b947582b..2e26829c4d 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.27-1.4.0.0.28.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.27-1.4.0.0.28.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.28-1.4.0.0.29.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.28-1.4.0.0.29.php index 4cde6df1a0..00c4c9209c 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.28-1.4.0.0.29.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.28-1.4.0.0.29.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.3-1.4.0.0.4.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.3-1.4.0.0.4.php index a91dc113a8..2850d3c5dc 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.3-1.4.0.0.4.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.3-1.4.0.0.4.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.30-1.4.0.0.31.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.30-1.4.0.0.31.php index b700014d1f..99bedc24be 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.30-1.4.0.0.31.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.30-1.4.0.0.31.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.31-1.4.0.0.32.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.31-1.4.0.0.32.php index 046bdbf242..94239f7a86 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.31-1.4.0.0.32.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.31-1.4.0.0.32.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.32-1.4.0.0.33.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.32-1.4.0.0.33.php index a643d749cf..3895c4381b 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.32-1.4.0.0.33.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.32-1.4.0.0.33.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.33-1.4.0.0.34.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.33-1.4.0.0.34.php index 9836d22647..0050f252fe 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.33-1.4.0.0.34.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.33-1.4.0.0.34.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.34-1.4.0.0.35.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.34-1.4.0.0.35.php index 98241accba..6cd10fce58 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.34-1.4.0.0.35.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.34-1.4.0.0.35.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.35-1.4.0.0.36.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.35-1.4.0.0.36.php index b33ceb4e93..b53c70960d 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.35-1.4.0.0.36.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.35-1.4.0.0.36.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.36-1.4.0.0.37.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.36-1.4.0.0.37.php index 567fcf53be..19644cb5b9 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.36-1.4.0.0.37.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.36-1.4.0.0.37.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.37-1.4.0.0.38.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.37-1.4.0.0.38.php index 792468a94e..f82cdd045d 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.37-1.4.0.0.38.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.37-1.4.0.0.38.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.38-1.4.0.0.39.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.38-1.4.0.0.39.php index e9c4800c03..e44df89686 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.38-1.4.0.0.39.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.38-1.4.0.0.39.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.39-1.4.0.0.40.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.39-1.4.0.0.40.php index 2aacd514c7..9ca8704fe2 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.39-1.4.0.0.40.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.39-1.4.0.0.40.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.4-1.4.0.0.5.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.4-1.4.0.0.5.php index 0e538319bd..d9599bfc52 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.4-1.4.0.0.5.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.4-1.4.0.0.5.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.40-1.4.0.0.41.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.40-1.4.0.0.41.php index 0550111a49..4a13b39de0 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.40-1.4.0.0.41.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.40-1.4.0.0.41.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.41-1.4.0.0.42.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.41-1.4.0.0.42.php index e72953925d..1b46888ef1 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.41-1.4.0.0.42.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.41-1.4.0.0.42.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.43-1.4.0.0.44.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.43-1.4.0.0.44.php index 64738d26ba..bf023b9138 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.43-1.4.0.0.44.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.43-1.4.0.0.44.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.5-1.4.0.0.6.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.5-1.4.0.0.6.php index cf41288ac9..367c23e70b 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.5-1.4.0.0.6.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.5-1.4.0.0.6.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.6-1.4.0.0.7.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.6-1.4.0.0.7.php index 80f263bb08..fb5f015dcb 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.6-1.4.0.0.7.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.6-1.4.0.0.7.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.7-1.4.0.0.8.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.7-1.4.0.0.8.php index 3246f8712c..ab462eb2f0 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.7-1.4.0.0.8.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.7-1.4.0.0.8.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.8-1.4.0.0.9.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.8-1.4.0.0.9.php index 1c27fd369d..25e95f06ee 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.8-1.4.0.0.9.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.8-1.4.0.0.9.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.9-1.4.0.0.10.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.9-1.4.0.0.10.php index 56c56f08ff..923eaf03ae 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.9-1.4.0.0.10.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.9-1.4.0.0.10.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php index 13772d2c76..87c8e9f155 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.6.0.0.8-1.6.0.0.9.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.6.0.0.8-1.6.0.0.9.php index 3a89478cb0..ed210231df 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.6.0.0.8-1.6.0.0.9.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.6.0.0.8-1.6.0.0.9.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0-1.6.0.0.1.php b/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0-1.6.0.0.1.php index 7061c88bbe..dd5d9f89f3 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0-1.6.0.0.1.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0-1.6.0.0.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.1-1.6.0.0.2.php b/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.1-1.6.0.0.2.php index 522b96ee98..898c076ed6 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.1-1.6.0.0.2.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.1-1.6.0.0.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.10-1.6.0.0.11.php b/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.10-1.6.0.0.11.php new file mode 100644 index 0000000000..05161ad2d0 --- /dev/null +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.10-1.6.0.0.11.php @@ -0,0 +1,31 @@ +getAttribute('catalog_product', 'group_price', 'attribute_id'); +$installer->updateAttribute('catalog_product', $attributeId, array(), null, 5); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.11-1.6.0.0.12.php b/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.11-1.6.0.0.12.php new file mode 100644 index 0000000000..c678196d33 --- /dev/null +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.11-1.6.0.0.12.php @@ -0,0 +1,34 @@ +getConnection()->addIndex( + $installer->getTable('catalog/product_index_price'), + $installer->getIdxName('catalog/product_index_price', $indexFields), + $indexFields +); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.2-1.6.0.0.3.php b/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.2-1.6.0.0.3.php index 445f538029..5e8151862e 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.2-1.6.0.0.3.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.2-1.6.0.0.3.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.3-1.6.0.0.4.php b/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.3-1.6.0.0.4.php index 4ecfda9f4a..46bc9414fa 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.3-1.6.0.0.4.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.3-1.6.0.0.4.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.4-1.6.0.0.5.php b/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.4-1.6.0.0.5.php index a46c66111a..8177b80d6b 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.4-1.6.0.0.5.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.4-1.6.0.0.5.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.5-1.6.0.0.6.php b/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.5-1.6.0.0.6.php index fd578cc350..b3468b6cd5 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.5-1.6.0.0.6.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.5-1.6.0.0.6.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.6-1.6.0.0.7.php b/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.6-1.6.0.0.7.php index 9410d26110..94701a30af 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.6-1.6.0.0.7.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.6-1.6.0.0.7.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.7-1.6.0.0.8.php b/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.7-1.6.0.0.8.php index 0cb3b8af9f..a1b98173ba 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.7-1.6.0.0.8.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.7-1.6.0.0.8.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.9-1.6.0.0.10.php b/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.9-1.6.0.0.10.php index 3d9b6b45bd..d812852a40 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.9-1.6.0.0.10.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.9-1.6.0.0.10.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/Model/Aggregation.php b/app/code/core/Mage/CatalogIndex/Model/Aggregation.php index 380ceaa94d..833df3431f 100644 --- a/app/code/core/Mage/CatalogIndex/Model/Aggregation.php +++ b/app/code/core/Mage/CatalogIndex/Model/Aggregation.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/Model/Attribute.php b/app/code/core/Mage/CatalogIndex/Model/Attribute.php index b3242cb281..35ebbf5cb3 100644 --- a/app/code/core/Mage/CatalogIndex/Model/Attribute.php +++ b/app/code/core/Mage/CatalogIndex/Model/Attribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/Model/Catalog/Index/Flag.php b/app/code/core/Mage/CatalogIndex/Model/Catalog/Index/Flag.php index 030faef71f..a5e2bede21 100644 --- a/app/code/core/Mage/CatalogIndex/Model/Catalog/Index/Flag.php +++ b/app/code/core/Mage/CatalogIndex/Model/Catalog/Index/Flag.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/Model/Catalog/Index/Kill/Flag.php b/app/code/core/Mage/CatalogIndex/Model/Catalog/Index/Kill/Flag.php index 20ff328fbf..5277149d20 100644 --- a/app/code/core/Mage/CatalogIndex/Model/Catalog/Index/Kill/Flag.php +++ b/app/code/core/Mage/CatalogIndex/Model/Catalog/Index/Kill/Flag.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/Model/Data/Abstract.php b/app/code/core/Mage/CatalogIndex/Model/Data/Abstract.php index 015c775794..c144734ec6 100644 --- a/app/code/core/Mage/CatalogIndex/Model/Data/Abstract.php +++ b/app/code/core/Mage/CatalogIndex/Model/Data/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/Model/Data/Configurable.php b/app/code/core/Mage/CatalogIndex/Model/Data/Configurable.php index a7c092d0fc..eb6a2a6770 100644 --- a/app/code/core/Mage/CatalogIndex/Model/Data/Configurable.php +++ b/app/code/core/Mage/CatalogIndex/Model/Data/Configurable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/Model/Data/Grouped.php b/app/code/core/Mage/CatalogIndex/Model/Data/Grouped.php index ccbad03c72..7d694155bc 100644 --- a/app/code/core/Mage/CatalogIndex/Model/Data/Grouped.php +++ b/app/code/core/Mage/CatalogIndex/Model/Data/Grouped.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/Model/Data/Simple.php b/app/code/core/Mage/CatalogIndex/Model/Data/Simple.php index 203c82f492..956d12e24a 100644 --- a/app/code/core/Mage/CatalogIndex/Model/Data/Simple.php +++ b/app/code/core/Mage/CatalogIndex/Model/Data/Simple.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/Model/Data/Virtual.php b/app/code/core/Mage/CatalogIndex/Model/Data/Virtual.php index 90902cbd9b..8f590d6ec5 100644 --- a/app/code/core/Mage/CatalogIndex/Model/Data/Virtual.php +++ b/app/code/core/Mage/CatalogIndex/Model/Data/Virtual.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/Model/Indexer.php b/app/code/core/Mage/CatalogIndex/Model/Indexer.php index 4e0d63c1a2..f50bad0767 100644 --- a/app/code/core/Mage/CatalogIndex/Model/Indexer.php +++ b/app/code/core/Mage/CatalogIndex/Model/Indexer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/Model/Indexer/Abstract.php b/app/code/core/Mage/CatalogIndex/Model/Indexer/Abstract.php index b516141019..33c1b2a0f5 100644 --- a/app/code/core/Mage/CatalogIndex/Model/Indexer/Abstract.php +++ b/app/code/core/Mage/CatalogIndex/Model/Indexer/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/Model/Indexer/Eav.php b/app/code/core/Mage/CatalogIndex/Model/Indexer/Eav.php index 56012946cf..c77f21df40 100644 --- a/app/code/core/Mage/CatalogIndex/Model/Indexer/Eav.php +++ b/app/code/core/Mage/CatalogIndex/Model/Indexer/Eav.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/Model/Indexer/Interface.php b/app/code/core/Mage/CatalogIndex/Model/Indexer/Interface.php index 5ef4751350..229efa853a 100644 --- a/app/code/core/Mage/CatalogIndex/Model/Indexer/Interface.php +++ b/app/code/core/Mage/CatalogIndex/Model/Indexer/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/Model/Indexer/Minimalprice.php b/app/code/core/Mage/CatalogIndex/Model/Indexer/Minimalprice.php index 3dddaf5c5d..14e5d91db5 100644 --- a/app/code/core/Mage/CatalogIndex/Model/Indexer/Minimalprice.php +++ b/app/code/core/Mage/CatalogIndex/Model/Indexer/Minimalprice.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/Model/Indexer/Price.php b/app/code/core/Mage/CatalogIndex/Model/Indexer/Price.php index cf95d4eb49..090d2404ec 100644 --- a/app/code/core/Mage/CatalogIndex/Model/Indexer/Price.php +++ b/app/code/core/Mage/CatalogIndex/Model/Indexer/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/Model/Indexer/Tierprice.php b/app/code/core/Mage/CatalogIndex/Model/Indexer/Tierprice.php index 4e2dd30ab5..d8d745e547 100644 --- a/app/code/core/Mage/CatalogIndex/Model/Indexer/Tierprice.php +++ b/app/code/core/Mage/CatalogIndex/Model/Indexer/Tierprice.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/Model/Mysql4/Abstract.php b/app/code/core/Mage/CatalogIndex/Model/Mysql4/Abstract.php index c55af91ab0..9bdcc5973e 100644 --- a/app/code/core/Mage/CatalogIndex/Model/Mysql4/Abstract.php +++ b/app/code/core/Mage/CatalogIndex/Model/Mysql4/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/Model/Mysql4/Aggregation.php b/app/code/core/Mage/CatalogIndex/Model/Mysql4/Aggregation.php index 364e667897..f9fc10cbb7 100644 --- a/app/code/core/Mage/CatalogIndex/Model/Mysql4/Aggregation.php +++ b/app/code/core/Mage/CatalogIndex/Model/Mysql4/Aggregation.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/Model/Mysql4/Attribute.php b/app/code/core/Mage/CatalogIndex/Model/Mysql4/Attribute.php index 59c2e67656..11609da5e9 100644 --- a/app/code/core/Mage/CatalogIndex/Model/Mysql4/Attribute.php +++ b/app/code/core/Mage/CatalogIndex/Model/Mysql4/Attribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/Model/Mysql4/Data/Abstract.php b/app/code/core/Mage/CatalogIndex/Model/Mysql4/Data/Abstract.php index 68375eeea5..92eb437dd3 100644 --- a/app/code/core/Mage/CatalogIndex/Model/Mysql4/Data/Abstract.php +++ b/app/code/core/Mage/CatalogIndex/Model/Mysql4/Data/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/Model/Mysql4/Data/Configurable.php b/app/code/core/Mage/CatalogIndex/Model/Mysql4/Data/Configurable.php index 85e2ecd48d..8246ba6dde 100644 --- a/app/code/core/Mage/CatalogIndex/Model/Mysql4/Data/Configurable.php +++ b/app/code/core/Mage/CatalogIndex/Model/Mysql4/Data/Configurable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/Model/Mysql4/Data/Grouped.php b/app/code/core/Mage/CatalogIndex/Model/Mysql4/Data/Grouped.php index d0cbbab81e..ea9368e674 100644 --- a/app/code/core/Mage/CatalogIndex/Model/Mysql4/Data/Grouped.php +++ b/app/code/core/Mage/CatalogIndex/Model/Mysql4/Data/Grouped.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/Model/Mysql4/Indexer.php b/app/code/core/Mage/CatalogIndex/Model/Mysql4/Indexer.php index 2a6a930bdf..24a998c0fa 100644 --- a/app/code/core/Mage/CatalogIndex/Model/Mysql4/Indexer.php +++ b/app/code/core/Mage/CatalogIndex/Model/Mysql4/Indexer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/Model/Mysql4/Indexer/Abstract.php b/app/code/core/Mage/CatalogIndex/Model/Mysql4/Indexer/Abstract.php index 46d4dea0ec..80ce8a1a4b 100644 --- a/app/code/core/Mage/CatalogIndex/Model/Mysql4/Indexer/Abstract.php +++ b/app/code/core/Mage/CatalogIndex/Model/Mysql4/Indexer/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/Model/Mysql4/Indexer/Eav.php b/app/code/core/Mage/CatalogIndex/Model/Mysql4/Indexer/Eav.php index b010796d92..fe684018d1 100644 --- a/app/code/core/Mage/CatalogIndex/Model/Mysql4/Indexer/Eav.php +++ b/app/code/core/Mage/CatalogIndex/Model/Mysql4/Indexer/Eav.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/Model/Mysql4/Indexer/Minimalprice.php b/app/code/core/Mage/CatalogIndex/Model/Mysql4/Indexer/Minimalprice.php index 7a4d694d97..9cc25c83a5 100644 --- a/app/code/core/Mage/CatalogIndex/Model/Mysql4/Indexer/Minimalprice.php +++ b/app/code/core/Mage/CatalogIndex/Model/Mysql4/Indexer/Minimalprice.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/Model/Mysql4/Indexer/Price.php b/app/code/core/Mage/CatalogIndex/Model/Mysql4/Indexer/Price.php index 53b74c0571..a3888b5fae 100644 --- a/app/code/core/Mage/CatalogIndex/Model/Mysql4/Indexer/Price.php +++ b/app/code/core/Mage/CatalogIndex/Model/Mysql4/Indexer/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/Model/Mysql4/Price.php b/app/code/core/Mage/CatalogIndex/Model/Mysql4/Price.php index 73bdd1c711..6f3a6de33a 100644 --- a/app/code/core/Mage/CatalogIndex/Model/Mysql4/Price.php +++ b/app/code/core/Mage/CatalogIndex/Model/Mysql4/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/Model/Mysql4/Retreiver.php b/app/code/core/Mage/CatalogIndex/Model/Mysql4/Retreiver.php index 69333eaa57..01ecb6acc0 100644 --- a/app/code/core/Mage/CatalogIndex/Model/Mysql4/Retreiver.php +++ b/app/code/core/Mage/CatalogIndex/Model/Mysql4/Retreiver.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/Model/Mysql4/Setup.php b/app/code/core/Mage/CatalogIndex/Model/Mysql4/Setup.php index c79aa20948..bcf18c36e5 100644 --- a/app/code/core/Mage/CatalogIndex/Model/Mysql4/Setup.php +++ b/app/code/core/Mage/CatalogIndex/Model/Mysql4/Setup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/Model/Observer.php b/app/code/core/Mage/CatalogIndex/Model/Observer.php index 77d4637832..233ca49f50 100644 --- a/app/code/core/Mage/CatalogIndex/Model/Observer.php +++ b/app/code/core/Mage/CatalogIndex/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/Model/Price.php b/app/code/core/Mage/CatalogIndex/Model/Price.php index af73f50098..5e0729fa8d 100644 --- a/app/code/core/Mage/CatalogIndex/Model/Price.php +++ b/app/code/core/Mage/CatalogIndex/Model/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/Model/Resource/Abstract.php b/app/code/core/Mage/CatalogIndex/Model/Resource/Abstract.php index e4830d5d4f..b566d4e879 100755 --- a/app/code/core/Mage/CatalogIndex/Model/Resource/Abstract.php +++ b/app/code/core/Mage/CatalogIndex/Model/Resource/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/Model/Resource/Aggregation.php b/app/code/core/Mage/CatalogIndex/Model/Resource/Aggregation.php index b4026c9c8a..0f0f7bc967 100755 --- a/app/code/core/Mage/CatalogIndex/Model/Resource/Aggregation.php +++ b/app/code/core/Mage/CatalogIndex/Model/Resource/Aggregation.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/Model/Resource/Attribute.php b/app/code/core/Mage/CatalogIndex/Model/Resource/Attribute.php index 411cb3583e..8e5d69ea9c 100755 --- a/app/code/core/Mage/CatalogIndex/Model/Resource/Attribute.php +++ b/app/code/core/Mage/CatalogIndex/Model/Resource/Attribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/Model/Resource/Data/Abstract.php b/app/code/core/Mage/CatalogIndex/Model/Resource/Data/Abstract.php index 2c844b6611..04b30c4e32 100755 --- a/app/code/core/Mage/CatalogIndex/Model/Resource/Data/Abstract.php +++ b/app/code/core/Mage/CatalogIndex/Model/Resource/Data/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/Model/Resource/Data/Configurable.php b/app/code/core/Mage/CatalogIndex/Model/Resource/Data/Configurable.php index 9b43003ded..bda85155a1 100755 --- a/app/code/core/Mage/CatalogIndex/Model/Resource/Data/Configurable.php +++ b/app/code/core/Mage/CatalogIndex/Model/Resource/Data/Configurable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/Model/Resource/Data/Grouped.php b/app/code/core/Mage/CatalogIndex/Model/Resource/Data/Grouped.php index b02910e711..40e411dec1 100755 --- a/app/code/core/Mage/CatalogIndex/Model/Resource/Data/Grouped.php +++ b/app/code/core/Mage/CatalogIndex/Model/Resource/Data/Grouped.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/Model/Resource/Indexer.php b/app/code/core/Mage/CatalogIndex/Model/Resource/Indexer.php index d8164471af..8218c50b99 100755 --- a/app/code/core/Mage/CatalogIndex/Model/Resource/Indexer.php +++ b/app/code/core/Mage/CatalogIndex/Model/Resource/Indexer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/Model/Resource/Indexer/Abstract.php b/app/code/core/Mage/CatalogIndex/Model/Resource/Indexer/Abstract.php index 92e46acf54..c14abda7b1 100755 --- a/app/code/core/Mage/CatalogIndex/Model/Resource/Indexer/Abstract.php +++ b/app/code/core/Mage/CatalogIndex/Model/Resource/Indexer/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/Model/Resource/Indexer/Eav.php b/app/code/core/Mage/CatalogIndex/Model/Resource/Indexer/Eav.php index a57a9609f9..ec53e3b311 100755 --- a/app/code/core/Mage/CatalogIndex/Model/Resource/Indexer/Eav.php +++ b/app/code/core/Mage/CatalogIndex/Model/Resource/Indexer/Eav.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/Model/Resource/Indexer/Minimalprice.php b/app/code/core/Mage/CatalogIndex/Model/Resource/Indexer/Minimalprice.php index 7345fb132f..4d68907a5d 100755 --- a/app/code/core/Mage/CatalogIndex/Model/Resource/Indexer/Minimalprice.php +++ b/app/code/core/Mage/CatalogIndex/Model/Resource/Indexer/Minimalprice.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/Model/Resource/Indexer/Price.php b/app/code/core/Mage/CatalogIndex/Model/Resource/Indexer/Price.php index 36a00c35fe..2ca0a40f11 100755 --- a/app/code/core/Mage/CatalogIndex/Model/Resource/Indexer/Price.php +++ b/app/code/core/Mage/CatalogIndex/Model/Resource/Indexer/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/Model/Resource/Price.php b/app/code/core/Mage/CatalogIndex/Model/Resource/Price.php index 0efdb50c9e..54dded506c 100755 --- a/app/code/core/Mage/CatalogIndex/Model/Resource/Price.php +++ b/app/code/core/Mage/CatalogIndex/Model/Resource/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/Model/Resource/Retreiver.php b/app/code/core/Mage/CatalogIndex/Model/Resource/Retreiver.php index 1bbbc7e45c..cd793480e9 100755 --- a/app/code/core/Mage/CatalogIndex/Model/Resource/Retreiver.php +++ b/app/code/core/Mage/CatalogIndex/Model/Resource/Retreiver.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/Model/Resource/Setup.php b/app/code/core/Mage/CatalogIndex/Model/Resource/Setup.php index 3801a70d70..071ed24c16 100755 --- a/app/code/core/Mage/CatalogIndex/Model/Resource/Setup.php +++ b/app/code/core/Mage/CatalogIndex/Model/Resource/Setup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/Model/Retreiver.php b/app/code/core/Mage/CatalogIndex/Model/Retreiver.php index 56895c8a67..df9c53989e 100644 --- a/app/code/core/Mage/CatalogIndex/Model/Retreiver.php +++ b/app/code/core/Mage/CatalogIndex/Model/Retreiver.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/etc/config.xml b/app/code/core/Mage/CatalogIndex/etc/config.xml index 6abeb397c0..d601d8f517 100644 --- a/app/code/core/Mage/CatalogIndex/etc/config.xml +++ b/app/code/core/Mage/CatalogIndex/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/install-1.6.0.0.php b/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/install-1.6.0.0.php index fdb1df2f3d..724bbd9efc 100644 --- a/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-install-0.7.0.php index ab666a45ca..9c23c10284 100644 --- a/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-install-0.7.0.php +++ b/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-install-0.7.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.0-0.7.1.php b/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.0-0.7.1.php index e7e6c70f80..4ca081eb88 100644 --- a/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.0-0.7.1.php +++ b/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.0-0.7.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.1-0.7.2.php b/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.1-0.7.2.php index 71017f251c..6877f280f6 100644 --- a/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.1-0.7.2.php +++ b/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.1-0.7.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.2-0.7.3.php b/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.2-0.7.3.php index 99f9287439..0ac0e252bd 100644 --- a/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.2-0.7.3.php +++ b/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.2-0.7.3.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.3-0.7.4.php b/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.3-0.7.4.php index cf29d5ee11..8b9b44dc06 100644 --- a/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.3-0.7.4.php +++ b/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.3-0.7.4.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.4-0.7.5.php b/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.4-0.7.5.php index 9a89156fd4..37606167bb 100644 --- a/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.4-0.7.5.php +++ b/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.4-0.7.5.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.5-0.7.6.php b/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.5-0.7.6.php index f59d3d365d..0a91b126e4 100644 --- a/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.5-0.7.6.php +++ b/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.5-0.7.6.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.6-0.7.7.php b/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.6-0.7.7.php index d31e69e90b..818f23b9ba 100644 --- a/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.6-0.7.7.php +++ b/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.6-0.7.7.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.7-0.7.8.php b/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.7-0.7.8.php index 2fa8f01642..f49b596f26 100644 --- a/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.7-0.7.8.php +++ b/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.7-0.7.8.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.8-0.7.9.php b/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.8-0.7.9.php index c72ff88f1d..5973ceeeb6 100644 --- a/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.8-0.7.9.php +++ b/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.8-0.7.9.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.9-0.7.10.php b/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.9-0.7.10.php index 14aaf2e636..ce1c8d0249 100644 --- a/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.9-0.7.10.php +++ b/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-0.7.9-0.7.10.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php index 385eadb55b..399231cb0c 100644 --- a/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ b/app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogIndex - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Block/Adminhtml/Form/Field/Customergroup.php b/app/code/core/Mage/CatalogInventory/Block/Adminhtml/Form/Field/Customergroup.php index e1a0fddf5c..a02856a5d5 100644 --- a/app/code/core/Mage/CatalogInventory/Block/Adminhtml/Form/Field/Customergroup.php +++ b/app/code/core/Mage/CatalogInventory/Block/Adminhtml/Form/Field/Customergroup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Block/Adminhtml/Form/Field/Minsaleqty.php b/app/code/core/Mage/CatalogInventory/Block/Adminhtml/Form/Field/Minsaleqty.php index 3859a0a0ea..243933541b 100644 --- a/app/code/core/Mage/CatalogInventory/Block/Adminhtml/Form/Field/Minsaleqty.php +++ b/app/code/core/Mage/CatalogInventory/Block/Adminhtml/Form/Field/Minsaleqty.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Block/Qtyincrements.php b/app/code/core/Mage/CatalogInventory/Block/Qtyincrements.php index 30ae4b9ba8..9b31c74fb9 100644 --- a/app/code/core/Mage/CatalogInventory/Block/Qtyincrements.php +++ b/app/code/core/Mage/CatalogInventory/Block/Qtyincrements.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Block/Stockqty/Abstract.php b/app/code/core/Mage/CatalogInventory/Block/Stockqty/Abstract.php index 8eb3caa7ee..92c2b2ce7f 100644 --- a/app/code/core/Mage/CatalogInventory/Block/Stockqty/Abstract.php +++ b/app/code/core/Mage/CatalogInventory/Block/Stockqty/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Block/Stockqty/Composite.php b/app/code/core/Mage/CatalogInventory/Block/Stockqty/Composite.php index fa27818018..7764cfa676 100644 --- a/app/code/core/Mage/CatalogInventory/Block/Stockqty/Composite.php +++ b/app/code/core/Mage/CatalogInventory/Block/Stockqty/Composite.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Block/Stockqty/Default.php b/app/code/core/Mage/CatalogInventory/Block/Stockqty/Default.php index a49c189822..693b75e9f0 100644 --- a/app/code/core/Mage/CatalogInventory/Block/Stockqty/Default.php +++ b/app/code/core/Mage/CatalogInventory/Block/Stockqty/Default.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Block/Stockqty/Type/Configurable.php b/app/code/core/Mage/CatalogInventory/Block/Stockqty/Type/Configurable.php index 69c47d2773..091dc13b89 100644 --- a/app/code/core/Mage/CatalogInventory/Block/Stockqty/Type/Configurable.php +++ b/app/code/core/Mage/CatalogInventory/Block/Stockqty/Type/Configurable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Block/Stockqty/Type/Grouped.php b/app/code/core/Mage/CatalogInventory/Block/Stockqty/Type/Grouped.php index 09a40c590d..0a8602e42e 100644 --- a/app/code/core/Mage/CatalogInventory/Block/Stockqty/Type/Grouped.php +++ b/app/code/core/Mage/CatalogInventory/Block/Stockqty/Type/Grouped.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Helper/Data.php b/app/code/core/Mage/CatalogInventory/Helper/Data.php index de1f66b7f6..42fef0b323 100644 --- a/app/code/core/Mage/CatalogInventory/Helper/Data.php +++ b/app/code/core/Mage/CatalogInventory/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -103,6 +103,7 @@ public function getConfigItemOptions() 'manage_stock', 'enable_qty_increments', 'qty_increments', + 'is_decimal_divided', ); } diff --git a/app/code/core/Mage/CatalogInventory/Helper/Minsaleqty.php b/app/code/core/Mage/CatalogInventory/Helper/Minsaleqty.php index 108e994ff5..da39239eca 100644 --- a/app/code/core/Mage/CatalogInventory/Helper/Minsaleqty.php +++ b/app/code/core/Mage/CatalogInventory/Helper/Minsaleqty.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Model/Indexer/Stock.php b/app/code/core/Mage/CatalogInventory/Model/Indexer/Stock.php index 67e69eeba0..d4869156c6 100644 --- a/app/code/core/Mage/CatalogInventory/Model/Indexer/Stock.php +++ b/app/code/core/Mage/CatalogInventory/Model/Indexer/Stock.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -270,7 +270,12 @@ protected function _registerStockItemSaveEvent(Mage_Index_Model_Event $event) // Saving stock item without product object // Register re-index price process if products out of stock hidden on Front-end if (!Mage::helper('cataloginventory')->isShowOutOfStock() && !$object->getProduct()) { - $event->addNewData('force_reindex_required', 1); + $massObject = new Varien_Object(); + $massObject->setAttributesData(array('force_reindex_required' => 1)); + $massObject->setProductIds(array($object->getProductId())); + Mage::getSingleton('index/indexer')->logEvent( + $massObject, Mage_Catalog_Model_Product::ENTITY, Mage_Index_Model_Event::TYPE_MASS_ACTION + ); } return $this; diff --git a/app/code/core/Mage/CatalogInventory/Model/Mysql4/Indexer/Stock.php b/app/code/core/Mage/CatalogInventory/Model/Mysql4/Indexer/Stock.php index 4acbb00e49..6b286622c9 100644 --- a/app/code/core/Mage/CatalogInventory/Model/Mysql4/Indexer/Stock.php +++ b/app/code/core/Mage/CatalogInventory/Model/Mysql4/Indexer/Stock.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Model/Mysql4/Indexer/Stock/Configurable.php b/app/code/core/Mage/CatalogInventory/Model/Mysql4/Indexer/Stock/Configurable.php index e9ce77f720..fd7a3e4c90 100644 --- a/app/code/core/Mage/CatalogInventory/Model/Mysql4/Indexer/Stock/Configurable.php +++ b/app/code/core/Mage/CatalogInventory/Model/Mysql4/Indexer/Stock/Configurable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Model/Mysql4/Indexer/Stock/Default.php b/app/code/core/Mage/CatalogInventory/Model/Mysql4/Indexer/Stock/Default.php index 4b52c6f8f2..9b2a8521b2 100644 --- a/app/code/core/Mage/CatalogInventory/Model/Mysql4/Indexer/Stock/Default.php +++ b/app/code/core/Mage/CatalogInventory/Model/Mysql4/Indexer/Stock/Default.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Model/Mysql4/Indexer/Stock/Grouped.php b/app/code/core/Mage/CatalogInventory/Model/Mysql4/Indexer/Stock/Grouped.php index a65c118618..4c4d97231c 100644 --- a/app/code/core/Mage/CatalogInventory/Model/Mysql4/Indexer/Stock/Grouped.php +++ b/app/code/core/Mage/CatalogInventory/Model/Mysql4/Indexer/Stock/Grouped.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Model/Mysql4/Indexer/Stock/Interface.php b/app/code/core/Mage/CatalogInventory/Model/Mysql4/Indexer/Stock/Interface.php index fdd6ec2d85..2cee377b79 100644 --- a/app/code/core/Mage/CatalogInventory/Model/Mysql4/Indexer/Stock/Interface.php +++ b/app/code/core/Mage/CatalogInventory/Model/Mysql4/Indexer/Stock/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Model/Mysql4/Stock.php b/app/code/core/Mage/CatalogInventory/Model/Mysql4/Stock.php index 9e6c79ebd5..bb5b2081be 100644 --- a/app/code/core/Mage/CatalogInventory/Model/Mysql4/Stock.php +++ b/app/code/core/Mage/CatalogInventory/Model/Mysql4/Stock.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Model/Mysql4/Stock/Item.php b/app/code/core/Mage/CatalogInventory/Model/Mysql4/Stock/Item.php index e8b529c3c7..8b6b8ca8fb 100644 --- a/app/code/core/Mage/CatalogInventory/Model/Mysql4/Stock/Item.php +++ b/app/code/core/Mage/CatalogInventory/Model/Mysql4/Stock/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Model/Mysql4/Stock/Item/Collection.php b/app/code/core/Mage/CatalogInventory/Model/Mysql4/Stock/Item/Collection.php index 326bfe4ae1..8847bc8589 100644 --- a/app/code/core/Mage/CatalogInventory/Model/Mysql4/Stock/Item/Collection.php +++ b/app/code/core/Mage/CatalogInventory/Model/Mysql4/Stock/Item/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Model/Mysql4/Stock/Status.php b/app/code/core/Mage/CatalogInventory/Model/Mysql4/Stock/Status.php index 610c0f5675..7069572ef0 100644 --- a/app/code/core/Mage/CatalogInventory/Model/Mysql4/Stock/Status.php +++ b/app/code/core/Mage/CatalogInventory/Model/Mysql4/Stock/Status.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Model/Observer.php b/app/code/core/Mage/CatalogInventory/Model/Observer.php index 9e34f05ae1..4c819a3706 100644 --- a/app/code/core/Mage/CatalogInventory/Model/Observer.php +++ b/app/code/core/Mage/CatalogInventory/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -256,7 +256,28 @@ protected function _removeErrorsFromQuoteAndItem($item, $code) } $quote = $item->getQuote(); - if ($quote->getHasError()) { + $quoteItems = $quote->getItemsCollection(); + $canRemoveErrorFromQuote = true; + + foreach ($quoteItems as $quoteItem) { + if ($quoteItem->getItemId() == $item->getItemId()) { + continue; + } + + $errorInfos = $quoteItem->getErrorInfos(); + foreach ($errorInfos as $errorInfo) { + if ($errorInfo['code'] == $code) { + $canRemoveErrorFromQuote = false; + break; + } + } + + if (!$canRemoveErrorFromQuote) { + break; + } + } + + if ($quote->getHasError() && $canRemoveErrorFromQuote) { $params = array( 'origin' => 'cataloginventory', 'code' => $code @@ -326,6 +347,11 @@ public function checkQuoteItemQty($observer) $increaseOptionQty = ($quoteItem->getQtyToAdd() ? $quoteItem->getQtyToAdd() : $qty) * $optionValue; $stockItem = $option->getProduct()->getStockItem(); + + if ($quoteItem->getProductType() == Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE) { + $stockItem->setProductName($quoteItem->getName()); + } + /* @var $stockItem Mage_CatalogInventory_Model_Stock_Item */ if (!$stockItem instanceof Mage_CatalogInventory_Model_Stock_Item) { Mage::throwException( @@ -365,6 +391,7 @@ public function checkQuoteItemQty($observer) } if (!is_null($result->getMessage())) { $option->setMessage($result->getMessage()); + $quoteItem->setMessage($result->getMessage()); } if (!is_null($result->getItemBackorders())) { $option->setBackorders($result->getItemBackorders()); diff --git a/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock.php b/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock.php index 2c57c16314..19f0e8bc3a 100755 --- a/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock.php +++ b/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -74,17 +74,6 @@ public function cataloginventoryStockItemSave(Mage_Index_Model_Event $event) $productId = $data['product_id']; $this->reindexProducts($productId); - if (!empty($data['force_reindex_required'])) { - $massObject = new Varien_Object(); - $massObject->setAttributesData(array( - 'force_reindex_required' => 1 - )); - $massObject->setProductIds(array($productId)); - Mage::getSingleton('index/indexer')->logEvent( - $massObject, Mage_Catalog_Model_Product::ENTITY, Mage_Index_Model_Event::TYPE_MASS_ACTION - ); - } - return $this; } diff --git a/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock/Configurable.php b/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock/Configurable.php index 8737af64d6..fca02da0bf 100755 --- a/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock/Configurable.php +++ b/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock/Configurable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock/Default.php b/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock/Default.php index 85a5c5f456..1db3d8e9d6 100755 --- a/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock/Default.php +++ b/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock/Default.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock/Grouped.php b/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock/Grouped.php index b3f8c38008..3144b67f11 100755 --- a/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock/Grouped.php +++ b/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock/Grouped.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock/Interface.php b/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock/Interface.php index 8447e16d0d..47a2bb86df 100755 --- a/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock/Interface.php +++ b/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Model/Resource/Stock.php b/app/code/core/Mage/CatalogInventory/Model/Resource/Stock.php index b526ba5eaf..e0a2c04f96 100755 --- a/app/code/core/Mage/CatalogInventory/Model/Resource/Stock.php +++ b/app/code/core/Mage/CatalogInventory/Model/Resource/Stock.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Model/Resource/Stock/Item.php b/app/code/core/Mage/CatalogInventory/Model/Resource/Stock/Item.php index cf921a45a4..d04c6c3931 100755 --- a/app/code/core/Mage/CatalogInventory/Model/Resource/Stock/Item.php +++ b/app/code/core/Mage/CatalogInventory/Model/Resource/Stock/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Model/Resource/Stock/Item/Collection.php b/app/code/core/Mage/CatalogInventory/Model/Resource/Stock/Item/Collection.php index b847904a7f..7ac667192c 100755 --- a/app/code/core/Mage/CatalogInventory/Model/Resource/Stock/Item/Collection.php +++ b/app/code/core/Mage/CatalogInventory/Model/Resource/Stock/Item/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Model/Resource/Stock/Status.php b/app/code/core/Mage/CatalogInventory/Model/Resource/Stock/Status.php index a750e0a3fe..f008e9ee16 100755 --- a/app/code/core/Mage/CatalogInventory/Model/Resource/Stock/Status.php +++ b/app/code/core/Mage/CatalogInventory/Model/Resource/Stock/Status.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Model/Source/Backorders.php b/app/code/core/Mage/CatalogInventory/Model/Source/Backorders.php index 3d346bfbcc..4c4e878b20 100644 --- a/app/code/core/Mage/CatalogInventory/Model/Source/Backorders.php +++ b/app/code/core/Mage/CatalogInventory/Model/Source/Backorders.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Model/Source/Stock.php b/app/code/core/Mage/CatalogInventory/Model/Source/Stock.php index 6390f275dc..5a56f59d3f 100644 --- a/app/code/core/Mage/CatalogInventory/Model/Source/Stock.php +++ b/app/code/core/Mage/CatalogInventory/Model/Source/Stock.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Model/Stock.php b/app/code/core/Mage/CatalogInventory/Model/Stock.php index e4d81599b8..cfdf8a0819 100644 --- a/app/code/core/Mage/CatalogInventory/Model/Stock.php +++ b/app/code/core/Mage/CatalogInventory/Model/Stock.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Model/Stock/Item.php b/app/code/core/Mage/CatalogInventory/Model/Stock/Item.php index 0113ae920d..5ed9d1cac0 100644 --- a/app/code/core/Mage/CatalogInventory/Model/Stock/Item.php +++ b/app/code/core/Mage/CatalogInventory/Model/Stock/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -283,10 +283,8 @@ public function assignProduct(Mage_Catalog_Model_Product $product) */ public function getMinQty() { - if ($this->getUseConfigMinQty()) { - return (float) Mage::getStoreConfig(self::XML_PATH_MIN_QTY); - } - return (float) $this->getData('min_qty'); + return (float)($this->getUseConfigMinQty() ? Mage::getStoreConfig(self::XML_PATH_MIN_QTY) + : $this->getData('min_qty')); } /** @@ -318,40 +316,37 @@ public function setCustomerGroupId($value) */ public function getMinSaleQty() { - if ($this->getCustomerGroupId()) { - $customerGroupId = $this->getCustomerGroupId(); - } else if (Mage::app()->getStore()->isAdmin()) { - $customerGroupId = Mage_Customer_Model_Group::CUST_GROUP_ALL; - } else { - $customerGroupId = Mage::getSingleton('customer/session')->getCustomerGroupId(); + $customerGroupId = $this->getCustomerGroupId(); + if (!$customerGroupId) { + $customerGroupId = Mage::app()->getStore()->isAdmin() + ? Mage_Customer_Model_Group::CUST_GROUP_ALL + : Mage::getSingleton('customer/session')->getCustomerGroupId(); } - if (!array_key_exists($customerGroupId, $this->_minSaleQtyCache)) { - if ($this->getUseConfigMinSaleQty()) { - $minSaleQty = Mage::helper('cataloginventory/minsaleqty')->getConfigValue($customerGroupId); - } else { - $minSaleQty = $this->getData('min_sale_qty'); - } - $minSaleQty = (!empty($minSaleQty) ? (float)$minSaleQty : null); - $this->_minSaleQtyCache[$customerGroupId] = $minSaleQty; + + if (!isset($this->_minSaleQtyCache[$customerGroupId])) { + $minSaleQty = $this->getUseConfigMinSaleQty() + ? Mage::helper('cataloginventory/minsaleqty')->getConfigValue($customerGroupId) + : $this->getData('min_sale_qty'); + + $this->_minSaleQtyCache[$customerGroupId] = empty($minSaleQty) ? 0 : (float)$minSaleQty; } - return $this->_minSaleQtyCache[$customerGroupId]; + + return $this->_minSaleQtyCache[$customerGroupId] ? $this->_minSaleQtyCache[$customerGroupId] : null; } /** - * Retrieve Maximum Qty Allowed in Shopping Cart data wraper + * Retrieve Maximum Qty Allowed in Shopping Cart data wrapper * * @return float */ public function getMaxSaleQty() { - if ($this->getUseConfigMaxSaleQty()) { - return (float) Mage::getStoreConfig(self::XML_PATH_MAX_SALE_QTY); - } - return (float) $this->getData('max_sale_qty'); + return (float)($this->getUseConfigMaxSaleQty() ? Mage::getStoreConfig(self::XML_PATH_MAX_SALE_QTY) + : $this->getData('max_sale_qty')); } /** - * Retrieve Notify for Quantity Below data wraper + * Retrieve Notify for Quantity Below data wrapper * * @return float */ @@ -476,49 +471,41 @@ public function checkQty($qty) } /** - * Returns suggested qty increments for the item based on requested qty + * Returns suggested qty that satisfies qty increments and minQty/maxQty/minSaleQty/maxSaleQty conditions + * or original qty if such value does not exist * * @param int|float $qty * @return int|float */ public function suggestQty($qty) { - $origQty = $qty; - $qty = (float) $qty; - - // Maybe some wrong value - if ($qty <= 0) { - return $origQty; - } - // We do not manage stock - if (!$this->getManageStock()) { - return $origQty; + if ($qty <= 0 || !$this->getManageStock()) { + return $qty; } - // No qty increments enabled - $qtyIncrements = $this->getQtyIncrements(); - $qtyIncrements = (int) $qtyIncrements; // Currently only integer increments supported - if (!$qtyIncrements || ($qtyIncrements == 1)) { - return $origQty; + $qtyIncrements = (int)$this->getQtyIncrements(); // Currently only integer increments supported + if ($qtyIncrements < 2) { + return $qty; } - // Fix qty to be integer if needed - if (!$this->getIsQtyDecimal()) { - $qty = (int) $qty; - } + $minQty = max($this->getMinSaleQty(), $qtyIncrements); + $divisibleMin = ceil($minQty / $qtyIncrements) * $qtyIncrements; - // Maybe qty is evenly divided - no fixture needed - if ($qty % $qtyIncrements == 0) { + $maxQty = min($this->getQty() - $this->getMinQty(), $this->getMaxSaleQty()); + $divisibleMax = floor($maxQty / $qtyIncrements) * $qtyIncrements; + + if ($qty < $minQty || $qty > $maxQty || $divisibleMin > $divisibleMax) { + // Do not perform rounding for qty that does not satisfy min/max conditions to not confuse customer return $qty; } - $qty = round($qty / $qtyIncrements) * $qtyIncrements; - if (!$qty) { - // Value was closer to zero, so suggest first lowest minimal increment - $qty = $qtyIncrements; - } - return $qty; + // Suggest value closest to given qty + $closestDivisibleLeft = floor($qty / $qtyIncrements) * $qtyIncrements; + $closestDivisibleRight = $closestDivisibleLeft + $qtyIncrements; + $acceptableLeft = min(max($divisibleMin, $closestDivisibleLeft), $divisibleMax); + $acceptableRight = max(min($divisibleMax, $closestDivisibleRight), $divisibleMin); + return abs($acceptableLeft - $qty) < abs($acceptableRight - $qty) ? $acceptableLeft : $acceptableRight; } /** @@ -562,21 +549,23 @@ public function checkQuoteItemQty($qty, $summaryQty, $origQty = 0) $result->setOrigQty($origQty); } - if ($this->getMinSaleQty() && ($qty) < $this->getMinSaleQty()) { + if ($this->getMinSaleQty() && $qty < $this->getMinSaleQty()) { $result->setHasError(true) ->setMessage( Mage::helper('cataloginventory')->__('The minimum quantity allowed for purchase is %s.', $this->getMinSaleQty() * 1) ) + ->setErrorCode('qty_min') ->setQuoteMessage(Mage::helper('cataloginventory')->__('Some of the products cannot be ordered in requested quantity.')) ->setQuoteMessageIndex('qty'); return $result; } - if ($this->getMaxSaleQty() && ($qty) > $this->getMaxSaleQty()) { + if ($this->getMaxSaleQty() && $qty > $this->getMaxSaleQty()) { $result->setHasError(true) ->setMessage( Mage::helper('cataloginventory')->__('The maximum quantity allowed for purchase is %s.', $this->getMaxSaleQty() * 1) ) + ->setErrorCode('qty_max') ->setQuoteMessage(Mage::helper('cataloginventory')->__('Some of the products cannot be ordered in requested quantity.')) ->setQuoteMessageIndex('qty'); return $result; @@ -674,11 +663,12 @@ public function checkQtyIncrements($qty) $qtyIncrements = $this->getDefaultQtyIncrements(); } - if ($qtyIncrements && ($qty % $qtyIncrements != 0)) { + if ($qtyIncrements && (Mage::helper('core')->getExactDivision($qty, $qtyIncrements) != 0)) { $result->setHasError(true) ->setQuoteMessage( Mage::helper('cataloginventory')->__('Some of the products cannot be ordered in the requested quantity.') ) + ->setErrorCode('qty_increments') ->setQuoteMessageIndex('qty'); if ($this->getIsChildItem()) { $result->setMessage( diff --git a/app/code/core/Mage/CatalogInventory/Model/Stock/Item/Api.php b/app/code/core/Mage/CatalogInventory/Model/Stock/Item/Api.php index 40406fee0c..0951d78faa 100644 --- a/app/code/core/Mage/CatalogInventory/Model/Stock/Item/Api.php +++ b/app/code/core/Mage/CatalogInventory/Model/Stock/Item/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Model/Stock/Item/Api/V2.php b/app/code/core/Mage/CatalogInventory/Model/Stock/Item/Api/V2.php index 2ad5812547..a8fee164ac 100644 --- a/app/code/core/Mage/CatalogInventory/Model/Stock/Item/Api/V2.php +++ b/app/code/core/Mage/CatalogInventory/Model/Stock/Item/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Model/Stock/Status.php b/app/code/core/Mage/CatalogInventory/Model/Stock/Status.php index a73b6ed074..1fa4eccb2b 100644 --- a/app/code/core/Mage/CatalogInventory/Model/Stock/Status.php +++ b/app/code/core/Mage/CatalogInventory/Model/Stock/Status.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Model/System/Config/Backend/Minqty.php b/app/code/core/Mage/CatalogInventory/Model/System/Config/Backend/Minqty.php index e4c5b0e3c2..74ae128db5 100644 --- a/app/code/core/Mage/CatalogInventory/Model/System/Config/Backend/Minqty.php +++ b/app/code/core/Mage/CatalogInventory/Model/System/Config/Backend/Minqty.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Model/System/Config/Backend/Minsaleqty.php b/app/code/core/Mage/CatalogInventory/Model/System/Config/Backend/Minsaleqty.php index 992233be5c..651bfd17dd 100644 --- a/app/code/core/Mage/CatalogInventory/Model/System/Config/Backend/Minsaleqty.php +++ b/app/code/core/Mage/CatalogInventory/Model/System/Config/Backend/Minsaleqty.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Model/System/Config/Backend/Qtyincrements.php b/app/code/core/Mage/CatalogInventory/Model/System/Config/Backend/Qtyincrements.php index e4609848a7..86373a28d3 100644 --- a/app/code/core/Mage/CatalogInventory/Model/System/Config/Backend/Qtyincrements.php +++ b/app/code/core/Mage/CatalogInventory/Model/System/Config/Backend/Qtyincrements.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/etc/adminhtml.xml b/app/code/core/Mage/CatalogInventory/etc/adminhtml.xml index 7002bd3988..b89d426357 100644 --- a/app/code/core/Mage/CatalogInventory/etc/adminhtml.xml +++ b/app/code/core/Mage/CatalogInventory/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/CatalogInventory/etc/api.xml b/app/code/core/Mage/CatalogInventory/etc/api.xml index 5d681ce49a..aa8e9838b5 100644 --- a/app/code/core/Mage/CatalogInventory/etc/api.xml +++ b/app/code/core/Mage/CatalogInventory/etc/api.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/CatalogInventory/etc/config.xml b/app/code/core/Mage/CatalogInventory/etc/config.xml index 1e7354899e..1baf453778 100644 --- a/app/code/core/Mage/CatalogInventory/etc/config.xml +++ b/app/code/core/Mage/CatalogInventory/etc/config.xml @@ -21,14 +21,14 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> - 1.6.0.0.1 + 1.6.0.0.2 diff --git a/app/code/core/Mage/CatalogInventory/etc/system.xml b/app/code/core/Mage/CatalogInventory/etc/system.xml index a2422844c8..e11a71bcf6 100644 --- a/app/code/core/Mage/CatalogInventory/etc/system.xml +++ b/app/code/core/Mage/CatalogInventory/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -74,6 +74,7 @@ text + validate-number 4 1 1 @@ -112,6 +113,7 @@ text + validate-number 4 1 0 @@ -120,6 +122,7 @@ text + validate-number cataloginventory/system_config_backend_minqty 5 1 @@ -138,6 +141,7 @@ text + validate-number 7 1 0 @@ -164,12 +168,12 @@ text + validate-number validate-greater-than-zero cataloginventory/system_config_backend_qtyincrements 9 1 0 0 - validate-per-page-value-list 1 diff --git a/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/install-1.6.0.0.php b/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/install-1.6.0.0.php index 00aafdbc5f..35503b9595 100644 --- a/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-install-0.7.0.php index 0e9acabfc8..7b9c742859 100644 --- a/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-install-0.7.0.php +++ b/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-install-0.7.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.0-0.7.1.php b/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.0-0.7.1.php index 39b414048c..aed3a03051 100644 --- a/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.0-0.7.1.php +++ b/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.0-0.7.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.1-0.7.2.php b/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.1-0.7.2.php index 84d45a486c..8df11b0f4e 100644 --- a/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.1-0.7.2.php +++ b/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.1-0.7.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.2-0.7.3.php b/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.2-0.7.3.php index 1b26ffbe83..ed2b9b6fd1 100644 --- a/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.2-0.7.3.php +++ b/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.2-0.7.3.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.3-0.7.4.php b/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.3-0.7.4.php index 9e9d48bc9e..da89ee3ecf 100644 --- a/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.3-0.7.4.php +++ b/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.3-0.7.4.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.4-0.7.5.php b/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.4-0.7.5.php index a798d1063a..6af5ccc275 100644 --- a/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.4-0.7.5.php +++ b/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.4-0.7.5.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.5-0.7.6.php b/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.5-0.7.6.php index efc703528b..1cff512d26 100644 --- a/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.5-0.7.6.php +++ b/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.5-0.7.6.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.6-0.7.7.php b/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.6-0.7.7.php index 2e265fe3af..1902efba7a 100644 --- a/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.6-0.7.7.php +++ b/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.6-0.7.7.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.7-0.7.8.php b/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.7-0.7.8.php index 2bdd056c35..3c1556ea33 100644 --- a/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.7-0.7.8.php +++ b/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.7-0.7.8.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php index fcfc80d456..2c6a38d1f8 100644 --- a/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ b/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-1.6.0.0-1.6.0.0.1.php b/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-1.6.0.0-1.6.0.0.1.php index 8c34a13788..c4cabd9db3 100644 --- a/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-1.6.0.0-1.6.0.0.1.php +++ b/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-1.6.0.0-1.6.0.0.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/upgrade-1.6.0.0.1-1.6.0.0.2.php b/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/upgrade-1.6.0.0.1-1.6.0.0.2.php new file mode 100644 index 0000000000..6705f73dd4 --- /dev/null +++ b/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/upgrade-1.6.0.0.1-1.6.0.0.2.php @@ -0,0 +1,45 @@ +getConnection() + ->addColumn( + $installer->getTable('cataloginventory/stock_item'), + 'is_decimal_divided', + array( + 'TYPE' => Varien_Db_Ddl_Table::TYPE_SMALLINT, + 'LENGTH' => 5, + 'UNSIGNED' => true, + 'NULLABLE' => false, + 'DEFAULT' => 0, + 'COMMENT' => 'Is Divided into Multiple Boxes for Shipping' + ) + ); diff --git a/app/code/core/Mage/CatalogRule/Helper/Data.php b/app/code/core/Mage/CatalogRule/Helper/Data.php index f3237e51eb..9521b57dd1 100644 --- a/app/code/core/Mage/CatalogRule/Helper/Data.php +++ b/app/code/core/Mage/CatalogRule/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Captcha/Model/Resource/LoginAttempt/Collection.php b/app/code/core/Mage/CatalogRule/Model/Flag.php old mode 100755 new mode 100644 similarity index 70% rename from app/code/core/Mage/Captcha/Model/Resource/LoginAttempt/Collection.php rename to app/code/core/Mage/CatalogRule/Model/Flag.php index 2486e741cf..891723096a --- a/app/code/core/Mage/Captcha/Model/Resource/LoginAttempt/Collection.php +++ b/app/code/core/Mage/CatalogRule/Model/Flag.php @@ -19,27 +19,24 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage - * @package Mage_Captcha - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @package Mage_CatalogRule + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - /** - * Captcha attempts log collection + * Flag stores status about availability not applied catalog price rules * * @category Mage - * @package Mage_Captcha + * @package Mage_CatalogRule * @author Magento Core Team */ - -class Mage_Captcha_Model_Resource_LoginAttempt_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract +class Mage_CatalogRule_Model_Flag extends Mage_Core_Model_Flag { /** - * Collection resource initialization + * Flag code + * + * @var string */ - protected function _construct() - { - $this->_init('captcha/loginAttempt'); - } + protected $_flagCode = 'catalog_rules_dirty'; } diff --git a/app/code/core/Mage/CatalogRule/Model/Mysql4/Rule.php b/app/code/core/Mage/CatalogRule/Model/Mysql4/Rule.php index 98d433ee24..add733864d 100644 --- a/app/code/core/Mage/CatalogRule/Model/Mysql4/Rule.php +++ b/app/code/core/Mage/CatalogRule/Model/Mysql4/Rule.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogRule/Model/Mysql4/Rule/Collection.php b/app/code/core/Mage/CatalogRule/Model/Mysql4/Rule/Collection.php index 2b9a70ab1d..7f3711ef20 100644 --- a/app/code/core/Mage/CatalogRule/Model/Mysql4/Rule/Collection.php +++ b/app/code/core/Mage/CatalogRule/Model/Mysql4/Rule/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogRule/Model/Mysql4/Rule/Product/Price.php b/app/code/core/Mage/CatalogRule/Model/Mysql4/Rule/Product/Price.php index 26b5dbf202..0448fbc4ba 100644 --- a/app/code/core/Mage/CatalogRule/Model/Mysql4/Rule/Product/Price.php +++ b/app/code/core/Mage/CatalogRule/Model/Mysql4/Rule/Product/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogRule/Model/Mysql4/Rule/Product/Price/Collection.php b/app/code/core/Mage/CatalogRule/Model/Mysql4/Rule/Product/Price/Collection.php index 8686d89962..1abe039f0e 100644 --- a/app/code/core/Mage/CatalogRule/Model/Mysql4/Rule/Product/Price/Collection.php +++ b/app/code/core/Mage/CatalogRule/Model/Mysql4/Rule/Product/Price/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogRule/Model/Observer.php b/app/code/core/Mage/CatalogRule/Model/Observer.php index 9dd49c6370..3d4252a3e3 100644 --- a/app/code/core/Mage/CatalogRule/Model/Observer.php +++ b/app/code/core/Mage/CatalogRule/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -29,6 +29,12 @@ */ class Mage_CatalogRule_Model_Observer { + /** + * Store calculated catalog rules prices for products + * Prices collected per website, customer group, date and product + * + * @var array + */ protected $_rulePrices = array(); /** @@ -50,14 +56,10 @@ public function applyAllRulesOnProduct($observer) ->addFieldToFilter('is_active', 1); foreach ($rules as $rule) { - if (!is_array($rule->getWebsiteIds())) { - $ruleWebsiteIds = (array)explode(',', $rule->getWebsiteIds()); - } else { - $ruleWebsiteIds = $rule->getWebsiteIds(); - } - $websiteIds = array_intersect($productWebsiteIds, $ruleWebsiteIds); + $websiteIds = array_intersect($productWebsiteIds, $rule->getWebsiteIds()); $rule->applyToProduct($product, $websiteIds); } + return $this; } @@ -66,19 +68,25 @@ public function applyAllRulesOnProduct($observer) * Handle cataolg_product_import_after event * * @param Varien_Event_Observer $observer + * * @return Mage_CatalogRule_Model_Observer */ public function applyAllRules($observer) { $resource = Mage::getResourceSingleton('catalogrule/rule'); $resource->applyAllRulesForDateRange($resource->formatDate(mktime(0,0,0))); - Mage::app()->removeCache('catalog_rules_dirty'); + Mage::getModel('catalogrule/flag')->loadSelf() + ->setState(0) + ->save(); + return $this; } /** * Apply catalog price rules to product on frontend * + * @param Varien_Event_Observer $observer + * * @return Mage_CatalogRule_Model_Observer */ public function processFrontFinalPrice($observer) @@ -123,6 +131,8 @@ public function processFrontFinalPrice($observer) /** * Apply catalog price rules to product in admin * + * @param Varien_Event_Observer $observer + * * @return Mage_CatalogRule_Model_Observer */ public function processAdminFinalPrice($observer) @@ -157,6 +167,7 @@ public function processAdminFinalPrice($observer) $product->setFinalPrice($finalPrice); } } + return $this; } @@ -164,6 +175,7 @@ public function processAdminFinalPrice($observer) * Calculate price using catalog price rules of configurable product * * @param Varien_Event_Observer $observer + * * @return Mage_CatalogRule_Model_Observer */ public function catalogProductTypeConfigurablePrice(Varien_Event_Observer $observer) @@ -178,6 +190,7 @@ public function catalogProductTypeConfigurablePrice(Varien_Event_Observer $obser $product->setConfigurablePrice($productPriceRule); } } + return $this; } @@ -188,14 +201,19 @@ public function catalogProductTypeConfigurablePrice(Varien_Event_Observer $obser * we should generate data for interval -1 day ... +1 day * * @param Varien_Event_Observer $observer + * * @return Mage_CatalogRule_Model_Observer */ public function dailyCatalogUpdate($observer) { Mage::getResourceSingleton('catalogrule/rule')->applyAllRulesForDateRange(); + return $this; } + /** + * Clean out calculated catalog rule prices for products + */ public function flushPriceCache() { $this->_rulePrices = array(); @@ -215,7 +233,6 @@ public function prepareCatalogProductPriceIndexTable(Varien_Event_Observer $obse $entityId = $observer->getEvent()->getEntityId(); $customerGroupId = $observer->getEvent()->getCustomerGroupId(); $websiteId = $observer->getEvent()->getWebsiteId(); - $websiteDate = $observer->getEvent()->getWebsiteDate(); $updateFields = $observer->getEvent()->getUpdateFields(); @@ -231,6 +248,7 @@ public function prepareCatalogProductPriceIndexTable(Varien_Event_Observer $obse * If rules were found they will be set to inactive and notice will be add to admin session * * @param string $attributeCode + * * @return Mage_CatalogRule_Model_Observer */ protected function _checkCatalogRulesAvailability($attributeCode) @@ -263,6 +281,7 @@ protected function _checkCatalogRulesAvailability($attributeCode) * Remove catalog attribute condition by attribute code from rule conditions * * @param Mage_CatalogRule_Model_Rule_Condition_Combine $combine + * * @param string $attributeCode */ protected function _removeAttributeFromConditions($combine, $attributeCode) @@ -272,7 +291,7 @@ protected function _removeAttributeFromConditions($combine, $attributeCode) if ($condition instanceof Mage_CatalogRule_Model_Rule_Condition_Combine) { $this->_removeAttributeFromConditions($condition, $attributeCode); } - if ($condition instanceof Mage_CatalogRule_Model_Rule_Condition_Product) { + if ($condition instanceof Mage_Rule_Model_Condition_Product_Abstract) { if ($condition->getAttribute() == $attributeCode) { unset($conditions[$conditionId]); } @@ -285,6 +304,7 @@ protected function _removeAttributeFromConditions($combine, $attributeCode) * After save attribute if it is not used for promo rules already check rules for containing this attribute * * @param Varien_Event_Observer $observer + * * @return Mage_CatalogRule_Model_Observer */ public function catalogAttributeSaveAfter(Varien_Event_Observer $observer) diff --git a/app/code/core/Mage/CatalogRule/Model/Resource/Rule.php b/app/code/core/Mage/CatalogRule/Model/Resource/Rule.php index 1c79e55fe8..bcb88e8b7f 100755 --- a/app/code/core/Mage/CatalogRule/Model/Resource/Rule.php +++ b/app/code/core/Mage/CatalogRule/Model/Resource/Rule.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -32,13 +32,33 @@ * @package Mage_CatalogRule * @author Magento Core Team */ -class Mage_CatalogRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_Abstract +class Mage_CatalogRule_Model_Resource_Rule extends Mage_Rule_Model_Resource_Abstract { + /** + * Store number of seconds in a day + */ const SECONDS_IN_DAY = 86400; /** - * Initialize main table and table id field + * Store associated with rule entities information map * + * @var array + */ + protected $_associatedEntitiesMap = array( + 'website' => array( + 'associations_table' => 'catalogrule/website', + 'rule_id_field' => 'rule_id', + 'entity_id_field' => 'website_id' + ), + 'customer_group' => array( + 'associations_table' => 'catalogrule/customer_group', + 'rule_id_field' => 'rule_id', + 'entity_id_field' => 'customer_group_id' + ) + ); + + /** + * Initialize main table and table id field */ protected function _construct() { @@ -46,50 +66,69 @@ protected function _construct() } /** - * Prepare object data for saving + * Add customer group ids and website ids to rule data after load * * @param Mage_Core_Model_Abstract $object + * + * @return Mage_CatalogRule_Model_Resource_Rule */ - public function _beforeSave(Mage_Core_Model_Abstract $object) + protected function _afterLoad(Mage_Core_Model_Abstract $object) { - if (!$object->getFromDate()) { - $date = Mage::app()->getLocale()->date(); - $date->setHour(0) - ->setMinute(0) - ->setSecond(0); - $object->setFromDate($date); - } - if ($object->getFromDate() instanceof Zend_Date) { - $object->setFromDate($object->getFromDate()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT)); + $object->setData('customer_group_ids', (array)$this->getCustomerGroupIds($object->getId())); + $object->setData('website_ids', (array)$this->getWebsiteIds($object->getId())); + + return parent::_afterLoad($object); + } + + /** + * Bind catalog rule to customer group(s) and website(s). + * Update products which are matched for rule. + * + * @param Mage_Core_Model_Abstract $object + * + * @return Mage_CatalogRule_Model_Resource_Rule + */ + protected function _afterSave(Mage_Core_Model_Abstract $object) + { + if ($object->hasWebsiteIds()) { + $websiteIds = $object->getWebsiteIds(); + if (!is_array($websiteIds)) { + $websiteIds = explode(',', (string)$websiteIds); + } + $this->bindRuleToEntity($object->getId(), $websiteIds, 'website'); } - if (!$object->getToDate()) { - $object->setToDate(new Zend_Db_Expr('NULL')); - } else { - if ($object->getToDate() instanceof Zend_Date) { - $object->setToDate($object->getToDate()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT)); + if ($object->hasCustomerGroupIds()) { + $customerGroupIds = $object->getCustomerGroupIds(); + if (!is_array($customerGroupIds)) { + $customerGroupIds = explode(',', (string)$customerGroupIds); } + $this->bindRuleToEntity($object->getId(), $customerGroupIds, 'customer_group'); } - parent::_beforeSave($object); + + parent::_afterSave($object); + return $this; } /** * Update products which are matched for rule * * @param Mage_CatalogRule_Model_Rule $rule + * * @return Mage_CatalogRule_Model_Resource_Rule */ public function updateRuleProductData(Mage_CatalogRule_Model_Rule $rule) { $ruleId = $rule->getId(); - $write = $this->_getWriteAdapter(); + $write = $this->_getWriteAdapter(); $write->beginTransaction(); - if ($rule->getProductsFilter()) { $write->delete( $this->getTable('catalogrule/rule_product'), - $write->quoteInto('rule_id=?', $ruleId) - . $write->quoteInto('and product_id in (?)', implode(',' , $rule->getProductsFilter())) + array( + 'rule_id=?' => $ruleId, + 'product_id IN (?)' => $rule->getProductsFilter() + ) ); } else { $write->delete($this->getTable('catalogrule/rule_product'), $write->quoteInto('rule_id=?', $ruleId)); @@ -111,15 +150,16 @@ public function updateRuleProductData(Mage_CatalogRule_Model_Rule $rule) Varien_Profiler::start('__MATCH_PRODUCTS__'); $productIds = $rule->getMatchingProductIds(); Varien_Profiler::stop('__MATCH_PRODUCTS__'); - $customerGroupIds = $rule->getCustomerGroupIds(); + $customerGroupIds = $rule->getCustomerGroupIds(); $fromTime = strtotime($rule->getFromDate()); $toTime = strtotime($rule->getToDate()); $toTime = $toTime ? ($toTime + self::SECONDS_IN_DAY - 1) : 0; - $sortOrder = (int)$rule->getSortOrder(); $actionOperator = $rule->getSimpleAction(); $actionAmount = $rule->getDiscountAmount(); + $subActionOperator = $rule->getSubIsEnable() ? $rule->getSubSimpleAction() : ''; + $subActionAmount = $rule->getSubDiscountAmount(); $actionStop = $rule->getStopRulesProcessing(); $rows = array(); @@ -129,17 +169,19 @@ public function updateRuleProductData(Mage_CatalogRule_Model_Rule $rule) foreach ($websiteIds as $websiteId) { foreach ($customerGroupIds as $customerGroupId) { $rows[] = array( - 'rule_id' => $ruleId, - 'from_time' => $fromTime, - 'to_time' => $toTime, - 'website_id' => $websiteId, + 'rule_id' => $ruleId, + 'from_time' => $fromTime, + 'to_time' => $toTime, + 'website_id' => $websiteId, 'customer_group_id' => $customerGroupId, - 'product_id' => $productId, - 'action_operator' => $actionOperator, - 'action_amount' => $actionAmount, - 'action_stop' => $actionStop, - 'sort_order' => $sortOrder, - ); + 'product_id' => $productId, + 'action_operator' => $actionOperator, + 'action_amount' => $actionAmount, + 'action_stop' => $actionStop, + 'sort_order' => $sortOrder, + 'sub_simple_action' => $subActionOperator, + 'sub_discount_amount' => $subActionAmount, + ); if (count($rows) == 1000) { $write->insertMultiple($this->getTable('catalogrule/rule_product'), $rows); @@ -158,6 +200,7 @@ public function updateRuleProductData(Mage_CatalogRule_Model_Rule $rule) throw $e; } + return $this; } @@ -165,6 +208,7 @@ public function updateRuleProductData(Mage_CatalogRule_Model_Rule $rule) * Get all product ids matched for rule * * @param int $ruleId + * * @return array */ public function getRuleProductIds($ruleId) @@ -172,6 +216,7 @@ public function getRuleProductIds($ruleId) $read = $this->_getReadAdapter(); $select = $read->select()->from($this->getTable('catalogrule/rule_product'), 'product_id') ->where('rule_id=?', $ruleId); + return $read->fetchCol($select); } @@ -181,6 +226,7 @@ public function getRuleProductIds($ruleId) * @param int|string $fromDate * @param int|string $toDate * @param int|null $productId + * * @return Mage_CatalogRule_Model_Resource_Rule */ public function removeCatalogPricesForDateRange($fromDate, $toDate, $productId = null) @@ -217,8 +263,9 @@ public function removeCatalogPricesForDateRange($fromDate, $toDate, $productId = /** * Delete old price rules data * - * @param unknown_type $date - * @param mixed $productId + * @param string $date + * @param int|null $productId + * * @return Mage_CatalogRule_Model_Resource_Rule */ public function deleteOldData($date, $productId = null) @@ -240,6 +287,7 @@ public function deleteOldData($date, $productId = null) * @param int $toDate * @param int|null $productId * @param int|null $websiteId + * * @return Zend_Db_Statement_Interface */ protected function _getRuleProductsStmt($fromDate, $toDate, $productId = null, $websiteId = null) @@ -257,8 +305,8 @@ protected function _getRuleProductsStmt($fromDate, $toDate, $productId = null, $ */ $select = $read->select() ->from(array('rp' => $this->getTable('catalogrule/rule_product'))) - ->where($read->quoteInto('rp.from_time=0 or rp.from_time<=?', $toDate) - . ' or ' .$read->quoteInto('rp.to_time=0 or rp.to_time>=?', $fromDate)) + ->where($read->quoteInto('rp.from_time = 0 or rp.from_time <= ?', $toDate) + . ' OR ' . $read->quoteInto('rp.to_time = 0 or rp.to_time >= ?', $fromDate)) ->order(array('rp.website_id', 'rp.customer_group_id', 'rp.product_id', 'rp.sort_order', 'rp.rule_id')); if (!is_null($productId)) { @@ -272,7 +320,8 @@ protected function _getRuleProductsStmt($fromDate, $toDate, $productId = null, $ $priceTable = $priceAttr->getBackend()->getTable(); $attributeId= $priceAttr->getId(); - $joinCondition = '%1$s.entity_id=rp.product_id AND (%1$s.attribute_id='.$attributeId.') and %1$s.store_id=%2$s'; + $joinCondition = '%1$s.entity_id=rp.product_id AND (%1$s.attribute_id=' . $attributeId + . ') and %1$s.store_id=%2$s'; $select->join( array('pp_default'=>$priceTable), @@ -306,20 +355,20 @@ protected function _getRuleProductsStmt($fromDate, $toDate, $productId = null, $ ); } else { foreach (Mage::app()->getWebsites() as $website) { - $websiteId = $website->getId(); - $defaultGroup = $website->getDefaultGroup(); + $websiteId = $website->getId(); + $defaultGroup = $website->getDefaultGroup(); if ($defaultGroup instanceof Mage_Core_Model_Store_Group) { - $storeId = $defaultGroup->getDefaultStoreId(); + $storeId = $defaultGroup->getDefaultStoreId(); } else { - $storeId = Mage_Core_Model_App::ADMIN_STORE_ID; + $storeId = Mage_Core_Model_App::ADMIN_STORE_ID; } - $tableAlias = 'pp'.$websiteId; - $fieldAlias = 'website_'.$websiteId.'_price'; + $tableAlias = 'pp' . $websiteId; + $fieldAlias = 'website_' . $websiteId . '_price'; $select->joinLeft( array($tableAlias => $priceTable), sprintf($joinCondition, $tableAlias, $storeId), - array($fieldAlias => $tableAlias . '.value') + array($fieldAlias => $tableAlias.'.value') ); } } @@ -335,6 +384,7 @@ protected function _getRuleProductsStmt($fromDate, $toDate, $productId = null, $ * @param int|string|null $fromDate * @param int|string|null $toDate * @param int $productId + * * @return Mage_CatalogRule_Model_Resource_Rule */ public function applyAllRulesForDateRange($fromDate = null, $toDate = null, $productId = null) @@ -464,8 +514,10 @@ public function applyAllRulesForDateRange($fromDate = null, $toDate = null, $pro $select = $write->select() ->distinct(true) - ->from($this->getTable('catalogrule/rule_product'), array('rule_id', 'customer_group_id', 'website_id')) - ->where("{$timestamp} >= from_time AND (({$timestamp} <= to_time AND to_time > 0) OR to_time = 0)"); + ->from( + $this->getTable('catalogrule/rule_product'), + array('rule_id', 'customer_group_id', 'website_id') + )->where("{$timestamp} >= from_time AND (({$timestamp} <= to_time AND to_time > 0) OR to_time = 0)"); $query = $select->insertFromSelect($this->getTable('catalogrule/rule_group_website')); $write->query($query); @@ -492,6 +544,7 @@ public function applyAllRulesForDateRange($fromDate = null, $toDate = null, $pro * * @param array $ruleData * @param null|array $productData + * * @return float */ protected function _calcRuleProductPrice($ruleData, $productData = null) @@ -519,6 +572,7 @@ protected function _calcRuleProductPrice($ruleData, $productData = null) * Save rule prices for products to DB * * @param array $arrData + * * @return Mage_CatalogRule_Model_Resource_Rule */ protected function _saveRuleProductPrices($arrData) @@ -527,21 +581,27 @@ protected function _saveRuleProductPrices($arrData) return $this; } - foreach ($arrData as $key => $data) { - $productIds[$data['product_id']] = true; // to avoid dupes - $arrData[$key]['rule_date'] = $this->formatDate($data['rule_date'], false); - $arrData[$key]['latest_start_date'] = $this->formatDate($data['latest_start_date'], false); - $arrData[$key]['earliest_end_date'] = $this->formatDate($data['earliest_end_date'], false); - } + $adapter = $this->_getWriteAdapter(); + $productIds = array(); + + $adapter->beginTransaction(); + try { + foreach ($arrData as $key => $data) { + $productIds['product_id'] = $data['product_id']; + $arrData[$key]['rule_date'] = $this->formatDate($data['rule_date'], false); + $arrData[$key]['latest_start_date'] = $this->formatDate($data['latest_start_date'], false); + $arrData[$key]['earliest_end_date'] = $this->formatDate($data['earliest_end_date'], false); + } + $adapter->insertOnDuplicate($this->getTable('catalogrule/affected_product'), array_unique($productIds)); + $adapter->insertOnDuplicate($this->getTable('catalogrule/rule_product_price'), $arrData); + + } catch (Exception $e) { + $adapter->rollback(); + throw $e; - foreach ($productIds as $id => $v) { - $this->_getWriteAdapter()->delete($this->getTable('catalogrule/affected_product'), - array("product_id = $id")); - $this->_getWriteAdapter()->insert($this->getTable('catalogrule/affected_product'), - array('product_id' => $id)); } + $adapter->commit(); - $this->_getWriteAdapter()->insertOnDuplicate($this->getTable('catalogrule/rule_product_price'), $arrData); return $this; } @@ -553,7 +613,8 @@ protected function _saveRuleProductPrices($arrData) * @param int $wId * @param int $gId * @param int $pId - * @return float | false + * + * @return float|bool */ public function getRulePrice($date, $wId, $gId, $pId) { @@ -566,13 +627,14 @@ public function getRulePrice($date, $wId, $gId, $pId) } /** - * Return product prices by catalog rule for specific date, website and customer group - * Return product - price pairs + * Retrieve product prices by catalog rule for specific date, website and customer group + * Collect data with product Id => price pairs * * @param int|string $date * @param int $websiteId * @param int $customerGroupId * @param array $productIds + * * @return array */ public function getRulePrices($date, $websiteId, $customerGroupId, $productIds) @@ -599,31 +661,27 @@ public function getRulePrices($date, $websiteId, $customerGroupId, $productIds) public function getRulesFromProduct($date, $websiteId, $customerGroupId, $productId) { $adapter = $this->_getReadAdapter(); - $dateQuoted = $adapter->quote($this->formatDate($date, false)); - $joinCondsQuoted[] = 'main_table.rule_id = rp.rule_id'; - $joinCondsQuoted[] = $adapter->quoteInto('rp.website_id = ?', $websiteId); - $joinCondsQuoted[] = $adapter->quoteInto('rp.customer_group_id = ?', $customerGroupId); - $joinCondsQuoted[] = $adapter->quoteInto('rp.product_id = ?', $productId); - $fromDate = $adapter->getIfNullSql('main_table.from_date', $dateQuoted); - $toDate = $adapter->getIfNullSql('main_table.to_date', $dateQuoted); + if (is_string($date)) { + $date = strtotime($date); + } $select = $adapter->select() - ->from(array('main_table' => $this->getTable('catalogrule/rule'))) - ->joinInner( - array('rp' => $this->getTable('catalogrule/rule_product')), - implode(' AND ', $joinCondsQuoted), - array()) - ->where(new Zend_Db_Expr("{$dateQuoted} BETWEEN {$fromDate} AND {$toDate}")) - ->where('main_table.is_active = ?', 1) - ->order('main_table.sort_order'); + ->from($this->getTable('catalogrule/rule_product')) + ->where('website_id = ?', $websiteId) + ->where('customer_group_id = ?', $customerGroupId) + ->where('product_id = ?', $productId) + ->where('from_time = 0 or from_time < ?', $date) + ->where('to_time = 0 or to_time > ?', $date); + return $adapter->fetchAll($select); } /** - * Get data about product prices for all customer groups + * Retrieve product price data for all customer groups * * @param int|string $date * @param int $wId * @param int $pId + * * @return array */ public function getRulesForProduct($date, $wId, $pId) @@ -634,6 +692,7 @@ public function getRulesForProduct($date, $wId, $pId) ->where('rule_date=?', $this->formatDate($date, false)) ->where('website_id=?', $wId) ->where('product_id=?', $pId); + return $read->fetchAll($select); } @@ -643,6 +702,7 @@ public function getRulesForProduct($date, $wId, $pId) * @param Mage_CatalogRule_Model_Rule $rule * @param Mage_Catalog_Model_Product $product * @param array $websiteIds + * * @return Mage_CatalogRule_Model_Resource_Rule */ public function applyToProduct($rule, $product, $websiteIds) @@ -651,7 +711,7 @@ public function applyToProduct($rule, $product, $websiteIds) return $this; } - $ruleId = $rule->getId(); + $ruleId = $rule->getId(); $productId = $product->getId(); $write = $this->_getWriteAdapter(); @@ -671,32 +731,34 @@ public function applyToProduct($rule, $product, $websiteIds) } $customerGroupIds = $rule->getCustomerGroupIds(); - - $fromTime = strtotime($rule->getFromDate()); - $toTime = strtotime($rule->getToDate()); - $toTime = $toTime ? $toTime+self::SECONDS_IN_DAY - 1 : 0; - - $sortOrder = (int)$rule->getSortOrder(); + $fromTime = strtotime($rule->getFromDate()); + $toTime = strtotime($rule->getToDate()); + $toTime = $toTime ? $toTime + self::SECONDS_IN_DAY - 1 : 0; + $sortOrder = (int)$rule->getSortOrder(); $actionOperator = $rule->getSimpleAction(); - $actionAmount = $rule->getDiscountAmount(); - $actionStop = $rule->getStopRulesProcessing(); + $actionAmount = $rule->getDiscountAmount(); + $actionStop = $rule->getStopRulesProcessing(); + $subActionOperator = $rule->getSubIsEnable() ? $rule->getSubSimpleAction() : ''; + $subActionAmount = $rule->getSubDiscountAmount(); $rows = array(); try { foreach ($websiteIds as $websiteId) { foreach ($customerGroupIds as $customerGroupId) { $rows[] = array( - 'rule_id' => $ruleId, - 'from_time' => $fromTime, - 'to_time' => $toTime, - 'website_id' => $websiteId, + 'rule_id' => $ruleId, + 'from_time' => $fromTime, + 'to_time' => $toTime, + 'website_id' => $websiteId, 'customer_group_id' => $customerGroupId, - 'product_id' => $productId, - 'action_operator' => $actionOperator, - 'action_amount' => $actionAmount, - 'action_stop' => $actionStop, - 'sort_order' => $sortOrder, - ); + 'product_id' => $productId, + 'action_operator' => $actionOperator, + 'action_amount' => $actionAmount, + 'action_stop' => $actionStop, + 'sort_order' => $sortOrder, + 'sub_simple_action' => $subActionOperator, + 'sub_discount_amount' => $subActionAmount, + ); if (count($rows) == 1000) { $write->insertMultiple($this->getTable('catalogrule/rule_product'), $rows); @@ -706,7 +768,7 @@ public function applyToProduct($rule, $product, $websiteIds) } if (!empty($rows)) { - $write->insertMultiple($this->getTable('catalogrule/rule_product'), $rows); + $write->insertMultiple($this->getTable('catalogrule/rule_product'), $rows); } } catch (Exception $e) { $write->rollback(); @@ -714,6 +776,7 @@ public function applyToProduct($rule, $product, $websiteIds) } $this->applyAllRulesForDateRange(null, null, $product); + $write->commit(); return $this; diff --git a/app/code/core/Mage/CatalogRule/Model/Resource/Rule/Collection.php b/app/code/core/Mage/CatalogRule/Model/Resource/Rule/Collection.php index 420e5fa0b5..f54f992b5f 100755 --- a/app/code/core/Mage/CatalogRule/Model/Resource/Rule/Collection.php +++ b/app/code/core/Mage/CatalogRule/Model/Resource/Rule/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -32,45 +32,27 @@ * @package Mage_CatalogRule * @author Magento Core Team */ -class Mage_CatalogRule_Model_Resource_Rule_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract +class Mage_CatalogRule_Model_Resource_Rule_Collection extends Mage_Rule_Model_Resource_Rule_Collection_Abstract { /** - * Enter description here ... + * Store associated with rule entities information map * + * @var array */ - protected function _construct() - { - $this->_init('catalogrule/rule'); - } + protected $_associatedEntitiesMap = array( + 'website' => array( + 'associations_table' => 'catalogrule/website', + 'rule_id_field' => 'rule_id', + 'entity_id_field' => 'website_id' + ) + ); /** - * Enter description here ... - * + * Set resource model */ - protected function _afterLoad() - { - $this->walk('afterLoad'); - } - - /** - * Filter collection by specified website IDs - * - * @param int|array $websiteIds - * @return Mage_CatalogRule_Model_Resource_Rule_Collection - */ - public function addWebsiteFilter($websiteIds) + protected function _construct() { - if (!is_array($websiteIds)) { - $websiteIds = array($websiteIds); - } - $parts = array(); - foreach ($websiteIds as $websiteId) { - $parts[] = $this->getConnection()->prepareSqlCondition('main_table.website_ids', array('finset' => $websiteId)); - } - if ($parts) { - $this->getSelect()->where(new Zend_Db_Expr(implode(' OR ', $parts))); - } - return $this; + $this->_init('catalogrule/rule'); } /** diff --git a/app/code/core/Mage/CatalogRule/Model/Resource/Rule/Product/Price.php b/app/code/core/Mage/CatalogRule/Model/Resource/Rule/Product/Price.php index 07c4655004..f8184465fb 100755 --- a/app/code/core/Mage/CatalogRule/Model/Resource/Rule/Product/Price.php +++ b/app/code/core/Mage/CatalogRule/Model/Resource/Rule/Product/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogRule/Model/Resource/Rule/Product/Price/Collection.php b/app/code/core/Mage/CatalogRule/Model/Resource/Rule/Product/Price/Collection.php index 22a8423393..f1529d0b5e 100755 --- a/app/code/core/Mage/CatalogRule/Model/Resource/Rule/Product/Price/Collection.php +++ b/app/code/core/Mage/CatalogRule/Model/Resource/Rule/Product/Price/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogRule/Model/Rule.php b/app/code/core/Mage/CatalogRule/Model/Rule.php index 99f2cb4073..675eb0ed78 100644 --- a/app/code/core/Mage/CatalogRule/Model/Rule.php +++ b/app/code/core/Mage/CatalogRule/Model/Rule.php @@ -20,13 +20,13 @@ * * @category Mage * @package Mage_CatalogRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** - * Enter description here ... + * Catalog Rule data model * * @method Mage_CatalogRule_Model_Resource_Rule _getResource() * @method Mage_CatalogRule_Model_Resource_Rule getResource() @@ -60,8 +60,11 @@ * @package Mage_CatalogRule * @author Magento Core Team */ -class Mage_CatalogRule_Model_Rule extends Mage_Rule_Model_Rule +class Mage_CatalogRule_Model_Rule extends Mage_Rule_Model_Abstract { + /** + * Related cache types config path + */ const XML_NODE_RELATED_CACHE = 'global/catalogrule/related_cache_types'; /** @@ -81,7 +84,7 @@ class Mage_CatalogRule_Model_Rule extends Mage_Rule_Model_Rule protected $_eventObject = 'rule'; /** - * Matched product ids array + * Store matched product Ids * * @var array */ @@ -94,6 +97,11 @@ class Mage_CatalogRule_Model_Rule extends Mage_Rule_Model_Rule */ protected $_productsFilter = null; + /** + * Store current date at "Y-m-d H:i:s" format + * + * @var string + */ protected $_now; /** @@ -114,106 +122,60 @@ protected function _construct() } /** - * Filtering products that must be checked for matching with rule + * Getter for rule conditions collection * - * @param int|array $productIds + * @return Mage_CatalogRule_Model_Rule_Condition_Combine */ - public function setProductsFilter($productIds) + public function getConditionsInstance() { - $this->_productsFilter = $productIds; + return Mage::getModel('catalogrule/rule_condition_combine'); } /** - * Returns products filter + * Getter for rule actions collection * - * @return array|int|null + * @return Mage_CatalogRule_Model_Rule_Action_Collection */ - public function getProductsFilter() - { - return $this->_productsFilter; - } - - public function getConditionsInstance() - { - return Mage::getModel('catalogrule/rule_condition_combine'); - } - public function getActionsInstance() { return Mage::getModel('catalogrule/rule_action_collection'); } - public function getNow() - { - if (!$this->_now) { - return now(); - } - return $this->_now; - } - - public function setNow($now) - { - $this->_now = $now; - } - - public function toString($format='') - { - $str = Mage::helper('catalogrule')->__("Name: %s", $this->getName()) ."\n" - . Mage::helper('catalogrule')->__("Start at: %s", $this->getStartAt()) ."\n" - . Mage::helper('catalogrule')->__("Expire at: %s", $this->getExpireAt()) ."\n" - . Mage::helper('catalogrule')->__("Customer Registered: %s", $this->getCustomerRegistered()) ."\n" - . Mage::helper('catalogrule')->__("Customer is a New Buyer: %s", $this->getCustomerNewBuyer()) ."\n" - . Mage::helper('catalogrule')->__("Description: %s", $this->getDescription()) ."\n\n" - . $this->getConditions()->toStringRecursive() ."\n\n" - . $this->getActions()->toStringRecursive() ."\n\n"; - return $str; - } - /** - * Returns rule as an array for admin interface - * - * Output example: - * array( - * 'name'=>'Example rule', - * 'conditions'=>{condition_combine::toArray} - * 'actions'=>{action_collection::toArray} - * ) + * Get catalog rule customer group Ids * * @return array */ - public function toArray(array $arrAttributes = array()) + public function getCustomerGroupIds() { - $out = parent::toArray($arrAttributes); - $out['customer_registered'] = $this->getCustomerRegistered(); - $out['customer_new_buyer'] = $this->getCustomerNewBuyer(); - - return $out; + if (!$this->hasCustomerGroupIds()) { + $customerGroupIds = $this->_getResource()->getCustomerGroupIds($this->getId()); + $this->setData('customer_group_ids', (array)$customerGroupIds); + } + return $this->_getData('customer_group_ids'); } /** - * Invalidate related cache types + * Retrieve current date for current rule * - * @return Mage_CatalogRule_Model_Rule + * @return string */ - protected function _invalidateCache() + public function getNow() { - $types = Mage::getConfig()->getNode(self::XML_NODE_RELATED_CACHE); - if ($types) { - $types = $types->asArray(); - Mage::app()->getCacheInstance()->invalidateType(array_keys($types)); + if (!$this->_now) { + return now(); } - return $this; + return $this->_now; } /** - * Process rule related data after rule save + * Set current date for current rule * - * @return Mage_CatalogRule_Model_Rule + * @param string $now */ - protected function _afterSave() + public function setNow($now) { - $this->_getResource()->updateRuleProductData($this); - parent::_afterSave(); + $this->_now = $now; } /** @@ -226,18 +188,14 @@ public function getMatchingProductIds() if (is_null($this->_productIds)) { $this->_productIds = array(); $this->setCollectedAttributes(array()); - $websiteIds = $this->getWebsiteIds(); - if (!is_array($websiteIds)) { - $websiteIds = explode(',', $websiteIds); - } - if ($websiteIds) { - $productCollection = Mage::getResourceModel('catalog/product_collection') - ->addWebsiteFilter($websiteIds); + if ($this->getWebsiteIds()) { + /** @var $productCollection Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection */ + $productCollection = Mage::getResourceModel('catalog/product_collection'); + $productCollection->addWebsiteFilter($this->getWebsiteIds()); if ($this->_productsFilter) { $productCollection->addIdFilter($this->_productsFilter); } - $this->getConditions()->collectValidatedAttributes($productCollection); Mage::getSingleton('core/resource_iterator')->walk( @@ -274,41 +232,21 @@ public function callbackValidateProduct($args) * Apply rule to product * * @param int|Mage_Catalog_Model_Product $product - * @param array $websiteIds + * @param array|null $websiteIds + * * @return void */ - public function applyToProduct($product, $websiteIds=null) + public function applyToProduct($product, $websiteIds = null) { if (is_numeric($product)) { $product = Mage::getModel('catalog/product')->load($product); } if (is_null($websiteIds)) { - $websiteIds = explode(',', $this->getWebsiteIds()); + $websiteIds = $this->getWebsiteIds(); } $this->getResource()->applyToProduct($this, $product, $websiteIds); } - /** - * Get array of assigned customer group ids - * - * @return array - */ - public function getCustomerGroupIds() - { - $ids = $this->getData('customer_group_ids'); - if (($ids && !$this->getCustomerGroupChecked()) || is_string($ids)) { - if (is_string($ids)) { - $ids = explode(',', $ids); - } - - $groupIds = Mage::getModel('customer/group')->getCollection()->getAllIds(); - $ids = array_intersect($ids, $groupIds); - $this->setData('customer_group_ids', $ids); - $this->setCustomerGroupChecked(true); - } - return $ids; - } - /** * Apply all price rules, invalidate related cache and refresh price index * @@ -354,8 +292,8 @@ public function applyAllRulesToProduct($product) /** * Calculate price using catalog price rule of product * - * @param Mage_Catalog_Model_Product $product - * @param float $price + * @param Mage_Catalog_Model_Product $product + * @param float $price * @return float|null */ public function calcProductPriceRule(Mage_Catalog_Model_Product $product, $price) @@ -377,7 +315,7 @@ public function calcProductPriceRule(Mage_Catalog_Model_Product $product, $price if ($rulesData) { foreach ($rulesData as $ruleData) { if ($product->getParentId()) { - if ($ruleData['sub_is_enable']) { + if (!empty($ruleData['sub_simple_action'])) { $priceRules = Mage::helper('catalogrule')->calcPriceRule( $ruleData['sub_simple_action'], $ruleData['sub_discount_amount'], @@ -386,16 +324,16 @@ public function calcProductPriceRule(Mage_Catalog_Model_Product $product, $price } else { $priceRules = $price; } - if ($ruleData['stop_rules_processing']) { + if ($ruleData['action_stop']) { break; } } else { $priceRules = Mage::helper('catalogrule')->calcPriceRule( - $ruleData['simple_action'], - $ruleData['discount_amount'], - $priceRules ? $priceRules :$price + $ruleData['action_operator'], + $ruleData['action_amount'], + $priceRules ? $priceRules : $price ); - if ($ruleData['stop_rules_processing']) { + if ($ruleData['action_stop']) { break; } } @@ -409,4 +347,75 @@ public function calcProductPriceRule(Mage_Catalog_Model_Product $product, $price } return null; } + + /** + * Filtering products that must be checked for matching with rule + * + * @param int|array $productIds + */ + public function setProductsFilter($productIds) + { + $this->_productsFilter = $productIds; + } + + /** + * Returns products filter + * + * @return array|int|null + */ + public function getProductsFilter() + { + return $this->_productsFilter; + } + + /** + * Invalidate related cache types + * + * @return Mage_CatalogRule_Model_Rule + */ + protected function _invalidateCache() + { + $types = Mage::getConfig()->getNode(self::XML_NODE_RELATED_CACHE); + if ($types) { + $types = $types->asArray(); + Mage::app()->getCacheInstance()->invalidateType(array_keys($types)); + } + return $this; + } + + + + + /** + * @deprecated after 1.11.2.0 + * + * @param string $format + * + * @return string + */ + public function toString($format='') + { + return ''; + } + + /** + * Returns rule as an array for admin interface + * + * @deprecated after 1.11.2.0 + * + * @param array $arrAttributes + * + * Output example: + * array( + * 'name'=>'Example rule', + * 'conditions'=>{condition_combine::toArray} + * 'actions'=>{action_collection::toArray} + * ) + * + * @return array + */ + public function toArray(array $arrAttributes = array()) + { + return parent::toArray($arrAttributes); + } } diff --git a/app/code/core/Mage/CatalogRule/Model/Rule/Action/Collection.php b/app/code/core/Mage/CatalogRule/Model/Rule/Action/Collection.php index fc68d94243..e5a2c06ec4 100644 --- a/app/code/core/Mage/CatalogRule/Model/Rule/Action/Collection.php +++ b/app/code/core/Mage/CatalogRule/Model/Rule/Action/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogRule/Model/Rule/Action/Product.php b/app/code/core/Mage/CatalogRule/Model/Rule/Action/Product.php index 2ac8b299f7..f8e6dbb946 100644 --- a/app/code/core/Mage/CatalogRule/Model/Rule/Action/Product.php +++ b/app/code/core/Mage/CatalogRule/Model/Rule/Action/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogRule/Model/Rule/Condition/Combine.php b/app/code/core/Mage/CatalogRule/Model/Rule/Condition/Combine.php index a8687b67ce..807747a2cd 100644 --- a/app/code/core/Mage/CatalogRule/Model/Rule/Condition/Combine.php +++ b/app/code/core/Mage/CatalogRule/Model/Rule/Condition/Combine.php @@ -20,11 +20,13 @@ * * @category Mage * @package Mage_CatalogRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - +/** + * Catalog Rule Combine Condition data model + */ class Mage_CatalogRule_Model_Rule_Condition_Combine extends Mage_Rule_Model_Condition_Combine { public function __construct() diff --git a/app/code/core/Mage/CatalogRule/Model/Rule/Condition/Product.php b/app/code/core/Mage/CatalogRule/Model/Rule/Condition/Product.php index 80c8cb4314..e1f9bb2c80 100644 --- a/app/code/core/Mage/CatalogRule/Model/Rule/Condition/Product.php +++ b/app/code/core/Mage/CatalogRule/Model/Rule/Condition/Product.php @@ -20,488 +20,15 @@ * * @category Mage * @package Mage_CatalogRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -class Mage_CatalogRule_Model_Rule_Condition_Product extends Mage_Rule_Model_Condition_Abstract +/** + * Catalog Rule Product Condition data model + */ +class Mage_CatalogRule_Model_Rule_Condition_Product extends Mage_Rule_Model_Condition_Product_Abstract { - /** - * All attribute values as array in form: - * array( - * [entity_id_1] => array( - * [store_id_1] => store_value_1, - * [store_id_2] => store_value_2, - * ... - * [store_id_n] => store_value_n - * ), - * ... - * ) - * - * Will be set only for not global scope attribute - * - * @var array - */ - protected $_entityAttributeValues = null; - - /** - * Attribute data key that indicates whether it should be used for rules - * - * @var string - */ - protected $_isUsedForRuleProperty = 'is_used_for_promo_rules'; - - /** - * Customize default operator input by type mapper for some types - * - * @return array - */ - public function getDefaultOperatorInputByType() - { - if (null === $this->_defaultOperatorInputByType) { - parent::getDefaultOperatorInputByType(); - /* - * '{}' and '!{}' are left for back-compatibility and equal to '==' and '!=' - */ - $this->_defaultOperatorInputByType['category'] = array('==', '!=', '{}', '!{}', '()', '!()'); - $this->_arrayInputTypes[] = 'category'; - } - return $this->_defaultOperatorInputByType; - } - - /** - * Retrieve attribute object - * - * @return Mage_Catalog_Model_Resource_Eav_Attribute - */ - public function getAttributeObject() - { - try { - $obj = Mage::getSingleton('eav/config') - ->getAttribute(Mage_Catalog_Model_Product::ENTITY, $this->getAttribute()); - } - catch (Exception $e) { - $obj = new Varien_Object(); - $obj->setEntity(Mage::getResourceSingleton('catalog/product')) - ->setFrontendInput('text'); - } - return $obj; - } - - /** - * Add special attributes - * - * @param array $attributes - */ - protected function _addSpecialAttributes(array &$attributes) - { - $attributes['attribute_set_id'] = Mage::helper('catalogrule')->__('Attribute Set'); - $attributes['category_ids'] = Mage::helper('catalogrule')->__('Category'); - } - - /** - * Load attribute options - * - * @return Mage_CatalogRule_Model_Rule_Condition_Product - */ - public function loadAttributeOptions() - { - $productAttributes = Mage::getResourceSingleton('catalog/product') - ->loadAllAttributes() - ->getAttributesByCode(); - - $attributes = array(); - foreach ($productAttributes as $attribute) { - /* @var $attribute Mage_Catalog_Model_Resource_Eav_Attribute */ - if (!$attribute->isAllowedForRuleCondition() - || !$attribute->getDataUsingMethod($this->_isUsedForRuleProperty) - ) { - continue; - } - $attributes[$attribute->getAttributeCode()] = $attribute->getFrontendLabel(); - } - - $this->_addSpecialAttributes($attributes); - - asort($attributes); - $this->setAttributeOption($attributes); - - return $this; - } - - /** - * Prepares values options to be used as select options or hashed array - * Result is stored in following keys: - * 'value_select_options' - normal select array: array(array('value' => $value, 'label' => $label), ...) - * 'value_option' - hashed array: array($value => $label, ...), - * - * @return Mage_CatalogRule_Model_Rule_Condition_Product - */ - protected function _prepareValueOptions() - { - // Check that both keys exist. Maybe somehow only one was set not in this routine, but externally. - $selectReady = $this->getData('value_select_options'); - $hashedReady = $this->getData('value_option'); - if ($selectReady && $hashedReady) { - return $this; - } - - // Get array of select options. It will be used as source for hashed options - $selectOptions = null; - if ($this->getAttribute() === 'attribute_set_id') { - $entityTypeId = Mage::getSingleton('eav/config') - ->getEntityType(Mage_Catalog_Model_Product::ENTITY)->getId(); - $selectOptions = Mage::getResourceModel('eav/entity_attribute_set_collection') - ->setEntityTypeFilter($entityTypeId) - ->load() - ->toOptionArray(); - } else if (is_object($this->getAttributeObject())) { - $attributeObject = $this->getAttributeObject(); - if ($attributeObject->usesSource()) { - if ($attributeObject->getFrontendInput() == 'multiselect') { - $addEmptyOption = false; - } else { - $addEmptyOption = true; - } - $selectOptions = $attributeObject->getSource()->getAllOptions($addEmptyOption); - } - } - - // Set new values only if we really got them - if ($selectOptions !== null) { - // Overwrite only not already existing values - if (!$selectReady) { - $this->setData('value_select_options', $selectOptions); - } - if (!$hashedReady) { - $hashedOptions = array(); - foreach ($selectOptions as $o) { - if (is_array($o['value'])) { - continue; // We cannot use array as index - } - $hashedOptions[$o['value']] = $o['label']; - } - $this->setData('value_option', $hashedOptions); - } - } - - return $this; - } - - /** - * Retrieve value by option - * - * @param mixed $option - * @return string - */ - public function getValueOption($option=null) - { - $this->_prepareValueOptions(); - return $this->getData('value_option'.(!is_null($option) ? '/'.$option : '')); - } - - /** - * Retrieve select option values - * - * @return array - */ - public function getValueSelectOptions() - { - $this->_prepareValueOptions(); - return $this->getData('value_select_options'); - } - - /** - * Retrieve after element HTML - * - * @return string - */ - public function getValueAfterElementHtml() - { - $html = ''; - - switch ($this->getAttribute()) { - case 'sku': case 'category_ids': - $image = Mage::getDesign()->getSkinUrl('images/rule_chooser_trigger.gif'); - break; - } - - if (!empty($image)) { - $html = ''; - } - return $html; - } - - /** - * Retrieve attribute element - * - * @return Varien_Form_Element_Abstract - */ - public function getAttributeElement() - { - $element = parent::getAttributeElement(); - $element->setShowAsText(true); - return $element; - } - - /** - * Collect validated attributes - * - * @param Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection $productCollection - * @return Mage_CatalogRule_Model_Rule_Condition_Product - */ - public function collectValidatedAttributes($productCollection) - { - $attribute = $this->getAttribute(); - if ('category_ids' != $attribute) { - if ($this->getAttributeObject()->isScopeGlobal()) { - $attributes = $this->getRule()->getCollectedAttributes(); - $attributes[$attribute] = true; - $this->getRule()->setCollectedAttributes($attributes); - $productCollection->addAttributeToSelect($attribute, 'left'); - } else { - $this->_entityAttributeValues = $productCollection->getAllAttributeValues($attribute); - } - } - - return $this; - } - - /** - * Retrieve input type - * - * @return string - */ - public function getInputType() - { - if ($this->getAttribute()==='attribute_set_id') { - return 'select'; - } - if (!is_object($this->getAttributeObject())) { - return 'string'; - } - if ($this->getAttributeObject()->getAttributeCode() == 'category_ids') { - return 'category'; - } - switch ($this->getAttributeObject()->getFrontendInput()) { - case 'select': - return 'select'; - - case 'multiselect': - return 'multiselect'; - - case 'date': - return 'date'; - - case 'boolean': - return 'boolean'; - - default: - return 'string'; - } - } - - /** - * Retrieve value element type - * - * @return string - */ - public function getValueElementType() - { - if ($this->getAttribute()==='attribute_set_id') { - return 'select'; - } - if (!is_object($this->getAttributeObject())) { - return 'text'; - } - switch ($this->getAttributeObject()->getFrontendInput()) { - case 'select': - case 'boolean': - return 'select'; - - case 'multiselect': - return 'multiselect'; - - case 'date': - return 'date'; - - default: - return 'text'; - } - } - - /** - * Retrieve value element - * - * @return Varien_Data_Form_Element_Abstract - */ - public function getValueElement() - { - $element = parent::getValueElement(); - if (is_object($this->getAttributeObject())) { - switch ($this->getAttributeObject()->getFrontendInput()) { - case 'date': - $element->setImage(Mage::getDesign()->getSkinUrl('images/grid-cal.gif')); - break; - } - } - - return $element; - } - - /** - * Retrieve value element chooser URL - * - * @return string - */ - public function getValueElementChooserUrl() - { - $url = false; - switch ($this->getAttribute()) { - case 'sku': case 'category_ids': - $url = 'adminhtml/promo_widget/chooser' - .'/attribute/'.$this->getAttribute(); - if ($this->getJsFormObject()) { - $url .= '/form/'.$this->getJsFormObject(); - } - break; - } - return $url!==false ? Mage::helper('adminhtml')->getUrl($url) : ''; - } - - /** - * Retrieve Explicit Apply - * - * @return bool - */ - public function getExplicitApply() - { - switch ($this->getAttribute()) { - case 'sku': case 'category_ids': - return true; - } - if (is_object($this->getAttributeObject())) { - switch ($this->getAttributeObject()->getFrontendInput()) { - case 'date': - return true; - } - } - return false; - } - - /** - * Load array - * - * @param array $arr - * @return Mage_CatalogRule_Model_Rule_Condition_Product - */ - public function loadArray($arr) - { - $this->setAttribute(isset($arr['attribute']) ? $arr['attribute'] : false); - $attribute = $this->getAttributeObject(); - - $isContainsOperator = !empty($arr['operator']) && in_array($arr['operator'], array('{}', '!{}')); - if ($attribute && $attribute->getBackendType() == 'decimal' && !$isContainsOperator) { - if (isset($arr['value'])) { - if (!empty($arr['operator']) - && in_array($arr['operator'], array('!()', '()')) - && false !== strpos($arr['value'], ',')) { - - $tmp = array(); - foreach (explode(',', $arr['value']) as $value) { - $tmp[] = Mage::app()->getLocale()->getNumber($value); - } - $arr['value'] = implode(',', $tmp); - } else { - $arr['value'] = Mage::app()->getLocale()->getNumber($arr['value']); - } - } else { - $arr['value'] = false; - } - $arr['is_value_parsed'] = isset($arr['is_value_parsed']) - ? Mage::app()->getLocale()->getNumber($arr['is_value_parsed']) : false; - } - - return parent::loadArray($arr); - } - - /** - * Validate product attrbute value for condition - * - * @param Varien_Object $object - * @return bool - */ - public function validate(Varien_Object $object) - { - $attrCode = $this->getAttribute(); - - if ('category_ids' == $attrCode) { - return $this->validateAttribute($object->getAvailableInCategories()); - } elseif (! isset($this->_entityAttributeValues[$object->getId()])) { - $attr = $object->getResource()->getAttribute($attrCode); - - if ($attr && $attr->getBackendType() == 'datetime' && !is_int($this->getValue())) { - $this->setValue(strtotime($this->getValue())); - $value = strtotime($object->getData($attrCode)); - return $this->validateAttribute($value); - } - - if ($attr && $attr->getFrontendInput() == 'multiselect') { - $value = $object->getData($attrCode); - $value = strlen($value) ? explode(',', $value) : array(); - return $this->validateAttribute($value); - } - - return parent::validate($object); - } else { - $result = false; // any valid value will set it to TRUE - // remember old attribute state - $oldAttrValue = $object->hasData($attrCode) ? $object->getData($attrCode) : null; - - foreach ($this->_entityAttributeValues[$object->getId()] as $storeId => $value) { - $attr = $object->getResource()->getAttribute($attrCode); - if ($attr && $attr->getBackendType() == 'datetime') { - $value = strtotime($value); - } else if ($attr && $attr->getFrontendInput() == 'multiselect') { - $value = strlen($value) ? explode(',', $value) : array(); - } - - $object->setData($attrCode, $value); - $result |= parent::validate($object); - - if ($result) { - break; - } - } - - if (is_null($oldAttrValue)) { - $object->unsetData($attrCode); - } else { - $object->setData($attrCode, $oldAttrValue); - } - - return (bool) $result; - } - } - - /** - * Correct '==' and '!=' operators - * Categories can't be equal because product is included categories selected by administrator and in their parents - * - * @return string - */ - public function getOperatorForValidate() - { - $op = $this->getOperator(); - if ($this->getInputType() == 'category') { - if ($op == '==') { - $op = '{}'; - } elseif ($op == '!=') { - $op = '!{}'; - } - } - return $op; - } } diff --git a/app/code/core/Mage/CatalogRule/Model/Rule/Product/Price.php b/app/code/core/Mage/CatalogRule/Model/Rule/Product/Price.php index 1ce69281f9..8aa0b4e4e5 100644 --- a/app/code/core/Mage/CatalogRule/Model/Rule/Product/Price.php +++ b/app/code/core/Mage/CatalogRule/Model/Rule/Product/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogRule/etc/adminhtml.xml b/app/code/core/Mage/CatalogRule/etc/adminhtml.xml index 7c5d3c4c47..d9d21da21e 100644 --- a/app/code/core/Mage/CatalogRule/etc/adminhtml.xml +++ b/app/code/core/Mage/CatalogRule/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_CatalogRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/CatalogRule/etc/config.xml b/app/code/core/Mage/CatalogRule/etc/config.xml index 918026fc76..9f2375d2e2 100644 --- a/app/code/core/Mage/CatalogRule/etc/config.xml +++ b/app/code/core/Mage/CatalogRule/etc/config.xml @@ -21,14 +21,14 @@ * * @category Mage * @package Mage_CatalogRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> - 1.6.0.1 + 1.6.0.3 @@ -61,6 +61,12 @@
     
    - +
    @@ -166,6 +167,7 @@ diff --git a/js/tiny_mce/plugins/table/editor_plugin.js b/js/tiny_mce/plugins/table/editor_plugin.js index 266d7d5371..2f3b0e2d7a 100644 --- a/js/tiny_mce/plugins/table/editor_plugin.js +++ b/js/tiny_mce/plugins/table/editor_plugin.js @@ -1 +1 @@ -(function(b){var c=b.each;function a(F,E,I){var e,J,B,n;r();n=E.getParent(I.getStart(),"th,td");if(n){J=D(n);B=G();n=v(J.x,J.y)}function w(L,K){L=L.cloneNode(K);L.removeAttribute("id");return L}function r(){var K=0;e=[];c(["thead","tbody","tfoot"],function(L){var M=E.select(L+" tr",F);c(M,function(N,O){O+=K;c(E.select("td,th",N),function(U,P){var Q,R,S,T;if(e[O]){while(e[O][P]){P++}}S=g(U,"rowspan");T=g(U,"colspan");for(R=O;R'}return false}},"childNodes");K=w(K,false);K.rowSpan=K.colSpan=1;if(L){K.appendChild(L)}else{if(!b.isIE){K.innerHTML='
    '}}return K}function p(){var K=E.createRng();c(E.select("tr",F),function(L){if(L.cells.length==0){E.remove(L)}});if(E.select("tr",F).length==0){K.setStartAfter(F);K.setEndAfter(F);I.setRng(K);E.remove(F);return}c(E.select("thead,tbody,tfoot",F),function(L){if(L.rows.length==0){E.remove(L)}});r();row=e[Math.min(e.length-1,J.y)];if(row){I.select(row[Math.min(row.length-1,J.x)].elm,true);I.collapse(true)}}function s(Q,O,S,P){var N,L,K,M,R;N=e[O][Q].elm.parentNode;for(K=1;K<=S;K++){N=E.getNext(N,"tr");if(N){for(L=Q;L>=0;L--){R=e[O+K][L].elm;if(R.parentNode==N){for(M=1;M<=P;M++){E.insertAfter(d(R),R)}break}}if(L==-1){for(M=1;M<=P;M++){N.insertBefore(d(N.cells[0]),N.cells[0])}}}}}function A(){c(e,function(K,L){c(K,function(N,M){var Q,P,R,O;if(h(N)){N=N.elm;Q=g(N,"colspan");P=g(N,"rowspan");if(Q>1||P>1){N.colSpan=N.rowSpan=1;for(O=0;O1){P.rowSpan=rowSpan+1;continue}}else{if(K>0&&e[K-1][O]){S=e[K-1][O].elm;rowSpan=g(S,"rowspan");if(rowSpan>1){S.rowSpan=rowSpan+1;continue}}}L=d(P);L.colSpan=P.colSpan;R.appendChild(L);M=P}}if(R.hasChildNodes()){if(!N){E.insertAfter(R,Q)}else{Q.parentNode.insertBefore(R,Q)}}}function f(L){var M,K;c(e,function(N,O){c(N,function(Q,P){if(h(Q)){M=P;if(L){return false}}});if(L){return !M}});c(e,function(Q,R){var N=Q[M].elm,O,P;if(N!=K){P=g(N,"colspan");O=g(N,"rowspan");if(P==1){if(!L){E.insertAfter(d(N),N);s(M,R,O-1,P)}else{N.parentNode.insertBefore(d(N),N);s(M,R,O-1,P)}}else{N.colSpan++}K=N}})}function m(){var K=[];c(e,function(L,M){c(L,function(O,N){if(h(O)&&b.inArray(K,N)===-1){c(e,function(R){var P=R[N].elm,Q;Q=g(P,"colspan");if(Q>1){P.colSpan=Q-1}else{E.remove(P)}});K.push(N)}})});p()}function l(){var L;function K(O){var N,P,M;N=E.getNext(O,"tr");c(O.cells,function(Q){var R=g(Q,"rowspan");if(R>1){Q.rowSpan=R-1;P=D(Q);s(P.x,P.y,1,1)}});P=D(O.cells[0]);c(e[P.y],function(Q){var R;Q=Q.elm;if(Q!=M){R=g(Q,"rowspan");if(R<=1){E.remove(Q)}else{Q.rowSpan=R-1}M=Q}})}L=j();c(L.reverse(),function(M){K(M)});p()}function C(){var K=j();E.remove(K);p();return K}function H(){var K=j();c(K,function(M,L){K[L]=w(M,true)});return K}function z(M,L){var N=j(),K=N[L?0:N.length-1],O=K.cells.length;c(e,function(Q){var P;O=0;c(Q,function(S,R){if(S.real){O+=S.colspan}if(S.elm.parentNode==K){P=1}});if(P){return false}});if(!L){M.reverse()}c(M,function(R){var Q=R.cells.length,P;for(i=0;iL){L=P}if(O>K){K=O}if(Q.real){S=Q.colspan-1;R=Q.rowspan-1;if(S){if(P+S>L){L=P+S}}if(R){if(O+R>K){K=O+R}}}}})});return{x:L,y:K}}function t(Q){var N,M,S,R,L,K,O,P;B=D(Q);if(J&&B){N=Math.min(J.x,B.x);M=Math.min(J.y,B.y);S=Math.max(J.x,B.x);R=Math.max(J.y,B.y);L=S;K=R;for(y=M;y<=K;y++){Q=e[y][N];if(!Q.real){if(N-(Q.colspan-1)L){L=x+O}}if(P){if(y+P>K){K=y+P}}}}}E.removeClass(E.select("td.mceSelected,th.mceSelected"),"mceSelected");for(y=M;y<=K;y++){for(x=N;x<=L;x++){E.addClass(e[y][x].elm,"mceSelected")}}}}b.extend(this,{deleteTable:q,split:A,merge:o,insertRow:k,insertCol:f,deleteCols:m,deleteRows:l,cutRows:C,copyRows:H,pasteRows:z,getPos:D,setStartCell:u,setEndCell:t})}b.create("tinymce.plugins.TablePlugin",{init:function(e,f){var d,j;function h(m){var l=e.selection,k=e.dom.getParent(m||l.getNode(),"table");if(k){return new a(k,e.dom,l)}}function g(){e.getBody().style.webkitUserSelect="";e.dom.removeClass(e.dom.select("td.mceSelected,th.mceSelected"),"mceSelected")}c([["table","table.desc","mceInsertTable",true],["delete_table","table.del","mceTableDelete"],["delete_col","table.delete_col_desc","mceTableDeleteCol"],["delete_row","table.delete_row_desc","mceTableDeleteRow"],["col_after","table.col_after_desc","mceTableInsertColAfter"],["col_before","table.col_before_desc","mceTableInsertColBefore"],["row_after","table.row_after_desc","mceTableInsertRowAfter"],["row_before","table.row_before_desc","mceTableInsertRowBefore"],["row_props","table.row_desc","mceTableRowProps",true],["cell_props","table.cell_desc","mceTableCellProps",true],["split_cells","table.split_cells_desc","mceTableSplitCells",true],["merge_cells","table.merge_cells_desc","mceTableMergeCells",true]],function(k){e.addButton(k[0],{title:k[1],cmd:k[2],ui:k[3]})});if(!b.isIE){e.onClick.add(function(k,l){l=l.target;if(l.nodeName==="TABLE"){k.selection.select(l)}})}e.onNodeChange.add(function(l,k,o){var m;o=l.selection.getStart();m=l.dom.getParent(o,"td,th,caption");k.setActive("table",o.nodeName==="TABLE"||!!m);if(m&&m.nodeName==="CAPTION"){m=0}k.setDisabled("delete_table",!m);k.setDisabled("delete_col",!m);k.setDisabled("delete_table",!m);k.setDisabled("delete_row",!m);k.setDisabled("col_after",!m);k.setDisabled("col_before",!m);k.setDisabled("row_after",!m);k.setDisabled("row_before",!m);k.setDisabled("row_props",!m);k.setDisabled("cell_props",!m);k.setDisabled("split_cells",!m);k.setDisabled("merge_cells",!m)});e.onInit.add(function(l){var k,o,p=l.dom,m;d=l.windowManager;l.onMouseDown.add(function(q,r){if(r.button!=2){g();o=p.getParent(r.target,"td,th");k=p.getParent(o,"table")}});p.bind(l.getDoc(),"mouseover",function(t){var r,q,s=t.target;if(o&&(m||s!=o)&&(s.nodeName=="TD"||s.nodeName=="TH")){q=p.getParent(s,"table");if(q==k){if(!m){m=h(q);m.setStartCell(o);l.getBody().style.webkitUserSelect="none"}m.setEndCell(s)}r=l.selection.getSel();if(r.removeAllRanges){r.removeAllRanges()}else{r.empty()}t.preventDefault()}});l.onMouseUp.add(function(z,A){var r,t=z.selection,B,C=t.getSel(),q,u,s,w;if(o){if(m){z.getBody().style.webkitUserSelect=""}function v(D,F){var E=new b.dom.TreeWalker(D,D);do{if(D.nodeType==3&&b.trim(D.nodeValue).length!=0){if(F){r.setStart(D,0)}else{r.setEnd(D,D.nodeValue.length)}return}if(D.nodeName=="BR"){if(F){r.setStartBefore(D)}else{r.setEndBefore(D)}return}}while(D=(F?E.next():E.prev()))}B=p.select("td.mceSelected,th.mceSelected");if(B.length>0){r=p.createRng();u=B[0];w=B[B.length-1];v(u,1);q=new b.dom.TreeWalker(u,p.getParent(B[0],"table"));do{if(u.nodeName=="TD"||u.nodeName=="TH"){if(!p.hasClass(u,"mceSelected")){break}s=u}}while(u=q.next());v(s);t.setRng(r)}z.nodeChanged();o=m=k=null}});l.onKeyUp.add(function(q,r){g()});if(l&&l.plugins.contextmenu){l.plugins.contextmenu.onContextMenu.add(function(s,q,u){var v,t=l.selection,r=t.getNode()||l.getBody();if(l.dom.getParent(u,"td")||l.dom.getParent(u,"th")||l.dom.select("td.mceSelected,th.mceSelected").length){q.removeAll();if(r.nodeName=="A"&&!l.dom.getAttrib(r,"name")){q.add({title:"advanced.link_desc",icon:"link",cmd:l.plugins.advlink?"mceAdvLink":"mceLink",ui:true});q.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"});q.addSeparator()}if(r.nodeName=="IMG"&&r.className.indexOf("mceItem")==-1){q.add({title:"advanced.image_desc",icon:"image",cmd:l.plugins.advimage?"mceAdvImage":"mceImage",ui:true});q.addSeparator()}q.add({title:"table.desc",icon:"table",cmd:"mceInsertTable",value:{action:"insert"}});q.add({title:"table.props_desc",icon:"table_props",cmd:"mceInsertTable"});q.add({title:"table.del",icon:"delete_table",cmd:"mceTableDelete"});q.addSeparator();v=q.addMenu({title:"table.cell"});v.add({title:"table.cell_desc",icon:"cell_props",cmd:"mceTableCellProps"});v.add({title:"table.split_cells_desc",icon:"split_cells",cmd:"mceTableSplitCells"});v.add({title:"table.merge_cells_desc",icon:"merge_cells",cmd:"mceTableMergeCells"});v=q.addMenu({title:"table.row"});v.add({title:"table.row_desc",icon:"row_props",cmd:"mceTableRowProps"});v.add({title:"table.row_before_desc",icon:"row_before",cmd:"mceTableInsertRowBefore"});v.add({title:"table.row_after_desc",icon:"row_after",cmd:"mceTableInsertRowAfter"});v.add({title:"table.delete_row_desc",icon:"delete_row",cmd:"mceTableDeleteRow"});v.addSeparator();v.add({title:"table.cut_row_desc",icon:"cut",cmd:"mceTableCutRow"});v.add({title:"table.copy_row_desc",icon:"copy",cmd:"mceTableCopyRow"});v.add({title:"table.paste_row_before_desc",icon:"paste",cmd:"mceTablePasteRowBefore"}).setDisabled(!j);v.add({title:"table.paste_row_after_desc",icon:"paste",cmd:"mceTablePasteRowAfter"}).setDisabled(!j);v=q.addMenu({title:"table.col"});v.add({title:"table.col_before_desc",icon:"col_before",cmd:"mceTableInsertColBefore"});v.add({title:"table.col_after_desc",icon:"col_after",cmd:"mceTableInsertColAfter"});v.add({title:"table.delete_col_desc",icon:"delete_col",cmd:"mceTableDeleteCol"})}else{q.add({title:"table.desc",icon:"table",cmd:"mceInsertTable"})}})}if(!b.isIE){function n(){var q;for(q=l.getBody().lastChild;q&&q.nodeType==3&&!q.nodeValue.length;q=q.previousSibling){}if(q&&q.nodeName=="TABLE"){l.dom.add(l.getBody(),"p",null,'
    ')}}if(b.isGecko){l.onKeyDown.add(function(r,t){var q,s,u=r.dom;if(t.keyCode==37||t.keyCode==38){q=r.selection.getRng();s=u.getParent(q.startContainer,"table");if(s&&r.getBody().firstChild==s){if(isAtStart(q,s)){q=u.createRng();q.setStartBefore(s);q.setEndBefore(s);r.selection.setRng(q);t.preventDefault()}}}})}l.onKeyUp.add(n);l.onSetContent.add(n);l.onVisualAid.add(n);l.onPreProcess.add(function(q,s){var r=s.node.lastChild;if(r&&r.childNodes.length==1&&r.firstChild.nodeName=="BR"){q.dom.remove(r)}});n()}});c({mceTableSplitCells:function(k){k.split()},mceTableMergeCells:function(l){var m,n,k;k=e.dom.getParent(e.selection.getNode(),"th,td");if(k){m=k.rowSpan;n=k.colSpan}if(!e.dom.select("td.mceSelected,th.mceSelected").length){d.open({url:f+"/merge_cells.htm",width:240+parseInt(e.getLang("table.merge_cells_delta_width",0)),height:110+parseInt(e.getLang("table.merge_cells_delta_height",0)),inline:1},{rows:m,cols:n,onaction:function(o){l.merge(k,o.cols,o.rows)},plugin_url:f})}else{l.merge()}},mceTableInsertRowBefore:function(k){k.insertRow(true)},mceTableInsertRowAfter:function(k){k.insertRow()},mceTableInsertColBefore:function(k){k.insertCol(true)},mceTableInsertColAfter:function(k){k.insertCol()},mceTableDeleteCol:function(k){k.deleteCols()},mceTableDeleteRow:function(k){k.deleteRows()},mceTableCutRow:function(k){j=k.cutRows()},mceTableCopyRow:function(k){j=k.copyRows()},mceTablePasteRowBefore:function(k){k.pasteRows(j,true)},mceTablePasteRowAfter:function(k){k.pasteRows(j)},mceTableDelete:function(k){k.deleteTable()}},function(l,k){e.addCommand(k,function(){var m=h();if(m){l(m);e.execCommand("mceRepaint");g()}})});c({mceInsertTable:function(k){d.open({url:f+"/table.htm",width:400+parseInt(e.getLang("table.table_delta_width",0)),height:320+parseInt(e.getLang("table.table_delta_height",0)),inline:1},{plugin_url:f,action:k?k.action:0})},mceTableRowProps:function(){d.open({url:f+"/row.htm",width:400+parseInt(e.getLang("table.rowprops_delta_width",0)),height:295+parseInt(e.getLang("table.rowprops_delta_height",0)),inline:1},{plugin_url:f})},mceTableCellProps:function(){d.open({url:f+"/cell.htm",width:400+parseInt(e.getLang("table.cellprops_delta_width",0)),height:295+parseInt(e.getLang("table.cellprops_delta_height",0)),inline:1},{plugin_url:f})}},function(l,k){e.addCommand(k,function(m,n){l(n)})})}});b.PluginManager.add("table",b.plugins.TablePlugin)})(tinymce); \ No newline at end of file +(function(d){var e=d.each;function c(g,h){var j=h.ownerDocument,f=j.createRange(),k;f.setStartBefore(h);f.setEnd(g.endContainer,g.endOffset);k=j.createElement("body");k.appendChild(f.cloneContents());return k.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi,"-").replace(/<[^>]+>/g,"").length==0}function a(g,f){return parseInt(g.getAttribute(f)||1)}function b(H,G,K){var g,L,D,o;t();o=G.getParent(K.getStart(),"th,td");if(o){L=F(o);D=I();o=z(L.x,L.y)}function A(N,M){N=N.cloneNode(M);N.removeAttribute("id");return N}function t(){var M=0;g=[];e(["thead","tbody","tfoot"],function(N){var O=G.select("> "+N+" tr",H);e(O,function(P,Q){Q+=M;e(G.select("> td, > th",P),function(W,R){var S,T,U,V;if(g[Q]){while(g[Q][R]){R++}}U=a(W,"rowspan");V=a(W,"colspan");for(T=Q;T'}return false}},"childNodes");M=A(M,false);s(M,"rowSpan",1);s(M,"colSpan",1);if(N){M.appendChild(N)}else{if(!d.isIE){M.innerHTML='
    '}}return M}function q(){var M=G.createRng();e(G.select("tr",H),function(N){if(N.cells.length==0){G.remove(N)}});if(G.select("tr",H).length==0){M.setStartAfter(H);M.setEndAfter(H);K.setRng(M);G.remove(H);return}e(G.select("thead,tbody,tfoot",H),function(N){if(N.rows.length==0){G.remove(N)}});t();row=g[Math.min(g.length-1,L.y)];if(row){K.select(row[Math.min(row.length-1,L.x)].elm,true);K.collapse(true)}}function u(S,Q,U,R){var P,N,M,O,T;P=g[Q][S].elm.parentNode;for(M=1;M<=U;M++){P=G.getNext(P,"tr");if(P){for(N=S;N>=0;N--){T=g[Q+M][N].elm;if(T.parentNode==P){for(O=1;O<=R;O++){G.insertAfter(f(T),T)}break}}if(N==-1){for(O=1;O<=R;O++){P.insertBefore(f(P.cells[0]),P.cells[0])}}}}}function C(){e(g,function(M,N){e(M,function(P,O){var S,R,T,Q;if(j(P)){P=P.elm;S=a(P,"colspan");R=a(P,"rowspan");if(S>1||R>1){s(P,"rowSpan",1);s(P,"colSpan",1);for(Q=0;Q1){s(S,"rowSpan",O+1);continue}}else{if(M>0&&g[M-1][R]){V=g[M-1][R].elm;O=a(V,"rowSpan");if(O>1){s(V,"rowSpan",O+1);continue}}}N=f(S);s(N,"colSpan",S.colSpan);U.appendChild(N);P=S}}if(U.hasChildNodes()){if(!Q){G.insertAfter(U,T)}else{T.parentNode.insertBefore(U,T)}}}function h(N){var O,M;e(g,function(P,Q){e(P,function(S,R){if(j(S)){O=R;if(N){return false}}});if(N){return !O}});e(g,function(S,T){var P,Q,R;if(!S[O]){return}P=S[O].elm;if(P!=M){R=a(P,"colspan");Q=a(P,"rowspan");if(R==1){if(!N){G.insertAfter(f(P),P);u(O,T,Q-1,R)}else{P.parentNode.insertBefore(f(P),P);u(O,T,Q-1,R)}}else{s(P,"colSpan",P.colSpan+1)}M=P}})}function n(){var M=[];e(g,function(N,O){e(N,function(Q,P){if(j(Q)&&d.inArray(M,P)===-1){e(g,function(T){var R=T[P].elm,S;S=a(R,"colSpan");if(S>1){s(R,"colSpan",S-1)}else{G.remove(R)}});M.push(P)}})});q()}function m(){var N;function M(Q){var P,R,O;P=G.getNext(Q,"tr");e(Q.cells,function(S){var T=a(S,"rowSpan");if(T>1){s(S,"rowSpan",T-1);R=F(S);u(R.x,R.y,1,1)}});R=F(Q.cells[0]);e(g[R.y],function(S){var T;S=S.elm;if(S!=O){T=a(S,"rowSpan");if(T<=1){G.remove(S)}else{s(S,"rowSpan",T-1)}O=S}})}N=k();e(N.reverse(),function(O){M(O)});q()}function E(){var M=k();G.remove(M);q();return M}function J(){var M=k();e(M,function(O,N){M[N]=A(O,true)});return M}function B(O,N){var P=k(),M=P[N?0:P.length-1],Q=M.cells.length;e(g,function(S){var R;Q=0;e(S,function(U,T){if(U.real){Q+=U.colspan}if(U.elm.parentNode==M){R=1}});if(R){return false}});if(!N){O.reverse()}e(O,function(T){var S=T.cells.length,R;for(i=0;iN){N=R}if(Q>M){M=Q}if(S.real){U=S.colspan-1;T=S.rowspan-1;if(U){if(R+U>N){N=R+U}}if(T){if(Q+T>M){M=Q+T}}}}})});return{x:N,y:M}}function v(S){var P,O,U,T,N,M,Q,R;D=F(S);if(L&&D){P=Math.min(L.x,D.x);O=Math.min(L.y,D.y);U=Math.max(L.x,D.x);T=Math.max(L.y,D.y);N=U;M=T;for(y=O;y<=M;y++){S=g[y][P];if(!S.real){if(P-(S.colspan-1)N){N=x+Q}}if(R){if(y+R>M){M=y+R}}}}}G.removeClass(G.select("td.mceSelected,th.mceSelected"),"mceSelected");for(y=O;y<=M;y++){for(x=P;x<=N;x++){if(g[y][x]){G.addClass(g[y][x].elm,"mceSelected")}}}}}d.extend(this,{deleteTable:r,split:C,merge:p,insertRow:l,insertCol:h,deleteCols:n,deleteRows:m,cutRows:E,copyRows:J,pasteRows:B,getPos:F,setStartCell:w,setEndCell:v})}d.create("tinymce.plugins.TablePlugin",{init:function(g,h){var f,m,j=true;function l(p){var o=g.selection,n=g.dom.getParent(p||o.getNode(),"table");if(n){return new b(n,g.dom,o)}}function k(){g.getBody().style.webkitUserSelect="";if(j){g.dom.removeClass(g.dom.select("td.mceSelected,th.mceSelected"),"mceSelected");j=false}}e([["table","table.desc","mceInsertTable",true],["delete_table","table.del","mceTableDelete"],["delete_col","table.delete_col_desc","mceTableDeleteCol"],["delete_row","table.delete_row_desc","mceTableDeleteRow"],["col_after","table.col_after_desc","mceTableInsertColAfter"],["col_before","table.col_before_desc","mceTableInsertColBefore"],["row_after","table.row_after_desc","mceTableInsertRowAfter"],["row_before","table.row_before_desc","mceTableInsertRowBefore"],["row_props","table.row_desc","mceTableRowProps",true],["cell_props","table.cell_desc","mceTableCellProps",true],["split_cells","table.split_cells_desc","mceTableSplitCells",true],["merge_cells","table.merge_cells_desc","mceTableMergeCells",true]],function(n){g.addButton(n[0],{title:n[1],cmd:n[2],ui:n[3]})});if(!d.isIE){g.onClick.add(function(n,o){o=o.target;if(o.nodeName==="TABLE"){n.selection.select(o);n.nodeChanged()}})}g.onPreProcess.add(function(o,p){var n,q,r,t=o.dom,s;n=t.select("table",p.node);q=n.length;while(q--){r=n[q];t.setAttrib(r,"data-mce-style","");if((s=t.getAttrib(r,"width"))){t.setStyle(r,"width",s);t.setAttrib(r,"width","")}if((s=t.getAttrib(r,"height"))){t.setStyle(r,"height",s);t.setAttrib(r,"height","")}}});g.onNodeChange.add(function(q,o,s){var r;s=q.selection.getStart();r=q.dom.getParent(s,"td,th,caption");o.setActive("table",s.nodeName==="TABLE"||!!r);if(r&&r.nodeName==="CAPTION"){r=0}o.setDisabled("delete_table",!r);o.setDisabled("delete_col",!r);o.setDisabled("delete_table",!r);o.setDisabled("delete_row",!r);o.setDisabled("col_after",!r);o.setDisabled("col_before",!r);o.setDisabled("row_after",!r);o.setDisabled("row_before",!r);o.setDisabled("row_props",!r);o.setDisabled("cell_props",!r);o.setDisabled("split_cells",!r);o.setDisabled("merge_cells",!r)});g.onInit.add(function(r){var p,t,q=r.dom,u;f=r.windowManager;r.onMouseDown.add(function(w,z){if(z.button!=2){k();t=q.getParent(z.target,"td,th");p=q.getParent(t,"table")}});q.bind(r.getDoc(),"mouseover",function(C){var A,z,B=C.target;if(t&&(u||B!=t)&&(B.nodeName=="TD"||B.nodeName=="TH")){z=q.getParent(B,"table");if(z==p){if(!u){u=l(z);u.setStartCell(t);r.getBody().style.webkitUserSelect="none"}u.setEndCell(B);j=true}A=r.selection.getSel();try{if(A.removeAllRanges){A.removeAllRanges()}else{A.empty()}}catch(w){}C.preventDefault()}});r.onMouseUp.add(function(F,G){var z,B=F.selection,H,I=B.getSel(),w,C,A,E;if(t){if(u){F.getBody().style.webkitUserSelect=""}function D(J,L){var K=new d.dom.TreeWalker(J,J);do{if(J.nodeType==3&&d.trim(J.nodeValue).length!=0){if(L){z.setStart(J,0)}else{z.setEnd(J,J.nodeValue.length)}return}if(J.nodeName=="BR"){if(L){z.setStartBefore(J)}else{z.setEndBefore(J)}return}}while(J=(L?K.next():K.prev()))}H=q.select("td.mceSelected,th.mceSelected");if(H.length>0){z=q.createRng();C=H[0];E=H[H.length-1];z.setStartBefore(C);z.setEndAfter(C);D(C,1);w=new d.dom.TreeWalker(C,q.getParent(H[0],"table"));do{if(C.nodeName=="TD"||C.nodeName=="TH"){if(!q.hasClass(C,"mceSelected")){break}A=C}}while(C=w.next());D(A);B.setRng(z)}F.nodeChanged();t=u=p=null}});r.onKeyUp.add(function(w,z){k()});r.onKeyDown.add(function(w,z){n(w)});r.onMouseDown.add(function(w,z){if(z.button!=2){n(w)}});function o(D,z,A,F){var B=3,G=D.dom.getParent(z.startContainer,"TABLE"),C,w,E;if(G){C=G.parentNode}w=z.startContainer.nodeType==B&&z.startOffset==0&&z.endOffset==0&&F&&(A.nodeName=="TR"||A==C);E=(A.nodeName=="TD"||A.nodeName=="TH")&&!F;return w||E}function n(A){if(!d.isWebKit){return}var z=A.selection.getRng();var C=A.selection.getNode();var B=A.dom.getParent(z.startContainer,"TD,TH");if(!o(A,z,C,B)){return}if(!B){B=C}var w=B.lastChild;while(w.lastChild){w=w.lastChild}z.setEnd(w,w.nodeValue.length);A.selection.setRng(z)}r.plugins.table.fixTableCellSelection=n;if(r&&r.plugins.contextmenu){r.plugins.contextmenu.onContextMenu.add(function(A,w,C){var D,B=r.selection,z=B.getNode()||r.getBody();if(r.dom.getParent(C,"td")||r.dom.getParent(C,"th")||r.dom.select("td.mceSelected,th.mceSelected").length){w.removeAll();if(z.nodeName=="A"&&!r.dom.getAttrib(z,"name")){w.add({title:"advanced.link_desc",icon:"link",cmd:r.plugins.advlink?"mceAdvLink":"mceLink",ui:true});w.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"});w.addSeparator()}if(z.nodeName=="IMG"&&z.className.indexOf("mceItem")==-1){w.add({title:"advanced.image_desc",icon:"image",cmd:r.plugins.advimage?"mceAdvImage":"mceImage",ui:true});w.addSeparator()}w.add({title:"table.desc",icon:"table",cmd:"mceInsertTable",value:{action:"insert"}});w.add({title:"table.props_desc",icon:"table_props",cmd:"mceInsertTable"});w.add({title:"table.del",icon:"delete_table",cmd:"mceTableDelete"});w.addSeparator();D=w.addMenu({title:"table.cell"});D.add({title:"table.cell_desc",icon:"cell_props",cmd:"mceTableCellProps"});D.add({title:"table.split_cells_desc",icon:"split_cells",cmd:"mceTableSplitCells"});D.add({title:"table.merge_cells_desc",icon:"merge_cells",cmd:"mceTableMergeCells"});D=w.addMenu({title:"table.row"});D.add({title:"table.row_desc",icon:"row_props",cmd:"mceTableRowProps"});D.add({title:"table.row_before_desc",icon:"row_before",cmd:"mceTableInsertRowBefore"});D.add({title:"table.row_after_desc",icon:"row_after",cmd:"mceTableInsertRowAfter"});D.add({title:"table.delete_row_desc",icon:"delete_row",cmd:"mceTableDeleteRow"});D.addSeparator();D.add({title:"table.cut_row_desc",icon:"cut",cmd:"mceTableCutRow"});D.add({title:"table.copy_row_desc",icon:"copy",cmd:"mceTableCopyRow"});D.add({title:"table.paste_row_before_desc",icon:"paste",cmd:"mceTablePasteRowBefore"}).setDisabled(!m);D.add({title:"table.paste_row_after_desc",icon:"paste",cmd:"mceTablePasteRowAfter"}).setDisabled(!m);D=w.addMenu({title:"table.col"});D.add({title:"table.col_before_desc",icon:"col_before",cmd:"mceTableInsertColBefore"});D.add({title:"table.col_after_desc",icon:"col_after",cmd:"mceTableInsertColAfter"});D.add({title:"table.delete_col_desc",icon:"delete_col",cmd:"mceTableDeleteCol"})}else{w.add({title:"table.desc",icon:"table",cmd:"mceInsertTable"})}})}if(d.isWebKit){function v(C,N){var L=d.VK;var Q=N.keyCode;function O(Y,U,S){var T=Y?"previousSibling":"nextSibling";var Z=C.dom.getParent(U,"tr");var X=Z[T];if(X){z(C,U,X,Y);d.dom.Event.cancel(S);return true}else{var aa=C.dom.getParent(Z,"table");var W=Z.parentNode;var R=W.nodeName.toLowerCase();if(R==="tbody"||R===(Y?"tfoot":"thead")){var V=w(Y,aa,W,"tbody");if(V!==null){return K(Y,V,U,S)}}return M(Y,Z,T,aa,S)}}function w(V,T,U,X){var S=C.dom.select(">"+X,T);var R=S.indexOf(U);if(V&&R===0||!V&&R===S.length-1){return B(V,T)}else{if(R===-1){var W=U.tagName.toLowerCase()==="thead"?0:S.length-1;return S[W]}else{return S[R+(V?-1:1)]}}}function B(U,T){var S=U?"thead":"tfoot";var R=C.dom.select(">"+S,T);return R.length!==0?R[0]:null}function K(V,T,S,U){var R=J(T,V);R&&z(C,S,R,V);d.dom.Event.cancel(U);return true}function M(Y,U,R,X,W){var S=X[R];if(S){F(S);return true}else{var V=C.dom.getParent(X,"td,th");if(V){return O(Y,V,W)}else{var T=J(U,!Y);F(T);return d.dom.Event.cancel(W)}}}function J(S,R){return S&&S[R?"lastChild":"firstChild"]}function F(R){C.selection.setCursorLocation(R,0)}function A(){return Q==L.UP||Q==L.DOWN}function D(R){var T=R.selection.getNode();var S=R.dom.getParent(T,"tr");return S!==null}function P(S){var R=0;var T=S;while(T.previousSibling){T=T.previousSibling;R=R+a(T,"colspan")}return R}function E(T,R){var U=0;var S=0;e(T.children,function(V,W){U=U+a(V,"colspan");S=W;if(U>R){return false}});return S}function z(T,W,Y,V){var X=P(T.dom.getParent(W,"td,th"));var S=E(Y,X);var R=Y.childNodes[S];var U=J(R,V);F(U||R)}function H(R){var T=C.selection.getNode();var U=C.dom.getParent(T,"td,th");var S=C.dom.getParent(R,"td,th");return U&&U!==S&&I(U,S)}function I(S,R){return C.dom.getParent(S,"TABLE")===C.dom.getParent(R,"TABLE")}if(A()&&D(C)){var G=C.selection.getNode();setTimeout(function(){if(H(G)){O(!N.shiftKey&&Q===L.UP,G,N)}},0)}}r.onKeyDown.add(v)}if(!d.isIE){function s(){var w;for(w=r.getBody().lastChild;w&&w.nodeType==3&&!w.nodeValue.length;w=w.previousSibling){}if(w&&w.nodeName=="TABLE"){r.dom.add(r.getBody(),"p",null,'
    ')}}if(d.isGecko){r.onKeyDown.add(function(z,B){var w,A,C=z.dom;if(B.keyCode==37||B.keyCode==38){w=z.selection.getRng();A=C.getParent(w.startContainer,"table");if(A&&z.getBody().firstChild==A){if(c(w,A)){w=C.createRng();w.setStartBefore(A);w.setEndBefore(A);z.selection.setRng(w);B.preventDefault()}}}})}r.onKeyUp.add(s);r.onSetContent.add(s);r.onVisualAid.add(s);r.onPreProcess.add(function(w,A){var z=A.node.lastChild;if(z&&z.childNodes.length==1&&z.firstChild.nodeName=="BR"){w.dom.remove(z)}});s();r.startContent=r.getContent({format:"raw"})}});e({mceTableSplitCells:function(n){n.split()},mceTableMergeCells:function(o){var p,q,n;n=g.dom.getParent(g.selection.getNode(),"th,td");if(n){p=n.rowSpan;q=n.colSpan}if(!g.dom.select("td.mceSelected,th.mceSelected").length){f.open({url:h+"/merge_cells.htm",width:240+parseInt(g.getLang("table.merge_cells_delta_width",0)),height:110+parseInt(g.getLang("table.merge_cells_delta_height",0)),inline:1},{rows:p,cols:q,onaction:function(r){o.merge(n,r.cols,r.rows)},plugin_url:h})}else{o.merge()}},mceTableInsertRowBefore:function(n){n.insertRow(true)},mceTableInsertRowAfter:function(n){n.insertRow()},mceTableInsertColBefore:function(n){n.insertCol(true)},mceTableInsertColAfter:function(n){n.insertCol()},mceTableDeleteCol:function(n){n.deleteCols()},mceTableDeleteRow:function(n){n.deleteRows()},mceTableCutRow:function(n){m=n.cutRows()},mceTableCopyRow:function(n){m=n.copyRows()},mceTablePasteRowBefore:function(n){n.pasteRows(m,true)},mceTablePasteRowAfter:function(n){n.pasteRows(m)},mceTableDelete:function(n){n.deleteTable()}},function(o,n){g.addCommand(n,function(){var p=l();if(p){o(p);g.execCommand("mceRepaint");k()}})});e({mceInsertTable:function(n){f.open({url:h+"/table.htm",width:400+parseInt(g.getLang("table.table_delta_width",0)),height:320+parseInt(g.getLang("table.table_delta_height",0)),inline:1},{plugin_url:h,action:n?n.action:0})},mceTableRowProps:function(){f.open({url:h+"/row.htm",width:400+parseInt(g.getLang("table.rowprops_delta_width",0)),height:295+parseInt(g.getLang("table.rowprops_delta_height",0)),inline:1},{plugin_url:h})},mceTableCellProps:function(){f.open({url:h+"/cell.htm",width:400+parseInt(g.getLang("table.cellprops_delta_width",0)),height:295+parseInt(g.getLang("table.cellprops_delta_height",0)),inline:1},{plugin_url:h})}},function(o,n){g.addCommand(n,function(p,q){o(q)})})}});d.PluginManager.add("table",d.plugins.TablePlugin)})(tinymce); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/editor_plugin_src.js b/js/tiny_mce/plugins/table/editor_plugin_src.js index c2f307f045..8170e4ed44 100644 --- a/js/tiny_mce/plugins/table/editor_plugin_src.js +++ b/js/tiny_mce/plugins/table/editor_plugin_src.js @@ -1,1125 +1,1408 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function(tinymce) { - var each = tinymce.each; - - /** - * Table Grid class. - */ - function TableGrid(table, dom, selection) { - var grid, startPos, endPos, selectedCell; - - buildGrid(); - selectedCell = dom.getParent(selection.getStart(), 'th,td'); - if (selectedCell) { - startPos = getPos(selectedCell); - endPos = findEndPos(); - selectedCell = getCell(startPos.x, startPos.y); - } - - function cloneNode(node, children) { - node = node.cloneNode(children); - node.removeAttribute('id'); - - return node; - } - - function buildGrid() { - var startY = 0; - - grid = []; - - each(['thead', 'tbody', 'tfoot'], function(part) { - var rows = dom.select(part + ' tr', table); - - each(rows, function(tr, y) { - y += startY; - - each(dom.select('td,th', tr), function(td, x) { - var x2, y2, rowspan, colspan; - - // Skip over existing cells produced by rowspan - if (grid[y]) { - while (grid[y][x]) - x++; - } - - // Get col/rowspan from cell - rowspan = getSpanVal(td, 'rowspan'); - colspan = getSpanVal(td, 'colspan'); - - // Fill out rowspan/colspan right and down - for (y2 = y; y2 < y + rowspan; y2++) { - if (!grid[y2]) - grid[y2] = []; - - for (x2 = x; x2 < x + colspan; x2++) { - grid[y2][x2] = { - part : part, - real : y2 == y && x2 == x, - elm : td, - rowspan : rowspan, - colspan : colspan - }; - } - } - }); - }); - - startY += rows.length; - }); - }; - - function getCell(x, y) { - var row; - - row = grid[y]; - if (row) - return row[x]; - }; - - function getSpanVal(td, name) { - return parseInt(td.getAttribute(name) || 1); - }; - - function isCellSelected(cell) { - return dom.hasClass(cell.elm, 'mceSelected') || cell == selectedCell; - }; - - function getSelectedRows() { - var rows = []; - - each(table.rows, function(row) { - each(row.cells, function(cell) { - if (dom.hasClass(cell, 'mceSelected') || cell == selectedCell.elm) { - rows.push(row); - return false; - } - }); - }); - - return rows; - }; - - function deleteTable() { - var rng = dom.createRng(); - - rng.setStartAfter(table); - rng.setEndAfter(table); - - selection.setRng(rng); - - dom.remove(table); - }; - - function cloneCell(cell) { - var formatNode; - - // Clone formats - tinymce.walk(cell, function(node) { - var curNode; - - if (node.nodeType == 3) { - each(dom.getParents(node.parentNode, null, cell).reverse(), function(node) { - node = cloneNode(node, false); - - if (!formatNode) - formatNode = curNode = node; - else if (curNode) - curNode.appendChild(node); - - curNode = node; - }); - - // Add something to the inner node - if (curNode) - curNode.innerHTML = tinymce.isIE ? ' ' : '
    '; - - return false; - } - }, 'childNodes'); - - cell = cloneNode(cell, false); - cell.rowSpan = cell.colSpan = 1; - - if (formatNode) { - cell.appendChild(formatNode); - } else { - if (!tinymce.isIE) - cell.innerHTML = '
    '; - } - - return cell; - }; - - function cleanup() { - var rng = dom.createRng(); - - // Empty rows - each(dom.select('tr', table), function(tr) { - if (tr.cells.length == 0) - dom.remove(tr); - }); - - // Empty table - if (dom.select('tr', table).length == 0) { - rng.setStartAfter(table); - rng.setEndAfter(table); - selection.setRng(rng); - dom.remove(table); - return; - } - - // Empty header/body/footer - each(dom.select('thead,tbody,tfoot', table), function(part) { - if (part.rows.length == 0) - dom.remove(part); - }); - - // Restore selection to start position if it still exists - buildGrid(); - - // Restore the selection to the closest table position - row = grid[Math.min(grid.length - 1, startPos.y)]; - if (row) { - selection.select(row[Math.min(row.length - 1, startPos.x)].elm, true); - selection.collapse(true); - } - }; - - function fillLeftDown(x, y, rows, cols) { - var tr, x2, r, c, cell; - - tr = grid[y][x].elm.parentNode; - for (r = 1; r <= rows; r++) { - tr = dom.getNext(tr, 'tr'); - - if (tr) { - // Loop left to find real cell - for (x2 = x; x2 >= 0; x2--) { - cell = grid[y + r][x2].elm; - - if (cell.parentNode == tr) { - // Append clones after - for (c = 1; c <= cols; c++) - dom.insertAfter(cloneCell(cell), cell); - - break; - } - } - - if (x2 == -1) { - // Insert nodes before first cell - for (c = 1; c <= cols; c++) - tr.insertBefore(cloneCell(tr.cells[0]), tr.cells[0]); - } - } - } - }; - - function split() { - each(grid, function(row, y) { - each(row, function(cell, x) { - var colSpan, rowSpan, newCell, i; - - if (isCellSelected(cell)) { - cell = cell.elm; - colSpan = getSpanVal(cell, 'colspan'); - rowSpan = getSpanVal(cell, 'rowspan'); - - if (colSpan > 1 || rowSpan > 1) { - cell.colSpan = cell.rowSpan = 1; - - // Insert cells right - for (i = 0; i < colSpan - 1; i++) - dom.insertAfter(cloneCell(cell), cell); - - fillLeftDown(x, y, rowSpan - 1, colSpan); - } - } - }); - }); - }; - - function merge(cell, cols, rows) { - var startX, startY, endX, endY, x, y, startCell, endCell, cell, children; - - // Use specified cell and cols/rows - if (cell) { - pos = getPos(cell); - startX = pos.x; - startY = pos.y; - endX = startX + (cols - 1); - endY = startY + (rows - 1); - } else { - // Use selection - startX = startPos.x; - startY = startPos.y; - endX = endPos.x; - endY = endPos.y; - } - - // Find start/end cells - startCell = getCell(startX, startY); - endCell = getCell(endX, endY); - - // Check if the cells exists and if they are of the same part for example tbody = tbody - if (startCell && endCell && startCell.part == endCell.part) { - // Split and rebuild grid - split(); - buildGrid(); - - // Set row/col span to start cell - startCell = getCell(startX, startY).elm; - startCell.colSpan = (endX - startX) + 1; - startCell.rowSpan = (endY - startY) + 1; - - // Remove other cells and add it's contents to the start cell - for (y = startY; y <= endY; y++) { - for (x = startX; x <= endX; x++) { - cell = grid[y][x].elm; - - if (cell != startCell) { - // Move children to startCell - children = tinymce.grep(cell.childNodes); - each(children, function(node, i) { - // Jump over last BR element - if (node.nodeName != 'BR' || i != children.length - 1) - startCell.appendChild(node); - }); - - // Remove cell - dom.remove(cell); - } - } - } - - // Remove empty rows etc and restore caret location - cleanup(); - } - }; - - function insertRow(before) { - var posY, cell, lastCell, x, rowElm, newRow, newCell, otherCell; - - // Find first/last row - each(grid, function(row, y) { - each(row, function(cell, x) { - if (isCellSelected(cell)) { - cell = cell.elm; - rowElm = cell.parentNode; - newRow = cloneNode(rowElm, false); - posY = y; - - if (before) - return false; - } - }); - - if (before) - return !posY; - }); - - for (x = 0; x < grid[0].length; x++) { - cell = grid[posY][x].elm; - - if (cell != lastCell) { - if (!before) { - rowSpan = getSpanVal(cell, 'rowspan'); - if (rowSpan > 1) { - cell.rowSpan = rowSpan + 1; - continue; - } - } else { - // Check if cell above can be expanded - if (posY > 0 && grid[posY - 1][x]) { - otherCell = grid[posY - 1][x].elm; - rowSpan = getSpanVal(otherCell, 'rowspan'); - if (rowSpan > 1) { - otherCell.rowSpan = rowSpan + 1; - continue; - } - } - } - - // Insert new cell into new row - newCell = cloneCell(cell) - newCell.colSpan = cell.colSpan; - newRow.appendChild(newCell); - - lastCell = cell; - } - } - - if (newRow.hasChildNodes()) { - if (!before) - dom.insertAfter(newRow, rowElm); - else - rowElm.parentNode.insertBefore(newRow, rowElm); - } - }; - - function insertCol(before) { - var posX, lastCell; - - // Find first/last column - each(grid, function(row, y) { - each(row, function(cell, x) { - if (isCellSelected(cell)) { - posX = x; - - if (before) - return false; - } - }); - - if (before) - return !posX; - }); - - each(grid, function(row, y) { - var cell = row[posX].elm, rowSpan, colSpan; - - if (cell != lastCell) { - colSpan = getSpanVal(cell, 'colspan'); - rowSpan = getSpanVal(cell, 'rowspan'); - - if (colSpan == 1) { - if (!before) { - dom.insertAfter(cloneCell(cell), cell); - fillLeftDown(posX, y, rowSpan - 1, colSpan); - } else { - cell.parentNode.insertBefore(cloneCell(cell), cell); - fillLeftDown(posX, y, rowSpan - 1, colSpan); - } - } else - cell.colSpan++; - - lastCell = cell; - } - }); - }; - - function deleteCols() { - var cols = []; - - // Get selected column indexes - each(grid, function(row, y) { - each(row, function(cell, x) { - if (isCellSelected(cell) && tinymce.inArray(cols, x) === -1) { - each(grid, function(row) { - var cell = row[x].elm, colSpan; - - colSpan = getSpanVal(cell, 'colspan'); - - if (colSpan > 1) - cell.colSpan = colSpan - 1; - else - dom.remove(cell); - }); - - cols.push(x); - } - }); - }); - - cleanup(); - }; - - function deleteRows() { - var rows; - - function deleteRow(tr) { - var nextTr, pos, lastCell; - - nextTr = dom.getNext(tr, 'tr'); - - // Move down row spanned cells - each(tr.cells, function(cell) { - var rowSpan = getSpanVal(cell, 'rowspan'); - - if (rowSpan > 1) { - cell.rowSpan = rowSpan - 1; - pos = getPos(cell); - fillLeftDown(pos.x, pos.y, 1, 1); - } - }); - - // Delete cells - pos = getPos(tr.cells[0]); - each(grid[pos.y], function(cell) { - var rowSpan; - - cell = cell.elm; - - if (cell != lastCell) { - rowSpan = getSpanVal(cell, 'rowspan'); - - if (rowSpan <= 1) - dom.remove(cell); - else - cell.rowSpan = rowSpan - 1; - - lastCell = cell; - } - }); - }; - - // Get selected rows and move selection out of scope - rows = getSelectedRows(); - - // Delete all selected rows - each(rows.reverse(), function(tr) { - deleteRow(tr); - }); - - cleanup(); - }; - - function cutRows() { - var rows = getSelectedRows(); - - dom.remove(rows); - cleanup(); - - return rows; - }; - - function copyRows() { - var rows = getSelectedRows(); - - each(rows, function(row, i) { - rows[i] = cloneNode(row, true); - }); - - return rows; - }; - - function pasteRows(rows, before) { - var selectedRows = getSelectedRows(), - targetRow = selectedRows[before ? 0 : selectedRows.length - 1], - targetCellCount = targetRow.cells.length; - - // Calc target cell count - each(grid, function(row) { - var match; - - targetCellCount = 0; - each(row, function(cell, x) { - if (cell.real) - targetCellCount += cell.colspan; - - if (cell.elm.parentNode == targetRow) - match = 1; - }); - - if (match) - return false; - }); - - if (!before) - rows.reverse(); - - each(rows, function(row) { - var cellCount = row.cells.length, cell; - - // Remove col/rowspans - for (i = 0; i < cellCount; i++) { - cell = row.cells[i]; - cell.colSpan = cell.rowSpan = 1; - } - - // Needs more cells - for (i = cellCount; i < targetCellCount; i++) - row.appendChild(cloneCell(row.cells[cellCount - 1])); - - // Needs less cells - for (i = targetCellCount; i < cellCount; i++) - dom.remove(row.cells[i]); - - // Add before/after - if (before) - targetRow.parentNode.insertBefore(row, targetRow); - else - dom.insertAfter(row, targetRow); - }); - }; - - function getPos(target) { - var pos; - - each(grid, function(row, y) { - each(row, function(cell, x) { - if (cell.elm == target) { - pos = {x : x, y : y}; - return false; - } - }); - - return !pos; - }); - - return pos; - }; - - function setStartCell(cell) { - startPos = getPos(cell); - }; - - function findEndPos() { - var pos, maxX, maxY; - - maxX = maxY = 0; - - each(grid, function(row, y) { - each(row, function(cell, x) { - var colSpan, rowSpan; - - if (isCellSelected(cell)) { - cell = grid[y][x]; - - if (x > maxX) - maxX = x; - - if (y > maxY) - maxY = y; - - if (cell.real) { - colSpan = cell.colspan - 1; - rowSpan = cell.rowspan - 1; - - if (colSpan) { - if (x + colSpan > maxX) - maxX = x + colSpan; - } - - if (rowSpan) { - if (y + rowSpan > maxY) - maxY = y + rowSpan; - } - } - } - }); - }); - - return {x : maxX, y : maxY}; - }; - - function setEndCell(cell) { - var startX, startY, endX, endY, maxX, maxY, colSpan, rowSpan; - - endPos = getPos(cell); - - if (startPos && endPos) { - // Get start/end positions - startX = Math.min(startPos.x, endPos.x); - startY = Math.min(startPos.y, endPos.y); - endX = Math.max(startPos.x, endPos.x); - endY = Math.max(startPos.y, endPos.y); - - // Expand end positon to include spans - maxX = endX; - maxY = endY; - - // Expand startX - for (y = startY; y <= maxY; y++) { - cell = grid[y][startX]; - - if (!cell.real) { - if (startX - (cell.colspan - 1) < startX) - startX -= cell.colspan - 1; - } - } - - // Expand startY - for (x = startX; x <= maxX; x++) { - cell = grid[startY][x]; - - if (!cell.real) { - if (startY - (cell.rowspan - 1) < startY) - startY -= cell.rowspan - 1; - } - } - - // Find max X, Y - for (y = startY; y <= endY; y++) { - for (x = startX; x <= endX; x++) { - cell = grid[y][x]; - - if (cell.real) { - colSpan = cell.colspan - 1; - rowSpan = cell.rowspan - 1; - - if (colSpan) { - if (x + colSpan > maxX) - maxX = x + colSpan; - } - - if (rowSpan) { - if (y + rowSpan > maxY) - maxY = y + rowSpan; - } - } - } - } - - // Remove current selection - dom.removeClass(dom.select('td.mceSelected,th.mceSelected'), 'mceSelected'); - - // Add new selection - for (y = startY; y <= maxY; y++) { - for (x = startX; x <= maxX; x++) - dom.addClass(grid[y][x].elm, 'mceSelected'); - } - } - }; - - // Expose to public - tinymce.extend(this, { - deleteTable : deleteTable, - split : split, - merge : merge, - insertRow : insertRow, - insertCol : insertCol, - deleteCols : deleteCols, - deleteRows : deleteRows, - cutRows : cutRows, - copyRows : copyRows, - pasteRows : pasteRows, - getPos : getPos, - setStartCell : setStartCell, - setEndCell : setEndCell - }); - }; - - tinymce.create('tinymce.plugins.TablePlugin', { - init : function(ed, url) { - var winMan, clipboardRows; - - function createTableGrid(node) { - var selection = ed.selection, tblElm = ed.dom.getParent(node || selection.getNode(), 'table'); - - if (tblElm) - return new TableGrid(tblElm, ed.dom, selection); - }; - - function cleanup() { - // Restore selection possibilities - ed.getBody().style.webkitUserSelect = ''; - ed.dom.removeClass(ed.dom.select('td.mceSelected,th.mceSelected'), 'mceSelected'); - }; - - // Register buttons - each([ - ['table', 'table.desc', 'mceInsertTable', true], - ['delete_table', 'table.del', 'mceTableDelete'], - ['delete_col', 'table.delete_col_desc', 'mceTableDeleteCol'], - ['delete_row', 'table.delete_row_desc', 'mceTableDeleteRow'], - ['col_after', 'table.col_after_desc', 'mceTableInsertColAfter'], - ['col_before', 'table.col_before_desc', 'mceTableInsertColBefore'], - ['row_after', 'table.row_after_desc', 'mceTableInsertRowAfter'], - ['row_before', 'table.row_before_desc', 'mceTableInsertRowBefore'], - ['row_props', 'table.row_desc', 'mceTableRowProps', true], - ['cell_props', 'table.cell_desc', 'mceTableCellProps', true], - ['split_cells', 'table.split_cells_desc', 'mceTableSplitCells', true], - ['merge_cells', 'table.merge_cells_desc', 'mceTableMergeCells', true] - ], function(c) { - ed.addButton(c[0], {title : c[1], cmd : c[2], ui : c[3]}); - }); - - // Select whole table is a table border is clicked - if (!tinymce.isIE) { - ed.onClick.add(function(ed, e) { - e = e.target; - - if (e.nodeName === 'TABLE') - ed.selection.select(e); - }); - } - - // Handle node change updates - ed.onNodeChange.add(function(ed, cm, n) { - var p; - - n = ed.selection.getStart(); - p = ed.dom.getParent(n, 'td,th,caption'); - cm.setActive('table', n.nodeName === 'TABLE' || !!p); - - // Disable table tools if we are in caption - if (p && p.nodeName === 'CAPTION') - p = 0; - - cm.setDisabled('delete_table', !p); - cm.setDisabled('delete_col', !p); - cm.setDisabled('delete_table', !p); - cm.setDisabled('delete_row', !p); - cm.setDisabled('col_after', !p); - cm.setDisabled('col_before', !p); - cm.setDisabled('row_after', !p); - cm.setDisabled('row_before', !p); - cm.setDisabled('row_props', !p); - cm.setDisabled('cell_props', !p); - cm.setDisabled('split_cells', !p); - cm.setDisabled('merge_cells', !p); - }); - - ed.onInit.add(function(ed) { - var startTable, startCell, dom = ed.dom, tableGrid; - - winMan = ed.windowManager; - - // Add cell selection logic - ed.onMouseDown.add(function(ed, e) { - if (e.button != 2) { - cleanup(); - - startCell = dom.getParent(e.target, 'td,th'); - startTable = dom.getParent(startCell, 'table'); - } - }); - - dom.bind(ed.getDoc(), 'mouseover', function(e) { - var sel, table, target = e.target; - - if (startCell && (tableGrid || target != startCell) && (target.nodeName == 'TD' || target.nodeName == 'TH')) { - table = dom.getParent(target, 'table'); - if (table == startTable) { - if (!tableGrid) { - tableGrid = createTableGrid(table); - tableGrid.setStartCell(startCell); - - ed.getBody().style.webkitUserSelect = 'none'; - } - - tableGrid.setEndCell(target); - } - - // Remove current selection - sel = ed.selection.getSel(); - - if (sel.removeAllRanges) - sel.removeAllRanges(); - else - sel.empty(); - - e.preventDefault(); - } - }); - - ed.onMouseUp.add(function(ed, e) { - var rng, sel = ed.selection, selectedCells, nativeSel = sel.getSel(), walker, node, lastNode, endNode; - - // Move selection to startCell - if (startCell) { - if (tableGrid) - ed.getBody().style.webkitUserSelect = ''; - - function setPoint(node, start) { - var walker = new tinymce.dom.TreeWalker(node, node); - - do { - // Text node - if (node.nodeType == 3 && tinymce.trim(node.nodeValue).length != 0) { - if (start) - rng.setStart(node, 0); - else - rng.setEnd(node, node.nodeValue.length); - - return; - } - - // BR element - if (node.nodeName == 'BR') { - if (start) - rng.setStartBefore(node); - else - rng.setEndBefore(node); - - return; - } - } while (node = (start ? walker.next() : walker.prev())); - }; - - // Try to expand text selection as much as we can only Gecko supports cell selection - selectedCells = dom.select('td.mceSelected,th.mceSelected'); - if (selectedCells.length > 0) { - rng = dom.createRng(); - node = selectedCells[0]; - endNode = selectedCells[selectedCells.length - 1]; - - setPoint(node, 1); - walker = new tinymce.dom.TreeWalker(node, dom.getParent(selectedCells[0], 'table')); - - do { - if (node.nodeName == 'TD' || node.nodeName == 'TH') { - if (!dom.hasClass(node, 'mceSelected')) - break; - - lastNode = node; - } - } while (node = walker.next()); - - setPoint(lastNode); - - sel.setRng(rng); - } - - ed.nodeChanged(); - startCell = tableGrid = startTable = null; - } - }); - - ed.onKeyUp.add(function(ed, e) { - cleanup(); - }); - - // Add context menu - if (ed && ed.plugins.contextmenu) { - ed.plugins.contextmenu.onContextMenu.add(function(th, m, e) { - var sm, se = ed.selection, el = se.getNode() || ed.getBody(); - - if (ed.dom.getParent(e, 'td') || ed.dom.getParent(e, 'th') || ed.dom.select('td.mceSelected,th.mceSelected').length) { - m.removeAll(); - - if (el.nodeName == 'A' && !ed.dom.getAttrib(el, 'name')) { - m.add({title : 'advanced.link_desc', icon : 'link', cmd : ed.plugins.advlink ? 'mceAdvLink' : 'mceLink', ui : true}); - m.add({title : 'advanced.unlink_desc', icon : 'unlink', cmd : 'UnLink'}); - m.addSeparator(); - } - - if (el.nodeName == 'IMG' && el.className.indexOf('mceItem') == -1) { - m.add({title : 'advanced.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true}); - m.addSeparator(); - } - - m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable', value : {action : 'insert'}}); - m.add({title : 'table.props_desc', icon : 'table_props', cmd : 'mceInsertTable'}); - m.add({title : 'table.del', icon : 'delete_table', cmd : 'mceTableDelete'}); - m.addSeparator(); - - // Cell menu - sm = m.addMenu({title : 'table.cell'}); - sm.add({title : 'table.cell_desc', icon : 'cell_props', cmd : 'mceTableCellProps'}); - sm.add({title : 'table.split_cells_desc', icon : 'split_cells', cmd : 'mceTableSplitCells'}); - sm.add({title : 'table.merge_cells_desc', icon : 'merge_cells', cmd : 'mceTableMergeCells'}); - - // Row menu - sm = m.addMenu({title : 'table.row'}); - sm.add({title : 'table.row_desc', icon : 'row_props', cmd : 'mceTableRowProps'}); - sm.add({title : 'table.row_before_desc', icon : 'row_before', cmd : 'mceTableInsertRowBefore'}); - sm.add({title : 'table.row_after_desc', icon : 'row_after', cmd : 'mceTableInsertRowAfter'}); - sm.add({title : 'table.delete_row_desc', icon : 'delete_row', cmd : 'mceTableDeleteRow'}); - sm.addSeparator(); - sm.add({title : 'table.cut_row_desc', icon : 'cut', cmd : 'mceTableCutRow'}); - sm.add({title : 'table.copy_row_desc', icon : 'copy', cmd : 'mceTableCopyRow'}); - sm.add({title : 'table.paste_row_before_desc', icon : 'paste', cmd : 'mceTablePasteRowBefore'}).setDisabled(!clipboardRows); - sm.add({title : 'table.paste_row_after_desc', icon : 'paste', cmd : 'mceTablePasteRowAfter'}).setDisabled(!clipboardRows); - - // Column menu - sm = m.addMenu({title : 'table.col'}); - sm.add({title : 'table.col_before_desc', icon : 'col_before', cmd : 'mceTableInsertColBefore'}); - sm.add({title : 'table.col_after_desc', icon : 'col_after', cmd : 'mceTableInsertColAfter'}); - sm.add({title : 'table.delete_col_desc', icon : 'delete_col', cmd : 'mceTableDeleteCol'}); - } else - m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable'}); - }); - } - - // Fixes an issue on Gecko where it's impossible to place the caret behind a table - // This fix will force a paragraph element after the table but only when the forced_root_block setting is enabled - if (!tinymce.isIE) { - function fixTableCaretPos() { - var last; - - // Skip empty text nodes form the end - for (last = ed.getBody().lastChild; last && last.nodeType == 3 && !last.nodeValue.length; last = last.previousSibling) ; - - if (last && last.nodeName == 'TABLE') - ed.dom.add(ed.getBody(), 'p', null, '
    '); - }; - - // Fixes an bug where it's impossible to place the caret before a table in Gecko - // this fix solves it by detecting when the caret is at the beginning of such a table - // and then manually moves the caret infront of the table - if (tinymce.isGecko) { - ed.onKeyDown.add(function(ed, e) { - var rng, table, dom = ed.dom; - - // On gecko it's not possible to place the caret before a table - if (e.keyCode == 37 || e.keyCode == 38) { - rng = ed.selection.getRng(); - table = dom.getParent(rng.startContainer, 'table'); - - if (table && ed.getBody().firstChild == table) { - if (isAtStart(rng, table)) { - rng = dom.createRng(); - - rng.setStartBefore(table); - rng.setEndBefore(table); - - ed.selection.setRng(rng); - - e.preventDefault(); - } - } - } - }); - } - - ed.onKeyUp.add(fixTableCaretPos); - ed.onSetContent.add(fixTableCaretPos); - ed.onVisualAid.add(fixTableCaretPos); - - ed.onPreProcess.add(function(ed, o) { - var last = o.node.lastChild; - - if (last && last.childNodes.length == 1 && last.firstChild.nodeName == 'BR') - ed.dom.remove(last); - }); - - fixTableCaretPos(); - } - }); - - // Register action commands - each({ - mceTableSplitCells : function(grid) { - grid.split(); - }, - - mceTableMergeCells : function(grid) { - var rowSpan, colSpan, cell; - - cell = ed.dom.getParent(ed.selection.getNode(), 'th,td'); - if (cell) { - rowSpan = cell.rowSpan; - colSpan = cell.colSpan; - } - - if (!ed.dom.select('td.mceSelected,th.mceSelected').length) { - winMan.open({ - url : url + '/merge_cells.htm', - width : 240 + parseInt(ed.getLang('table.merge_cells_delta_width', 0)), - height : 110 + parseInt(ed.getLang('table.merge_cells_delta_height', 0)), - inline : 1 - }, { - rows : rowSpan, - cols : colSpan, - onaction : function(data) { - grid.merge(cell, data.cols, data.rows); - }, - plugin_url : url - }); - } else - grid.merge(); - }, - - mceTableInsertRowBefore : function(grid) { - grid.insertRow(true); - }, - - mceTableInsertRowAfter : function(grid) { - grid.insertRow(); - }, - - mceTableInsertColBefore : function(grid) { - grid.insertCol(true); - }, - - mceTableInsertColAfter : function(grid) { - grid.insertCol(); - }, - - mceTableDeleteCol : function(grid) { - grid.deleteCols(); - }, - - mceTableDeleteRow : function(grid) { - grid.deleteRows(); - }, - - mceTableCutRow : function(grid) { - clipboardRows = grid.cutRows(); - }, - - mceTableCopyRow : function(grid) { - clipboardRows = grid.copyRows(); - }, - - mceTablePasteRowBefore : function(grid) { - grid.pasteRows(clipboardRows, true); - }, - - mceTablePasteRowAfter : function(grid) { - grid.pasteRows(clipboardRows); - }, - - mceTableDelete : function(grid) { - grid.deleteTable(); - } - }, function(func, name) { - ed.addCommand(name, function() { - var grid = createTableGrid(); - - if (grid) { - func(grid); - ed.execCommand('mceRepaint'); - cleanup(); - } - }); - }); - - // Register dialog commands - each({ - mceInsertTable : function(val) { - winMan.open({ - url : url + '/table.htm', - width : 400 + parseInt(ed.getLang('table.table_delta_width', 0)), - height : 320 + parseInt(ed.getLang('table.table_delta_height', 0)), - inline : 1 - }, { - plugin_url : url, - action : val ? val.action : 0 - }); - }, - - mceTableRowProps : function() { - winMan.open({ - url : url + '/row.htm', - width : 400 + parseInt(ed.getLang('table.rowprops_delta_width', 0)), - height : 295 + parseInt(ed.getLang('table.rowprops_delta_height', 0)), - inline : 1 - }, { - plugin_url : url - }); - }, - - mceTableCellProps : function() { - winMan.open({ - url : url + '/cell.htm', - width : 400 + parseInt(ed.getLang('table.cellprops_delta_width', 0)), - height : 295 + parseInt(ed.getLang('table.cellprops_delta_height', 0)), - inline : 1 - }, { - plugin_url : url - }); - } - }, function(func, name) { - ed.addCommand(name, function(ui, val) { - func(val); - }); - }); - } - }); - - // Register plugin - tinymce.PluginManager.add('table', tinymce.plugins.TablePlugin); -})(tinymce); \ No newline at end of file +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function(tinymce) { + var each = tinymce.each; + + // Checks if the selection/caret is at the start of the specified block element + function isAtStart(rng, par) { + var doc = par.ownerDocument, rng2 = doc.createRange(), elm; + + rng2.setStartBefore(par); + rng2.setEnd(rng.endContainer, rng.endOffset); + + elm = doc.createElement('body'); + elm.appendChild(rng2.cloneContents()); + + // Check for text characters of other elements that should be treated as content + return elm.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi, '-').replace(/<[^>]+>/g, '').length == 0; + }; + + function getSpanVal(td, name) { + return parseInt(td.getAttribute(name) || 1); + } + + /** + * Table Grid class. + */ + function TableGrid(table, dom, selection) { + var grid, startPos, endPos, selectedCell; + + buildGrid(); + selectedCell = dom.getParent(selection.getStart(), 'th,td'); + if (selectedCell) { + startPos = getPos(selectedCell); + endPos = findEndPos(); + selectedCell = getCell(startPos.x, startPos.y); + } + + function cloneNode(node, children) { + node = node.cloneNode(children); + node.removeAttribute('id'); + + return node; + } + + function buildGrid() { + var startY = 0; + + grid = []; + + each(['thead', 'tbody', 'tfoot'], function(part) { + var rows = dom.select('> ' + part + ' tr', table); + + each(rows, function(tr, y) { + y += startY; + + each(dom.select('> td, > th', tr), function(td, x) { + var x2, y2, rowspan, colspan; + + // Skip over existing cells produced by rowspan + if (grid[y]) { + while (grid[y][x]) + x++; + } + + // Get col/rowspan from cell + rowspan = getSpanVal(td, 'rowspan'); + colspan = getSpanVal(td, 'colspan'); + + // Fill out rowspan/colspan right and down + for (y2 = y; y2 < y + rowspan; y2++) { + if (!grid[y2]) + grid[y2] = []; + + for (x2 = x; x2 < x + colspan; x2++) { + grid[y2][x2] = { + part : part, + real : y2 == y && x2 == x, + elm : td, + rowspan : rowspan, + colspan : colspan + }; + } + } + }); + }); + + startY += rows.length; + }); + }; + + function getCell(x, y) { + var row; + + row = grid[y]; + if (row) + return row[x]; + }; + + function setSpanVal(td, name, val) { + if (td) { + val = parseInt(val); + + if (val === 1) + td.removeAttribute(name, 1); + else + td.setAttribute(name, val, 1); + } + } + + function isCellSelected(cell) { + return cell && (dom.hasClass(cell.elm, 'mceSelected') || cell == selectedCell); + }; + + function getSelectedRows() { + var rows = []; + + each(table.rows, function(row) { + each(row.cells, function(cell) { + if (dom.hasClass(cell, 'mceSelected') || cell == selectedCell.elm) { + rows.push(row); + return false; + } + }); + }); + + return rows; + }; + + function deleteTable() { + var rng = dom.createRng(); + + rng.setStartAfter(table); + rng.setEndAfter(table); + + selection.setRng(rng); + + dom.remove(table); + }; + + function cloneCell(cell) { + var formatNode; + + // Clone formats + tinymce.walk(cell, function(node) { + var curNode; + + if (node.nodeType == 3) { + each(dom.getParents(node.parentNode, null, cell).reverse(), function(node) { + node = cloneNode(node, false); + + if (!formatNode) + formatNode = curNode = node; + else if (curNode) + curNode.appendChild(node); + + curNode = node; + }); + + // Add something to the inner node + if (curNode) + curNode.innerHTML = tinymce.isIE ? ' ' : '
    '; + + return false; + } + }, 'childNodes'); + + cell = cloneNode(cell, false); + setSpanVal(cell, 'rowSpan', 1); + setSpanVal(cell, 'colSpan', 1); + + if (formatNode) { + cell.appendChild(formatNode); + } else { + if (!tinymce.isIE) + cell.innerHTML = '
    '; + } + + return cell; + }; + + function cleanup() { + var rng = dom.createRng(); + + // Empty rows + each(dom.select('tr', table), function(tr) { + if (tr.cells.length == 0) + dom.remove(tr); + }); + + // Empty table + if (dom.select('tr', table).length == 0) { + rng.setStartAfter(table); + rng.setEndAfter(table); + selection.setRng(rng); + dom.remove(table); + return; + } + + // Empty header/body/footer + each(dom.select('thead,tbody,tfoot', table), function(part) { + if (part.rows.length == 0) + dom.remove(part); + }); + + // Restore selection to start position if it still exists + buildGrid(); + + // Restore the selection to the closest table position + row = grid[Math.min(grid.length - 1, startPos.y)]; + if (row) { + selection.select(row[Math.min(row.length - 1, startPos.x)].elm, true); + selection.collapse(true); + } + }; + + function fillLeftDown(x, y, rows, cols) { + var tr, x2, r, c, cell; + + tr = grid[y][x].elm.parentNode; + for (r = 1; r <= rows; r++) { + tr = dom.getNext(tr, 'tr'); + + if (tr) { + // Loop left to find real cell + for (x2 = x; x2 >= 0; x2--) { + cell = grid[y + r][x2].elm; + + if (cell.parentNode == tr) { + // Append clones after + for (c = 1; c <= cols; c++) + dom.insertAfter(cloneCell(cell), cell); + + break; + } + } + + if (x2 == -1) { + // Insert nodes before first cell + for (c = 1; c <= cols; c++) + tr.insertBefore(cloneCell(tr.cells[0]), tr.cells[0]); + } + } + } + }; + + function split() { + each(grid, function(row, y) { + each(row, function(cell, x) { + var colSpan, rowSpan, newCell, i; + + if (isCellSelected(cell)) { + cell = cell.elm; + colSpan = getSpanVal(cell, 'colspan'); + rowSpan = getSpanVal(cell, 'rowspan'); + + if (colSpan > 1 || rowSpan > 1) { + setSpanVal(cell, 'rowSpan', 1); + setSpanVal(cell, 'colSpan', 1); + + // Insert cells right + for (i = 0; i < colSpan - 1; i++) + dom.insertAfter(cloneCell(cell), cell); + + fillLeftDown(x, y, rowSpan - 1, colSpan); + } + } + }); + }); + }; + + function merge(cell, cols, rows) { + var startX, startY, endX, endY, x, y, startCell, endCell, cell, children, count; + + // Use specified cell and cols/rows + if (cell) { + pos = getPos(cell); + startX = pos.x; + startY = pos.y; + endX = startX + (cols - 1); + endY = startY + (rows - 1); + } else { + // Use selection + startX = startPos.x; + startY = startPos.y; + endX = endPos.x; + endY = endPos.y; + } + + // Find start/end cells + startCell = getCell(startX, startY); + endCell = getCell(endX, endY); + + // Check if the cells exists and if they are of the same part for example tbody = tbody + if (startCell && endCell && startCell.part == endCell.part) { + // Split and rebuild grid + split(); + buildGrid(); + + // Set row/col span to start cell + startCell = getCell(startX, startY).elm; + setSpanVal(startCell, 'colSpan', (endX - startX) + 1); + setSpanVal(startCell, 'rowSpan', (endY - startY) + 1); + + // Remove other cells and add it's contents to the start cell + for (y = startY; y <= endY; y++) { + for (x = startX; x <= endX; x++) { + if (!grid[y] || !grid[y][x]) + continue; + + cell = grid[y][x].elm; + + if (cell != startCell) { + // Move children to startCell + children = tinymce.grep(cell.childNodes); + each(children, function(node) { + startCell.appendChild(node); + }); + + // Remove bogus nodes if there is children in the target cell + if (children.length) { + children = tinymce.grep(startCell.childNodes); + count = 0; + each(children, function(node) { + if (node.nodeName == 'BR' && dom.getAttrib(node, 'data-mce-bogus') && count++ < children.length - 1) + startCell.removeChild(node); + }); + } + + // Remove cell + dom.remove(cell); + } + } + } + + // Remove empty rows etc and restore caret location + cleanup(); + } + }; + + function insertRow(before) { + var posY, cell, lastCell, x, rowElm, newRow, newCell, otherCell, rowSpan; + + // Find first/last row + each(grid, function(row, y) { + each(row, function(cell, x) { + if (isCellSelected(cell)) { + cell = cell.elm; + rowElm = cell.parentNode; + newRow = cloneNode(rowElm, false); + posY = y; + + if (before) + return false; + } + }); + + if (before) + return !posY; + }); + + for (x = 0; x < grid[0].length; x++) { + // Cell not found could be because of an invalid table structure + if (!grid[posY][x]) + continue; + + cell = grid[posY][x].elm; + + if (cell != lastCell) { + if (!before) { + rowSpan = getSpanVal(cell, 'rowspan'); + if (rowSpan > 1) { + setSpanVal(cell, 'rowSpan', rowSpan + 1); + continue; + } + } else { + // Check if cell above can be expanded + if (posY > 0 && grid[posY - 1][x]) { + otherCell = grid[posY - 1][x].elm; + rowSpan = getSpanVal(otherCell, 'rowSpan'); + if (rowSpan > 1) { + setSpanVal(otherCell, 'rowSpan', rowSpan + 1); + continue; + } + } + } + + // Insert new cell into new row + newCell = cloneCell(cell); + setSpanVal(newCell, 'colSpan', cell.colSpan); + + newRow.appendChild(newCell); + + lastCell = cell; + } + } + + if (newRow.hasChildNodes()) { + if (!before) + dom.insertAfter(newRow, rowElm); + else + rowElm.parentNode.insertBefore(newRow, rowElm); + } + }; + + function insertCol(before) { + var posX, lastCell; + + // Find first/last column + each(grid, function(row, y) { + each(row, function(cell, x) { + if (isCellSelected(cell)) { + posX = x; + + if (before) + return false; + } + }); + + if (before) + return !posX; + }); + + each(grid, function(row, y) { + var cell, rowSpan, colSpan; + + if (!row[posX]) + return; + + cell = row[posX].elm; + if (cell != lastCell) { + colSpan = getSpanVal(cell, 'colspan'); + rowSpan = getSpanVal(cell, 'rowspan'); + + if (colSpan == 1) { + if (!before) { + dom.insertAfter(cloneCell(cell), cell); + fillLeftDown(posX, y, rowSpan - 1, colSpan); + } else { + cell.parentNode.insertBefore(cloneCell(cell), cell); + fillLeftDown(posX, y, rowSpan - 1, colSpan); + } + } else + setSpanVal(cell, 'colSpan', cell.colSpan + 1); + + lastCell = cell; + } + }); + }; + + function deleteCols() { + var cols = []; + + // Get selected column indexes + each(grid, function(row, y) { + each(row, function(cell, x) { + if (isCellSelected(cell) && tinymce.inArray(cols, x) === -1) { + each(grid, function(row) { + var cell = row[x].elm, colSpan; + + colSpan = getSpanVal(cell, 'colSpan'); + + if (colSpan > 1) + setSpanVal(cell, 'colSpan', colSpan - 1); + else + dom.remove(cell); + }); + + cols.push(x); + } + }); + }); + + cleanup(); + }; + + function deleteRows() { + var rows; + + function deleteRow(tr) { + var nextTr, pos, lastCell; + + nextTr = dom.getNext(tr, 'tr'); + + // Move down row spanned cells + each(tr.cells, function(cell) { + var rowSpan = getSpanVal(cell, 'rowSpan'); + + if (rowSpan > 1) { + setSpanVal(cell, 'rowSpan', rowSpan - 1); + pos = getPos(cell); + fillLeftDown(pos.x, pos.y, 1, 1); + } + }); + + // Delete cells + pos = getPos(tr.cells[0]); + each(grid[pos.y], function(cell) { + var rowSpan; + + cell = cell.elm; + + if (cell != lastCell) { + rowSpan = getSpanVal(cell, 'rowSpan'); + + if (rowSpan <= 1) + dom.remove(cell); + else + setSpanVal(cell, 'rowSpan', rowSpan - 1); + + lastCell = cell; + } + }); + }; + + // Get selected rows and move selection out of scope + rows = getSelectedRows(); + + // Delete all selected rows + each(rows.reverse(), function(tr) { + deleteRow(tr); + }); + + cleanup(); + }; + + function cutRows() { + var rows = getSelectedRows(); + + dom.remove(rows); + cleanup(); + + return rows; + }; + + function copyRows() { + var rows = getSelectedRows(); + + each(rows, function(row, i) { + rows[i] = cloneNode(row, true); + }); + + return rows; + }; + + function pasteRows(rows, before) { + var selectedRows = getSelectedRows(), + targetRow = selectedRows[before ? 0 : selectedRows.length - 1], + targetCellCount = targetRow.cells.length; + + // Calc target cell count + each(grid, function(row) { + var match; + + targetCellCount = 0; + each(row, function(cell, x) { + if (cell.real) + targetCellCount += cell.colspan; + + if (cell.elm.parentNode == targetRow) + match = 1; + }); + + if (match) + return false; + }); + + if (!before) + rows.reverse(); + + each(rows, function(row) { + var cellCount = row.cells.length, cell; + + // Remove col/rowspans + for (i = 0; i < cellCount; i++) { + cell = row.cells[i]; + setSpanVal(cell, 'colSpan', 1); + setSpanVal(cell, 'rowSpan', 1); + } + + // Needs more cells + for (i = cellCount; i < targetCellCount; i++) + row.appendChild(cloneCell(row.cells[cellCount - 1])); + + // Needs less cells + for (i = targetCellCount; i < cellCount; i++) + dom.remove(row.cells[i]); + + // Add before/after + if (before) + targetRow.parentNode.insertBefore(row, targetRow); + else + dom.insertAfter(row, targetRow); + }); + }; + + function getPos(target) { + var pos; + + each(grid, function(row, y) { + each(row, function(cell, x) { + if (cell.elm == target) { + pos = {x : x, y : y}; + return false; + } + }); + + return !pos; + }); + + return pos; + }; + + function setStartCell(cell) { + startPos = getPos(cell); + }; + + function findEndPos() { + var pos, maxX, maxY; + + maxX = maxY = 0; + + each(grid, function(row, y) { + each(row, function(cell, x) { + var colSpan, rowSpan; + + if (isCellSelected(cell)) { + cell = grid[y][x]; + + if (x > maxX) + maxX = x; + + if (y > maxY) + maxY = y; + + if (cell.real) { + colSpan = cell.colspan - 1; + rowSpan = cell.rowspan - 1; + + if (colSpan) { + if (x + colSpan > maxX) + maxX = x + colSpan; + } + + if (rowSpan) { + if (y + rowSpan > maxY) + maxY = y + rowSpan; + } + } + } + }); + }); + + return {x : maxX, y : maxY}; + }; + + function setEndCell(cell) { + var startX, startY, endX, endY, maxX, maxY, colSpan, rowSpan; + + endPos = getPos(cell); + + if (startPos && endPos) { + // Get start/end positions + startX = Math.min(startPos.x, endPos.x); + startY = Math.min(startPos.y, endPos.y); + endX = Math.max(startPos.x, endPos.x); + endY = Math.max(startPos.y, endPos.y); + + // Expand end positon to include spans + maxX = endX; + maxY = endY; + + // Expand startX + for (y = startY; y <= maxY; y++) { + cell = grid[y][startX]; + + if (!cell.real) { + if (startX - (cell.colspan - 1) < startX) + startX -= cell.colspan - 1; + } + } + + // Expand startY + for (x = startX; x <= maxX; x++) { + cell = grid[startY][x]; + + if (!cell.real) { + if (startY - (cell.rowspan - 1) < startY) + startY -= cell.rowspan - 1; + } + } + + // Find max X, Y + for (y = startY; y <= endY; y++) { + for (x = startX; x <= endX; x++) { + cell = grid[y][x]; + + if (cell.real) { + colSpan = cell.colspan - 1; + rowSpan = cell.rowspan - 1; + + if (colSpan) { + if (x + colSpan > maxX) + maxX = x + colSpan; + } + + if (rowSpan) { + if (y + rowSpan > maxY) + maxY = y + rowSpan; + } + } + } + } + + // Remove current selection + dom.removeClass(dom.select('td.mceSelected,th.mceSelected'), 'mceSelected'); + + // Add new selection + for (y = startY; y <= maxY; y++) { + for (x = startX; x <= maxX; x++) { + if (grid[y][x]) + dom.addClass(grid[y][x].elm, 'mceSelected'); + } + } + } + }; + + // Expose to public + tinymce.extend(this, { + deleteTable : deleteTable, + split : split, + merge : merge, + insertRow : insertRow, + insertCol : insertCol, + deleteCols : deleteCols, + deleteRows : deleteRows, + cutRows : cutRows, + copyRows : copyRows, + pasteRows : pasteRows, + getPos : getPos, + setStartCell : setStartCell, + setEndCell : setEndCell + }); + }; + + tinymce.create('tinymce.plugins.TablePlugin', { + init : function(ed, url) { + var winMan, clipboardRows, hasCellSelection = true; // Might be selected cells on reload + + function createTableGrid(node) { + var selection = ed.selection, tblElm = ed.dom.getParent(node || selection.getNode(), 'table'); + + if (tblElm) + return new TableGrid(tblElm, ed.dom, selection); + }; + + function cleanup() { + // Restore selection possibilities + ed.getBody().style.webkitUserSelect = ''; + + if (hasCellSelection) { + ed.dom.removeClass(ed.dom.select('td.mceSelected,th.mceSelected'), 'mceSelected'); + hasCellSelection = false; + } + }; + + // Register buttons + each([ + ['table', 'table.desc', 'mceInsertTable', true], + ['delete_table', 'table.del', 'mceTableDelete'], + ['delete_col', 'table.delete_col_desc', 'mceTableDeleteCol'], + ['delete_row', 'table.delete_row_desc', 'mceTableDeleteRow'], + ['col_after', 'table.col_after_desc', 'mceTableInsertColAfter'], + ['col_before', 'table.col_before_desc', 'mceTableInsertColBefore'], + ['row_after', 'table.row_after_desc', 'mceTableInsertRowAfter'], + ['row_before', 'table.row_before_desc', 'mceTableInsertRowBefore'], + ['row_props', 'table.row_desc', 'mceTableRowProps', true], + ['cell_props', 'table.cell_desc', 'mceTableCellProps', true], + ['split_cells', 'table.split_cells_desc', 'mceTableSplitCells', true], + ['merge_cells', 'table.merge_cells_desc', 'mceTableMergeCells', true] + ], function(c) { + ed.addButton(c[0], {title : c[1], cmd : c[2], ui : c[3]}); + }); + + // Select whole table is a table border is clicked + if (!tinymce.isIE) { + ed.onClick.add(function(ed, e) { + e = e.target; + + if (e.nodeName === 'TABLE') { + ed.selection.select(e); + ed.nodeChanged(); + } + }); + } + + ed.onPreProcess.add(function(ed, args) { + var nodes, i, node, dom = ed.dom, value; + + nodes = dom.select('table', args.node); + i = nodes.length; + while (i--) { + node = nodes[i]; + dom.setAttrib(node, 'data-mce-style', ''); + + if ((value = dom.getAttrib(node, 'width'))) { + dom.setStyle(node, 'width', value); + dom.setAttrib(node, 'width', ''); + } + + if ((value = dom.getAttrib(node, 'height'))) { + dom.setStyle(node, 'height', value); + dom.setAttrib(node, 'height', ''); + } + } + }); + + // Handle node change updates + ed.onNodeChange.add(function(ed, cm, n) { + var p; + + n = ed.selection.getStart(); + p = ed.dom.getParent(n, 'td,th,caption'); + cm.setActive('table', n.nodeName === 'TABLE' || !!p); + + // Disable table tools if we are in caption + if (p && p.nodeName === 'CAPTION') + p = 0; + + cm.setDisabled('delete_table', !p); + cm.setDisabled('delete_col', !p); + cm.setDisabled('delete_table', !p); + cm.setDisabled('delete_row', !p); + cm.setDisabled('col_after', !p); + cm.setDisabled('col_before', !p); + cm.setDisabled('row_after', !p); + cm.setDisabled('row_before', !p); + cm.setDisabled('row_props', !p); + cm.setDisabled('cell_props', !p); + cm.setDisabled('split_cells', !p); + cm.setDisabled('merge_cells', !p); + }); + + ed.onInit.add(function(ed) { + var startTable, startCell, dom = ed.dom, tableGrid; + + winMan = ed.windowManager; + + // Add cell selection logic + ed.onMouseDown.add(function(ed, e) { + if (e.button != 2) { + cleanup(); + + startCell = dom.getParent(e.target, 'td,th'); + startTable = dom.getParent(startCell, 'table'); + } + }); + + dom.bind(ed.getDoc(), 'mouseover', function(e) { + var sel, table, target = e.target; + + if (startCell && (tableGrid || target != startCell) && (target.nodeName == 'TD' || target.nodeName == 'TH')) { + table = dom.getParent(target, 'table'); + if (table == startTable) { + if (!tableGrid) { + tableGrid = createTableGrid(table); + tableGrid.setStartCell(startCell); + + ed.getBody().style.webkitUserSelect = 'none'; + } + + tableGrid.setEndCell(target); + hasCellSelection = true; + } + + // Remove current selection + sel = ed.selection.getSel(); + + try { + if (sel.removeAllRanges) + sel.removeAllRanges(); + else + sel.empty(); + } catch (ex) { + // IE9 might throw errors here + } + + e.preventDefault(); + } + }); + + ed.onMouseUp.add(function(ed, e) { + var rng, sel = ed.selection, selectedCells, nativeSel = sel.getSel(), walker, node, lastNode, endNode; + + // Move selection to startCell + if (startCell) { + if (tableGrid) + ed.getBody().style.webkitUserSelect = ''; + + function setPoint(node, start) { + var walker = new tinymce.dom.TreeWalker(node, node); + + do { + // Text node + if (node.nodeType == 3 && tinymce.trim(node.nodeValue).length != 0) { + if (start) + rng.setStart(node, 0); + else + rng.setEnd(node, node.nodeValue.length); + + return; + } + + // BR element + if (node.nodeName == 'BR') { + if (start) + rng.setStartBefore(node); + else + rng.setEndBefore(node); + + return; + } + } while (node = (start ? walker.next() : walker.prev())); + } + + // Try to expand text selection as much as we can only Gecko supports cell selection + selectedCells = dom.select('td.mceSelected,th.mceSelected'); + if (selectedCells.length > 0) { + rng = dom.createRng(); + node = selectedCells[0]; + endNode = selectedCells[selectedCells.length - 1]; + rng.setStartBefore(node); + rng.setEndAfter(node); + + setPoint(node, 1); + walker = new tinymce.dom.TreeWalker(node, dom.getParent(selectedCells[0], 'table')); + + do { + if (node.nodeName == 'TD' || node.nodeName == 'TH') { + if (!dom.hasClass(node, 'mceSelected')) + break; + + lastNode = node; + } + } while (node = walker.next()); + + setPoint(lastNode); + + sel.setRng(rng); + } + + ed.nodeChanged(); + startCell = tableGrid = startTable = null; + } + }); + + ed.onKeyUp.add(function(ed, e) { + cleanup(); + }); + + ed.onKeyDown.add(function (ed, e) { + fixTableCellSelection(ed); + }); + + ed.onMouseDown.add(function (ed, e) { + if (e.button != 2) { + fixTableCellSelection(ed); + } + }); + function tableCellSelected(ed, rng, n, currentCell) { + // The decision of when a table cell is selected is somewhat involved. The fact that this code is + // required is actually a pointer to the root cause of this bug. A cell is selected when the start + // and end offsets are 0, the start container is a text, and the selection node is either a TR (most cases) + // or the parent of the table (in the case of the selection containing the last cell of a table). + var TEXT_NODE = 3, table = ed.dom.getParent(rng.startContainer, 'TABLE'), + tableParent, allOfCellSelected, tableCellSelection; + if (table) + tableParent = table.parentNode; + allOfCellSelected =rng.startContainer.nodeType == TEXT_NODE && + rng.startOffset == 0 && + rng.endOffset == 0 && + currentCell && + (n.nodeName=="TR" || n==tableParent); + tableCellSelection = (n.nodeName=="TD"||n.nodeName=="TH")&& !currentCell; + return allOfCellSelected || tableCellSelection; + // return false; + } + + // this nasty hack is here to work around some WebKit selection bugs. + function fixTableCellSelection(ed) { + if (!tinymce.isWebKit) + return; + + var rng = ed.selection.getRng(); + var n = ed.selection.getNode(); + var currentCell = ed.dom.getParent(rng.startContainer, 'TD,TH'); + + if (!tableCellSelected(ed, rng, n, currentCell)) + return; + if (!currentCell) { + currentCell=n; + } + + // Get the very last node inside the table cell + var end = currentCell.lastChild; + while (end.lastChild) + end = end.lastChild; + + // Select the entire table cell. Nothing outside of the table cell should be selected. + rng.setEnd(end, end.nodeValue.length); + ed.selection.setRng(rng); + } + ed.plugins.table.fixTableCellSelection=fixTableCellSelection; + + // Add context menu + if (ed && ed.plugins.contextmenu) { + ed.plugins.contextmenu.onContextMenu.add(function(th, m, e) { + var sm, se = ed.selection, el = se.getNode() || ed.getBody(); + + if (ed.dom.getParent(e, 'td') || ed.dom.getParent(e, 'th') || ed.dom.select('td.mceSelected,th.mceSelected').length) { + m.removeAll(); + + if (el.nodeName == 'A' && !ed.dom.getAttrib(el, 'name')) { + m.add({title : 'advanced.link_desc', icon : 'link', cmd : ed.plugins.advlink ? 'mceAdvLink' : 'mceLink', ui : true}); + m.add({title : 'advanced.unlink_desc', icon : 'unlink', cmd : 'UnLink'}); + m.addSeparator(); + } + + if (el.nodeName == 'IMG' && el.className.indexOf('mceItem') == -1) { + m.add({title : 'advanced.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true}); + m.addSeparator(); + } + + m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable', value : {action : 'insert'}}); + m.add({title : 'table.props_desc', icon : 'table_props', cmd : 'mceInsertTable'}); + m.add({title : 'table.del', icon : 'delete_table', cmd : 'mceTableDelete'}); + m.addSeparator(); + + // Cell menu + sm = m.addMenu({title : 'table.cell'}); + sm.add({title : 'table.cell_desc', icon : 'cell_props', cmd : 'mceTableCellProps'}); + sm.add({title : 'table.split_cells_desc', icon : 'split_cells', cmd : 'mceTableSplitCells'}); + sm.add({title : 'table.merge_cells_desc', icon : 'merge_cells', cmd : 'mceTableMergeCells'}); + + // Row menu + sm = m.addMenu({title : 'table.row'}); + sm.add({title : 'table.row_desc', icon : 'row_props', cmd : 'mceTableRowProps'}); + sm.add({title : 'table.row_before_desc', icon : 'row_before', cmd : 'mceTableInsertRowBefore'}); + sm.add({title : 'table.row_after_desc', icon : 'row_after', cmd : 'mceTableInsertRowAfter'}); + sm.add({title : 'table.delete_row_desc', icon : 'delete_row', cmd : 'mceTableDeleteRow'}); + sm.addSeparator(); + sm.add({title : 'table.cut_row_desc', icon : 'cut', cmd : 'mceTableCutRow'}); + sm.add({title : 'table.copy_row_desc', icon : 'copy', cmd : 'mceTableCopyRow'}); + sm.add({title : 'table.paste_row_before_desc', icon : 'paste', cmd : 'mceTablePasteRowBefore'}).setDisabled(!clipboardRows); + sm.add({title : 'table.paste_row_after_desc', icon : 'paste', cmd : 'mceTablePasteRowAfter'}).setDisabled(!clipboardRows); + + // Column menu + sm = m.addMenu({title : 'table.col'}); + sm.add({title : 'table.col_before_desc', icon : 'col_before', cmd : 'mceTableInsertColBefore'}); + sm.add({title : 'table.col_after_desc', icon : 'col_after', cmd : 'mceTableInsertColAfter'}); + sm.add({title : 'table.delete_col_desc', icon : 'delete_col', cmd : 'mceTableDeleteCol'}); + } else + m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable'}); + }); + } + + // Fix to allow navigating up and down in a table in WebKit browsers. + if (tinymce.isWebKit) { + function moveSelection(ed, e) { + var VK = tinymce.VK; + var key = e.keyCode; + + function handle(upBool, sourceNode, event) { + var siblingDirection = upBool ? 'previousSibling' : 'nextSibling'; + var currentRow = ed.dom.getParent(sourceNode, 'tr'); + var siblingRow = currentRow[siblingDirection]; + + if (siblingRow) { + moveCursorToRow(ed, sourceNode, siblingRow, upBool); + tinymce.dom.Event.cancel(event); + return true; + } else { + var tableNode = ed.dom.getParent(currentRow, 'table'); + var middleNode = currentRow.parentNode; + var parentNodeName = middleNode.nodeName.toLowerCase(); + if (parentNodeName === 'tbody' || parentNodeName === (upBool ? 'tfoot' : 'thead')) { + var targetParent = getTargetParent(upBool, tableNode, middleNode, 'tbody'); + if (targetParent !== null) { + return moveToRowInTarget(upBool, targetParent, sourceNode, event); + } + } + return escapeTable(upBool, currentRow, siblingDirection, tableNode, event); + } + } + + function getTargetParent(upBool, topNode, secondNode, nodeName) { + var tbodies = ed.dom.select('>' + nodeName, topNode); + var position = tbodies.indexOf(secondNode); + if (upBool && position === 0 || !upBool && position === tbodies.length - 1) { + return getFirstHeadOrFoot(upBool, topNode); + } else if (position === -1) { + var topOrBottom = secondNode.tagName.toLowerCase() === 'thead' ? 0 : tbodies.length - 1; + return tbodies[topOrBottom]; + } else { + return tbodies[position + (upBool ? -1 : 1)]; + } + } + + function getFirstHeadOrFoot(upBool, parent) { + var tagName = upBool ? 'thead' : 'tfoot'; + var headOrFoot = ed.dom.select('>' + tagName, parent); + return headOrFoot.length !== 0 ? headOrFoot[0] : null; + } + + function moveToRowInTarget(upBool, targetParent, sourceNode, event) { + var targetRow = getChildForDirection(targetParent, upBool); + targetRow && moveCursorToRow(ed, sourceNode, targetRow, upBool); + tinymce.dom.Event.cancel(event); + return true; + } + + function escapeTable(upBool, currentRow, siblingDirection, table, event) { + var tableSibling = table[siblingDirection]; + if (tableSibling) { + moveCursorToStartOfElement(tableSibling); + return true; + } else { + var parentCell = ed.dom.getParent(table, 'td,th'); + if (parentCell) { + return handle(upBool, parentCell, event); + } else { + var backUpSibling = getChildForDirection(currentRow, !upBool); + moveCursorToStartOfElement(backUpSibling); + return tinymce.dom.Event.cancel(event); + } + } + } + + function getChildForDirection(parent, up) { + return parent && parent[up ? 'lastChild' : 'firstChild']; + } + + function moveCursorToStartOfElement(n) { + ed.selection.setCursorLocation(n, 0); + } + + function isVerticalMovement() { + return key == VK.UP || key == VK.DOWN; + } + + function isInTable(ed) { + var node = ed.selection.getNode(); + var currentRow = ed.dom.getParent(node, 'tr'); + return currentRow !== null; + } + + function columnIndex(column) { + var colIndex = 0; + var c = column; + while (c.previousSibling) { + c = c.previousSibling; + colIndex = colIndex + getSpanVal(c, "colspan"); + } + return colIndex; + } + + function findColumn(rowElement, columnIndex) { + var c = 0; + var r = 0; + each(rowElement.children, function(cell, i) { + c = c + getSpanVal(cell, "colspan"); + r = i; + if (c > columnIndex) + return false; + }); + return r; + } + + function moveCursorToRow(ed, node, row, upBool) { + var srcColumnIndex = columnIndex(ed.dom.getParent(node, 'td,th')); + var tgtColumnIndex = findColumn(row, srcColumnIndex); + var tgtNode = row.childNodes[tgtColumnIndex]; + var rowCellTarget = getChildForDirection(tgtNode, upBool); + moveCursorToStartOfElement(rowCellTarget || tgtNode); + } + + function shouldFixCaret(preBrowserNode) { + var newNode = ed.selection.getNode(); + var newParent = ed.dom.getParent(newNode, 'td,th'); + var oldParent = ed.dom.getParent(preBrowserNode, 'td,th'); + return newParent && newParent !== oldParent && checkSameParentTable(newParent, oldParent) + } + + function checkSameParentTable(nodeOne, NodeTwo) { + return ed.dom.getParent(nodeOne, 'TABLE') === ed.dom.getParent(NodeTwo, 'TABLE'); + } + + if (isVerticalMovement() && isInTable(ed)) { + var preBrowserNode = ed.selection.getNode(); + setTimeout(function() { + if (shouldFixCaret(preBrowserNode)) { + handle(!e.shiftKey && key === VK.UP, preBrowserNode, e); + } + }, 0); + } + } + + ed.onKeyDown.add(moveSelection); + } + + // Fixes an issue on Gecko where it's impossible to place the caret behind a table + // This fix will force a paragraph element after the table but only when the forced_root_block setting is enabled + if (!tinymce.isIE) { + function fixTableCaretPos() { + var last; + + // Skip empty text nodes form the end + for (last = ed.getBody().lastChild; last && last.nodeType == 3 && !last.nodeValue.length; last = last.previousSibling) ; + + if (last && last.nodeName == 'TABLE') + ed.dom.add(ed.getBody(), 'p', null, '
    '); + }; + + // Fixes an bug where it's impossible to place the caret before a table in Gecko + // this fix solves it by detecting when the caret is at the beginning of such a table + // and then manually moves the caret infront of the table + if (tinymce.isGecko) { + ed.onKeyDown.add(function(ed, e) { + var rng, table, dom = ed.dom; + + // On gecko it's not possible to place the caret before a table + if (e.keyCode == 37 || e.keyCode == 38) { + rng = ed.selection.getRng(); + table = dom.getParent(rng.startContainer, 'table'); + + if (table && ed.getBody().firstChild == table) { + if (isAtStart(rng, table)) { + rng = dom.createRng(); + + rng.setStartBefore(table); + rng.setEndBefore(table); + + ed.selection.setRng(rng); + + e.preventDefault(); + } + } + } + }); + } + + ed.onKeyUp.add(fixTableCaretPos); + ed.onSetContent.add(fixTableCaretPos); + ed.onVisualAid.add(fixTableCaretPos); + + ed.onPreProcess.add(function(ed, o) { + var last = o.node.lastChild; + + if (last && last.childNodes.length == 1 && last.firstChild.nodeName == 'BR') + ed.dom.remove(last); + }); + + fixTableCaretPos(); + ed.startContent = ed.getContent({format : 'raw'}); + } + }); + + // Register action commands + each({ + mceTableSplitCells : function(grid) { + grid.split(); + }, + + mceTableMergeCells : function(grid) { + var rowSpan, colSpan, cell; + + cell = ed.dom.getParent(ed.selection.getNode(), 'th,td'); + if (cell) { + rowSpan = cell.rowSpan; + colSpan = cell.colSpan; + } + + if (!ed.dom.select('td.mceSelected,th.mceSelected').length) { + winMan.open({ + url : url + '/merge_cells.htm', + width : 240 + parseInt(ed.getLang('table.merge_cells_delta_width', 0)), + height : 110 + parseInt(ed.getLang('table.merge_cells_delta_height', 0)), + inline : 1 + }, { + rows : rowSpan, + cols : colSpan, + onaction : function(data) { + grid.merge(cell, data.cols, data.rows); + }, + plugin_url : url + }); + } else + grid.merge(); + }, + + mceTableInsertRowBefore : function(grid) { + grid.insertRow(true); + }, + + mceTableInsertRowAfter : function(grid) { + grid.insertRow(); + }, + + mceTableInsertColBefore : function(grid) { + grid.insertCol(true); + }, + + mceTableInsertColAfter : function(grid) { + grid.insertCol(); + }, + + mceTableDeleteCol : function(grid) { + grid.deleteCols(); + }, + + mceTableDeleteRow : function(grid) { + grid.deleteRows(); + }, + + mceTableCutRow : function(grid) { + clipboardRows = grid.cutRows(); + }, + + mceTableCopyRow : function(grid) { + clipboardRows = grid.copyRows(); + }, + + mceTablePasteRowBefore : function(grid) { + grid.pasteRows(clipboardRows, true); + }, + + mceTablePasteRowAfter : function(grid) { + grid.pasteRows(clipboardRows); + }, + + mceTableDelete : function(grid) { + grid.deleteTable(); + } + }, function(func, name) { + ed.addCommand(name, function() { + var grid = createTableGrid(); + + if (grid) { + func(grid); + ed.execCommand('mceRepaint'); + cleanup(); + } + }); + }); + + // Register dialog commands + each({ + mceInsertTable : function(val) { + winMan.open({ + url : url + '/table.htm', + width : 400 + parseInt(ed.getLang('table.table_delta_width', 0)), + height : 320 + parseInt(ed.getLang('table.table_delta_height', 0)), + inline : 1 + }, { + plugin_url : url, + action : val ? val.action : 0 + }); + }, + + mceTableRowProps : function() { + winMan.open({ + url : url + '/row.htm', + width : 400 + parseInt(ed.getLang('table.rowprops_delta_width', 0)), + height : 295 + parseInt(ed.getLang('table.rowprops_delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }, + + mceTableCellProps : function() { + winMan.open({ + url : url + '/cell.htm', + width : 400 + parseInt(ed.getLang('table.cellprops_delta_width', 0)), + height : 295 + parseInt(ed.getLang('table.cellprops_delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + } + }, function(func, name) { + ed.addCommand(name, function(ui, val) { + func(val); + }); + }); + } + }); + + // Register plugin + tinymce.PluginManager.add('table', tinymce.plugins.TablePlugin); +})(tinymce); diff --git a/js/tiny_mce/plugins/table/js/cell.js b/js/tiny_mce/plugins/table/js/cell.js index b5fc1fda3d..d6f3290599 100644 --- a/js/tiny_mce/plugins/table/js/cell.js +++ b/js/tiny_mce/plugins/table/js/cell.js @@ -63,6 +63,11 @@ function init() { function updateAction() { var el, inst = ed, tdElm, trElm, tableElm, formObj = document.forms[0]; + if (!AutoValidator.validate(formObj)) { + tinyMCEPopup.alert(AutoValidator.getErrorMessages(formObj).join('. ') + '.'); + return false; + } + tinyMCEPopup.restoreSelection(); el = ed.selection.getStart(); tdElm = ed.dom.getParent(el, "td,th"); @@ -83,8 +88,6 @@ function updateAction() { return; } - ed.execCommand('mceBeginUndoLevel'); - switch (getSelectValue(formObj, 'action')) { case "cell": var celltype = getSelectValue(formObj, 'celltype'); @@ -125,6 +128,36 @@ function updateAction() { break; + case "col": + var curr, col = 0, cell = trElm.firstChild, rows = tableElm.getElementsByTagName("tr"); + + if (cell.nodeName != "TD" && cell.nodeName != "TH") + cell = nextCell(cell); + + do { + if (cell == tdElm) + break; + col += cell.getAttribute("colspan"); + } while ((cell = nextCell(cell)) != null); + + for (var i=0; i - +
    {#table_dlg.merge_cells_title} -
     
    - - - - - - - - -
    {#table_dlg.cols}:
    {#table_dlg.rows}:
    + + + + + + + + + +
    :
    :
    diff --git a/js/tiny_mce/plugins/table/row.htm b/js/tiny_mce/plugins/table/row.htm index 092e6c8270..1885401f6b 100644 --- a/js/tiny_mce/plugins/table/row.htm +++ b/js/tiny_mce/plugins/table/row.htm @@ -5,16 +5,17 @@ + - + @@ -23,7 +24,7 @@
    {#table_dlg.general_props} - +
    - +
    @@ -70,7 +71,7 @@
    @@ -80,7 +81,7 @@
    {#table_dlg.advanced_props} - +
    @@ -112,7 +113,7 @@ bug - if (hc && (cn = n.firstChild) && cn.nodeType === 1 && n.childNodes.length === 1) { - if (cn.hasAttribute ? cn.hasAttribute('_mce_bogus') : cn.getAttribute('_mce_bogus')) - w.writeText('\u00a0'); - } else if (!hc) - w.writeText('\u00a0'); // No children then padd it - } + onPreProcess = new tinymce.util.Dispatcher(self); - break; + onPostProcess = new tinymce.util.Dispatcher(self); - case 3: // Text - // Check if valid child - if (s.validate_children && t.elementName && !t.schema.isValid(t.elementName, '#text')) - return; + htmlParser = new tinymce.html.DomParser(settings, schema); - return w.writeText(n.nodeValue); + // Convert move data-mce-src, data-mce-href and data-mce-style into nodes or process them if needed + htmlParser.addAttributeFilter('src,href,style', function(nodes, name) { + var i = nodes.length, node, value, internalName = 'data-mce-' + name, urlConverter = settings.url_converter, urlConverterScope = settings.url_converter_scope, undef; - case 4: // CDATA - return w.writeCDATA(n.nodeValue); + while (i--) { + node = nodes[i]; - case 8: // Comment - return w.writeComment(n.nodeValue); - } - } else if (n.nodeType == 1) - hc = n.hasChildNodes(); + value = node.attributes.map[internalName]; + if (value !== undef) { + // Set external name to internal value and remove internal + node.attr(name, value.length > 0 ? value : null); + node.attr(internalName, null); + } else { + // No internal attribute found then convert the value we have in the DOM + value = node.attributes.map[name]; - if (hc && !closed) { - cn = n.firstChild; + if (name === "style") + value = dom.serializeStyle(dom.parseStyle(value), node.name); + else if (urlConverter) + value = urlConverter.call(urlConverterScope, value, name, node.name); - while (cn) { - t._serializeNode(cn); - t.elementName = nn; - cn = cn.nextSibling; + node.attr(name, value.length > 0 ? value : null); } } + }); - // Write element end - if (!iv) { - if (!closed) - w.writeFullEndElement(); - else - w.writeEndElement(); - } - }, + // Remove internal classes mceItem<..> + htmlParser.addAttributeFilter('class', function(nodes, name) { + var i = nodes.length, node, value; - _protect : function(o) { - var t = this; + while (i--) { + node = nodes[i]; + value = node.attr('class').replace(/\s*mce(Item\w+|Selected)\s*/g, ''); + node.attr('class', value.length > 0 ? value : null); + } + }); - o.items = o.items || []; + // Remove bookmark elements + htmlParser.addAttributeFilter('data-mce-type', function(nodes, name, args) { + var i = nodes.length, node; - function enc(s) { - return s.replace(/[\r\n\\]/g, function(c) { - if (c === '\n') - return '\\n'; - else if (c === '\\') - return '\\\\'; + while (i--) { + node = nodes[i]; - return '\\r'; - }); - }; + if (node.attributes.map['data-mce-type'] === 'bookmark' && !args.cleanup) + node.remove(); + } + }); - function dec(s) { - return s.replace(/\\[\\rn]/g, function(c) { - if (c === '\\n') - return '\n'; - else if (c === '\\\\') - return '\\'; + // Force script into CDATA sections and remove the mce- prefix also add comments around styles + htmlParser.addNodeFilter('script,style', function(nodes, name) { + var i = nodes.length, node, value; - return '\r'; - }); + function trim(value) { + return value.replace(/()/g, '\n') + .replace(/^[\r\n]*|[\r\n]*$/g, '') + .replace(/^\s*(\/\/\s*|\]\]>|-->|\]\]-->)\s*$/g, ''); }; - each(o.patterns, function(p) { - o.content = dec(enc(o.content).replace(p.pattern, function(x, a, b, c) { - b = dec(b); - - if (p.encode) - b = t._encode(b); - - o.items.push(b); - return a + '' + c; - })); - }); - - return o; - }, + while (i--) { + node = nodes[i]; + value = node.firstChild ? node.firstChild.value : ''; - _unprotect : function(h, o) { - h = h.replace(/\'; + } + } + }); - return h; - }, + // Convert comments to cdata and handle protected comments + htmlParser.addNodeFilter('#comment', function(nodes, name) { + var i = nodes.length, node; + + while (i--) { + node = nodes[i]; + + if (node.value.indexOf('[CDATA[') === 0) { + node.name = '#cdata'; + node.type = 4; + node.value = node.value.replace(/^\[CDATA\[|\]\]$/g, ''); + } else if (node.value.indexOf('mce:protected ') === 0) { + node.name = "#text"; + node.type = 3; + node.raw = true; + node.value = unescape(node.value).substr(14); + } + } + }); - _encode : function(h) { - var t = this, s = t.settings, l; + htmlParser.addNodeFilter('xml:namespace,input', function(nodes, name) { + var i = nodes.length, node; - // Entity encode - if (s.entity_encoding !== 'raw') { - if (s.entity_encoding.indexOf('named') != -1) { - t.setEntities(s.entities); - l = t.entityLookup; + while (i--) { + node = nodes[i]; + if (node.type === 7) + node.remove(); + else if (node.type === 1) { + if (name === "input" && !("type" in node.attributes.map)) + node.attr('type', 'text'); + } + } + }); - h = h.replace(/[\u007E-\uFFFF]/g, function(a) { - var v; + // Fix list elements, TODO: Replace this later + if (settings.fix_list_elements) { + htmlParser.addNodeFilter('ul,ol', function(nodes, name) { + var i = nodes.length, node, parentNode; - if (v = l[a]) - a = '&' + v + ';'; + while (i--) { + node = nodes[i]; + parentNode = node.parent; - return a; - }); + if (parentNode.name === 'ul' || parentNode.name === 'ol') { + if (node.prev && node.prev.name === 'li') { + node.prev.append(node); + } + } } + }); + } - if (s.entity_encoding.indexOf('numeric') != -1) { - h = h.replace(/[\u007E-\uFFFF]/g, function(a) { - return '&#' + a.charCodeAt(0) + ';'; - }); - } + // Remove internal data attributes + htmlParser.addAttributeFilter('data-mce-src,data-mce-href,data-mce-style', function(nodes, name) { + var i = nodes.length; + + while (i--) { + nodes[i].attr(name, null); } + }); - return h; - }, + // Return public methods + return { + schema : schema, - _setup : function() { - var t = this, s = this.settings; + addNodeFilter : htmlParser.addNodeFilter, - if (t.done) - return; + addAttributeFilter : htmlParser.addAttributeFilter, - t.done = 1; + onPreProcess : onPreProcess, - t.setRules(s.valid_elements); - t.addRules(s.extended_valid_elements); + onPostProcess : onPostProcess, - if (s.invalid_elements) - t.invalidElementsRE = new RegExp('^(' + wildcardToRE(s.invalid_elements.replace(/,/g, '|').toLowerCase()) + ')$'); + serialize : function(node, args) { + var impl, doc, oldDoc, htmlSerializer, content; - if (s.attrib_value_filter) - t.attribValueFilter = s.attribValueFilter; - }, + // Explorer won't clone contents of script and style and the + // selected index of select elements are cleared on a clone operation. + if (isIE && dom.select('script,style,select,map').length > 0) { + content = node.innerHTML; + node = node.cloneNode(false); + dom.setHTML(node, content); + } else + node = node.cloneNode(true); + + // Nodes needs to be attached to something in WebKit/Opera + // Older builds of Opera crashes if you attach the node to an document created dynamically + // and since we can't feature detect a crash we need to sniff the acutal build number + // This fix will make DOM ranges and make Sizzle happy! + impl = node.ownerDocument.implementation; + if (impl.createHTMLDocument) { + // Create an empty HTML document + doc = impl.createHTMLDocument(""); + + // Add the element or it's children if it's a body element to the new document + each(node.nodeName == 'BODY' ? node.childNodes : [node], function(node) { + doc.body.appendChild(doc.importNode(node, true)); + }); - _getAttrib : function(n, a, na) { - var i, v; + // Grab first child or body element for serialization + if (node.nodeName != 'BODY') + node = doc.body.firstChild; + else + node = doc.body; - na = na || a.name; + // set the new document in DOMUtils so createElement etc works + oldDoc = dom.doc; + dom.doc = doc; + } - if (a.forcedVal && (v = a.forcedVal)) { - if (v === '{$uid}') - return this.dom.uniqueId(); + args = args || {}; + args.format = args.format || 'html'; - return v; - } + // Pre process + if (!args.no_events) { + args.node = node; + onPreProcess.dispatch(self, args); + } - v = this.dom.getAttrib(n, na); + // Setup serializer + htmlSerializer = new tinymce.html.Serializer(settings, schema); - switch (na) { - case 'rowspan': - case 'colspan': - // Whats the point? Remove usless attribute value - if (v == '1') - v = ''; + // Parse and serialize HTML + args.content = htmlSerializer.serialize( + htmlParser.parse(args.getInner ? node.innerHTML : tinymce.trim(dom.getOuterHTML(node), args), args) + ); - break; - } + // Replace all BOM characters for now until we can find a better solution + if (!args.cleanup) + args.content = args.content.replace(/\uFEFF|\u200B/g, ''); - if (this.attribValueFilter) - v = this.attribValueFilter(na, v, n); + // Post process + if (!args.no_events) + onPostProcess.dispatch(self, args); - if (a.validVals) { - for (i = a.validVals.length - 1; i >= 0; i--) { - if (v == a.validVals[i]) - break; - } + // Restore the old document if it was changed + if (oldDoc) + dom.doc = oldDoc; - if (i == -1) - return null; - } + args.node = null; - if (v === '' && typeof(a.defaultVal) != 'undefined') { - v = a.defaultVal; + return args.content; + }, - if (v === '{$uid}') - return this.dom.uniqueId(); + addRules : function(rules) { + schema.addValidElements(rules); + }, - return v; - } else { - // Remove internal mceItemXX classes when content is extracted from editor - if (na == 'class' && this.processObj.get) - v = v.replace(/\s?mceItem\w+\s?/g, ''); + setRules : function(rules) { + schema.setValidElements(rules); } - - if (v === '') - return null; - - - return v; - } - }); + }; + }; })(tinymce); - (function(tinymce) { tinymce.dom.ScriptLoader = function(settings) { var QUEUED = 0, @@ -6850,6 +8581,17 @@ window.tinymce.dom.Sizzle = Sizzle; callback(); }; + + function error() { + // Report the error so it's easier for people to spot loading errors + if (typeof(console) !== "undefined" && console.log) + console.log("Failed to load: " + url); + + // We can't mark it as done if there is a load error since + // A) We don't want to produce 404 errors on the server and + // B) the onerror event won't fire on all browsers. + // done(); + }; id = dom.uniqueId(); @@ -6859,7 +8601,7 @@ window.tinymce.dom.Sizzle = Sizzle; // If script is from same domain and we // use IE 6 then use XHR since it's more reliable - if (uri.host == loc.hostname && uri.port == loc.port && (uri.protocol + ':') == loc.protocol) { + if (uri.host == loc.hostname && uri.port == loc.port && (uri.protocol + ':') == loc.protocol && uri.protocol.toLowerCase() != 'file') { tinymce.util.XHR.send({ url : tinymce._addVer(uri.getURI()), success : function(content) { @@ -6874,7 +8616,9 @@ window.tinymce.dom.Sizzle = Sizzle; dom.remove(script); done(); - } + }, + + error : error }); return; @@ -6888,17 +8632,26 @@ window.tinymce.dom.Sizzle = Sizzle; src : tinymce._addVer(url) }); - // Add onload and readystate listeners - elm.onload = done; - elm.onreadystatechange = function() { - var state = elm.readyState; + // Add onload listener for non IE browsers since IE9 + // fires onload event before the script is parsed and executed + if (!tinymce.isIE) + elm.onload = done; - // Loaded state is passed on IE 6 however there - // are known issues with this method but we can't use - // XHR in a cross domain loading - if (state == 'complete' || state == 'loaded') - done(); - }; + // Add onerror event will get fired on some browsers but not all of them + elm.onerror = error; + + // Opera 9.60 doesn't seem to fire the onreadystate event at correctly + if (!tinymce.isOpera) { + elm.onreadystatechange = function() { + var state = elm.readyState; + + // Loaded state is passed on IE 6 however there + // are known issues with this method but we can't use + // XHR in a cross domain loading + if (state == 'complete' || state == 'loaded') + done(); + }; + } // Most browsers support this feature so we report errors // for those at least to help users track their missing plugins etc @@ -7046,164 +8799,10 @@ tinymce.dom.TreeWalker = function(start_node, root_node) { }; this.prev = function(shallow) { - return (node = findSibling(node, 'lastChild', 'lastSibling', shallow)); - }; -}; - -(function() { - var transitional = {}; - - function unpack(lookup, data) { - var key; - - function replace(value) { - return value.replace(/[A-Z]+/g, function(key) { - return replace(lookup[key]); - }); - }; - - // Unpack lookup - for (key in lookup) { - if (lookup.hasOwnProperty(key)) - lookup[key] = replace(lookup[key]); - } - - // Unpack and parse data into object map - replace(data).replace(/#/g, '#text').replace(/(\w+)\[([^\]]+)\]/g, function(str, name, children) { - var i, map = {}; - - children = children.split(/\|/); - - for (i = children.length - 1; i >= 0; i--) - map[children[i]] = 1; - - transitional[name] = map; - }); - }; - - // This is the XHTML 1.0 transitional elements with it's children packed to reduce it's size - // we will later include the attributes here and use it as a default for valid elements but it - // requires us to rewrite the serializer engine - unpack({ - Z : '#|H|K|N|O|P', - Y : '#|X|form|R|Q', - X : 'p|T|div|U|W|isindex|fieldset|table', - W : 'pre|hr|blockquote|address|center|noframes', - U : 'ul|ol|dl|menu|dir', - ZC : '#|p|Y|div|U|W|table|br|span|bdo|object|applet|img|map|K|N|Q', - T : 'h1|h2|h3|h4|h5|h6', - ZB : '#|X|S|Q', - S : 'R|P', - ZA : '#|a|G|J|M|O|P', - R : '#|a|H|K|N|O', - Q : 'noscript|P', - P : 'ins|del|script', - O : 'input|select|textarea|label|button', - N : 'M|L', - M : 'em|strong|dfn|code|q|samp|kbd|var|cite|abbr|acronym', - L : 'sub|sup', - K : 'J|I', - J : 'tt|i|b|u|s|strike', - I : 'big|small|font|basefont', - H : 'G|F', - G : 'br|span|bdo', - F : 'object|applet|img|map|iframe' - }, 'script[]' + - 'style[]' + - 'object[#|param|X|form|a|H|K|N|O|Q]' + - 'param[]' + - 'p[S]' + - 'a[Z]' + - 'br[]' + - 'span[S]' + - 'bdo[S]' + - 'applet[#|param|X|form|a|H|K|N|O|Q]' + - 'h1[S]' + - 'img[]' + - 'map[X|form|Q|area]' + - 'h2[S]' + - 'iframe[#|X|form|a|H|K|N|O|Q]' + - 'h3[S]' + - 'tt[S]' + - 'i[S]' + - 'b[S]' + - 'u[S]' + - 's[S]' + - 'strike[S]' + - 'big[S]' + - 'small[S]' + - 'font[S]' + - 'basefont[]' + - 'em[S]' + - 'strong[S]' + - 'dfn[S]' + - 'code[S]' + - 'q[S]' + - 'samp[S]' + - 'kbd[S]' + - 'var[S]' + - 'cite[S]' + - 'abbr[S]' + - 'acronym[S]' + - 'sub[S]' + - 'sup[S]' + - 'input[]' + - 'select[optgroup|option]' + - 'optgroup[option]' + - 'option[]' + - 'textarea[]' + - 'label[S]' + - 'button[#|p|T|div|U|W|table|G|object|applet|img|map|K|N|Q]' + - 'h4[S]' + - 'ins[#|X|form|a|H|K|N|O|Q]' + - 'h5[S]' + - 'del[#|X|form|a|H|K|N|O|Q]' + - 'h6[S]' + - 'div[#|X|form|a|H|K|N|O|Q]' + - 'ul[li]' + - 'li[#|X|form|a|H|K|N|O|Q]' + - 'ol[li]' + - 'dl[dt|dd]' + - 'dt[S]' + - 'dd[#|X|form|a|H|K|N|O|Q]' + - 'menu[li]' + - 'dir[li]' + - 'pre[ZA]' + - 'hr[]' + - 'blockquote[#|X|form|a|H|K|N|O|Q]' + - 'address[S|p]' + - 'center[#|X|form|a|H|K|N|O|Q]' + - 'noframes[#|X|form|a|H|K|N|O|Q]' + - 'isindex[]' + - 'fieldset[#|legend|X|form|a|H|K|N|O|Q]' + - 'legend[S]' + - 'table[caption|col|colgroup|thead|tfoot|tbody|tr]' + - 'caption[S]' + - 'col[]' + - 'colgroup[col]' + - 'thead[tr]' + - 'tr[th|td]' + - 'th[#|X|form|a|H|K|N|O|Q]' + - 'form[#|X|a|H|K|N|O|Q]' + - 'noscript[#|X|form|a|H|K|N|O|Q]' + - 'td[#|X|form|a|H|K|N|O|Q]' + - 'tfoot[tr]' + - 'tbody[tr]' + - 'area[]' + - 'base[]' + - 'body[#|X|form|a|H|K|N|O|Q]' - ); - - tinymce.dom.Schema = function() { - var t = this, elements = transitional; - - t.isValid = function(name, child_name) { - var element = elements[name]; - - return !!(element && (!child_name || element[child_name])); - }; + return (node = findSibling(node, 'lastChild', 'previousSibling', shallow)); }; -})(); +}; + (function(tinymce) { tinymce.dom.RangeUtils = function(dom) { var INVISIBLE_CHAR = '\uFEFF'; @@ -7227,6 +8826,24 @@ tinymce.dom.TreeWalker = function(start_node, root_node) { return; } + function exclude(nodes) { + var node; + + // First node is excluded + node = nodes[0]; + if (node.nodeType === 3 && node === startContainer && startOffset >= node.nodeValue.length) { + nodes.splice(0, 1); + } + + // Last node is excluded + node = nodes[nodes.length - 1]; + if (endOffset === 0 && nodes.length > 0 && node === endContainer && node.nodeType === 3) { + nodes.splice(nodes.length - 1, 1); + } + + return nodes; + }; + function collectSiblings(node, name, end_node) { var siblings = []; @@ -7256,7 +8873,7 @@ tinymce.dom.TreeWalker = function(start_node, root_node) { if (!next) siblings.reverse(); - callback(siblings); + callback(exclude(siblings)); } } }; @@ -7267,30 +8884,30 @@ tinymce.dom.TreeWalker = function(start_node, root_node) { // If index based end position then resolve it if (endContainer.nodeType == 1 && endContainer.hasChildNodes()) - endContainer = endContainer.childNodes[Math.min(startOffset == endOffset ? endOffset : endOffset - 1, endContainer.childNodes.length - 1)]; - - // Find common ancestor and end points - ancestor = dom.findCommonAncestor(startContainer, endContainer); + endContainer = endContainer.childNodes[Math.min(endOffset - 1, endContainer.childNodes.length - 1)]; // Same container if (startContainer == endContainer) - return callback([startContainer]); + return callback(exclude([startContainer])); + // Find common ancestor and end points + ancestor = dom.findCommonAncestor(startContainer, endContainer); + // Process left side for (node = startContainer; node; node = node.parentNode) { - if (node == endContainer) + if (node === endContainer) return walkBoundary(startContainer, ancestor, true); - if (node == ancestor) + if (node === ancestor) break; } // Process right side for (node = endContainer; node; node = node.parentNode) { - if (node == startContainer) + if (node === startContainer) return walkBoundary(endContainer, ancestor); - if (node == ancestor) + if (node === ancestor) break; } @@ -7309,48 +8926,46 @@ tinymce.dom.TreeWalker = function(start_node, root_node) { ); if (siblings.length) - callback(siblings); + callback(exclude(siblings)); // Walk right leaf walkBoundary(endContainer, endPoint); }; - /* this.split = function(rng) { + this.split = function(rng) { var startContainer = rng.startContainer, startOffset = rng.startOffset, endContainer = rng.endContainer, endOffset = rng.endOffset; function splitText(node, offset) { - if (offset == node.nodeValue.length) - node.appendData(INVISIBLE_CHAR); - - node = node.splitText(offset); - - if (node.nodeValue === INVISIBLE_CHAR) - node.nodeValue = ''; - - return node; + return node.splitText(offset); }; // Handle single text node - if (startContainer == endContainer) { - if (startContainer.nodeType == 3) { - if (startOffset != 0) - startContainer = endContainer = splitText(startContainer, startOffset); - - if (endOffset - startOffset != startContainer.nodeValue.length) - splitText(startContainer, endOffset - startOffset); + if (startContainer == endContainer && startContainer.nodeType == 3) { + if (startOffset > 0 && startOffset < startContainer.nodeValue.length) { + endContainer = splitText(startContainer, startOffset); + startContainer = endContainer.previousSibling; + + if (endOffset > startOffset) { + endOffset = endOffset - startOffset; + startContainer = endContainer = splitText(endContainer, endOffset).previousSibling; + endOffset = endContainer.nodeValue.length; + startOffset = 0; + } else { + endOffset = 0; + } } } else { // Split startContainer text node if needed - if (startContainer.nodeType == 3 && startOffset != 0) { + if (startContainer.nodeType == 3 && startOffset > 0 && startOffset < startContainer.nodeValue.length) { startContainer = splitText(startContainer, startOffset); startOffset = 0; } // Split endContainer text node if needed - if (endContainer.nodeType == 3 && endOffset != endContainer.nodeValue.length) { + if (endContainer.nodeType == 3 && endOffset > 0 && endOffset < endContainer.nodeValue.length) { endContainer = splitText(endContainer, endOffset).previousSibling; endOffset = endContainer.nodeValue.length; } @@ -7363,7 +8978,7 @@ tinymce.dom.TreeWalker = function(start_node, root_node) { endOffset : endOffset }; }; -*/ + }; tinymce.dom.RangeUtils.compareRanges = function(rng1, rng2) { @@ -7387,12 +9002,159 @@ tinymce.dom.TreeWalker = function(start_node, root_node) { }; })(tinymce); +(function(tinymce) { + var Event = tinymce.dom.Event, each = tinymce.each; + + tinymce.create('tinymce.ui.KeyboardNavigation', { + KeyboardNavigation: function(settings, dom) { + var t = this, root = settings.root, items = settings.items, + enableUpDown = settings.enableUpDown, enableLeftRight = settings.enableLeftRight || !settings.enableUpDown, + excludeFromTabOrder = settings.excludeFromTabOrder, + itemFocussed, itemBlurred, rootKeydown, rootFocussed, focussedId; + + dom = dom || tinymce.DOM; + + itemFocussed = function(evt) { + focussedId = evt.target.id; + }; + + itemBlurred = function(evt) { + dom.setAttrib(evt.target.id, 'tabindex', '-1'); + }; + + rootFocussed = function(evt) { + var item = dom.get(focussedId); + dom.setAttrib(item, 'tabindex', '0'); + item.focus(); + }; + + t.focus = function() { + dom.get(focussedId).focus(); + }; + + t.destroy = function() { + each(items, function(item) { + dom.unbind(dom.get(item.id), 'focus', itemFocussed); + dom.unbind(dom.get(item.id), 'blur', itemBlurred); + }); + + dom.unbind(dom.get(root), 'focus', rootFocussed); + dom.unbind(dom.get(root), 'keydown', rootKeydown); + + items = dom = root = t.focus = itemFocussed = itemBlurred = rootKeydown = rootFocussed = null; + t.destroy = function() {}; + }; + + t.moveFocus = function(dir, evt) { + var idx = -1, controls = t.controls, newFocus; + + if (!focussedId) + return; + + each(items, function(item, index) { + if (item.id === focussedId) { + idx = index; + return false; + } + }); + + idx += dir; + if (idx < 0) { + idx = items.length - 1; + } else if (idx >= items.length) { + idx = 0; + } + + newFocus = items[idx]; + dom.setAttrib(focussedId, 'tabindex', '-1'); + dom.setAttrib(newFocus.id, 'tabindex', '0'); + dom.get(newFocus.id).focus(); + + if (settings.actOnFocus) { + settings.onAction(newFocus.id); + } + + if (evt) + Event.cancel(evt); + }; + + rootKeydown = function(evt) { + var DOM_VK_LEFT = 37, DOM_VK_RIGHT = 39, DOM_VK_UP = 38, DOM_VK_DOWN = 40, DOM_VK_ESCAPE = 27, DOM_VK_ENTER = 14, DOM_VK_RETURN = 13, DOM_VK_SPACE = 32; + + switch (evt.keyCode) { + case DOM_VK_LEFT: + if (enableLeftRight) t.moveFocus(-1); + break; + + case DOM_VK_RIGHT: + if (enableLeftRight) t.moveFocus(1); + break; + + case DOM_VK_UP: + if (enableUpDown) t.moveFocus(-1); + break; + + case DOM_VK_DOWN: + if (enableUpDown) t.moveFocus(1); + break; + + case DOM_VK_ESCAPE: + if (settings.onCancel) { + settings.onCancel(); + Event.cancel(evt); + } + break; + + case DOM_VK_ENTER: + case DOM_VK_RETURN: + case DOM_VK_SPACE: + if (settings.onAction) { + settings.onAction(focussedId); + Event.cancel(evt); + } + break; + } + }; + + // Set up state and listeners for each item. + each(items, function(item, idx) { + var tabindex; + + if (!item.id) { + item.id = dom.uniqueId('_mce_item_'); + } + + if (excludeFromTabOrder) { + dom.bind(item.id, 'blur', itemBlurred); + tabindex = '-1'; + } else { + tabindex = (idx === 0 ? '0' : '-1'); + } + + dom.setAttrib(item.id, 'tabindex', tabindex); + dom.bind(dom.get(item.id), 'focus', itemFocussed); + }); + + // Setup initial state for root element. + if (items[0]){ + focussedId = items[0].id; + } + + dom.setAttrib(root, 'tabindex', '-1'); + + // Setup listeners for root element. + dom.bind(dom.get(root), 'focus', rootFocussed); + dom.bind(dom.get(root), 'keydown', rootKeydown); + } + }); +})(tinymce); + (function(tinymce) { // Shorten class names var DOM = tinymce.DOM, is = tinymce.is; tinymce.create('tinymce.ui.Control', { - Control : function(id, s) { + Control : function(id, s, editor) { this.id = id; this.settings = s = s || {}; this.rendered = false; @@ -7401,22 +9163,23 @@ tinymce.dom.TreeWalker = function(start_node, root_node) { this.scope = s.scope || this; this.disabled = 0; this.active = 0; + this.editor = editor; + }, + + setAriaProperty : function(property, value) { + var element = DOM.get(this.id + '_aria') || DOM.get(this.id); + if (element) { + DOM.setAttrib(element, 'aria-' + property, !!value); + } + }, + + focus : function() { + DOM.get(this.id).focus(); }, setDisabled : function(s) { - var e; - if (s != this.disabled) { - e = DOM.get(this.id); - - // Add accessibility title for unavailable actions - if (e && this.settings.unavailable_prefix) { - if (s) { - this.prevTitle = e.title; - e.title = this.settings.unavailable_prefix + ": " + e.title; - } else - e.title = this.prevTitle; - } + this.setAriaProperty('disabled', s); this.setState('Disabled', s); this.setState('Enabled', !s); @@ -7432,6 +9195,7 @@ tinymce.dom.TreeWalker = function(start_node, root_node) { if (s != this.active) { this.setState('Active', s); this.active = s; + this.setAriaProperty('pressed', s); } }, @@ -7489,8 +9253,8 @@ tinymce.dom.TreeWalker = function(start_node, root_node) { }); })(tinymce); tinymce.create('tinymce.ui.Container:tinymce.ui.Control', { - Container : function(id, s) { - this.parent(id, s); + Container : function(id, s, editor) { + this.parent(id, s, editor); this.controls = []; @@ -7514,10 +9278,11 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', { Separator : function(id, s) { this.parent(id, s); this.classPrefix = 'mceSeparator'; + this.setDisabled(true); }, renderHTML : function() { - return tinymce.DOM.createHTML('span', {'class' : this.classPrefix}); + return tinymce.DOM.createHTML('span', {'class' : this.classPrefix, role : 'separator', 'aria-orientation' : 'vertical', tabindex : '-1'}); } }); @@ -7532,6 +9297,7 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', { setSelected : function(s) { this.setState('Selected', s); + this.setAriaProperty('checked', !!s); this.selected = s; }, @@ -7679,12 +9445,20 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', { s['class'] = s['class'] || cs['class']; s.vp_offset_x = s.vp_offset_x || cs.vp_offset_x; s.vp_offset_y = s.vp_offset_y || cs.vp_offset_y; + s.keyboard_focus = cs.keyboard_focus; m = new tinymce.ui.DropMenu(s.id || DOM.uniqueId(), s); m.onAddItem.add(t.onAddItem.dispatch, t.onAddItem); return m; }, + + focus : function() { + var t = this; + if (t.keyboardNav) { + t.keyboardNav.focus(); + } + }, update : function() { var t = this, s = t.settings, tb = DOM.get('menu_' + t.id + '_tbl'), co = DOM.get('menu_' + t.id + '_co'), tw, th; @@ -7808,13 +9582,13 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', { } }); } + + Event.add(co, 'keydown', t._keyHandler, t); t.onShowMenu.dispatch(t); - if (s.keyboard_focus) { - Event.add(co, 'keydown', t._keyHandler, t); - DOM.select('a', 'menu_' + t.id)[0].focus(); // Select first link - t._focusIdx = 0; + if (s.keyboard_focus) { + t._setupKeyboardNav(); } }, @@ -7824,6 +9598,7 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', { if (!t.isMenuVisible) return; + if (t.keyboardNav) t.keyboardNav.destroy(); Event.remove(co, 'mouseover', t.mouseOverFunc); Event.remove(co, 'click', t.mouseClickFunc); Event.remove(co, 'keydown', t._keyHandler); @@ -7868,8 +9643,11 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', { destroy : function() { var t = this, co = DOM.get('menu_' + t.id); + if (t.keyboardNav) t.keyboardNav.destroy(); Event.remove(co, 'mouseover', t.mouseOverFunc); + Event.remove(DOM.select('a', co), 'focus', t.mouseOverFunc); Event.remove(co, 'click', t.mouseClickFunc); + Event.remove(co, 'keydown', t._keyHandler); if (t.element) t.element.remove(); @@ -7880,15 +9658,18 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', { renderNode : function() { var t = this, s = t.settings, n, tb, co, w; - w = DOM.create('div', {id : 'menu_' + t.id, 'class' : s['class'], 'style' : 'position:absolute;left:0;top:0;z-index:200000'}); - co = DOM.add(w, 'div', {id : 'menu_' + t.id + '_co', 'class' : t.classPrefix + (s['class'] ? ' ' + s['class'] : '')}); + w = DOM.create('div', {role: 'listbox', id : 'menu_' + t.id, 'class' : s['class'], 'style' : 'position:absolute;left:0;top:0;z-index:200000;outline:0'}); + if (t.settings.parent) { + DOM.setAttrib(w, 'aria-parent', 'menu_' + t.settings.parent.id); + } + co = DOM.add(w, 'div', {role: 'presentation', id : 'menu_' + t.id + '_co', 'class' : t.classPrefix + (s['class'] ? ' ' + s['class'] : '')}); t.element = new Element('menu_' + t.id, {blocker : 1, container : s.container}); if (s.menu_line) DOM.add(co, 'span', {'class' : t.classPrefix + 'Line'}); // n = DOM.add(co, 'div', {id : 'menu_' + t.id + '_co', 'class' : 'mceMenuContainer'}); - n = DOM.add(co, 'table', {id : 'menu_' + t.id + '_tbl', border : 0, cellPadding : 0, cellSpacing : 0}); + n = DOM.add(co, 'table', {role: 'presentation', id : 'menu_' + t.id + '_tbl', border : 0, cellPadding : 0, cellSpacing : 0}); tb = DOM.add(n, 'tbody'); each(t.items, function(o) { @@ -7901,33 +9682,36 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', { }, // Internal functions + _setupKeyboardNav : function(){ + var contextMenu, menuItems, t=this; + contextMenu = DOM.select('#menu_' + t.id)[0]; + menuItems = DOM.select('a[role=option]', 'menu_' + t.id); + menuItems.splice(0,0,contextMenu); + t.keyboardNav = new tinymce.ui.KeyboardNavigation({ + root: 'menu_' + t.id, + items: menuItems, + onCancel: function() { + t.hideMenu(); + }, + enableUpDown: true + }); + contextMenu.focus(); + }, - _keyHandler : function(e) { - var t = this, kc = e.keyCode; - - function focus(d) { - var i = t._focusIdx + d, e = DOM.select('a', 'menu_' + t.id)[i]; - - if (e) { - t._focusIdx = i; - e.focus(); - } - }; - - switch (kc) { - case 38: - focus(-1); // Select first link - return; - - case 40: - focus(1); - return; - - case 13: - return; - - case 27: - return this.hideMenu(); + _keyHandler : function(evt) { + var t = this, e; + switch (evt.keyCode) { + case 37: // Left + if (t.settings.parent) { + t.hideMenu(); + t.settings.parent.focus(); + Event.cancel(evt); + } + break; + case 39: // Right + if (t.mouseOverFunc) + t.mouseOverFunc(evt); + break; } }, @@ -7945,8 +9729,13 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', { } n = ro = DOM.add(tb, 'tr', {id : o.id, 'class' : cp + 'Item ' + cp + 'ItemEnabled'}); - n = it = DOM.add(n, 'td'); - n = a = DOM.add(n, 'a', {href : 'javascript:;', onclick : "return false;", onmousedown : 'return false;'}); + n = it = DOM.add(n, s.titleItem ? 'th' : 'td'); + n = a = DOM.add(n, 'a', {id: o.id + '_aria', role: s.titleItem ? 'presentation' : 'option', href : 'javascript:;', onclick : "return false;", onmousedown : 'return false;'}); + + if (s.parent) { + DOM.setAttrib(a, 'aria-haspopup', 'true'); + DOM.setAttrib(a, 'aria-owns', 'menu_' + o.id); + } DOM.addClass(it, s['class']); // n = DOM.add(n, 'span', {'class' : 'item'}); @@ -7981,8 +9770,8 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', { var DOM = tinymce.DOM; tinymce.create('tinymce.ui.Button:tinymce.ui.Control', { - Button : function(id, s) { - this.parent(id, s); + Button : function(id, s, ed) { + this.parent(id, s, ed); this.classPrefix = 'mceButton'; }, @@ -7990,13 +9779,14 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', { var cp = this.classPrefix, s = this.settings, h, l; l = DOM.encode(s.label || ''); - h = ''; - - if (s.image) - h += '' + l + ''; + h = ''; + if (s.image && !(this.editor &&this.editor.forcedHighContrastMode) ) + h += '' + DOM.encode(s.title) + '' + l; else - h += '' + (l ? '' + l + '' : '') + ''; + h += '' + (l ? '' + l + '' : ''); + h += ''; + h += ''; return h; }, @@ -8015,10 +9805,10 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', { var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, Dispatcher = tinymce.util.Dispatcher; tinymce.create('tinymce.ui.ListBox:tinymce.ui.Control', { - ListBox : function(id, s) { + ListBox : function(id, s, ed) { var t = this; - t.parent(id, s); + t.parent(id, s, ed); t.items = []; @@ -8065,23 +9855,27 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', { }, selectByIndex : function(idx) { - var t = this, e, o; + var t = this, e, o, label; if (idx != t.selectedIndex) { e = DOM.get(t.id + '_text'); + label = DOM.get(t.id + '_voiceDesc'); o = t.items[idx]; if (o) { t.selectedValue = o.value; t.selectedIndex = idx; DOM.setHTML(e, DOM.encode(o.title)); + DOM.setHTML(label, t.settings.title + " - " + o.title); DOM.removeClass(e, 'mceTitle'); + DOM.setAttrib(t.id, 'aria-valuenow', o.title); } else { DOM.setHTML(e, DOM.encode(t.settings.title)); + DOM.setHTML(label, DOM.encode(t.settings.title)); DOM.addClass(e, 'mceTitle'); t.selectedValue = t.selectedIndex = null; + DOM.setAttrib(t.id, 'aria-valuenow', t.settings.title); } - e = 0; } }, @@ -8106,16 +9900,17 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', { renderHTML : function() { var h = '', t = this, s = t.settings, cp = t.classPrefix; - h = '
    - +
    @@ -122,14 +123,16 @@ - +
     
    - + +
     
    +
    diff --git a/js/tiny_mce/plugins/table/table.htm b/js/tiny_mce/plugins/table/table.htm index f269039228..b92fa741eb 100644 --- a/js/tiny_mce/plugins/table/table.htm +++ b/js/tiny_mce/plugins/table/table.htm @@ -10,12 +10,13 @@ - + + @@ -23,48 +24,48 @@
    {#table_dlg.general_props} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    @@ -72,7 +73,7 @@
    {#table_dlg.advanced_props} - +
    @@ -98,7 +99,7 @@ "}else{e+=""}if(f&&j.ListBox){if(f.Button||f.SplitButton){e+=b.createHTML("td",{"class":"mceToolbarStart"},b.createHTML("span",null,""))}}}g="mceToolbarEnd";if(j.Button){g+=" mceToolbarEndButton"}else{if(j.SplitButton){g+=" mceToolbarEndSplitButton"}else{if(j.ListBox){g+=" mceToolbarEndListBox"}}}e+=b.createHTML("td",{"class":g},b.createHTML("span",null,""));return b.createHTML("table",{id:l.id,"class":"mceToolbar"+(m["class"]?" "+m["class"]:""),cellpadding:"0",cellspacing:"0",align:l.settings.align||""},""+e+"")}});(function(b){var a=b.util.Dispatcher,c=b.each;b.create("tinymce.AddOnManager",{items:[],urls:{},lookup:{},onAdd:new a(this),get:function(d){return this.lookup[d]},requireLangPack:function(e){var d=b.settings;if(d&&d.language){b.ScriptLoader.add(this.urls[e]+"/langs/"+d.language+".js")}},add:function(e,d){this.items.push(d);this.lookup[e]=d;this.onAdd.dispatch(this,e,d);return d},load:function(h,e,d,g){var f=this;if(f.urls[h]){return}if(e.indexOf("/")!=0&&e.indexOf("://")==-1){e=b.baseURL+"/"+e}f.urls[h]=e.substring(0,e.lastIndexOf("/"));b.ScriptLoader.add(e,d,g)}});b.PluginManager=new b.AddOnManager();b.ThemeManager=new b.AddOnManager()}(tinymce));(function(j){var g=j.each,d=j.extend,k=j.DOM,i=j.dom.Event,f=j.ThemeManager,b=j.PluginManager,e=j.explode,h=j.util.Dispatcher,a,c=0;j.documentBaseURL=window.location.href.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,"");if(!/[\/\\]$/.test(j.documentBaseURL)){j.documentBaseURL+="/"}j.baseURL=new j.util.URI(j.documentBaseURL).toAbsolute(j.baseURL);j.baseURI=new j.util.URI(j.baseURL);j.onBeforeUnload=new h(j);i.add(window,"beforeunload",function(l){j.onBeforeUnload.dispatch(j,l)});j.onAddEditor=new h(j);j.onRemoveEditor=new h(j);j.EditorManager=d(j,{editors:[],i18n:{},activeEditor:null,init:function(q){var n=this,p,l=j.ScriptLoader,u,o=[],m;function r(x,y,t){var v=x[y];if(!v){return}if(j.is(v,"string")){t=v.replace(/\.\w+$/,"");t=t?j.resolve(t):0;v=j.resolve(v)}return v.apply(t||this,Array.prototype.slice.call(arguments,2))}q=d({theme:"simple",language:"en"},q);n.settings=q;i.add(document,"init",function(){var s,v;r(q,"onpageload");switch(q.mode){case"exact":s=q.elements||"";if(s.length>0){g(e(s),function(x){if(k.get(x)){m=new j.Editor(x,q);o.push(m);m.render(1)}else{g(document.forms,function(y){g(y.elements,function(z){if(z.name===x){x="mce_editor_"+c++;k.setAttrib(z,"id",x);m=new j.Editor(x,q);o.push(m);m.render(1)}})})}})}break;case"textareas":case"specific_textareas":function t(y,x){return x.constructor===RegExp?x.test(y.className):k.hasClass(y,x)}g(k.select("textarea"),function(x){if(q.editor_deselector&&t(x,q.editor_deselector)){return}if(!q.editor_selector||t(x,q.editor_selector)){u=k.get(x.name);if(!x.id&&!u){x.id=x.name}if(!x.id||n.get(x.id)){x.id=k.uniqueId()}m=new j.Editor(x.id,q);o.push(m);m.render(1)}});break}if(q.oninit){s=v=0;g(o,function(x){v++;if(!x.initialized){x.onInit.add(function(){s++;if(s==v){r(q,"oninit")}})}else{s++}if(s==v){r(q,"oninit")}})}})},get:function(l){if(l===a){return this.editors}return this.editors[l]},getInstanceById:function(l){return this.get(l)},add:function(m){var l=this,n=l.editors;n[m.id]=m;n.push(m);l._setActive(m);l.onAddEditor.dispatch(l,m);return m},remove:function(n){var m=this,l,o=m.editors;if(!o[n.id]){return null}delete o[n.id];for(l=0;l':"",visual_table_class:"mceItemTable",visual:1,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",apply_source_formatting:1,directionality:"ltr",forced_root_block:"p",valid_elements:"@[id|class|style|title|dir';if(F.document_base_url!=m.documentBaseURL){E.iframeHTML+=''}E.iframeHTML+='';if(m.relaxedDomain){E.iframeHTML+='\n'; - - document.write(html); - }; - - // Firebug - if (query.debug) - include('firebug/firebug-lite.js'); - - // Core ns - include('tinymce.js'); - - // Load framework adapter - if (query.api) - include('adapter/' + query.api + '/adapter.js'); - - // Core API - include('util/Dispatcher.js'); - include('util/URI.js'); - include('util/Cookie.js'); - include('util/JSON.js'); - include('util/JSONP.js'); - include('util/XHR.js'); - include('util/JSONRequest.js'); - include('dom/DOMUtils.js'); - include('dom/Range.js'); - include('dom/TridentSelection.js'); - include('dom/Sizzle.js'); - include('dom/EventUtils.js'); - include('dom/Element.js'); - include('dom/Selection.js'); - include('dom/XMLWriter.js'); - include('dom/Schema.js'); - include('dom/StringWriter.js'); - include('dom/Serializer.js'); - include('dom/ScriptLoader.js'); - include('dom/TreeWalker.js'); - include('dom/RangeUtils.js'); - include('ui/Control.js'); - include('ui/Container.js'); - include('ui/Separator.js'); - include('ui/MenuItem.js'); - include('ui/Menu.js'); - include('ui/DropMenu.js'); - include('ui/Button.js'); - include('ui/ListBox.js'); - include('ui/NativeListBox.js'); - include('ui/MenuButton.js'); - include('ui/SplitButton.js'); - include('ui/ColorSplitButton.js'); - include('ui/Toolbar.js'); - include('AddOnManager.js'); - include('EditorManager.js'); - include('Editor.js'); - include('EditorCommands.js'); - include('UndoManager.js'); - include('ForceBlocks.js'); - include('ControlManager.js'); - include('WindowManager.js'); - include('Formatter.js'); - include('CommandManager.js'); - include('LegacyInput.js'); - - // Developer API - include('xml/Parser.js'); - include('Developer.js'); - - load(); -}()); \ No newline at end of file +/** + * tiny_mce_dev.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + * + * This file should only be used while developing TinyMCE + * tiny_mce.js or tiny_mce_src.js should be used in a production environment. + * This file loads the js files from classes instead of a merged copy. + */ + +(function() { + var i, nl = document.getElementsByTagName('script'), base, src, p, li, query = '', it, scripts = []; + + if (window.tinyMCEPreInit) { + base = tinyMCEPreInit.base; + query = tinyMCEPreInit.query || ''; + } else { + for (i=0; i\n'; + + document.write(html); + }; + + // Firebug + if (query.debug && !("console" in window)) { + include('firebug/firebug-lite.js'); + } + + // Core ns + include('tinymce.js'); + + // Load framework adapter + if (query.api) + include('adapter/' + query.api + '/adapter.js'); + + // tinymce.util.* + include('util/Dispatcher.js'); + include('util/URI.js'); + include('util/Cookie.js'); + include('util/JSON.js'); + include('util/JSONP.js'); + include('util/XHR.js'); + include('util/JSONRequest.js'); + include('util/VK.js'); + include('util/Quirks.js'); + + // tinymce.html.* + include('html/Entities.js'); + include('html/Styles.js'); + include('html/Schema.js'); + include('html/SaxParser.js'); + include('html/Node.js'); + include('html/DomParser.js'); + include('html/Serializer.js'); + include('html/Writer.js'); + + // tinymce.dom.* + include('dom/DOMUtils.js'); + include('dom/Range.js'); + include('dom/TridentSelection.js'); + include('dom/Sizzle.js'); + include('dom/EventUtils.js'); + include('dom/Element.js'); + include('dom/Selection.js'); + include('dom/Serializer.js'); + include('dom/ScriptLoader.js'); + include('dom/TreeWalker.js'); + include('dom/RangeUtils.js'); + + // tinymce.ui.* + include('ui/KeyboardNavigation.js'); + include('ui/Control.js'); + include('ui/Container.js'); + include('ui/Separator.js'); + include('ui/MenuItem.js'); + include('ui/Menu.js'); + include('ui/DropMenu.js'); + include('ui/Button.js'); + include('ui/ListBox.js'); + include('ui/NativeListBox.js'); + include('ui/MenuButton.js'); + include('ui/SplitButton.js'); + include('ui/ColorSplitButton.js'); + include('ui/ToolbarGroup.js'); + include('ui/Toolbar.js'); + + // tinymce.* + include('AddOnManager.js'); + include('EditorManager.js'); + include('Editor.js'); + include('EditorCommands.js'); + include('UndoManager.js'); + include('ForceBlocks.js'); + include('ControlManager.js'); + include('WindowManager.js'); + include('Formatter.js'); + include('LegacyInput.js'); + + load(); +}()); diff --git a/js/tiny_mce/tiny_mce_jquery.js b/js/tiny_mce/tiny_mce_jquery.js index b93ed9bf45..e7139c08ad 100644 --- a/js/tiny_mce/tiny_mce_jquery.js +++ b/js/tiny_mce/tiny_mce_jquery.js @@ -1 +1 @@ -(function(c){var a=/^\s*|\s*$/g,d;var b={majorVersion:"3",minorVersion:"3.7",releaseDate:"2010-06-10",_init:function(){var r=this,o=document,m=navigator,f=m.userAgent,l,e,k,j,h,q;r.isOpera=c.opera&&opera.buildNumber;r.isWebKit=/WebKit/.test(f);r.isIE=!r.isWebKit&&!r.isOpera&&(/MSIE/gi).test(f)&&(/Explorer/gi).test(m.appName);r.isIE6=r.isIE&&/MSIE [56]/.test(f);r.isGecko=!r.isWebKit&&/Gecko/.test(f);r.isMac=f.indexOf("Mac")!=-1;r.isAir=/adobeair/i.test(f);r.isIDevice=/(iPad|iPhone)/.test(f);if(c.tinyMCEPreInit){r.suffix=tinyMCEPreInit.suffix;r.baseURL=tinyMCEPreInit.base;r.query=tinyMCEPreInit.query;return}r.suffix="";e=o.getElementsByTagName("base");for(l=0;l=c.length){for(e=0,b=g.length;e=c.length||g[e]!=c[e]){f=e+1;break}}}if(g.length=g.length||g[e]!=c[e]){f=e+1;break}}}if(f==1){return h}for(e=0,b=g.length-(f-1);e=0;c--){if(f[c].length==0||f[c]=="."){continue}if(f[c]==".."){b++;continue}if(b>0){b--;continue}h.push(f[c])}c=e.length-b;if(c<=0){g=h.reverse().join("/")}else{g=e.slice(0,c).join("/")+"/"+h.reverse().join("/")}if(g.indexOf("/")!==0){g="/"+g}if(d&&g.lastIndexOf("/")!==g.length-1){g+=d}return g},getURI:function(d){var c,b=this;if(!b.source||d){c="";if(!d){if(b.protocol){c+=b.protocol+"://"}if(b.userInfo){c+=b.userInfo+"@"}if(b.host){c+=b.host}if(b.port){c+=":"+b.port}}if(b.path){c+=b.path}if(b.query){c+="?"+b.query}if(b.anchor){c+="#"+b.anchor}b.source=c}return b.source}})})();(function(){var a=tinymce.each;tinymce.create("static tinymce.util.Cookie",{getHash:function(d){var b=this.get(d),c;if(b){a(b.split("&"),function(e){e=e.split("=");c=c||{};c[unescape(e[0])]=unescape(e[1])})}return c},setHash:function(j,b,g,f,i,c){var h="";a(b,function(e,d){h+=(!h?"":"&")+escape(d)+"="+escape(e)});this.set(j,h,g,f,i,c)},get:function(i){var h=document.cookie,g,f=i+"=",d;if(!h){return}d=h.indexOf("; "+f);if(d==-1){d=h.indexOf(f);if(d!=0){return null}}else{d+=2}g=h.indexOf(";",d);if(g==-1){g=h.length}return unescape(h.substring(d+f.length,g))},set:function(i,b,g,f,h,c){document.cookie=i+"="+escape(b)+((g)?"; expires="+g.toGMTString():"")+((f)?"; path="+escape(f):"")+((h)?"; domain="+h:"")+((c)?"; secure":"")},remove:function(e,b){var c=new Date();c.setTime(c.getTime()-1000);this.set(e,"",c,b,c)}})})();tinymce.create("static tinymce.util.JSON",{serialize:function(e){var c,a,d=tinymce.util.JSON.serialize,b;if(e==null){return"null"}b=typeof e;if(b=="string"){a="\bb\tt\nn\ff\rr\"\"''\\\\";return'"'+e.replace(/([\u0080-\uFFFF\x00-\x1f\"])/g,function(g,f){c=a.indexOf(f);if(c+1){return"\\"+a.charAt(c+1)}g=f.charCodeAt().toString(16);return"\\u"+"0000".substring(g.length)+g})+'"'}if(b=="object"){if(e.hasOwnProperty&&e instanceof Array){for(c=0,a="[";c0?",":"")+d(e[c])}return a+"]"}a="{";for(c in e){a+=typeof e[c]!="function"?(a.length>1?',"':'"')+c+'":'+d(e[c]):""}return a+"}"}return""+e},parse:function(s){try{return eval("("+s+")")}catch(ex){}}});tinymce.create("static tinymce.util.XHR",{send:function(g){var a,e,b=window,h=0;g.scope=g.scope||this;g.success_scope=g.success_scope||g.scope;g.error_scope=g.error_scope||g.scope;g.async=g.async===false?false:true;g.data=g.data||"";function d(i){a=0;try{a=new ActiveXObject(i)}catch(c){}return a}a=b.XMLHttpRequest?new XMLHttpRequest():d("Microsoft.XMLHTTP")||d("Msxml2.XMLHTTP");if(a){if(a.overrideMimeType){a.overrideMimeType(g.content_type)}a.open(g.type||(g.data?"POST":"GET"),g.url,g.async);if(g.content_type){a.setRequestHeader("Content-Type",g.content_type)}a.setRequestHeader("X-Requested-With","XMLHttpRequest");a.send(g.data);function f(){if(!g.async||a.readyState==4||h++>10000){if(g.success&&h<10000&&a.status==200){g.success.call(g.success_scope,""+a.responseText,a,g)}else{if(g.error){g.error.call(g.error_scope,h>10000?"TIMED_OUT":"GENERAL",a,g)}}a=null}else{b.setTimeout(f,10)}}if(!g.async){return f()}e=b.setTimeout(f,10)}}});(function(){var c=tinymce.extend,b=tinymce.util.JSON,a=tinymce.util.XHR;tinymce.create("tinymce.util.JSONRequest",{JSONRequest:function(d){this.settings=c({},d);this.count=0},send:function(f){var e=f.error,d=f.success;f=c(this.settings,f);f.success=function(h,g){h=b.parse(h);if(typeof(h)=="undefined"){h={error:"JSON Parse error."}}if(h.error){e.call(f.error_scope||f.scope,h.error,g)}else{d.call(f.success_scope||f.scope,h.result)}};f.error=function(h,g){e.call(f.error_scope||f.scope,h,g)};f.data=b.serialize({id:f.id||"c"+(this.count++),method:f.method,params:f.params});f.content_type="application/json";a.send(f)},"static":{sendRPC:function(d){return new tinymce.util.JSONRequest().send(d)}}})}());(function(m){var k=m.each,j=m.is,i=m.isWebKit,d=m.isIE,a=/^(H[1-6R]|P|DIV|ADDRESS|PRE|FORM|T(ABLE|BODY|HEAD|FOOT|H|R|D)|LI|OL|UL|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|NOSCRIPT|MENU|ISINDEX|SAMP)$/,e=g("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected"),f=g("src,href,style,coords,shape"),c={"&":"&",'"':""","<":"<",">":">"},n=/[<>&\"]/g,b=/^([a-z0-9],?)+$/i,h=/<(\w+)((?:\s+\w+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)(\s*\/?)>/g,l=/(\w+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g;function g(q){var p={},o;q=q.split(",");for(o=q.length;o>=0;o--){p[q[o]]=1}return p}m.create("tinymce.dom.DOMUtils",{doc:null,root:null,files:null,pixelStyles:/^(top|left|bottom|right|width|height|borderWidth)$/,props:{"for":"htmlFor","class":"className",className:"className",checked:"checked",disabled:"disabled",maxlength:"maxLength",readonly:"readOnly",selected:"selected",value:"value",id:"id",name:"name",type:"type"},DOMUtils:function(u,q){var p=this,o;p.doc=u;p.win=window;p.files={};p.cssFlicker=false;p.counter=0;p.boxModel=!m.isIE||u.compatMode=="CSS1Compat";p.stdMode=u.documentMode===8;p.settings=q=m.extend({keep_values:false,hex_colors:1,process_html:1},q);if(m.isIE6){try{u.execCommand("BackgroundImageCache",false,true)}catch(r){p.cssFlicker=true}}if(q.valid_styles){p._styles={};k(q.valid_styles,function(t,s){p._styles[s]=m.explode(t)})}m.addUnload(p.destroy,p)},getRoot:function(){var o=this,p=o.settings;return(p&&o.get(p.root_element))||o.doc.body},getViewPort:function(p){var q,o;p=!p?this.win:p;q=p.document;o=this.boxModel?q.documentElement:q.body;return{x:p.pageXOffset||o.scrollLeft,y:p.pageYOffset||o.scrollTop,w:p.innerWidth||o.clientWidth,h:p.innerHeight||o.clientHeight}},getRect:function(s){var r,o=this,q;s=o.get(s);r=o.getPos(s);q=o.getSize(s);return{x:r.x,y:r.y,w:q.w,h:q.h}},getSize:function(r){var p=this,o,q;r=p.get(r);o=p.getStyle(r,"width");q=p.getStyle(r,"height");if(o.indexOf("px")===-1){o=0}if(q.indexOf("px")===-1){q=0}return{w:parseInt(o)||r.offsetWidth||r.clientWidth,h:parseInt(q)||r.offsetHeight||r.clientHeight}},getParent:function(q,p,o){return this.getParents(q,p,o,false)},getParents:function(z,v,s,y){var q=this,p,u=q.settings,x=[];z=q.get(z);y=y===undefined;if(u.strict_root){s=s||q.getRoot()}if(j(v,"string")){p=v;if(v==="*"){v=function(o){return o.nodeType==1}}else{v=function(o){return q.is(o,p)}}}while(z){if(z==s||!z.nodeType||z.nodeType===9){break}if(!v||v(z)){if(y){x.push(z)}else{return z}}z=z.parentNode}return y?x:null},get:function(o){var p;if(o&&this.doc&&typeof(o)=="string"){p=o;o=this.doc.getElementById(o);if(o&&o.id!==p){return this.doc.getElementsByName(p)[1]}}return o},getNext:function(p,o){return this._findSib(p,o,"nextSibling")},getPrev:function(p,o){return this._findSib(p,o,"previousSibling")},add:function(s,v,o,r,u){var q=this;return this.run(s,function(y){var x,t;x=j(v,"string")?q.doc.createElement(v):v;q.setAttribs(x,o);if(r){if(r.nodeType){x.appendChild(r)}else{q.setHTML(x,r)}}return !u?y.appendChild(x):x})},create:function(q,o,p){return this.add(this.doc.createElement(q),q,o,p,1)},createHTML:function(v,p,s){var u="",r=this,q;u+="<"+v;for(q in p){if(p.hasOwnProperty(q)){u+=" "+q+'="'+r.encode(p[q])+'"'}}if(m.is(s)){return u+">"+s+""}return u+" />"},remove:function(o,p){return this.run(o,function(r){var q,s;q=r.parentNode;if(!q){return null}if(p){while(s=r.firstChild){if(!m.isIE||s.nodeType!==3||s.nodeValue){q.insertBefore(s,r)}else{r.removeChild(s)}}}return q.removeChild(r)})},setStyle:function(r,o,p){var q=this;return q.run(r,function(v){var u,t;u=v.style;o=o.replace(/-(\D)/g,function(x,s){return s.toUpperCase()});if(q.pixelStyles.test(o)&&(m.is(p,"number")||/^[\-0-9\.]+$/.test(p))){p+="px"}switch(o){case"opacity":if(d){u.filter=p===""?"":"alpha(opacity="+(p*100)+")";if(!r.currentStyle||!r.currentStyle.hasLayout){u.display="inline-block"}}u[o]=u["-moz-opacity"]=u["-khtml-opacity"]=p||"";break;case"float":d?u.styleFloat=p:u.cssFloat=p;break;default:u[o]=p||""}if(q.settings.update_styles){q.setAttrib(v,"_mce_style")}})},getStyle:function(r,o,q){r=this.get(r);if(!r){return false}if(this.doc.defaultView&&q){o=o.replace(/[A-Z]/g,function(s){return"-"+s});try{return this.doc.defaultView.getComputedStyle(r,null).getPropertyValue(o)}catch(p){return null}}o=o.replace(/-(\D)/g,function(t,s){return s.toUpperCase()});if(o=="float"){o=d?"styleFloat":"cssFloat"}if(r.currentStyle&&q){return r.currentStyle[o]}return r.style[o]},setStyles:function(u,v){var q=this,r=q.settings,p;p=r.update_styles;r.update_styles=0;k(v,function(o,s){q.setStyle(u,s,o)});r.update_styles=p;if(r.update_styles){q.setAttrib(u,r.cssText)}},setAttrib:function(q,r,o){var p=this;if(!q||!r){return}if(p.settings.strict){r=r.toLowerCase()}return this.run(q,function(u){var t=p.settings;switch(r){case"style":if(!j(o,"string")){k(o,function(s,x){p.setStyle(u,x,s)});return}if(t.keep_values){if(o&&!p._isRes(o)){u.setAttribute("_mce_style",o,2)}else{u.removeAttribute("_mce_style",2)}}u.style.cssText=o;break;case"class":u.className=o||"";break;case"src":case"href":if(t.keep_values){if(t.url_converter){o=t.url_converter.call(t.url_converter_scope||p,o,r,u)}p.setAttrib(u,"_mce_"+r,o,2)}break;case"shape":u.setAttribute("_mce_style",o);break}if(j(o)&&o!==null&&o.length!==0){u.setAttribute(r,""+o,2)}else{u.removeAttribute(r,2)}})},setAttribs:function(q,r){var p=this;return this.run(q,function(o){k(r,function(s,t){p.setAttrib(o,t,s)})})},getAttrib:function(r,s,q){var o,p=this;r=p.get(r);if(!r||r.nodeType!==1){return false}if(!j(q)){q=""}if(/^(src|href|style|coords|shape)$/.test(s)){o=r.getAttribute("_mce_"+s);if(o){return o}}if(d&&p.props[s]){o=r[p.props[s]];o=o&&o.nodeValue?o.nodeValue:o}if(!o){o=r.getAttribute(s,2)}if(/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(s)){if(r[p.props[s]]===true&&o===""){return s}return o?s:""}if(r.nodeName==="FORM"&&r.getAttributeNode(s)){return r.getAttributeNode(s).nodeValue}if(s==="style"){o=o||r.style.cssText;if(o){o=p.serializeStyle(p.parseStyle(o),r.nodeName);if(p.settings.keep_values&&!p._isRes(o)){r.setAttribute("_mce_style",o)}}}if(i&&s==="class"&&o){o=o.replace(/(apple|webkit)\-[a-z\-]+/gi,"")}if(d){switch(s){case"rowspan":case"colspan":if(o===1){o=""}break;case"size":if(o==="+0"||o===20||o===0){o=""}break;case"width":case"height":case"vspace":case"checked":case"disabled":case"readonly":if(o===0){o=""}break;case"hspace":if(o===-1){o=""}break;case"maxlength":case"tabindex":if(o===32768||o===2147483647||o==="32768"){o=""}break;case"multiple":case"compact":case"noshade":case"nowrap":if(o===65535){return s}return q;case"shape":o=o.toLowerCase();break;default:if(s.indexOf("on")===0&&o){o=(""+o).replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/,"$1")}}}return(o!==undefined&&o!==null&&o!=="")?""+o:q},getPos:function(A,s){var p=this,o=0,z=0,u,v=p.doc,q;A=p.get(A);s=s||v.body;if(A){if(d&&!p.stdMode){A=A.getBoundingClientRect();u=p.boxModel?v.documentElement:v.body;o=p.getStyle(p.select("html")[0],"borderWidth");o=(o=="medium"||p.boxModel&&!p.isIE6)&&2||o;A.top+=p.win.self!=p.win.top?2:0;return{x:A.left+u.scrollLeft-o,y:A.top+u.scrollTop-o}}q=A;while(q&&q!=s&&q.nodeType){o+=q.offsetLeft||0;z+=q.offsetTop||0;q=q.offsetParent}q=A.parentNode;while(q&&q!=s&&q.nodeType){o-=q.scrollLeft||0;z-=q.scrollTop||0;q=q.parentNode}}return{x:o,y:z}},parseStyle:function(r){var u=this,v=u.settings,x={};if(!r){return x}function p(D,A,C){var z,B,o,y;z=x[D+"-top"+A];if(!z){return}B=x[D+"-right"+A];if(z!=B){return}o=x[D+"-bottom"+A];if(B!=o){return}y=x[D+"-left"+A];if(o!=y){return}x[C]=y;delete x[D+"-top"+A];delete x[D+"-right"+A];delete x[D+"-bottom"+A];delete x[D+"-left"+A]}function q(y,s,o,A){var z;z=x[s];if(!z){return}z=x[o];if(!z){return}z=x[A];if(!z){return}x[y]=x[s]+" "+x[o]+" "+x[A];delete x[s];delete x[o];delete x[A]}r=r.replace(/&(#?[a-z0-9]+);/g,"&$1_MCE_SEMI_");k(r.split(";"),function(s){var o,t=[];if(s){s=s.replace(/_MCE_SEMI_/g,";");s=s.replace(/url\([^\)]+\)/g,function(y){t.push(y);return"url("+t.length+")"});s=s.split(":");o=m.trim(s[1]);o=o.replace(/url\(([^\)]+)\)/g,function(z,y){return t[parseInt(y)-1]});o=o.replace(/rgb\([^\)]+\)/g,function(y){return u.toHex(y)});if(v.url_converter){o=o.replace(/url\([\'\"]?([^\)\'\"]+)[\'\"]?\)/g,function(y,z){return"url("+v.url_converter.call(v.url_converter_scope||u,u.decode(z),"style",null)+")"})}x[m.trim(s[0]).toLowerCase()]=o}});p("border","","border");p("border","-width","border-width");p("border","-color","border-color");p("border","-style","border-style");p("padding","","padding");p("margin","","margin");q("border","border-width","border-style","border-color");if(d){if(x.border=="medium none"){x.border=""}}return x},serializeStyle:function(v,p){var q=this,r="";function u(s,o){if(o&&s){if(o.indexOf("-")===0){return}switch(o){case"font-weight":if(s==700){s="bold"}break;case"color":case"background-color":s=s.toLowerCase();break}r+=(r?" ":"")+o+": "+s+";"}}if(p&&q._styles){k(q._styles["*"],function(o){u(v[o],o)});k(q._styles[p.toLowerCase()],function(o){u(v[o],o)})}else{k(v,u)}return r},loadCSS:function(o){var q=this,r=q.doc,p;if(!o){o=""}p=q.select("head")[0];k(o.split(","),function(s){var t;if(q.files[s]){return}q.files[s]=true;t=q.create("link",{rel:"stylesheet",href:m._addVer(s)});if(d&&r.documentMode){t.onload=function(){r.recalc();t.onload=null}}p.appendChild(t)})},addClass:function(o,p){return this.run(o,function(q){var r;if(!p){return 0}if(this.hasClass(q,p)){return q.className}r=this.removeClass(q,p);return q.className=(r!=""?(r+" "):"")+p})},removeClass:function(q,r){var o=this,p;return o.run(q,function(t){var s;if(o.hasClass(t,r)){if(!p){p=new RegExp("(^|\\s+)"+r+"(\\s+|$)","g")}s=t.className.replace(p," ");s=m.trim(s!=" "?s:"");t.className=s;if(!s){t.removeAttribute("class");t.removeAttribute("className")}return s}return t.className})},hasClass:function(p,o){p=this.get(p);if(!p||!o){return false}return(" "+p.className+" ").indexOf(" "+o+" ")!==-1},show:function(o){return this.setStyle(o,"display","block")},hide:function(o){return this.setStyle(o,"display","none")},isHidden:function(o){o=this.get(o);return !o||o.style.display=="none"||this.getStyle(o,"display")=="none"},uniqueId:function(o){return(!o?"mce_":o)+(this.counter++)},setHTML:function(q,p){var o=this;return this.run(q,function(v){var r,t,s,z,u,r;p=o.processHTML(p);if(d){function y(){while(v.firstChild){v.firstChild.removeNode()}try{v.innerHTML="
    "+p;v.removeChild(v.firstChild)}catch(x){r=o.create("div");r.innerHTML="
    "+p;k(r.childNodes,function(B,A){if(A){v.appendChild(B)}})}}if(o.settings.fix_ie_paragraphs){p=p.replace(/

    <\/p>|]+)><\/p>|/gi,' 

    ')}y();if(o.settings.fix_ie_paragraphs){s=v.getElementsByTagName("p");for(t=s.length-1,r=0;t>=0;t--){z=s[t];if(!z.hasChildNodes()){if(!z._mce_keep){r=1;break}z.removeAttribute("_mce_keep")}}}if(r){p=p.replace(/

    ]+)>|

    /ig,'

    ');p=p.replace(/<\/p>/gi,"
    ");y();if(o.settings.fix_ie_paragraphs){s=v.getElementsByTagName("DIV");for(t=s.length-1;t>=0;t--){z=s[t];if(z._mce_tmp){u=o.doc.createElement("p");z.cloneNode(false).outerHTML.replace(/([a-z0-9\-_]+)=/gi,function(A,x){var B;if(x!=="_mce_tmp"){B=z.getAttribute(x);if(!B&&x==="class"){B=z.className}u.setAttribute(x,B)}});for(r=0;r]+)\/>|/gi,"");if(q.keep_values){if(/)/g,"\n");t=t.replace(/^[\r\n]*|[\r\n]*$/g,"");t=t.replace(/^\s*(\/\/\s*|\]\]>|-->|\]\]-->)\s*$/g,"");return t}r=r.replace(/]+|)>([\s\S]*?)<\/script>/gi,function(s,x,t){if(!x){x=' type="text/javascript"'}x=x.replace(/src=\"([^\"]+)\"?/i,function(y,z){if(q.url_converter){z=p.encode(q.url_converter.call(q.url_converter_scope||p,p.decode(z),"src","script"))}return'_mce_src="'+z+'"'});if(m.trim(t)){v.push(o(t));t=""}return""+t+""});r=r.replace(/]+|)>([\s\S]*?)<\/style>/gi,function(s,x,t){if(t){v.push(o(t));t=""}return""+t+""});r=r.replace(/]+|)>([\s\S]*?)<\/noscript>/g,function(s,x,t){return""})}r=r.replace(//g,"");function u(s){return s.replace(h,function(y,z,x,t){return"<"+z+x.replace(l,function(B,A,E,D,C){var F;A=A.toLowerCase();E=E||D||C||"";if(e[A]){if(E==="false"||E==="0"){return}return A+'="'+A+'"'}if(f[A]&&x.indexOf("_mce_"+A)==-1){F=p.decode(E);if(q.url_converter&&(A=="src"||A=="href")){F=q.url_converter.call(q.url_converter_scope||p,F,A,z)}if(A=="style"){F=p.serializeStyle(p.parseStyle(F),A)}return A+'="'+E+'" _mce_'+A+'="'+p.encode(F)+'"'}return B})+t+">"})}r=u(r);r=r.replace(/MCE_SCRIPT:([0-9]+)/g,function(t,s){return v[s]})}return r},getOuterHTML:function(o){var p;o=this.get(o);if(!o){return null}if(o.outerHTML!==undefined){return o.outerHTML}p=(o.ownerDocument||this.doc).createElement("body");p.appendChild(o.cloneNode(true));return p.innerHTML},setOuterHTML:function(r,p,s){var o=this;function q(u,t,x){var y,v;v=x.createElement("body");v.innerHTML=t;y=v.lastChild;while(y){o.insertAfter(y.cloneNode(true),u);y=y.previousSibling}o.remove(u)}return this.run(r,function(u){u=o.get(u);if(u.nodeType==1){s=s||u.ownerDocument||o.doc;if(d){try{if(d&&u.nodeType==1){u.outerHTML=p}else{q(u,p,s)}}catch(t){q(u,p,s)}}else{q(u,p,s)}}})},decode:function(p){var q,r,o;if(/&[\w#]+;/.test(p)){q=this.doc.createElement("div");q.innerHTML=p;r=q.firstChild;o="";if(r){do{o+=r.nodeValue}while(r=r.nextSibling)}return o||p}return p},encode:function(o){return(""+o).replace(n,function(p){return c[p]})},insertAfter:function(o,p){p=this.get(p);return this.run(o,function(r){var q,s;q=p.parentNode;s=p.nextSibling;if(s){q.insertBefore(r,s)}else{q.appendChild(r)}return r})},isBlock:function(o){if(o.nodeType&&o.nodeType!==1){return false}o=o.nodeName||o;return a.test(o)},replace:function(s,r,p){var q=this;if(j(r,"array")){s=s.cloneNode(true)}return q.run(r,function(t){if(p){k(m.grep(t.childNodes),function(o){s.appendChild(o)})}return t.parentNode.replaceChild(s,t)})},rename:function(r,o){var q=this,p;if(r.nodeName!=o.toUpperCase()){p=q.create(o);k(q.getAttribs(r),function(s){q.setAttrib(p,s.nodeName,q.getAttrib(r,s.nodeName))});q.replace(p,r,1)}return p||r},findCommonAncestor:function(q,o){var r=q,p;while(r){p=o;while(p&&r!=p){p=p.parentNode}if(r==p){break}r=r.parentNode}if(!r&&q.ownerDocument){return q.ownerDocument.documentElement}return r},toHex:function(o){var q=/^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(o);function p(r){r=parseInt(r).toString(16);return r.length>1?r:"0"+r}if(q){o="#"+p(q[1])+p(q[2])+p(q[3]);return o}return o},getClasses:function(){var s=this,o=[],r,u={},v=s.settings.class_filter,q;if(s.classes){return s.classes}function x(t){k(t.imports,function(y){x(y)});k(t.cssRules||t.rules,function(y){switch(y.type||1){case 1:if(y.selectorText){k(y.selectorText.split(","),function(z){z=z.replace(/^\s*|\s*$|^\s\./g,"");if(/\.mce/.test(z)||!/\.[\w\-]+$/.test(z)){return}q=z;z=z.replace(/.*\.([a-z0-9_\-]+).*/i,"$1");if(v&&!(z=v(z,q))){return}if(!u[z]){o.push({"class":z});u[z]=1}})}break;case 3:x(y.styleSheet);break}})}try{k(s.doc.styleSheets,x)}catch(p){}if(o.length>0){s.classes=o}return o},run:function(u,r,q){var p=this,v;if(p.doc&&typeof(u)==="string"){u=p.get(u)}if(!u){return false}q=q||this;if(!u.nodeType&&(u.length||u.length===0)){v=[];k(u,function(s,o){if(s){if(typeof(s)=="string"){s=p.doc.getElementById(s)}v.push(r.call(q,s,o))}});return v}return r.call(q,u)},getAttribs:function(q){var p;q=this.get(q);if(!q){return[]}if(d){p=[];if(q.nodeName=="OBJECT"){return q.attributes}if(q.nodeName==="OPTION"&&this.getAttrib(q,"selected")){p.push({specified:1,nodeName:"selected"})}q.cloneNode(false).outerHTML.replace(/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi,"").replace(/[\w:\-]+/gi,function(o){p.push({specified:1,nodeName:o})});return p}return q.attributes},destroy:function(p){var o=this;if(o.events){o.events.destroy()}o.win=o.doc=o.root=o.events=null;if(!p){m.removeUnload(o.destroy)}},createRng:function(){var o=this.doc;return o.createRange?o.createRange():new m.dom.Range(this)},nodeIndex:function(s,t){var o=0,q,r,p;if(s){for(q=s.nodeType,s=s.previousSibling,r=s;s;s=s.previousSibling){p=s.nodeType;if(t&&p==3){if(p==q||!s.nodeValue.length){continue}}o++;q=p}}return o},split:function(u,s,y){var z=this,o=z.createRng(),v,q,x;function p(A){var t,r=A.childNodes;if(A.nodeType==1&&A.getAttribute("_mce_type")=="bookmark"){return}for(t=r.length-1;t>=0;t--){p(r[t])}if(A.nodeType!=9){if(A.nodeType==3&&A.nodeValue.length>0){return}if(A.nodeType==1){r=A.childNodes;if(r.length==1&&r[0]&&r[0].nodeType==1&&r[0].getAttribute("_mce_type")=="bookmark"){A.parentNode.insertBefore(r[0],A)}if(r.length||/^(br|hr|input|img)$/i.test(A.nodeName)){return}}z.remove(A)}return A}if(u&&s){o.setStart(u.parentNode,z.nodeIndex(u));o.setEnd(s.parentNode,z.nodeIndex(s));v=o.extractContents();o=z.createRng();o.setStart(s.parentNode,z.nodeIndex(s)+1);o.setEnd(u.parentNode,z.nodeIndex(u)+1);q=o.extractContents();x=u.parentNode;x.insertBefore(p(v),u);if(y){x.replaceChild(y,s)}else{x.insertBefore(s,u)}x.insertBefore(p(q),u);z.remove(u);return y||s}},bind:function(s,o,r,q){var p=this;if(!p.events){p.events=new m.dom.EventUtils()}return p.events.add(s,o,r,q||this)},unbind:function(r,o,q){var p=this;if(!p.events){p.events=new m.dom.EventUtils()}return p.events.remove(r,o,q)},_findSib:function(r,o,p){var q=this,s=o;if(r){if(j(s,"string")){s=function(t){return q.is(t,o)}}for(r=r[p];r;r=r[p]){if(s(r)){return r}}}return null},_isRes:function(o){return/^(top|left|bottom|right|width|height)/i.test(o)||/;\s*(top|left|bottom|right|width|height)/i.test(o)}});m.DOM=new m.dom.DOMUtils(document,{process_html:0})})(tinymce);(function(a){function b(c){var N=this,e=c.doc,S=0,E=1,j=2,D=true,R=false,U="startOffset",h="startContainer",P="endContainer",z="endOffset",k=tinymce.extend,n=c.nodeIndex;k(N,{startContainer:e,startOffset:0,endContainer:e,endOffset:0,collapsed:D,commonAncestorContainer:e,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3,setStart:q,setEnd:s,setStartBefore:g,setStartAfter:I,setEndBefore:J,setEndAfter:u,collapse:A,selectNode:x,selectNodeContents:F,compareBoundaryPoints:v,deleteContents:p,extractContents:H,cloneContents:d,insertNode:C,surroundContents:M,cloneRange:K});function q(V,t){B(D,V,t)}function s(V,t){B(R,V,t)}function g(t){q(t.parentNode,n(t))}function I(t){q(t.parentNode,n(t)+1)}function J(t){s(t.parentNode,n(t))}function u(t){s(t.parentNode,n(t)+1)}function A(t){if(t){N[P]=N[h];N[z]=N[U]}else{N[h]=N[P];N[U]=N[z]}N.collapsed=D}function x(t){g(t);u(t)}function F(t){q(t,0);s(t,t.nodeType===1?t.childNodes.length:t.nodeValue.length)}function v(W,X){var Z=N[h],Y=N[U],V=N[P],t=N[z];if(W===0){return G(Z,Y,Z,Y)}if(W===1){return G(Z,Y,V,t)}if(W===2){return G(V,t,V,t)}if(W===3){return G(V,t,Z,Y)}}function p(){m(j)}function H(){return m(S)}function d(){return m(E)}function C(Y){var V=this[h],t=this[U],X,W;if((V.nodeType===3||V.nodeType===4)&&V.nodeValue){if(!t){V.parentNode.insertBefore(Y,V)}else{if(t>=V.nodeValue.length){c.insertAfter(Y,V)}else{X=V.splitText(t);V.parentNode.insertBefore(Y,X)}}}else{if(V.childNodes.length>0){W=V.childNodes[t]}if(W){V.insertBefore(Y,W)}else{V.appendChild(Y)}}}function M(V){var t=N.extractContents();N.insertNode(V);V.appendChild(t);N.selectNode(V)}function K(){return k(new b(c),{startContainer:N[h],startOffset:N[U],endContainer:N[P],endOffset:N[z],collapsed:N.collapsed,commonAncestorContainer:N.commonAncestorContainer})}function O(t,V){var W;if(t.nodeType==3){return t}if(V<0){return t}W=t.firstChild;while(W&&V>0){--V;W=W.nextSibling}if(W){return W}return t}function l(){return(N[h]==N[P]&&N[U]==N[z])}function G(X,Z,V,Y){var aa,W,t,ab,ad,ac;if(X==V){if(Z==Y){return 0}if(Z0){N.collapse(V)}}else{N.collapse(V)}N.collapsed=l();N.commonAncestorContainer=c.findCommonAncestor(N[h],N[P])}function m(ab){var aa,X=0,ad=0,V,Z,W,Y,t,ac;if(N[h]==N[P]){return f(ab)}for(aa=N[P],V=aa.parentNode;V;aa=V,V=V.parentNode){if(V==N[h]){return r(aa,ab)}++X}for(aa=N[h],V=aa.parentNode;V;aa=V,V=V.parentNode){if(V==N[P]){return T(aa,ab)}++ad}Z=ad-X;W=N[h];while(Z>0){W=W.parentNode;Z--}Y=N[P];while(Z<0){Y=Y.parentNode;Z++}for(t=W.parentNode,ac=Y.parentNode;t!=ac;t=t.parentNode,ac=ac.parentNode){W=t;Y=ac}return o(W,Y,ab)}function f(Z){var ab,Y,X,aa,t,W,V;if(Z!=j){ab=e.createDocumentFragment()}if(N[U]==N[z]){return ab}if(N[h].nodeType==3){Y=N[h].nodeValue;X=Y.substring(N[U],N[z]);if(Z!=E){N[h].deleteData(N[U],N[z]-N[U]);N.collapse(D)}if(Z==j){return}ab.appendChild(e.createTextNode(X));return ab}aa=O(N[h],N[U]);t=N[z]-N[U];while(t>0){W=aa.nextSibling;V=y(aa,Z);if(ab){ab.appendChild(V)}--t;aa=W}if(Z!=E){N.collapse(D)}return ab}function r(ab,Y){var aa,Z,V,t,X,W;if(Y!=j){aa=e.createDocumentFragment()}Z=i(ab,Y);if(aa){aa.appendChild(Z)}V=n(ab);t=V-N[U];if(t<=0){if(Y!=E){N.setEndBefore(ab);N.collapse(R)}return aa}Z=ab.previousSibling;while(t>0){X=Z.previousSibling;W=y(Z,Y);if(aa){aa.insertBefore(W,aa.firstChild)}--t;Z=X}if(Y!=E){N.setEndBefore(ab);N.collapse(R)}return aa}function T(Z,Y){var ab,V,aa,t,X,W;if(Y!=j){ab=e.createDocumentFragment()}aa=Q(Z,Y);if(ab){ab.appendChild(aa)}V=n(Z);++V;t=N[z]-V;aa=Z.nextSibling;while(t>0){X=aa.nextSibling;W=y(aa,Y);if(ab){ab.appendChild(W)}--t;aa=X}if(Y!=E){N.setStartAfter(Z);N.collapse(D)}return ab}function o(Z,t,ac){var W,ae,Y,aa,ab,V,ad,X;if(ac!=j){ae=e.createDocumentFragment()}W=Q(Z,ac);if(ae){ae.appendChild(W)}Y=Z.parentNode;aa=n(Z);ab=n(t);++aa;V=ab-aa;ad=Z.nextSibling;while(V>0){X=ad.nextSibling;W=y(ad,ac);if(ae){ae.appendChild(W)}ad=X;--V}W=i(t,ac);if(ae){ae.appendChild(W)}if(ac!=E){N.setStartAfter(Z);N.collapse(D)}return ae}function i(aa,ab){var W=O(N[P],N[z]-1),ac,Z,Y,t,V,X=W!=N[P];if(W==aa){return L(W,X,R,ab)}ac=W.parentNode;Z=L(ac,R,R,ab);while(ac){while(W){Y=W.previousSibling;t=L(W,X,R,ab);if(ab!=j){Z.insertBefore(t,Z.firstChild)}X=D;W=Y}if(ac==aa){return Z}W=ac.previousSibling;ac=ac.parentNode;V=L(ac,R,R,ab);if(ab!=j){V.appendChild(Z)}Z=V}}function Q(aa,ab){var X=O(N[h],N[U]),Y=X!=N[h],ac,Z,W,t,V;if(X==aa){return L(X,Y,D,ab)}ac=X.parentNode;Z=L(ac,R,D,ab);while(ac){while(X){W=X.nextSibling;t=L(X,Y,D,ab);if(ab!=j){Z.appendChild(t)}Y=D;X=W}if(ac==aa){return Z}X=ac.nextSibling;ac=ac.parentNode;V=L(ac,R,D,ab);if(ab!=j){V.appendChild(Z)}Z=V}}function L(t,Y,ab,ac){var X,W,Z,V,aa;if(Y){return y(t,ac)}if(t.nodeType==3){X=t.nodeValue;if(ab){V=N[U];W=X.substring(V);Z=X.substring(0,V)}else{V=N[z];W=X.substring(0,V);Z=X.substring(V)}if(ac!=E){t.nodeValue=Z}if(ac==j){return}aa=t.cloneNode(R);aa.nodeValue=W;return aa}if(ac==j){return}return t.cloneNode(R)}function y(V,t){if(t!=j){return t==E?V.cloneNode(D):V}V.parentNode.removeChild(V)}}a.Range=b})(tinymce.dom);(function(){function a(g){var i=this,j="\uFEFF",e,h,d=g.dom,c=true,f=false;function b(){var n=g.getRng(),k=d.createRng(),m,o;m=n.item?n.item(0):n.parentElement();if(m.ownerDocument!=d.doc){return k}if(n.item||!m.hasChildNodes()){k.setStart(m.parentNode,d.nodeIndex(m));k.setEnd(k.startContainer,k.startOffset+1);return k}o=g.isCollapsed();function l(s){var u,q,t,p,A=0,x,y,z,r,v;r=n.duplicate();r.collapse(s);u=d.create("a");z=r.parentElement();if(!z.hasChildNodes()){k[s?"setStart":"setEnd"](z,0);return}z.appendChild(u);r.moveToElementText(u);v=n.compareEndPoints(s?"StartToStart":"EndToEnd",r);if(v>0){k[s?"setStartAfter":"setEndAfter"](z);d.remove(u);return}p=tinymce.grep(z.childNodes);x=p.length-1;while(A<=x){y=Math.floor((A+x)/2);z.insertBefore(u,p[y]);r.moveToElementText(u);v=n.compareEndPoints(s?"StartToStart":"EndToEnd",r);if(v>0){A=y+1}else{if(v<0){x=y-1}else{found=true;break}}}q=v>0||y==0?u.nextSibling:u.previousSibling;if(q.nodeType==1){d.remove(u);t=d.nodeIndex(q);q=q.parentNode;if(!s||y>0){t++}}else{if(v>0||y==0){r.setEndPoint(s?"StartToStart":"EndToEnd",n);t=r.text.length}else{r.setEndPoint(s?"StartToStart":"EndToEnd",n);t=q.nodeValue.length-r.text.length}d.remove(u)}k[s?"setStart":"setEnd"](q,t)}l(true);if(!o){l()}return k}this.addRange=function(l){var t,A,z=g.dom.doc,r=z.body,u,n,y,o,s,k,p,q,x,m;this.destroy();y=l.startContainer;o=l.startOffset;s=l.endContainer;k=l.endOffset;t=r.createTextRange();if(y==z||s==z){t=r.createTextRange();t.collapse();t.select();return}if(y.nodeType==1&&y.hasChildNodes()){q=y.childNodes.length-1;if(o>q){x=1;y=y.childNodes[q]}else{y=y.childNodes[o]}if(y.nodeType==3){o=0}}if(s.nodeType==1&&s.hasChildNodes()){q=s.childNodes.length-1;if(k==0){m=1;s=s.childNodes[0]}else{s=s.childNodes[Math.min(q,k-1)];if(s.nodeType==3){k=s.nodeValue.length}}}if(y==s&&y.nodeType==1){if(/^(IMG|TABLE)$/.test(y.nodeName)&&o!=k){t=r.createControlRange();t.addElement(y)}else{t=r.createTextRange();if(!y.hasChildNodes()&&y.canHaveHTML){y.innerHTML=j}t.moveToElementText(y);if(y.innerHTML==j){t.collapse(c);y.removeChild(y.firstChild)}}if(o==k){t.collapse(k<=l.endContainer.childNodes.length-1)}t.select();t.scrollIntoView();return}t=r.createTextRange();p=z.createElement("span");p.innerHTML=" ";if(y.nodeType==3){if(x){d.insertAfter(p,y)}else{y.parentNode.insertBefore(p,y)}t.moveToElementText(p);p.parentNode.removeChild(p);if(o>0){t.move("character",o)}}else{t.moveToElementText(y);if(x){t.collapse(f)}}if(y==s&&y.nodeType==3){try{t.moveEnd("character",k-o);t.select();t.scrollIntoView()}catch(v){}return}A=r.createTextRange();if(s.nodeType==3){s.parentNode.insertBefore(p,s);A.moveToElementText(p);p.parentNode.removeChild(p);A.move("character",k);t.setEndPoint("EndToStart",A)}else{A.moveToElementText(s);A.collapse(!!m);t.setEndPoint("EndToEnd",A)}t.select();t.scrollIntoView()};this.getRangeAt=function(){if(!e||!tinymce.dom.RangeUtils.compareRanges(h,g.getRng())){e=b();h=g.getRng()}try{e.startContainer.nextSibling}catch(k){e=b();h=null}return e};this.destroy=function(){h=e=null};if(g.dom.boxModel){(function(){var q=d.doc,l=q.body,n,o;q.documentElement.unselectable=c;function p(r,u){var s=l.createTextRange();try{s.moveToPoint(r,u)}catch(t){s=null}return s}function m(s){var r;if(s.button){r=p(s.x,s.y);if(r){if(r.compareEndPoints("StartToStart",o)>0){r.setEndPoint("StartToStart",o)}else{r.setEndPoint("EndToEnd",o)}r.select()}}else{k()}}function k(){d.unbind(q,"mouseup",k);d.unbind(q,"mousemove",m);n=0}d.bind(q,"mousedown",function(r){if(r.target.nodeName==="HTML"){if(n){k()}n=1;o=p(r.x,r.y);if(o){d.bind(q,"mouseup",k);d.bind(q,"mousemove",m);o.select()}}})})()}}tinymce.dom.TridentSelection=a})();(function(d){var f=d.each,c=d.DOM,b=d.isIE,e=d.isWebKit,a;d.create("tinymce.dom.EventUtils",{EventUtils:function(){this.inits=[];this.events=[]},add:function(m,p,l,j){var g,h=this,i=h.events,k;if(p instanceof Array){k=[];f(p,function(o){k.push(h.add(m,o,l,j))});return k}if(m&&m.hasOwnProperty&&m instanceof Array){k=[];f(m,function(n){n=c.get(n);k.push(h.add(n,p,l,j))});return k}m=c.get(m);if(!m){return}g=function(n){if(h.disabled){return}n=n||window.event;if(n&&b){if(!n.target){n.target=n.srcElement}d.extend(n,h._stoppers)}if(!j){return l(n)}return l.call(j,n)};if(p=="unload"){d.unloads.unshift({func:g});return g}if(p=="init"){if(h.domLoaded){g()}else{h.inits.push(g)}return g}i.push({obj:m,name:p,func:l,cfunc:g,scope:j});h._add(m,p,g);return l},remove:function(l,m,k){var h=this,g=h.events,i=false,j;if(l&&l.hasOwnProperty&&l instanceof Array){j=[];f(l,function(n){n=c.get(n);j.push(h.remove(n,m,k))});return j}l=c.get(l);f(g,function(o,n){if(o.obj==l&&o.name==m&&(!k||(o.func==k||o.cfunc==k))){g.splice(n,1);h._remove(l,m,o.cfunc);i=true;return false}});return i},clear:function(l){var j=this,g=j.events,h,k;if(l){l=c.get(l);for(h=g.length-1;h>=0;h--){k=g[h];if(k.obj===l){j._remove(k.obj,k.name,k.cfunc);k.obj=k.cfunc=null;g.splice(h,1)}}}},cancel:function(g){if(!g){return false}this.stop(g);return this.prevent(g)},stop:function(g){if(g.stopPropagation){g.stopPropagation()}else{g.cancelBubble=true}return false},prevent:function(g){if(g.preventDefault){g.preventDefault()}else{g.returnValue=false}return false},destroy:function(){var g=this;f(g.events,function(j,h){g._remove(j.obj,j.name,j.cfunc);j.obj=j.cfunc=null});g.events=[];g=null},_add:function(h,i,g){if(h.attachEvent){h.attachEvent("on"+i,g)}else{if(h.addEventListener){h.addEventListener(i,g,false)}else{h["on"+i]=g}}},_remove:function(i,j,h){if(i){try{if(i.detachEvent){i.detachEvent("on"+j,h)}else{if(i.removeEventListener){i.removeEventListener(j,h,false)}else{i["on"+j]=null}}}catch(g){}}},_pageInit:function(h){var g=this;if(g.domLoaded){return}g.domLoaded=true;f(g.inits,function(i){i()});g.inits=[]},_wait:function(i){var g=this,h=i.document;if(i.tinyMCE_GZ&&tinyMCE_GZ.loaded){g.domLoaded=1;return}if(h.attachEvent){h.attachEvent("onreadystatechange",function(){if(h.readyState==="complete"){h.detachEvent("onreadystatechange",arguments.callee);g._pageInit(i)}});if(h.documentElement.doScroll&&i==i.top){(function(){if(g.domLoaded){return}try{h.documentElement.doScroll("left")}catch(j){setTimeout(arguments.callee,0);return}g._pageInit(i)})()}}else{if(h.addEventListener){g._add(i,"DOMContentLoaded",function(){g._pageInit(i)})}}g._add(i,"load",function(){g._pageInit(i)})},_stoppers:{preventDefault:function(){this.returnValue=false},stopPropagation:function(){this.cancelBubble=true}}});a=d.dom.Event=new d.dom.EventUtils();a._wait(window);d.addUnload(function(){a.destroy()})})(tinymce);(function(a){a.dom.Element=function(f,d){var b=this,e,c;b.settings=d=d||{};b.id=f;b.dom=e=d.dom||a.DOM;if(!a.isIE){c=e.get(b.id)}a.each(("getPos,getRect,getParent,add,setStyle,getStyle,setStyles,setAttrib,setAttribs,getAttrib,addClass,removeClass,hasClass,getOuterHTML,setOuterHTML,remove,show,hide,isHidden,setHTML,get").split(/,/),function(g){b[g]=function(){var h=[f],j;for(j=0;j_';if(j.startContainer==k&&j.endContainer==k){k.body.innerHTML=i}else{j.deleteContents();if(k.body.childNodes.length==0){k.body.innerHTML=i}else{j.insertNode(j.createContextualFragment(i))}}l=f.dom.get("__caret");j=k.createRange();j.setStartBefore(l);j.setEndBefore(l);f.setRng(j);f.dom.remove("__caret")}else{if(j.item){k.execCommand("Delete",false,null);j=f.getRng()}j.pasteHTML(i)}f.onSetContent.dispatch(f,g)},getStart:function(){var g=this.getRng(),h,f,j,i;if(g.duplicate||g.item){if(g.item){return g.item(0)}j=g.duplicate();j.collapse(1);h=j.parentElement();f=i=g.parentElement();while(i=i.parentNode){if(i==h){h=f;break}}if(h&&h.nodeName=="BODY"){return h.firstChild||h}return h}else{h=g.startContainer;if(h.nodeType==1&&h.hasChildNodes()){h=h.childNodes[Math.min(h.childNodes.length-1,g.startOffset)]}if(h&&h.nodeType==3){return h.parentNode}return h}},getEnd:function(){var g=this,h=g.getRng(),i,f;if(h.duplicate||h.item){if(h.item){return h.item(0)}h=h.duplicate();h.collapse(0);i=h.parentElement();if(i&&i.nodeName=="BODY"){return i.lastChild||i}return i}else{i=h.endContainer;f=h.endOffset;if(i.nodeType==1&&i.hasChildNodes()){i=i.childNodes[f>0?f-1:f]}if(i&&i.nodeType==3){return i.parentNode}return i}},getBookmark:function(q,r){var u=this,m=u.dom,g,j,i,n,h,o,p,l="\uFEFF",s;function f(v,x){var t=0;d(m.select(v),function(z,y){if(z==x){t=y}});return t}if(q==2){function k(){var v=u.getRng(true),t=m.getRoot(),x={};function y(B,G){var A=B[G?"startContainer":"endContainer"],F=B[G?"startOffset":"endOffset"],z=[],C,E,D=0;if(A.nodeType==3){if(r){for(C=A.previousSibling;C&&C.nodeType==3;C=C.previousSibling){F+=C.nodeValue.length}}z.push(F)}else{E=A.childNodes;if(F>=E.length&&E.length){D=1;F=Math.max(0,E.length-1)}z.push(u.dom.nodeIndex(E[F],r)+D)}for(;A&&A!=t;A=A.parentNode){z.push(u.dom.nodeIndex(A,r))}return z}x.start=y(v,true);if(!u.isCollapsed()){x.end=y(v)}return x}return k()}if(q){return{rng:u.getRng()}}g=u.getRng();i=m.uniqueId();n=tinyMCE.activeEditor.selection.isCollapsed();s="overflow:hidden;line-height:0px";if(g.duplicate||g.item){if(!g.item){j=g.duplicate();g.collapse();g.pasteHTML(''+l+"");if(!n){j.collapse(false);j.pasteHTML(''+l+"")}}else{o=g.item(0);h=o.nodeName;return{name:h,index:f(h,o)}}}else{o=u.getNode();h=o.nodeName;if(h=="IMG"){return{name:h,index:f(h,o)}}j=g.cloneRange();if(!n){j.collapse(false);j.insertNode(m.create("span",{_mce_type:"bookmark",id:i+"_end",style:s},l))}g.collapse(true);g.insertNode(m.create("span",{_mce_type:"bookmark",id:i+"_start",style:s},l))}u.moveToBookmark({id:i,keep:1});return{id:i}},moveToBookmark:function(n){var r=this,l=r.dom,i,h,f,q,j,s,o,p;if(r.tridentSel){r.tridentSel.destroy()}if(n){if(n.start){f=l.createRng();q=l.getRoot();function g(z){var t=n[z?"start":"end"],v,x,y,u;if(t){for(x=q,v=t.length-1;v>=1;v--){u=x.childNodes;if(u.length){x=u[t[v]]}}if(z){f.setStart(x,t[0])}else{f.setEnd(x,t[0])}}}g(true);g();r.setRng(f)}else{if(n.id){function k(A){var u=l.get(n.id+"_"+A),z,t,x,y,v=n.keep;if(u){z=u.parentNode;if(A=="start"){if(!v){t=l.nodeIndex(u)}else{z=u.firstChild;t=1}j=s=z;o=p=t}else{if(!v){t=l.nodeIndex(u)}else{z=u.firstChild;t=1}s=z;p=t}if(!v){y=u.previousSibling;x=u.nextSibling;d(c.grep(u.childNodes),function(B){if(B.nodeType==3){B.nodeValue=B.nodeValue.replace(/\uFEFF/g,"")}});while(u=l.get(n.id+"_"+A)){l.remove(u,1)}if(y&&x&&y.nodeType==x.nodeType&&y.nodeType==3){t=y.nodeValue.length;y.appendData(x.nodeValue);l.remove(x);if(A=="start"){j=s=y;o=p=t}else{s=y;p=t}}}}}function m(t){if(!a&&l.isBlock(t)&&!t.innerHTML){t.innerHTML='
    '}return t}k("start");k("end");f=l.createRng();f.setStart(m(j),o);f.setEnd(m(s),p);r.setRng(f)}else{if(n.name){r.select(l.select(n.name)[n.index])}else{if(n.rng){r.setRng(n.rng)}}}}}},select:function(k,j){var i=this,l=i.dom,g=l.createRng(),f;f=l.nodeIndex(k);g.setStart(k.parentNode,f);g.setEnd(k.parentNode,f+1);if(j){function h(m,o){var n=new c.dom.TreeWalker(m,m);do{if(m.nodeType==3&&c.trim(m.nodeValue).length!=0){if(o){g.setStart(m,0)}else{g.setEnd(m,m.nodeValue.length)}return}if(m.nodeName=="BR"){if(o){g.setStartBefore(m)}else{g.setEndBefore(m)}return}}while(m=(o?n.next():n.prev()))}h(k,1);h(k)}i.setRng(g);return k},isCollapsed:function(){var f=this,h=f.getRng(),g=f.getSel();if(!h||h.item){return false}if(h.compareEndPoints){return h.compareEndPoints("StartToEnd",h)===0}return !g||h.collapsed},collapse:function(f){var g=this,h=g.getRng(),i;if(h.item){i=h.item(0);h=this.win.document.body.createTextRange();h.moveToElementText(i)}h.collapse(!!f);g.setRng(h)},getSel:function(){var g=this,f=this.win;return f.getSelection?f.getSelection():f.document.selection},getRng:function(j){var g=this,h,i;if(j&&g.tridentSel){return g.tridentSel.getRangeAt(0)}try{if(h=g.getSel()){i=h.rangeCount>0?h.getRangeAt(0):(h.createRange?h.createRange():g.win.document.createRange())}}catch(f){}if(!i){i=g.win.document.createRange?g.win.document.createRange():g.win.document.body.createTextRange()}if(g.selectedRange&&g.explicitRange){if(i.compareBoundaryPoints(i.START_TO_START,g.selectedRange)===0&&i.compareBoundaryPoints(i.END_TO_END,g.selectedRange)===0){i=g.explicitRange}else{g.selectedRange=null;g.explicitRange=null}}return i},setRng:function(i){var h,g=this;if(!g.tridentSel){h=g.getSel();if(h){g.explicitRange=i;h.removeAllRanges();h.addRange(i);g.selectedRange=h.getRangeAt(0)}}else{if(i.cloneRange){g.tridentSel.addRange(i);return}try{i.select()}catch(f){}}},setNode:function(g){var f=this;f.setContent(f.dom.getOuterHTML(g));return g},getNode:function(){var g=this,f=g.getRng(),h=g.getSel(),i;if(f.setStart){if(!f){return g.dom.getRoot()}i=f.commonAncestorContainer;if(!f.collapsed){if(f.startContainer==f.endContainer){if(f.startOffset-f.endOffset<2){if(f.startContainer.hasChildNodes()){i=f.startContainer.childNodes[f.startOffset]}}}if(c.isWebKit&&h.anchorNode&&h.anchorNode.nodeType==1){return h.anchorNode.childNodes[h.anchorOffset]}}if(i&&i.nodeType==3){return i.parentNode}return i}return f.item?f.item(0):f.parentElement()},getSelectedBlocks:function(g,f){var i=this,j=i.dom,m,h,l,k=[];m=j.getParent(g||i.getStart(),j.isBlock);h=j.getParent(f||i.getEnd(),j.isBlock);if(m){k.push(m)}if(m&&h&&m!=h){l=m;while((l=l.nextSibling)&&l!=h){if(j.isBlock(l)){k.push(l)}}}if(h&&m!=h){k.push(h)}return k},destroy:function(g){var f=this;f.win=null;if(f.tridentSel){f.tridentSel.destroy()}if(!g){c.removeUnload(f.destroy)}}})})(tinymce);(function(a){a.create("tinymce.dom.XMLWriter",{node:null,XMLWriter:function(c){function b(){var e=document.implementation;if(!e||!e.createDocument){try{return new ActiveXObject("MSXML2.DOMDocument")}catch(d){}try{return new ActiveXObject("Microsoft.XmlDom")}catch(d){}}else{return e.createDocument("","",null)}}this.doc=b();this.valid=a.isOpera||a.isWebKit;this.reset()},reset:function(){var b=this,c=b.doc;if(c.firstChild){c.removeChild(c.firstChild)}b.node=c.appendChild(c.createElement("html"))},writeStartElement:function(c){var b=this;b.node=b.node.appendChild(b.doc.createElement(c))},writeAttribute:function(c,b){if(this.valid){b=b.replace(/>/g,"%MCGT%")}this.node.setAttribute(c,b)},writeEndElement:function(){this.node=this.node.parentNode},writeFullEndElement:function(){var b=this,c=b.node;c.appendChild(b.doc.createTextNode(""));b.node=c.parentNode},writeText:function(b){if(this.valid){b=b.replace(/>/g,"%MCGT%")}this.node.appendChild(this.doc.createTextNode(b))},writeCDATA:function(b){this.node.appendChild(this.doc.createCDATASection(b))},writeComment:function(b){if(a.isIE){b=b.replace(/^\-|\-$/g," ")}this.node.appendChild(this.doc.createComment(b.replace(/\-\-/g," ")))},getContent:function(){var b;b=this.doc.xml||new XMLSerializer().serializeToString(this.doc);b=b.replace(/<\?[^?]+\?>||<\/html>||]+>/g,"");b=b.replace(/ ?\/>/g," />");if(this.valid){b=b.replace(/\%MCGT%/g,">")}return b}})})(tinymce);(function(a){a.create("tinymce.dom.StringWriter",{str:null,tags:null,count:0,settings:null,indent:null,StringWriter:function(b){this.settings=a.extend({indent_char:" ",indentation:0},b);this.reset()},reset:function(){this.indent="";this.str="";this.tags=[];this.count=0},writeStartElement:function(b){this._writeAttributesEnd();this.writeRaw("<"+b);this.tags.push(b);this.inAttr=true;this.count++;this.elementCount=this.count},writeAttribute:function(d,b){var c=this;c.writeRaw(" "+c.encode(d)+'="'+c.encode(b)+'"')},writeEndElement:function(){var b;if(this.tags.length>0){b=this.tags.pop();if(this._writeAttributesEnd(1)){this.writeRaw("")}if(this.settings.indentation>0){this.writeRaw("\n")}}},writeFullEndElement:function(){if(this.tags.length>0){this._writeAttributesEnd();this.writeRaw("");if(this.settings.indentation>0){this.writeRaw("\n")}}},writeText:function(b){this._writeAttributesEnd();this.writeRaw(this.encode(b));this.count++},writeCDATA:function(b){this._writeAttributesEnd();this.writeRaw("");this.count++},writeComment:function(b){this._writeAttributesEnd();this.writeRaw("");this.count++},writeRaw:function(b){this.str+=b},encode:function(b){return b.replace(/[<>&"]/g,function(c){switch(c){case"<":return"<";case">":return">";case"&":return"&";case'"':return"""}return c})},getContent:function(){return this.str},_writeAttributesEnd:function(b){if(!this.inAttr){return}this.inAttr=false;if(b&&this.elementCount==this.count){this.writeRaw(" />");return false}this.writeRaw(">");return true}})})(tinymce);(function(e){var g=e.extend,f=e.each,b=e.util.Dispatcher,d=e.isIE,a=e.isGecko;function c(h){return h.replace(/([?+*])/g,".$1")}e.create("tinymce.dom.Serializer",{Serializer:function(j){var i=this;i.key=0;i.onPreProcess=new b(i);i.onPostProcess=new b(i);try{i.writer=new e.dom.XMLWriter()}catch(h){i.writer=new e.dom.StringWriter()}i.settings=j=g({dom:e.DOM,valid_nodes:0,node_filter:0,attr_filter:0,invalid_attrs:/^(_mce_|_moz_|sizset|sizcache)/,closed:/^(br|hr|input|meta|img|link|param|area)$/,entity_encoding:"named",entities:"160,nbsp,161,iexcl,162,cent,163,pound,164,curren,165,yen,166,brvbar,167,sect,168,uml,169,copy,170,ordf,171,laquo,172,not,173,shy,174,reg,175,macr,176,deg,177,plusmn,178,sup2,179,sup3,180,acute,181,micro,182,para,183,middot,184,cedil,185,sup1,186,ordm,187,raquo,188,frac14,189,frac12,190,frac34,191,iquest,192,Agrave,193,Aacute,194,Acirc,195,Atilde,196,Auml,197,Aring,198,AElig,199,Ccedil,200,Egrave,201,Eacute,202,Ecirc,203,Euml,204,Igrave,205,Iacute,206,Icirc,207,Iuml,208,ETH,209,Ntilde,210,Ograve,211,Oacute,212,Ocirc,213,Otilde,214,Ouml,215,times,216,Oslash,217,Ugrave,218,Uacute,219,Ucirc,220,Uuml,221,Yacute,222,THORN,223,szlig,224,agrave,225,aacute,226,acirc,227,atilde,228,auml,229,aring,230,aelig,231,ccedil,232,egrave,233,eacute,234,ecirc,235,euml,236,igrave,237,iacute,238,icirc,239,iuml,240,eth,241,ntilde,242,ograve,243,oacute,244,ocirc,245,otilde,246,ouml,247,divide,248,oslash,249,ugrave,250,uacute,251,ucirc,252,uuml,253,yacute,254,thorn,255,yuml,402,fnof,913,Alpha,914,Beta,915,Gamma,916,Delta,917,Epsilon,918,Zeta,919,Eta,920,Theta,921,Iota,922,Kappa,923,Lambda,924,Mu,925,Nu,926,Xi,927,Omicron,928,Pi,929,Rho,931,Sigma,932,Tau,933,Upsilon,934,Phi,935,Chi,936,Psi,937,Omega,945,alpha,946,beta,947,gamma,948,delta,949,epsilon,950,zeta,951,eta,952,theta,953,iota,954,kappa,955,lambda,956,mu,957,nu,958,xi,959,omicron,960,pi,961,rho,962,sigmaf,963,sigma,964,tau,965,upsilon,966,phi,967,chi,968,psi,969,omega,977,thetasym,978,upsih,982,piv,8226,bull,8230,hellip,8242,prime,8243,Prime,8254,oline,8260,frasl,8472,weierp,8465,image,8476,real,8482,trade,8501,alefsym,8592,larr,8593,uarr,8594,rarr,8595,darr,8596,harr,8629,crarr,8656,lArr,8657,uArr,8658,rArr,8659,dArr,8660,hArr,8704,forall,8706,part,8707,exist,8709,empty,8711,nabla,8712,isin,8713,notin,8715,ni,8719,prod,8721,sum,8722,minus,8727,lowast,8730,radic,8733,prop,8734,infin,8736,ang,8743,and,8744,or,8745,cap,8746,cup,8747,int,8756,there4,8764,sim,8773,cong,8776,asymp,8800,ne,8801,equiv,8804,le,8805,ge,8834,sub,8835,sup,8836,nsub,8838,sube,8839,supe,8853,oplus,8855,otimes,8869,perp,8901,sdot,8968,lceil,8969,rceil,8970,lfloor,8971,rfloor,9001,lang,9002,rang,9674,loz,9824,spades,9827,clubs,9829,hearts,9830,diams,338,OElig,339,oelig,352,Scaron,353,scaron,376,Yuml,710,circ,732,tilde,8194,ensp,8195,emsp,8201,thinsp,8204,zwnj,8205,zwj,8206,lrm,8207,rlm,8211,ndash,8212,mdash,8216,lsquo,8217,rsquo,8218,sbquo,8220,ldquo,8221,rdquo,8222,bdquo,8224,dagger,8225,Dagger,8240,permil,8249,lsaquo,8250,rsaquo,8364,euro",valid_elements:"*[*]",extended_valid_elements:0,invalid_elements:0,fix_table_elements:1,fix_list_elements:true,fix_content_duplication:true,convert_fonts_to_spans:false,font_size_classes:0,apply_source_formatting:0,indent_mode:"simple",indent_char:"\t",indent_levels:1,remove_linebreaks:1,remove_redundant_brs:1,element_format:"xhtml"},j);i.dom=j.dom;i.schema=j.schema;if(j.entity_encoding=="named"&&!j.entities){j.entity_encoding="raw"}if(j.remove_redundant_brs){i.onPostProcess.add(function(k,l){l.content=l.content.replace(/(
    \s*)+<\/(p|h[1-6]|div|li)>/gi,function(n,m,o){if(/^
    \s*<\//.test(n)){return""}return n})})}if(j.element_format=="html"){i.onPostProcess.add(function(k,l){l.content=l.content.replace(/<([^>]+) \/>/g,"<$1>")})}if(j.fix_list_elements){i.onPreProcess.add(function(v,s){var l,z,y=["ol","ul"],u,t,q,k=/^(OL|UL)$/,A;function m(r,x){var o=x.split(","),p;while((r=r.previousSibling)!=null){for(p=0;p=1767){f(i.dom.select("p table",l.node).reverse(),function(p){var o=i.dom.getParent(p.parentNode,"table,p");if(o.nodeName!="TABLE"){try{i.dom.split(o,p)}catch(m){}}})}})}},setEntities:function(o){var n=this,j,m,h={},k;if(n.entityLookup){return}j=o.split(",");for(m=0;m1){f(q[1].split("|"),function(u){var p={},t;k=k||[];u=u.replace(/::/g,"~");u=/^([!\-])?([\w*.?~_\-]+|)([=:<])?(.+)?$/.exec(u);u[2]=u[2].replace(/~/g,":");if(u[1]=="!"){r=r||[];r.push(u[2])}if(u[1]=="-"){for(t=0;t=1767)){p=j.createHTMLDocument("");f(r.nodeName=="BODY"?r.childNodes:[r],function(h){p.body.appendChild(p.importNode(h,true))});if(r.nodeName!="BODY"){r=p.body.firstChild}else{r=p.body}i=k.dom.doc;k.dom.doc=p}k.key=""+(parseInt(k.key)+1);if(!q.no_events){q.node=r;k.onPreProcess.dispatch(k,q)}k.writer.reset();k._info=q;k._serializeNode(r,q.getInner);q.content=k.writer.getContent();if(i){k.dom.doc=i}if(!q.no_events){k.onPostProcess.dispatch(k,q)}k._postProcess(q);q.node=null;return e.trim(q.content)},_postProcess:function(n){var i=this,k=i.settings,j=n.content,m=[],l;if(n.format=="html"){l=i._protect({content:j,patterns:[{pattern:/(]*>)(.*?)(<\/script>)/g},{pattern:/(]*>)(.*?)(<\/noscript>)/g},{pattern:/(]*>)(.*?)(<\/style>)/g},{pattern:/(]*>)(.*?)(<\/pre>)/g,encode:1},{pattern:/()/g}]});j=l.content;if(k.entity_encoding!=="raw"){j=i._encode(j)}if(!n.set){j=j.replace(/

    \s+<\/p>|]+)>\s+<\/p>/g,k.entity_encoding=="numeric"?" 

    ":" 

    ");if(k.remove_linebreaks){j=j.replace(/\r?\n|\r/g," ");j=j.replace(/(<[^>]+>)\s+/g,"$1 ");j=j.replace(/\s+(<\/[^>]+>)/g," $1");j=j.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object) ([^>]+)>\s+/g,"<$1 $2>");j=j.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>\s+/g,"<$1>");j=j.replace(/\s+<\/(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>/g,"")}if(k.apply_source_formatting&&k.indent_mode=="simple"){j=j.replace(/<(\/?)(ul|hr|table|meta|link|tbody|tr|object|body|head|html|map)(|[^>]+)>\s*/g,"\n<$1$2$3>\n");j=j.replace(/\s*<(p|h[1-6]|blockquote|div|title|style|pre|script|td|li|area)(|[^>]+)>/g,"\n<$1$2>");j=j.replace(/<\/(p|h[1-6]|blockquote|div|title|style|pre|script|td|li)>\s*/g,"\n");j=j.replace(/\n\n/g,"\n")}}j=i._unprotect(j,l);j=j.replace(//g,"");if(k.entity_encoding=="raw"){j=j.replace(/

     <\/p>|]+)> <\/p>/g,"\u00a0

    ")}j=j.replace(/]+|)>([\s\S]*?)<\/noscript>/g,function(h,p,o){return""+i.dom.decode(o.replace(//g,""))+""})}n.content=j},_serializeNode:function(D,I){var z=this,A=z.settings,x=z.writer,q,j,u,F,E,H,B,h,y,k,r,C,p,m,G,o;if(!A.node_filter||A.node_filter(D)){switch(D.nodeType){case 1:if(D.hasAttribute?D.hasAttribute("_mce_bogus"):D.getAttribute("_mce_bogus")){return}p=G=false;q=D.hasChildNodes();k=D.getAttribute("_mce_name")||D.nodeName.toLowerCase();o=D.getAttribute("_mce_type");if(o){if(!z._info.cleanup){p=true;return}else{G=1}}if(d){if(D.scopeName!=="HTML"&&D.scopeName!=="html"){k=D.scopeName+":"+k}}if(k.indexOf("mce:")===0){k=k.substring(4)}if(!G){if(!z.validElementsRE||!z.validElementsRE.test(k)||(z.invalidElementsRE&&z.invalidElementsRE.test(k))||I){p=true;break}}if(d){if(A.fix_content_duplication){if(D._mce_serialized==z.key){return}D._mce_serialized=z.key}if(k.charAt(0)=="/"){k=k.substring(1)}}else{if(a){if(D.nodeName==="BR"&&D.getAttribute("type")=="_moz"){return}}}if(A.validate_children){if(z.elementName&&!z.schema.isValid(z.elementName,k)){p=true;break}z.elementName=k}r=z.findRule(k);if(!r){p=true;break}k=r.name||k;m=A.closed.test(k);if((!q&&r.noEmpty)||(d&&!k)){p=true;break}if(r.requiredAttribs){H=r.requiredAttribs;for(F=H.length-1;F>=0;F--){if(this.dom.getAttrib(D,H[F])!==""){break}}if(F==-1){p=true;break}}x.writeStartElement(k);if(r.attribs){for(F=0,B=r.attribs,E=B.length;F-1;F--){h=B[F];if(h.specified){H=h.nodeName.toLowerCase();if(A.invalid_attrs.test(H)||!r.validAttribsRE.test(H)){continue}C=z.findAttribRule(r,H);y=z._getAttrib(D,C,H);if(y!==null){x.writeAttribute(H,y)}}}}if(o&&G){x.writeAttribute("_mce_type",o)}if(k==="script"&&e.trim(D.innerHTML)){x.writeText("// ");x.writeCDATA(D.innerHTML.replace(/|<\[CDATA\[|\]\]>/g,""));q=false;break}if(r.padd){if(q&&(u=D.firstChild)&&u.nodeType===1&&D.childNodes.length===1){if(u.hasAttribute?u.hasAttribute("_mce_bogus"):u.getAttribute("_mce_bogus")){x.writeText("\u00a0")}}else{if(!q){x.writeText("\u00a0")}}}break;case 3:if(A.validate_children&&z.elementName&&!z.schema.isValid(z.elementName,"#text")){return}return x.writeText(D.nodeValue);case 4:return x.writeCDATA(D.nodeValue);case 8:return x.writeComment(D.nodeValue)}}else{if(D.nodeType==1){q=D.hasChildNodes()}}if(q&&!m){u=D.firstChild;while(u){z._serializeNode(u);z.elementName=k;u=u.nextSibling}}if(!p){if(!m){x.writeFullEndElement()}else{x.writeEndElement()}}},_protect:function(j){var i=this;j.items=j.items||[];function h(l){return l.replace(/[\r\n\\]/g,function(m){if(m==="\n"){return"\\n"}else{if(m==="\\"){return"\\\\"}}return"\\r"})}function k(l){return l.replace(/\\[\\rn]/g,function(m){if(m==="\\n"){return"\n"}else{if(m==="\\\\"){return"\\"}}return"\r"})}f(j.patterns,function(l){j.content=k(h(j.content).replace(l.pattern,function(n,o,m,p){m=k(m);if(l.encode){m=i._encode(m)}j.items.push(m);return o+""+p}))});return j},_unprotect:function(i,j){i=i.replace(/\"))}if(a&&j.ListBox){if(a.Button||a.SplitButton){e+=b.createHTML("td",{"class":"mceToolbarEnd"},b.createHTML("span",null,""))}}if(b.stdMode){e+='
    "}else{e+=""}if(f&&j.ListBox){if(f.Button||f.SplitButton){e+=b.createHTML("td",{"class":"mceToolbarStart"},b.createHTML("span",null,""))}}}g="mceToolbarEnd";if(j.Button){g+=" mceToolbarEndButton"}else{if(j.SplitButton){g+=" mceToolbarEndSplitButton"}else{if(j.ListBox){g+=" mceToolbarEndListBox"}}}e+=b.createHTML("td",{"class":g},b.createHTML("span",null,""));return b.createHTML("table",{id:l.id,"class":"mceToolbar"+(m["class"]?" "+m["class"]:""),cellpadding:"0",cellspacing:"0",align:l.settings.align||""},""+e+"")}});(function(b){var a=b.util.Dispatcher,c=b.each;b.create("tinymce.AddOnManager",{items:[],urls:{},lookup:{},onAdd:new a(this),get:function(d){return this.lookup[d]},requireLangPack:function(e){var d=b.settings;if(d&&d.language){b.ScriptLoader.add(this.urls[e]+"/langs/"+d.language+".js")}},add:function(e,d){this.items.push(d);this.lookup[e]=d;this.onAdd.dispatch(this,e,d);return d},load:function(h,e,d,g){var f=this;if(f.urls[h]){return}if(e.indexOf("/")!=0&&e.indexOf("://")==-1){e=b.baseURL+"/"+e}f.urls[h]=e.substring(0,e.lastIndexOf("/"));b.ScriptLoader.add(e,d,g)}});b.PluginManager=new b.AddOnManager();b.ThemeManager=new b.AddOnManager()}(tinymce));(function(j){var g=j.each,d=j.extend,k=j.DOM,i=j.dom.Event,f=j.ThemeManager,b=j.PluginManager,e=j.explode,h=j.util.Dispatcher,a,c=0;j.documentBaseURL=window.location.href.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,"");if(!/[\/\\]$/.test(j.documentBaseURL)){j.documentBaseURL+="/"}j.baseURL=new j.util.URI(j.documentBaseURL).toAbsolute(j.baseURL);j.baseURI=new j.util.URI(j.baseURL);j.onBeforeUnload=new h(j);i.add(window,"beforeunload",function(l){j.onBeforeUnload.dispatch(j,l)});j.onAddEditor=new h(j);j.onRemoveEditor=new h(j);j.EditorManager=d(j,{editors:[],i18n:{},activeEditor:null,init:function(q){var n=this,p,l=j.ScriptLoader,u,o=[],m;function r(x,y,t){var v=x[y];if(!v){return}if(j.is(v,"string")){t=v.replace(/\.\w+$/,"");t=t?j.resolve(t):0;v=j.resolve(v)}return v.apply(t||this,Array.prototype.slice.call(arguments,2))}q=d({theme:"simple",language:"en"},q);n.settings=q;i.add(document,"init",function(){var s,v;r(q,"onpageload");switch(q.mode){case"exact":s=q.elements||"";if(s.length>0){g(e(s),function(x){if(k.get(x)){m=new j.Editor(x,q);o.push(m);m.render(1)}else{g(document.forms,function(y){g(y.elements,function(z){if(z.name===x){x="mce_editor_"+c++;k.setAttrib(z,"id",x);m=new j.Editor(x,q);o.push(m);m.render(1)}})})}})}break;case"textareas":case"specific_textareas":function t(y,x){return x.constructor===RegExp?x.test(y.className):k.hasClass(y,x)}g(k.select("textarea"),function(x){if(q.editor_deselector&&t(x,q.editor_deselector)){return}if(!q.editor_selector||t(x,q.editor_selector)){u=k.get(x.name);if(!x.id&&!u){x.id=x.name}if(!x.id||n.get(x.id)){x.id=k.uniqueId()}m=new j.Editor(x.id,q);o.push(m);m.render(1)}});break}if(q.oninit){s=v=0;g(o,function(x){v++;if(!x.initialized){x.onInit.add(function(){s++;if(s==v){r(q,"oninit")}})}else{s++}if(s==v){r(q,"oninit")}})}})},get:function(l){if(l===a){return this.editors}return this.editors[l]},getInstanceById:function(l){return this.get(l)},add:function(m){var l=this,n=l.editors;n[m.id]=m;n.push(m);l._setActive(m);l.onAddEditor.dispatch(l,m);if(j.adapter){j.adapter.patchEditor(m)}return m},remove:function(n){var m=this,l,o=m.editors;if(!o[n.id]){return null}delete o[n.id];for(l=0;l':"",visual_table_class:"mceItemTable",visual:1,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",apply_source_formatting:1,directionality:"ltr",forced_root_block:"p",valid_elements:"@[id|class|style|title|dir';if(F.document_base_url!=m.documentBaseURL){E.iframeHTML+=''}E.iframeHTML+='';if(m.relaxedDomain){E.iframeHTML+=''; + // Load the CSS by injecting them into the HTML this will reduce "flicker" + for (i = 0; i < t.contentCSS.length; i++) { + t.iframeHTML += ''; + } bi = s.body_id || 'tinymce'; if (bi.indexOf('=') != -1) { @@ -8743,33 +10760,35 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { bc = bc[t.id] || ''; } - t.iframeHTML += ''; + t.iframeHTML += '
    '; // Domain relaxing enabled, then set document domain - if (tinymce.relaxedDomain) { + if (tinymce.relaxedDomain && (isIE || (tinymce.isOpera && parseFloat(opera.version()) < 11))) { // We need to write the contents here in IE since multiple writes messes up refresh button and back button - if (isIE || (tinymce.isOpera && parseFloat(opera.version()) >= 9.5)) - u = 'javascript:(function(){document.open();document.domain="' + document.domain + '";var ed = window.parent.tinyMCE.get("' + t.id + '");document.write(ed.iframeHTML);document.close();ed.setupIframe();})()'; - else if (tinymce.isOpera) - u = 'javascript:(function(){document.open();document.domain="' + document.domain + '";document.close();ed.setupIframe();})()'; + u = 'javascript:(function(){document.open();document.domain="' + document.domain + '";var ed = window.parent.tinyMCE.get("' + t.id + '");document.write(ed.iframeHTML);document.close();ed.setupIframe();})()'; } // Create iframe - n = DOM.add(o.iframeContainer, 'iframe', { + // TODO: ACC add the appropriate description on this. + n = DOM.add(o.iframeContainer, 'iframe', { id : t.id + "_ifr", src : u || 'javascript:""', // Workaround for HTTPS warning in IE6/7 frameBorder : '0', + allowTransparency : "true", + title : s.aria_label, style : { width : '100%', - height : h + height : h, + display : 'block' // Important for Gecko to render the iframe correctly } }); t.contentAreaContainer = o.iframeContainer; DOM.get(o.editorContainer).style.display = t.orgDisplay; DOM.get(t.id).style.display = 'none'; + DOM.setAttrib(t.id, 'aria-hidden', true); - if (!isIE || !tinymce.relaxedDomain) + if (!tinymce.relaxedDomain || !u) t.setupIframe(); e = n = o = null; // Cleanup @@ -8783,30 +10802,21 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { d.open(); d.write(t.iframeHTML); d.close(); - } - // Design mode needs to be added here Ctrl+A will fail otherwise - if (!isIE) { - try { - if (!s.readonly) - d.designMode = 'On'; - } catch (ex) { - // Will fail on Gecko if the editor is placed in an hidden container element - // The design mode will be set ones the editor is focused - } + if (tinymce.relaxedDomain) + d.domain = tinymce.relaxedDomain; } - // IE needs to use contentEditable or it will display non secure items for HTTPS - if (isIE) { - // It will not steal focus if we hide it while setting contentEditable - b = t.getBody(); - DOM.hide(b); + // It will not steal focus while setting contentEditable + b = t.getBody(); + b.disabled = true; - if (!s.readonly) - b.contentEditable = true; + if (!s.readonly) + b.contentEditable = true; - DOM.show(b); - } + b.disabled = false; + + t.schema = new tinymce.html.Schema(s); t.dom = new tinymce.dom.DOMUtils(t.getDoc(), { keep_values : true, @@ -8816,16 +10826,85 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { class_filter : s.class_filter, update_styles : 1, fix_ie_paragraphs : 1, - valid_styles : s.valid_styles + schema : t.schema }); - t.schema = new tinymce.dom.Schema(); + t.parser = new tinymce.html.DomParser(s, t.schema); - t.serializer = new tinymce.dom.Serializer(extend(s, { - valid_elements : s.verify_html === false ? '*[*]' : s.valid_elements, - dom : t.dom, - schema : t.schema - })); + // Force anchor names closed, unless the setting "allow_html_in_named_anchor" is explicitly included. + if (!t.settings.allow_html_in_named_anchor) { + t.parser.addAttributeFilter('name', function(nodes, name) { + var i = nodes.length, sibling, prevSibling, parent, node; + + while (i--) { + node = nodes[i]; + if (node.name === 'a' && node.firstChild) { + parent = node.parent; + + // Move children after current node + sibling = node.lastChild; + do { + prevSibling = sibling.prev; + parent.insert(sibling, node); + sibling = prevSibling; + } while (sibling); + } + } + }); + } + + // Convert src and href into data-mce-src, data-mce-href and data-mce-style + t.parser.addAttributeFilter('src,href,style', function(nodes, name) { + var i = nodes.length, node, dom = t.dom, value, internalName; + + while (i--) { + node = nodes[i]; + value = node.attr(name); + internalName = 'data-mce-' + name; + + // Add internal attribute if we need to we don't on a refresh of the document + if (!node.attributes.map[internalName]) { + if (name === "style") + node.attr(internalName, dom.serializeStyle(dom.parseStyle(value), node.name)); + else + node.attr(internalName, t.convertURL(value, name, node.name)); + } + } + }); + + // Keep scripts from executing + t.parser.addNodeFilter('script', function(nodes, name) { + var i = nodes.length, node; + + while (i--) { + node = nodes[i]; + node.attr('type', 'mce-' + (node.attr('type') || 'text/javascript')); + } + }); + + t.parser.addNodeFilter('#cdata', function(nodes, name) { + var i = nodes.length, node; + + while (i--) { + node = nodes[i]; + node.type = 8; + node.name = '#comment'; + node.value = '[CDATA[' + node.value + ']]'; + } + }); + + t.parser.addNodeFilter('p,h1,h2,h3,h4,h5,h6,div', function(nodes, name) { + var i = nodes.length, node, nonEmptyElements = t.schema.getNonEmptyElements(); + + while (i--) { + node = nodes[i]; + + if (node.isEmpty(nonEmptyElements)) + node.empty().append(new tinymce.html.Node('br', 1)).shortEnded = true; + } + }); + + t.serializer = new tinymce.dom.Serializer(s, t.dom, t.schema); t.selection = new tinymce.dom.Selection(t.dom, t.getWin(), t.serializer); @@ -8835,18 +10914,18 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { t.formatter.register({ alignleft : [ {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'left'}}, - {selector : 'img,table', styles : {'float' : 'left'}} + {selector : 'img,table', collapsed : false, styles : {'float' : 'left'}} ], aligncenter : [ {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'center'}}, - {selector : 'img', styles : {display : 'block', marginLeft : 'auto', marginRight : 'auto'}}, - {selector : 'table', styles : {marginLeft : 'auto', marginRight : 'auto'}} + {selector : 'img', collapsed : false, styles : {display : 'block', marginLeft : 'auto', marginRight : 'auto'}}, + {selector : 'table', collapsed : false, styles : {marginLeft : 'auto', marginRight : 'auto'}} ], alignright : [ {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'right'}}, - {selector : 'img,table', styles : {'float' : 'right'}} + {selector : 'img,table', collapsed : false, styles : {'float' : 'right'}} ], alignfull : [ @@ -8854,33 +10933,47 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { ], bold : [ - {inline : 'strong'}, + {inline : 'strong', remove : 'all'}, {inline : 'span', styles : {fontWeight : 'bold'}}, - {inline : 'b'} + {inline : 'b', remove : 'all'} ], italic : [ - {inline : 'em'}, + {inline : 'em', remove : 'all'}, {inline : 'span', styles : {fontStyle : 'italic'}}, - {inline : 'i'} + {inline : 'i', remove : 'all'} ], underline : [ {inline : 'span', styles : {textDecoration : 'underline'}, exact : true}, - {inline : 'u'} + {inline : 'u', remove : 'all'} ], strikethrough : [ {inline : 'span', styles : {textDecoration : 'line-through'}, exact : true}, - {inline : 'u'} + {inline : 'strike', remove : 'all'} ], - forecolor : {inline : 'span', styles : {color : '%value'}}, - hilitecolor : {inline : 'span', styles : {backgroundColor : '%value'}}, + forecolor : {inline : 'span', styles : {color : '%value'}, wrap_links : false}, + hilitecolor : {inline : 'span', styles : {backgroundColor : '%value'}, wrap_links : false}, fontname : {inline : 'span', styles : {fontFamily : '%value'}}, fontsize : {inline : 'span', styles : {fontSize : '%value'}}, fontsize_class : {inline : 'span', attributes : {'class' : '%value'}}, blockquote : {block : 'blockquote', wrapper : 1, remove : 'all'}, + subscript : {inline : 'sub'}, + superscript : {inline : 'sup'}, + + link : {inline : 'a', selector : 'a', remove : 'all', split : true, deep : true, + onmatch : function(node) { + return true; + }, + + onformat : function(elm, fmt, vars) { + each(vars, function(value, key) { + t.dom.setAttrib(elm, key, value); + }); + } + }, removeformat : [ {selector : 'b,strong,em,i,font,u,strike', remove : 'all', split : true, expand : false, block_expand : true, deep : true}, @@ -8901,7 +10994,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { // Pass through t.undoManager.onAdd.add(function(um, l) { - if (!l.initial) + if (um.hasUndo()) return t.onChange.dispatch(t, l, um); }); @@ -8939,35 +11032,14 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { t.controlManager.onPostRender.dispatch(t, t.controlManager); t.onPostRender.dispatch(t); + t.quirks = new tinymce.util.Quirks(this); + if (s.directionality) t.getBody().dir = s.directionality; if (s.nowrap) t.getBody().style.whiteSpace = "nowrap"; - if (s.custom_elements) { - function handleCustom(ed, o) { - each(explode(s.custom_elements), function(v) { - var n; - - if (v.indexOf('~') === 0) { - v = v.substring(1); - n = 'span'; - } else - n = 'div'; - - o.content = o.content.replace(new RegExp('<(' + v + ')([^>]*)>', 'g'), '<' + n + ' _mce_name="$1"$2>'); - o.content = o.content.replace(new RegExp('', 'g'), ''); - }); - }; - - t.onBeforeSetContent.add(handleCustom); - t.onPostProcess.add(function(ed, o) { - if (o.set) - handleCustom(ed, o); - }); - } - if (s.handle_node_change_callback) { t.onNodeChange.add(function(ed, cm, n) { t.execCallback('handle_node_change_callback', t.id, n, -1, -1, true, t.selection.isCollapsed()); @@ -8989,16 +11061,22 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { }); } - if (s.convert_newlines_to_brs) { + if (s.protect) { t.onBeforeSetContent.add(function(ed, o) { - if (o.initial) - o.content = o.content.replace(/\r?\n/g, '
    '); + if (s.protect) { + each(s.protect, function(pattern) { + o.content = o.content.replace(pattern, function(str) { + return ''; + }); + }); + } }); } - if (s.fix_nesting && isIE) { + if (s.convert_newlines_to_brs) { t.onBeforeSetContent.add(function(ed, o) { - o.content = t._fixNesting(o.content); + if (o.initial) + o.content = o.content.replace(/\r?\n/g, '
    '); }); } @@ -9095,7 +11173,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { var pn = n.parentNode; if (ed.dom.isBlock(pn) && pn.lastChild === n) - ed.dom.add(pn, 'br', {'_mce_bogus' : 1}); + ed.dom.add(pn, 'br', {'data-mce-bogus' : 1}); }); }; @@ -9105,72 +11183,62 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { }); t.onSetContent.add(t.selection.onSetContent.add(fixLinks)); - - if (!s.readonly) { - try { - // Design mode must be set here once again to fix a bug where - // Ctrl+A/Delete/Backspace didn't work if the editor was added using mceAddControl then removed then added again - d.designMode = 'Off'; - d.designMode = 'On'; - } catch (ex) { - // Will fail on Gecko if the editor is placed in an hidden container element - // The design mode will be set ones the editor is focused - } - } } - // A small timeout was needed since firefox will remove. Bug: #1838304 - setTimeout(function () { - if (t.removed) - return; + t.load({initial : true, format : 'html'}); + t.startContent = t.getContent({format : 'raw'}); + t.undoManager.add(); + t.initialized = true; - t.load({initial : true, format : (s.cleanup_on_startup ? 'html' : 'raw')}); - t.startContent = t.getContent({format : 'raw'}); - t.initialized = true; + t.onInit.dispatch(t); + t.execCallback('setupcontent_callback', t.id, t.getBody(), t.getDoc()); + t.execCallback('init_instance_callback', t); + t.focus(true); + t.nodeChanged({initial : 1}); - t.onInit.dispatch(t); - t.execCallback('setupcontent_callback', t.id, t.getBody(), t.getDoc()); - t.execCallback('init_instance_callback', t); - t.focus(true); - t.nodeChanged({initial : 1}); + // Load specified content CSS last + each(t.contentCSS, function(u) { + t.dom.loadCSS(u); + }); - // Load specified content CSS last - if (s.content_css) { - tinymce.each(explode(s.content_css), function(u) { - t.dom.loadCSS(t.documentBaseURI.toAbsolute(u)); - }); - } + // Handle auto focus + if (s.auto_focus) { + setTimeout(function () { + var ed = tinymce.get(s.auto_focus); - // Handle auto focus - if (s.auto_focus) { - setTimeout(function () { - var ed = tinymce.get(s.auto_focus); + ed.selection.select(ed.getBody(), 1); + ed.selection.collapse(1); + ed.getBody().focus(); + ed.getWin().focus(); + }, 100); + } - ed.selection.select(ed.getBody(), 1); - ed.selection.collapse(1); - ed.getWin().focus(); - }, 100); - } - }, 1); - e = null; }, focus : function(sf) { - var oed, t = this, ce = t.settings.content_editable, ieRng, controlElm, doc = t.getDoc(); + var oed, t = this, selection = t.selection, ce = t.settings.content_editable, ieRng, controlElm, doc = t.getDoc(); if (!sf) { // Get selected control element - ieRng = t.selection.getRng(); + ieRng = selection.getRng(); if (ieRng.item) { controlElm = ieRng.item(0); } + t._refreshContentEditable(); + selection.normalize(); + // Is not content editable if (!ce) t.getWin().focus(); + // Focus the body as well since it's contentEditable + if (tinymce.isGecko) { + t.getBody().focus(); + } + // Restore selected control element // This is needed when for example an image is selected within a // layer a call to focus will then remove the control selection @@ -9255,7 +11323,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { }, nodeChanged : function(o) { - var t = this, s = t.selection, n = (isIE ? s.getNode() : s.getStart()) || t.getBody(); + var t = this, s = t.selection, n = s.getStart() || t.getBody(); // Fix for bug #1896577 it seems that this can not be fired while the editor is loading if (t.initialized) { @@ -9288,16 +11356,16 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { t.buttons[n] = s; }, - addCommand : function(n, f, s) { - this.execCommands[n] = {func : f, scope : s || this}; + addCommand : function(name, callback, scope) { + this.execCommands[name] = {func : callback, scope : scope || this}; }, - addQueryStateHandler : function(n, f, s) { - this.queryStateCommands[n] = {func : f, scope : s || this}; + addQueryStateHandler : function(name, callback, scope) { + this.queryStateCommands[name] = {func : callback, scope : scope || this}; }, - addQueryValueHandler : function(n, f, s) { - this.queryValueCommands[n] = {func : f, scope : s || this}; + addQueryValueHandler : function(name, callback, scope) { + this.queryValueCommands[name] = {func : callback, scope : scope || this}; }, addShortcut : function(pa, desc, cmd_func, sc) { @@ -9400,12 +11468,6 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { return true; } - // Execute global commands - if (tinymce.GlobalCommands.execCommand(t, cmd, ui, val)) { - t.onExecCommand.dispatch(t, cmd, ui, val, a); - return true; - } - // Editor commands if (t.editorCommands.execCommand(cmd, ui, val)) { t.onExecCommand.dispatch(t, cmd, ui, val, a); @@ -9537,7 +11599,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { // Add undo level will trigger onchange event if (!o.no_events) { - t.undoManager.typing = 0; + t.undoManager.typing = false; t.undoManager.add(); } @@ -9569,66 +11631,87 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { return h; }, - setContent : function(h, o) { - var t = this; + setContent : function(content, args) { + var self = this, rootNode, body = self.getBody(), forcedRootBlockName; - o = o || {}; - o.format = o.format || 'html'; - o.set = true; - o.content = h; + // Setup args object + args = args || {}; + args.format = args.format || 'html'; + args.set = true; + args.content = content; - if (!o.no_events) - t.onBeforeSetContent.dispatch(t, o); + // Do preprocessing + if (!args.no_events) + self.onBeforeSetContent.dispatch(self, args); + + content = args.content; // Padd empty content in Gecko and Safari. Commands will otherwise fail on the content // It will also be impossible to place the caret in the editor unless there is a BR element present - if (!tinymce.isIE && (h.length === 0 || /^\s+$/.test(h))) { - o.content = t.dom.setHTML(t.getBody(), '
    '); - o.format = 'raw'; - } + if (!tinymce.isIE && (content.length === 0 || /^\s+$/.test(content))) { + forcedRootBlockName = self.settings.forced_root_block; + if (forcedRootBlockName) + content = '<' + forcedRootBlockName + '>
    '; + else + content = '
    '; - o.content = t.dom.setHTML(t.getBody(), tinymce.trim(o.content)); + body.innerHTML = content; + self.selection.select(body, true); + self.selection.collapse(true); + return; + } - if (o.format != 'raw' && t.settings.cleanup) { - o.getInner = true; - o.content = t.dom.setHTML(t.getBody(), t.serializer.serialize(t.getBody(), o)); + // Parse and serialize the html + if (args.format !== 'raw') { + content = new tinymce.html.Serializer({}, self.schema).serialize( + self.parser.parse(content) + ); } - if (!o.no_events) - t.onSetContent.dispatch(t, o); + // Set the new cleaned contents to the editor + args.content = tinymce.trim(content); + self.dom.setHTML(body, args.content); + + // Do post processing + if (!args.no_events) + self.onSetContent.dispatch(self, args); - return o.content; + self.selection.normalize(); + + return args.content; }, - getContent : function(o) { - var t = this, h; + getContent : function(args) { + var self = this, content; - o = o || {}; - o.format = o.format || 'html'; - o.get = true; + // Setup args object + args = args || {}; + args.format = args.format || 'html'; + args.get = true; - if (!o.no_events) - t.onBeforeGetContent.dispatch(t, o); + // Do preprocessing + if (!args.no_events) + self.onBeforeGetContent.dispatch(self, args); - if (o.format != 'raw' && t.settings.cleanup) { - o.getInner = true; - h = t.serializer.serialize(t.getBody(), o); - } else - h = t.getBody().innerHTML; + // Get raw contents or by default the cleaned contents + if (args.format == 'raw') + content = self.getBody().innerHTML; + else + content = self.serializer.serialize(self.getBody(), args); - h = h.replace(/^\s*|\s*$/g, ''); - o.content = h; + args.content = tinymce.trim(content); - if (!o.no_events) - t.onGetContent.dispatch(t, o); + // Do post processing + if (!args.no_events) + self.onGetContent.dispatch(self, args); - return o.content; + return args.content; }, isDirty : function() { - var t = this; + var self = this; - return tinymce.trim(t.startContent) != tinymce.trim(t.getContent({format : 'raw', no_events : 1})) && !t.isNotDirty; + return tinymce.trim(self.startContent) != tinymce.trim(self.getContent({format : 'raw', no_events : 1})) && !self.isNotDirty; }, getContainer : function() { @@ -9806,7 +11889,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { _addEvents : function() { // 'focus', 'blur', 'dblclick', 'beforedeactivate', submit, reset - var t = this, i, s = t.settings, lo = { + var t = this, i, s = t.settings, dom = t.dom, lo = { mouseup : 'onMouseUp', mousedown : 'onMouseDown', click : 'onClick', @@ -9838,35 +11921,26 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { each(lo, function(v, k) { switch (k) { case 'contextmenu': - if (tinymce.isOpera) { - // Fake contextmenu on Opera - t.dom.bind(t.getBody(), 'mousedown', function(e) { - if (e.ctrlKey) { - e.fakeType = 'contextmenu'; - eventHandler(e); - } - }); - } else - t.dom.bind(t.getBody(), k, eventHandler); + dom.bind(t.getDoc(), k, eventHandler); break; case 'paste': - t.dom.bind(t.getBody(), k, function(e) { + dom.bind(t.getBody(), k, function(e) { eventHandler(e); }); break; case 'submit': case 'reset': - t.dom.bind(t.getElement().form || DOM.getParent(t.id, 'form'), k, eventHandler); + dom.bind(t.getElement().form || DOM.getParent(t.id, 'form'), k, eventHandler); break; default: - t.dom.bind(s.content_editable ? t.getBody() : t.getDoc(), k, eventHandler); + dom.bind(s.content_editable ? t.getBody() : t.getDoc(), k, eventHandler); } }); - t.dom.bind(s.content_editable ? t.getBody() : (isGecko ? t.getDoc() : t.getWin()), 'focus', function(e) { + dom.bind(s.content_editable ? t.getBody() : (isGecko ? t.getDoc() : t.getWin()), 'focus', function(e) { t.focus(true); }); @@ -9874,22 +11948,12 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { // Fixes bug where a specified document_base_uri could result in broken images // This will also fix drag drop of images in Gecko if (tinymce.isGecko) { - // Convert all images to absolute URLs -/* t.onSetContent.add(function(ed, o) { - each(ed.dom.select('img'), function(e) { - var v; - - if (v = e.getAttribute('_mce_src')) - e.src = t.documentBaseURI.toAbsolute(v); - }) - });*/ - - t.dom.bind(t.getDoc(), 'DOMNodeInserted', function(e) { + dom.bind(t.getDoc(), 'DOMNodeInserted', function(e) { var v; e = e.target; - if (e.nodeType === 1 && e.nodeName === 'IMG' && (v = e.getAttribute('_mce_src'))) + if (e.nodeType === 1 && e.nodeName === 'IMG' && (v = e.getAttribute('data-mce-src'))) e.src = t.documentBaseURI.toAbsolute(v); }); } @@ -9900,14 +11964,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { var t = this, d = t.getDoc(), s = t.settings; if (isGecko && !s.readonly) { - if (t._isHidden()) { - try { - if (!s.content_editable) - d.designMode = 'On'; - } catch (ex) { - // Fails if it's hidden - } - } + t._refreshContentEditable(); try { // Try new Gecko method @@ -9930,19 +11987,6 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { t.onMouseDown.add(setOpts); } - // Workaround for bug, http://bugs.webkit.org/show_bug.cgi?id=12250 - // WebKit can't even do simple things like selecting an image - // This also fixes so it's possible to select mceItemAnchors - if (tinymce.isWebKit) { - t.onClick.add(function(ed, e) { - e = e.target; - - // Needs tobe the setBaseAndExtend or it will fail to select floated images - if (e.nodeName == 'IMG' || (e.nodeName == 'A' && t.dom.hasClass(e, 'mceItemAnchor'))) - t.selection.getSel().setBaseAndExtent(e, 0, e, 1); - }); - } - // Add node change handlers t.onMouseUp.add(t.nodeChanged); //t.onClick.add(t.nodeChanged); @@ -9953,6 +11997,35 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { t.nodeChanged(); }); + + // Add block quote deletion handler + t.onKeyDown.add(function(ed, e) { + // Was the BACKSPACE key pressed? + if (e.keyCode != 8) + return; + + var n = ed.selection.getRng().startContainer; + var offset = ed.selection.getRng().startOffset; + + while (n && n.nodeType && n.nodeType != 1 && n.parentNode) + n = n.parentNode; + + // Is the cursor at the beginning of a blockquote? + if (n && n.parentNode && n.parentNode.tagName === 'BLOCKQUOTE' && n.parentNode.firstChild == n && offset == 0) { + // Remove the blockquote + ed.formatter.toggle('blockquote', null, n.parentNode); + + // Move the caret to the beginning of n + var rng = ed.selection.getRng(); + rng.setStart(n, 0); + rng.setEnd(n, 0); + ed.selection.setRng(rng); + ed.selection.collapse(false); + } + }); + + + // Add reset handler t.onReset.add(function() { t.setContent(t.startContent, {format : 'raw'}); @@ -9974,9 +12047,9 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { for (i=1; i<=6; i++) t.addShortcut('ctrl+' + i, '', ['FormatBlock', false, 'h' + i]); - t.addShortcut('ctrl+7', '', ['FormatBlock', false, '

    ']); - t.addShortcut('ctrl+8', '', ['FormatBlock', false, '

    ']); - t.addShortcut('ctrl+9', '', ['FormatBlock', false, '
    ']); + t.addShortcut('ctrl+7', '', ['FormatBlock', false, 'p']); + t.addShortcut('ctrl+8', '', ['FormatBlock', false, 'div']); + t.addShortcut('ctrl+9', '', ['FormatBlock', false, 'address']); function find(e) { var v = null; @@ -10032,7 +12105,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { if (tinymce.isIE) { // Fix so resize will only update the width and height attributes not the styles of an image // It will also block mceItemNoResize items - t.dom.bind(t.getDoc(), 'controlselect', function(e) { + dom.bind(t.getDoc(), 'controlselect', function(e) { var re = t.resizeInfo, cb; e = e.target; @@ -10042,28 +12115,28 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { return; if (re) - t.dom.unbind(re.node, re.ev, re.cb); + dom.unbind(re.node, re.ev, re.cb); - if (!t.dom.hasClass(e, 'mceItemNoResize')) { + if (!dom.hasClass(e, 'mceItemNoResize')) { ev = 'resizeend'; - cb = t.dom.bind(e, ev, function(e) { + cb = dom.bind(e, ev, function(e) { var v; e = e.target; - if (v = t.dom.getStyle(e, 'width')) { - t.dom.setAttrib(e, 'width', v.replace(/[^0-9%]+/g, '')); - t.dom.setStyle(e, 'width', ''); + if (v = dom.getStyle(e, 'width')) { + dom.setAttrib(e, 'width', v.replace(/[^0-9%]+/g, '')); + dom.setStyle(e, 'width', ''); } - if (v = t.dom.getStyle(e, 'height')) { - t.dom.setAttrib(e, 'height', v.replace(/[^0-9%]+/g, '')); - t.dom.setStyle(e, 'height', ''); + if (v = dom.getStyle(e, 'height')) { + dom.setAttrib(e, 'height', v.replace(/[^0-9%]+/g, '')); + dom.setStyle(e, 'height', ''); } }); } else { ev = 'resizestart'; - cb = t.dom.bind(e, 'resizestart', Event.cancel, Event); + cb = dom.bind(e, 'resizestart', Event.cancel, Event); } re = t.resizeInfo = { @@ -10072,27 +12145,6 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { cb : cb }; }); - - t.onKeyDown.add(function(ed, e) { - switch (e.keyCode) { - case 8: - // Fix IE control + backspace browser bug - if (t.selection.getRng().item) { - ed.dom.remove(t.selection.getRng().item(0)); - return Event.cancel(e); - } - } - }); - - /*if (t.dom.boxModel) { - t.getBody().style.height = '100%'; - - Event.add(t.getWin(), 'resize', function(e) { - var docElm = t.getDoc().documentElement; - - docElm.style.height = (docElm.offsetHeight - 10) + 'px'; - }); - }*/ } if (tinymce.isOpera) { @@ -10104,81 +12156,61 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { // Add custom undo/redo handlers if (s.custom_undo_redo) { function addUndo() { - t.undoManager.typing = 0; + t.undoManager.typing = false; t.undoManager.add(); }; - t.dom.bind(t.getDoc(), 'focusout', function(e) { + dom.bind(t.getDoc(), 'focusout', function(e) { if (!t.removed && t.undoManager.typing) addUndo(); }); + // Add undo level when contents is drag/dropped within the editor + t.dom.bind(t.dom.getRoot(), 'dragend', function(e) { + addUndo(); + }); + t.onKeyUp.add(function(ed, e) { - if ((e.keyCode >= 33 && e.keyCode <= 36) || (e.keyCode >= 37 && e.keyCode <= 40) || e.keyCode == 13 || e.keyCode == 45 || e.ctrlKey) + var keyCode = e.keyCode; + + if ((keyCode >= 33 && keyCode <= 36) || (keyCode >= 37 && keyCode <= 40) || keyCode == 13 || keyCode == 45 || e.ctrlKey) addUndo(); }); t.onKeyDown.add(function(ed, e) { - var rng, tmpRng, parent, offset; - - // IE has a really odd bug where the DOM might include an node that doesn't have - // a proper structure. If you try to access nodeValue it would throw an illegal value exception. - // This seems to only happen when you delete contents and it seems to be avoidable if you refresh the element - // after you delete contents from it. See: #3008923 - if (isIE && e.keyCode == 46) { - rng = t.selection.getRng(); - - if (rng.parentElement) { - parent = rng.parentElement(); - - // Get the current caret position within the element - tmpRng = rng.duplicate(); - tmpRng.moveToElementText(parent); - tmpRng.setEndPoint('EndToEnd', rng); - offset = tmpRng.text.length; - - // Select next word when ctrl key is used in combo with delete - if (e.ctrlKey) { - rng.moveEnd('word', 1); - rng.select(); - } + var keyCode = e.keyCode, sel; - // Delete contents - t.selection.getSel().clear(); + if (keyCode == 8) { + sel = t.getDoc().selection; - // Check if we are within the same parent - if (rng.parentElement() == parent) { - try { - // Update the HTML and hopefully it will remove the artifacts - parent.innerHTML = parent.innerHTML; - } catch (ex) { - // And since it's IE it can sometimes produce an unknown runtime error - } - - // Restore the caret position - tmpRng.moveToElementText(parent); - tmpRng.collapse(); - tmpRng.move('character', offset); - tmpRng.select(); - } + // Fix IE control + backspace browser bug + if (sel && sel.createRange && sel.createRange().item) { + t.undoManager.beforeChange(); + ed.dom.remove(sel.createRange().item(0)); + addUndo(); - // Block the default delete behavior since it might be broken - e.preventDefault(); - return; + return Event.cancel(e); } } - // Is caracter positon keys - if ((e.keyCode >= 33 && e.keyCode <= 36) || (e.keyCode >= 37 && e.keyCode <= 40) || e.keyCode == 13 || e.keyCode == 45) { + // Is caracter positon keys left,right,up,down,home,end,pgdown,pgup,enter + if ((keyCode >= 33 && keyCode <= 36) || (keyCode >= 37 && keyCode <= 40) || keyCode == 13 || keyCode == 45) { + // Add position before enter key is pressed, used by IE since it still uses the default browser behavior + // Todo: Remove this once we normalize enter behavior on IE + if (tinymce.isIE && keyCode == 13) + t.undoManager.beforeChange(); + if (t.undoManager.typing) addUndo(); return; } - if (!t.undoManager.typing) { + // If key isn't shift,ctrl,alt,capslock,metakey + if ((keyCode < 16 || keyCode > 20) && keyCode != 224 && keyCode != 91 && !t.undoManager.typing) { + t.undoManager.beforeChange(); + t.undoManager.typing = true; t.undoManager.add(); - t.undoManager.typing = 1; } }); @@ -10187,68 +12219,83 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { addUndo(); }); } - }, - _isHidden : function() { - var s; + // Bug fix for FireFox keeping styles from end of selection instead of start. + if (tinymce.isGecko) { + function getAttributeApplyFunction() { + var template = t.dom.getAttribs(t.selection.getStart().cloneNode(false)); - if (!isGecko) - return 0; + return function() { + var target = t.selection.getStart(); - // Weird, wheres that cursor selection? - s = this.selection.getSel(); - return (!s || !s.rangeCount || s.rangeCount == 0); - }, + if (target !== t.getBody()) { + t.dom.setAttrib(target, "style", null); - // Fix for bug #1867292 - _fixNesting : function(s) { - var d = [], i; + each(template, function(attr) { + target.setAttributeNode(attr.cloneNode(true)); + }); + } + }; + } - s = s.replace(/<(\/)?([^\s>]+)[^>]*?>/g, function(a, b, c) { - var e; + function isSelectionAcrossElements() { + var s = t.selection; - // Handle end element - if (b === '/') { - if (!d.length) - return ''; + return !s.isCollapsed() && s.getStart() != s.getEnd(); + } - if (c !== d[d.length - 1].tag) { - for (i=d.length - 1; i>=0; i--) { - if (d[i].tag === c) { - d[i].close = 1; - break; - } - } + t.onKeyPress.add(function(ed, e) { + var applyAttributes; - return ''; - } else { - d.pop(); + if ((e.keyCode == 8 || e.keyCode == 46) && isSelectionAcrossElements()) { + applyAttributes = getAttributeApplyFunction(); + t.getDoc().execCommand('delete', false, null); + applyAttributes(); - if (d.length && d[d.length - 1].close) { - a = a + ''; - d.pop(); - } + return Event.cancel(e); } - } else { - // Ignore these - if (/^(br|hr|input|meta|img|link|param)$/i.test(c)) - return a; + }); - // Ignore closed ones - if (/\/>$/.test(a)) - return a; + t.dom.bind(t.getDoc(), 'cut', function(e) { + var applyAttributes; - d.push({tag : c}); // Push start element - } + if (isSelectionAcrossElements()) { + applyAttributes = getAttributeApplyFunction(); + t.onKeyUp.addToTop(Event.cancel, Event); - return a; - }); + setTimeout(function() { + applyAttributes(); + t.onKeyUp.remove(Event.cancel, Event); + }, 0); + } + }); + } + }, - // End all open tags - for (i=d.length - 1; i>=0; i--) - s += ''; + _refreshContentEditable : function() { + var self = this, body, parent; - return s; + // Check if the editor was hidden and the re-initalize contentEditable mode by removing and adding the body again + if (self._isHidden()) { + body = self.getBody(); + parent = body.parentNode; + + parent.removeChild(body); + parent.appendChild(body); + + body.focus(); + } + }, + + _isHidden : function() { + var s; + + if (!isGecko) + return 0; + + // Weird, wheres that cursor selection? + s = this.selection.getSel(); + return (!s || !s.rangeCount || s.rangeCount == 0); } }); })(tinymce); @@ -10262,6 +12309,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { selection = editor.selection, commands = {state: {}, exec : {}, value : {}}, settings = editor.settings, + formatter = editor.formatter, bookmark; function execCommand(command, ui, value) { @@ -10327,11 +12375,11 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { }; function isFormatMatch(name) { - return editor.formatter.match(name); + return formatter.match(name); }; function toggleFormat(name, value) { - editor.formatter.toggle(name, value ? {value : value} : undefined); + formatter.toggle(name, value ? {value : value} : undefined); }; function storeSelection(type) { @@ -10391,10 +12439,11 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { // Remove all other alignments first each('left,center,right,full'.split(','), function(name) { if (align != name) - editor.formatter.remove('align' + name); + formatter.remove('align' + name); }); toggleFormat('align' + align); + execCommand('mceRepaint'); }, // Override list commands to fix WebKit bug @@ -10420,7 +12469,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { }, // Override commands to use the text formatter engine - 'Bold,Italic,Underline,Strikethrough' : function(command) { + 'Bold,Italic,Underline,Strikethrough,Superscript,Subscript' : function(command) { toggleFormat(command); }, @@ -10447,7 +12496,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { }, RemoveFormat : function(command) { - editor.formatter.remove(command); + formatter.remove(command); }, mceBlockQuote : function(command) { @@ -10455,7 +12504,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { }, FormatBlock : function(command, ui, value) { - return toggleFormat(value); + return toggleFormat(value || 'p'); }, mceCleanup : function() { @@ -10475,30 +12524,156 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { editor.dom.remove(node, TRUE); restoreSelection(); } - }, + }, + + mceSelectNodeDepth : function(command, ui, value) { + var counter = 0; + + dom.getParent(selection.getNode(), function(node) { + if (node.nodeType == 1 && counter++ == value) { + selection.select(node); + return FALSE; + } + }, editor.getBody()); + }, + + mceSelectNode : function(command, ui, value) { + selection.select(value); + }, + + mceInsertContent : function(command, ui, value) { + var parser, serializer, parentNode, rootNode, fragment, args, + marker, nodeRect, viewPortRect, rng, node, node2, bookmarkHtml, viewportBodyElement; + + // Setup parser and serializer + parser = editor.parser; + serializer = new tinymce.html.Serializer({}, editor.schema); + bookmarkHtml = '\uFEFF'; + + // Run beforeSetContent handlers on the HTML to be inserted + args = {content: value, format: 'html'}; + selection.onBeforeSetContent.dispatch(selection, args); + value = args.content; + + // Add caret at end of contents if it's missing + if (value.indexOf('{$caret}') == -1) + value += '{$caret}'; + + // Replace the caret marker with a span bookmark element + value = value.replace(/\{\$caret\}/, bookmarkHtml); + + // Insert node maker where we will insert the new HTML and get it's parent + if (!selection.isCollapsed()) + editor.getDoc().execCommand('Delete', false, null); + + parentNode = selection.getNode(); + + // Parse the fragment within the context of the parent node + args = {context : parentNode.nodeName.toLowerCase()}; + fragment = parser.parse(value, args); + + // Move the caret to a more suitable location + node = fragment.lastChild; + if (node.attr('id') == 'mce_marker') { + marker = node; + + for (node = node.prev; node; node = node.walk(true)) { + if (node.type == 3 || !dom.isBlock(node.name)) { + node.parent.insert(marker, node, node.name === 'br'); + break; + } + } + } + + // If parser says valid we can insert the contents into that parent + if (!args.invalid) { + value = serializer.serialize(fragment); + + // Check if parent is empty or only has one BR element then set the innerHTML of that parent + node = parentNode.firstChild; + node2 = parentNode.lastChild; + if (!node || (node === node2 && node.nodeName === 'BR')) + dom.setHTML(parentNode, value); + else + selection.setContent(value); + } else { + // If the fragment was invalid within that context then we need + // to parse and process the parent it's inserted into + + // Insert bookmark node and get the parent + selection.setContent(bookmarkHtml); + parentNode = editor.selection.getNode(); + rootNode = editor.getBody(); + + // Opera will return the document node when selection is in root + if (parentNode.nodeType == 9) + parentNode = node = rootNode; + else + node = parentNode; + + // Find the ancestor just before the root element + while (node !== rootNode) { + parentNode = node; + node = node.parentNode; + } + + // Get the outer/inner HTML depending on if we are in the root and parser and serialize that + value = parentNode == rootNode ? rootNode.innerHTML : dom.getOuterHTML(parentNode); + value = serializer.serialize( + parser.parse( + // Need to replace by using a function since $ in the contents would otherwise be a problem + value.replace(//i, function() { + return serializer.serialize(fragment); + }) + ) + ); + + // Set the inner/outer HTML depending on if we are in the root or not + if (parentNode == rootNode) + dom.setHTML(rootNode, value); + else + dom.setOuterHTML(parentNode, value); + } - mceSelectNodeDepth : function(command, ui, value) { - var counter = 0; + marker = dom.get('mce_marker'); - dom.getParent(selection.getNode(), function(node) { - if (node.nodeType == 1 && counter++ == value) { - selection.select(node); - return FALSE; - } - }, editor.getBody()); - }, + // Scroll range into view scrollIntoView on element can't be used since it will scroll the main view port as well + nodeRect = dom.getRect(marker); + viewPortRect = dom.getViewPort(editor.getWin()); - mceSelectNode : function(command, ui, value) { - selection.select(value); - }, + // Check if node is out side the viewport if it is then scroll to it + if ((nodeRect.y + nodeRect.h > viewPortRect.y + viewPortRect.h || nodeRect.y < viewPortRect.y) || + (nodeRect.x > viewPortRect.x + viewPortRect.w || nodeRect.x < viewPortRect.x)) { + viewportBodyElement = tinymce.isIE ? editor.getDoc().documentElement : editor.getBody(); + viewportBodyElement.scrollLeft = nodeRect.x; + viewportBodyElement.scrollTop = nodeRect.y - viewPortRect.h + 25; + } - mceInsertContent : function(command, ui, value) { - selection.setContent(value); + // Move selection before marker and remove it + rng = dom.createRng(); + + // If previous sibling is a text node set the selection to the end of that node + node = marker.previousSibling; + if (node && node.nodeType == 3) { + rng.setStart(node, node.nodeValue.length); + } else { + // If the previous sibling isn't a text node or doesn't exist set the selection before the marker node + rng.setStartBefore(marker); + rng.setEndBefore(marker); + } + + // Remove the marker node and set the new range + dom.remove(marker); + selection.setRng(rng); + + // Dispatch after event and add any visual elements needed + selection.onSetContent.dispatch(selection, args); + editor.addVisual(); }, mceInsertRawHTML : function(command, ui, value) { selection.setContent('tiny_mce_marker'); - editor.setContent(editor.getContent().replace(/tiny_mce_marker/g, value)); + editor.setContent(editor.getContent().replace(/tiny_mce_marker/g, function() { return value })); }, mceSetContent : function(command, ui, value) { @@ -10544,11 +12719,11 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { }, mceToggleFormat : function(command, ui, value) { - editor.formatter.toggle(value); + formatter.toggle(value); }, InsertHorizontalRule : function() { - selection.setContent('
    '); + editor.execCommand('mceInsertContent', false, '
    '); }, mceToggleVisualAid : function() { @@ -10557,33 +12732,37 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { }, mceReplaceContent : function(command, ui, value) { - selection.setContent(value.replace(/\{\$selection\}/g, selection.getContent({format : 'text'}))); + editor.execCommand('mceInsertContent', false, value.replace(/\{\$selection\}/g, selection.getContent({format : 'text'}))); }, mceInsertLink : function(command, ui, value) { - var link = dom.getParent(selection.getNode(), 'a'); + var anchor; - if (tinymce.is(value, 'string')) + if (typeof(value) == 'string') value = {href : value}; - if (!link) { - execNativeCommand('CreateLink', FALSE, 'javascript:mctmp(0);'); - each(dom.select('a[href=javascript:mctmp(0);]'), function(link) { - dom.setAttribs(link, value); - }); - } else { - if (value.href) - dom.setAttribs(link, value); - else - editor.dom.remove(link, TRUE); + anchor = dom.getParent(selection.getNode(), 'a'); + + // Spaces are never valid in URLs and it's a very common mistake for people to make so we fix it here. + value.href = value.href.replace(' ', '%20'); + + // Remove existing links if there could be child links or that the href isn't specified + if (!anchor || !value.href) { + formatter.remove('link'); + } + + // Apply new link to selection + if (value.href) { + formatter.apply('link', value, anchor); } }, - + selectAll : function() { - var root = dom.getRoot(); - var rng = dom.createRng(); + var root = dom.getRoot(), rng = dom.createRng(); + rng.setStart(root, 0); rng.setEnd(root, root.childNodes.length); + editor.selection.setRng(rng); } }); @@ -10595,7 +12774,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { return isFormatMatch('align' + command.substring(7)); }, - 'Bold,Italic,Underline,Strikethrough' : function(command) { + 'Bold,Italic,Underline,Strikethrough,Superscript,Subscript' : function(command) { return isFormatMatch(command); }, @@ -10652,23 +12831,30 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { } }; })(tinymce); + (function(tinymce) { var Dispatcher = tinymce.util.Dispatcher; tinymce.UndoManager = function(editor) { - var self, index = 0, data = []; + var self, index = 0, data = [], beforeBookmark; function getContent() { return tinymce.trim(editor.getContent({format : 'raw', no_events : 1})); }; return self = { - typing : 0, + typing : false, onAdd : new Dispatcher(self), + onUndo : new Dispatcher(self), + onRedo : new Dispatcher(self), + beforeChange : function() { + beforeBookmark = editor.selection.getBookmark(2, true); + }, + add : function(level) { var i, settings = editor.settings, lastLevel; @@ -10677,10 +12863,12 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { // Add undo level if needed lastLevel = data[index]; - if (lastLevel && lastLevel.content == level.content) { - if (index > 0 || data.length == 1) - return null; - } + if (lastLevel && lastLevel.content == level.content) + return null; + + // Set before bookmark on previous level + if (data[index]) + data[index].beforeBookmark = beforeBookmark; // Time to compress if (settings.custom_undo_redo_levels) { @@ -10697,13 +12885,8 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { level.bookmark = editor.selection.getBookmark(2, true); // Crop array if needed - if (index < data.length - 1) { - // Treat first level as initial - if (index == 0) - data = []; - else - data.length = index + 1; - } + if (index < data.length - 1) + data.length = index + 1; data.push(level); index = data.length - 1; @@ -10719,14 +12902,14 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { if (self.typing) { self.add(); - self.typing = 0; + self.typing = false; } if (index > 0) { level = data[--index]; editor.setContent(level.content, {format : 'raw'}); - editor.selection.moveToBookmark(level.bookmark); + editor.selection.moveToBookmark(level.beforeBookmark); self.onUndo.dispatch(self, level); } @@ -10751,15 +12934,16 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { clear : function() { data = []; - index = self.typing = 0; + index = 0; + self.typing = false; }, hasUndo : function() { - return index > 0 || self.typing; + return index > 0 || this.typing; }, hasRedo : function() { - return index < data.length - 1; + return index < data.length - 1 && !this.typing; } }; }; @@ -10808,24 +12992,15 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { return rng2.cloneContents().textContent.length == 0; }; - function isEmpty(n) { - n = n.innerHTML; - - n = n.replace(/<(img|hr|table|input|select|textarea)[ \>]/gi, '-'); // Keep these convert them to - chars - n = n.replace(/<[^>]+>/g, ''); // Remove all tags - - return n.replace(/[ \u00a0\t\r\n]+/g, '') == ''; - }; - function splitList(selection, dom, li) { var listBlock, block; - if (isEmpty(li)) { + if (dom.isEmpty(li)) { listBlock = dom.getParent(li, 'ul,ol'); if (!dom.getParent(listBlock.parentNode, 'ul,ol')) { dom.split(listBlock, li); - block = dom.create('p', 0, '
    '); + block = dom.create('p', 0, '
    '); dom.replace(block, li); selection.select(block, 1); } @@ -10846,45 +13021,94 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { s.element = elm.toUpperCase(); ed.onPreInit.add(t.setup, t); + }, - t.reOpera = new RegExp('(\\u00a0| | )<\/' + elm + '>', 'gi'); - t.rePadd = new RegExp(']+)><\\\/p>|]+)\\\/>|]+)>\\s+<\\\/p>|

    <\\\/p>||

    \\s+<\\\/p>'.replace(/p/g, elm), 'gi'); - t.reNbsp2BR1 = new RegExp(']+)>[\\s\\u00a0]+<\\\/p>|

    [\\s\\u00a0]+<\\\/p>'.replace(/p/g, elm), 'gi'); - t.reNbsp2BR2 = new RegExp('<%p()([^>]+)>( | )<\\\/%p>|<%p>( | )<\\\/%p>'.replace(/%p/g, elm), 'gi'); - t.reBR2Nbsp = new RegExp(']+)>\\s*
    \\s*<\\\/p>|

    \\s*
    \\s*<\\\/p>'.replace(/p/g, elm), 'gi'); + setup : function() { + var t = this, ed = t.editor, s = ed.settings, dom = ed.dom, selection = ed.selection, blockElements = ed.schema.getBlockElements(); - function padd(ed, o) { - if (isOpera) - o.content = o.content.replace(t.reOpera, ''); + // Force root blocks + if (s.forced_root_block) { + function addRootBlocks() { + var node = selection.getStart(), rootNode = ed.getBody(), rng, startContainer, startOffset, endContainer, endOffset, rootBlockNode, tempNode, offset = -0xFFFFFF; - o.content = o.content.replace(t.rePadd, '<' + elm + '$1$2$3$4$5$6>\u00a0'); + if (!node || node.nodeType !== 1) + return; - if (!isIE && !isOpera && o.set) { - // Use   instead of BR in padded paragraphs - o.content = o.content.replace(t.reNbsp2BR1, '<' + elm + '$1$2>
    '); - o.content = o.content.replace(t.reNbsp2BR2, '<' + elm + '$1$2>
    '); - } else - o.content = o.content.replace(t.reBR2Nbsp, '<' + elm + '$1$2>\u00a0'); - }; + // Check if node is wrapped in block + while (node != rootNode) { + if (blockElements[node.nodeName]) + return; - ed.onBeforeSetContent.add(padd); - ed.onPostProcess.add(padd); + node = node.parentNode; + } - if (s.forced_root_block) { - ed.onInit.add(t.forceRoots, t); - ed.onSetContent.add(t.forceRoots, t); - ed.onBeforeGetContent.add(t.forceRoots, t); - } - }, + // Get current selection + rng = selection.getRng(); + if (rng.setStart) { + startContainer = rng.startContainer; + startOffset = rng.startOffset; + endContainer = rng.endContainer; + endOffset = rng.endOffset; + } else { + // Force control range into text range + if (rng.item) { + rng = ed.getDoc().body.createTextRange(); + rng.moveToElementText(rng.item(0)); + } - setup : function() { - var t = this, ed = t.editor, s = ed.settings, dom = ed.dom, selection = ed.selection; + tmpRng = rng.duplicate(); + tmpRng.collapse(true); + startOffset = tmpRng.move('character', offset) * -1; - // Force root blocks when typing and when getting output - if (s.forced_root_block) { - ed.onBeforeExecCommand.add(t.forceRoots, t); - ed.onKeyUp.add(t.forceRoots, t); - ed.onPreProcess.add(t.forceRoots, t); + if (!tmpRng.collapsed) { + tmpRng = rng.duplicate(); + tmpRng.collapse(false); + endOffset = (tmpRng.move('character', offset) * -1) - startOffset; + } + } + + // Wrap non block elements and text nodes + for (node = rootNode.firstChild; node; node) { + if (node.nodeType === 3 || (node.nodeType == 1 && !blockElements[node.nodeName])) { + if (!rootBlockNode) { + rootBlockNode = dom.create(s.forced_root_block); + node.parentNode.insertBefore(rootBlockNode, node); + } + + tempNode = node; + node = node.nextSibling; + rootBlockNode.appendChild(tempNode); + } else { + rootBlockNode = null; + node = node.nextSibling; + } + } + + if (rng.setStart) { + rng.setStart(startContainer, startOffset); + rng.setEnd(endContainer, endOffset); + selection.setRng(rng); + } else { + try { + rng = ed.getDoc().body.createTextRange(); + rng.moveToElementText(rootNode); + rng.collapse(true); + rng.moveStart('character', startOffset); + + if (endOffset > 0) + rng.moveEnd('character', endOffset); + + rng.select(); + } catch (ex) { + // Ignore + } + } + + ed.nodeChanged(); + }; + + ed.onKeyUp.add(addRootBlocks); + ed.onClick.add(addRootBlocks); } if (s.force_br_newlines) { @@ -10934,12 +13158,12 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { var parent = ed.selection.getStart(), fmt = t._previousFormats; // Parent is an empty block - if (!parent.hasChildNodes()) { + if (!parent.hasChildNodes() && fmt) { parent = dom.getParent(parent, dom.isBlock); - if (parent) { + if (parent && parent.nodeName != 'LI') { parent.innerHTML = ''; - + if (t._previousFormats) { parent.appendChild(fmt.wrapper); fmt.inner.innerHTML = '\uFEFF'; @@ -10947,7 +13171,9 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { parent.innerHTML = '\uFEFF'; selection.select(parent, 1); + selection.collapse(true); ed.getDoc().execCommand('Delete', false, null); + t._previousFormats = 0; } } } @@ -11000,21 +13226,6 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { }); } - // Padd empty inline elements within block elements - // For example:

    becomes

     

    - ed.onPreProcess.add(function(ed, o) { - each(dom.select('p,h1,h2,h3,h4,h5,h6,div', o.node), function(p) { - if (isEmpty(p)) { - each(dom.select('span,em,strong,b,i', o.node), function(n) { - if (!n.hasChildNodes()) { - n.appendChild(ed.getDoc().createTextNode('\u00a0')); - return FALSE; // Break the loop one padding is enough - } - }); - } - }); - }); - // IE specific fixes if (isIE) { // Replaces IE:s auto generated paragraphs with the specified element name @@ -11044,155 +13255,6 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { } }, - find : function(n, t, s) { - var ed = this.editor, w = ed.getDoc().createTreeWalker(n, 4, null, FALSE), c = -1; - - while (n = w.nextNode()) { - c++; - - // Index by node - if (t == 0 && n == s) - return c; - - // Node by index - if (t == 1 && c == s) - return n; - } - - return -1; - }, - - forceRoots : function(ed, e) { - var t = this, ed = t.editor, b = ed.getBody(), d = ed.getDoc(), se = ed.selection, s = se.getSel(), r = se.getRng(), si = -2, ei, so, eo, tr, c = -0xFFFFFF; - var nx, bl, bp, sp, le, nl = b.childNodes, i, n, eid; - - // Fix for bug #1863847 - //if (e && e.keyCode == 13) - // return TRUE; - - // Wrap non blocks into blocks - for (i = nl.length - 1; i >= 0; i--) { - nx = nl[i]; - - // Ignore internal elements - if (nx.nodeType === 1 && nx.getAttribute('_mce_type')) { - bl = null; - continue; - } - - // Is text or non block element - if (nx.nodeType === 3 || (!t.dom.isBlock(nx) && nx.nodeType !== 8 && !/^(script|mce:script|style|mce:style)$/i.test(nx.nodeName))) { - if (!bl) { - // Create new block but ignore whitespace - if (nx.nodeType != 3 || /[^\s]/g.test(nx.nodeValue)) { - // Store selection - if (si == -2 && r) { - if (!isIE) { - // If selection is element then mark it - if (r.startContainer.nodeType == 1 && (n = r.startContainer.childNodes[r.startOffset]) && n.nodeType == 1) { - // Save the id of the selected element - eid = n.getAttribute("id"); - n.setAttribute("id", "__mce"); - } else { - // If element is inside body, might not be the case in contentEdiable mode - if (ed.dom.getParent(r.startContainer, function(e) {return e === b;})) { - so = r.startOffset; - eo = r.endOffset; - si = t.find(b, 0, r.startContainer); - ei = t.find(b, 0, r.endContainer); - } - } - } else { - // Force control range into text range - if (r.item) { - tr = d.body.createTextRange(); - tr.moveToElementText(r.item(0)); - r = tr; - } - - tr = d.body.createTextRange(); - tr.moveToElementText(b); - tr.collapse(1); - bp = tr.move('character', c) * -1; - - tr = r.duplicate(); - tr.collapse(1); - sp = tr.move('character', c) * -1; - - tr = r.duplicate(); - tr.collapse(0); - le = (tr.move('character', c) * -1) - sp; - - si = sp - bp; - ei = le; - } - } - - // Uses replaceChild instead of cloneNode since it removes selected attribute from option elements on IE - // See: http://support.microsoft.com/kb/829907 - bl = ed.dom.create(ed.settings.forced_root_block); - nx.parentNode.replaceChild(bl, nx); - bl.appendChild(nx); - } - } else { - if (bl.hasChildNodes()) - bl.insertBefore(nx, bl.firstChild); - else - bl.appendChild(nx); - } - } else - bl = null; // Time to create new block - } - - // Restore selection - if (si != -2) { - if (!isIE) { - bl = b.getElementsByTagName(ed.settings.element)[0]; - r = d.createRange(); - - // Select last location or generated block - if (si != -1) - r.setStart(t.find(b, 1, si), so); - else - r.setStart(bl, 0); - - // Select last location or generated block - if (ei != -1) - r.setEnd(t.find(b, 1, ei), eo); - else - r.setEnd(bl, 0); - - if (s) { - s.removeAllRanges(); - s.addRange(r); - } - } else { - try { - r = s.createRange(); - r.moveToElementText(b); - r.collapse(1); - r.moveStart('character', si); - r.moveEnd('character', ei); - r.select(); - } catch (ex) { - // Ignore - } - } - } else if (!isIE && (n = ed.dom.get('__mce'))) { - // Restore the id of the selected element - if (eid) - n.setAttribute('id', eid); - else - n.removeAttribute('id'); - - // Move caret before selected element - r = d.createRange(); - r.setStartBefore(n); - r.setEndBefore(n); - se.setRng(r); - } - }, - getParentBlock : function(n) { var d = this.dom; @@ -11203,6 +13265,8 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { var t = this, ed = t.editor, dom = ed.dom, d = ed.getDoc(), se = ed.settings, s = ed.selection.getSel(), r = s.getRangeAt(0), b = d.body; var rb, ra, dir, sn, so, en, eo, sb, eb, bn, bef, aft, sc, ec, n, vp = dom.getViewPort(ed.getWin()), y, ch, car; + ed.undoManager.beforeChange(); + // If root blocks are forced then use Operas default behavior since it's really good // Removed due to bug: #1853816 // if (se.forced_root_block && isOpera) @@ -11264,6 +13328,11 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { ra.setStart(en, 0); } + // If the body is totally empty add a BR element this might happen on webkit + if (!d.body.hasChildNodes()) { + d.body.appendChild(dom.create('br')); + } + // Never use body as start or end node sn = sn.nodeName == "HTML" ? d.body : sn; // Fix for Opera bug: https://bugs.opera.com/show_bug.cgi?id=273224&comments=yes sn = sn.nodeName == "BODY" ? sn.firstChild : sn; @@ -11378,10 +13447,6 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { if (aft.firstChild && aft.firstChild.nodeName == bn) aft.innerHTML = aft.firstChild.innerHTML; - // Padd empty blocks - if (isEmpty(bef)) - bef.innerHTML = '
    '; - function appendStyles(e, en) { var nl = [], nn, n, i; @@ -11406,14 +13471,18 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { nn = nn.appendChild(nl[i]); // Padd most inner style element - nl[0].innerHTML = isOpera ? ' ' : '
    '; // Extra space for Opera so that the caret can move there + nl[0].innerHTML = isOpera ? '\u00a0' : '
    '; // Extra space for Opera so that the caret can move there return nl[0]; // Move caret to most inner element } else - e.innerHTML = isOpera ? ' ' : '
    '; // Extra space for Opera so that the caret can move there + e.innerHTML = isOpera ? '\u00a0' : '
    '; // Extra space for Opera so that the caret can move there }; + + // Padd empty blocks + if (dom.isEmpty(bef)) + appendStyles(bef, sn); // Fill empty afterblook with current style - if (isEmpty(aft)) + if (dom.isEmpty(aft)) car = appendStyles(aft, en); // Opera needs this one backwards for older versions @@ -11429,27 +13498,26 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { aft.normalize(); bef.normalize(); - function first(n) { - return d.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, FALSE).nextNode() || n; - }; - // Move cursor and scroll into view - r = d.createRange(); - r.selectNodeContents(isGecko ? first(car || aft) : car || aft); - r.collapse(1); - s.removeAllRanges(); - s.addRange(r); + ed.selection.select(aft, true); + ed.selection.collapse(true); // scrollIntoView seems to scroll the parent window in most browsers now including FF 3.0b4 so it's time to stop using it and do it our selfs y = ed.dom.getPos(aft).y; - ch = aft.clientHeight; + //ch = aft.clientHeight; // Is element within viewport - if (y < vp.y || y + ch > vp.y + vp.h) { + if (y < vp.y || y + 25 > vp.y + vp.h) { ed.getWin().scrollTo(0, y < vp.y ? y : y - vp.h + 25); // Needs to be hardcoded to roughly one line of text if a huge text block is broken into two blocks - //console.debug('SCROLL!', 'vp.y: ' + vp.y, 'y' + y, 'vp.h' + vp.h, 'clientHeight' + aft.clientHeight, 'yyy: ' + (y < vp.y ? y : y - vp.h + aft.clientHeight)); + + /*console.debug( + 'Element: y=' + y + ', h=' + ch + ', ' + + 'Viewport: y=' + vp.y + ", h=" + vp.h + ', bottom=' + (vp.y + vp.h) + );*/ } + ed.undoManager.add(); + return FALSE; }, @@ -11660,11 +13728,16 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { id = t.prefix + id; - if (ed.settings.use_native_selects) + + function useNativeListForAccessibility(ed) { + return ed.settings.use_accessible_selects && !tinymce.isGecko + } + + if (ed.settings.use_native_selects || useNativeListForAccessibility(ed)) c = new tinymce.ui.NativeListBox(id, s); else { cls = cc || t._cls.listbox || tinymce.ui.ListBox; - c = new cls(id, s); + c = new cls(id, s, ed); } t.controls[id] = c; @@ -11719,11 +13792,11 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { if (s.menu_button) { cls = cc || t._cls.menubutton || tinymce.ui.MenuButton; - c = new cls(id, s); + c = new cls(id, s, ed); ed.onMouseDown.add(c.hideMenu, c); } else { cls = t._cls.button || tinymce.ui.Button; - c = new cls(id, s); + c = new cls(id, s, ed); } return t.add(c); @@ -11766,7 +13839,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { id = t.prefix + id; cls = cc || t._cls.splitbutton || tinymce.ui.SplitButton; - c = t.add(new cls(id, s)); + c = t.add(new cls(id, s, ed)); ed.onMouseDown.add(c.hideMenu, c); return c; @@ -11806,7 +13879,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { id = t.prefix + id; cls = cc || t._cls.colorsplitbutton || tinymce.ui.ColorSplitButton; - c = new cls(id, s); + c = new cls(id, s, ed); ed.onMouseDown.add(c.hideMenu, c); // Remove the menu element when the editor is removed @@ -11838,13 +13911,25 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { id = t.prefix + id; cls = cc || t._cls.toolbar || tinymce.ui.Toolbar; - c = new cls(id, s); + c = new cls(id, s, t.editor); if (t.get(id)) return null; return t.add(c); }, + + createToolbarGroup : function(id, s, cc) { + var c, t = this, cls; + id = t.prefix + id; + cls = cc || this._cls.toolbarGroup || tinymce.ui.ToolbarGroup; + c = new cls(id, s, t.editor); + + if (t.get(id)) + return null; + + return t.add(c); + }, createSeparator : function(cc) { var cls = cc || this._cls.separator || tinymce.ui.Separator; @@ -11981,53 +14066,6 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { } }); }(tinymce)); -(function(tinymce) { - function CommandManager() { - var execCommands = {}, queryStateCommands = {}, queryValueCommands = {}; - - function add(collection, cmd, func, scope) { - if (typeof(cmd) == 'string') - cmd = [cmd]; - - tinymce.each(cmd, function(cmd) { - collection[cmd.toLowerCase()] = {func : func, scope : scope}; - }); - }; - - tinymce.extend(this, { - add : function(cmd, func, scope) { - add(execCommands, cmd, func, scope); - }, - - addQueryStateHandler : function(cmd, func, scope) { - add(queryStateCommands, cmd, func, scope); - }, - - addQueryValueHandler : function(cmd, func, scope) { - add(queryValueCommands, cmd, func, scope); - }, - - execCommand : function(scope, cmd, ui, value, args) { - if (cmd = execCommands[cmd.toLowerCase()]) { - if (cmd.func.call(scope || cmd.scope, ui, value, args) !== false) - return true; - } - }, - - queryCommandValue : function() { - if (cmd = queryValueCommands[cmd.toLowerCase()]) - return cmd.func.call(scope || cmd.scope, ui, value, args); - }, - - queryCommandState : function() { - if (cmd = queryStateCommands[cmd.toLowerCase()]) - return cmd.func.call(scope || cmd.scope, ui, value, args); - } - }); - }; - - tinymce.GlobalCommands = new CommandManager(); -})(tinymce); (function(tinymce) { tinymce.Formatter = function(ed) { var formats = {}, @@ -12036,7 +14074,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { selection = ed.selection, TreeWalker = tinymce.dom.TreeWalker, rangeUtils = new tinymce.dom.RangeUtils(dom), - isValid = ed.schema.isValid, + isValid = ed.schema.isValidChild, isBlock = dom.isBlock, forcedRootBlock = ed.settings.forced_root_block, nodeIndex = dom.nodeIndex, @@ -12044,8 +14082,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { MCE_ATTR_RE = /^(src|href|style)$/, FALSE = false, TRUE = true, - undefined, - pendingFormats = {apply : [], remove : []}; + undefined; function isArray(obj) { return obj instanceof Array; @@ -12105,8 +14142,31 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { } }; + var getTextDecoration = function(node) { + var decoration; + + ed.dom.getParent(node, function(n) { + decoration = ed.dom.getStyle(n, 'text-decoration'); + return decoration && decoration !== 'none'; + }); + + return decoration; + }; + + var processUnderlineAndColor = function(node) { + var textDecoration; + if (node.nodeType === 1 && node.parentNode && node.parentNode.nodeType === 1) { + textDecoration = getTextDecoration(node.parentNode); + if (ed.dom.getStyle(node, 'color') && textDecoration) { + ed.dom.setStyle(node, 'text-decoration', textDecoration); + } else if (ed.dom.getStyle(node, 'textdecoration') === textDecoration) { + ed.dom.setStyle(node, 'text-decoration', null); + } + } + }; + function apply(name, vars, node) { - var formatList = get(name), format = formatList[0], bookmark, rng, i; + var formatList = get(name), format = formatList[0], bookmark, rng, i, isCollapsed = selection.isCollapsed(); function moveStart(rng) { var container = rng.startContainer, @@ -12136,6 +14196,10 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { fmt = fmt || format; if (elm) { + if (fmt.onformat) { + fmt.onformat(elm, fmt, vars, node); + } + each(fmt.styles, function(value, name) { dom.setStyle(elm, name, replaceVars(value, vars)); }); @@ -12152,8 +14216,89 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { }); } }; + function adjustSelectionToVisibleSelection() { + function findSelectionEnd(start, end) { + var walker = new TreeWalker(end); + for (node = walker.current(); node; node = walker.prev()) { + if (node.childNodes.length > 1 || node == start) { + return node; + } + } + }; + + // Adjust selection so that a end container with a end offset of zero is not included in the selection + // as this isn't visible to the user. + var rng = ed.selection.getRng(); + var start = rng.startContainer; + var end = rng.endContainer; + + if (start != end && rng.endOffset == 0) { + var newEnd = findSelectionEnd(start, end); + var endOffset = newEnd.nodeType == 3 ? newEnd.length : newEnd.childNodes.length; + + rng.setEnd(newEnd, endOffset); + } + + return rng; + } + + function applyStyleToList(node, bookmark, wrapElm, newWrappers, process){ + var nodes = [], listIndex = -1, list, startIndex = -1, endIndex = -1, currentWrapElm; + + // find the index of the first child list. + each(node.childNodes, function(n, index) { + if (n.nodeName === "UL" || n.nodeName === "OL") { + listIndex = index; + list = n; + return false; + } + }); + + // get the index of the bookmarks + each(node.childNodes, function(n, index) { + if (n.nodeName === "SPAN" && dom.getAttrib(n, "data-mce-type") == "bookmark") { + if (n.id == bookmark.id + "_start") { + startIndex = index; + } else if (n.id == bookmark.id + "_end") { + endIndex = index; + } + } + }); + + // if the selection spans across an embedded list, or there isn't an embedded list - handle processing normally + if (listIndex <= 0 || (startIndex < listIndex && endIndex > listIndex)) { + each(tinymce.grep(node.childNodes), process); + return 0; + } else { + currentWrapElm = wrapElm.cloneNode(FALSE); + + // create a list of the nodes on the same side of the list as the selection + each(tinymce.grep(node.childNodes), function(n, index) { + if ((startIndex < listIndex && index < listIndex) || (startIndex > listIndex && index > listIndex)) { + nodes.push(n); + n.parentNode.removeChild(n); + } + }); + + // insert the wrapping element either before or after the list. + if (startIndex < listIndex) { + node.insertBefore(currentWrapElm, list); + } else if (startIndex > listIndex) { + node.insertBefore(currentWrapElm, list.nextSibling); + } + + // add the new nodes to the list. + newWrappers.push(currentWrapElm); + + each(nodes, function(node) { + currentWrapElm.appendChild(node); + }); - function applyRngStyle(rng) { + return currentWrapElm; + } + }; + + function applyRngStyle(rng, bookmark, node_specific) { var newWrappers = [], wrapName, wrapElm; // Setup wrapper element @@ -12197,6 +14342,11 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { if (format.selector) { // Look for matching formats each(formatList, function(format) { + // Check collapsed state if it exists + if ('collapsed' in format && format.collapsed !== isCollapsed) { + return; + } + if (dom.is(node, format.selector) && !isCaretNode(node)) { setElementFormat(node, format); found = true; @@ -12211,7 +14361,8 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { } // Is it valid to wrap this item - if (isValid(wrapName, nodeName) && isValid(parentName, wrapName)) { + if (isValid(wrapName, nodeName) && isValid(parentName, wrapName) && + !(!node_specific && node.nodeType === 3 && node.nodeValue.length === 1 && node.nodeValue.charCodeAt(0) === 65279) && node.id !== '_mce_caret') { // Start wrapping if (!currentWrapElm) { // Wrap the node @@ -12221,6 +14372,9 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { } currentWrapElm.appendChild(node); + } else if (nodeName == 'li' && bookmark) { + // Start wrapping - if we are in a list node and have a bookmark, then we will always begin by wrapping in a new element. + currentWrapElm = applyStyleToList(node, bookmark, wrapElm, newWrappers, process); } else { // Start a new wrapper for possible children currentWrapElm = 0; @@ -12232,9 +14386,33 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { } }; - // Process siblings from range - each(nodes, process); - }); + // Process siblings from range + each(nodes, process); + }); + + // Wrap links inside as well, for example color inside a link when the wrapper is around the link + if (format.wrap_links === false) { + each(newWrappers, function(node) { + function process(node) { + var i, currentWrapElm, children; + + if (node.nodeName === 'A') { + currentWrapElm = wrapElm.cloneNode(FALSE); + newWrappers.push(currentWrapElm); + + children = tinymce.grep(node.childNodes); + for (i = 0; i < children.length; i++) + currentWrapElm.appendChild(children[i]); + + node.appendChild(currentWrapElm); + } + + each(tinymce.grep(node.childNodes), process); + }; + + process(node); + }); + } // Cleanup each(newWrappers, function(node) { @@ -12275,8 +14453,9 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { childCount = getChildCount(node); - // Remove empty nodes - if (childCount === 0) { + // Remove empty nodes but only if there is multiple wrappers and they are not block + // elements so never remove single

    since that would remove the currrent empty block element where the caret is at + if ((newWrappers.length > 1 || !isBlock(node)) && childCount === 0) { dom.remove(node, 1); return; } @@ -12292,6 +14471,19 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { // this: text // will become: text each(dom.select(format.inline, node), function(child) { + var parent; + + // When wrap_links is set to false we don't want + // to remove the format on children within links + if (format.wrap_links === false) { + parent = child.parentNode; + + do { + if (parent.nodeName === 'A') + return; + } while (parent = parent.parentNode); + } + removeFormat(format, vars, child, format.exact ? child : null); }); }); @@ -12315,7 +14507,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { } // Merge next and previous siblings if they are similar texttext becomes texttext - if (node) { + if (node && format.merge_siblings !== false) { node = mergeSiblings(getNonWhiteSpaceSibling(node), node); node = mergeSiblings(node, getNonWhiteSpaceSibling(node, TRUE)); } @@ -12325,17 +14517,29 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { if (format) { if (node) { - rng = dom.createRng(); - - rng.setStartBefore(node); - rng.setEndAfter(node); - - applyRngStyle(expandRng(rng, formatList)); + if (node.nodeType) { + rng = dom.createRng(); + rng.setStartBefore(node); + rng.setEndAfter(node); + applyRngStyle(expandRng(rng, formatList), null, true); + } else { + applyRngStyle(node, null, true); + } } else { - if (!selection.isCollapsed() || !format.inline) { + if (!isCollapsed || !format.inline || dom.select('td.mceSelected,th.mceSelected').length) { + // Obtain selection node before selection is unselected by applyRngStyle() + var curSelNode = ed.selection.getNode(); + // Apply formatting to selection + ed.selection.setRng(adjustSelectionToVisibleSelection()); bookmark = selection.getBookmark(); - applyRngStyle(expandRng(selection.getRng(TRUE), formatList)); + applyRngStyle(expandRng(selection.getRng(TRUE), formatList), bookmark); + + // Colored nodes should be underlined so that the color of the underline matches the text color. + if (format.styles && (format.styles.color || format.styles.textDecoration)) { + tinymce.walk(curSelNode, processUnderlineAndColor, 'childNodes'); + processUnderlineAndColor(curSelNode); + } selection.moveToBookmark(bookmark); selection.setRng(moveStart(selection.getRng(TRUE))); @@ -12348,6 +14552,44 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { function remove(name, vars, node) { var formatList = get(name), format = formatList[0], bookmark, i, rng; + function moveStart(rng) { + var container = rng.startContainer, + offset = rng.startOffset, + walker, node, nodes, tmpNode; + + // Convert text node into index if possible + if (container.nodeType == 3 && offset >= container.nodeValue.length - 1) { + container = container.parentNode; + offset = nodeIndex(container) + 1; + } + + // Move startContainer/startOffset in to a suitable node + if (container.nodeType == 1) { + nodes = container.childNodes; + container = nodes[Math.min(offset, nodes.length - 1)]; + walker = new TreeWalker(container); + + // If offset is at end of the parent node walk to the next one + if (offset > nodes.length - 1) + walker.next(); + + for (node = walker.current(); node; node = walker.next()) { + if (node.nodeType == 3 && !isWhiteSpaceNode(node)) { + // IE has a "neat" feature where it moves the start node into the closest element + // we can avoid this by inserting an element before it and then remove it after we set the selection + tmpNode = dom.create('a', null, INVISIBLE_CHAR); + node.parentNode.insertBefore(tmpNode, node); + + // Set selection and remove tmpNode + rng.setStart(node, 0); + selection.setRng(rng); + dom.remove(tmpNode); + + return; + } + } + } + }; // Merges the styles for each node function process(node) { @@ -12461,8 +14703,8 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { if (startContainer != endContainer) { // Wrap start/end nodes in span element since these might be cloned/moved - startContainer = wrap(startContainer, 'span', {id : '_start', _mce_type : 'bookmark'}); - endContainer = wrap(endContainer, 'span', {id : '_end', _mce_type : 'bookmark'}); + startContainer = wrap(startContainer, 'span', {id : '_start', 'data-mce-type' : 'bookmark'}); + endContainer = wrap(endContainer, 'span', {id : '_end', 'data-mce-type' : 'bookmark'}); // Split start/end splitToFormatRoot(startContainer); @@ -12485,30 +14727,53 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { rangeUtils.walk(rng, function(nodes) { each(nodes, function(node) { process(node); + + // Remove parent span if it only contains text-decoration: underline, yet a parent node is also underlined. + if (node.nodeType === 1 && ed.dom.getStyle(node, 'text-decoration') === 'underline' && node.parentNode && getTextDecoration(node.parentNode) === 'underline') { + removeFormat({'deep': false, 'exact': true, 'inline': 'span', 'styles': {'textDecoration' : 'underline'}}, null, node); + } }); }); }; // Handle node if (node) { - rng = dom.createRng(); - rng.setStartBefore(node); - rng.setEndAfter(node); - removeRngStyle(rng); + if (node.nodeType) { + rng = dom.createRng(); + rng.setStartBefore(node); + rng.setEndAfter(node); + removeRngStyle(rng); + } else { + removeRngStyle(node); + } + return; } - if (!selection.isCollapsed() || !format.inline) { + if (!selection.isCollapsed() || !format.inline || dom.select('td.mceSelected,th.mceSelected').length) { bookmark = selection.getBookmark(); removeRngStyle(selection.getRng(TRUE)); selection.moveToBookmark(bookmark); + + // Check if start element still has formatting then we are at: "text|text" and need to move the start into the next text node + if (format.inline && match(name, vars, selection.getStart())) { + moveStart(selection.getRng(true)); + } + ed.nodeChanged(); } else performCaretAction('remove', name, vars); + + // When you remove formatting from a table cell in WebKit (cell, not the contents of a cell) there is a rendering issue with column width + if (tinymce.isWebKit) { + ed.execCommand('mceCleanup'); + } }; function toggle(name, vars, node) { - if (match(name, vars, node)) + var fmt = get(name); + + if (match(name, vars, node) && (!('toggle' in fmt[0]) || fmt[0]['toggle'])) remove(name, vars, node); else apply(name, vars, node); @@ -12520,6 +14785,11 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { function matchItems(node, format, item_name) { var key, value, items = format[item_name], i; + // Custom match + if (format.onmatch) { + return format.onmatch(node, format, item_name); + } + // Check all items if (items) { // Non indexed object @@ -12572,7 +14842,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { }; function match(name, vars, node) { - var startNode, i; + var startNode; function matchParents(node) { // Find first node with similar format settings @@ -12588,21 +14858,6 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { if (node) return matchParents(node); - // Check pending formats - if (selection.isCollapsed()) { - for (i = pendingFormats.apply.length - 1; i >= 0; i--) { - if (pendingFormats.apply[i].name == name) - return true; - } - - for (i = pendingFormats.remove.length - 1; i >= 0; i--) { - if (pendingFormats.remove[i].name == name) - return false; - } - - return matchParents(selection.getNode()); - } - // Check selected node node = selection.getNode(); if (matchParents(node)) @@ -12621,33 +14876,6 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { function matchAll(names, vars) { var startElement, matchedFormatNames = [], checkedMap = {}, i, ni, name; - // If the selection is collapsed then check pending formats - if (selection.isCollapsed()) { - for (ni = 0; ni < names.length; ni++) { - // If the name is to be removed, then stop it from being added - for (i = pendingFormats.remove.length - 1; i >= 0; i--) { - name = names[ni]; - - if (pendingFormats.remove[i].name == name) { - checkedMap[name] = true; - break; - } - } - } - - // If the format is to be applied - for (i = pendingFormats.apply.length - 1; i >= 0; i--) { - for (ni = 0; ni < names.length; ni++) { - name = names[ni]; - - if (!checkedMap[name] && pendingFormats.apply[i].name == name) { - checkedMap[name] = true; - matchedFormatNames.push(name); - } - } - } - } - // Check start of selection for formats startElement = selection.getStart(); dom.getParent(startElement, function(node) { @@ -12756,7 +14984,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { }; function isWhiteSpaceNode(node) { - return node && node.nodeType === 3 && /^([\s\r\n]+|)$/.test(node.nodeValue); + return node && node.nodeType === 3 && /^([\t \r\n]+|)$/.test(node.nodeValue); }; function wrap(node, name, attrs) { @@ -12772,36 +15000,55 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { var startContainer = rng.startContainer, startOffset = rng.startOffset, endContainer = rng.endContainer, - endOffset = rng.endOffset, sibling, lastIdx; + endOffset = rng.endOffset, sibling, lastIdx, leaf, endPoint; // This function walks up the tree if there is no siblings before/after the node - function findParentContainer(container, child_name, sibling_name, root) { - var parent, child; + function findParentContainer(start) { + var container, parent, child, sibling, siblingName; - root = root || dom.getRoot(); + container = parent = start ? startContainer : endContainer; + siblingName = start ? 'previousSibling' : 'nextSibling'; + root = dom.getRoot(); - for (;;) { - // Check if we can move up are we at root level or body level - parent = container.parentNode; + // If it's a text node and the offset is inside the text + if (container.nodeType == 3 && !isWhiteSpaceNode(container)) { + if (start ? startOffset > 0 : endOffset < container.nodeValue.length) { + return container; + } + } + for (;;) { // Stop expanding on block elements or root depending on format if (parent == root || (!format[0].block_expand && isBlock(parent))) - return container; - - for (sibling = parent[child_name]; sibling && sibling != container; sibling = sibling[sibling_name]) { - if (sibling.nodeType == 1 && !isBookmarkNode(sibling)) - return container; + return parent; - if (sibling.nodeType == 3 && !isWhiteSpaceNode(sibling)) - return container; + // Walk left/right + for (sibling = parent[siblingName]; sibling; sibling = sibling[siblingName]) { + if (!isBookmarkNode(sibling) && !isWhiteSpaceNode(sibling)) { + return parent; + } } - container = container.parentNode; + // Check if we can move up are we at root level or body level + parent = parent.parentNode; } return container; }; + // This function walks down the tree to find the leaf at the selection. + // The offset is also returned as if node initially a leaf, the offset may be in the middle of the text node. + function findLeaf(node, offset) { + if (offset === undefined) + offset = node.nodeType === 3 ? node.length : node.childNodes.length; + while (node && node.hasChildNodes()) { + node = node.childNodes[offset]; + if (node) + offset = node.nodeType === 3 ? node.length : node.childNodes.length; + } + return { node: node, offset: offset }; + } + // If index based start position then resolve it if (startContainer.nodeType == 1 && startContainer.hasChildNodes()) { lastIdx = startContainer.childNodes.length - 1; @@ -12821,31 +15068,141 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { } // Exclude bookmark nodes if possible - if (isBookmarkNode(startContainer.parentNode)) - startContainer = startContainer.parentNode; - - if (isBookmarkNode(startContainer)) + if (isBookmarkNode(startContainer.parentNode) || isBookmarkNode(startContainer)) { + startContainer = isBookmarkNode(startContainer) ? startContainer : startContainer.parentNode; startContainer = startContainer.nextSibling || startContainer; - if (isBookmarkNode(endContainer.parentNode)) - endContainer = endContainer.parentNode; + if (startContainer.nodeType == 3) + startOffset = 0; + } - if (isBookmarkNode(endContainer)) + if (isBookmarkNode(endContainer.parentNode) || isBookmarkNode(endContainer)) { + endContainer = isBookmarkNode(endContainer) ? endContainer : endContainer.parentNode; endContainer = endContainer.previousSibling || endContainer; + if (endContainer.nodeType == 3) + endOffset = endContainer.length; + } + + if (format[0].inline) { + if (rng.collapsed) { + function findWordEndPoint(container, offset, start) { + var walker, node, pos, lastTextNode; + + function findSpace(node, offset) { + var pos, pos2, str = node.nodeValue; + + if (typeof(offset) == "undefined") { + offset = start ? str.length : 0; + } + + if (start) { + pos = str.lastIndexOf(' ', offset); + pos2 = str.lastIndexOf('\u00a0', offset); + pos = pos > pos2 ? pos : pos2; + + // Include the space on remove to avoid tag soup + if (pos !== -1 && !remove) { + pos++; + } + } else { + pos = str.indexOf(' ', offset); + pos2 = str.indexOf('\u00a0', offset); + pos = pos !== -1 && (pos2 === -1 || pos < pos2) ? pos : pos2; + } + + return pos; + }; + + if (container.nodeType === 3) { + pos = findSpace(container, offset); + + if (pos !== -1) { + return {container : container, offset : pos}; + } + + lastTextNode = container; + } + + // Walk the nodes inside the block + walker = new TreeWalker(container, dom.getParent(container, isBlock) || ed.getBody()); + while (node = walker[start ? 'prev' : 'next']()) { + if (node.nodeType === 3) { + lastTextNode = node; + pos = findSpace(node); + + if (pos !== -1) { + return {container : node, offset : pos}; + } + } else if (isBlock(node)) { + break; + } + } + + if (lastTextNode) { + if (start) { + offset = 0; + } else { + offset = lastTextNode.length; + } + + return {container: lastTextNode, offset: offset}; + } + } + + // Expand left to closest word boundery + endPoint = findWordEndPoint(startContainer, startOffset, true); + if (endPoint) { + startContainer = endPoint.container; + startOffset = endPoint.offset; + } + + // Expand right to closest word boundery + endPoint = findWordEndPoint(endContainer, endOffset); + if (endPoint) { + endContainer = endPoint.container; + endOffset = endPoint.offset; + } + } + + // Avoid applying formatting to a trailing space. + leaf = findLeaf(endContainer, endOffset); + if (leaf.node) { + while (leaf.node && leaf.offset === 0 && leaf.node.previousSibling) + leaf = findLeaf(leaf.node.previousSibling); + + if (leaf.node && leaf.offset > 0 && leaf.node.nodeType === 3 && + leaf.node.nodeValue.charAt(leaf.offset - 1) === ' ') { + + if (leaf.offset > 1) { + endContainer = leaf.node; + endContainer.splitText(leaf.offset - 1); + } else if (leaf.node.previousSibling) { + // TODO: Figure out why this is in here + //endContainer = leaf.node.previousSibling; + } + } + } + } + // Move start/end point up the tree if the leaves are sharp and if we are in different containers // Example * becomes !: !

    *texttext*

    ! // This will reduce the number of wrapper elements that needs to be created // Move start point up the tree if (format[0].inline || format[0].block_expand) { - startContainer = findParentContainer(startContainer, 'firstChild', 'nextSibling'); - endContainer = findParentContainer(endContainer, 'lastChild', 'previousSibling'); + if (!format[0].inline || (startContainer.nodeType != 3 || startOffset === 0)) { + startContainer = findParentContainer(true); + } + + if (!format[0].inline || (endContainer.nodeType != 3 || endOffset === endContainer.nodeValue.length)) { + endContainer = findParentContainer(); + } } // Expand start/end container to matching selector if (format[0].selector && format[0].expand !== FALSE && !format[0].inline) { function findSelectorEndPoint(container, sibling_name) { - var parents, i, y; + var parents, i, y, curFormat; if (container.nodeType == 3 && container.nodeValue.length == 0 && container[sibling_name]) container = container[sibling_name]; @@ -12853,7 +15210,13 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { parents = getParents(container); for (i = 0; i < parents.length; i++) { for (y = 0; y < format.length; y++) { - if (dom.is(parents[i], format[y].selector)) + curFormat = format[y]; + + // If collapsed state is set then skip formats that doesn't match that + if ("collapsed" in curFormat && curFormat.collapsed !== rng.collapsed) + continue; + + if (dom.is(parents[i], curFormat.selector)) return parents[i]; } } @@ -12907,10 +15270,10 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { // Non block element then try to expand up the leaf if (format[0].block) { if (!isBlock(startContainer)) - startContainer = findParentContainer(startContainer, 'firstChild', 'nextSibling'); + startContainer = findParentContainer(true); if (!isBlock(endContainer)) - endContainer = findParentContainer(endContainer, 'lastChild', 'previousSibling'); + endContainer = findParentContainer(); } } @@ -12963,7 +15326,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { // Remove style attribute if it's empty if (stylesModified && dom.getAttrib(node, 'style') == '') { node.removeAttribute('style'); - node.removeAttribute('_mce_style'); + node.removeAttribute('data-mce-style'); } // Remove attributes @@ -13004,7 +15367,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { // Remove mce prefixed attributes if (MCE_ATTR_RE.test(name)) - node.removeAttribute('_mce_' + name); + node.removeAttribute('data-mce-' + name); node.removeAttribute(name); } @@ -13089,7 +15452,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { }; function isBookmarkNode(node) { - return node && node.nodeType == 1 && node.getAttribute('_mce_type') == 'bookmark'; + return node && node.nodeType == 1 && node.getAttribute('data-mce-type') == 'bookmark'; }; function mergeSiblings(prev, next) { @@ -13160,7 +15523,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { if (prev && next) { function findElementSibling(node, sibling_name) { for (sibling = node; sibling; sibling = sibling[sibling_name]) { - if (sibling.nodeType == 3 && !isWhiteSpaceNode(sibling)) + if (sibling.nodeType == 3 && sibling.nodeValue.length !== 0) return node; if (sibling.nodeType == 1 && !isBookmarkNode(sibling)) @@ -13203,7 +15566,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { }; function getContainer(rng, start) { - var container, offset, lastIdx; + var container, offset, lastIdx, walker; container = rng[start ? 'startContainer' : 'endContainer']; offset = rng[start ? 'startOffset' : 'endOffset']; @@ -13217,103 +15580,267 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { container = container.childNodes[offset > lastIdx ? lastIdx : offset]; } + // If start text node is excluded then walk to the next node + if (container.nodeType === 3 && start && offset >= container.nodeValue.length) { + container = new TreeWalker(container, ed.getBody()).next() || container; + } + + // If end text node is excluded then walk to the previous node + if (container.nodeType === 3 && !start && offset == 0) { + container = new TreeWalker(container, ed.getBody()).prev() || container; + } + return container; }; function performCaretAction(type, name, vars) { - var i, currentPendingFormats = pendingFormats[type], - otherPendingFormats = pendingFormats[type == 'apply' ? 'remove' : 'apply']; + var invisibleChar, caretContainerId = '_mce_caret', debug = ed.settings.caret_debug; + + // Setup invisible character use zero width space on Gecko since it doesn't change the heigt of the container + invisibleChar = tinymce.isGecko ? '\u200B' : INVISIBLE_CHAR; + + // Creates a caret container bogus element + function createCaretContainer(fill) { + var caretContainer = dom.create('span', {id: caretContainerId, 'data-mce-bogus': true, style: debug ? 'color:red' : ''}); + + if (fill) { + caretContainer.appendChild(ed.getDoc().createTextNode(invisibleChar)); + } + + return caretContainer; + }; + + function isCaretContainerEmpty(node, nodes) { + while (node) { + if ((node.nodeType === 3 && node.nodeValue !== invisibleChar) || node.childNodes.length > 1) { + return false; + } + + // Collect nodes + if (nodes && node.nodeType === 1) { + nodes.push(node); + } - function hasPending() { - return pendingFormats.apply.length || pendingFormats.remove.length; + node = node.firstChild; + } + + return true; }; + + // Returns any parent caret container element + function getParentCaretContainer(node) { + while (node) { + if (node.id === caretContainerId) { + return node; + } - function resetPending() { - pendingFormats.apply = []; - pendingFormats.remove = []; + node = node.parentNode; + } }; - function perform(caret_node) { - // Apply pending formats - each(pendingFormats.apply.reverse(), function(item) { - apply(item.name, item.vars, caret_node); - }); + // Finds the first text node in the specified node + function findFirstTextNode(node) { + var walker; - // Remove pending formats - each(pendingFormats.remove.reverse(), function(item) { - remove(item.name, item.vars, caret_node); - }); + if (node) { + walker = new TreeWalker(node, node); + + for (node = walker.current(); node; node = walker.next()) { + if (node.nodeType === 3) { + return node; + } + } + } + }; + + // Removes the caret container for the specified node or all on the current document + function removeCaretContainer(node, move_caret) { + var child, rng; + + if (!node) { + node = getParentCaretContainer(selection.getStart()); + + if (!node) { + while (node = dom.get(caretContainerId)) { + removeCaretContainer(node, false); + } + } + } else { + rng = selection.getRng(true); + + if (isCaretContainerEmpty(node)) { + if (move_caret !== false) { + rng.setStartBefore(node); + rng.setEndBefore(node); + } + + dom.remove(node); + } else { + child = findFirstTextNode(node); + child = child.deleteData(0, 1); + dom.remove(node, 1); + } + + selection.setRng(rng); + } + }; + + // Applies formatting to the caret postion + function applyCaretFormat() { + var rng, caretContainer, textNode, offset, bookmark, container, text; + + rng = selection.getRng(true); + offset = rng.startOffset; + container = rng.startContainer; + text = container.nodeValue; + + caretContainer = getParentCaretContainer(selection.getStart()); + if (caretContainer) { + textNode = findFirstTextNode(caretContainer); + } + + // Expand to word is caret is in the middle of a text node and the char before/after is a alpha numeric character + if (text && offset > 0 && offset < text.length && /\w/.test(text.charAt(offset)) && /\w/.test(text.charAt(offset - 1))) { + // Get bookmark of caret position + bookmark = selection.getBookmark(); + + // Collapse bookmark range (WebKit) + rng.collapse(true); + + // Expand the range to the closest word and split it at those points + rng = expandRng(rng, get(name)); + rng = rangeUtils.split(rng); + + // Apply the format to the range + apply(name, vars, rng); + + // Move selection back to caret position + selection.moveToBookmark(bookmark); + } else { + if (!caretContainer || textNode.nodeValue !== invisibleChar) { + caretContainer = createCaretContainer(true); + textNode = caretContainer.firstChild; + + rng.insertNode(caretContainer); + offset = 1; + + apply(name, vars, caretContainer); + } else { + apply(name, vars, caretContainer); + } - dom.remove(caret_node, 1); - resetPending(); + // Move selection to text node + selection.setCursorLocation(textNode, offset); + } }; - // Check if it already exists then ignore it - for (i = currentPendingFormats.length - 1; i >= 0; i--) { - if (currentPendingFormats[i].name == name) + function removeCaretFormat() { + var rng = selection.getRng(true), container, offset, bookmark, + hasContentAfter, node, formatNode, parents = [], i, caretContainer; + + container = rng.startContainer; + offset = rng.startOffset; + node = container; + + if (container.nodeType == 3) { + if (offset != container.nodeValue.length || container.nodeValue === invisibleChar) { + hasContentAfter = true; + } + + node = node.parentNode; + } + + while (node) { + if (matchNode(node, name, vars)) { + formatNode = node; + break; + } + + if (node.nextSibling) { + hasContentAfter = true; + } + + parents.push(node); + node = node.parentNode; + } + + // Node doesn't have the specified format + if (!formatNode) { return; - } + } - currentPendingFormats.push({name : name, vars : vars}); + // Is there contents after the caret then remove the format on the element + if (hasContentAfter) { + // Get bookmark of caret position + bookmark = selection.getBookmark(); - // Check if it's in the other type, then remove it - for (i = otherPendingFormats.length - 1; i >= 0; i--) { - if (otherPendingFormats[i].name == name) - otherPendingFormats.splice(i, 1); - } + // Collapse bookmark range (WebKit) + rng.collapse(true); - // Pending apply or remove formats - if (hasPending()) { - ed.getDoc().execCommand('FontName', false, 'mceinline'); - pendingFormats.lastRng = selection.getRng(); + // Expand the range to the closest word and split it at those points + rng = expandRng(rng, get(name), true); + rng = rangeUtils.split(rng); - // IE will convert the current word - each(dom.select('font,span'), function(node) { - var bookmark; + // Remove the format from the range + remove(name, vars, rng); - if (isCaretNode(node)) { - bookmark = selection.getBookmark(); - perform(node); - selection.moveToBookmark(bookmark); - ed.nodeChanged(); + // Move selection back to caret position + selection.moveToBookmark(bookmark); + } else { + caretContainer = createCaretContainer(); + + node = caretContainer; + for (i = parents.length - 1; i >= 0; i--) { + node.appendChild(parents[i].cloneNode(false)); + node = node.firstChild; + } + + // Insert invisible character into inner most format element + node.appendChild(dom.doc.createTextNode(invisibleChar)); + node = node.firstChild; + + // Insert caret container after the formated node + dom.insertAfter(caretContainer, formatNode); + + // Move selection to text node + selection.setCursorLocation(node, 1); + } + }; + + // Mark current caret container elements as bogus when getting the contents so we don't end up with empty elements + ed.onBeforeGetContent.addToTop(function() { + var nodes = [], i; + + if (isCaretContainerEmpty(getParentCaretContainer(selection.getStart()), nodes)) { + // Mark children + i = nodes.length; + while (i--) { + dom.setAttrib(nodes[i], 'data-mce-bogus', '1'); } + } + }); + + // Remove caret container on mouse up and on key up + tinymce.each('onMouseUp onKeyUp'.split(' '), function(name) { + ed[name].addToTop(function() { + removeCaretContainer(); }); + }); - // Only register listeners once if we need to - if (!pendingFormats.isListening && hasPending()) { - pendingFormats.isListening = true; - - each('onKeyDown,onKeyUp,onKeyPress,onMouseUp'.split(','), function(event) { - ed[event].addToTop(function(ed, e) { - // Do we have pending formats and is the selection moved has moved - if (hasPending() && !tinymce.dom.RangeUtils.compareRanges(pendingFormats.lastRng, selection.getRng())) { - each(dom.select('font,span'), function(node) { - var textNode, rng; - - // Look for marker - if (isCaretNode(node)) { - textNode = node.firstChild; - - if (textNode) { - perform(node); - - rng = dom.createRng(); - rng.setStart(textNode, textNode.nodeValue.length); - rng.setEnd(textNode, textNode.nodeValue.length); - selection.setRng(rng); - ed.nodeChanged(); - } else - dom.remove(node); - } - }); + // Remove caret container on keydown and it's a backspace, enter or left/right arrow keys + ed.onKeyDown.addToTop(function(ed, e) { + var keyCode = e.keyCode; - // Always unbind and clear pending styles on keyup - if (e.type == 'keyup' || e.type == 'mouseup') - resetPending(); - } - }); - }); + if (keyCode == 8 || keyCode == 37 || keyCode == 39) { + removeCaretContainer(getParentCaretContainer(selection.getStart())); } + }); + + // Do apply or remove caret format + if (type == "apply") { + applyCaretFormat(); + } else { + removeCaretFormat(); } }; }; @@ -13323,12 +15850,15 @@ tinymce.onAddEditor.add(function(tinymce, ed) { var filters, fontSizes, dom, settings = ed.settings; if (settings.inline_styles) { - fontSizes = tinymce.explode(settings.font_size_style_values); + fontSizes = tinymce.explode(settings.font_size_legacy_values); function replaceWithSpan(node, styles) { - dom.replace(dom.create('span', { - style : styles - }), node, 1); + tinymce.each(styles, function(value, name) { + if (value) + dom.setStyle(node, name, value); + }); + + dom.rename(node, 'span'); }; filters = { @@ -13365,6 +15895,7 @@ tinymce.onAddEditor.add(function(tinymce, ed) { }; ed.onPreProcess.add(convert); + ed.onSetContent.add(convert); ed.onInit.add(function() { ed.selection.onSetContent.add(convert); diff --git a/js/tiny_mce/tiny_mce_popup.js b/js/tiny_mce/tiny_mce_popup.js index 3ef3acb1fd..f859d24e6a 100644 --- a/js/tiny_mce/tiny_mce_popup.js +++ b/js/tiny_mce/tiny_mce_popup.js @@ -2,4 +2,4 @@ // Uncomment and change this document.domain value if you are loading the script cross subdomains // document.domain = 'moxiecode.com'; -var tinymce=null,tinyMCEPopup,tinyMCE;tinyMCEPopup={init:function(){var b=this,a,c;a=b.getWin();tinymce=a.tinymce;tinyMCE=a.tinyMCE;b.editor=tinymce.EditorManager.activeEditor;b.params=b.editor.windowManager.params;b.features=b.editor.windowManager.features;b.dom=b.editor.windowManager.createInstance("tinymce.dom.DOMUtils",document);if(b.features.popup_css!==false){b.dom.loadCSS(b.features.popup_css||b.editor.settings.popup_css)}b.listeners=[];b.onInit={add:function(e,d){b.listeners.push({func:e,scope:d})}};b.isWindow=!b.getWindowArg("mce_inline");b.id=b.getWindowArg("mce_window_id");b.editor.windowManager.onOpen.dispatch(b.editor.windowManager,window)},getWin:function(){return(!window.frameElement&&window.dialogArguments)||opener||parent||top},getWindowArg:function(c,b){var a=this.params[c];return tinymce.is(a)?a:b},getParam:function(b,a){return this.editor.getParam(b,a)},getLang:function(b,a){return this.editor.getLang(b,a)},execCommand:function(d,c,e,b){b=b||{};b.skip_focus=1;this.restoreSelection();return this.editor.execCommand(d,c,e,b)},resizeToInnerSize:function(){var a=this;setTimeout(function(){var b=a.dom.getViewPort(window);a.editor.windowManager.resizeBy(a.getWindowArg("mce_width")-b.w,a.getWindowArg("mce_height")-b.h,a.id||window)},0)},executeOnLoad:function(s){this.onInit.add(function(){eval(s)})},storeSelection:function(){this.editor.windowManager.bookmark=tinyMCEPopup.editor.selection.getBookmark(1)},restoreSelection:function(){var a=tinyMCEPopup;if(!a.isWindow&&tinymce.isIE){a.editor.selection.moveToBookmark(a.editor.windowManager.bookmark)}},requireLangPack:function(){var b=this,a=b.getWindowArg("plugin_url")||b.getWindowArg("theme_url");if(a&&b.editor.settings.language&&b.features.translate_i18n!==false){a+="/langs/"+b.editor.settings.language+"_dlg.js";if(!tinymce.ScriptLoader.isDone(a)){document.write(''; + // Load the CSS by injecting them into the HTML this will reduce "flicker" + for (i = 0; i < t.contentCSS.length; i++) { + t.iframeHTML += ''; + } bi = s.body_id || 'tinymce'; if (bi.indexOf('=') != -1) { @@ -9594,33 +11610,35 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { bc = bc[t.id] || ''; } - t.iframeHTML += ''; + t.iframeHTML += '
    '; // Domain relaxing enabled, then set document domain - if (tinymce.relaxedDomain) { + if (tinymce.relaxedDomain && (isIE || (tinymce.isOpera && parseFloat(opera.version()) < 11))) { // We need to write the contents here in IE since multiple writes messes up refresh button and back button - if (isIE || (tinymce.isOpera && parseFloat(opera.version()) >= 9.5)) - u = 'javascript:(function(){document.open();document.domain="' + document.domain + '";var ed = window.parent.tinyMCE.get("' + t.id + '");document.write(ed.iframeHTML);document.close();ed.setupIframe();})()'; - else if (tinymce.isOpera) - u = 'javascript:(function(){document.open();document.domain="' + document.domain + '";document.close();ed.setupIframe();})()'; + u = 'javascript:(function(){document.open();document.domain="' + document.domain + '";var ed = window.parent.tinyMCE.get("' + t.id + '");document.write(ed.iframeHTML);document.close();ed.setupIframe();})()'; } // Create iframe - n = DOM.add(o.iframeContainer, 'iframe', { + // TODO: ACC add the appropriate description on this. + n = DOM.add(o.iframeContainer, 'iframe', { id : t.id + "_ifr", src : u || 'javascript:""', // Workaround for HTTPS warning in IE6/7 frameBorder : '0', + allowTransparency : "true", + title : s.aria_label, style : { width : '100%', - height : h + height : h, + display : 'block' // Important for Gecko to render the iframe correctly } }); t.contentAreaContainer = o.iframeContainer; DOM.get(o.editorContainer).style.display = t.orgDisplay; DOM.get(t.id).style.display = 'none'; + DOM.setAttrib(t.id, 'aria-hidden', true); - if (!isIE || !tinymce.relaxedDomain) + if (!tinymce.relaxedDomain || !u) t.setupIframe(); e = n = o = null; // Cleanup @@ -9634,30 +11652,21 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { d.open(); d.write(t.iframeHTML); d.close(); - } - // Design mode needs to be added here Ctrl+A will fail otherwise - if (!isIE) { - try { - if (!s.readonly) - d.designMode = 'On'; - } catch (ex) { - // Will fail on Gecko if the editor is placed in an hidden container element - // The design mode will be set ones the editor is focused - } + if (tinymce.relaxedDomain) + d.domain = tinymce.relaxedDomain; } - // IE needs to use contentEditable or it will display non secure items for HTTPS - if (isIE) { - // It will not steal focus if we hide it while setting contentEditable - b = t.getBody(); - DOM.hide(b); + // It will not steal focus while setting contentEditable + b = t.getBody(); + b.disabled = true; - if (!s.readonly) - b.contentEditable = true; + if (!s.readonly) + b.contentEditable = true; - DOM.show(b); - } + b.disabled = false; + + t.schema = new tinymce.html.Schema(s); t.dom = new tinymce.dom.DOMUtils(t.getDoc(), { keep_values : true, @@ -9667,16 +11676,85 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { class_filter : s.class_filter, update_styles : 1, fix_ie_paragraphs : 1, - valid_styles : s.valid_styles + schema : t.schema }); - t.schema = new tinymce.dom.Schema(); + t.parser = new tinymce.html.DomParser(s, t.schema); - t.serializer = new tinymce.dom.Serializer(extend(s, { - valid_elements : s.verify_html === false ? '*[*]' : s.valid_elements, - dom : t.dom, - schema : t.schema - })); + // Force anchor names closed, unless the setting "allow_html_in_named_anchor" is explicitly included. + if (!t.settings.allow_html_in_named_anchor) { + t.parser.addAttributeFilter('name', function(nodes, name) { + var i = nodes.length, sibling, prevSibling, parent, node; + + while (i--) { + node = nodes[i]; + if (node.name === 'a' && node.firstChild) { + parent = node.parent; + + // Move children after current node + sibling = node.lastChild; + do { + prevSibling = sibling.prev; + parent.insert(sibling, node); + sibling = prevSibling; + } while (sibling); + } + } + }); + } + + // Convert src and href into data-mce-src, data-mce-href and data-mce-style + t.parser.addAttributeFilter('src,href,style', function(nodes, name) { + var i = nodes.length, node, dom = t.dom, value, internalName; + + while (i--) { + node = nodes[i]; + value = node.attr(name); + internalName = 'data-mce-' + name; + + // Add internal attribute if we need to we don't on a refresh of the document + if (!node.attributes.map[internalName]) { + if (name === "style") + node.attr(internalName, dom.serializeStyle(dom.parseStyle(value), node.name)); + else + node.attr(internalName, t.convertURL(value, name, node.name)); + } + } + }); + + // Keep scripts from executing + t.parser.addNodeFilter('script', function(nodes, name) { + var i = nodes.length, node; + + while (i--) { + node = nodes[i]; + node.attr('type', 'mce-' + (node.attr('type') || 'text/javascript')); + } + }); + + t.parser.addNodeFilter('#cdata', function(nodes, name) { + var i = nodes.length, node; + + while (i--) { + node = nodes[i]; + node.type = 8; + node.name = '#comment'; + node.value = '[CDATA[' + node.value + ']]'; + } + }); + + t.parser.addNodeFilter('p,h1,h2,h3,h4,h5,h6,div', function(nodes, name) { + var i = nodes.length, node, nonEmptyElements = t.schema.getNonEmptyElements(); + + while (i--) { + node = nodes[i]; + + if (node.isEmpty(nonEmptyElements)) + node.empty().append(new tinymce.html.Node('br', 1)).shortEnded = true; + } + }); + + t.serializer = new tinymce.dom.Serializer(s, t.dom, t.schema); t.selection = new tinymce.dom.Selection(t.dom, t.getWin(), t.serializer); @@ -9686,18 +11764,18 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { t.formatter.register({ alignleft : [ {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'left'}}, - {selector : 'img,table', styles : {'float' : 'left'}} + {selector : 'img,table', collapsed : false, styles : {'float' : 'left'}} ], aligncenter : [ {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'center'}}, - {selector : 'img', styles : {display : 'block', marginLeft : 'auto', marginRight : 'auto'}}, - {selector : 'table', styles : {marginLeft : 'auto', marginRight : 'auto'}} + {selector : 'img', collapsed : false, styles : {display : 'block', marginLeft : 'auto', marginRight : 'auto'}}, + {selector : 'table', collapsed : false, styles : {marginLeft : 'auto', marginRight : 'auto'}} ], alignright : [ {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'right'}}, - {selector : 'img,table', styles : {'float' : 'right'}} + {selector : 'img,table', collapsed : false, styles : {'float' : 'right'}} ], alignfull : [ @@ -9705,33 +11783,47 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { ], bold : [ - {inline : 'strong'}, + {inline : 'strong', remove : 'all'}, {inline : 'span', styles : {fontWeight : 'bold'}}, - {inline : 'b'} + {inline : 'b', remove : 'all'} ], italic : [ - {inline : 'em'}, + {inline : 'em', remove : 'all'}, {inline : 'span', styles : {fontStyle : 'italic'}}, - {inline : 'i'} + {inline : 'i', remove : 'all'} ], underline : [ {inline : 'span', styles : {textDecoration : 'underline'}, exact : true}, - {inline : 'u'} + {inline : 'u', remove : 'all'} ], strikethrough : [ {inline : 'span', styles : {textDecoration : 'line-through'}, exact : true}, - {inline : 'u'} + {inline : 'strike', remove : 'all'} ], - forecolor : {inline : 'span', styles : {color : '%value'}}, - hilitecolor : {inline : 'span', styles : {backgroundColor : '%value'}}, + forecolor : {inline : 'span', styles : {color : '%value'}, wrap_links : false}, + hilitecolor : {inline : 'span', styles : {backgroundColor : '%value'}, wrap_links : false}, fontname : {inline : 'span', styles : {fontFamily : '%value'}}, fontsize : {inline : 'span', styles : {fontSize : '%value'}}, fontsize_class : {inline : 'span', attributes : {'class' : '%value'}}, blockquote : {block : 'blockquote', wrapper : 1, remove : 'all'}, + subscript : {inline : 'sub'}, + superscript : {inline : 'sup'}, + + link : {inline : 'a', selector : 'a', remove : 'all', split : true, deep : true, + onmatch : function(node) { + return true; + }, + + onformat : function(elm, fmt, vars) { + each(vars, function(value, key) { + t.dom.setAttrib(elm, key, value); + }); + } + }, removeformat : [ {selector : 'b,strong,em,i,font,u,strike', remove : 'all', split : true, expand : false, block_expand : true, deep : true}, @@ -9752,7 +11844,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { // Pass through t.undoManager.onAdd.add(function(um, l) { - if (!l.initial) + if (um.hasUndo()) return t.onChange.dispatch(t, l, um); }); @@ -9790,35 +11882,14 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { t.controlManager.onPostRender.dispatch(t, t.controlManager); t.onPostRender.dispatch(t); + t.quirks = new tinymce.util.Quirks(this); + if (s.directionality) t.getBody().dir = s.directionality; if (s.nowrap) t.getBody().style.whiteSpace = "nowrap"; - if (s.custom_elements) { - function handleCustom(ed, o) { - each(explode(s.custom_elements), function(v) { - var n; - - if (v.indexOf('~') === 0) { - v = v.substring(1); - n = 'span'; - } else - n = 'div'; - - o.content = o.content.replace(new RegExp('<(' + v + ')([^>]*)>', 'g'), '<' + n + ' _mce_name="$1"$2>'); - o.content = o.content.replace(new RegExp('', 'g'), ''); - }); - }; - - t.onBeforeSetContent.add(handleCustom); - t.onPostProcess.add(function(ed, o) { - if (o.set) - handleCustom(ed, o); - }); - } - if (s.handle_node_change_callback) { t.onNodeChange.add(function(ed, cm, n) { t.execCallback('handle_node_change_callback', t.id, n, -1, -1, true, t.selection.isCollapsed()); @@ -9840,16 +11911,22 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { }); } - if (s.convert_newlines_to_brs) { + if (s.protect) { t.onBeforeSetContent.add(function(ed, o) { - if (o.initial) - o.content = o.content.replace(/\r?\n/g, '
    '); + if (s.protect) { + each(s.protect, function(pattern) { + o.content = o.content.replace(pattern, function(str) { + return ''; + }); + }); + } }); } - if (s.fix_nesting && isIE) { + if (s.convert_newlines_to_brs) { t.onBeforeSetContent.add(function(ed, o) { - o.content = t._fixNesting(o.content); + if (o.initial) + o.content = o.content.replace(/\r?\n/g, '
    '); }); } @@ -9946,7 +12023,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { var pn = n.parentNode; if (ed.dom.isBlock(pn) && pn.lastChild === n) - ed.dom.add(pn, 'br', {'_mce_bogus' : 1}); + ed.dom.add(pn, 'br', {'data-mce-bogus' : 1}); }); }; @@ -9956,72 +12033,62 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { }); t.onSetContent.add(t.selection.onSetContent.add(fixLinks)); - - if (!s.readonly) { - try { - // Design mode must be set here once again to fix a bug where - // Ctrl+A/Delete/Backspace didn't work if the editor was added using mceAddControl then removed then added again - d.designMode = 'Off'; - d.designMode = 'On'; - } catch (ex) { - // Will fail on Gecko if the editor is placed in an hidden container element - // The design mode will be set ones the editor is focused - } - } } - // A small timeout was needed since firefox will remove. Bug: #1838304 - setTimeout(function () { - if (t.removed) - return; + t.load({initial : true, format : 'html'}); + t.startContent = t.getContent({format : 'raw'}); + t.undoManager.add(); + t.initialized = true; - t.load({initial : true, format : (s.cleanup_on_startup ? 'html' : 'raw')}); - t.startContent = t.getContent({format : 'raw'}); - t.initialized = true; + t.onInit.dispatch(t); + t.execCallback('setupcontent_callback', t.id, t.getBody(), t.getDoc()); + t.execCallback('init_instance_callback', t); + t.focus(true); + t.nodeChanged({initial : 1}); - t.onInit.dispatch(t); - t.execCallback('setupcontent_callback', t.id, t.getBody(), t.getDoc()); - t.execCallback('init_instance_callback', t); - t.focus(true); - t.nodeChanged({initial : 1}); + // Load specified content CSS last + each(t.contentCSS, function(u) { + t.dom.loadCSS(u); + }); - // Load specified content CSS last - if (s.content_css) { - tinymce.each(explode(s.content_css), function(u) { - t.dom.loadCSS(t.documentBaseURI.toAbsolute(u)); - }); - } + // Handle auto focus + if (s.auto_focus) { + setTimeout(function () { + var ed = tinymce.get(s.auto_focus); - // Handle auto focus - if (s.auto_focus) { - setTimeout(function () { - var ed = tinymce.get(s.auto_focus); + ed.selection.select(ed.getBody(), 1); + ed.selection.collapse(1); + ed.getBody().focus(); + ed.getWin().focus(); + }, 100); + } - ed.selection.select(ed.getBody(), 1); - ed.selection.collapse(1); - ed.getWin().focus(); - }, 100); - } - }, 1); - e = null; }, focus : function(sf) { - var oed, t = this, ce = t.settings.content_editable, ieRng, controlElm, doc = t.getDoc(); + var oed, t = this, selection = t.selection, ce = t.settings.content_editable, ieRng, controlElm, doc = t.getDoc(); if (!sf) { // Get selected control element - ieRng = t.selection.getRng(); + ieRng = selection.getRng(); if (ieRng.item) { controlElm = ieRng.item(0); } + t._refreshContentEditable(); + selection.normalize(); + // Is not content editable if (!ce) t.getWin().focus(); + // Focus the body as well since it's contentEditable + if (tinymce.isGecko) { + t.getBody().focus(); + } + // Restore selected control element // This is needed when for example an image is selected within a // layer a call to focus will then remove the control selection @@ -10106,7 +12173,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { }, nodeChanged : function(o) { - var t = this, s = t.selection, n = (isIE ? s.getNode() : s.getStart()) || t.getBody(); + var t = this, s = t.selection, n = s.getStart() || t.getBody(); // Fix for bug #1896577 it seems that this can not be fired while the editor is loading if (t.initialized) { @@ -10139,16 +12206,16 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { t.buttons[n] = s; }, - addCommand : function(n, f, s) { - this.execCommands[n] = {func : f, scope : s || this}; + addCommand : function(name, callback, scope) { + this.execCommands[name] = {func : callback, scope : scope || this}; }, - addQueryStateHandler : function(n, f, s) { - this.queryStateCommands[n] = {func : f, scope : s || this}; + addQueryStateHandler : function(name, callback, scope) { + this.queryStateCommands[name] = {func : callback, scope : scope || this}; }, - addQueryValueHandler : function(n, f, s) { - this.queryValueCommands[n] = {func : f, scope : s || this}; + addQueryValueHandler : function(name, callback, scope) { + this.queryValueCommands[name] = {func : callback, scope : scope || this}; }, addShortcut : function(pa, desc, cmd_func, sc) { @@ -10251,12 +12318,6 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { return true; } - // Execute global commands - if (tinymce.GlobalCommands.execCommand(t, cmd, ui, val)) { - t.onExecCommand.dispatch(t, cmd, ui, val, a); - return true; - } - // Editor commands if (t.editorCommands.execCommand(cmd, ui, val)) { t.onExecCommand.dispatch(t, cmd, ui, val, a); @@ -10388,7 +12449,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { // Add undo level will trigger onchange event if (!o.no_events) { - t.undoManager.typing = 0; + t.undoManager.typing = false; t.undoManager.add(); } @@ -10420,66 +12481,87 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { return h; }, - setContent : function(h, o) { - var t = this; + setContent : function(content, args) { + var self = this, rootNode, body = self.getBody(), forcedRootBlockName; - o = o || {}; - o.format = o.format || 'html'; - o.set = true; - o.content = h; + // Setup args object + args = args || {}; + args.format = args.format || 'html'; + args.set = true; + args.content = content; - if (!o.no_events) - t.onBeforeSetContent.dispatch(t, o); + // Do preprocessing + if (!args.no_events) + self.onBeforeSetContent.dispatch(self, args); + + content = args.content; // Padd empty content in Gecko and Safari. Commands will otherwise fail on the content // It will also be impossible to place the caret in the editor unless there is a BR element present - if (!tinymce.isIE && (h.length === 0 || /^\s+$/.test(h))) { - o.content = t.dom.setHTML(t.getBody(), '
    '); - o.format = 'raw'; - } + if (!tinymce.isIE && (content.length === 0 || /^\s+$/.test(content))) { + forcedRootBlockName = self.settings.forced_root_block; + if (forcedRootBlockName) + content = '<' + forcedRootBlockName + '>
    '; + else + content = '
    '; - o.content = t.dom.setHTML(t.getBody(), tinymce.trim(o.content)); + body.innerHTML = content; + self.selection.select(body, true); + self.selection.collapse(true); + return; + } - if (o.format != 'raw' && t.settings.cleanup) { - o.getInner = true; - o.content = t.dom.setHTML(t.getBody(), t.serializer.serialize(t.getBody(), o)); + // Parse and serialize the html + if (args.format !== 'raw') { + content = new tinymce.html.Serializer({}, self.schema).serialize( + self.parser.parse(content) + ); } - if (!o.no_events) - t.onSetContent.dispatch(t, o); + // Set the new cleaned contents to the editor + args.content = tinymce.trim(content); + self.dom.setHTML(body, args.content); + + // Do post processing + if (!args.no_events) + self.onSetContent.dispatch(self, args); - return o.content; + self.selection.normalize(); + + return args.content; }, - getContent : function(o) { - var t = this, h; + getContent : function(args) { + var self = this, content; - o = o || {}; - o.format = o.format || 'html'; - o.get = true; + // Setup args object + args = args || {}; + args.format = args.format || 'html'; + args.get = true; - if (!o.no_events) - t.onBeforeGetContent.dispatch(t, o); + // Do preprocessing + if (!args.no_events) + self.onBeforeGetContent.dispatch(self, args); - if (o.format != 'raw' && t.settings.cleanup) { - o.getInner = true; - h = t.serializer.serialize(t.getBody(), o); - } else - h = t.getBody().innerHTML; + // Get raw contents or by default the cleaned contents + if (args.format == 'raw') + content = self.getBody().innerHTML; + else + content = self.serializer.serialize(self.getBody(), args); - h = h.replace(/^\s*|\s*$/g, ''); - o.content = h; + args.content = tinymce.trim(content); - if (!o.no_events) - t.onGetContent.dispatch(t, o); + // Do post processing + if (!args.no_events) + self.onGetContent.dispatch(self, args); - return o.content; + return args.content; }, isDirty : function() { - var t = this; + var self = this; - return tinymce.trim(t.startContent) != tinymce.trim(t.getContent({format : 'raw', no_events : 1})) && !t.isNotDirty; + return tinymce.trim(self.startContent) != tinymce.trim(self.getContent({format : 'raw', no_events : 1})) && !self.isNotDirty; }, getContainer : function() { @@ -10657,7 +12739,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { _addEvents : function() { // 'focus', 'blur', 'dblclick', 'beforedeactivate', submit, reset - var t = this, i, s = t.settings, lo = { + var t = this, i, s = t.settings, dom = t.dom, lo = { mouseup : 'onMouseUp', mousedown : 'onMouseDown', click : 'onClick', @@ -10689,35 +12771,26 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { each(lo, function(v, k) { switch (k) { case 'contextmenu': - if (tinymce.isOpera) { - // Fake contextmenu on Opera - t.dom.bind(t.getBody(), 'mousedown', function(e) { - if (e.ctrlKey) { - e.fakeType = 'contextmenu'; - eventHandler(e); - } - }); - } else - t.dom.bind(t.getBody(), k, eventHandler); + dom.bind(t.getDoc(), k, eventHandler); break; case 'paste': - t.dom.bind(t.getBody(), k, function(e) { + dom.bind(t.getBody(), k, function(e) { eventHandler(e); }); break; case 'submit': case 'reset': - t.dom.bind(t.getElement().form || DOM.getParent(t.id, 'form'), k, eventHandler); + dom.bind(t.getElement().form || DOM.getParent(t.id, 'form'), k, eventHandler); break; default: - t.dom.bind(s.content_editable ? t.getBody() : t.getDoc(), k, eventHandler); + dom.bind(s.content_editable ? t.getBody() : t.getDoc(), k, eventHandler); } }); - t.dom.bind(s.content_editable ? t.getBody() : (isGecko ? t.getDoc() : t.getWin()), 'focus', function(e) { + dom.bind(s.content_editable ? t.getBody() : (isGecko ? t.getDoc() : t.getWin()), 'focus', function(e) { t.focus(true); }); @@ -10725,22 +12798,12 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { // Fixes bug where a specified document_base_uri could result in broken images // This will also fix drag drop of images in Gecko if (tinymce.isGecko) { - // Convert all images to absolute URLs -/* t.onSetContent.add(function(ed, o) { - each(ed.dom.select('img'), function(e) { - var v; - - if (v = e.getAttribute('_mce_src')) - e.src = t.documentBaseURI.toAbsolute(v); - }) - });*/ - - t.dom.bind(t.getDoc(), 'DOMNodeInserted', function(e) { + dom.bind(t.getDoc(), 'DOMNodeInserted', function(e) { var v; e = e.target; - if (e.nodeType === 1 && e.nodeName === 'IMG' && (v = e.getAttribute('_mce_src'))) + if (e.nodeType === 1 && e.nodeName === 'IMG' && (v = e.getAttribute('data-mce-src'))) e.src = t.documentBaseURI.toAbsolute(v); }); } @@ -10751,14 +12814,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { var t = this, d = t.getDoc(), s = t.settings; if (isGecko && !s.readonly) { - if (t._isHidden()) { - try { - if (!s.content_editable) - d.designMode = 'On'; - } catch (ex) { - // Fails if it's hidden - } - } + t._refreshContentEditable(); try { // Try new Gecko method @@ -10781,19 +12837,6 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { t.onMouseDown.add(setOpts); } - // Workaround for bug, http://bugs.webkit.org/show_bug.cgi?id=12250 - // WebKit can't even do simple things like selecting an image - // This also fixes so it's possible to select mceItemAnchors - if (tinymce.isWebKit) { - t.onClick.add(function(ed, e) { - e = e.target; - - // Needs tobe the setBaseAndExtend or it will fail to select floated images - if (e.nodeName == 'IMG' || (e.nodeName == 'A' && t.dom.hasClass(e, 'mceItemAnchor'))) - t.selection.getSel().setBaseAndExtent(e, 0, e, 1); - }); - } - // Add node change handlers t.onMouseUp.add(t.nodeChanged); //t.onClick.add(t.nodeChanged); @@ -10804,6 +12847,35 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { t.nodeChanged(); }); + + // Add block quote deletion handler + t.onKeyDown.add(function(ed, e) { + // Was the BACKSPACE key pressed? + if (e.keyCode != 8) + return; + + var n = ed.selection.getRng().startContainer; + var offset = ed.selection.getRng().startOffset; + + while (n && n.nodeType && n.nodeType != 1 && n.parentNode) + n = n.parentNode; + + // Is the cursor at the beginning of a blockquote? + if (n && n.parentNode && n.parentNode.tagName === 'BLOCKQUOTE' && n.parentNode.firstChild == n && offset == 0) { + // Remove the blockquote + ed.formatter.toggle('blockquote', null, n.parentNode); + + // Move the caret to the beginning of n + var rng = ed.selection.getRng(); + rng.setStart(n, 0); + rng.setEnd(n, 0); + ed.selection.setRng(rng); + ed.selection.collapse(false); + } + }); + + + // Add reset handler t.onReset.add(function() { t.setContent(t.startContent, {format : 'raw'}); @@ -10825,9 +12897,9 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { for (i=1; i<=6; i++) t.addShortcut('ctrl+' + i, '', ['FormatBlock', false, 'h' + i]); - t.addShortcut('ctrl+7', '', ['FormatBlock', false, '

    ']); - t.addShortcut('ctrl+8', '', ['FormatBlock', false, '

    ']); - t.addShortcut('ctrl+9', '', ['FormatBlock', false, '
    ']); + t.addShortcut('ctrl+7', '', ['FormatBlock', false, 'p']); + t.addShortcut('ctrl+8', '', ['FormatBlock', false, 'div']); + t.addShortcut('ctrl+9', '', ['FormatBlock', false, 'address']); function find(e) { var v = null; @@ -10883,7 +12955,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { if (tinymce.isIE) { // Fix so resize will only update the width and height attributes not the styles of an image // It will also block mceItemNoResize items - t.dom.bind(t.getDoc(), 'controlselect', function(e) { + dom.bind(t.getDoc(), 'controlselect', function(e) { var re = t.resizeInfo, cb; e = e.target; @@ -10893,28 +12965,28 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { return; if (re) - t.dom.unbind(re.node, re.ev, re.cb); + dom.unbind(re.node, re.ev, re.cb); - if (!t.dom.hasClass(e, 'mceItemNoResize')) { + if (!dom.hasClass(e, 'mceItemNoResize')) { ev = 'resizeend'; - cb = t.dom.bind(e, ev, function(e) { + cb = dom.bind(e, ev, function(e) { var v; e = e.target; - if (v = t.dom.getStyle(e, 'width')) { - t.dom.setAttrib(e, 'width', v.replace(/[^0-9%]+/g, '')); - t.dom.setStyle(e, 'width', ''); + if (v = dom.getStyle(e, 'width')) { + dom.setAttrib(e, 'width', v.replace(/[^0-9%]+/g, '')); + dom.setStyle(e, 'width', ''); } - if (v = t.dom.getStyle(e, 'height')) { - t.dom.setAttrib(e, 'height', v.replace(/[^0-9%]+/g, '')); - t.dom.setStyle(e, 'height', ''); + if (v = dom.getStyle(e, 'height')) { + dom.setAttrib(e, 'height', v.replace(/[^0-9%]+/g, '')); + dom.setStyle(e, 'height', ''); } }); } else { ev = 'resizestart'; - cb = t.dom.bind(e, 'resizestart', Event.cancel, Event); + cb = dom.bind(e, 'resizestart', Event.cancel, Event); } re = t.resizeInfo = { @@ -10923,27 +12995,6 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { cb : cb }; }); - - t.onKeyDown.add(function(ed, e) { - switch (e.keyCode) { - case 8: - // Fix IE control + backspace browser bug - if (t.selection.getRng().item) { - ed.dom.remove(t.selection.getRng().item(0)); - return Event.cancel(e); - } - } - }); - - /*if (t.dom.boxModel) { - t.getBody().style.height = '100%'; - - Event.add(t.getWin(), 'resize', function(e) { - var docElm = t.getDoc().documentElement; - - docElm.style.height = (docElm.offsetHeight - 10) + 'px'; - }); - }*/ } if (tinymce.isOpera) { @@ -10955,81 +13006,61 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { // Add custom undo/redo handlers if (s.custom_undo_redo) { function addUndo() { - t.undoManager.typing = 0; + t.undoManager.typing = false; t.undoManager.add(); }; - t.dom.bind(t.getDoc(), 'focusout', function(e) { + dom.bind(t.getDoc(), 'focusout', function(e) { if (!t.removed && t.undoManager.typing) addUndo(); }); + // Add undo level when contents is drag/dropped within the editor + t.dom.bind(t.dom.getRoot(), 'dragend', function(e) { + addUndo(); + }); + t.onKeyUp.add(function(ed, e) { - if ((e.keyCode >= 33 && e.keyCode <= 36) || (e.keyCode >= 37 && e.keyCode <= 40) || e.keyCode == 13 || e.keyCode == 45 || e.ctrlKey) + var keyCode = e.keyCode; + + if ((keyCode >= 33 && keyCode <= 36) || (keyCode >= 37 && keyCode <= 40) || keyCode == 13 || keyCode == 45 || e.ctrlKey) addUndo(); }); t.onKeyDown.add(function(ed, e) { - var rng, tmpRng, parent, offset; - - // IE has a really odd bug where the DOM might include an node that doesn't have - // a proper structure. If you try to access nodeValue it would throw an illegal value exception. - // This seems to only happen when you delete contents and it seems to be avoidable if you refresh the element - // after you delete contents from it. See: #3008923 - if (isIE && e.keyCode == 46) { - rng = t.selection.getRng(); - - if (rng.parentElement) { - parent = rng.parentElement(); - - // Get the current caret position within the element - tmpRng = rng.duplicate(); - tmpRng.moveToElementText(parent); - tmpRng.setEndPoint('EndToEnd', rng); - offset = tmpRng.text.length; - - // Select next word when ctrl key is used in combo with delete - if (e.ctrlKey) { - rng.moveEnd('word', 1); - rng.select(); - } + var keyCode = e.keyCode, sel; - // Delete contents - t.selection.getSel().clear(); + if (keyCode == 8) { + sel = t.getDoc().selection; - // Check if we are within the same parent - if (rng.parentElement() == parent) { - try { - // Update the HTML and hopefully it will remove the artifacts - parent.innerHTML = parent.innerHTML; - } catch (ex) { - // And since it's IE it can sometimes produce an unknown runtime error - } - - // Restore the caret position - tmpRng.moveToElementText(parent); - tmpRng.collapse(); - tmpRng.move('character', offset); - tmpRng.select(); - } + // Fix IE control + backspace browser bug + if (sel && sel.createRange && sel.createRange().item) { + t.undoManager.beforeChange(); + ed.dom.remove(sel.createRange().item(0)); + addUndo(); - // Block the default delete behavior since it might be broken - e.preventDefault(); - return; + return Event.cancel(e); } } - // Is caracter positon keys - if ((e.keyCode >= 33 && e.keyCode <= 36) || (e.keyCode >= 37 && e.keyCode <= 40) || e.keyCode == 13 || e.keyCode == 45) { + // Is caracter positon keys left,right,up,down,home,end,pgdown,pgup,enter + if ((keyCode >= 33 && keyCode <= 36) || (keyCode >= 37 && keyCode <= 40) || keyCode == 13 || keyCode == 45) { + // Add position before enter key is pressed, used by IE since it still uses the default browser behavior + // Todo: Remove this once we normalize enter behavior on IE + if (tinymce.isIE && keyCode == 13) + t.undoManager.beforeChange(); + if (t.undoManager.typing) addUndo(); return; } - if (!t.undoManager.typing) { + // If key isn't shift,ctrl,alt,capslock,metakey + if ((keyCode < 16 || keyCode > 20) && keyCode != 224 && keyCode != 91 && !t.undoManager.typing) { + t.undoManager.beforeChange(); + t.undoManager.typing = true; t.undoManager.add(); - t.undoManager.typing = 1; } }); @@ -11038,68 +13069,83 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { addUndo(); }); } - }, - _isHidden : function() { - var s; + // Bug fix for FireFox keeping styles from end of selection instead of start. + if (tinymce.isGecko) { + function getAttributeApplyFunction() { + var template = t.dom.getAttribs(t.selection.getStart().cloneNode(false)); - if (!isGecko) - return 0; + return function() { + var target = t.selection.getStart(); - // Weird, wheres that cursor selection? - s = this.selection.getSel(); - return (!s || !s.rangeCount || s.rangeCount == 0); - }, + if (target !== t.getBody()) { + t.dom.setAttrib(target, "style", null); - // Fix for bug #1867292 - _fixNesting : function(s) { - var d = [], i; + each(template, function(attr) { + target.setAttributeNode(attr.cloneNode(true)); + }); + } + }; + } - s = s.replace(/<(\/)?([^\s>]+)[^>]*?>/g, function(a, b, c) { - var e; + function isSelectionAcrossElements() { + var s = t.selection; - // Handle end element - if (b === '/') { - if (!d.length) - return ''; + return !s.isCollapsed() && s.getStart() != s.getEnd(); + } - if (c !== d[d.length - 1].tag) { - for (i=d.length - 1; i>=0; i--) { - if (d[i].tag === c) { - d[i].close = 1; - break; - } - } + t.onKeyPress.add(function(ed, e) { + var applyAttributes; - return ''; - } else { - d.pop(); + if ((e.keyCode == 8 || e.keyCode == 46) && isSelectionAcrossElements()) { + applyAttributes = getAttributeApplyFunction(); + t.getDoc().execCommand('delete', false, null); + applyAttributes(); - if (d.length && d[d.length - 1].close) { - a = a + ''; - d.pop(); - } + return Event.cancel(e); } - } else { - // Ignore these - if (/^(br|hr|input|meta|img|link|param)$/i.test(c)) - return a; + }); - // Ignore closed ones - if (/\/>$/.test(a)) - return a; + t.dom.bind(t.getDoc(), 'cut', function(e) { + var applyAttributes; - d.push({tag : c}); // Push start element - } + if (isSelectionAcrossElements()) { + applyAttributes = getAttributeApplyFunction(); + t.onKeyUp.addToTop(Event.cancel, Event); - return a; - }); + setTimeout(function() { + applyAttributes(); + t.onKeyUp.remove(Event.cancel, Event); + }, 0); + } + }); + } + }, - // End all open tags - for (i=d.length - 1; i>=0; i--) - s += ''; + _refreshContentEditable : function() { + var self = this, body, parent; - return s; + // Check if the editor was hidden and the re-initalize contentEditable mode by removing and adding the body again + if (self._isHidden()) { + body = self.getBody(); + parent = body.parentNode; + + parent.removeChild(body); + parent.appendChild(body); + + body.focus(); + } + }, + + _isHidden : function() { + var s; + + if (!isGecko) + return 0; + + // Weird, wheres that cursor selection? + s = this.selection.getSel(); + return (!s || !s.rangeCount || s.rangeCount == 0); } }); })(tinymce); @@ -11113,6 +13159,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { selection = editor.selection, commands = {state: {}, exec : {}, value : {}}, settings = editor.settings, + formatter = editor.formatter, bookmark; function execCommand(command, ui, value) { @@ -11178,11 +13225,11 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { }; function isFormatMatch(name) { - return editor.formatter.match(name); + return formatter.match(name); }; function toggleFormat(name, value) { - editor.formatter.toggle(name, value ? {value : value} : undefined); + formatter.toggle(name, value ? {value : value} : undefined); }; function storeSelection(type) { @@ -11242,10 +13289,11 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { // Remove all other alignments first each('left,center,right,full'.split(','), function(name) { if (align != name) - editor.formatter.remove('align' + name); + formatter.remove('align' + name); }); toggleFormat('align' + align); + execCommand('mceRepaint'); }, // Override list commands to fix WebKit bug @@ -11271,7 +13319,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { }, // Override commands to use the text formatter engine - 'Bold,Italic,Underline,Strikethrough' : function(command) { + 'Bold,Italic,Underline,Strikethrough,Superscript,Subscript' : function(command) { toggleFormat(command); }, @@ -11298,7 +13346,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { }, RemoveFormat : function(command) { - editor.formatter.remove(command); + formatter.remove(command); }, mceBlockQuote : function(command) { @@ -11306,7 +13354,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { }, FormatBlock : function(command, ui, value) { - return toggleFormat(value); + return toggleFormat(value || 'p'); }, mceCleanup : function() { @@ -11331,25 +13379,151 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { mceSelectNodeDepth : function(command, ui, value) { var counter = 0; - dom.getParent(selection.getNode(), function(node) { - if (node.nodeType == 1 && counter++ == value) { - selection.select(node); - return FALSE; - } - }, editor.getBody()); - }, + dom.getParent(selection.getNode(), function(node) { + if (node.nodeType == 1 && counter++ == value) { + selection.select(node); + return FALSE; + } + }, editor.getBody()); + }, + + mceSelectNode : function(command, ui, value) { + selection.select(value); + }, + + mceInsertContent : function(command, ui, value) { + var parser, serializer, parentNode, rootNode, fragment, args, + marker, nodeRect, viewPortRect, rng, node, node2, bookmarkHtml, viewportBodyElement; + + // Setup parser and serializer + parser = editor.parser; + serializer = new tinymce.html.Serializer({}, editor.schema); + bookmarkHtml = '\uFEFF'; + + // Run beforeSetContent handlers on the HTML to be inserted + args = {content: value, format: 'html'}; + selection.onBeforeSetContent.dispatch(selection, args); + value = args.content; + + // Add caret at end of contents if it's missing + if (value.indexOf('{$caret}') == -1) + value += '{$caret}'; + + // Replace the caret marker with a span bookmark element + value = value.replace(/\{\$caret\}/, bookmarkHtml); + + // Insert node maker where we will insert the new HTML and get it's parent + if (!selection.isCollapsed()) + editor.getDoc().execCommand('Delete', false, null); + + parentNode = selection.getNode(); + + // Parse the fragment within the context of the parent node + args = {context : parentNode.nodeName.toLowerCase()}; + fragment = parser.parse(value, args); + + // Move the caret to a more suitable location + node = fragment.lastChild; + if (node.attr('id') == 'mce_marker') { + marker = node; + + for (node = node.prev; node; node = node.walk(true)) { + if (node.type == 3 || !dom.isBlock(node.name)) { + node.parent.insert(marker, node, node.name === 'br'); + break; + } + } + } + + // If parser says valid we can insert the contents into that parent + if (!args.invalid) { + value = serializer.serialize(fragment); + + // Check if parent is empty or only has one BR element then set the innerHTML of that parent + node = parentNode.firstChild; + node2 = parentNode.lastChild; + if (!node || (node === node2 && node.nodeName === 'BR')) + dom.setHTML(parentNode, value); + else + selection.setContent(value); + } else { + // If the fragment was invalid within that context then we need + // to parse and process the parent it's inserted into + + // Insert bookmark node and get the parent + selection.setContent(bookmarkHtml); + parentNode = editor.selection.getNode(); + rootNode = editor.getBody(); + + // Opera will return the document node when selection is in root + if (parentNode.nodeType == 9) + parentNode = node = rootNode; + else + node = parentNode; + + // Find the ancestor just before the root element + while (node !== rootNode) { + parentNode = node; + node = node.parentNode; + } + + // Get the outer/inner HTML depending on if we are in the root and parser and serialize that + value = parentNode == rootNode ? rootNode.innerHTML : dom.getOuterHTML(parentNode); + value = serializer.serialize( + parser.parse( + // Need to replace by using a function since $ in the contents would otherwise be a problem + value.replace(//i, function() { + return serializer.serialize(fragment); + }) + ) + ); + + // Set the inner/outer HTML depending on if we are in the root or not + if (parentNode == rootNode) + dom.setHTML(rootNode, value); + else + dom.setOuterHTML(parentNode, value); + } + + marker = dom.get('mce_marker'); + + // Scroll range into view scrollIntoView on element can't be used since it will scroll the main view port as well + nodeRect = dom.getRect(marker); + viewPortRect = dom.getViewPort(editor.getWin()); + + // Check if node is out side the viewport if it is then scroll to it + if ((nodeRect.y + nodeRect.h > viewPortRect.y + viewPortRect.h || nodeRect.y < viewPortRect.y) || + (nodeRect.x > viewPortRect.x + viewPortRect.w || nodeRect.x < viewPortRect.x)) { + viewportBodyElement = tinymce.isIE ? editor.getDoc().documentElement : editor.getBody(); + viewportBodyElement.scrollLeft = nodeRect.x; + viewportBodyElement.scrollTop = nodeRect.y - viewPortRect.h + 25; + } + + // Move selection before marker and remove it + rng = dom.createRng(); - mceSelectNode : function(command, ui, value) { - selection.select(value); - }, + // If previous sibling is a text node set the selection to the end of that node + node = marker.previousSibling; + if (node && node.nodeType == 3) { + rng.setStart(node, node.nodeValue.length); + } else { + // If the previous sibling isn't a text node or doesn't exist set the selection before the marker node + rng.setStartBefore(marker); + rng.setEndBefore(marker); + } - mceInsertContent : function(command, ui, value) { - selection.setContent(value); + // Remove the marker node and set the new range + dom.remove(marker); + selection.setRng(rng); + + // Dispatch after event and add any visual elements needed + selection.onSetContent.dispatch(selection, args); + editor.addVisual(); }, mceInsertRawHTML : function(command, ui, value) { selection.setContent('tiny_mce_marker'); - editor.setContent(editor.getContent().replace(/tiny_mce_marker/g, value)); + editor.setContent(editor.getContent().replace(/tiny_mce_marker/g, function() { return value })); }, mceSetContent : function(command, ui, value) { @@ -11395,11 +13569,11 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { }, mceToggleFormat : function(command, ui, value) { - editor.formatter.toggle(value); + formatter.toggle(value); }, InsertHorizontalRule : function() { - selection.setContent('
    '); + editor.execCommand('mceInsertContent', false, '
    '); }, mceToggleVisualAid : function() { @@ -11408,33 +13582,37 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { }, mceReplaceContent : function(command, ui, value) { - selection.setContent(value.replace(/\{\$selection\}/g, selection.getContent({format : 'text'}))); + editor.execCommand('mceInsertContent', false, value.replace(/\{\$selection\}/g, selection.getContent({format : 'text'}))); }, mceInsertLink : function(command, ui, value) { - var link = dom.getParent(selection.getNode(), 'a'); + var anchor; - if (tinymce.is(value, 'string')) + if (typeof(value) == 'string') value = {href : value}; - if (!link) { - execNativeCommand('CreateLink', FALSE, 'javascript:mctmp(0);'); - each(dom.select('a[href=javascript:mctmp(0);]'), function(link) { - dom.setAttribs(link, value); - }); - } else { - if (value.href) - dom.setAttribs(link, value); - else - editor.dom.remove(link, TRUE); + anchor = dom.getParent(selection.getNode(), 'a'); + + // Spaces are never valid in URLs and it's a very common mistake for people to make so we fix it here. + value.href = value.href.replace(' ', '%20'); + + // Remove existing links if there could be child links or that the href isn't specified + if (!anchor || !value.href) { + formatter.remove('link'); + } + + // Apply new link to selection + if (value.href) { + formatter.apply('link', value, anchor); } }, - + selectAll : function() { - var root = dom.getRoot(); - var rng = dom.createRng(); + var root = dom.getRoot(), rng = dom.createRng(); + rng.setStart(root, 0); rng.setEnd(root, root.childNodes.length); + editor.selection.setRng(rng); } }); @@ -11446,7 +13624,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { return isFormatMatch('align' + command.substring(7)); }, - 'Bold,Italic,Underline,Strikethrough' : function(command) { + 'Bold,Italic,Underline,Strikethrough,Superscript,Subscript' : function(command) { return isFormatMatch(command); }, @@ -11503,23 +13681,30 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { } }; })(tinymce); + (function(tinymce) { var Dispatcher = tinymce.util.Dispatcher; tinymce.UndoManager = function(editor) { - var self, index = 0, data = []; + var self, index = 0, data = [], beforeBookmark; function getContent() { return tinymce.trim(editor.getContent({format : 'raw', no_events : 1})); }; return self = { - typing : 0, + typing : false, onAdd : new Dispatcher(self), + onUndo : new Dispatcher(self), + onRedo : new Dispatcher(self), + beforeChange : function() { + beforeBookmark = editor.selection.getBookmark(2, true); + }, + add : function(level) { var i, settings = editor.settings, lastLevel; @@ -11528,10 +13713,12 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { // Add undo level if needed lastLevel = data[index]; - if (lastLevel && lastLevel.content == level.content) { - if (index > 0 || data.length == 1) - return null; - } + if (lastLevel && lastLevel.content == level.content) + return null; + + // Set before bookmark on previous level + if (data[index]) + data[index].beforeBookmark = beforeBookmark; // Time to compress if (settings.custom_undo_redo_levels) { @@ -11548,13 +13735,8 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { level.bookmark = editor.selection.getBookmark(2, true); // Crop array if needed - if (index < data.length - 1) { - // Treat first level as initial - if (index == 0) - data = []; - else - data.length = index + 1; - } + if (index < data.length - 1) + data.length = index + 1; data.push(level); index = data.length - 1; @@ -11570,14 +13752,14 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { if (self.typing) { self.add(); - self.typing = 0; + self.typing = false; } if (index > 0) { level = data[--index]; editor.setContent(level.content, {format : 'raw'}); - editor.selection.moveToBookmark(level.bookmark); + editor.selection.moveToBookmark(level.beforeBookmark); self.onUndo.dispatch(self, level); } @@ -11602,15 +13784,16 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { clear : function() { data = []; - index = self.typing = 0; + index = 0; + self.typing = false; }, hasUndo : function() { - return index > 0 || self.typing; + return index > 0 || this.typing; }, hasRedo : function() { - return index < data.length - 1; + return index < data.length - 1 && !this.typing; } }; }; @@ -11659,24 +13842,15 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { return rng2.cloneContents().textContent.length == 0; }; - function isEmpty(n) { - n = n.innerHTML; - - n = n.replace(/<(img|hr|table|input|select|textarea)[ \>]/gi, '-'); // Keep these convert them to - chars - n = n.replace(/<[^>]+>/g, ''); // Remove all tags - - return n.replace(/[ \u00a0\t\r\n]+/g, '') == ''; - }; - function splitList(selection, dom, li) { var listBlock, block; - if (isEmpty(li)) { + if (dom.isEmpty(li)) { listBlock = dom.getParent(li, 'ul,ol'); if (!dom.getParent(listBlock.parentNode, 'ul,ol')) { dom.split(listBlock, li); - block = dom.create('p', 0, '
    '); + block = dom.create('p', 0, '
    '); dom.replace(block, li); selection.select(block, 1); } @@ -11697,45 +13871,94 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { s.element = elm.toUpperCase(); ed.onPreInit.add(t.setup, t); + }, - t.reOpera = new RegExp('(\\u00a0| | )<\/' + elm + '>', 'gi'); - t.rePadd = new RegExp(']+)><\\\/p>|]+)\\\/>|]+)>\\s+<\\\/p>|

    <\\\/p>||

    \\s+<\\\/p>'.replace(/p/g, elm), 'gi'); - t.reNbsp2BR1 = new RegExp(']+)>[\\s\\u00a0]+<\\\/p>|

    [\\s\\u00a0]+<\\\/p>'.replace(/p/g, elm), 'gi'); - t.reNbsp2BR2 = new RegExp('<%p()([^>]+)>( | )<\\\/%p>|<%p>( | )<\\\/%p>'.replace(/%p/g, elm), 'gi'); - t.reBR2Nbsp = new RegExp(']+)>\\s*
    \\s*<\\\/p>|

    \\s*
    \\s*<\\\/p>'.replace(/p/g, elm), 'gi'); + setup : function() { + var t = this, ed = t.editor, s = ed.settings, dom = ed.dom, selection = ed.selection, blockElements = ed.schema.getBlockElements(); - function padd(ed, o) { - if (isOpera) - o.content = o.content.replace(t.reOpera, ''); + // Force root blocks + if (s.forced_root_block) { + function addRootBlocks() { + var node = selection.getStart(), rootNode = ed.getBody(), rng, startContainer, startOffset, endContainer, endOffset, rootBlockNode, tempNode, offset = -0xFFFFFF; - o.content = o.content.replace(t.rePadd, '<' + elm + '$1$2$3$4$5$6>\u00a0'); + if (!node || node.nodeType !== 1) + return; - if (!isIE && !isOpera && o.set) { - // Use   instead of BR in padded paragraphs - o.content = o.content.replace(t.reNbsp2BR1, '<' + elm + '$1$2>
    '); - o.content = o.content.replace(t.reNbsp2BR2, '<' + elm + '$1$2>
    '); - } else - o.content = o.content.replace(t.reBR2Nbsp, '<' + elm + '$1$2>\u00a0'); - }; + // Check if node is wrapped in block + while (node != rootNode) { + if (blockElements[node.nodeName]) + return; - ed.onBeforeSetContent.add(padd); - ed.onPostProcess.add(padd); + node = node.parentNode; + } - if (s.forced_root_block) { - ed.onInit.add(t.forceRoots, t); - ed.onSetContent.add(t.forceRoots, t); - ed.onBeforeGetContent.add(t.forceRoots, t); - } - }, + // Get current selection + rng = selection.getRng(); + if (rng.setStart) { + startContainer = rng.startContainer; + startOffset = rng.startOffset; + endContainer = rng.endContainer; + endOffset = rng.endOffset; + } else { + // Force control range into text range + if (rng.item) { + rng = ed.getDoc().body.createTextRange(); + rng.moveToElementText(rng.item(0)); + } - setup : function() { - var t = this, ed = t.editor, s = ed.settings, dom = ed.dom, selection = ed.selection; + tmpRng = rng.duplicate(); + tmpRng.collapse(true); + startOffset = tmpRng.move('character', offset) * -1; - // Force root blocks when typing and when getting output - if (s.forced_root_block) { - ed.onBeforeExecCommand.add(t.forceRoots, t); - ed.onKeyUp.add(t.forceRoots, t); - ed.onPreProcess.add(t.forceRoots, t); + if (!tmpRng.collapsed) { + tmpRng = rng.duplicate(); + tmpRng.collapse(false); + endOffset = (tmpRng.move('character', offset) * -1) - startOffset; + } + } + + // Wrap non block elements and text nodes + for (node = rootNode.firstChild; node; node) { + if (node.nodeType === 3 || (node.nodeType == 1 && !blockElements[node.nodeName])) { + if (!rootBlockNode) { + rootBlockNode = dom.create(s.forced_root_block); + node.parentNode.insertBefore(rootBlockNode, node); + } + + tempNode = node; + node = node.nextSibling; + rootBlockNode.appendChild(tempNode); + } else { + rootBlockNode = null; + node = node.nextSibling; + } + } + + if (rng.setStart) { + rng.setStart(startContainer, startOffset); + rng.setEnd(endContainer, endOffset); + selection.setRng(rng); + } else { + try { + rng = ed.getDoc().body.createTextRange(); + rng.moveToElementText(rootNode); + rng.collapse(true); + rng.moveStart('character', startOffset); + + if (endOffset > 0) + rng.moveEnd('character', endOffset); + + rng.select(); + } catch (ex) { + // Ignore + } + } + + ed.nodeChanged(); + }; + + ed.onKeyUp.add(addRootBlocks); + ed.onClick.add(addRootBlocks); } if (s.force_br_newlines) { @@ -11785,12 +14008,12 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { var parent = ed.selection.getStart(), fmt = t._previousFormats; // Parent is an empty block - if (!parent.hasChildNodes()) { + if (!parent.hasChildNodes() && fmt) { parent = dom.getParent(parent, dom.isBlock); - if (parent) { + if (parent && parent.nodeName != 'LI') { parent.innerHTML = ''; - + if (t._previousFormats) { parent.appendChild(fmt.wrapper); fmt.inner.innerHTML = '\uFEFF'; @@ -11798,7 +14021,9 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { parent.innerHTML = '\uFEFF'; selection.select(parent, 1); + selection.collapse(true); ed.getDoc().execCommand('Delete', false, null); + t._previousFormats = 0; } } } @@ -11851,21 +14076,6 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { }); } - // Padd empty inline elements within block elements - // For example:

    becomes

     

    - ed.onPreProcess.add(function(ed, o) { - each(dom.select('p,h1,h2,h3,h4,h5,h6,div', o.node), function(p) { - if (isEmpty(p)) { - each(dom.select('span,em,strong,b,i', o.node), function(n) { - if (!n.hasChildNodes()) { - n.appendChild(ed.getDoc().createTextNode('\u00a0')); - return FALSE; // Break the loop one padding is enough - } - }); - } - }); - }); - // IE specific fixes if (isIE) { // Replaces IE:s auto generated paragraphs with the specified element name @@ -11895,155 +14105,6 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { } }, - find : function(n, t, s) { - var ed = this.editor, w = ed.getDoc().createTreeWalker(n, 4, null, FALSE), c = -1; - - while (n = w.nextNode()) { - c++; - - // Index by node - if (t == 0 && n == s) - return c; - - // Node by index - if (t == 1 && c == s) - return n; - } - - return -1; - }, - - forceRoots : function(ed, e) { - var t = this, ed = t.editor, b = ed.getBody(), d = ed.getDoc(), se = ed.selection, s = se.getSel(), r = se.getRng(), si = -2, ei, so, eo, tr, c = -0xFFFFFF; - var nx, bl, bp, sp, le, nl = b.childNodes, i, n, eid; - - // Fix for bug #1863847 - //if (e && e.keyCode == 13) - // return TRUE; - - // Wrap non blocks into blocks - for (i = nl.length - 1; i >= 0; i--) { - nx = nl[i]; - - // Ignore internal elements - if (nx.nodeType === 1 && nx.getAttribute('_mce_type')) { - bl = null; - continue; - } - - // Is text or non block element - if (nx.nodeType === 3 || (!t.dom.isBlock(nx) && nx.nodeType !== 8 && !/^(script|mce:script|style|mce:style)$/i.test(nx.nodeName))) { - if (!bl) { - // Create new block but ignore whitespace - if (nx.nodeType != 3 || /[^\s]/g.test(nx.nodeValue)) { - // Store selection - if (si == -2 && r) { - if (!isIE) { - // If selection is element then mark it - if (r.startContainer.nodeType == 1 && (n = r.startContainer.childNodes[r.startOffset]) && n.nodeType == 1) { - // Save the id of the selected element - eid = n.getAttribute("id"); - n.setAttribute("id", "__mce"); - } else { - // If element is inside body, might not be the case in contentEdiable mode - if (ed.dom.getParent(r.startContainer, function(e) {return e === b;})) { - so = r.startOffset; - eo = r.endOffset; - si = t.find(b, 0, r.startContainer); - ei = t.find(b, 0, r.endContainer); - } - } - } else { - // Force control range into text range - if (r.item) { - tr = d.body.createTextRange(); - tr.moveToElementText(r.item(0)); - r = tr; - } - - tr = d.body.createTextRange(); - tr.moveToElementText(b); - tr.collapse(1); - bp = tr.move('character', c) * -1; - - tr = r.duplicate(); - tr.collapse(1); - sp = tr.move('character', c) * -1; - - tr = r.duplicate(); - tr.collapse(0); - le = (tr.move('character', c) * -1) - sp; - - si = sp - bp; - ei = le; - } - } - - // Uses replaceChild instead of cloneNode since it removes selected attribute from option elements on IE - // See: http://support.microsoft.com/kb/829907 - bl = ed.dom.create(ed.settings.forced_root_block); - nx.parentNode.replaceChild(bl, nx); - bl.appendChild(nx); - } - } else { - if (bl.hasChildNodes()) - bl.insertBefore(nx, bl.firstChild); - else - bl.appendChild(nx); - } - } else - bl = null; // Time to create new block - } - - // Restore selection - if (si != -2) { - if (!isIE) { - bl = b.getElementsByTagName(ed.settings.element)[0]; - r = d.createRange(); - - // Select last location or generated block - if (si != -1) - r.setStart(t.find(b, 1, si), so); - else - r.setStart(bl, 0); - - // Select last location or generated block - if (ei != -1) - r.setEnd(t.find(b, 1, ei), eo); - else - r.setEnd(bl, 0); - - if (s) { - s.removeAllRanges(); - s.addRange(r); - } - } else { - try { - r = s.createRange(); - r.moveToElementText(b); - r.collapse(1); - r.moveStart('character', si); - r.moveEnd('character', ei); - r.select(); - } catch (ex) { - // Ignore - } - } - } else if (!isIE && (n = ed.dom.get('__mce'))) { - // Restore the id of the selected element - if (eid) - n.setAttribute('id', eid); - else - n.removeAttribute('id'); - - // Move caret before selected element - r = d.createRange(); - r.setStartBefore(n); - r.setEndBefore(n); - se.setRng(r); - } - }, - getParentBlock : function(n) { var d = this.dom; @@ -12054,6 +14115,8 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { var t = this, ed = t.editor, dom = ed.dom, d = ed.getDoc(), se = ed.settings, s = ed.selection.getSel(), r = s.getRangeAt(0), b = d.body; var rb, ra, dir, sn, so, en, eo, sb, eb, bn, bef, aft, sc, ec, n, vp = dom.getViewPort(ed.getWin()), y, ch, car; + ed.undoManager.beforeChange(); + // If root blocks are forced then use Operas default behavior since it's really good // Removed due to bug: #1853816 // if (se.forced_root_block && isOpera) @@ -12115,6 +14178,11 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { ra.setStart(en, 0); } + // If the body is totally empty add a BR element this might happen on webkit + if (!d.body.hasChildNodes()) { + d.body.appendChild(dom.create('br')); + } + // Never use body as start or end node sn = sn.nodeName == "HTML" ? d.body : sn; // Fix for Opera bug: https://bugs.opera.com/show_bug.cgi?id=273224&comments=yes sn = sn.nodeName == "BODY" ? sn.firstChild : sn; @@ -12229,10 +14297,6 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { if (aft.firstChild && aft.firstChild.nodeName == bn) aft.innerHTML = aft.firstChild.innerHTML; - // Padd empty blocks - if (isEmpty(bef)) - bef.innerHTML = '
    '; - function appendStyles(e, en) { var nl = [], nn, n, i; @@ -12257,14 +14321,18 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { nn = nn.appendChild(nl[i]); // Padd most inner style element - nl[0].innerHTML = isOpera ? ' ' : '
    '; // Extra space for Opera so that the caret can move there + nl[0].innerHTML = isOpera ? '\u00a0' : '
    '; // Extra space for Opera so that the caret can move there return nl[0]; // Move caret to most inner element } else - e.innerHTML = isOpera ? ' ' : '
    '; // Extra space for Opera so that the caret can move there + e.innerHTML = isOpera ? '\u00a0' : '
    '; // Extra space for Opera so that the caret can move there }; + + // Padd empty blocks + if (dom.isEmpty(bef)) + appendStyles(bef, sn); // Fill empty afterblook with current style - if (isEmpty(aft)) + if (dom.isEmpty(aft)) car = appendStyles(aft, en); // Opera needs this one backwards for older versions @@ -12280,27 +14348,26 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { aft.normalize(); bef.normalize(); - function first(n) { - return d.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, FALSE).nextNode() || n; - }; - // Move cursor and scroll into view - r = d.createRange(); - r.selectNodeContents(isGecko ? first(car || aft) : car || aft); - r.collapse(1); - s.removeAllRanges(); - s.addRange(r); + ed.selection.select(aft, true); + ed.selection.collapse(true); // scrollIntoView seems to scroll the parent window in most browsers now including FF 3.0b4 so it's time to stop using it and do it our selfs y = ed.dom.getPos(aft).y; - ch = aft.clientHeight; + //ch = aft.clientHeight; // Is element within viewport - if (y < vp.y || y + ch > vp.y + vp.h) { + if (y < vp.y || y + 25 > vp.y + vp.h) { ed.getWin().scrollTo(0, y < vp.y ? y : y - vp.h + 25); // Needs to be hardcoded to roughly one line of text if a huge text block is broken into two blocks - //console.debug('SCROLL!', 'vp.y: ' + vp.y, 'y' + y, 'vp.h' + vp.h, 'clientHeight' + aft.clientHeight, 'yyy: ' + (y < vp.y ? y : y - vp.h + aft.clientHeight)); + + /*console.debug( + 'Element: y=' + y + ', h=' + ch + ', ' + + 'Viewport: y=' + vp.y + ", h=" + vp.h + ', bottom=' + (vp.y + vp.h) + );*/ } + ed.undoManager.add(); + return FALSE; }, @@ -12511,11 +14578,16 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { id = t.prefix + id; - if (ed.settings.use_native_selects) + + function useNativeListForAccessibility(ed) { + return ed.settings.use_accessible_selects && !tinymce.isGecko + } + + if (ed.settings.use_native_selects || useNativeListForAccessibility(ed)) c = new tinymce.ui.NativeListBox(id, s); else { cls = cc || t._cls.listbox || tinymce.ui.ListBox; - c = new cls(id, s); + c = new cls(id, s, ed); } t.controls[id] = c; @@ -12570,11 +14642,11 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { if (s.menu_button) { cls = cc || t._cls.menubutton || tinymce.ui.MenuButton; - c = new cls(id, s); + c = new cls(id, s, ed); ed.onMouseDown.add(c.hideMenu, c); } else { cls = t._cls.button || tinymce.ui.Button; - c = new cls(id, s); + c = new cls(id, s, ed); } return t.add(c); @@ -12617,7 +14689,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { id = t.prefix + id; cls = cc || t._cls.splitbutton || tinymce.ui.SplitButton; - c = t.add(new cls(id, s)); + c = t.add(new cls(id, s, ed)); ed.onMouseDown.add(c.hideMenu, c); return c; @@ -12657,7 +14729,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { id = t.prefix + id; cls = cc || t._cls.colorsplitbutton || tinymce.ui.ColorSplitButton; - c = new cls(id, s); + c = new cls(id, s, ed); ed.onMouseDown.add(c.hideMenu, c); // Remove the menu element when the editor is removed @@ -12689,13 +14761,25 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { id = t.prefix + id; cls = cc || t._cls.toolbar || tinymce.ui.Toolbar; - c = new cls(id, s); + c = new cls(id, s, t.editor); if (t.get(id)) return null; return t.add(c); }, + + createToolbarGroup : function(id, s, cc) { + var c, t = this, cls; + id = t.prefix + id; + cls = cc || this._cls.toolbarGroup || tinymce.ui.ToolbarGroup; + c = new cls(id, s, t.editor); + + if (t.get(id)) + return null; + + return t.add(c); + }, createSeparator : function(cc) { var cls = cc || this._cls.separator || tinymce.ui.Separator; @@ -12832,53 +14916,6 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { } }); }(tinymce)); -(function(tinymce) { - function CommandManager() { - var execCommands = {}, queryStateCommands = {}, queryValueCommands = {}; - - function add(collection, cmd, func, scope) { - if (typeof(cmd) == 'string') - cmd = [cmd]; - - tinymce.each(cmd, function(cmd) { - collection[cmd.toLowerCase()] = {func : func, scope : scope}; - }); - }; - - tinymce.extend(this, { - add : function(cmd, func, scope) { - add(execCommands, cmd, func, scope); - }, - - addQueryStateHandler : function(cmd, func, scope) { - add(queryStateCommands, cmd, func, scope); - }, - - addQueryValueHandler : function(cmd, func, scope) { - add(queryValueCommands, cmd, func, scope); - }, - - execCommand : function(scope, cmd, ui, value, args) { - if (cmd = execCommands[cmd.toLowerCase()]) { - if (cmd.func.call(scope || cmd.scope, ui, value, args) !== false) - return true; - } - }, - - queryCommandValue : function() { - if (cmd = queryValueCommands[cmd.toLowerCase()]) - return cmd.func.call(scope || cmd.scope, ui, value, args); - }, - - queryCommandState : function() { - if (cmd = queryStateCommands[cmd.toLowerCase()]) - return cmd.func.call(scope || cmd.scope, ui, value, args); - } - }); - }; - - tinymce.GlobalCommands = new CommandManager(); -})(tinymce); (function(tinymce) { tinymce.Formatter = function(ed) { var formats = {}, @@ -12887,7 +14924,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { selection = ed.selection, TreeWalker = tinymce.dom.TreeWalker, rangeUtils = new tinymce.dom.RangeUtils(dom), - isValid = ed.schema.isValid, + isValid = ed.schema.isValidChild, isBlock = dom.isBlock, forcedRootBlock = ed.settings.forced_root_block, nodeIndex = dom.nodeIndex, @@ -12895,8 +14932,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { MCE_ATTR_RE = /^(src|href|style)$/, FALSE = false, TRUE = true, - undefined, - pendingFormats = {apply : [], remove : []}; + undefined; function isArray(obj) { return obj instanceof Array; @@ -12956,8 +14992,31 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { } }; + var getTextDecoration = function(node) { + var decoration; + + ed.dom.getParent(node, function(n) { + decoration = ed.dom.getStyle(n, 'text-decoration'); + return decoration && decoration !== 'none'; + }); + + return decoration; + }; + + var processUnderlineAndColor = function(node) { + var textDecoration; + if (node.nodeType === 1 && node.parentNode && node.parentNode.nodeType === 1) { + textDecoration = getTextDecoration(node.parentNode); + if (ed.dom.getStyle(node, 'color') && textDecoration) { + ed.dom.setStyle(node, 'text-decoration', textDecoration); + } else if (ed.dom.getStyle(node, 'textdecoration') === textDecoration) { + ed.dom.setStyle(node, 'text-decoration', null); + } + } + }; + function apply(name, vars, node) { - var formatList = get(name), format = formatList[0], bookmark, rng, i; + var formatList = get(name), format = formatList[0], bookmark, rng, i, isCollapsed = selection.isCollapsed(); function moveStart(rng) { var container = rng.startContainer, @@ -12987,6 +15046,10 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { fmt = fmt || format; if (elm) { + if (fmt.onformat) { + fmt.onformat(elm, fmt, vars, node); + } + each(fmt.styles, function(value, name) { dom.setStyle(elm, name, replaceVars(value, vars)); }); @@ -13003,8 +15066,89 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { }); } }; + function adjustSelectionToVisibleSelection() { + function findSelectionEnd(start, end) { + var walker = new TreeWalker(end); + for (node = walker.current(); node; node = walker.prev()) { + if (node.childNodes.length > 1 || node == start) { + return node; + } + } + }; + + // Adjust selection so that a end container with a end offset of zero is not included in the selection + // as this isn't visible to the user. + var rng = ed.selection.getRng(); + var start = rng.startContainer; + var end = rng.endContainer; + + if (start != end && rng.endOffset == 0) { + var newEnd = findSelectionEnd(start, end); + var endOffset = newEnd.nodeType == 3 ? newEnd.length : newEnd.childNodes.length; + + rng.setEnd(newEnd, endOffset); + } + + return rng; + } + + function applyStyleToList(node, bookmark, wrapElm, newWrappers, process){ + var nodes = [], listIndex = -1, list, startIndex = -1, endIndex = -1, currentWrapElm; + + // find the index of the first child list. + each(node.childNodes, function(n, index) { + if (n.nodeName === "UL" || n.nodeName === "OL") { + listIndex = index; + list = n; + return false; + } + }); + + // get the index of the bookmarks + each(node.childNodes, function(n, index) { + if (n.nodeName === "SPAN" && dom.getAttrib(n, "data-mce-type") == "bookmark") { + if (n.id == bookmark.id + "_start") { + startIndex = index; + } else if (n.id == bookmark.id + "_end") { + endIndex = index; + } + } + }); + + // if the selection spans across an embedded list, or there isn't an embedded list - handle processing normally + if (listIndex <= 0 || (startIndex < listIndex && endIndex > listIndex)) { + each(tinymce.grep(node.childNodes), process); + return 0; + } else { + currentWrapElm = wrapElm.cloneNode(FALSE); + + // create a list of the nodes on the same side of the list as the selection + each(tinymce.grep(node.childNodes), function(n, index) { + if ((startIndex < listIndex && index < listIndex) || (startIndex > listIndex && index > listIndex)) { + nodes.push(n); + n.parentNode.removeChild(n); + } + }); + + // insert the wrapping element either before or after the list. + if (startIndex < listIndex) { + node.insertBefore(currentWrapElm, list); + } else if (startIndex > listIndex) { + node.insertBefore(currentWrapElm, list.nextSibling); + } + + // add the new nodes to the list. + newWrappers.push(currentWrapElm); + + each(nodes, function(node) { + currentWrapElm.appendChild(node); + }); - function applyRngStyle(rng) { + return currentWrapElm; + } + }; + + function applyRngStyle(rng, bookmark, node_specific) { var newWrappers = [], wrapName, wrapElm; // Setup wrapper element @@ -13048,6 +15192,11 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { if (format.selector) { // Look for matching formats each(formatList, function(format) { + // Check collapsed state if it exists + if ('collapsed' in format && format.collapsed !== isCollapsed) { + return; + } + if (dom.is(node, format.selector) && !isCaretNode(node)) { setElementFormat(node, format); found = true; @@ -13062,7 +15211,8 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { } // Is it valid to wrap this item - if (isValid(wrapName, nodeName) && isValid(parentName, wrapName)) { + if (isValid(wrapName, nodeName) && isValid(parentName, wrapName) && + !(!node_specific && node.nodeType === 3 && node.nodeValue.length === 1 && node.nodeValue.charCodeAt(0) === 65279) && node.id !== '_mce_caret') { // Start wrapping if (!currentWrapElm) { // Wrap the node @@ -13072,20 +15222,47 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { } currentWrapElm.appendChild(node); + } else if (nodeName == 'li' && bookmark) { + // Start wrapping - if we are in a list node and have a bookmark, then we will always begin by wrapping in a new element. + currentWrapElm = applyStyleToList(node, bookmark, wrapElm, newWrappers, process); } else { // Start a new wrapper for possible children currentWrapElm = 0; each(tinymce.grep(node.childNodes), process); - // End the last wrapper - currentWrapElm = 0; - } - }; - - // Process siblings from range - each(nodes, process); - }); + // End the last wrapper + currentWrapElm = 0; + } + }; + + // Process siblings from range + each(nodes, process); + }); + + // Wrap links inside as well, for example color inside a link when the wrapper is around the link + if (format.wrap_links === false) { + each(newWrappers, function(node) { + function process(node) { + var i, currentWrapElm, children; + + if (node.nodeName === 'A') { + currentWrapElm = wrapElm.cloneNode(FALSE); + newWrappers.push(currentWrapElm); + + children = tinymce.grep(node.childNodes); + for (i = 0; i < children.length; i++) + currentWrapElm.appendChild(children[i]); + + node.appendChild(currentWrapElm); + } + + each(tinymce.grep(node.childNodes), process); + }; + + process(node); + }); + } // Cleanup each(newWrappers, function(node) { @@ -13126,8 +15303,9 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { childCount = getChildCount(node); - // Remove empty nodes - if (childCount === 0) { + // Remove empty nodes but only if there is multiple wrappers and they are not block + // elements so never remove single

    since that would remove the currrent empty block element where the caret is at + if ((newWrappers.length > 1 || !isBlock(node)) && childCount === 0) { dom.remove(node, 1); return; } @@ -13143,6 +15321,19 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { // this: text // will become: text each(dom.select(format.inline, node), function(child) { + var parent; + + // When wrap_links is set to false we don't want + // to remove the format on children within links + if (format.wrap_links === false) { + parent = child.parentNode; + + do { + if (parent.nodeName === 'A') + return; + } while (parent = parent.parentNode); + } + removeFormat(format, vars, child, format.exact ? child : null); }); }); @@ -13166,7 +15357,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { } // Merge next and previous siblings if they are similar texttext becomes texttext - if (node) { + if (node && format.merge_siblings !== false) { node = mergeSiblings(getNonWhiteSpaceSibling(node), node); node = mergeSiblings(node, getNonWhiteSpaceSibling(node, TRUE)); } @@ -13176,17 +15367,29 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { if (format) { if (node) { - rng = dom.createRng(); - - rng.setStartBefore(node); - rng.setEndAfter(node); - - applyRngStyle(expandRng(rng, formatList)); + if (node.nodeType) { + rng = dom.createRng(); + rng.setStartBefore(node); + rng.setEndAfter(node); + applyRngStyle(expandRng(rng, formatList), null, true); + } else { + applyRngStyle(node, null, true); + } } else { - if (!selection.isCollapsed() || !format.inline) { + if (!isCollapsed || !format.inline || dom.select('td.mceSelected,th.mceSelected').length) { + // Obtain selection node before selection is unselected by applyRngStyle() + var curSelNode = ed.selection.getNode(); + // Apply formatting to selection + ed.selection.setRng(adjustSelectionToVisibleSelection()); bookmark = selection.getBookmark(); - applyRngStyle(expandRng(selection.getRng(TRUE), formatList)); + applyRngStyle(expandRng(selection.getRng(TRUE), formatList), bookmark); + + // Colored nodes should be underlined so that the color of the underline matches the text color. + if (format.styles && (format.styles.color || format.styles.textDecoration)) { + tinymce.walk(curSelNode, processUnderlineAndColor, 'childNodes'); + processUnderlineAndColor(curSelNode); + } selection.moveToBookmark(bookmark); selection.setRng(moveStart(selection.getRng(TRUE))); @@ -13199,6 +15402,44 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { function remove(name, vars, node) { var formatList = get(name), format = formatList[0], bookmark, i, rng; + function moveStart(rng) { + var container = rng.startContainer, + offset = rng.startOffset, + walker, node, nodes, tmpNode; + + // Convert text node into index if possible + if (container.nodeType == 3 && offset >= container.nodeValue.length - 1) { + container = container.parentNode; + offset = nodeIndex(container) + 1; + } + + // Move startContainer/startOffset in to a suitable node + if (container.nodeType == 1) { + nodes = container.childNodes; + container = nodes[Math.min(offset, nodes.length - 1)]; + walker = new TreeWalker(container); + + // If offset is at end of the parent node walk to the next one + if (offset > nodes.length - 1) + walker.next(); + + for (node = walker.current(); node; node = walker.next()) { + if (node.nodeType == 3 && !isWhiteSpaceNode(node)) { + // IE has a "neat" feature where it moves the start node into the closest element + // we can avoid this by inserting an element before it and then remove it after we set the selection + tmpNode = dom.create('a', null, INVISIBLE_CHAR); + node.parentNode.insertBefore(tmpNode, node); + + // Set selection and remove tmpNode + rng.setStart(node, 0); + selection.setRng(rng); + dom.remove(tmpNode); + + return; + } + } + } + }; // Merges the styles for each node function process(node) { @@ -13312,8 +15553,8 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { if (startContainer != endContainer) { // Wrap start/end nodes in span element since these might be cloned/moved - startContainer = wrap(startContainer, 'span', {id : '_start', _mce_type : 'bookmark'}); - endContainer = wrap(endContainer, 'span', {id : '_end', _mce_type : 'bookmark'}); + startContainer = wrap(startContainer, 'span', {id : '_start', 'data-mce-type' : 'bookmark'}); + endContainer = wrap(endContainer, 'span', {id : '_end', 'data-mce-type' : 'bookmark'}); // Split start/end splitToFormatRoot(startContainer); @@ -13336,30 +15577,53 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { rangeUtils.walk(rng, function(nodes) { each(nodes, function(node) { process(node); + + // Remove parent span if it only contains text-decoration: underline, yet a parent node is also underlined. + if (node.nodeType === 1 && ed.dom.getStyle(node, 'text-decoration') === 'underline' && node.parentNode && getTextDecoration(node.parentNode) === 'underline') { + removeFormat({'deep': false, 'exact': true, 'inline': 'span', 'styles': {'textDecoration' : 'underline'}}, null, node); + } }); }); }; // Handle node if (node) { - rng = dom.createRng(); - rng.setStartBefore(node); - rng.setEndAfter(node); - removeRngStyle(rng); + if (node.nodeType) { + rng = dom.createRng(); + rng.setStartBefore(node); + rng.setEndAfter(node); + removeRngStyle(rng); + } else { + removeRngStyle(node); + } + return; } - if (!selection.isCollapsed() || !format.inline) { + if (!selection.isCollapsed() || !format.inline || dom.select('td.mceSelected,th.mceSelected').length) { bookmark = selection.getBookmark(); removeRngStyle(selection.getRng(TRUE)); selection.moveToBookmark(bookmark); + + // Check if start element still has formatting then we are at: "text|text" and need to move the start into the next text node + if (format.inline && match(name, vars, selection.getStart())) { + moveStart(selection.getRng(true)); + } + ed.nodeChanged(); } else performCaretAction('remove', name, vars); + + // When you remove formatting from a table cell in WebKit (cell, not the contents of a cell) there is a rendering issue with column width + if (tinymce.isWebKit) { + ed.execCommand('mceCleanup'); + } }; function toggle(name, vars, node) { - if (match(name, vars, node)) + var fmt = get(name); + + if (match(name, vars, node) && (!('toggle' in fmt[0]) || fmt[0]['toggle'])) remove(name, vars, node); else apply(name, vars, node); @@ -13371,6 +15635,11 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { function matchItems(node, format, item_name) { var key, value, items = format[item_name], i; + // Custom match + if (format.onmatch) { + return format.onmatch(node, format, item_name); + } + // Check all items if (items) { // Non indexed object @@ -13423,7 +15692,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { }; function match(name, vars, node) { - var startNode, i; + var startNode; function matchParents(node) { // Find first node with similar format settings @@ -13439,21 +15708,6 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { if (node) return matchParents(node); - // Check pending formats - if (selection.isCollapsed()) { - for (i = pendingFormats.apply.length - 1; i >= 0; i--) { - if (pendingFormats.apply[i].name == name) - return true; - } - - for (i = pendingFormats.remove.length - 1; i >= 0; i--) { - if (pendingFormats.remove[i].name == name) - return false; - } - - return matchParents(selection.getNode()); - } - // Check selected node node = selection.getNode(); if (matchParents(node)) @@ -13472,33 +15726,6 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { function matchAll(names, vars) { var startElement, matchedFormatNames = [], checkedMap = {}, i, ni, name; - // If the selection is collapsed then check pending formats - if (selection.isCollapsed()) { - for (ni = 0; ni < names.length; ni++) { - // If the name is to be removed, then stop it from being added - for (i = pendingFormats.remove.length - 1; i >= 0; i--) { - name = names[ni]; - - if (pendingFormats.remove[i].name == name) { - checkedMap[name] = true; - break; - } - } - } - - // If the format is to be applied - for (i = pendingFormats.apply.length - 1; i >= 0; i--) { - for (ni = 0; ni < names.length; ni++) { - name = names[ni]; - - if (!checkedMap[name] && pendingFormats.apply[i].name == name) { - checkedMap[name] = true; - matchedFormatNames.push(name); - } - } - } - } - // Check start of selection for formats startElement = selection.getStart(); dom.getParent(startElement, function(node) { @@ -13607,7 +15834,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { }; function isWhiteSpaceNode(node) { - return node && node.nodeType === 3 && /^([\s\r\n]+|)$/.test(node.nodeValue); + return node && node.nodeType === 3 && /^([\t \r\n]+|)$/.test(node.nodeValue); }; function wrap(node, name, attrs) { @@ -13623,36 +15850,55 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { var startContainer = rng.startContainer, startOffset = rng.startOffset, endContainer = rng.endContainer, - endOffset = rng.endOffset, sibling, lastIdx; + endOffset = rng.endOffset, sibling, lastIdx, leaf, endPoint; // This function walks up the tree if there is no siblings before/after the node - function findParentContainer(container, child_name, sibling_name, root) { - var parent, child; + function findParentContainer(start) { + var container, parent, child, sibling, siblingName; - root = root || dom.getRoot(); + container = parent = start ? startContainer : endContainer; + siblingName = start ? 'previousSibling' : 'nextSibling'; + root = dom.getRoot(); - for (;;) { - // Check if we can move up are we at root level or body level - parent = container.parentNode; + // If it's a text node and the offset is inside the text + if (container.nodeType == 3 && !isWhiteSpaceNode(container)) { + if (start ? startOffset > 0 : endOffset < container.nodeValue.length) { + return container; + } + } + for (;;) { // Stop expanding on block elements or root depending on format if (parent == root || (!format[0].block_expand && isBlock(parent))) - return container; + return parent; - for (sibling = parent[child_name]; sibling && sibling != container; sibling = sibling[sibling_name]) { - if (sibling.nodeType == 1 && !isBookmarkNode(sibling)) - return container; - - if (sibling.nodeType == 3 && !isWhiteSpaceNode(sibling)) - return container; + // Walk left/right + for (sibling = parent[siblingName]; sibling; sibling = sibling[siblingName]) { + if (!isBookmarkNode(sibling) && !isWhiteSpaceNode(sibling)) { + return parent; + } } - container = container.parentNode; + // Check if we can move up are we at root level or body level + parent = parent.parentNode; } return container; }; + // This function walks down the tree to find the leaf at the selection. + // The offset is also returned as if node initially a leaf, the offset may be in the middle of the text node. + function findLeaf(node, offset) { + if (offset === undefined) + offset = node.nodeType === 3 ? node.length : node.childNodes.length; + while (node && node.hasChildNodes()) { + node = node.childNodes[offset]; + if (node) + offset = node.nodeType === 3 ? node.length : node.childNodes.length; + } + return { node: node, offset: offset }; + } + // If index based start position then resolve it if (startContainer.nodeType == 1 && startContainer.hasChildNodes()) { lastIdx = startContainer.childNodes.length - 1; @@ -13672,31 +15918,141 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { } // Exclude bookmark nodes if possible - if (isBookmarkNode(startContainer.parentNode)) - startContainer = startContainer.parentNode; - - if (isBookmarkNode(startContainer)) + if (isBookmarkNode(startContainer.parentNode) || isBookmarkNode(startContainer)) { + startContainer = isBookmarkNode(startContainer) ? startContainer : startContainer.parentNode; startContainer = startContainer.nextSibling || startContainer; - if (isBookmarkNode(endContainer.parentNode)) - endContainer = endContainer.parentNode; + if (startContainer.nodeType == 3) + startOffset = 0; + } - if (isBookmarkNode(endContainer)) + if (isBookmarkNode(endContainer.parentNode) || isBookmarkNode(endContainer)) { + endContainer = isBookmarkNode(endContainer) ? endContainer : endContainer.parentNode; endContainer = endContainer.previousSibling || endContainer; + if (endContainer.nodeType == 3) + endOffset = endContainer.length; + } + + if (format[0].inline) { + if (rng.collapsed) { + function findWordEndPoint(container, offset, start) { + var walker, node, pos, lastTextNode; + + function findSpace(node, offset) { + var pos, pos2, str = node.nodeValue; + + if (typeof(offset) == "undefined") { + offset = start ? str.length : 0; + } + + if (start) { + pos = str.lastIndexOf(' ', offset); + pos2 = str.lastIndexOf('\u00a0', offset); + pos = pos > pos2 ? pos : pos2; + + // Include the space on remove to avoid tag soup + if (pos !== -1 && !remove) { + pos++; + } + } else { + pos = str.indexOf(' ', offset); + pos2 = str.indexOf('\u00a0', offset); + pos = pos !== -1 && (pos2 === -1 || pos < pos2) ? pos : pos2; + } + + return pos; + }; + + if (container.nodeType === 3) { + pos = findSpace(container, offset); + + if (pos !== -1) { + return {container : container, offset : pos}; + } + + lastTextNode = container; + } + + // Walk the nodes inside the block + walker = new TreeWalker(container, dom.getParent(container, isBlock) || ed.getBody()); + while (node = walker[start ? 'prev' : 'next']()) { + if (node.nodeType === 3) { + lastTextNode = node; + pos = findSpace(node); + + if (pos !== -1) { + return {container : node, offset : pos}; + } + } else if (isBlock(node)) { + break; + } + } + + if (lastTextNode) { + if (start) { + offset = 0; + } else { + offset = lastTextNode.length; + } + + return {container: lastTextNode, offset: offset}; + } + } + + // Expand left to closest word boundery + endPoint = findWordEndPoint(startContainer, startOffset, true); + if (endPoint) { + startContainer = endPoint.container; + startOffset = endPoint.offset; + } + + // Expand right to closest word boundery + endPoint = findWordEndPoint(endContainer, endOffset); + if (endPoint) { + endContainer = endPoint.container; + endOffset = endPoint.offset; + } + } + + // Avoid applying formatting to a trailing space. + leaf = findLeaf(endContainer, endOffset); + if (leaf.node) { + while (leaf.node && leaf.offset === 0 && leaf.node.previousSibling) + leaf = findLeaf(leaf.node.previousSibling); + + if (leaf.node && leaf.offset > 0 && leaf.node.nodeType === 3 && + leaf.node.nodeValue.charAt(leaf.offset - 1) === ' ') { + + if (leaf.offset > 1) { + endContainer = leaf.node; + endContainer.splitText(leaf.offset - 1); + } else if (leaf.node.previousSibling) { + // TODO: Figure out why this is in here + //endContainer = leaf.node.previousSibling; + } + } + } + } + // Move start/end point up the tree if the leaves are sharp and if we are in different containers // Example * becomes !: !

    *texttext*

    ! // This will reduce the number of wrapper elements that needs to be created // Move start point up the tree if (format[0].inline || format[0].block_expand) { - startContainer = findParentContainer(startContainer, 'firstChild', 'nextSibling'); - endContainer = findParentContainer(endContainer, 'lastChild', 'previousSibling'); + if (!format[0].inline || (startContainer.nodeType != 3 || startOffset === 0)) { + startContainer = findParentContainer(true); + } + + if (!format[0].inline || (endContainer.nodeType != 3 || endOffset === endContainer.nodeValue.length)) { + endContainer = findParentContainer(); + } } // Expand start/end container to matching selector if (format[0].selector && format[0].expand !== FALSE && !format[0].inline) { function findSelectorEndPoint(container, sibling_name) { - var parents, i, y; + var parents, i, y, curFormat; if (container.nodeType == 3 && container.nodeValue.length == 0 && container[sibling_name]) container = container[sibling_name]; @@ -13704,7 +16060,13 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { parents = getParents(container); for (i = 0; i < parents.length; i++) { for (y = 0; y < format.length; y++) { - if (dom.is(parents[i], format[y].selector)) + curFormat = format[y]; + + // If collapsed state is set then skip formats that doesn't match that + if ("collapsed" in curFormat && curFormat.collapsed !== rng.collapsed) + continue; + + if (dom.is(parents[i], curFormat.selector)) return parents[i]; } } @@ -13758,10 +16120,10 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { // Non block element then try to expand up the leaf if (format[0].block) { if (!isBlock(startContainer)) - startContainer = findParentContainer(startContainer, 'firstChild', 'nextSibling'); + startContainer = findParentContainer(true); if (!isBlock(endContainer)) - endContainer = findParentContainer(endContainer, 'lastChild', 'previousSibling'); + endContainer = findParentContainer(); } } @@ -13814,7 +16176,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { // Remove style attribute if it's empty if (stylesModified && dom.getAttrib(node, 'style') == '') { node.removeAttribute('style'); - node.removeAttribute('_mce_style'); + node.removeAttribute('data-mce-style'); } // Remove attributes @@ -13855,7 +16217,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { // Remove mce prefixed attributes if (MCE_ATTR_RE.test(name)) - node.removeAttribute('_mce_' + name); + node.removeAttribute('data-mce-' + name); node.removeAttribute(name); } @@ -13940,7 +16302,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { }; function isBookmarkNode(node) { - return node && node.nodeType == 1 && node.getAttribute('_mce_type') == 'bookmark'; + return node && node.nodeType == 1 && node.getAttribute('data-mce-type') == 'bookmark'; }; function mergeSiblings(prev, next) { @@ -14011,7 +16373,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { if (prev && next) { function findElementSibling(node, sibling_name) { for (sibling = node; sibling; sibling = sibling[sibling_name]) { - if (sibling.nodeType == 3 && !isWhiteSpaceNode(sibling)) + if (sibling.nodeType == 3 && sibling.nodeValue.length !== 0) return node; if (sibling.nodeType == 1 && !isBookmarkNode(sibling)) @@ -14054,7 +16416,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { }; function getContainer(rng, start) { - var container, offset, lastIdx; + var container, offset, lastIdx, walker; container = rng[start ? 'startContainer' : 'endContainer']; offset = rng[start ? 'startOffset' : 'endOffset']; @@ -14068,103 +16430,267 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { container = container.childNodes[offset > lastIdx ? lastIdx : offset]; } + // If start text node is excluded then walk to the next node + if (container.nodeType === 3 && start && offset >= container.nodeValue.length) { + container = new TreeWalker(container, ed.getBody()).next() || container; + } + + // If end text node is excluded then walk to the previous node + if (container.nodeType === 3 && !start && offset == 0) { + container = new TreeWalker(container, ed.getBody()).prev() || container; + } + return container; }; function performCaretAction(type, name, vars) { - var i, currentPendingFormats = pendingFormats[type], - otherPendingFormats = pendingFormats[type == 'apply' ? 'remove' : 'apply']; + var invisibleChar, caretContainerId = '_mce_caret', debug = ed.settings.caret_debug; + + // Setup invisible character use zero width space on Gecko since it doesn't change the heigt of the container + invisibleChar = tinymce.isGecko ? '\u200B' : INVISIBLE_CHAR; + + // Creates a caret container bogus element + function createCaretContainer(fill) { + var caretContainer = dom.create('span', {id: caretContainerId, 'data-mce-bogus': true, style: debug ? 'color:red' : ''}); + + if (fill) { + caretContainer.appendChild(ed.getDoc().createTextNode(invisibleChar)); + } + + return caretContainer; + }; + + function isCaretContainerEmpty(node, nodes) { + while (node) { + if ((node.nodeType === 3 && node.nodeValue !== invisibleChar) || node.childNodes.length > 1) { + return false; + } + + // Collect nodes + if (nodes && node.nodeType === 1) { + nodes.push(node); + } + + node = node.firstChild; + } - function hasPending() { - return pendingFormats.apply.length || pendingFormats.remove.length; + return true; }; + + // Returns any parent caret container element + function getParentCaretContainer(node) { + while (node) { + if (node.id === caretContainerId) { + return node; + } - function resetPending() { - pendingFormats.apply = []; - pendingFormats.remove = []; + node = node.parentNode; + } }; - function perform(caret_node) { - // Apply pending formats - each(pendingFormats.apply.reverse(), function(item) { - apply(item.name, item.vars, caret_node); - }); + // Finds the first text node in the specified node + function findFirstTextNode(node) { + var walker; - // Remove pending formats - each(pendingFormats.remove.reverse(), function(item) { - remove(item.name, item.vars, caret_node); - }); + if (node) { + walker = new TreeWalker(node, node); + + for (node = walker.current(); node; node = walker.next()) { + if (node.nodeType === 3) { + return node; + } + } + } + }; + + // Removes the caret container for the specified node or all on the current document + function removeCaretContainer(node, move_caret) { + var child, rng; + + if (!node) { + node = getParentCaretContainer(selection.getStart()); + + if (!node) { + while (node = dom.get(caretContainerId)) { + removeCaretContainer(node, false); + } + } + } else { + rng = selection.getRng(true); + + if (isCaretContainerEmpty(node)) { + if (move_caret !== false) { + rng.setStartBefore(node); + rng.setEndBefore(node); + } + + dom.remove(node); + } else { + child = findFirstTextNode(node); + child = child.deleteData(0, 1); + dom.remove(node, 1); + } + + selection.setRng(rng); + } + }; + + // Applies formatting to the caret postion + function applyCaretFormat() { + var rng, caretContainer, textNode, offset, bookmark, container, text; + + rng = selection.getRng(true); + offset = rng.startOffset; + container = rng.startContainer; + text = container.nodeValue; + + caretContainer = getParentCaretContainer(selection.getStart()); + if (caretContainer) { + textNode = findFirstTextNode(caretContainer); + } + + // Expand to word is caret is in the middle of a text node and the char before/after is a alpha numeric character + if (text && offset > 0 && offset < text.length && /\w/.test(text.charAt(offset)) && /\w/.test(text.charAt(offset - 1))) { + // Get bookmark of caret position + bookmark = selection.getBookmark(); + + // Collapse bookmark range (WebKit) + rng.collapse(true); + + // Expand the range to the closest word and split it at those points + rng = expandRng(rng, get(name)); + rng = rangeUtils.split(rng); + + // Apply the format to the range + apply(name, vars, rng); + + // Move selection back to caret position + selection.moveToBookmark(bookmark); + } else { + if (!caretContainer || textNode.nodeValue !== invisibleChar) { + caretContainer = createCaretContainer(true); + textNode = caretContainer.firstChild; + + rng.insertNode(caretContainer); + offset = 1; + + apply(name, vars, caretContainer); + } else { + apply(name, vars, caretContainer); + } - dom.remove(caret_node, 1); - resetPending(); + // Move selection to text node + selection.setCursorLocation(textNode, offset); + } }; - // Check if it already exists then ignore it - for (i = currentPendingFormats.length - 1; i >= 0; i--) { - if (currentPendingFormats[i].name == name) + function removeCaretFormat() { + var rng = selection.getRng(true), container, offset, bookmark, + hasContentAfter, node, formatNode, parents = [], i, caretContainer; + + container = rng.startContainer; + offset = rng.startOffset; + node = container; + + if (container.nodeType == 3) { + if (offset != container.nodeValue.length || container.nodeValue === invisibleChar) { + hasContentAfter = true; + } + + node = node.parentNode; + } + + while (node) { + if (matchNode(node, name, vars)) { + formatNode = node; + break; + } + + if (node.nextSibling) { + hasContentAfter = true; + } + + parents.push(node); + node = node.parentNode; + } + + // Node doesn't have the specified format + if (!formatNode) { return; - } + } - currentPendingFormats.push({name : name, vars : vars}); + // Is there contents after the caret then remove the format on the element + if (hasContentAfter) { + // Get bookmark of caret position + bookmark = selection.getBookmark(); - // Check if it's in the other type, then remove it - for (i = otherPendingFormats.length - 1; i >= 0; i--) { - if (otherPendingFormats[i].name == name) - otherPendingFormats.splice(i, 1); - } + // Collapse bookmark range (WebKit) + rng.collapse(true); - // Pending apply or remove formats - if (hasPending()) { - ed.getDoc().execCommand('FontName', false, 'mceinline'); - pendingFormats.lastRng = selection.getRng(); + // Expand the range to the closest word and split it at those points + rng = expandRng(rng, get(name), true); + rng = rangeUtils.split(rng); - // IE will convert the current word - each(dom.select('font,span'), function(node) { - var bookmark; + // Remove the format from the range + remove(name, vars, rng); - if (isCaretNode(node)) { - bookmark = selection.getBookmark(); - perform(node); - selection.moveToBookmark(bookmark); - ed.nodeChanged(); + // Move selection back to caret position + selection.moveToBookmark(bookmark); + } else { + caretContainer = createCaretContainer(); + + node = caretContainer; + for (i = parents.length - 1; i >= 0; i--) { + node.appendChild(parents[i].cloneNode(false)); + node = node.firstChild; + } + + // Insert invisible character into inner most format element + node.appendChild(dom.doc.createTextNode(invisibleChar)); + node = node.firstChild; + + // Insert caret container after the formated node + dom.insertAfter(caretContainer, formatNode); + + // Move selection to text node + selection.setCursorLocation(node, 1); + } + }; + + // Mark current caret container elements as bogus when getting the contents so we don't end up with empty elements + ed.onBeforeGetContent.addToTop(function() { + var nodes = [], i; + + if (isCaretContainerEmpty(getParentCaretContainer(selection.getStart()), nodes)) { + // Mark children + i = nodes.length; + while (i--) { + dom.setAttrib(nodes[i], 'data-mce-bogus', '1'); } + } + }); + + // Remove caret container on mouse up and on key up + tinymce.each('onMouseUp onKeyUp'.split(' '), function(name) { + ed[name].addToTop(function() { + removeCaretContainer(); }); + }); - // Only register listeners once if we need to - if (!pendingFormats.isListening && hasPending()) { - pendingFormats.isListening = true; - - each('onKeyDown,onKeyUp,onKeyPress,onMouseUp'.split(','), function(event) { - ed[event].addToTop(function(ed, e) { - // Do we have pending formats and is the selection moved has moved - if (hasPending() && !tinymce.dom.RangeUtils.compareRanges(pendingFormats.lastRng, selection.getRng())) { - each(dom.select('font,span'), function(node) { - var textNode, rng; - - // Look for marker - if (isCaretNode(node)) { - textNode = node.firstChild; - - if (textNode) { - perform(node); - - rng = dom.createRng(); - rng.setStart(textNode, textNode.nodeValue.length); - rng.setEnd(textNode, textNode.nodeValue.length); - selection.setRng(rng); - ed.nodeChanged(); - } else - dom.remove(node); - } - }); + // Remove caret container on keydown and it's a backspace, enter or left/right arrow keys + ed.onKeyDown.addToTop(function(ed, e) { + var keyCode = e.keyCode; - // Always unbind and clear pending styles on keyup - if (e.type == 'keyup' || e.type == 'mouseup') - resetPending(); - } - }); - }); + if (keyCode == 8 || keyCode == 37 || keyCode == 39) { + removeCaretContainer(getParentCaretContainer(selection.getStart())); } + }); + + // Do apply or remove caret format + if (type == "apply") { + applyCaretFormat(); + } else { + removeCaretFormat(); } }; }; @@ -14174,12 +16700,15 @@ tinymce.onAddEditor.add(function(tinymce, ed) { var filters, fontSizes, dom, settings = ed.settings; if (settings.inline_styles) { - fontSizes = tinymce.explode(settings.font_size_style_values); + fontSizes = tinymce.explode(settings.font_size_legacy_values); function replaceWithSpan(node, styles) { - dom.replace(dom.create('span', { - style : styles - }), node, 1); + tinymce.each(styles, function(value, name) { + if (value) + dom.setStyle(node, name, value); + }); + + dom.rename(node, 'span'); }; filters = { @@ -14216,6 +16745,7 @@ tinymce.onAddEditor.add(function(tinymce, ed) { }; ed.onPreProcess.add(convert); + ed.onSetContent.add(convert); ed.onInit.add(function() { ed.selection.onSetContent.add(convert); diff --git a/js/tiny_mce/tiny_mce_src.js b/js/tiny_mce/tiny_mce_src.js index 9db8d18fe0..0866d617b6 100644 --- a/js/tiny_mce/tiny_mce_src.js +++ b/js/tiny_mce/tiny_mce_src.js @@ -1,13 +1,13 @@ (function(win) { var whiteSpaceRe = /^\s*|\s*$/g, - undefined; + undefined, isRegExpBroken = 'B'.replace(/A(.)|B/, '$1') === '$1'; var tinymce = { majorVersion : '3', - minorVersion : '3.7', + minorVersion : '4.7', - releaseDate : '2010-06-10', + releaseDate : '2011-11-03', _init : function() { var t = this, d = document, na = navigator, ua = na.userAgent, i, nl, n, base, p, v; @@ -20,6 +20,12 @@ t.isIE6 = t.isIE && /MSIE [56]/.test(ua); + t.isIE7 = t.isIE && /MSIE [7]/.test(ua); + + t.isIE8 = t.isIE && /MSIE [8]/.test(ua); + + t.isIE9 = t.isIE && /MSIE [9]/.test(ua); + t.isGecko = !t.isWebKit && /Gecko/.test(ua); t.isMac = ua.indexOf('Mac') != -1; @@ -27,6 +33,8 @@ t.isAir = /adobeair/i.test(ua); t.isIDevice = /(iPad|iPhone)/.test(ua); + + t.isIOS5 = t.isIDevice && ua.match(/AppleWebKit\/(\d*)/)[1]>=534; // TinyMCE .NET webcontrol might be setting the values for TinyMCE if (win.tinyMCEPreInit) { @@ -52,7 +60,7 @@ } function getBase(n) { - if (n.src && /tiny_mce(|_gzip|_jquery|_prototype)(_dev|_src)?.js/.test(n.src)) { + if (n.src && /tiny_mce(|_gzip|_jquery|_prototype|_full)(_dev|_src)?.js/.test(n.src)) { if (/_(src|dev)\.js/g.test(n.src)) t.suffix = '_src'; @@ -103,6 +111,24 @@ return typeof(o) == t; }, + makeMap : function(items, delim, map) { + var i; + + items = items || []; + delim = delim || ','; + + if (typeof(items) == "string") + items = items.split(delim); + + map = map || {}; + + i = items.length; + while (i--) + map[items[i]] = {}; + + return map; + }, + each : function(o, cb, s) { var n, l; @@ -185,7 +211,7 @@ return (s ? '' + s : '').replace(whiteSpaceRe, ''); }, - create : function(s, p) { + create : function(s, p, root) { var t = this, sp, ns, cn, scn, c, de = 0; // Parse : : @@ -193,7 +219,7 @@ cn = s[3].match(/(^|\.)(\w+)$/i)[2]; // Class name // Create namespace for new class - ns = t.createNS(s[3].replace(/\.\w+$/, '')); + ns = t.createNS(s[3].replace(/\.\w+$/, ''), root); // Class already exists if (ns[cn]) @@ -428,6 +454,29 @@ return u + v; return u.replace('#', v + '#'); + }, + + // Fix function for IE 9 where regexps isn't working correctly + // Todo: remove me once MS fixes the bug + _replace : function(find, replace, str) { + // On IE9 we have to fake $x replacement + if (isRegExpBroken) { + return str.replace(find, function() { + var val = replace, args = arguments, i; + + for (i = 0; i < args.length - 2; i++) { + if (args[i] === undefined) { + val = val.replace(new RegExp('\\$' + i, 'g'), ''); + } else { + val = val.replace(new RegExp('\\$' + i, 'g'), args[i]); + } + } + + return val; + }); + } + + return str.replace(find, replace); } }; @@ -437,7 +486,11 @@ // Expose tinymce namespace to the global namespace (window) win.tinymce = win.tinyMCE = tinymce; -})(window); + + // Describe the different namespaces + + })(window); + tinymce.create('tinymce.util.Dispatcher', { @@ -498,7 +551,7 @@ tinymce.create('tinymce.util.Dispatcher', { tinymce.create('tinymce.util.URI', { URI : function(u, s) { - var t = this, o, a, b; + var t = this, o, a, b, base_url; // Trim whitespace u = tinymce.trim(u); @@ -506,8 +559,9 @@ tinymce.create('tinymce.util.Dispatcher', { // Default settings s = t.settings = s || {}; - // Strange app protocol or local anchor - if (/^(mailto|tel|news|javascript|about|data):/i.test(u) || /^\s*#/.test(u)) { + // Strange app protocol that isn't http/https or local anchor + // For example: mailto,skype,tel etc. + if (/^([\w\-]+):([^\/]{2})/i.test(u) || /^\s*#/.test(u)) { t.source = u; return; } @@ -517,8 +571,10 @@ tinymce.create('tinymce.util.Dispatcher', { u = (s.base_uri ? s.base_uri.protocol || 'http' : 'http') + '://mce_host' + u; // Relative path http:// or protocol relative //path - if (!/^\w*:?\/\//.test(u)) - u = (s.base_uri.protocol || 'http') + '://mce_host' + t.toAbsPath(s.base_uri.path, u); + if (!/^[\w-]*:?\/\//.test(u)) { + base_url = s.base_uri ? s.base_uri.path : new tinymce.util.URI(location.href).directory; + u = ((s.base_uri && s.base_uri.protocol) || 'http') + '://mce_host' + t.toAbsPath(base_url, u); + } // Parse URL (Credits goes to Steave, http://blog.stevenlevithan.com/archives/parseuri) u = u.replace(/@@/g, '(mce_at)'); // Zope 3 workaround, they use @@something @@ -805,9 +861,11 @@ tinymce.create('tinymce.util.Dispatcher', { }); })(); -tinymce.create('static tinymce.util.JSON', { - serialize : function(o) { - var i, v, s = tinymce.util.JSON.serialize, t; +(function() { + function serialize(o, quote) { + var i, v, t; + + quote = quote || '"'; if (o == null) return 'null'; @@ -817,7 +875,11 @@ tinymce.create('static tinymce.util.JSON', { if (t == 'string') { v = '\bb\tt\nn\ff\rr\""\'\'\\\\'; - return '"' + o.replace(/([\u0080-\uFFFF\x00-\x1f\"])/g, function(a, b) { + return quote + o.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g, function(a, b) { + // Make sure single quotes never get encoded inside double quotes for JSON compatibility + if (quote === '"' && a === "'") + return a; + i = v.indexOf(b); if (i + 1) @@ -826,37 +888,44 @@ tinymce.create('static tinymce.util.JSON', { a = b.charCodeAt().toString(16); return '\\u' + '0000'.substring(a.length) + a; - }) + '"'; + }) + quote; } if (t == 'object') { if (o.hasOwnProperty && o instanceof Array) { for (i=0, v = '['; i 0 ? ',' : '') + s(o[i]); + v += (i > 0 ? ',' : '') + serialize(o[i], quote); return v + ']'; } v = '{'; - for (i in o) - v += typeof o[i] != 'function' ? (v.length > 1 ? ',"' : '"') + i + '":' + s(o[i]) : ''; + for (i in o) { + if (o.hasOwnProperty(i)) { + v += typeof o[i] != 'function' ? (v.length > 1 ? ',' + quote : quote) + i + quote +':' + serialize(o[i], quote) : ''; + } + } return v + '}'; } return '' + o; - }, + }; - parse : function(s) { - try { - return eval('(' + s + ')'); - } catch (ex) { - // Ignore + tinymce.util.JSON = { + serialize: serialize, + + parse: function(s) { + try { + return eval('(' + s + ')'); + } catch (ex) { + // Ignore + } } - } - }); + }; +})(); tinymce.create('static tinymce.util.XHR', { send : function(o) { @@ -948,7 +1017,8 @@ tinymce.create('static tinymce.util.XHR', { }; o.error = function(ty, x) { - ecb.call(o.error_scope || o.scope, ty, x); + if (ecb) + ecb.call(o.error_scope || o.scope, ty, x); }; o.data = JSON.serialize({ @@ -970,5862 +1040,7523 @@ tinymce.create('static tinymce.util.XHR', { } }); }()); +(function(tinymce){ + tinymce.VK = { + DELETE: 46, + BACKSPACE: 8, + ENTER: 13, + TAB: 9, + SPACEBAR: 32, + UP: 38, + DOWN: 40 + } +})(tinymce); + (function(tinymce) { - // Shorten names - var each = tinymce.each, - is = tinymce.is, - isWebKit = tinymce.isWebKit, - isIE = tinymce.isIE, - blockRe = /^(H[1-6R]|P|DIV|ADDRESS|PRE|FORM|T(ABLE|BODY|HEAD|FOOT|H|R|D)|LI|OL|UL|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|NOSCRIPT|MENU|ISINDEX|SAMP)$/, - boolAttrs = makeMap('checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected'), - mceAttribs = makeMap('src,href,style,coords,shape'), - encodedChars = {'&' : '&', '"' : '"', '<' : '<', '>' : '>'}, - encodeCharsRe = /[<>&\"]/g, - simpleSelectorRe = /^([a-z0-9],?)+$/i, - tagRegExp = /<(\w+)((?:\s+\w+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)(\s*\/?)>/g, - attrRegExp = /(\w+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g; + var VK = tinymce.VK, BACKSPACE = VK.BACKSPACE, DELETE = VK.DELETE; - function makeMap(str) { - var map = {}, i; + function cleanupStylesWhenDeleting(ed) { + var dom = ed.dom, selection = ed.selection; - str = str.split(','); - for (i = str.length; i >= 0; i--) - map[str[i]] = 1; + ed.onKeyDown.add(function(ed, e) { + var rng, blockElm, node, clonedSpan, isDelete; - return map; - }; + isDelete = e.keyCode == DELETE; + if (isDelete || e.keyCode == BACKSPACE) { + e.preventDefault(); + rng = selection.getRng(); - tinymce.create('tinymce.dom.DOMUtils', { - doc : null, - root : null, - files : null, - pixelStyles : /^(top|left|bottom|right|width|height|borderWidth)$/, - props : { - "for" : "htmlFor", - "class" : "className", - className : "className", - checked : "checked", - disabled : "disabled", - maxlength : "maxLength", - readonly : "readOnly", - selected : "selected", - value : "value", - id : "id", - name : "name", - type : "type" - }, + // Find root block + blockElm = dom.getParent(rng.startContainer, dom.isBlock); - DOMUtils : function(d, s) { - var t = this, globalStyle; + // On delete clone the root span of the next block element + if (isDelete) + blockElm = dom.getNext(blockElm, dom.isBlock); - t.doc = d; - t.win = window; - t.files = {}; - t.cssFlicker = false; - t.counter = 0; - t.boxModel = !tinymce.isIE || d.compatMode == "CSS1Compat"; - t.stdMode = d.documentMode === 8; + // Locate root span element and clone it since it would otherwise get merged by the "apple-style-span" on delete/backspace + if (blockElm) { + node = blockElm.firstChild; - t.settings = s = tinymce.extend({ - keep_values : false, - hex_colors : 1, - process_html : 1 - }, s); + // Ignore empty text nodes + while (node && node.nodeType == 3 && node.nodeValue.length == 0) + node = node.nextSibling; - // Fix IE6SP2 flicker and check it failed for pre SP2 - if (tinymce.isIE6) { - try { - d.execCommand('BackgroundImageCache', false, true); - } catch (e) { - t.cssFlicker = true; + if (node && node.nodeName === 'SPAN') { + clonedSpan = node.cloneNode(false); + } } - } - // Build styles list - if (s.valid_styles) { - t._styles = {}; + // Do the backspace/delete actiopn + ed.getDoc().execCommand(isDelete ? 'ForwardDelete' : 'Delete', false, null); + + // Find all odd apple-style-spans + blockElm = dom.getParent(rng.startContainer, dom.isBlock); + tinymce.each(dom.select('span.Apple-style-span,font.Apple-style-span', blockElm), function(span) { + var bm = selection.getBookmark(); + + if (clonedSpan) { + dom.replace(clonedSpan.cloneNode(false), span, true); + } else { + dom.remove(span, true); + } - // Convert styles into a rule list - each(s.valid_styles, function(value, key) { - t._styles[key] = tinymce.explode(value); + // Restore the selection + selection.moveToBookmark(bm); }); } + }); + }; - tinymce.addUnload(t.destroy, t); - }, + function emptyEditorWhenDeleting(ed) { + ed.onKeyUp.add(function(ed, e) { + var keyCode = e.keyCode; - getRoot : function() { - var t = this, s = t.settings; + if (keyCode == DELETE || keyCode == BACKSPACE) { + if (ed.dom.isEmpty(ed.getBody())) { + ed.setContent('', {format : 'raw'}); + ed.nodeChanged(); + return; + } + } + }); + }; - return (s && t.get(s.root_element)) || t.doc.body; - }, + function inputMethodFocus(ed) { + ed.dom.bind(ed.getDoc(), 'focusin', function() { + ed.selection.setRng(ed.selection.getRng()); + }); + }; - getViewPort : function(w) { - var d, b; + function removeHrOnBackspace(ed) { + ed.onKeyDown.add(function(ed, e) { + if (e.keyCode === BACKSPACE) { + if (ed.selection.isCollapsed() && ed.selection.getRng(true).startOffset === 0) { + var node = ed.selection.getNode(); + var previousSibling = node.previousSibling; + if (previousSibling && previousSibling.nodeName && previousSibling.nodeName.toLowerCase() === "hr") { + ed.dom.remove(previousSibling); + tinymce.dom.Event.cancel(e); + } + } + } + }) + } - w = !w ? this.win : w; - d = w.document; - b = this.boxModel ? d.documentElement : d.body; + function focusBody(ed) { + // Fix for a focus bug in FF 3.x where the body element + // wouldn't get proper focus if the user clicked on the HTML element + if (!Range.prototype.getClientRects) { // Detect getClientRects got introduced in FF 4 + ed.onMouseDown.add(function(ed, e) { + if (e.target.nodeName === "HTML") { + var body = ed.getBody(); + + // Blur the body it's focused but not correctly focused + body.blur(); + + // Refocus the body after a little while + setTimeout(function() { + body.focus(); + }, 0); + } + }); + } + }; - // Returns viewport size excluding scrollbars - return { - x : w.pageXOffset || b.scrollLeft, - y : w.pageYOffset || b.scrollTop, - w : w.innerWidth || b.clientWidth, - h : w.innerHeight || b.clientHeight - }; - }, + function selectControlElements(ed) { + ed.onClick.add(function(ed, e) { + e = e.target; - getRect : function(e) { - var p, t = this, sr; + // Workaround for bug, http://bugs.webkit.org/show_bug.cgi?id=12250 + // WebKit can't even do simple things like selecting an image + // Needs tobe the setBaseAndExtend or it will fail to select floated images + if (/^(IMG|HR)$/.test(e.nodeName)) + ed.selection.getSel().setBaseAndExtent(e, 0, e, 1); - e = t.get(e); - p = t.getPos(e); - sr = t.getSize(e); + if (e.nodeName == 'A' && ed.dom.hasClass(e, 'mceItemAnchor')) + ed.selection.select(e); - return { - x : p.x, - y : p.y, - w : sr.w, - h : sr.h - }; - }, + ed.nodeChanged(); + }); + }; - getSize : function(e) { - var t = this, w, h; + function selectionChangeNodeChanged(ed) { + var lastRng, selectionTimer; - e = t.get(e); - w = t.getStyle(e, 'width'); - h = t.getStyle(e, 'height'); + ed.dom.bind(ed.getDoc(), 'selectionchange', function() { + if (selectionTimer) { + clearTimeout(selectionTimer); + selectionTimer = 0; + } - // Non pixel value, then force offset/clientWidth - if (w.indexOf('px') === -1) - w = 0; + selectionTimer = window.setTimeout(function() { + var rng = ed.selection.getRng(); - // Non pixel value, then force offset/clientWidth - if (h.indexOf('px') === -1) - h = 0; + // Compare the ranges to see if it was a real change or not + if (!lastRng || !tinymce.dom.RangeUtils.compareRanges(rng, lastRng)) { + ed.nodeChanged(); + lastRng = rng; + } + }, 50); + }); + } - return { - w : parseInt(w) || e.offsetWidth || e.clientWidth, - h : parseInt(h) || e.offsetHeight || e.clientHeight - }; - }, + function ensureBodyHasRoleApplication(ed) { + document.body.setAttribute("role", "application"); + } - getParent : function(n, f, r) { - return this.getParents(n, f, r, false); - }, + tinymce.create('tinymce.util.Quirks', { + Quirks: function(ed) { + // WebKit + if (tinymce.isWebKit) { + cleanupStylesWhenDeleting(ed); + emptyEditorWhenDeleting(ed); + inputMethodFocus(ed); + selectControlElements(ed); + + // iOS + if (tinymce.isIDevice) { + selectionChangeNodeChanged(ed); + } + } - getParents : function(n, f, r, c) { - var t = this, na, se = t.settings, o = []; + // IE + if (tinymce.isIE) { + removeHrOnBackspace(ed); + emptyEditorWhenDeleting(ed); + ensureBodyHasRoleApplication(ed); + } - n = t.get(n); - c = c === undefined; + // Gecko + if (tinymce.isGecko) { + removeHrOnBackspace(ed); + focusBody(ed); + } + } + }); +})(tinymce); - if (se.strict_root) - r = r || t.getRoot(); +(function(tinymce) { + var namedEntities, baseEntities, reverseEntities, + attrsCharsRegExp = /[&<>\"\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g, + textCharsRegExp = /[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g, + rawCharsRegExp = /[<>&\"\']/g, + entityRegExp = /&(#x|#)?([\w]+);/g, + asciiMap = { + 128 : "\u20AC", 130 : "\u201A", 131 : "\u0192", 132 : "\u201E", 133 : "\u2026", 134 : "\u2020", + 135 : "\u2021", 136 : "\u02C6", 137 : "\u2030", 138 : "\u0160", 139 : "\u2039", 140 : "\u0152", + 142 : "\u017D", 145 : "\u2018", 146 : "\u2019", 147 : "\u201C", 148 : "\u201D", 149 : "\u2022", + 150 : "\u2013", 151 : "\u2014", 152 : "\u02DC", 153 : "\u2122", 154 : "\u0161", 155 : "\u203A", + 156 : "\u0153", 158 : "\u017E", 159 : "\u0178" + }; - // Wrap node name as func - if (is(f, 'string')) { - na = f; + // Raw entities + baseEntities = { + '\"' : '"', // Needs to be escaped since the YUI compressor would otherwise break the code + "'" : ''', + '<' : '<', + '>' : '>', + '&' : '&' + }; - if (f === '*') { - f = function(n) {return n.nodeType == 1;}; - } else { - f = function(n) { - return t.is(n, na); - }; - } - } + // Reverse lookup table for raw entities + reverseEntities = { + '<' : '<', + '>' : '>', + '&' : '&', + '"' : '"', + ''' : "'" + }; - while (n) { - if (n == r || !n.nodeType || n.nodeType === 9) - break; + // Decodes text by using the browser + function nativeDecode(text) { + var elm; - if (!f || f(n)) { - if (c) - o.push(n); - else - return n; - } + elm = document.createElement("div"); + elm.innerHTML = text; - n = n.parentNode; - } + return elm.textContent || elm.innerText || text; + }; - return c ? o : null; - }, + // Build a two way lookup table for the entities + function buildEntitiesLookup(items, radix) { + var i, chr, entity, lookup = {}; - get : function(e) { - var n; + if (items) { + items = items.split(','); + radix = radix || 10; - if (e && this.doc && typeof(e) == 'string') { - n = e; - e = this.doc.getElementById(e); + // Build entities lookup table + for (i = 0; i < items.length; i += 2) { + chr = String.fromCharCode(parseInt(items[i], radix)); - // IE and Opera returns meta elements when they match the specified input ID, but getElementsByName seems to do the trick - if (e && e.id !== n) - return this.doc.getElementsByName(n)[1]; + // Only add non base entities + if (!baseEntities[chr]) { + entity = '&' + items[i + 1] + ';'; + lookup[chr] = entity; + lookup[entity] = chr; + } } - return e; - }, + return lookup; + } + }; - getNext : function(node, selector) { - return this._findSib(node, selector, 'nextSibling'); + // Unpack entities lookup where the numbers are in radix 32 to reduce the size + namedEntities = buildEntitiesLookup( + '50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,' + + '5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,' + + '5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,' + + '5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,' + + '68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,' + + '6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,' + + '6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,' + + '75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,' + + '7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,' + + '7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,' + + 'sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,' + + 'st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,' + + 't9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,' + + 'tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,' + + 'u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,' + + '81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,' + + '8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,' + + '8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,' + + '8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,' + + '8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,' + + 'nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,' + + 'rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,' + + 'Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,' + + '80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,' + + '811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro' + , 32); + + tinymce.html = tinymce.html || {}; + + tinymce.html.Entities = { + encodeRaw : function(text, attr) { + return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) { + return baseEntities[chr] || chr; + }); }, - getPrev : function(node, selector) { - return this._findSib(node, selector, 'previousSibling'); + encodeAllRaw : function(text) { + return ('' + text).replace(rawCharsRegExp, function(chr) { + return baseEntities[chr] || chr; + }); }, + encodeNumeric : function(text, attr) { + return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) { + // Multi byte sequence convert it to a single entity + if (chr.length > 1) + return '&#' + (((chr.charCodeAt(0) - 0xD800) * 0x400) + (chr.charCodeAt(1) - 0xDC00) + 0x10000) + ';'; - select : function(pa, s) { - var t = this; + return baseEntities[chr] || '&#' + chr.charCodeAt(0) + ';'; + }); + }, - return tinymce.dom.Sizzle(pa, t.get(s) || t.get(t.settings.root_element) || t.doc, []); + encodeNamed : function(text, attr, entities) { + entities = entities || namedEntities; + + return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) { + return baseEntities[chr] || entities[chr] || chr; + }); }, - is : function(n, selector) { - var i; + getEncodeFunc : function(name, entities) { + var Entities = tinymce.html.Entities; - // If it isn't an array then try to do some simple selectors instead of Sizzle for to boost performance - if (n.length === undefined) { - // Simple all selector - if (selector === '*') - return n.nodeType == 1; + entities = buildEntitiesLookup(entities) || namedEntities; - // Simple selector just elements - if (simpleSelectorRe.test(selector)) { - selector = selector.toLowerCase().split(/,/); - n = n.nodeName.toLowerCase(); + function encodeNamedAndNumeric(text, attr) { + return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) { + return baseEntities[chr] || entities[chr] || '&#' + chr.charCodeAt(0) + ';' || chr; + }); + }; - for (i = selector.length - 1; i >= 0; i--) { - if (selector[i] == n) - return true; - } - - return false; - } - } - - return tinymce.dom.Sizzle.matches(selector, n.nodeType ? [n] : n).length > 0; - }, + function encodeCustomNamed(text, attr) { + return Entities.encodeNamed(text, attr, entities); + }; + // Replace + with , to be compatible with previous TinyMCE versions + name = tinymce.makeMap(name.replace(/\+/g, ',')); - add : function(p, n, a, h, c) { - var t = this; + // Named and numeric encoder + if (name.named && name.numeric) + return encodeNamedAndNumeric; - return this.run(p, function(p) { - var e, k; + // Named encoder + if (name.named) { + // Custom names + if (entities) + return encodeCustomNamed; - e = is(n, 'string') ? t.doc.createElement(n) : n; - t.setAttribs(e, a); + return Entities.encodeNamed; + } - if (h) { - if (h.nodeType) - e.appendChild(h); - else - t.setHTML(e, h); - } + // Numeric + if (name.numeric) + return Entities.encodeNumeric; - return !c ? p.appendChild(e) : e; - }); + // Raw encoder + return Entities.encodeRaw; }, - create : function(n, a, h) { - return this.add(this.doc.createElement(n), n, a, h, 1); - }, + decode : function(text) { + return text.replace(entityRegExp, function(all, numeric, value) { + if (numeric) { + value = parseInt(value, numeric.length === 2 ? 16 : 10); - createHTML : function(n, a, h) { - var o = '', t = this, k; + // Support upper UTF + if (value > 0xFFFF) { + value -= 0x10000; - o += '<' + n; + return String.fromCharCode(0xD800 + (value >> 10), 0xDC00 + (value & 0x3FF)); + } else + return asciiMap[value] || String.fromCharCode(value); + } - for (k in a) { - if (a.hasOwnProperty(k)) - o += ' ' + k + '="' + t.encode(a[k]) + '"'; - } + return reverseEntities[all] || namedEntities[all] || nativeDecode(all); + }); + } + }; +})(tinymce); - if (tinymce.is(h)) - return o + '>' + h + ''; +tinymce.html.Styles = function(settings, schema) { + var rgbRegExp = /rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi, + urlOrStrRegExp = /(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi, + styleRegExp = /\s*([^:]+):\s*([^;]+);?/g, + trimRightRegExp = /\s+$/, + urlColorRegExp = /rgb/, + undef, i, encodingLookup = {}, encodingItems; - return o + ' />'; - }, + settings = settings || {}; - remove : function(node, keep_children) { - return this.run(node, function(node) { - var parent, child; + encodingItems = '\\" \\\' \\; \\: ; : \uFEFF'.split(' '); + for (i = 0; i < encodingItems.length; i++) { + encodingLookup[encodingItems[i]] = '\uFEFF' + i; + encodingLookup['\uFEFF' + i] = encodingItems[i]; + } - parent = node.parentNode; + function toHex(match, r, g, b) { + function hex(val) { + val = parseInt(val).toString(16); - if (!parent) - return null; + return val.length > 1 ? val : '0' + val; // 0 -> 00 + }; - if (keep_children) { - while (child = node.firstChild) { - // IE 8 will crash if you don't remove completely empty text nodes - if (!tinymce.isIE || child.nodeType !== 3 || child.nodeValue) - parent.insertBefore(child, node); - else - node.removeChild(child); - } - } + return '#' + hex(r) + hex(g) + hex(b); + }; - return parent.removeChild(node); - }); + return { + toHex : function(color) { + return color.replace(rgbRegExp, toHex); }, - setStyle : function(n, na, v) { - var t = this; - - return t.run(n, function(e) { - var s, i; + parse : function(css) { + var styles = {}, matches, name, value, isEncoded, urlConverter = settings.url_converter, urlConverterScope = settings.url_converter_scope || this; - s = e.style; + function compress(prefix, suffix) { + var top, right, bottom, left; - // Camelcase it, if needed - na = na.replace(/-(\D)/g, function(a, b){ - return b.toUpperCase(); - }); + // Get values and check it it needs compressing + top = styles[prefix + '-top' + suffix]; + if (!top) + return; - // Default px suffix on these - if (t.pixelStyles.test(na) && (tinymce.is(v, 'number') || /^[\-0-9\.]+$/.test(v))) - v += 'px'; + right = styles[prefix + '-right' + suffix]; + if (top != right) + return; - switch (na) { - case 'opacity': - // IE specific opacity - if (isIE) { - s.filter = v === '' ? '' : "alpha(opacity=" + (v * 100) + ")"; + bottom = styles[prefix + '-bottom' + suffix]; + if (right != bottom) + return; - if (!n.currentStyle || !n.currentStyle.hasLayout) - s.display = 'inline-block'; - } + left = styles[prefix + '-left' + suffix]; + if (bottom != left) + return; - // Fix for older browsers - s[na] = s['-moz-opacity'] = s['-khtml-opacity'] = v || ''; - break; + // Compress + styles[prefix + suffix] = left; + delete styles[prefix + '-top' + suffix]; + delete styles[prefix + '-right' + suffix]; + delete styles[prefix + '-bottom' + suffix]; + delete styles[prefix + '-left' + suffix]; + }; - case 'float': - isIE ? s.styleFloat = v : s.cssFloat = v; - break; - - default: - s[na] = v || ''; - } + function canCompress(key) { + var value = styles[key], i; - // Force update of the style data - if (t.settings.update_styles) - t.setAttrib(e, '_mce_style'); - }); - }, + if (!value || value.indexOf(' ') < 0) + return; - getStyle : function(n, na, c) { - n = this.get(n); + value = value.split(' '); + i = value.length; + while (i--) { + if (value[i] !== value[0]) + return false; + } - if (!n) - return false; + styles[key] = value[0]; - // Gecko - if (this.doc.defaultView && c) { - // Remove camelcase - na = na.replace(/[A-Z]/g, function(a){ - return '-' + a; - }); + return true; + }; - try { - return this.doc.defaultView.getComputedStyle(n, null).getPropertyValue(na); - } catch (ex) { - // Old safari might fail - return null; - } - } + function compress2(target, a, b, c) { + if (!canCompress(a)) + return; - // Camelcase it, if needed - na = na.replace(/-(\D)/g, function(a, b){ - return b.toUpperCase(); - }); + if (!canCompress(b)) + return; - if (na == 'float') - na = isIE ? 'styleFloat' : 'cssFloat'; + if (!canCompress(c)) + return; - // IE & Opera - if (n.currentStyle && c) - return n.currentStyle[na]; + // Compress + styles[target] = styles[a] + ' ' + styles[b] + ' ' + styles[c]; + delete styles[a]; + delete styles[b]; + delete styles[c]; + }; - return n.style[na]; - }, + // Encodes the specified string by replacing all \" \' ; : with _ + function encode(str) { + isEncoded = true; - setStyles : function(e, o) { - var t = this, s = t.settings, ol; + return encodingLookup[str]; + }; - ol = s.update_styles; - s.update_styles = 0; + // Decodes the specified string by replacing all _ with it's original value \" \' etc + // It will also decode the \" \' if keep_slashes is set to fale or omitted + function decode(str, keep_slashes) { + if (isEncoded) { + str = str.replace(/\uFEFF[0-9]/g, function(str) { + return encodingLookup[str]; + }); + } - each(o, function(v, n) { - t.setStyle(e, n, v); - }); + if (!keep_slashes) + str = str.replace(/\\([\'\";:])/g, "$1"); - // Update style info - s.update_styles = ol; - if (s.update_styles) - t.setAttrib(e, s.cssText); - }, + return str; + } - setAttrib : function(e, n, v) { - var t = this; + if (css) { + // Encode \" \' % and ; and : inside strings so they don't interfere with the style parsing + css = css.replace(/\\[\"\';:\uFEFF]/g, encode).replace(/\"[^\"]+\"|\'[^\']+\'/g, function(str) { + return str.replace(/[;:]/g, encode); + }); - // Whats the point - if (!e || !n) - return; + // Parse styles + while (matches = styleRegExp.exec(css)) { + name = matches[1].replace(trimRightRegExp, '').toLowerCase(); + value = matches[2].replace(trimRightRegExp, ''); - // Strict XML mode - if (t.settings.strict) - n = n.toLowerCase(); + if (name && value.length > 0) { + // Opera will produce 700 instead of bold in their style values + if (name === 'font-weight' && value === '700') + value = 'bold'; + else if (name === 'color' || name === 'background-color') // Lowercase colors like RED + value = value.toLowerCase(); - return this.run(e, function(e) { - var s = t.settings; + // Convert RGB colors to HEX + value = value.replace(rgbRegExp, toHex); - switch (n) { - case "style": - if (!is(v, 'string')) { - each(v, function(v, n) { - t.setStyle(e, n, v); - }); + // Convert URLs and force them into url('value') format + value = value.replace(urlOrStrRegExp, function(match, url, url2, url3, str, str2) { + str = str || str2; - return; - } + if (str) { + str = decode(str); - // No mce_style for elements with these since they might get resized by the user - if (s.keep_values) { - if (v && !t._isRes(v)) - e.setAttribute('_mce_style', v, 2); - else - e.removeAttribute('_mce_style', 2); - } + // Force strings into single quote format + return "'" + str.replace(/\'/g, "\\'") + "'"; + } - e.style.cssText = v; - break; + url = decode(url || url2 || url3); - case "class": - e.className = v || ''; // Fix IE null bug - break; + // Convert the URL to relative/absolute depending on config + if (urlConverter) + url = urlConverter.call(urlConverterScope, url, 'style'); - case "src": - case "href": - if (s.keep_values) { - if (s.url_converter) - v = s.url_converter.call(s.url_converter_scope || t, v, n, e); + // Output new URL format + return "url('" + url.replace(/\'/g, "\\'") + "')"; + }); - t.setAttrib(e, '_mce_' + n, v, 2); - } + styles[name] = isEncoded ? decode(value, true) : value; + } - break; - - case "shape": - e.setAttribute('_mce_style', v); - break; + styleRegExp.lastIndex = matches.index + matches[0].length; } - if (is(v) && v !== null && v.length !== 0) - e.setAttribute(n, '' + v, 2); - else - e.removeAttribute(n, 2); - }); - }, + // Compress the styles to reduce it's size for example IE will expand styles + compress("border", ""); + compress("border", "-width"); + compress("border", "-color"); + compress("border", "-style"); + compress("padding", ""); + compress("margin", ""); + compress2('border', 'border-width', 'border-style', 'border-color'); - setAttribs : function(e, o) { - var t = this; + // Remove pointless border, IE produces these + if (styles.border === 'medium none') + delete styles.border; + } - return this.run(e, function(e) { - each(o, function(v, n) { - t.setAttrib(e, n, v); - }); - }); + return styles; }, - getAttrib : function(e, n, dv) { - var v, t = this; + serialize : function(styles, element_name) { + var css = '', name, value; - e = t.get(e); + function serializeStyles(name) { + var styleList, i, l, value; - if (!e || e.nodeType !== 1) - return false; + styleList = schema.styles[name]; + if (styleList) { + for (i = 0, l = styleList.length; i < l; i++) { + name = styleList[i]; + value = styles[name]; - if (!is(dv)) - dv = ''; + if (value !== undef && value.length > 0) + css += (css.length > 0 ? ' ' : '') + name + ': ' + value + ';'; + } + } + }; - // Try the mce variant for these - if (/^(src|href|style|coords|shape)$/.test(n)) { - v = e.getAttribute("_mce_" + n); + // Serialize styles according to schema + if (element_name && schema && schema.styles) { + // Serialize global styles and element specific styles + serializeStyles('*'); + serializeStyles(element_name); + } else { + // Output the styles in the order they are inside the object + for (name in styles) { + value = styles[name]; - if (v) - return v; + if (value !== undef && value.length > 0) + css += (css.length > 0 ? ' ' : '') + name + ': ' + value + ';'; + } } - if (isIE && t.props[n]) { - v = e[t.props[n]]; - v = v && v.nodeValue ? v.nodeValue : v; - } + return css; + } + }; +}; - if (!v) - v = e.getAttribute(n, 2); +(function(tinymce) { + var transitional = {}, boolAttrMap, blockElementsMap, shortEndedElementsMap, nonEmptyElementsMap, customElementsMap = {}, + defaultWhiteSpaceElementsMap, selfClosingElementsMap, makeMap = tinymce.makeMap, each = tinymce.each; - // Check boolean attribs - if (/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(n)) { - if (e[t.props[n]] === true && v === '') - return n; + function split(str, delim) { + return str.split(delim || ','); + }; - return v ? n : ''; - } + function unpack(lookup, data) { + var key, elements = {}; - // Inner input elements will override attributes on form elements - if (e.nodeName === "FORM" && e.getAttributeNode(n)) - return e.getAttributeNode(n).nodeValue; + function replace(value) { + return value.replace(/[A-Z]+/g, function(key) { + return replace(lookup[key]); + }); + }; - if (n === 'style') { - v = v || e.style.cssText; + // Unpack lookup + for (key in lookup) { + if (lookup.hasOwnProperty(key)) + lookup[key] = replace(lookup[key]); + } - if (v) { - v = t.serializeStyle(t.parseStyle(v), e.nodeName); + // Unpack and parse data into object map + replace(data).replace(/#/g, '#text').replace(/(\w+)\[([^\]]+)\]\[([^\]]*)\]/g, function(str, name, attributes, children) { + attributes = split(attributes, '|'); - if (t.settings.keep_values && !t._isRes(v)) - e.setAttribute('_mce_style', v); - } + elements[name] = { + attributes : makeMap(attributes), + attributesOrder : attributes, + children : makeMap(children, '|', {'#comment' : {}}) } + }); - // Remove Apple and WebKit stuff - if (isWebKit && n === "class" && v) - v = v.replace(/(apple|webkit)\-[a-z\-]+/gi, ''); + return elements; + }; - // Handle IE issues - if (isIE) { - switch (n) { - case 'rowspan': - case 'colspan': - // IE returns 1 as default value - if (v === 1) - v = ''; + // Build a lookup table for block elements both lowercase and uppercase + blockElementsMap = 'h1,h2,h3,h4,h5,h6,hr,p,div,address,pre,form,table,tbody,thead,tfoot,' + + 'th,tr,td,li,ol,ul,caption,blockquote,center,dl,dt,dd,dir,fieldset,' + + 'noscript,menu,isindex,samp,header,footer,article,section,hgroup'; + blockElementsMap = makeMap(blockElementsMap, ',', makeMap(blockElementsMap.toUpperCase())); + + // This is the XHTML 1.0 transitional elements with it's attributes and children packed to reduce it's size + transitional = unpack({ + Z : 'H|K|N|O|P', + Y : 'X|form|R|Q', + ZG : 'E|span|width|align|char|charoff|valign', + X : 'p|T|div|U|W|isindex|fieldset|table', + ZF : 'E|align|char|charoff|valign', + W : 'pre|hr|blockquote|address|center|noframes', + ZE : 'abbr|axis|headers|scope|rowspan|colspan|align|char|charoff|valign|nowrap|bgcolor|width|height', + ZD : '[E][S]', + U : 'ul|ol|dl|menu|dir', + ZC : 'p|Y|div|U|W|table|br|span|bdo|object|applet|img|map|K|N|Q', + T : 'h1|h2|h3|h4|h5|h6', + ZB : 'X|S|Q', + S : 'R|P', + ZA : 'a|G|J|M|O|P', + R : 'a|H|K|N|O', + Q : 'noscript|P', + P : 'ins|del|script', + O : 'input|select|textarea|label|button', + N : 'M|L', + M : 'em|strong|dfn|code|q|samp|kbd|var|cite|abbr|acronym', + L : 'sub|sup', + K : 'J|I', + J : 'tt|i|b|u|s|strike', + I : 'big|small|font|basefont', + H : 'G|F', + G : 'br|span|bdo', + F : 'object|applet|img|map|iframe', + E : 'A|B|C', + D : 'accesskey|tabindex|onfocus|onblur', + C : 'onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup', + B : 'lang|xml:lang|dir', + A : 'id|class|style|title' + }, 'script[id|charset|type|language|src|defer|xml:space][]' + + 'style[B|id|type|media|title|xml:space][]' + + 'object[E|declare|classid|codebase|data|type|codetype|archive|standby|width|height|usemap|name|tabindex|align|border|hspace|vspace][#|param|Y]' + + 'param[id|name|value|valuetype|type][]' + + 'p[E|align][#|S]' + + 'a[E|D|charset|type|name|href|hreflang|rel|rev|shape|coords|target][#|Z]' + + 'br[A|clear][]' + + 'span[E][#|S]' + + 'bdo[A|C|B][#|S]' + + 'applet[A|codebase|archive|code|object|alt|name|width|height|align|hspace|vspace][#|param|Y]' + + 'h1[E|align][#|S]' + + 'img[E|src|alt|name|longdesc|width|height|usemap|ismap|align|border|hspace|vspace][]' + + 'map[B|C|A|name][X|form|Q|area]' + + 'h2[E|align][#|S]' + + 'iframe[A|longdesc|name|src|frameborder|marginwidth|marginheight|scrolling|align|width|height][#|Y]' + + 'h3[E|align][#|S]' + + 'tt[E][#|S]' + + 'i[E][#|S]' + + 'b[E][#|S]' + + 'u[E][#|S]' + + 's[E][#|S]' + + 'strike[E][#|S]' + + 'big[E][#|S]' + + 'small[E][#|S]' + + 'font[A|B|size|color|face][#|S]' + + 'basefont[id|size|color|face][]' + + 'em[E][#|S]' + + 'strong[E][#|S]' + + 'dfn[E][#|S]' + + 'code[E][#|S]' + + 'q[E|cite][#|S]' + + 'samp[E][#|S]' + + 'kbd[E][#|S]' + + 'var[E][#|S]' + + 'cite[E][#|S]' + + 'abbr[E][#|S]' + + 'acronym[E][#|S]' + + 'sub[E][#|S]' + + 'sup[E][#|S]' + + 'input[E|D|type|name|value|checked|disabled|readonly|size|maxlength|src|alt|usemap|onselect|onchange|accept|align][]' + + 'select[E|name|size|multiple|disabled|tabindex|onfocus|onblur|onchange][optgroup|option]' + + 'optgroup[E|disabled|label][option]' + + 'option[E|selected|disabled|label|value][]' + + 'textarea[E|D|name|rows|cols|disabled|readonly|onselect|onchange][]' + + 'label[E|for|accesskey|onfocus|onblur][#|S]' + + 'button[E|D|name|value|type|disabled][#|p|T|div|U|W|table|G|object|applet|img|map|K|N|Q]' + + 'h4[E|align][#|S]' + + 'ins[E|cite|datetime][#|Y]' + + 'h5[E|align][#|S]' + + 'del[E|cite|datetime][#|Y]' + + 'h6[E|align][#|S]' + + 'div[E|align][#|Y]' + + 'ul[E|type|compact][li]' + + 'li[E|type|value][#|Y]' + + 'ol[E|type|compact|start][li]' + + 'dl[E|compact][dt|dd]' + + 'dt[E][#|S]' + + 'dd[E][#|Y]' + + 'menu[E|compact][li]' + + 'dir[E|compact][li]' + + 'pre[E|width|xml:space][#|ZA]' + + 'hr[E|align|noshade|size|width][]' + + 'blockquote[E|cite][#|Y]' + + 'address[E][#|S|p]' + + 'center[E][#|Y]' + + 'noframes[E][#|Y]' + + 'isindex[A|B|prompt][]' + + 'fieldset[E][#|legend|Y]' + + 'legend[E|accesskey|align][#|S]' + + 'table[E|summary|width|border|frame|rules|cellspacing|cellpadding|align|bgcolor][caption|col|colgroup|thead|tfoot|tbody|tr]' + + 'caption[E|align][#|S]' + + 'col[ZG][]' + + 'colgroup[ZG][col]' + + 'thead[ZF][tr]' + + 'tr[ZF|bgcolor][th|td]' + + 'th[E|ZE][#|Y]' + + 'form[E|action|method|name|enctype|onsubmit|onreset|accept|accept-charset|target][#|X|R|Q]' + + 'noscript[E][#|Y]' + + 'td[E|ZE][#|Y]' + + 'tfoot[ZF][tr]' + + 'tbody[ZF][tr]' + + 'area[E|D|shape|coords|href|nohref|alt|target][]' + + 'base[id|href|target][]' + + 'body[E|onload|onunload|background|bgcolor|text|link|vlink|alink][#|Y]' + ); - break; + boolAttrMap = makeMap('checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected,autoplay,loop,controls'); + shortEndedElementsMap = makeMap('area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed,source'); + nonEmptyElementsMap = tinymce.extend(makeMap('td,th,iframe,video,audio,object'), shortEndedElementsMap); + defaultWhiteSpaceElementsMap = makeMap('pre,script,style,textarea'); + selfClosingElementsMap = makeMap('colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr'); - case 'size': - // IE returns +0 as default value for size - if (v === '+0' || v === 20 || v === 0) - v = ''; + tinymce.html.Schema = function(settings) { + var self = this, elements = {}, children = {}, patternElements = [], validStyles, whiteSpaceElementsMap; - break; + settings = settings || {}; - case 'width': - case 'height': - case 'vspace': - case 'checked': - case 'disabled': - case 'readonly': - if (v === 0) - v = ''; + // Allow all elements and attributes if verify_html is set to false + if (settings.verify_html === false) + settings.valid_elements = '*[*]'; - break; + // Build styles list + if (settings.valid_styles) { + validStyles = {}; - case 'hspace': - // IE returns -1 as default value - if (v === -1) - v = ''; + // Convert styles into a rule list + each(settings.valid_styles, function(value, key) { + validStyles[key] = tinymce.explode(value); + }); + } - break; + whiteSpaceElementsMap = settings.whitespace_elements ? makeMap(settings.whitespace_elements) : defaultWhiteSpaceElementsMap; - case 'maxlength': - case 'tabindex': - // IE returns default value - if (v === 32768 || v === 2147483647 || v === '32768') - v = ''; + // Converts a wildcard expression string to a regexp for example *a will become /.*a/. + function patternToRegExp(str) { + return new RegExp('^' + str.replace(/([?+*])/g, '.$1') + '$'); + }; - break; + // Parses the specified valid_elements string and adds to the current rules + // This function is a bit hard to read since it's heavily optimized for speed + function addValidElements(valid_elements) { + var ei, el, ai, al, yl, matches, element, attr, attrData, elementName, attrName, attrType, attributes, attributesOrder, + prefix, outputName, globalAttributes, globalAttributesOrder, transElement, key, childKey, value, + elementRuleRegExp = /^([#+-])?([^\[\/]+)(?:\/([^\[]+))?(?:\[([^\]]+)\])?$/, + attrRuleRegExp = /^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/, + hasPatternsRegExp = /[*?+]/; + + if (valid_elements) { + // Split valid elements into an array with rules + valid_elements = split(valid_elements); + + if (elements['@']) { + globalAttributes = elements['@'].attributes; + globalAttributesOrder = elements['@'].attributesOrder; + } - case 'multiple': - case 'compact': - case 'noshade': - case 'nowrap': - if (v === 65535) - return n; + // Loop all rules + for (ei = 0, el = valid_elements.length; ei < el; ei++) { + // Parse element rule + matches = elementRuleRegExp.exec(valid_elements[ei]); + if (matches) { + // Setup local names for matches + prefix = matches[1]; + elementName = matches[2]; + outputName = matches[3]; + attrData = matches[4]; + + // Create new attributes and attributesOrder + attributes = {}; + attributesOrder = []; + + // Create the new element + element = { + attributes : attributes, + attributesOrder : attributesOrder + }; - return dv; + // Padd empty elements prefix + if (prefix === '#') + element.paddEmpty = true; - case 'shape': - v = v.toLowerCase(); - break; + // Remove empty elements prefix + if (prefix === '-') + element.removeEmpty = true; - default: - // IE has odd anonymous function for event attributes - if (n.indexOf('on') === 0 && v) - v = ('' + v).replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/, '$1'); - } - } + // Copy attributes from global rule into current rule + if (globalAttributes) { + for (key in globalAttributes) + attributes[key] = globalAttributes[key]; - return (v !== undefined && v !== null && v !== '') ? '' + v : dv; - }, + attributesOrder.push.apply(attributesOrder, globalAttributesOrder); + } - getPos : function(n, ro) { - var t = this, x = 0, y = 0, e, d = t.doc, r; + // Attributes defined + if (attrData) { + attrData = split(attrData, '|'); + for (ai = 0, al = attrData.length; ai < al; ai++) { + matches = attrRuleRegExp.exec(attrData[ai]); + if (matches) { + attr = {}; + attrType = matches[1]; + attrName = matches[2].replace(/::/g, ':'); + prefix = matches[3]; + value = matches[4]; + + // Required + if (attrType === '!') { + element.attributesRequired = element.attributesRequired || []; + element.attributesRequired.push(attrName); + attr.required = true; + } - n = t.get(n); - ro = ro || d.body; + // Denied from global + if (attrType === '-') { + delete attributes[attrName]; + attributesOrder.splice(tinymce.inArray(attributesOrder, attrName), 1); + continue; + } - if (n) { - // Use getBoundingClientRect on IE, Opera has it but it's not perfect - if (isIE && !t.stdMode) { - n = n.getBoundingClientRect(); - e = t.boxModel ? d.documentElement : d.body; - x = t.getStyle(t.select('html')[0], 'borderWidth'); // Remove border - x = (x == 'medium' || t.boxModel && !t.isIE6) && 2 || x; - n.top += t.win.self != t.win.top ? 2 : 0; // IE adds some strange extra cord if used in a frameset + // Default value + if (prefix) { + // Default value + if (prefix === '=') { + element.attributesDefault = element.attributesDefault || []; + element.attributesDefault.push({name: attrName, value: value}); + attr.defaultValue = value; + } - return {x : n.left + e.scrollLeft - x, y : n.top + e.scrollTop - x}; - } + // Forced value + if (prefix === ':') { + element.attributesForced = element.attributesForced || []; + element.attributesForced.push({name: attrName, value: value}); + attr.forcedValue = value; + } - r = n; - while (r && r != ro && r.nodeType) { - x += r.offsetLeft || 0; - y += r.offsetTop || 0; - r = r.offsetParent; - } + // Required values + if (prefix === '<') + attr.validValues = makeMap(value, '?'); + } - r = n.parentNode; - while (r && r != ro && r.nodeType) { - x -= r.scrollLeft || 0; - y -= r.scrollTop || 0; - r = r.parentNode; - } - } + // Check for attribute patterns + if (hasPatternsRegExp.test(attrName)) { + element.attributePatterns = element.attributePatterns || []; + attr.pattern = patternToRegExp(attrName); + element.attributePatterns.push(attr); + } else { + // Add attribute to order list if it doesn't already exist + if (!attributes[attrName]) + attributesOrder.push(attrName); - return {x : x, y : y}; - }, + attributes[attrName] = attr; + } + } + } + } - parseStyle : function(st) { - var t = this, s = t.settings, o = {}; + // Global rule, store away these for later usage + if (!globalAttributes && elementName == '@') { + globalAttributes = attributes; + globalAttributesOrder = attributesOrder; + } - if (!st) - return o; + // Handle substitute elements such as b/strong + if (outputName) { + element.outputName = elementName; + elements[outputName] = element; + } - function compress(p, s, ot) { - var t, r, b, l; + // Add pattern or exact element + if (hasPatternsRegExp.test(elementName)) { + element.pattern = patternToRegExp(elementName); + patternElements.push(element); + } else + elements[elementName] = element; + } + } + } + }; - // Get values and check it it needs compressing - t = o[p + '-top' + s]; - if (!t) - return; + function setValidElements(valid_elements) { + elements = {}; + patternElements = []; - r = o[p + '-right' + s]; - if (t != r) - return; + addValidElements(valid_elements); - b = o[p + '-bottom' + s]; - if (r != b) - return; + each(transitional, function(element, name) { + children[name] = element.children; + }); + }; - l = o[p + '-left' + s]; - if (b != l) - return; + // Adds custom non HTML elements to the schema + function addCustomElements(custom_elements) { + var customElementRegExp = /^(~)?(.+)$/; - // Compress - o[ot] = l; - delete o[p + '-top' + s]; - delete o[p + '-right' + s]; - delete o[p + '-bottom' + s]; - delete o[p + '-left' + s]; - }; + if (custom_elements) { + each(split(custom_elements), function(rule) { + var matches = customElementRegExp.exec(rule), + inline = matches[1] === '~', + cloneName = inline ? 'span' : 'div', + name = matches[2]; - function compress2(ta, a, b, c) { - var t; + children[name] = children[cloneName]; + customElementsMap[name] = cloneName; - t = o[a]; - if (!t) - return; + // If it's not marked as inline then add it to valid block elements + if (!inline) + blockElementsMap[name] = {}; - t = o[b]; - if (!t) - return; + // Add custom elements at span/div positions + each(children, function(element, child) { + if (element[cloneName]) + element[name] = element[cloneName]; + }); + }); + } + }; - t = o[c]; - if (!t) - return; + // Adds valid children to the schema object + function addValidChildren(valid_children) { + var childRuleRegExp = /^([+\-]?)(\w+)\[([^\]]+)\]$/; - // Compress - o[ta] = o[a] + ' ' + o[b] + ' ' + o[c]; - delete o[a]; - delete o[b]; - delete o[c]; - }; + if (valid_children) { + each(split(valid_children), function(rule) { + var matches = childRuleRegExp.exec(rule), parent, prefix; - st = st.replace(/&(#?[a-z0-9]+);/g, '&$1_MCE_SEMI_'); // Protect entities + if (matches) { + prefix = matches[1]; - each(st.split(';'), function(v) { - var sv, ur = []; + // Add/remove items from default + if (prefix) + parent = children[matches[2]]; + else + parent = children[matches[2]] = {'#comment' : {}}; - if (v) { - v = v.replace(/_MCE_SEMI_/g, ';'); // Restore entities - v = v.replace(/url\([^\)]+\)/g, function(v) {ur.push(v);return 'url(' + ur.length + ')';}); - v = v.split(':'); - sv = tinymce.trim(v[1]); - sv = sv.replace(/url\(([^\)]+)\)/g, function(a, b) {return ur[parseInt(b) - 1];}); - - sv = sv.replace(/rgb\([^\)]+\)/g, function(v) { - return t.toHex(v); - }); + parent = children[matches[2]]; - if (s.url_converter) { - sv = sv.replace(/url\([\'\"]?([^\)\'\"]+)[\'\"]?\)/g, function(x, c) { - return 'url(' + s.url_converter.call(s.url_converter_scope || t, t.decode(c), 'style', null) + ')'; + each(split(matches[3], '|'), function(child) { + if (prefix === '-') + delete parent[child]; + else + parent[child] = {}; }); } + }); + } + }; - o[tinymce.trim(v[0]).toLowerCase()] = sv; - } - }); + function getElementRule(name) { + var element = elements[name], i; - compress("border", "", "border"); - compress("border", "-width", "border-width"); - compress("border", "-color", "border-color"); - compress("border", "-style", "border-style"); - compress("padding", "", "padding"); - compress("margin", "", "margin"); - compress2('border', 'border-width', 'border-style', 'border-color'); + // Exact match found + if (element) + return element; - if (isIE) { - // Remove pointless border - if (o.border == 'medium none') - o.border = ''; + // No exact match then try the patterns + i = patternElements.length; + while (i--) { + element = patternElements[i]; + + if (element.pattern.test(name)) + return element; } + }; - return o; - }, + if (!settings.valid_elements) { + // No valid elements defined then clone the elements from the transitional spec + each(transitional, function(element, name) { + elements[name] = { + attributes : element.attributes, + attributesOrder : element.attributesOrder + }; - serializeStyle : function(o, name) { - var t = this, s = ''; + children[name] = element.children; + }); - function add(v, k) { - if (k && v) { - // Remove browser specific styles like -moz- or -webkit- - if (k.indexOf('-') === 0) - return; + // Switch these + each(split('strong/b,em/i'), function(item) { + item = split(item, '/'); + elements[item[1]].outputName = item[0]; + }); - switch (k) { - case 'font-weight': - // Opera will output bold as 700 - if (v == 700) - v = 'bold'; + // Add default alt attribute for images + elements.img.attributesDefault = [{name: 'alt', value: ''}]; - break; + // Remove these if they are empty by default + each(split('ol,ul,sub,sup,blockquote,span,font,a,table,tbody,tr'), function(name) { + elements[name].removeEmpty = true; + }); - case 'color': - case 'background-color': - v = v.toLowerCase(); - break; - } + // Padd these by default + each(split('p,h1,h2,h3,h4,h5,h6,th,td,pre,div,address,caption'), function(name) { + elements[name].paddEmpty = true; + }); + } else + setValidElements(settings.valid_elements); - s += (s ? ' ' : '') + k + ': ' + v + ';'; - } - }; + addCustomElements(settings.custom_elements); + addValidChildren(settings.valid_children); + addValidElements(settings.extended_valid_elements); - // Validate style output - if (name && t._styles) { - each(t._styles['*'], function(name) { - add(o[name], name); - }); + // Todo: Remove this when we fix list handling to be valid + addValidChildren('+ol[ul|ol],+ul[ul|ol]'); - each(t._styles[name.toLowerCase()], function(name) { - add(o[name], name); - }); - } else - each(o, add); + // If the user didn't allow span only allow internal spans + if (!getElementRule('span')) + addValidElements('span[!data-mce-type|*]'); - return s; - }, + // Delete invalid elements + if (settings.invalid_elements) { + tinymce.each(tinymce.explode(settings.invalid_elements), function(item) { + if (elements[item]) + delete elements[item]; + }); + } - loadCSS : function(u) { - var t = this, d = t.doc, head; + self.children = children; - if (!u) - u = ''; + self.styles = validStyles; - head = t.select('head')[0]; + self.getBoolAttrs = function() { + return boolAttrMap; + }; - each(u.split(','), function(u) { - var link; + self.getBlockElements = function() { + return blockElementsMap; + }; - if (t.files[u]) - return; + self.getShortEndedElements = function() { + return shortEndedElementsMap; + }; - t.files[u] = true; - link = t.create('link', {rel : 'stylesheet', href : tinymce._addVer(u)}); + self.getSelfClosingElements = function() { + return selfClosingElementsMap; + }; - // IE 8 has a bug where dynamically loading stylesheets would produce a 1 item remaining bug - // This fix seems to resolve that issue by realcing the document ones a stylesheet finishes loading - // It's ugly but it seems to work fine. - if (isIE && d.documentMode) { - link.onload = function() { - d.recalc(); - link.onload = null; - }; - } + self.getNonEmptyElements = function() { + return nonEmptyElementsMap; + }; - head.appendChild(link); - }); - }, + self.getWhiteSpaceElements = function() { + return whiteSpaceElementsMap; + }; - addClass : function(e, c) { - return this.run(e, function(e) { - var o; + self.isValidChild = function(name, child) { + var parent = children[name]; - if (!c) - return 0; + return !!(parent && parent[child]); + }; - if (this.hasClass(e, c)) - return e.className; + self.getElementRule = getElementRule; - o = this.removeClass(e, c); + self.getCustomElements = function() { + return customElementsMap; + }; - return e.className = (o != '' ? (o + ' ') : '') + c; - }); - }, + self.addValidElements = addValidElements; - removeClass : function(e, c) { - var t = this, re; + self.setValidElements = setValidElements; - return t.run(e, function(e) { - var v; + self.addCustomElements = addCustomElements; - if (t.hasClass(e, c)) { - if (!re) - re = new RegExp("(^|\\s+)" + c + "(\\s+|$)", "g"); + self.addValidChildren = addValidChildren; + }; - v = e.className.replace(re, ' '); - v = tinymce.trim(v != ' ' ? v : ''); + // Expose boolMap and blockElementMap as static properties for usage in DOMUtils + tinymce.html.Schema.boolAttrMap = boolAttrMap; + tinymce.html.Schema.blockElementsMap = blockElementsMap; +})(tinymce); - e.className = v; +(function(tinymce) { + tinymce.html.SaxParser = function(settings, schema) { + var self = this, noop = function() {}; - // Empty class attr - if (!v) { - e.removeAttribute('class'); - e.removeAttribute('className'); - } + settings = settings || {}; + self.schema = schema = schema || new tinymce.html.Schema(); - return v; + if (settings.fix_self_closing !== false) + settings.fix_self_closing = true; + + // Add handler functions from settings and setup default handlers + tinymce.each('comment cdata text start end pi doctype'.split(' '), function(name) { + if (name) + self[name] = settings[name] || noop; + }); + + self.parse = function(html) { + var self = this, matches, index = 0, value, endRegExp, stack = [], attrList, i, text, name, isInternalElement, removeInternalElements, + shortEndedElements, fillAttrsMap, isShortEnded, validate, elementRule, isValidElement, attr, attribsValue, invalidPrefixRegExp, + validAttributesMap, validAttributePatterns, attributesRequired, attributesDefault, attributesForced, selfClosing, + tokenRegExp, attrRegExp, specialElements, attrValue, idCount = 0, decode = tinymce.html.Entities.decode, fixSelfClosing, isIE; + + function processEndTag(name) { + var pos, i; + + // Find position of parent of the same type + pos = stack.length; + while (pos--) { + if (stack[pos].name === name) + break; } - return e.className; - }); - }, + // Found parent + if (pos >= 0) { + // Close all the open elements + for (i = stack.length - 1; i >= pos; i--) { + name = stack[i]; - hasClass : function(n, c) { - n = this.get(n); + if (name.valid) + self.end(name.name); + } - if (!n || !c) - return false; + // Remove the open elements from the stack + stack.length = pos; + } + }; - return (' ' + n.className + ' ').indexOf(' ' + c + ' ') !== -1; - }, + // Precompile RegExps and map objects + tokenRegExp = new RegExp('<(?:' + + '(?:!--([\\w\\W]*?)-->)|' + // Comment + '(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|' + // CDATA + '(?:!DOCTYPE([\\w\\W]*?)>)|' + // DOCTYPE + '(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|' + // PI + '(?:\\/([^>]+)>)|' + // End element + '(?:([^\\s\\/<>]+)((?:\\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\\/)>)' + // Start element + ')', 'g'); + + attrRegExp = /([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:\\.|[^\"])*)\")|(?:\'((?:\\.|[^\'])*)\')|([^>\s]+)))?/g; + specialElements = { + 'script' : /<\/script[^>]*>/gi, + 'style' : /<\/style[^>]*>/gi, + 'noscript' : /<\/noscript[^>]*>/gi + }; - show : function(e) { - return this.setStyle(e, 'display', 'block'); - }, + // Setup lookup tables for empty elements and boolean attributes + shortEndedElements = schema.getShortEndedElements(); + selfClosing = schema.getSelfClosingElements(); + fillAttrsMap = schema.getBoolAttrs(); + validate = settings.validate; + removeInternalElements = settings.remove_internals; + fixSelfClosing = settings.fix_self_closing; + isIE = tinymce.isIE; + invalidPrefixRegExp = /^:/; + + while (matches = tokenRegExp.exec(html)) { + // Text + if (index < matches.index) + self.text(decode(html.substr(index, matches.index - index))); + + if (value = matches[6]) { // End element + value = value.toLowerCase(); + + // IE will add a ":" in front of elements it doesn't understand like custom elements or HTML5 elements + if (isIE && invalidPrefixRegExp.test(value)) + value = value.substr(1); + + processEndTag(value); + } else if (value = matches[7]) { // Start element + value = value.toLowerCase(); + + // IE will add a ":" in front of elements it doesn't understand like custom elements or HTML5 elements + if (isIE && invalidPrefixRegExp.test(value)) + value = value.substr(1); + + isShortEnded = value in shortEndedElements; + + // Is self closing tag for example an
  • after an open
  • + if (fixSelfClosing && selfClosing[value] && stack.length > 0 && stack[stack.length - 1].name === value) + processEndTag(value); + + // Validate element + if (!validate || (elementRule = schema.getElementRule(value))) { + isValidElement = true; + + // Grab attributes map and patters when validation is enabled + if (validate) { + validAttributesMap = elementRule.attributes; + validAttributePatterns = elementRule.attributePatterns; + } - hide : function(e) { - return this.setStyle(e, 'display', 'none'); - }, + // Parse attributes + if (attribsValue = matches[8]) { + isInternalElement = attribsValue.indexOf('data-mce-type') !== -1; // Check if the element is an internal element - isHidden : function(e) { - e = this.get(e); + // If the element has internal attributes then remove it if we are told to do so + if (isInternalElement && removeInternalElements) + isValidElement = false; - return !e || e.style.display == 'none' || this.getStyle(e, 'display') == 'none'; - }, + attrList = []; + attrList.map = {}; - uniqueId : function(p) { - return (!p ? 'mce_' : p) + (this.counter++); - }, + attribsValue.replace(attrRegExp, function(match, name, value, val2, val3) { + var attrRule, i; - setHTML : function(e, h) { - var t = this; + name = name.toLowerCase(); + value = name in fillAttrsMap ? name : decode(value || val2 || val3 || ''); // Handle boolean attribute than value attribute - return this.run(e, function(e) { - var x, i, nl, n, p, x; + // Validate name and value + if (validate && !isInternalElement && name.indexOf('data-') !== 0) { + attrRule = validAttributesMap[name]; - h = t.processHTML(h); + // Find rule by pattern matching + if (!attrRule && validAttributePatterns) { + i = validAttributePatterns.length; + while (i--) { + attrRule = validAttributePatterns[i]; + if (attrRule.pattern.test(name)) + break; + } - if (isIE) { - function set() { - // Remove all child nodes - while (e.firstChild) - e.firstChild.removeNode(); + // No rule matched + if (i === -1) + attrRule = null; + } - try { - // IE will remove comments from the beginning - // unless you padd the contents with something - e.innerHTML = '
    ' + h; - e.removeChild(e.firstChild); - } catch (ex) { - // IE sometimes produces an unknown runtime error on innerHTML if it's an block element within a block element for example a div inside a p - // This seems to fix this problem - - // Create new div with HTML contents and a BR infront to keep comments - x = t.create('div'); - x.innerHTML = '
    ' + h; - - // Add all children from div to target - each (x.childNodes, function(n, i) { - // Skip br element - if (i) - e.appendChild(n); + // No attribute rule found + if (!attrRule) + return; + + // Validate value + if (attrRule.validValues && !(value in attrRule.validValues)) + return; + } + + // Add attribute to list and map + attrList.map[name] = value; + attrList.push({ + name: name, + value: value + }); }); + } else { + attrList = []; + attrList.map = {}; } - }; - // IE has a serious bug when it comes to paragraphs it can produce an invalid - // DOM tree if contents like this

    • Item 1

    is inserted - // It seems to be that IE doesn't like a root block element placed inside another root block element - if (t.settings.fix_ie_paragraphs) - h = h.replace(/

    <\/p>|]+)><\/p>|/gi, ' 

    '); + // Process attributes if validation is enabled + if (validate && !isInternalElement) { + attributesRequired = elementRule.attributesRequired; + attributesDefault = elementRule.attributesDefault; + attributesForced = elementRule.attributesForced; + + // Handle forced attributes + if (attributesForced) { + i = attributesForced.length; + while (i--) { + attr = attributesForced[i]; + name = attr.name; + attrValue = attr.value; + + if (attrValue === '{$uid}') + attrValue = 'mce_' + idCount++; + + attrList.map[name] = attrValue; + attrList.push({name: name, value: attrValue}); + } + } + + // Handle default attributes + if (attributesDefault) { + i = attributesDefault.length; + while (i--) { + attr = attributesDefault[i]; + name = attr.name; - set(); + if (!(name in attrList.map)) { + attrValue = attr.value; - if (t.settings.fix_ie_paragraphs) { - // Check for odd paragraphs this is a sign of a broken DOM - nl = e.getElementsByTagName("p"); - for (i = nl.length - 1, x = 0; i >= 0; i--) { - n = nl[i]; + if (attrValue === '{$uid}') + attrValue = 'mce_' + idCount++; - if (!n.hasChildNodes()) { - if (!n._mce_keep) { - x = 1; // Is broken - break; + attrList.map[name] = attrValue; + attrList.push({name: name, value: attrValue}); + } } - - n.removeAttribute('_mce_keep'); } - } - } - // Time to fix the madness IE left us - if (x) { - // So if we replace the p elements with divs and mark them and then replace them back to paragraphs - // after we use innerHTML we can fix the DOM tree - h = h.replace(/

    ]+)>|

    /ig, '

    '); - h = h.replace(/<\/p>/gi, '
    '); + // Handle required attributes + if (attributesRequired) { + i = attributesRequired.length; + while (i--) { + if (attributesRequired[i] in attrList.map) + break; + } + + // None of the required attributes where found + if (i === -1) + isValidElement = false; + } - // Set the new HTML with DIVs - set(); + // Invalidate element if it's marked as bogus + if (attrList.map['data-mce-bogus']) + isValidElement = false; + } - // Replace all DIV elements with the _mce_tmp attibute back to paragraphs - // This is needed since IE has a annoying bug see above for details - // This is a slow process but it has to be done. :( - if (t.settings.fix_ie_paragraphs) { - nl = e.getElementsByTagName("DIV"); - for (i = nl.length - 1; i >= 0; i--) { - n = nl[i]; + if (isValidElement) + self.start(value, attrList, isShortEnded); + } else + isValidElement = false; - // Is it a temp div - if (n._mce_tmp) { - // Create new paragraph - p = t.doc.createElement('p'); + // Treat script, noscript and style a bit different since they may include code that looks like elements + if (endRegExp = specialElements[value]) { + endRegExp.lastIndex = index = matches.index + matches[0].length; - // Copy all attributes - n.cloneNode(false).outerHTML.replace(/([a-z0-9\-_]+)=/gi, function(a, b) { - var v; + if (matches = endRegExp.exec(html)) { + if (isValidElement) + text = html.substr(index, matches.index - index); - if (b !== '_mce_tmp') { - v = n.getAttribute(b); + index = matches.index + matches[0].length; + } else { + text = html.substr(index); + index = html.length; + } - if (!v && b === 'class') - v = n.className; + if (isValidElement && text.length > 0) + self.text(text, true); - p.setAttribute(b, v); - } - }); + if (isValidElement) + self.end(value); - // Append all children to new paragraph - for (x = 0; x= 0; i--) { + value = stack[i]; - if (isIE) { - h = h.replace(/'/g, '''); // IE can't handle apos - h = h.replace(/\s+(disabled|checked|readonly|selected)\s*=\s*[\"\']?(false|0)[\"\']?/gi, ''); // IE doesn't handle default values correct + if (value.valid) + self.end(value.name); } + }; + } +})(tinymce); - // Fix some issues - h = h.replace(/]+)\/>|/gi, ''); // Force open +(function(tinymce) { + var whiteSpaceRegExp = /^[ \t\r\n]*$/, typeLookup = { + '#text' : 3, + '#comment' : 8, + '#cdata' : 4, + '#pi' : 7, + '#doctype' : 10, + '#document-fragment' : 11 + }; - // Store away src and href in _mce_src and mce_href since browsers mess them up - if (s.keep_values) { - // Wrap scripts and styles in comments for serialization purposes - if (/)/g, '\n'); - s = s.replace(/^[\r\n]*|[\r\n]*$/g, ''); - s = s.replace(/^\s*(\/\/\s*|\]\]>|-->|\]\]-->)\s*$/g, ''); + // Walks the tree left/right + function walk(node, root_node, prev) { + var sibling, parent, startName = prev ? 'lastChild' : 'firstChild', siblingName = prev ? 'prev' : 'next'; - return s; - }; + // Walk into nodes if it has a start + if (node[startName]) + return node[startName]; - // Wrap the script contents in CDATA and keep them from executing - h = h.replace(/]+|)>([\s\S]*?)<\/script>/gi, function(v, attribs, text) { - // Force type attribute - if (!attribs) - attribs = ' type="text/javascript"'; + // Return the sibling if it has one + if (node !== root_node) { + sibling = node[siblingName]; - // Convert the src attribute of the scripts - attribs = attribs.replace(/src=\"([^\"]+)\"?/i, function(a, url) { - if (s.url_converter) - url = t.encode(s.url_converter.call(s.url_converter_scope || t, t.decode(url), 'src', 'script')); + if (sibling) + return sibling; - return '_mce_src="' + url + '"'; - }); + // Walk up the parents to look for siblings + for (parent = node.parent; parent && parent !== root_node; parent = parent.parent) { + sibling = parent[siblingName]; - // Wrap text contents - if (tinymce.trim(text)) { - codeBlocks.push(trim(text)); - text = ''; - } + if (sibling) + return sibling; + } + } + }; - return '' + text + ''; - }); + function Node(name, type) { + this.name = name; + this.type = type; - // Wrap style elements - h = h.replace(/]+|)>([\s\S]*?)<\/style>/gi, function(v, attribs, text) { - // Wrap text contents - if (text) { - codeBlocks.push(trim(text)); - text = ''; - } + if (type === 1) { + this.attributes = []; + this.attributes.map = {}; + } + } - return '' + text + ''; - }); + tinymce.extend(Node.prototype, { + replace : function(node) { + var self = this; - // Wrap noscript elements - h = h.replace(/]+|)>([\s\S]*?)<\/noscript>/g, function(v, attribs, text) { - return ''; - }); - } + if (node.parent) + node.remove(); - h = h.replace(//g, ''); + self.insert(node, self); + self.remove(); - // This function processes the attributes in the HTML string to force boolean - // attributes to the attr="attr" format and convert style, src and href to _mce_ versions - function processTags(html) { - return html.replace(tagRegExp, function(match, elm_name, attrs, end) { - return '<' + elm_name + attrs.replace(attrRegExp, function(match, name, value, val2, val3) { - var mceValue; + return self; + }, - name = name.toLowerCase(); - value = value || val2 || val3 || ""; + attr : function(name, value) { + var self = this, attrs, i, undef; - // Treat boolean attributes - if (boolAttrs[name]) { - // false or 0 is treated as a missing attribute - if (value === 'false' || value === '0') - return; + if (typeof name !== "string") { + for (i in name) + self.attr(i, name[i]); - return name + '="' + name + '"'; - } + return self; + } - // Is attribute one that needs special treatment - if (mceAttribs[name] && attrs.indexOf('_mce_' + name) == -1) { - mceValue = t.decode(value); + if (attrs = self.attributes) { + if (value !== undef) { + // Remove attribute + if (value === null) { + if (name in attrs.map) { + delete attrs.map[name]; - // Convert URLs to relative/absolute ones - if (s.url_converter && (name == "src" || name == "href")) - mceValue = s.url_converter.call(s.url_converter_scope || t, mceValue, name, elm_name); + i = attrs.length; + while (i--) { + if (attrs[i].name === name) { + attrs = attrs.splice(i, 1); + return self; + } + } + } - // Process styles lowercases them and compresses them - if (name == 'style') - mceValue = t.serializeStyle(t.parseStyle(mceValue), name); + return self; + } - return name + '="' + value + '"' + ' _mce_' + name + '="' + t.encode(mceValue) + '"'; + // Set attribute + if (name in attrs.map) { + // Set attribute + i = attrs.length; + while (i--) { + if (attrs[i].name === name) { + attrs[i].value = value; + break; } + } + } else + attrs.push({name: name, value: value}); - return match; - }) + end + '>'; - }); - }; - - h = processTags(h); + attrs.map[name] = value; - // Restore script blocks - h = h.replace(/MCE_SCRIPT:([0-9]+)/g, function(val, idx) { - return codeBlocks[idx]; - }); + return self; + } else { + return attrs.map[name]; + } } - - return h; }, - getOuterHTML : function(e) { - var d; + clone : function() { + var self = this, clone = new Node(self.name, self.type), i, l, selfAttrs, selfAttr, cloneAttrs; - e = this.get(e); + // Clone element attributes + if (selfAttrs = self.attributes) { + cloneAttrs = []; + cloneAttrs.map = {}; - if (!e) - return null; + for (i = 0, l = selfAttrs.length; i < l; i++) { + selfAttr = selfAttrs[i]; + + // Clone everything except id + if (selfAttr.name !== 'id') { + cloneAttrs[cloneAttrs.length] = {name: selfAttr.name, value: selfAttr.value}; + cloneAttrs.map[selfAttr.name] = selfAttr.value; + } + } - if (e.outerHTML !== undefined) - return e.outerHTML; + clone.attributes = cloneAttrs; + } - d = (e.ownerDocument || this.doc).createElement("body"); - d.appendChild(e.cloneNode(true)); + clone.value = self.value; + clone.shortEnded = self.shortEnded; - return d.innerHTML; + return clone; }, - setOuterHTML : function(e, h, d) { - var t = this; + wrap : function(wrapper) { + var self = this; - function setHTML(e, h, d) { - var n, tp; + self.parent.insert(wrapper, self); + wrapper.append(self); - tp = d.createElement("body"); - tp.innerHTML = h; + return self; + }, - n = tp.lastChild; - while (n) { - t.insertAfter(n.cloneNode(true), e); - n = n.previousSibling; - } + unwrap : function() { + var self = this, node, next; - t.remove(e); - }; + for (node = self.firstChild; node; ) { + next = node.next; + self.insert(node, self, true); + node = next; + } - return this.run(e, function(e) { - e = t.get(e); + self.remove(); + }, - // Only set HTML on elements - if (e.nodeType == 1) { - d = d || e.ownerDocument || t.doc; + remove : function() { + var self = this, parent = self.parent, next = self.next, prev = self.prev; - if (isIE) { - try { - // Try outerHTML for IE it sometimes produces an unknown runtime error - if (isIE && e.nodeType == 1) - e.outerHTML = h; - else - setHTML(e, h, d); - } catch (ex) { - // Fix for unknown runtime error - setHTML(e, h, d); - } - } else - setHTML(e, h, d); - } - }); - }, + if (parent) { + if (parent.firstChild === self) { + parent.firstChild = next; - decode : function(s) { - var e, n, v; + if (next) + next.prev = null; + } else { + prev.next = next; + } - // Look for entities to decode - if (/&[\w#]+;/.test(s)) { - // Decode the entities using a div element not super efficient but less code - e = this.doc.createElement("div"); - e.innerHTML = s; - n = e.firstChild; - v = ''; + if (parent.lastChild === self) { + parent.lastChild = prev; - if (n) { - do { - v += n.nodeValue; - } while (n = n.nextSibling); + if (prev) + prev.next = null; + } else { + next.prev = prev; } - return v || s; + self.parent = self.next = self.prev = null; } - return s; + return self; }, - encode : function(str) { - return ('' + str).replace(encodeCharsRe, function(chr) { - return encodedChars[chr]; - }); + append : function(node) { + var self = this, last; + + if (node.parent) + node.remove(); + + last = self.lastChild; + if (last) { + last.next = node; + node.prev = last; + self.lastChild = node; + } else + self.lastChild = self.firstChild = node; + + node.parent = self; + + return node; }, - insertAfter : function(node, reference_node) { - reference_node = this.get(reference_node); + insert : function(node, ref_node, before) { + var parent; - return this.run(node, function(node) { - var parent, nextSibling; + if (node.parent) + node.remove(); - parent = reference_node.parentNode; - nextSibling = reference_node.nextSibling; + parent = ref_node.parent || this; - if (nextSibling) - parent.insertBefore(node, nextSibling); + if (before) { + if (ref_node === parent.firstChild) + parent.firstChild = node; else - parent.appendChild(node); + ref_node.prev.next = node; - return node; - }); - }, + node.prev = ref_node.prev; + node.next = ref_node; + ref_node.prev = node; + } else { + if (ref_node === parent.lastChild) + parent.lastChild = node; + else + ref_node.next.prev = node; - isBlock : function(n) { - if (n.nodeType && n.nodeType !== 1) - return false; + node.next = ref_node.next; + node.prev = ref_node; + ref_node.next = node; + } - n = n.nodeName || n; + node.parent = parent; - return blockRe.test(n); + return node; }, - replace : function(n, o, k) { - var t = this; - - if (is(o, 'array')) - n = n.cloneNode(true); + getAll : function(name) { + var self = this, node, collection = []; - return t.run(o, function(o) { - if (k) { - each(tinymce.grep(o.childNodes), function(c) { - n.appendChild(c); - }); - } + for (node = self.firstChild; node; node = walk(node, self)) { + if (node.name === name) + collection.push(node); + } - return o.parentNode.replaceChild(n, o); - }); + return collection; }, - rename : function(elm, name) { - var t = this, newElm; + empty : function() { + var self = this, nodes, i, node; - if (elm.nodeName != name.toUpperCase()) { - // Rename block element - newElm = t.create(name); + // Remove all children + if (self.firstChild) { + nodes = []; - // Copy attribs to new block - each(t.getAttribs(elm), function(attr_node) { - t.setAttrib(newElm, attr_node.nodeName, t.getAttrib(elm, attr_node.nodeName)); - }); + // Collect the children + for (node = self.firstChild; node; node = walk(node, self)) + nodes.push(node); - // Replace block - t.replace(newElm, elm, 1); + // Remove the children + i = nodes.length; + while (i--) { + node = nodes[i]; + node.parent = node.firstChild = node.lastChild = node.next = node.prev = null; + } } - return newElm || elm; + self.firstChild = self.lastChild = null; + + return self; }, - findCommonAncestor : function(a, b) { - var ps = a, pe; + isEmpty : function(elements) { + var self = this, node = self.firstChild, i, name; - while (ps) { - pe = b; + if (node) { + do { + if (node.type === 1) { + // Ignore bogus elements + if (node.attributes.map['data-mce-bogus']) + continue; - while (pe && ps != pe) - pe = pe.parentNode; + // Keep empty elements like + if (elements[node.name]) + return false; - if (ps == pe) - break; + // Keep elements with data attributes or name attribute like + i = node.attributes.length; + while (i--) { + name = node.attributes[i].name; + if (name === "name" || name.indexOf('data-') === 0) + return false; + } + } - ps = ps.parentNode; + // Keep non whitespace text nodes + if ((node.type === 3 && !whiteSpaceRegExp.test(node.value))) + return false; + } while (node = walk(node, self)); } - if (!ps && a.ownerDocument) - return a.ownerDocument.documentElement; - - return ps; + return true; }, - toHex : function(s) { - var c = /^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(s); - - function hex(s) { - s = parseInt(s).toString(16); + walk : function(prev) { + return walk(this, null, prev); + } + }); - return s.length > 1 ? s : '0' + s; // 0 -> 00 - }; + tinymce.extend(Node, { + create : function(name, attrs) { + var node, attrName; - if (c) { - s = '#' + hex(c[1]) + hex(c[2]) + hex(c[3]); + // Create node + node = new Node(name, typeLookup[name] || 1); - return s; + // Add attributes if needed + if (attrs) { + for (attrName in attrs) + node.attr(attrName, attrs[attrName]); } - return s; - }, + return node; + } + }); - getClasses : function() { - var t = this, cl = [], i, lo = {}, f = t.settings.class_filter, ov; + tinymce.html.Node = Node; +})(tinymce); - if (t.classes) - return t.classes; +(function(tinymce) { + var Node = tinymce.html.Node; - function addClasses(s) { - // IE style imports - each(s.imports, function(r) { - addClasses(r); - }); + tinymce.html.DomParser = function(settings, schema) { + var self = this, nodeFilters = {}, attributeFilters = [], matchedNodes = {}, matchedAttributes = {}; - each(s.cssRules || s.rules, function(r) { - // Real type or fake it on IE - switch (r.type || 1) { - // Rule - case 1: - if (r.selectorText) { - each(r.selectorText.split(','), function(v) { - v = v.replace(/^\s*|\s*$|^\s\./g, ""); + settings = settings || {}; + settings.validate = "validate" in settings ? settings.validate : true; + settings.root_name = settings.root_name || 'body'; + self.schema = schema = schema || new tinymce.html.Schema(); - // Is internal or it doesn't contain a class - if (/\.mce/.test(v) || !/\.[\w\-]+$/.test(v)) - return; + function fixInvalidChildren(nodes) { + var ni, node, parent, parents, newParent, currentNode, tempNode, childNode, i, + childClone, nonEmptyElements, nonSplitableElements, sibling, nextNode; - // Remove everything but class name - ov = v; - v = v.replace(/.*\.([a-z0-9_\-]+).*/i, '$1'); + nonSplitableElements = tinymce.makeMap('tr,td,th,tbody,thead,tfoot,table'); + nonEmptyElements = schema.getNonEmptyElements(); - // Filter classes - if (f && !(v = f(v, ov))) - return; + for (ni = 0; ni < nodes.length; ni++) { + node = nodes[ni]; - if (!lo[v]) { - cl.push({'class' : v}); - lo[v] = 1; - } - }); - } - break; + // Already removed + if (!node.parent) + continue; - // Import - case 3: - addClasses(r.styleSheet); - break; - } - }); - }; + // Get list of all parent nodes until we find a valid parent to stick the child into + parents = [node]; + for (parent = node.parent; parent && !schema.isValidChild(parent.name, node.name) && !nonSplitableElements[parent.name]; parent = parent.parent) + parents.push(parent); - try { - each(t.doc.styleSheets, addClasses); - } catch (ex) { - // Ignore - } + // Found a suitable parent + if (parent && parents.length > 1) { + // Reverse the array since it makes looping easier + parents.reverse(); - if (cl.length > 0) - t.classes = cl; + // Clone the related parent and insert that after the moved node + newParent = currentNode = self.filterNode(parents[0].clone()); - return cl; - }, + // Start cloning and moving children on the left side of the target node + for (i = 0; i < parents.length - 1; i++) { + if (schema.isValidChild(currentNode.name, parents[i].name)) { + tempNode = self.filterNode(parents[i].clone()); + currentNode.append(tempNode); + } else + tempNode = currentNode; - run : function(e, f, s) { - var t = this, o; + for (childNode = parents[i].firstChild; childNode && childNode != parents[i + 1]; ) { + nextNode = childNode.next; + tempNode.append(childNode); + childNode = nextNode; + } - if (t.doc && typeof(e) === 'string') - e = t.get(e); + currentNode = tempNode; + } - if (!e) - return false; + if (!newParent.isEmpty(nonEmptyElements)) { + parent.insert(newParent, parents[0], true); + parent.insert(node, newParent); + } else { + parent.insert(node, parents[0], true); + } - s = s || this; - if (!e.nodeType && (e.length || e.length === 0)) { - o = []; + // Check if the element is empty by looking through it's contents and special treatment for


    + parent = parents[0]; + if (parent.isEmpty(nonEmptyElements) || parent.firstChild === parent.lastChild && parent.firstChild.name === 'br') { + parent.empty().remove(); + } + } else if (node.parent) { + // If it's an LI try to find a UL/OL for it or wrap it + if (node.name === 'li') { + sibling = node.prev; + if (sibling && (sibling.name === 'ul' || sibling.name === 'ul')) { + sibling.append(node); + continue; + } - each(e, function(e, i) { - if (e) { - if (typeof(e) == 'string') - e = t.doc.getElementById(e); + sibling = node.next; + if (sibling && (sibling.name === 'ul' || sibling.name === 'ul')) { + sibling.insert(node, sibling.firstChild, true); + continue; + } - o.push(f.call(s, e, i)); + node.wrap(self.filterNode(new Node('ul', 1))); + continue; } - }); - return o; + // Try wrapping the element in a DIV + if (schema.isValidChild(node.parent.name, 'div') && schema.isValidChild('div', node.name)) { + node.wrap(self.filterNode(new Node('div', 1))); + } else { + // We failed wrapping it, then remove or unwrap it + if (node.name === 'style' || node.name === 'script') + node.empty().remove(); + else + node.unwrap(); + } + } } + }; - return f.call(s, e); - }, + self.filterNode = function(node) { + var i, name, list; - getAttribs : function(n) { - var o; + // Run element filters + if (name in nodeFilters) { + list = matchedNodes[name]; - n = this.get(n); + if (list) + list.push(node); + else + matchedNodes[name] = [node]; + } - if (!n) - return []; + // Run attribute filters + i = attributeFilters.length; + while (i--) { + name = attributeFilters[i].name; - if (isIE) { - o = []; + if (name in node.attributes.map) { + list = matchedAttributes[name]; - // Object will throw exception in IE - if (n.nodeName == 'OBJECT') - return n.attributes; + if (list) + list.push(node); + else + matchedAttributes[name] = [node]; + } + } - // IE doesn't keep the selected attribute if you clone option elements - if (n.nodeName === 'OPTION' && this.getAttrib(n, 'selected')) - o.push({specified : 1, nodeName : 'selected'}); + return node; + }; - // It's crazy that this is faster in IE but it's because it returns all attributes all the time - n.cloneNode(false).outerHTML.replace(/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi, '').replace(/[\w:\-]+/gi, function(a) { - o.push({specified : 1, nodeName : a}); - }); + self.addNodeFilter = function(name, callback) { + tinymce.each(tinymce.explode(name), function(name) { + var list = nodeFilters[name]; - return o; - } + if (!list) + nodeFilters[name] = list = []; - return n.attributes; - }, + list.push(callback); + }); + }; - destroy : function(s) { - var t = this; + self.addAttributeFilter = function(name, callback) { + tinymce.each(tinymce.explode(name), function(name) { + var i; - if (t.events) - t.events.destroy(); + for (i = 0; i < attributeFilters.length; i++) { + if (attributeFilters[i].name === name) { + attributeFilters[i].callbacks.push(callback); + return; + } + } - t.win = t.doc = t.root = t.events = null; + attributeFilters.push({name: name, callbacks: [callback]}); + }); + }; - // Manual destroy then remove unload handler - if (!s) - tinymce.removeUnload(t.destroy); - }, + self.parse = function(html, args) { + var parser, rootNode, node, nodes, i, l, fi, fl, list, name, validate, + blockElements, startWhiteSpaceRegExp, invalidChildren = [], + endWhiteSpaceRegExp, allWhiteSpaceRegExp, whiteSpaceElements, children, nonEmptyElements, rootBlockName; + + args = args || {}; + matchedNodes = {}; + matchedAttributes = {}; + blockElements = tinymce.extend(tinymce.makeMap('script,style,head,html,body,title,meta,param'), schema.getBlockElements()); + nonEmptyElements = schema.getNonEmptyElements(); + children = schema.children; + validate = settings.validate; + rootBlockName = "forced_root_block" in args ? args.forced_root_block : settings.forced_root_block; + + whiteSpaceElements = schema.getWhiteSpaceElements(); + startWhiteSpaceRegExp = /^[ \t\r\n]+/; + endWhiteSpaceRegExp = /[ \t\r\n]+$/; + allWhiteSpaceRegExp = /[ \t\r\n]+/g; + + function addRootBlocks() { + var node = rootNode.firstChild, next, rootBlockNode; + + while (node) { + next = node.next; + + if (node.type == 3 || (node.type == 1 && node.name !== 'p' && !blockElements[node.name] && !node.attr('data-mce-type'))) { + if (!rootBlockNode) { + // Create a new root block element + rootBlockNode = createNode(rootBlockName, 1); + rootNode.insert(rootBlockNode, node); + rootBlockNode.append(node); + } else + rootBlockNode.append(node); + } else { + rootBlockNode = null; + } - createRng : function() { - var d = this.doc; + node = next; + }; + }; - return d.createRange ? d.createRange() : new tinymce.dom.Range(this); - }, + function createNode(name, type) { + var node = new Node(name, type), list; - nodeIndex : function(node, normalized) { - var idx = 0, lastNodeType, lastNode, nodeType; + if (name in nodeFilters) { + list = matchedNodes[name]; - if (node) { - for (lastNodeType = node.nodeType, node = node.previousSibling, lastNode = node; node; node = node.previousSibling) { - nodeType = node.nodeType; + if (list) + list.push(node); + else + matchedNodes[name] = [node]; + } - // Normalize text nodes - if (normalized && nodeType == 3) { - if (nodeType == lastNodeType || !node.nodeValue.length) - continue; - } + return node; + }; - idx++; - lastNodeType = nodeType; - } - } + function removeWhitespaceBefore(node) { + var textNode, textVal, sibling; - return idx; - }, + for (textNode = node.prev; textNode && textNode.type === 3; ) { + textVal = textNode.value.replace(endWhiteSpaceRegExp, ''); - split : function(pe, e, re) { - var t = this, r = t.createRng(), bef, aft, pa; + if (textVal.length > 0) { + textNode.value = textVal; + textNode = textNode.prev; + } else { + sibling = textNode.prev; + textNode.remove(); + textNode = sibling; + } + } + }; - // W3C valid browsers tend to leave empty nodes to the left/right side of the contents, this makes sense - // but we don't want that in our code since it serves no purpose for the end user - // For example if this is chopped: - //

    text 1CHOPtext 2

    - // would produce: - //

    text 1

    CHOP

    text 2

    - // this function will then trim of empty edges and produce: - //

    text 1

    CHOP

    text 2

    - function trim(node) { - var i, children = node.childNodes; + parser = new tinymce.html.SaxParser({ + validate : validate, + fix_self_closing : !validate, // Let the DOM parser handle
  • in
  • or

    in

    for better results - if (node.nodeType == 1 && node.getAttribute('_mce_type') == 'bookmark') - return; + cdata: function(text) { + node.append(createNode('#cdata', 4)).value = text; + }, - for (i = children.length - 1; i >= 0; i--) - trim(children[i]); + text: function(text, raw) { + var textNode; - if (node.nodeType != 9) { - // Keep non whitespace text nodes - if (node.nodeType == 3 && node.nodeValue.length > 0) - return; + // Trim all redundant whitespace on non white space elements + if (!whiteSpaceElements[node.name]) { + text = text.replace(allWhiteSpaceRegExp, ' '); - if (node.nodeType == 1) { - // If the only child is a bookmark then move it up - children = node.childNodes; - if (children.length == 1 && children[0] && children[0].nodeType == 1 && children[0].getAttribute('_mce_type') == 'bookmark') - node.parentNode.insertBefore(children[0], node); + if (node.lastChild && blockElements[node.lastChild.name]) + text = text.replace(startWhiteSpaceRegExp, ''); + } - // Keep non empty elements or img, hr etc - if (children.length || /^(br|hr|input|img)$/i.test(node.nodeName)) - return; + // Do we need to create the node + if (text.length !== 0) { + textNode = createNode('#text', 3); + textNode.raw = !!raw; + node.append(textNode).value = text; } + }, - t.remove(node); - } + comment: function(text) { + node.append(createNode('#comment', 8)).value = text; + }, - return node; - }; + pi: function(name, text) { + node.append(createNode(name, 7)).value = text; + removeWhitespaceBefore(node); + }, - if (pe && e) { - // Get before chunk - r.setStart(pe.parentNode, t.nodeIndex(pe)); - r.setEnd(e.parentNode, t.nodeIndex(e)); - bef = r.extractContents(); + doctype: function(text) { + var newNode; + + newNode = node.append(createNode('#doctype', 10)); + newNode.value = text; + removeWhitespaceBefore(node); + }, - // Get after chunk - r = t.createRng(); - r.setStart(e.parentNode, t.nodeIndex(e) + 1); - r.setEnd(pe.parentNode, t.nodeIndex(pe) + 1); - aft = r.extractContents(); + start: function(name, attrs, empty) { + var newNode, attrFiltersLen, elementRule, textNode, attrName, text, sibling, parent; - // Insert before chunk - pa = pe.parentNode; - pa.insertBefore(trim(bef), pe); + elementRule = validate ? schema.getElementRule(name) : {}; + if (elementRule) { + newNode = createNode(elementRule.outputName || name, 1); + newNode.attributes = attrs; + newNode.shortEnded = empty; - // Insert middle chunk - if (re) - pa.replaceChild(re, e); - else - pa.insertBefore(e, pe); + node.append(newNode); - // Insert after chunk - pa.insertBefore(trim(aft), pe); - t.remove(pe); + // Check if node is valid child of the parent node is the child is + // unknown we don't collect it since it's probably a custom element + parent = children[node.name]; + if (parent && children[newNode.name] && !parent[newNode.name]) + invalidChildren.push(newNode); - return re || e; - } - }, + attrFiltersLen = attributeFilters.length; + while (attrFiltersLen--) { + attrName = attributeFilters[attrFiltersLen].name; - bind : function(target, name, func, scope) { - var t = this; + if (attrName in attrs.map) { + list = matchedAttributes[attrName]; - if (!t.events) - t.events = new tinymce.dom.EventUtils(); + if (list) + list.push(newNode); + else + matchedAttributes[attrName] = [newNode]; + } + } - return t.events.add(target, name, func, scope || this); - }, + // Trim whitespace before block + if (blockElements[name]) + removeWhitespaceBefore(newNode); - unbind : function(target, name, func) { - var t = this; + // Change current node if the element wasn't empty i.e not
    or + if (!empty) + node = newNode; + } + }, - if (!t.events) - t.events = new tinymce.dom.EventUtils(); + end: function(name) { + var textNode, elementRule, text, sibling, tempNode; - return t.events.remove(target, name, func); - }, + elementRule = validate ? schema.getElementRule(name) : {}; + if (elementRule) { + if (blockElements[name]) { + if (!whiteSpaceElements[node.name]) { + // Trim whitespace at beginning of block + for (textNode = node.firstChild; textNode && textNode.type === 3; ) { + text = textNode.value.replace(startWhiteSpaceRegExp, ''); + if (text.length > 0) { + textNode.value = text; + textNode = textNode.next; + } else { + sibling = textNode.next; + textNode.remove(); + textNode = sibling; + } + } - _findSib : function(node, selector, name) { - var t = this, f = selector; + // Trim whitespace at end of block + for (textNode = node.lastChild; textNode && textNode.type === 3; ) { + text = textNode.value.replace(endWhiteSpaceRegExp, ''); - if (node) { - // If expression make a function of it using is - if (is(f, 'string')) { - f = function(node) { - return t.is(node, selector); - }; - } + if (text.length > 0) { + textNode.value = text; + textNode = textNode.prev; + } else { + sibling = textNode.prev; + textNode.remove(); + textNode = sibling; + } + } + } - // Loop all siblings - for (node = node[name]; node; node = node[name]) { - if (f(node)) - return node; + // Trim start white space + textNode = node.prev; + if (textNode && textNode.type === 3) { + text = textNode.value.replace(startWhiteSpaceRegExp, ''); + + if (text.length > 0) + textNode.value = text; + else + textNode.remove(); + } + } + + // Handle empty nodes + if (elementRule.removeEmpty || elementRule.paddEmpty) { + if (node.isEmpty(nonEmptyElements)) { + if (elementRule.paddEmpty) + node.empty().append(new Node('#text', '3')).value = '\u00a0'; + else { + // Leave nodes that have a name like + if (!node.attributes.map.name) { + tempNode = node.parent; + node.empty().remove(); + node = tempNode; + return; + } + } + } + } + + node = node.parent; + } } - } + }, schema); - return null; - }, + rootNode = node = new Node(args.context || settings.root_name, 11); - _isRes : function(c) { - // Is live resizble element - return /^(top|left|bottom|right|width|height)/i.test(c) || /;\s*(top|left|bottom|right|width|height)/i.test(c); - } + parser.parse(html); - /* - walk : function(n, f, s) { - var d = this.doc, w; + // Fix invalid children or report invalid children in a contextual parsing + if (validate && invalidChildren.length) { + if (!args.context) + fixInvalidChildren(invalidChildren); + else + args.invalid = true; + } - if (d.createTreeWalker) { - w = d.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, false); + // Wrap nodes in the root into block elements if the root is body + if (rootBlockName && rootNode.name == 'body') + addRootBlocks(); - while ((n = w.nextNode()) != null) - f.call(s || this, n); - } else - tinymce.walk(n, f, 'childNodes', s); - } - */ + // Run filters only when the contents is valid + if (!args.invalid) { + // Run node filters + for (name in matchedNodes) { + list = nodeFilters[name]; + nodes = matchedNodes[name]; - /* - toRGB : function(s) { - var c = /^\s*?#([0-9A-F]{2})([0-9A-F]{1,2})([0-9A-F]{2})?\s*?$/.exec(s); + // Remove already removed children + fi = nodes.length; + while (fi--) { + if (!nodes[fi].parent) + nodes.splice(fi, 1); + } - if (c) { - // #FFF -> #FFFFFF - if (!is(c[3])) - c[3] = c[2] = c[1]; + for (i = 0, l = list.length; i < l; i++) + list[i](nodes, name, args); + } - return "rgb(" + parseInt(c[1], 16) + "," + parseInt(c[2], 16) + "," + parseInt(c[3], 16) + ")"; - } + // Run attribute filters + for (i = 0, l = attributeFilters.length; i < l; i++) { + list = attributeFilters[i]; - return s; - } - */ - }); + if (list.name in matchedAttributes) { + nodes = matchedAttributes[list.name]; - tinymce.DOM = new tinymce.dom.DOMUtils(document, {process_html : 0}); -})(tinymce); + // Remove already removed children + fi = nodes.length; + while (fi--) { + if (!nodes[fi].parent) + nodes.splice(fi, 1); + } -(function(ns) { - // Range constructor - function Range(dom) { - var t = this, - doc = dom.doc, - EXTRACT = 0, - CLONE = 1, - DELETE = 2, - TRUE = true, - FALSE = false, - START_OFFSET = 'startOffset', - START_CONTAINER = 'startContainer', - END_CONTAINER = 'endContainer', - END_OFFSET = 'endOffset', - extend = tinymce.extend, - nodeIndex = dom.nodeIndex; + for (fi = 0, fl = list.callbacks.length; fi < fl; fi++) + list.callbacks[fi](nodes, list.name, args); + } + } + } - extend(t, { - // Inital states - startContainer : doc, - startOffset : 0, - endContainer : doc, - endOffset : 0, - collapsed : TRUE, - commonAncestorContainer : doc, + return rootNode; + }; - // Range constants - START_TO_START : 0, - START_TO_END : 1, - END_TO_END : 2, - END_TO_START : 3, + // Remove
    at end of block elements Gecko and WebKit injects BR elements to + // make it possible to place the caret inside empty blocks. This logic tries to remove + // these elements and keep br elements that where intended to be there intact + if (settings.remove_trailing_brs) { + self.addNodeFilter('br', function(nodes, name) { + var i, l = nodes.length, node, blockElements = schema.getBlockElements(), + nonEmptyElements = schema.getNonEmptyElements(), parent, prev, prevName; + + // Remove brs from body element as well + blockElements.body = 1; + + // Must loop forwards since it will otherwise remove all brs in

    a


    + for (i = 0; i < l; i++) { + node = nodes[i]; + parent = node.parent; + + if (blockElements[node.parent.name] && node === parent.lastChild) { + // Loop all nodes to the right of the current node and check for other BR elements + // excluding bookmarks since they are invisible + prev = node.prev; + while (prev) { + prevName = prev.name; + + // Ignore bookmarks + if (prevName !== "span" || prev.attr('data-mce-type') !== 'bookmark') { + // Found a non BR element + if (prevName !== "br") + break; + + // Found another br it's a

    structure then don't remove anything + if (prevName === 'br') { + node = null; + break; + } + } - // Public methods - setStart : setStart, - setEnd : setEnd, - setStartBefore : setStartBefore, - setStartAfter : setStartAfter, - setEndBefore : setEndBefore, - setEndAfter : setEndAfter, - collapse : collapse, - selectNode : selectNode, - selectNodeContents : selectNodeContents, - compareBoundaryPoints : compareBoundaryPoints, - deleteContents : deleteContents, - extractContents : extractContents, - cloneContents : cloneContents, - insertNode : insertNode, - surroundContents : surroundContents, - cloneRange : cloneRange - }); + prev = prev.prev; + } - function setStart(n, o) { - _setEndPoint(TRUE, n, o); - }; + if (node) { + node.remove(); + + // Is the parent to be considered empty after we removed the BR + if (parent.isEmpty(nonEmptyElements)) { + elementRule = schema.getElementRule(parent.name); + + // Remove or padd the element depending on schema rule + if (elementRule) { + if (elementRule.removeEmpty) + parent.remove(); + else if (elementRule.paddEmpty) + parent.empty().append(new tinymce.html.Node('#text', 3)).value = '\u00a0'; + } + } + } + } + } + }); + } + } +})(tinymce); - function setEnd(n, o) { - _setEndPoint(FALSE, n, o); - }; +tinymce.html.Writer = function(settings) { + var html = [], indent, indentBefore, indentAfter, encode, htmlOutput; - function setStartBefore(n) { - setStart(n.parentNode, nodeIndex(n)); - }; + settings = settings || {}; + indent = settings.indent; + indentBefore = tinymce.makeMap(settings.indent_before || ''); + indentAfter = tinymce.makeMap(settings.indent_after || ''); + encode = tinymce.html.Entities.getEncodeFunc(settings.entity_encoding || 'raw', settings.entities); + htmlOutput = settings.element_format == "html"; - function setStartAfter(n) { - setStart(n.parentNode, nodeIndex(n) + 1); - }; + return { + start: function(name, attrs, empty) { + var i, l, attr, value; - function setEndBefore(n) { - setEnd(n.parentNode, nodeIndex(n)); - }; + if (indent && indentBefore[name] && html.length > 0) { + value = html[html.length - 1]; - function setEndAfter(n) { - setEnd(n.parentNode, nodeIndex(n) + 1); - }; + if (value.length > 0 && value !== '\n') + html.push('\n'); + } - function collapse(ts) { - if (ts) { - t[END_CONTAINER] = t[START_CONTAINER]; - t[END_OFFSET] = t[START_OFFSET]; - } else { - t[START_CONTAINER] = t[END_CONTAINER]; - t[START_OFFSET] = t[END_OFFSET]; + html.push('<', name); + + if (attrs) { + for (i = 0, l = attrs.length; i < l; i++) { + attr = attrs[i]; + html.push(' ', attr.name, '="', encode(attr.value, true), '"'); + } } - t.collapsed = TRUE; - }; + if (!empty || htmlOutput) + html[html.length] = '>'; + else + html[html.length] = ' />'; - function selectNode(n) { - setStartBefore(n); - setEndAfter(n); - }; + if (empty && indent && indentAfter[name] && html.length > 0) { + value = html[html.length - 1]; - function selectNodeContents(n) { - setStart(n, 0); - setEnd(n, n.nodeType === 1 ? n.childNodes.length : n.nodeValue.length); - }; + if (value.length > 0 && value !== '\n') + html.push('\n'); + } + }, - function compareBoundaryPoints(h, r) { - var sc = t[START_CONTAINER], so = t[START_OFFSET], ec = t[END_CONTAINER], eo = t[END_OFFSET]; + end: function(name) { + var value; - // Check START_TO_START - if (h === 0) - return _compareBoundaryPoints(sc, so, sc, so); + /*if (indent && indentBefore[name] && html.length > 0) { + value = html[html.length - 1]; - // Check START_TO_END - if (h === 1) - return _compareBoundaryPoints(sc, so, ec, eo); + if (value.length > 0 && value !== '\n') + html.push('\n'); + }*/ - // Check END_TO_END - if (h === 2) - return _compareBoundaryPoints(ec, eo, ec, eo); + html.push(''); - // Check END_TO_START - if (h === 3) - return _compareBoundaryPoints(ec, eo, sc, so); - }; + if (indent && indentAfter[name] && html.length > 0) { + value = html[html.length - 1]; - function deleteContents() { - _traverse(DELETE); - }; + if (value.length > 0 && value !== '\n') + html.push('\n'); + } + }, - function extractContents() { - return _traverse(EXTRACT); - }; + text: function(text, raw) { + if (text.length > 0) + html[html.length] = raw ? text : encode(text); + }, - function cloneContents() { - return _traverse(CLONE); - }; + cdata: function(text) { + html.push(''); + }, - function insertNode(n) { - var startContainer = this[START_CONTAINER], - startOffset = this[START_OFFSET], nn, o; + comment: function(text) { + html.push(''); + }, - // Node is TEXT_NODE or CDATA - if ((startContainer.nodeType === 3 || startContainer.nodeType === 4) && startContainer.nodeValue) { - if (!startOffset) { - // At the start of text - startContainer.parentNode.insertBefore(n, startContainer); - } else if (startOffset >= startContainer.nodeValue.length) { - // At the end of text - dom.insertAfter(n, startContainer); - } else { - // Middle, need to split - nn = startContainer.splitText(startOffset); - startContainer.parentNode.insertBefore(n, nn); - } - } else { - // Insert element node - if (startContainer.childNodes.length > 0) - o = startContainer.childNodes[startOffset]; + pi: function(name, text) { + if (text) + html.push(''); + else + html.push(''); - if (o) - startContainer.insertBefore(n, o); - else - startContainer.appendChild(n); - } - }; + if (indent) + html.push('\n'); + }, - function surroundContents(n) { - var f = t.extractContents(); + doctype: function(text) { + html.push('', indent ? '\n' : ''); + }, - t.insertNode(n); - n.appendChild(f); - t.selectNode(n); - }; + reset: function() { + html.length = 0; + }, - function cloneRange() { - return extend(new Range(dom), { - startContainer : t[START_CONTAINER], - startOffset : t[START_OFFSET], - endContainer : t[END_CONTAINER], - endOffset : t[END_OFFSET], - collapsed : t.collapsed, - commonAncestorContainer : t.commonAncestorContainer - }); - }; + getContent: function() { + return html.join('').replace(/\n$/, ''); + } + }; +}; - // Private methods +(function(tinymce) { + tinymce.html.Serializer = function(settings, schema) { + var self = this, writer = new tinymce.html.Writer(settings); - function _getSelectedNode(container, offset) { - var child; + settings = settings || {}; + settings.validate = "validate" in settings ? settings.validate : true; - if (container.nodeType == 3 /* TEXT_NODE */) - return container; + self.schema = schema = schema || new tinymce.html.Schema(); + self.writer = writer; - if (offset < 0) - return container; + self.serialize = function(node) { + var handlers, validate; - child = container.firstChild; - while (child && offset > 0) { - --offset; - child = child.nextSibling; - } + validate = settings.validate; - if (child) - return child; + handlers = { + // #text + 3: function(node, raw) { + writer.text(node.value, node.raw); + }, - return container; - }; + // #comment + 8: function(node) { + writer.comment(node.value); + }, - function _isCollapsed() { - return (t[START_CONTAINER] == t[END_CONTAINER] && t[START_OFFSET] == t[END_OFFSET]); - }; + // Processing instruction + 7: function(node) { + writer.pi(node.name, node.value); + }, - function _compareBoundaryPoints(containerA, offsetA, containerB, offsetB) { - var c, offsetC, n, cmnRoot, childA, childB; + // Doctype + 10: function(node) { + writer.doctype(node.value); + }, - // In the first case the boundary-points have the same container. A is before B - // if its offset is less than the offset of B, A is equal to B if its offset is - // equal to the offset of B, and A is after B if its offset is greater than the - // offset of B. - if (containerA == containerB) { - if (offsetA == offsetB) - return 0; // equal + // CDATA + 4: function(node) { + writer.cdata(node.value); + }, - if (offsetA < offsetB) - return -1; // before + // Document fragment + 11: function(node) { + if ((node = node.firstChild)) { + do { + walk(node); + } while (node = node.next); + } + } + }; - return 1; // after - } + writer.reset(); - // In the second case a child node C of the container of A is an ancestor - // container of B. In this case, A is before B if the offset of A is less than or - // equal to the index of the child node C and A is after B otherwise. - c = containerB; - while (c && c.parentNode != containerA) - c = c.parentNode; + function walk(node) { + var handler = handlers[node.type], name, isEmpty, attrs, attrName, attrValue, sortedAttrs, i, l, elementRule; - if (c) { - offsetC = 0; - n = containerA.firstChild; + if (!handler) { + name = node.name; + isEmpty = node.shortEnded; + attrs = node.attributes; - while (n != c && offsetC < offsetA) { - offsetC++; - n = n.nextSibling; - } + // Sort attributes + if (validate && attrs && attrs.length > 1) { + sortedAttrs = []; + sortedAttrs.map = {}; - if (offsetA <= offsetC) - return -1; // before + elementRule = schema.getElementRule(node.name); + for (i = 0, l = elementRule.attributesOrder.length; i < l; i++) { + attrName = elementRule.attributesOrder[i]; - return 1; // after - } + if (attrName in attrs.map) { + attrValue = attrs.map[attrName]; + sortedAttrs.map[attrName] = attrValue; + sortedAttrs.push({name: attrName, value: attrValue}); + } + } - // In the third case a child node C of the container of B is an ancestor container - // of A. In this case, A is before B if the index of the child node C is less than - // the offset of B and A is after B otherwise. - c = containerA; - while (c && c.parentNode != containerB) { - c = c.parentNode; - } + for (i = 0, l = attrs.length; i < l; i++) { + attrName = attrs[i].name; - if (c) { - offsetC = 0; - n = containerB.firstChild; + if (!(attrName in sortedAttrs.map)) { + attrValue = attrs.map[attrName]; + sortedAttrs.map[attrName] = attrValue; + sortedAttrs.push({name: attrName, value: attrValue}); + } + } - while (n != c && offsetC < offsetB) { - offsetC++; - n = n.nextSibling; - } + attrs = sortedAttrs; + } - if (offsetC < offsetB) - return -1; // before + writer.start(node.name, attrs, isEmpty); - return 1; // after - } + if (!isEmpty) { + if ((node = node.firstChild)) { + do { + walk(node); + } while (node = node.next); + } - // In the fourth case, none of three other cases hold: the containers of A and B - // are siblings or descendants of sibling nodes. In this case, A is before B if - // the container of A is before the container of B in a pre-order traversal of the - // Ranges' context tree and A is after B otherwise. - cmnRoot = dom.findCommonAncestor(containerA, containerB); - childA = containerA; + writer.end(name); + } + } else + handler(node); + } - while (childA && childA.parentNode != cmnRoot) - childA = childA.parentNode; + // Serialize element and treat all non elements as fragments + if (node.type == 1 && !settings.inner) + walk(node); + else + handlers[11](node); - if (!childA) - childA = cmnRoot; + return writer.getContent(); + }; + } +})(tinymce); - childB = containerB; - while (childB && childB.parentNode != cmnRoot) - childB = childB.parentNode; +(function(tinymce) { + // Shorten names + var each = tinymce.each, + is = tinymce.is, + isWebKit = tinymce.isWebKit, + isIE = tinymce.isIE, + Entities = tinymce.html.Entities, + simpleSelectorRe = /^([a-z0-9],?)+$/i, + blockElementsMap = tinymce.html.Schema.blockElementsMap, + whiteSpaceRegExp = /^[ \t\r\n]*$/; - if (!childB) - childB = cmnRoot; + tinymce.create('tinymce.dom.DOMUtils', { + doc : null, + root : null, + files : null, + pixelStyles : /^(top|left|bottom|right|width|height|borderWidth)$/, + props : { + "for" : "htmlFor", + "class" : "className", + className : "className", + checked : "checked", + disabled : "disabled", + maxlength : "maxLength", + readonly : "readOnly", + selected : "selected", + value : "value", + id : "id", + name : "name", + type : "type" + }, - if (childA == childB) - return 0; // equal + DOMUtils : function(d, s) { + var t = this, globalStyle, name; - n = cmnRoot.firstChild; - while (n) { - if (n == childA) - return -1; // before + t.doc = d; + t.win = window; + t.files = {}; + t.cssFlicker = false; + t.counter = 0; + t.stdMode = !tinymce.isIE || d.documentMode >= 8; + t.boxModel = !tinymce.isIE || d.compatMode == "CSS1Compat" || t.stdMode; + t.hasOuterHTML = "outerHTML" in d.createElement("a"); - if (n == childB) - return 1; // after + t.settings = s = tinymce.extend({ + keep_values : false, + hex_colors : 1 + }, s); + + t.schema = s.schema; + t.styles = new tinymce.html.Styles({ + url_converter : s.url_converter, + url_converter_scope : s.url_converter_scope + }, s.schema); - n = n.nextSibling; + // Fix IE6SP2 flicker and check it failed for pre SP2 + if (tinymce.isIE6) { + try { + d.execCommand('BackgroundImageCache', false, true); + } catch (e) { + t.cssFlicker = true; + } } - }; - function _setEndPoint(st, n, o) { - var ec, sc; + if (isIE && s.schema) { + // Add missing HTML 4/5 elements to IE + ('abbr article aside audio canvas ' + + 'details figcaption figure footer ' + + 'header hgroup mark menu meter nav ' + + 'output progress section summary ' + + 'time video').replace(/\w+/g, function(name) { + d.createElement(name); + }); - if (st) { - t[START_CONTAINER] = n; - t[START_OFFSET] = o; - } else { - t[END_CONTAINER] = n; - t[END_OFFSET] = o; + // Create all custom elements + for (name in s.schema.getCustomElements()) { + d.createElement(name); + } } - // If one boundary-point of a Range is set to have a root container - // other than the current one for the Range, the Range is collapsed to - // the new position. This enforces the restriction that both boundary- - // points of a Range must have the same root container. - ec = t[END_CONTAINER]; - while (ec.parentNode) - ec = ec.parentNode; - - sc = t[START_CONTAINER]; - while (sc.parentNode) - sc = sc.parentNode; + tinymce.addUnload(t.destroy, t); + }, - if (sc == ec) { - // The start position of a Range is guaranteed to never be after the - // end position. To enforce this restriction, if the start is set to - // be at a position after the end, the Range is collapsed to that - // position. - if (_compareBoundaryPoints(t[START_CONTAINER], t[START_OFFSET], t[END_CONTAINER], t[END_OFFSET]) > 0) - t.collapse(st); - } else - t.collapse(st); + getRoot : function() { + var t = this, s = t.settings; - t.collapsed = _isCollapsed(); - t.commonAncestorContainer = dom.findCommonAncestor(t[START_CONTAINER], t[END_CONTAINER]); - }; + return (s && t.get(s.root_element)) || t.doc.body; + }, - function _traverse(how) { - var c, endContainerDepth = 0, startContainerDepth = 0, p, depthDiff, startNode, endNode, sp, ep; + getViewPort : function(w) { + var d, b; - if (t[START_CONTAINER] == t[END_CONTAINER]) - return _traverseSameContainer(how); + w = !w ? this.win : w; + d = w.document; + b = this.boxModel ? d.documentElement : d.body; - for (c = t[END_CONTAINER], p = c.parentNode; p; c = p, p = p.parentNode) { - if (p == t[START_CONTAINER]) - return _traverseCommonStartContainer(c, how); + // Returns viewport size excluding scrollbars + return { + x : w.pageXOffset || b.scrollLeft, + y : w.pageYOffset || b.scrollTop, + w : w.innerWidth || b.clientWidth, + h : w.innerHeight || b.clientHeight + }; + }, - ++endContainerDepth; - } + getRect : function(e) { + var p, t = this, sr; - for (c = t[START_CONTAINER], p = c.parentNode; p; c = p, p = p.parentNode) { - if (p == t[END_CONTAINER]) - return _traverseCommonEndContainer(c, how); + e = t.get(e); + p = t.getPos(e); + sr = t.getSize(e); - ++startContainerDepth; - } + return { + x : p.x, + y : p.y, + w : sr.w, + h : sr.h + }; + }, - depthDiff = startContainerDepth - endContainerDepth; + getSize : function(e) { + var t = this, w, h; - startNode = t[START_CONTAINER]; - while (depthDiff > 0) { - startNode = startNode.parentNode; - depthDiff--; - } + e = t.get(e); + w = t.getStyle(e, 'width'); + h = t.getStyle(e, 'height'); - endNode = t[END_CONTAINER]; - while (depthDiff < 0) { - endNode = endNode.parentNode; - depthDiff++; - } + // Non pixel value, then force offset/clientWidth + if (w.indexOf('px') === -1) + w = 0; - // ascend the ancestor hierarchy until we have a common parent. - for (sp = startNode.parentNode, ep = endNode.parentNode; sp != ep; sp = sp.parentNode, ep = ep.parentNode) { - startNode = sp; - endNode = ep; - } + // Non pixel value, then force offset/clientWidth + if (h.indexOf('px') === -1) + h = 0; - return _traverseCommonAncestors(startNode, endNode, how); - }; + return { + w : parseInt(w) || e.offsetWidth || e.clientWidth, + h : parseInt(h) || e.offsetHeight || e.clientHeight + }; + }, - function _traverseSameContainer(how) { - var frag, s, sub, n, cnt, sibling, xferNode; + getParent : function(n, f, r) { + return this.getParents(n, f, r, false); + }, - if (how != DELETE) - frag = doc.createDocumentFragment(); + getParents : function(n, f, r, c) { + var t = this, na, se = t.settings, o = []; - // If selection is empty, just return the fragment - if (t[START_OFFSET] == t[END_OFFSET]) - return frag; + n = t.get(n); + c = c === undefined; - // Text node needs special case handling - if (t[START_CONTAINER].nodeType == 3 /* TEXT_NODE */) { - // get the substring - s = t[START_CONTAINER].nodeValue; - sub = s.substring(t[START_OFFSET], t[END_OFFSET]); + if (se.strict_root) + r = r || t.getRoot(); - // set the original text node to its new value - if (how != CLONE) { - t[START_CONTAINER].deleteData(t[START_OFFSET], t[END_OFFSET] - t[START_OFFSET]); + // Wrap node name as func + if (is(f, 'string')) { + na = f; - // Nothing is partially selected, so collapse to start point - t.collapse(TRUE); + if (f === '*') { + f = function(n) {return n.nodeType == 1;}; + } else { + f = function(n) { + return t.is(n, na); + }; } - - if (how == DELETE) - return; - - frag.appendChild(doc.createTextNode(sub)); - return frag; } - // Copy nodes between the start/end offsets. - n = _getSelectedNode(t[START_CONTAINER], t[START_OFFSET]); - cnt = t[END_OFFSET] - t[START_OFFSET]; - - while (cnt > 0) { - sibling = n.nextSibling; - xferNode = _traverseFullySelected(n, how); + while (n) { + if (n == r || !n.nodeType || n.nodeType === 9) + break; - if (frag) - frag.appendChild( xferNode ); + if (!f || f(n)) { + if (c) + o.push(n); + else + return n; + } - --cnt; - n = sibling; + n = n.parentNode; } - // Nothing is partially selected, so collapse to start point - if (how != CLONE) - t.collapse(TRUE); + return c ? o : null; + }, - return frag; - }; + get : function(e) { + var n; - function _traverseCommonStartContainer(endAncestor, how) { - var frag, n, endIdx, cnt, sibling, xferNode; + if (e && this.doc && typeof(e) == 'string') { + n = e; + e = this.doc.getElementById(e); - if (how != DELETE) - frag = doc.createDocumentFragment(); + // IE and Opera returns meta elements when they match the specified input ID, but getElementsByName seems to do the trick + if (e && e.id !== n) + return this.doc.getElementsByName(n)[1]; + } - n = _traverseRightBoundary(endAncestor, how); + return e; + }, - if (frag) - frag.appendChild(n); + getNext : function(node, selector) { + return this._findSib(node, selector, 'nextSibling'); + }, - endIdx = nodeIndex(endAncestor); - cnt = endIdx - t[START_OFFSET]; + getPrev : function(node, selector) { + return this._findSib(node, selector, 'previousSibling'); + }, - if (cnt <= 0) { - // Collapse to just before the endAncestor, which - // is partially selected. - if (how != CLONE) { - t.setEndBefore(endAncestor); - t.collapse(FALSE); - } - return frag; - } + select : function(pa, s) { + var t = this; - n = endAncestor.previousSibling; - while (cnt > 0) { - sibling = n.previousSibling; - xferNode = _traverseFullySelected(n, how); + return tinymce.dom.Sizzle(pa, t.get(s) || t.get(t.settings.root_element) || t.doc, []); + }, - if (frag) - frag.insertBefore(xferNode, frag.firstChild); + is : function(n, selector) { + var i; - --cnt; - n = sibling; - } + // If it isn't an array then try to do some simple selectors instead of Sizzle for to boost performance + if (n.length === undefined) { + // Simple all selector + if (selector === '*') + return n.nodeType == 1; - // Collapse to just before the endAncestor, which - // is partially selected. - if (how != CLONE) { - t.setEndBefore(endAncestor); - t.collapse(FALSE); - } + // Simple selector just elements + if (simpleSelectorRe.test(selector)) { + selector = selector.toLowerCase().split(/,/); + n = n.nodeName.toLowerCase(); - return frag; - }; + for (i = selector.length - 1; i >= 0; i--) { + if (selector[i] == n) + return true; + } - function _traverseCommonEndContainer(startAncestor, how) { - var frag, startIdx, n, cnt, sibling, xferNode; + return false; + } + } - if (how != DELETE) - frag = doc.createDocumentFragment(); + return tinymce.dom.Sizzle.matches(selector, n.nodeType ? [n] : n).length > 0; + }, - n = _traverseLeftBoundary(startAncestor, how); - if (frag) - frag.appendChild(n); - startIdx = nodeIndex(startAncestor); - ++startIdx; // Because we already traversed it.... + add : function(p, n, a, h, c) { + var t = this; - cnt = t[END_OFFSET] - startIdx; - n = startAncestor.nextSibling; - while (cnt > 0) { - sibling = n.nextSibling; - xferNode = _traverseFullySelected(n, how); + return this.run(p, function(p) { + var e, k; - if (frag) - frag.appendChild(xferNode); + e = is(n, 'string') ? t.doc.createElement(n) : n; + t.setAttribs(e, a); - --cnt; - n = sibling; - } + if (h) { + if (h.nodeType) + e.appendChild(h); + else + t.setHTML(e, h); + } - if (how != CLONE) { - t.setStartAfter(startAncestor); - t.collapse(TRUE); - } + return !c ? p.appendChild(e) : e; + }); + }, - return frag; - }; + create : function(n, a, h) { + return this.add(this.doc.createElement(n), n, a, h, 1); + }, - function _traverseCommonAncestors(startAncestor, endAncestor, how) { - var n, frag, commonParent, startOffset, endOffset, cnt, sibling, nextSibling; + createHTML : function(n, a, h) { + var o = '', t = this, k; - if (how != DELETE) - frag = doc.createDocumentFragment(); + o += '<' + n; - n = _traverseLeftBoundary(startAncestor, how); - if (frag) - frag.appendChild(n); + for (k in a) { + if (a.hasOwnProperty(k)) + o += ' ' + k + '="' + t.encode(a[k]) + '"'; + } - commonParent = startAncestor.parentNode; - startOffset = nodeIndex(startAncestor); - endOffset = nodeIndex(endAncestor); - ++startOffset; + // A call to tinymce.is doesn't work for some odd reason on IE9 possible bug inside their JS runtime + if (typeof(h) != "undefined") + return o + '>' + h + ''; - cnt = endOffset - startOffset; - sibling = startAncestor.nextSibling; + return o + ' />'; + }, - while (cnt > 0) { - nextSibling = sibling.nextSibling; - n = _traverseFullySelected(sibling, how); + remove : function(node, keep_children) { + return this.run(node, function(node) { + var child, parent = node.parentNode; - if (frag) - frag.appendChild(n); + if (!parent) + return null; - sibling = nextSibling; - --cnt; - } + if (keep_children) { + while (child = node.firstChild) { + // IE 8 will crash if you don't remove completely empty text nodes + if (!tinymce.isIE || child.nodeType !== 3 || child.nodeValue) + parent.insertBefore(child, node); + else + node.removeChild(child); + } + } - n = _traverseRightBoundary(endAncestor, how); + return parent.removeChild(node); + }); + }, - if (frag) - frag.appendChild(n); + setStyle : function(n, na, v) { + var t = this; - if (how != CLONE) { - t.setStartAfter(startAncestor); - t.collapse(TRUE); - } + return t.run(n, function(e) { + var s, i; - return frag; - }; + s = e.style; - function _traverseRightBoundary(root, how) { - var next = _getSelectedNode(t[END_CONTAINER], t[END_OFFSET] - 1), parent, clonedParent, prevSibling, clonedChild, clonedGrandParent, isFullySelected = next != t[END_CONTAINER]; + // Camelcase it, if needed + na = na.replace(/-(\D)/g, function(a, b){ + return b.toUpperCase(); + }); - if (next == root) - return _traverseNode(next, isFullySelected, FALSE, how); + // Default px suffix on these + if (t.pixelStyles.test(na) && (tinymce.is(v, 'number') || /^[\-0-9\.]+$/.test(v))) + v += 'px'; - parent = next.parentNode; - clonedParent = _traverseNode(parent, FALSE, FALSE, how); + switch (na) { + case 'opacity': + // IE specific opacity + if (isIE) { + s.filter = v === '' ? '' : "alpha(opacity=" + (v * 100) + ")"; - while (parent) { - while (next) { - prevSibling = next.previousSibling; - clonedChild = _traverseNode(next, isFullySelected, FALSE, how); + if (!n.currentStyle || !n.currentStyle.hasLayout) + s.display = 'inline-block'; + } - if (how != DELETE) - clonedParent.insertBefore(clonedChild, clonedParent.firstChild); + // Fix for older browsers + s[na] = s['-moz-opacity'] = s['-khtml-opacity'] = v || ''; + break; - isFullySelected = TRUE; - next = prevSibling; + case 'float': + isIE ? s.styleFloat = v : s.cssFloat = v; + break; + + default: + s[na] = v || ''; } - if (parent == root) - return clonedParent; - - next = parent.previousSibling; - parent = parent.parentNode; + // Force update of the style data + if (t.settings.update_styles) + t.setAttrib(e, 'data-mce-style'); + }); + }, - clonedGrandParent = _traverseNode(parent, FALSE, FALSE, how); + getStyle : function(n, na, c) { + n = this.get(n); - if (how != DELETE) - clonedGrandParent.appendChild(clonedParent); - - clonedParent = clonedGrandParent; - } - }; - - function _traverseLeftBoundary(root, how) { - var next = _getSelectedNode(t[START_CONTAINER], t[START_OFFSET]), isFullySelected = next != t[START_CONTAINER], parent, clonedParent, nextSibling, clonedChild, clonedGrandParent; - - if (next == root) - return _traverseNode(next, isFullySelected, TRUE, how); - - parent = next.parentNode; - clonedParent = _traverseNode(parent, FALSE, TRUE, how); - - while (parent) { - while (next) { - nextSibling = next.nextSibling; - clonedChild = _traverseNode(next, isFullySelected, TRUE, how); + if (!n) + return; - if (how != DELETE) - clonedParent.appendChild(clonedChild); + // Gecko + if (this.doc.defaultView && c) { + // Remove camelcase + na = na.replace(/[A-Z]/g, function(a){ + return '-' + a; + }); - isFullySelected = TRUE; - next = nextSibling; + try { + return this.doc.defaultView.getComputedStyle(n, null).getPropertyValue(na); + } catch (ex) { + // Old safari might fail + return null; } + } - if (parent == root) - return clonedParent; + // Camelcase it, if needed + na = na.replace(/-(\D)/g, function(a, b){ + return b.toUpperCase(); + }); - next = parent.nextSibling; - parent = parent.parentNode; + if (na == 'float') + na = isIE ? 'styleFloat' : 'cssFloat'; - clonedGrandParent = _traverseNode(parent, FALSE, TRUE, how); + // IE & Opera + if (n.currentStyle && c) + return n.currentStyle[na]; - if (how != DELETE) - clonedGrandParent.appendChild(clonedParent); + return n.style ? n.style[na] : undefined; + }, - clonedParent = clonedGrandParent; - } - }; + setStyles : function(e, o) { + var t = this, s = t.settings, ol; - function _traverseNode(n, isFullySelected, isLeft, how) { - var txtValue, newNodeValue, oldNodeValue, offset, newNode; + ol = s.update_styles; + s.update_styles = 0; - if (isFullySelected) - return _traverseFullySelected(n, how); + each(o, function(v, n) { + t.setStyle(e, n, v); + }); - if (n.nodeType == 3 /* TEXT_NODE */) { - txtValue = n.nodeValue; + // Update style info + s.update_styles = ol; + if (s.update_styles) + t.setAttrib(e, s.cssText); + }, - if (isLeft) { - offset = t[START_OFFSET]; - newNodeValue = txtValue.substring(offset); - oldNodeValue = txtValue.substring(0, offset); - } else { - offset = t[END_OFFSET]; - newNodeValue = txtValue.substring(0, offset); - oldNodeValue = txtValue.substring(offset); + removeAllAttribs: function(e) { + return this.run(e, function(e) { + var i, attrs = e.attributes; + for (i = attrs.length - 1; i >= 0; i--) { + e.removeAttributeNode(attrs.item(i)); } + }); + }, - if (how != CLONE) - n.nodeValue = oldNodeValue; - - if (how == DELETE) - return; - - newNode = n.cloneNode(FALSE); - newNode.nodeValue = newNodeValue; - - return newNode; - } + setAttrib : function(e, n, v) { + var t = this; - if (how == DELETE) + // Whats the point + if (!e || !n) return; - return n.cloneNode(FALSE); - }; - - function _traverseFullySelected(n, how) { - if (how != DELETE) - return how == CLONE ? n.cloneNode(TRUE) : n; - - n.parentNode.removeChild(n); - }; - }; - - ns.Range = Range; -})(tinymce.dom); - -(function() { - function Selection(selection) { - var t = this, invisibleChar = '\uFEFF', range, lastIERng, dom = selection.dom, TRUE = true, FALSE = false; - - // Returns a W3C DOM compatible range object by using the IE Range API - function getRange() { - var ieRange = selection.getRng(), domRange = dom.createRng(), element, collapsed; - - // If selection is outside the current document just return an empty range - element = ieRange.item ? ieRange.item(0) : ieRange.parentElement(); - if (element.ownerDocument != dom.doc) - return domRange; - - // Handle control selection or text selection of a image - if (ieRange.item || !element.hasChildNodes()) { - domRange.setStart(element.parentNode, dom.nodeIndex(element)); - domRange.setEnd(domRange.startContainer, domRange.startOffset + 1); - - return domRange; - } - - collapsed = selection.isCollapsed(); - - function findEndPoint(start) { - var marker, container, offset, nodes, startIndex = 0, endIndex, index, parent, checkRng, position; + // Strict XML mode + if (t.settings.strict) + n = n.toLowerCase(); - // Setup temp range and collapse it - checkRng = ieRange.duplicate(); - checkRng.collapse(start); + return this.run(e, function(e) { + var s = t.settings; + if (v !== null) { + switch (n) { + case "style": + if (!is(v, 'string')) { + each(v, function(v, n) { + t.setStyle(e, n, v); + }); - // Create marker and insert it at the end of the endpoints parent - marker = dom.create('a'); - parent = checkRng.parentElement(); + return; + } - // If parent doesn't have any children then set the container to that parent and the index to 0 - if (!parent.hasChildNodes()) { - domRange[start ? 'setStart' : 'setEnd'](parent, 0); - return; - } + // No mce_style for elements with these since they might get resized by the user + if (s.keep_values) { + if (v && !t._isRes(v)) + e.setAttribute('data-mce-style', v, 2); + else + e.removeAttribute('data-mce-style', 2); + } - parent.appendChild(marker); - checkRng.moveToElementText(marker); - position = ieRange.compareEndPoints(start ? 'StartToStart' : 'EndToEnd', checkRng); - if (position > 0) { - // The position is after the end of the parent element. - // This is the case where IE puts the caret to the left edge of a table. - domRange[start ? 'setStartAfter' : 'setEndAfter'](parent); - dom.remove(marker); - return; - } + e.style.cssText = v; + break; - // Setup node list and endIndex - nodes = tinymce.grep(parent.childNodes); - endIndex = nodes.length - 1; - // Perform a binary search for the position - while (startIndex <= endIndex) { - index = Math.floor((startIndex + endIndex) / 2); - - // Insert marker and check it's position relative to the selection - parent.insertBefore(marker, nodes[index]); - checkRng.moveToElementText(marker); - position = ieRange.compareEndPoints(start ? 'StartToStart' : 'EndToEnd', checkRng); - if (position > 0) { - // Marker is to the right - startIndex = index + 1; - } else if (position < 0) { - // Marker is to the left - endIndex = index - 1; - } else { - // Maker is where we are - found = true; - break; - } - } + case "class": + e.className = v || ''; // Fix IE null bug + break; - // Setup container - container = position > 0 || index == 0 ? marker.nextSibling : marker.previousSibling; + case "src": + case "href": + if (s.keep_values) { + if (s.url_converter) + v = s.url_converter.call(s.url_converter_scope || t, v, n, e); - // Handle element selection - if (container.nodeType == 1) { - dom.remove(marker); + t.setAttrib(e, 'data-mce-' + n, v, 2); + } - // Find offset and container - offset = dom.nodeIndex(container); - container = container.parentNode; + break; - // Move the offset if we are setting the end or the position is after an element - if (!start || index > 0) - offset++; - } else { - // Calculate offset within text node - if (position > 0 || index == 0) { - checkRng.setEndPoint(start ? 'StartToStart' : 'EndToEnd', ieRange); - offset = checkRng.text.length; - } else { - checkRng.setEndPoint(start ? 'StartToStart' : 'EndToEnd', ieRange); - offset = container.nodeValue.length - checkRng.text.length; + case "shape": + e.setAttribute('data-mce-style', v); + break; } - - dom.remove(marker); } + if (is(v) && v !== null && v.length !== 0) + e.setAttribute(n, '' + v, 2); + else + e.removeAttribute(n, 2); + }); + }, - domRange[start ? 'setStart' : 'setEnd'](container, offset); - }; + setAttribs : function(e, o) { + var t = this; - // Find start point - findEndPoint(true); + return this.run(e, function(e) { + each(o, function(v, n) { + t.setAttrib(e, n, v); + }); + }); + }, - // Find end point if needed - if (!collapsed) - findEndPoint(); + getAttrib : function(e, n, dv) { + var v, t = this, undef; - return domRange; - }; + e = t.get(e); - this.addRange = function(rng) { - var ieRng, ieRng2, doc = selection.dom.doc, body = doc.body, startPos, endPos, sc, so, ec, eo, marker, lastIndex, skipStart, skipEnd; + if (!e || e.nodeType !== 1) + return dv === undef ? false : dv; - this.destroy(); + if (!is(dv)) + dv = ''; - // Setup some shorter versions - sc = rng.startContainer; - so = rng.startOffset; - ec = rng.endContainer; - eo = rng.endOffset; - ieRng = body.createTextRange(); + // Try the mce variant for these + if (/^(src|href|style|coords|shape)$/.test(n)) { + v = e.getAttribute("data-mce-" + n); - // If document selection move caret to first node in document - if (sc == doc || ec == doc) { - ieRng = body.createTextRange(); - ieRng.collapse(); - ieRng.select(); - return; + if (v) + return v; } - // If child index resolve it - if (sc.nodeType == 1 && sc.hasChildNodes()) { - lastIndex = sc.childNodes.length - 1; - - // Index is higher that the child count then we need to jump over the start container - if (so > lastIndex) { - skipStart = 1; - sc = sc.childNodes[lastIndex]; - } else - sc = sc.childNodes[so]; - - // Child was text node then move offset to start of it - if (sc.nodeType == 3) - so = 0; + if (isIE && t.props[n]) { + v = e[t.props[n]]; + v = v && v.nodeValue ? v.nodeValue : v; } - // If child index resolve it - if (ec.nodeType == 1 && ec.hasChildNodes()) { - lastIndex = ec.childNodes.length - 1; + if (!v) + v = e.getAttribute(n, 2); - if (eo == 0) { - skipEnd = 1; - ec = ec.childNodes[0]; - } else { - ec = ec.childNodes[Math.min(lastIndex, eo - 1)]; + // Check boolean attribs + if (/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(n)) { + if (e[t.props[n]] === true && v === '') + return n; - // Child was text node then move offset to end of text node - if (ec.nodeType == 3) - eo = ec.nodeValue.length; - } + return v ? n : ''; } - // Single element selection - if (sc == ec && sc.nodeType == 1) { - // Make control selection for some elements - if (/^(IMG|TABLE)$/.test(sc.nodeName) && so != eo) { - ieRng = body.createControlRange(); - ieRng.addElement(sc); - } else { - ieRng = body.createTextRange(); + // Inner input elements will override attributes on form elements + if (e.nodeName === "FORM" && e.getAttributeNode(n)) + return e.getAttributeNode(n).nodeValue; - // Padd empty elements with invisible character - if (!sc.hasChildNodes() && sc.canHaveHTML) - sc.innerHTML = invisibleChar; + if (n === 'style') { + v = v || e.style.cssText; - // Select element contents - ieRng.moveToElementText(sc); + if (v) { + v = t.serializeStyle(t.parseStyle(v), e.nodeName); - // If it's only containing a padding remove it so the caret remains - if (sc.innerHTML == invisibleChar) { - ieRng.collapse(TRUE); - sc.removeChild(sc.firstChild); - } + if (t.settings.keep_values && !t._isRes(v)) + e.setAttribute('data-mce-style', v); } - - if (so == eo) - ieRng.collapse(eo <= rng.endContainer.childNodes.length - 1); - - ieRng.select(); - ieRng.scrollIntoView(); - return; } - // Create range and marker - ieRng = body.createTextRange(); - marker = doc.createElement('span'); - marker.innerHTML = ' '; - - // Set start of range to startContainer/startOffset - if (sc.nodeType == 3) { - // Insert marker after/before startContainer - if (skipStart) - dom.insertAfter(marker, sc); - else - sc.parentNode.insertBefore(marker, sc); + // Remove Apple and WebKit stuff + if (isWebKit && n === "class" && v) + v = v.replace(/(apple|webkit)\-[a-z\-]+/gi, ''); - // Select marker the caret to offset position - ieRng.moveToElementText(marker); - marker.parentNode.removeChild(marker); + // Handle IE issues + if (isIE) { + switch (n) { + case 'rowspan': + case 'colspan': + // IE returns 1 as default value + if (v === 1) + v = ''; - // Move if we need to, moving it 0 characters actually moves it! - if (so > 0) - ieRng.move('character', so); - } else { - ieRng.moveToElementText(sc); + break; - if (skipStart) - ieRng.collapse(FALSE); - } + case 'size': + // IE returns +0 as default value for size + if (v === '+0' || v === 20 || v === 0) + v = ''; - // If same text container then we can do a more simple move - if (sc == ec && sc.nodeType == 3) { - try { - ieRng.moveEnd('character', eo - so); - ieRng.select(); - ieRng.scrollIntoView(); - } catch (ex) { - // Some times a Runtime error of the 800a025e type gets thrown - // especially when the caret is placed before a table. - // This is a somewhat strange location for the caret. - // TODO: Find a better solution for this would possible require a rewrite of the setRng method - } + break; - return; - } + case 'width': + case 'height': + case 'vspace': + case 'checked': + case 'disabled': + case 'readonly': + if (v === 0) + v = ''; - // Set end of range to endContainer/endOffset - ieRng2 = body.createTextRange(); - if (ec.nodeType == 3) { - // Insert marker after/before startContainer - ec.parentNode.insertBefore(marker, ec); + break; - // Move selection to end marker and move caret to end offset - ieRng2.moveToElementText(marker); - marker.parentNode.removeChild(marker); - ieRng2.move('character', eo); - ieRng.setEndPoint('EndToStart', ieRng2); - } else { - ieRng2.moveToElementText(ec); - ieRng2.collapse(!!skipEnd); - ieRng.setEndPoint('EndToEnd', ieRng2); - } + case 'hspace': + // IE returns -1 as default value + if (v === -1) + v = ''; - ieRng.select(); - ieRng.scrollIntoView(); - }; + break; - this.getRangeAt = function() { - // Setup new range if the cache is empty - if (!range || !tinymce.dom.RangeUtils.compareRanges(lastIERng, selection.getRng())) { - range = getRange(); + case 'maxlength': + case 'tabindex': + // IE returns default value + if (v === 32768 || v === 2147483647 || v === '32768') + v = ''; - // Store away text range for next call - lastIERng = selection.getRng(); - } + break; - // IE will say that the range is equal then produce an invalid argument exception - // if you perform specific operations in a keyup event. For example Ctrl+Del. - // This hack will invalidate the range cache if the exception occurs - try { - range.startContainer.nextSibling; - } catch (ex) { - range = getRange(); - lastIERng = null; - } + case 'multiple': + case 'compact': + case 'noshade': + case 'nowrap': + if (v === 65535) + return n; - // Return cached range - return range; - }; + return dv; - this.destroy = function() { - // Destroy cached range and last IE range to avoid memory leaks - lastIERng = range = null; - }; + case 'shape': + v = v.toLowerCase(); + break; - // IE has an issue where you can't select/move the caret by clicking outside the body if the document is in standards mode - if (selection.dom.boxModel) { - (function() { - var doc = dom.doc, body = doc.body, started, startRng; + default: + // IE has odd anonymous function for event attributes + if (n.indexOf('on') === 0 && v) + v = tinymce._replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/, '$1', '' + v); + } + } - // Make HTML element unselectable since we are going to handle selection by hand - doc.documentElement.unselectable = TRUE; + return (v !== undef && v !== null && v !== '') ? '' + v : dv; + }, - // Return range from point or null if it failed - function rngFromPoint(x, y) { - var rng = body.createTextRange(); + getPos : function(n, ro) { + var t = this, x = 0, y = 0, e, d = t.doc, r; - try { - rng.moveToPoint(x, y); - } catch (ex) { - // IE sometimes throws and exception, so lets just ignore it - rng = null; - } + n = t.get(n); + ro = ro || d.body; - return rng; - }; + if (n) { + // Use getBoundingClientRect if it exists since it's faster than looping offset nodes + if (n.getBoundingClientRect) { + n = n.getBoundingClientRect(); + e = t.boxModel ? d.documentElement : d.body; - // Fires while the selection is changing - function selectionChange(e) { - var pointRng; + // Add scroll offsets from documentElement or body since IE with the wrong box model will use d.body and so do WebKit + // Also remove the body/documentelement clientTop/clientLeft on IE 6, 7 since they offset the position + x = n.left + (d.documentElement.scrollLeft || d.body.scrollLeft) - e.clientTop; + y = n.top + (d.documentElement.scrollTop || d.body.scrollTop) - e.clientLeft; - // Check if the button is down or not - if (e.button) { - // Create range from mouse position - pointRng = rngFromPoint(e.x, e.y); + return {x : x, y : y}; + } - if (pointRng) { - // Check if pointRange is before/after selection then change the endPoint - if (pointRng.compareEndPoints('StartToStart', startRng) > 0) - pointRng.setEndPoint('StartToStart', startRng); - else - pointRng.setEndPoint('EndToEnd', startRng); + r = n; + while (r && r != ro && r.nodeType) { + x += r.offsetLeft || 0; + y += r.offsetTop || 0; + r = r.offsetParent; + } - pointRng.select(); - } - } else - endSelection(); + r = n.parentNode; + while (r && r != ro && r.nodeType) { + x -= r.scrollLeft || 0; + y -= r.scrollTop || 0; + r = r.parentNode; } + } - // Removes listeners - function endSelection() { - dom.unbind(doc, 'mouseup', endSelection); - dom.unbind(doc, 'mousemove', selectionChange); - started = 0; - }; + return {x : x, y : y}; + }, - // Detect when user selects outside BODY - dom.bind(doc, 'mousedown', function(e) { - if (e.target.nodeName === 'HTML') { - if (started) - endSelection(); + parseStyle : function(st) { + return this.styles.parse(st); + }, - started = 1; + serializeStyle : function(o, name) { + return this.styles.serialize(o, name); + }, - // Setup start position - startRng = rngFromPoint(e.x, e.y); - if (startRng) { - // Listen for selection change events - dom.bind(doc, 'mouseup', endSelection); - dom.bind(doc, 'mousemove', selectionChange); + loadCSS : function(u) { + var t = this, d = t.doc, head; - startRng.select(); - } - } - }); - })(); - } - }; + if (!u) + u = ''; - // Expose the selection object - tinymce.dom.TridentSelection = Selection; -})(); + head = t.select('head')[0]; + each(u.split(','), function(u) { + var link; -/* - * Sizzle CSS Selector Engine - v1.0 - * Copyright 2009, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * More information: http://sizzlejs.com/ - */ -(function(){ + if (t.files[u]) + return; -var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, - done = 0, - toString = Object.prototype.toString, - hasDuplicate = false, - baseHasDuplicate = true; + t.files[u] = true; + link = t.create('link', {rel : 'stylesheet', href : tinymce._addVer(u)}); -// Here we check if the JavaScript engine is using some sort of -// optimization where it does not always call our comparision -// function. If that is the case, discard the hasDuplicate value. -// Thus far that includes Google Chrome. -[0, 0].sort(function(){ - baseHasDuplicate = false; - return 0; -}); + // IE 8 has a bug where dynamically loading stylesheets would produce a 1 item remaining bug + // This fix seems to resolve that issue by realcing the document ones a stylesheet finishes loading + // It's ugly but it seems to work fine. + if (isIE && d.documentMode && d.recalc) { + link.onload = function() { + if (d.recalc) + d.recalc(); -var Sizzle = function(selector, context, results, seed) { - results = results || []; - context = context || document; + link.onload = null; + }; + } - var origContext = context; + head.appendChild(link); + }); + }, - if ( context.nodeType !== 1 && context.nodeType !== 9 ) { - return []; - } - - if ( !selector || typeof selector !== "string" ) { - return results; - } + addClass : function(e, c) { + return this.run(e, function(e) { + var o; - var parts = [], m, set, checkSet, extra, prune = true, contextXML = Sizzle.isXML(context), - soFar = selector, ret, cur, pop, i; - - // Reset the position of the chunker regexp (start from head) - do { - chunker.exec(""); - m = chunker.exec(soFar); + if (!c) + return 0; - if ( m ) { - soFar = m[3]; - - parts.push( m[1] ); - - if ( m[2] ) { - extra = m[3]; - break; - } - } - } while ( m ); + if (this.hasClass(e, c)) + return e.className; - if ( parts.length > 1 && origPOS.exec( selector ) ) { - if ( parts.length === 2 && Expr.relative[ parts[0] ] ) { - set = posProcess( parts[0] + parts[1], context ); - } else { - set = Expr.relative[ parts[0] ] ? - [ context ] : - Sizzle( parts.shift(), context ); + o = this.removeClass(e, c); - while ( parts.length ) { - selector = parts.shift(); + return e.className = (o != '' ? (o + ' ') : '') + c; + }); + }, - if ( Expr.relative[ selector ] ) { - selector += parts.shift(); - } - - set = posProcess( selector, set ); - } - } - } else { - // Take a shortcut and set the context if the root selector is an ID - // (but not if it'll be faster if the inner selector is an ID) - if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML && - Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) { - ret = Sizzle.find( parts.shift(), context, contextXML ); - context = ret.expr ? Sizzle.filter( ret.expr, ret.set )[0] : ret.set[0]; - } + removeClass : function(e, c) { + var t = this, re; - if ( context ) { - ret = seed ? - { expr: parts.pop(), set: makeArray(seed) } : - Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML ); - set = ret.expr ? Sizzle.filter( ret.expr, ret.set ) : ret.set; + return t.run(e, function(e) { + var v; - if ( parts.length > 0 ) { - checkSet = makeArray(set); - } else { - prune = false; - } + if (t.hasClass(e, c)) { + if (!re) + re = new RegExp("(^|\\s+)" + c + "(\\s+|$)", "g"); - while ( parts.length ) { - cur = parts.pop(); - pop = cur; + v = e.className.replace(re, ' '); + v = tinymce.trim(v != ' ' ? v : ''); - if ( !Expr.relative[ cur ] ) { - cur = ""; - } else { - pop = parts.pop(); - } + e.className = v; - if ( pop == null ) { - pop = context; + // Empty class attr + if (!v) { + e.removeAttribute('class'); + e.removeAttribute('className'); + } + + return v; } - Expr.relative[ cur ]( checkSet, pop, contextXML ); - } - } else { - checkSet = parts = []; - } - } + return e.className; + }); + }, - if ( !checkSet ) { - checkSet = set; - } + hasClass : function(n, c) { + n = this.get(n); - if ( !checkSet ) { - Sizzle.error( cur || selector ); - } + if (!n || !c) + return false; - if ( toString.call(checkSet) === "[object Array]" ) { - if ( !prune ) { - results.push.apply( results, checkSet ); - } else if ( context && context.nodeType === 1 ) { - for ( i = 0; checkSet[i] != null; i++ ) { - if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) { - results.push( set[i] ); - } - } - } else { - for ( i = 0; checkSet[i] != null; i++ ) { - if ( checkSet[i] && checkSet[i].nodeType === 1 ) { - results.push( set[i] ); - } - } - } - } else { - makeArray( checkSet, results ); - } + return (' ' + n.className + ' ').indexOf(' ' + c + ' ') !== -1; + }, - if ( extra ) { - Sizzle( extra, origContext, results, seed ); - Sizzle.uniqueSort( results ); - } + show : function(e) { + return this.setStyle(e, 'display', 'block'); + }, - return results; -}; + hide : function(e) { + return this.setStyle(e, 'display', 'none'); + }, -Sizzle.uniqueSort = function(results){ - if ( sortOrder ) { - hasDuplicate = baseHasDuplicate; - results.sort(sortOrder); + isHidden : function(e) { + e = this.get(e); - if ( hasDuplicate ) { - for ( var i = 1; i < results.length; i++ ) { - if ( results[i] === results[i-1] ) { - results.splice(i--, 1); - } - } - } - } + return !e || e.style.display == 'none' || this.getStyle(e, 'display') == 'none'; + }, - return results; -}; + uniqueId : function(p) { + return (!p ? 'mce_' : p) + (this.counter++); + }, -Sizzle.matches = function(expr, set){ - return Sizzle(expr, null, null, set); -}; + setHTML : function(element, html) { + var self = this; -Sizzle.find = function(expr, context, isXML){ - var set; + return self.run(element, function(element) { + if (isIE) { + // Remove all child nodes, IE keeps empty text nodes in DOM + while (element.firstChild) + element.removeChild(element.firstChild); - if ( !expr ) { - return []; - } + try { + // IE will remove comments from the beginning + // unless you padd the contents with something + element.innerHTML = '
    ' + html; + element.removeChild(element.firstChild); + } catch (ex) { + // IE sometimes produces an unknown runtime error on innerHTML if it's an block element within a block element for example a div inside a p + // This seems to fix this problem + + // Create new div with HTML contents and a BR infront to keep comments + element = self.create('div'); + element.innerHTML = '
    ' + html; + + // Add all children from div to target + each (element.childNodes, function(node, i) { + // Skip br element + if (i) + element.appendChild(node); + }); + } + } else + element.innerHTML = html; - for ( var i = 0, l = Expr.order.length; i < l; i++ ) { - var type = Expr.order[i], match; - - if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { - var left = match[1]; - match.splice(1,1); + return html; + }); + }, - if ( left.substr( left.length - 1 ) !== "\\" ) { - match[1] = (match[1] || "").replace(/\\/g, ""); - set = Expr.find[ type ]( match, context, isXML ); - if ( set != null ) { - expr = expr.replace( Expr.match[ type ], "" ); - break; - } - } - } - } + getOuterHTML : function(elm) { + var doc, self = this; - if ( !set ) { - set = context.getElementsByTagName("*"); - } + elm = self.get(elm); - return {set: set, expr: expr}; -}; + if (!elm) + return null; -Sizzle.filter = function(expr, set, inplace, not){ - var old = expr, result = [], curLoop = set, match, anyFound, - isXMLFilter = set && set[0] && Sizzle.isXML(set[0]); + if (elm.nodeType === 1 && self.hasOuterHTML) + return elm.outerHTML; - while ( expr && set.length ) { - for ( var type in Expr.filter ) { - if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) { - var filter = Expr.filter[ type ], found, item, left = match[1]; - anyFound = false; + doc = (elm.ownerDocument || self.doc).createElement("body"); + doc.appendChild(elm.cloneNode(true)); - match.splice(1,1); + return doc.innerHTML; + }, - if ( left.substr( left.length - 1 ) === "\\" ) { - continue; - } + setOuterHTML : function(e, h, d) { + var t = this; - if ( curLoop === result ) { - result = []; - } + function setHTML(e, h, d) { + var n, tp; - if ( Expr.preFilter[ type ] ) { - match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter ); + tp = d.createElement("body"); + tp.innerHTML = h; - if ( !match ) { - anyFound = found = true; - } else if ( match === true ) { - continue; - } + n = tp.lastChild; + while (n) { + t.insertAfter(n.cloneNode(true), e); + n = n.previousSibling; } - if ( match ) { - for ( var i = 0; (item = curLoop[i]) != null; i++ ) { - if ( item ) { - found = filter( item, match, i, curLoop ); - var pass = not ^ !!found; + t.remove(e); + }; - if ( inplace && found != null ) { - if ( pass ) { - anyFound = true; - } else { - curLoop[i] = false; - } - } else if ( pass ) { - result.push( item ); - anyFound = true; - } + return this.run(e, function(e) { + e = t.get(e); + + // Only set HTML on elements + if (e.nodeType == 1) { + d = d || e.ownerDocument || t.doc; + + if (isIE) { + try { + // Try outerHTML for IE it sometimes produces an unknown runtime error + if (isIE && e.nodeType == 1) + e.outerHTML = h; + else + setHTML(e, h, d); + } catch (ex) { + // Fix for unknown runtime error + setHTML(e, h, d); } - } + } else + setHTML(e, h, d); } + }); + }, - if ( found !== undefined ) { - if ( !inplace ) { - curLoop = result; - } + decode : Entities.decode, - expr = expr.replace( Expr.match[ type ], "" ); + encode : Entities.encodeAllRaw, - if ( !anyFound ) { - return []; - } + insertAfter : function(node, reference_node) { + reference_node = this.get(reference_node); - break; - } - } - } + return this.run(node, function(node) { + var parent, nextSibling; - // Improper expression - if ( expr === old ) { - if ( anyFound == null ) { - Sizzle.error( expr ); - } else { - break; - } - } + parent = reference_node.parentNode; + nextSibling = reference_node.nextSibling; - old = expr; - } + if (nextSibling) + parent.insertBefore(node, nextSibling); + else + parent.appendChild(node); - return curLoop; -}; + return node; + }); + }, -Sizzle.error = function( msg ) { - throw "Syntax error, unrecognized expression: " + msg; -}; + isBlock : function(node) { + var type = node.nodeType; -var Expr = Sizzle.selectors = { - order: [ "ID", "NAME", "TAG" ], - match: { - ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, - CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, - NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/, - ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/, - TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/, - CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/, - POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/, - PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/ - }, - leftMatch: {}, - attrMap: { - "class": "className", - "for": "htmlFor" - }, - attrHandle: { - href: function(elem){ - return elem.getAttribute("href"); - } - }, - relative: { - "+": function(checkSet, part){ - var isPartStr = typeof part === "string", - isTag = isPartStr && !/\W/.test(part), - isPartStrNotTag = isPartStr && !isTag; + // If it's a node then check the type and use the nodeName + if (type) + return !!(type === 1 && blockElementsMap[node.nodeName]); - if ( isTag ) { - part = part.toLowerCase(); - } + return !!blockElementsMap[node]; + }, - for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) { - if ( (elem = checkSet[i]) ) { - while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {} + replace : function(n, o, k) { + var t = this; - checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ? - elem || false : - elem === part; + if (is(o, 'array')) + n = n.cloneNode(true); + + return t.run(o, function(o) { + if (k) { + each(tinymce.grep(o.childNodes), function(c) { + n.appendChild(c); + }); } - } - if ( isPartStrNotTag ) { - Sizzle.filter( part, checkSet, true ); - } + return o.parentNode.replaceChild(n, o); + }); }, - ">": function(checkSet, part){ - var isPartStr = typeof part === "string", - elem, i = 0, l = checkSet.length; - if ( isPartStr && !/\W/.test(part) ) { - part = part.toLowerCase(); + rename : function(elm, name) { + var t = this, newElm; - for ( ; i < l; i++ ) { - elem = checkSet[i]; - if ( elem ) { - var parent = elem.parentNode; - checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false; - } - } - } else { - for ( ; i < l; i++ ) { - elem = checkSet[i]; - if ( elem ) { - checkSet[i] = isPartStr ? - elem.parentNode : - elem.parentNode === part; - } - } + if (elm.nodeName != name.toUpperCase()) { + // Rename block element + newElm = t.create(name); - if ( isPartStr ) { - Sizzle.filter( part, checkSet, true ); - } + // Copy attribs to new block + each(t.getAttribs(elm), function(attr_node) { + t.setAttrib(newElm, attr_node.nodeName, t.getAttrib(elm, attr_node.nodeName)); + }); + + // Replace block + t.replace(newElm, elm, 1); } + + return newElm || elm; }, - "": function(checkSet, part, isXML){ - var doneName = done++, checkFn = dirCheck, nodeCheck; - if ( typeof part === "string" && !/\W/.test(part) ) { - part = part.toLowerCase(); - nodeCheck = part; - checkFn = dirNodeCheck; + findCommonAncestor : function(a, b) { + var ps = a, pe; + + while (ps) { + pe = b; + + while (pe && ps != pe) + pe = pe.parentNode; + + if (ps == pe) + break; + + ps = ps.parentNode; } - checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML); + if (!ps && a.ownerDocument) + return a.ownerDocument.documentElement; + + return ps; }, - "~": function(checkSet, part, isXML){ - var doneName = done++, checkFn = dirCheck, nodeCheck; - if ( typeof part === "string" && !/\W/.test(part) ) { - part = part.toLowerCase(); - nodeCheck = part; - checkFn = dirNodeCheck; - } + toHex : function(s) { + var c = /^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(s); - checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML); - } - }, - find: { - ID: function(match, context, isXML){ - if ( typeof context.getElementById !== "undefined" && !isXML ) { - var m = context.getElementById(match[1]); - return m ? [m] : []; + function hex(s) { + s = parseInt(s).toString(16); + + return s.length > 1 ? s : '0' + s; // 0 -> 00 + }; + + if (c) { + s = '#' + hex(c[1]) + hex(c[2]) + hex(c[3]); + + return s; } + + return s; }, - NAME: function(match, context){ - if ( typeof context.getElementsByName !== "undefined" ) { - var ret = [], results = context.getElementsByName(match[1]); - for ( var i = 0, l = results.length; i < l; i++ ) { - if ( results[i].getAttribute("name") === match[1] ) { - ret.push( results[i] ); + getClasses : function() { + var t = this, cl = [], i, lo = {}, f = t.settings.class_filter, ov; + + if (t.classes) + return t.classes; + + function addClasses(s) { + // IE style imports + each(s.imports, function(r) { + addClasses(r); + }); + + each(s.cssRules || s.rules, function(r) { + // Real type or fake it on IE + switch (r.type || 1) { + // Rule + case 1: + if (r.selectorText) { + each(r.selectorText.split(','), function(v) { + v = v.replace(/^\s*|\s*$|^\s\./g, ""); + + // Is internal or it doesn't contain a class + if (/\.mce/.test(v) || !/\.[\w\-]+$/.test(v)) + return; + + // Remove everything but class name + ov = v; + v = tinymce._replace(/.*\.([a-z0-9_\-]+).*/i, '$1', v); + + // Filter classes + if (f && !(v = f(v, ov))) + return; + + if (!lo[v]) { + cl.push({'class' : v}); + lo[v] = 1; + } + }); + } + break; + + // Import + case 3: + addClasses(r.styleSheet); + break; } - } + }); + }; - return ret.length === 0 ? null : ret; + try { + each(t.doc.styleSheets, addClasses); + } catch (ex) { + // Ignore } + + if (cl.length > 0) + t.classes = cl; + + return cl; }, - TAG: function(match, context){ - return context.getElementsByTagName(match[1]); - } - }, - preFilter: { - CLASS: function(match, curLoop, inplace, result, not, isXML){ - match = " " + match[1].replace(/\\/g, "") + " "; - if ( isXML ) { - return match; - } + run : function(e, f, s) { + var t = this, o; - for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) { - if ( elem ) { - if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n]/g, " ").indexOf(match) >= 0) ) { - if ( !inplace ) { - result.push( elem ); - } - } else if ( inplace ) { - curLoop[i] = false; + if (t.doc && typeof(e) === 'string') + e = t.get(e); + + if (!e) + return false; + + s = s || this; + if (!e.nodeType && (e.length || e.length === 0)) { + o = []; + + each(e, function(e, i) { + if (e) { + if (typeof(e) == 'string') + e = t.doc.getElementById(e); + + o.push(f.call(s, e, i)); } - } + }); + + return o; } - return false; - }, - ID: function(match){ - return match[1].replace(/\\/g, ""); - }, - TAG: function(match, curLoop){ - return match[1].toLowerCase(); + return f.call(s, e); }, - CHILD: function(match){ - if ( match[1] === "nth" ) { - // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6' - var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec( - match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" || - !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]); - // calculate the numbers (first)n+(last) including if they are negative - match[2] = (test[1] + (test[2] || 1)) - 0; - match[3] = test[3] - 0; - } + getAttribs : function(n) { + var o; - // TODO: Move to normal caching system - match[0] = done++; + n = this.get(n); - return match; - }, - ATTR: function(match, curLoop, inplace, result, not, isXML){ - var name = match[1].replace(/\\/g, ""); - - if ( !isXML && Expr.attrMap[name] ) { - match[1] = Expr.attrMap[name]; - } + if (!n) + return []; - if ( match[2] === "~=" ) { - match[4] = " " + match[4] + " "; + if (isIE) { + o = []; + + // Object will throw exception in IE + if (n.nodeName == 'OBJECT') + return n.attributes; + + // IE doesn't keep the selected attribute if you clone option elements + if (n.nodeName === 'OPTION' && this.getAttrib(n, 'selected')) + o.push({specified : 1, nodeName : 'selected'}); + + // It's crazy that this is faster in IE but it's because it returns all attributes all the time + n.cloneNode(false).outerHTML.replace(/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi, '').replace(/[\w:\-]+/gi, function(a) { + o.push({specified : 1, nodeName : a}); + }); + + return o; } - return match; + return n.attributes; }, - PSEUDO: function(match, curLoop, inplace, result, not){ - if ( match[1] === "not" ) { - // If we're dealing with a complex expression, or a simple one - if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) { - match[3] = Sizzle(match[3], null, null, curLoop); - } else { - var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); - if ( !inplace ) { - result.push.apply( result, ret ); - } - return false; - } - } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { - return true; + + isEmpty : function(node, elements) { + var self = this, i, attributes, type, walker, name, parentNode; + + node = node.firstChild; + if (node) { + walker = new tinymce.dom.TreeWalker(node); + elements = elements || self.schema ? self.schema.getNonEmptyElements() : null; + + do { + type = node.nodeType; + + if (type === 1) { + // Ignore bogus elements + if (node.getAttribute('data-mce-bogus')) + continue; + + // Keep empty elements like + name = node.nodeName.toLowerCase(); + if (elements && elements[name]) { + // Ignore single BR elements in blocks like


    + parentNode = node.parentNode; + if (name === 'br' && self.isBlock(parentNode) && parentNode.firstChild === node && parentNode.lastChild === node) { + continue; + } + + return false; + } + + // Keep elements with data-bookmark attributes or name attribute like
    + attributes = self.getAttribs(node); + i = node.attributes.length; + while (i--) { + name = node.attributes[i].nodeName; + if (name === "name" || name === 'data-mce-bookmark') + return false; + } + } + + // Keep non whitespace text nodes + if ((type === 3 && !whiteSpaceRegExp.test(node.nodeValue))) + return false; + } while (node = walker.next()); } - - return match; - }, - POS: function(match){ - match.unshift( true ); - return match; - } - }, - filters: { - enabled: function(elem){ - return elem.disabled === false && elem.type !== "hidden"; - }, - disabled: function(elem){ - return elem.disabled === true; - }, - checked: function(elem){ - return elem.checked === true; - }, - selected: function(elem){ - // Accessing this property makes selected-by-default - // options in Safari work properly - elem.parentNode.selectedIndex; - return elem.selected === true; - }, - parent: function(elem){ - return !!elem.firstChild; - }, - empty: function(elem){ - return !elem.firstChild; - }, - has: function(elem, i, match){ - return !!Sizzle( match[3], elem ).length; - }, - header: function(elem){ - return (/h\d/i).test( elem.nodeName ); - }, - text: function(elem){ - return "text" === elem.type; - }, - radio: function(elem){ - return "radio" === elem.type; - }, - checkbox: function(elem){ - return "checkbox" === elem.type; - }, - file: function(elem){ - return "file" === elem.type; - }, - password: function(elem){ - return "password" === elem.type; - }, - submit: function(elem){ - return "submit" === elem.type; - }, - image: function(elem){ - return "image" === elem.type; - }, - reset: function(elem){ - return "reset" === elem.type; - }, - button: function(elem){ - return "button" === elem.type || elem.nodeName.toLowerCase() === "button"; - }, - input: function(elem){ - return (/input|select|textarea|button/i).test(elem.nodeName); - } - }, - setFilters: { - first: function(elem, i){ - return i === 0; + + return true; }, - last: function(elem, i, match, array){ - return i === array.length - 1; + + destroy : function(s) { + var t = this; + + if (t.events) + t.events.destroy(); + + t.win = t.doc = t.root = t.events = null; + + // Manual destroy then remove unload handler + if (!s) + tinymce.removeUnload(t.destroy); }, - even: function(elem, i){ - return i % 2 === 0; + + createRng : function() { + var d = this.doc; + + return d.createRange ? d.createRange() : new tinymce.dom.Range(this); }, - odd: function(elem, i){ - return i % 2 === 1; + + nodeIndex : function(node, normalized) { + var idx = 0, lastNodeType, lastNode, nodeType; + + if (node) { + for (lastNodeType = node.nodeType, node = node.previousSibling, lastNode = node; node; node = node.previousSibling) { + nodeType = node.nodeType; + + // Normalize text nodes + if (normalized && nodeType == 3) { + if (nodeType == lastNodeType || !node.nodeValue.length) + continue; + } + idx++; + lastNodeType = nodeType; + } + } + + return idx; }, - lt: function(elem, i, match){ - return i < match[3] - 0; + + split : function(pe, e, re) { + var t = this, r = t.createRng(), bef, aft, pa; + + // W3C valid browsers tend to leave empty nodes to the left/right side of the contents, this makes sense + // but we don't want that in our code since it serves no purpose for the end user + // For example if this is chopped: + //

    text 1CHOPtext 2

    + // would produce: + //

    text 1

    CHOP

    text 2

    + // this function will then trim of empty edges and produce: + //

    text 1

    CHOP

    text 2

    + function trim(node) { + var i, children = node.childNodes, type = node.nodeType; + + if (type == 1 && node.getAttribute('data-mce-type') == 'bookmark') + return; + + for (i = children.length - 1; i >= 0; i--) + trim(children[i]); + + if (type != 9) { + // Keep non whitespace text nodes + if (type == 3 && node.nodeValue.length > 0) { + // If parent element isn't a block or there isn't any useful contents for example "

    " + if (!t.isBlock(node.parentNode) || tinymce.trim(node.nodeValue).length > 0) + return; + } else if (type == 1) { + // If the only child is a bookmark then move it up + children = node.childNodes; + if (children.length == 1 && children[0] && children[0].nodeType == 1 && children[0].getAttribute('data-mce-type') == 'bookmark') + node.parentNode.insertBefore(children[0], node); + + // Keep non empty elements or img, hr etc + if (children.length || /^(br|hr|input|img)$/i.test(node.nodeName)) + return; + } + + t.remove(node); + } + + return node; + }; + + if (pe && e) { + // Get before chunk + r.setStart(pe.parentNode, t.nodeIndex(pe)); + r.setEnd(e.parentNode, t.nodeIndex(e)); + bef = r.extractContents(); + + // Get after chunk + r = t.createRng(); + r.setStart(e.parentNode, t.nodeIndex(e) + 1); + r.setEnd(pe.parentNode, t.nodeIndex(pe) + 1); + aft = r.extractContents(); + + // Insert before chunk + pa = pe.parentNode; + pa.insertBefore(trim(bef), pe); + + // Insert middle chunk + if (re) + pa.replaceChild(re, e); + else + pa.insertBefore(e, pe); + + // Insert after chunk + pa.insertBefore(trim(aft), pe); + t.remove(pe); + + return re || e; + } }, - gt: function(elem, i, match){ - return i > match[3] - 0; + + bind : function(target, name, func, scope) { + var t = this; + + if (!t.events) + t.events = new tinymce.dom.EventUtils(); + + return t.events.add(target, name, func, scope || this); }, - nth: function(elem, i, match){ - return match[3] - 0 === i; + + unbind : function(target, name, func) { + var t = this; + + if (!t.events) + t.events = new tinymce.dom.EventUtils(); + + return t.events.remove(target, name, func); }, - eq: function(elem, i, match){ - return match[3] - 0 === i; - } - }, - filter: { - PSEUDO: function(elem, match, i, array){ - var name = match[1], filter = Expr.filters[ name ]; - if ( filter ) { - return filter( elem, i, match, array ); - } else if ( name === "contains" ) { - return (elem.textContent || elem.innerText || Sizzle.getText([ elem ]) || "").indexOf(match[3]) >= 0; - } else if ( name === "not" ) { - var not = match[3]; - for ( var j = 0, l = not.length; j < l; j++ ) { - if ( not[j] === elem ) { - return false; - } + _findSib : function(node, selector, name) { + var t = this, f = selector; + + if (node) { + // If expression make a function of it using is + if (is(f, 'string')) { + f = function(node) { + return t.is(node, selector); + }; } - return true; - } else { - Sizzle.error( "Syntax error, unrecognized expression: " + name ); + // Loop all siblings + for (node = node[name]; node; node = node[name]) { + if (f(node)) + return node; + } } + + return null; }, - CHILD: function(elem, match){ - var type = match[1], node = elem; - switch (type) { - case 'only': - case 'first': - while ( (node = node.previousSibling) ) { - if ( node.nodeType === 1 ) { - return false; - } + + _isRes : function(c) { + // Is live resizble element + return /^(top|left|bottom|right|width|height)/i.test(c) || /;\s*(top|left|bottom|right|width|height)/i.test(c); + } + + /* + walk : function(n, f, s) { + var d = this.doc, w; + + if (d.createTreeWalker) { + w = d.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, false); + + while ((n = w.nextNode()) != null) + f.call(s || this, n); + } else + tinymce.walk(n, f, 'childNodes', s); + } + */ + + /* + toRGB : function(s) { + var c = /^\s*?#([0-9A-F]{2})([0-9A-F]{1,2})([0-9A-F]{2})?\s*?$/.exec(s); + + if (c) { + // #FFF -> #FFFFFF + if (!is(c[3])) + c[3] = c[2] = c[1]; + + return "rgb(" + parseInt(c[1], 16) + "," + parseInt(c[2], 16) + "," + parseInt(c[3], 16) + ")"; + } + + return s; + } + */ + }); + + tinymce.DOM = new tinymce.dom.DOMUtils(document, {process_html : 0}); +})(tinymce); + +(function(ns) { + // Range constructor + function Range(dom) { + var t = this, + doc = dom.doc, + EXTRACT = 0, + CLONE = 1, + DELETE = 2, + TRUE = true, + FALSE = false, + START_OFFSET = 'startOffset', + START_CONTAINER = 'startContainer', + END_CONTAINER = 'endContainer', + END_OFFSET = 'endOffset', + extend = tinymce.extend, + nodeIndex = dom.nodeIndex; + + extend(t, { + // Inital states + startContainer : doc, + startOffset : 0, + endContainer : doc, + endOffset : 0, + collapsed : TRUE, + commonAncestorContainer : doc, + + // Range constants + START_TO_START : 0, + START_TO_END : 1, + END_TO_END : 2, + END_TO_START : 3, + + // Public methods + setStart : setStart, + setEnd : setEnd, + setStartBefore : setStartBefore, + setStartAfter : setStartAfter, + setEndBefore : setEndBefore, + setEndAfter : setEndAfter, + collapse : collapse, + selectNode : selectNode, + selectNodeContents : selectNodeContents, + compareBoundaryPoints : compareBoundaryPoints, + deleteContents : deleteContents, + extractContents : extractContents, + cloneContents : cloneContents, + insertNode : insertNode, + surroundContents : surroundContents, + cloneRange : cloneRange + }); + + function setStart(n, o) { + _setEndPoint(TRUE, n, o); + }; + + function setEnd(n, o) { + _setEndPoint(FALSE, n, o); + }; + + function setStartBefore(n) { + setStart(n.parentNode, nodeIndex(n)); + }; + + function setStartAfter(n) { + setStart(n.parentNode, nodeIndex(n) + 1); + }; + + function setEndBefore(n) { + setEnd(n.parentNode, nodeIndex(n)); + }; + + function setEndAfter(n) { + setEnd(n.parentNode, nodeIndex(n) + 1); + }; + + function collapse(ts) { + if (ts) { + t[END_CONTAINER] = t[START_CONTAINER]; + t[END_OFFSET] = t[START_OFFSET]; + } else { + t[START_CONTAINER] = t[END_CONTAINER]; + t[START_OFFSET] = t[END_OFFSET]; + } + + t.collapsed = TRUE; + }; + + function selectNode(n) { + setStartBefore(n); + setEndAfter(n); + }; + + function selectNodeContents(n) { + setStart(n, 0); + setEnd(n, n.nodeType === 1 ? n.childNodes.length : n.nodeValue.length); + }; + + function compareBoundaryPoints(h, r) { + var sc = t[START_CONTAINER], so = t[START_OFFSET], ec = t[END_CONTAINER], eo = t[END_OFFSET], + rsc = r.startContainer, rso = r.startOffset, rec = r.endContainer, reo = r.endOffset; + + // Check START_TO_START + if (h === 0) + return _compareBoundaryPoints(sc, so, rsc, rso); + + // Check START_TO_END + if (h === 1) + return _compareBoundaryPoints(ec, eo, rsc, rso); + + // Check END_TO_END + if (h === 2) + return _compareBoundaryPoints(ec, eo, rec, reo); + + // Check END_TO_START + if (h === 3) + return _compareBoundaryPoints(sc, so, rec, reo); + }; + + function deleteContents() { + _traverse(DELETE); + }; + + function extractContents() { + return _traverse(EXTRACT); + }; + + function cloneContents() { + return _traverse(CLONE); + }; + + function insertNode(n) { + var startContainer = this[START_CONTAINER], + startOffset = this[START_OFFSET], nn, o; + + // Node is TEXT_NODE or CDATA + if ((startContainer.nodeType === 3 || startContainer.nodeType === 4) && startContainer.nodeValue) { + if (!startOffset) { + // At the start of text + startContainer.parentNode.insertBefore(n, startContainer); + } else if (startOffset >= startContainer.nodeValue.length) { + // At the end of text + dom.insertAfter(n, startContainer); + } else { + // Middle, need to split + nn = startContainer.splitText(startOffset); + startContainer.parentNode.insertBefore(n, nn); + } + } else { + // Insert element node + if (startContainer.childNodes.length > 0) + o = startContainer.childNodes[startOffset]; + + if (o) + startContainer.insertBefore(n, o); + else + startContainer.appendChild(n); + } + }; + + function surroundContents(n) { + var f = t.extractContents(); + + t.insertNode(n); + n.appendChild(f); + t.selectNode(n); + }; + + function cloneRange() { + return extend(new Range(dom), { + startContainer : t[START_CONTAINER], + startOffset : t[START_OFFSET], + endContainer : t[END_CONTAINER], + endOffset : t[END_OFFSET], + collapsed : t.collapsed, + commonAncestorContainer : t.commonAncestorContainer + }); + }; + + // Private methods + + function _getSelectedNode(container, offset) { + var child; + + if (container.nodeType == 3 /* TEXT_NODE */) + return container; + + if (offset < 0) + return container; + + child = container.firstChild; + while (child && offset > 0) { + --offset; + child = child.nextSibling; + } + + if (child) + return child; + + return container; + }; + + function _isCollapsed() { + return (t[START_CONTAINER] == t[END_CONTAINER] && t[START_OFFSET] == t[END_OFFSET]); + }; + + function _compareBoundaryPoints(containerA, offsetA, containerB, offsetB) { + var c, offsetC, n, cmnRoot, childA, childB; + + // In the first case the boundary-points have the same container. A is before B + // if its offset is less than the offset of B, A is equal to B if its offset is + // equal to the offset of B, and A is after B if its offset is greater than the + // offset of B. + if (containerA == containerB) { + if (offsetA == offsetB) + return 0; // equal + + if (offsetA < offsetB) + return -1; // before + + return 1; // after + } + + // In the second case a child node C of the container of A is an ancestor + // container of B. In this case, A is before B if the offset of A is less than or + // equal to the index of the child node C and A is after B otherwise. + c = containerB; + while (c && c.parentNode != containerA) + c = c.parentNode; + + if (c) { + offsetC = 0; + n = containerA.firstChild; + + while (n != c && offsetC < offsetA) { + offsetC++; + n = n.nextSibling; + } + + if (offsetA <= offsetC) + return -1; // before + + return 1; // after + } + + // In the third case a child node C of the container of B is an ancestor container + // of A. In this case, A is before B if the index of the child node C is less than + // the offset of B and A is after B otherwise. + c = containerA; + while (c && c.parentNode != containerB) { + c = c.parentNode; + } + + if (c) { + offsetC = 0; + n = containerB.firstChild; + + while (n != c && offsetC < offsetB) { + offsetC++; + n = n.nextSibling; + } + + if (offsetC < offsetB) + return -1; // before + + return 1; // after + } + + // In the fourth case, none of three other cases hold: the containers of A and B + // are siblings or descendants of sibling nodes. In this case, A is before B if + // the container of A is before the container of B in a pre-order traversal of the + // Ranges' context tree and A is after B otherwise. + cmnRoot = dom.findCommonAncestor(containerA, containerB); + childA = containerA; + + while (childA && childA.parentNode != cmnRoot) + childA = childA.parentNode; + + if (!childA) + childA = cmnRoot; + + childB = containerB; + while (childB && childB.parentNode != cmnRoot) + childB = childB.parentNode; + + if (!childB) + childB = cmnRoot; + + if (childA == childB) + return 0; // equal + + n = cmnRoot.firstChild; + while (n) { + if (n == childA) + return -1; // before + + if (n == childB) + return 1; // after + + n = n.nextSibling; + } + }; + + function _setEndPoint(st, n, o) { + var ec, sc; + + if (st) { + t[START_CONTAINER] = n; + t[START_OFFSET] = o; + } else { + t[END_CONTAINER] = n; + t[END_OFFSET] = o; + } + + // If one boundary-point of a Range is set to have a root container + // other than the current one for the Range, the Range is collapsed to + // the new position. This enforces the restriction that both boundary- + // points of a Range must have the same root container. + ec = t[END_CONTAINER]; + while (ec.parentNode) + ec = ec.parentNode; + + sc = t[START_CONTAINER]; + while (sc.parentNode) + sc = sc.parentNode; + + if (sc == ec) { + // The start position of a Range is guaranteed to never be after the + // end position. To enforce this restriction, if the start is set to + // be at a position after the end, the Range is collapsed to that + // position. + if (_compareBoundaryPoints(t[START_CONTAINER], t[START_OFFSET], t[END_CONTAINER], t[END_OFFSET]) > 0) + t.collapse(st); + } else + t.collapse(st); + + t.collapsed = _isCollapsed(); + t.commonAncestorContainer = dom.findCommonAncestor(t[START_CONTAINER], t[END_CONTAINER]); + }; + + function _traverse(how) { + var c, endContainerDepth = 0, startContainerDepth = 0, p, depthDiff, startNode, endNode, sp, ep; + + if (t[START_CONTAINER] == t[END_CONTAINER]) + return _traverseSameContainer(how); + + for (c = t[END_CONTAINER], p = c.parentNode; p; c = p, p = p.parentNode) { + if (p == t[START_CONTAINER]) + return _traverseCommonStartContainer(c, how); + + ++endContainerDepth; + } + + for (c = t[START_CONTAINER], p = c.parentNode; p; c = p, p = p.parentNode) { + if (p == t[END_CONTAINER]) + return _traverseCommonEndContainer(c, how); + + ++startContainerDepth; + } + + depthDiff = startContainerDepth - endContainerDepth; + + startNode = t[START_CONTAINER]; + while (depthDiff > 0) { + startNode = startNode.parentNode; + depthDiff--; + } + + endNode = t[END_CONTAINER]; + while (depthDiff < 0) { + endNode = endNode.parentNode; + depthDiff++; + } + + // ascend the ancestor hierarchy until we have a common parent. + for (sp = startNode.parentNode, ep = endNode.parentNode; sp != ep; sp = sp.parentNode, ep = ep.parentNode) { + startNode = sp; + endNode = ep; + } + + return _traverseCommonAncestors(startNode, endNode, how); + }; + + function _traverseSameContainer(how) { + var frag, s, sub, n, cnt, sibling, xferNode; + + if (how != DELETE) + frag = doc.createDocumentFragment(); + + // If selection is empty, just return the fragment + if (t[START_OFFSET] == t[END_OFFSET]) + return frag; + + // Text node needs special case handling + if (t[START_CONTAINER].nodeType == 3 /* TEXT_NODE */) { + // get the substring + s = t[START_CONTAINER].nodeValue; + sub = s.substring(t[START_OFFSET], t[END_OFFSET]); + + // set the original text node to its new value + if (how != CLONE) { + t[START_CONTAINER].deleteData(t[START_OFFSET], t[END_OFFSET] - t[START_OFFSET]); + + // Nothing is partially selected, so collapse to start point + t.collapse(TRUE); + } + + if (how == DELETE) + return; + + frag.appendChild(doc.createTextNode(sub)); + return frag; + } + + // Copy nodes between the start/end offsets. + n = _getSelectedNode(t[START_CONTAINER], t[START_OFFSET]); + cnt = t[END_OFFSET] - t[START_OFFSET]; + + while (cnt > 0) { + sibling = n.nextSibling; + xferNode = _traverseFullySelected(n, how); + + if (frag) + frag.appendChild( xferNode ); + + --cnt; + n = sibling; + } + + // Nothing is partially selected, so collapse to start point + if (how != CLONE) + t.collapse(TRUE); + + return frag; + }; + + function _traverseCommonStartContainer(endAncestor, how) { + var frag, n, endIdx, cnt, sibling, xferNode; + + if (how != DELETE) + frag = doc.createDocumentFragment(); + + n = _traverseRightBoundary(endAncestor, how); + + if (frag) + frag.appendChild(n); + + endIdx = nodeIndex(endAncestor); + cnt = endIdx - t[START_OFFSET]; + + if (cnt <= 0) { + // Collapse to just before the endAncestor, which + // is partially selected. + if (how != CLONE) { + t.setEndBefore(endAncestor); + t.collapse(FALSE); + } + + return frag; + } + + n = endAncestor.previousSibling; + while (cnt > 0) { + sibling = n.previousSibling; + xferNode = _traverseFullySelected(n, how); + + if (frag) + frag.insertBefore(xferNode, frag.firstChild); + + --cnt; + n = sibling; + } + + // Collapse to just before the endAncestor, which + // is partially selected. + if (how != CLONE) { + t.setEndBefore(endAncestor); + t.collapse(FALSE); + } + + return frag; + }; + + function _traverseCommonEndContainer(startAncestor, how) { + var frag, startIdx, n, cnt, sibling, xferNode; + + if (how != DELETE) + frag = doc.createDocumentFragment(); + + n = _traverseLeftBoundary(startAncestor, how); + if (frag) + frag.appendChild(n); + + startIdx = nodeIndex(startAncestor); + ++startIdx; // Because we already traversed it + + cnt = t[END_OFFSET] - startIdx; + n = startAncestor.nextSibling; + while (cnt > 0) { + sibling = n.nextSibling; + xferNode = _traverseFullySelected(n, how); + + if (frag) + frag.appendChild(xferNode); + + --cnt; + n = sibling; + } + + if (how != CLONE) { + t.setStartAfter(startAncestor); + t.collapse(TRUE); + } + + return frag; + }; + + function _traverseCommonAncestors(startAncestor, endAncestor, how) { + var n, frag, commonParent, startOffset, endOffset, cnt, sibling, nextSibling; + + if (how != DELETE) + frag = doc.createDocumentFragment(); + + n = _traverseLeftBoundary(startAncestor, how); + if (frag) + frag.appendChild(n); + + commonParent = startAncestor.parentNode; + startOffset = nodeIndex(startAncestor); + endOffset = nodeIndex(endAncestor); + ++startOffset; + + cnt = endOffset - startOffset; + sibling = startAncestor.nextSibling; + + while (cnt > 0) { + nextSibling = sibling.nextSibling; + n = _traverseFullySelected(sibling, how); + + if (frag) + frag.appendChild(n); + + sibling = nextSibling; + --cnt; + } + + n = _traverseRightBoundary(endAncestor, how); + + if (frag) + frag.appendChild(n); + + if (how != CLONE) { + t.setStartAfter(startAncestor); + t.collapse(TRUE); + } + + return frag; + }; + + function _traverseRightBoundary(root, how) { + var next = _getSelectedNode(t[END_CONTAINER], t[END_OFFSET] - 1), parent, clonedParent, prevSibling, clonedChild, clonedGrandParent, isFullySelected = next != t[END_CONTAINER]; + + if (next == root) + return _traverseNode(next, isFullySelected, FALSE, how); + + parent = next.parentNode; + clonedParent = _traverseNode(parent, FALSE, FALSE, how); + + while (parent) { + while (next) { + prevSibling = next.previousSibling; + clonedChild = _traverseNode(next, isFullySelected, FALSE, how); + + if (how != DELETE) + clonedParent.insertBefore(clonedChild, clonedParent.firstChild); + + isFullySelected = TRUE; + next = prevSibling; + } + + if (parent == root) + return clonedParent; + + next = parent.previousSibling; + parent = parent.parentNode; + + clonedGrandParent = _traverseNode(parent, FALSE, FALSE, how); + + if (how != DELETE) + clonedGrandParent.appendChild(clonedParent); + + clonedParent = clonedGrandParent; + } + }; + + function _traverseLeftBoundary(root, how) { + var next = _getSelectedNode(t[START_CONTAINER], t[START_OFFSET]), isFullySelected = next != t[START_CONTAINER], parent, clonedParent, nextSibling, clonedChild, clonedGrandParent; + + if (next == root) + return _traverseNode(next, isFullySelected, TRUE, how); + + parent = next.parentNode; + clonedParent = _traverseNode(parent, FALSE, TRUE, how); + + while (parent) { + while (next) { + nextSibling = next.nextSibling; + clonedChild = _traverseNode(next, isFullySelected, TRUE, how); + + if (how != DELETE) + clonedParent.appendChild(clonedChild); + + isFullySelected = TRUE; + next = nextSibling; + } + + if (parent == root) + return clonedParent; + + next = parent.nextSibling; + parent = parent.parentNode; + + clonedGrandParent = _traverseNode(parent, FALSE, TRUE, how); + + if (how != DELETE) + clonedGrandParent.appendChild(clonedParent); + + clonedParent = clonedGrandParent; + } + }; + + function _traverseNode(n, isFullySelected, isLeft, how) { + var txtValue, newNodeValue, oldNodeValue, offset, newNode; + + if (isFullySelected) + return _traverseFullySelected(n, how); + + if (n.nodeType == 3 /* TEXT_NODE */) { + txtValue = n.nodeValue; + + if (isLeft) { + offset = t[START_OFFSET]; + newNodeValue = txtValue.substring(offset); + oldNodeValue = txtValue.substring(0, offset); + } else { + offset = t[END_OFFSET]; + newNodeValue = txtValue.substring(0, offset); + oldNodeValue = txtValue.substring(offset); + } + + if (how != CLONE) + n.nodeValue = oldNodeValue; + + if (how == DELETE) + return; + + newNode = n.cloneNode(FALSE); + newNode.nodeValue = newNodeValue; + + return newNode; + } + + if (how == DELETE) + return; + + return n.cloneNode(FALSE); + }; + + function _traverseFullySelected(n, how) { + if (how != DELETE) + return how == CLONE ? n.cloneNode(TRUE) : n; + + n.parentNode.removeChild(n); + }; + }; + + ns.Range = Range; +})(tinymce.dom); + +(function() { + function Selection(selection) { + var self = this, dom = selection.dom, TRUE = true, FALSE = false; + + function getPosition(rng, start) { + var checkRng, startIndex = 0, endIndex, inside, + children, child, offset, index, position = -1, parent; + + // Setup test range, collapse it and get the parent + checkRng = rng.duplicate(); + checkRng.collapse(start); + parent = checkRng.parentElement(); + + // Check if the selection is within the right document + if (parent.ownerDocument !== selection.dom.doc) + return; + + // IE will report non editable elements as it's parent so look for an editable one + while (parent.contentEditable === "false") { + parent = parent.parentNode; + } + + // If parent doesn't have any children then return that we are inside the element + if (!parent.hasChildNodes()) { + return {node : parent, inside : 1}; + } + + // Setup node list and endIndex + children = parent.children; + endIndex = children.length - 1; + + // Perform a binary search for the position + while (startIndex <= endIndex) { + index = Math.floor((startIndex + endIndex) / 2); + + // Move selection to node and compare the ranges + child = children[index]; + checkRng.moveToElementText(child); + position = checkRng.compareEndPoints(start ? 'StartToStart' : 'EndToEnd', rng); + + // Before/after or an exact match + if (position > 0) { + endIndex = index - 1; + } else if (position < 0) { + startIndex = index + 1; + } else { + return {node : child}; + } + } + + // Check if child position is before or we didn't find a position + if (position < 0) { + // No element child was found use the parent element and the offset inside that + if (!child) { + checkRng.moveToElementText(parent); + checkRng.collapse(true); + child = parent; + inside = true; + } else + checkRng.collapse(false); + + checkRng.setEndPoint(start ? 'EndToStart' : 'EndToEnd', rng); + + // Fix for edge case:
  • - +
    @@ -150,10 +151,10 @@ - - + +
     
    - +
    @@ -162,10 +163,10 @@ - - + + <\/tr>/g, ''); return html; } diff --git a/js/tiny_mce/themes/advanced/js/color_picker.js b/js/tiny_mce/themes/advanced/js/color_picker.js index fd9700f222..f51e703b0a 100644 --- a/js/tiny_mce/themes/advanced/js/color_picker.js +++ b/js/tiny_mce/themes/advanced/js/color_picker.js @@ -33,37 +33,41 @@ var colors = [ ]; var named = { - '#F0F8FF':'AliceBlue','#FAEBD7':'AntiqueWhite','#00FFFF':'Aqua','#7FFFD4':'Aquamarine','#F0FFFF':'Azure','#F5F5DC':'Beige', - '#FFE4C4':'Bisque','#000000':'Black','#FFEBCD':'BlanchedAlmond','#0000FF':'Blue','#8A2BE2':'BlueViolet','#A52A2A':'Brown', - '#DEB887':'BurlyWood','#5F9EA0':'CadetBlue','#7FFF00':'Chartreuse','#D2691E':'Chocolate','#FF7F50':'Coral','#6495ED':'CornflowerBlue', - '#FFF8DC':'Cornsilk','#DC143C':'Crimson','#00FFFF':'Cyan','#00008B':'DarkBlue','#008B8B':'DarkCyan','#B8860B':'DarkGoldenRod', - '#A9A9A9':'DarkGray','#A9A9A9':'DarkGrey','#006400':'DarkGreen','#BDB76B':'DarkKhaki','#8B008B':'DarkMagenta','#556B2F':'DarkOliveGreen', - '#FF8C00':'Darkorange','#9932CC':'DarkOrchid','#8B0000':'DarkRed','#E9967A':'DarkSalmon','#8FBC8F':'DarkSeaGreen','#483D8B':'DarkSlateBlue', - '#2F4F4F':'DarkSlateGray','#2F4F4F':'DarkSlateGrey','#00CED1':'DarkTurquoise','#9400D3':'DarkViolet','#FF1493':'DeepPink','#00BFFF':'DeepSkyBlue', - '#696969':'DimGray','#696969':'DimGrey','#1E90FF':'DodgerBlue','#B22222':'FireBrick','#FFFAF0':'FloralWhite','#228B22':'ForestGreen', - '#FF00FF':'Fuchsia','#DCDCDC':'Gainsboro','#F8F8FF':'GhostWhite','#FFD700':'Gold','#DAA520':'GoldenRod','#808080':'Gray','#808080':'Grey', - '#008000':'Green','#ADFF2F':'GreenYellow','#F0FFF0':'HoneyDew','#FF69B4':'HotPink','#CD5C5C':'IndianRed','#4B0082':'Indigo','#FFFFF0':'Ivory', - '#F0E68C':'Khaki','#E6E6FA':'Lavender','#FFF0F5':'LavenderBlush','#7CFC00':'LawnGreen','#FFFACD':'LemonChiffon','#ADD8E6':'LightBlue', - '#F08080':'LightCoral','#E0FFFF':'LightCyan','#FAFAD2':'LightGoldenRodYellow','#D3D3D3':'LightGray','#D3D3D3':'LightGrey','#90EE90':'LightGreen', - '#FFB6C1':'LightPink','#FFA07A':'LightSalmon','#20B2AA':'LightSeaGreen','#87CEFA':'LightSkyBlue','#778899':'LightSlateGray','#778899':'LightSlateGrey', - '#B0C4DE':'LightSteelBlue','#FFFFE0':'LightYellow','#00FF00':'Lime','#32CD32':'LimeGreen','#FAF0E6':'Linen','#FF00FF':'Magenta','#800000':'Maroon', - '#66CDAA':'MediumAquaMarine','#0000CD':'MediumBlue','#BA55D3':'MediumOrchid','#9370D8':'MediumPurple','#3CB371':'MediumSeaGreen','#7B68EE':'MediumSlateBlue', - '#00FA9A':'MediumSpringGreen','#48D1CC':'MediumTurquoise','#C71585':'MediumVioletRed','#191970':'MidnightBlue','#F5FFFA':'MintCream','#FFE4E1':'MistyRose','#FFE4B5':'Moccasin', - '#FFDEAD':'NavajoWhite','#000080':'Navy','#FDF5E6':'OldLace','#808000':'Olive','#6B8E23':'OliveDrab','#FFA500':'Orange','#FF4500':'OrangeRed','#DA70D6':'Orchid', - '#EEE8AA':'PaleGoldenRod','#98FB98':'PaleGreen','#AFEEEE':'PaleTurquoise','#D87093':'PaleVioletRed','#FFEFD5':'PapayaWhip','#FFDAB9':'PeachPuff', - '#CD853F':'Peru','#FFC0CB':'Pink','#DDA0DD':'Plum','#B0E0E6':'PowderBlue','#800080':'Purple','#FF0000':'Red','#BC8F8F':'RosyBrown','#4169E1':'RoyalBlue', - '#8B4513':'SaddleBrown','#FA8072':'Salmon','#F4A460':'SandyBrown','#2E8B57':'SeaGreen','#FFF5EE':'SeaShell','#A0522D':'Sienna','#C0C0C0':'Silver', - '#87CEEB':'SkyBlue','#6A5ACD':'SlateBlue','#708090':'SlateGray','#708090':'SlateGrey','#FFFAFA':'Snow','#00FF7F':'SpringGreen', - '#4682B4':'SteelBlue','#D2B48C':'Tan','#008080':'Teal','#D8BFD8':'Thistle','#FF6347':'Tomato','#40E0D0':'Turquoise','#EE82EE':'Violet', - '#F5DEB3':'Wheat','#FFFFFF':'White','#F5F5F5':'WhiteSmoke','#FFFF00':'Yellow','#9ACD32':'YellowGreen' + '#F0F8FF':'Alice Blue','#FAEBD7':'Antique White','#00FFFF':'Aqua','#7FFFD4':'Aquamarine','#F0FFFF':'Azure','#F5F5DC':'Beige', + '#FFE4C4':'Bisque','#000000':'Black','#FFEBCD':'Blanched Almond','#0000FF':'Blue','#8A2BE2':'Blue Violet','#A52A2A':'Brown', + '#DEB887':'Burly Wood','#5F9EA0':'Cadet Blue','#7FFF00':'Chartreuse','#D2691E':'Chocolate','#FF7F50':'Coral','#6495ED':'Cornflower Blue', + '#FFF8DC':'Cornsilk','#DC143C':'Crimson','#00FFFF':'Cyan','#00008B':'Dark Blue','#008B8B':'Dark Cyan','#B8860B':'Dark Golden Rod', + '#A9A9A9':'Dark Gray','#A9A9A9':'Dark Grey','#006400':'Dark Green','#BDB76B':'Dark Khaki','#8B008B':'Dark Magenta','#556B2F':'Dark Olive Green', + '#FF8C00':'Darkorange','#9932CC':'Dark Orchid','#8B0000':'Dark Red','#E9967A':'Dark Salmon','#8FBC8F':'Dark Sea Green','#483D8B':'Dark Slate Blue', + '#2F4F4F':'Dark Slate Gray','#2F4F4F':'Dark Slate Grey','#00CED1':'Dark Turquoise','#9400D3':'Dark Violet','#FF1493':'Deep Pink','#00BFFF':'Deep Sky Blue', + '#696969':'Dim Gray','#696969':'Dim Grey','#1E90FF':'Dodger Blue','#B22222':'Fire Brick','#FFFAF0':'Floral White','#228B22':'Forest Green', + '#FF00FF':'Fuchsia','#DCDCDC':'Gainsboro','#F8F8FF':'Ghost White','#FFD700':'Gold','#DAA520':'Golden Rod','#808080':'Gray','#808080':'Grey', + '#008000':'Green','#ADFF2F':'Green Yellow','#F0FFF0':'Honey Dew','#FF69B4':'Hot Pink','#CD5C5C':'Indian Red','#4B0082':'Indigo','#FFFFF0':'Ivory', + '#F0E68C':'Khaki','#E6E6FA':'Lavender','#FFF0F5':'Lavender Blush','#7CFC00':'Lawn Green','#FFFACD':'Lemon Chiffon','#ADD8E6':'Light Blue', + '#F08080':'Light Coral','#E0FFFF':'Light Cyan','#FAFAD2':'Light Golden Rod Yellow','#D3D3D3':'Light Gray','#D3D3D3':'Light Grey','#90EE90':'Light Green', + '#FFB6C1':'Light Pink','#FFA07A':'Light Salmon','#20B2AA':'Light Sea Green','#87CEFA':'Light Sky Blue','#778899':'Light Slate Gray','#778899':'Light Slate Grey', + '#B0C4DE':'Light Steel Blue','#FFFFE0':'Light Yellow','#00FF00':'Lime','#32CD32':'Lime Green','#FAF0E6':'Linen','#FF00FF':'Magenta','#800000':'Maroon', + '#66CDAA':'Medium Aqua Marine','#0000CD':'Medium Blue','#BA55D3':'Medium Orchid','#9370D8':'Medium Purple','#3CB371':'Medium Sea Green','#7B68EE':'Medium Slate Blue', + '#00FA9A':'Medium Spring Green','#48D1CC':'Medium Turquoise','#C71585':'Medium Violet Red','#191970':'Midnight Blue','#F5FFFA':'Mint Cream','#FFE4E1':'Misty Rose','#FFE4B5':'Moccasin', + '#FFDEAD':'Navajo White','#000080':'Navy','#FDF5E6':'Old Lace','#808000':'Olive','#6B8E23':'Olive Drab','#FFA500':'Orange','#FF4500':'Orange Red','#DA70D6':'Orchid', + '#EEE8AA':'Pale Golden Rod','#98FB98':'Pale Green','#AFEEEE':'Pale Turquoise','#D87093':'Pale Violet Red','#FFEFD5':'Papaya Whip','#FFDAB9':'Peach Puff', + '#CD853F':'Peru','#FFC0CB':'Pink','#DDA0DD':'Plum','#B0E0E6':'Powder Blue','#800080':'Purple','#FF0000':'Red','#BC8F8F':'Rosy Brown','#4169E1':'Royal Blue', + '#8B4513':'Saddle Brown','#FA8072':'Salmon','#F4A460':'Sandy Brown','#2E8B57':'Sea Green','#FFF5EE':'Sea Shell','#A0522D':'Sienna','#C0C0C0':'Silver', + '#87CEEB':'Sky Blue','#6A5ACD':'Slate Blue','#708090':'Slate Gray','#708090':'Slate Grey','#FFFAFA':'Snow','#00FF7F':'Spring Green', + '#4682B4':'Steel Blue','#D2B48C':'Tan','#008080':'Teal','#D8BFD8':'Thistle','#FF6347':'Tomato','#40E0D0':'Turquoise','#EE82EE':'Violet', + '#F5DEB3':'Wheat','#FFFFFF':'White','#F5F5F5':'White Smoke','#FFFF00':'Yellow','#9ACD32':'Yellow Green' }; +var namedLookup = {}; + function init() { - var inputColor = convertRGBToHex(tinyMCEPopup.getWindowArg('input_color')); + var inputColor = convertRGBToHex(tinyMCEPopup.getWindowArg('input_color')), key, value; tinyMCEPopup.resizeToInnerSize(); generatePicker(); + generateWebColors(); + generateNamedColors(); if (inputColor) { changeFinalColor(inputColor); @@ -73,6 +77,45 @@ function init() { if (col) updateLight(col.r, col.g, col.b); } + + for (key in named) { + value = named[key]; + namedLookup[value.replace(/\s+/, '').toLowerCase()] = key.replace(/#/, '').toLowerCase(); + } +} + +function toHexColor(color) { + var matches, red, green, blue, toInt = parseInt; + + function hex(value) { + value = parseInt(value).toString(16); + + return value.length > 1 ? value : '0' + value; // Padd with leading zero + }; + + color = color.replace(/[\s#]+/g, '').toLowerCase(); + color = namedLookup[color] || color; + matches = /^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)|([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})|([a-f0-9])([a-f0-9])([a-f0-9])$/.exec(color); + + if (matches) { + if (matches[1]) { + red = toInt(matches[1]); + green = toInt(matches[2]); + blue = toInt(matches[3]); + } else if (matches[4]) { + red = toInt(matches[4], 16); + green = toInt(matches[5], 16); + blue = toInt(matches[6], 16); + } else if (matches[7]) { + red = toInt(matches[7] + matches[7], 16); + green = toInt(matches[8] + matches[8], 16); + blue = toInt(matches[9] + matches[9], 16); + } + + return '#' + hex(red) + hex(green) + hex(blue); + } + + return ''; } function insertAction() { @@ -81,7 +124,7 @@ function insertAction() { tinyMCEPopup.restoreSelection(); if (f) - f(color); + f(toHexColor(color)); tinyMCEPopup.close(); } @@ -91,7 +134,7 @@ function showColor(color, name) { document.getElementById("colorname").innerHTML = name; document.getElementById("preview").style.backgroundColor = color; - document.getElementById("color").value = color.toLowerCase(); + document.getElementById("color").value = color.toUpperCase(); } function convertRGBToHex(col) { @@ -153,23 +196,40 @@ function generateWebColors() { if (el.className == 'generated') return; - h += '
     
    - +
    diff --git a/js/tiny_mce/plugins/template/js/template.js b/js/tiny_mce/plugins/template/js/template.js index 24045d7311..bc3045d244 100644 --- a/js/tiny_mce/plugins/template/js/template.js +++ b/js/tiny_mce/plugins/template/js/template.js @@ -42,7 +42,7 @@ var TemplateDialog = { if (e) { e.style.height = Math.abs(h) + 'px'; - e.style.width = Math.abs(w - 5) + 'px'; + e.style.width = Math.abs(w - 5) + 'px'; } }, diff --git a/js/tiny_mce/plugins/template/langs/en_dlg.js b/js/tiny_mce/plugins/template/langs/en_dlg.js index 2471c3fa04..83e599d68f 100644 --- a/js/tiny_mce/plugins/template/langs/en_dlg.js +++ b/js/tiny_mce/plugins/template/langs/en_dlg.js @@ -1,15 +1 @@ -tinyMCE.addI18n('en.template_dlg',{ -title:"Templates", -label:"Template", -desc_label:"Description", -desc:"Insert predefined template content", -select:"Select a template", -preview:"Preview", -warning:"Warning: Updating a template with a different one may cause data loss.", -mdate_format:"%Y-%m-%d %H:%M:%S", -cdate_format:"%Y-%m-%d %H:%M:%S", -months_long:"January,February,March,April,May,June,July,August,September,October,November,December", -months_short:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec", -day_long:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday", -day_short:"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun" -}); \ No newline at end of file +tinyMCE.addI18n('en.template_dlg',{title:"Templates",label:"Template","desc_label":"Description",desc:"Insert Predefined Template Content",select:"Select a Template",preview:"Preview",warning:"Warning: Updating a template with a different one may cause data loss.","mdate_format":"%Y-%m-%d %H:%M:%S","cdate_format":"%Y-%m-%d %H:%M:%S","months_long":"January,February,March,April,May,June,July,August,September,October,November,December","months_short":"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec","day_long":"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday","day_short":"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/visualchars/editor_plugin.js b/js/tiny_mce/plugins/visualchars/editor_plugin.js index 53d31c44fa..1a148e8b4f 100644 --- a/js/tiny_mce/plugins/visualchars/editor_plugin.js +++ b/js/tiny_mce/plugins/visualchars/editor_plugin.js @@ -1 +1 @@ -(function(){tinymce.create("tinymce.plugins.VisualChars",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceVisualChars",c._toggleVisualChars,c);a.addButton("visualchars",{title:"visualchars.desc",cmd:"mceVisualChars"});a.onBeforeGetContent.add(function(d,e){if(c.state){c.state=true;c._toggleVisualChars()}})},getInfo:function(){return{longname:"Visual characters",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/visualchars",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_toggleVisualChars:function(){var m=this,g=m.editor,a,e,f,k=g.getDoc(),l=g.getBody(),j,n=g.selection,c;m.state=!m.state;g.controlManager.setActive("visualchars",m.state);if(m.state){a=[];tinymce.walk(l,function(b){if(b.nodeType==3&&b.nodeValue&&b.nodeValue.indexOf("\u00a0")!=-1){a.push(b)}},"childNodes");for(e=0;e$1');j=j.replace(/\u00a0/g,"\u00b7");g.dom.setOuterHTML(a[e],j,k)}}else{a=tinymce.grep(g.dom.select("span",l),function(b){return g.dom.hasClass(b,"mceVisualNbsp")});for(e=0;e$1');c=k.dom.create("div",null,l);while(node=c.lastChild){k.dom.insertAfter(node,a[g])}k.dom.remove(a[g])}}else{a=k.dom.select("span.mceItemNbsp",o);for(g=a.length-1;g>=0;g--){k.dom.remove(a[g],1)}}q.moveToBookmark(f)}});tinymce.PluginManager.add("visualchars",tinymce.plugins.VisualChars)})(); \ No newline at end of file diff --git a/js/tiny_mce/plugins/visualchars/editor_plugin_src.js b/js/tiny_mce/plugins/visualchars/editor_plugin_src.js index 0a5275fe28..df985905b6 100644 --- a/js/tiny_mce/plugins/visualchars/editor_plugin_src.js +++ b/js/tiny_mce/plugins/visualchars/editor_plugin_src.js @@ -22,9 +22,9 @@ ed.addButton('visualchars', {title : 'visualchars.desc', cmd : 'mceVisualChars'}); ed.onBeforeGetContent.add(function(ed, o) { - if (t.state) { + if (t.state && o.format != 'raw' && !o.draft) { t.state = true; - t._toggleVisualChars(); + t._toggleVisualChars(false); } }); }, @@ -41,12 +41,15 @@ // Private methods - _toggleVisualChars : function() { - var t = this, ed = t.editor, nl, i, h, d = ed.getDoc(), b = ed.getBody(), nv, s = ed.selection, bo; + _toggleVisualChars : function(bookmark) { + var t = this, ed = t.editor, nl, i, h, d = ed.getDoc(), b = ed.getBody(), nv, s = ed.selection, bo, div, bm; t.state = !t.state; ed.controlManager.setActive('visualchars', t.state); + if (bookmark) + bm = s.getBookmark(); + if (t.state) { nl = []; tinymce.walk(b, function(n) { @@ -54,20 +57,24 @@ nl.push(n); }, 'childNodes'); - for (i=0; i$1'); - nv = nv.replace(/\u00a0/g, '\u00b7'); - ed.dom.setOuterHTML(nl[i], nv, d); + nv = nv.replace(/(\u00a0)/g, '$1'); + + div = ed.dom.create('div', null, nv); + while (node = div.lastChild) + ed.dom.insertAfter(node, nl[i]); + + ed.dom.remove(nl[i]); } } else { - nl = tinymce.grep(ed.dom.select('span', b), function(n) { - return ed.dom.hasClass(n, 'mceVisualNbsp'); - }); + nl = ed.dom.select('span.mceItemNbsp', b); - for (i=0; i= 0; i--) + ed.dom.remove(nl[i], 1); } + + s.moveToBookmark(bm); } }); diff --git a/js/tiny_mce/plugins/wordcount/editor_plugin.js b/js/tiny_mce/plugins/wordcount/editor_plugin.js index a099e6a8c5..a752ad32ae 100644 --- a/js/tiny_mce/plugins/wordcount/editor_plugin.js +++ b/js/tiny_mce/plugins/wordcount/editor_plugin.js @@ -1 +1 @@ -(function(){tinymce.create("tinymce.plugins.WordCount",{block:0,id:null,countre:null,cleanre:null,init:function(a,b){var c=this,d=0;c.countre=a.getParam("wordcount_countregex",/\S\s+/g);c.cleanre=a.getParam("wordcount_cleanregex",/[0-9.(),;:!?%#$¿'"_+=\\\/-]*/g);c.id=a.id+"-word-count";a.onPostRender.add(function(f,e){var g,h;h=f.getParam("wordcount_target_id");if(!h){g=tinymce.DOM.get(f.id+"_path_row");if(g){tinymce.DOM.add(g.parentNode,"div",{style:"float: right"},f.getLang("wordcount.words","Words: ")+'0')}}else{tinymce.DOM.add(h,"span",{},'0')}});a.onInit.add(function(e){e.selection.onSetContent.add(function(){c._count(e)});c._count(e)});a.onSetContent.add(function(e){c._count(e)});a.onKeyUp.add(function(f,g){if(g.keyCode==d){return}if(13==g.keyCode||8==d||46==d){c._count(f)}d=g.keyCode})},_count:function(b){var c=this,a=0;if(c.block){return}c.block=1;setTimeout(function(){var d=b.getContent({format:"raw"});if(d){d=d.replace(/<.[^<>]*?>/g," ").replace(/ | /gi," ");d=d.replace(c.cleanre,"");d.replace(c.countre,function(){a++})}tinymce.DOM.setHTML(c.id,a.toString());setTimeout(function(){c.block=0},2000)},1)},getInfo:function(){return{longname:"Word Count plugin",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/wordcount",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("wordcount",tinymce.plugins.WordCount)})(); \ No newline at end of file +(function(){tinymce.create("tinymce.plugins.WordCount",{block:0,id:null,countre:null,cleanre:null,init:function(a,b){var c=this,d=0;c.countre=a.getParam("wordcount_countregex",/[\w\u2019\'-]+/g);c.cleanre=a.getParam("wordcount_cleanregex",/[0-9.(),;:!?%#$?\'\"_+=\\\/-]*/g);c.id=a.id+"-word-count";a.onPostRender.add(function(f,e){var g,h;h=f.getParam("wordcount_target_id");if(!h){g=tinymce.DOM.get(f.id+"_path_row");if(g){tinymce.DOM.add(g.parentNode,"div",{style:"float: right"},f.getLang("wordcount.words","Words: ")+'0')}}else{tinymce.DOM.add(h,"span",{},'0')}});a.onInit.add(function(e){e.selection.onSetContent.add(function(){c._count(e)});c._count(e)});a.onSetContent.add(function(e){c._count(e)});a.onKeyUp.add(function(f,g){if(g.keyCode==d){return}if(13==g.keyCode||8==d||46==d){c._count(f)}d=g.keyCode})},_getCount:function(c){var a=0;var b=c.getContent({format:"raw"});if(b){b=b.replace(/\.\.\./g," ");b=b.replace(/<.[^<>]*?>/g," ").replace(/ | /gi," ");b=b.replace(/(\w+)(&.+?;)+(\w+)/,"$1$3").replace(/&.+?;/g," ");b=b.replace(this.cleanre,"");var d=b.match(this.countre);if(d){a=d.length}}return a},_count:function(a){var b=this;if(b.block){return}b.block=1;setTimeout(function(){if(!a.destroyed){var c=b._getCount(a);tinymce.DOM.setHTML(b.id,c.toString());setTimeout(function(){b.block=0},2000)}},1)},getInfo:function(){return{longname:"Word Count plugin",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/wordcount",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("wordcount",tinymce.plugins.WordCount)})(); \ No newline at end of file diff --git a/js/tiny_mce/plugins/wordcount/editor_plugin_src.js b/js/tiny_mce/plugins/wordcount/editor_plugin_src.js index 5cb92fa0f0..e94743bae1 100644 --- a/js/tiny_mce/plugins/wordcount/editor_plugin_src.js +++ b/js/tiny_mce/plugins/wordcount/editor_plugin_src.js @@ -9,7 +9,7 @@ */ (function() { - tinymce.create('tinymce.plugins.WordCount', { + tinymce.create('tinymce.plugins.WordCount', { block : 0, id : null, countre : null, @@ -18,8 +18,8 @@ init : function(ed, url) { var t = this, last = 0; - t.countre = ed.getParam('wordcount_countregex', /\S\s+/g); - t.cleanre = ed.getParam('wordcount_cleanregex', /[0-9.(),;:!?%#$¿'"_+=\\\/-]*/g); + t.countre = ed.getParam('wordcount_countregex', /[\w\u2019\'-]+/g); // u2019 == ’ + t.cleanre = ed.getParam('wordcount_cleanregex', /[0-9.(),;:!?%#$?\'\"_+=\\\/-]*/g); t.id = ed.id + '-word-count'; ed.onPostRender.add(function(ed, cm) { @@ -32,11 +32,12 @@ if (row) tinymce.DOM.add(row.parentNode, 'div', {'style': 'float: right'}, ed.getLang('wordcount.words', 'Words: ') + '0'); - } else + } else { tinymce.DOM.add(id, 'span', {}, '0'); + } }); - ed.onInit.add(function(ed) { + ed.onInit.add(function(ed) { ed.selection.onSetContent.add(function() { t._count(ed); }); @@ -59,8 +60,29 @@ }); }, + _getCount : function(ed) { + var tc = 0; + var tx = ed.getContent({ format: 'raw' }); + + if (tx) { + tx = tx.replace(/\.\.\./g, ' '); // convert ellipses to spaces + tx = tx.replace(/<.[^<>]*?>/g, ' ').replace(/ | /gi, ' '); // remove html tags and space chars + + // deal with html entities + tx = tx.replace(/(\w+)(&.+?;)+(\w+)/, "$1$3").replace(/&.+?;/g, ' '); + tx = tx.replace(this.cleanre, ''); // remove numbers and punctuation + + var wordArray = tx.match(this.countre); + if (wordArray) { + tc = wordArray.length; + } + } + + return tc; + }, + _count : function(ed) { - var t = this, tc = 0; + var t = this; // Keep multiple calls from happening at the same time if (t.block) @@ -69,21 +91,15 @@ t.block = 1; setTimeout(function() { - var tx = ed.getContent({format : 'raw'}); - - if (tx) { - tx = tx.replace(/<.[^<>]*?>/g, ' ').replace(/ | /gi, ' '); // remove html tags and space chars - tx = tx.replace(t.cleanre, ''); // remove numbers and punctuation - tx.replace(t.countre, function() {tc++;}); // count the words + if (!ed.destroyed) { + var tc = t._getCount(ed); + tinymce.DOM.setHTML(t.id, tc.toString()); + setTimeout(function() {t.block = 0;}, 2000); } - - tinymce.DOM.setHTML(t.id, tc.toString()); - - setTimeout(function() {t.block = 0;}, 2000); }, 1); }, - getInfo: function() { + getInfo: function() { return { longname : 'Word Count plugin', author : 'Moxiecode Systems AB', @@ -91,8 +107,8 @@ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/wordcount', version : tinymce.majorVersion + "." + tinymce.minorVersion }; - } - }); + } + }); - tinymce.PluginManager.add('wordcount', tinymce.plugins.WordCount); + tinymce.PluginManager.add('wordcount', tinymce.plugins.WordCount); })(); diff --git a/js/tiny_mce/plugins/xhtmlxtras/abbr.htm b/js/tiny_mce/plugins/xhtmlxtras/abbr.htm index 3aeac0deba..30a894f7c3 100644 --- a/js/tiny_mce/plugins/xhtmlxtras/abbr.htm +++ b/js/tiny_mce/plugins/xhtmlxtras/abbr.htm @@ -10,11 +10,12 @@ - + + @@ -23,7 +24,7 @@
    {#xhtmlxtras_dlg.fieldset_attrib_tab} -
     
    +
    @@ -41,7 +42,7 @@ - + @@ -67,7 +68,7 @@
    {#xhtmlxtras_dlg.fieldset_events_tab} -
    :
    ::
    +
    diff --git a/js/tiny_mce/plugins/xhtmlxtras/acronym.htm b/js/tiny_mce/plugins/xhtmlxtras/acronym.htm index 31ee7b70f3..c109345928 100644 --- a/js/tiny_mce/plugins/xhtmlxtras/acronym.htm +++ b/js/tiny_mce/plugins/xhtmlxtras/acronym.htm @@ -10,11 +10,12 @@ - + + @@ -23,7 +24,7 @@
    {#xhtmlxtras_dlg.fieldset_attrib_tab} -
    :
    +
    @@ -41,7 +42,7 @@ - + @@ -67,7 +68,7 @@
    {#xhtmlxtras_dlg.fieldset_events_tab} -
    :
    ::
    +
    diff --git a/js/tiny_mce/plugins/xhtmlxtras/attributes.htm b/js/tiny_mce/plugins/xhtmlxtras/attributes.htm index 17054da3ed..e8d606a340 100644 --- a/js/tiny_mce/plugins/xhtmlxtras/attributes.htm +++ b/js/tiny_mce/plugins/xhtmlxtras/attributes.htm @@ -9,12 +9,13 @@ - + + @@ -22,7 +23,7 @@
    {#xhtmlxtras_dlg.attribute_attrib_tab} -
    :
    +
    @@ -75,7 +76,7 @@
    {#xhtmlxtras_dlg.attribute_events_tab} -
    :
    +
    diff --git a/js/tiny_mce/plugins/xhtmlxtras/cite.htm b/js/tiny_mce/plugins/xhtmlxtras/cite.htm index d0a3e3a8e5..0ac6bdb667 100644 --- a/js/tiny_mce/plugins/xhtmlxtras/cite.htm +++ b/js/tiny_mce/plugins/xhtmlxtras/cite.htm @@ -10,11 +10,12 @@ - + + @@ -23,7 +24,7 @@
    {#xhtmlxtras_dlg.fieldset_attrib_tab} -
    :
    +
    @@ -67,7 +68,7 @@
    {#xhtmlxtras_dlg.fieldset_events_tab} -
    :
    +
    diff --git a/js/tiny_mce/plugins/xhtmlxtras/del.htm b/js/tiny_mce/plugins/xhtmlxtras/del.htm index 8b07fa8429..5f667510f5 100644 --- a/js/tiny_mce/plugins/xhtmlxtras/del.htm +++ b/js/tiny_mce/plugins/xhtmlxtras/del.htm @@ -10,11 +10,12 @@ - + + @@ -23,14 +24,14 @@
    {#xhtmlxtras_dlg.fieldset_general_tab} -
    :
    +
    @@ -43,7 +44,7 @@
    {#xhtmlxtras_dlg.fieldset_attrib_tab} -
    : - +
    - +
    +
    @@ -61,7 +62,7 @@ - + @@ -87,7 +88,7 @@
    {#xhtmlxtras_dlg.fieldset_events_tab} -
    :
    ::
    +
    diff --git a/js/tiny_mce/plugins/xhtmlxtras/editor_plugin.js b/js/tiny_mce/plugins/xhtmlxtras/editor_plugin.js index e5195265e0..9b98a5154b 100644 --- a/js/tiny_mce/plugins/xhtmlxtras/editor_plugin.js +++ b/js/tiny_mce/plugins/xhtmlxtras/editor_plugin.js @@ -1 +1 @@ -(function(){tinymce.create("tinymce.plugins.XHTMLXtrasPlugin",{init:function(b,c){b.addCommand("mceCite",function(){b.windowManager.open({file:c+"/cite.htm",width:350+parseInt(b.getLang("xhtmlxtras.cite_delta_width",0)),height:250+parseInt(b.getLang("xhtmlxtras.cite_delta_height",0)),inline:1},{plugin_url:c})});b.addCommand("mceAcronym",function(){b.windowManager.open({file:c+"/acronym.htm",width:350+parseInt(b.getLang("xhtmlxtras.acronym_delta_width",0)),height:250+parseInt(b.getLang("xhtmlxtras.acronym_delta_width",0)),inline:1},{plugin_url:c})});b.addCommand("mceAbbr",function(){b.windowManager.open({file:c+"/abbr.htm",width:350+parseInt(b.getLang("xhtmlxtras.abbr_delta_width",0)),height:250+parseInt(b.getLang("xhtmlxtras.abbr_delta_width",0)),inline:1},{plugin_url:c})});b.addCommand("mceDel",function(){b.windowManager.open({file:c+"/del.htm",width:340+parseInt(b.getLang("xhtmlxtras.del_delta_width",0)),height:310+parseInt(b.getLang("xhtmlxtras.del_delta_width",0)),inline:1},{plugin_url:c})});b.addCommand("mceIns",function(){b.windowManager.open({file:c+"/ins.htm",width:340+parseInt(b.getLang("xhtmlxtras.ins_delta_width",0)),height:310+parseInt(b.getLang("xhtmlxtras.ins_delta_width",0)),inline:1},{plugin_url:c})});b.addCommand("mceAttributes",function(){b.windowManager.open({file:c+"/attributes.htm",width:380,height:370,inline:1},{plugin_url:c})});b.addButton("cite",{title:"xhtmlxtras.cite_desc",cmd:"mceCite"});b.addButton("acronym",{title:"xhtmlxtras.acronym_desc",cmd:"mceAcronym"});b.addButton("abbr",{title:"xhtmlxtras.abbr_desc",cmd:"mceAbbr"});b.addButton("del",{title:"xhtmlxtras.del_desc",cmd:"mceDel"});b.addButton("ins",{title:"xhtmlxtras.ins_desc",cmd:"mceIns"});b.addButton("attribs",{title:"xhtmlxtras.attribs_desc",cmd:"mceAttributes"});if(tinymce.isIE){function a(d,e){if(e.set){e.content=e.content.replace(/]+)>/gi,"");e.content=e.content.replace(/<\/abbr>/gi,"")}}b.onBeforeSetContent.add(a);b.onPostProcess.add(a)}b.onNodeChange.add(function(e,d,g,f){g=e.dom.getParent(g,"CITE,ACRONYM,ABBR,DEL,INS");d.setDisabled("cite",f);d.setDisabled("acronym",f);d.setDisabled("abbr",f);d.setDisabled("del",f);d.setDisabled("ins",f);d.setDisabled("attribs",g&&g.nodeName=="BODY");d.setActive("cite",0);d.setActive("acronym",0);d.setActive("abbr",0);d.setActive("del",0);d.setActive("ins",0);if(g){do{d.setDisabled(g.nodeName.toLowerCase(),0);d.setActive(g.nodeName.toLowerCase(),1)}while(g=g.parentNode)}});b.onPreInit.add(function(){b.dom.create("abbr")})},getInfo:function(){return{longname:"XHTML Xtras Plugin",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/xhtmlxtras",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("xhtmlxtras",tinymce.plugins.XHTMLXtrasPlugin)})(); \ No newline at end of file +(function(){tinymce.create("tinymce.plugins.XHTMLXtrasPlugin",{init:function(a,b){a.addCommand("mceCite",function(){a.windowManager.open({file:b+"/cite.htm",width:350+parseInt(a.getLang("xhtmlxtras.cite_delta_width",0)),height:250+parseInt(a.getLang("xhtmlxtras.cite_delta_height",0)),inline:1},{plugin_url:b})});a.addCommand("mceAcronym",function(){a.windowManager.open({file:b+"/acronym.htm",width:350+parseInt(a.getLang("xhtmlxtras.acronym_delta_width",0)),height:250+parseInt(a.getLang("xhtmlxtras.acronym_delta_height",0)),inline:1},{plugin_url:b})});a.addCommand("mceAbbr",function(){a.windowManager.open({file:b+"/abbr.htm",width:350+parseInt(a.getLang("xhtmlxtras.abbr_delta_width",0)),height:250+parseInt(a.getLang("xhtmlxtras.abbr_delta_height",0)),inline:1},{plugin_url:b})});a.addCommand("mceDel",function(){a.windowManager.open({file:b+"/del.htm",width:340+parseInt(a.getLang("xhtmlxtras.del_delta_width",0)),height:310+parseInt(a.getLang("xhtmlxtras.del_delta_height",0)),inline:1},{plugin_url:b})});a.addCommand("mceIns",function(){a.windowManager.open({file:b+"/ins.htm",width:340+parseInt(a.getLang("xhtmlxtras.ins_delta_width",0)),height:310+parseInt(a.getLang("xhtmlxtras.ins_delta_height",0)),inline:1},{plugin_url:b})});a.addCommand("mceAttributes",function(){a.windowManager.open({file:b+"/attributes.htm",width:380+parseInt(a.getLang("xhtmlxtras.attr_delta_width",0)),height:370+parseInt(a.getLang("xhtmlxtras.attr_delta_height",0)),inline:1},{plugin_url:b})});a.addButton("cite",{title:"xhtmlxtras.cite_desc",cmd:"mceCite"});a.addButton("acronym",{title:"xhtmlxtras.acronym_desc",cmd:"mceAcronym"});a.addButton("abbr",{title:"xhtmlxtras.abbr_desc",cmd:"mceAbbr"});a.addButton("del",{title:"xhtmlxtras.del_desc",cmd:"mceDel"});a.addButton("ins",{title:"xhtmlxtras.ins_desc",cmd:"mceIns"});a.addButton("attribs",{title:"xhtmlxtras.attribs_desc",cmd:"mceAttributes"});a.onNodeChange.add(function(d,c,f,e){f=d.dom.getParent(f,"CITE,ACRONYM,ABBR,DEL,INS");c.setDisabled("cite",e);c.setDisabled("acronym",e);c.setDisabled("abbr",e);c.setDisabled("del",e);c.setDisabled("ins",e);c.setDisabled("attribs",f&&f.nodeName=="BODY");c.setActive("cite",0);c.setActive("acronym",0);c.setActive("abbr",0);c.setActive("del",0);c.setActive("ins",0);if(f){do{c.setDisabled(f.nodeName.toLowerCase(),0);c.setActive(f.nodeName.toLowerCase(),1)}while(f=f.parentNode)}});a.onPreInit.add(function(){a.dom.create("abbr")})},getInfo:function(){return{longname:"XHTML Xtras Plugin",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/xhtmlxtras",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("xhtmlxtras",tinymce.plugins.XHTMLXtrasPlugin)})(); \ No newline at end of file diff --git a/js/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js b/js/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js index 9b51b8368d..f24057211c 100644 --- a/js/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js +++ b/js/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js @@ -27,7 +27,7 @@ ed.windowManager.open({ file : url + '/acronym.htm', width : 350 + parseInt(ed.getLang('xhtmlxtras.acronym_delta_width', 0)), - height : 250 + parseInt(ed.getLang('xhtmlxtras.acronym_delta_width', 0)), + height : 250 + parseInt(ed.getLang('xhtmlxtras.acronym_delta_height', 0)), inline : 1 }, { plugin_url : url @@ -38,7 +38,7 @@ ed.windowManager.open({ file : url + '/abbr.htm', width : 350 + parseInt(ed.getLang('xhtmlxtras.abbr_delta_width', 0)), - height : 250 + parseInt(ed.getLang('xhtmlxtras.abbr_delta_width', 0)), + height : 250 + parseInt(ed.getLang('xhtmlxtras.abbr_delta_height', 0)), inline : 1 }, { plugin_url : url @@ -49,7 +49,7 @@ ed.windowManager.open({ file : url + '/del.htm', width : 340 + parseInt(ed.getLang('xhtmlxtras.del_delta_width', 0)), - height : 310 + parseInt(ed.getLang('xhtmlxtras.del_delta_width', 0)), + height : 310 + parseInt(ed.getLang('xhtmlxtras.del_delta_height', 0)), inline : 1 }, { plugin_url : url @@ -60,7 +60,7 @@ ed.windowManager.open({ file : url + '/ins.htm', width : 340 + parseInt(ed.getLang('xhtmlxtras.ins_delta_width', 0)), - height : 310 + parseInt(ed.getLang('xhtmlxtras.ins_delta_width', 0)), + height : 310 + parseInt(ed.getLang('xhtmlxtras.ins_delta_height', 0)), inline : 1 }, { plugin_url : url @@ -70,8 +70,8 @@ ed.addCommand('mceAttributes', function() { ed.windowManager.open({ file : url + '/attributes.htm', - width : 380, - height : 370, + width : 380 + parseInt(ed.getLang('xhtmlxtras.attr_delta_width', 0)), + height : 370 + parseInt(ed.getLang('xhtmlxtras.attr_delta_height', 0)), inline : 1 }, { plugin_url : url @@ -86,18 +86,6 @@ ed.addButton('ins', {title : 'xhtmlxtras.ins_desc', cmd : 'mceIns'}); ed.addButton('attribs', {title : 'xhtmlxtras.attribs_desc', cmd : 'mceAttributes'}); - if (tinymce.isIE) { - function fix(ed, o) { - if (o.set) { - o.content = o.content.replace(/]+)>/gi, ''); - o.content = o.content.replace(/<\/abbr>/gi, ''); - } - }; - - ed.onBeforeSetContent.add(fix); - ed.onPostProcess.add(fix); - } - ed.onNodeChange.add(function(ed, cm, n, co) { n = ed.dom.getParent(n, 'CITE,ACRONYM,ABBR,DEL,INS'); diff --git a/js/tiny_mce/plugins/xhtmlxtras/ins.htm b/js/tiny_mce/plugins/xhtmlxtras/ins.htm index 6c5470cfcc..d001ac7c4d 100644 --- a/js/tiny_mce/plugins/xhtmlxtras/ins.htm +++ b/js/tiny_mce/plugins/xhtmlxtras/ins.htm @@ -10,11 +10,12 @@ - + + @@ -23,19 +24,19 @@
    {#xhtmlxtras_dlg.fieldset_general_tab} -
    :
    +
    - + @@ -43,9 +44,9 @@
    {#xhtmlxtras_dlg.fieldset_attrib_tab} -
    : - +
    - +
    :
    +
    - + @@ -61,7 +62,7 @@ - + @@ -87,7 +88,7 @@
    {#xhtmlxtras_dlg.fieldset_events_tab} -
    ::
    ::
    +
    diff --git a/js/tiny_mce/plugins/xhtmlxtras/js/attributes.js b/js/tiny_mce/plugins/xhtmlxtras/js/attributes.js index d62a219e6b..9c99995adb 100644 --- a/js/tiny_mce/plugins/xhtmlxtras/js/attributes.js +++ b/js/tiny_mce/plugins/xhtmlxtras/js/attributes.js @@ -53,7 +53,6 @@ function insertAction() { var inst = tinyMCEPopup.editor; var elm = inst.selection.getNode(); - tinyMCEPopup.execCommand("mceBeginUndoLevel"); setAllAttribs(elm); tinyMCEPopup.execCommand("mceEndUndoLevel"); tinyMCEPopup.close(); @@ -72,21 +71,7 @@ function setAttrib(elm, attrib, value) { value = valueElm.value; } - if (value != "") { - dom.setAttrib(elm, attrib.toLowerCase(), value); - - if (attrib == "style") - attrib = "style.cssText"; - - if (attrib.substring(0, 2) == 'on') - value = 'return true;' + value; - - if (attrib == "class") - attrib = "className"; - - elm[attrib]=value; - } else - elm.removeAttribute(attrib); + dom.setAttrib(elm, attrib.toLowerCase(), value); } function setAllAttribs(elm) { diff --git a/js/tiny_mce/plugins/xhtmlxtras/js/del.js b/js/tiny_mce/plugins/xhtmlxtras/js/del.js index 9e5d8c5717..1f957dc786 100644 --- a/js/tiny_mce/plugins/xhtmlxtras/js/del.js +++ b/js/tiny_mce/plugins/xhtmlxtras/js/del.js @@ -21,17 +21,17 @@ function setElementAttribs(elm) { setAllCommonAttribs(elm); setAttrib(elm, 'datetime'); setAttrib(elm, 'cite'); + elm.removeAttribute('data-mce-new'); } function insertDel() { var elm = tinyMCEPopup.editor.dom.getParent(SXE.focusElement, 'DEL'); - tinyMCEPopup.execCommand('mceBeginUndoLevel'); if (elm == null) { var s = SXE.inst.selection.getContent(); if(s.length > 0) { insertInlineElement('del'); - var elementArray = tinymce.grep(SXE.inst.dom.select('del'), function(n) {return n.id == '#sxe_temp_del#';}); + var elementArray = SXE.inst.dom.select('del[data-mce-new]'); for (var i=0; i 0) { @@ -165,11 +164,11 @@ SXE.insertElement = function(element_name) { for (var i=0; i 0) { - insertInlineElement('INS'); - var elementArray = tinymce.grep(SXE.inst.dom.select('ins'), function(n) {return n.id == '#sxe_temp_ins#';}); + insertInlineElement('ins'); + var elementArray = SXE.inst.dom.select('ins[data-mce-new]'); for (var i=0; i
    :
    +
    - + - - + +
    {#advanced_dlg.anchor_title}{#advanced_dlg.anchor_title}
    {#advanced_dlg.anchor_name}:
    diff --git a/js/tiny_mce/themes/advanced/charmap.htm b/js/tiny_mce/themes/advanced/charmap.htm index 3991b8141b..d4b6bdfb7b 100644 --- a/js/tiny_mce/themes/advanced/charmap.htm +++ b/js/tiny_mce/themes/advanced/charmap.htm @@ -5,48 +5,51 @@ - - - - - - -
    {#advanced_dlg.charmap_title}
    + + + + + + + - - - - - + + + + + + + + + +
    - - - - - - - - -
     
     
    -
    - - - - - - - - - - - - - - - - -
    HTML-Code
     
     
    NUM-Code
     
    -
    + + + + + + + +
     
     
    +
    + + + + + + + + + + + + + + + + +
     
     
     
    +
    {#advanced_dlg.charmap_usage}
    - diff --git a/js/tiny_mce/themes/advanced/color_picker.htm b/js/tiny_mce/themes/advanced/color_picker.htm index 096e7550c3..ad1bb0f6cc 100644 --- a/js/tiny_mce/themes/advanced/color_picker.htm +++ b/js/tiny_mce/themes/advanced/color_picker.htm @@ -6,13 +6,14 @@ - + + @@ -34,7 +35,7 @@
    - {#advanced_dlg.colorpicker_palette_title} + {#advanced_dlg.colorpicker_palette_title}
    @@ -44,9 +45,9 @@
    -
    - {#advanced_dlg.colorpicker_named_title} -
    +
    + {#advanced_dlg.colorpicker_named_title} +
    @@ -65,7 +66,7 @@
    - +
    diff --git a/js/tiny_mce/themes/advanced/editor_template.js b/js/tiny_mce/themes/advanced/editor_template.js index dc61977461..812578d0bc 100644 --- a/js/tiny_mce/themes/advanced/editor_template.js +++ b/js/tiny_mce/themes/advanced/editor_template.js @@ -1 +1 @@ -(function(e){var d=e.DOM,b=e.dom.Event,h=e.extend,f=e.each,a=e.util.Cookie,g,c=e.explode;e.ThemeManager.requireLangPack("advanced");e.create("tinymce.themes.AdvancedTheme",{sizes:[8,10,12,14,18,24,36],controls:{bold:["bold_desc","Bold"],italic:["italic_desc","Italic"],underline:["underline_desc","Underline"],strikethrough:["striketrough_desc","Strikethrough"],justifyleft:["justifyleft_desc","JustifyLeft"],justifycenter:["justifycenter_desc","JustifyCenter"],justifyright:["justifyright_desc","JustifyRight"],justifyfull:["justifyfull_desc","JustifyFull"],bullist:["bullist_desc","InsertUnorderedList"],numlist:["numlist_desc","InsertOrderedList"],outdent:["outdent_desc","Outdent"],indent:["indent_desc","Indent"],cut:["cut_desc","Cut"],copy:["copy_desc","Copy"],paste:["paste_desc","Paste"],undo:["undo_desc","Undo"],redo:["redo_desc","Redo"],link:["link_desc","mceLink"],unlink:["unlink_desc","unlink"],image:["image_desc","mceImage"],cleanup:["cleanup_desc","mceCleanup"],help:["help_desc","mceHelp"],code:["code_desc","mceCodeEditor"],hr:["hr_desc","InsertHorizontalRule"],removeformat:["removeformat_desc","RemoveFormat"],sub:["sub_desc","subscript"],sup:["sup_desc","superscript"],forecolor:["forecolor_desc","ForeColor"],forecolorpicker:["forecolor_desc","mceForeColor"],backcolor:["backcolor_desc","HiliteColor"],backcolorpicker:["backcolor_desc","mceBackColor"],charmap:["charmap_desc","mceCharMap"],visualaid:["visualaid_desc","mceToggleVisualAid"],anchor:["anchor_desc","mceInsertAnchor"],newdocument:["newdocument_desc","mceNewDocument"],blockquote:["blockquote_desc","mceBlockQuote"]},stateControls:["bold","italic","underline","strikethrough","bullist","numlist","justifyleft","justifycenter","justifyright","justifyfull","sub","sup","blockquote"],init:function(j,k){var l=this,m,i,n;l.editor=j;l.url=k;l.onResolveName=new e.util.Dispatcher(this);l.settings=m=h({theme_advanced_path:true,theme_advanced_toolbar_location:"bottom",theme_advanced_buttons1:"bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect",theme_advanced_buttons2:"bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code",theme_advanced_buttons3:"hr,removeformat,visualaid,|,sub,sup,|,charmap",theme_advanced_blockformats:"p,address,pre,h1,h2,h3,h4,h5,h6",theme_advanced_toolbar_align:"center",theme_advanced_fonts:"Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",theme_advanced_more_colors:1,theme_advanced_row_height:23,theme_advanced_resize_horizontal:1,theme_advanced_resizing_use_cookie:1,theme_advanced_font_sizes:"1,2,3,4,5,6,7",readonly:j.settings.readonly},j.settings);if(!m.font_size_style_values){m.font_size_style_values="8pt,10pt,12pt,14pt,18pt,24pt,36pt"}if(e.is(m.theme_advanced_font_sizes,"string")){m.font_size_style_values=e.explode(m.font_size_style_values);m.font_size_classes=e.explode(m.font_size_classes||"");n={};j.settings.theme_advanced_font_sizes=m.theme_advanced_font_sizes;f(j.getParam("theme_advanced_font_sizes","","hash"),function(q,p){var o;if(p==q&&q>=1&&q<=7){p=q+" ("+l.sizes[q-1]+"pt)";o=m.font_size_classes[q-1];q=m.font_size_style_values[q-1]||(l.sizes[q-1]+"pt")}if(/^\s*\./.test(q)){o=q.replace(/\./g,"")}n[p]=o?{"class":o}:{fontSize:q}});m.theme_advanced_font_sizes=n}if((i=m.theme_advanced_path_location)&&i!="none"){m.theme_advanced_statusbar_location=m.theme_advanced_path_location}if(m.theme_advanced_statusbar_location=="none"){m.theme_advanced_statusbar_location=0}j.onInit.add(function(){if(!j.settings.readonly){j.onNodeChange.add(l._nodeChanged,l)}if(j.settings.content_css!==false){j.dom.loadCSS(j.baseURI.toAbsolute("themes/advanced/skins/"+j.settings.skin+"/content.css"))}});j.onSetProgressState.add(function(q,o,r){var s,t=q.id,p;if(o){l.progressTimer=setTimeout(function(){s=q.getContainer();s=s.insertBefore(d.create("DIV",{style:"position:relative"}),s.firstChild);p=d.get(q.id+"_tbl");d.add(s,"div",{id:t+"_blocker","class":"mceBlocker",style:{width:p.clientWidth+2,height:p.clientHeight+2}});d.add(s,"div",{id:t+"_progress","class":"mceProgress",style:{left:p.clientWidth/2,top:p.clientHeight/2}})},r||0)}else{d.remove(t+"_blocker");d.remove(t+"_progress");clearTimeout(l.progressTimer)}});d.loadCSS(m.editor_css?j.documentBaseURI.toAbsolute(m.editor_css):k+"/skins/"+j.settings.skin+"/ui.css");if(m.skin_variant){d.loadCSS(k+"/skins/"+j.settings.skin+"/ui_"+m.skin_variant+".css")}},createControl:function(l,i){var j,k;if(k=i.createControl(l)){return k}switch(l){case"styleselect":return this._createStyleSelect();case"formatselect":return this._createBlockFormats();case"fontselect":return this._createFontSelect();case"fontsizeselect":return this._createFontSizeSelect();case"forecolor":return this._createForeColorMenu();case"backcolor":return this._createBackColorMenu()}if((j=this.controls[l])){return i.createButton(l,{title:"advanced."+j[0],cmd:j[1],ui:j[2],value:j[3]})}},execCommand:function(k,j,l){var i=this["_"+k];if(i){i.call(this,j,l);return true}return false},_importClasses:function(k){var i=this.editor,j=i.controlManager.get("styleselect");if(j.getLength()==0){f(i.dom.getClasses(),function(n,l){var m="style_"+l;i.formatter.register(m,{inline:"span",attributes:{"class":n["class"]},selector:"*"});j.add(n["class"],m)})}},_createStyleSelect:function(m){var k=this,i=k.editor,j=i.controlManager,l;l=j.createListBox("styleselect",{title:"advanced.style_select",onselect:function(o){var p,n=[];f(l.items,function(q){n.push(q.value)});i.focus();i.undoManager.add();p=i.formatter.matchAll(n);if(p[0]==o){i.formatter.remove(o)}else{i.formatter.apply(o)}i.undoManager.add();i.nodeChanged();return false}});i.onInit.add(function(){var o=0,n=i.getParam("style_formats");if(n){f(n,function(p){var q,r=0;f(p,function(){r++});if(r>1){q=p.name=p.name||"style_"+(o++);i.formatter.register(q,p);l.add(p.title,q)}else{l.add(p.title)}})}else{f(i.getParam("theme_advanced_styles","","hash"),function(r,q){var p;if(r){p="style_"+(o++);i.formatter.register(p,{inline:"span",classes:r,selector:"*"});l.add(k.editor.translate(q),p)}})}});if(l.getLength()==0){l.onPostRender.add(function(o,p){if(!l.NativeListBox){b.add(p.id+"_text","focus",k._importClasses,k);b.add(p.id+"_text","mousedown",k._importClasses,k);b.add(p.id+"_open","focus",k._importClasses,k);b.add(p.id+"_open","mousedown",k._importClasses,k)}else{b.add(p.id,"focus",k._importClasses,k)}})}return l},_createFontSelect:function(){var k,j=this,i=j.editor;k=i.controlManager.createListBox("fontselect",{title:"advanced.fontdefault",onselect:function(l){i.execCommand("FontName",false,l);k.select(function(m){return l==m});return false}});if(k){f(i.getParam("theme_advanced_fonts",j.settings.theme_advanced_fonts,"hash"),function(m,l){k.add(i.translate(l),m,{style:m.indexOf("dings")==-1?"font-family:"+m:""})})}return k},_createFontSizeSelect:function(){var m=this,k=m.editor,n,l=0,j=[];n=k.controlManager.createListBox("fontsizeselect",{title:"advanced.font_size",onselect:function(i){if(i["class"]){k.focus();k.undoManager.add();k.formatter.toggle("fontsize_class",{value:i["class"]});k.undoManager.add();k.nodeChanged()}else{k.execCommand("FontSize",false,i.fontSize)}n.select(function(o){return i==o});return false}});if(n){f(m.settings.theme_advanced_font_sizes,function(o,i){var p=o.fontSize;if(p>=1&&p<=7){p=m.sizes[parseInt(p)-1]+"pt"}n.add(i,o,{style:"font-size:"+p,"class":"mceFontSize"+(l++)+(" "+(o["class"]||""))})})}return n},_createBlockFormats:function(){var k,i={p:"advanced.paragraph",address:"advanced.address",pre:"advanced.pre",h1:"advanced.h1",h2:"advanced.h2",h3:"advanced.h3",h4:"advanced.h4",h5:"advanced.h5",h6:"advanced.h6",div:"advanced.div",blockquote:"advanced.blockquote",code:"advanced.code",dt:"advanced.dt",dd:"advanced.dd",samp:"advanced.samp"},j=this;k=j.editor.controlManager.createListBox("formatselect",{title:"advanced.block",cmd:"FormatBlock"});if(k){f(j.editor.getParam("theme_advanced_blockformats",j.settings.theme_advanced_blockformats,"hash"),function(m,l){k.add(j.editor.translate(l!=m?l:i[m]),m,{"class":"mce_formatPreview mce_"+m})})}return k},_createForeColorMenu:function(){var m,j=this,k=j.settings,l={},i;if(k.theme_advanced_more_colors){l.more_colors_func=function(){j._mceColorPicker(0,{color:m.value,func:function(n){m.setColor(n)}})}}if(i=k.theme_advanced_text_colors){l.colors=i}if(k.theme_advanced_default_foreground_color){l.default_color=k.theme_advanced_default_foreground_color}l.title="advanced.forecolor_desc";l.cmd="ForeColor";l.scope=this;m=j.editor.controlManager.createColorSplitButton("forecolor",l);return m},_createBackColorMenu:function(){var m,j=this,k=j.settings,l={},i;if(k.theme_advanced_more_colors){l.more_colors_func=function(){j._mceColorPicker(0,{color:m.value,func:function(n){m.setColor(n)}})}}if(i=k.theme_advanced_background_colors){l.colors=i}if(k.theme_advanced_default_background_color){l.default_color=k.theme_advanced_default_background_color}l.title="advanced.backcolor_desc";l.cmd="HiliteColor";l.scope=this;m=j.editor.controlManager.createColorSplitButton("backcolor",l);return m},renderUI:function(k){var m,l,q,v=this,r=v.editor,w=v.settings,u,j,i;m=j=d.create("span",{id:r.id+"_parent","class":"mceEditor "+r.settings.skin+"Skin"+(w.skin_variant?" "+r.settings.skin+"Skin"+v._ufirst(w.skin_variant):"")});if(!d.boxModel){m=d.add(m,"div",{"class":"mceOldBoxModel"})}m=u=d.add(m,"table",{id:r.id+"_tbl","class":"mceLayout",cellSpacing:0,cellPadding:0});m=q=d.add(m,"tbody");switch((w.theme_advanced_layout_manager||"").toLowerCase()){case"rowlayout":l=v._rowLayout(w,q,k);break;case"customlayout":l=r.execCallback("theme_advanced_custom_layout",w,q,k,j);break;default:l=v._simpleLayout(w,q,k,j)}m=k.targetNode;i=d.stdMode?u.getElementsByTagName("tr"):u.rows;d.addClass(i[0],"mceFirst");d.addClass(i[i.length-1],"mceLast");f(d.select("tr",q),function(o){d.addClass(o.firstChild,"mceFirst");d.addClass(o.childNodes[o.childNodes.length-1],"mceLast")});if(d.get(w.theme_advanced_toolbar_container)){d.get(w.theme_advanced_toolbar_container).appendChild(j)}else{d.insertAfter(j,m)}b.add(r.id+"_path_row","click",function(n){n=n.target;if(n.nodeName=="A"){v._sel(n.className.replace(/^.*mcePath_([0-9]+).*$/,"$1"));return b.cancel(n)}});if(!r.getParam("accessibility_focus")){b.add(d.add(j,"a",{href:"#"},""),"focus",function(){tinyMCE.get(r.id).focus()})}if(w.theme_advanced_toolbar_location=="external"){k.deltaHeight=0}v.deltaHeight=k.deltaHeight;k.targetNode=null;return{iframeContainer:l,editorContainer:r.id+"_parent",sizeContainer:u,deltaHeight:k.deltaHeight}},getInfo:function(){return{longname:"Advanced theme",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",version:e.majorVersion+"."+e.minorVersion}},resizeBy:function(i,j){var k=d.get(this.editor.id+"_tbl");this.resizeTo(k.clientWidth+i,k.clientHeight+j)},resizeTo:function(i,l){var j=this.editor,k=this.settings,m=d.get(j.id+"_tbl"),n=d.get(j.id+"_ifr");i=Math.max(k.theme_advanced_resizing_min_width||100,i);l=Math.max(k.theme_advanced_resizing_min_height||100,l);i=Math.min(k.theme_advanced_resizing_max_width||65535,i);l=Math.min(k.theme_advanced_resizing_max_height||65535,l);d.setStyle(m,"height","");d.setStyle(n,"height",l);if(k.theme_advanced_resize_horizontal){d.setStyle(m,"width","");d.setStyle(n,"width",i);if(i"))}q.push(d.createHTML("a",{href:"#",accesskey:"q",title:r.getLang("advanced.toolbar_focus")},""));for(p=1;(y=A["theme_advanced_buttons"+p]);p++){m=j.createToolbar("toolbar"+p,{"class":"mceToolbarRow"+p});if(A["theme_advanced_buttons"+p+"_add"]){y+=","+A["theme_advanced_buttons"+p+"_add"]}if(A["theme_advanced_buttons"+p+"_add_before"]){y=A["theme_advanced_buttons"+p+"_add_before"]+","+y}z._addControls(y,m);q.push(m.renderHTML());k.deltaHeight-=A.theme_advanced_row_height}q.push(d.createHTML("a",{href:"#",accesskey:"z",title:r.getLang("advanced.toolbar_focus"),onfocus:"tinyMCE.getInstanceById('"+r.id+"').focus();"},""));d.setHTML(l,q.join(""))},_addStatusBar:function(m,j){var k,v=this,p=v.editor,w=v.settings,i,q,u,l;k=d.add(m,"tr");k=l=d.add(k,"td",{"class":"mceStatusbar"});k=d.add(k,"div",{id:p.id+"_path_row"},w.theme_advanced_path?p.translate("advanced.path")+": ":" ");d.add(k,"a",{href:"#",accesskey:"x"});if(w.theme_advanced_resizing){d.add(l,"a",{id:p.id+"_resize",href:"javascript:;",onclick:"return false;","class":"mceResize"});if(w.theme_advanced_resizing_use_cookie){p.onPostRender.add(function(){var n=a.getHash("TinyMCE_"+p.id+"_size"),r=d.get(p.id+"_tbl");if(!n){return}v.resizeTo(n.cw,n.ch)})}p.onPostRender.add(function(){b.add(p.id+"_resize","mousedown",function(D){var t,r,s,o,C,z,A,F,n,E,x;function y(G){n=A+(G.screenX-C);E=F+(G.screenY-z);v.resizeTo(n,E)}function B(G){b.remove(d.doc,"mousemove",t);b.remove(p.getDoc(),"mousemove",r);b.remove(d.doc,"mouseup",s);b.remove(p.getDoc(),"mouseup",o);if(w.theme_advanced_resizing_use_cookie){a.setHash("TinyMCE_"+p.id+"_size",{cw:n,ch:E})}}D.preventDefault();C=D.screenX;z=D.screenY;x=d.get(v.editor.id+"_ifr");A=n=x.clientWidth;F=E=x.clientHeight;t=b.add(d.doc,"mousemove",y);r=b.add(p.getDoc(),"mousemove",y);s=b.add(d.doc,"mouseup",B);o=b.add(p.getDoc(),"mouseup",B)})})}j.deltaHeight-=21;k=m=null},_nodeChanged:function(r,z,l,x,j){var C=this,i,y=0,B,u,D=C.settings,A,k,w,m,q;e.each(C.stateControls,function(n){z.setActive(n,r.queryCommandState(C.controls[n][1]))});function o(p){var s,n=j.parents,t=p;if(typeof(p)=="string"){t=function(v){return v.nodeName==p}}for(s=0;s=1&&q<=7){p=q+" ("+l.sizes[q-1]+"pt)";o=m.font_size_classes[q-1];q=m.font_size_style_values[q-1]||(l.sizes[q-1]+"pt")}if(/^\s*\./.test(q)){o=q.replace(/\./g,"")}n[p]=o?{"class":o}:{fontSize:q}});m.theme_advanced_font_sizes=n}if((i=m.theme_advanced_path_location)&&i!="none"){m.theme_advanced_statusbar_location=m.theme_advanced_path_location}if(m.theme_advanced_statusbar_location=="none"){m.theme_advanced_statusbar_location=0}if(j.settings.content_css!==false){j.contentCSS.push(j.baseURI.toAbsolute(k+"/skins/"+j.settings.skin+"/content.css"))}j.onInit.add(function(){if(!j.settings.readonly){j.onNodeChange.add(l._nodeChanged,l);j.onKeyUp.add(l._updateUndoStatus,l);j.onMouseUp.add(l._updateUndoStatus,l);j.dom.bind(j.dom.getRoot(),"dragend",function(){l._updateUndoStatus(j)})}});j.onSetProgressState.add(function(q,o,r){var s,t=q.id,p;if(o){l.progressTimer=setTimeout(function(){s=q.getContainer();s=s.insertBefore(d.create("DIV",{style:"position:relative"}),s.firstChild);p=d.get(q.id+"_tbl");d.add(s,"div",{id:t+"_blocker","class":"mceBlocker",style:{width:p.clientWidth+2,height:p.clientHeight+2}});d.add(s,"div",{id:t+"_progress","class":"mceProgress",style:{left:p.clientWidth/2,top:p.clientHeight/2}})},r||0)}else{d.remove(t+"_blocker");d.remove(t+"_progress");clearTimeout(l.progressTimer)}});d.loadCSS(m.editor_css?j.documentBaseURI.toAbsolute(m.editor_css):k+"/skins/"+j.settings.skin+"/ui.css");if(m.skin_variant){d.loadCSS(k+"/skins/"+j.settings.skin+"/ui_"+m.skin_variant+".css")}},_isHighContrast:function(){var i,j=d.add(d.getRoot(),"div",{style:"background-color: rgb(171,239,86);"});i=(d.getStyle(j,"background-color",true)+"").toLowerCase().replace(/ /g,"");d.remove(j);return i!="rgb(171,239,86)"&&i!="#abef56"},createControl:function(l,i){var j,k;if(k=i.createControl(l)){return k}switch(l){case"styleselect":return this._createStyleSelect();case"formatselect":return this._createBlockFormats();case"fontselect":return this._createFontSelect();case"fontsizeselect":return this._createFontSizeSelect();case"forecolor":return this._createForeColorMenu();case"backcolor":return this._createBackColorMenu()}if((j=this.controls[l])){return i.createButton(l,{title:"advanced."+j[0],cmd:j[1],ui:j[2],value:j[3]})}},execCommand:function(k,j,l){var i=this["_"+k];if(i){i.call(this,j,l);return true}return false},_importClasses:function(k){var i=this.editor,j=i.controlManager.get("styleselect");if(j.getLength()==0){f(i.dom.getClasses(),function(n,l){var m="style_"+l;i.formatter.register(m,{inline:"span",attributes:{"class":n["class"]},selector:"*"});j.add(n["class"],m)})}},_createStyleSelect:function(m){var k=this,i=k.editor,j=i.controlManager,l;l=j.createListBox("styleselect",{title:"advanced.style_select",onselect:function(o){var p,n=[];f(l.items,function(q){n.push(q.value)});i.focus();i.undoManager.add();p=i.formatter.matchAll(n);if(!o||p[0]==o){if(p[0]){i.formatter.remove(p[0])}}else{i.formatter.apply(o)}i.undoManager.add();i.nodeChanged();return false}});i.onInit.add(function(){var o=0,n=i.getParam("style_formats");if(n){f(n,function(p){var q,r=0;f(p,function(){r++});if(r>1){q=p.name=p.name||"style_"+(o++);i.formatter.register(q,p);l.add(p.title,q)}else{l.add(p.title)}})}else{f(i.getParam("theme_advanced_styles","","hash"),function(r,q){var p;if(r){p="style_"+(o++);i.formatter.register(p,{inline:"span",classes:r,selector:"*"});l.add(k.editor.translate(q),p)}})}});if(l.getLength()==0){l.onPostRender.add(function(o,p){if(!l.NativeListBox){b.add(p.id+"_text","focus",k._importClasses,k);b.add(p.id+"_text","mousedown",k._importClasses,k);b.add(p.id+"_open","focus",k._importClasses,k);b.add(p.id+"_open","mousedown",k._importClasses,k)}else{b.add(p.id,"focus",k._importClasses,k)}})}return l},_createFontSelect:function(){var k,j=this,i=j.editor;k=i.controlManager.createListBox("fontselect",{title:"advanced.fontdefault",onselect:function(l){var m=k.items[k.selectedIndex];if(!l&&m){i.execCommand("FontName",false,m.value);return}i.execCommand("FontName",false,l);k.select(function(n){return l==n});if(m&&m.value==l){k.select(null)}return false}});if(k){f(i.getParam("theme_advanced_fonts",j.settings.theme_advanced_fonts,"hash"),function(m,l){k.add(i.translate(l),m,{style:m.indexOf("dings")==-1?"font-family:"+m:""})})}return k},_createFontSizeSelect:function(){var m=this,k=m.editor,n,l=0,j=[];n=k.controlManager.createListBox("fontsizeselect",{title:"advanced.font_size",onselect:function(i){var o=n.items[n.selectedIndex];if(!i&&o){o=o.value;if(o["class"]){k.formatter.toggle("fontsize_class",{value:o["class"]});k.undoManager.add();k.nodeChanged()}else{k.execCommand("FontSize",false,o.fontSize)}return}if(i["class"]){k.focus();k.undoManager.add();k.formatter.toggle("fontsize_class",{value:i["class"]});k.undoManager.add();k.nodeChanged()}else{k.execCommand("FontSize",false,i.fontSize)}n.select(function(p){return i==p});if(o&&(o.value.fontSize==i.fontSize||o.value["class"]==i["class"])){n.select(null)}return false}});if(n){f(m.settings.theme_advanced_font_sizes,function(o,i){var p=o.fontSize;if(p>=1&&p<=7){p=m.sizes[parseInt(p)-1]+"pt"}n.add(i,o,{style:"font-size:"+p,"class":"mceFontSize"+(l++)+(" "+(o["class"]||""))})})}return n},_createBlockFormats:function(){var k,i={p:"advanced.paragraph",address:"advanced.address",pre:"advanced.pre",h1:"advanced.h1",h2:"advanced.h2",h3:"advanced.h3",h4:"advanced.h4",h5:"advanced.h5",h6:"advanced.h6",div:"advanced.div",blockquote:"advanced.blockquote",code:"advanced.code",dt:"advanced.dt",dd:"advanced.dd",samp:"advanced.samp"},j=this;k=j.editor.controlManager.createListBox("formatselect",{title:"advanced.block",onselect:function(l){j.editor.execCommand("FormatBlock",false,l);return false}});if(k){f(j.editor.getParam("theme_advanced_blockformats",j.settings.theme_advanced_blockformats,"hash"),function(m,l){k.add(j.editor.translate(l!=m?l:i[m]),m,{"class":"mce_formatPreview mce_"+m})})}return k},_createForeColorMenu:function(){var m,j=this,k=j.settings,l={},i;if(k.theme_advanced_more_colors){l.more_colors_func=function(){j._mceColorPicker(0,{color:m.value,func:function(n){m.setColor(n)}})}}if(i=k.theme_advanced_text_colors){l.colors=i}if(k.theme_advanced_default_foreground_color){l.default_color=k.theme_advanced_default_foreground_color}l.title="advanced.forecolor_desc";l.cmd="ForeColor";l.scope=this;m=j.editor.controlManager.createColorSplitButton("forecolor",l);return m},_createBackColorMenu:function(){var m,j=this,k=j.settings,l={},i;if(k.theme_advanced_more_colors){l.more_colors_func=function(){j._mceColorPicker(0,{color:m.value,func:function(n){m.setColor(n)}})}}if(i=k.theme_advanced_background_colors){l.colors=i}if(k.theme_advanced_default_background_color){l.default_color=k.theme_advanced_default_background_color}l.title="advanced.backcolor_desc";l.cmd="HiliteColor";l.scope=this;m=j.editor.controlManager.createColorSplitButton("backcolor",l);return m},renderUI:function(k){var m,l,q,v=this,r=v.editor,w=v.settings,u,j,i;if(r.settings){r.settings.aria_label=w.aria_label+r.getLang("advanced.help_shortcut")}m=j=d.create("span",{role:"application","aria-labelledby":r.id+"_voice",id:r.id+"_parent","class":"mceEditor "+r.settings.skin+"Skin"+(w.skin_variant?" "+r.settings.skin+"Skin"+v._ufirst(w.skin_variant):"")});d.add(m,"span",{"class":"mceVoiceLabel",style:"display:none;",id:r.id+"_voice"},w.aria_label);if(!d.boxModel){m=d.add(m,"div",{"class":"mceOldBoxModel"})}m=u=d.add(m,"table",{role:"presentation",id:r.id+"_tbl","class":"mceLayout",cellSpacing:0,cellPadding:0});m=q=d.add(m,"tbody");switch((w.theme_advanced_layout_manager||"").toLowerCase()){case"rowlayout":l=v._rowLayout(w,q,k);break;case"customlayout":l=r.execCallback("theme_advanced_custom_layout",w,q,k,j);break;default:l=v._simpleLayout(w,q,k,j)}m=k.targetNode;i=u.rows;d.addClass(i[0],"mceFirst");d.addClass(i[i.length-1],"mceLast");f(d.select("tr",q),function(o){d.addClass(o.firstChild,"mceFirst");d.addClass(o.childNodes[o.childNodes.length-1],"mceLast")});if(d.get(w.theme_advanced_toolbar_container)){d.get(w.theme_advanced_toolbar_container).appendChild(j)}else{d.insertAfter(j,m)}b.add(r.id+"_path_row","click",function(n){n=n.target;if(n.nodeName=="A"){v._sel(n.className.replace(/^.*mcePath_([0-9]+).*$/,"$1"));return b.cancel(n)}});if(!r.getParam("accessibility_focus")){b.add(d.add(j,"a",{href:"#"},""),"focus",function(){tinyMCE.get(r.id).focus()})}if(w.theme_advanced_toolbar_location=="external"){k.deltaHeight=0}v.deltaHeight=k.deltaHeight;k.targetNode=null;r.onKeyDown.add(function(p,n){var s=121,o=122;if(n.altKey){if(n.keyCode===s){if(e.isWebKit){window.focus()}v.toolbarGroup.focus();return b.cancel(n)}else{if(n.keyCode===o){d.get(p.id+"_path_row").focus();return b.cancel(n)}}}});r.addShortcut("alt+0","","mceShortcuts",v);return{iframeContainer:l,editorContainer:r.id+"_parent",sizeContainer:u,deltaHeight:k.deltaHeight}},getInfo:function(){return{longname:"Advanced theme",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",version:e.majorVersion+"."+e.minorVersion}},resizeBy:function(i,j){var k=d.get(this.editor.id+"_ifr");this.resizeTo(k.clientWidth+i,k.clientHeight+j)},resizeTo:function(i,m,k){var j=this.editor,l=this.settings,n=d.get(j.id+"_tbl"),o=d.get(j.id+"_ifr");i=Math.max(l.theme_advanced_resizing_min_width||100,i);m=Math.max(l.theme_advanced_resizing_min_height||100,m);i=Math.min(l.theme_advanced_resizing_max_width||65535,i);m=Math.min(l.theme_advanced_resizing_max_height||65535,m);d.setStyle(n,"height","");d.setStyle(o,"height",m);if(l.theme_advanced_resize_horizontal){d.setStyle(n,"width","");d.setStyle(o,"width",i);if(i"));d.setHTML(l,q.join(""))},_addStatusBar:function(m,j){var k,v=this,p=v.editor,w=v.settings,i,q,u,l;k=d.add(m,"tr");k=l=d.add(k,"td",{"class":"mceStatusbar"});k=d.add(k,"div",{id:p.id+"_path_row",role:"group","aria-labelledby":p.id+"_path_voice"});if(w.theme_advanced_path){d.add(k,"span",{id:p.id+"_path_voice"},p.translate("advanced.path"));d.add(k,"span",{},": ")}else{d.add(k,"span",{}," ")}if(w.theme_advanced_resizing){d.add(l,"a",{id:p.id+"_resize",href:"javascript:;",onclick:"return false;","class":"mceResize",tabIndex:"-1"});if(w.theme_advanced_resizing_use_cookie){p.onPostRender.add(function(){var n=a.getHash("TinyMCE_"+p.id+"_size"),r=d.get(p.id+"_tbl");if(!n){return}v.resizeTo(n.cw,n.ch)})}p.onPostRender.add(function(){b.add(p.id+"_resize","click",function(n){n.preventDefault()});b.add(p.id+"_resize","mousedown",function(D){var t,r,s,o,C,z,A,F,n,E,x;function y(G){G.preventDefault();n=A+(G.screenX-C);E=F+(G.screenY-z);v.resizeTo(n,E)}function B(G){b.remove(d.doc,"mousemove",t);b.remove(p.getDoc(),"mousemove",r);b.remove(d.doc,"mouseup",s);b.remove(p.getDoc(),"mouseup",o);n=A+(G.screenX-C);E=F+(G.screenY-z);v.resizeTo(n,E,true)}D.preventDefault();C=D.screenX;z=D.screenY;x=d.get(v.editor.id+"_ifr");A=n=x.clientWidth;F=E=x.clientHeight;t=b.add(d.doc,"mousemove",y);r=b.add(p.getDoc(),"mousemove",y);s=b.add(d.doc,"mouseup",B);o=b.add(p.getDoc(),"mouseup",B)})})}j.deltaHeight-=21;k=m=null},_updateUndoStatus:function(j){var i=j.controlManager,k=j.undoManager;i.setDisabled("undo",!k.hasUndo()&&!k.typing);i.setDisabled("redo",!k.hasRedo())},_nodeChanged:function(m,r,D,q,E){var y=this,C,F=0,x,G,z=y.settings,w,k,u,B,l,j,i;e.each(y.stateControls,function(n){r.setActive(n,m.queryCommandState(y.controls[n][1]))});function o(p){var s,n=E.parents,t=p;if(typeof(p)=="string"){t=function(v){return v.nodeName==p}}for(s=0;s0){y.statusKeyboardNavigation=new e.ui.KeyboardNavigation({root:m.id+"_path_row",items:d.select("a",C),excludeFromTabOrder:true,onCancel:function(){m.focus()}},d)}}},_sel:function(i){this.editor.execCommand("mceSelectNodeDepth",false,i)},_mceInsertAnchor:function(k,j){var i=this.editor;i.windowManager.open({url:this.url+"/anchor.htm",width:320+parseInt(i.getLang("advanced.anchor_delta_width",0)),height:90+parseInt(i.getLang("advanced.anchor_delta_height",0)),inline:true},{theme_url:this.url})},_mceCharMap:function(){var i=this.editor;i.windowManager.open({url:this.url+"/charmap.htm",width:550+parseInt(i.getLang("advanced.charmap_delta_width",0)),height:260+parseInt(i.getLang("advanced.charmap_delta_height",0)),inline:true},{theme_url:this.url})},_mceHelp:function(){var i=this.editor;i.windowManager.open({url:this.url+"/about.htm",width:480,height:380,inline:true},{theme_url:this.url})},_mceShortcuts:function(){var i=this.editor;i.windowManager.open({url:this.url+"/shortcuts.htm",width:480,height:380,inline:true},{theme_url:this.url})},_mceColorPicker:function(k,j){var i=this.editor;j=j||{};i.windowManager.open({url:this.url+"/color_picker.htm",width:375+parseInt(i.getLang("advanced.colorpicker_delta_width",0)),height:250+parseInt(i.getLang("advanced.colorpicker_delta_height",0)),close_previous:false,inline:true},{input_color:j.color,func:j.func,theme_url:this.url})},_mceCodeEditor:function(j,k){var i=this.editor;i.windowManager.open({url:this.url+"/source_editor.htm",width:parseInt(i.getParam("theme_advanced_source_editor_width",720)),height:parseInt(i.getParam("theme_advanced_source_editor_height",580)),inline:true,resizable:true,maximizable:true},{theme_url:this.url})},_mceImage:function(j,k){var i=this.editor;if(i.dom.getAttrib(i.selection.getNode(),"class").indexOf("mceItem")!=-1){return}i.windowManager.open({url:this.url+"/image.htm",width:355+parseInt(i.getLang("advanced.image_delta_width",0)),height:275+parseInt(i.getLang("advanced.image_delta_height",0)),inline:true},{theme_url:this.url})},_mceLink:function(j,k){var i=this.editor;i.windowManager.open({url:this.url+"/link.htm",width:310+parseInt(i.getLang("advanced.link_delta_width",0)),height:200+parseInt(i.getLang("advanced.link_delta_height",0)),inline:true},{theme_url:this.url})},_mceNewDocument:function(){var i=this.editor;i.windowManager.confirm("advanced.newdocument",function(j){if(j){i.execCommand("mceSetContent",false,"")}})},_mceForeColor:function(){var i=this;this._mceColorPicker(0,{color:i.fgColor,func:function(j){i.fgColor=j;i.editor.execCommand("ForeColor",false,j)}})},_mceBackColor:function(){var i=this;this._mceColorPicker(0,{color:i.bgColor,func:function(j){i.bgColor=j;i.editor.execCommand("HiliteColor",false,j)}})},_ufirst:function(i){return i.substring(0,1).toUpperCase()+i.substring(1)}});e.ThemeManager.add("advanced",e.themes.AdvancedTheme)}(tinymce)); \ No newline at end of file diff --git a/js/tiny_mce/themes/advanced/editor_template_src.js b/js/tiny_mce/themes/advanced/editor_template_src.js index 279ca359ce..a3713b29e3 100644 --- a/js/tiny_mce/themes/advanced/editor_template_src.js +++ b/js/tiny_mce/themes/advanced/editor_template_src.js @@ -66,6 +66,9 @@ t.url = url; t.onResolveName = new tinymce.util.Dispatcher(this); + ed.forcedHighContrastMode = ed.settings.detect_highcontrast && t._isHighContrast(); + ed.settings.skin = ed.forcedHighContrastMode ? 'highcontrast' : ed.settings.skin; + // Default settings t.settings = s = extend({ theme_advanced_path : true, @@ -81,6 +84,8 @@ theme_advanced_resize_horizontal : 1, theme_advanced_resizing_use_cookie : 1, theme_advanced_font_sizes : "1,2,3,4,5,6,7", + theme_advanced_font_selector : "span", + theme_advanced_show_current_color: 0, readonly : ed.settings.readonly }, ed.settings); @@ -119,13 +124,19 @@ if (s.theme_advanced_statusbar_location == 'none') s.theme_advanced_statusbar_location = 0; + if (ed.settings.content_css !== false) + ed.contentCSS.push(ed.baseURI.toAbsolute(url + "/skins/" + ed.settings.skin + "/content.css")); + // Init editor ed.onInit.add(function() { - if (!ed.settings.readonly) + if (!ed.settings.readonly) { ed.onNodeChange.add(t._nodeChanged, t); - - if (ed.settings.content_css !== false) - ed.dom.loadCSS(ed.baseURI.toAbsolute("themes/advanced/skins/" + ed.settings.skin + "/content.css")); + ed.onKeyUp.add(t._updateUndoStatus, t); + ed.onMouseUp.add(t._updateUndoStatus, t); + ed.dom.bind(ed.dom.getRoot(), 'dragend', function() { + t._updateUndoStatus(ed); + }); + } }); ed.onSetProgressState.add(function(ed, b, ti) { @@ -153,6 +164,15 @@ DOM.loadCSS(url + "/skins/" + ed.settings.skin + "/ui_" + s.skin_variant + ".css"); }, + _isHighContrast : function() { + var actualColor, div = DOM.add(DOM.getRoot(), 'div', {'style': 'background-color: rgb(171,239,86);'}); + + actualColor = (DOM.getStyle(div, 'background-color', true) + '').toLowerCase().replace(/ /g, ''); + DOM.remove(div); + + return actualColor != 'rgb(171,239,86)' && actualColor != '#abef56'; + }, + createControl : function(n, cf) { var cd, c; @@ -230,9 +250,10 @@ // Toggle off the current format matches = ed.formatter.matchAll(formatNames); - if (matches[0] == name) - ed.formatter.remove(name); - else + if (!name || matches[0] == name) { + if (matches[0]) + ed.formatter.remove(matches[0]); + } else ed.formatter.apply(name); ed.undoManager.add(); @@ -300,6 +321,13 @@ c = ed.controlManager.createListBox('fontselect', { title : 'advanced.fontdefault', onselect : function(v) { + var cur = c.items[c.selectedIndex]; + + if (!v && cur) { + ed.execCommand('FontName', false, cur.value); + return; + } + ed.execCommand('FontName', false, v); // Fake selection, execCommand will fire a nodeChange and update the selection @@ -307,6 +335,10 @@ return v == sv; }); + if (cur && cur.value == v) { + c.select(null); + } + return false; // No auto select } }); @@ -324,6 +356,22 @@ var t = this, ed = t.editor, c, i = 0, cl = []; c = ed.controlManager.createListBox('fontsizeselect', {title : 'advanced.font_size', onselect : function(v) { + var cur = c.items[c.selectedIndex]; + + if (!v && cur) { + cur = cur.value; + + if (cur['class']) { + ed.formatter.toggle('fontsize_class', {value : cur['class']}); + ed.undoManager.add(); + ed.nodeChanged(); + } else { + ed.execCommand('FontSize', false, cur.fontSize); + } + + return; + } + if (v['class']) { ed.focus(); ed.undoManager.add(); @@ -338,6 +386,10 @@ return v == sv; }); + if (cur && (cur.value.fontSize == v.fontSize || cur.value['class'] == v['class'])) { + c.select(null); + } + return false; // No auto select }}); @@ -374,7 +426,11 @@ samp : 'advanced.samp' }, t = this; - c = t.editor.controlManager.createListBox('formatselect', {title : 'advanced.block', cmd : 'FormatBlock'}); + c = t.editor.controlManager.createListBox('formatselect', {title : 'advanced.block', onselect : function(v) { + t.editor.execCommand('FormatBlock', false, v); + return false; + }}); + if (c) { each(t.editor.getParam('theme_advanced_blockformats', t.settings.theme_advanced_blockformats, 'hash'), function(v, k) { c.add(t.editor.translate(k != v ? k : fmts[v]), v, {'class' : 'mce_formatPreview mce_' + v}); @@ -445,12 +501,19 @@ renderUI : function(o) { var n, ic, tb, t = this, ed = t.editor, s = t.settings, sc, p, nl; - n = p = DOM.create('span', {id : ed.id + '_parent', 'class' : 'mceEditor ' + ed.settings.skin + 'Skin' + (s.skin_variant ? ' ' + ed.settings.skin + 'Skin' + t._ufirst(s.skin_variant) : '')}); + if (ed.settings) { + ed.settings.aria_label = s.aria_label + ed.getLang('advanced.help_shortcut'); + } + + // TODO: ACC Should have an aria-describedby attribute which is user-configurable to describe what this field is actually for. + // Maybe actually inherit it from the original textara? + n = p = DOM.create('span', {role : 'application', 'aria-labelledby' : ed.id + '_voice', id : ed.id + '_parent', 'class' : 'mceEditor ' + ed.settings.skin + 'Skin' + (s.skin_variant ? ' ' + ed.settings.skin + 'Skin' + t._ufirst(s.skin_variant) : '')}); + DOM.add(n, 'span', {'class': 'mceVoiceLabel', 'style': 'display:none;', id: ed.id + '_voice'}, s.aria_label); if (!DOM.boxModel) n = DOM.add(n, 'div', {'class' : 'mceOldBoxModel'}); - n = sc = DOM.add(n, 'table', {id : ed.id + '_tbl', 'class' : 'mceLayout', cellSpacing : 0, cellPadding : 0}); + n = sc = DOM.add(n, 'table', {role : "presentation", id : ed.id + '_tbl', 'class' : 'mceLayout', cellSpacing : 0, cellPadding : 0}); n = tb = DOM.add(n, 'tbody'); switch ((s.theme_advanced_layout_manager || '').toLowerCase()) { @@ -469,7 +532,7 @@ n = o.targetNode; // Add classes to first and last TRs - nl = DOM.stdMode ? sc.getElementsByTagName('tr') : sc.rows; // Quick fix for IE 8 + nl = sc.rows; DOM.addClass(nl[0], 'mceFirst'); DOM.addClass(nl[nl.length - 1], 'mceLast'); @@ -525,6 +588,28 @@ t.deltaHeight = o.deltaHeight; o.targetNode = null; + ed.onKeyDown.add(function(ed, evt) { + var DOM_VK_F10 = 121, DOM_VK_F11 = 122; + + if (evt.altKey) { + if (evt.keyCode === DOM_VK_F10) { + // Make sure focus is given to toolbar in Safari. + // We can't do this in IE as it prevents giving focus to toolbar when editor is in a frame + if (tinymce.isWebKit) { + window.focus(); + } + t.toolbarGroup.focus(); + return Event.cancel(evt); + } else if (evt.keyCode === DOM_VK_F11) { + DOM.get(ed.id + '_path_row').focus(); + return Event.cancel(evt); + } + } + }); + + // alt+0 is the UK recommended shortcut for accessing the list of access controls. + ed.addShortcut('alt+0', '', 'mceShortcuts', t); + return { iframeContainer : ic, editorContainer : ed.id + '_parent', @@ -543,12 +628,12 @@ }, resizeBy : function(dw, dh) { - var e = DOM.get(this.editor.id + '_tbl'); + var e = DOM.get(this.editor.id + '_ifr'); this.resizeTo(e.clientWidth + dw, e.clientHeight + dh); }, - resizeTo : function(w, h) { + resizeTo : function(w, h, store) { var ed = this.editor, s = this.settings, e = DOM.get(ed.id + '_tbl'), ifr = DOM.get(ed.id + '_ifr'); // Boundery fix box @@ -566,8 +651,18 @@ DOM.setStyle(ifr, 'width', w); // Make sure that the size is never smaller than the over all ui - if (w < e.clientWidth) + if (w < e.clientWidth) { + w = e.clientWidth; DOM.setStyle(ifr, 'width', e.clientWidth); + } + } + + // Store away the size + if (store && s.theme_advanced_resizing_use_cookie) { + Cookie.setHash("TinyMCE_" + ed.id + "_size", { + cw : w, + ch : h + }); } }, @@ -662,7 +757,7 @@ each(explode(s.theme_advanced_containers || ''), function(c, i) { var v = s['theme_advanced_container_' + c] || ''; - switch (v.toLowerCase()) { + switch (c.toLowerCase()) { case 'mceeditor': n = DOM.add(tb, 'tr'); n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'}); @@ -730,17 +825,19 @@ }, _addToolbars : function(c, o) { - var t = this, i, tb, ed = t.editor, s = t.settings, v, cf = ed.controlManager, di, n, h = [], a; + var t = this, i, tb, ed = t.editor, s = t.settings, v, cf = ed.controlManager, di, n, h = [], a, toolbarGroup; - a = s.theme_advanced_toolbar_align.toLowerCase(); - a = 'mce' + t._ufirst(a); + toolbarGroup = cf.createToolbarGroup('toolbargroup', { + 'name': ed.getLang('advanced.toolbar'), + 'tab_focus_toolbar':ed.getParam('theme_advanced_tab_focus_toolbar') + }); - n = DOM.add(DOM.add(c, 'tr'), 'td', {'class' : 'mceToolbar ' + a}); + t.toolbarGroup = toolbarGroup; - if (!ed.getParam('accessibility_focus')) - h.push(DOM.createHTML('a', {href : '#', onfocus : 'tinyMCE.get(\'' + ed.id + '\').focus();'}, '')); + a = s.theme_advanced_toolbar_align.toLowerCase(); + a = 'mce' + t._ufirst(a); - h.push(DOM.createHTML('a', {href : '#', accesskey : 'q', title : ed.getLang("advanced.toolbar_focus")}, '')); + n = DOM.add(DOM.add(c, 'tr', {role: 'presentation'}), 'td', {'class' : 'mceToolbar ' + a, "role":"presentation"}); // Create toolbar and add the controls for (i=1; (v = s['theme_advanced_buttons' + i]); i++) { @@ -753,13 +850,11 @@ v = s['theme_advanced_buttons' + i + '_add_before'] + ',' + v; t._addControls(v, tb); - - //n.appendChild(n = tb.render()); - h.push(tb.renderHTML()); + toolbarGroup.add(tb); o.deltaHeight -= s.theme_advanced_row_height; } - + h.push(toolbarGroup.renderHTML()); h.push(DOM.createHTML('a', {href : '#', accesskey : 'z', title : ed.getLang("advanced.toolbar_focus"), onfocus : 'tinyMCE.getInstanceById(\'' + ed.id + '\').focus();'}, '')); DOM.setHTML(n, h.join('')); }, @@ -768,12 +863,18 @@ var n, t = this, ed = t.editor, s = t.settings, r, mf, me, td; n = DOM.add(tb, 'tr'); - n = td = DOM.add(n, 'td', {'class' : 'mceStatusbar'}); - n = DOM.add(n, 'div', {id : ed.id + '_path_row'}, s.theme_advanced_path ? ed.translate('advanced.path') + ': ' : ' '); - DOM.add(n, 'a', {href : '#', accesskey : 'x'}); + n = td = DOM.add(n, 'td', {'class' : 'mceStatusbar'}); + n = DOM.add(n, 'div', {id : ed.id + '_path_row', 'role': 'group', 'aria-labelledby': ed.id + '_path_voice'}); + if (s.theme_advanced_path) { + DOM.add(n, 'span', {id: ed.id + '_path_voice'}, ed.translate('advanced.path')); + DOM.add(n, 'span', {}, ': '); + } else { + DOM.add(n, 'span', {}, ' '); + } + if (s.theme_advanced_resizing) { - DOM.add(td, 'a', {id : ed.id + '_resize', href : 'javascript:;', onclick : "return false;", 'class' : 'mceResize'}); + DOM.add(td, 'a', {id : ed.id + '_resize', href : 'javascript:;', onclick : "return false;", 'class' : 'mceResize', tabIndex:"-1"}); if (s.theme_advanced_resizing_use_cookie) { ed.onPostRender.add(function() { @@ -787,12 +888,18 @@ } ed.onPostRender.add(function() { + Event.add(ed.id + '_resize', 'click', function(e) { + e.preventDefault(); + }); + Event.add(ed.id + '_resize', 'mousedown', function(e) { var mouseMoveHandler1, mouseMoveHandler2, mouseUpHandler1, mouseUpHandler2, startX, startY, startWidth, startHeight, width, height, ifrElm; function resizeOnMove(e) { + e.preventDefault(); + width = startWidth + (e.screenX - startX); height = startHeight + (e.screenY - startY); @@ -806,13 +913,9 @@ Event.remove(DOM.doc, 'mouseup', mouseUpHandler1); Event.remove(ed.getDoc(), 'mouseup', mouseUpHandler2); - // Store away the size - if (s.theme_advanced_resizing_use_cookie) { - Cookie.setHash("TinyMCE_" + ed.id + "_size", { - cw : width, - ch : height - }); - } + width = startWidth + (e.screenX - startX); + height = startHeight + (e.screenY - startY); + t.resizeTo(width, height, true); }; e.preventDefault(); @@ -837,8 +940,15 @@ n = tb = null; }, + _updateUndoStatus : function(ed) { + var cm = ed.controlManager, um = ed.undoManager; + + cm.setDisabled('undo', !um.hasUndo() && !um.typing); + cm.setDisabled('redo', !um.hasRedo()); + }, + _nodeChanged : function(ed, cm, n, co, ob) { - var t = this, p, de = 0, v, c, s = t.settings, cl, fz, fn, formatNames, matches; + var t = this, p, de = 0, v, c, s = t.settings, cl, fz, fn, fc, bc, formatNames, matches; tinymce.each(t.stateControls, function(c) { cm.setActive(c, ed.queryCommandState(t.controls[c][1])); @@ -860,8 +970,7 @@ }; cm.setActive('visualaid', ed.hasVisual); - cm.setDisabled('undo', !ed.undoManager.hasUndo() && !ed.typing); - cm.setDisabled('redo', !ed.undoManager.hasRedo()); + t._updateUndoStatus(ed); cm.setDisabled('outdent', !ed.queryCommandState('Outdent')); p = getParent('A'); @@ -878,12 +987,12 @@ } if (c = cm.get('anchor')) { - c.setActive(!!p && p.name); + c.setActive(!co && !!p && p.name); } p = getParent('IMG'); if (c = cm.get('image')) - c.setActive(!!p && n.className.indexOf('mceItem') == -1); + c.setActive(!co && !!p && n.className.indexOf('mceItem') == -1); if (c = cm.get('styleselect')) { t._importClasses(); @@ -909,12 +1018,20 @@ if (n.nodeName === 'SPAN') { if (!cl && n.className) cl = n.className; + } + if (ed.dom.is(n, s.theme_advanced_font_selector)) { if (!fz && n.style.fontSize) fz = n.style.fontSize; if (!fn && n.style.fontFamily) fn = n.style.fontFamily.replace(/[\"\']+/g, '').replace(/^([^,]+).*/, '$1').toLowerCase(); + + if (!fc && n.style.color) + fc = n.style.color; + + if (!bc && n.style.backgroundColor) + bc = n.style.backgroundColor; } return false; @@ -940,25 +1057,53 @@ return true; }); } + + if (s.theme_advanced_show_current_color) { + function updateColor(controlId, color) { + if (c = cm.get(controlId)) { + if (!color) + color = c.settings.default_color; + if (color !== c.value) { + c.displayColor(color); + } + } + } + updateColor('forecolor', fc); + updateColor('backcolor', bc); + } + + if (s.theme_advanced_show_current_color) { + function updateColor(controlId, color) { + if (c = cm.get(controlId)) { + if (!color) + color = c.settings.default_color; + if (color !== c.value) { + c.displayColor(color); + } + } + }; + + updateColor('forecolor', fc); + updateColor('backcolor', bc); + } if (s.theme_advanced_path && s.theme_advanced_statusbar_location) { p = DOM.get(ed.id + '_path') || DOM.add(ed.id + '_path_row', 'span', {id : ed.id + '_path'}); + + if (t.statusKeyboardNavigation) { + t.statusKeyboardNavigation.destroy(); + t.statusKeyboardNavigation = null; + } + DOM.setHTML(p, ''); getParent(function(n) { var na = n.nodeName.toLowerCase(), u, pi, ti = ''; - /*if (n.getAttribute('_mce_bogus')) - return; -*/ - // Ignore non element and hidden elements - if (n.nodeType != 1 || n.nodeName === 'BR' || (DOM.hasClass(n, 'mceItemHidden') || DOM.hasClass(n, 'mceItemRemoved'))) + // Ignore non element and bogus/hidden elements + if (n.nodeType != 1 || na === 'br' || n.getAttribute('data-mce-bogus') || DOM.hasClass(n, 'mceItemHidden') || DOM.hasClass(n, 'mceItemRemoved')) return; - // Fake name - if (v = DOM.getAttrib(n, 'mce_name')) - na = v; - // Handle prefix if (tinymce.isIE && n.scopeName !== 'HTML') na = n.scopeName + ':' + na; @@ -1033,14 +1178,25 @@ na = na.name; //u = "javascript:tinymce.EditorManager.get('" + ed.id + "').theme._sel('" + (de++) + "');"; - pi = DOM.create('a', {'href' : "javascript:;", onmousedown : "return false;", title : ti, 'class' : 'mcePath_' + (de++)}, na); + pi = DOM.create('a', {'href' : "javascript:;", role: 'button', onmousedown : "return false;", title : ti, 'class' : 'mcePath_' + (de++)}, na); if (p.hasChildNodes()) { - p.insertBefore(DOM.doc.createTextNode(' \u00bb '), p.firstChild); + p.insertBefore(DOM.create('span', {'aria-hidden': 'true'}, '\u00a0\u00bb '), p.firstChild); p.insertBefore(pi, p.firstChild); } else p.appendChild(pi); }, ed.getBody()); + + if (DOM.select('a', p).length > 0) { + t.statusKeyboardNavigation = new tinymce.ui.KeyboardNavigation({ + root: ed.id + "_path_row", + items: DOM.select('a', p), + excludeFromTabOrder: true, + onCancel: function() { + ed.focus(); + } + }, DOM); + } } }, @@ -1054,7 +1210,7 @@ var ed = this.editor; ed.windowManager.open({ - url : tinymce.baseURL + '/themes/advanced/anchor.htm', + url : this.url + '/anchor.htm', width : 320 + parseInt(ed.getLang('advanced.anchor_delta_width', 0)), height : 90 + parseInt(ed.getLang('advanced.anchor_delta_height', 0)), inline : true @@ -1067,9 +1223,9 @@ var ed = this.editor; ed.windowManager.open({ - url : tinymce.baseURL + '/themes/advanced/charmap.htm', + url : this.url + '/charmap.htm', width : 550 + parseInt(ed.getLang('advanced.charmap_delta_width', 0)), - height : 250 + parseInt(ed.getLang('advanced.charmap_delta_height', 0)), + height : 260 + parseInt(ed.getLang('advanced.charmap_delta_height', 0)), inline : true }, { theme_url : this.url @@ -1080,7 +1236,7 @@ var ed = this.editor; ed.windowManager.open({ - url : tinymce.baseURL + '/themes/advanced/about.htm', + url : this.url + '/about.htm', width : 480, height : 380, inline : true @@ -1089,13 +1245,25 @@ }); }, + _mceShortcuts : function() { + var ed = this.editor; + ed.windowManager.open({ + url: this.url + '/shortcuts.htm', + width: 480, + height: 380, + inline: true + }, { + theme_url: this.url + }); + }, + _mceColorPicker : function(u, v) { var ed = this.editor; v = v || {}; ed.windowManager.open({ - url : tinymce.baseURL + '/themes/advanced/color_picker.htm', + url : this.url + '/color_picker.htm', width : 375 + parseInt(ed.getLang('advanced.colorpicker_delta_width', 0)), height : 250 + parseInt(ed.getLang('advanced.colorpicker_delta_height', 0)), close_previous : false, @@ -1111,7 +1279,7 @@ var ed = this.editor; ed.windowManager.open({ - url : tinymce.baseURL + '/themes/advanced/source_editor.htm', + url : this.url + '/source_editor.htm', width : parseInt(ed.getParam("theme_advanced_source_editor_width", 720)), height : parseInt(ed.getParam("theme_advanced_source_editor_height", 580)), inline : true, @@ -1130,7 +1298,7 @@ return; ed.windowManager.open({ - url : tinymce.baseURL + '/themes/advanced/image.htm', + url : this.url + '/image.htm', width : 355 + parseInt(ed.getLang('advanced.image_delta_width', 0)), height : 275 + parseInt(ed.getLang('advanced.image_delta_height', 0)), inline : true @@ -1143,7 +1311,7 @@ var ed = this.editor; ed.windowManager.open({ - url : tinymce.baseURL + '/themes/advanced/link.htm', + url : this.url + '/link.htm', width : 310 + parseInt(ed.getLang('advanced.link_delta_width', 0)), height : 200 + parseInt(ed.getLang('advanced.link_delta_height', 0)), inline : true @@ -1191,4 +1359,4 @@ }); tinymce.ThemeManager.add('advanced', tinymce.themes.AdvancedTheme); -}(tinymce)); \ No newline at end of file +}(tinymce)); diff --git a/js/tiny_mce/themes/advanced/image.htm b/js/tiny_mce/themes/advanced/image.htm index f30d670641..b8ba729f6f 100644 --- a/js/tiny_mce/themes/advanced/image.htm +++ b/js/tiny_mce/themes/advanced/image.htm @@ -17,57 +17,57 @@
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - -
     
    - x -
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + +
     
    + x +
    diff --git a/js/tiny_mce/themes/advanced/img/colorpicker.jpg b/js/tiny_mce/themes/advanced/img/colorpicker.jpg index b4c542d107b25f68a9d4f9d7a109d0565d1f1437..b1a377aba7784d3a0a0fabb4d22b8114cde25ace 100644 GIT binary patch delta 2365 zcmYjO3pmqzAD>I9aMlowjp#C>)aEu~#cYyDxlQJt%Q?biYTo#tN~-`!P7ZFtr#nbAadE%ze9HDSzJMmFK4-1(Z9?%`+We=EjEv|W8 z!>fdSp#4VT&;i*tOEuLrFX!SvV5H)yQ$M{NTKU}Rsefh3dVL?o0U74_i)ZpjwWnX6 z6^GWUCyvDw8vI51WW6>*;PC!a;G{L3-)U)nS4+Mz!|^Nm96;x!$DzG3Jg0jb`V-hT z!RX58Qg_~Hsn)#>vYGK5Cq(JfK-%aRXp7MeN&Rl53iw{+L-+)W-WD?_Gv)rlC}&nC zch!w<-^aJ@-bXR16@ZXoZ~3np zHkJWU^yj*MC@S4CIAgtc)vERJ4#=w=c+x!dem~k9`*nt*JjoffY`OboyxPRP%Mp{o z3Is?qbu6n_(|p={5t(PxygI_$Ki%gJ3y86r22ZDXMbgbic+$jl@tct8aDGX^P8!5py0G(Y*e#hDL&adl}yF;&k=#MEQU?%wx7lj zg^D@iej=|$udQ;j$Y1u^zY&>rQP;i^ny}sb(MkyS^{Avxui{9St*d5QRuoe&vw$RE zP`P<}Ncy#QG=nPKM&5dVQ)wId<$bVOT??<&g0+x8xGtRC`12NY#>OFV_7*T09&zsL z$6JHpw~f9AFw<)B2$mIpy3fZdjzLS$Uyis3_x*H`v6FzN8P#9b2*N+pXh^Jp%< zz3=id_o{p`@dx!kNv6xdkh)!+r};VKp+81TQAtfJA$uPhjO16p$i=Pcb7qyFpUFM6 zXh>#7zZRNa?>}H--9-52_OSz4;D6Tgn<8GBk53x#-fy?Vuk56y^f59&d*(4bIYY00ZBdgfF#EuHHg( z-H;=%Gix(awxAypdOXi&u4L12N-yjqU%m}^LZL(2_cEC<8=?3Qff&iq${y@ zFYHZ8Zl6w}eQ6eK8+tW>tIlYTPzL6W=f4C+-eHM4GYxNYlbW?m2 zv%;g{S-F$|HG>Ed?QTs_%o#rHlh>vpG*rZ=ylRM7Kmr#65dLy#i?anDgQ}X^;>1~a zZck+}Q?VO0g;EfAEp%qzo>G;58DemHBwt@`H_tIb8QH%QjPuY;jrPuQ!_bXa>PS7+ zCaQ@Ogwiw)olB};8EQHb>)b?dAkC*9Dowu-4yq4o<8-aFiScSxs4FtRc(Q-wxKz27 zg8-xRADQKrR~tN^f`sQKX+|{ke1E0!^Nb3+(;j2w+`+fii%N0+&WuEHDS8DAKHlaS z?@2h$5%-+CDxab-pzt_@k!kV?6?MVcFOQ$hIR57;Sl-?!Z69h&Q7|G%A8m?u9*e&r zv8C|x7SsYfkkF6fbj*S|J;oOV@lt?q7_wswj0>wIQfvBT{NfXtsWp~R|5lk0ZtYmw zVZ^~LREbm!M)7dv7)Hg??v$Y7P_cU8uNZZ|D~e&mWU*ohW?@;);f?foEc?f5;ZjJU zlE9PwF=ZG1AgWk8uIO{K=)!MuCud}f7F~2$QoVYYmf~m$^t~}|b8Ut|v1?*G-R$Dx$TjdIOKcDK;mX@fH`!@w!LQ-p7}+gw+iH%#vd;c^>d>F zTrft9^Z7>o^Na*_ASiuZtWgMXI(|P{*mbX7wR~uTn{WVIZ^Hhifeczd?%Cc|P@jj4 z)cR==&S_jt*^-;slnb4tpqEkHb@wsy^*$YHECM(8+}PzN5^<#fmu9`LUSX0I^wtI$ z!!65Z1qrEnu+%&ix`kWiZaTea-x6IC~5 z*wI#uCo1&6l8=0_Yo?zsNR-n(!giGee;g)2ri9}6Xu!9b(LNjQ8&3CV7Oo+Hu!Kys@+D&1vNPYp$8X7kaM9`Kwp~Cx%94s{@0{2Sd9bYI*FY>E8Af!vsJOb`u+5UM zQ3W)7!-xd3PPi+Q-20;M#SNhvQcrH%T^RT1gzUYCM1*5pj*Cm`e4HUWKD9zl@;9b1 zEqikpFxXJ5j(H-uWIi9e2`<5UXf)auA+U?>!}WM`GpDrz$paBOarF7Yf-;CXS^$BV zBkb_-GlLW_p39MxymIwAl(O(=8lXK?9#&m!xHS`JOpBa W2*l#|Pa-Y~b(9+&nY$I(8UGuz^kRPi literal 3189 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 diff --git a/js/tiny_mce/themes/advanced/img/flash.gif b/js/tiny_mce/themes/advanced/img/flash.gif new file mode 100644 index 0000000000000000000000000000000000000000..dec3f7c7028df98657860529461af29b8793601c GIT binary patch literal 239 zcmVM~p;I&fgwbZVtlRJPxC7uw?yFxEX;uVr4IeWCJ^(5m4hjYVM>G^+2V)FnXE$mS p86yHh03AmHCKD}bWutOkFce4&0zF5CG_Myp4hRT+ig>^g06S0cRV@Gj literal 0 HcmV?d00001 diff --git a/js/tiny_mce/themes/advanced/img/icons.gif b/js/tiny_mce/themes/advanced/img/icons.gif index e46de5333082869b9bdab2576a554a2f9d01a966..641a9e3d314f4ea051692a2274aeb281456f5df9 100644 GIT binary patch delta 5712 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 F{{atF+}!{G delta 5709 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 K-wuZXHvA7eh13lI diff --git a/js/tiny_mce/themes/advanced/img/iframe.gif b/js/tiny_mce/themes/advanced/img/iframe.gif new file mode 100644 index 0000000000000000000000000000000000000000..410c7ad084db698e9f35e3230233aa4040682566 GIT binary patch literal 600 zcmZ?wbhEHb6krfwcoxm@|NsB$<##6SeDUYszh8g<{{H*-%a7k_-3KZc-T3+YPwBiX zzyAIE^Y`z!U%$Wp{QdX;|FQ*Fw;jIy{pasbUw?o3{yVB>Q_sRgx-G9iegFLZcfrha#d9w;%sU=Zx~6K$tw~$%z4`#O^Y@3Z zKV#~)MpSKh@#b63l#}6=>yq2|{`&JLqwny)|NnC)o%r$l&-Y)yKYjo8?#quSuRaGB zt_&<%`RV)bl#YEr{`~p)?RU|v^Y1_Z`u*?Ux8J`*N>>+5JlMAOZr+qr@y$D{mfVhO z+zt#7208-8pDc_F4ABfaAUi>E!oa?@A-bu#r8Qd6oKeb*Lx9UTz)0QBL@+vxY38ii zvqGa87c5+~h&?)zVa3W-D;=U$88}^qMBJ^ERU|z17!;#97+4%Rd1XcXJq#>t8KR;E z7zr5i6BgH5y=gAD)sAQlGB zh8au?j!n~E(Pks?@!j1fR&j*RWY8GF(-=x H6d0@lT&58X literal 0 HcmV?d00001 diff --git a/js/tiny_mce/themes/advanced/img/pagebreak.gif b/js/tiny_mce/themes/advanced/img/pagebreak.gif new file mode 100644 index 0000000000000000000000000000000000000000..acdf4085f3068c4c0a1d6855f4b80dae8bac3068 GIT binary patch literal 325 zcmV-L0lNN2Nk%w1VPpUd0J9GO`>v<{=;ru;boX6P{`2zsmyZ3>&HK5t_;hIbi-G;z z+4`cI{KdfcXj}GCLjV8&A^8LW000jFEC2ui0Av6R000E?@X1N5y*TU5yZ>M)j$|1M z4Ouvb$pHu>IW8BZq|n;U0s@T!VM5~w1_+1X!EiVl!&PITYdjT!ffYfpt{jAfv%qvh zA63WUHSlr7LkeyaV4(pM0f50(II?RD4RtMg4-E+tFhdAy5{3c=0}3Bg9Y8`B2To20 zR%SO62L%9}0H+dzoKB$+2TOwzUrwi{XiBM^4V#>63q3!LsU3u93zH8CdwqY%62;1g z0g8ze$k93lWExp`CUe|K4qOWk17ZeJ0|5pDP6+}};{>bI@lOWj=kf}r2sHp7w9-Ie XK%9UG6W(*AX-vY05F<*&5CH%?Gwy&_ literal 0 HcmV?d00001 diff --git a/js/tiny_mce/themes/advanced/img/quicktime.gif b/js/tiny_mce/themes/advanced/img/quicktime.gif new file mode 100644 index 0000000000000000000000000000000000000000..8f10e7aa6b6ab40ee69a1a41a961c092168d6fda GIT binary patch literal 301 zcmV+|0n+|QNk%w1VGsZi0Q4UK+~)L6v+~s9^fsC5ZpZP=*zu3F=Jxpf8k_5u%JNv6 z=md-84VLU4w)kSE=yI&-yw>b=v+SqE?+kq47pC+YrR?bJ^yu>Zyvpn;hTp*6^mM!O zu+8!}sO$`q%8%`=C5EEn#1d#z95FHtK5(^#(cp^e+Y!d=4FCrFbY9A3U z4-O0-4kHJPJ2(jk13n5879s!!3Q`V>8VwW`9my3H#|R8ZD+fdx0E-+693cQZ;!k;* literal 0 HcmV?d00001 diff --git a/js/tiny_mce/themes/advanced/img/realmedia.gif b/js/tiny_mce/themes/advanced/img/realmedia.gif new file mode 100644 index 0000000000000000000000000000000000000000..fdfe0b9ac05869ae845fdd828eaad97cc0c69dbc GIT binary patch literal 439 zcmV;o0Z9HwNk%w1VI=?(0K^{vQcz8xz}f&njBB06v9GQ`Jv%NdDHCI&z`wqZw$(Lw zuFTBL!Pe#<92tv>h)9OE1Xh}vnVEHSaeb-GByg#tqM_B*)YRkdSdqTu&}n`s(k;lb>H+`#+Q6|3c{>OLTv23;utm>DSfy zuOD3adm!iUuGar)4FAhzel5=UwZ7*6(K(+k@BP_g{o}}@k7u_2k7W2iGwlom!+#Z( z|Hj5w_4MwTo8QaHxm#EFYX1DUOO|}vvgQBb!_ST${rmj+`+Fep|C$j4HGtwz7FGrZ zO$Hs1VIV&_u+2R%#bJV$RKJIcL*N7vss0Y-EsB{gGlSJaTr>sRLKbLj5HMTpyK;)l zJcfpaMYltBZdEK6Kht6+BPy*VtthFMtIoqFC=#Tu$e^eaDXCC7U0vOYOJjNk(;P!VagC#fQ*?7otVO)-#9rK#nB%ry4`E_DHQ Wm01j~^6E13^D1O7+^=wCum%9s<%z=p literal 0 HcmV?d00001 diff --git a/js/tiny_mce/themes/advanced/img/trans.gif b/js/tiny_mce/themes/advanced/img/trans.gif new file mode 100644 index 0000000000000000000000000000000000000000..388486517fa8da13ebd150e8f65d5096c3e10c3a GIT binary patch literal 43 ncmZ?wbhEHbWMp7un7{x9ia%KxMSyG_5FaGNz{KRj$Y2csb)f_x literal 0 HcmV?d00001 diff --git a/js/tiny_mce/themes/advanced/img/video.gif b/js/tiny_mce/themes/advanced/img/video.gif new file mode 100644 index 0000000000000000000000000000000000000000..3570104077a3b3585f11403c8d4c3fc9351f35d2 GIT binary patch literal 597 zcmZ?wbhEHb6krfwc$UTx9v<%P?Ok48Ze?YanwpxCkzrwBk(ZYzB_&l;Qw!gmM(Ep^QBwbzIoSdAh>*2n> zz9l6k0Xw#(?);y5^ls9w|LObxXI*si^YfcEYu3*P8J(S-PEJlaNB-yTd}C^Ax@_69 zzP`Ryt5)S5`=P3;TDk9SbaeFk_3NiTjGA~aFd-pf@}tlxQ>GLb7jM|Gp`oFHlaq7F zk|nvhxjsHV=g+oST3Rl6T(N1>rn0iK*Ed>3MMVn>3vF#}**q!otE>Sy|^jDoRUBoBANRc=wyaJged$+}u3x zK}ld>puWET{||NozXdO-0f3nK$V8iNkVNKl+Guy1NeYie$3 zZB}=&Zex!RYq8YfVwgNdMpdFkN|rU!Fha}0m66q>CDxczOhH^pM9qvxw1p`;Rftzu zQJ&9}g>iErlc2ORw;aC_=l*6UJ=st%r*ISVV2jgDT<)w>rXHGL<21Kdo z#uyug^O^t z0hZGrt*x!>$1C!zn`W5@`ts6_uMW)2%<0NUEKIo?SIPPE=}U0}7Z(?JcX!y=*;bF< zCWz-=h7+2ao9)(dOHM;+X=xs9)%!~xc&ICMZdRYdUQ2$^@9y(6X3NCIz{cM7f^Z=Q z1_tQ95kgl8b%R%OiYTIo7LSdE^@}A^8LW002J#EC2ui01p5U000KOz@O0K01zUifeIyT9%!RzMDgehG|mwLz+Eh; z7Z~iE zrX?OfJ^>XeDJK)xJuWOB3_l1N0Ra>g4Gk^=ED0V6LI?>4;Q|6OB{LplLMRLg8U5-E J?0y6R06W6!pgRBn literal 0 HcmV?d00001 diff --git a/js/tiny_mce/themes/advanced/js/about.js b/js/tiny_mce/themes/advanced/js/about.js index 5cee9ed863..5b35845761 100644 --- a/js/tiny_mce/themes/advanced/js/about.js +++ b/js/tiny_mce/themes/advanced/js/about.js @@ -66,6 +66,7 @@ function insertHelpIFrame() { html = ''; document.getElementById('iframecontainer').innerHTML = html; document.getElementById('help_tab').style.display = 'block'; + document.getElementById('help_tab').setAttribute("aria-hidden", "false"); } } diff --git a/js/tiny_mce/themes/advanced/js/anchor.js b/js/tiny_mce/themes/advanced/js/anchor.js index 7fe7810558..04f41e0cac 100644 --- a/js/tiny_mce/themes/advanced/js/anchor.js +++ b/js/tiny_mce/themes/advanced/js/anchor.js @@ -19,15 +19,21 @@ var AnchorDialog = { update : function() { var ed = this.editor, elm, name = document.forms[0].anchorName.value; + if (!name || !/^[a-z][a-z0-9\-\_:\.]*$/i.test(name)) { + tinyMCEPopup.alert('advanced_dlg.anchor_invalid'); + return; + } + tinyMCEPopup.restoreSelection(); if (this.action != 'update') ed.selection.collapse(1); elm = ed.dom.getParent(ed.selection.getNode(), 'A'); - if (elm) + if (elm) { + elm.setAttribute('name', name); elm.name = name; - else + } else ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('a', {name : name, 'class' : 'mceItemAnchor'}, '')); tinyMCEPopup.close(); diff --git a/js/tiny_mce/themes/advanced/js/charmap.js b/js/tiny_mce/themes/advanced/js/charmap.js index 8c5aea1721..bb1869558c 100644 --- a/js/tiny_mce/themes/advanced/js/charmap.js +++ b/js/tiny_mce/themes/advanced/js/charmap.js @@ -173,7 +173,7 @@ var charmap = [ ['ý', 'ý', true, 'y - acute'], ['þ', 'þ', true, 'thorn'], ['ÿ', 'ÿ', true, 'y - diaeresis'], - ['Α', 'Α', true, 'Alpha'], + ['Α', 'Α', true, 'Alpha'], ['Β', 'Β', true, 'Beta'], ['Γ', 'Γ', true, 'Gamma'], ['Δ', 'Δ', true, 'Delta'], @@ -258,8 +258,8 @@ var charmap = [ ['⌋', '⌋', false,'right floor'], ['⟨', '〈', false,'left-pointing angle bracket'], ['⟩', '〉', false,'right-pointing angle bracket'], - ['◊', '◊', true,'lozenge'], - ['♠', '♠', false,'black spade suit'], + ['◊', '◊', true, 'lozenge'], + ['♠', '♠', true, 'black spade suit'], ['♣', '♣', true, 'black club suit'], ['♥', '♥', true, 'black heart suit'], ['♦', '♦', true, 'black diamond suit'], @@ -275,19 +275,46 @@ var charmap = [ tinyMCEPopup.onInit.add(function() { tinyMCEPopup.dom.setHTML('charmapView', renderCharMapHTML()); + addKeyboardNavigation(); }); +function addKeyboardNavigation(){ + var tableElm, cells, settings; + + cells = tinyMCEPopup.dom.select("a.charmaplink", "charmapgroup"); + + settings ={ + root: "charmapgroup", + items: cells + }; + cells[0].tabindex=0; + tinyMCEPopup.dom.addClass(cells[0], "mceFocus"); + if (tinymce.isGecko) { + cells[0].focus(); + } else { + setTimeout(function(){ + cells[0].focus(); + }, 100); + } + tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', settings, tinyMCEPopup.dom); +} + function renderCharMapHTML() { var charsPerRow = 20, tdWidth=20, tdHeight=20, i; - var html = ''; + var html = '
    '+ + '
    '; var cols=-1; for (i=0; i' - + '' + + '' + charmap[i][1] + ''; if ((cols+1) % charsPerRow == 0) @@ -301,7 +328,8 @@ function renderCharMapHTML() { html += ''; } - html += '
     
    '; + html += '
    '; + html = html.replace(/
    ' + // TODO: VoiceOver doesn't seem to support legend as a label referenced by labelledby. + h += '
    ' + ''; for (i=0; i' - + '' - + ''; + + ''; + if (tinyMCEPopup.editor.forcedHighContrastMode) { + h += ''; + } + h += ''; + h += ''; if ((i+1) % 18 == 0) h += ''; } - h += '
    '; + h += '
    '; el.innerHTML = h; el.className = 'generated'; + + paintCanvas(el); + enableKeyboardNavigation(el.firstChild); } +function paintCanvas(el) { + tinyMCEPopup.getWin().tinymce.each(tinyMCEPopup.dom.select('canvas.mceColorSwatch', el), function(canvas) { + var context; + if (canvas.getContext && (context = canvas.getContext("2d"))) { + context.fillStyle = canvas.getAttribute('data-color'); + context.fillRect(0, 0, 10, 10); + } + }); +} function generateNamedColors() { var el = document.getElementById('namedcolors'), h = '', n, v, i = 0; @@ -178,11 +238,27 @@ function generateNamedColors() { for (n in named) { v = named[n]; - h += '' + h += ''; + if (tinyMCEPopup.editor.forcedHighContrastMode) { + h += ''; + } + h += ''; + h += ''; + i++; } el.innerHTML = h; el.className = 'generated'; + + paintCanvas(el); + enableKeyboardNavigation(el); +} + +function enableKeyboardNavigation(el) { + tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', { + root: el, + items: tinyMCEPopup.dom.select('a', el) + }, tinyMCEPopup.dom); } function dechex(n) { @@ -190,10 +266,10 @@ function dechex(n) { } function computeColor(e) { - var x, y, partWidth, partDetail, imHeight, r, g, b, coef, i, finalCoef, finalR, finalG, finalB; + var x, y, partWidth, partDetail, imHeight, r, g, b, coef, i, finalCoef, finalR, finalG, finalB, pos = tinyMCEPopup.dom.getPos(e.target); - x = e.offsetX ? e.offsetX : (e.target ? e.clientX - e.target.x : 0); - y = e.offsetY ? e.offsetY : (e.target ? e.clientY - e.target.y : 0); + x = e.offsetX ? e.offsetX : (e.target ? e.clientX - pos.x : 0); + y = e.offsetY ? e.offsetY : (e.target ? e.clientY - pos.y : 0); partWidth = document.getElementById('colors').width / 6; partDetail = detail / 2; diff --git a/js/tiny_mce/themes/advanced/js/image.js b/js/tiny_mce/themes/advanced/js/image.js index 6423d90809..6c2489a168 100644 --- a/js/tiny_mce/themes/advanced/js/image.js +++ b/js/tiny_mce/themes/advanced/js/image.js @@ -18,7 +18,7 @@ var ImageDialog = { e = ed.selection.getNode(); - this.fillFileList('image_list', 'tinyMCEImageList'); + this.fillFileList('image_list', tinyMCEPopup.getParam('external_image_list', 'tinyMCEImageList')); if (e.nodeName == 'IMG') { f.src.value = ed.dom.getAttrib(e, 'src'); @@ -39,7 +39,7 @@ var ImageDialog = { fillFileList : function(id, l) { var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; - l = window[l]; + l = typeof(l) === 'function' ? l() : window[l]; if (l && l.length > 0) { lst.options[lst.options.length] = new Option('', ''); @@ -77,7 +77,7 @@ var ImageDialog = { args.style = this.styleVal; tinymce.extend(args, { - src : f.src.value, + src : f.src.value.replace(/ /g, '%20'), alt : f.alt.value, width : f.width.value, height : f.height.value @@ -87,10 +87,16 @@ var ImageDialog = { if (el && el.nodeName == 'IMG') { ed.dom.setAttribs(el, args); + tinyMCEPopup.editor.execCommand('mceRepaint'); + tinyMCEPopup.editor.focus(); } else { - ed.execCommand('mceInsertContent', false, '', {skip_undo : 1}); - ed.dom.setAttribs('__mce_tmp', args); - ed.dom.setAttrib('__mce_tmp', 'id', ''); + tinymce.each(args, function(value, name) { + if (value === "") { + delete args[name]; + } + }); + + ed.execCommand('mceInsertContent', false, tinyMCEPopup.editor.dom.createHTML('img', args), {skip_undo : 1}); ed.undoManager.add(); } diff --git a/js/tiny_mce/themes/advanced/js/link.js b/js/tiny_mce/themes/advanced/js/link.js index f67a5bc828..53ff409e79 100644 --- a/js/tiny_mce/themes/advanced/js/link.js +++ b/js/tiny_mce/themes/advanced/js/link.js @@ -31,7 +31,7 @@ var LinkDialog = { }, update : function() { - var f = document.forms[0], ed = tinyMCEPopup.editor, e, b; + var f = document.forms[0], ed = tinyMCEPopup.editor, e, b, href = f.href.value.replace(/ /g, '%20'); tinyMCEPopup.restoreSelection(); e = ed.dom.getParent(ed.selection.getNode(), 'A'); @@ -39,7 +39,6 @@ var LinkDialog = { // Remove element if there is no href if (!f.href.value) { if (e) { - tinyMCEPopup.execCommand("mceBeginUndoLevel"); b = ed.selection.getBookmark(); ed.dom.remove(e, 1); ed.selection.moveToBookmark(b); @@ -49,19 +48,17 @@ var LinkDialog = { } } - tinyMCEPopup.execCommand("mceBeginUndoLevel"); - // Create new anchor elements if (e == null) { ed.getDoc().execCommand("unlink", false, null); - tinyMCEPopup.execCommand("CreateLink", false, "#mce_temp_url#", {skip_undo : 1}); + tinyMCEPopup.execCommand("mceInsertLink", false, "#mce_temp_url#", {skip_undo : 1}); tinymce.each(ed.dom.select("a"), function(n) { if (ed.dom.getAttrib(n, 'href') == '#mce_temp_url#') { e = n; ed.dom.setAttribs(e, { - href : f.href.value, + href : href, title : f.linktitle.value, target : f.target_list ? getSelectValue(f, "target_list") : null, 'class' : f.class_list ? getSelectValue(f, "class_list") : null @@ -70,7 +67,7 @@ var LinkDialog = { }); } else { ed.dom.setAttribs(e, { - href : f.href.value, + href : href, title : f.linktitle.value, target : f.target_list ? getSelectValue(f, "target_list") : null, 'class' : f.class_list ? getSelectValue(f, "class_list") : null diff --git a/js/tiny_mce/themes/advanced/js/source_editor.js b/js/tiny_mce/themes/advanced/js/source_editor.js index 279328614c..84546ad52e 100644 --- a/js/tiny_mce/themes/advanced/js/source_editor.js +++ b/js/tiny_mce/themes/advanced/js/source_editor.js @@ -44,19 +44,13 @@ function toggleWordWrap(elm) { setWrap('off'); } -var wHeight=0, wWidth=0, owHeight=0, owWidth=0; - function resizeInputs() { - var el = document.getElementById('htmlSource'); + var vp = tinyMCEPopup.dom.getViewPort(window), el; - if (!tinymce.isIE) { - wHeight = self.innerHeight - 65; - wWidth = self.innerWidth - 16; - } else { - wHeight = document.body.clientHeight - 70; - wWidth = document.body.clientWidth - 16; - } + el = document.getElementById('htmlSource'); - el.style.height = Math.abs(wHeight) + 'px'; - el.style.width = Math.abs(wWidth) + 'px'; + if (el) { + el.style.width = (vp.w - 20) + 'px'; + el.style.height = (vp.h - 65) + 'px'; + } } diff --git a/js/tiny_mce/themes/advanced/langs/en.js b/js/tiny_mce/themes/advanced/langs/en.js index 69694b1f9f..6e58481874 100644 --- a/js/tiny_mce/themes/advanced/langs/en.js +++ b/js/tiny_mce/themes/advanced/langs/en.js @@ -1,62 +1 @@ -tinyMCE.addI18n('en.advanced',{ -style_select:"Styles", -font_size:"Font size", -fontdefault:"Font family", -block:"Format", -paragraph:"Paragraph", -div:"Div", -address:"Address", -pre:"Preformatted", -h1:"Heading 1", -h2:"Heading 2", -h3:"Heading 3", -h4:"Heading 4", -h5:"Heading 5", -h6:"Heading 6", -blockquote:"Blockquote", -code:"Code", -samp:"Code sample", -dt:"Definition term ", -dd:"Definition description", -bold_desc:"Bold (Ctrl+B)", -italic_desc:"Italic (Ctrl+I)", -underline_desc:"Underline (Ctrl+U)", -striketrough_desc:"Strikethrough", -justifyleft_desc:"Align left", -justifycenter_desc:"Align center", -justifyright_desc:"Align right", -justifyfull_desc:"Align full", -bullist_desc:"Unordered list", -numlist_desc:"Ordered list", -outdent_desc:"Outdent", -indent_desc:"Indent", -undo_desc:"Undo (Ctrl+Z)", -redo_desc:"Redo (Ctrl+Y)", -link_desc:"Insert/edit link", -unlink_desc:"Unlink", -image_desc:"Insert/edit image", -cleanup_desc:"Cleanup messy code", -code_desc:"Edit HTML Source", -sub_desc:"Subscript", -sup_desc:"Superscript", -hr_desc:"Insert horizontal ruler", -removeformat_desc:"Remove formatting", -custom1_desc:"Your custom description here", -forecolor_desc:"Select text color", -backcolor_desc:"Select background color", -charmap_desc:"Insert custom character", -visualaid_desc:"Toggle guidelines/invisible elements", -anchor_desc:"Insert/edit anchor", -cut_desc:"Cut", -copy_desc:"Copy", -paste_desc:"Paste", -image_props_desc:"Image properties", -newdocument_desc:"New document", -help_desc:"Help", -blockquote_desc:"Blockquote", -clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\r\nDo you want more information about this issue?", -path:"Path", -newdocument:"Are you sure you want clear all contents?", -toolbar_focus:"Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X", -more_colors:"More colors" -}); \ No newline at end of file +tinyMCE.addI18n('en.advanced',{"underline_desc":"Underline (Ctrl+U)","italic_desc":"Italic (Ctrl+I)","bold_desc":"Bold (Ctrl+B)",dd:"Definition Description",dt:"Definition Term ",samp:"Code Sample",code:"Code",blockquote:"Block Quote",h6:"Heading 6",h5:"Heading 5",h4:"Heading 4",h3:"Heading 3",h2:"Heading 2",h1:"Heading 1",pre:"Preformatted",address:"Address",div:"DIV",paragraph:"Paragraph",block:"Format",fontdefault:"Font Family","font_size":"Font Size","style_select":"Styles","anchor_delta_height":"","anchor_delta_width":"","charmap_delta_height":"","charmap_delta_width":"","colorpicker_delta_height":"","colorpicker_delta_width":"","link_delta_height":"","link_delta_width":"","image_delta_height":"","image_delta_width":"","more_colors":"More Colors...","toolbar_focus":"Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X",newdocument:"Are you sure you want clear all contents?",path:"Path","clipboard_msg":"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?","blockquote_desc":"Block Quote","help_desc":"Help","newdocument_desc":"New Document","image_props_desc":"Image Properties","paste_desc":"Paste (Ctrl+V)","copy_desc":"Copy (Ctrl+C)","cut_desc":"Cut (Ctrl+X)","anchor_desc":"Insert/Edit Anchor","visualaid_desc":"show/Hide Guidelines/Invisible Elements","charmap_desc":"Insert Special Character","backcolor_desc":"Select Background Color","forecolor_desc":"Select Text Color","custom1_desc":"Your Custom Description Here","removeformat_desc":"Remove Formatting","hr_desc":"Insert Horizontal Line","sup_desc":"Superscript","sub_desc":"Subscript","code_desc":"Edit HTML Source","cleanup_desc":"Cleanup Messy Code","image_desc":"Insert/Edit Image","unlink_desc":"Unlink","link_desc":"Insert/Edit Link","redo_desc":"Redo (Ctrl+Y)","undo_desc":"Undo (Ctrl+Z)","indent_desc":"Increase Indent","outdent_desc":"Decrease Indent","numlist_desc":"Insert/Remove Numbered List","bullist_desc":"Insert/Remove Bulleted List","justifyfull_desc":"Align Full","justifyright_desc":"Align Right","justifycenter_desc":"Align Center","justifyleft_desc":"Align Left","striketrough_desc":"Strikethrough","help_shortcut":"Press ALT-F10 for toolbar. Press ALT-0 for help","rich_text_area":"Rich Text Area","shortcuts_desc":"Accessability Help",toolbar:"Toolbar"}); \ No newline at end of file diff --git a/js/tiny_mce/themes/advanced/langs/en_dlg.js b/js/tiny_mce/themes/advanced/langs/en_dlg.js index 9d124d7db6..42c9a13c85 100644 --- a/js/tiny_mce/themes/advanced/langs/en_dlg.js +++ b/js/tiny_mce/themes/advanced/langs/en_dlg.js @@ -1,51 +1 @@ -tinyMCE.addI18n('en.advanced_dlg',{ -about_title:"About TinyMCE", -about_general:"About", -about_help:"Help", -about_license:"License", -about_plugins:"Plugins", -about_plugin:"Plugin", -about_author:"Author", -about_version:"Version", -about_loaded:"Loaded plugins", -anchor_title:"Insert/edit anchor", -anchor_name:"Anchor name", -code_title:"HTML Source Editor", -code_wordwrap:"Word wrap", -colorpicker_title:"Select a color", -colorpicker_picker_tab:"Picker", -colorpicker_picker_title:"Color picker", -colorpicker_palette_tab:"Palette", -colorpicker_palette_title:"Palette colors", -colorpicker_named_tab:"Named", -colorpicker_named_title:"Named colors", -colorpicker_color:"Color:", -colorpicker_name:"Name:", -charmap_title:"Select custom character", -image_title:"Insert/edit image", -image_src:"Image URL", -image_alt:"Image description", -image_list:"Image list", -image_border:"Border", -image_dimensions:"Dimensions", -image_vspace:"Vertical space", -image_hspace:"Horizontal space", -image_align:"Alignment", -image_align_baseline:"Baseline", -image_align_top:"Top", -image_align_middle:"Middle", -image_align_bottom:"Bottom", -image_align_texttop:"Text top", -image_align_textbottom:"Text bottom", -image_align_left:"Left", -image_align_right:"Right", -link_title:"Insert/edit link", -link_url:"Link URL", -link_target:"Target", -link_target_same:"Open link in the same window", -link_target_blank:"Open link in a new window", -link_titlefield:"Title", -link_is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?", -link_is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?", -link_list:"Link list" -}); \ No newline at end of file +tinyMCE.addI18n('en.advanced_dlg', {"link_list":"Link List","link_is_external":"The URL you entered seems to be an external link. Do you want to add the required http:// prefix?","link_is_email":"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?","link_titlefield":"Title","link_target_blank":"Open Link in a New Window","link_target_same":"Open Link in the Same Window","link_target":"Target","link_url":"Link URL","link_title":"Insert/Edit Link","image_align_right":"Right","image_align_left":"Left","image_align_textbottom":"Text Bottom","image_align_texttop":"Text Top","image_align_bottom":"Bottom","image_align_middle":"Middle","image_align_top":"Top","image_align_baseline":"Baseline","image_align":"Alignment","image_hspace":"Horizontal Space","image_vspace":"Vertical Space","image_dimensions":"Dimensions","image_alt":"Image Description","image_list":"Image List","image_border":"Border","image_src":"Image URL","image_title":"Insert/Edit Image","charmap_title":"Select Special Character", "charmap_usage":"Use left and right arrows to navigate.","colorpicker_name":"Name:","colorpicker_color":"Color:","colorpicker_named_title":"Named Colors","colorpicker_named_tab":"Named","colorpicker_palette_title":"Palette Colors","colorpicker_palette_tab":"Palette","colorpicker_picker_title":"Color Picker","colorpicker_picker_tab":"Picker","colorpicker_title":"Select a Color","code_wordwrap":"Word Wrap","code_title":"HTML Source Editor","anchor_name":"Anchor Name","anchor_title":"Insert/Edit Anchor","about_loaded":"Loaded Plugins","about_version":"Version","about_author":"Author","about_plugin":"Plugin","about_plugins":"Plugins","about_license":"License","about_help":"Help","about_general":"About","about_title":"About TinyMCE","anchor_invalid":"Please specify a valid anchor name.","accessibility_help":"Accessibility Help","accessibility_usage_title":"General Usage","":""}); diff --git a/js/tiny_mce/themes/advanced/link.htm b/js/tiny_mce/themes/advanced/link.htm index 7565b9ae8b..5d9dea9b8c 100644 --- a/js/tiny_mce/themes/advanced/link.htm +++ b/js/tiny_mce/themes/advanced/link.htm @@ -18,34 +18,33 @@
    - - - - - - - - - - - - - - - - - - - - - - -
    - - - - -
     
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + +
     
    diff --git a/js/tiny_mce/themes/advanced/shortcuts.htm b/js/tiny_mce/themes/advanced/shortcuts.htm new file mode 100644 index 0000000000..20ec2f5a34 --- /dev/null +++ b/js/tiny_mce/themes/advanced/shortcuts.htm @@ -0,0 +1,47 @@ + + + + {#advanced_dlg.accessibility_help} + + + + +

    {#advanced_dlg.accessibility_usage_title}

    +

    Toolbars

    +

    Press ALT-F10 to move focus to the toolbars. Navigate through the buttons using the arrow keys. + Press enter to activate a button and return focus to the editor. + Press escape to return focus to the editor without performing any actions.

    + +

    Status Bar

    +

    To access the editor status bar, press ALT-F11. Use the left and right arrow keys to navigate between elements in the path. + Press enter or space to select an element. Press escape to return focus to the editor without changing the selection.

    + +

    Context Menu

    +

    Press shift-F10 to activate the context menu. Use the up and down arrow keys to move between menu items. To open sub-menus press the right arrow key. + To close submenus press the left arrow key. Press escape to close the context menu.

    + +

    Keyboard Shortcuts

    + + + + + + + + + + + + + + + + + + + + + +
    KeystrokeFunction
    Control-BBold
    Control-IItalic
    Control-ZUndo
    Control-YRedo
    + + diff --git a/js/tiny_mce/themes/advanced/skins/default/content.css b/js/tiny_mce/themes/advanced/skins/default/content.css index 36f38aba29..2fd94a1f9c 100644 --- a/js/tiny_mce/themes/advanced/skins/default/content.css +++ b/js/tiny_mce/themes/advanced/skins/default/content.css @@ -1,6 +1,7 @@ body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;} body {background:#FFF;} body.mceForceColors {background:#FFF; color:#000;} +body.mceBrowserDefaults {background:transparent; color:inherit; font-size:inherit; font-family:inherit;} h1 {font-size: 2em} h2 {font-size: 1.5em} h3 {font-size: 1.17em} @@ -8,10 +9,11 @@ h4 {font-size: 1em} h5 {font-size: .83em} h6 {font-size: .75em} .mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} -a.mceItemAnchor {display:inline-block; width:11px !important; height:11px !important; background:url(img/items.gif) no-repeat 0 0;} +a.mceItemAnchor {display:inline-block; -webkit-user-select:all; -webkit-user-modify:read-only; -moz-user-select:all; -moz-user-modify:read-only; width:11px !important; height:11px !important; background:url(img/items.gif) no-repeat center center} +span.mceItemNbsp {background: #DDD} td.mceSelected, th.mceSelected {background-color:#3399ff !important} img {border:0;} -table {cursor:default} +table, img, hr, .mceItemAnchor {cursor:default} table td, table th {cursor:text} ins {border-bottom:1px solid green; text-decoration: none; color:green} del {color:red; text-decoration:line-through} @@ -33,3 +35,16 @@ scrollbar-track-color:#F5F5F5; img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px} font[face=mceinline] {font-family:inherit !important} +*[contentEditable]:focus {outline:0} + +.mceItemMedia {border:1px dotted #cc0000; background-position:center; background-repeat:no-repeat; background-color:#ffffcc} +.mceItemShockWave {background-image:url(../../img/shockwave.gif)} +.mceItemFlash {background-image:url(../../img/flash.gif)} +.mceItemQuickTime {background-image:url(../../img/quicktime.gif)} +.mceItemWindowsMedia {background-image:url(../../img/windowsmedia.gif)} +.mceItemRealMedia {background-image:url(../../img/realmedia.gif)} +.mceItemVideo {background-image:url(../../img/video.gif)} +.mceItemAudio {background-image:url(../../img/video.gif)} +.mceItemEmbeddedAudio {background-image:url(../../img/video.gif)} +.mceItemIframe {background-image:url(../../img/iframe.gif)} +.mcePageBreak {display:block;border:0;width:100%;height:12px;border-top:1px dotted #ccc;margin-top:15px;background:#fff url(../../img/pagebreak.gif) no-repeat center top;} diff --git a/js/tiny_mce/themes/advanced/skins/default/img/buttons.png b/js/tiny_mce/themes/advanced/skins/default/img/buttons.png index 7dd58418ba7cfe58ae7efdf174e0b223fe3aa6a0..1e53560e0aa7bb1b9a0373fc2f330acab7d1d51f 100644 GIT binary patch delta 2525 zcmV<32_p8&8NC>gBe7Up0)GjqNklW6KNnY z5Dmy?f+RtfI3miXgUZ$l3N2OYxbJnZTdVCj)}{MCZD&hL34hpp-*fJkN9^6-rttRd_kS0lKeglM98q|x zSXg)|clwtWRQ;MY1qEx?toa>1R4`M3mjVKlOJfdD-oUKKN?soPS!gqP#L^XT4aOn{ z<|RX4N|~K3sI#VE=T7#D$4&spi{!Bt^$m?o{QUC{rr%gvO7{Aqylm?0S+zX;7S)5x zYH`$|q9m`!4|np5D1R_fYSKe+^>SWz0Y7FK1ysuqN>D&2@AB2F{;N0@haxPiQCh0& zhw4lG5r0WZQ4t;*Lqq;NdgWD1{6j!LBHsQN0n-H)T^-WjVH5Nl`Db5R>T*R~PM05_ zz&}62x_GwK&EQ;@DGPWTGSzxvULAk)dDV>VGDjevLnadS|zjKJgNr z`bf8#+LA20zq{MdV;qyd)>%W;u2b1cxN5qol8KVq;TnzZb$VIutgWfp%2Ix?b*q1c zp^rpdy`U!2+}vDCtV5;l-Wsivb|!ywlycE%FI3t1UC}6o*QwN+^e&e(+6tmh&IV$* zwKr1BS*PP_Wq6=`xrq%|~+T_C5$Ej&(aBhffVASe$q7B6G zIup%|XhSd0Mu0Qgpy>-sR}42bHT5AGzmv^*wAx7)^Unf>~5$T9%lO1CJm!P4FXMOHKz$z zM=wnfkZ6UWhyVA>%nC?#J^af}srE1Jej#Va#*O+2?4ajYUZim8X-e~b+=1AA=!;Li z{LVWs=YIfLPf;Us>ZKfUYN0sSZPfdXhr^3GA$+*;eW5Y@_20p3+g{(S@;An7+c>-4 zzH{fVD(lz(Woh*EW|q5i=WXKKaHDYeKe^uY^@!eVA} zU?3JNw_3}~%v4||MYYOBD+pBBK=CiB2=GM=ZK74QsnEWGf%6%rzj!7P2v}t?l}eTC zl$E#0Ct|T!SuA#?$iibMaNC?>Kiw?CEKd zzJCvBq=2zAM1~_he8t?66 zfn&!4^f)$wyn6yk5sZ(EV*dOH)4w{O@AEl)KA*H@%a$t8Lb%;&pMYYFvGMV7tDQ2w z^uMR<7J&^Nb)p7@Ek2(-Hpb#JGc#^?{(Oh7_Y#hyQXS{kEm_{u>HP%tcr7sFmVeV; zGlCm7l_N*oN4?%UH-)z_WRu>~d7~W&AKja>6GxBYOY^mRsgg|aEiHo5uHm)287)vU zr_lbNqZGYW2PCP^q)&h2+XLDKi)GP5+_T)9>fh5og-X&n zYuzV%<`96qIK=6}-Q;lqal;oUona*U5Yva9&^5?HCzQCBYQePB^} z1G^QI{#~E1|9S|__B%kDaVhkfLtwn|hPKge|6hpk+D-7KxzMN35)ad9$LArF{=NSG z{!d2}qobpb=6s;j0hH0v{xnBWfu(a4gfKE85W&$|9{#7pap|+sgr+|~pMU?=SC_nV zeSOzIPT)Rt_LyM34W+BD~pYLNtW_A6!EA8z!ZnXCe z{-Cr!8XWBV0fzy~;NTt~fi0#gpAQZWzL(Ahi@v_WS(w3%#Nc3J&U@vYs=s*VZae6k zo>dfO@8IF5}l ze2%BrIIn|UoVTuFde>WwT^d-P#5C>en7nrF8d*jxYW`2>4Sop9r3$7^9D z0|tV3X(>MKmaTjdTktrvwvFjGojrtexg~ch8%eTiL$?HEDrQFQ(o|zg&NduBtLhIO zr!H+##_1SX!$S-&LZ~82VT&b<_XeVjKkdaT)8&MZn3s@_Ho}t76Fe-_-RMhe8N;d)Q7$ zgh%o6N^}7$y zR~4_W4h0it*_&N5iO~AmA~pIUX&|1-eOHt8eKM$d&WQn~arrTISYK3<2LI5tZb~ra4Vor00000NkvXXu0mjf6xaGA delta 2666 zcmV-w3YGP}7|I!tBQpR5XF*Lt006JZHwB960000PbVXQnQ*UN;cVTj606}DLVr3vn zZDD6+Qe|Oed2z{QJh35N0)GktNklOuzigg*>~3$W~EbK zkJI3gRag&Pk;36h;(u!ibKpZf$s%$Un3eX0^;fTCr3YA`hg=wxWdVv6yUWeGa`md^ zYPZydB%+pJHp})s^~DyqrMS4T5Pd~@dMsJ!Oj3(2J%GGL`1xNDC>B(BwMYI1lfb@) zTzj)wuXpQpdJ9~Ee*nbvVdZyBfC9gXDU5y?>5fdiK8l)c-n4+B;1rlzK9#2!fM3|C1>(w;0$9;EYl!lG3Qi{9fw zVrhld3VXd?=YR169vz_+(dP}js|kB#^j=K3^ni>w0`h8!(x#?9g}qC!cX=BCuM6&( zm{HZxpeuFbq|$0R$Ae@IeR~u%VLT0CqICm0PlIHiXU^_(xm;m9ufe020DG5mHvqWk zv8uF52_Ex?yhN-=D+`4b_He8EJfV;`4BcMHBKDz>n13aP=+L^rCKL*n%DC}jfrgM* zj~-Vb3=*%x-h&8rgsVIa9UY-C+KkIp)zOjKN-D+E(b3VTO9zdHI=n;%MjatfU&@~N z!#M213$q)l`uecF*CmlkfbI_0Z>#|qtPY)A$N-G8753)rKWsDEX0yWHoW0$crGIJn z#nJPOdwtjmu*fKZ%u>cXgG^6d`tnH)&sRp%WhF|=p(lZ|$`~53maBoH z-%@TRgV0nnG@}+l^J1|}>)3v2-fFed9Fs^S%4AB)nz{2npRdH{JKxN49BoCRYH@$W zp?{o#0q%5JIs7UqY368gX)vp#Y<}rDwr^itVY<4S*`KWv351npCs7VWCVpmtHLEXu zgA50~9E00sJ|D+6!*ZnMSyvXvi2Z8Ld4^_ha?A+2j12SC`joL+yT)&F2`hXO|9YNa z*qbWVI0T^SJ`BU%+!()E`5c@1%FZU(@qg22pO=Ztdper4`U2YzuI5l&vnHuBOb-uF zPos-DGCVvyLM1h$3^2-!T1Q7KRa7#WWNC4O22B!vYlf|7&sx#<>?r6Bqo71nMn)JW zXLS(UA79NenY1R8iEU|VsRWu421C+BkuaJb9vK;-HArJh{(D@bqHt4N$HFYWvR_B)x^!$Fg+_ z`{WO%UZ9OqsWw!Id#Zcm(cU%)JAcDM6xkEU)v0D5_CCZ?wnbbe7$VoYFM4M|%;M#Z zkKa=%?1Mq=>``DA?q2fIqem1%I66bA2rpl1L`+99GgO_7II?{7p{Q1!g4w*n{(;F9 zz3u>JqFNw{S$2G-#W~ceQ_@6@=6^`$5Ht$N(5&OjQ$+qKnbdymP}qMIjekbJ9108# z4LzPk&qNS~@IymU5|pGwz$FNxA&0ar0v@vs%@FZFwc6#ch60lPrPZA8zFQV%Ba!Q$ z2jCz?AD{>mABo%u27~f$#FXoiNTioa2Ms=s%z!aWFqu9F$&75jxYE{k<3?K~{tMss zI3ADuf;JP4^6_{t&ItyUDSuzbA;{V5}yfT`Het49+(wY7DfA|`Mc;*i%iY% zJbyGkHT9SmAYu90l#T3zM4$`yYck1CO+7QEoPR~#FdBU}^$>IqqBbzN&M)7cUm}0C zmtwKiyWjq4Tlx0xYAlBBFJFS!$^1&rwz4u0uag(>I&rT5c#<&IK7UBw$JdSzwzm(C zy@10B!n?p>!u!{t`|$gi!xAt&2Hj|0``EQ>*O1F#`}goNoV@Vrv(H{-0C0s@d86~f z`sMWuaC!X#6e1Zeqtt3TQ}(o4O{twvP-&J|k+(mMyb40z{=L7CtX7KmKXIxl+Sa~WQrB0pi^&f|09 zya82dI7=<>51&YtmLS~*j+Ryi+Qh`}R%~CpFai5Au!clBEPqQ&O#`aZI25KttkOis z1efk`Zb7u4IESjV4GwmPfid_p&J9l1GOSaja&pS)3G6@e;EDw5##NmZJ(A5x{!DLc>`uo9qQq30%Q$+e$2XEbV!Mk8BEAO(yeX`~ck zG*oGzF(xS|s(;c@Q_H5RG+3C?$caikUABMkn2}UztOUAam0CfY%0g_a(o)e-rLls* zVi{Q@ckDgcUZv#`lt$ykr3KC~@`9KIS!7!jFC$fHB9)aeM#SP0752#=jDCQZt2B*D z<23qtrM&atqW=vISyu-0YmF9m_mF9QYPRUh|*6$cNCff^OZwnwCe*8?} zDlHH&Zm!a_ShZD^7O=@h5AO&BWcwon=vMjdc84th2b6{2?RFmLq*rMUyWQ^JqDphv zZA1+#wSU_Kwt*u`dmh~UJRd-l1<4+7h3rL6fo0f*%~hH)0QO`acm(`{!hRRBhjBPU zvfaT80=BmqB~l5{Z8xS{<26faV!-c8*&jKw>zhArE8pw_Q(|8Mt$|(J%mA38e`(J3 zC*o_kwYE0Zs;zBB$Gpu{Y~792WS(eJTl)lFhAXt~RmOlB(02E9v#?C$X5eP{z{CIq|Noy+{K>+~z`(?y1LA{Z9GJviddkHn8j1n{4_XQ! literal 70 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 m$9hVqYNgZs*94epU`y6#e2-qmp8{7)K diff --git a/js/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png b/js/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png index 8996c7493e8a58c9c40845cbe8abdc3e6730716d..7fc57f2bc2d63a3ad6fbf98b663f336539f011ec 100644 GIT binary patch delta 618 zcmV-w0+s!k9g78!83+Ra0086$;ro#x7k>cEP)t-s0002HySo4Y08>*_a&~-=k(7~{ zq?n(no1(0rrmv!@vZk!Hsjs-Lv%9dizO=c)x4gu=z{b14$GpMFzQf7C#LL0P%)`gc z#L3Ub%FxKn(aFuz%g@yRt3Us-P5-h`|Fl&9wO9YQTmQIT|GHxTyJi2qY5%`%|9`=9 z|HF3w#e4t9fd9#a|I3O0&5r-ub^qLY|J{H8--Q3*iT~k_|KpSYd|L3Cr z=%)YbtN-h;|LwH@@45f*zW?&W|MbWI_00eO|F&Wq@&Et;0(4SNQveU|I_8w5<1)+Sxjy>khxmTZ^UMAPuDhl=nJ%xacLVXE zN31WKSh0P^hawhnw)jf}#5_+GPu2e^5c51aiV00%6xVrr#$!*$V|i{OPJb2GYE{RI zUk${E_f%7X#d{l5O*06LqA`1W{A{z-KcE#qKx)lR6a_=R{wHo}S^x<1c*Pfemr)l5 zdENxVv+rLvA{OzVh(9zy{H9446TMvi`r@7X*kwhrq7{r{OWVwhm!6C_^4vrmA^ryB ziMy8mgg|d`WSser1qE6f|5sqVKRBqtZ!0b!I11C^6r?oOYvK8FsKs4z{;LqNh=&nh z+Biyl2i(R3MA5bJ5E*aeRfzb1#Gw{<#77AJa-hW>&Xefx-T2hw#sB~S07*qoM6N<$ Eg3||6=l}o! delta 3727 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 diff --git a/js/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_silver.png b/js/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_silver.png index bd5d2550c06d83c1141b78c5af7217e89559fc32..c0dcc6cac2003f7405fff3ea5df7bcf276243596 100644 GIT binary patch delta 2072 zcmV+z2bL86o&f`_+2dMjNDlznH&TyHd_URN{##*Ml(GE~%a^)cgqM3rM6 zy{bondNjd$e}A~n3(q}gq4ulxA1GMAU&Onw&G(G!`w1>rDpD?2qyj2sDOZq}vmEsd z@}xM$9V2sUnzinX>{lh^hXjQ<)2Nkx*%9e)zkkSD0CoV{iZJ)DasnENC6 zO3eKu1`Fo?3BIrvYh2$;@cjI|BpLJbiDbD&l4LPSRIcEBvIVYz{%C^DeJ19f%sg1I zUXySwx9qiQ?A_Q?s9^K`6JE!_ z_bH;j`G1t4avR;FV7+1Waz2(|Uc;urnCmH`!L@zx6WnSxrP*vrv(=JThRQ)R8*>hQ zYQ71wvFg#UXH>6?^{X=WplEV0ExjMW`9Q(y{i(G;wl>F@)APzl%kNj^PNyxMPDk49 z4x$C>ZH`GBSan^CCfK|VA>41MV6M?-$Q72-@G>9egXySHG$4qGvBl01NZ;Wk5IlbdYjLYHBI{RmBx^I0qP8}!GuogJYk_!zN2?;k z|>^JhLf(MIk(!X*D?q~AKKA_i6@c2i;>U72h zvW9WSnu*;0QO^O4*~dEac!Gy3nZTYC^nc|OJm-VIVBBrPr70OKP9f&UTqC03W&Esn zg1&r$XMOM&jBoqFjW1=Rb4L0Z8{5Df=WS8%`SX1EkC7(aeCzViXS5bXT0 z2Y0X`bDP|q>h>IK@dQKM?V6iGFQ4GmFMaSAjBn?D{e;CvrjbbpH> zSZYT^etAG~1(C3BM?2T-$2jhfh{bQl9C+a~3q2=)T?-eCKNy!z0Io?;*Pz!=a9Vwv zk|v7WZ;3Q>ikAq_KzC(jyDTxBt>P zqC_AX^<0AcU6Jcg6Rxes1igNO1%HB#yVN1hs1uGO3tlT{0;dchz^bkOo>TB)1FX$4 z@fJL4d?<45u`#3BM*(u9hDaVqbP-Q5?#$)y-K>@K37&i2hg^a|xM0@N8(;9sjL6Mt zH|t5bU_9FW@rn=V^%IOos`TpNOv*EeI^P_#_N>k=WLEVf0@R`jzIjpP)_)~8>(yci z#xDlx+^gjJD>70sgX1hm1V$g{P-jmx!T9!HnQ=1eH*yGG6iMFnW8nE0u<=`0n!IH& z%5c2D`Dk-1N-F?tx)JaWF4V-Q(z_RnP(IMpbK;H$@Emx17@r^@NAX(zIt z6hrXnr`JS&eq9i){L&j3gULPiTx7w^UMJk?>Rd4d4}W-CMi)#}?T}S7#@|21u}O5n zgI>wO*OIQx7DMphi+=+GAY~h>er9{^LFRm|5z!O#$Y`T|%E|EN<>CouPJxzizZh3= zDECwMgVgrwg-IR-gkeh`tcmwk2}cXHfQ1*&W$KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a(?@3)XSs8O^N5RyOM=TTmp(3=8^+zpz2r)C z^>JO{deZfso3oq3?Wo(Y?l$ge?uXo;%ru`Vo>?<<(8I_>;8Eq#KMS9gFl*neeosSB zfoHYnBQIkwkyowPu(zdms`p{<7e4kra-ZWq<2*OsGTvEV%s0Td$hXT+!*8Bnh2KMe zBmZRodjHV?r+_5^X9J0WL4jKW`}lf%A-|44I@@LTvf1rHjG(ze6+w@Jt%Bvjts!X0 z?2xS?_ve_-kiKB_KiJlZ$9G`c^=E@oNG)mWWaNo-3TIW8)$Hg0Ub-~8?KhvJ>$ z3*&nim@mj(aCxE5!t{lw7O5^0EIO7zOo&c6l<+|iDySBWCGrz@C5{St!X3hAA}`T4 z(TLbXTq+(;@<=L8dXnssyft|w#WSTW<++3>sgS%(4NTpeI-VAqb|7ssJvzNHgOZVu zaYCvgO_R1~>SyL=cFU|~g|hy|Zi}}s9+d~lYqOB71z9Z$wnC=pR9Yz4DhIM>Wmjgu z&56o6maCpC&F##y%G;1PobR9i?GnNg;gYtchD%p19a!eQtZF&3JaKv33gZ<8D~47E ztUS1iwkmDaPpj=$m#%)jCVEY4fnLGNg2A-`YwHVD3gv};>)hAvT~AmqS>Lr``i7kw zJ{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i& z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01 z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| zawq-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=00004XF*Lt006O$eEU(80000WV@Og>004R=004l4008;_004mL004C` z008P>0026e000+nl3&F}000UJNklsV|cYlY&q4zsSqY(=s&=iZ>cW|Jxv$MmG9zDvBot+(KW~|_7TD<6H{cAkN3K|aG zcrux+oO=g@0Ya4~{cSpH8q)S^C!RJ4&uZ})*9T~k*=eimkK)R(5Tt1);2fRB?TM})FJ3}Q5GXUb8Lk){FF_3Wx z=iJIUQx^{h5)s+dB4+IF?&d(;*xttO?zotV+(ty0F%iZKw08@d%-%zcDVt0A1Sf#Z z!$i550O_}rB?3rfgC(+rO4veFh#~^8Hy-20_BQs$V=WfUeQHPBy1+Q2J>DBT_nOd; zg%BBtmQXJ}Okfa+99U7I2a5MoP!1ME*2}cE*xTO+2~p?`YNwur5G5ud?C!LPP@KOm{BB z#+D0KgT?0I#e@*i(sz&zP75$15rJ3S|2QI{O)t_@pSjQy1b~?`xvW2-u@wmfCWc_c z)13c;fEO-bc3xDzZd;8l6W9w42 zW<`}u<0ZaeC@-Kijls+P(6(Jz6qgLJDBi=ii9)_II9f8%T4>=@up99}kB^U{(Z*SusdxZ;9thpIi5|i%i*z7$Q42&#_|A+Sh|kzjQ25$CH1E&}eROqug=T&4vm5K@rO%+N(%@`EF2u{BU z2Qnvsn%2zW93s5e7jCOIXrWnutK12sf9DVsIqQl!K zhoN|xb6z?(C(OXNeio?91RU=H0IvOZk=t(m;#^_H#4j{gps5xS*M76PNc)#Z#YNxG ziV!N#^i_O(Q*TlwRk0u{wdK&9Q_#P8{fY~KbKOP@%m6t7Q#fr z6(&y=#~QAtQ!vp0V0x&ttt5csqa28v*RKG_N5#EX2FeV0Jl4nlM=tICkBWPb$GWXo z+@j2iWlp6fpqDxQv_v1P%!ka5<0Jz&aqHWHjHo#FZ)M=#a_bw+j+mn}px!qeOTe}Q zY!hrb(x+I|44{$-^&C&VxQs>Iq8|c?*8SU-N@Z4=h=ATktzooG$I%jf zM^9NqP`kBL{y`K^Q5aM2ED-e}OpJ=ndH@$KuK0e+hz~1_tWL#>s0WxKT0l$@h4C8d{u@yJ}>WAE3Fd(@KviX7h9|z;NfuiI1EEH+t=KPgTM3Aw^tS8%B9EP z^FIQ3GY}A4!0e!2MEv!BH|*f^eOPO4vn>O8GOk!rNj0Vl^C`K{oB$@Vy3__9;QQZu zsT%p6nI|0@Px#?8vwI>zRXr6&qMS=T9077Cn~IJ)5MpqpvI zv*Y?!y^a9vbgF8avwNRNI6?R_xcWD=lsNK`)oC{XE_1H47NP>Y@&~8_J8U8J9{vFU zaP8Kjt$p*SAL^5fKL#$m)&YR~8wE(E1t_M@-d$N4PclpTv(-N;ISMKwaxkx7!L@h) z?Ofv@=u{EZUkCL!fwc{Yb$ys~>ThPh>-m8-eczl@e;u@L&NuaSNK0aRs52VW1Ma=! zW`6IzQ`|$`4H1F0bD)atgv*kf_TDsm_bxeM`GEfvi4`EMXxeA*;pX*U0iV6+){Bk+ z%x6ReTe}PSOr2szl;!Ry`!)GE+Z)6|z#gj^AWExl?*DF~j;SAfiH08s_s-@COXCse zt1K&4O)3x&A>UQ0%;Mqbl!n9UBEXfN+*(&e#D=3fmi?ZrZcfuxmO$jOUxm5?aMX7! zfjl>t#TnF+1%XC-2r6=Uu4xg9gQtKvc9uisyY6kqWefa}R)j}lGU^Bi!vc^> z9-S($V$V6bv=SaqzQ4o2%)s%DcQ3_4T)pHJ_8n&Rr~9ROG-5#LxX)wLf6NO|fq`uOj7mdgJI0H2v4wf~~Kng9R* M07*qoM6N<$f@g#ZbN~PV diff --git a/js/tiny_mce/themes/advanced/skins/o2k7/ui.css b/js/tiny_mce/themes/advanced/skins/o2k7/ui.css index a6253976af..0916c34e83 100644 --- a/js/tiny_mce/themes/advanced/skins/o2k7/ui.css +++ b/js/tiny_mce/themes/advanced/skins/o2k7/ui.css @@ -4,8 +4,8 @@ .o2k7Skin table td {vertical-align:middle} /* Containers */ -.o2k7Skin table {background:#E5EFFD} -.o2k7Skin iframe {display:block; background:#FFF} +.o2k7Skin table {background:transparent} +.o2k7Skin iframe {display:block;} .o2k7Skin .mceToolbar {height:26px} /* External */ @@ -19,7 +19,8 @@ .o2k7Skin table.mceLayout tr.mceLast td {border-bottom:1px solid #ABC6DD} .o2k7Skin table.mceToolbar, .o2k7Skin tr.mceFirst .mceToolbar tr td, .o2k7Skin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0} .o2k7Skin .mceIframeContainer {border-top:1px solid #ABC6DD; border-bottom:1px solid #ABC6DD} -.o2k7Skin .mceStatusbar {display:block; font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; height:20px} +.o2k7Skin td.mceToolbar{background:#E5EFFD} +.o2k7Skin .mceStatusbar {background:#E5EFFD; display:block; font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; height:20px} .o2k7Skin .mceStatusbar div {float:left; padding:2px} .o2k7Skin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize; outline:0} .o2k7Skin .mceStatusbar a:hover {text-decoration:underline} @@ -50,19 +51,19 @@ .o2k7Skin .mceSeparator {display:block; background:url(img/button_bg.png) -22px 0; width:5px; height:22px} /* ListBox */ -.o2k7Skin .mceListBox {margin-left:3px} +.o2k7Skin .mceListBox {padding-left: 3px} .o2k7Skin .mceListBox, .o2k7Skin .mceListBox a {display:block} .o2k7Skin .mceListBox .mceText {padding-left:4px; text-align:left; width:70px; border:1px solid #b3c7e1; border-right:0; background:#eaf2fb; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden} .o2k7Skin .mceListBox .mceOpen {width:14px; height:22px; background:url(img/button_bg.png) -66px 0} .o2k7Skin table.mceListBoxEnabled:hover .mceText, .o2k7Skin .mceListBoxHover .mceText, .o2k7Skin .mceListBoxSelected .mceText {background:#FFF} .o2k7Skin table.mceListBoxEnabled:hover .mceOpen, .o2k7Skin .mceListBoxHover .mceOpen, .o2k7Skin .mceListBoxSelected .mceOpen {background-position:-66px -22px} .o2k7Skin .mceListBoxDisabled .mceText {color:gray} -.o2k7Skin .mceListBoxMenu {overflow:auto; overflow-x:hidden} +.o2k7Skin .mceListBoxMenu {overflow:auto; overflow-x:hidden; margin-left:3px} .o2k7Skin .mceOldBoxModel .mceListBox .mceText {height:22px} .o2k7Skin select.mceListBox {font-family:Tahoma,Verdana,Arial,Helvetica; font-size:12px; border:1px solid #b3c7e1; background:#FFF;} /* SplitButton */ -.o2k7Skin .mceSplitButton, .o2k7Skin .mceSplitButton a, .o2k7Skin .mceSplitButton span {display:block; height:22px} +.o2k7Skin .mceSplitButton, .o2k7Skin .mceSplitButton a, .o2k7Skin .mceSplitButton span {display:block; height:22px; direction:ltr} .o2k7Skin .mceSplitButton {background:url(img/button_bg.png)} .o2k7Skin .mceSplitButton a.mceAction {width:22px} .o2k7Skin .mceSplitButton span.mceAction {width:22px; background-image:url(../../img/icons.gif)} @@ -105,6 +106,7 @@ .o2k7Skin .mceNoIcons .mceMenuItemSelected a {background:url(../default/img/menu_arrow.gif) no-repeat -6px center} .o2k7Skin .mceMenu span.mceMenuLine {display:none} .o2k7Skin .mceMenuItemSub a {background:url(../default/img/menu_arrow.gif) no-repeat top right;} +.o2k7Skin .mceMenuItem td, .o2k7Skin .mceMenuItem th {line-height: normal} /* Progress,Resize */ .o2k7Skin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=50); background:#FFF} diff --git a/js/tiny_mce/themes/advanced/skins/o2k7/ui_black.css b/js/tiny_mce/themes/advanced/skins/o2k7/ui_black.css index 153f0c38a6..50c9b76a2d 100644 --- a/js/tiny_mce/themes/advanced/skins/o2k7/ui_black.css +++ b/js/tiny_mce/themes/advanced/skins/o2k7/ui_black.css @@ -1,6 +1,6 @@ /* Black */ .o2k7SkinBlack .mceToolbar .mceToolbarStart span, .o2k7SkinBlack .mceToolbar .mceToolbarEnd span, .o2k7SkinBlack .mceButton, .o2k7SkinBlack .mceSplitButton, .o2k7SkinBlack .mceSeparator, .o2k7SkinBlack .mceSplitButton a.mceOpen, .o2k7SkinBlack .mceListBox a.mceOpen {background-image:url(img/button_bg_black.png)} -.o2k7SkinBlack table, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack .mceMenuItemTitle span.mceText, .o2k7SkinBlack .mceStatusbar div, .o2k7SkinBlack .mceStatusbar span, .o2k7SkinBlack .mceStatusbar a {background:#535353; color:#FFF} +.o2k7SkinBlack td.mceToolbar, .o2k7SkinBlack td.mceStatusbar, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack .mceMenuItemTitle span.mceText, .o2k7SkinBlack .mceStatusbar div, .o2k7SkinBlack .mceStatusbar span, .o2k7SkinBlack .mceStatusbar a {background:#535353; color:#FFF} .o2k7SkinBlack table.mceListBoxEnabled .mceText, o2k7SkinBlack .mceListBox .mceText {background:#FFF; border:1px solid #CBCFD4; border-bottom-color:#989FA9; border-right:0} .o2k7SkinBlack table.mceListBoxEnabled:hover .mceText, .o2k7SkinBlack .mceListBoxHover .mceText, .o2k7SkinBlack .mceListBoxSelected .mceText {background:#FFF; border:1px solid #FFBD69; border-right:0} .o2k7SkinBlack .mceExternalToolbar, .o2k7SkinBlack .mceListBox .mceText, .o2k7SkinBlack div.mceMenu, .o2k7SkinBlack table.mceLayout, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack table.mceLayout tr.mceFirst td, .o2k7SkinBlack table.mceLayout, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack table.mceLayout tr.mceLast td, .o2k7SkinBlack .mceIframeContainer {border-color: #535353;} diff --git a/js/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css b/js/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css index 7fe3b45e12..960a8e4755 100644 --- a/js/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css +++ b/js/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css @@ -1,5 +1,5 @@ /* Silver */ .o2k7SkinSilver .mceToolbar .mceToolbarStart span, .o2k7SkinSilver .mceButton, .o2k7SkinSilver .mceSplitButton, .o2k7SkinSilver .mceSeparator, .o2k7SkinSilver .mceSplitButton a.mceOpen, .o2k7SkinSilver .mceListBox a.mceOpen {background-image:url(img/button_bg_silver.png)} -.o2k7SkinSilver table, .o2k7SkinSilver .mceMenuItemTitle a {background:#eee} +.o2k7SkinSilver td.mceToolbar, .o2k7SkinSilver td.mceStatusbar, .o2k7SkinSilver .mceMenuItemTitle a {background:#eee} .o2k7SkinSilver .mceListBox .mceText {background:#FFF} .o2k7SkinSilver .mceExternalToolbar, .o2k7SkinSilver .mceListBox .mceText, .o2k7SkinSilver div.mceMenu, .o2k7SkinSilver table.mceLayout, .o2k7SkinSilver .mceMenuItemTitle a, .o2k7SkinSilver table.mceLayout tr.mceFirst td, .o2k7SkinSilver table.mceLayout, .o2k7SkinSilver .mceMenuItemTitle a, .o2k7SkinSilver table.mceLayout tr.mceLast td, .o2k7SkinSilver .mceIframeContainer {border-color: #bbb} diff --git a/js/tiny_mce/themes/advanced/source_editor.htm b/js/tiny_mce/themes/advanced/source_editor.htm index 5957bbd178..3c6d65808a 100644 --- a/js/tiny_mce/themes/advanced/source_editor.htm +++ b/js/tiny_mce/themes/advanced/source_editor.htm @@ -6,7 +6,7 @@
    -
    {#advanced_dlg.code_title}
    +
    @@ -17,8 +17,8 @@
    - - + +
    diff --git a/js/tiny_mce/themes/simple/editor_template.js b/js/tiny_mce/themes/simple/editor_template.js index ed89abc067..4b3209cc92 100644 --- a/js/tiny_mce/themes/simple/editor_template.js +++ b/js/tiny_mce/themes/simple/editor_template.js @@ -1 +1 @@ -(function(){var a=tinymce.DOM;tinymce.ThemeManager.requireLangPack("simple");tinymce.create("tinymce.themes.SimpleTheme",{init:function(c,d){var e=this,b=["Bold","Italic","Underline","Strikethrough","InsertUnorderedList","InsertOrderedList"],f=c.settings;e.editor=c;c.onInit.add(function(){c.onNodeChange.add(function(h,g){tinymce.each(b,function(i){g.get(i.toLowerCase()).setActive(h.queryCommandState(i))})});c.dom.loadCSS(d+"/skins/"+f.skin+"/content.css")});a.loadCSS((f.editor_css?c.documentBaseURI.toAbsolute(f.editor_css):"")||d+"/skins/"+f.skin+"/ui.css")},renderUI:function(h){var e=this,i=h.targetNode,b,c,d=e.editor,f=d.controlManager,g;i=a.insertAfter(a.create("span",{id:d.id+"_container","class":"mceEditor "+d.settings.skin+"SimpleSkin"}),i);i=g=a.add(i,"table",{cellPadding:0,cellSpacing:0,"class":"mceLayout"});i=c=a.add(i,"tbody");i=a.add(c,"tr");i=b=a.add(a.add(i,"td"),"div",{"class":"mceIframeContainer"});i=a.add(a.add(c,"tr",{"class":"last"}),"td",{"class":"mceToolbar mceLast",align:"center"});c=e.toolbar=f.createToolbar("tools1");c.add(f.createButton("bold",{title:"simple.bold_desc",cmd:"Bold"}));c.add(f.createButton("italic",{title:"simple.italic_desc",cmd:"Italic"}));c.add(f.createButton("underline",{title:"simple.underline_desc",cmd:"Underline"}));c.add(f.createButton("strikethrough",{title:"simple.striketrough_desc",cmd:"Strikethrough"}));c.add(f.createSeparator());c.add(f.createButton("undo",{title:"simple.undo_desc",cmd:"Undo"}));c.add(f.createButton("redo",{title:"simple.redo_desc",cmd:"Redo"}));c.add(f.createSeparator());c.add(f.createButton("cleanup",{title:"simple.cleanup_desc",cmd:"mceCleanup"}));c.add(f.createSeparator());c.add(f.createButton("insertunorderedlist",{title:"simple.bullist_desc",cmd:"InsertUnorderedList"}));c.add(f.createButton("insertorderedlist",{title:"simple.numlist_desc",cmd:"InsertOrderedList"}));c.renderTo(i);return{iframeContainer:b,editorContainer:d.id+"_container",sizeContainer:g,deltaHeight:-20}},getInfo:function(){return{longname:"Simple theme",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.ThemeManager.add("simple",tinymce.themes.SimpleTheme)})(); \ No newline at end of file +(function(){var a=tinymce.DOM;tinymce.ThemeManager.requireLangPack("simple");tinymce.create("tinymce.themes.SimpleTheme",{init:function(c,d){var e=this,b=["Bold","Italic","Underline","Strikethrough","InsertUnorderedList","InsertOrderedList"],f=c.settings;e.editor=c;c.contentCSS.push(d+"/skins/"+f.skin+"/content.css");c.onInit.add(function(){c.onNodeChange.add(function(h,g){tinymce.each(b,function(i){g.get(i.toLowerCase()).setActive(h.queryCommandState(i))})})});a.loadCSS((f.editor_css?c.documentBaseURI.toAbsolute(f.editor_css):"")||d+"/skins/"+f.skin+"/ui.css")},renderUI:function(h){var e=this,i=h.targetNode,b,c,d=e.editor,f=d.controlManager,g;i=a.insertAfter(a.create("span",{id:d.id+"_container","class":"mceEditor "+d.settings.skin+"SimpleSkin"}),i);i=g=a.add(i,"table",{cellPadding:0,cellSpacing:0,"class":"mceLayout"});i=c=a.add(i,"tbody");i=a.add(c,"tr");i=b=a.add(a.add(i,"td"),"div",{"class":"mceIframeContainer"});i=a.add(a.add(c,"tr",{"class":"last"}),"td",{"class":"mceToolbar mceLast",align:"center"});c=e.toolbar=f.createToolbar("tools1");c.add(f.createButton("bold",{title:"simple.bold_desc",cmd:"Bold"}));c.add(f.createButton("italic",{title:"simple.italic_desc",cmd:"Italic"}));c.add(f.createButton("underline",{title:"simple.underline_desc",cmd:"Underline"}));c.add(f.createButton("strikethrough",{title:"simple.striketrough_desc",cmd:"Strikethrough"}));c.add(f.createSeparator());c.add(f.createButton("undo",{title:"simple.undo_desc",cmd:"Undo"}));c.add(f.createButton("redo",{title:"simple.redo_desc",cmd:"Redo"}));c.add(f.createSeparator());c.add(f.createButton("cleanup",{title:"simple.cleanup_desc",cmd:"mceCleanup"}));c.add(f.createSeparator());c.add(f.createButton("insertunorderedlist",{title:"simple.bullist_desc",cmd:"InsertUnorderedList"}));c.add(f.createButton("insertorderedlist",{title:"simple.numlist_desc",cmd:"InsertOrderedList"}));c.renderTo(i);return{iframeContainer:b,editorContainer:d.id+"_container",sizeContainer:g,deltaHeight:-20}},getInfo:function(){return{longname:"Simple theme",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.ThemeManager.add("simple",tinymce.themes.SimpleTheme)})(); \ No newline at end of file diff --git a/js/tiny_mce/themes/simple/editor_template_src.js b/js/tiny_mce/themes/simple/editor_template_src.js index 4b862d49d6..01ce87c58a 100644 --- a/js/tiny_mce/themes/simple/editor_template_src.js +++ b/js/tiny_mce/themes/simple/editor_template_src.js @@ -19,6 +19,7 @@ var t = this, states = ['Bold', 'Italic', 'Underline', 'Strikethrough', 'InsertUnorderedList', 'InsertOrderedList'], s = ed.settings; t.editor = ed; + ed.contentCSS.push(url + "/skins/" + s.skin + "/content.css"); ed.onInit.add(function() { ed.onNodeChange.add(function(ed, cm) { @@ -26,8 +27,6 @@ cm.get(c.toLowerCase()).setActive(ed.queryCommandState(c)); }); }); - - ed.dom.loadCSS(url + "/skins/" + s.skin + "/content.css"); }); DOM.loadCSS((s.editor_css ? ed.documentBaseURI.toAbsolute(s.editor_css) : '') || url + "/skins/" + s.skin + "/ui.css"); diff --git a/js/tiny_mce/themes/simple/img/icons.gif b/js/tiny_mce/themes/simple/img/icons.gif index 16af141ff0eea376a889b1e8d28e9c1cacaaab16..6fcbcb5dedf16a5fa1d15c2aa127bceb612f1e71 100644 GIT binary patch literal 806 zcmZ?wbhEHbJi#Es@KuxH{{08bHy>kQU|4+kcV*u?6Yu2z|Nk2X_I-c9E~4fBsnb_x z&7Ngzq1inB@Woqi-rnfiGF7yw9zM z^p;~=3MY4TT)2AY!iC=7fBwej_wPS(UDm1P!}|}9?`#au+qhx#R?Fl=KuakHia%Lc z85lGfbU;Rd{N%v)|G<<24;`ug6HAIt=2*?Yu%d)ZG@><(acbwmDSj%f4MMZ#%vkt3 z%+g~)i8kP^LLB_(WJHBo z)4eilyozQ8a&qqSt%<6xpa0;xA7k;M?mchbzI*>+`RnL~M?L!{MDwZt;o_B2F2$0=pQSpQ!u@RcUGT{(44KaY91N#ws_nDH9G%Qf=ZF z5o_THWH`G~`GwyilS^z$ZvV~I`dh4Lx_8c>?R@8gr-07UIgFjp0y#A&c{B)cE>2kS zL5I1;i$zoEA)6qV`HGJvVWE!{8MZ6ST|PC}d%Kid7{KiD{l18xziSGKuWtj9AkWy-*`}#c~0`Lrjq> z-;O-o=3A#@&dst%_SasuJq0xZW;OwR3vM!diY%Es?;J~Pp}LYununP(i|XxU>#u=* zSvNC^0?cJ=S?=UK4&2DdcCO^BsHxjWc4vR-Z64x&8r#>V9!JMd4O!Z*d@mNrgX=jUy;0|T>ZntHjDU$=-I8y`|tN~Y9 literal 1440 zcmV;R1z-9{Nk%w1VaNa!0QUd@Ib*`7v&H}b0P*i`B{WZ*I4YI8{iDPCZ*XyWj;?N! z&ooP8CcKTM%}ImAk&d@bUef&=iA% zhPA3sm56OYcjMRI^s}jof~E0n!SIozxs`y)bZpaM%~elOt(xIz_1F@`xREtxwxO@X zElsNLx;f_MIwnTOux@bk@5r<-;@s){f~fMSskU>S&vlpdmZGk)n^Ks084*pfMo5}`Y)@uBrt7q^ z_xb)XxI@^-XhLVQWPPfUtMQSg&Xb6UQhU2=S3pa1!Lhs1Kwz1)!P59aI6r5pthLM4 zE-ud4`aC>8zybolqcQ$sRq*)W>+kl^)!br%x2LJkVv+Dui1Oh7|6z>ag023Luhg%= z;=sbh)RP30t>V}2$H?fg=;-%zOTU8v0MO8l85I$+z}bYP#G9DS_#hs}n3hj*tissz zAwYQh{QX~VkH5&*9YTcu{{H^`{_yYcW|;u|{Qilm^upTyi?sd!nVG)6{{LrW`s5%! zQETJeu@Y0sB3Qy+jGVB@-BWO)C1U{h_4v@?@UEu*S8lPiucH6>|4vxO2|0#LaF@v0 z@ZaCy@c8hkxVXaB{z|fT@U~;Hv$d$T$J*xpqPpE8TH+G^0=vlI+KzIEuZN}B@UYO} z&dtoGp5{=vw)ErQRcDJbQgSxGf8JYL_`X^{uFH_9uqY`f`}_Of)zF}&w4mVd!0r05 zoM3>k!2kdMA^8LW00930EC2ui0LTCo000R80RIUbNU)&6g9sBUT*$DY!-o(fN}Ncs zqQ#3CGiuz(v7^V2AVW@EluM+^lPFV4B&kwhfCK?JZW}S8Lq-x8D(>2KU{_0tBn}8A zagb%p1Q&P-6u`78(}*2LRH3FT;{^Z%ooYoWl!#X%K7Tem@Rf*AgGMWAZK^N;uLKrJ zgqs_6Dufyfw<06~AZA3KR{>nO09GJYj!yq2Mo2^;St0-;UpPxp*8_}f6+Z>JE!?&a z+dPb*b~hYDra%-%J`C}|)xna%9$;-yz|zc`Z6DmMS)p07fiENwe4t=jwVQEwY|=zo zxL=@s=&E6Qp)TGXT_1)l*emUVx)m?~6;Hl)c5^2e&KlH&3v877L9rfP;Fp}T4iu?af8AOXd@5C0(U&fK3z8Av u{UxbK=c.length){for(e=0,b=g.length;e=c.length||g[e]!=c[e]){f=e+1;break}}}if(g.length=g.length||g[e]!=c[e]){f=e+1;break}}}if(f==1){return h}for(e=0,b=g.length-(f-1);e=0;c--){if(f[c].length==0||f[c]=="."){continue}if(f[c]==".."){b++;continue}if(b>0){b--;continue}h.push(f[c])}c=e.length-b;if(c<=0){g=h.reverse().join("/")}else{g=e.slice(0,c).join("/")+"/"+h.reverse().join("/")}if(g.indexOf("/")!==0){g="/"+g}if(d&&g.lastIndexOf("/")!==g.length-1){g+=d}return g},getURI:function(d){var c,b=this;if(!b.source||d){c="";if(!d){if(b.protocol){c+=b.protocol+"://"}if(b.userInfo){c+=b.userInfo+"@"}if(b.host){c+=b.host}if(b.port){c+=":"+b.port}}if(b.path){c+=b.path}if(b.query){c+="?"+b.query}if(b.anchor){c+="#"+b.anchor}b.source=c}return b.source}})})();(function(){var a=tinymce.each;tinymce.create("static tinymce.util.Cookie",{getHash:function(d){var b=this.get(d),c;if(b){a(b.split("&"),function(e){e=e.split("=");c=c||{};c[unescape(e[0])]=unescape(e[1])})}return c},setHash:function(j,b,g,f,i,c){var h="";a(b,function(e,d){h+=(!h?"":"&")+escape(d)+"="+escape(e)});this.set(j,h,g,f,i,c)},get:function(i){var h=document.cookie,g,f=i+"=",d;if(!h){return}d=h.indexOf("; "+f);if(d==-1){d=h.indexOf(f);if(d!=0){return null}}else{d+=2}g=h.indexOf(";",d);if(g==-1){g=h.length}return unescape(h.substring(d+f.length,g))},set:function(i,b,g,f,h,c){document.cookie=i+"="+escape(b)+((g)?"; expires="+g.toGMTString():"")+((f)?"; path="+escape(f):"")+((h)?"; domain="+h:"")+((c)?"; secure":"")},remove:function(e,b){var c=new Date();c.setTime(c.getTime()-1000);this.set(e,"",c,b,c)}})})();tinymce.create("static tinymce.util.JSON",{serialize:function(e){var c,a,d=tinymce.util.JSON.serialize,b;if(e==null){return"null"}b=typeof e;if(b=="string"){a="\bb\tt\nn\ff\rr\"\"''\\\\";return'"'+e.replace(/([\u0080-\uFFFF\x00-\x1f\"])/g,function(g,f){c=a.indexOf(f);if(c+1){return"\\"+a.charAt(c+1)}g=f.charCodeAt().toString(16);return"\\u"+"0000".substring(g.length)+g})+'"'}if(b=="object"){if(e.hasOwnProperty&&e instanceof Array){for(c=0,a="[";c0?",":"")+d(e[c])}return a+"]"}a="{";for(c in e){a+=typeof e[c]!="function"?(a.length>1?',"':'"')+c+'":'+d(e[c]):""}return a+"}"}return""+e},parse:function(s){try{return eval("("+s+")")}catch(ex){}}});tinymce.create("static tinymce.util.XHR",{send:function(g){var a,e,b=window,h=0;g.scope=g.scope||this;g.success_scope=g.success_scope||g.scope;g.error_scope=g.error_scope||g.scope;g.async=g.async===false?false:true;g.data=g.data||"";function d(i){a=0;try{a=new ActiveXObject(i)}catch(c){}return a}a=b.XMLHttpRequest?new XMLHttpRequest():d("Microsoft.XMLHTTP")||d("Msxml2.XMLHTTP");if(a){if(a.overrideMimeType){a.overrideMimeType(g.content_type)}a.open(g.type||(g.data?"POST":"GET"),g.url,g.async);if(g.content_type){a.setRequestHeader("Content-Type",g.content_type)}a.setRequestHeader("X-Requested-With","XMLHttpRequest");a.send(g.data);function f(){if(!g.async||a.readyState==4||h++>10000){if(g.success&&h<10000&&a.status==200){g.success.call(g.success_scope,""+a.responseText,a,g)}else{if(g.error){g.error.call(g.error_scope,h>10000?"TIMED_OUT":"GENERAL",a,g)}}a=null}else{b.setTimeout(f,10)}}if(!g.async){return f()}e=b.setTimeout(f,10)}}});(function(){var c=tinymce.extend,b=tinymce.util.JSON,a=tinymce.util.XHR;tinymce.create("tinymce.util.JSONRequest",{JSONRequest:function(d){this.settings=c({},d);this.count=0},send:function(f){var e=f.error,d=f.success;f=c(this.settings,f);f.success=function(h,g){h=b.parse(h);if(typeof(h)=="undefined"){h={error:"JSON Parse error."}}if(h.error){e.call(f.error_scope||f.scope,h.error,g)}else{d.call(f.success_scope||f.scope,h.result)}};f.error=function(h,g){e.call(f.error_scope||f.scope,h,g)};f.data=b.serialize({id:f.id||"c"+(this.count++),method:f.method,params:f.params});f.content_type="application/json";a.send(f)},"static":{sendRPC:function(d){return new tinymce.util.JSONRequest().send(d)}}})}());(function(m){var k=m.each,j=m.is,i=m.isWebKit,d=m.isIE,a=/^(H[1-6R]|P|DIV|ADDRESS|PRE|FORM|T(ABLE|BODY|HEAD|FOOT|H|R|D)|LI|OL|UL|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|NOSCRIPT|MENU|ISINDEX|SAMP)$/,e=g("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected"),f=g("src,href,style,coords,shape"),c={"&":"&",'"':""","<":"<",">":">"},n=/[<>&\"]/g,b=/^([a-z0-9],?)+$/i,h=/<(\w+)((?:\s+\w+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)(\s*\/?)>/g,l=/(\w+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g;function g(q){var p={},o;q=q.split(",");for(o=q.length;o>=0;o--){p[q[o]]=1}return p}m.create("tinymce.dom.DOMUtils",{doc:null,root:null,files:null,pixelStyles:/^(top|left|bottom|right|width|height|borderWidth)$/,props:{"for":"htmlFor","class":"className",className:"className",checked:"checked",disabled:"disabled",maxlength:"maxLength",readonly:"readOnly",selected:"selected",value:"value",id:"id",name:"name",type:"type"},DOMUtils:function(u,q){var p=this,o;p.doc=u;p.win=window;p.files={};p.cssFlicker=false;p.counter=0;p.boxModel=!m.isIE||u.compatMode=="CSS1Compat";p.stdMode=u.documentMode===8;p.settings=q=m.extend({keep_values:false,hex_colors:1,process_html:1},q);if(m.isIE6){try{u.execCommand("BackgroundImageCache",false,true)}catch(r){p.cssFlicker=true}}if(q.valid_styles){p._styles={};k(q.valid_styles,function(t,s){p._styles[s]=m.explode(t)})}m.addUnload(p.destroy,p)},getRoot:function(){var o=this,p=o.settings;return(p&&o.get(p.root_element))||o.doc.body},getViewPort:function(p){var q,o;p=!p?this.win:p;q=p.document;o=this.boxModel?q.documentElement:q.body;return{x:p.pageXOffset||o.scrollLeft,y:p.pageYOffset||o.scrollTop,w:p.innerWidth||o.clientWidth,h:p.innerHeight||o.clientHeight}},getRect:function(s){var r,o=this,q;s=o.get(s);r=o.getPos(s);q=o.getSize(s);return{x:r.x,y:r.y,w:q.w,h:q.h}},getSize:function(r){var p=this,o,q;r=p.get(r);o=p.getStyle(r,"width");q=p.getStyle(r,"height");if(o.indexOf("px")===-1){o=0}if(q.indexOf("px")===-1){q=0}return{w:parseInt(o)||r.offsetWidth||r.clientWidth,h:parseInt(q)||r.offsetHeight||r.clientHeight}},getParent:function(q,p,o){return this.getParents(q,p,o,false)},getParents:function(z,v,s,y){var q=this,p,u=q.settings,x=[];z=q.get(z);y=y===undefined;if(u.strict_root){s=s||q.getRoot()}if(j(v,"string")){p=v;if(v==="*"){v=function(o){return o.nodeType==1}}else{v=function(o){return q.is(o,p)}}}while(z){if(z==s||!z.nodeType||z.nodeType===9){break}if(!v||v(z)){if(y){x.push(z)}else{return z}}z=z.parentNode}return y?x:null},get:function(o){var p;if(o&&this.doc&&typeof(o)=="string"){p=o;o=this.doc.getElementById(o);if(o&&o.id!==p){return this.doc.getElementsByName(p)[1]}}return o},getNext:function(p,o){return this._findSib(p,o,"nextSibling")},getPrev:function(p,o){return this._findSib(p,o,"previousSibling")},select:function(q,p){var o=this;return m.dom.Sizzle(q,o.get(p)||o.get(o.settings.root_element)||o.doc,[])},is:function(q,o){var p;if(q.length===undefined){if(o==="*"){return q.nodeType==1}if(b.test(o)){o=o.toLowerCase().split(/,/);q=q.nodeName.toLowerCase();for(p=o.length-1;p>=0;p--){if(o[p]==q){return true}}return false}}return m.dom.Sizzle.matches(o,q.nodeType?[q]:q).length>0},add:function(s,v,o,r,u){var q=this;return this.run(s,function(y){var x,t;x=j(v,"string")?q.doc.createElement(v):v;q.setAttribs(x,o);if(r){if(r.nodeType){x.appendChild(r)}else{q.setHTML(x,r)}}return !u?y.appendChild(x):x})},create:function(q,o,p){return this.add(this.doc.createElement(q),q,o,p,1)},createHTML:function(v,p,s){var u="",r=this,q;u+="<"+v;for(q in p){if(p.hasOwnProperty(q)){u+=" "+q+'="'+r.encode(p[q])+'"'}}if(m.is(s)){return u+">"+s+""}return u+" />"},remove:function(o,p){return this.run(o,function(r){var q,s;q=r.parentNode;if(!q){return null}if(p){while(s=r.firstChild){if(!m.isIE||s.nodeType!==3||s.nodeValue){q.insertBefore(s,r)}else{r.removeChild(s)}}}return q.removeChild(r)})},setStyle:function(r,o,p){var q=this;return q.run(r,function(v){var u,t;u=v.style;o=o.replace(/-(\D)/g,function(x,s){return s.toUpperCase()});if(q.pixelStyles.test(o)&&(m.is(p,"number")||/^[\-0-9\.]+$/.test(p))){p+="px"}switch(o){case"opacity":if(d){u.filter=p===""?"":"alpha(opacity="+(p*100)+")";if(!r.currentStyle||!r.currentStyle.hasLayout){u.display="inline-block"}}u[o]=u["-moz-opacity"]=u["-khtml-opacity"]=p||"";break;case"float":d?u.styleFloat=p:u.cssFloat=p;break;default:u[o]=p||""}if(q.settings.update_styles){q.setAttrib(v,"_mce_style")}})},getStyle:function(r,o,q){r=this.get(r);if(!r){return false}if(this.doc.defaultView&&q){o=o.replace(/[A-Z]/g,function(s){return"-"+s});try{return this.doc.defaultView.getComputedStyle(r,null).getPropertyValue(o)}catch(p){return null}}o=o.replace(/-(\D)/g,function(t,s){return s.toUpperCase()});if(o=="float"){o=d?"styleFloat":"cssFloat"}if(r.currentStyle&&q){return r.currentStyle[o]}return r.style[o]},setStyles:function(u,v){var q=this,r=q.settings,p;p=r.update_styles;r.update_styles=0;k(v,function(o,s){q.setStyle(u,s,o)});r.update_styles=p;if(r.update_styles){q.setAttrib(u,r.cssText)}},setAttrib:function(q,r,o){var p=this;if(!q||!r){return}if(p.settings.strict){r=r.toLowerCase()}return this.run(q,function(u){var t=p.settings;switch(r){case"style":if(!j(o,"string")){k(o,function(s,x){p.setStyle(u,x,s)});return}if(t.keep_values){if(o&&!p._isRes(o)){u.setAttribute("_mce_style",o,2)}else{u.removeAttribute("_mce_style",2)}}u.style.cssText=o;break;case"class":u.className=o||"";break;case"src":case"href":if(t.keep_values){if(t.url_converter){o=t.url_converter.call(t.url_converter_scope||p,o,r,u)}p.setAttrib(u,"_mce_"+r,o,2)}break;case"shape":u.setAttribute("_mce_style",o);break}if(j(o)&&o!==null&&o.length!==0){u.setAttribute(r,""+o,2)}else{u.removeAttribute(r,2)}})},setAttribs:function(q,r){var p=this;return this.run(q,function(o){k(r,function(s,t){p.setAttrib(o,t,s)})})},getAttrib:function(r,s,q){var o,p=this;r=p.get(r);if(!r||r.nodeType!==1){return false}if(!j(q)){q=""}if(/^(src|href|style|coords|shape)$/.test(s)){o=r.getAttribute("_mce_"+s);if(o){return o}}if(d&&p.props[s]){o=r[p.props[s]];o=o&&o.nodeValue?o.nodeValue:o}if(!o){o=r.getAttribute(s,2)}if(/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(s)){if(r[p.props[s]]===true&&o===""){return s}return o?s:""}if(r.nodeName==="FORM"&&r.getAttributeNode(s)){return r.getAttributeNode(s).nodeValue}if(s==="style"){o=o||r.style.cssText;if(o){o=p.serializeStyle(p.parseStyle(o),r.nodeName);if(p.settings.keep_values&&!p._isRes(o)){r.setAttribute("_mce_style",o)}}}if(i&&s==="class"&&o){o=o.replace(/(apple|webkit)\-[a-z\-]+/gi,"")}if(d){switch(s){case"rowspan":case"colspan":if(o===1){o=""}break;case"size":if(o==="+0"||o===20||o===0){o=""}break;case"width":case"height":case"vspace":case"checked":case"disabled":case"readonly":if(o===0){o=""}break;case"hspace":if(o===-1){o=""}break;case"maxlength":case"tabindex":if(o===32768||o===2147483647||o==="32768"){o=""}break;case"multiple":case"compact":case"noshade":case"nowrap":if(o===65535){return s}return q;case"shape":o=o.toLowerCase();break;default:if(s.indexOf("on")===0&&o){o=(""+o).replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/,"$1")}}}return(o!==undefined&&o!==null&&o!=="")?""+o:q},getPos:function(A,s){var p=this,o=0,z=0,u,v=p.doc,q;A=p.get(A);s=s||v.body;if(A){if(d&&!p.stdMode){A=A.getBoundingClientRect();u=p.boxModel?v.documentElement:v.body;o=p.getStyle(p.select("html")[0],"borderWidth");o=(o=="medium"||p.boxModel&&!p.isIE6)&&2||o;A.top+=p.win.self!=p.win.top?2:0;return{x:A.left+u.scrollLeft-o,y:A.top+u.scrollTop-o}}q=A;while(q&&q!=s&&q.nodeType){o+=q.offsetLeft||0;z+=q.offsetTop||0;q=q.offsetParent}q=A.parentNode;while(q&&q!=s&&q.nodeType){o-=q.scrollLeft||0;z-=q.scrollTop||0;q=q.parentNode}}return{x:o,y:z}},parseStyle:function(r){var u=this,v=u.settings,x={};if(!r){return x}function p(D,A,C){var z,B,o,y;z=x[D+"-top"+A];if(!z){return}B=x[D+"-right"+A];if(z!=B){return}o=x[D+"-bottom"+A];if(B!=o){return}y=x[D+"-left"+A];if(o!=y){return}x[C]=y;delete x[D+"-top"+A];delete x[D+"-right"+A];delete x[D+"-bottom"+A];delete x[D+"-left"+A]}function q(y,s,o,A){var z;z=x[s];if(!z){return}z=x[o];if(!z){return}z=x[A];if(!z){return}x[y]=x[s]+" "+x[o]+" "+x[A];delete x[s];delete x[o];delete x[A]}r=r.replace(/&(#?[a-z0-9]+);/g,"&$1_MCE_SEMI_");k(r.split(";"),function(s){var o,t=[];if(s){s=s.replace(/_MCE_SEMI_/g,";");s=s.replace(/url\([^\)]+\)/g,function(y){t.push(y);return"url("+t.length+")"});s=s.split(":");o=m.trim(s[1]);o=o.replace(/url\(([^\)]+)\)/g,function(z,y){return t[parseInt(y)-1]});o=o.replace(/rgb\([^\)]+\)/g,function(y){return u.toHex(y)});if(v.url_converter){o=o.replace(/url\([\'\"]?([^\)\'\"]+)[\'\"]?\)/g,function(y,z){return"url("+v.url_converter.call(v.url_converter_scope||u,u.decode(z),"style",null)+")"})}x[m.trim(s[0]).toLowerCase()]=o}});p("border","","border");p("border","-width","border-width");p("border","-color","border-color");p("border","-style","border-style");p("padding","","padding");p("margin","","margin");q("border","border-width","border-style","border-color");if(d){if(x.border=="medium none"){x.border=""}}return x},serializeStyle:function(v,p){var q=this,r="";function u(s,o){if(o&&s){if(o.indexOf("-")===0){return}switch(o){case"font-weight":if(s==700){s="bold"}break;case"color":case"background-color":s=s.toLowerCase();break}r+=(r?" ":"")+o+": "+s+";"}}if(p&&q._styles){k(q._styles["*"],function(o){u(v[o],o)});k(q._styles[p.toLowerCase()],function(o){u(v[o],o)})}else{k(v,u)}return r},loadCSS:function(o){var q=this,r=q.doc,p;if(!o){o=""}p=q.select("head")[0];k(o.split(","),function(s){var t;if(q.files[s]){return}q.files[s]=true;t=q.create("link",{rel:"stylesheet",href:m._addVer(s)});if(d&&r.documentMode){t.onload=function(){r.recalc();t.onload=null}}p.appendChild(t)})},addClass:function(o,p){return this.run(o,function(q){var r;if(!p){return 0}if(this.hasClass(q,p)){return q.className}r=this.removeClass(q,p);return q.className=(r!=""?(r+" "):"")+p})},removeClass:function(q,r){var o=this,p;return o.run(q,function(t){var s;if(o.hasClass(t,r)){if(!p){p=new RegExp("(^|\\s+)"+r+"(\\s+|$)","g")}s=t.className.replace(p," ");s=m.trim(s!=" "?s:"");t.className=s;if(!s){t.removeAttribute("class");t.removeAttribute("className")}return s}return t.className})},hasClass:function(p,o){p=this.get(p);if(!p||!o){return false}return(" "+p.className+" ").indexOf(" "+o+" ")!==-1},show:function(o){return this.setStyle(o,"display","block")},hide:function(o){return this.setStyle(o,"display","none")},isHidden:function(o){o=this.get(o);return !o||o.style.display=="none"||this.getStyle(o,"display")=="none"},uniqueId:function(o){return(!o?"mce_":o)+(this.counter++)},setHTML:function(q,p){var o=this;return this.run(q,function(v){var r,t,s,z,u,r;p=o.processHTML(p);if(d){function y(){while(v.firstChild){v.firstChild.removeNode()}try{v.innerHTML="
    "+p;v.removeChild(v.firstChild)}catch(x){r=o.create("div");r.innerHTML="
    "+p;k(r.childNodes,function(B,A){if(A){v.appendChild(B)}})}}if(o.settings.fix_ie_paragraphs){p=p.replace(/

    <\/p>|]+)><\/p>|/gi,' 

    ')}y();if(o.settings.fix_ie_paragraphs){s=v.getElementsByTagName("p");for(t=s.length-1,r=0;t>=0;t--){z=s[t];if(!z.hasChildNodes()){if(!z._mce_keep){r=1;break}z.removeAttribute("_mce_keep")}}}if(r){p=p.replace(/

    ]+)>|

    /ig,'

    ');p=p.replace(/<\/p>/gi,"
    ");y();if(o.settings.fix_ie_paragraphs){s=v.getElementsByTagName("DIV");for(t=s.length-1;t>=0;t--){z=s[t];if(z._mce_tmp){u=o.doc.createElement("p");z.cloneNode(false).outerHTML.replace(/([a-z0-9\-_]+)=/gi,function(A,x){var B;if(x!=="_mce_tmp"){B=z.getAttribute(x);if(!B&&x==="class"){B=z.className}u.setAttribute(x,B)}});for(r=0;r]+)\/>|/gi,"");if(q.keep_values){if(/)/g,"\n");t=t.replace(/^[\r\n]*|[\r\n]*$/g,"");t=t.replace(/^\s*(\/\/\s*|\]\]>|-->|\]\]-->)\s*$/g,"");return t}r=r.replace(/]+|)>([\s\S]*?)<\/script>/gi,function(s,x,t){if(!x){x=' type="text/javascript"'}x=x.replace(/src=\"([^\"]+)\"?/i,function(y,z){if(q.url_converter){z=p.encode(q.url_converter.call(q.url_converter_scope||p,p.decode(z),"src","script"))}return'_mce_src="'+z+'"'});if(m.trim(t)){v.push(o(t));t=""}return""+t+""});r=r.replace(/]+|)>([\s\S]*?)<\/style>/gi,function(s,x,t){if(t){v.push(o(t));t=""}return""+t+""});r=r.replace(/]+|)>([\s\S]*?)<\/noscript>/g,function(s,x,t){return""})}r=r.replace(//g,"");function u(s){return s.replace(h,function(y,z,x,t){return"<"+z+x.replace(l,function(B,A,E,D,C){var F;A=A.toLowerCase();E=E||D||C||"";if(e[A]){if(E==="false"||E==="0"){return}return A+'="'+A+'"'}if(f[A]&&x.indexOf("_mce_"+A)==-1){F=p.decode(E);if(q.url_converter&&(A=="src"||A=="href")){F=q.url_converter.call(q.url_converter_scope||p,F,A,z)}if(A=="style"){F=p.serializeStyle(p.parseStyle(F),A)}return A+'="'+E+'" _mce_'+A+'="'+p.encode(F)+'"'}return B})+t+">"})}r=u(r);r=r.replace(/MCE_SCRIPT:([0-9]+)/g,function(t,s){return v[s]})}return r},getOuterHTML:function(o){var p;o=this.get(o);if(!o){return null}if(o.outerHTML!==undefined){return o.outerHTML}p=(o.ownerDocument||this.doc).createElement("body");p.appendChild(o.cloneNode(true));return p.innerHTML},setOuterHTML:function(r,p,s){var o=this;function q(u,t,x){var y,v;v=x.createElement("body");v.innerHTML=t;y=v.lastChild;while(y){o.insertAfter(y.cloneNode(true),u);y=y.previousSibling}o.remove(u)}return this.run(r,function(u){u=o.get(u);if(u.nodeType==1){s=s||u.ownerDocument||o.doc;if(d){try{if(d&&u.nodeType==1){u.outerHTML=p}else{q(u,p,s)}}catch(t){q(u,p,s)}}else{q(u,p,s)}}})},decode:function(p){var q,r,o;if(/&[\w#]+;/.test(p)){q=this.doc.createElement("div");q.innerHTML=p;r=q.firstChild;o="";if(r){do{o+=r.nodeValue}while(r=r.nextSibling)}return o||p}return p},encode:function(o){return(""+o).replace(n,function(p){return c[p]})},insertAfter:function(o,p){p=this.get(p);return this.run(o,function(r){var q,s;q=p.parentNode;s=p.nextSibling;if(s){q.insertBefore(r,s)}else{q.appendChild(r)}return r})},isBlock:function(o){if(o.nodeType&&o.nodeType!==1){return false}o=o.nodeName||o;return a.test(o)},replace:function(s,r,p){var q=this;if(j(r,"array")){s=s.cloneNode(true)}return q.run(r,function(t){if(p){k(m.grep(t.childNodes),function(o){s.appendChild(o)})}return t.parentNode.replaceChild(s,t)})},rename:function(r,o){var q=this,p;if(r.nodeName!=o.toUpperCase()){p=q.create(o);k(q.getAttribs(r),function(s){q.setAttrib(p,s.nodeName,q.getAttrib(r,s.nodeName))});q.replace(p,r,1)}return p||r},findCommonAncestor:function(q,o){var r=q,p;while(r){p=o;while(p&&r!=p){p=p.parentNode}if(r==p){break}r=r.parentNode}if(!r&&q.ownerDocument){return q.ownerDocument.documentElement}return r},toHex:function(o){var q=/^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(o);function p(r){r=parseInt(r).toString(16);return r.length>1?r:"0"+r}if(q){o="#"+p(q[1])+p(q[2])+p(q[3]);return o}return o},getClasses:function(){var s=this,o=[],r,u={},v=s.settings.class_filter,q;if(s.classes){return s.classes}function x(t){k(t.imports,function(y){x(y)});k(t.cssRules||t.rules,function(y){switch(y.type||1){case 1:if(y.selectorText){k(y.selectorText.split(","),function(z){z=z.replace(/^\s*|\s*$|^\s\./g,"");if(/\.mce/.test(z)||!/\.[\w\-]+$/.test(z)){return}q=z;z=z.replace(/.*\.([a-z0-9_\-]+).*/i,"$1");if(v&&!(z=v(z,q))){return}if(!u[z]){o.push({"class":z});u[z]=1}})}break;case 3:x(y.styleSheet);break}})}try{k(s.doc.styleSheets,x)}catch(p){}if(o.length>0){s.classes=o}return o},run:function(u,r,q){var p=this,v;if(p.doc&&typeof(u)==="string"){u=p.get(u)}if(!u){return false}q=q||this;if(!u.nodeType&&(u.length||u.length===0)){v=[];k(u,function(s,o){if(s){if(typeof(s)=="string"){s=p.doc.getElementById(s)}v.push(r.call(q,s,o))}});return v}return r.call(q,u)},getAttribs:function(q){var p;q=this.get(q);if(!q){return[]}if(d){p=[];if(q.nodeName=="OBJECT"){return q.attributes}if(q.nodeName==="OPTION"&&this.getAttrib(q,"selected")){p.push({specified:1,nodeName:"selected"})}q.cloneNode(false).outerHTML.replace(/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi,"").replace(/[\w:\-]+/gi,function(o){p.push({specified:1,nodeName:o})});return p}return q.attributes},destroy:function(p){var o=this;if(o.events){o.events.destroy()}o.win=o.doc=o.root=o.events=null;if(!p){m.removeUnload(o.destroy)}},createRng:function(){var o=this.doc;return o.createRange?o.createRange():new m.dom.Range(this)},nodeIndex:function(s,t){var o=0,q,r,p;if(s){for(q=s.nodeType,s=s.previousSibling,r=s;s;s=s.previousSibling){p=s.nodeType;if(t&&p==3){if(p==q||!s.nodeValue.length){continue}}o++;q=p}}return o},split:function(u,s,y){var z=this,o=z.createRng(),v,q,x;function p(A){var t,r=A.childNodes;if(A.nodeType==1&&A.getAttribute("_mce_type")=="bookmark"){return}for(t=r.length-1;t>=0;t--){p(r[t])}if(A.nodeType!=9){if(A.nodeType==3&&A.nodeValue.length>0){return}if(A.nodeType==1){r=A.childNodes;if(r.length==1&&r[0]&&r[0].nodeType==1&&r[0].getAttribute("_mce_type")=="bookmark"){A.parentNode.insertBefore(r[0],A)}if(r.length||/^(br|hr|input|img)$/i.test(A.nodeName)){return}}z.remove(A)}return A}if(u&&s){o.setStart(u.parentNode,z.nodeIndex(u));o.setEnd(s.parentNode,z.nodeIndex(s));v=o.extractContents();o=z.createRng();o.setStart(s.parentNode,z.nodeIndex(s)+1);o.setEnd(u.parentNode,z.nodeIndex(u)+1);q=o.extractContents();x=u.parentNode;x.insertBefore(p(v),u);if(y){x.replaceChild(y,s)}else{x.insertBefore(s,u)}x.insertBefore(p(q),u);z.remove(u);return y||s}},bind:function(s,o,r,q){var p=this;if(!p.events){p.events=new m.dom.EventUtils()}return p.events.add(s,o,r,q||this)},unbind:function(r,o,q){var p=this;if(!p.events){p.events=new m.dom.EventUtils()}return p.events.remove(r,o,q)},_findSib:function(r,o,p){var q=this,s=o;if(r){if(j(s,"string")){s=function(t){return q.is(t,o)}}for(r=r[p];r;r=r[p]){if(s(r)){return r}}}return null},_isRes:function(o){return/^(top|left|bottom|right|width|height)/i.test(o)||/;\s*(top|left|bottom|right|width|height)/i.test(o)}});m.DOM=new m.dom.DOMUtils(document,{process_html:0})})(tinymce);(function(a){function b(c){var N=this,e=c.doc,S=0,E=1,j=2,D=true,R=false,U="startOffset",h="startContainer",P="endContainer",z="endOffset",k=tinymce.extend,n=c.nodeIndex;k(N,{startContainer:e,startOffset:0,endContainer:e,endOffset:0,collapsed:D,commonAncestorContainer:e,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3,setStart:q,setEnd:s,setStartBefore:g,setStartAfter:I,setEndBefore:J,setEndAfter:u,collapse:A,selectNode:x,selectNodeContents:F,compareBoundaryPoints:v,deleteContents:p,extractContents:H,cloneContents:d,insertNode:C,surroundContents:M,cloneRange:K});function q(V,t){B(D,V,t)}function s(V,t){B(R,V,t)}function g(t){q(t.parentNode,n(t))}function I(t){q(t.parentNode,n(t)+1)}function J(t){s(t.parentNode,n(t))}function u(t){s(t.parentNode,n(t)+1)}function A(t){if(t){N[P]=N[h];N[z]=N[U]}else{N[h]=N[P];N[U]=N[z]}N.collapsed=D}function x(t){g(t);u(t)}function F(t){q(t,0);s(t,t.nodeType===1?t.childNodes.length:t.nodeValue.length)}function v(W,X){var Z=N[h],Y=N[U],V=N[P],t=N[z];if(W===0){return G(Z,Y,Z,Y)}if(W===1){return G(Z,Y,V,t)}if(W===2){return G(V,t,V,t)}if(W===3){return G(V,t,Z,Y)}}function p(){m(j)}function H(){return m(S)}function d(){return m(E)}function C(Y){var V=this[h],t=this[U],X,W;if((V.nodeType===3||V.nodeType===4)&&V.nodeValue){if(!t){V.parentNode.insertBefore(Y,V)}else{if(t>=V.nodeValue.length){c.insertAfter(Y,V)}else{X=V.splitText(t);V.parentNode.insertBefore(Y,X)}}}else{if(V.childNodes.length>0){W=V.childNodes[t]}if(W){V.insertBefore(Y,W)}else{V.appendChild(Y)}}}function M(V){var t=N.extractContents();N.insertNode(V);V.appendChild(t);N.selectNode(V)}function K(){return k(new b(c),{startContainer:N[h],startOffset:N[U],endContainer:N[P],endOffset:N[z],collapsed:N.collapsed,commonAncestorContainer:N.commonAncestorContainer})}function O(t,V){var W;if(t.nodeType==3){return t}if(V<0){return t}W=t.firstChild;while(W&&V>0){--V;W=W.nextSibling}if(W){return W}return t}function l(){return(N[h]==N[P]&&N[U]==N[z])}function G(X,Z,V,Y){var aa,W,t,ab,ad,ac;if(X==V){if(Z==Y){return 0}if(Z0){N.collapse(V)}}else{N.collapse(V)}N.collapsed=l();N.commonAncestorContainer=c.findCommonAncestor(N[h],N[P])}function m(ab){var aa,X=0,ad=0,V,Z,W,Y,t,ac;if(N[h]==N[P]){return f(ab)}for(aa=N[P],V=aa.parentNode;V;aa=V,V=V.parentNode){if(V==N[h]){return r(aa,ab)}++X}for(aa=N[h],V=aa.parentNode;V;aa=V,V=V.parentNode){if(V==N[P]){return T(aa,ab)}++ad}Z=ad-X;W=N[h];while(Z>0){W=W.parentNode;Z--}Y=N[P];while(Z<0){Y=Y.parentNode;Z++}for(t=W.parentNode,ac=Y.parentNode;t!=ac;t=t.parentNode,ac=ac.parentNode){W=t;Y=ac}return o(W,Y,ab)}function f(Z){var ab,Y,X,aa,t,W,V;if(Z!=j){ab=e.createDocumentFragment()}if(N[U]==N[z]){return ab}if(N[h].nodeType==3){Y=N[h].nodeValue;X=Y.substring(N[U],N[z]);if(Z!=E){N[h].deleteData(N[U],N[z]-N[U]);N.collapse(D)}if(Z==j){return}ab.appendChild(e.createTextNode(X));return ab}aa=O(N[h],N[U]);t=N[z]-N[U];while(t>0){W=aa.nextSibling;V=y(aa,Z);if(ab){ab.appendChild(V)}--t;aa=W}if(Z!=E){N.collapse(D)}return ab}function r(ab,Y){var aa,Z,V,t,X,W;if(Y!=j){aa=e.createDocumentFragment()}Z=i(ab,Y);if(aa){aa.appendChild(Z)}V=n(ab);t=V-N[U];if(t<=0){if(Y!=E){N.setEndBefore(ab);N.collapse(R)}return aa}Z=ab.previousSibling;while(t>0){X=Z.previousSibling;W=y(Z,Y);if(aa){aa.insertBefore(W,aa.firstChild)}--t;Z=X}if(Y!=E){N.setEndBefore(ab);N.collapse(R)}return aa}function T(Z,Y){var ab,V,aa,t,X,W;if(Y!=j){ab=e.createDocumentFragment()}aa=Q(Z,Y);if(ab){ab.appendChild(aa)}V=n(Z);++V;t=N[z]-V;aa=Z.nextSibling;while(t>0){X=aa.nextSibling;W=y(aa,Y);if(ab){ab.appendChild(W)}--t;aa=X}if(Y!=E){N.setStartAfter(Z);N.collapse(D)}return ab}function o(Z,t,ac){var W,ae,Y,aa,ab,V,ad,X;if(ac!=j){ae=e.createDocumentFragment()}W=Q(Z,ac);if(ae){ae.appendChild(W)}Y=Z.parentNode;aa=n(Z);ab=n(t);++aa;V=ab-aa;ad=Z.nextSibling;while(V>0){X=ad.nextSibling;W=y(ad,ac);if(ae){ae.appendChild(W)}ad=X;--V}W=i(t,ac);if(ae){ae.appendChild(W)}if(ac!=E){N.setStartAfter(Z);N.collapse(D)}return ae}function i(aa,ab){var W=O(N[P],N[z]-1),ac,Z,Y,t,V,X=W!=N[P];if(W==aa){return L(W,X,R,ab)}ac=W.parentNode;Z=L(ac,R,R,ab);while(ac){while(W){Y=W.previousSibling;t=L(W,X,R,ab);if(ab!=j){Z.insertBefore(t,Z.firstChild)}X=D;W=Y}if(ac==aa){return Z}W=ac.previousSibling;ac=ac.parentNode;V=L(ac,R,R,ab);if(ab!=j){V.appendChild(Z)}Z=V}}function Q(aa,ab){var X=O(N[h],N[U]),Y=X!=N[h],ac,Z,W,t,V;if(X==aa){return L(X,Y,D,ab)}ac=X.parentNode;Z=L(ac,R,D,ab);while(ac){while(X){W=X.nextSibling;t=L(X,Y,D,ab);if(ab!=j){Z.appendChild(t)}Y=D;X=W}if(ac==aa){return Z}X=ac.nextSibling;ac=ac.parentNode;V=L(ac,R,D,ab);if(ab!=j){V.appendChild(Z)}Z=V}}function L(t,Y,ab,ac){var X,W,Z,V,aa;if(Y){return y(t,ac)}if(t.nodeType==3){X=t.nodeValue;if(ab){V=N[U];W=X.substring(V);Z=X.substring(0,V)}else{V=N[z];W=X.substring(0,V);Z=X.substring(V)}if(ac!=E){t.nodeValue=Z}if(ac==j){return}aa=t.cloneNode(R);aa.nodeValue=W;return aa}if(ac==j){return}return t.cloneNode(R)}function y(V,t){if(t!=j){return t==E?V.cloneNode(D):V}V.parentNode.removeChild(V)}}a.Range=b})(tinymce.dom);(function(){function a(g){var i=this,j="\uFEFF",e,h,d=g.dom,c=true,f=false;function b(){var n=g.getRng(),k=d.createRng(),m,o;m=n.item?n.item(0):n.parentElement();if(m.ownerDocument!=d.doc){return k}if(n.item||!m.hasChildNodes()){k.setStart(m.parentNode,d.nodeIndex(m));k.setEnd(k.startContainer,k.startOffset+1);return k}o=g.isCollapsed();function l(s){var u,q,t,p,A=0,x,y,z,r,v;r=n.duplicate();r.collapse(s);u=d.create("a");z=r.parentElement();if(!z.hasChildNodes()){k[s?"setStart":"setEnd"](z,0);return}z.appendChild(u);r.moveToElementText(u);v=n.compareEndPoints(s?"StartToStart":"EndToEnd",r);if(v>0){k[s?"setStartAfter":"setEndAfter"](z);d.remove(u);return}p=tinymce.grep(z.childNodes);x=p.length-1;while(A<=x){y=Math.floor((A+x)/2);z.insertBefore(u,p[y]);r.moveToElementText(u);v=n.compareEndPoints(s?"StartToStart":"EndToEnd",r);if(v>0){A=y+1}else{if(v<0){x=y-1}else{found=true;break}}}q=v>0||y==0?u.nextSibling:u.previousSibling;if(q.nodeType==1){d.remove(u);t=d.nodeIndex(q);q=q.parentNode;if(!s||y>0){t++}}else{if(v>0||y==0){r.setEndPoint(s?"StartToStart":"EndToEnd",n);t=r.text.length}else{r.setEndPoint(s?"StartToStart":"EndToEnd",n);t=q.nodeValue.length-r.text.length}d.remove(u)}k[s?"setStart":"setEnd"](q,t)}l(true);if(!o){l()}return k}this.addRange=function(l){var t,A,z=g.dom.doc,r=z.body,u,n,y,o,s,k,p,q,x,m;this.destroy();y=l.startContainer;o=l.startOffset;s=l.endContainer;k=l.endOffset;t=r.createTextRange();if(y==z||s==z){t=r.createTextRange();t.collapse();t.select();return}if(y.nodeType==1&&y.hasChildNodes()){q=y.childNodes.length-1;if(o>q){x=1;y=y.childNodes[q]}else{y=y.childNodes[o]}if(y.nodeType==3){o=0}}if(s.nodeType==1&&s.hasChildNodes()){q=s.childNodes.length-1;if(k==0){m=1;s=s.childNodes[0]}else{s=s.childNodes[Math.min(q,k-1)];if(s.nodeType==3){k=s.nodeValue.length}}}if(y==s&&y.nodeType==1){if(/^(IMG|TABLE)$/.test(y.nodeName)&&o!=k){t=r.createControlRange();t.addElement(y)}else{t=r.createTextRange();if(!y.hasChildNodes()&&y.canHaveHTML){y.innerHTML=j}t.moveToElementText(y);if(y.innerHTML==j){t.collapse(c);y.removeChild(y.firstChild)}}if(o==k){t.collapse(k<=l.endContainer.childNodes.length-1)}t.select();t.scrollIntoView();return}t=r.createTextRange();p=z.createElement("span");p.innerHTML=" ";if(y.nodeType==3){if(x){d.insertAfter(p,y)}else{y.parentNode.insertBefore(p,y)}t.moveToElementText(p);p.parentNode.removeChild(p);if(o>0){t.move("character",o)}}else{t.moveToElementText(y);if(x){t.collapse(f)}}if(y==s&&y.nodeType==3){try{t.moveEnd("character",k-o);t.select();t.scrollIntoView()}catch(v){}return}A=r.createTextRange();if(s.nodeType==3){s.parentNode.insertBefore(p,s);A.moveToElementText(p);p.parentNode.removeChild(p);A.move("character",k);t.setEndPoint("EndToStart",A)}else{A.moveToElementText(s);A.collapse(!!m);t.setEndPoint("EndToEnd",A)}t.select();t.scrollIntoView()};this.getRangeAt=function(){if(!e||!tinymce.dom.RangeUtils.compareRanges(h,g.getRng())){e=b();h=g.getRng()}try{e.startContainer.nextSibling}catch(k){e=b();h=null}return e};this.destroy=function(){h=e=null};if(g.dom.boxModel){(function(){var q=d.doc,l=q.body,n,o;q.documentElement.unselectable=c;function p(r,u){var s=l.createTextRange();try{s.moveToPoint(r,u)}catch(t){s=null}return s}function m(s){var r;if(s.button){r=p(s.x,s.y);if(r){if(r.compareEndPoints("StartToStart",o)>0){r.setEndPoint("StartToStart",o)}else{r.setEndPoint("EndToEnd",o)}r.select()}}else{k()}}function k(){d.unbind(q,"mouseup",k);d.unbind(q,"mousemove",m);n=0}d.bind(q,"mousedown",function(r){if(r.target.nodeName==="HTML"){if(n){k()}n=1;o=p(r.x,r.y);if(o){d.bind(q,"mouseup",k);d.bind(q,"mousemove",m);o.select()}}})})()}}tinymce.dom.TridentSelection=a})();(function(){var p=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,j=0,d=Object.prototype.toString,o=false,i=true;[0,0].sort(function(){i=false;return 0});var b=function(v,e,z,A){z=z||[];e=e||document;var C=e;if(e.nodeType!==1&&e.nodeType!==9){return[]}if(!v||typeof v!=="string"){return z}var x=[],s,E,H,r,u=true,t=b.isXML(e),B=v,D,G,F,y;do{p.exec("");s=p.exec(B);if(s){B=s[3];x.push(s[1]);if(s[2]){r=s[3];break}}}while(s);if(x.length>1&&k.exec(v)){if(x.length===2&&f.relative[x[0]]){E=h(x[0]+x[1],e)}else{E=f.relative[x[0]]?[e]:b(x.shift(),e);while(x.length){v=x.shift();if(f.relative[v]){v+=x.shift()}E=h(v,E)}}}else{if(!A&&x.length>1&&e.nodeType===9&&!t&&f.match.ID.test(x[0])&&!f.match.ID.test(x[x.length-1])){D=b.find(x.shift(),e,t);e=D.expr?b.filter(D.expr,D.set)[0]:D.set[0]}if(e){D=A?{expr:x.pop(),set:a(A)}:b.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&e.parentNode?e.parentNode:e,t);E=D.expr?b.filter(D.expr,D.set):D.set;if(x.length>0){H=a(E)}else{u=false}while(x.length){G=x.pop();F=G;if(!f.relative[G]){G=""}else{F=x.pop()}if(F==null){F=e}f.relative[G](H,F,t)}}else{H=x=[]}}if(!H){H=E}if(!H){b.error(G||v)}if(d.call(H)==="[object Array]"){if(!u){z.push.apply(z,H)}else{if(e&&e.nodeType===1){for(y=0;H[y]!=null;y++){if(H[y]&&(H[y]===true||H[y].nodeType===1&&b.contains(e,H[y]))){z.push(E[y])}}}else{for(y=0;H[y]!=null;y++){if(H[y]&&H[y].nodeType===1){z.push(E[y])}}}}}else{a(H,z)}if(r){b(r,C,z,A);b.uniqueSort(z)}return z};b.uniqueSort=function(r){if(c){o=i;r.sort(c);if(o){for(var e=1;e":function(x,r){var u=typeof r==="string",v,s=0,e=x.length;if(u&&!/\W/.test(r)){r=r.toLowerCase();for(;s=0)){if(!s){e.push(v)}}else{if(s){r[u]=false}}}}return false},ID:function(e){return e[1].replace(/\\/g,"")},TAG:function(r,e){return r[1].toLowerCase()},CHILD:function(e){if(e[1]==="nth"){var r=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(e[2]==="even"&&"2n"||e[2]==="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(r[1]+(r[2]||1))-0;e[3]=r[3]-0}e[0]=j++;return e},ATTR:function(u,r,s,e,v,x){var t=u[1].replace(/\\/g,"");if(!x&&f.attrMap[t]){u[1]=f.attrMap[t]}if(u[2]==="~="){u[4]=" "+u[4]+" "}return u},PSEUDO:function(u,r,s,e,v){if(u[1]==="not"){if((p.exec(u[3])||"").length>1||/^\w/.test(u[3])){u[3]=b(u[3],null,null,r)}else{var t=b.filter(u[3],r,s,true^v);if(!s){e.push.apply(e,t)}return false}}else{if(f.match.POS.test(u[0])||f.match.CHILD.test(u[0])){return true}}return u},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){e.parentNode.selectedIndex;return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(s,r,e){return !!b(e[3],s).length},header:function(e){return(/h\d/i).test(e.nodeName)},text:function(e){return"text"===e.type},radio:function(e){return"radio"===e.type},checkbox:function(e){return"checkbox"===e.type},file:function(e){return"file"===e.type},password:function(e){return"password"===e.type},submit:function(e){return"submit"===e.type},image:function(e){return"image"===e.type},reset:function(e){return"reset"===e.type},button:function(e){return"button"===e.type||e.nodeName.toLowerCase()==="button"},input:function(e){return(/input|select|textarea|button/i).test(e.nodeName)}},setFilters:{first:function(r,e){return e===0},last:function(s,r,e,t){return r===t.length-1},even:function(r,e){return e%2===0},odd:function(r,e){return e%2===1},lt:function(s,r,e){return re[3]-0},nth:function(s,r,e){return e[3]-0===r},eq:function(s,r,e){return e[3]-0===r}},filter:{PSEUDO:function(s,y,x,z){var e=y[1],r=f.filters[e];if(r){return r(s,x,y,z)}else{if(e==="contains"){return(s.textContent||s.innerText||b.getText([s])||"").indexOf(y[3])>=0}else{if(e==="not"){var t=y[3];for(var v=0,u=t.length;v=0)}}},ID:function(r,e){return r.nodeType===1&&r.getAttribute("id")===e},TAG:function(r,e){return(e==="*"&&r.nodeType===1)||r.nodeName.toLowerCase()===e},CLASS:function(r,e){return(" "+(r.className||r.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(v,t){var s=t[1],e=f.attrHandle[s]?f.attrHandle[s](v):v[s]!=null?v[s]:v.getAttribute(s),x=e+"",u=t[2],r=t[4];return e==null?u==="!=":u==="="?x===r:u==="*="?x.indexOf(r)>=0:u==="~="?(" "+x+" ").indexOf(r)>=0:!r?x&&e!==false:u==="!="?x!==r:u==="^="?x.indexOf(r)===0:u==="$="?x.substr(x.length-r.length)===r:u==="|="?x===r||x.substr(0,r.length+1)===r+"-":false},POS:function(u,r,s,v){var e=r[2],t=f.setFilters[e];if(t){return t(u,s,r,v)}}}};var k=f.match.POS,g=function(r,e){return"\\"+(e-0+1)};for(var m in f.match){f.match[m]=new RegExp(f.match[m].source+(/(?![^\[]*\])(?![^\(]*\))/.source));f.leftMatch[m]=new RegExp(/(^(?:.|\r|\n)*?)/.source+f.match[m].source.replace(/\\(\d+)/g,g))}var a=function(r,e){r=Array.prototype.slice.call(r,0);if(e){e.push.apply(e,r);return e}return r};try{Array.prototype.slice.call(document.documentElement.childNodes,0)[0].nodeType}catch(l){a=function(u,t){var r=t||[],s=0;if(d.call(u)==="[object Array]"){Array.prototype.push.apply(r,u)}else{if(typeof u.length==="number"){for(var e=u.length;s";var e=document.documentElement;e.insertBefore(r,e.firstChild);if(document.getElementById(s)){f.find.ID=function(u,v,x){if(typeof v.getElementById!=="undefined"&&!x){var t=v.getElementById(u[1]);return t?t.id===u[1]||typeof t.getAttributeNode!=="undefined"&&t.getAttributeNode("id").nodeValue===u[1]?[t]:undefined:[]}};f.filter.ID=function(v,t){var u=typeof v.getAttributeNode!=="undefined"&&v.getAttributeNode("id");return v.nodeType===1&&u&&u.nodeValue===t}}e.removeChild(r);e=r=null})();(function(){var e=document.createElement("div");e.appendChild(document.createComment(""));if(e.getElementsByTagName("*").length>0){f.find.TAG=function(r,v){var u=v.getElementsByTagName(r[1]);if(r[1]==="*"){var t=[];for(var s=0;u[s];s++){if(u[s].nodeType===1){t.push(u[s])}}u=t}return u}}e.innerHTML="";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){f.attrHandle.href=function(r){return r.getAttribute("href",2)}}e=null})();if(document.querySelectorAll){(function(){var e=b,s=document.createElement("div");s.innerHTML="

    ";if(s.querySelectorAll&&s.querySelectorAll(".TEST").length===0){return}b=function(x,v,t,u){v=v||document;if(!u&&v.nodeType===9&&!b.isXML(v)){try{return a(v.querySelectorAll(x),t)}catch(y){}}return e(x,v,t,u)};for(var r in e){b[r]=e[r]}s=null})()}(function(){var e=document.createElement("div");e.innerHTML="
    ";if(!e.getElementsByClassName||e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}f.order.splice(1,0,"CLASS");f.find.CLASS=function(r,s,t){if(typeof s.getElementsByClassName!=="undefined"&&!t){return s.getElementsByClassName(r[1])}};e=null})();function n(r,x,v,A,y,z){for(var t=0,s=A.length;t0){u=e;break}}}e=e[r]}A[t]=u}}}b.contains=document.compareDocumentPosition?function(r,e){return !!(r.compareDocumentPosition(e)&16)}:function(r,e){return r!==e&&(r.contains?r.contains(e):true)};b.isXML=function(e){var r=(e?e.ownerDocument||e:0).documentElement;return r?r.nodeName!=="HTML":false};var h=function(e,y){var t=[],u="",v,s=y.nodeType?[y]:y;while((v=f.match.PSEUDO.exec(e))){u+=v[0];e=e.replace(f.match.PSEUDO,"")}e=f.relative[e]?e+"*":e;for(var x=0,r=s.length;x=0;h--){k=g[h];if(k.obj===l){j._remove(k.obj,k.name,k.cfunc);k.obj=k.cfunc=null;g.splice(h,1)}}}},cancel:function(g){if(!g){return false}this.stop(g);return this.prevent(g)},stop:function(g){if(g.stopPropagation){g.stopPropagation()}else{g.cancelBubble=true}return false},prevent:function(g){if(g.preventDefault){g.preventDefault()}else{g.returnValue=false}return false},destroy:function(){var g=this;f(g.events,function(j,h){g._remove(j.obj,j.name,j.cfunc);j.obj=j.cfunc=null});g.events=[];g=null},_add:function(h,i,g){if(h.attachEvent){h.attachEvent("on"+i,g)}else{if(h.addEventListener){h.addEventListener(i,g,false)}else{h["on"+i]=g}}},_remove:function(i,j,h){if(i){try{if(i.detachEvent){i.detachEvent("on"+j,h)}else{if(i.removeEventListener){i.removeEventListener(j,h,false)}else{i["on"+j]=null}}}catch(g){}}},_pageInit:function(h){var g=this;if(g.domLoaded){return}g.domLoaded=true;f(g.inits,function(i){i()});g.inits=[]},_wait:function(i){var g=this,h=i.document;if(i.tinyMCE_GZ&&tinyMCE_GZ.loaded){g.domLoaded=1;return}if(h.attachEvent){h.attachEvent("onreadystatechange",function(){if(h.readyState==="complete"){h.detachEvent("onreadystatechange",arguments.callee);g._pageInit(i)}});if(h.documentElement.doScroll&&i==i.top){(function(){if(g.domLoaded){return}try{h.documentElement.doScroll("left")}catch(j){setTimeout(arguments.callee,0);return}g._pageInit(i)})()}}else{if(h.addEventListener){g._add(i,"DOMContentLoaded",function(){g._pageInit(i)})}}g._add(i,"load",function(){g._pageInit(i)})},_stoppers:{preventDefault:function(){this.returnValue=false},stopPropagation:function(){this.cancelBubble=true}}});a=d.dom.Event=new d.dom.EventUtils();a._wait(window);d.addUnload(function(){a.destroy()})})(tinymce);(function(a){a.dom.Element=function(f,d){var b=this,e,c;b.settings=d=d||{};b.id=f;b.dom=e=d.dom||a.DOM;if(!a.isIE){c=e.get(b.id)}a.each(("getPos,getRect,getParent,add,setStyle,getStyle,setStyles,setAttrib,setAttribs,getAttrib,addClass,removeClass,hasClass,getOuterHTML,setOuterHTML,remove,show,hide,isHidden,setHTML,get").split(/,/),function(g){b[g]=function(){var h=[f],j;for(j=0;j_';if(j.startContainer==k&&j.endContainer==k){k.body.innerHTML=i}else{j.deleteContents();if(k.body.childNodes.length==0){k.body.innerHTML=i}else{j.insertNode(j.createContextualFragment(i))}}l=f.dom.get("__caret");j=k.createRange();j.setStartBefore(l);j.setEndBefore(l);f.setRng(j);f.dom.remove("__caret")}else{if(j.item){k.execCommand("Delete",false,null);j=f.getRng()}j.pasteHTML(i)}f.onSetContent.dispatch(f,g)},getStart:function(){var g=this.getRng(),h,f,j,i;if(g.duplicate||g.item){if(g.item){return g.item(0)}j=g.duplicate();j.collapse(1);h=j.parentElement();f=i=g.parentElement();while(i=i.parentNode){if(i==h){h=f;break}}if(h&&h.nodeName=="BODY"){return h.firstChild||h}return h}else{h=g.startContainer;if(h.nodeType==1&&h.hasChildNodes()){h=h.childNodes[Math.min(h.childNodes.length-1,g.startOffset)]}if(h&&h.nodeType==3){return h.parentNode}return h}},getEnd:function(){var g=this,h=g.getRng(),i,f;if(h.duplicate||h.item){if(h.item){return h.item(0)}h=h.duplicate();h.collapse(0);i=h.parentElement();if(i&&i.nodeName=="BODY"){return i.lastChild||i}return i}else{i=h.endContainer;f=h.endOffset;if(i.nodeType==1&&i.hasChildNodes()){i=i.childNodes[f>0?f-1:f]}if(i&&i.nodeType==3){return i.parentNode}return i}},getBookmark:function(q,r){var u=this,m=u.dom,g,j,i,n,h,o,p,l="\uFEFF",s;function f(v,x){var t=0;d(m.select(v),function(z,y){if(z==x){t=y}});return t}if(q==2){function k(){var v=u.getRng(true),t=m.getRoot(),x={};function y(B,G){var A=B[G?"startContainer":"endContainer"],F=B[G?"startOffset":"endOffset"],z=[],C,E,D=0;if(A.nodeType==3){if(r){for(C=A.previousSibling;C&&C.nodeType==3;C=C.previousSibling){F+=C.nodeValue.length}}z.push(F)}else{E=A.childNodes;if(F>=E.length&&E.length){D=1;F=Math.max(0,E.length-1)}z.push(u.dom.nodeIndex(E[F],r)+D)}for(;A&&A!=t;A=A.parentNode){z.push(u.dom.nodeIndex(A,r))}return z}x.start=y(v,true);if(!u.isCollapsed()){x.end=y(v)}return x}return k()}if(q){return{rng:u.getRng()}}g=u.getRng();i=m.uniqueId();n=tinyMCE.activeEditor.selection.isCollapsed();s="overflow:hidden;line-height:0px";if(g.duplicate||g.item){if(!g.item){j=g.duplicate();g.collapse();g.pasteHTML(''+l+"");if(!n){j.collapse(false);j.pasteHTML(''+l+"")}}else{o=g.item(0);h=o.nodeName;return{name:h,index:f(h,o)}}}else{o=u.getNode();h=o.nodeName;if(h=="IMG"){return{name:h,index:f(h,o)}}j=g.cloneRange();if(!n){j.collapse(false);j.insertNode(m.create("span",{_mce_type:"bookmark",id:i+"_end",style:s},l))}g.collapse(true);g.insertNode(m.create("span",{_mce_type:"bookmark",id:i+"_start",style:s},l))}u.moveToBookmark({id:i,keep:1});return{id:i}},moveToBookmark:function(n){var r=this,l=r.dom,i,h,f,q,j,s,o,p;if(r.tridentSel){r.tridentSel.destroy()}if(n){if(n.start){f=l.createRng();q=l.getRoot();function g(z){var t=n[z?"start":"end"],v,x,y,u;if(t){for(x=q,v=t.length-1;v>=1;v--){u=x.childNodes;if(u.length){x=u[t[v]]}}if(z){f.setStart(x,t[0])}else{f.setEnd(x,t[0])}}}g(true);g();r.setRng(f)}else{if(n.id){function k(A){var u=l.get(n.id+"_"+A),z,t,x,y,v=n.keep;if(u){z=u.parentNode;if(A=="start"){if(!v){t=l.nodeIndex(u)}else{z=u.firstChild;t=1}j=s=z;o=p=t}else{if(!v){t=l.nodeIndex(u)}else{z=u.firstChild;t=1}s=z;p=t}if(!v){y=u.previousSibling;x=u.nextSibling;d(c.grep(u.childNodes),function(B){if(B.nodeType==3){B.nodeValue=B.nodeValue.replace(/\uFEFF/g,"")}});while(u=l.get(n.id+"_"+A)){l.remove(u,1)}if(y&&x&&y.nodeType==x.nodeType&&y.nodeType==3){t=y.nodeValue.length;y.appendData(x.nodeValue);l.remove(x);if(A=="start"){j=s=y;o=p=t}else{s=y;p=t}}}}}function m(t){if(!a&&l.isBlock(t)&&!t.innerHTML){t.innerHTML='
    '}return t}k("start");k("end");f=l.createRng();f.setStart(m(j),o);f.setEnd(m(s),p);r.setRng(f)}else{if(n.name){r.select(l.select(n.name)[n.index])}else{if(n.rng){r.setRng(n.rng)}}}}}},select:function(k,j){var i=this,l=i.dom,g=l.createRng(),f;f=l.nodeIndex(k);g.setStart(k.parentNode,f);g.setEnd(k.parentNode,f+1);if(j){function h(m,o){var n=new c.dom.TreeWalker(m,m);do{if(m.nodeType==3&&c.trim(m.nodeValue).length!=0){if(o){g.setStart(m,0)}else{g.setEnd(m,m.nodeValue.length)}return}if(m.nodeName=="BR"){if(o){g.setStartBefore(m)}else{g.setEndBefore(m)}return}}while(m=(o?n.next():n.prev()))}h(k,1);h(k)}i.setRng(g);return k},isCollapsed:function(){var f=this,h=f.getRng(),g=f.getSel();if(!h||h.item){return false}if(h.compareEndPoints){return h.compareEndPoints("StartToEnd",h)===0}return !g||h.collapsed},collapse:function(f){var g=this,h=g.getRng(),i;if(h.item){i=h.item(0);h=this.win.document.body.createTextRange();h.moveToElementText(i)}h.collapse(!!f);g.setRng(h)},getSel:function(){var g=this,f=this.win;return f.getSelection?f.getSelection():f.document.selection},getRng:function(j){var g=this,h,i;if(j&&g.tridentSel){return g.tridentSel.getRangeAt(0)}try{if(h=g.getSel()){i=h.rangeCount>0?h.getRangeAt(0):(h.createRange?h.createRange():g.win.document.createRange())}}catch(f){}if(!i){i=g.win.document.createRange?g.win.document.createRange():g.win.document.body.createTextRange()}if(g.selectedRange&&g.explicitRange){if(i.compareBoundaryPoints(i.START_TO_START,g.selectedRange)===0&&i.compareBoundaryPoints(i.END_TO_END,g.selectedRange)===0){i=g.explicitRange}else{g.selectedRange=null;g.explicitRange=null}}return i},setRng:function(i){var h,g=this;if(!g.tridentSel){h=g.getSel();if(h){g.explicitRange=i;h.removeAllRanges();h.addRange(i);g.selectedRange=h.getRangeAt(0)}}else{if(i.cloneRange){g.tridentSel.addRange(i);return}try{i.select()}catch(f){}}},setNode:function(g){var f=this;f.setContent(f.dom.getOuterHTML(g));return g},getNode:function(){var g=this,f=g.getRng(),h=g.getSel(),i;if(f.setStart){if(!f){return g.dom.getRoot()}i=f.commonAncestorContainer;if(!f.collapsed){if(f.startContainer==f.endContainer){if(f.startOffset-f.endOffset<2){if(f.startContainer.hasChildNodes()){i=f.startContainer.childNodes[f.startOffset]}}}if(c.isWebKit&&h.anchorNode&&h.anchorNode.nodeType==1){return h.anchorNode.childNodes[h.anchorOffset]}}if(i&&i.nodeType==3){return i.parentNode}return i}return f.item?f.item(0):f.parentElement()},getSelectedBlocks:function(g,f){var i=this,j=i.dom,m,h,l,k=[];m=j.getParent(g||i.getStart(),j.isBlock);h=j.getParent(f||i.getEnd(),j.isBlock);if(m){k.push(m)}if(m&&h&&m!=h){l=m;while((l=l.nextSibling)&&l!=h){if(j.isBlock(l)){k.push(l)}}}if(h&&m!=h){k.push(h)}return k},destroy:function(g){var f=this;f.win=null;if(f.tridentSel){f.tridentSel.destroy()}if(!g){c.removeUnload(f.destroy)}}})})(tinymce);(function(a){a.create("tinymce.dom.XMLWriter",{node:null,XMLWriter:function(c){function b(){var e=document.implementation;if(!e||!e.createDocument){try{return new ActiveXObject("MSXML2.DOMDocument")}catch(d){}try{return new ActiveXObject("Microsoft.XmlDom")}catch(d){}}else{return e.createDocument("","",null)}}this.doc=b();this.valid=a.isOpera||a.isWebKit;this.reset()},reset:function(){var b=this,c=b.doc;if(c.firstChild){c.removeChild(c.firstChild)}b.node=c.appendChild(c.createElement("html"))},writeStartElement:function(c){var b=this;b.node=b.node.appendChild(b.doc.createElement(c))},writeAttribute:function(c,b){if(this.valid){b=b.replace(/>/g,"%MCGT%")}this.node.setAttribute(c,b)},writeEndElement:function(){this.node=this.node.parentNode},writeFullEndElement:function(){var b=this,c=b.node;c.appendChild(b.doc.createTextNode(""));b.node=c.parentNode},writeText:function(b){if(this.valid){b=b.replace(/>/g,"%MCGT%")}this.node.appendChild(this.doc.createTextNode(b))},writeCDATA:function(b){this.node.appendChild(this.doc.createCDATASection(b))},writeComment:function(b){if(a.isIE){b=b.replace(/^\-|\-$/g," ")}this.node.appendChild(this.doc.createComment(b.replace(/\-\-/g," ")))},getContent:function(){var b;b=this.doc.xml||new XMLSerializer().serializeToString(this.doc);b=b.replace(/<\?[^?]+\?>||<\/html>||]+>/g,"");b=b.replace(/ ?\/>/g," />");if(this.valid){b=b.replace(/\%MCGT%/g,">")}return b}})})(tinymce);(function(a){a.create("tinymce.dom.StringWriter",{str:null,tags:null,count:0,settings:null,indent:null,StringWriter:function(b){this.settings=a.extend({indent_char:" ",indentation:0},b);this.reset()},reset:function(){this.indent="";this.str="";this.tags=[];this.count=0},writeStartElement:function(b){this._writeAttributesEnd();this.writeRaw("<"+b);this.tags.push(b);this.inAttr=true;this.count++;this.elementCount=this.count},writeAttribute:function(d,b){var c=this;c.writeRaw(" "+c.encode(d)+'="'+c.encode(b)+'"')},writeEndElement:function(){var b;if(this.tags.length>0){b=this.tags.pop();if(this._writeAttributesEnd(1)){this.writeRaw("")}if(this.settings.indentation>0){this.writeRaw("\n")}}},writeFullEndElement:function(){if(this.tags.length>0){this._writeAttributesEnd();this.writeRaw("");if(this.settings.indentation>0){this.writeRaw("\n")}}},writeText:function(b){this._writeAttributesEnd();this.writeRaw(this.encode(b));this.count++},writeCDATA:function(b){this._writeAttributesEnd();this.writeRaw("");this.count++},writeComment:function(b){this._writeAttributesEnd();this.writeRaw("");this.count++},writeRaw:function(b){this.str+=b},encode:function(b){return b.replace(/[<>&"]/g,function(c){switch(c){case"<":return"<";case">":return">";case"&":return"&";case'"':return"""}return c})},getContent:function(){return this.str},_writeAttributesEnd:function(b){if(!this.inAttr){return}this.inAttr=false;if(b&&this.elementCount==this.count){this.writeRaw(" />");return false}this.writeRaw(">");return true}})})(tinymce);(function(e){var g=e.extend,f=e.each,b=e.util.Dispatcher,d=e.isIE,a=e.isGecko;function c(h){return h.replace(/([?+*])/g,".$1")}e.create("tinymce.dom.Serializer",{Serializer:function(j){var i=this;i.key=0;i.onPreProcess=new b(i);i.onPostProcess=new b(i);try{i.writer=new e.dom.XMLWriter()}catch(h){i.writer=new e.dom.StringWriter()}i.settings=j=g({dom:e.DOM,valid_nodes:0,node_filter:0,attr_filter:0,invalid_attrs:/^(_mce_|_moz_|sizset|sizcache)/,closed:/^(br|hr|input|meta|img|link|param|area)$/,entity_encoding:"named",entities:"160,nbsp,161,iexcl,162,cent,163,pound,164,curren,165,yen,166,brvbar,167,sect,168,uml,169,copy,170,ordf,171,laquo,172,not,173,shy,174,reg,175,macr,176,deg,177,plusmn,178,sup2,179,sup3,180,acute,181,micro,182,para,183,middot,184,cedil,185,sup1,186,ordm,187,raquo,188,frac14,189,frac12,190,frac34,191,iquest,192,Agrave,193,Aacute,194,Acirc,195,Atilde,196,Auml,197,Aring,198,AElig,199,Ccedil,200,Egrave,201,Eacute,202,Ecirc,203,Euml,204,Igrave,205,Iacute,206,Icirc,207,Iuml,208,ETH,209,Ntilde,210,Ograve,211,Oacute,212,Ocirc,213,Otilde,214,Ouml,215,times,216,Oslash,217,Ugrave,218,Uacute,219,Ucirc,220,Uuml,221,Yacute,222,THORN,223,szlig,224,agrave,225,aacute,226,acirc,227,atilde,228,auml,229,aring,230,aelig,231,ccedil,232,egrave,233,eacute,234,ecirc,235,euml,236,igrave,237,iacute,238,icirc,239,iuml,240,eth,241,ntilde,242,ograve,243,oacute,244,ocirc,245,otilde,246,ouml,247,divide,248,oslash,249,ugrave,250,uacute,251,ucirc,252,uuml,253,yacute,254,thorn,255,yuml,402,fnof,913,Alpha,914,Beta,915,Gamma,916,Delta,917,Epsilon,918,Zeta,919,Eta,920,Theta,921,Iota,922,Kappa,923,Lambda,924,Mu,925,Nu,926,Xi,927,Omicron,928,Pi,929,Rho,931,Sigma,932,Tau,933,Upsilon,934,Phi,935,Chi,936,Psi,937,Omega,945,alpha,946,beta,947,gamma,948,delta,949,epsilon,950,zeta,951,eta,952,theta,953,iota,954,kappa,955,lambda,956,mu,957,nu,958,xi,959,omicron,960,pi,961,rho,962,sigmaf,963,sigma,964,tau,965,upsilon,966,phi,967,chi,968,psi,969,omega,977,thetasym,978,upsih,982,piv,8226,bull,8230,hellip,8242,prime,8243,Prime,8254,oline,8260,frasl,8472,weierp,8465,image,8476,real,8482,trade,8501,alefsym,8592,larr,8593,uarr,8594,rarr,8595,darr,8596,harr,8629,crarr,8656,lArr,8657,uArr,8658,rArr,8659,dArr,8660,hArr,8704,forall,8706,part,8707,exist,8709,empty,8711,nabla,8712,isin,8713,notin,8715,ni,8719,prod,8721,sum,8722,minus,8727,lowast,8730,radic,8733,prop,8734,infin,8736,ang,8743,and,8744,or,8745,cap,8746,cup,8747,int,8756,there4,8764,sim,8773,cong,8776,asymp,8800,ne,8801,equiv,8804,le,8805,ge,8834,sub,8835,sup,8836,nsub,8838,sube,8839,supe,8853,oplus,8855,otimes,8869,perp,8901,sdot,8968,lceil,8969,rceil,8970,lfloor,8971,rfloor,9001,lang,9002,rang,9674,loz,9824,spades,9827,clubs,9829,hearts,9830,diams,338,OElig,339,oelig,352,Scaron,353,scaron,376,Yuml,710,circ,732,tilde,8194,ensp,8195,emsp,8201,thinsp,8204,zwnj,8205,zwj,8206,lrm,8207,rlm,8211,ndash,8212,mdash,8216,lsquo,8217,rsquo,8218,sbquo,8220,ldquo,8221,rdquo,8222,bdquo,8224,dagger,8225,Dagger,8240,permil,8249,lsaquo,8250,rsaquo,8364,euro",valid_elements:"*[*]",extended_valid_elements:0,invalid_elements:0,fix_table_elements:1,fix_list_elements:true,fix_content_duplication:true,convert_fonts_to_spans:false,font_size_classes:0,apply_source_formatting:0,indent_mode:"simple",indent_char:"\t",indent_levels:1,remove_linebreaks:1,remove_redundant_brs:1,element_format:"xhtml"},j);i.dom=j.dom;i.schema=j.schema;if(j.entity_encoding=="named"&&!j.entities){j.entity_encoding="raw"}if(j.remove_redundant_brs){i.onPostProcess.add(function(k,l){l.content=l.content.replace(/(
    \s*)+<\/(p|h[1-6]|div|li)>/gi,function(n,m,o){if(/^
    \s*<\//.test(n)){return""}return n})})}if(j.element_format=="html"){i.onPostProcess.add(function(k,l){l.content=l.content.replace(/<([^>]+) \/>/g,"<$1>")})}if(j.fix_list_elements){i.onPreProcess.add(function(v,s){var l,z,y=["ol","ul"],u,t,q,k=/^(OL|UL)$/,A;function m(r,x){var o=x.split(","),p;while((r=r.previousSibling)!=null){for(p=0;p=1767){f(i.dom.select("p table",l.node).reverse(),function(p){var o=i.dom.getParent(p.parentNode,"table,p");if(o.nodeName!="TABLE"){try{i.dom.split(o,p)}catch(m){}}})}})}},setEntities:function(o){var n=this,j,m,h={},k;if(n.entityLookup){return}j=o.split(",");for(m=0;m1){f(q[1].split("|"),function(u){var p={},t;k=k||[];u=u.replace(/::/g,"~");u=/^([!\-])?([\w*.?~_\-]+|)([=:<])?(.+)?$/.exec(u);u[2]=u[2].replace(/~/g,":");if(u[1]=="!"){r=r||[];r.push(u[2])}if(u[1]=="-"){for(t=0;t=1767)){p=j.createHTMLDocument("");f(r.nodeName=="BODY"?r.childNodes:[r],function(h){p.body.appendChild(p.importNode(h,true))});if(r.nodeName!="BODY"){r=p.body.firstChild}else{r=p.body}i=k.dom.doc;k.dom.doc=p}k.key=""+(parseInt(k.key)+1);if(!q.no_events){q.node=r;k.onPreProcess.dispatch(k,q)}k.writer.reset();k._info=q;k._serializeNode(r,q.getInner);q.content=k.writer.getContent();if(i){k.dom.doc=i}if(!q.no_events){k.onPostProcess.dispatch(k,q)}k._postProcess(q);q.node=null;return e.trim(q.content)},_postProcess:function(n){var i=this,k=i.settings,j=n.content,m=[],l;if(n.format=="html"){l=i._protect({content:j,patterns:[{pattern:/(]*>)(.*?)(<\/script>)/g},{pattern:/(]*>)(.*?)(<\/noscript>)/g},{pattern:/(]*>)(.*?)(<\/style>)/g},{pattern:/(]*>)(.*?)(<\/pre>)/g,encode:1},{pattern:/()/g}]});j=l.content;if(k.entity_encoding!=="raw"){j=i._encode(j)}if(!n.set){j=j.replace(/

    \s+<\/p>|]+)>\s+<\/p>/g,k.entity_encoding=="numeric"?" 

    ":" 

    ");if(k.remove_linebreaks){j=j.replace(/\r?\n|\r/g," ");j=j.replace(/(<[^>]+>)\s+/g,"$1 ");j=j.replace(/\s+(<\/[^>]+>)/g," $1");j=j.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object) ([^>]+)>\s+/g,"<$1 $2>");j=j.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>\s+/g,"<$1>");j=j.replace(/\s+<\/(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>/g,"")}if(k.apply_source_formatting&&k.indent_mode=="simple"){j=j.replace(/<(\/?)(ul|hr|table|meta|link|tbody|tr|object|body|head|html|map)(|[^>]+)>\s*/g,"\n<$1$2$3>\n");j=j.replace(/\s*<(p|h[1-6]|blockquote|div|title|style|pre|script|td|li|area)(|[^>]+)>/g,"\n<$1$2>");j=j.replace(/<\/(p|h[1-6]|blockquote|div|title|style|pre|script|td|li)>\s*/g,"\n");j=j.replace(/\n\n/g,"\n")}}j=i._unprotect(j,l);j=j.replace(//g,"");if(k.entity_encoding=="raw"){j=j.replace(/

     <\/p>|]+)> <\/p>/g,"\u00a0

    ")}j=j.replace(/]+|)>([\s\S]*?)<\/noscript>/g,function(h,p,o){return""+i.dom.decode(o.replace(//g,""))+""})}n.content=j},_serializeNode:function(D,I){var z=this,A=z.settings,x=z.writer,q,j,u,F,E,H,B,h,y,k,r,C,p,m,G,o;if(!A.node_filter||A.node_filter(D)){switch(D.nodeType){case 1:if(D.hasAttribute?D.hasAttribute("_mce_bogus"):D.getAttribute("_mce_bogus")){return}p=G=false;q=D.hasChildNodes();k=D.getAttribute("_mce_name")||D.nodeName.toLowerCase();o=D.getAttribute("_mce_type");if(o){if(!z._info.cleanup){p=true;return}else{G=1}}if(d){if(D.scopeName!=="HTML"&&D.scopeName!=="html"){k=D.scopeName+":"+k}}if(k.indexOf("mce:")===0){k=k.substring(4)}if(!G){if(!z.validElementsRE||!z.validElementsRE.test(k)||(z.invalidElementsRE&&z.invalidElementsRE.test(k))||I){p=true;break}}if(d){if(A.fix_content_duplication){if(D._mce_serialized==z.key){return}D._mce_serialized=z.key}if(k.charAt(0)=="/"){k=k.substring(1)}}else{if(a){if(D.nodeName==="BR"&&D.getAttribute("type")=="_moz"){return}}}if(A.validate_children){if(z.elementName&&!z.schema.isValid(z.elementName,k)){p=true;break}z.elementName=k}r=z.findRule(k);if(!r){p=true;break}k=r.name||k;m=A.closed.test(k);if((!q&&r.noEmpty)||(d&&!k)){p=true;break}if(r.requiredAttribs){H=r.requiredAttribs;for(F=H.length-1;F>=0;F--){if(this.dom.getAttrib(D,H[F])!==""){break}}if(F==-1){p=true;break}}x.writeStartElement(k);if(r.attribs){for(F=0,B=r.attribs,E=B.length;F-1;F--){h=B[F];if(h.specified){H=h.nodeName.toLowerCase();if(A.invalid_attrs.test(H)||!r.validAttribsRE.test(H)){continue}C=z.findAttribRule(r,H);y=z._getAttrib(D,C,H);if(y!==null){x.writeAttribute(H,y)}}}}if(o&&G){x.writeAttribute("_mce_type",o)}if(k==="script"&&e.trim(D.innerHTML)){x.writeText("// ");x.writeCDATA(D.innerHTML.replace(/|<\[CDATA\[|\]\]>/g,""));q=false;break}if(r.padd){if(q&&(u=D.firstChild)&&u.nodeType===1&&D.childNodes.length===1){if(u.hasAttribute?u.hasAttribute("_mce_bogus"):u.getAttribute("_mce_bogus")){x.writeText("\u00a0")}}else{if(!q){x.writeText("\u00a0")}}}break;case 3:if(A.validate_children&&z.elementName&&!z.schema.isValid(z.elementName,"#text")){return}return x.writeText(D.nodeValue);case 4:return x.writeCDATA(D.nodeValue);case 8:return x.writeComment(D.nodeValue)}}else{if(D.nodeType==1){q=D.hasChildNodes()}}if(q&&!m){u=D.firstChild;while(u){z._serializeNode(u);z.elementName=k;u=u.nextSibling}}if(!p){if(!m){x.writeFullEndElement()}else{x.writeEndElement()}}},_protect:function(j){var i=this;j.items=j.items||[];function h(l){return l.replace(/[\r\n\\]/g,function(m){if(m==="\n"){return"\\n"}else{if(m==="\\"){return"\\\\"}}return"\\r"})}function k(l){return l.replace(/\\[\\rn]/g,function(m){if(m==="\\n"){return"\n"}else{if(m==="\\\\"){return"\\"}}return"\r"})}f(j.patterns,function(l){j.content=k(h(j.content).replace(l.pattern,function(n,o,m,p){m=k(m);if(l.encode){m=i._encode(m)}j.items.push(m);return o+""+p}))});return j},_unprotect:function(i,j){i=i.replace(/\"))}if(a&&j.ListBox){if(a.Button||a.SplitButton){e+=b.createHTML("td",{"class":"mceToolbarEnd"},b.createHTML("span",null,""))}}if(b.stdMode){e+='
    '+j.renderHTML()+""+j.renderHTML()+"
    '+j.renderHTML()+""+j.renderHTML()+"
    ..
    ab|c + if (checkRng.compareEndPoints(start ? 'StartToStart' : 'StartToEnd', rng) > 0) { + checkRng = rng.duplicate(); + checkRng.collapse(start); + + offset = -1; + while (parent == checkRng.parentElement()) { + if (checkRng.move('character', -1) == 0) + break; + + offset++; } - if ( type === "first" ) { - return true; + } + + offset = offset || checkRng.text.replace('\r\n', ' ').length; + } else { + // Child position is after the selection endpoint + checkRng.collapse(true); + checkRng.setEndPoint(start ? 'StartToStart' : 'StartToEnd', rng); + + // Get the length of the text to find where the endpoint is relative to it's container + offset = checkRng.text.replace('\r\n', ' ').length; + } + + return {node : child, position : position, offset : offset, inside : inside}; + }; + + // Returns a W3C DOM compatible range object by using the IE Range API + function getRange() { + var ieRange = selection.getRng(), domRange = dom.createRng(), element, collapsed, tmpRange, element2, bookmark, fail; + + // If selection is outside the current document just return an empty range + element = ieRange.item ? ieRange.item(0) : ieRange.parentElement(); + if (element.ownerDocument != dom.doc) + return domRange; + + collapsed = selection.isCollapsed(); + + // Handle control selection + if (ieRange.item) { + domRange.setStart(element.parentNode, dom.nodeIndex(element)); + domRange.setEnd(domRange.startContainer, domRange.startOffset + 1); + + return domRange; + } + + function findEndPoint(start) { + var endPoint = getPosition(ieRange, start), container, offset, textNodeOffset = 0, sibling, undef, nodeValue; + + container = endPoint.node; + offset = endPoint.offset; + + if (endPoint.inside && !container.hasChildNodes()) { + domRange[start ? 'setStart' : 'setEnd'](container, 0); + return; + } + + if (offset === undef) { + domRange[start ? 'setStartBefore' : 'setEndAfter'](container); + return; + } + + if (endPoint.position < 0) { + sibling = endPoint.inside ? container.firstChild : container.nextSibling; + + if (!sibling) { + domRange[start ? 'setStartAfter' : 'setEndAfter'](container); + return; } - node = elem; - case 'last': - while ( (node = node.nextSibling) ) { - if ( node.nodeType === 1 ) { - return false; + + if (!offset) { + if (sibling.nodeType == 3) + domRange[start ? 'setStart' : 'setEnd'](sibling, 0); + else + domRange[start ? 'setStartBefore' : 'setEndBefore'](sibling); + + return; + } + + // Find the text node and offset + while (sibling) { + nodeValue = sibling.nodeValue; + textNodeOffset += nodeValue.length; + + // We are at or passed the position we where looking for + if (textNodeOffset >= offset) { + container = sibling; + textNodeOffset -= offset; + textNodeOffset = nodeValue.length - textNodeOffset; + break; } + + sibling = sibling.nextSibling; } - return true; - case 'nth': - var first = match[2], last = match[3]; + } else { + // Find the text node and offset + sibling = container.previousSibling; - if ( first === 1 && last === 0 ) { - return true; + if (!sibling) + return domRange[start ? 'setStartBefore' : 'setEndBefore'](container); + + // If there isn't any text to loop then use the first position + if (!offset) { + if (container.nodeType == 3) + domRange[start ? 'setStart' : 'setEnd'](sibling, container.nodeValue.length); + else + domRange[start ? 'setStartAfter' : 'setEndAfter'](sibling); + + return; } - - var doneName = match[0], - parent = elem.parentNode; - - if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) { - var count = 0; - for ( node = parent.firstChild; node; node = node.nextSibling ) { - if ( node.nodeType === 1 ) { - node.nodeIndex = ++count; - } - } - parent.sizcache = doneName; + + while (sibling) { + textNodeOffset += sibling.nodeValue.length; + + // We are at or passed the position we where looking for + if (textNodeOffset >= offset) { + container = sibling; + textNodeOffset -= offset; + break; + } + + sibling = sibling.previousSibling; } - - var diff = elem.nodeIndex - last; - if ( first === 0 ) { - return diff === 0; - } else { - return ( diff % first === 0 && diff / first >= 0 ); + } + + domRange[start ? 'setStart' : 'setEnd'](container, textNodeOffset); + }; + + try { + // Find start point + findEndPoint(true); + + // Find end point if needed + if (!collapsed) + findEndPoint(); + } catch (ex) { + // IE has a nasty bug where text nodes might throw "invalid argument" when you + // access the nodeValue or other properties of text nodes. This seems to happend when + // text nodes are split into two nodes by a delete/backspace call. So lets detect it and try to fix it. + if (ex.number == -2147024809) { + // Get the current selection + bookmark = self.getBookmark(2); + + // Get start element + tmpRange = ieRange.duplicate(); + tmpRange.collapse(true); + element = tmpRange.parentElement(); + + // Get end element + if (!collapsed) { + tmpRange = ieRange.duplicate(); + tmpRange.collapse(false); + element2 = tmpRange.parentElement(); + element2.innerHTML = element2.innerHTML; } - } - }, - ID: function(elem, match){ - return elem.nodeType === 1 && elem.getAttribute("id") === match; - }, - TAG: function(elem, match){ - return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match; - }, - CLASS: function(elem, match){ - return (" " + (elem.className || elem.getAttribute("class")) + " ") - .indexOf( match ) > -1; - }, - ATTR: function(elem, match){ - var name = match[1], - result = Expr.attrHandle[ name ] ? - Expr.attrHandle[ name ]( elem ) : - elem[ name ] != null ? - elem[ name ] : - elem.getAttribute( name ), - value = result + "", - type = match[2], - check = match[4]; - return result == null ? - type === "!=" : - type === "=" ? - value === check : - type === "*=" ? - value.indexOf(check) >= 0 : - type === "~=" ? - (" " + value + " ").indexOf(check) >= 0 : - !check ? - value && result !== false : - type === "!=" ? - value !== check : - type === "^=" ? - value.indexOf(check) === 0 : - type === "$=" ? - value.substr(value.length - check.length) === check : - type === "|=" ? - value === check || value.substr(0, check.length + 1) === check + "-" : - false; - }, - POS: function(elem, match, i, array){ - var name = match[2], filter = Expr.setFilters[ name ]; + // Remove the broken elements + element.innerHTML = element.innerHTML; - if ( filter ) { - return filter( elem, i, match, array ); + // Restore the selection + self.moveToBookmark(bookmark); + + // Since the range has moved we need to re-get it + ieRange = selection.getRng(); + + // Find start point + findEndPoint(true); + + // Find end point if needed + if (!collapsed) + findEndPoint(); + } else + throw ex; // Throw other errors } - } - } -}; -var origPOS = Expr.match.POS, - fescape = function(all, num){ - return "\\" + (num - 0 + 1); - }; + return domRange; + }; -for ( var type in Expr.match ) { - Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) ); - Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) ); -} + this.getBookmark = function(type) { + var rng = selection.getRng(), start, end, bookmark = {}; -var makeArray = function(array, results) { - array = Array.prototype.slice.call( array, 0 ); + function getIndexes(node) { + var node, parent, root, children, i, indexes = []; - if ( results ) { - results.push.apply( results, array ); - return results; - } - - return array; -}; + parent = node.parentNode; + root = dom.getRoot().parentNode; -// Perform a simple check to determine if the browser is capable of -// converting a NodeList to an array using builtin methods. -// Also verifies that the returned array holds DOM nodes -// (which is not the case in the Blackberry browser) -try { - Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType; + while (parent != root && parent.nodeType !== 9) { + children = parent.children; -// Provide a fallback method if it does not work -} catch(e){ - makeArray = function(array, results) { - var ret = results || [], i = 0; + i = children.length; + while (i--) { + if (node === children[i]) { + indexes.push(i); + break; + } + } - if ( toString.call(array) === "[object Array]" ) { - Array.prototype.push.apply( ret, array ); - } else { - if ( typeof array.length === "number" ) { - for ( var l = array.length; i < l; i++ ) { - ret.push( array[i] ); - } - } else { - for ( ; array[i]; i++ ) { - ret.push( array[i] ); + node = parent; + parent = parent.parentNode; } - } - } - return ret; - }; -} + return indexes; + }; -var sortOrder; + function getBookmarkEndPoint(start) { + var position; -if ( document.documentElement.compareDocumentPosition ) { - sortOrder = function( a, b ) { - if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) { - if ( a == b ) { - hasDuplicate = true; - } - return a.compareDocumentPosition ? -1 : 1; - } + position = getPosition(rng, start); + if (position) { + return { + position : position.position, + offset : position.offset, + indexes : getIndexes(position.node), + inside : position.inside + }; + } + }; - var ret = a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1; - if ( ret === 0 ) { - hasDuplicate = true; - } - return ret; - }; -} else if ( "sourceIndex" in document.documentElement ) { - sortOrder = function( a, b ) { - if ( !a.sourceIndex || !b.sourceIndex ) { - if ( a == b ) { - hasDuplicate = true; - } - return a.sourceIndex ? -1 : 1; - } + // Non ubstructive bookmark + if (type === 2) { + // Handle text selection + if (!rng.item) { + bookmark.start = getBookmarkEndPoint(true); - var ret = a.sourceIndex - b.sourceIndex; - if ( ret === 0 ) { - hasDuplicate = true; - } - return ret; - }; -} else if ( document.createRange ) { - sortOrder = function( a, b ) { - if ( !a.ownerDocument || !b.ownerDocument ) { - if ( a == b ) { - hasDuplicate = true; + if (!selection.isCollapsed()) + bookmark.end = getBookmarkEndPoint(); + } else + bookmark.start = {ctrl : true, indexes : getIndexes(rng.item(0))}; } - return a.ownerDocument ? -1 : 1; - } - var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange(); - aRange.setStart(a, 0); - aRange.setEnd(a, 0); - bRange.setStart(b, 0); - bRange.setEnd(b, 0); - var ret = aRange.compareBoundaryPoints(Range.START_TO_END, bRange); - if ( ret === 0 ) { - hasDuplicate = true; - } - return ret; - }; -} + return bookmark; + }; -// Utility function for retreiving the text value of an array of DOM nodes -Sizzle.getText = function( elems ) { - var ret = "", elem; + this.moveToBookmark = function(bookmark) { + var rng, body = dom.doc.body; - for ( var i = 0; elems[i]; i++ ) { - elem = elems[i]; + function resolveIndexes(indexes) { + var node, i, idx, children; - // Get the text from text nodes and CDATA nodes - if ( elem.nodeType === 3 || elem.nodeType === 4 ) { - ret += elem.nodeValue; + node = dom.getRoot(); + for (i = indexes.length - 1; i >= 0; i--) { + children = node.children; + idx = indexes[i]; - // Traverse everything else, except comment nodes - } else if ( elem.nodeType !== 8 ) { - ret += Sizzle.getText( elem.childNodes ); - } - } + if (idx <= children.length - 1) { + node = children[idx]; + } + } - return ret; -}; + return node; + }; + + function setBookmarkEndPoint(start) { + var endPoint = bookmark[start ? 'start' : 'end'], moveLeft, moveRng, undef; -// Check to see if the browser returns elements by name when -// querying by getElementById (and provide a workaround) -(function(){ - // We're going to inject a fake input element with a specified name - var form = document.createElement("div"), - id = "script" + (new Date()).getTime(); - form.innerHTML = ""; + if (endPoint) { + moveLeft = endPoint.position > 0; - // Inject it into the root element, check its status, and remove it quickly - var root = document.documentElement; - root.insertBefore( form, root.firstChild ); + moveRng = body.createTextRange(); + moveRng.moveToElementText(resolveIndexes(endPoint.indexes)); - // The workaround has to do additional checks after a getElementById - // Which slows things down for other browsers (hence the branching) - if ( document.getElementById( id ) ) { - Expr.find.ID = function(match, context, isXML){ - if ( typeof context.getElementById !== "undefined" && !isXML ) { - var m = context.getElementById(match[1]); - return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : []; - } - }; + offset = endPoint.offset; + if (offset !== undef) { + moveRng.collapse(endPoint.inside || moveLeft); + moveRng.moveStart('character', moveLeft ? -offset : offset); + } else + moveRng.collapse(start); - Expr.filter.ID = function(elem, match){ - var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); - return elem.nodeType === 1 && node && node.nodeValue === match; - }; - } + rng.setEndPoint(start ? 'StartToStart' : 'EndToStart', moveRng); - root.removeChild( form ); - root = form = null; // release memory in IE -})(); + if (start) + rng.collapse(true); + } + }; -(function(){ - // Check to see if the browser returns only elements - // when doing getElementsByTagName("*") + if (bookmark.start) { + if (bookmark.start.ctrl) { + rng = body.createControlRange(); + rng.addElement(resolveIndexes(bookmark.start.indexes)); + rng.select(); + } else { + rng = body.createTextRange(); + setBookmarkEndPoint(true); + setBookmarkEndPoint(); + rng.select(); + } + } + }; + + this.addRange = function(rng) { + var ieRng, ctrlRng, startContainer, startOffset, endContainer, endOffset, doc = selection.dom.doc, body = doc.body; - // Create a fake element - var div = document.createElement("div"); - div.appendChild( document.createComment("") ); + function setEndPoint(start) { + var container, offset, marker, tmpRng, nodes; - // Make sure no comments are found - if ( div.getElementsByTagName("*").length > 0 ) { - Expr.find.TAG = function(match, context){ - var results = context.getElementsByTagName(match[1]); + marker = dom.create('a'); + container = start ? startContainer : endContainer; + offset = start ? startOffset : endOffset; + tmpRng = ieRng.duplicate(); - // Filter out possible comments - if ( match[1] === "*" ) { - var tmp = []; + if (container == doc || container == doc.documentElement) { + container = body; + offset = 0; + } - for ( var i = 0; results[i]; i++ ) { - if ( results[i].nodeType === 1 ) { - tmp.push( results[i] ); + if (container.nodeType == 3) { + container.parentNode.insertBefore(marker, container); + tmpRng.moveToElementText(marker); + tmpRng.moveStart('character', offset); + dom.remove(marker); + ieRng.setEndPoint(start ? 'StartToStart' : 'EndToEnd', tmpRng); + } else { + nodes = container.childNodes; + + if (nodes.length) { + if (offset >= nodes.length) { + dom.insertAfter(marker, nodes[nodes.length - 1]); + } else { + container.insertBefore(marker, nodes[offset]); + } + + tmpRng.moveToElementText(marker); + } else { + // Empty node selection for example
    |
    + marker = doc.createTextNode('\uFEFF'); + container.appendChild(marker); + tmpRng.moveToElementText(marker.parentNode); + tmpRng.collapse(TRUE); } + + ieRng.setEndPoint(start ? 'StartToStart' : 'EndToEnd', tmpRng); + dom.remove(marker); } + } - results = tmp; + // Setup some shorter versions + startContainer = rng.startContainer; + startOffset = rng.startOffset; + endContainer = rng.endContainer; + endOffset = rng.endOffset; + ieRng = body.createTextRange(); + + // If single element selection then try making a control selection out of it + if (startContainer == endContainer && startContainer.nodeType == 1 && startOffset == endOffset - 1) { + if (startOffset == endOffset - 1) { + try { + ctrlRng = body.createControlRange(); + ctrlRng.addElement(startContainer.childNodes[startOffset]); + ctrlRng.select(); + return; + } catch (ex) { + // Ignore + } + } } - return results; - }; - } + // Set start/end point of selection + setEndPoint(true); + setEndPoint(); - // Check to see if an attribute returns normalized href attributes - div.innerHTML = "
    "; - if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" && - div.firstChild.getAttribute("href") !== "#" ) { - Expr.attrHandle.href = function(elem){ - return elem.getAttribute("href", 2); + // Select the new range and scroll it into view + ieRng.select(); }; - } - div = null; // release memory in IE -})(); + // Expose range method + this.getRangeAt = getRange; + }; -if ( document.querySelectorAll ) { - (function(){ - var oldSizzle = Sizzle, div = document.createElement("div"); - div.innerHTML = "

    "; + // Expose the selection object + tinymce.dom.TridentSelection = Selection; +})(); - // Safari can't handle uppercase or unicode characters when - // in quirks mode. - if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { - return; - } - - Sizzle = function(query, context, extra, seed){ - context = context || document; - // Only use querySelectorAll on non-XML documents - // (ID selectors don't work in non-HTML documents) - if ( !seed && context.nodeType === 9 && !Sizzle.isXML(context) ) { - try { - return makeArray( context.querySelectorAll(query), extra ); - } catch(e){} - } - - return oldSizzle(query, context, extra, seed); - }; +/* + * Sizzle CSS Selector Engine - v1.0 + * Copyright 2009, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * More information: http://sizzlejs.com/ + */ +(function(){ - for ( var prop in oldSizzle ) { - Sizzle[ prop ] = oldSizzle[ prop ]; - } +var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, + done = 0, + toString = Object.prototype.toString, + hasDuplicate = false, + baseHasDuplicate = true; - div = null; // release memory in IE - })(); -} +// Here we check if the JavaScript engine is using some sort of +// optimization where it does not always call our comparision +// function. If that is the case, discard the hasDuplicate value. +// Thus far that includes Google Chrome. +[0, 0].sort(function(){ + baseHasDuplicate = false; + return 0; +}); -(function(){ - var div = document.createElement("div"); +var Sizzle = function(selector, context, results, seed) { + results = results || []; + context = context || document; - div.innerHTML = "
    "; + var origContext = context; - // Opera can't find a second classname (in 9.6) - // Also, make sure that getElementsByClassName actually exists - if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) { - return; + if ( context.nodeType !== 1 && context.nodeType !== 9 ) { + return []; } - - // Safari caches class attributes, doesn't catch changes (in 3.2) - div.lastChild.className = "e"; - - if ( div.getElementsByClassName("e").length === 1 ) { - return; + + if ( !selector || typeof selector !== "string" ) { + return results; } + + var parts = [], m, set, checkSet, extra, prune = true, contextXML = Sizzle.isXML(context), + soFar = selector, ret, cur, pop, i; - Expr.order.splice(1, 0, "CLASS"); - Expr.find.CLASS = function(match, context, isXML) { - if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { - return context.getElementsByClassName(match[1]); + // Reset the position of the chunker regexp (start from head) + do { + chunker.exec(""); + m = chunker.exec(soFar); + + if ( m ) { + soFar = m[3]; + + parts.push( m[1] ); + + if ( m[2] ) { + extra = m[3]; + break; + } } - }; + } while ( m ); - div = null; // release memory in IE -})(); + if ( parts.length > 1 && origPOS.exec( selector ) ) { + if ( parts.length === 2 && Expr.relative[ parts[0] ] ) { + set = posProcess( parts[0] + parts[1], context ); + } else { + set = Expr.relative[ parts[0] ] ? + [ context ] : + Sizzle( parts.shift(), context ); -function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { - for ( var i = 0, l = checkSet.length; i < l; i++ ) { - var elem = checkSet[i]; - if ( elem ) { - elem = elem[dir]; - var match = false; + while ( parts.length ) { + selector = parts.shift(); - while ( elem ) { - if ( elem.sizcache === doneName ) { - match = checkSet[elem.sizset]; - break; + if ( Expr.relative[ selector ] ) { + selector += parts.shift(); } + + set = posProcess( selector, set ); + } + } + } else { + // Take a shortcut and set the context if the root selector is an ID + // (but not if it'll be faster if the inner selector is an ID) + if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML && + Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) { + ret = Sizzle.find( parts.shift(), context, contextXML ); + context = ret.expr ? Sizzle.filter( ret.expr, ret.set )[0] : ret.set[0]; + } - if ( elem.nodeType === 1 && !isXML ){ - elem.sizcache = doneName; - elem.sizset = i; + if ( context ) { + ret = seed ? + { expr: parts.pop(), set: makeArray(seed) } : + Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML ); + set = ret.expr ? Sizzle.filter( ret.expr, ret.set ) : ret.set; + + if ( parts.length > 0 ) { + checkSet = makeArray(set); + } else { + prune = false; + } + + while ( parts.length ) { + cur = parts.pop(); + pop = cur; + + if ( !Expr.relative[ cur ] ) { + cur = ""; + } else { + pop = parts.pop(); } - if ( elem.nodeName.toLowerCase() === cur ) { - match = elem; - break; + if ( pop == null ) { + pop = context; } - elem = elem[dir]; + Expr.relative[ cur ]( checkSet, pop, contextXML ); } - - checkSet[i] = match; + } else { + checkSet = parts = []; } } -} -function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { - for ( var i = 0, l = checkSet.length; i < l; i++ ) { - var elem = checkSet[i]; - if ( elem ) { - elem = elem[dir]; - var match = false; + if ( !checkSet ) { + checkSet = set; + } - while ( elem ) { - if ( elem.sizcache === doneName ) { - match = checkSet[elem.sizset]; - break; + if ( !checkSet ) { + Sizzle.error( cur || selector ); + } + + if ( toString.call(checkSet) === "[object Array]" ) { + if ( !prune ) { + results.push.apply( results, checkSet ); + } else if ( context && context.nodeType === 1 ) { + for ( i = 0; checkSet[i] != null; i++ ) { + if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) { + results.push( set[i] ); + } + } + } else { + for ( i = 0; checkSet[i] != null; i++ ) { + if ( checkSet[i] && checkSet[i].nodeType === 1 ) { + results.push( set[i] ); } + } + } + } else { + makeArray( checkSet, results ); + } + + if ( extra ) { + Sizzle( extra, origContext, results, seed ); + Sizzle.uniqueSort( results ); + } + + return results; +}; - if ( elem.nodeType === 1 ) { - if ( !isXML ) { - elem.sizcache = doneName; - elem.sizset = i; - } - if ( typeof cur !== "string" ) { - if ( elem === cur ) { - match = true; - break; - } +Sizzle.uniqueSort = function(results){ + if ( sortOrder ) { + hasDuplicate = baseHasDuplicate; + results.sort(sortOrder); - } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) { - match = elem; - break; - } + if ( hasDuplicate ) { + for ( var i = 1; i < results.length; i++ ) { + if ( results[i] === results[i-1] ) { + results.splice(i--, 1); } - - elem = elem[dir]; } - - checkSet[i] = match; } } -} -Sizzle.contains = document.compareDocumentPosition ? function(a, b){ - return !!(a.compareDocumentPosition(b) & 16); -} : function(a, b){ - return a !== b && (a.contains ? a.contains(b) : true); + return results; }; -Sizzle.isXML = function(elem){ - // documentElement is verified for cases where it doesn't yet exist - // (such as loading iframes in IE - #4833) - var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement; - return documentElement ? documentElement.nodeName !== "HTML" : false; +Sizzle.matches = function(expr, set){ + return Sizzle(expr, null, null, set); }; -var posProcess = function(selector, context){ - var tmpSet = [], later = "", match, - root = context.nodeType ? [context] : context; +Sizzle.find = function(expr, context, isXML){ + var set; - // Position selectors must be done after the filter - // And so must :not(positional) so we move all PSEUDOs to the end - while ( (match = Expr.match.PSEUDO.exec( selector )) ) { - later += match[0]; - selector = selector.replace( Expr.match.PSEUDO, "" ); + if ( !expr ) { + return []; } - selector = Expr.relative[selector] ? selector + "*" : selector; + for ( var i = 0, l = Expr.order.length; i < l; i++ ) { + var type = Expr.order[i], match; + + if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { + var left = match[1]; + match.splice(1,1); - for ( var i = 0, l = root.length; i < l; i++ ) { - Sizzle( selector, root[i], tmpSet ); + if ( left.substr( left.length - 1 ) !== "\\" ) { + match[1] = (match[1] || "").replace(/\\/g, ""); + set = Expr.find[ type ]( match, context, isXML ); + if ( set != null ) { + expr = expr.replace( Expr.match[ type ], "" ); + break; + } + } + } } - return Sizzle.filter( later, tmpSet ); + if ( !set ) { + set = context.getElementsByTagName("*"); + } + + return {set: set, expr: expr}; }; -// EXPOSE +Sizzle.filter = function(expr, set, inplace, not){ + var old = expr, result = [], curLoop = set, match, anyFound, + isXMLFilter = set && set[0] && Sizzle.isXML(set[0]); -window.tinymce.dom.Sizzle = Sizzle; + while ( expr && set.length ) { + for ( var type in Expr.filter ) { + if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) { + var filter = Expr.filter[ type ], found, item, left = match[1]; + anyFound = false; -})(); + match.splice(1,1); + if ( left.substr( left.length - 1 ) === "\\" ) { + continue; + } -(function(tinymce) { - // Shorten names - var each = tinymce.each, DOM = tinymce.DOM, isIE = tinymce.isIE, isWebKit = tinymce.isWebKit, Event; + if ( curLoop === result ) { + result = []; + } - tinymce.create('tinymce.dom.EventUtils', { - EventUtils : function() { - this.inits = []; - this.events = []; - }, + if ( Expr.preFilter[ type ] ) { + match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter ); - add : function(o, n, f, s) { - var cb, t = this, el = t.events, r; + if ( !match ) { + anyFound = found = true; + } else if ( match === true ) { + continue; + } + } - if (n instanceof Array) { - r = []; + if ( match ) { + for ( var i = 0; (item = curLoop[i]) != null; i++ ) { + if ( item ) { + found = filter( item, match, i, curLoop ); + var pass = not ^ !!found; - each(n, function(n) { - r.push(t.add(o, n, f, s)); - }); + if ( inplace && found != null ) { + if ( pass ) { + anyFound = true; + } else { + curLoop[i] = false; + } + } else if ( pass ) { + result.push( item ); + anyFound = true; + } + } + } + } - return r; - } + if ( found !== undefined ) { + if ( !inplace ) { + curLoop = result; + } - // Handle array - if (o && o.hasOwnProperty && o instanceof Array) { - r = []; + expr = expr.replace( Expr.match[ type ], "" ); - each(o, function(o) { - o = DOM.get(o); - r.push(t.add(o, n, f, s)); - }); + if ( !anyFound ) { + return []; + } - return r; + break; + } } + } - o = DOM.get(o); + // Improper expression + if ( expr === old ) { + if ( anyFound == null ) { + Sizzle.error( expr ); + } else { + break; + } + } - if (!o) - return; + old = expr; + } - // Setup event callback - cb = function(e) { - // Is all events disabled - if (t.disabled) - return; + return curLoop; +}; - e = e || window.event; +Sizzle.error = function( msg ) { + throw "Syntax error, unrecognized expression: " + msg; +}; - // Patch in target, preventDefault and stopPropagation in IE it's W3C valid - if (e && isIE) { - if (!e.target) - e.target = e.srcElement; +var Expr = Sizzle.selectors = { + order: [ "ID", "NAME", "TAG" ], + match: { + ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, + CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, + NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/, + ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/, + TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/, + CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/, + POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/, + PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/ + }, + leftMatch: {}, + attrMap: { + "class": "className", + "for": "htmlFor" + }, + attrHandle: { + href: function(elem){ + return elem.getAttribute("href"); + } + }, + relative: { + "+": function(checkSet, part){ + var isPartStr = typeof part === "string", + isTag = isPartStr && !/\W/.test(part), + isPartStrNotTag = isPartStr && !isTag; - // Patch in preventDefault, stopPropagation methods for W3C compatibility - tinymce.extend(e, t._stoppers); + if ( isTag ) { + part = part.toLowerCase(); + } + + for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) { + if ( (elem = checkSet[i]) ) { + while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {} + + checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ? + elem || false : + elem === part; } + } - if (!s) - return f(e); + if ( isPartStrNotTag ) { + Sizzle.filter( part, checkSet, true ); + } + }, + ">": function(checkSet, part){ + var isPartStr = typeof part === "string", + elem, i = 0, l = checkSet.length; - return f.call(s, e); - }; + if ( isPartStr && !/\W/.test(part) ) { + part = part.toLowerCase(); + + for ( ; i < l; i++ ) { + elem = checkSet[i]; + if ( elem ) { + var parent = elem.parentNode; + checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false; + } + } + } else { + for ( ; i < l; i++ ) { + elem = checkSet[i]; + if ( elem ) { + checkSet[i] = isPartStr ? + elem.parentNode : + elem.parentNode === part; + } + } - if (n == 'unload') { - tinymce.unloads.unshift({func : cb}); - return cb; + if ( isPartStr ) { + Sizzle.filter( part, checkSet, true ); + } } + }, + "": function(checkSet, part, isXML){ + var doneName = done++, checkFn = dirCheck, nodeCheck; - if (n == 'init') { - if (t.domLoaded) - cb(); - else - t.inits.push(cb); - - return cb; + if ( typeof part === "string" && !/\W/.test(part) ) { + part = part.toLowerCase(); + nodeCheck = part; + checkFn = dirNodeCheck; } - // Store away listener reference - el.push({ - obj : o, - name : n, - func : f, - cfunc : cb, - scope : s - }); - - t._add(o, n, cb); - - return f; + checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML); }, + "~": function(checkSet, part, isXML){ + var doneName = done++, checkFn = dirCheck, nodeCheck; - remove : function(o, n, f) { - var t = this, a = t.events, s = false, r; - - // Handle array - if (o && o.hasOwnProperty && o instanceof Array) { - r = []; - - each(o, function(o) { - o = DOM.get(o); - r.push(t.remove(o, n, f)); - }); - - return r; + if ( typeof part === "string" && !/\W/.test(part) ) { + part = part.toLowerCase(); + nodeCheck = part; + checkFn = dirNodeCheck; } - o = DOM.get(o); + checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML); + } + }, + find: { + ID: function(match, context, isXML){ + if ( typeof context.getElementById !== "undefined" && !isXML ) { + var m = context.getElementById(match[1]); + return m ? [m] : []; + } + }, + NAME: function(match, context){ + if ( typeof context.getElementsByName !== "undefined" ) { + var ret = [], results = context.getElementsByName(match[1]); - each(a, function(e, i) { - if (e.obj == o && e.name == n && (!f || (e.func == f || e.cfunc == f))) { - a.splice(i, 1); - t._remove(o, n, e.cfunc); - s = true; - return false; + for ( var i = 0, l = results.length; i < l; i++ ) { + if ( results[i].getAttribute("name") === match[1] ) { + ret.push( results[i] ); + } } - }); - return s; + return ret.length === 0 ? null : ret; + } }, + TAG: function(match, context){ + return context.getElementsByTagName(match[1]); + } + }, + preFilter: { + CLASS: function(match, curLoop, inplace, result, not, isXML){ + match = " " + match[1].replace(/\\/g, "") + " "; - clear : function(o) { - var t = this, a = t.events, i, e; - - if (o) { - o = DOM.get(o); - - for (i = a.length - 1; i >= 0; i--) { - e = a[i]; + if ( isXML ) { + return match; + } - if (e.obj === o) { - t._remove(e.obj, e.name, e.cfunc); - e.obj = e.cfunc = null; - a.splice(i, 1); + for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) { + if ( elem ) { + if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n]/g, " ").indexOf(match) >= 0) ) { + if ( !inplace ) { + result.push( elem ); + } + } else if ( inplace ) { + curLoop[i] = false; } } } + + return false; }, + ID: function(match){ + return match[1].replace(/\\/g, ""); + }, + TAG: function(match, curLoop){ + return match[1].toLowerCase(); + }, + CHILD: function(match){ + if ( match[1] === "nth" ) { + // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6' + var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec( + match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" || + !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]); - cancel : function(e) { - if (!e) - return false; + // calculate the numbers (first)n+(last) including if they are negative + match[2] = (test[1] + (test[2] || 1)) - 0; + match[3] = test[3] - 0; + } - this.stop(e); + // TODO: Move to normal caching system + match[0] = done++; - return this.prevent(e); + return match; }, + ATTR: function(match, curLoop, inplace, result, not, isXML){ + var name = match[1].replace(/\\/g, ""); + + if ( !isXML && Expr.attrMap[name] ) { + match[1] = Expr.attrMap[name]; + } - stop : function(e) { - if (e.stopPropagation) - e.stopPropagation(); - else - e.cancelBubble = true; + if ( match[2] === "~=" ) { + match[4] = " " + match[4] + " "; + } - return false; + return match; }, - - prevent : function(e) { - if (e.preventDefault) - e.preventDefault(); - else - e.returnValue = false; - - return false; + PSEUDO: function(match, curLoop, inplace, result, not){ + if ( match[1] === "not" ) { + // If we're dealing with a complex expression, or a simple one + if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) { + match[3] = Sizzle(match[3], null, null, curLoop); + } else { + var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); + if ( !inplace ) { + result.push.apply( result, ret ); + } + return false; + } + } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { + return true; + } + + return match; }, - - destroy : function() { - var t = this; - - each(t.events, function(e, i) { - t._remove(e.obj, e.name, e.cfunc); - e.obj = e.cfunc = null; - }); - - t.events = []; - t = null; + POS: function(match){ + match.unshift( true ); + return match; + } + }, + filters: { + enabled: function(elem){ + return elem.disabled === false && elem.type !== "hidden"; + }, + disabled: function(elem){ + return elem.disabled === true; + }, + checked: function(elem){ + return elem.checked === true; + }, + selected: function(elem){ + // Accessing this property makes selected-by-default + // options in Safari work properly + elem.parentNode.selectedIndex; + return elem.selected === true; + }, + parent: function(elem){ + return !!elem.firstChild; + }, + empty: function(elem){ + return !elem.firstChild; + }, + has: function(elem, i, match){ + return !!Sizzle( match[3], elem ).length; + }, + header: function(elem){ + return (/h\d/i).test( elem.nodeName ); + }, + text: function(elem){ + return "text" === elem.type; + }, + radio: function(elem){ + return "radio" === elem.type; + }, + checkbox: function(elem){ + return "checkbox" === elem.type; + }, + file: function(elem){ + return "file" === elem.type; + }, + password: function(elem){ + return "password" === elem.type; + }, + submit: function(elem){ + return "submit" === elem.type; + }, + image: function(elem){ + return "image" === elem.type; + }, + reset: function(elem){ + return "reset" === elem.type; + }, + button: function(elem){ + return "button" === elem.type || elem.nodeName.toLowerCase() === "button"; + }, + input: function(elem){ + return (/input|select|textarea|button/i).test(elem.nodeName); + } + }, + setFilters: { + first: function(elem, i){ + return i === 0; + }, + last: function(elem, i, match, array){ + return i === array.length - 1; }, - - _add : function(o, n, f) { - if (o.attachEvent) - o.attachEvent('on' + n, f); - else if (o.addEventListener) - o.addEventListener(n, f, false); - else - o['on' + n] = f; + even: function(elem, i){ + return i % 2 === 0; }, - - _remove : function(o, n, f) { - if (o) { - try { - if (o.detachEvent) - o.detachEvent('on' + n, f); - else if (o.removeEventListener) - o.removeEventListener(n, f, false); - else - o['on' + n] = null; - } catch (ex) { - // Might fail with permission denined on IE so we just ignore that - } - } + odd: function(elem, i){ + return i % 2 === 1; }, - - _pageInit : function(win) { - var t = this; - - // Keep it from running more than once - if (t.domLoaded) - return; - - t.domLoaded = true; - - each(t.inits, function(c) { - c(); - }); - - t.inits = []; + lt: function(elem, i, match){ + return i < match[3] - 0; }, + gt: function(elem, i, match){ + return i > match[3] - 0; + }, + nth: function(elem, i, match){ + return match[3] - 0 === i; + }, + eq: function(elem, i, match){ + return match[3] - 0 === i; + } + }, + filter: { + PSEUDO: function(elem, match, i, array){ + var name = match[1], filter = Expr.filters[ name ]; - _wait : function(win) { - var t = this, doc = win.document; - - // No need since the document is already loaded - if (win.tinyMCE_GZ && tinyMCE_GZ.loaded) { - t.domLoaded = 1; - return; - } + if ( filter ) { + return filter( elem, i, match, array ); + } else if ( name === "contains" ) { + return (elem.textContent || elem.innerText || Sizzle.getText([ elem ]) || "").indexOf(match[3]) >= 0; + } else if ( name === "not" ) { + var not = match[3]; - // Use IE method - if (doc.attachEvent) { - doc.attachEvent("onreadystatechange", function() { - if (doc.readyState === "complete") { - doc.detachEvent("onreadystatechange", arguments.callee); - t._pageInit(win); + for ( var j = 0, l = not.length; j < l; j++ ) { + if ( not[j] === elem ) { + return false; } - }); - - if (doc.documentElement.doScroll && win == win.top) { - (function() { - if (t.domLoaded) - return; + } - try { - // If IE is used, use the trick by Diego Perini - // http://javascript.nwbox.com/IEContentLoaded/ - doc.documentElement.doScroll("left"); - } catch (ex) { - setTimeout(arguments.callee, 0); - return; + return true; + } else { + Sizzle.error( "Syntax error, unrecognized expression: " + name ); + } + }, + CHILD: function(elem, match){ + var type = match[1], node = elem; + switch (type) { + case 'only': + case 'first': + while ( (node = node.previousSibling) ) { + if ( node.nodeType === 1 ) { + return false; + } + } + if ( type === "first" ) { + return true; + } + node = elem; + case 'last': + while ( (node = node.nextSibling) ) { + if ( node.nodeType === 1 ) { + return false; } + } + return true; + case 'nth': + var first = match[2], last = match[3]; - t._pageInit(win); - })(); - } - } else if (doc.addEventListener) { - t._add(win, 'DOMContentLoaded', function() { - t._pageInit(win); - }); + if ( first === 1 && last === 0 ) { + return true; + } + + var doneName = match[0], + parent = elem.parentNode; + + if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) { + var count = 0; + for ( node = parent.firstChild; node; node = node.nextSibling ) { + if ( node.nodeType === 1 ) { + node.nodeIndex = ++count; + } + } + parent.sizcache = doneName; + } + + var diff = elem.nodeIndex - last; + if ( first === 0 ) { + return diff === 0; + } else { + return ( diff % first === 0 && diff / first >= 0 ); + } } - - t._add(win, 'load', function() { - t._pageInit(win); - }); }, + ID: function(elem, match){ + return elem.nodeType === 1 && elem.getAttribute("id") === match; + }, + TAG: function(elem, match){ + return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match; + }, + CLASS: function(elem, match){ + return (" " + (elem.className || elem.getAttribute("class")) + " ") + .indexOf( match ) > -1; + }, + ATTR: function(elem, match){ + var name = match[1], + result = Expr.attrHandle[ name ] ? + Expr.attrHandle[ name ]( elem ) : + elem[ name ] != null ? + elem[ name ] : + elem.getAttribute( name ), + value = result + "", + type = match[2], + check = match[4]; - _stoppers : { - preventDefault : function() { - this.returnValue = false; - }, + return result == null ? + type === "!=" : + type === "=" ? + value === check : + type === "*=" ? + value.indexOf(check) >= 0 : + type === "~=" ? + (" " + value + " ").indexOf(check) >= 0 : + !check ? + value && result !== false : + type === "!=" ? + value !== check : + type === "^=" ? + value.indexOf(check) === 0 : + type === "$=" ? + value.substr(value.length - check.length) === check : + type === "|=" ? + value === check || value.substr(0, check.length + 1) === check + "-" : + false; + }, + POS: function(elem, match, i, array){ + var name = match[2], filter = Expr.setFilters[ name ]; - stopPropagation : function() { - this.cancelBubble = true; + if ( filter ) { + return filter( elem, i, match, array ); } } - }); - - Event = tinymce.dom.Event = new tinymce.dom.EventUtils(); - - // Dispatch DOM content loaded event for IE and Safari - Event._wait(window); - - tinymce.addUnload(function() { - Event.destroy(); - }); -})(tinymce); + } +}; -(function(tinymce) { - tinymce.dom.Element = function(id, settings) { - var t = this, dom, el; +var origPOS = Expr.match.POS, + fescape = function(all, num){ + return "\\" + (num - 0 + 1); + }; - t.settings = settings = settings || {}; - t.id = id; - t.dom = dom = settings.dom || tinymce.DOM; +for ( var type in Expr.match ) { + Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) ); + Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) ); +} - // Only IE leaks DOM references, this is a lot faster - if (!tinymce.isIE) - el = dom.get(t.id); +var makeArray = function(array, results) { + array = Array.prototype.slice.call( array, 0 ); - tinymce.each( - ('getPos,getRect,getParent,add,setStyle,getStyle,setStyles,' + - 'setAttrib,setAttribs,getAttrib,addClass,removeClass,' + - 'hasClass,getOuterHTML,setOuterHTML,remove,show,hide,' + - 'isHidden,setHTML,get').split(/,/) - , function(k) { - t[k] = function() { - var a = [id], i; + if ( results ) { + results.push.apply( results, array ); + return results; + } + + return array; +}; - for (i = 0; i < arguments.length; i++) - a.push(arguments[i]); +// Perform a simple check to determine if the browser is capable of +// converting a NodeList to an array using builtin methods. +// Also verifies that the returned array holds DOM nodes +// (which is not the case in the Blackberry browser) +try { + Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType; - a = dom[k].apply(dom, a); - t.update(k); +// Provide a fallback method if it does not work +} catch(e){ + makeArray = function(array, results) { + var ret = results || [], i = 0; - return a; - }; - }); + if ( toString.call(array) === "[object Array]" ) { + Array.prototype.push.apply( ret, array ); + } else { + if ( typeof array.length === "number" ) { + for ( var l = array.length; i < l; i++ ) { + ret.push( array[i] ); + } + } else { + for ( ; array[i]; i++ ) { + ret.push( array[i] ); + } + } + } - tinymce.extend(t, { - on : function(n, f, s) { - return tinymce.dom.Event.add(t.id, n, f, s); - }, + return ret; + }; +} - getXY : function() { - return { - x : parseInt(t.getStyle('left')), - y : parseInt(t.getStyle('top')) - }; - }, +var sortOrder; - getSize : function() { - var n = dom.get(t.id); +if ( document.documentElement.compareDocumentPosition ) { + sortOrder = function( a, b ) { + if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) { + if ( a == b ) { + hasDuplicate = true; + } + return a.compareDocumentPosition ? -1 : 1; + } - return { - w : parseInt(t.getStyle('width') || n.clientWidth), - h : parseInt(t.getStyle('height') || n.clientHeight) - }; - }, + var ret = a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1; + if ( ret === 0 ) { + hasDuplicate = true; + } + return ret; + }; +} else if ( "sourceIndex" in document.documentElement ) { + sortOrder = function( a, b ) { + if ( !a.sourceIndex || !b.sourceIndex ) { + if ( a == b ) { + hasDuplicate = true; + } + return a.sourceIndex ? -1 : 1; + } - moveTo : function(x, y) { - t.setStyles({left : x, top : y}); - }, + var ret = a.sourceIndex - b.sourceIndex; + if ( ret === 0 ) { + hasDuplicate = true; + } + return ret; + }; +} else if ( document.createRange ) { + sortOrder = function( a, b ) { + if ( !a.ownerDocument || !b.ownerDocument ) { + if ( a == b ) { + hasDuplicate = true; + } + return a.ownerDocument ? -1 : 1; + } - moveBy : function(x, y) { - var p = t.getXY(); + var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange(); + aRange.setStart(a, 0); + aRange.setEnd(a, 0); + bRange.setStart(b, 0); + bRange.setEnd(b, 0); + var ret = aRange.compareBoundaryPoints(Range.START_TO_END, bRange); + if ( ret === 0 ) { + hasDuplicate = true; + } + return ret; + }; +} - t.moveTo(p.x + x, p.y + y); - }, +// Utility function for retreiving the text value of an array of DOM nodes +Sizzle.getText = function( elems ) { + var ret = "", elem; - resizeTo : function(w, h) { - t.setStyles({width : w, height : h}); - }, + for ( var i = 0; elems[i]; i++ ) { + elem = elems[i]; - resizeBy : function(w, h) { - var s = t.getSize(); + // Get the text from text nodes and CDATA nodes + if ( elem.nodeType === 3 || elem.nodeType === 4 ) { + ret += elem.nodeValue; - t.resizeTo(s.w + w, s.h + h); - }, + // Traverse everything else, except comment nodes + } else if ( elem.nodeType !== 8 ) { + ret += Sizzle.getText( elem.childNodes ); + } + } - update : function(k) { - var b; + return ret; +}; - if (tinymce.isIE6 && settings.blocker) { - k = k || ''; +// Check to see if the browser returns elements by name when +// querying by getElementById (and provide a workaround) +(function(){ + // We're going to inject a fake input element with a specified name + var form = document.createElement("div"), + id = "script" + (new Date()).getTime(); + form.innerHTML = ""; - // Ignore getters - if (k.indexOf('get') === 0 || k.indexOf('has') === 0 || k.indexOf('is') === 0) - return; + // Inject it into the root element, check its status, and remove it quickly + var root = document.documentElement; + root.insertBefore( form, root.firstChild ); - // Remove blocker on remove - if (k == 'remove') { - dom.remove(t.blocker); - return; - } + // The workaround has to do additional checks after a getElementById + // Which slows things down for other browsers (hence the branching) + if ( document.getElementById( id ) ) { + Expr.find.ID = function(match, context, isXML){ + if ( typeof context.getElementById !== "undefined" && !isXML ) { + var m = context.getElementById(match[1]); + return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : []; + } + }; - if (!t.blocker) { - t.blocker = dom.uniqueId(); - b = dom.add(settings.container || dom.getRoot(), 'iframe', {id : t.blocker, style : 'position:absolute;', frameBorder : 0, src : 'javascript:""'}); - dom.setStyle(b, 'opacity', 0); - } else - b = dom.get(t.blocker); + Expr.filter.ID = function(elem, match){ + var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); + return elem.nodeType === 1 && node && node.nodeValue === match; + }; + } - dom.setStyles(b, { - left : t.getStyle('left', 1), - top : t.getStyle('top', 1), - width : t.getStyle('width', 1), - height : t.getStyle('height', 1), - display : t.getStyle('display', 1), - zIndex : parseInt(t.getStyle('zIndex', 1) || 0) - 1 - }); - } - } - }); - }; -})(tinymce); + root.removeChild( form ); + root = form = null; // release memory in IE +})(); -(function(tinymce) { - function trimNl(s) { - return s.replace(/[\n\r]+/g, ''); - }; +(function(){ + // Check to see if the browser returns only elements + // when doing getElementsByTagName("*") - // Shorten names - var is = tinymce.is, isIE = tinymce.isIE, each = tinymce.each; + // Create a fake element + var div = document.createElement("div"); + div.appendChild( document.createComment("") ); - tinymce.create('tinymce.dom.Selection', { - Selection : function(dom, win, serializer) { - var t = this; + // Make sure no comments are found + if ( div.getElementsByTagName("*").length > 0 ) { + Expr.find.TAG = function(match, context){ + var results = context.getElementsByTagName(match[1]); - t.dom = dom; - t.win = win; - t.serializer = serializer; + // Filter out possible comments + if ( match[1] === "*" ) { + var tmp = []; - // Add events - each([ - 'onBeforeSetContent', - 'onBeforeGetContent', - 'onSetContent', - 'onGetContent' - ], function(e) { - t[e] = new tinymce.util.Dispatcher(t); - }); + for ( var i = 0; results[i]; i++ ) { + if ( results[i].nodeType === 1 ) { + tmp.push( results[i] ); + } + } - // No W3C Range support - if (!t.win.getSelection) - t.tridentSel = new tinymce.dom.TridentSelection(t); + results = tmp; + } - // Prevent leaks - tinymce.addUnload(t.destroy, t); - }, + return results; + }; + } - getContent : function(s) { - var t = this, r = t.getRng(), e = t.dom.create("body"), se = t.getSel(), wb, wa, n; + // Check to see if an attribute returns normalized href attributes + div.innerHTML = ""; + if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" && + div.firstChild.getAttribute("href") !== "#" ) { + Expr.attrHandle.href = function(elem){ + return elem.getAttribute("href", 2); + }; + } - s = s || {}; - wb = wa = ''; - s.get = true; - s.format = s.format || 'html'; - t.onBeforeGetContent.dispatch(t, s); + div = null; // release memory in IE +})(); - if (s.format == 'text') - return t.isCollapsed() ? '' : (r.text || (se.toString ? se.toString() : '')); +if ( document.querySelectorAll ) { + (function(){ + var oldSizzle = Sizzle, div = document.createElement("div"); + div.innerHTML = "

    "; - if (r.cloneContents) { - n = r.cloneContents(); + // Safari can't handle uppercase or unicode characters when + // in quirks mode. + if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { + return; + } + + Sizzle = function(query, context, extra, seed){ + context = context || document; - if (n) - e.appendChild(n); - } else if (is(r.item) || is(r.htmlText)) - e.innerHTML = r.item ? r.item(0).outerHTML : r.htmlText; - else - e.innerHTML = r.toString(); + // Only use querySelectorAll on non-XML documents + // (ID selectors don't work in non-HTML documents) + if ( !seed && context.nodeType === 9 && !Sizzle.isXML(context) ) { + try { + return makeArray( context.querySelectorAll(query), extra ); + } catch(e){} + } + + return oldSizzle(query, context, extra, seed); + }; - // Keep whitespace before and after - if (/^\s/.test(e.innerHTML)) - wb = ' '; + for ( var prop in oldSizzle ) { + Sizzle[ prop ] = oldSizzle[ prop ]; + } - if (/\s+$/.test(e.innerHTML)) - wa = ' '; + div = null; // release memory in IE + })(); +} - s.getInner = true; +(function(){ + var div = document.createElement("div"); - s.content = t.isCollapsed() ? '' : wb + t.serializer.serialize(e, s) + wa; - t.onGetContent.dispatch(t, s); + div.innerHTML = "
    "; - return s.content; - }, + // Opera can't find a second classname (in 9.6) + // Also, make sure that getElementsByClassName actually exists + if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) { + return; + } - setContent : function(h, s) { - var t = this, r = t.getRng(), c, d = t.win.document; + // Safari caches class attributes, doesn't catch changes (in 3.2) + div.lastChild.className = "e"; - s = s || {format : 'html'}; - s.set = true; - h = s.content = t.dom.processHTML(h); + if ( div.getElementsByClassName("e").length === 1 ) { + return; + } + + Expr.order.splice(1, 0, "CLASS"); + Expr.find.CLASS = function(match, context, isXML) { + if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { + return context.getElementsByClassName(match[1]); + } + }; - // Dispatch before set content event - t.onBeforeSetContent.dispatch(t, s); - h = s.content; + div = null; // release memory in IE +})(); - if (r.insertNode) { - // Make caret marker since insertNode places the caret in the beginning of text after insert - h += '_'; +function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { + for ( var i = 0, l = checkSet.length; i < l; i++ ) { + var elem = checkSet[i]; + if ( elem ) { + elem = elem[dir]; + var match = false; - // Delete and insert new node - - if (r.startContainer == d && r.endContainer == d) { - // WebKit will fail if the body is empty since the range is then invalid and it can't insert contents - d.body.innerHTML = h; - } else { - r.deleteContents(); - if (d.body.childNodes.length == 0) { - d.body.innerHTML = h; - } else { - r.insertNode(r.createContextualFragment(h)); - } + while ( elem ) { + if ( elem.sizcache === doneName ) { + match = checkSet[elem.sizset]; + break; } - // Move to caret marker - c = t.dom.get('__caret'); - // Make sure we wrap it compleatly, Opera fails with a simple select call - r = d.createRange(); - r.setStartBefore(c); - r.setEndBefore(c); - t.setRng(r); + if ( elem.nodeType === 1 && !isXML ){ + elem.sizcache = doneName; + elem.sizset = i; + } - // Remove the caret position - t.dom.remove('__caret'); - } else { - if (r.item) { - // Delete content and get caret text selection - d.execCommand('Delete', false, null); - r = t.getRng(); + if ( elem.nodeName.toLowerCase() === cur ) { + match = elem; + break; } - r.pasteHTML(h); + elem = elem[dir]; } - // Dispatch set content event - t.onSetContent.dispatch(t, s); - }, + checkSet[i] = match; + } + } +} - getStart : function() { - var rng = this.getRng(), startElement, parentElement, checkRng, node; +function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { + for ( var i = 0, l = checkSet.length; i < l; i++ ) { + var elem = checkSet[i]; + if ( elem ) { + elem = elem[dir]; + var match = false; - if (rng.duplicate || rng.item) { - // Control selection, return first item - if (rng.item) - return rng.item(0); + while ( elem ) { + if ( elem.sizcache === doneName ) { + match = checkSet[elem.sizset]; + break; + } - // Get start element - checkRng = rng.duplicate(); - checkRng.collapse(1); - startElement = checkRng.parentElement(); + if ( elem.nodeType === 1 ) { + if ( !isXML ) { + elem.sizcache = doneName; + elem.sizset = i; + } + if ( typeof cur !== "string" ) { + if ( elem === cur ) { + match = true; + break; + } - // Check if range parent is inside the start element, then return the inner parent element - // This will fix issues when a single element is selected, IE would otherwise return the wrong start element - parentElement = node = rng.parentElement(); - while (node = node.parentNode) { - if (node == startElement) { - startElement = parentElement; + } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) { + match = elem; break; } } - // If start element is body element try to move to the first child if it exists - if (startElement && startElement.nodeName == 'BODY') - return startElement.firstChild || startElement; - - return startElement; - } else { - startElement = rng.startContainer; - - if (startElement.nodeType == 1 && startElement.hasChildNodes()) - startElement = startElement.childNodes[Math.min(startElement.childNodes.length - 1, rng.startOffset)]; - - if (startElement && startElement.nodeType == 3) - return startElement.parentNode; - - return startElement; + elem = elem[dir]; } - }, - - getEnd : function() { - var t = this, r = t.getRng(), e, eo; - - if (r.duplicate || r.item) { - if (r.item) - return r.item(0); - - r = r.duplicate(); - r.collapse(0); - e = r.parentElement(); - if (e && e.nodeName == 'BODY') - return e.lastChild || e; + checkSet[i] = match; + } + } +} - return e; - } else { - e = r.endContainer; - eo = r.endOffset; +Sizzle.contains = document.compareDocumentPosition ? function(a, b){ + return !!(a.compareDocumentPosition(b) & 16); +} : function(a, b){ + return a !== b && (a.contains ? a.contains(b) : true); +}; - if (e.nodeType == 1 && e.hasChildNodes()) - e = e.childNodes[eo > 0 ? eo - 1 : eo]; +Sizzle.isXML = function(elem){ + // documentElement is verified for cases where it doesn't yet exist + // (such as loading iframes in IE - #4833) + var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement; + return documentElement ? documentElement.nodeName !== "HTML" : false; +}; - if (e && e.nodeType == 3) - return e.parentNode; +var posProcess = function(selector, context){ + var tmpSet = [], later = "", match, + root = context.nodeType ? [context] : context; - return e; - } - }, + // Position selectors must be done after the filter + // And so must :not(positional) so we move all PSEUDOs to the end + while ( (match = Expr.match.PSEUDO.exec( selector )) ) { + later += match[0]; + selector = selector.replace( Expr.match.PSEUDO, "" ); + } - getBookmark : function(type, normalized) { - var t = this, dom = t.dom, rng, rng2, id, collapsed, name, element, index, chr = '\uFEFF', styles; + selector = Expr.relative[selector] ? selector + "*" : selector; - function findIndex(name, element) { - var index = 0; + for ( var i = 0, l = root.length; i < l; i++ ) { + Sizzle( selector, root[i], tmpSet ); + } - each(dom.select(name), function(node, i) { - if (node == element) - index = i; - }); + return Sizzle.filter( later, tmpSet ); +}; - return index; - }; +// EXPOSE - if (type == 2) { - function getLocation() { - var rng = t.getRng(true), root = dom.getRoot(), bookmark = {}; +window.tinymce.dom.Sizzle = Sizzle; - function getPoint(rng, start) { - var container = rng[start ? 'startContainer' : 'endContainer'], - offset = rng[start ? 'startOffset' : 'endOffset'], point = [], node, childNodes, after = 0; +})(); - if (container.nodeType == 3) { - if (normalized) { - for (node = container.previousSibling; node && node.nodeType == 3; node = node.previousSibling) - offset += node.nodeValue.length; - } - point.push(offset); - } else { - childNodes = container.childNodes; +(function(tinymce) { + // Shorten names + var each = tinymce.each, DOM = tinymce.DOM, isIE = tinymce.isIE, isWebKit = tinymce.isWebKit, Event; - if (offset >= childNodes.length && childNodes.length) { - after = 1; - offset = Math.max(0, childNodes.length - 1); - } + tinymce.create('tinymce.dom.EventUtils', { + EventUtils : function() { + this.inits = []; + this.events = []; + }, - point.push(t.dom.nodeIndex(childNodes[offset], normalized) + after); - } + add : function(o, n, f, s) { + var cb, t = this, el = t.events, r; - for (; container && container != root; container = container.parentNode) - point.push(t.dom.nodeIndex(container, normalized)); + if (n instanceof Array) { + r = []; - return point; - }; + each(n, function(n) { + r.push(t.add(o, n, f, s)); + }); - bookmark.start = getPoint(rng, true); + return r; + } - if (!t.isCollapsed()) - bookmark.end = getPoint(rng); + // Handle array + if (o && o.hasOwnProperty && o instanceof Array) { + r = []; - return bookmark; - }; + each(o, function(o) { + o = DOM.get(o); + r.push(t.add(o, n, f, s)); + }); - return getLocation(); + return r; } - // Handle simple range - if (type) - return {rng : t.getRng()}; + o = DOM.get(o); - rng = t.getRng(); - id = dom.uniqueId(); - collapsed = tinyMCE.activeEditor.selection.isCollapsed(); - styles = 'overflow:hidden;line-height:0px'; + if (!o) + return; - // Explorer method - if (rng.duplicate || rng.item) { - // Text selection - if (!rng.item) { - rng2 = rng.duplicate(); + // Setup event callback + cb = function(e) { + // Is all events disabled + if (t.disabled) + return; - // Insert start marker - rng.collapse(); - rng.pasteHTML('' + chr + ''); + e = e || window.event; - // Insert end marker - if (!collapsed) { - rng2.collapse(false); - rng2.pasteHTML('' + chr + ''); - } - } else { - // Control selection - element = rng.item(0); - name = element.nodeName; + // Patch in target, preventDefault and stopPropagation in IE it's W3C valid + if (e && isIE) { + if (!e.target) + e.target = e.srcElement; - return {name : name, index : findIndex(name, element)}; + // Patch in preventDefault, stopPropagation methods for W3C compatibility + tinymce.extend(e, t._stoppers); } - } else { - element = t.getNode(); - name = element.nodeName; - if (name == 'IMG') - return {name : name, index : findIndex(name, element)}; - // W3C method - rng2 = rng.cloneRange(); + if (!s) + return f(e); - // Insert end marker - if (!collapsed) { - rng2.collapse(false); - rng2.insertNode(dom.create('span', {_mce_type : "bookmark", id : id + '_end', style : styles}, chr)); - } + return f.call(s, e); + }; - rng.collapse(true); - rng.insertNode(dom.create('span', {_mce_type : "bookmark", id : id + '_start', style : styles}, chr)); + if (n == 'unload') { + tinymce.unloads.unshift({func : cb}); + return cb; } - t.moveToBookmark({id : id, keep : 1}); + if (n == 'init') { + if (t.domLoaded) + cb(); + else + t.inits.push(cb); - return {id : id}; + return cb; + } + + // Store away listener reference + el.push({ + obj : o, + name : n, + func : f, + cfunc : cb, + scope : s + }); + + t._add(o, n, cb); + + return f; }, - moveToBookmark : function(bookmark) { - var t = this, dom = t.dom, marker1, marker2, rng, root, startContainer, endContainer, startOffset, endOffset; + remove : function(o, n, f) { + var t = this, a = t.events, s = false, r; - // Clear selection cache - if (t.tridentSel) - t.tridentSel.destroy(); + // Handle array + if (o && o.hasOwnProperty && o instanceof Array) { + r = []; - if (bookmark) { - if (bookmark.start) { - rng = dom.createRng(); - root = dom.getRoot(); + each(o, function(o) { + o = DOM.get(o); + r.push(t.remove(o, n, f)); + }); - function setEndPoint(start) { - var point = bookmark[start ? 'start' : 'end'], i, node, offset, children; + return r; + } - if (point) { - // Find container node - for (node = root, i = point.length - 1; i >= 1; i--) { - children = node.childNodes; + o = DOM.get(o); - if (children.length) - node = children[point[i]]; - } + each(a, function(e, i) { + if (e.obj == o && e.name == n && (!f || (e.func == f || e.cfunc == f))) { + a.splice(i, 1); + t._remove(o, n, e.cfunc); + s = true; + return false; + } + }); - // Set offset within container node - if (start) - rng.setStart(node, point[0]); - else - rng.setEnd(node, point[0]); - } - }; + return s; + }, - setEndPoint(true); - setEndPoint(); + clear : function(o) { + var t = this, a = t.events, i, e; - t.setRng(rng); - } else if (bookmark.id) { - function restoreEndPoint(suffix) { - var marker = dom.get(bookmark.id + '_' + suffix), node, idx, next, prev, keep = bookmark.keep; + if (o) { + o = DOM.get(o); - if (marker) { - node = marker.parentNode; + for (i = a.length - 1; i >= 0; i--) { + e = a[i]; - if (suffix == 'start') { - if (!keep) { - idx = dom.nodeIndex(marker); - } else { - node = marker.firstChild; - idx = 1; - } + if (e.obj === o) { + t._remove(e.obj, e.name, e.cfunc); + e.obj = e.cfunc = null; + a.splice(i, 1); + } + } + } + }, - startContainer = endContainer = node; - startOffset = endOffset = idx; - } else { - if (!keep) { - idx = dom.nodeIndex(marker); - } else { - node = marker.firstChild; - idx = 1; - } + cancel : function(e) { + if (!e) + return false; - endContainer = node; - endOffset = idx; - } + this.stop(e); - if (!keep) { - prev = marker.previousSibling; - next = marker.nextSibling; + return this.prevent(e); + }, - // Remove all marker text nodes - each(tinymce.grep(marker.childNodes), function(node) { - if (node.nodeType == 3) - node.nodeValue = node.nodeValue.replace(/\uFEFF/g, ''); - }); + stop : function(e) { + if (e.stopPropagation) + e.stopPropagation(); + else + e.cancelBubble = true; - // Remove marker but keep children if for example contents where inserted into the marker - // Also remove duplicated instances of the marker for example by a split operation or by WebKit auto split on paste feature - while (marker = dom.get(bookmark.id + '_' + suffix)) - dom.remove(marker, 1); + return false; + }, - // If siblings are text nodes then merge them - if (prev && next && prev.nodeType == next.nodeType && prev.nodeType == 3) { - idx = prev.nodeValue.length; - prev.appendData(next.nodeValue); - dom.remove(next); + prevent : function(e) { + if (e.preventDefault) + e.preventDefault(); + else + e.returnValue = false; - if (suffix == 'start') { - startContainer = endContainer = prev; - startOffset = endOffset = idx; - } else { - endContainer = prev; - endOffset = idx; - } - } - } - } - }; + return false; + }, - function addBogus(node) { - // Adds a bogus BR element for empty block elements - // on non IE browsers just to have a place to put the caret - if (!isIE && dom.isBlock(node) && !node.innerHTML) - node.innerHTML = '
    '; + destroy : function() { + var t = this; - return node; - }; + each(t.events, function(e, i) { + t._remove(e.obj, e.name, e.cfunc); + e.obj = e.cfunc = null; + }); - // Restore start/end points - restoreEndPoint('start'); - restoreEndPoint('end'); + t.events = []; + t = null; + }, - rng = dom.createRng(); - rng.setStart(addBogus(startContainer), startOffset); - rng.setEnd(addBogus(endContainer), endOffset); - t.setRng(rng); - } else if (bookmark.name) { - t.select(dom.select(bookmark.name)[bookmark.index]); - } else if (bookmark.rng) - t.setRng(bookmark.rng); + _add : function(o, n, f) { + if (o.attachEvent) + o.attachEvent('on' + n, f); + else if (o.addEventListener) + o.addEventListener(n, f, false); + else + o['on' + n] = f; + }, + + _remove : function(o, n, f) { + if (o) { + try { + if (o.detachEvent) + o.detachEvent('on' + n, f); + else if (o.removeEventListener) + o.removeEventListener(n, f, false); + else + o['on' + n] = null; + } catch (ex) { + // Might fail with permission denined on IE so we just ignore that + } } }, - select : function(node, content) { - var t = this, dom = t.dom, rng = dom.createRng(), idx; - - idx = dom.nodeIndex(node); - rng.setStart(node.parentNode, idx); - rng.setEnd(node.parentNode, idx + 1); + _pageInit : function(win) { + var t = this; - // Find first/last text node or BR element - if (content) { - function setPoint(node, start) { - var walker = new tinymce.dom.TreeWalker(node, node); + // Keep it from running more than once + if (t.domLoaded) + return; - do { - // Text node - if (node.nodeType == 3 && tinymce.trim(node.nodeValue).length != 0) { - if (start) - rng.setStart(node, 0); - else - rng.setEnd(node, node.nodeValue.length); + t.domLoaded = true; - return; - } + each(t.inits, function(c) { + c(); + }); - // BR element - if (node.nodeName == 'BR') { - if (start) - rng.setStartBefore(node); - else - rng.setEndBefore(node); + t.inits = []; + }, - return; - } - } while (node = (start ? walker.next() : walker.prev())); - }; + _wait : function(win) { + var t = this, doc = win.document; - setPoint(node, 1); - setPoint(node); + // No need since the document is already loaded + if (win.tinyMCE_GZ && tinyMCE_GZ.loaded) { + t.domLoaded = 1; + return; } - t.setRng(rng); - - return node; - }, + // Use IE method + if (doc.attachEvent) { + doc.attachEvent("onreadystatechange", function() { + if (doc.readyState === "complete") { + doc.detachEvent("onreadystatechange", arguments.callee); + t._pageInit(win); + } + }); - isCollapsed : function() { - var t = this, r = t.getRng(), s = t.getSel(); + if (doc.documentElement.doScroll && win == win.top) { + (function() { + if (t.domLoaded) + return; - if (!r || r.item) - return false; + try { + // If IE is used, use the trick by Diego Perini licensed under MIT by request to the author. + // http://javascript.nwbox.com/IEContentLoaded/ + doc.documentElement.doScroll("left"); + } catch (ex) { + setTimeout(arguments.callee, 0); + return; + } - if (r.compareEndPoints) - return r.compareEndPoints('StartToEnd', r) === 0; + t._pageInit(win); + })(); + } + } else if (doc.addEventListener) { + t._add(win, 'DOMContentLoaded', function() { + t._pageInit(win); + }); + } - return !s || r.collapsed; + t._add(win, 'load', function() { + t._pageInit(win); + }); }, - collapse : function(b) { - var t = this, r = t.getRng(), n; + _stoppers : { + preventDefault : function() { + this.returnValue = false; + }, - // Control range on IE - if (r.item) { - n = r.item(0); - r = this.win.document.body.createTextRange(); - r.moveToElementText(n); + stopPropagation : function() { + this.cancelBubble = true; } + } + }); - r.collapse(!!b); - t.setRng(r); - }, - - getSel : function() { - var t = this, w = this.win; + Event = tinymce.dom.Event = new tinymce.dom.EventUtils(); - return w.getSelection ? w.getSelection() : w.document.selection; - }, + // Dispatch DOM content loaded event for IE and Safari + Event._wait(window); - getRng : function(w3c) { - var t = this, s, r; + tinymce.addUnload(function() { + Event.destroy(); + }); +})(tinymce); - // Found tridentSel object then we need to use that one - if (w3c && t.tridentSel) - return t.tridentSel.getRangeAt(0); +(function(tinymce) { + tinymce.dom.Element = function(id, settings) { + var t = this, dom, el; - try { - if (s = t.getSel()) - r = s.rangeCount > 0 ? s.getRangeAt(0) : (s.createRange ? s.createRange() : t.win.document.createRange()); - } catch (ex) { - // IE throws unspecified error here if TinyMCE is placed in a frame/iframe - } + t.settings = settings = settings || {}; + t.id = id; + t.dom = dom = settings.dom || tinymce.DOM; - // No range found then create an empty one - // This can occur when the editor is placed in a hidden container element on Gecko - // Or on IE when there was an exception - if (!r) - r = t.win.document.createRange ? t.win.document.createRange() : t.win.document.body.createTextRange(); + // Only IE leaks DOM references, this is a lot faster + if (!tinymce.isIE) + el = dom.get(t.id); - if (t.selectedRange && t.explicitRange) { - if (r.compareBoundaryPoints(r.START_TO_START, t.selectedRange) === 0 && r.compareBoundaryPoints(r.END_TO_END, t.selectedRange) === 0) { - // Safari, Opera and Chrome only ever select text which causes the range to change. - // This lets us use the originally set range if the selection hasn't been changed by the user. - r = t.explicitRange; - } else { - t.selectedRange = null; - t.explicitRange = null; - } - } - return r; - }, + tinymce.each( + ('getPos,getRect,getParent,add,setStyle,getStyle,setStyles,' + + 'setAttrib,setAttribs,getAttrib,addClass,removeClass,' + + 'hasClass,getOuterHTML,setOuterHTML,remove,show,hide,' + + 'isHidden,setHTML,get').split(/,/) + , function(k) { + t[k] = function() { + var a = [id], i; - setRng : function(r) { - var s, t = this; - - if (!t.tridentSel) { - s = t.getSel(); + for (i = 0; i < arguments.length; i++) + a.push(arguments[i]); - if (s) { - t.explicitRange = r; - s.removeAllRanges(); - s.addRange(r); - t.selectedRange = s.getRangeAt(0); - } - } else { - // Is W3C Range - if (r.cloneRange) { - t.tridentSel.addRange(r); - return; - } + a = dom[k].apply(dom, a); + t.update(k); - // Is IE specific range - try { - r.select(); - } catch (ex) { - // Needed for some odd IE bug #1843306 - } - } - }, + return a; + }; + }); - setNode : function(n) { - var t = this; + tinymce.extend(t, { + on : function(n, f, s) { + return tinymce.dom.Event.add(t.id, n, f, s); + }, - t.setContent(t.dom.getOuterHTML(n)); + getXY : function() { + return { + x : parseInt(t.getStyle('left')), + y : parseInt(t.getStyle('top')) + }; + }, - return n; - }, + getSize : function() { + var n = dom.get(t.id); - getNode : function() { - var t = this, rng = t.getRng(), sel = t.getSel(), elm; + return { + w : parseInt(t.getStyle('width') || n.clientWidth), + h : parseInt(t.getStyle('height') || n.clientHeight) + }; + }, - if (rng.setStart) { - // Range maybe lost after the editor is made visible again - if (!rng) - return t.dom.getRoot(); + moveTo : function(x, y) { + t.setStyles({left : x, top : y}); + }, - elm = rng.commonAncestorContainer; + moveBy : function(x, y) { + var p = t.getXY(); - // Handle selection a image or other control like element such as anchors - if (!rng.collapsed) { - if (rng.startContainer == rng.endContainer) { - if (rng.startOffset - rng.endOffset < 2) { - if (rng.startContainer.hasChildNodes()) - elm = rng.startContainer.childNodes[rng.startOffset]; - } - } + t.moveTo(p.x + x, p.y + y); + }, - // If the anchor node is a element instead of a text node then return this element - if (tinymce.isWebKit && sel.anchorNode && sel.anchorNode.nodeType == 1) - return sel.anchorNode.childNodes[sel.anchorOffset]; - } + resizeTo : function(w, h) { + t.setStyles({width : w, height : h}); + }, - if (elm && elm.nodeType == 3) - return elm.parentNode; + resizeBy : function(w, h) { + var s = t.getSize(); - return elm; - } + t.resizeTo(s.w + w, s.h + h); + }, - return rng.item ? rng.item(0) : rng.parentElement(); - }, + update : function(k) { + var b; - getSelectedBlocks : function(st, en) { - var t = this, dom = t.dom, sb, eb, n, bl = []; + if (tinymce.isIE6 && settings.blocker) { + k = k || ''; - sb = dom.getParent(st || t.getStart(), dom.isBlock); - eb = dom.getParent(en || t.getEnd(), dom.isBlock); + // Ignore getters + if (k.indexOf('get') === 0 || k.indexOf('has') === 0 || k.indexOf('is') === 0) + return; - if (sb) - bl.push(sb); + // Remove blocker on remove + if (k == 'remove') { + dom.remove(t.blocker); + return; + } - if (sb && eb && sb != eb) { - n = sb; + if (!t.blocker) { + t.blocker = dom.uniqueId(); + b = dom.add(settings.container || dom.getRoot(), 'iframe', {id : t.blocker, style : 'position:absolute;', frameBorder : 0, src : 'javascript:""'}); + dom.setStyle(b, 'opacity', 0); + } else + b = dom.get(t.blocker); - while ((n = n.nextSibling) && n != eb) { - if (dom.isBlock(n)) - bl.push(n); + dom.setStyles(b, { + left : t.getStyle('left', 1), + top : t.getStyle('top', 1), + width : t.getStyle('width', 1), + height : t.getStyle('height', 1), + display : t.getStyle('display', 1), + zIndex : parseInt(t.getStyle('zIndex', 1) || 0) - 1 + }); } } + }); + }; +})(tinymce); - if (eb && sb != eb) - bl.push(eb); +(function(tinymce) { + function trimNl(s) { + return s.replace(/[\n\r]+/g, ''); + }; - return bl; - }, + // Shorten names + var is = tinymce.is, isIE = tinymce.isIE, each = tinymce.each; - destroy : function(s) { + tinymce.create('tinymce.dom.Selection', { + Selection : function(dom, win, serializer) { var t = this; - t.win = null; + t.dom = dom; + t.win = win; + t.serializer = serializer; - if (t.tridentSel) - t.tridentSel.destroy(); + // Add events + each([ + 'onBeforeSetContent', - // Manual destroy then remove unload handler - if (!s) - tinymce.removeUnload(t.destroy); - } - }); -})(tinymce); + 'onBeforeGetContent', -(function(tinymce) { - tinymce.create('tinymce.dom.XMLWriter', { - node : null, - - XMLWriter : function(s) { - // Get XML document - function getXML() { - var i = document.implementation; - - if (!i || !i.createDocument) { - // Try IE objects - try {return new ActiveXObject('MSXML2.DOMDocument');} catch (ex) {} - try {return new ActiveXObject('Microsoft.XmlDom');} catch (ex) {} - } else - return i.createDocument('', '', null); - }; + 'onSetContent', - this.doc = getXML(); - - // Since Opera and WebKit doesn't escape > into > we need to do it our self to normalize the output for all browsers - this.valid = tinymce.isOpera || tinymce.isWebKit; + 'onGetContent' + ], function(e) { + t[e] = new tinymce.util.Dispatcher(t); + }); - this.reset(); - }, + // No W3C Range support + if (!t.win.getSelection) + t.tridentSel = new tinymce.dom.TridentSelection(t); - reset : function() { - var t = this, d = t.doc; + if (tinymce.isIE && dom.boxModel) + this._fixIESelection(); - if (d.firstChild) - d.removeChild(d.firstChild); + // Prevent leaks + tinymce.addUnload(t.destroy, t); + }, - t.node = d.appendChild(d.createElement("html")); + setCursorLocation: function(node, offset) { + var t = this; var r = t.dom.createRng(); + r.setStart(node, offset); + r.setEnd(node, offset); + t.setRng(r); + t.collapse(false); }, + getContent : function(s) { + var t = this, r = t.getRng(), e = t.dom.create("body"), se = t.getSel(), wb, wa, n; - writeStartElement : function(n) { - var t = this; + s = s || {}; + wb = wa = ''; + s.get = true; + s.format = s.format || 'html'; + s.forced_root_block = ''; + t.onBeforeGetContent.dispatch(t, s); - t.node = t.node.appendChild(t.doc.createElement(n)); - }, + if (s.format == 'text') + return t.isCollapsed() ? '' : (r.text || (se.toString ? se.toString() : '')); - writeAttribute : function(n, v) { - if (this.valid) - v = v.replace(/>/g, '%MCGT%'); + if (r.cloneContents) { + n = r.cloneContents(); - this.node.setAttribute(n, v); - }, + if (n) + e.appendChild(n); + } else if (is(r.item) || is(r.htmlText)) { + // IE will produce invalid markup if elements are present that + // it doesn't understand like custom elements or HTML5 elements. + // Adding a BR in front of the contents and then remoiving it seems to fix it though. + e.innerHTML = '
    ' + (r.item ? r.item(0).outerHTML : r.htmlText); + e.removeChild(e.firstChild); + } else + e.innerHTML = r.toString(); - writeEndElement : function() { - this.node = this.node.parentNode; - }, + // Keep whitespace before and after + if (/^\s/.test(e.innerHTML)) + wb = ' '; - writeFullEndElement : function() { - var t = this, n = t.node; + if (/\s+$/.test(e.innerHTML)) + wa = ' '; - n.appendChild(t.doc.createTextNode("")); - t.node = n.parentNode; - }, + s.getInner = true; - writeText : function(v) { - if (this.valid) - v = v.replace(/>/g, '%MCGT%'); + s.content = t.isCollapsed() ? '' : wb + t.serializer.serialize(e, s) + wa; + t.onGetContent.dispatch(t, s); - this.node.appendChild(this.doc.createTextNode(v)); + return s.content; }, - writeCDATA : function(v) { - this.node.appendChild(this.doc.createCDATASection(v)); - }, + setContent : function(content, args) { + var self = this, rng = self.getRng(), caretNode, doc = self.win.document, frag, temp; - writeComment : function(v) { - // Fix for bug #2035694 - if (tinymce.isIE) - v = v.replace(/^\-|\-$/g, ' '); + args = args || {format : 'html'}; + args.set = true; + content = args.content = content; - this.node.appendChild(this.doc.createComment(v.replace(/\-\-/g, ' '))); - }, + // Dispatch before set content event + if (!args.no_events) + self.onBeforeSetContent.dispatch(self, args); - getContent : function() { - var h; + content = args.content; - h = this.doc.xml || new XMLSerializer().serializeToString(this.doc); - h = h.replace(/<\?[^?]+\?>||<\/html>||]+>/g, ''); - h = h.replace(/ ?\/>/g, ' />'); + if (rng.insertNode) { + // Make caret marker since insertNode places the caret in the beginning of text after insert + content += '_'; - if (this.valid) - h = h.replace(/\%MCGT%/g, '>'); + // Delete and insert new node + if (rng.startContainer == doc && rng.endContainer == doc) { + // WebKit will fail if the body is empty since the range is then invalid and it can't insert contents + doc.body.innerHTML = content; + } else { + rng.deleteContents(); - return h; - } - }); -})(tinymce); + if (doc.body.childNodes.length == 0) { + doc.body.innerHTML = content; + } else { + // createContextualFragment doesn't exists in IE 9 DOMRanges + if (rng.createContextualFragment) { + rng.insertNode(rng.createContextualFragment(content)); + } else { + // Fake createContextualFragment call in IE 9 + frag = doc.createDocumentFragment(); + temp = doc.createElement('div'); -(function(tinymce) { - tinymce.create('tinymce.dom.StringWriter', { - str : null, - tags : null, - count : 0, - settings : null, - indent : null, - - StringWriter : function(s) { - this.settings = tinymce.extend({ - indent_char : ' ', - indentation : 0 - }, s); + frag.appendChild(temp); + temp.outerHTML = content; - this.reset(); - }, + rng.insertNode(frag); + } + } + } - reset : function() { - this.indent = ''; - this.str = ""; - this.tags = []; - this.count = 0; - }, + // Move to caret marker + caretNode = self.dom.get('__caret'); - writeStartElement : function(n) { - this._writeAttributesEnd(); - this.writeRaw('<' + n); - this.tags.push(n); - this.inAttr = true; - this.count++; - this.elementCount = this.count; - }, + // Make sure we wrap it compleatly, Opera fails with a simple select call + rng = doc.createRange(); + rng.setStartBefore(caretNode); + rng.setEndBefore(caretNode); + self.setRng(rng); - writeAttribute : function(n, v) { - var t = this; + // Remove the caret position + self.dom.remove('__caret'); + + try { + self.setRng(rng); + } catch (ex) { + // Might fail on Opera for some odd reason + } + } else { + if (rng.item) { + // Delete content and get caret text selection + doc.execCommand('Delete', false, null); + rng = self.getRng(); + } + + // Explorer removes spaces from the beginning of pasted contents + if (/^\s+/.test(content)) { + rng.pasteHTML('_' + content); + self.dom.remove('__mce_tmp'); + } else + rng.pasteHTML(content); + } - t.writeRaw(" " + t.encode(n) + '="' + t.encode(v) + '"'); + // Dispatch set content event + if (!args.no_events) + self.onSetContent.dispatch(self, args); }, - writeEndElement : function() { - var n; + getStart : function() { + var rng = this.getRng(), startElement, parentElement, checkRng, node; - if (this.tags.length > 0) { - n = this.tags.pop(); + if (rng.duplicate || rng.item) { + // Control selection, return first item + if (rng.item) + return rng.item(0); - if (this._writeAttributesEnd(1)) - this.writeRaw(''); + // Get start element + checkRng = rng.duplicate(); + checkRng.collapse(1); + startElement = checkRng.parentElement(); - if (this.settings.indentation > 0) - this.writeRaw('\n'); - } - }, + // Check if range parent is inside the start element, then return the inner parent element + // This will fix issues when a single element is selected, IE would otherwise return the wrong start element + parentElement = node = rng.parentElement(); + while (node = node.parentNode) { + if (node == startElement) { + startElement = parentElement; + break; + } + } - writeFullEndElement : function() { - if (this.tags.length > 0) { - this._writeAttributesEnd(); - this.writeRaw(''); + return startElement; + } else { + startElement = rng.startContainer; - if (this.settings.indentation > 0) - this.writeRaw('\n'); - } - }, + if (startElement.nodeType == 1 && startElement.hasChildNodes()) + startElement = startElement.childNodes[Math.min(startElement.childNodes.length - 1, rng.startOffset)]; - writeText : function(v) { - this._writeAttributesEnd(); - this.writeRaw(this.encode(v)); - this.count++; - }, + if (startElement && startElement.nodeType == 3) + return startElement.parentNode; - writeCDATA : function(v) { - this._writeAttributesEnd(); - this.writeRaw(''); - this.count++; + return startElement; + } }, - writeComment : function(v) { - this._writeAttributesEnd(); - this.writeRaw(''); - this.count++; - }, + getEnd : function() { + var t = this, r = t.getRng(), e, eo; - writeRaw : function(v) { - this.str += v; - }, + if (r.duplicate || r.item) { + if (r.item) + return r.item(0); - encode : function(s) { - return s.replace(/[<>&"]/g, function(v) { - switch (v) { - case '<': - return '<'; + r = r.duplicate(); + r.collapse(0); + e = r.parentElement(); - case '>': - return '>'; + if (e && e.nodeName == 'BODY') + return e.lastChild || e; - case '&': - return '&'; + return e; + } else { + e = r.endContainer; + eo = r.endOffset; - case '"': - return '"'; - } + if (e.nodeType == 1 && e.hasChildNodes()) + e = e.childNodes[eo > 0 ? eo - 1 : eo]; - return v; - }); - }, + if (e && e.nodeType == 3) + return e.parentNode; - getContent : function() { - return this.str; + return e; + } }, - _writeAttributesEnd : function(s) { - if (!this.inAttr) - return; + getBookmark : function(type, normalized) { + var t = this, dom = t.dom, rng, rng2, id, collapsed, name, element, index, chr = '\uFEFF', styles; - this.inAttr = false; + function findIndex(name, element) { + var index = 0; - if (s && this.elementCount == this.count) { - this.writeRaw(' />'); - return false; - } + each(dom.select(name), function(node, i) { + if (node == element) + index = i; + }); - this.writeRaw('>'); + return index; + }; - return true; - } - }); -})(tinymce); + if (type == 2) { + function getLocation() { + var rng = t.getRng(true), root = dom.getRoot(), bookmark = {}; -(function(tinymce) { - // Shorten names - var extend = tinymce.extend, each = tinymce.each, Dispatcher = tinymce.util.Dispatcher, isIE = tinymce.isIE, isGecko = tinymce.isGecko; + function getPoint(rng, start) { + var container = rng[start ? 'startContainer' : 'endContainer'], + offset = rng[start ? 'startOffset' : 'endOffset'], point = [], node, childNodes, after = 0; - function wildcardToRE(s) { - return s.replace(/([?+*])/g, '.$1'); - }; + if (container.nodeType == 3) { + if (normalized) { + for (node = container.previousSibling; node && node.nodeType == 3; node = node.previousSibling) + offset += node.nodeValue.length; + } - tinymce.create('tinymce.dom.Serializer', { - Serializer : function(s) { - var t = this; + point.push(offset); + } else { + childNodes = container.childNodes; - t.key = 0; - t.onPreProcess = new Dispatcher(t); - t.onPostProcess = new Dispatcher(t); + if (offset >= childNodes.length && childNodes.length) { + after = 1; + offset = Math.max(0, childNodes.length - 1); + } - try { - t.writer = new tinymce.dom.XMLWriter(); - } catch (ex) { - // IE might throw exception if ActiveX is disabled so we then switch to the slightly slower StringWriter - t.writer = new tinymce.dom.StringWriter(); - } + point.push(t.dom.nodeIndex(childNodes[offset], normalized) + after); + } - // Default settings - t.settings = s = extend({ - dom : tinymce.DOM, - valid_nodes : 0, - node_filter : 0, - attr_filter : 0, - invalid_attrs : /^(_mce_|_moz_|sizset|sizcache)/, - closed : /^(br|hr|input|meta|img|link|param|area)$/, - entity_encoding : 'named', - entities : '160,nbsp,161,iexcl,162,cent,163,pound,164,curren,165,yen,166,brvbar,167,sect,168,uml,169,copy,170,ordf,171,laquo,172,not,173,shy,174,reg,175,macr,176,deg,177,plusmn,178,sup2,179,sup3,180,acute,181,micro,182,para,183,middot,184,cedil,185,sup1,186,ordm,187,raquo,188,frac14,189,frac12,190,frac34,191,iquest,192,Agrave,193,Aacute,194,Acirc,195,Atilde,196,Auml,197,Aring,198,AElig,199,Ccedil,200,Egrave,201,Eacute,202,Ecirc,203,Euml,204,Igrave,205,Iacute,206,Icirc,207,Iuml,208,ETH,209,Ntilde,210,Ograve,211,Oacute,212,Ocirc,213,Otilde,214,Ouml,215,times,216,Oslash,217,Ugrave,218,Uacute,219,Ucirc,220,Uuml,221,Yacute,222,THORN,223,szlig,224,agrave,225,aacute,226,acirc,227,atilde,228,auml,229,aring,230,aelig,231,ccedil,232,egrave,233,eacute,234,ecirc,235,euml,236,igrave,237,iacute,238,icirc,239,iuml,240,eth,241,ntilde,242,ograve,243,oacute,244,ocirc,245,otilde,246,ouml,247,divide,248,oslash,249,ugrave,250,uacute,251,ucirc,252,uuml,253,yacute,254,thorn,255,yuml,402,fnof,913,Alpha,914,Beta,915,Gamma,916,Delta,917,Epsilon,918,Zeta,919,Eta,920,Theta,921,Iota,922,Kappa,923,Lambda,924,Mu,925,Nu,926,Xi,927,Omicron,928,Pi,929,Rho,931,Sigma,932,Tau,933,Upsilon,934,Phi,935,Chi,936,Psi,937,Omega,945,alpha,946,beta,947,gamma,948,delta,949,epsilon,950,zeta,951,eta,952,theta,953,iota,954,kappa,955,lambda,956,mu,957,nu,958,xi,959,omicron,960,pi,961,rho,962,sigmaf,963,sigma,964,tau,965,upsilon,966,phi,967,chi,968,psi,969,omega,977,thetasym,978,upsih,982,piv,8226,bull,8230,hellip,8242,prime,8243,Prime,8254,oline,8260,frasl,8472,weierp,8465,image,8476,real,8482,trade,8501,alefsym,8592,larr,8593,uarr,8594,rarr,8595,darr,8596,harr,8629,crarr,8656,lArr,8657,uArr,8658,rArr,8659,dArr,8660,hArr,8704,forall,8706,part,8707,exist,8709,empty,8711,nabla,8712,isin,8713,notin,8715,ni,8719,prod,8721,sum,8722,minus,8727,lowast,8730,radic,8733,prop,8734,infin,8736,ang,8743,and,8744,or,8745,cap,8746,cup,8747,int,8756,there4,8764,sim,8773,cong,8776,asymp,8800,ne,8801,equiv,8804,le,8805,ge,8834,sub,8835,sup,8836,nsub,8838,sube,8839,supe,8853,oplus,8855,otimes,8869,perp,8901,sdot,8968,lceil,8969,rceil,8970,lfloor,8971,rfloor,9001,lang,9002,rang,9674,loz,9824,spades,9827,clubs,9829,hearts,9830,diams,338,OElig,339,oelig,352,Scaron,353,scaron,376,Yuml,710,circ,732,tilde,8194,ensp,8195,emsp,8201,thinsp,8204,zwnj,8205,zwj,8206,lrm,8207,rlm,8211,ndash,8212,mdash,8216,lsquo,8217,rsquo,8218,sbquo,8220,ldquo,8221,rdquo,8222,bdquo,8224,dagger,8225,Dagger,8240,permil,8249,lsaquo,8250,rsaquo,8364,euro', - valid_elements : '*[*]', - extended_valid_elements : 0, - invalid_elements : 0, - fix_table_elements : 1, - fix_list_elements : true, - fix_content_duplication : true, - convert_fonts_to_spans : false, - font_size_classes : 0, - apply_source_formatting : 0, - indent_mode : 'simple', - indent_char : '\t', - indent_levels : 1, - remove_linebreaks : 1, - remove_redundant_brs : 1, - element_format : 'xhtml' - }, s); + for (; container && container != root; container = container.parentNode) + point.push(t.dom.nodeIndex(container, normalized)); - t.dom = s.dom; - t.schema = s.schema; + return point; + }; - // Use raw entities if no entities are defined - if (s.entity_encoding == 'named' && !s.entities) - s.entity_encoding = 'raw'; + bookmark.start = getPoint(rng, true); - if (s.remove_redundant_brs) { - t.onPostProcess.add(function(se, o) { - // Remove single BR at end of block elements since they get rendered - o.content = o.content.replace(/(
    \s*)+<\/(p|h[1-6]|div|li)>/gi, function(a, b, c) { - // Check if it's a single element - if (/^
    \s*<\//.test(a)) - return ''; + if (!t.isCollapsed()) + bookmark.end = getPoint(rng); - return a; - }); - }); - } + return bookmark; + }; - // Remove XHTML element endings i.e. produce crap :) XHTML is better - if (s.element_format == 'html') { - t.onPostProcess.add(function(se, o) { - o.content = o.content.replace(/<([^>]+) \/>/g, '<$1>'); - }); + if (t.tridentSel) + return t.tridentSel.getBookmark(type); + + return getLocation(); } - if (s.fix_list_elements) { - t.onPreProcess.add(function(se, o) { - var nl, x, a = ['ol', 'ul'], i, n, p, r = /^(OL|UL)$/, np; + // Handle simple range + if (type) + return {rng : t.getRng()}; + + rng = t.getRng(); + id = dom.uniqueId(); + collapsed = tinyMCE.activeEditor.selection.isCollapsed(); + styles = 'overflow:hidden;line-height:0px'; + + // Explorer method + if (rng.duplicate || rng.item) { + // Text selection + if (!rng.item) { + rng2 = rng.duplicate(); + + try { + // Insert start marker + rng.collapse(); + rng.pasteHTML('' + chr + ''); + + // Insert end marker + if (!collapsed) { + rng2.collapse(false); - function prevNode(e, n) { - var a = n.split(','), i; + // Detect the empty space after block elements in IE and move the end back one character

    ] becomes

    ]

    + rng.moveToElementText(rng2.parentElement()); + if (rng.compareEndPoints('StartToEnd', rng2) == 0) + rng2.move('character', -1); - while ((e = e.previousSibling) != null) { - for (i=0; i' + chr + ''); } - + } catch (ex) { + // IE might throw unspecified error so lets ignore it return null; - }; + } + } else { + // Control selection + element = rng.item(0); + name = element.nodeName; - for (x=0; x= 1767) { - each(t.dom.select('p table', o.node).reverse(), function(n) { - var parent = t.dom.getParent(n.parentNode, 'table,p'); + t.moveToBookmark({id : id, keep : 1}); - if (parent.nodeName != 'TABLE') { - try { - t.dom.split(parent, n); - } catch (ex) { - // IE can sometimes fire an unknown runtime error so we just ignore it - } - } - }); - } - }); - } + return {id : id}; }, - setEntities : function(s) { - var t = this, a, i, l = {}, v; + moveToBookmark : function(bookmark) { + var t = this, dom = t.dom, marker1, marker2, rng, root, startContainer, endContainer, startOffset, endOffset; - // No need to setup more than once - if (t.entityLookup) - return; + if (bookmark) { + if (bookmark.start) { + rng = dom.createRng(); + root = dom.getRoot(); - // Build regex and lookup array - a = s.split(','); - for (i = 0; i < a.length; i += 2) { - v = a[i]; + function setEndPoint(start) { + var point = bookmark[start ? 'start' : 'end'], i, node, offset, children; - // Don't add default & " etc. - if (v == 34 || v == 38 || v == 60 || v == 62) - continue; + if (point) { + offset = point[0]; - l[String.fromCharCode(a[i])] = a[i + 1]; + // Find container node + for (node = root, i = point.length - 1; i >= 1; i--) { + children = node.childNodes; - v = parseInt(a[i]).toString(16); - } + if (point[i] > children.length - 1) + return; - t.entityLookup = l; - }, + node = children[point[i]]; + } - setRules : function(s) { - var t = this; + // Move text offset to best suitable location + if (node.nodeType === 3) + offset = Math.min(point[0], node.nodeValue.length); - t._setup(); - t.rules = {}; - t.wildRules = []; - t.validElements = {}; + // Move element offset to best suitable location + if (node.nodeType === 1) + offset = Math.min(point[0], node.childNodes.length); - return t.addRules(s); - }, + // Set offset within container node + if (start) + rng.setStart(node, offset); + else + rng.setEnd(node, offset); + } - addRules : function(s) { - var t = this, dr; + return true; + }; - if (!s) - return; + if (t.tridentSel) + return t.tridentSel.moveToBookmark(bookmark); - t._setup(); + if (setEndPoint(true) && setEndPoint()) { + t.setRng(rng); + } + } else if (bookmark.id) { + function restoreEndPoint(suffix) { + var marker = dom.get(bookmark.id + '_' + suffix), node, idx, next, prev, keep = bookmark.keep; - each(s.split(','), function(s) { - var p = s.split(/\[|\]/), tn = p[0].split('/'), ra, at, wat, va = []; + if (marker) { + node = marker.parentNode; - // Extend with default rules - if (dr) - at = tinymce.extend([], dr.attribs); + if (suffix == 'start') { + if (!keep) { + idx = dom.nodeIndex(marker); + } else { + node = marker.firstChild; + idx = 1; + } - // Parse attributes - if (p.length > 1) { - each(p[1].split('|'), function(s) { - var ar = {}, i; + startContainer = endContainer = node; + startOffset = endOffset = idx; + } else { + if (!keep) { + idx = dom.nodeIndex(marker); + } else { + node = marker.firstChild; + idx = 1; + } - at = at || []; + endContainer = node; + endOffset = idx; + } - // Parse attribute rule - s = s.replace(/::/g, '~'); - s = /^([!\-])?([\w*.?~_\-]+|)([=:<])?(.+)?$/.exec(s); - s[2] = s[2].replace(/~/g, ':'); + if (!keep) { + prev = marker.previousSibling; + next = marker.nextSibling; - // Add required attributes - if (s[1] == '!') { - ra = ra || []; - ra.push(s[2]); - } + // Remove all marker text nodes + each(tinymce.grep(marker.childNodes), function(node) { + if (node.nodeType == 3) + node.nodeValue = node.nodeValue.replace(/\uFEFF/g, ''); + }); - // Remove inherited attributes - if (s[1] == '-') { - for (i = 0; i ' : ' '; - // Add validation values - case '<': - ar.validVals = s[4].split('?'); - break; - } + return node; + }; - if (/[*.?]/.test(s[2])) { - wat = wat || []; - ar.nameRE = new RegExp('^' + wildcardToRE(s[2]) + '$'); - wat.push(ar); - } else { - ar.name = s[2]; - at.push(ar); - } + // Restore start/end points + restoreEndPoint('start'); + restoreEndPoint('end'); - va.push(s[2]); - }); - } + if (startContainer) { + rng = dom.createRng(); + rng.setStart(addBogus(startContainer), startOffset); + rng.setEnd(addBogus(endContainer), endOffset); + t.setRng(rng); + } + } else if (bookmark.name) { + t.select(dom.select(bookmark.name)[bookmark.index]); + } else if (bookmark.rng) + t.setRng(bookmark.rng); + } + }, - // Handle element names - each(tn, function(s, i) { - var pr = s.charAt(0), x = 1, ru = {}; + select : function(node, content) { + var t = this, dom = t.dom, rng = dom.createRng(), idx; - // Extend with default rule data - if (dr) { - if (dr.noEmpty) - ru.noEmpty = dr.noEmpty; + if (node) { + idx = dom.nodeIndex(node); + rng.setStart(node.parentNode, idx); + rng.setEnd(node.parentNode, idx + 1); + + // Find first/last text node or BR element + if (content) { + function setPoint(node, start) { + var walker = new tinymce.dom.TreeWalker(node, node); + + do { + // Text node + if (node.nodeType == 3 && tinymce.trim(node.nodeValue).length != 0) { + if (start) + rng.setStart(node, 0); + else + rng.setEnd(node, node.nodeValue.length); - if (dr.fullEnd) - ru.fullEnd = dr.fullEnd; + return; + } - if (dr.padd) - ru.padd = dr.padd; - } + // BR element + if (node.nodeName == 'BR') { + if (start) + rng.setStartBefore(node); + else + rng.setEndBefore(node); - // Handle prefixes - switch (pr) { - case '-': - ru.noEmpty = true; - break; + return; + } + } while (node = (start ? walker.next() : walker.prev())); + }; - case '+': - ru.fullEnd = true; - break; + setPoint(node, 1); + setPoint(node); + } - case '#': - ru.padd = true; - break; + t.setRng(rng); + } - default: - x = 0; - } + return node; + }, - tn[i] = s = s.substring(x); - t.validElements[s] = 1; + isCollapsed : function() { + var t = this, r = t.getRng(), s = t.getSel(); - // Add element name or element regex - if (/[*.?]/.test(tn[0])) { - ru.nameRE = new RegExp('^' + wildcardToRE(tn[0]) + '$'); - t.wildRules = t.wildRules || {}; - t.wildRules.push(ru); - } else { - ru.name = tn[0]; + if (!r || r.item) + return false; - // Store away default rule - if (tn[0] == '@') - dr = ru; + if (r.compareEndPoints) + return r.compareEndPoints('StartToEnd', r) === 0; - t.rules[s] = ru; - } + return !s || r.collapsed; + }, - ru.attribs = at; + collapse : function(to_start) { + var self = this, rng = self.getRng(), node; - if (ra) - ru.requiredAttribs = ra; + // Control range on IE + if (rng.item) { + node = rng.item(0); + rng = self.win.document.body.createTextRange(); + rng.moveToElementText(node); + } - if (wat) { - // Build valid attributes regexp - s = ''; - each(va, function(v) { - if (s) - s += '|'; + rng.collapse(!!to_start); + self.setRng(rng); + }, - s += '(' + wildcardToRE(v) + ')'; - }); - ru.validAttribsRE = new RegExp('^' + s.toLowerCase() + '$'); - ru.wildAttribs = wat; - } - }); - }); + getSel : function() { + var t = this, w = this.win; - // Build valid elements regexp - s = ''; - each(t.validElements, function(v, k) { - if (s) - s += '|'; + return w.getSelection ? w.getSelection() : w.document.selection; + }, - if (k != '@') - s += k; - }); - t.validElementsRE = new RegExp('^(' + wildcardToRE(s.toLowerCase()) + ')$'); + getRng : function(w3c) { + var t = this, s, r, elm, doc = t.win.document; - //console.debug(t.validElementsRE.toString()); - //console.dir(t.rules); - //console.dir(t.wildRules); - }, + // Found tridentSel object then we need to use that one + if (w3c && t.tridentSel) + return t.tridentSel.getRangeAt(0); - findRule : function(n) { - var t = this, rl = t.rules, i, r; + try { + if (s = t.getSel()) + r = s.rangeCount > 0 ? s.getRangeAt(0) : (s.createRange ? s.createRange() : doc.createRange()); + } catch (ex) { + // IE throws unspecified error here if TinyMCE is placed in a frame/iframe + } - t._setup(); + // We have W3C ranges and it's IE then fake control selection since IE9 doesn't handle that correctly yet + if (tinymce.isIE && r && r.setStart && doc.selection.createRange().item) { + elm = doc.selection.createRange().item(0); + r = doc.createRange(); + r.setStartBefore(elm); + r.setEndAfter(elm); + } - // Exact match - r = rl[n]; - if (r) - return r; + // No range found then create an empty one + // This can occur when the editor is placed in a hidden container element on Gecko + // Or on IE when there was an exception + if (!r) + r = doc.createRange ? doc.createRange() : doc.body.createTextRange(); - // Try wildcards - rl = t.wildRules; - for (i = 0; i < rl.length; i++) { - if (rl[i].nameRE.test(n)) - return rl[i]; + if (t.selectedRange && t.explicitRange) { + if (r.compareBoundaryPoints(r.START_TO_START, t.selectedRange) === 0 && r.compareBoundaryPoints(r.END_TO_END, t.selectedRange) === 0) { + // Safari, Opera and Chrome only ever select text which causes the range to change. + // This lets us use the originally set range if the selection hasn't been changed by the user. + r = t.explicitRange; + } else { + t.selectedRange = null; + t.explicitRange = null; + } } - return null; + return r; }, - findAttribRule : function(ru, n) { - var i, wa = ru.wildAttribs; + setRng : function(r) { + var s, t = this; + + if (!t.tridentSel) { + s = t.getSel(); - for (i = 0; i < wa.length; i++) { - if (wa[i].nameRE.test(n)) - return wa[i]; - } + if (s) { + t.explicitRange = r; - return null; + try { + s.removeAllRanges(); + } catch (ex) { + // IE9 might throw errors here don't know why + } + + s.addRange(r); + t.selectedRange = s.getRangeAt(0); + } + } else { + // Is W3C Range + if (r.cloneRange) { + t.tridentSel.addRange(r); + return; + } + + // Is IE specific range + try { + r.select(); + } catch (ex) { + // Needed for some odd IE bug #1843306 + } + } }, - serialize : function(n, o) { - var h, t = this, doc, oldDoc, impl, selected; + setNode : function(n) { + var t = this; + + t.setContent(t.dom.getOuterHTML(n)); - t._setup(); - o = o || {}; - o.format = o.format || 'html'; - t.processObj = o; + return n; + }, - // IE looses the selected attribute on option elements so we need to store it - // See: http://support.microsoft.com/kb/829907 - if (isIE) { - selected = []; - each(n.getElementsByTagName('option'), function(n) { - var v = t.dom.getAttrib(n, 'selected'); + getNode : function() { + var t = this, rng = t.getRng(), sel = t.getSel(), elm, start = rng.startContainer, end = rng.endContainer; - selected.push(v ? v : null); - }); - } + // Range maybe lost after the editor is made visible again + if (!rng) + return t.dom.getRoot(); - n = n.cloneNode(true); + if (rng.setStart) { + elm = rng.commonAncestorContainer; - // IE looses the selected attribute on option elements so we need to restore it - if (isIE) { - each(n.getElementsByTagName('option'), function(n, i) { - t.dom.setAttrib(n, 'selected', selected[i]); - }); - } + // Handle selection a image or other control like element such as anchors + if (!rng.collapsed) { + if (rng.startContainer == rng.endContainer) { + if (rng.endOffset - rng.startOffset < 2) { + if (rng.startContainer.hasChildNodes()) + elm = rng.startContainer.childNodes[rng.startOffset]; + } + } - // Nodes needs to be attached to something in WebKit/Opera - // Older builds of Opera crashes if you attach the node to an document created dynamically - // and since we can't feature detect a crash we need to sniff the acutal build number - // This fix will make DOM ranges and make Sizzle happy! - impl = n.ownerDocument.implementation; - if (impl.createHTMLDocument && (tinymce.isOpera && opera.buildNumber() >= 1767)) { - // Create an empty HTML document - doc = impl.createHTMLDocument(""); + // If the anchor node is a element instead of a text node then return this element + //if (tinymce.isWebKit && sel.anchorNode && sel.anchorNode.nodeType == 1) + // return sel.anchorNode.childNodes[sel.anchorOffset]; + + // Handle cases where the selection is immediately wrapped around a node and return that node instead of it's parent. + // This happens when you double click an underlined word in FireFox. + if (start.nodeType === 3 && end.nodeType === 3) { + function skipEmptyTextNodes(n, forwards) { + var orig = n; + while (n && n.nodeType === 3 && n.length === 0) { + n = forwards ? n.nextSibling : n.previousSibling; + } + return n || orig; + } + if (start.length === rng.startOffset) { + start = skipEmptyTextNodes(start.nextSibling, true); + } else { + start = start.parentNode; + } + if (rng.endOffset === 0) { + end = skipEmptyTextNodes(end.previousSibling, false); + } else { + end = end.parentNode; + } - // Add the element or it's children if it's a body element to the new document - each(n.nodeName == 'BODY' ? n.childNodes : [n], function(node) { - doc.body.appendChild(doc.importNode(node, true)); - }); + if (start && start === end) + return start; + } + } - // Grab first child or body element for serialization - if (n.nodeName != 'BODY') - n = doc.body.firstChild; - else - n = doc.body; + if (elm && elm.nodeType == 3) + return elm.parentNode; - // set the new document in DOMUtils so createElement etc works - oldDoc = t.dom.doc; - t.dom.doc = doc; + return elm; } - t.key = '' + (parseInt(t.key) + 1); + return rng.item ? rng.item(0) : rng.parentElement(); + }, - // Pre process - if (!o.no_events) { - o.node = n; - t.onPreProcess.dispatch(t, o); - } + getSelectedBlocks : function(st, en) { + var t = this, dom = t.dom, sb, eb, n, bl = []; - // Serialize HTML DOM into a string - t.writer.reset(); - t._info = o; - t._serializeNode(n, o.getInner); + sb = dom.getParent(st || t.getStart(), dom.isBlock); + eb = dom.getParent(en || t.getEnd(), dom.isBlock); - // Post process - o.content = t.writer.getContent(); + if (sb) + bl.push(sb); - // Restore the old document if it was changed - if (oldDoc) - t.dom.doc = oldDoc; + if (sb && eb && sb != eb) { + n = sb; - if (!o.no_events) - t.onPostProcess.dispatch(t, o); + var walker = new tinymce.dom.TreeWalker(sb, dom.getRoot()); + while ((n = walker.next()) && n != eb) { + if (dom.isBlock(n)) + bl.push(n); + } + } - t._postProcess(o); - o.node = null; + if (eb && sb != eb) + bl.push(eb); - return tinymce.trim(o.content); + return bl; }, - // Internal functions + normalize : function() { + var self = this, rng, normalized; - _postProcess : function(o) { - var t = this, s = t.settings, h = o.content, sc = [], p; - - if (o.format == 'html') { - // Protect some elements - p = t._protect({ - content : h, - patterns : [ - {pattern : /(]*>)(.*?)(<\/script>)/g}, - {pattern : /(]*>)(.*?)(<\/noscript>)/g}, - {pattern : /(]*>)(.*?)(<\/style>)/g}, - {pattern : /(]*>)(.*?)(<\/pre>)/g, encode : 1}, - {pattern : /()/g} - ] - }); + // Normalize only on non IE browsers for now + if (tinymce.isIE) + return; - h = p.content; + function normalizeEndPoint(start) { + var container, offset, walker, dom = self.dom, body = dom.getRoot(), node; - // Entity encode - if (s.entity_encoding !== 'raw') - h = t._encode(h); + container = rng[(start ? 'start' : 'end') + 'Container']; + offset = rng[(start ? 'start' : 'end') + 'Offset']; - // Use BR instead of   padded P elements inside editor and use

     

    outside editor -/* if (o.set) - h = h.replace(/

    \s+( | |\u00a0|
    )\s+<\/p>/g, '


    '); - else - h = h.replace(/

    \s+( | |\u00a0|
    )\s+<\/p>/g, '

    $1

    ');*/ + // If the container is a document move it to the body element + if (container.nodeType === 9) { + container = container.body; + offset = 0; + } - // Since Gecko and Safari keeps whitespace in the DOM we need to - // remove it inorder to match other browsers. But I think Gecko and Safari is right. - // This process is only done when getting contents out from the editor. - if (!o.set) { - // We need to replace paragraph whitespace with an nbsp before indentation to keep the \u00a0 char - h = h.replace(/

    \s+<\/p>|]+)>\s+<\/p>/g, s.entity_encoding == 'numeric' ? ' 

    ' : ' 

    '); + // If the container is body try move it into the closest text node or position + // TODO: Add more logic here to handle element selection cases + if (container === body) { + // Resolve the index + if (container.hasChildNodes()) { + container = container.childNodes[Math.min(!start && offset > 0 ? offset - 1 : offset, container.childNodes.length - 1)]; + offset = 0; + + // Don't walk into elements that doesn't have any child nodes like a IMG + if (container.hasChildNodes()) { + // Walk the DOM to find a text node to place the caret at or a BR + node = container; + walker = new tinymce.dom.TreeWalker(container, body); + do { + // Found a text node use that position + if (node.nodeType === 3) { + offset = start ? 0 : node.nodeValue.length - 1; + container = node; + break; + } - if (s.remove_linebreaks) { - h = h.replace(/\r?\n|\r/g, ' '); - h = h.replace(/(<[^>]+>)\s+/g, '$1 '); - h = h.replace(/\s+(<\/[^>]+>)/g, ' $1'); - h = h.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object) ([^>]+)>\s+/g, '<$1 $2>'); // Trim block start - h = h.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>\s+/g, '<$1>'); // Trim block start - h = h.replace(/\s+<\/(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>/g, ''); // Trim block end - } + // Found a BR element that we can place the caret before + if (node.nodeName === 'BR') { + offset = dom.nodeIndex(node); + container = node.parentNode; + break; + } + } while (node = (start ? walker.next() : walker.prev())); - // Simple indentation - if (s.apply_source_formatting && s.indent_mode == 'simple') { - // Add line breaks before and after block elements - h = h.replace(/<(\/?)(ul|hr|table|meta|link|tbody|tr|object|body|head|html|map)(|[^>]+)>\s*/g, '\n<$1$2$3>\n'); - h = h.replace(/\s*<(p|h[1-6]|blockquote|div|title|style|pre|script|td|li|area)(|[^>]+)>/g, '\n<$1$2>'); - h = h.replace(/<\/(p|h[1-6]|blockquote|div|title|style|pre|script|td|li)>\s*/g, '\n'); - h = h.replace(/\n\n/g, '\n'); + normalized = true; + } } } - h = t._unprotect(h, p); + // Set endpoint if it was normalized + if (normalized) + rng['set' + (start ? 'Start' : 'End')](container, offset); + }; - // Restore CDATA sections - h = h.replace(//g, ''); + rng = self.getRng(); - // Restore the \u00a0 character if raw mode is enabled - if (s.entity_encoding == 'raw') - h = h.replace(/

     <\/p>|]+)> <\/p>/g, '\u00a0

    '); + // Normalize the end points + normalizeEndPoint(true); + + if (rng.collapsed) + normalizeEndPoint(); - // Restore noscript elements - h = h.replace(/]+|)>([\s\S]*?)<\/noscript>/g, function(v, attribs, text) { - return '' + t.dom.decode(text.replace(//g, '')) + ''; - }); + // Set the selection if it was normalized + if (normalized) { + //console.log(self.dom.dumpRng(rng)); + self.setRng(rng); } - - o.content = h; }, - _serializeNode : function(n, inner) { - var t = this, s = t.settings, w = t.writer, hc, el, cn, i, l, a, at, no, v, nn, ru, ar, iv, closed, keep, type; - - if (!s.node_filter || s.node_filter(n)) { - switch (n.nodeType) { - case 1: // Element - if (n.hasAttribute ? n.hasAttribute('_mce_bogus') : n.getAttribute('_mce_bogus')) - return; - - iv = keep = false; - hc = n.hasChildNodes(); - nn = n.getAttribute('_mce_name') || n.nodeName.toLowerCase(); - - // Get internal type - type = n.getAttribute('_mce_type'); - if (type) { - if (!t._info.cleanup) { - iv = true; - return; - } else - keep = 1; - } - - // Add correct prefix on IE - if (isIE) { - if (n.scopeName !== 'HTML' && n.scopeName !== 'html') - nn = n.scopeName + ':' + nn; - } - - // Remove mce prefix on IE needed for the abbr element - if (nn.indexOf('mce:') === 0) - nn = nn.substring(4); + destroy : function(s) { + var t = this; - // Check if valid - if (!keep) { - if (!t.validElementsRE || !t.validElementsRE.test(nn) || (t.invalidElementsRE && t.invalidElementsRE.test(nn)) || inner) { - iv = true; - break; - } - } + t.win = null; - if (isIE) { - // Fix IE content duplication (DOM can have multiple copies of the same node) - if (s.fix_content_duplication) { - if (n._mce_serialized == t.key) - return; + // Manual destroy then remove unload handler + if (!s) + tinymce.removeUnload(t.destroy); + }, - n._mce_serialized = t.key; - } + // IE has an issue where you can't select/move the caret by clicking outside the body if the document is in standards mode + _fixIESelection : function() { + var dom = this.dom, doc = dom.doc, body = doc.body, started, startRng, htmlElm; - // IE sometimes adds a / infront of the node name - if (nn.charAt(0) == '/') - nn = nn.substring(1); - } else if (isGecko) { - // Ignore br elements - if (n.nodeName === 'BR' && n.getAttribute('type') == '_moz') - return; - } + // Make HTML element unselectable since we are going to handle selection by hand + doc.documentElement.unselectable = true; - // Check if valid child - if (s.validate_children) { - if (t.elementName && !t.schema.isValid(t.elementName, nn)) { - iv = true; - break; - } + // Return range from point or null if it failed + function rngFromPoint(x, y) { + var rng = body.createTextRange(); - t.elementName = nn; - } + try { + rng.moveToPoint(x, y); + } catch (ex) { + // IE sometimes throws and exception, so lets just ignore it + rng = null; + } - ru = t.findRule(nn); - - // No valid rule for this element could be found then skip it - if (!ru) { - iv = true; - break; - } + return rng; + }; - nn = ru.name || nn; - closed = s.closed.test(nn); + // Fires while the selection is changing + function selectionChange(e) { + var pointRng; - // Skip empty nodes or empty node name in IE - if ((!hc && ru.noEmpty) || (isIE && !nn)) { - iv = true; - break; - } + // Check if the button is down or not + if (e.button) { + // Create range from mouse position + pointRng = rngFromPoint(e.x, e.y); - // Check required - if (ru.requiredAttribs) { - a = ru.requiredAttribs; + if (pointRng) { + // Check if pointRange is before/after selection then change the endPoint + if (pointRng.compareEndPoints('StartToStart', startRng) > 0) + pointRng.setEndPoint('StartToStart', startRng); + else + pointRng.setEndPoint('EndToEnd', startRng); - for (i = a.length - 1; i >= 0; i--) { - if (this.dom.getAttrib(n, a[i]) !== '') - break; - } + pointRng.select(); + } + } else + endSelection(); + } - // None of the required was there - if (i == -1) { - iv = true; - break; - } - } + // Removes listeners + function endSelection() { + var rng = doc.selection.createRange(); - w.writeStartElement(nn); + // If the range is collapsed then use the last start range + if (startRng && !rng.item && rng.compareEndPoints('StartToEnd', rng) === 0) + startRng.select(); - // Add ordered attributes - if (ru.attribs) { - for (i=0, at = ru.attribs, l = at.length; i-1; i--) { - no = at[i]; + // Detect vertical scrollbar, since IE will fire a mousedown on the scrollbar and have target set as HTML + htmlElm = doc.documentElement; + if (htmlElm.scrollHeight > htmlElm.clientHeight) + return; - if (no.specified) { - a = no.nodeName.toLowerCase(); + started = 1; + // Setup start position + startRng = rngFromPoint(e.x, e.y); + if (startRng) { + // Listen for selection change events + dom.bind(doc, 'mouseup', endSelection); + dom.bind(doc, 'mousemove', selectionChange); - if (s.invalid_attrs.test(a) || !ru.validAttribsRE.test(a)) - continue; + dom.win.focus(); + startRng.select(); + } + } + }); + } + }); +})(tinymce); - ar = t.findAttribRule(ru, a); - v = t._getAttrib(n, ar, a); +(function(tinymce) { + tinymce.dom.Serializer = function(settings, dom, schema) { + var onPreProcess, onPostProcess, isIE = tinymce.isIE, each = tinymce.each, htmlParser; - if (v !== null) - w.writeAttribute(a, v); - } - } - } + // Support the old apply_source_formatting option + if (!settings.apply_source_formatting) + settings.indent = false; - // Keep type attribute - if (type && keep) - w.writeAttribute('_mce_type', type); + settings.remove_trailing_brs = true; - // Write text from script - if (nn === 'script' && tinymce.trim(n.innerHTML)) { - w.writeText('// '); // Padd it with a comment so it will parse on older browsers - w.writeCDATA(n.innerHTML.replace(/|<\[CDATA\[|\]\]>/g, '')); // Remove comments and cdata stuctures - hc = false; - break; - } + // Default DOM and Schema if they are undefined + dom = dom || tinymce.DOM; + schema = schema || new tinymce.html.Schema(settings); + settings.entity_encoding = settings.entity_encoding || 'named'; - // Padd empty nodes with a   - if (ru.padd) { - // If it has only one bogus child, padd it anyway workaround for

    '; - h += ''; - h += ''; - h += '
    ' + DOM.createHTML('a', {id : t.id + '_text', href : 'javascript:;', 'class' : 'mceText', onclick : "return false;", onmousedown : 'return false;'}, DOM.encode(t.settings.title)) + '' + DOM.createHTML('a', {id : t.id + '_open', tabindex : -1, href : 'javascript:;', 'class' : 'mceOpen', onclick : "return false;", onmousedown : 'return false;'}, '') + '
    '; + h = ''; + h += ''; + h += ''; + h += ''; return h; }, showMenu : function() { - var t = this, p1, p2, e = DOM.get(this.id), m; + var t = this, p2, e = DOM.get(this.id), m; if (t.isDisabled() || t.items.length == 0) return; @@ -8128,7 +9923,6 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', { t.isMenuRendered = true; } - p1 = DOM.getPos(this.settings.menu_container); p2 = DOM.getPos(e); m = t.menu; @@ -8159,6 +9953,8 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', { var t = this; if (t.menu && t.menu.isMenuVisible) { + DOM.removeClass(t.id, t.classPrefix + 'Selected'); + // Prevent double toogles by canceling the mouse click event to the button if (e && e.type == "mousedown" && (e.target.id == t.id + '_text' || e.target.id == t.id + '_open')) return; @@ -8181,7 +9977,10 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', { max_height : 150 }); - m.onHideMenu.add(t.hideMenu, t); + m.onHideMenu.add(function() { + t.hideMenu(); + t.focus(); + }); m.add({ title : t.settings.title, @@ -8197,6 +9996,7 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', { if (o.value === undefined) { m.add({ title : o.title, + role : "option", 'class' : 'mceMenuItemTitle', onclick : function() { if (t.settings.onselect('') !== false) @@ -8205,6 +10005,7 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', { }); } else { o.id = DOM.uniqueId(); + o.role= "option"; o.onclick = function() { if (t.settings.onselect(o.value) !== false) t.select(o.value); // Must be runned after @@ -8222,40 +10023,39 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', { var t = this, cp = t.classPrefix; Event.add(t.id, 'click', t.showMenu, t); - Event.add(t.id + '_text', 'focus', function() { + Event.add(t.id, 'keydown', function(evt) { + if (evt.keyCode == 32) { // Space + t.showMenu(evt); + Event.cancel(evt); + } + }); + Event.add(t.id, 'focus', function() { if (!t._focused) { - t.keyDownHandler = Event.add(t.id + '_text', 'keydown', function(e) { - var idx = -1, v, kc = e.keyCode; - - // Find current index - each(t.items, function(v, i) { - if (t.selectedValue == v.value) - idx = i; - }); - - // Move up/down - if (kc == 38) - v = t.items[idx - 1]; - else if (kc == 40) - v = t.items[idx + 1]; - else if (kc == 13) { + t.keyDownHandler = Event.add(t.id, 'keydown', function(e) { + if (e.keyCode == 40) { + t.showMenu(); + Event.cancel(e); + } + }); + t.keyPressHandler = Event.add(t.id, 'keypress', function(e) { + var v; + if (e.keyCode == 13) { // Fake select on enter v = t.selectedValue; t.selectedValue = null; // Needs to be null to fake change + Event.cancel(e); t.settings.onselect(v); - return Event.cancel(e); - } - - if (v) { - t.hideMenu(); - t.select(v.value); } }); } t._focused = 1; }); - Event.add(t.id + '_text', 'blur', function() {Event.remove(t.id + '_text', 'keydown', t.keyDownHandler); t._focused = 0;}); + Event.add(t.id, 'blur', function() { + Event.remove(t.id, 'keydown', t.keyDownHandler); + Event.remove(t.id, 'keypress', t.keyPressHandler); + t._focused = 0; + }); // Old IE doesn't have hover on all elements if (tinymce.isIE6 || !DOM.boxModel) { @@ -8281,6 +10081,7 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', { } }); })(tinymce); + (function(tinymce) { var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, Dispatcher = tinymce.util.Dispatcher; @@ -8292,6 +10093,7 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', { setDisabled : function(s) { DOM.get(this.id).disabled = s; + this.setAriaProperty('disabled', s); }, isDisabled : function() { @@ -8366,13 +10168,13 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', { h += DOM.createHTML('option', {value : it.value}, it.title); }); - h = DOM.createHTML('select', {id : t.id, 'class' : 'mceNativeListBox'}, h); - + h = DOM.createHTML('select', {id : t.id, 'class' : 'mceNativeListBox', 'aria-labelledby': t.id + '_aria'}, h); + h += DOM.createHTML('span', {id : t.id + '_aria', 'style': 'display: none'}, t.settings.title); return h; }, postRender : function() { - var t = this, ch; + var t = this, ch, changeListenerAdded = true; t.rendered = true; @@ -8394,12 +10196,20 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', { var bf; Event.remove(t.id, 'change', ch); + changeListenerAdded = false; bf = Event.add(t.id, 'blur', function() { + if (changeListenerAdded) return; + changeListenerAdded = true; Event.add(t.id, 'change', onChange); Event.remove(t.id, 'blur', bf); }); + //prevent default left and right keys on chrome - so that the keyboard navigation is used. + if (tinymce.isWebKit && (e.keyCode==37 ||e.keyCode==39)) { + return Event.prevent(e); + } + if (e.keyCode == 13 || e.keyCode == 32) { onChange(e); return Event.cancel(e); @@ -8410,12 +10220,13 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', { } }); })(tinymce); + (function(tinymce) { var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each; tinymce.create('tinymce.ui.MenuButton:tinymce.ui.Button', { - MenuButton : function(id, s) { - this.parent(id, s); + MenuButton : function(id, s, ed) { + this.parent(id, s, ed); this.onRenderMenu = new tinymce.util.Dispatcher(this); @@ -8462,7 +10273,10 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', { icons : t.settings.icons }); - m.onHideMenu.add(t.hideMenu, t); + m.onHideMenu.add(function() { + t.hideMenu(); + t.focus(); + }); t.onRenderMenu.dispatch(t, m); t.menu = m; @@ -8504,8 +10318,8 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', { var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each; tinymce.create('tinymce.ui.SplitButton:tinymce.ui.MenuButton', { - SplitButton : function(id, s) { - this.parent(id, s); + SplitButton : function(id, s, ed) { + this.parent(id, s, ed); this.classPrefix = 'mceSplitButton'; }, @@ -8515,33 +10329,50 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', { h = '
    ' + DOM.createHTML('a', {id : t.id + '_action', href : 'javascript:;', 'class' : 'mceAction ' + s['class'], onclick : "return false;", onmousedown : 'return false;', title : s.title}, h1) + '' + DOM.createHTML('a', {role: 'button', id : t.id + '_action', tabindex: '-1', href : 'javascript:;', 'class' : 'mceAction ' + s['class'], onclick : "return false;", onmousedown : 'return false;', title : s.title}, h1) + '' + DOM.createHTML('a', {id : t.id + '_open', href : 'javascript:;', 'class' : 'mceOpen ' + s['class'], onclick : "return false;", onmousedown : 'return false;', title : s.title}, h1) + '' + DOM.createHTML('a', {role: 'button', id : t.id + '_open', tabindex: '-1', href : 'javascript:;', 'class' : 'mceOpen ' + s['class'], onclick : "return false;", onmousedown : 'return false;', title : s.title}, h1) + '
    '.$element->getLabelHtml().''; - $html.= $element->getElementHtml(); + $element->setRequired(true); + $html .= '' . $element->getLabelHtml() . ''; + $html .= $element->getElementHtml(); $selectName = str_replace('region', 'region_id', $element->getName()); - $selectId = $element->getHtmlId().'_id'; - $html.= ''; + $selectId = $element->getHtmlId() . '_id'; + $html .= ''; - $html.= ''."\n"; + $html .= '' . "\n"; + + $html .= '
    catalogrule_group_website
    + + catalogrule_website
    +
    + + catalogrule_customer_group
    +
    diff --git a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/install-1.6.0.0.php b/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/install-1.6.0.0.php index acbac07b2c..8b89ec0c30 100644 --- a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-install-0.7.0.php index b9fe6bb806..4d5d8e44d6 100644 --- a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-install-0.7.0.php +++ b/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-install-0.7.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.0-0.7.1.php b/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.0-0.7.1.php index 041d52c68d..fbf7a4050b 100644 --- a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.0-0.7.1.php +++ b/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.0-0.7.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.1-0.7.2.php b/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.1-0.7.2.php index fdcc5d73d8..e975064f34 100644 --- a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.1-0.7.2.php +++ b/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.1-0.7.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.2-0.7.3.php b/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.2-0.7.3.php index b2282e459d..bb70a64a51 100644 --- a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.2-0.7.3.php +++ b/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.2-0.7.3.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.3-0.7.4.php b/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.3-0.7.4.php index 75fed8fa64..3ab7a325ec 100644 --- a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.3-0.7.4.php +++ b/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.3-0.7.4.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.4-0.7.5.php b/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.4-0.7.5.php index 19d5a4682f..7ce16d3c16 100644 --- a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.4-0.7.5.php +++ b/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.4-0.7.5.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.5-0.7.6.php b/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.5-0.7.6.php index 40653573f7..7be0bad5c1 100644 --- a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.5-0.7.6.php +++ b/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.5-0.7.6.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.6-0.7.7.php b/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.6-0.7.7.php index 23aeb6403a..ae1734a415 100644 --- a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.6-0.7.7.php +++ b/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.6-0.7.7.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.7-0.7.8.php b/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.7-0.7.8.php index 3672439f91..05b2d788c1 100644 --- a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.7-0.7.8.php +++ b/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.7-0.7.8.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.8-0.7.9.php b/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.8-0.7.9.php index 0d2c5b01c0..7c64254399 100644 --- a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.8-0.7.9.php +++ b/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.8-0.7.9.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.9-0.7.10.php b/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.9-0.7.10.php index f88844c54e..9f19f8fd0f 100644 --- a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.9-0.7.10.php +++ b/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.9-0.7.10.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php index 3bacdbd129..ea9cff8943 100644 --- a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ b/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/upgrade-1.6.0.0-1.6.0.1.php b/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/upgrade-1.6.0.0-1.6.0.1.php index 2b97372452..131739aff9 100644 --- a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/upgrade-1.6.0.0-1.6.0.1.php +++ b/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/upgrade-1.6.0.0-1.6.0.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/upgrade-1.6.0.1-1.6.0.2.php b/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/upgrade-1.6.0.1-1.6.0.2.php new file mode 100644 index 0000000000..9da4eb051b --- /dev/null +++ b/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/upgrade-1.6.0.1-1.6.0.2.php @@ -0,0 +1,163 @@ +getConnection(); + +$rulesTable = $installer->getTable('catalogrule/rule'); +$websitesTable = $installer->getTable('core/website'); +$customerGroupsTable = $installer->getTable('customer/customer_group'); +$rulesWebsitesTable = $installer->getTable('catalogrule/website'); +$rulesCustomerGroupsTable = $installer->getTable('catalogrule/customer_group'); + +$installer->startSetup(); +/** + * Create table 'catalogrule/website' if not exists. This table will be used instead of + * column website_ids of main catalog rules table + */ +if (!$connection->isTableExists($rulesWebsitesTable)) { + $table = $connection->newTable($rulesWebsitesTable) + ->addColumn('rule_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array( + 'unsigned' => true, + 'nullable' => false, + 'primary' => true + ), + 'Rule Id' + ) + ->addColumn('website_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array( + 'unsigned' => true, + 'nullable' => false, + 'primary' => true + ), + 'Website Id' + ) + ->addIndex( + $installer->getIdxName('catalogrule/website', array('rule_id')), + array('rule_id') + ) + ->addIndex( + $installer->getIdxName('catalogrule/website', array('website_id')), + array('website_id') + ) + ->addForeignKey($installer->getFkName('catalogrule/website', 'rule_id', 'catalogrule/rule', 'rule_id'), + 'rule_id', $rulesTable, 'rule_id', + Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE + ) + ->addForeignKey($installer->getFkName('catalogrule/website', 'website_id', 'core/website', 'website_id'), + 'website_id', $websitesTable, 'website_id', + Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE + ) + ->setComment('Catalog Rules To Websites Relations'); + + $connection->createTable($table); +} + +/** + * Create table 'catalogrule/customer_group' if not exists. This table will be used instead of + * column customer_group_ids of main catalog rules table + */ +if (!$connection->isTableExists($rulesCustomerGroupsTable)) { + $table = $connection->newTable($rulesCustomerGroupsTable) + ->addColumn('rule_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array( + 'unsigned' => true, + 'nullable' => false, + 'primary' => true + ), + 'Rule Id' + ) + ->addColumn('customer_group_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array( + 'unsigned' => true, + 'nullable' => false, + 'primary' => true + ), + 'Customer Group Id' + ) + ->addIndex( + $installer->getIdxName('catalogrule/customer_group', array('rule_id')), + array('rule_id') + ) + ->addIndex( + $installer->getIdxName('catalogrule/customer_group', array('customer_group_id')), + array('customer_group_id') + ) + ->addForeignKey($installer->getFkName('catalogrule/customer_group', 'rule_id', 'catalogrule/rule', 'rule_id'), + 'rule_id', $rulesTable, 'rule_id', + Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE + ) + ->addForeignKey( + $installer->getFkName('catalogrule/customer_group', 'customer_group_id', + 'customer/customer_group', 'customer_group_id' + ), + 'customer_group_id', $customerGroupsTable, 'customer_group_id', + Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE + ) + ->setComment('Catalog Rules To Customer Groups Relations'); + + $connection->createTable($table); +} + +/** + * Fill out relation table 'catalogrule/website' with website Ids + */ +if ($connection->tableColumnExists($rulesTable, 'website_ids')) { + $select = $connection->select() + ->from(array('sr' => $rulesTable), array('sr.rule_id', 'cw.website_id')) + ->join( + array('cw' => $websitesTable), + $connection->prepareSqlCondition( + 'sr.website_ids', array('finset' => new Zend_Db_Expr('cw.website_id')) + ), + array() + ); + $query = $select->insertFromSelect($rulesWebsitesTable, array('rule_id', 'website_id')); + $connection->query($query); +} + +/** + * Fill out relation table 'catalogrule/customer_group' with customer group Ids + */ +if ($connection->tableColumnExists($rulesTable, 'customer_group_ids')) { + $select = $connection->select() + ->from(array('sr' => $rulesTable), array('sr.rule_id', 'cg.customer_group_id')) + ->join( + array('cg' => $customerGroupsTable), + $connection->prepareSqlCondition( + 'sr.customer_group_ids', array('finset' => new Zend_Db_Expr('cg.customer_group_id')) + ), + array() + ); + $query = $select->insertFromSelect($rulesCustomerGroupsTable, array('rule_id', 'customer_group_id')); + $connection->query($query); +} + +/** + * Eliminate obsolete columns + */ +$connection->dropColumn($rulesTable, 'website_ids'); +$connection->dropColumn($rulesTable, 'customer_group_ids'); + +$installer->endSetup(); diff --git a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/upgrade-1.6.0.2-1.6.0.3.php b/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/upgrade-1.6.0.2-1.6.0.3.php new file mode 100644 index 0000000000..98cbdbcb51 --- /dev/null +++ b/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/upgrade-1.6.0.2-1.6.0.3.php @@ -0,0 +1,51 @@ +startSetup(); + +$ruleProductTable = $installer->getTable('catalogrule/rule_product'); + +$columnOptions = array( + 'TYPE' => Varien_Db_Ddl_Table::TYPE_TEXT, + 'LENGTH' => 32, + 'COMMENT' => 'Simple Action For Subitems', +); +$installer->getConnection()->addColumn($ruleProductTable, 'sub_simple_action', $columnOptions); + +$columnOptions = array( + 'TYPE' => Varien_Db_Ddl_Table::TYPE_DECIMAL, + 'SCALE' => 4, + 'PRECISION' => 12, + 'NULLABLE' => false, + 'DEFAULT' => '0.0000', + 'COMMENT' => 'Discount Amount For Subitems', +); +$installer->getConnection()->addColumn($ruleProductTable, 'sub_discount_amount', $columnOptions); + +$installer->endSetup(); diff --git a/app/code/core/Mage/CatalogSearch/Block/Advanced/Form.php b/app/code/core/Mage/CatalogSearch/Block/Advanced/Form.php index bf3c27537c..61858c08cc 100644 --- a/app/code/core/Mage/CatalogSearch/Block/Advanced/Form.php +++ b/app/code/core/Mage/CatalogSearch/Block/Advanced/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -81,6 +81,13 @@ public function getAttributeValidationClass($attribute) return $attribute->getFrontendClass(); } + /** + * Retrieve search string for given field from request + * + * @param string $attribute + * @param string $part + * @return mixed|string + */ public function getAttributeValue($attribute, $part=null) { $value = $this->getRequest()->getQuery($attribute->getAttributeCode()); @@ -93,12 +100,14 @@ public function getAttributeValue($attribute, $part=null) } } - if (!is_array($value)) { - $value = htmlspecialchars($value); - } return $value; } + /** + * Retrieve the list of available currencies + * + * @return array + */ public function getAvailableCurrencies() { $currencies = $this->getData('_currencies'); @@ -123,11 +132,22 @@ public function getAvailableCurrencies() return $currencies; } + /** + * Count available currencies + * + * @return int + */ public function getCurrencyCount() { return count($this->getAvailableCurrencies()); } + /** + * Retrieve currency code for attribute + * + * @param $attribute + * @return string + */ public function getCurrency($attribute) { return Mage::app()->getStore()->getCurrentCurrencyCode(); @@ -170,6 +190,12 @@ public function getAttributeInputType($attribute) return 'string'; } + /** + * Build attribute select element html string + * + * @param $attribute + * @return string + */ public function getAttributeSelectElement($attribute) { $extra = ''; @@ -186,8 +212,6 @@ public function getAttributeSelectElement($attribute) array_unshift($options, array('value'=>'', 'label'=>Mage::helper('catalogsearch')->__('All'))); } - - return $this->_getSelectBlock() ->setName($name) ->setId($attribute->getAttributeCode()) @@ -237,6 +261,7 @@ protected function _getDateBlock() } return $block; } + /** * Retrieve advanced search model object * @@ -247,11 +272,23 @@ public function getModel() return Mage::getSingleton('catalogsearch/advanced'); } + /** + * Retrieve search form action string + * + * @return string + */ public function getSearchPostUrl() { return $this->getUrl('*/*/result'); } + /** + * Build date element html string for attribute + * + * @param $attribute + * @param string $part + * @return string + */ public function getDateInput($attribute, $part = 'from') { $name = $attribute->getAttributeCode() . '[' . $part . ']'; diff --git a/app/code/core/Mage/CatalogSearch/Block/Advanced/Result.php b/app/code/core/Mage/CatalogSearch/Block/Advanced/Result.php index 46a2ebc3b6..5e71e1078e 100644 --- a/app/code/core/Mage/CatalogSearch/Block/Advanced/Result.php +++ b/app/code/core/Mage/CatalogSearch/Block/Advanced/Result.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/Block/Autocomplete.php b/app/code/core/Mage/CatalogSearch/Block/Autocomplete.php index 81eeb7efcd..4e5c4ef0af 100644 --- a/app/code/core/Mage/CatalogSearch/Block/Autocomplete.php +++ b/app/code/core/Mage/CatalogSearch/Block/Autocomplete.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/Block/Layer.php b/app/code/core/Mage/CatalogSearch/Block/Layer.php index e646a1a1ac..f7a6d941f9 100644 --- a/app/code/core/Mage/CatalogSearch/Block/Layer.php +++ b/app/code/core/Mage/CatalogSearch/Block/Layer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/Block/Layer/Filter/Attribute.php b/app/code/core/Mage/CatalogSearch/Block/Layer/Filter/Attribute.php index 9cc0dea12b..35287c3eca 100644 --- a/app/code/core/Mage/CatalogSearch/Block/Layer/Filter/Attribute.php +++ b/app/code/core/Mage/CatalogSearch/Block/Layer/Filter/Attribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/Block/Result.php b/app/code/core/Mage/CatalogSearch/Block/Result.php index 0f9ae577a4..3acc3c8306 100644 --- a/app/code/core/Mage/CatalogSearch/Block/Result.php +++ b/app/code/core/Mage/CatalogSearch/Block/Result.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/Block/Term.php b/app/code/core/Mage/CatalogSearch/Block/Term.php index 0b5ff7b65e..1387e4ff3a 100644 --- a/app/code/core/Mage/CatalogSearch/Block/Term.php +++ b/app/code/core/Mage/CatalogSearch/Block/Term.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/Helper/Data.php b/app/code/core/Mage/CatalogSearch/Helper/Data.php index 3e0e962e0a..bb3d215b34 100644 --- a/app/code/core/Mage/CatalogSearch/Helper/Data.php +++ b/app/code/core/Mage/CatalogSearch/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/Model/Advanced.php b/app/code/core/Mage/CatalogSearch/Model/Advanced.php index 71306af5b2..f27fa6246e 100644 --- a/app/code/core/Mage/CatalogSearch/Model/Advanced.php +++ b/app/code/core/Mage/CatalogSearch/Model/Advanced.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/Model/Fulltext.php b/app/code/core/Mage/CatalogSearch/Model/Fulltext.php index 34f79921c4..fdf95b3999 100644 --- a/app/code/core/Mage/CatalogSearch/Model/Fulltext.php +++ b/app/code/core/Mage/CatalogSearch/Model/Fulltext.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -69,8 +69,9 @@ protected function _construct() * (1, 2) => Regenerate index for product Id=2 and its store view Id=1 * (null, 2) => Regenerate index for all store views of product Id=2 * - * @param int $storeId Store View Id - * @param int | array $productId Product Entity Id + * @param int|null $storeId Store View Id + * @param int|array|null $productIds Product Entity Id + * * @return Mage_CatalogSearch_Model_Fulltext */ public function rebuildIndex($storeId = null, $productIds = null) @@ -147,29 +148,39 @@ public function getSearchType($storeId = null) return Mage::getStoreConfig(self::XML_PATH_CATALOG_SEARCH_TYPE, $storeId); } + + + + + // Deprecated methods + /** - * Update category'es products indexes + * Set whether table changes are allowed * - * @param array $productIds - * @param array $categoryIds + * @deprecated after 1.6.1.0 + * + * @param bool $value * @return Mage_CatalogSearch_Model_Fulltext */ - public function updateCategoryIndex($productIds, $categoryIds) + public function setAllowTableChanges($value = true) { - $this->getResource()->updateCategoryIndex($productIds, $categoryIds); + $this->_allowTableChanges = $value; return $this; } /** - * Set whether table changes are allowed + * Update category products indexes + * + * @deprecated after 1.6.2.0 + * + * @param array $productIds + * @param array $categoryIds * - * @deprecated after 1.6.1.0 - * @param bool $value * @return Mage_CatalogSearch_Model_Fulltext */ - public function setAllowTableChanges($value = true) + public function updateCategoryIndex($productIds, $categoryIds) { - $this->_allowTableChanges = $value; + $this->getResource()->updateCategoryIndex($productIds, $categoryIds); return $this; } } diff --git a/app/code/core/Mage/CatalogSearch/Model/Fulltext/Observer.php b/app/code/core/Mage/CatalogSearch/Model/Fulltext/Observer.php index fb715227db..5d7a39991f 100644 --- a/app/code/core/Mage/CatalogSearch/Model/Fulltext/Observer.php +++ b/app/code/core/Mage/CatalogSearch/Model/Fulltext/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/Model/Indexer/Fulltext.php b/app/code/core/Mage/CatalogSearch/Model/Indexer/Fulltext.php index fc19b63bc1..153415d875 100644 --- a/app/code/core/Mage/CatalogSearch/Model/Indexer/Fulltext.php +++ b/app/code/core/Mage/CatalogSearch/Model/Indexer/Fulltext.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/Model/Layer.php b/app/code/core/Mage/CatalogSearch/Model/Layer.php index 465d987125..0f3df3c80b 100644 --- a/app/code/core/Mage/CatalogSearch/Model/Layer.php +++ b/app/code/core/Mage/CatalogSearch/Model/Layer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/Model/Layer/Filter/Attribute.php b/app/code/core/Mage/CatalogSearch/Model/Layer/Filter/Attribute.php index f7ef2f3de1..6d9b2affd1 100644 --- a/app/code/core/Mage/CatalogSearch/Model/Layer/Filter/Attribute.php +++ b/app/code/core/Mage/CatalogSearch/Model/Layer/Filter/Attribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/Model/Mysql4/Advanced.php b/app/code/core/Mage/CatalogSearch/Model/Mysql4/Advanced.php index e526804a89..09fe8e4988 100644 --- a/app/code/core/Mage/CatalogSearch/Model/Mysql4/Advanced.php +++ b/app/code/core/Mage/CatalogSearch/Model/Mysql4/Advanced.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/Model/Mysql4/Advanced/Collection.php b/app/code/core/Mage/CatalogSearch/Model/Mysql4/Advanced/Collection.php index 203a826405..1b442dd75b 100644 --- a/app/code/core/Mage/CatalogSearch/Model/Mysql4/Advanced/Collection.php +++ b/app/code/core/Mage/CatalogSearch/Model/Mysql4/Advanced/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/Model/Mysql4/Fulltext.php b/app/code/core/Mage/CatalogSearch/Model/Mysql4/Fulltext.php index 7c1e2970b9..d7de9e255f 100644 --- a/app/code/core/Mage/CatalogSearch/Model/Mysql4/Fulltext.php +++ b/app/code/core/Mage/CatalogSearch/Model/Mysql4/Fulltext.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/Model/Mysql4/Fulltext/Collection.php b/app/code/core/Mage/CatalogSearch/Model/Mysql4/Fulltext/Collection.php index a47aa7a1fd..01b6d73fcb 100644 --- a/app/code/core/Mage/CatalogSearch/Model/Mysql4/Fulltext/Collection.php +++ b/app/code/core/Mage/CatalogSearch/Model/Mysql4/Fulltext/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/Model/Mysql4/Fulltext/Engine.php b/app/code/core/Mage/CatalogSearch/Model/Mysql4/Fulltext/Engine.php index 189ecaa741..3ac267e270 100644 --- a/app/code/core/Mage/CatalogSearch/Model/Mysql4/Fulltext/Engine.php +++ b/app/code/core/Mage/CatalogSearch/Model/Mysql4/Fulltext/Engine.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/Model/Mysql4/Indexer/Fulltext.php b/app/code/core/Mage/CatalogSearch/Model/Mysql4/Indexer/Fulltext.php index 01ec5e5b57..f627b4ace5 100644 --- a/app/code/core/Mage/CatalogSearch/Model/Mysql4/Indexer/Fulltext.php +++ b/app/code/core/Mage/CatalogSearch/Model/Mysql4/Indexer/Fulltext.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/Model/Mysql4/Query.php b/app/code/core/Mage/CatalogSearch/Model/Mysql4/Query.php index 2519f125a7..ce367a3f51 100644 --- a/app/code/core/Mage/CatalogSearch/Model/Mysql4/Query.php +++ b/app/code/core/Mage/CatalogSearch/Model/Mysql4/Query.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/Model/Mysql4/Query/Collection.php b/app/code/core/Mage/CatalogSearch/Model/Mysql4/Query/Collection.php index 3429155d0e..b5683f5c79 100644 --- a/app/code/core/Mage/CatalogSearch/Model/Mysql4/Query/Collection.php +++ b/app/code/core/Mage/CatalogSearch/Model/Mysql4/Query/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/Model/Mysql4/Search/Collection.php b/app/code/core/Mage/CatalogSearch/Model/Mysql4/Search/Collection.php index e05f0870a7..f6c8dbfa26 100644 --- a/app/code/core/Mage/CatalogSearch/Model/Mysql4/Search/Collection.php +++ b/app/code/core/Mage/CatalogSearch/Model/Mysql4/Search/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/Model/Query.php b/app/code/core/Mage/CatalogSearch/Model/Query.php index 2832eb13b3..d90c22b90c 100644 --- a/app/code/core/Mage/CatalogSearch/Model/Query.php +++ b/app/code/core/Mage/CatalogSearch/Model/Query.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/Model/Resource/Advanced.php b/app/code/core/Mage/CatalogSearch/Model/Resource/Advanced.php index 5e5f79a58c..b83427db67 100755 --- a/app/code/core/Mage/CatalogSearch/Model/Resource/Advanced.php +++ b/app/code/core/Mage/CatalogSearch/Model/Resource/Advanced.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/Model/Resource/Advanced/Collection.php b/app/code/core/Mage/CatalogSearch/Model/Resource/Advanced/Collection.php index cc2d377c3c..ae98d68f39 100755 --- a/app/code/core/Mage/CatalogSearch/Model/Resource/Advanced/Collection.php +++ b/app/code/core/Mage/CatalogSearch/Model/Resource/Advanced/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -99,6 +99,9 @@ public function addFieldsToFilter($fields) if (!is_numeric($conditionValue['from'])){ $conditionValue['from'] = Mage::getSingleton('core/date') ->gmtDate(null, $conditionValue['from']); + if (!$conditionValue['from']) { + $conditionValue['from'] = Mage::getSingleton('core/date')->gmtDate(); + } } $conditionData[] = array('gteq' => $conditionValue['from']); } @@ -109,6 +112,9 @@ public function addFieldsToFilter($fields) if (!is_numeric($conditionValue['to'])){ $conditionValue['to'] = Mage::getSingleton('core/date') ->gmtDate(null, $conditionValue['to']); + if (!$conditionValue['to']) { + $conditionValue['to'] = Mage::getSingleton('core/date')->gmtDate(); + } } $conditionData[] = array('lteq' => $conditionValue['to']); } diff --git a/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php b/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php index 80ce6cf8a4..f200e92287 100755 --- a/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php +++ b/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -75,7 +75,11 @@ class Mage_CatalogSearch_Model_Resource_Fulltext extends Mage_Core_Model_Resourc * @deprecated after 1.6.1.0 * @var bool */ - protected $_allowTableChanges = true; + protected $_allowTableChanges = true; + + + + /** * Init resource model @@ -97,22 +101,6 @@ public function getSeparator() return $this->_separator; } - /** - * Update category'es products indexes - * - * @param array $productIds - * @param array $categoryIds - * @return Mage_CatalogSearch_Model_Resource_Fulltext - */ - public function updateCategoryIndex($productIds, $categoryIds) - { - if ($this->_engine && $this->_engine->allowAdvancedIndex()) { - $this->_engine->updateCategoryIndex($productIds, $categoryIds); - } - - return $this; - } - /** * Regenerate search index for store(s) * @@ -146,11 +134,11 @@ protected function _rebuildStoreIndex($storeId, $productIds = null) $this->cleanIndex($storeId, $productIds); // prepare searchable attributes - $staticFields = array(); + $staticFields = array(); foreach ($this->_getSearchableAttributes('static') as $attribute) { $staticFields[] = $attribute->getAttributeCode(); } - $dynamicFields = array( + $dynamicFields = array( 'int' => array_keys($this->_getSearchableAttributes('int')), 'varchar' => array_keys($this->_getSearchableAttributes('varchar')), 'text' => array_keys($this->_getSearchableAttributes('text')), @@ -161,8 +149,8 @@ protected function _rebuildStoreIndex($storeId, $productIds = null) // status and visibility filter $visibility = $this->_getSearchableAttribute('visibility'); $status = $this->_getSearchableAttribute('status'); - $visibilityVals = Mage::getSingleton('catalog/product_visibility')->getVisibleInSearchIds(); $statusVals = Mage::getSingleton('catalog/product_status')->getVisibleStatusIds(); + $allowedVisibilityValues = $this->_engine->getAllowedVisibility(); $lastProductId = 0; while (true) { @@ -176,10 +164,10 @@ protected function _rebuildStoreIndex($storeId, $productIds = null) foreach ($products as $productData) { $lastProductId = $productData['entity_id']; $productAttributes[$productData['entity_id']] = $productData['entity_id']; - $productChilds = $this->_getProductChildIds($productData['entity_id'], $productData['type_id']); - $productRelations[$productData['entity_id']] = $productChilds; - if ($productChilds) { - foreach ($productChilds as $productChildId) { + $productChildren = $this->_getProductChildIds($productData['entity_id'], $productData['type_id']); + $productRelations[$productData['entity_id']] = $productChildren; + if ($productChildren) { + foreach ($productChildren as $productChildId) { $productAttributes[$productChildId] = $productChildId; } } @@ -188,30 +176,17 @@ protected function _rebuildStoreIndex($storeId, $productIds = null) $productIndexes = array(); $productAttributes = $this->_getProductAttributes($storeId, $productAttributes, $dynamicFields); foreach ($products as $productData) { - /* - * If using advanced index and there is no required fields - do not add to index. - * Skipping out of stock products if there are no prices for them in catalog_product_index_price table - */ - if ($this->_engine->allowAdvancedIndex() - && (!isset($productData[$this->_engine->getFieldsPrefix() . 'categories'])) - ) { - continue; - } if (!isset($productAttributes[$productData['entity_id']])) { continue; } $productAttr = $productAttributes[$productData['entity_id']]; if (!isset($productAttr[$visibility->getId()]) - || (!in_array($productAttr[$visibility->getId()], $visibilityVals) - && !$this->_engine->allowAdvancedIndex() - ) + || !in_array($productAttr[$visibility->getId()], $allowedVisibilityValues) ) { continue; } - if (!isset($productAttr[$status->getId()]) - || !in_array($productAttr[$status->getId()], $statusVals) - ) { + if (!isset($productAttr[$status->getId()]) || !in_array($productAttr[$status->getId()], $statusVals)) { continue; } @@ -219,8 +194,8 @@ protected function _rebuildStoreIndex($storeId, $productIds = null) $productData['entity_id'] => $productAttr ); - if ($productChilds = $productRelations[$productData['entity_id']]) { - foreach ($productChilds as $productChildId) { + if ($productChildren = $productRelations[$productData['entity_id']]) { + foreach ($productChildren as $productChildId) { if (isset($productAttributes[$productChildId])) { $productIndex[$productChildId] = $productAttributes[$productChildId]; } @@ -253,8 +228,10 @@ protected function _rebuildStoreIndex($storeId, $productIds = null) protected function _getSearchableProducts($storeId, array $staticFields, $productIds = null, $lastProductId = 0, $limit = 100) { - $store = Mage::app()->getStore($storeId); - $select = $this->_getWriteAdapter()->select() + $websiteId = Mage::app()->getStore($storeId)->getWebsiteId(); + $writeAdapter = $this->_getWriteAdapter(); + + $select = $writeAdapter->select() ->useStraightJoin(true) ->from( array('e' => $this->getTable('catalog/product')), @@ -262,17 +239,17 @@ protected function _getSearchableProducts($storeId, array $staticFields, $produc ) ->join( array('website' => $this->getTable('catalog/product_website')), - $this->_getWriteAdapter()->quoteInto( + $writeAdapter->quoteInto( 'website.product_id=e.entity_id AND website.website_id=?', - $store->getWebsiteId() + $websiteId ), array() ) ->join( array('stock_status' => $this->getTable('cataloginventory/stock_status')), - $this->_getWriteAdapter()->quoteInto( + $writeAdapter->quoteInto( 'stock_status.product_id=e.entity_id AND stock_status.website_id=?', - $store->getWebsiteId() + $websiteId ), array('in_stock' => 'stock_status') ); @@ -285,12 +262,9 @@ protected function _getSearchableProducts($storeId, array $staticFields, $produc ->limit($limit) ->order('e.entity_id'); - $result = $this->_getWriteAdapter()->fetchAll($select); - if ($this->_engine && $this->_engine->allowAdvancedIndex() && count($result) > 0) { - return $this->_engine->addAdvancedIndex($result, $storeId, $productIds); - } else { - return $result; - } + $result = $writeAdapter->fetchAll($select); + + return $result; } /** @@ -321,6 +295,7 @@ public function cleanIndex($storeId = null, $productId = null) if ($this->_engine) { $this->_engine->cleanIndex($storeId, $productId); } + return $this; } @@ -369,18 +344,20 @@ public function prepareResult($object, $queryText, $query) ->where($mainTableAlias.'.store_id = ?', (int)$query->getStoreId()); if ($searchType == Mage_CatalogSearch_Model_Fulltext::SEARCH_TYPE_FULLTEXT - || $searchType == Mage_CatalogSearch_Model_Fulltext::SEARCH_TYPE_COMBINE) { + || $searchType == Mage_CatalogSearch_Model_Fulltext::SEARCH_TYPE_COMBINE + ) { $bind[':query'] = implode(' ', $preparedTerms[0]); $where = Mage::getResourceHelper('catalogsearch') ->chooseFulltext($this->getMainTable(), $mainTableAlias, $select); } + if ($likeCond != '' && $searchType == Mage_CatalogSearch_Model_Fulltext::SEARCH_TYPE_COMBINE) { $where .= ($where ? ' OR ' : '') . $likeCond; - } - if ($likeCond != '' && $searchType == Mage_CatalogSearch_Model_Fulltext::SEARCH_TYPE_LIKE) { + } elseif ($likeCond != '' && $searchType == Mage_CatalogSearch_Model_Fulltext::SEARCH_TYPE_LIKE) { $select->columns(array('relevance' => new Zend_Db_Expr(0))); $where = $likeCond; } + if ($where != '') { $select->where($where); } @@ -408,7 +385,7 @@ public function getEavConfig() } /** - * Retrieve Searchable attributes + * Retrieve searchable attributes * * @param string $backendType * @return array @@ -418,11 +395,8 @@ protected function _getSearchableAttributes($backendType = null) if (is_null($this->_searchableAttributes)) { $this->_searchableAttributes = array(); - $entityType = $this->getEavConfig()->getEntityType(Mage_Catalog_Model_Product::ENTITY); - $entity = $entityType->getEntity(); + $productAttributeCollection = Mage::getResourceModel('catalog/product_attribute_collection'); - $productAttributeCollection = Mage::getResourceModel('catalog/product_attribute_collection') - ->setEntityTypeFilter($entityType->getEntityTypeId()); if ($this->_engine && $this->_engine->allowAdvancedIndex()) { $productAttributeCollection->addToIndexFilter(true); } else { @@ -430,16 +404,27 @@ protected function _getSearchableAttributes($backendType = null) } $attributes = $productAttributeCollection->getItems(); + Mage::dispatchEvent('catelogsearch_searchable_attributes_load_after', array( + 'engine' => $this->_engine, + 'attributes' => $attributes + )); + + $entity = $this->getEavConfig() + ->getEntityType(Mage_Catalog_Model_Product::ENTITY) + ->getEntity(); + foreach ($attributes as $attribute) { $attribute->setEntity($entity); - $this->_searchableAttributes[$attribute->getId()] = $attribute; } + + $this->_searchableAttributes = $attributes; } + if (!is_null($backendType)) { $attributes = array(); - foreach ($this->_searchableAttributes as $attribute) { + foreach ($this->_searchableAttributes as $attributeId => $attribute) { if ($attribute->getBackendType() == $backendType) { - $attributes[$attribute->getId()] = $attribute; + $attributes[$attributeId] = $attribute; } } @@ -462,14 +447,14 @@ protected function _getSearchableAttribute($attribute) if (isset($attributes[$attribute])) { return $attributes[$attribute]; } - } - elseif (is_string($attribute)) { + } elseif (is_string($attribute)) { foreach ($attributes as $attributeModel) { if ($attributeModel->getAttributeCode() == $attribute) { return $attributeModel; } } } + return $this->getEavConfig()->getAttribute(Mage_Catalog_Model_Product::ENTITY, $attribute); } @@ -496,16 +481,16 @@ protected function _unifyField($field, $backendType = 'varchar') * * @param int $storeId * @param array $productIds - * @param array $atributeTypes + * @param array $attributeTypes * @return array */ - protected function _getProductAttributes($storeId, array $productIds, array $atributeTypes) + protected function _getProductAttributes($storeId, array $productIds, array $attributeTypes) { $result = array(); $selects = array(); - $adapter = $this->_getReadAdapter(); + $adapter = $this->_getWriteAdapter(); $ifStoreValue = $adapter->getCheckSql('t_store.value_id > 0', 't_store.value', 't_default.value'); - foreach ($atributeTypes as $backendType => $attributeIds) { + foreach ($attributeTypes as $backendType => $attributeIds) { if ($attributeIds) { $tableName = $this->getTable(array('catalog/product', $backendType)); $selects[] = $adapter->select() @@ -593,6 +578,7 @@ protected function _getProductEmulator() { $productEmulator = new Varien_Object(); $productEmulator->setIdFieldName('entity_id'); + return $productEmulator; } @@ -633,24 +619,26 @@ protected function _prepareProductIndex($indexData, $productData, $storeId) foreach ($attributeData as $attributeId => $attributeValue) { $value = $this->_getAttributeValue($attributeId, $attributeValue, $storeId); if (!is_null($value) && $value !== false) { - $code = $this->_getSearchableAttribute($attributeId)->getAttributeCode(); + $attributeCode = $this->_getSearchableAttribute($attributeId)->getAttributeCode(); - if (isset($index[$code])) { - $index[$code][$entityId] = $value; + if (isset($index[$attributeCode])) { + $index[$attributeCode][$entityId] = $value; } else { - $index[$code] = array($entityId => $value); + $index[$attributeCode] = array($entityId => $value); } } } } - $product = $this->_getProductEmulator() - ->setId($productData['entity_id']) - ->setTypeId($productData['type_id']) - ->setStoreId($storeId); - $typeInstance = $this->_getProductTypeInstance($productData['type_id']); - if ($data = $typeInstance->getSearchableData($product)) { - $index['options'] = $data; + if (!$this->_engine->allowAdvancedIndex()) { + $product = $this->_getProductEmulator() + ->setId($productData['entity_id']) + ->setTypeId($productData['type_id']) + ->setStoreId($storeId); + $typeInstance = $this->_getProductTypeInstance($productData['type_id']); + if ($data = $typeInstance->getSearchableData($product)) { + $index['options'] = $data; + } } if (isset($productData['in_stock'])) { @@ -658,10 +646,6 @@ protected function _prepareProductIndex($indexData, $productData, $storeId) } if ($this->_engine) { - if ($this->_engine->allowAdvancedIndex()) { - $index += $this->_engine->addAllowedAdvancedIndexField($productData); - } - return $this->_engine->prepareEntityIndex($index, $this->_separator); } @@ -679,35 +663,50 @@ protected function _prepareProductIndex($indexData, $productData, $storeId) protected function _getAttributeValue($attributeId, $value, $storeId) { $attribute = $this->_getSearchableAttribute($attributeId); - if (!($attribute->getIsSearchable() - || $attribute->getIsVisibleInAdvancedSearch() - || $attribute->getIsFilterable() - || $attribute->getIsFilterableInSearch() - || $attribute->getUsedForSortBy()) - ) { - return null; + if (!$attribute->getIsSearchable()) { + if ($this->_engine->allowAdvancedIndex()) { + if ($attribute->getAttributeCode() == 'visibility') { + return $value; + } elseif (!($attribute->getIsVisibleInAdvancedSearch() + || $attribute->getIsFilterable() + || $attribute->getIsFilterableInSearch() + || $attribute->getUsedForSortBy()) + ) { + return null; + } + } else { + return null; + } } if ($attribute->usesSource()) { + if ($this->_engine->allowAdvancedIndex()) { + return $value; + } + $attribute->setStoreId($storeId); $value = $attribute->getSource()->getOptionText($value); - } - if ($attribute->getBackendType() == 'datetime') { - $value = $this->_getStoreDate($storeId, $value); - } - $inputType = $attribute->getFrontend()->getInputType(); - if ($inputType == 'price') { - $value = Mage::app()->getStore($storeId)->roundPrice($value); + if (is_array($value)) { + $value = implode($this->_separator, $value); + } elseif (empty($value)) { + $inputType = $attribute->getFrontend()->getInputType(); + if ($inputType == 'select' || $inputType == 'multiselect') { + return null; + } + } + } elseif ($attribute->getBackendType() == 'datetime') { + $value = $this->_getStoreDate($storeId, $value); + } else { + $inputType = $attribute->getFrontend()->getInputType(); + if ($inputType == 'price') { + $value = Mage::app()->getStore($storeId)->roundPrice($value); + } } - if (is_array($value)) { - $value = implode($this->_separator, $value); - } elseif (empty($value) && ($inputType == 'select' || $inputType == 'multiselect')) { - return null; - } + $value = preg_replace("#\s+#siu", ' ', trim(strip_tags($value))); - return preg_replace("#\s+#siu", ' ', trim(strip_tags($value))); + return $value; } /** @@ -723,6 +722,7 @@ protected function _saveProductIndex($productId, $storeId, $index) if ($this->_engine) { $this->_engine->saveEntityIndex($productId, $storeId, $index); } + return $this; } @@ -738,6 +738,7 @@ protected function _saveProductIndexes($storeId, $productIndexes) if ($this->_engine) { $this->_engine->saveEntityIndexes($storeId, $productIndexes); } + return $this; } @@ -770,6 +771,12 @@ protected function _getStoreDate($storeId, $date = null) return null; } + + + + + // Deprecated methods + /** * Set whether table changes are allowed * @@ -782,4 +789,18 @@ public function setAllowTableChanges($value = true) $this->_allowTableChanges = $value; return $this; } + + /** + * Update category products indexes + * + * deprecated after 1.6.2.0 + * + * @param array $productIds + * @param array $categoryIds + * @return Mage_CatalogSearch_Model_Resource_Fulltext + */ + public function updateCategoryIndex($productIds, $categoryIds) + { + return $this; + } } diff --git a/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext/Collection.php b/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext/Collection.php index 3709cc33f5..a490756de5 100755 --- a/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext/Collection.php +++ b/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext/Engine.php b/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext/Engine.php index 1f6dca4f8e..a7826fa7ac 100755 --- a/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext/Engine.php +++ b/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext/Engine.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -72,10 +72,9 @@ public function saveEntityIndex($entityId, $storeId, $index, $entity = 'product' */ public function saveEntityIndexes($storeId, $entityIndexes, $entity = 'product') { - $adapter = $this->_getWriteAdapter(); $data = array(); $storeId = (int)$storeId; - foreach ($entityIndexes as $entityId => &$index) { + foreach ($entityIndexes as $entityId => $index) { $data[] = array( 'product_id' => (int)$entityId, 'store_id' => $storeId, @@ -91,6 +90,16 @@ public function saveEntityIndexes($storeId, $entityIndexes, $entity = 'product') return $this; } + /** + * Retrieve allowed visibility values for current engine + * + * @return array + */ + public function getAllowedVisibility() + { + return Mage::getSingleton('catalog/product_visibility')->getVisibleInSearchIds(); + } + /** * Define if current search engine supports advanced index * diff --git a/app/code/core/Mage/CatalogSearch/Model/Resource/Helper/Mysql4.php b/app/code/core/Mage/CatalogSearch/Model/Resource/Helper/Mysql4.php index 429a276c77..4659e58315 100644 --- a/app/code/core/Mage/CatalogSearch/Model/Resource/Helper/Mysql4.php +++ b/app/code/core/Mage/CatalogSearch/Model/Resource/Helper/Mysql4.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/Model/Resource/Indexer/Fulltext.php b/app/code/core/Mage/CatalogSearch/Model/Resource/Indexer/Fulltext.php index 30c5769376..bc3f6c28a3 100644 --- a/app/code/core/Mage/CatalogSearch/Model/Resource/Indexer/Fulltext.php +++ b/app/code/core/Mage/CatalogSearch/Model/Resource/Indexer/Fulltext.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/Model/Resource/Query.php b/app/code/core/Mage/CatalogSearch/Model/Resource/Query.php index e8908b3cf9..1363af6eda 100755 --- a/app/code/core/Mage/CatalogSearch/Model/Resource/Query.php +++ b/app/code/core/Mage/CatalogSearch/Model/Resource/Query.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/Model/Resource/Query/Collection.php b/app/code/core/Mage/CatalogSearch/Model/Resource/Query/Collection.php index 9f35cfcfe2..4084f24329 100755 --- a/app/code/core/Mage/CatalogSearch/Model/Resource/Query/Collection.php +++ b/app/code/core/Mage/CatalogSearch/Model/Resource/Query/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/Model/Resource/Search/Collection.php b/app/code/core/Mage/CatalogSearch/Model/Resource/Search/Collection.php index 2d50c55b4e..8ada846a47 100755 --- a/app/code/core/Mage/CatalogSearch/Model/Resource/Search/Collection.php +++ b/app/code/core/Mage/CatalogSearch/Model/Resource/Search/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/Model/Session.php b/app/code/core/Mage/CatalogSearch/Model/Session.php index 618832dae2..c5dffd0d76 100644 --- a/app/code/core/Mage/CatalogSearch/Model/Session.php +++ b/app/code/core/Mage/CatalogSearch/Model/Session.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/Model/System/Config/Backend/Sitemap.php b/app/code/core/Mage/CatalogSearch/Model/System/Config/Backend/Sitemap.php index 6112ae20bc..81668bc5ba 100644 --- a/app/code/core/Mage/CatalogSearch/Model/System/Config/Backend/Sitemap.php +++ b/app/code/core/Mage/CatalogSearch/Model/System/Config/Backend/Sitemap.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/controllers/AdvancedController.php b/app/code/core/Mage/CatalogSearch/controllers/AdvancedController.php index d9dfcea366..4c590606da 100644 --- a/app/code/core/Mage/CatalogSearch/controllers/AdvancedController.php +++ b/app/code/core/Mage/CatalogSearch/controllers/AdvancedController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/controllers/AjaxController.php b/app/code/core/Mage/CatalogSearch/controllers/AjaxController.php index 9e905357e9..32654c9ea4 100644 --- a/app/code/core/Mage/CatalogSearch/controllers/AjaxController.php +++ b/app/code/core/Mage/CatalogSearch/controllers/AjaxController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/controllers/ResultController.php b/app/code/core/Mage/CatalogSearch/controllers/ResultController.php index e548a93928..fa0b0e776c 100644 --- a/app/code/core/Mage/CatalogSearch/controllers/ResultController.php +++ b/app/code/core/Mage/CatalogSearch/controllers/ResultController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -48,7 +48,7 @@ public function indexAction() $query->setStoreId(Mage::app()->getStore()->getId()); - if ($query->getQueryText()) { + if ($query->getQueryText() != '') { if (Mage::helper('catalogsearch')->isMinQueryLength()) { $query->setId(0) ->setIsActive(1) diff --git a/app/code/core/Mage/CatalogSearch/controllers/TermController.php b/app/code/core/Mage/CatalogSearch/controllers/TermController.php index 6fb464f2f4..514a6bb98a 100644 --- a/app/code/core/Mage/CatalogSearch/controllers/TermController.php +++ b/app/code/core/Mage/CatalogSearch/controllers/TermController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/etc/adminhtml.xml b/app/code/core/Mage/CatalogSearch/etc/adminhtml.xml index 1606b944e2..5a16a04e62 100644 --- a/app/code/core/Mage/CatalogSearch/etc/adminhtml.xml +++ b/app/code/core/Mage/CatalogSearch/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/CatalogSearch/etc/config.xml b/app/code/core/Mage/CatalogSearch/etc/config.xml index 7c5e60c85d..16566c4f08 100644 --- a/app/code/core/Mage/CatalogSearch/etc/config.xml +++ b/app/code/core/Mage/CatalogSearch/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/CatalogSearch/etc/system.xml b/app/code/core/Mage/CatalogSearch/etc/system.xml index 6c8d24fa6e..85622ec4ca 100644 --- a/app/code/core/Mage/CatalogSearch/etc/system.xml +++ b/app/code/core/Mage/CatalogSearch/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/install-1.6.0.0.php b/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/install-1.6.0.0.php index 6e848905f9..28b753bcab 100644 --- a/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-install-0.7.0.php index a598bb09f7..38fd8760e6 100644 --- a/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-install-0.7.0.php +++ b/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-install-0.7.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-upgrade-0.7.1-0.7.2.php b/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-upgrade-0.7.1-0.7.2.php index fe4ac75df6..41398a8fe4 100644 --- a/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-upgrade-0.7.1-0.7.2.php +++ b/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-upgrade-0.7.1-0.7.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-upgrade-0.7.2-0.7.3.php b/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-upgrade-0.7.2-0.7.3.php index c2320527ec..5dbed7c4d4 100644 --- a/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-upgrade-0.7.2-0.7.3.php +++ b/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-upgrade-0.7.2-0.7.3.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-upgrade-0.7.3-0.7.4.php b/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-upgrade-0.7.3-0.7.4.php index 64187c13eb..08d53dd893 100644 --- a/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-upgrade-0.7.3-0.7.4.php +++ b/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-upgrade-0.7.3-0.7.4.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-upgrade-0.7.4-0.7.5.php b/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-upgrade-0.7.4-0.7.5.php index 1079464284..6eb55e992a 100644 --- a/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-upgrade-0.7.4-0.7.5.php +++ b/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-upgrade-0.7.4-0.7.5.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-upgrade-0.7.5-0.7.6.php b/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-upgrade-0.7.5-0.7.6.php index 802f81adcc..f262699edc 100644 --- a/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-upgrade-0.7.5-0.7.6.php +++ b/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-upgrade-0.7.5-0.7.6.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-upgrade-0.7.6-0.7.7.php b/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-upgrade-0.7.6-0.7.7.php index 89bbf88fd6..0685bcf171 100644 --- a/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-upgrade-0.7.6-0.7.7.php +++ b/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-upgrade-0.7.6-0.7.7.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php index 91046278f7..5a0d3c2ca1 100644 --- a/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ b/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Centinel/Block/Adminhtml/Validation.php b/app/code/core/Mage/Centinel/Block/Adminhtml/Validation.php index 15b009031b..0a73a853e4 100644 --- a/app/code/core/Mage/Centinel/Block/Adminhtml/Validation.php +++ b/app/code/core/Mage/Centinel/Block/Adminhtml/Validation.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Centinel - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Centinel/Block/Adminhtml/Validation/Form.php b/app/code/core/Mage/Centinel/Block/Adminhtml/Validation/Form.php index a69802a324..fd8c93b714 100644 --- a/app/code/core/Mage/Centinel/Block/Adminhtml/Validation/Form.php +++ b/app/code/core/Mage/Centinel/Block/Adminhtml/Validation/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Centinel - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Centinel/Block/Authentication.php b/app/code/core/Mage/Centinel/Block/Authentication.php index 047065dbc4..bebc687e06 100644 --- a/app/code/core/Mage/Centinel/Block/Authentication.php +++ b/app/code/core/Mage/Centinel/Block/Authentication.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Centinel - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Centinel/Block/Authentication/Complete.php b/app/code/core/Mage/Centinel/Block/Authentication/Complete.php index 0304134ac4..df9fac2aec 100644 --- a/app/code/core/Mage/Centinel/Block/Authentication/Complete.php +++ b/app/code/core/Mage/Centinel/Block/Authentication/Complete.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Centinel - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Centinel/Block/Authentication/Start.php b/app/code/core/Mage/Centinel/Block/Authentication/Start.php index 6d44192db7..56114b7a0f 100644 --- a/app/code/core/Mage/Centinel/Block/Authentication/Start.php +++ b/app/code/core/Mage/Centinel/Block/Authentication/Start.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Centinel - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Centinel/Block/Logo.php b/app/code/core/Mage/Centinel/Block/Logo.php index 1e54ddf188..8ec2ae1198 100644 --- a/app/code/core/Mage/Centinel/Block/Logo.php +++ b/app/code/core/Mage/Centinel/Block/Logo.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Centinel - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Centinel/Helper/Data.php b/app/code/core/Mage/Centinel/Helper/Data.php index aa93eb1c5c..b96ee91dcc 100644 --- a/app/code/core/Mage/Centinel/Helper/Data.php +++ b/app/code/core/Mage/Centinel/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Centinel - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Centinel/Model/Api.php b/app/code/core/Mage/Centinel/Model/Api.php index 51267012e5..13b1b36107 100644 --- a/app/code/core/Mage/Centinel/Model/Api.php +++ b/app/code/core/Mage/Centinel/Model/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Centinel - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Centinel/Model/Config.php b/app/code/core/Mage/Centinel/Model/Config.php index 0bb529cd5d..636302ec5d 100644 --- a/app/code/core/Mage/Centinel/Model/Config.php +++ b/app/code/core/Mage/Centinel/Model/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Centinel - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Centinel/Model/Observer.php b/app/code/core/Mage/Centinel/Model/Observer.php index 670f066075..10a0255bf1 100644 --- a/app/code/core/Mage/Centinel/Model/Observer.php +++ b/app/code/core/Mage/Centinel/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Centinel - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Centinel/Model/Service.php b/app/code/core/Mage/Centinel/Model/Service.php index f42801ad25..ba08b409c2 100644 --- a/app/code/core/Mage/Centinel/Model/Service.php +++ b/app/code/core/Mage/Centinel/Model/Service.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Centinel - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Centinel/Model/Session.php b/app/code/core/Mage/Centinel/Model/Session.php index 59943acfd4..4096e05787 100644 --- a/app/code/core/Mage/Centinel/Model/Session.php +++ b/app/code/core/Mage/Centinel/Model/Session.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Centinel - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Centinel/Model/State/Jcb.php b/app/code/core/Mage/Centinel/Model/State/Jcb.php index 0a81840d91..45fb5f9677 100644 --- a/app/code/core/Mage/Centinel/Model/State/Jcb.php +++ b/app/code/core/Mage/Centinel/Model/State/Jcb.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Centinel - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Centinel/Model/State/Mastercard.php b/app/code/core/Mage/Centinel/Model/State/Mastercard.php index a2a6f5a75e..b6a586b9e6 100644 --- a/app/code/core/Mage/Centinel/Model/State/Mastercard.php +++ b/app/code/core/Mage/Centinel/Model/State/Mastercard.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Centinel - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Centinel/Model/State/Visa.php b/app/code/core/Mage/Centinel/Model/State/Visa.php index e4f2b51a0d..080235c340 100644 --- a/app/code/core/Mage/Centinel/Model/State/Visa.php +++ b/app/code/core/Mage/Centinel/Model/State/Visa.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Centinel - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Centinel/Model/StateAbstract.php b/app/code/core/Mage/Centinel/Model/StateAbstract.php index b235b128d3..7da0655174 100644 --- a/app/code/core/Mage/Centinel/Model/StateAbstract.php +++ b/app/code/core/Mage/Centinel/Model/StateAbstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Centinel - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Centinel/controllers/Adminhtml/Centinel/IndexController.php b/app/code/core/Mage/Centinel/controllers/Adminhtml/Centinel/IndexController.php index f75f2d2542..a67bddfa2e 100644 --- a/app/code/core/Mage/Centinel/controllers/Adminhtml/Centinel/IndexController.php +++ b/app/code/core/Mage/Centinel/controllers/Adminhtml/Centinel/IndexController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Centinel - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Centinel/controllers/IndexController.php b/app/code/core/Mage/Centinel/controllers/IndexController.php index 33bf2cb140..302cdd227f 100644 --- a/app/code/core/Mage/Centinel/controllers/IndexController.php +++ b/app/code/core/Mage/Centinel/controllers/IndexController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Centinel - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Centinel/etc/config.xml b/app/code/core/Mage/Centinel/etc/config.xml index 06f6ceb5ca..e0ca00dda9 100644 --- a/app/code/core/Mage/Centinel/etc/config.xml +++ b/app/code/core/Mage/Centinel/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Centinel - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Centinel/etc/system.xml b/app/code/core/Mage/Centinel/etc/system.xml index 23a4119e0f..61b217265f 100644 --- a/app/code/core/Mage/Centinel/etc/system.xml +++ b/app/code/core/Mage/Centinel/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Centinel - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Checkout/Block/Agreements.php b/app/code/core/Mage/Checkout/Block/Agreements.php index 92414da796..0b4f176a8c 100644 --- a/app/code/core/Mage/Checkout/Block/Agreements.php +++ b/app/code/core/Mage/Checkout/Block/Agreements.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Checkout_Block_Agreements extends Mage_Core_Block_Template diff --git a/app/code/core/Mage/Checkout/Block/Cart.php b/app/code/core/Mage/Checkout/Block/Cart.php index 3d9a4961c1..a774c6cb1c 100644 --- a/app/code/core/Mage/Checkout/Block/Cart.php +++ b/app/code/core/Mage/Checkout/Block/Cart.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Cart/Abstract.php b/app/code/core/Mage/Checkout/Block/Cart/Abstract.php index f781f9f2ca..447ab51062 100644 --- a/app/code/core/Mage/Checkout/Block/Cart/Abstract.php +++ b/app/code/core/Mage/Checkout/Block/Cart/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Cart/Coupon.php b/app/code/core/Mage/Checkout/Block/Cart/Coupon.php index 917c9c0c70..565421bf36 100644 --- a/app/code/core/Mage/Checkout/Block/Cart/Coupon.php +++ b/app/code/core/Mage/Checkout/Block/Cart/Coupon.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Cart/Crosssell.php b/app/code/core/Mage/Checkout/Block/Cart/Crosssell.php index 94bc9ca1ba..35211a17ca 100644 --- a/app/code/core/Mage/Checkout/Block/Cart/Crosssell.php +++ b/app/code/core/Mage/Checkout/Block/Cart/Crosssell.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Cart/Item/Configure.php b/app/code/core/Mage/Checkout/Block/Cart/Item/Configure.php index b796f1be86..8ed4eae280 100644 --- a/app/code/core/Mage/Checkout/Block/Cart/Item/Configure.php +++ b/app/code/core/Mage/Checkout/Block/Cart/Item/Configure.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Cart/Item/Renderer.php b/app/code/core/Mage/Checkout/Block/Cart/Item/Renderer.php index fe36e85382..64b2c7e91f 100644 --- a/app/code/core/Mage/Checkout/Block/Cart/Item/Renderer.php +++ b/app/code/core/Mage/Checkout/Block/Cart/Item/Renderer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -30,6 +30,9 @@ * @category Mage * @package Mage_Checkout * @author Magento Core Team + * + * @method Mage_Checkout_Block_Cart_Item_Renderer setProductName(string) + * @method Mage_Checkout_Block_Cart_Item_Renderer setDeleteUrl(string) */ class Mage_Checkout_Block_Cart_Item_Renderer extends Mage_Core_Block_Template { @@ -39,6 +42,20 @@ class Mage_Checkout_Block_Cart_Item_Renderer extends Mage_Core_Block_Template protected $_productUrl = null; protected $_productThumbnail = null; + /** + * Whether qty will be converted to number + * + * @var bool + */ + protected $_strictQtyMode = true; + + /** + * Check, whether product URL rendering should be ignored + * + * @var bool + */ + protected $_ignoreProductUrl = false; + /** * Set item for render * @@ -99,10 +116,14 @@ public function overrideProductUrl($productUrl) /** * Check Product has URL * - * @return this + * @return bool */ public function hasProductUrl() { + if ($this->_ignoreProductUrl) { + return false; + } + if ($this->_productUrl || $this->getItem()->getRedirectUrl()) { return true; } @@ -158,6 +179,9 @@ public function getProductUrl() */ public function getProductName() { + if ($this->hasProductName()) { + return $this->getData('product_name'); + } return $this->getProduct()->getName(); } @@ -203,6 +227,10 @@ public function getConfigureUrl() */ public function getDeleteUrl() { + if ($this->hasDeleteUrl()) { + return $this->getData('delete_url'); + } + return $this->getUrl( 'checkout/cart/delete', array( @@ -215,11 +243,14 @@ public function getDeleteUrl() /** * Get quote item qty * - * @return mixed + * @return float|int|string */ public function getQty() { - return $this->getItem()->getQty()*1; + if (!$this->_strictQtyMode && (string)$this->getItem()->getQty() == '') { + return ''; + } + return $this->getItem()->getQty() * 1; } /** @@ -360,4 +391,28 @@ public function getMsrpHtml($item) ->setProduct($item->getProduct()) ->toHtml(); } + + /** + * Set qty mode to be strict or not + * + * @param bool $strict + * @return Mage_Checkout_Block_Cart_Item_Renderer + */ + public function setQtyMode($strict) + { + $this->_strictQtyMode = $strict; + return $this; + } + + /** + * Set ignore product URL rendering + * + * @param bool $ignore + * @return Mage_Checkout_Block_Cart_Item_Renderer + */ + public function setIgnoreProductUrl($ignore = true) + { + $this->_ignoreProductUrl = $ignore; + return $this; + } } diff --git a/app/code/core/Mage/Checkout/Block/Cart/Item/Renderer/Configurable.php b/app/code/core/Mage/Checkout/Block/Cart/Item/Renderer/Configurable.php index e202600d63..609bffc8eb 100644 --- a/app/code/core/Mage/Checkout/Block/Cart/Item/Renderer/Configurable.php +++ b/app/code/core/Mage/Checkout/Block/Cart/Item/Renderer/Configurable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Cart/Item/Renderer/Grouped.php b/app/code/core/Mage/Checkout/Block/Cart/Item/Renderer/Grouped.php index 225ff0ae80..7d9d7787e9 100644 --- a/app/code/core/Mage/Checkout/Block/Cart/Item/Renderer/Grouped.php +++ b/app/code/core/Mage/Checkout/Block/Cart/Item/Renderer/Grouped.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Cart/Shipping.php b/app/code/core/Mage/Checkout/Block/Cart/Shipping.php index 67c5ddc1d0..ddf32624e0 100644 --- a/app/code/core/Mage/Checkout/Block/Cart/Shipping.php +++ b/app/code/core/Mage/Checkout/Block/Cart/Shipping.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Cart/Sidebar.php b/app/code/core/Mage/Checkout/Block/Cart/Sidebar.php index 7aefd6d07f..b6d010f5d7 100644 --- a/app/code/core/Mage/Checkout/Block/Cart/Sidebar.php +++ b/app/code/core/Mage/Checkout/Block/Cart/Sidebar.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Cart/Totals.php b/app/code/core/Mage/Checkout/Block/Cart/Totals.php index e8da92961d..2b0cc70694 100644 --- a/app/code/core/Mage/Checkout/Block/Cart/Totals.php +++ b/app/code/core/Mage/Checkout/Block/Cart/Totals.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Links.php b/app/code/core/Mage/Checkout/Block/Links.php index 41e1b81566..219cca37b7 100644 --- a/app/code/core/Mage/Checkout/Block/Links.php +++ b/app/code/core/Mage/Checkout/Block/Links.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Multishipping/Abstract.php b/app/code/core/Mage/Checkout/Block/Multishipping/Abstract.php index 8761aecadb..647ca2401d 100644 --- a/app/code/core/Mage/Checkout/Block/Multishipping/Abstract.php +++ b/app/code/core/Mage/Checkout/Block/Multishipping/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Multishipping/Address/Select.php b/app/code/core/Mage/Checkout/Block/Multishipping/Address/Select.php index 50b39723d1..c624531536 100644 --- a/app/code/core/Mage/Checkout/Block/Multishipping/Address/Select.php +++ b/app/code/core/Mage/Checkout/Block/Multishipping/Address/Select.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Multishipping/Addresses.php b/app/code/core/Mage/Checkout/Block/Multishipping/Addresses.php index 1e1887c281..b46f3dbc07 100644 --- a/app/code/core/Mage/Checkout/Block/Multishipping/Addresses.php +++ b/app/code/core/Mage/Checkout/Block/Multishipping/Addresses.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Multishipping/Billing.php b/app/code/core/Mage/Checkout/Block/Multishipping/Billing.php index 1725974817..b63ba0e869 100644 --- a/app/code/core/Mage/Checkout/Block/Multishipping/Billing.php +++ b/app/code/core/Mage/Checkout/Block/Multishipping/Billing.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Multishipping/Billing/Items.php b/app/code/core/Mage/Checkout/Block/Multishipping/Billing/Items.php index aef08de1d3..6ea5022b0a 100644 --- a/app/code/core/Mage/Checkout/Block/Multishipping/Billing/Items.php +++ b/app/code/core/Mage/Checkout/Block/Multishipping/Billing/Items.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Multishipping/Link.php b/app/code/core/Mage/Checkout/Block/Multishipping/Link.php index 324d57cc1d..efbebd04ae 100644 --- a/app/code/core/Mage/Checkout/Block/Multishipping/Link.php +++ b/app/code/core/Mage/Checkout/Block/Multishipping/Link.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Multishipping/Overview.php b/app/code/core/Mage/Checkout/Block/Multishipping/Overview.php index d05b33a41b..01ffc43a57 100644 --- a/app/code/core/Mage/Checkout/Block/Multishipping/Overview.php +++ b/app/code/core/Mage/Checkout/Block/Multishipping/Overview.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Multishipping/Payment/Info.php b/app/code/core/Mage/Checkout/Block/Multishipping/Payment/Info.php index 3f212100f6..c7921d367e 100644 --- a/app/code/core/Mage/Checkout/Block/Multishipping/Payment/Info.php +++ b/app/code/core/Mage/Checkout/Block/Multishipping/Payment/Info.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Multishipping/Shipping.php b/app/code/core/Mage/Checkout/Block/Multishipping/Shipping.php index 1951c9ae3e..d73c375841 100644 --- a/app/code/core/Mage/Checkout/Block/Multishipping/Shipping.php +++ b/app/code/core/Mage/Checkout/Block/Multishipping/Shipping.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Multishipping/State.php b/app/code/core/Mage/Checkout/Block/Multishipping/State.php index f909e47847..191d04a3bd 100644 --- a/app/code/core/Mage/Checkout/Block/Multishipping/State.php +++ b/app/code/core/Mage/Checkout/Block/Multishipping/State.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Multishipping/Success.php b/app/code/core/Mage/Checkout/Block/Multishipping/Success.php index d57a5a01d9..b932dabe1d 100644 --- a/app/code/core/Mage/Checkout/Block/Multishipping/Success.php +++ b/app/code/core/Mage/Checkout/Block/Multishipping/Success.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Onepage.php b/app/code/core/Mage/Checkout/Block/Onepage.php index 40bc4c76a9..3a5f91406a 100644 --- a/app/code/core/Mage/Checkout/Block/Onepage.php +++ b/app/code/core/Mage/Checkout/Block/Onepage.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Onepage/Abstract.php b/app/code/core/Mage/Checkout/Block/Onepage/Abstract.php index 50b7018dd4..0ff811b2f3 100644 --- a/app/code/core/Mage/Checkout/Block/Onepage/Abstract.php +++ b/app/code/core/Mage/Checkout/Block/Onepage/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Onepage/Billing.php b/app/code/core/Mage/Checkout/Block/Onepage/Billing.php index f4b65c3dc7..bcac0aa349 100644 --- a/app/code/core/Mage/Checkout/Block/Onepage/Billing.php +++ b/app/code/core/Mage/Checkout/Block/Onepage/Billing.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Onepage/Failure.php b/app/code/core/Mage/Checkout/Block/Onepage/Failure.php index 01eac67fb3..5b0559500f 100644 --- a/app/code/core/Mage/Checkout/Block/Onepage/Failure.php +++ b/app/code/core/Mage/Checkout/Block/Onepage/Failure.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Onepage/Link.php b/app/code/core/Mage/Checkout/Block/Onepage/Link.php index 9ba9e0d9cd..542c4cdb74 100644 --- a/app/code/core/Mage/Checkout/Block/Onepage/Link.php +++ b/app/code/core/Mage/Checkout/Block/Onepage/Link.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Onepage/Login.php b/app/code/core/Mage/Checkout/Block/Onepage/Login.php index 341c739a3b..5a9bd3316b 100644 --- a/app/code/core/Mage/Checkout/Block/Onepage/Login.php +++ b/app/code/core/Mage/Checkout/Block/Onepage/Login.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Onepage/Payment.php b/app/code/core/Mage/Checkout/Block/Onepage/Payment.php index 9015ee6b2a..021a454e07 100644 --- a/app/code/core/Mage/Checkout/Block/Onepage/Payment.php +++ b/app/code/core/Mage/Checkout/Block/Onepage/Payment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Onepage/Payment/Info.php b/app/code/core/Mage/Checkout/Block/Onepage/Payment/Info.php index 2ee8e013ea..8303b9f46e 100644 --- a/app/code/core/Mage/Checkout/Block/Onepage/Payment/Info.php +++ b/app/code/core/Mage/Checkout/Block/Onepage/Payment/Info.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Onepage/Payment/Methods.php b/app/code/core/Mage/Checkout/Block/Onepage/Payment/Methods.php index 866e80ca36..ff981bff28 100644 --- a/app/code/core/Mage/Checkout/Block/Onepage/Payment/Methods.php +++ b/app/code/core/Mage/Checkout/Block/Onepage/Payment/Methods.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Onepage/Progress.php b/app/code/core/Mage/Checkout/Block/Onepage/Progress.php index 653359f3e7..140451bda7 100644 --- a/app/code/core/Mage/Checkout/Block/Onepage/Progress.php +++ b/app/code/core/Mage/Checkout/Block/Onepage/Progress.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Onepage/Review.php b/app/code/core/Mage/Checkout/Block/Onepage/Review.php index 4675ce673b..92a2e65a6a 100644 --- a/app/code/core/Mage/Checkout/Block/Onepage/Review.php +++ b/app/code/core/Mage/Checkout/Block/Onepage/Review.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Onepage/Review/Info.php b/app/code/core/Mage/Checkout/Block/Onepage/Review/Info.php index c76d8e783b..0caeb00442 100644 --- a/app/code/core/Mage/Checkout/Block/Onepage/Review/Info.php +++ b/app/code/core/Mage/Checkout/Block/Onepage/Review/Info.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Onepage/Shipping.php b/app/code/core/Mage/Checkout/Block/Onepage/Shipping.php index 26fd68be5f..ae9ba41956 100644 --- a/app/code/core/Mage/Checkout/Block/Onepage/Shipping.php +++ b/app/code/core/Mage/Checkout/Block/Onepage/Shipping.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Onepage/Shipping/Method.php b/app/code/core/Mage/Checkout/Block/Onepage/Shipping/Method.php index 8298523fc6..d893653bb7 100644 --- a/app/code/core/Mage/Checkout/Block/Onepage/Shipping/Method.php +++ b/app/code/core/Mage/Checkout/Block/Onepage/Shipping/Method.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Onepage/Shipping/Method/Additional.php b/app/code/core/Mage/Checkout/Block/Onepage/Shipping/Method/Additional.php index f72c20bea1..a1743fa5ec 100644 --- a/app/code/core/Mage/Checkout/Block/Onepage/Shipping/Method/Additional.php +++ b/app/code/core/Mage/Checkout/Block/Onepage/Shipping/Method/Additional.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Onepage/Shipping/Method/Available.php b/app/code/core/Mage/Checkout/Block/Onepage/Shipping/Method/Available.php index 3d95b7724b..20d0effc91 100644 --- a/app/code/core/Mage/Checkout/Block/Onepage/Shipping/Method/Available.php +++ b/app/code/core/Mage/Checkout/Block/Onepage/Shipping/Method/Available.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Onepage/Success.php b/app/code/core/Mage/Checkout/Block/Onepage/Success.php index 85e505eb08..6218023e46 100644 --- a/app/code/core/Mage/Checkout/Block/Onepage/Success.php +++ b/app/code/core/Mage/Checkout/Block/Onepage/Success.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Success.php b/app/code/core/Mage/Checkout/Block/Success.php index d1066c58e4..de17a0e69b 100644 --- a/app/code/core/Mage/Checkout/Block/Success.php +++ b/app/code/core/Mage/Checkout/Block/Success.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Total/Default.php b/app/code/core/Mage/Checkout/Block/Total/Default.php index 6df1f11fa8..537949a61e 100644 --- a/app/code/core/Mage/Checkout/Block/Total/Default.php +++ b/app/code/core/Mage/Checkout/Block/Total/Default.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Total/Nominal.php b/app/code/core/Mage/Checkout/Block/Total/Nominal.php index 84edd54870..f145aed30a 100644 --- a/app/code/core/Mage/Checkout/Block/Total/Nominal.php +++ b/app/code/core/Mage/Checkout/Block/Total/Nominal.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Total/Tax.php b/app/code/core/Mage/Checkout/Block/Total/Tax.php index 82fc5044bb..9187e9ef4c 100644 --- a/app/code/core/Mage/Checkout/Block/Total/Tax.php +++ b/app/code/core/Mage/Checkout/Block/Total/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Controller/Action.php b/app/code/core/Mage/Checkout/Controller/Action.php index c8a9e94dd3..1c06c2c31d 100644 --- a/app/code/core/Mage/Checkout/Controller/Action.php +++ b/app/code/core/Mage/Checkout/Controller/Action.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Exception.php b/app/code/core/Mage/Checkout/Exception.php index e0109ff814..478bc5c97c 100644 --- a/app/code/core/Mage/Checkout/Exception.php +++ b/app/code/core/Mage/Checkout/Exception.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Helper/Cart.php b/app/code/core/Mage/Checkout/Helper/Cart.php index 2331db71a7..33ba781875 100644 --- a/app/code/core/Mage/Checkout/Helper/Cart.php +++ b/app/code/core/Mage/Checkout/Helper/Cart.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Helper/Data.php b/app/code/core/Mage/Checkout/Helper/Data.php index f4bf8344ff..7d4e8f0fc8 100644 --- a/app/code/core/Mage/Checkout/Helper/Data.php +++ b/app/code/core/Mage/Checkout/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -103,7 +103,8 @@ public function getPriceInclTax($item) return $item->getPriceInclTax(); } $qty = ($item->getQty() ? $item->getQty() : ($item->getQtyOrdered() ? $item->getQtyOrdered() : 1)); - $price = (floatval($qty)) ? ($item->getRowTotal() + $item->getTaxAmount())/$qty : 0; + $taxAmount = $item->getTaxAmount() + $item->getDiscountTaxCompensation(); + $price = (floatval($qty)) ? ($item->getRowTotal() + $taxAmount)/$qty : 0; return Mage::app()->getStore()->roundPrice($price); } @@ -118,20 +119,21 @@ public function getSubtotalInclTax($item) if ($item->getRowTotalInclTax()) { return $item->getRowTotalInclTax(); } - $tax = $item->getTaxAmount(); + $tax = $item->getTaxAmount() + $item->getDiscountTaxCompensation(); return $item->getRowTotal() + $tax; } public function getBasePriceInclTax($item) { $qty = ($item->getQty() ? $item->getQty() : ($item->getQtyOrdered() ? $item->getQtyOrdered() : 1)); - $price = (floatval($qty)) ? ($item->getBaseRowTotal() + $item->getBaseTaxAmount())/$qty : 0; + $taxAmount = $item->getBaseTaxAmount() + $item->getBaseDiscountTaxCompensation(); + $price = (floatval($qty)) ? ($item->getBaseRowTotal() + $taxAmount)/$qty : 0; return Mage::app()->getStore()->roundPrice($price); } public function getBaseSubtotalInclTax($item) { - $tax = ($item->getBaseTaxBeforeDiscount() ? $item->getBaseTaxBeforeDiscount() : $item->getBaseTaxAmount()); + $tax = $item->getBaseTaxAmount() + $item->getBaseDiscountTaxCompensation(); return $item->getBaseRowTotal()+$tax; } diff --git a/app/code/core/Mage/Checkout/Helper/Url.php b/app/code/core/Mage/Checkout/Helper/Url.php index a85d45fc1e..0499e68a42 100644 --- a/app/code/core/Mage/Checkout/Helper/Url.php +++ b/app/code/core/Mage/Checkout/Helper/Url.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Model/Agreement.php b/app/code/core/Mage/Checkout/Model/Agreement.php index b575bda50b..870fbf06d5 100644 --- a/app/code/core/Mage/Checkout/Model/Agreement.php +++ b/app/code/core/Mage/Checkout/Model/Agreement.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Model/Api/Resource.php b/app/code/core/Mage/Checkout/Model/Api/Resource.php index 2d55f060c9..a7fd9935ef 100644 --- a/app/code/core/Mage/Checkout/Model/Api/Resource.php +++ b/app/code/core/Mage/Checkout/Model/Api/Resource.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Model/Api/Resource/Customer.php b/app/code/core/Mage/Checkout/Model/Api/Resource/Customer.php index 670b188d4d..557266fc27 100644 --- a/app/code/core/Mage/Checkout/Model/Api/Resource/Customer.php +++ b/app/code/core/Mage/Checkout/Model/Api/Resource/Customer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Model/Api/Resource/Product.php b/app/code/core/Mage/Checkout/Model/Api/Resource/Product.php index 507d3523bb..dc29d5ee0d 100644 --- a/app/code/core/Mage/Checkout/Model/Api/Resource/Product.php +++ b/app/code/core/Mage/Checkout/Model/Api/Resource/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Model/Cart.php b/app/code/core/Mage/Checkout/Model/Cart.php index 03730e3a62..cc99a9a31d 100644 --- a/app/code/core/Mage/Checkout/Model/Cart.php +++ b/app/code/core/Mage/Checkout/Model/Cart.php @@ -20,24 +20,37 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** - * Shoping cart model + * Shopping cart model * * @category Mage * @package Mage_Checkout * @author Magento Core Team */ -class Mage_Checkout_Model_Cart extends Varien_Object +class Mage_Checkout_Model_Cart extends Varien_Object implements Mage_Checkout_Model_Cart_Interface { - protected $_summaryQty = null; - protected $_productIds = null; + /** + * Shopping cart items summary quantity(s) + * + * @var int|null + */ + protected $_summaryQty; + + /** + * List of product ids in shopping cart + * + * @var array|null + */ + protected $_productIds; /** * Get shopping cart resource model + * + * @return Mage_Checkout_Model_Resource_Cart */ protected function _getResource() { @@ -55,7 +68,7 @@ public function getCheckoutSession() } /** - * Retrieve custome session model + * Retrieve customer session model * * @return Mage_Customer_Model_Customer */ @@ -64,6 +77,11 @@ public function getCustomerSession() return Mage::getSingleton('customer/session'); } + /** + * List of shopping cart items + * + * @return Mage_Eav_Model_Entity_Collection_Abstract|array + */ public function getItems() { if (!$this->getQuote()->getId()) { @@ -103,8 +121,22 @@ public function getQuote() return $this->_getData('quote'); } + /** + * Set quote object associated with the cart + * + * @param Mage_Sales_Model_Quote $quote + * @return Mage_Checkout_Model_Cart + */ + public function setQuote(Mage_Sales_Model_Quote $quote) + { + $this->setData('quote', $quote); + return $this; + } + /** * Initialize cart quote state to be able use it on cart page + * + * @return Mage_Checkout_Model_Cart */ public function init() { @@ -198,8 +230,7 @@ protected function _getProductRequest($requestInfo) if ($requestInfo instanceof Varien_Object) { $request = $requestInfo; } elseif (is_numeric($requestInfo)) { - $request = new Varien_Object(); - $request->setQty($requestInfo); + $request = new Varien_Object(array('qty' => $requestInfo)); } else { $request = new Varien_Object($requestInfo); } @@ -207,6 +238,7 @@ protected function _getProductRequest($requestInfo) if (!$request->hasQty()) { $request->setQty(1); } + return $request; } @@ -381,7 +413,10 @@ public function updateItems($data) $qty = isset($itemInfo['qty']) ? (float) $itemInfo['qty'] : false; if ($qty > 0) { $item->setQty($qty); - if ($item->getHasError()) { + + $itemInQuote = $this->getQuote()->getItemById($item->getId()); + + if (!$itemInQuote && $item->getHasError()) { Mage::throwException($item->getMessage()); } @@ -430,12 +465,20 @@ public function save() $this->getQuote()->save(); $this->getCheckoutSession()->setQuoteId($this->getQuote()->getId()); /** - * Cart save usually called after chenges with cart items. + * Cart save usually called after changes with cart items. */ Mage::dispatchEvent('checkout_cart_save_after', array('cart'=>$this)); return $this; } + /** + * Save cart (implement interface method) + */ + public function saveQuote() + { + $this->save(); + } + /** * Mark all quote items as deleted (empty shopping cart) * @@ -463,9 +506,9 @@ public function getProductIds() } /** - * Get shopping cart items summary (inchlude config settings) + * Get shopping cart items summary (includes config settings) * - * @return decimal + * @return int|float */ public function getSummaryQty() { @@ -502,7 +545,7 @@ public function getItemsCount() /** * Get shopping cart summary qty * - * @return decimal + * @return int|float */ public function getItemsQty() { @@ -514,7 +557,7 @@ public function getItemsQty() * $requestInfo - either qty (int) or buyRequest in form of array or Varien_Object * $updatingParams - information on how to perform update, passed to Quote->updateItem() method * - * @param int $id + * @param int $itemId * @param int|array|Varien_Object $requestInfo * @param null|array|Varien_Object $updatingParams * @return Mage_Sales_Model_Quote_Item|string diff --git a/app/code/core/Mage/Checkout/Model/Cart/Api.php b/app/code/core/Mage/Checkout/Model/Cart/Api.php index 203273e315..a63025a42a 100644 --- a/app/code/core/Mage/Checkout/Model/Cart/Api.php +++ b/app/code/core/Mage/Checkout/Model/Cart/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Model/Cart/Api/V2.php b/app/code/core/Mage/Checkout/Model/Cart/Api/V2.php index 74b3e829eb..e2a2f62a20 100644 --- a/app/code/core/Mage/Checkout/Model/Cart/Api/V2.php +++ b/app/code/core/Mage/Checkout/Model/Cart/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Model/Cart/Coupon/Api.php b/app/code/core/Mage/Checkout/Model/Cart/Coupon/Api.php index 6aad5b9051..07bc847013 100644 --- a/app/code/core/Mage/Checkout/Model/Cart/Coupon/Api.php +++ b/app/code/core/Mage/Checkout/Model/Cart/Coupon/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Model/Cart/Coupon/Api/V2.php b/app/code/core/Mage/Checkout/Model/Cart/Coupon/Api/V2.php index 979e521619..2e4d0632bb 100644 --- a/app/code/core/Mage/Checkout/Model/Cart/Coupon/Api/V2.php +++ b/app/code/core/Mage/Checkout/Model/Cart/Coupon/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Model/Cart/Customer/Api.php b/app/code/core/Mage/Checkout/Model/Cart/Customer/Api.php index 6f4b77d998..c89304fbdf 100644 --- a/app/code/core/Mage/Checkout/Model/Cart/Customer/Api.php +++ b/app/code/core/Mage/Checkout/Model/Cart/Customer/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Model/Cart/Customer/Api/V2.php b/app/code/core/Mage/Checkout/Model/Cart/Customer/Api/V2.php index d53eccf02f..9c01745370 100644 --- a/app/code/core/Mage/Checkout/Model/Cart/Customer/Api/V2.php +++ b/app/code/core/Mage/Checkout/Model/Cart/Customer/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Model/Cart/Interface.php b/app/code/core/Mage/Checkout/Model/Cart/Interface.php new file mode 100644 index 0000000000..12950afa9f --- /dev/null +++ b/app/code/core/Mage/Checkout/Model/Cart/Interface.php @@ -0,0 +1,69 @@ + + */ + +interface Mage_Checkout_Model_Cart_Interface +{ + /** + * Add product to shopping cart (quote) + * + * @param int|Mage_Catalog_Model_Product $productInfo + * @param mixed $requestInfo + * @return Mage_Checkout_Model_Cart_Interface + */ + public function addProduct($productInfo, $requestInfo = null); + + /** + * Save cart + * + * @abstract + * @return Mage_Checkout_Model_Cart_Interface + */ + public function saveQuote(); + + /** + * Associate quote with the cart + * + * @abstract + * @param $quote Mage_Sales_Model_Quote + * @return Mage_Checkout_Model_Cart_Interface + */ + public function setQuote(Mage_Sales_Model_Quote $quote); + + /** + * Get quote object associated with cart + * @abstract + * @return Mage_Sales_Model_Quote + */ + public function getQuote(); +} diff --git a/app/code/core/Mage/Checkout/Model/Cart/Payment/Api.php b/app/code/core/Mage/Checkout/Model/Cart/Payment/Api.php index f535514d3f..63d5f5765e 100644 --- a/app/code/core/Mage/Checkout/Model/Cart/Payment/Api.php +++ b/app/code/core/Mage/Checkout/Model/Cart/Payment/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Model/Cart/Payment/Api/V2.php b/app/code/core/Mage/Checkout/Model/Cart/Payment/Api/V2.php index b2bc69e6bc..535d065643 100644 --- a/app/code/core/Mage/Checkout/Model/Cart/Payment/Api/V2.php +++ b/app/code/core/Mage/Checkout/Model/Cart/Payment/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Model/Cart/Product/Api.php b/app/code/core/Mage/Checkout/Model/Cart/Product/Api.php index 914c61abce..1288f787c0 100644 --- a/app/code/core/Mage/Checkout/Model/Cart/Product/Api.php +++ b/app/code/core/Mage/Checkout/Model/Cart/Product/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -188,7 +188,8 @@ public function remove($quoteId, $productsData, $store=null) try { /** @var $quoteItem Mage_Sales_Model_Quote_Item */ - $quoteItem = $this->_getQuoteItemByProduct($quote, $productByItem, $this->_getProductRequest($productItem)); + $quoteItem = $this->_getQuoteItemByProduct($quote, $productByItem, + $this->_getProductRequest($productItem)); if (is_null($quoteItem->getId())) { $errors[] = Mage::helper('checkout')->__("One item of products is not belong any of quote item"); continue; @@ -233,12 +234,13 @@ public function items($quoteId, $store = null) /** @var $item Mage_Sales_Model_Quote_Item */ $product = $item->getProduct(); $productsResult[] = array( // Basic product data - 'product_id' => $product->getId(), - 'sku' => $product->getSku(), - 'set' => $product->getAttributeSetId(), - 'type' => $product->getTypeId(), - 'categories' => $product->getCategoryIds(), - 'websites' => $product->getWebsiteIds() + 'product_id' => $product->getId(), + 'sku' => $product->getSku(), + 'name' => $product->getName(), + 'set' => $product->getAttributeSetId(), + 'type' => $product->getTypeId(), + 'category_ids' => $product->getCategoryIds(), + 'website_ids' => $product->getWebsiteIds() ); } @@ -295,7 +297,8 @@ public function moveToCustomerQuote($quoteId, $productsData, $store=null) try { /** @var $quoteItem Mage_Sales_Model_Quote_Item */ - $quoteItem = $this->_getQuoteItemByProduct($quote, $productByItem, $this->_getProductRequest($productItem)); + $quoteItem = $this->_getQuoteItemByProduct($quote, $productByItem, + $this->_getProductRequest($productItem)); if($quoteItem->getId()){ $customerQuote->addItem($quoteItem); $quote->removeItem($quoteItem->getId()); diff --git a/app/code/core/Mage/Checkout/Model/Cart/Product/Api/V2.php b/app/code/core/Mage/Checkout/Model/Cart/Product/Api/V2.php index f386815018..691211f6d9 100644 --- a/app/code/core/Mage/Checkout/Model/Cart/Product/Api/V2.php +++ b/app/code/core/Mage/Checkout/Model/Cart/Product/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Model/Cart/Shipping/Api.php b/app/code/core/Mage/Checkout/Model/Cart/Shipping/Api.php index a9126b458e..a1d6a828af 100644 --- a/app/code/core/Mage/Checkout/Model/Cart/Shipping/Api.php +++ b/app/code/core/Mage/Checkout/Model/Cart/Shipping/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Model/Cart/Shipping/Api/V2.php b/app/code/core/Mage/Checkout/Model/Cart/Shipping/Api/V2.php index e3c5a55628..8b71595019 100644 --- a/app/code/core/Mage/Checkout/Model/Cart/Shipping/Api/V2.php +++ b/app/code/core/Mage/Checkout/Model/Cart/Shipping/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Model/Config/Source/Cart/Summary.php b/app/code/core/Mage/Checkout/Model/Config/Source/Cart/Summary.php index af73e517d2..03ca2877fa 100644 --- a/app/code/core/Mage/Checkout/Model/Config/Source/Cart/Summary.php +++ b/app/code/core/Mage/Checkout/Model/Config/Source/Cart/Summary.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Checkout_Model_Config_Source_Cart_Summary diff --git a/app/code/core/Mage/Checkout/Model/Mysql4/Agreement.php b/app/code/core/Mage/Checkout/Model/Mysql4/Agreement.php index 379c3a164b..843ce327dd 100644 --- a/app/code/core/Mage/Checkout/Model/Mysql4/Agreement.php +++ b/app/code/core/Mage/Checkout/Model/Mysql4/Agreement.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Model/Mysql4/Agreement/Collection.php b/app/code/core/Mage/Checkout/Model/Mysql4/Agreement/Collection.php index 635e2412dc..e39a59cb76 100644 --- a/app/code/core/Mage/Checkout/Model/Mysql4/Agreement/Collection.php +++ b/app/code/core/Mage/Checkout/Model/Mysql4/Agreement/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Model/Mysql4/Cart.php b/app/code/core/Mage/Checkout/Model/Mysql4/Cart.php index e4be9495f7..682a04f9cb 100644 --- a/app/code/core/Mage/Checkout/Model/Mysql4/Cart.php +++ b/app/code/core/Mage/Checkout/Model/Mysql4/Cart.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Model/Mysql4/Setup.php b/app/code/core/Mage/Checkout/Model/Mysql4/Setup.php index 5eade76bc8..ce7274d543 100644 --- a/app/code/core/Mage/Checkout/Model/Mysql4/Setup.php +++ b/app/code/core/Mage/Checkout/Model/Mysql4/Setup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Model/Observer.php b/app/code/core/Mage/Checkout/Model/Observer.php index 1b6970209c..e254c540b6 100644 --- a/app/code/core/Mage/Checkout/Model/Observer.php +++ b/app/code/core/Mage/Checkout/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Model/Resource/Agreement.php b/app/code/core/Mage/Checkout/Model/Resource/Agreement.php index 6e08caac19..fa88879f52 100755 --- a/app/code/core/Mage/Checkout/Model/Resource/Agreement.php +++ b/app/code/core/Mage/Checkout/Model/Resource/Agreement.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Model/Resource/Agreement/Collection.php b/app/code/core/Mage/Checkout/Model/Resource/Agreement/Collection.php index 6dbc11fe7b..d699844f4b 100755 --- a/app/code/core/Mage/Checkout/Model/Resource/Agreement/Collection.php +++ b/app/code/core/Mage/Checkout/Model/Resource/Agreement/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Model/Resource/Cart.php b/app/code/core/Mage/Checkout/Model/Resource/Cart.php index 6729faff81..a77d58e31a 100755 --- a/app/code/core/Mage/Checkout/Model/Resource/Cart.php +++ b/app/code/core/Mage/Checkout/Model/Resource/Cart.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Model/Resource/Setup.php b/app/code/core/Mage/Checkout/Model/Resource/Setup.php index d7f39115bd..9050214529 100755 --- a/app/code/core/Mage/Checkout/Model/Resource/Setup.php +++ b/app/code/core/Mage/Checkout/Model/Resource/Setup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Model/Session.php b/app/code/core/Mage/Checkout/Model/Session.php index 97ffc19092..5c17599c7f 100644 --- a/app/code/core/Mage/Checkout/Model/Session.php +++ b/app/code/core/Mage/Checkout/Model/Session.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -28,14 +28,20 @@ class Mage_Checkout_Model_Session extends Mage_Core_Model_Session_Abstract { const CHECKOUT_STATE_BEGIN = 'begin'; - protected $_quote = null; + + /** + * Quote instance + * + * @var null|Mage_Sales_Model_Quote + */ + protected $_quote; /** * Customer instance * * @var null|Mage_Customer_Model_Customer */ - protected $_customer = null; + protected $_customer; /** * Whether load only active quote @@ -64,7 +70,7 @@ public function unsetAll() /** * Set customer instance * - * @param Mage_Customer_Model_Customer $customer + * @param Mage_Customer_Model_Customer|null $customer * @return Mage_Checkout_Model_Session */ public function setCustomer($customer) @@ -80,7 +86,7 @@ public function setCustomer($customer) */ public function hasQuote() { - return !(is_null($this->_quote)); + return isset($this->_quote); } /** @@ -105,10 +111,8 @@ public function getQuote() Mage::dispatchEvent('custom_quote_process', array('checkout_session' => $this)); if ($this->_quote === null) { - $quote = Mage::getModel('sales/quote') - ->setStoreId(Mage::app()->getStore()->getId()); - /** @var $quote Mage_Sales_Model_Quote */ + $quote = Mage::getModel('sales/quote')->setStoreId(Mage::app()->getStore()->getId()); if ($this->getQuoteId()) { if ($this->_loadInactive) { $quote->load($this->getQuoteId()); diff --git a/app/code/core/Mage/Checkout/Model/Type/Abstract.php b/app/code/core/Mage/Checkout/Model/Type/Abstract.php index 9957e31057..507ecc4535 100644 --- a/app/code/core/Mage/Checkout/Model/Type/Abstract.php +++ b/app/code/core/Mage/Checkout/Model/Type/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Model/Type/Multishipping.php b/app/code/core/Mage/Checkout/Model/Type/Multishipping.php index 49b70b0a9c..5bed5f55ad 100644 --- a/app/code/core/Mage/Checkout/Model/Type/Multishipping.php +++ b/app/code/core/Mage/Checkout/Model/Type/Multishipping.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Model/Type/Multishipping/State.php b/app/code/core/Mage/Checkout/Model/Type/Multishipping/State.php index 97fda4df06..b7fe32fee2 100644 --- a/app/code/core/Mage/Checkout/Model/Type/Multishipping/State.php +++ b/app/code/core/Mage/Checkout/Model/Type/Multishipping/State.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Model/Type/Onepage.php b/app/code/core/Mage/Checkout/Model/Type/Onepage.php index 50be9c13b1..0d4bc722a1 100644 --- a/app/code/core/Mage/Checkout/Model/Type/Onepage.php +++ b/app/code/core/Mage/Checkout/Model/Type/Onepage.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -102,6 +102,7 @@ public function getQuote() * Declare checkout quote instance * * @param Mage_Sales_Model_Quote $quote + * @return Mage_Checkout_Model_Type_Onepage */ public function setQuote(Mage_Sales_Model_Quote $quote) { @@ -146,7 +147,7 @@ public function initCheckout() } /* - * want to laod the correct customer information by assiging to address + * want to load the correct customer information by assigning to address * instead of just loading from sales/quote_address */ $customer = $customerSession->getCustomer(); @@ -188,7 +189,7 @@ public function getCheckoutMehod() } /** - * Specify chceckout method + * Specify checkout method * * @param string $method * @return array @@ -300,7 +301,7 @@ public function saveBilling($data, $customerAddressId) */ $usingCase = isset($data['use_for_shipping']) ? (int)$data['use_for_shipping'] : 0; - switch($usingCase) { + switch ($usingCase) { case 0: $shipping = $this->getQuote()->getShippingAddress(); $shipping->setSameAsBilling(0); @@ -311,11 +312,14 @@ public function saveBilling($data, $customerAddressId) $shipping = $this->getQuote()->getShippingAddress(); $shippingMethod = $shipping->getShippingMethod(); + // Billing address properties that must be always copied to shipping address + $requiredBillingAttributes = array('customer_address_id'); + // don't reset original shipping data, if it was not changed by customer foreach ($shipping->getData() as $shippingKey => $shippingValue) { - if (!is_null($shippingValue) - && !is_null($billing->getData($shippingKey)) - && !isset($data[$shippingKey])) { + if (!is_null($shippingValue) && !is_null($billing->getData($shippingKey)) + && !isset($data[$shippingKey]) && !in_array($shippingKey, $requiredBillingAttributes) + ) { $billing->unsetData($shippingKey); } } @@ -354,8 +358,8 @@ public function saveBilling($data, $customerAddressId) */ protected function _validateCustomerData(array $data) { - /* @var $customerForm Mage_Customer_Model_Form */ - $customerForm = Mage::getModel('customer/form'); + /** @var $customerForm Mage_Customer_Model_Form */ + $customerForm = Mage::getModel('customer/form'); $customerForm->setFormCode('checkout_register') ->setIsAjaxRequest(Mage::app()->getRequest()->isAjax()); @@ -391,10 +395,13 @@ protected function _validateCustomerData(array $data) $customer->setPassword($customerRequest->getParam('customer_password')); $customer->setConfirmation($customerRequest->getParam('confirm_password')); } else { - // emulate customer password for quest + // spoof customer password for guest $password = $customer->generatePassword(); $customer->setPassword($password); $customer->setConfirmation($password); + // set NOT LOGGED IN group id explicitly, + // otherwise copyFieldset('customer_account', 'to_quote') will fill it with default group id value + $customer->setGroupId(Mage_Customer_Model_Group::NOT_LOGGED_IN_ID); } $result = $customer->validate(); @@ -539,6 +546,7 @@ public function saveShipping($data, $customerAddressId) } } + $address->setCustomerAddressId(null); // Additional form data, not fetched by extractData (as it fetches only attributes) $address->setSaveInAddressBook(empty($data['save_in_address_book']) ? 0 : 1); $address->setSameAsBilling(empty($data['same_as_billing']) ? 0 : 1); @@ -830,7 +838,7 @@ public function saveOrder() } /** - * Validate quote state to be able submited from one page checkout page + * Validate quote state to be able submitted from one page checkout page * * @deprecated after 1.4 - service model doing quote validation * @return Mage_Checkout_Model_Type_Onepage diff --git a/app/code/core/Mage/Checkout/controllers/CartController.php b/app/code/core/Mage/Checkout/controllers/CartController.php index f925eb3e7d..8745dd6f65 100644 --- a/app/code/core/Mage/Checkout/controllers/CartController.php +++ b/app/code/core/Mage/Checkout/controllers/CartController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -75,10 +75,12 @@ protected function _goBack() { $returnUrl = $this->getRequest()->getParam('return_url'); if ($returnUrl) { - // clear layout messages in case of external url redirect - if ($this->_isUrlInternal($returnUrl)) { - $this->_getSession()->getMessages(true); + + if (!$this->_isUrlInternal($returnUrl)) { + throw new Mage_Exception('External urls redirect to "' . $returnUrl . '" denied!'); } + + $this->_getSession()->getMessages(true); $this->getResponse()->setRedirect($returnUrl); } elseif (!Mage::getStoreConfig('checkout/cart/redirect_to_cart') && !$this->getRequest()->getParam('in_cart') @@ -124,7 +126,13 @@ public function indexAction() $cart->save(); if (!$this->_getQuote()->validateMinimumAmount()) { - $warning = Mage::getStoreConfig('sales/minimum_order/description'); + $minimumAmount = Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode()) + ->toCurrency(Mage::getStoreConfig('sales/minimum_order/amount')); + + $warning = Mage::getStoreConfig('sales/minimum_order/description') + ? Mage::getStoreConfig('sales/minimum_order/description') + : Mage::helper('checkout')->__('Minimum order amount is %s', $minimumAmount); + $cart->getCheckoutSession()->addNotice($warning); } } @@ -133,6 +141,8 @@ public function indexAction() $messages = array(); foreach ($cart->getQuote()->getMessages() as $message) { if ($message) { + // Escape HTML entities in quote message to prevent XSS + $message->setCode(Mage::helper('core')->escapeHtml($message->getCode())); $messages[] = $message; } } @@ -198,18 +208,18 @@ public function addAction() if (!$this->_getSession()->getNoCartRedirect(true)) { if (!$cart->getQuote()->getHasError()){ - $message = $this->__('%s was added to your shopping cart.', Mage::helper('core')->htmlEscape($product->getName())); + $message = $this->__('%s was added to your shopping cart.', Mage::helper('core')->escapeHtml($product->getName())); $this->_getSession()->addSuccess($message); } $this->_goBack(); } } catch (Mage_Core_Exception $e) { if ($this->_getSession()->getUseNotice(true)) { - $this->_getSession()->addNotice($e->getMessage()); + $this->_getSession()->addNotice(Mage::helper('core')->escapeHtml($e->getMessage())); } else { $messages = array_unique(explode("\n", $e->getMessage())); foreach ($messages as $message) { - $this->_getSession()->addError($message); + $this->_getSession()->addError(Mage::helper('core')->escapeHtml($message)); } } @@ -415,7 +425,7 @@ protected function _updateShoppingCart() } $this->_getSession()->setCartWasUpdated(true); } catch (Mage_Core_Exception $e) { - $this->_getSession()->addError($e->getMessage()); + $this->_getSession()->addError(Mage::helper('core')->escapeHtml($e->getMessage())); } catch (Exception $e) { $this->_getSession()->addException($e, $this->__('Cannot update shopping cart.')); Mage::logException($e); diff --git a/app/code/core/Mage/Checkout/controllers/IndexController.php b/app/code/core/Mage/Checkout/controllers/IndexController.php index 6a5ff01a8d..19ee4ae45e 100644 --- a/app/code/core/Mage/Checkout/controllers/IndexController.php +++ b/app/code/core/Mage/Checkout/controllers/IndexController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/controllers/Multishipping/AddressController.php b/app/code/core/Mage/Checkout/controllers/Multishipping/AddressController.php index a764e94bb2..679e3f7959 100644 --- a/app/code/core/Mage/Checkout/controllers/Multishipping/AddressController.php +++ b/app/code/core/Mage/Checkout/controllers/Multishipping/AddressController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -89,7 +89,7 @@ public function shippingSavedAction() if (count($this->_getCheckout()->getCustomer()->getAddresses()) == 1) { $this->_getCheckout()->reset(); } - $this->_redirect('*/multishipping/'); + $this->_redirect('*/multishipping/addresses'); } public function editShippingAction() diff --git a/app/code/core/Mage/Checkout/controllers/MultishippingController.php b/app/code/core/Mage/Checkout/controllers/MultishippingController.php index 8af1443a57..71ee416bf8 100644 --- a/app/code/core/Mage/Checkout/controllers/MultishippingController.php +++ b/app/code/core/Mage/Checkout/controllers/MultishippingController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/controllers/OnepageController.php b/app/code/core/Mage/Checkout/controllers/OnepageController.php index 88ca7e9e50..e90b59eee1 100644 --- a/app/code/core/Mage/Checkout/controllers/OnepageController.php +++ b/app/code/core/Mage/Checkout/controllers/OnepageController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -33,6 +33,9 @@ class Mage_Checkout_OnepageController extends Mage_Checkout_Controller_Action 'review' => '_getReviewHtml', ); + /** @var Mage_Sales_Model_Order */ + protected $_order; + /** * @return Mage_Checkout_OnepageController */ @@ -128,6 +131,7 @@ protected function _getAdditionalHtml() $layout->generateXml(); $layout->generateBlocks(); $output = $layout->getOutput(); + Mage::getSingleton('core/translate_inline')->processResponseBody($output); return $output; } @@ -167,7 +171,10 @@ public function indexAction() return; } if (!$quote->validateMinimumAmount()) { - $error = Mage::getStoreConfig('sales/minimum_order/error_message'); + $error = Mage::getStoreConfig('sales/minimum_order/error_message') ? + Mage::getStoreConfig('sales/minimum_order/error_message') : + Mage::helper('checkout')->__('Subtotal must exceed minimum order amount'); + Mage::getSingleton('checkout/session')->addError($error); $this->_redirect('checkout/cart'); return; @@ -442,9 +449,6 @@ public function savePaymentAction() $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result)); } - /* @var $_order Mage_Sales_Model_Order */ - protected $_order; - /** * Get Order by quoteId * @@ -506,21 +510,6 @@ public function saveOrderAction() } $this->getOnepage()->saveOrder(); - $storeId = Mage::app()->getStore()->getId(); - $paymentHelper = Mage::helper("payment"); - $zeroSubTotalPaymentAction = $paymentHelper->getZeroSubTotalPaymentAutomaticInvoice($storeId); - if ($paymentHelper->isZeroSubTotal($storeId) - && $this->_getOrder()->getGrandTotal() == 0 - && $zeroSubTotalPaymentAction == Mage_Payment_Model_Method_Abstract::ACTION_AUTHORIZE_CAPTURE - && $paymentHelper->getZeroSubTotalOrderStatus($storeId) == 'pending') { - $invoice = $this->_initInvoice(); - $invoice->getOrder()->setIsInProcess(true); - $transactionSave = Mage::getModel('core/resource_transaction') - ->addObject($invoice) - ->addObject($invoice->getOrder()); - $transactionSave->save(); - } - $redirectUrl = $this->getOnepage()->getCheckout()->getRedirectUrl(); $result['success'] = true; $result['error'] = false; diff --git a/app/code/core/Mage/Checkout/etc/adminhtml.xml b/app/code/core/Mage/Checkout/etc/adminhtml.xml index a72062df07..e478d31ba3 100644 --- a/app/code/core/Mage/Checkout/etc/adminhtml.xml +++ b/app/code/core/Mage/Checkout/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Checkout/etc/api.xml b/app/code/core/Mage/Checkout/etc/api.xml index b22730f7ed..234f5d15ab 100644 --- a/app/code/core/Mage/Checkout/etc/api.xml +++ b/app/code/core/Mage/Checkout/etc/api.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Checkout/etc/config.xml b/app/code/core/Mage/Checkout/etc/config.xml index bc13fa2e1e..8a9d3cb063 100644 --- a/app/code/core/Mage/Checkout/etc/config.xml +++ b/app/code/core/Mage/Checkout/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Checkout/etc/jstranslator.xml b/app/code/core/Mage/Checkout/etc/jstranslator.xml new file mode 100644 index 0000000000..f1010de31f --- /dev/null +++ b/app/code/core/Mage/Checkout/etc/jstranslator.xml @@ -0,0 +1,46 @@ + + + + + + Please choose to register or to checkout as a guest + + + Your order cannot be completed at this time as there is no shipping methods available for it. Please make necessary changes in your shipping address. + + + Please specify shipping method. + + + Your order cannot be completed at this time as there is no payment methods available for it. + + + Please specify payment method. + + + diff --git a/app/code/core/Mage/Checkout/etc/system.xml b/app/code/core/Mage/Checkout/etc/system.xml index 801c2ec288..7741532857 100644 --- a/app/code/core/Mage/Checkout/etc/system.xml +++ b/app/code/core/Mage/Checkout/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Checkout/sql/checkout_setup/install-1.6.0.0.php b/app/code/core/Mage/Checkout/sql/checkout_setup/install-1.6.0.0.php index ec40ee36a5..9bc678bca0 100644 --- a/app/code/core/Mage/Checkout/sql/checkout_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Checkout/sql/checkout_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/sql/checkout_setup/mysql4-install-0.9.1.php b/app/code/core/Mage/Checkout/sql/checkout_setup/mysql4-install-0.9.1.php index 7d64ae39a9..e58093e170 100644 --- a/app/code/core/Mage/Checkout/sql/checkout_setup/mysql4-install-0.9.1.php +++ b/app/code/core/Mage/Checkout/sql/checkout_setup/mysql4-install-0.9.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/sql/checkout_setup/mysql4-upgrade-0.9.0-0.9.1.php b/app/code/core/Mage/Checkout/sql/checkout_setup/mysql4-upgrade-0.9.0-0.9.1.php index bbac85d661..341bae3a50 100644 --- a/app/code/core/Mage/Checkout/sql/checkout_setup/mysql4-upgrade-0.9.0-0.9.1.php +++ b/app/code/core/Mage/Checkout/sql/checkout_setup/mysql4-upgrade-0.9.0-0.9.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/sql/checkout_setup/mysql4-upgrade-0.9.1-0.9.2.php b/app/code/core/Mage/Checkout/sql/checkout_setup/mysql4-upgrade-0.9.1-0.9.2.php index b7ba6d3137..b8b848c52c 100644 --- a/app/code/core/Mage/Checkout/sql/checkout_setup/mysql4-upgrade-0.9.1-0.9.2.php +++ b/app/code/core/Mage/Checkout/sql/checkout_setup/mysql4-upgrade-0.9.1-0.9.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/sql/checkout_setup/mysql4-upgrade-0.9.2-0.9.3.php b/app/code/core/Mage/Checkout/sql/checkout_setup/mysql4-upgrade-0.9.2-0.9.3.php index 38b4208551..0cd6005d5b 100644 --- a/app/code/core/Mage/Checkout/sql/checkout_setup/mysql4-upgrade-0.9.2-0.9.3.php +++ b/app/code/core/Mage/Checkout/sql/checkout_setup/mysql4-upgrade-0.9.2-0.9.3.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/sql/checkout_setup/mysql4-upgrade-0.9.3-0.9.4.php b/app/code/core/Mage/Checkout/sql/checkout_setup/mysql4-upgrade-0.9.3-0.9.4.php index f77af8a259..cf0bc8fbef 100644 --- a/app/code/core/Mage/Checkout/sql/checkout_setup/mysql4-upgrade-0.9.3-0.9.4.php +++ b/app/code/core/Mage/Checkout/sql/checkout_setup/mysql4-upgrade-0.9.3-0.9.4.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/sql/checkout_setup/mysql4-upgrade-0.9.4-0.9.5.php b/app/code/core/Mage/Checkout/sql/checkout_setup/mysql4-upgrade-0.9.4-0.9.5.php index f016b98904..f21b30b535 100644 --- a/app/code/core/Mage/Checkout/sql/checkout_setup/mysql4-upgrade-0.9.4-0.9.5.php +++ b/app/code/core/Mage/Checkout/sql/checkout_setup/mysql4-upgrade-0.9.4-0.9.5.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/sql/checkout_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/Checkout/sql/checkout_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php index 577f3c17d1..189c63f22e 100644 --- a/app/code/core/Mage/Checkout/sql/checkout_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ b/app/code/core/Mage/Checkout/sql/checkout_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/Block/Block.php b/app/code/core/Mage/Cms/Block/Block.php index 520833edc4..4158562188 100644 --- a/app/code/core/Mage/Cms/Block/Block.php +++ b/app/code/core/Mage/Cms/Block/Block.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/Block/Page.php b/app/code/core/Mage/Cms/Block/Page.php index 5bc0c8bb50..b1efe4df2c 100644 --- a/app/code/core/Mage/Cms/Block/Page.php +++ b/app/code/core/Mage/Cms/Block/Page.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -98,7 +98,7 @@ protected function _toHtml() $helper = Mage::helper('cms'); $processor = $helper->getPageTemplateProcessor(); $html = $processor->filter($this->getPage()->getContent()); - $html = $this->getMessagesBlock()->getGroupedHtml() . $html; + $html = $this->getMessagesBlock()->toHtml() . $html; return $html; } } diff --git a/app/code/core/Mage/Cms/Block/Widget/Block.php b/app/code/core/Mage/Cms/Block/Widget/Block.php index f7d573e118..34e20c2da9 100644 --- a/app/code/core/Mage/Cms/Block/Widget/Block.php +++ b/app/code/core/Mage/Cms/Block/Widget/Block.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/Block/Widget/Page/Link.php b/app/code/core/Mage/Cms/Block/Widget/Page/Link.php index a7a299b20c..897ebb31be 100644 --- a/app/code/core/Mage/Cms/Block/Widget/Page/Link.php +++ b/app/code/core/Mage/Cms/Block/Widget/Page/Link.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/Controller/Router.php b/app/code/core/Mage/Cms/Controller/Router.php index 81ec6605dd..0fa18baf79 100644 --- a/app/code/core/Mage/Cms/Controller/Router.php +++ b/app/code/core/Mage/Cms/Controller/Router.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/Helper/Data.php b/app/code/core/Mage/Cms/Helper/Data.php index ac81ca9d54..1cc961b9c1 100644 --- a/app/code/core/Mage/Cms/Helper/Data.php +++ b/app/code/core/Mage/Cms/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/Helper/Page.php b/app/code/core/Mage/Cms/Helper/Page.php index 86f95dfd1f..2cb55f2b83 100644 --- a/app/code/core/Mage/Cms/Helper/Page.php +++ b/app/code/core/Mage/Cms/Helper/Page.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -123,10 +123,13 @@ protected function _renderPage(Mage_Core_Controller_Varien_Action $action, $pag ->applyTemplate($page->getRootTemplate()); } - foreach (array('catalog/session', 'checkout/session') as $class_name) { - $storage = Mage::getSingleton($class_name); + /* @TODO: Move catalog and checkout storage types to appropriate modules */ + $messageBlock = $action->getLayout()->getMessagesBlock(); + foreach (array('catalog/session', 'checkout/session', 'customer/session') as $storageType) { + $storage = Mage::getSingleton($storageType); if ($storage) { - $action->getLayout()->getMessagesBlock()->addMessages($storage->getMessages(true)); + $messageBlock->addStorageType($storageType); + $messageBlock->addMessages($storage->getMessages(true)); } } diff --git a/app/code/core/Mage/Cms/Helper/Wysiwyg/Images.php b/app/code/core/Mage/Cms/Helper/Wysiwyg/Images.php index 059f7b247d..84b154e40a 100644 --- a/app/code/core/Mage/Cms/Helper/Wysiwyg/Images.php +++ b/app/code/core/Mage/Cms/Helper/Wysiwyg/Images.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/Model/Block.php b/app/code/core/Mage/Cms/Model/Block.php index 2fe14d8930..0b95c36dfe 100644 --- a/app/code/core/Mage/Cms/Model/Block.php +++ b/app/code/core/Mage/Cms/Model/Block.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/Model/Mysql4/Block.php b/app/code/core/Mage/Cms/Model/Mysql4/Block.php index 49ad5f0f57..9b639b424a 100644 --- a/app/code/core/Mage/Cms/Model/Mysql4/Block.php +++ b/app/code/core/Mage/Cms/Model/Mysql4/Block.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/Model/Mysql4/Block/Collection.php b/app/code/core/Mage/Cms/Model/Mysql4/Block/Collection.php index a1eac20916..79222e9d7f 100644 --- a/app/code/core/Mage/Cms/Model/Mysql4/Block/Collection.php +++ b/app/code/core/Mage/Cms/Model/Mysql4/Block/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/Model/Mysql4/Page.php b/app/code/core/Mage/Cms/Model/Mysql4/Page.php index df01fb2d8d..a8a0236823 100644 --- a/app/code/core/Mage/Cms/Model/Mysql4/Page.php +++ b/app/code/core/Mage/Cms/Model/Mysql4/Page.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/Model/Mysql4/Page/Collection.php b/app/code/core/Mage/Cms/Model/Mysql4/Page/Collection.php index 62c515d565..79af149ecc 100644 --- a/app/code/core/Mage/Cms/Model/Mysql4/Page/Collection.php +++ b/app/code/core/Mage/Cms/Model/Mysql4/Page/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/Model/Mysql4/Page/Service.php b/app/code/core/Mage/Cms/Model/Mysql4/Page/Service.php index 96c4c933e7..ffd82bb0ff 100644 --- a/app/code/core/Mage/Cms/Model/Mysql4/Page/Service.php +++ b/app/code/core/Mage/Cms/Model/Mysql4/Page/Service.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/Model/Observer.php b/app/code/core/Mage/Cms/Model/Observer.php index a4e0bcc896..4a8ed4c981 100644 --- a/app/code/core/Mage/Cms/Model/Observer.php +++ b/app/code/core/Mage/Cms/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/Model/Page.php b/app/code/core/Mage/Cms/Model/Page.php index 9b22ff88bf..db70e75837 100644 --- a/app/code/core/Mage/Cms/Model/Page.php +++ b/app/code/core/Mage/Cms/Model/Page.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/Model/Resource/Block.php b/app/code/core/Mage/Cms/Model/Resource/Block.php index 8bcbccbaa1..0cea3b84fd 100755 --- a/app/code/core/Mage/Cms/Model/Resource/Block.php +++ b/app/code/core/Mage/Cms/Model/Resource/Block.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -148,6 +148,7 @@ protected function _afterLoad(Mage_Core_Model_Abstract $object) if ($object->getId()) { $stores = $this->lookupStoreIds($object->getId()); $object->setData('store_id', $stores); + $object->setData('stores', $stores); } return parent::_afterLoad($object); diff --git a/app/code/core/Mage/Cms/Model/Resource/Block/Collection.php b/app/code/core/Mage/Cms/Model/Resource/Block/Collection.php index 935003eeb6..05afb6cc37 100755 --- a/app/code/core/Mage/Cms/Model/Resource/Block/Collection.php +++ b/app/code/core/Mage/Cms/Model/Resource/Block/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/Model/Resource/Page.php b/app/code/core/Mage/Cms/Model/Resource/Page.php index 0018892e02..d2814500cd 100755 --- a/app/code/core/Mage/Cms/Model/Resource/Page.php +++ b/app/code/core/Mage/Cms/Model/Resource/Page.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/Model/Resource/Page/Collection.php b/app/code/core/Mage/Cms/Model/Resource/Page/Collection.php index df91c980d8..ff2ea2e41f 100755 --- a/app/code/core/Mage/Cms/Model/Resource/Page/Collection.php +++ b/app/code/core/Mage/Cms/Model/Resource/Page/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/Model/Resource/Page/Service.php b/app/code/core/Mage/Cms/Model/Resource/Page/Service.php index c98bc9fe3b..000488daff 100644 --- a/app/code/core/Mage/Cms/Model/Resource/Page/Service.php +++ b/app/code/core/Mage/Cms/Model/Resource/Page/Service.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/Model/Template/Filter.php b/app/code/core/Mage/Cms/Model/Template/Filter.php index fd007a6dde..5afef1756f 100644 --- a/app/code/core/Mage/Cms/Model/Template/Filter.php +++ b/app/code/core/Mage/Cms/Model/Template/Filter.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/Model/Wysiwyg/Config.php b/app/code/core/Mage/Cms/Model/Wysiwyg/Config.php index 6ec3c19409..2b703d049f 100644 --- a/app/code/core/Mage/Cms/Model/Wysiwyg/Config.php +++ b/app/code/core/Mage/Cms/Model/Wysiwyg/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/Model/Wysiwyg/Images/Storage.php b/app/code/core/Mage/Cms/Model/Wysiwyg/Images/Storage.php index 8d7192fc50..a8f0c52c16 100644 --- a/app/code/core/Mage/Cms/Model/Wysiwyg/Images/Storage.php +++ b/app/code/core/Mage/Cms/Model/Wysiwyg/Images/Storage.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/Model/Wysiwyg/Images/Storage/Collection.php b/app/code/core/Mage/Cms/Model/Wysiwyg/Images/Storage/Collection.php index 55dd63109c..52ac19a20d 100644 --- a/app/code/core/Mage/Cms/Model/Wysiwyg/Images/Storage/Collection.php +++ b/app/code/core/Mage/Cms/Model/Wysiwyg/Images/Storage/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/controllers/IndexController.php b/app/code/core/Mage/Cms/controllers/IndexController.php index d75678b2f0..b0eaa72c39 100644 --- a/app/code/core/Mage/Cms/controllers/IndexController.php +++ b/app/code/core/Mage/Cms/controllers/IndexController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/controllers/PageController.php b/app/code/core/Mage/Cms/controllers/PageController.php index 06a2a71d8a..48d9b7da04 100644 --- a/app/code/core/Mage/Cms/controllers/PageController.php +++ b/app/code/core/Mage/Cms/controllers/PageController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/data/cms_setup/data-install-1.6.0.0.php b/app/code/core/Mage/Cms/data/cms_setup/data-install-1.6.0.0.php index 64e62ae649..92c2512848 100644 --- a/app/code/core/Mage/Cms/data/cms_setup/data-install-1.6.0.0.php +++ b/app/code/core/Mage/Cms/data/cms_setup/data-install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/data/cms_setup/data-upgrade-1.6.0.0.0-1.6.0.0.1.php b/app/code/core/Mage/Cms/data/cms_setup/data-upgrade-1.6.0.0.0-1.6.0.0.1.php new file mode 100644 index 0000000000..7e105285c3 --- /dev/null +++ b/app/code/core/Mage/Cms/data/cms_setup/data-upgrade-1.6.0.0.0-1.6.0.0.1.php @@ -0,0 +1,270 @@ + + + Please replace this text with you Privacy Policy. + Please add any additional cookies your website uses below (e.g., Google Analytics) + +

    +

    + This privacy policy sets out how {{config path="general/store_information/name"}} uses and protects any information + that you give {{config path="general/store_information/name"}} when you use this website. + {{config path="general/store_information/name"}} is committed to ensuring that your privacy is protected. + Should we ask you to provide certain information by which you can be identified when using this website, + then you can be assured that it will only be used in accordance with this privacy statement. + {{config path="general/store_information/name"}} may change this policy from time to time by updating this page. + You should check this page from time to time to ensure that you are happy with any changes. +

    +

    What we collect

    +

    We may collect the following information:

    +
      +
    • name
    • +
    • contact information including email address
    • +
    • demographic information such as postcode, preferences and interests
    • +
    • other information relevant to customer surveys and/or offers
    • +
    +

    + For the exhaustive list of cookies we collect see the List of cookies we collect section. +

    +

    What we do with the information we gather

    +

    + We require this information to understand your needs and provide you with a better service, + and in particular for the following reasons: +

    +
      +
    • Internal record keeping.
    • +
    • We may use the information to improve our products and services.
    • +
    • + We may periodically send promotional emails about new products, special offers or other information which we + think you may find interesting using the email address which you have provided. +
    • +
    • + From time to time, we may also use your information to contact you for market research purposes. + We may contact you by email, phone, fax or mail. We may use the information to customise the website + according to your interests. +
    • +
    +

    Security

    +

    + We are committed to ensuring that your information is secure. In order to prevent unauthorised access or disclosure, + we have put in place suitable physical, electronic and managerial procedures to safeguard and secure + the information we collect online. +

    +

    How we use cookies

    +

    + A cookie is a small file which asks permission to be placed on your computer's hard drive. + Once you agree, the file is added and the cookie helps analyse web traffic or lets you know when you visit + a particular site. Cookies allow web applications to respond to you as an individual. The web application + can tailor its operations to your needs, likes and dislikes by gathering and remembering information about + your preferences. +

    +

    + We use traffic log cookies to identify which pages are being used. This helps us analyse data about web page traffic + and improve our website in order to tailor it to customer needs. We only use this information for statistical + analysis purposes and then the data is removed from the system. +

    +

    + Overall, cookies help us provide you with a better website, by enabling us to monitor which pages you find useful + and which you do not. A cookie in no way gives us access to your computer or any information about you, + other than the data you choose to share with us. You can choose to accept or decline cookies. + Most web browsers automatically accept cookies, but you can usually modify your browser setting + to decline cookies if you prefer. This may prevent you from taking full advantage of the website. +

    +

    Links to other websites

    +

    + Our website may contain links to other websites of interest. However, once you have used these links + to leave our site, you should note that we do not have any control over that other website. + Therefore, we cannot be responsible for the protection and privacy of any information which you provide whilst + visiting such sites and such sites are not governed by this privacy statement. + You should exercise caution and look at the privacy statement applicable to the website in question. +

    +

    Controlling your personal information

    +

    You may choose to restrict the collection or use of your personal information in the following ways:

    +
      +
    • + whenever you are asked to fill in a form on the website, look for the box that you can click to indicate + that you do not want the information to be used by anybody for direct marketing purposes +
    • +
    • + if you have previously agreed to us using your personal information for direct marketing purposes, + you may change your mind at any time by writing to or emailing us at + {{config path="trans_email/ident_general/email"}} +
    • +
    +

    + We will not sell, distribute or lease your personal information to third parties unless we have your permission + or are required by law to do so. We may use your personal information to send you promotional information + about third parties which we think you may find interesting if you tell us that you wish this to happen. +

    +

    + You may request details of personal information which we hold about you under the Data Protection Act 1998. + A small fee will be payable. If you would like a copy of the information held on you please write to + {{config path="general/store_information/address"}}. +

    +

    + If you believe that any information we are holding on you is incorrect or incomplete, + please write to or email us as soon as possible, at the above address. + We will promptly correct any information found to be incorrect. +

    +

    List of cookies we collect

    +

    The table below lists the cookies we collect and what information they store.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    COOKIE nameCOOKIE Description
    CARTThe association with your shopping cart.
    CATEGORY_INFO
    COMPAREThe items that you have in the Compare Products list.
    CURRENCYYour preferred currency
    CUSTOMERAn encrypted version of your customer id with the store.
    CUSTOMER_AUTHAn indicator if you are currently logged into the store.
    CUSTOMER_INFOAn encrypted version of the customer group you belong to.
    EXTERNAL_NO_CACHE
    FRONTENDYou sesssion ID on the server.
    GUEST-VIEW
    LAST_CATEGORYThe last category you visited.
    LAST_PRODUCTThe most recent product you have viewed.
    NEWMESSAGE
    NO_CACHE
    PERSISTENT_SHOPPING_CARTA link to information about your cart and viewing history if you have asked the site.
    POLLThe ID of any polls you have recently voted in.
    POLLNInformation on what polls you have voted on.
    RECENTLYCOMPAREDThe items that you have recently compared.
    STFInformation on products you have emailed to friends.
    STOREThe store view or language you have selected.
    USER_ALLOWED_SAVE_COOKIEIndicates whether a customer allowed to use cookies.
    VIEWED_PRODUCT_IDSThe products that you have recently viewed.
    WISHLISTAn encrypted list of products added to your Wishlist.
    WISHLIST_CNTThe number of items in your Wishlist.
    +EOD; + +$privacyPageData = array( + 'title' => 'Privacy Policy', + 'content_heading' => 'Privacy Policy', + 'root_template' => 'one_column', + 'identifier' => 'privacy-policy-cookie-restriction-mode', + 'content' => $pageContent, + 'is_active' => 1, + 'stores' => array(0), + 'sort_order' => 0 +); + +Mage::getModel('cms/page')->setData($privacyPageData)->save(); + +$footerLinksBlock = Mage::getModel('cms/block')->load('footer_links','identifier'); + +if ($footerLinksBlock->getId()) { + $content = $footerLinksBlock->getContent(); + if (preg_match('/
      (.*?)<\\/ul>/ims',$content, $matches)) { + $content = preg_replace('/
    • /ims', '
    • ',$content); + $replacment = '
    • ' + . "" + . "Privacy Policy
    • \r\n
    "; + $content = preg_replace('/<\\/ul>/ims', $replacment, $content); + $footerLinksBlock->setContent($content)->save(); + } +} diff --git a/app/code/core/Mage/Cms/etc/adminhtml.xml b/app/code/core/Mage/Cms/etc/adminhtml.xml index 69ab09b9ef..57673a7ae3 100644 --- a/app/code/core/Mage/Cms/etc/adminhtml.xml +++ b/app/code/core/Mage/Cms/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Cms/etc/config.xml b/app/code/core/Mage/Cms/etc/config.xml index 6e39c5b5a7..f8264af1af 100644 --- a/app/code/core/Mage/Cms/etc/config.xml +++ b/app/code/core/Mage/Cms/etc/config.xml @@ -21,14 +21,14 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> - 1.6.0.0 + 1.6.0.0.1 diff --git a/app/code/core/Mage/Cms/etc/system.xml b/app/code/core/Mage/Cms/etc/system.xml index 3676f291e4..e673ef2826 100644 --- a/app/code/core/Mage/Cms/etc/system.xml +++ b/app/code/core/Mage/Cms/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Cms/etc/widget.xml b/app/code/core/Mage/Cms/etc/widget.xml index 052257312f..56653fee3a 100644 --- a/app/code/core/Mage/Cms/etc/widget.xml +++ b/app/code/core/Mage/Cms/etc/widget.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Cms/sql/cms_setup/install-1.6.0.0.php b/app/code/core/Mage/Cms/sql/cms_setup/install-1.6.0.0.php index b9829ca711..292b11788a 100644 --- a/app/code/core/Mage/Cms/sql/cms_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Cms/sql/cms_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/sql/cms_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/Cms/sql/cms_setup/mysql4-install-0.7.0.php index db09bcc880..1aaf747882 100644 --- a/app/code/core/Mage/Cms/sql/cms_setup/mysql4-install-0.7.0.php +++ b/app/code/core/Mage/Cms/sql/cms_setup/mysql4-install-0.7.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/sql/cms_setup/mysql4-upgrade-0.7.0-0.7.1.php b/app/code/core/Mage/Cms/sql/cms_setup/mysql4-upgrade-0.7.0-0.7.1.php index 534109a608..2f9a53a10f 100644 --- a/app/code/core/Mage/Cms/sql/cms_setup/mysql4-upgrade-0.7.0-0.7.1.php +++ b/app/code/core/Mage/Cms/sql/cms_setup/mysql4-upgrade-0.7.0-0.7.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/sql/cms_setup/mysql4-upgrade-0.7.1-0.7.2.php b/app/code/core/Mage/Cms/sql/cms_setup/mysql4-upgrade-0.7.1-0.7.2.php index a49fb199a4..e9934d29da 100644 --- a/app/code/core/Mage/Cms/sql/cms_setup/mysql4-upgrade-0.7.1-0.7.2.php +++ b/app/code/core/Mage/Cms/sql/cms_setup/mysql4-upgrade-0.7.1-0.7.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/sql/cms_setup/mysql4-upgrade-0.7.10-0.7.11.php b/app/code/core/Mage/Cms/sql/cms_setup/mysql4-upgrade-0.7.10-0.7.11.php index b72bd4c576..6490b42255 100644 --- a/app/code/core/Mage/Cms/sql/cms_setup/mysql4-upgrade-0.7.10-0.7.11.php +++ b/app/code/core/Mage/Cms/sql/cms_setup/mysql4-upgrade-0.7.10-0.7.11.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/sql/cms_setup/mysql4-upgrade-0.7.11-0.7.12.php b/app/code/core/Mage/Cms/sql/cms_setup/mysql4-upgrade-0.7.11-0.7.12.php index 0f09c539a4..7962536ac5 100644 --- a/app/code/core/Mage/Cms/sql/cms_setup/mysql4-upgrade-0.7.11-0.7.12.php +++ b/app/code/core/Mage/Cms/sql/cms_setup/mysql4-upgrade-0.7.11-0.7.12.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/sql/cms_setup/mysql4-upgrade-0.7.12-0.7.13.php b/app/code/core/Mage/Cms/sql/cms_setup/mysql4-upgrade-0.7.12-0.7.13.php index 94407ab8e7..2213dd5aec 100644 --- a/app/code/core/Mage/Cms/sql/cms_setup/mysql4-upgrade-0.7.12-0.7.13.php +++ b/app/code/core/Mage/Cms/sql/cms_setup/mysql4-upgrade-0.7.12-0.7.13.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/sql/cms_setup/mysql4-upgrade-0.7.2-0.7.3.php b/app/code/core/Mage/Cms/sql/cms_setup/mysql4-upgrade-0.7.2-0.7.3.php index ad78ec7157..03a713730a 100644 --- a/app/code/core/Mage/Cms/sql/cms_setup/mysql4-upgrade-0.7.2-0.7.3.php +++ b/app/code/core/Mage/Cms/sql/cms_setup/mysql4-upgrade-0.7.2-0.7.3.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/sql/cms_setup/mysql4-upgrade-0.7.4-0.7.5.php b/app/code/core/Mage/Cms/sql/cms_setup/mysql4-upgrade-0.7.4-0.7.5.php index 62c8efab6d..832c36305f 100644 --- a/app/code/core/Mage/Cms/sql/cms_setup/mysql4-upgrade-0.7.4-0.7.5.php +++ b/app/code/core/Mage/Cms/sql/cms_setup/mysql4-upgrade-0.7.4-0.7.5.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/sql/cms_setup/mysql4-upgrade-0.7.5-0.7.6.php b/app/code/core/Mage/Cms/sql/cms_setup/mysql4-upgrade-0.7.5-0.7.6.php index 0c614fdb16..5481e79054 100644 --- a/app/code/core/Mage/Cms/sql/cms_setup/mysql4-upgrade-0.7.5-0.7.6.php +++ b/app/code/core/Mage/Cms/sql/cms_setup/mysql4-upgrade-0.7.5-0.7.6.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/sql/cms_setup/mysql4-upgrade-0.7.7-0.7.8.php b/app/code/core/Mage/Cms/sql/cms_setup/mysql4-upgrade-0.7.7-0.7.8.php index 644fef0403..3013a38dcf 100644 --- a/app/code/core/Mage/Cms/sql/cms_setup/mysql4-upgrade-0.7.7-0.7.8.php +++ b/app/code/core/Mage/Cms/sql/cms_setup/mysql4-upgrade-0.7.7-0.7.8.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/sql/cms_setup/mysql4-upgrade-0.7.8-0.7.9.php b/app/code/core/Mage/Cms/sql/cms_setup/mysql4-upgrade-0.7.8-0.7.9.php index 39957cf46b..0e3fe5d739 100644 --- a/app/code/core/Mage/Cms/sql/cms_setup/mysql4-upgrade-0.7.8-0.7.9.php +++ b/app/code/core/Mage/Cms/sql/cms_setup/mysql4-upgrade-0.7.8-0.7.9.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/sql/cms_setup/mysql4-upgrade-0.7.9-0.7.10.php b/app/code/core/Mage/Cms/sql/cms_setup/mysql4-upgrade-0.7.9-0.7.10.php index 486d6a01b8..53be8fd42f 100644 --- a/app/code/core/Mage/Cms/sql/cms_setup/mysql4-upgrade-0.7.9-0.7.10.php +++ b/app/code/core/Mage/Cms/sql/cms_setup/mysql4-upgrade-0.7.9-0.7.10.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/sql/cms_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/Cms/sql/cms_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php index ad06b5c2ad..a3dfb7568c 100644 --- a/app/code/core/Mage/Cms/sql/cms_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ b/app/code/core/Mage/Cms/sql/cms_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Compiler/Block/Process.php b/app/code/core/Mage/Compiler/Block/Process.php index faeb627cc5..d0336e8f75 100644 --- a/app/code/core/Mage/Compiler/Block/Process.php +++ b/app/code/core/Mage/Compiler/Block/Process.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Compiler - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Compiler/Helper/Data.php b/app/code/core/Mage/Compiler/Helper/Data.php index 0a4fc144b2..8c74c9d0a3 100644 --- a/app/code/core/Mage/Compiler/Helper/Data.php +++ b/app/code/core/Mage/Compiler/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Compiler - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Compiler/Model/Process.php b/app/code/core/Mage/Compiler/Model/Process.php index 115b082a9a..bd40e40457 100644 --- a/app/code/core/Mage/Compiler/Model/Process.php +++ b/app/code/core/Mage/Compiler/Model/Process.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Compiler - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Compiler/controllers/Adminhtml/Compiler/ProcessController.php b/app/code/core/Mage/Compiler/controllers/Adminhtml/Compiler/ProcessController.php index 4e0668522f..f1c37b7f71 100644 --- a/app/code/core/Mage/Compiler/controllers/Adminhtml/Compiler/ProcessController.php +++ b/app/code/core/Mage/Compiler/controllers/Adminhtml/Compiler/ProcessController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Compiler - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Compiler/controllers/ProcessController.php b/app/code/core/Mage/Compiler/controllers/ProcessController.php index c2cb487b92..0dbaf34fbd 100644 --- a/app/code/core/Mage/Compiler/controllers/ProcessController.php +++ b/app/code/core/Mage/Compiler/controllers/ProcessController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Compiler - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Compiler/etc/adminhtml.xml b/app/code/core/Mage/Compiler/etc/adminhtml.xml index 53b41a871a..9ee10bff9e 100644 --- a/app/code/core/Mage/Compiler/etc/adminhtml.xml +++ b/app/code/core/Mage/Compiler/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Compiler - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Compiler/etc/compilation.xml b/app/code/core/Mage/Compiler/etc/compilation.xml index c827e32db8..f5b2130b1d 100644 --- a/app/code/core/Mage/Compiler/etc/compilation.xml +++ b/app/code/core/Mage/Compiler/etc/compilation.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Compiler - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -345,7 +345,11 @@ + + + + diff --git a/app/code/core/Mage/Compiler/etc/config.xml b/app/code/core/Mage/Compiler/etc/config.xml index 0f373f960a..f792c049b0 100644 --- a/app/code/core/Mage/Compiler/etc/config.xml +++ b/app/code/core/Mage/Compiler/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Compiler - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit.php b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit.php index 76cb1bd0f5..a8fd03e90a 100644 --- a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit.php +++ b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Form.php b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Form.php index 0e796385ca..a05c44e988 100644 --- a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Form.php +++ b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Abstract.php b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Abstract.php index a87c0f4cdc..42a1ba46e0 100644 --- a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Abstract.php +++ b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Authors.php b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Authors.php index 295574deac..d79395c2f8 100644 --- a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Authors.php +++ b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Authors.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Contents.php b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Contents.php index 09f17d137e..42b5ee5a8a 100644 --- a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Contents.php +++ b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Contents.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Depends.php b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Depends.php index 25aaf8a622..eac5bdf0cf 100644 --- a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Depends.php +++ b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Depends.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Grid.php b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Grid.php index a04ca442db..0461f2be8a 100644 --- a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Grid.php +++ b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Load.php b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Load.php index 3e25084ee1..aa8091a115 100644 --- a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Load.php +++ b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Load.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Local.php b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Local.php index 8b55025b8d..f254b18bc0 100644 --- a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Local.php +++ b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Local.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Package.php b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Package.php index 6dd69dbd94..75843423cd 100644 --- a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Package.php +++ b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Package.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Release.php b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Release.php index 2ca6f32615..7b690bd6fb 100644 --- a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Release.php +++ b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Release.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tabs.php b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tabs.php index efc8f024af..0c78e86236 100644 --- a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tabs.php +++ b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tabs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Connect/Helper/Data.php b/app/code/core/Mage/Connect/Helper/Data.php index b1c87b0a90..4a76237f30 100644 --- a/app/code/core/Mage/Connect/Helper/Data.php +++ b/app/code/core/Mage/Connect/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Connect/Model/Extension.php b/app/code/core/Mage/Connect/Model/Extension.php index f5a8750771..dfea04ad36 100644 --- a/app/code/core/Mage/Connect/Model/Extension.php +++ b/app/code/core/Mage/Connect/Model/Extension.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Connect/Model/Extension/Collection.php b/app/code/core/Mage/Connect/Model/Extension/Collection.php index 235742cc71..c1c6994827 100644 --- a/app/code/core/Mage/Connect/Model/Extension/Collection.php +++ b/app/code/core/Mage/Connect/Model/Extension/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Connect/Model/Session.php b/app/code/core/Mage/Connect/Model/Session.php index bcad40adf9..e6fc8acc45 100644 --- a/app/code/core/Mage/Connect/Model/Session.php +++ b/app/code/core/Mage/Connect/Model/Session.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Connect/controllers/Adminhtml/Extension/CustomController.php b/app/code/core/Mage/Connect/controllers/Adminhtml/Extension/CustomController.php index 897dc6b01b..d44f79f3ea 100644 --- a/app/code/core/Mage/Connect/controllers/Adminhtml/Extension/CustomController.php +++ b/app/code/core/Mage/Connect/controllers/Adminhtml/Extension/CustomController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Connect/controllers/Adminhtml/Extension/LocalController.php b/app/code/core/Mage/Connect/controllers/Adminhtml/Extension/LocalController.php index 50ae9e8154..9c38e0bf7b 100644 --- a/app/code/core/Mage/Connect/controllers/Adminhtml/Extension/LocalController.php +++ b/app/code/core/Mage/Connect/controllers/Adminhtml/Extension/LocalController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Connect/etc/adminhtml.xml b/app/code/core/Mage/Connect/etc/adminhtml.xml index 682f948889..c8c05cb5b7 100644 --- a/app/code/core/Mage/Connect/etc/adminhtml.xml +++ b/app/code/core/Mage/Connect/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Connect/etc/config.xml b/app/code/core/Mage/Connect/etc/config.xml index 7f4eb4df5b..170e645663 100644 --- a/app/code/core/Mage/Connect/etc/config.xml +++ b/app/code/core/Mage/Connect/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Contacts/Helper/Data.php b/app/code/core/Mage/Contacts/Helper/Data.php index a82a16b246..d56162c179 100644 --- a/app/code/core/Mage/Contacts/Helper/Data.php +++ b/app/code/core/Mage/Contacts/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Contacts - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Contacts/Model/System/Config/Backend/Links.php b/app/code/core/Mage/Contacts/Model/System/Config/Backend/Links.php index 0cfd7d6885..b4a5bb9531 100644 --- a/app/code/core/Mage/Contacts/Model/System/Config/Backend/Links.php +++ b/app/code/core/Mage/Contacts/Model/System/Config/Backend/Links.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Contacts - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Contacts/controllers/IndexController.php b/app/code/core/Mage/Contacts/controllers/IndexController.php index da8d843eba..3bc34f6a10 100644 --- a/app/code/core/Mage/Contacts/controllers/IndexController.php +++ b/app/code/core/Mage/Contacts/controllers/IndexController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Contacts - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Contacts/etc/adminhtml.xml b/app/code/core/Mage/Contacts/etc/adminhtml.xml index 955faea4cc..904dc82dd4 100644 --- a/app/code/core/Mage/Contacts/etc/adminhtml.xml +++ b/app/code/core/Mage/Contacts/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Contacts - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Contacts/etc/config.xml b/app/code/core/Mage/Contacts/etc/config.xml index 3a50119f91..438441768d 100644 --- a/app/code/core/Mage/Contacts/etc/config.xml +++ b/app/code/core/Mage/Contacts/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Contacts - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Contacts/etc/system.xml b/app/code/core/Mage/Contacts/etc/system.xml index 6141f80624..6d5fdf4f8f 100644 --- a/app/code/core/Mage/Contacts/etc/system.xml +++ b/app/code/core/Mage/Contacts/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Contacts - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Contacts/sql/contacts_setup/install-1.6.0.0.php b/app/code/core/Mage/Contacts/sql/contacts_setup/install-1.6.0.0.php index 2061c93042..787d439900 100644 --- a/app/code/core/Mage/Contacts/sql/contacts_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Contacts/sql/contacts_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Contacts - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Contacts/sql/contacts_setup/mysql4-install-0.7.1.php b/app/code/core/Mage/Contacts/sql/contacts_setup/mysql4-install-0.7.1.php index 55a19a37ec..a4ae2a37bb 100644 --- a/app/code/core/Mage/Contacts/sql/contacts_setup/mysql4-install-0.7.1.php +++ b/app/code/core/Mage/Contacts/sql/contacts_setup/mysql4-install-0.7.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Contacts - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Contacts/sql/contacts_setup/mysql4-install-0.8.0.php b/app/code/core/Mage/Contacts/sql/contacts_setup/mysql4-install-0.8.0.php index a205d61317..1deada5383 100644 --- a/app/code/core/Mage/Contacts/sql/contacts_setup/mysql4-install-0.8.0.php +++ b/app/code/core/Mage/Contacts/sql/contacts_setup/mysql4-install-0.8.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Contacts - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Contacts/sql/contacts_setup/mysql4-upgrade-0.7.1-0.7.2.php b/app/code/core/Mage/Contacts/sql/contacts_setup/mysql4-upgrade-0.7.1-0.7.2.php index 8ce115a053..35095cfbe1 100644 --- a/app/code/core/Mage/Contacts/sql/contacts_setup/mysql4-upgrade-0.7.1-0.7.2.php +++ b/app/code/core/Mage/Contacts/sql/contacts_setup/mysql4-upgrade-0.7.1-0.7.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Contacts - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Block/Abstract.php b/app/code/core/Mage/Core/Block/Abstract.php index b63148b3fa..dc92040a1d 100644 --- a/app/code/core/Mage/Core/Block/Abstract.php +++ b/app/code/core/Mage/Core/Block/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -419,11 +419,11 @@ public function setChild($alias, $block) public function unsetChild($alias) { if (isset($this->_children[$alias])) { + /** @var Mage_Core_Block_Abstract $block */ + $block = $this->_children[$alias]; + $name = $block->getNameInLayout(); unset($this->_children[$alias]); - } - - if (!empty($this->_sortedChildren)) { - $key = array_search($alias, $this->_sortedChildren); + $key = array_search($name, $this->_sortedChildren); if ($key !== false) { unset($this->_sortedChildren[$key]); } diff --git a/app/code/core/Mage/Core/Block/Flush.php b/app/code/core/Mage/Core/Block/Flush.php index 542bda3cf5..66d3fe800c 100644 --- a/app/code/core/Mage/Core/Block/Flush.php +++ b/app/code/core/Mage/Core/Block/Flush.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Block/Html/Calendar.php b/app/code/core/Mage/Core/Block/Html/Calendar.php index 8f0d6d695d..7515697b31 100644 --- a/app/code/core/Mage/Core/Block/Html/Calendar.php +++ b/app/code/core/Mage/Core/Block/Html/Calendar.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Block/Html/Date.php b/app/code/core/Mage/Core/Block/Html/Date.php index 0cbe48776d..86478afd52 100644 --- a/app/code/core/Mage/Core/Block/Html/Date.php +++ b/app/code/core/Mage/Core/Block/Html/Date.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Block/Html/Link.php b/app/code/core/Mage/Core/Block/Html/Link.php index d9744f87aa..5cac033c29 100644 --- a/app/code/core/Mage/Core/Block/Html/Link.php +++ b/app/code/core/Mage/Core/Block/Html/Link.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Block/Html/Select.php b/app/code/core/Mage/Core/Block/Html/Select.php index 5e57f5a337..d848348fca 100644 --- a/app/code/core/Mage/Core/Block/Html/Select.php +++ b/app/code/core/Mage/Core/Block/Html/Select.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Block/Messages.php b/app/code/core/Mage/Core/Block/Messages.php index 68c00662b1..b3feda3d35 100644 --- a/app/code/core/Mage/Core/Block/Messages.php +++ b/app/code/core/Mage/Core/Block/Messages.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Block/Profiler.php b/app/code/core/Mage/Core/Block/Profiler.php index 1238ec8781..02f0b66955 100644 --- a/app/code/core/Mage/Core/Block/Profiler.php +++ b/app/code/core/Mage/Core/Block/Profiler.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Block/Store/Switcher.php b/app/code/core/Mage/Core/Block/Store/Switcher.php index 1254e18161..9adaac9d85 100644 --- a/app/code/core/Mage/Core/Block/Store/Switcher.php +++ b/app/code/core/Mage/Core/Block/Store/Switcher.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Block/Template.php b/app/code/core/Mage/Core/Block/Template.php index d0d1d626a1..d684e3fb05 100644 --- a/app/code/core/Mage/Core/Block/Template.php +++ b/app/code/core/Mage/Core/Block/Template.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Block/Template/Facade.php b/app/code/core/Mage/Core/Block/Template/Facade.php index edb432b211..62a5f3ff45 100644 --- a/app/code/core/Mage/Core/Block/Template/Facade.php +++ b/app/code/core/Mage/Core/Block/Template/Facade.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Block/Template/Smarty.php b/app/code/core/Mage/Core/Block/Template/Smarty.php index e79f94abac..25ad728896 100644 --- a/app/code/core/Mage/Core/Block/Template/Smarty.php +++ b/app/code/core/Mage/Core/Block/Template/Smarty.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Block/Template/Zend.php b/app/code/core/Mage/Core/Block/Template/Zend.php index 01caa23d39..ee24aa8ff6 100644 --- a/app/code/core/Mage/Core/Block/Template/Zend.php +++ b/app/code/core/Mage/Core/Block/Template/Zend.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Block/Text.php b/app/code/core/Mage/Core/Block/Text.php index 2d54b827f0..3f96583db5 100644 --- a/app/code/core/Mage/Core/Block/Text.php +++ b/app/code/core/Mage/Core/Block/Text.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Block/Text/List.php b/app/code/core/Mage/Core/Block/Text/List.php index 60e33f2d80..f0c286f703 100644 --- a/app/code/core/Mage/Core/Block/Text/List.php +++ b/app/code/core/Mage/Core/Block/Text/List.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Block/Text/List/Item.php b/app/code/core/Mage/Core/Block/Text/List/Item.php index 6923b8aee2..2c511542a0 100644 --- a/app/code/core/Mage/Core/Block/Text/List/Item.php +++ b/app/code/core/Mage/Core/Block/Text/List/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Block/Text/List/Link.php b/app/code/core/Mage/Core/Block/Text/List/Link.php index e269121883..e019907f7a 100644 --- a/app/code/core/Mage/Core/Block/Text/List/Link.php +++ b/app/code/core/Mage/Core/Block/Text/List/Link.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Block/Text/Tag.php b/app/code/core/Mage/Core/Block/Text/Tag.php index ec8708cf10..2daec2a155 100644 --- a/app/code/core/Mage/Core/Block/Text/Tag.php +++ b/app/code/core/Mage/Core/Block/Text/Tag.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Block/Text/Tag/Css.php b/app/code/core/Mage/Core/Block/Text/Tag/Css.php index 3469836773..5635775d3d 100644 --- a/app/code/core/Mage/Core/Block/Text/Tag/Css.php +++ b/app/code/core/Mage/Core/Block/Text/Tag/Css.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Block/Text/Tag/Css/Admin.php b/app/code/core/Mage/Core/Block/Text/Tag/Css/Admin.php index bb4bb2b14d..cd56e19416 100644 --- a/app/code/core/Mage/Core/Block/Text/Tag/Css/Admin.php +++ b/app/code/core/Mage/Core/Block/Text/Tag/Css/Admin.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Block/Text/Tag/Debug.php b/app/code/core/Mage/Core/Block/Text/Tag/Debug.php index 5fe04cdbdf..e27f86ef13 100644 --- a/app/code/core/Mage/Core/Block/Text/Tag/Debug.php +++ b/app/code/core/Mage/Core/Block/Text/Tag/Debug.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Block/Text/Tag/Js.php b/app/code/core/Mage/Core/Block/Text/Tag/Js.php index 927f829a55..ec9b4091fc 100644 --- a/app/code/core/Mage/Core/Block/Text/Tag/Js.php +++ b/app/code/core/Mage/Core/Block/Text/Tag/Js.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Block/Text/Tag/Meta.php b/app/code/core/Mage/Core/Block/Text/Tag/Meta.php index 90b1eb53b1..9bb3d10fbb 100644 --- a/app/code/core/Mage/Core/Block/Text/Tag/Meta.php +++ b/app/code/core/Mage/Core/Block/Text/Tag/Meta.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Controller/Front/Action.php b/app/code/core/Mage/Core/Controller/Front/Action.php old mode 100644 new mode 100755 index 50dcdfedbb..ba615ccb18 --- a/app/code/core/Mage/Core/Controller/Front/Action.php +++ b/app/code/core/Mage/Core/Controller/Front/Action.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -33,6 +33,11 @@ */ class Mage_Core_Controller_Front_Action extends Mage_Core_Controller_Varien_Action { + /** + * Session namespace to refer in other places + */ + const SESSION_NAMESPACE = 'frontend'; + /** * Currently used area * @@ -45,10 +50,10 @@ class Mage_Core_Controller_Front_Action extends Mage_Core_Controller_Varien_Acti * * @var string */ - protected $_sessionNamespace = 'frontend'; + protected $_sessionNamespace = self::SESSION_NAMESPACE; /** - * Predispatch: shoud set layout area + * Predispatch: should set layout area * * @return Mage_Core_Controller_Front_Action */ @@ -88,7 +93,7 @@ public function __() } /** - * Declare headers and content file in responce for file download + * Declare headers and content file in response for file download * * @param string $fileName * @param string|array $content set to null to avoid starting output, $contentLength should be set explicitly in @@ -146,6 +151,8 @@ protected function _prepareDownloadResponse($fileName, $content, $contentType = if (!empty($content['rm'])) { $ioAdapter->rm($file); } + + exit(0); } else { $this->getResponse()->setBody($content); } diff --git a/app/code/core/Mage/Core/Controller/Front/Router.php b/app/code/core/Mage/Core/Controller/Front/Router.php index a47551b1a4..8625f59269 100644 --- a/app/code/core/Mage/Core/Controller/Front/Router.php +++ b/app/code/core/Mage/Core/Controller/Front/Router.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Controller/Request/Http.php b/app/code/core/Mage/Core/Controller/Request/Http.php index d8680479ad..efdaecb156 100644 --- a/app/code/core/Mage/Core/Controller/Request/Http.php +++ b/app/code/core/Mage/Core/Controller/Request/Http.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Controller/Response/Http.php b/app/code/core/Mage/Core/Controller/Response/Http.php index 0add065959..db9796e9c2 100644 --- a/app/code/core/Mage/Core/Controller/Response/Http.php +++ b/app/code/core/Mage/Core/Controller/Response/Http.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -44,6 +44,7 @@ class Mage_Core_Controller_Response_Http extends Zend_Controller_Response_Http * * @link http://bugs.php.net/bug.php?id=36705 * + * @return Mage_Core_Controller_Response_Http */ public function sendHeaders() { @@ -73,7 +74,7 @@ public function sendHeaders() } } } - parent::sendHeaders(); + return parent::sendHeaders(); } public function sendResponse() diff --git a/app/code/core/Mage/Core/Controller/Varien/Action.php b/app/code/core/Mage/Core/Controller/Varien/Action.php old mode 100644 new mode 100755 index ff21e8be0b..648b646b14 --- a/app/code/core/Mage/Core/Controller/Varien/Action.php +++ b/app/code/core/Mage/Core/Controller/Varien/Action.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -1029,9 +1029,9 @@ protected function _prepareDownloadResponse( ->setHeader('Pragma', 'public', true) ->setHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0', true) ->setHeader('Content-type', $contentType, true) - ->setHeader('Content-Length', is_null($contentLength) ? strlen($content) : $contentLength) - ->setHeader('Content-Disposition', 'attachment; filename="'.$fileName.'"') - ->setHeader('Last-Modified', date('r')); + ->setHeader('Content-Length', is_null($contentLength) ? strlen($content) : $contentLength, true) + ->setHeader('Content-Disposition', 'attachment; filename="'.$fileName.'"', true) + ->setHeader('Last-Modified', date('r'), true); if (!is_null($content)) { if ($isFile) { @@ -1048,6 +1048,8 @@ protected function _prepareDownloadResponse( if (!empty($content['rm'])) { $ioAdapter->rm($file); } + + exit(0); } else { $this->getResponse()->setBody($content); } diff --git a/app/code/core/Mage/Core/Controller/Varien/Exception.php b/app/code/core/Mage/Core/Controller/Varien/Exception.php index 958e5e7d1b..db2e35317a 100644 --- a/app/code/core/Mage/Core/Controller/Varien/Exception.php +++ b/app/code/core/Mage/Core/Controller/Varien/Exception.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Controller/Varien/Front.php b/app/code/core/Mage/Core/Controller/Varien/Front.php index 0d3b8ad5f9..93312bbc42 100644 --- a/app/code/core/Mage/Core/Controller/Varien/Front.php +++ b/app/code/core/Mage/Core/Controller/Varien/Front.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -119,7 +119,7 @@ public function getRouters() } /** - * Init Fron Controller + * Init Front Controller * * @return Mage_Core_Controller_Varien_Front */ @@ -182,7 +182,7 @@ public function dispatch() if ($i>100) { Mage::throwException('Front controller reached 100 router match iterations'); } - //This event give possibility to launch smth before sending ouptut(Allow cookie setting) + // This event gives possibility to launch something before sending output (allow cookie setting) Mage::dispatchEvent('controller_front_send_response_before', array('front'=>$this)); Varien_Profiler::start('mage::app::dispatch::send_response'); $this->getResponse()->sendResponse(); @@ -300,13 +300,9 @@ protected function _checkBaseUrl($request) return; } - $adminPath = (string)Mage::getConfig()->getNode(Mage_Adminhtml_Helper_Data::XML_PATH_CUSTOM_ADMIN_PATH); - if (!$adminPath) { - $adminPath = (string)Mage::getConfig() - ->getNode(Mage_Adminhtml_Helper_Data::XML_PATH_ADMINHTML_ROUTER_FRONTNAME); - } - if (preg_match('#^' . $adminPath . '(\/.*)?$#', ltrim($request->getPathInfo(), '/')) - && (string)Mage::getConfig()->getNode(Mage_Adminhtml_Helper_Data::XML_PATH_USE_CUSTOM_ADMIN_URL)) { + if ($this->_isAdminFrontNameMatched($request) + && (string)Mage::getConfig()->getNode(Mage_Adminhtml_Helper_Data::XML_PATH_USE_CUSTOM_ADMIN_URL) + ) { return; } @@ -333,4 +329,39 @@ protected function _checkBaseUrl($request) exit; } } + + /** + * Check if requested path starts with one of the admin front names + * + * @param Zend_Controller_Request_Http $request + * @return boolean + */ + protected function _isAdminFrontNameMatched($request) + { + $adminPath = (string)Mage::getConfig()->getNode(Mage_Adminhtml_Helper_Data::XML_PATH_CUSTOM_ADMIN_PATH); + if (!$adminPath) { + $adminPath = (string)Mage::getConfig() + ->getNode(Mage_Adminhtml_Helper_Data::XML_PATH_ADMINHTML_ROUTER_FRONTNAME); + } + $adminFrontNames = array($adminPath); + + // Check for other modules that can use admin router (a lot of Magento extensions do that) + $adminFrontNameNodes = Mage::getConfig()->getNode('admin/routers') + ->xpath('*[not(self::adminhtml) and use = "admin"]/args/frontName'); + + if (is_array($adminFrontNameNodes)) { + foreach ($adminFrontNameNodes as $frontNameNode) { + /** @var $frontNameNode SimpleXMLElement */ + array_push($adminFrontNames, (string)$frontNameNode); + } + } + + $pathPrefix = ltrim($request->getPathInfo(), '/'); + $urlDelimiterPos = strpos($pathPrefix, '/'); + if ($urlDelimiterPos) { + $pathPrefix = substr($pathPrefix, 0, $urlDelimiterPos); + } + + return in_array($pathPrefix, $adminFrontNames); + } } diff --git a/app/code/core/Mage/Core/Controller/Varien/Router/Abstract.php b/app/code/core/Mage/Core/Controller/Varien/Router/Abstract.php index 0a87c469f0..3d305c09f9 100644 --- a/app/code/core/Mage/Core/Controller/Varien/Router/Abstract.php +++ b/app/code/core/Mage/Core/Controller/Varien/Router/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Controller/Varien/Router/Admin.php b/app/code/core/Mage/Core/Controller/Varien/Router/Admin.php index b052fd835f..46456ec9b5 100644 --- a/app/code/core/Mage/Core/Controller/Varien/Router/Admin.php +++ b/app/code/core/Mage/Core/Controller/Varien/Router/Admin.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Controller/Varien/Router/Default.php b/app/code/core/Mage/Core/Controller/Varien/Router/Default.php index 25aa09b8ab..e2eb197343 100644 --- a/app/code/core/Mage/Core/Controller/Varien/Router/Default.php +++ b/app/code/core/Mage/Core/Controller/Varien/Router/Default.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php b/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php index c3bcd1c6a4..6c72e86e5b 100644 --- a/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php +++ b/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -154,7 +154,7 @@ public function match(Zend_Controller_Request_Http $request) return false; } - //checkings after we foundout that this router should be used for current module + // checks after we found out that this router should be used for current module if (!$this->_afterModuleMatch()) { return false; } @@ -210,7 +210,7 @@ public function match(Zend_Controller_Request_Http $request) } /** - * if we did not found any siutibul + * if we did not found any suitable */ if (!$found) { if ($this->_noRouteShouldBeApplied()) { @@ -417,13 +417,12 @@ public function rewrite(array $p) } /** - * Check if request URL should be secure - * - * Function redirects user to correct URL if needed + * Check that request uses https protocol if it should. + * Function redirects user to correct URL if needed. * * @param Mage_Core_Controller_Request_Http $request * @param string $path - * @return null + * @return void */ protected function _checkShouldBeSecure($request, $path = '') { @@ -433,11 +432,14 @@ protected function _checkShouldBeSecure($request, $path = '') if ($this->_shouldBeSecure($path) && !$request->isSecure()) { $url = $this->_getCurrentSecureUrl($request); + if ($request->getRouteName() != 'adminhtml' && Mage::app()->getUseSessionInUrl()) { + $url = Mage::getSingleton('core/url')->getRedirectUrl($url); + } Mage::app()->getFrontController()->getResponse() ->setRedirect($url) ->sendResponse(); - exit(); + exit; } } diff --git a/app/code/core/Mage/Core/Exception.php b/app/code/core/Mage/Core/Exception.php index 4d63eb30ed..92d66ac593 100644 --- a/app/code/core/Mage/Core/Exception.php +++ b/app/code/core/Mage/Core/Exception.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Helper/Abstract.php b/app/code/core/Mage/Core/Helper/Abstract.php old mode 100644 new mode 100755 index 06df7894ff..2897e56d1c --- a/app/code/core/Mage/Core/Helper/Abstract.php +++ b/app/code/core/Mage/Core/Helper/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -215,10 +215,10 @@ public function escapeHtml($data, $allowedTags = null) if (is_array($allowedTags) and !empty($allowedTags)) { $allowed = implode('|', $allowedTags); $result = preg_replace('/<([\/\s\r\n]*)(' . $allowed . ')([\/\s\r\n]*)>/si', '##$1$2$3##', $data); - $result = htmlspecialchars($result); + $result = htmlspecialchars($result, ENT_COMPAT, 'UTF-8', false); $result = preg_replace('/##([\/\s\r\n]*)(' . $allowed . ')([\/\s\r\n]*)##/si', '<$1$2$3>', $result); } else { - $result = htmlspecialchars($data); + $result = htmlspecialchars($data, ENT_COMPAT, 'UTF-8', false); } } else { $result = $data; @@ -227,6 +227,19 @@ public function escapeHtml($data, $allowedTags = null) return $result; } + /** + * Remove html tags, but leave "<" and ">" signs + * + * @param string $html + * @return string + */ + public function removeTags($html) + { + $html = preg_replace("# <(?![/a-z]) | (?<=\s)>(?![a-z]) #exi", "htmlentities('$0')", $html); + $html = strip_tags($html); + return htmlspecialchars_decode($html); + } + /** * Wrapper for standart strip_tags() function with extra functionality for html entities * @@ -280,6 +293,22 @@ public function jsQuoteEscape($data, $quote='\'') return str_replace($quote, '\\'.$quote, $data); } + /** + * Escape quotes inside html attributes + * Use $addSlashes = false for escaping js that inside html attribute (onClick, onSubmit etc) + * + * @param string $data + * @param bool $addSlashes + * @return string + */ + public function quoteEscape($data, $addSlashes = false) + { + if ($addSlashes === true) { + $data = addslashes($data); + } + return htmlspecialchars($data, ENT_QUOTES, null, false); + } + /** * Retrieve url * @@ -318,7 +347,7 @@ public function getLayout() * base64_encode() for URLs encoding * * @param string $url - * @return string + * @return string */ public function urlEncode($url) { @@ -329,7 +358,7 @@ public function urlEncode($url) * base64_dencode() for URLs dencoding * * @param string $url - * @return string + * @return string */ public function urlDecode($url) { @@ -341,7 +370,7 @@ public function urlDecode($url) * Translate array * * @param array $arr - * @return array + * @return array */ public function translateArray($arr = array()) { diff --git a/app/code/core/Mage/Core/Helper/Data.php b/app/code/core/Mage/Core/Helper/Data.php index 2e907117cc..b64d966a47 100644 --- a/app/code/core/Mage/Core/Helper/Data.php +++ b/app/code/core/Mage/Core/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -55,6 +55,11 @@ class Mage_Core_Helper_Data extends Mage_Core_Helper_Abstract const XML_PATH_MERCHANT_VAT_NUMBER = 'general/store_information/merchant_vat_number'; const XML_PATH_EU_COUNTRIES_LIST = 'general/country/eu_countries'; + /** + * Const for correct dividing decimal values + */ + const DIVIDE_EPSILON = 10000; + /** * @var Mage_Core_Model_Encryption */ @@ -822,21 +827,23 @@ public function useDbCompatibleMode() /** * Retrieve merchant country code * + * @param Mage_Core_Model_Store|string|int|null $store * @return string */ - public function getMerchantCountryCode() + public function getMerchantCountryCode($store = null) { - return (string) Mage::getStoreConfig(self::XML_PATH_MERCHANT_COUNTRY_CODE); + return (string) Mage::getStoreConfig(self::XML_PATH_MERCHANT_COUNTRY_CODE, $store); } /** * Retrieve merchant VAT number * + * @param Mage_Core_Model_Store|string|int|null $store * @return string */ - public function getMerchantVatNumber() + public function getMerchantVatNumber($store = null) { - return (string) Mage::getStoreConfig(self::XML_PATH_MERCHANT_VAT_NUMBER); + return (string) Mage::getStoreConfig(self::XML_PATH_MERCHANT_VAT_NUMBER, $store); } /** @@ -851,4 +858,23 @@ public function isCountryInEU($countryCode, $storeId = null) $euCountries = explode(',', Mage::getStoreConfig(self::XML_PATH_EU_COUNTRIES_LIST, $storeId)); return in_array($countryCode, $euCountries); } + + /** + * Returns the floating point remainder (modulo) of the division of the arguments + * + * @param float|int $dividend + * @param float|int $divisor + * @return float|int + */ + public function getExactDivision($dividend, $divisor) + { + $epsilon = $divisor / self::DIVIDE_EPSILON; + + $remainder = fmod($dividend, $divisor); + if (abs($remainder - $divisor) < $epsilon || abs($remainder) < $epsilon) { + $remainder = 0; + } + + return $remainder; + } } diff --git a/app/code/core/Mage/Core/Helper/File/Storage.php b/app/code/core/Mage/Core/Helper/File/Storage.php index 60506d394c..e09f923f9d 100644 --- a/app/code/core/Mage/Core/Helper/File/Storage.php +++ b/app/code/core/Mage/Core/Helper/File/Storage.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Helper/File/Storage/Database.php b/app/code/core/Mage/Core/Helper/File/Storage/Database.php index 1ec17581a5..413c962969 100644 --- a/app/code/core/Mage/Core/Helper/File/Storage/Database.php +++ b/app/code/core/Mage/Core/Helper/File/Storage/Database.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Helper/Hint.php b/app/code/core/Mage/Core/Helper/Hint.php new file mode 100644 index 0000000000..19afeeb567 --- /dev/null +++ b/app/code/core/Mage/Core/Helper/Hint.php @@ -0,0 +1,80 @@ + + */ +class Mage_Core_Helper_Hint extends Mage_Core_Helper_Abstract +{ + /** + * List of available hints + * + * @var null|array + */ + protected $_availableHints; + + /** + * Retrieve list of available hints as [hint code] => [hint url] + * + * @return array + */ + public function getAvailableHints() + { + if (null === $this->_availableHints) { + $hints = array(); + $config = Mage::getConfig()->getNode('default/hints'); + if ($config) { + foreach ($config->children() as $type => $node) { + if ((string)$node->enabled) { + $hints[$type] = (string)$node->url; + } + } + } + $this->_availableHints = $hints; + } + return $this->_availableHints; + } + + /** + * Get Hint Url by Its Code + * + * @param string $code + * @return null|string + */ + public function getHintByCode($code) + { + $hint = null; + $hints = $this->getAvailableHints(); + if (array_key_exists($code, $hints)) { + $hint = $hints[$code]; + } + return $hint; + } +} diff --git a/app/code/core/Mage/Core/Helper/Http.php b/app/code/core/Mage/Core/Helper/Http.php index 824a81c8fc..2aff4089b4 100644 --- a/app/code/core/Mage/Core/Helper/Http.php +++ b/app/code/core/Mage/Core/Helper/Http.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Helper/Js.php b/app/code/core/Mage/Core/Helper/Js.php index e3e878a4ee..bb03d52f3d 100644 --- a/app/code/core/Mage/Core/Helper/Js.php +++ b/app/code/core/Mage/Core/Helper/Js.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -31,6 +31,16 @@ */ class Mage_Core_Helper_Js extends Mage_Core_Helper_Abstract { + /** + * Key for cache + */ + const JAVASCRIPT_TRANSLATE_CONFIG_KEY = 'javascript_translate_config'; + + /** + * Translate file name + */ + const JAVASCRIPT_TRANSLATE_CONFIG_FILENAME = 'jstranslator.xml'; + /** * Array of senteces of JS translations * @@ -38,6 +48,13 @@ class Mage_Core_Helper_Js extends Mage_Core_Helper_Abstract */ protected $_translateData = null; + /** + * Translate config + * + * @var Varien_Simplexml_Config + */ + protected $_config = null; + /** * Retrieve JSON of JS sentences translation * @@ -121,102 +138,19 @@ public function getJsSkinUrl($file) */ protected function _getTranslateData() { - if ($this->_translateData ===null) { - $this->_translateData = array( - 'Please select an option.' => $this->__('Please select an option.'), - 'This is a required field.' => $this->__('This is a required field.'), - 'Please enter a valid number in this field.' => $this->__('Please enter a valid number in this field.'), - 'Please use numbers only in this field. Please avoid spaces or other characters such as dots or commas.' => - $this->__('Please use numbers only in this field. Please avoid spaces or other characters such as dots or commas.'), - 'Please use letters only (a-z) in this field.' => $this->__('Please use letters only (a-z) in this field.'), - 'Please use only letters (a-z), numbers (0-9) or underscore(_) in this field, first character should be a letter.' => - $this->__('Please use only letters (a-z), numbers (0-9) or underscore(_) in this field, first character should be a letter.'), - 'Please use only letters (a-z) or numbers (0-9) only in this field. No spaces or other characters are allowed.' => - $this->__('Please use only letters (a-z) or numbers (0-9) only in this field. No spaces or other characters are allowed.'), - 'Please use only letters (a-z) or numbers (0-9) or spaces and # only in this field.' => - $this->__('Please use only letters (a-z) or numbers (0-9) or spaces and # only in this field.'), - 'Please enter a valid phone number. For example (123) 456-7890 or 123-456-7890.' => - $this->__('Please enter a valid phone number. For example (123) 456-7890 or 123-456-7890.'), - 'Please enter a valid date.' => $this->__('Please enter a valid date.'), - 'Please enter a valid email address. For example johndoe@domain.com.' => - $this->__('Please enter a valid email address. For example johndoe@domain.com.'), - 'Please enter 6 or more characters.' => $this->__('Please enter 6 or more characters.'), - 'Please make sure your passwords match.' => $this->__('Please make sure your passwords match.'), - 'Please enter a valid URL. Protocol is required (http://, https:// or ftp://)' => - $this->__('Please enter a valid URL. Protocol is required (http://, https:// or ftp://)'), - 'Please enter a valid URL. For example http://www.example.com or www.example.com' => - $this->__('Please enter a valid URL. For example http://www.example.com or www.example.com'), - 'Please enter a valid social security number. For example 123-45-6789.' => - $this->__('Please enter a valid social security number. For example 123-45-6789.'), - 'Please enter a valid zip code. For example 90602 or 90602-1234.' => - $this->__('Please enter a valid zip code. For example 90602 or 90602-1234.'), - 'Please enter a valid zip code.' => $this->__('Please enter a valid zip code.'), - 'Please use this date format: dd/mm/yyyy. For example 17/03/2006 for the 17th of March, 2006.' => - $this->__('Please use this date format: dd/mm/yyyy. For example 17/03/2006 for the 17th of March, 2006.'), - 'Please enter a valid $ amount. For example $100.00.' => - $this->__('Please enter a valid $ amount. For example $100.00.'), - 'Please select one of the above options.' => $this->__('Please select one of the above options.'), - 'Please select one of the options.' => $this->__('Please select one of the options.'), - 'Please enter a valid number in this field.' => $this->__('Please enter a valid number in this field.'), - 'Please select State/Province.' => $this->__('Please select State/Province.'), - 'Please enter valid password.' => $this->__('Please enter valid password.'), - 'Please enter 6 or more characters. Leading or trailing spaces will be ignored.' => - $this->__('Please enter 6 or more characters. Leading or trailing spaces will be ignored.'), - 'Please use letters only (a-z or A-Z) in this field.' => $this->__('Please use letters only (a-z or A-Z) in this field.'), - 'Please enter a number greater than 0 in this field.' => - $this->__('Please enter a number greater than 0 in this field.'), - 'Please enter a valid credit card number.' => $this->__('Please enter a valid credit card number.'), - 'Please wait, loading...' => $this->__('Please wait, loading...'), - 'Please choose to register or to checkout as a guest' => $this->__('Please choose to register or to checkout as a guest'), - 'Error: Passwords do not match' => $this->__('Error: Passwords do not match'), - 'Your order cannot be completed at this time as there is no shipping methods available for it. Please make necessary changes in your shipping address.' => - $this->__('Your order cannot be completed at this time as there is no shipping methods available for it. Please make necessary changes in your shipping address.'), - 'Please specify shipping method.' => $this->__('Please specify shipping method.'), - 'Your order cannot be completed at this time as there is no payment methods available for it.' => - $this->__('Your order cannot be completed at this time as there is no payment methods available for it.'), - 'Please specify payment method.' => $this->__('Please specify payment method.'), - 'Credit card number does not match credit card type.' => $this->__('Credit card number does not match credit card type.'), - 'Card type does not match credit card number.' => $this->__('Card type does not match credit card number.'), - 'Please enter a valid credit card verification number.' => $this->__('Please enter a valid credit card verification number.'), - 'Please use only letters (a-z or A-Z), numbers (0-9) or underscore(_) in this field, first character should be a letter.' => - $this->__('Please use only letters (a-z or A-Z), numbers (0-9) or underscores (_) in this field, first character must be a letter.'), - 'Please input a valid CSS-length. For example 100px or 77pt or 20em or .5ex or 50%.' => - $this->__('Please input a valid CSS-length. For example 100px or 77pt or 20em or .5ex or 50%.'), - 'Maximum length exceeded.' => $this->__('Maximum length exceeded.'), - 'Your session has been expired, you will be relogged in now.' => $this->__('Your session has been expired, you will be relogged in now.'), - 'Incorrect credit card expiration date.' => $this->__('Incorrect credit card expiration date.'), - 'This date is a required value.' => $this->__('This date is a required value.'), - 'The value is not within the specified range.' => $this->__('The value is not within the specified range.'), - 'Please use only letters (a-z or A-Z) or numbers (0-9) only in this field. No spaces or other characters are allowed.' - => $this->__('Please use only letters (a-z or A-Z) or numbers (0-9) only in this field. No spaces or other characters are allowed.'), - 'Please use only letters (a-z or A-Z) or numbers (0-9) or spaces and # only in this field.' => - $this->__('Please use only letters (a-z or A-Z) or numbers (0-9) or spaces and # only in this field.'), - 'Please enter a valid fax number. For example (123) 456-7890 or 123-456-7890.' => - $this->__('Please enter a valid fax number. For example (123) 456-7890 or 123-456-7890.'), - 'Please use only visible characters and spaces.' => $this->__('Please use only visible characters and spaces.'), - 'Please enter 7 or more characters. Password should contain both numeric and alphabetic characters.' => - $this->__('Please enter 7 or more characters. Password should contain both numeric and alphabetic characters.'), - 'Please enter a valid URL Key. For example "example-page", "example-page.html" or "anotherlevel/example-page".' => - $this->__('Please enter a valid URL Key. For example "example-page", "example-page.html" or "anotherlevel/example-page".'), - 'Please enter a valid XML-identifier. For example something_1, block5, id-4.' => - $this->__('Please enter a valid XML-identifier. For example something_1, block5, id-4.'), - 'Please enter a number 0 or greater in this field.' => $this->__('Please enter a number 0 or greater in this field.'), - 'Text length does not satisfy specified text range.' => $this->__('Text length does not satisfy specified text range.'), - 'Please enter a number lower than 100.' => $this->__('Please enter a number lower than 100.'), - 'Please enter issue number or start date for switch/solo card type.' => - $this->__('Please enter issue number or start date for switch/solo card type.'), - 'Please enter a valid day (1-%d).' => $this->__('Please enter a valid day (1-%d).'), - 'Please enter a valid month (1-12).' => $this->__('Please enter a valid month (1-12).'), - 'Please enter a valid year (1900-%d).' => $this->__('Please enter a valid year (1900-%d).'), - 'Please enter a valid full date' => $this->__('Please enter a valid full date'), - 'Please enter a valid date between %s and %s' => - $this->__('Please enter a valid date between %s and %s'), - 'Please enter a valid date equal to or greater than %s' => - $this->__('Please enter a valid date equal to or greater than %s'), - 'Please enter a valid date less than or equal to %s' => - $this->__('Please enter a valid date less than or equal to %s') - ); - foreach ($this->_translateData as $key=>$value) { + if ($this->_translateData === null) { + $this->_translateData = array(); + $messages = $this->_getXmlConfig()->getXpath('*/message'); + if (!empty($messages)) { + foreach ($messages as $message) { + $messageText = (string)$message; + $module = $message->getParent()->getAttribute("module"); + $this->_translateData[$messageText] = Mage::helper(empty($module) ? 'core' : $module + )->__($messageText); + } + } + + foreach ($this->_translateData as $key => $value) { if ($key == $value) { unset($this->_translateData[$key]); } @@ -225,4 +159,30 @@ protected function _getTranslateData() return $this->_translateData; } + /** + * Load config from files and try to cache it + * + * @return Varien_Simplexml_Config + */ + protected function _getXmlConfig() + { + if (is_null($this->_config)) { + $canUsaCache = Mage::app()->useCache('config'); + $cachedXml = Mage::app()->loadCache(self::JAVASCRIPT_TRANSLATE_CONFIG_KEY); + if ($canUsaCache && $cachedXml) { + $xmlConfig = new Varien_Simplexml_Config($cachedXml); + } else { + $xmlConfig = new Varien_Simplexml_Config(); + $xmlConfig->loadString(''); + Mage::getConfig()->loadModulesConfiguration(self::JAVASCRIPT_TRANSLATE_CONFIG_FILENAME, $xmlConfig); + + if ($canUsaCache) { + Mage::app()->saveCache($xmlConfig->getXmlString(), self::JAVASCRIPT_TRANSLATE_CONFIG_KEY, + array(Mage_Core_Model_Config::CACHE_TAG)); + } + } + $this->_config = $xmlConfig; + } + return $this->_config; + } } diff --git a/app/code/core/Mage/Core/Helper/String.php b/app/code/core/Mage/Core/Helper/String.php index 6e9d49b529..12991d905a 100644 --- a/app/code/core/Mage/Core/Helper/String.php +++ b/app/code/core/Mage/Core/Helper/String.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -115,7 +115,8 @@ public function splitInjection($str, $length = 50, $needle = '-', $insert = ' ') if ($this->strlen($part) >= $length) { $lastDelimetr = $this->strpos($this->strrev($part), $needle); $tmpNewStr = ''; - $tmpNewStr = $this->substr($this->strrev($part), 0, $lastDelimetr) . $insert . $this->substr($this->strrev($part), $lastDelimetr); + $tmpNewStr = $this->substr($this->strrev($part), 0, $lastDelimetr) + . $insert . $this->substr($this->strrev($part), $lastDelimetr); $newStr .= $this->strrev($tmpNewStr); } else { $newStr .= $part; @@ -264,7 +265,8 @@ function splitWords($str, $uniqueOnly = false, $maxWordLength = 0, $wordSeparato */ public function cleanString($string) { - return '"libiconv"' == ICONV_IMPL ? iconv(self::ICONV_CHARSET, self::ICONV_CHARSET . '//IGNORE', $string) : $string; + return '"libiconv"' == ICONV_IMPL ? + iconv(self::ICONV_CHARSET, self::ICONV_CHARSET . '//IGNORE', $string) : $string; } /** @@ -292,7 +294,9 @@ public function ksortMultibyte(array &$sort) return false; } $oldLocale = setlocale(LC_COLLATE, "0"); - setlocale(LC_COLLATE, Mage::app()->getLocale()->getLocaleCode() . '.UTF8'); + $localeCode = Mage::app()->getLocale()->getLocaleCode(); + // use fallback locale if $localeCode is not available + setlocale(LC_COLLATE, $localeCode . '.UTF8', 'C.UTF-8', 'en_US.utf8'); ksort($sort, SORT_LOCALE_STRING); setlocale(LC_COLLATE, $oldLocale); diff --git a/app/code/core/Mage/Core/Helper/Translate.php b/app/code/core/Mage/Core/Helper/Translate.php index 3ef098e98d..1c5b9b7b0e 100644 --- a/app/code/core/Mage/Core/Helper/Translate.php +++ b/app/code/core/Mage/Core/Helper/Translate.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -51,28 +51,4 @@ public function apply($translate, $area, $returnType = 'json') return $returnType == 'json' ? "{error:true,message:'" . $e->getMessage() . "'}" : false; } } - - /** - * Sets escaping start marker which then processed by inline translation model - * - * @see Mage_Core_Model_Translate_Inline::_escapeInline() - * @param string $escapeChar Char to escape (default = ') - * @return string - */ - public function inlineEscapeStartMarker($escapeChar = "'") - { - $escapeChar = str_replace('"', '\"', $escapeChar); - return "{{escape={$escapeChar}}}"; - } - - /** - * Sets escaping end marker which then processed by inline translation model - * - * @see Mage_Core_Model_Translate_Inline::_escapeInline() - * @return string - */ - public function inlineEscapeEndMarker() - { - return '{{escape}}'; - } } diff --git a/app/code/core/Mage/Core/Helper/Url.php b/app/code/core/Mage/Core/Helper/Url.php index 811b5c49cb..2fd8608a13 100644 --- a/app/code/core/Mage/Core/Helper/Url.php +++ b/app/code/core/Mage/Core/Helper/Url.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Helper/Url/Rewrite.php b/app/code/core/Mage/Core/Helper/Url/Rewrite.php index aab104c136..4974cca38b 100644 --- a/app/code/core/Mage/Core/Helper/Url/Rewrite.php +++ b/app/code/core/Mage/Core/Helper/Url/Rewrite.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Abstract.php b/app/code/core/Mage/Core/Model/Abstract.php index 9799e4e3eb..d38f706438 100644 --- a/app/code/core/Mage/Core/Model/Abstract.php +++ b/app/code/core/Mage/Core/Model/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/App.php b/app/code/core/Mage/Core/Model/App.php index d80706d1b3..befc1582ea 100644 --- a/app/code/core/Mage/Core/Model/App.php +++ b/app/code/core/Mage/Core/Model/App.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -40,6 +40,11 @@ class Mage_Core_Model_App const XML_PATH_SKIP_PROCESS_MODULES_UPDATES = 'global/skip_process_modules_updates'; + /** + * if this node set to true, we will ignore Developer Mode for applying updates + */ + const XML_PATH_IGNORE_DEV_MODE = 'global/skip_process_modules_updates_ignore_dev_mode'; + const DEFAULT_ERROR_HANDLER = 'mageCoreErrorHandler'; const DISTRO_LOCALE_CODE = 'en_US'; @@ -429,7 +434,8 @@ protected function _shouldSkipProcessModulesUpdates() return false; } - if (Mage::getIsDeveloperMode()) { + $ignoreDevelopmentMode = (bool)(string)$this->_config->getNode(self::XML_PATH_IGNORE_DEV_MODE); + if (Mage::getIsDeveloperMode() && !$ignoreDevelopmentMode) { return false; } diff --git a/app/code/core/Mage/Core/Model/App/Area.php b/app/code/core/Mage/Core/Model/App/Area.php index 3409ab04d7..1545fdeb2c 100644 --- a/app/code/core/Mage/Core/Model/App/Area.php +++ b/app/code/core/Mage/Core/Model/App/Area.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/App/Emulation.php b/app/code/core/Mage/Core/Model/App/Emulation.php index 27d68f7e49..ac1adda910 100644 --- a/app/code/core/Mage/Core/Model/App/Emulation.php +++ b/app/code/core/Mage/Core/Model/App/Emulation.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Cache.php b/app/code/core/Mage/Core/Model/Cache.php index f2a9cc8e8b..a548021533 100644 --- a/app/code/core/Mage/Core/Model/Cache.php +++ b/app/code/core/Mage/Core/Model/Cache.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -156,12 +156,18 @@ protected function _getBackendOptions(array $cacheOptions) } break; case 'memcached': - if (extension_loaded('memcache')) { + if (extension_loaded('memcached')) { if (isset($cacheOptions['memcached'])) { $options = $cacheOptions['memcached']; } $enable2levels = true; - $backendType = 'Varien_Cache_Backend_Memcached'; + $backendType = 'Libmemcached'; + } elseif (extension_loaded('memcache')) { + if (isset($cacheOptions['memcached'])) { + $options = $cacheOptions['memcached']; + } + $enable2levels = true; + $backendType = 'Memcached'; } break; case 'apc': diff --git a/app/code/core/Mage/Core/Model/Calculator.php b/app/code/core/Mage/Core/Model/Calculator.php index 119dfb8f0d..cd5ba6f86f 100644 --- a/app/code/core/Mage/Core/Model/Calculator.php +++ b/app/code/core/Mage/Core/Model/Calculator.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Config.php b/app/code/core/Mage/Core/Model/Config.php index 959250cdfe..58827f34ff 100644 --- a/app/code/core/Mage/Core/Model/Config.php +++ b/app/code/core/Mage/Core/Model/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Config/Base.php b/app/code/core/Mage/Core/Model/Config/Base.php index a7a9c1cd01..bde7a6803b 100644 --- a/app/code/core/Mage/Core/Model/Config/Base.php +++ b/app/code/core/Mage/Core/Model/Config/Base.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Config/Data.php b/app/code/core/Mage/Core/Model/Config/Data.php index f036ba8852..48944c10ff 100644 --- a/app/code/core/Mage/Core/Model/Config/Data.php +++ b/app/code/core/Mage/Core/Model/Config/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Config/Element.php b/app/code/core/Mage/Core/Model/Config/Element.php index cc94a046fd..336bcbf572 100644 --- a/app/code/core/Mage/Core/Model/Config/Element.php +++ b/app/code/core/Mage/Core/Model/Config/Element.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Config/Options.php b/app/code/core/Mage/Core/Model/Config/Options.php index 0e0ffcb2ad..31fbd4b785 100644 --- a/app/code/core/Mage/Core/Model/Config/Options.php +++ b/app/code/core/Mage/Core/Model/Config/Options.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Config/System.php b/app/code/core/Mage/Core/Model/Config/System.php index de76295e98..31ed4824d8 100644 --- a/app/code/core/Mage/Core/Model/Config/System.php +++ b/app/code/core/Mage/Core/Model/Config/System.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Convert.php b/app/code/core/Mage/Core/Model/Convert.php index 92770f286d..a671fc15e9 100644 --- a/app/code/core/Mage/Core/Model/Convert.php +++ b/app/code/core/Mage/Core/Model/Convert.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Cookie.php b/app/code/core/Mage/Core/Model/Cookie.php index 7577a3116b..4f82c30fa1 100644 --- a/app/code/core/Mage/Core/Model/Cookie.php +++ b/app/code/core/Mage/Core/Model/Cookie.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Date.php b/app/code/core/Mage/Core/Model/Date.php index 974c2259bf..dca47c55d3 100644 --- a/app/code/core/Mage/Core/Model/Date.php +++ b/app/code/core/Mage/Core/Model/Date.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -106,7 +106,13 @@ public function gmtDate($format = null, $input = null) $format = 'Y-m-d H:i:s'; } - $result = date($format, $this->gmtTimestamp($input)); + $date = $this->gmtTimestamp($input); + + if ($date === false) { + return false; + } + + $result = date($format, $date); return $result; } @@ -144,6 +150,11 @@ public function gmtTimestamp($input = null) $result = strtotime($input); } + if ($result === false) { + // strtotime() unable to parse string (it's not a date or has incorrect format) + return false; + } + $date = Mage::app()->getLocale()->date($result); $timestamp = $date->get(Zend_Date::TIMESTAMP) - $date->get(Zend_Date::TIMEZONE_SECS); @@ -225,13 +236,22 @@ public function parseDateTime($dateTimeString, $dateTimeFormat) { // look for supported format $isSupportedFormatFound = false; - foreach (array( + + $formats = array( // priority is important! - '%m/%d/%y %I:%M' => array('/^([0-9]{1,2})\/([0-9]{1,2})\/([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2})/', array('y' => 3, 'm' => 1, 'd' => 2, 'h' => 4, 'i' => 5)), - 'm/d/y h:i' => array('/^([0-9]{1,2})\/([0-9]{1,2})\/([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2})/', array('y' => 3, 'm' => 1, 'd' => 2, 'h' => 4, 'i' => 5)), - '%m/%d/%y' => array('/^([0-9]{1,2})\/([0-9]{1,2})\/([0-9]{1,2})/', array('y' => 3, 'm' => 1, 'd' => 2)), - 'm/d/y' => array('/^([0-9]{1,2})\/([0-9]{1,2})\/([0-9]{1,2})/', array('y' => 3, 'm' => 1, 'd' => 2)), - ) as $supportedFormat => $regRule) { + '%m/%d/%y %I:%M' => array( + '/^([0-9]{1,2})\/([0-9]{1,2})\/([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2})/', + array('y' => 3, 'm' => 1, 'd' => 2, 'h' => 4, 'i' => 5) + ), + 'm/d/y h:i' => array( + '/^([0-9]{1,2})\/([0-9]{1,2})\/([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2})/', + array('y' => 3, 'm' => 1, 'd' => 2, 'h' => 4, 'i' => 5) + ), + '%m/%d/%y' => array('/^([0-9]{1,2})\/([0-9]{1,2})\/([0-9]{1,2})/', array('y' => 3, 'm' => 1, 'd' => 2)), + 'm/d/y' => array('/^([0-9]{1,2})\/([0-9]{1,2})\/([0-9]{1,2})/', array('y' => 3, 'm' => 1, 'd' => 2)), + ); + + foreach ($formats as $supportedFormat => $regRule) { if (false !== strpos($dateTimeFormat, $supportedFormat, 0)) { $isSupportedFormatFound = true; break; diff --git a/app/code/core/Mage/Core/Model/Design.php b/app/code/core/Mage/Core/Model/Design.php index 456ae7201b..74a8ba5c89 100644 --- a/app/code/core/Mage/Core/Model/Design.php +++ b/app/code/core/Mage/Core/Model/Design.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -61,7 +61,7 @@ public function loadChange($storeId, $date = null) $result = $this->getResource() ->loadChange($storeId, $date); - if (count($result)){ + if (!empty($result)) { if (!empty($result['design'])) { $tmp = explode('/', $result['design']); $result['package'] = $tmp[0]; diff --git a/app/code/core/Mage/Core/Model/Design/Package.php b/app/code/core/Mage/Core/Model/Design/Package.php index d0b06a31eb..dffa4c6f50 100644 --- a/app/code/core/Mage/Core/Model/Design/Package.php +++ b/app/code/core/Mage/Core/Model/Design/Package.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -518,7 +518,7 @@ public function getThemeList($package = null) * Directories lister utility method * * @param string $path - * @param string|false $fullPath + * @param string|bool $fullPath * @return array */ private function _listDirectories($path, $fullPath = false) @@ -581,6 +581,7 @@ protected function _checkUserAgentAgainstRegexps($regexpsConfigPath) * * @param array $rules - design exception rules * @param string $regexpsConfigPath + * @return bool|string */ public static function getPackageByUserAgent(array $rules, $regexpsConfigPath = 'path_mock') { @@ -647,7 +648,13 @@ public function getMergedCssUrl($files) // merge into target file $targetFilename = md5(implode(',', $files) . "|{$hostname}|{$port}") . '.css'; - if ($this->_mergeFiles($files, $targetDir . DS . $targetFilename, false, array($this, 'beforeMergeCss'), 'css')) { + $mergeFilesResult = $this->_mergeFiles( + $files, $targetDir . DS . $targetFilename, + false, + array($this, 'beforeMergeCss'), + 'css' + ); + if ($mergeFilesResult) { return $baseMediaUrl . $mergerDir . '/' . $targetFilename; } return ''; @@ -658,13 +665,14 @@ public function getMergedCssUrl($files) * * @see Mage_Core_Helper_Data::mergeFiles() * @param array $srcFiles - * @param string|false $targetFile - file path to be written + * @param string|bool $targetFile - file path to be written * @param bool $mustMerge * @param callback $beforeMergeCallback * @param array|string $extensionsFilter * @return bool|string */ - protected function _mergeFiles(array $srcFiles, $targetFile = false, $mustMerge = false, $beforeMergeCallback = null, $extensionsFilter = array()) + protected function _mergeFiles(array $srcFiles, $targetFile = false, + $mustMerge = false, $beforeMergeCallback = null, $extensionsFilter = array()) { if (Mage::helper('core/file_storage_database')->checkDbUsage()) { if (!file_exists($targetFile)) { @@ -675,14 +683,26 @@ protected function _mergeFiles(array $srcFiles, $targetFile = false, $mustMerge } else { $filemtime = null; } - $result = Mage::helper('core')->mergeFiles($srcFiles, $targetFile, $mustMerge, $beforeMergeCallback, $extensionsFilter); + $result = Mage::helper('core')->mergeFiles( + $srcFiles, + $targetFile, + $mustMerge, + $beforeMergeCallback, + $extensionsFilter + ); if ($result && (filemtime($targetFile) > $filemtime)) { Mage::helper('core/file_storage_database')->saveFile($targetFile); } return $result; } else { - return Mage::helper('core')->mergeFiles($srcFiles, $targetFile, $mustMerge, $beforeMergeCallback, $extensionsFilter); + return Mage::helper('core')->mergeFiles( + $srcFiles, + $targetFile, + $mustMerge, + $beforeMergeCallback, + $extensionsFilter + ); } } @@ -704,6 +724,7 @@ public function cleanMergedJsCss() * * @param string $dirRelativeName * @param bool $cleanup + * @return bool */ protected function _initMergerDir($dirRelativeName, $cleanup = false) { @@ -738,7 +759,7 @@ public function beforeMergeCss($file, $contents) $cssImport = '/@import\\s+([\'"])(.*?)[\'"]/'; $contents = preg_replace_callback($cssImport, array($this, '_cssMergerImportCallback'), $contents); - $cssUrl = '/url\\(\\s*([^\\)\\s]+)\\s*\\)?/'; + $cssUrl = '/url\\(\\s*(?!data:)([^\\)\\s]+)\\s*\\)?/'; $contents = preg_replace_callback($cssUrl, array($this, '_cssMergerUrlCallback'), $contents); return $contents; diff --git a/app/code/core/Mage/Core/Model/Design/Source/Apply.php b/app/code/core/Mage/Core/Model/Design/Source/Apply.php index fe392e99f4..6016718fd4 100644 --- a/app/code/core/Mage/Core/Model/Design/Source/Apply.php +++ b/app/code/core/Mage/Core/Model/Design/Source/Apply.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Design/Source/Design.php b/app/code/core/Mage/Core/Model/Design/Source/Design.php index 8f0d25e1f2..f4d3f21845 100644 --- a/app/code/core/Mage/Core/Model/Design/Source/Design.php +++ b/app/code/core/Mage/Core/Model/Design/Source/Design.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Email.php b/app/code/core/Mage/Core/Model/Email.php index d2833cffa7..b3228ac744 100644 --- a/app/code/core/Mage/Core/Model/Email.php +++ b/app/code/core/Mage/Core/Model/Email.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Email/Info.php b/app/code/core/Mage/Core/Model/Email/Info.php index 6f05ee4e47..3daa151a21 100644 --- a/app/code/core/Mage/Core/Model/Email/Info.php +++ b/app/code/core/Mage/Core/Model/Email/Info.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Email/Template.php b/app/code/core/Mage/Core/Model/Email/Template.php index 51a6f9be4c..32d28b2cda 100644 --- a/app/code/core/Mage/Core/Model/Email/Template.php +++ b/app/code/core/Mage/Core/Model/Email/Template.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -71,11 +71,12 @@ class Mage_Core_Model_Email_Template extends Mage_Core_Model_Template { /** * Configuration path for default email templates - * */ - const XML_PATH_TEMPLATE_EMAIL = 'global/template/email'; - const XML_PATH_SENDING_SET_RETURN_PATH = 'system/smtp/set_return_path'; - const XML_PATH_SENDING_RETURN_PATH_EMAIL = 'system/smtp/return_path_email'; + const XML_PATH_TEMPLATE_EMAIL = 'global/template/email'; + const XML_PATH_SENDING_SET_RETURN_PATH = 'system/smtp/set_return_path'; + const XML_PATH_SENDING_RETURN_PATH_EMAIL = 'system/smtp/return_path_email'; + const XML_PATH_DESIGN_EMAIL_LOGO = 'design/email/logo'; + const XML_PATH_DESIGN_EMAIL_LOGO_ALT = 'design/email/logo_alt'; protected $_templateFilter; protected $_preprocessFlag = false; @@ -92,6 +93,43 @@ protected function _construct() $this->_init('core/email_template'); } + /** + * Return logo URL for emails + * Take logo from skin if custom logo is undefined + * + * @param Mage_Core_Model_Store|int|string $store + * @return string + */ + protected function _getLogoUrl($store) + { + $store = Mage::app()->getStore($store); + $fileName = $store->getConfig(self::XML_PATH_DESIGN_EMAIL_LOGO); + if ($fileName) { + $uploadDir = Mage_Adminhtml_Model_System_Config_Backend_Email_logo::UPLOAD_DIR; + $fullFileName = Mage::getBaseDir('media') . DS . $uploadDir . DS . $fileName; + if (file_exists($fullFileName)) { + return Mage::getBaseUrl('media') . $uploadDir . '/' . $fileName; + } + } + return Mage::getDesign()->getSkinUrl('images/logo_email.gif'); + } + + /** + * Return logo alt for emails + * + * @param Mage_Core_Model_Store|int|string $store + * @return string + */ + protected function _getLogoAlt($store) + { + $store = Mage::app()->getStore($store); + $alt = $store->getConfig(self::XML_PATH_DESIGN_EMAIL_LOGO_ALT); + if ($alt) { + return $alt; + } + return $store->getFrontendName(); + } + /** * Retrieve mail object instance * @@ -284,14 +322,21 @@ public function getProcessedTemplate(array $variables = array()) $processor->setUseSessionInUrl(false) ->setPlainTemplateMode($this->isPlain()); - if(!$this->_preprocessFlag) { + if (!$this->_preprocessFlag) { $variables['this'] = $this; } - if(isset($variables['subscriber']) && ($variables['subscriber'] instanceof Mage_Newsletter_Model_Subscriber)) { + if (isset($variables['subscriber']) && ($variables['subscriber'] instanceof Mage_Newsletter_Model_Subscriber)) { $processor->setStoreId($variables['subscriber']->getStoreId()); } + if (!isset($variables['logo_url'])) { + $variables['logo_url'] = $this->_getLogoUrl($processor->getStoreId()); + } + if (!isset($variables['logo_alt'])) { + $variables['logo_alt'] = $this->_getLogoAlt($processor->getStoreId()); + } + $processor->setIncludeProcessor(array($this, 'getInclude')) ->setVariables($variables); @@ -444,12 +489,12 @@ public function sendTransactional($templateId, $sender, $email, $name, $vars=arr } if (!$this->getId()) { - throw Mage::exception('Mage_Core', Mage::helper('core')->__('Invalid transactional email code: '.$templateId)); + throw Mage::exception('Mage_Core', Mage::helper('core')->__('Invalid transactional email code: ' . $templateId)); } if (!is_array($sender)) { - $this->setSenderName(Mage::getStoreConfig('trans_email/ident_'.$sender.'/name', $storeId)); - $this->setSenderEmail(Mage::getStoreConfig('trans_email/ident_'.$sender.'/email', $storeId)); + $this->setSenderName(Mage::getStoreConfig('trans_email/ident_' . $sender . '/name', $storeId)); + $this->setSenderEmail(Mage::getStoreConfig('trans_email/ident_' . $sender . '/email', $storeId)); } else { $this->setSenderName($sender['name']); $this->setSenderEmail($sender['email']); @@ -458,7 +503,6 @@ public function sendTransactional($templateId, $sender, $email, $name, $vars=arr if (!isset($vars['store'])) { $vars['store'] = Mage::app()->getStore($storeId); } - $this->setSentSuccess($this->send($email, $name, $vars)); return $this; } diff --git a/app/code/core/Mage/Core/Model/Email/Template/Filter.php b/app/code/core/Mage/Core/Model/Email/Template/Filter.php index a1236a48f1..7a71a12f9b 100644 --- a/app/code/core/Mage/Core/Model/Email/Template/Filter.php +++ b/app/code/core/Mage/Core/Model/Email/Template/Filter.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Email/Template/Mailer.php b/app/code/core/Mage/Core/Model/Email/Template/Mailer.php index 06f15d3ba5..803ca30717 100644 --- a/app/code/core/Mage/Core/Model/Email/Template/Mailer.php +++ b/app/code/core/Mage/Core/Model/Email/Template/Mailer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Email/Transport.php b/app/code/core/Mage/Core/Model/Email/Transport.php index 02b6ea5eaa..08ff648a60 100644 --- a/app/code/core/Mage/Core/Model/Email/Transport.php +++ b/app/code/core/Mage/Core/Model/Email/Transport.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Encryption.php b/app/code/core/Mage/Core/Model/Encryption.php index 9fffd830d8..4de64a2cdc 100644 --- a/app/code/core/Mage/Core/Model/Encryption.php +++ b/app/code/core/Mage/Core/Model/Encryption.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/File/Storage.php b/app/code/core/Mage/Core/Model/File/Storage.php index dab4ded38b..862117f7d0 100644 --- a/app/code/core/Mage/Core/Model/File/Storage.php +++ b/app/code/core/Mage/Core/Model/File/Storage.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/File/Storage/Abstract.php b/app/code/core/Mage/Core/Model/File/Storage/Abstract.php index 0f0f83b32c..aec3a1d024 100644 --- a/app/code/core/Mage/Core/Model/File/Storage/Abstract.php +++ b/app/code/core/Mage/Core/Model/File/Storage/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/File/Storage/Database.php b/app/code/core/Mage/Core/Model/File/Storage/Database.php index 32adc3aba6..9804c1ff68 100644 --- a/app/code/core/Mage/Core/Model/File/Storage/Database.php +++ b/app/code/core/Mage/Core/Model/File/Storage/Database.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/File/Storage/Database/Abstract.php b/app/code/core/Mage/Core/Model/File/Storage/Database/Abstract.php index 81b25f5abe..945789a0ad 100644 --- a/app/code/core/Mage/Core/Model/File/Storage/Database/Abstract.php +++ b/app/code/core/Mage/Core/Model/File/Storage/Database/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/File/Storage/Directory/Database.php b/app/code/core/Mage/Core/Model/File/Storage/Directory/Database.php index 7289a1609e..6f15823bde 100644 --- a/app/code/core/Mage/Core/Model/File/Storage/Directory/Database.php +++ b/app/code/core/Mage/Core/Model/File/Storage/Directory/Database.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/File/Storage/File.php b/app/code/core/Mage/Core/Model/File/Storage/File.php index 4b7798ec8d..5d63b384b3 100644 --- a/app/code/core/Mage/Core/Model/File/Storage/File.php +++ b/app/code/core/Mage/Core/Model/File/Storage/File.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/File/Storage/Flag.php b/app/code/core/Mage/Core/Model/File/Storage/Flag.php index 8dbbca1cd5..e9418815f6 100644 --- a/app/code/core/Mage/Core/Model/File/Storage/Flag.php +++ b/app/code/core/Mage/Core/Model/File/Storage/Flag.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/File/Uploader.php b/app/code/core/Mage/Core/Model/File/Uploader.php index 7c5ce1fb6a..e99cb5aecd 100644 --- a/app/code/core/Mage/Core/Model/File/Uploader.php +++ b/app/code/core/Mage/Core/Model/File/Uploader.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/File/Validator/AvailablePath.php b/app/code/core/Mage/Core/Model/File/Validator/AvailablePath.php index 0eb5b4d143..8525ffe03d 100644 --- a/app/code/core/Mage/Core/Model/File/Validator/AvailablePath.php +++ b/app/code/core/Mage/Core/Model/File/Validator/AvailablePath.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/File/Validator/NotProtectedExtension.php b/app/code/core/Mage/Core/Model/File/Validator/NotProtectedExtension.php index 5072451208..ded259b910 100644 --- a/app/code/core/Mage/Core/Model/File/Validator/NotProtectedExtension.php +++ b/app/code/core/Mage/Core/Model/File/Validator/NotProtectedExtension.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Flag.php b/app/code/core/Mage/Core/Model/Flag.php index d49a79aafe..8914ec7163 100644 --- a/app/code/core/Mage/Core/Model/Flag.php +++ b/app/code/core/Mage/Core/Model/Flag.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Input/Filter/MaliciousCode.php b/app/code/core/Mage/Core/Model/Input/Filter/MaliciousCode.php index d170299d87..808a4db793 100644 --- a/app/code/core/Mage/Core/Model/Input/Filter/MaliciousCode.php +++ b/app/code/core/Mage/Core/Model/Input/Filter/MaliciousCode.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Language.php b/app/code/core/Mage/Core/Model/Language.php index aa9e597737..77b0c65322 100644 --- a/app/code/core/Mage/Core/Model/Language.php +++ b/app/code/core/Mage/Core/Model/Language.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Layout.php b/app/code/core/Mage/Core/Model/Layout.php index 6394b37279..b22de78244 100644 --- a/app/code/core/Mage/Core/Model/Layout.php +++ b/app/code/core/Mage/Core/Model/Layout.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -170,7 +170,8 @@ public function generateXml() if ($block->getAttribute('ignore') !== null) { continue; } - if (($acl = (string)$attributes->acl) && Mage::getSingleton('admin/session')->isAllowed($acl)) { + $acl = (string)$attributes->acl; + if ($acl && Mage::getSingleton('admin/session')->isAllowed($acl)) { continue; } if (!isset($block->attributes()->ignore)) { @@ -361,13 +362,38 @@ protected function _generateAction($node, $parent) protected function _translateLayoutNode($node, &$args) { if (isset($node['translate'])) { - $items = explode(' ', (string)$node['translate']); - foreach ($items as $arg) { - if (isset($node['module'])) { - $args[$arg] = Mage::helper((string)$node['module'])->__($args[$arg]); + // Translate value by core module if module attribute was not set + $moduleName = (isset($node['module'])) ? (string)$node['module'] : 'core'; + + // Handle translations in arrays if needed + $translatableArguments = explode(' ', (string)$node['translate']); + foreach ($translatableArguments as $translatableArgumentName) { + /* + * .(dot) character is used as a path separator in nodes hierarchy + * e.g. info.title means that Magento needs to translate value of node + * that is a child of <info> node + */ + // @var $argumentHierarhy array - path to translatable item in $args array + $argumentHierarchy = explode('.', $translatableArgumentName); + $argumentStack = &$args; + $canTranslate = true; + while (is_array($argumentStack) && count($argumentStack) > 0) { + $argumentName = array_shift($argumentHierarchy); + if (isset($argumentStack[$argumentName])) { + /* + * Move to the next element in arguments hieracrhy + * in order to find target translatable argument + */ + $argumentStack = &$argumentStack[$argumentName]; + } else { + // Target argument cannot be found + $canTranslate = false; + break; + } } - else { - $args[$arg] = Mage::helper('core')->__($args[$arg]); + if ($canTranslate && is_string($argumentStack)) { + // $argumentStack is now a reference to target translatable argument so it can be translated + $argumentStack = Mage::helper($moduleName)->__($argumentStack); } } } @@ -401,7 +427,7 @@ public function unsetBlock($name) * Block Factory * * @param string $type - * @param string $blockName + * @param string $name * @param array $attributes * @return Mage_Core_Block_Abstract */ diff --git a/app/code/core/Mage/Core/Model/Layout/Data.php b/app/code/core/Mage/Core/Model/Layout/Data.php index 442c01d554..a674e3d7f0 100644 --- a/app/code/core/Mage/Core/Model/Layout/Data.php +++ b/app/code/core/Mage/Core/Model/Layout/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Layout/Element.php b/app/code/core/Mage/Core/Model/Layout/Element.php index cb8de940e8..d9c727ab7b 100644 --- a/app/code/core/Mage/Core/Model/Layout/Element.php +++ b/app/code/core/Mage/Core/Model/Layout/Element.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Layout/Update.php b/app/code/core/Mage/Core/Model/Layout/Update.php index 7e66e02eb2..ae168d424a 100644 --- a/app/code/core/Mage/Core/Model/Layout/Update.php +++ b/app/code/core/Mage/Core/Model/Layout/Update.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -259,7 +259,9 @@ public function fetchFileLayoutUpdates() $storeId = Mage::app()->getStore()->getId(); $elementClass = $this->getElementClass(); $design = Mage::getSingleton('core/design_package'); - $cacheKey = 'LAYOUT_'.$design->getArea().'_STORE'.$storeId.'_'.$design->getPackageName().'_'.$design->getTheme('layout'); + $cacheKey = 'LAYOUT_' . $design->getArea() . '_STORE' . $storeId . '_' . $design->getPackageName() . '_' + . $design->getTheme('layout'); + $cacheTags = array(self::LAYOUT_GENERAL_CACHE_TAG); if (Mage::app()->useCache('layout') && ($layoutStr = Mage::app()->loadCache($cacheKey))) { $this->_packageLayout = simplexml_load_string($layoutStr, $elementClass); @@ -358,7 +360,7 @@ public function fetchDbLayoutUpdates($handle) { $_profilerKey = 'layout/db_update: '.$handle; Varien_Profiler::start($_profilerKey); - $updateStr = Mage::getResourceModel('core/layout')->fetchUpdatesByHandle($handle); + $updateStr = $this->_getUpdateString($handle); if (!$updateStr) { return false; } @@ -372,6 +374,17 @@ public function fetchDbLayoutUpdates($handle) return true; } + /** + * Get update string + * + * @param string $handle + * @return mixed + */ + protected function _getUpdateString($handle) + { + return Mage::getResourceModel('core/layout')->fetchUpdatesByHandle($handle); + } + public function fetchRecursiveUpdates($updateXml) { foreach ($updateXml->children() as $child) { diff --git a/app/code/core/Mage/Core/Model/Locale.php b/app/code/core/Mage/Core/Model/Locale.php index cb4d1cc09c..a3cf908ac0 100644 --- a/app/code/core/Mage/Core/Model/Locale.php +++ b/app/code/core/Mage/Core/Model/Locale.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -416,6 +416,18 @@ public function getDateFormat($type=null) return $this->getTranslation($type, 'date'); } + /** + * Retrieve short date format with 4-digit year + * + * @return string + */ + public function getDateFormatWithLongYear() + { + return preg_replace('/(?<!y)yy(?!y)/', 'yyyy', + $this->getTranslation(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT, 'date')); + } + + /** * Retrieve ISO time format * @@ -556,18 +568,23 @@ public function currency($currency) { Varien_Profiler::start('locale/currency'); if (!isset(self::$_currencyCache[$this->getLocaleCode()][$currency])) { + $options = array(); try { $currencyObject = new Zend_Currency($currency, $this->getLocale()); } catch (Exception $e) { $currencyObject = new Zend_Currency($this->getCurrency(), $this->getLocale()); - $options = array( - 'name' => $currency, - 'currency' => $currency, - 'symbol' => $currency - ); - $currencyObject->setFormat($options); + $options['name'] = $currency; + $options['currency'] = $currency; + $options['symbol'] = $currency; } + $options = new Varien_Object($options); + Mage::dispatchEvent('currency_display_options_forming', array( + 'currency_options' => $options, + 'base_code' => $currency + )); + + $currencyObject->setFormat($options->toArray()); self::$_currencyCache[$this->getLocaleCode()][$currency] = $currencyObject; } Varien_Profiler::stop('locale/currency'); @@ -588,8 +605,8 @@ public function currency($currency) * '2'054.52' = 2054.52 * '2,46 GB' = 2.46 * - * @param string|int $value - * @return float + * @param string|float|int $value + * @return float|null */ public function getNumber($value) { @@ -601,9 +618,8 @@ public function getNumber($value) return floatval($value); } - //trim space and apos - $value = str_replace('\'', '', $value); - $value = str_replace(' ', '', $value); + //trim spaces and apostrophes + $value = str_replace(array('\'', ' '), '', $value); $separatorComa = strpos($value, ','); $separatorDot = strpos($value, '.'); @@ -622,11 +638,10 @@ public function getNumber($value) } return floatval($value); - //return Zend_Locale_Format::getNumber($value, array('locale' => $this->getLocaleCode())); } /** - * Functions returns array with price formating info for js function + * Functions returns array with price formatting info for js function * formatCurrency in js/varien/js.js * * @return array diff --git a/app/code/core/Mage/Core/Model/Locale/Config.php b/app/code/core/Mage/Core/Model/Locale/Config.php index 195303562f..56ee499b81 100644 --- a/app/code/core/Mage/Core/Model/Locale/Config.php +++ b/app/code/core/Mage/Core/Model/Locale/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Core_Model_Locale_Config diff --git a/app/code/core/Mage/Core/Model/Log/Adapter.php b/app/code/core/Mage/Core/Model/Log/Adapter.php index cb562d04b7..599b53aeb9 100644 --- a/app/code/core/Mage/Core/Model/Log/Adapter.php +++ b/app/code/core/Mage/Core/Model/Log/Adapter.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Message.php b/app/code/core/Mage/Core/Model/Message.php index 67bc773d0f..6597b1d966 100644 --- a/app/code/core/Mage/Core/Model/Message.php +++ b/app/code/core/Mage/Core/Model/Message.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Message/Abstract.php b/app/code/core/Mage/Core/Model/Message/Abstract.php index ff4d3d5f0d..2b009cd0a4 100644 --- a/app/code/core/Mage/Core/Model/Message/Abstract.php +++ b/app/code/core/Mage/Core/Model/Message/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -120,4 +120,16 @@ public function getIsSticky() { return $this->_isSticky; } + + /** + * Set code + * + * @param string $code + * @return Mage_Core_Model_Message_Abstract + */ + public function setCode($code) + { + $this->_code = $code; + return $this; + } } diff --git a/app/code/core/Mage/Core/Model/Message/Collection.php b/app/code/core/Mage/Core/Model/Message/Collection.php index 93dcd7975c..898900f7db 100644 --- a/app/code/core/Mage/Core/Model/Message/Collection.php +++ b/app/code/core/Mage/Core/Model/Message/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Message/Error.php b/app/code/core/Mage/Core/Model/Message/Error.php index f339a5bdd6..ea61874913 100644 --- a/app/code/core/Mage/Core/Model/Message/Error.php +++ b/app/code/core/Mage/Core/Model/Message/Error.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Message/Notice.php b/app/code/core/Mage/Core/Model/Message/Notice.php index e0c4333b2e..527c530571 100644 --- a/app/code/core/Mage/Core/Model/Message/Notice.php +++ b/app/code/core/Mage/Core/Model/Message/Notice.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Message/Success.php b/app/code/core/Mage/Core/Model/Message/Success.php index bf51fdf5b1..16b1039cbd 100644 --- a/app/code/core/Mage/Core/Model/Message/Success.php +++ b/app/code/core/Mage/Core/Model/Message/Success.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Message/Warning.php b/app/code/core/Mage/Core/Model/Message/Warning.php index ad44e90528..ef1ac3c1f0 100644 --- a/app/code/core/Mage/Core/Model/Message/Warning.php +++ b/app/code/core/Mage/Core/Model/Message/Warning.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Mysql4/Abstract.php b/app/code/core/Mage/Core/Model/Mysql4/Abstract.php index 4269cfbe2b..67b5d37caf 100644 --- a/app/code/core/Mage/Core/Model/Mysql4/Abstract.php +++ b/app/code/core/Mage/Core/Model/Mysql4/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Mysql4/Cache.php b/app/code/core/Mage/Core/Model/Mysql4/Cache.php index a0a863a333..3235a264f1 100644 --- a/app/code/core/Mage/Core/Model/Mysql4/Cache.php +++ b/app/code/core/Mage/Core/Model/Mysql4/Cache.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Mysql4/Collection/Abstract.php b/app/code/core/Mage/Core/Model/Mysql4/Collection/Abstract.php index 95a9ed0fce..41655a1f25 100644 --- a/app/code/core/Mage/Core/Model/Mysql4/Collection/Abstract.php +++ b/app/code/core/Mage/Core/Model/Mysql4/Collection/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Mysql4/Config.php b/app/code/core/Mage/Core/Model/Mysql4/Config.php index eacc1baece..10f6766a20 100644 --- a/app/code/core/Mage/Core/Model/Mysql4/Config.php +++ b/app/code/core/Mage/Core/Model/Mysql4/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Mysql4/Config/Data.php b/app/code/core/Mage/Core/Model/Mysql4/Config/Data.php index bccdc13817..6885827b66 100644 --- a/app/code/core/Mage/Core/Model/Mysql4/Config/Data.php +++ b/app/code/core/Mage/Core/Model/Mysql4/Config/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Mysql4/Config/Data/Collection.php b/app/code/core/Mage/Core/Model/Mysql4/Config/Data/Collection.php index 69c7175820..815c18e604 100644 --- a/app/code/core/Mage/Core/Model/Mysql4/Config/Data/Collection.php +++ b/app/code/core/Mage/Core/Model/Mysql4/Config/Data/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Mysql4/Design.php b/app/code/core/Mage/Core/Model/Mysql4/Design.php index 96a5b1d628..1d47181224 100644 --- a/app/code/core/Mage/Core/Model/Mysql4/Design.php +++ b/app/code/core/Mage/Core/Model/Mysql4/Design.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Mysql4/Design/Collection.php b/app/code/core/Mage/Core/Model/Mysql4/Design/Collection.php index 9a895245a0..221b60b2a0 100644 --- a/app/code/core/Mage/Core/Model/Mysql4/Design/Collection.php +++ b/app/code/core/Mage/Core/Model/Mysql4/Design/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Mysql4/Design/Package/Collection.php b/app/code/core/Mage/Core/Model/Mysql4/Design/Package/Collection.php index 2adbbe83fd..50ba173430 100644 --- a/app/code/core/Mage/Core/Model/Mysql4/Design/Package/Collection.php +++ b/app/code/core/Mage/Core/Model/Mysql4/Design/Package/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Mysql4/Design/Theme/Collection.php b/app/code/core/Mage/Core/Model/Mysql4/Design/Theme/Collection.php index cd78c568ef..af2bb2aab6 100644 --- a/app/code/core/Mage/Core/Model/Mysql4/Design/Theme/Collection.php +++ b/app/code/core/Mage/Core/Model/Mysql4/Design/Theme/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Mysql4/Email/Template.php b/app/code/core/Mage/Core/Model/Mysql4/Email/Template.php index 19633c4260..c0ac24b86d 100644 --- a/app/code/core/Mage/Core/Model/Mysql4/Email/Template.php +++ b/app/code/core/Mage/Core/Model/Mysql4/Email/Template.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Mysql4/Email/Template/Collection.php b/app/code/core/Mage/Core/Model/Mysql4/Email/Template/Collection.php index 5e18dd4b1f..384aff83c5 100644 --- a/app/code/core/Mage/Core/Model/Mysql4/Email/Template/Collection.php +++ b/app/code/core/Mage/Core/Model/Mysql4/Email/Template/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Mysql4/File/Storage/Abstract.php b/app/code/core/Mage/Core/Model/Mysql4/File/Storage/Abstract.php index d70d36f80f..77be58c47e 100644 --- a/app/code/core/Mage/Core/Model/Mysql4/File/Storage/Abstract.php +++ b/app/code/core/Mage/Core/Model/Mysql4/File/Storage/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Mysql4/File/Storage/Database.php b/app/code/core/Mage/Core/Model/Mysql4/File/Storage/Database.php index 439b710508..2d23459e79 100644 --- a/app/code/core/Mage/Core/Model/Mysql4/File/Storage/Database.php +++ b/app/code/core/Mage/Core/Model/Mysql4/File/Storage/Database.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Mysql4/File/Storage/Directory/Database.php b/app/code/core/Mage/Core/Model/Mysql4/File/Storage/Directory/Database.php index 75d51bda9e..ad6665f63d 100644 --- a/app/code/core/Mage/Core/Model/Mysql4/File/Storage/Directory/Database.php +++ b/app/code/core/Mage/Core/Model/Mysql4/File/Storage/Directory/Database.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Mysql4/File/Storage/File.php b/app/code/core/Mage/Core/Model/Mysql4/File/Storage/File.php index a1a03cbc0b..6e9cc49527 100644 --- a/app/code/core/Mage/Core/Model/Mysql4/File/Storage/File.php +++ b/app/code/core/Mage/Core/Model/Mysql4/File/Storage/File.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Mysql4/Flag.php b/app/code/core/Mage/Core/Model/Mysql4/Flag.php index 5fef62fda1..c400aaeaaf 100644 --- a/app/code/core/Mage/Core/Model/Mysql4/Flag.php +++ b/app/code/core/Mage/Core/Model/Mysql4/Flag.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Mysql4/Language.php b/app/code/core/Mage/Core/Model/Mysql4/Language.php index f98965901b..3283ddf002 100644 --- a/app/code/core/Mage/Core/Model/Mysql4/Language.php +++ b/app/code/core/Mage/Core/Model/Mysql4/Language.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Mysql4/Language/Collection.php b/app/code/core/Mage/Core/Model/Mysql4/Language/Collection.php index eb16838caf..fe329d3bc1 100644 --- a/app/code/core/Mage/Core/Model/Mysql4/Language/Collection.php +++ b/app/code/core/Mage/Core/Model/Mysql4/Language/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Mysql4/Layout.php b/app/code/core/Mage/Core/Model/Mysql4/Layout.php index 2a583e6b4e..a9ff2cb038 100644 --- a/app/code/core/Mage/Core/Model/Mysql4/Layout.php +++ b/app/code/core/Mage/Core/Model/Mysql4/Layout.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Mysql4/Resource.php b/app/code/core/Mage/Core/Model/Mysql4/Resource.php index 11e1bcd131..7116a0ce4c 100644 --- a/app/code/core/Mage/Core/Model/Mysql4/Resource.php +++ b/app/code/core/Mage/Core/Model/Mysql4/Resource.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Mysql4/Session.php b/app/code/core/Mage/Core/Model/Mysql4/Session.php index 7b42ababc6..0b209c07e8 100644 --- a/app/code/core/Mage/Core/Model/Mysql4/Session.php +++ b/app/code/core/Mage/Core/Model/Mysql4/Session.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Mysql4/Store.php b/app/code/core/Mage/Core/Model/Mysql4/Store.php index 83975ad973..cc55840e70 100644 --- a/app/code/core/Mage/Core/Model/Mysql4/Store.php +++ b/app/code/core/Mage/Core/Model/Mysql4/Store.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Mysql4/Store/Collection.php b/app/code/core/Mage/Core/Model/Mysql4/Store/Collection.php index 03cbc6eb9c..b4144e53d4 100644 --- a/app/code/core/Mage/Core/Model/Mysql4/Store/Collection.php +++ b/app/code/core/Mage/Core/Model/Mysql4/Store/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Mysql4/Store/Group.php b/app/code/core/Mage/Core/Model/Mysql4/Store/Group.php index 785c539fd9..e17f79a012 100644 --- a/app/code/core/Mage/Core/Model/Mysql4/Store/Group.php +++ b/app/code/core/Mage/Core/Model/Mysql4/Store/Group.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Mysql4/Store/Group/Collection.php b/app/code/core/Mage/Core/Model/Mysql4/Store/Group/Collection.php index b13d878f03..c6ead1b8a3 100644 --- a/app/code/core/Mage/Core/Model/Mysql4/Store/Group/Collection.php +++ b/app/code/core/Mage/Core/Model/Mysql4/Store/Group/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Mysql4/Translate.php b/app/code/core/Mage/Core/Model/Mysql4/Translate.php index 2e1373326f..72bbdb09b6 100644 --- a/app/code/core/Mage/Core/Model/Mysql4/Translate.php +++ b/app/code/core/Mage/Core/Model/Mysql4/Translate.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Mysql4/Translate/String.php b/app/code/core/Mage/Core/Model/Mysql4/Translate/String.php index c9e977b152..9f3e30992c 100644 --- a/app/code/core/Mage/Core/Model/Mysql4/Translate/String.php +++ b/app/code/core/Mage/Core/Model/Mysql4/Translate/String.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Mysql4/Url/Rewrite.php b/app/code/core/Mage/Core/Model/Mysql4/Url/Rewrite.php index fa5962405d..2fefa0a62e 100644 --- a/app/code/core/Mage/Core/Model/Mysql4/Url/Rewrite.php +++ b/app/code/core/Mage/Core/Model/Mysql4/Url/Rewrite.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Mysql4/Url/Rewrite/Collection.php b/app/code/core/Mage/Core/Model/Mysql4/Url/Rewrite/Collection.php index edb917e105..c7c49e7ce8 100644 --- a/app/code/core/Mage/Core/Model/Mysql4/Url/Rewrite/Collection.php +++ b/app/code/core/Mage/Core/Model/Mysql4/Url/Rewrite/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Mysql4/Variable.php b/app/code/core/Mage/Core/Model/Mysql4/Variable.php index a660f0c733..d114944241 100644 --- a/app/code/core/Mage/Core/Model/Mysql4/Variable.php +++ b/app/code/core/Mage/Core/Model/Mysql4/Variable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Mysql4/Variable/Collection.php b/app/code/core/Mage/Core/Model/Mysql4/Variable/Collection.php index fa23931078..4327c59767 100644 --- a/app/code/core/Mage/Core/Model/Mysql4/Variable/Collection.php +++ b/app/code/core/Mage/Core/Model/Mysql4/Variable/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Mysql4/Website.php b/app/code/core/Mage/Core/Model/Mysql4/Website.php index af3819ee97..9c5697414b 100644 --- a/app/code/core/Mage/Core/Model/Mysql4/Website.php +++ b/app/code/core/Mage/Core/Model/Mysql4/Website.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Mysql4/Website/Collection.php b/app/code/core/Mage/Core/Model/Mysql4/Website/Collection.php index 4080007d7f..e1bcab52fd 100644 --- a/app/code/core/Mage/Core/Model/Mysql4/Website/Collection.php +++ b/app/code/core/Mage/Core/Model/Mysql4/Website/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Observer.php b/app/code/core/Mage/Core/Model/Observer.php index aaad029c07..615e25d0d6 100644 --- a/app/code/core/Mage/Core/Model/Observer.php +++ b/app/code/core/Mage/Core/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -94,4 +94,15 @@ public function addSynchronizeNotification(Varien_Event_Observer $observer) return $this; } + + /** + * Cron job method to clean old cache resources + * + * @param Mage_Cron_Model_Schedule $schedule + */ + public function cleanCache(Mage_Cron_Model_Schedule $schedule) + { + Mage::app()->getCache()->clean(Zend_Cache::CLEANING_MODE_OLD); + Mage::dispatchEvent('core_clean_cache'); + } } diff --git a/app/code/core/Mage/Core/Model/Resource.php b/app/code/core/Mage/Core/Model/Resource.php index 1e286060d7..44708e4dc7 100644 --- a/app/code/core/Mage/Core/Model/Resource.php +++ b/app/code/core/Mage/Core/Model/Resource.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Abstract.php b/app/code/core/Mage/Core/Model/Resource/Abstract.php index 21aacc295f..a1420239b7 100644 --- a/app/code/core/Mage/Core/Model/Resource/Abstract.php +++ b/app/code/core/Mage/Core/Model/Resource/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Cache.php b/app/code/core/Mage/Core/Model/Resource/Cache.php index 0ac3e8c4a9..bf3f05f482 100644 --- a/app/code/core/Mage/Core/Model/Resource/Cache.php +++ b/app/code/core/Mage/Core/Model/Resource/Cache.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Config.php b/app/code/core/Mage/Core/Model/Resource/Config.php index 60fb918b63..d4210b281e 100644 --- a/app/code/core/Mage/Core/Model/Resource/Config.php +++ b/app/code/core/Mage/Core/Model/Resource/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Config/Data.php b/app/code/core/Mage/Core/Model/Resource/Config/Data.php index 93bb3b5ac7..688002af99 100644 --- a/app/code/core/Mage/Core/Model/Resource/Config/Data.php +++ b/app/code/core/Mage/Core/Model/Resource/Config/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Config/Data/Collection.php b/app/code/core/Mage/Core/Model/Resource/Config/Data/Collection.php index 83c2136308..69807da1e3 100644 --- a/app/code/core/Mage/Core/Model/Resource/Config/Data/Collection.php +++ b/app/code/core/Mage/Core/Model/Resource/Config/Data/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php b/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php index 3a08d1db28..06d061229d 100644 --- a/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php +++ b/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -332,6 +332,11 @@ protected function _getConnection($connectionName) */ protected function _getReadAdapter() { + $writeAdapter = $this->_getWriteAdapter(); + if ($writeAdapter && $writeAdapter->getTransactionLevel() > 0) { + // if transaction is started we should use write connection for reading + return $writeAdapter; + } return $this->_getConnection('read'); } diff --git a/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php b/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php index 0660a708c9..6e8341b613 100644 --- a/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php +++ b/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Design.php b/app/code/core/Mage/Core/Model/Resource/Design.php index 5ca9a33452..b7de143ca7 100644 --- a/app/code/core/Mage/Core/Model/Resource/Design.php +++ b/app/code/core/Mage/Core/Model/Resource/Design.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Design/Collection.php b/app/code/core/Mage/Core/Model/Resource/Design/Collection.php index a243b61f50..aec260be76 100644 --- a/app/code/core/Mage/Core/Model/Resource/Design/Collection.php +++ b/app/code/core/Mage/Core/Model/Resource/Design/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Design/Package/Collection.php b/app/code/core/Mage/Core/Model/Resource/Design/Package/Collection.php index e36b15f9e4..2a4c2bfd23 100755 --- a/app/code/core/Mage/Core/Model/Resource/Design/Package/Collection.php +++ b/app/code/core/Mage/Core/Model/Resource/Design/Package/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Email/Template.php b/app/code/core/Mage/Core/Model/Resource/Email/Template.php index e8f504c23b..c5a1e997d3 100644 --- a/app/code/core/Mage/Core/Model/Resource/Email/Template.php +++ b/app/code/core/Mage/Core/Model/Resource/Email/Template.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Email/Template/Collection.php b/app/code/core/Mage/Core/Model/Resource/Email/Template/Collection.php index 1dabbcd39b..50d3ae8120 100644 --- a/app/code/core/Mage/Core/Model/Resource/Email/Template/Collection.php +++ b/app/code/core/Mage/Core/Model/Resource/Email/Template/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Entity/Abstract.php b/app/code/core/Mage/Core/Model/Resource/Entity/Abstract.php index 2d582e2b95..fb99b53096 100644 --- a/app/code/core/Mage/Core/Model/Resource/Entity/Abstract.php +++ b/app/code/core/Mage/Core/Model/Resource/Entity/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Entity/Table.php b/app/code/core/Mage/Core/Model/Resource/Entity/Table.php index 68380e149e..12923593fe 100644 --- a/app/code/core/Mage/Core/Model/Resource/Entity/Table.php +++ b/app/code/core/Mage/Core/Model/Resource/Entity/Table.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/File/Storage/Abstract.php b/app/code/core/Mage/Core/Model/Resource/File/Storage/Abstract.php index 6d0079a666..12477905d2 100644 --- a/app/code/core/Mage/Core/Model/Resource/File/Storage/Abstract.php +++ b/app/code/core/Mage/Core/Model/Resource/File/Storage/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/File/Storage/Database.php b/app/code/core/Mage/Core/Model/Resource/File/Storage/Database.php index 2e52e94397..ebce8095da 100644 --- a/app/code/core/Mage/Core/Model/Resource/File/Storage/Database.php +++ b/app/code/core/Mage/Core/Model/Resource/File/Storage/Database.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/File/Storage/Directory/Database.php b/app/code/core/Mage/Core/Model/Resource/File/Storage/Directory/Database.php index 591777784f..19a56f11bf 100644 --- a/app/code/core/Mage/Core/Model/Resource/File/Storage/Directory/Database.php +++ b/app/code/core/Mage/Core/Model/Resource/File/Storage/Directory/Database.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/File/Storage/File.php b/app/code/core/Mage/Core/Model/Resource/File/Storage/File.php index f0bee37e04..fa4ab3a038 100644 --- a/app/code/core/Mage/Core/Model/Resource/File/Storage/File.php +++ b/app/code/core/Mage/Core/Model/Resource/File/Storage/File.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Flag.php b/app/code/core/Mage/Core/Model/Resource/Flag.php index e895176e42..512c2d8246 100644 --- a/app/code/core/Mage/Core/Model/Resource/Flag.php +++ b/app/code/core/Mage/Core/Model/Resource/Flag.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Helper/Abstract.php b/app/code/core/Mage/Core/Model/Resource/Helper/Abstract.php index 0f6ba6e629..e9c4b335b5 100644 --- a/app/code/core/Mage/Core/Model/Resource/Helper/Abstract.php +++ b/app/code/core/Mage/Core/Model/Resource/Helper/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Helper/Mysql4.php b/app/code/core/Mage/Core/Model/Resource/Helper/Mysql4.php index 3c97725b6d..d1738d51f9 100644 --- a/app/code/core/Mage/Core/Model/Resource/Helper/Mysql4.php +++ b/app/code/core/Mage/Core/Model/Resource/Helper/Mysql4.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Iterator.php b/app/code/core/Mage/Core/Model/Resource/Iterator.php index 1b7d5e1d33..4a14bfa743 100644 --- a/app/code/core/Mage/Core/Model/Resource/Iterator.php +++ b/app/code/core/Mage/Core/Model/Resource/Iterator.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Language.php b/app/code/core/Mage/Core/Model/Resource/Language.php index 2e390d0226..ba564948d0 100755 --- a/app/code/core/Mage/Core/Model/Resource/Language.php +++ b/app/code/core/Mage/Core/Model/Resource/Language.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Language/Collection.php b/app/code/core/Mage/Core/Model/Resource/Language/Collection.php index f025c13b85..26b793bb8d 100644 --- a/app/code/core/Mage/Core/Model/Resource/Language/Collection.php +++ b/app/code/core/Mage/Core/Model/Resource/Language/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Layout.php b/app/code/core/Mage/Core/Model/Resource/Layout.php index f13a5a1c8d..de214f764b 100644 --- a/app/code/core/Mage/Core/Model/Resource/Layout.php +++ b/app/code/core/Mage/Core/Model/Resource/Layout.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Resource.php b/app/code/core/Mage/Core/Model/Resource/Resource.php index 7290509666..e550b3e6b4 100644 --- a/app/code/core/Mage/Core/Model/Resource/Resource.php +++ b/app/code/core/Mage/Core/Model/Resource/Resource.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Session.php b/app/code/core/Mage/Core/Model/Resource/Session.php index a48c59282a..3fc4817ad8 100644 --- a/app/code/core/Mage/Core/Model/Resource/Session.php +++ b/app/code/core/Mage/Core/Model/Resource/Session.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Setup.php b/app/code/core/Mage/Core/Model/Resource/Setup.php index 8abe27479a..e9c35d7013 100644 --- a/app/code/core/Mage/Core/Model/Resource/Setup.php +++ b/app/code/core/Mage/Core/Model/Resource/Setup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Setup/Query/Modifier.php b/app/code/core/Mage/Core/Model/Resource/Setup/Query/Modifier.php index 594c84470b..72632af12a 100644 --- a/app/code/core/Mage/Core/Model/Resource/Setup/Query/Modifier.php +++ b/app/code/core/Mage/Core/Model/Resource/Setup/Query/Modifier.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Store.php b/app/code/core/Mage/Core/Model/Resource/Store.php index 59422745bf..4ac77866ab 100644 --- a/app/code/core/Mage/Core/Model/Resource/Store.php +++ b/app/code/core/Mage/Core/Model/Resource/Store.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Store/Collection.php b/app/code/core/Mage/Core/Model/Resource/Store/Collection.php index 9cf66732e8..67e6223a54 100644 --- a/app/code/core/Mage/Core/Model/Resource/Store/Collection.php +++ b/app/code/core/Mage/Core/Model/Resource/Store/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Store/Group.php b/app/code/core/Mage/Core/Model/Resource/Store/Group.php index 1c06a28318..84884a7393 100644 --- a/app/code/core/Mage/Core/Model/Resource/Store/Group.php +++ b/app/code/core/Mage/Core/Model/Resource/Store/Group.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Store/Group/Collection.php b/app/code/core/Mage/Core/Model/Resource/Store/Group/Collection.php index d046909fc8..dca55de8c8 100644 --- a/app/code/core/Mage/Core/Model/Resource/Store/Group/Collection.php +++ b/app/code/core/Mage/Core/Model/Resource/Store/Group/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -40,7 +40,7 @@ class Mage_Core_Model_Resource_Store_Group_Collection extends Mage_Core_Model_Re * @deprecated since 1.5.0.0 * @var boolean */ - protected $_loadDefault = false; + protected $_loadDefault = false; /** * Define resource model @@ -56,12 +56,12 @@ protected function _construct() * Set flag for load default (admin) store * * @param boolean $loadDefault + * * @return Mage_Core_Model_Resource_Store_Group_Collection */ public function setLoadDefault($loadDefault) { - $this->setFlag('load_default_store_group', (bool)$loadDefault); - return $this; + return $this->setFlag('load_default_store_group', (bool)$loadDefault); } /** @@ -75,21 +75,28 @@ public function getLoadDefault() } /** - * Add disable default store group filter to collection + * Add disable default store group filter to collection * * @return Mage_Core_Model_Resource_Store_Group_Collection */ public function setWithoutDefaultFilter() { - $this->addFieldToFilter('main_table.group_id', array('gt' => 0)); - return $this; + return $this->addFieldToFilter('main_table.group_id', array('gt' => 0)); + } + + /** + * Filter to discard stores without views + * + * @return Mage_Core_Model_Resource_Store_Group_Collection + */ + public function setWithoutStoreViewFilter() + { + return $this->addFieldToFilter('main_table.default_store_id', array('gt' => 0)); } /** * Load collection data * - * @param boolean $printQuery - * @param boolean $logQuery * @return Mage_Core_Model_Resource_Store_Group_Collection */ public function _beforeLoad() @@ -111,15 +118,15 @@ public function toOptionArray() return $this->_toOptionArray('group_id', 'name'); } - /** + /** * Add filter by website to collection * * @param int|array $website - * @return Mage_Core_Model_Resource_Store_Collection + * + * @return Mage_Core_Model_Resource_Store_Group_Collection */ public function addWebsiteFilter($website) { return $this->addFieldToFilter('main_table.website_id', array('in' => $website)); } - } diff --git a/app/code/core/Mage/Core/Model/Resource/Transaction.php b/app/code/core/Mage/Core/Model/Resource/Transaction.php index 5fed71dc03..e6ae97ecfa 100644 --- a/app/code/core/Mage/Core/Model/Resource/Transaction.php +++ b/app/code/core/Mage/Core/Model/Resource/Transaction.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Translate.php b/app/code/core/Mage/Core/Model/Resource/Translate.php index fc1e8d0a70..f8617dae4a 100644 --- a/app/code/core/Mage/Core/Model/Resource/Translate.php +++ b/app/code/core/Mage/Core/Model/Resource/Translate.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Translate/String.php b/app/code/core/Mage/Core/Model/Resource/Translate/String.php index 44268009e1..c992c0e931 100644 --- a/app/code/core/Mage/Core/Model/Resource/Translate/String.php +++ b/app/code/core/Mage/Core/Model/Resource/Translate/String.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Type/Abstract.php b/app/code/core/Mage/Core/Model/Resource/Type/Abstract.php index fbf1a9142b..870f73865b 100644 --- a/app/code/core/Mage/Core/Model/Resource/Type/Abstract.php +++ b/app/code/core/Mage/Core/Model/Resource/Type/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Type/Db.php b/app/code/core/Mage/Core/Model/Resource/Type/Db.php index 67f3430c87..6ebb2af660 100644 --- a/app/code/core/Mage/Core/Model/Resource/Type/Db.php +++ b/app/code/core/Mage/Core/Model/Resource/Type/Db.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Type/Db/Mysqli.php b/app/code/core/Mage/Core/Model/Resource/Type/Db/Mysqli.php index 7f8f28625c..e9f4f27e00 100644 --- a/app/code/core/Mage/Core/Model/Resource/Type/Db/Mysqli.php +++ b/app/code/core/Mage/Core/Model/Resource/Type/Db/Mysqli.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Type/Db/Mysqli/Setup.php b/app/code/core/Mage/Core/Model/Resource/Type/Db/Mysqli/Setup.php index ea0444c3fe..50e165d90f 100644 --- a/app/code/core/Mage/Core/Model/Resource/Type/Db/Mysqli/Setup.php +++ b/app/code/core/Mage/Core/Model/Resource/Type/Db/Mysqli/Setup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Type/Db/Pdo/Mysql.php b/app/code/core/Mage/Core/Model/Resource/Type/Db/Pdo/Mysql.php index 3b905f2ec5..32e99cb1a0 100644 --- a/app/code/core/Mage/Core/Model/Resource/Type/Db/Pdo/Mysql.php +++ b/app/code/core/Mage/Core/Model/Resource/Type/Db/Pdo/Mysql.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Url/Rewrite.php b/app/code/core/Mage/Core/Model/Resource/Url/Rewrite.php index 4fdef622aa..6294e779b7 100644 --- a/app/code/core/Mage/Core/Model/Resource/Url/Rewrite.php +++ b/app/code/core/Mage/Core/Model/Resource/Url/Rewrite.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Url/Rewrite/Collection.php b/app/code/core/Mage/Core/Model/Resource/Url/Rewrite/Collection.php index 7a46f2c8d1..553bfc1e4c 100644 --- a/app/code/core/Mage/Core/Model/Resource/Url/Rewrite/Collection.php +++ b/app/code/core/Mage/Core/Model/Resource/Url/Rewrite/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Variable.php b/app/code/core/Mage/Core/Model/Resource/Variable.php index 0826809cc7..d91c35bc7d 100644 --- a/app/code/core/Mage/Core/Model/Resource/Variable.php +++ b/app/code/core/Mage/Core/Model/Resource/Variable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Variable/Collection.php b/app/code/core/Mage/Core/Model/Resource/Variable/Collection.php index 640cef2d56..f355bf3639 100644 --- a/app/code/core/Mage/Core/Model/Resource/Variable/Collection.php +++ b/app/code/core/Mage/Core/Model/Resource/Variable/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Website.php b/app/code/core/Mage/Core/Model/Resource/Website.php index 4d75ae7765..f1e1110044 100644 --- a/app/code/core/Mage/Core/Model/Resource/Website.php +++ b/app/code/core/Mage/Core/Model/Resource/Website.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Website/Collection.php b/app/code/core/Mage/Core/Model/Resource/Website/Collection.php index 0837edbbb1..d1484e4940 100644 --- a/app/code/core/Mage/Core/Model/Resource/Website/Collection.php +++ b/app/code/core/Mage/Core/Model/Resource/Website/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Session.php b/app/code/core/Mage/Core/Model/Session.php index a188c5fa21..ea52f0690e 100644 --- a/app/code/core/Mage/Core/Model/Session.php +++ b/app/code/core/Mage/Core/Model/Session.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Session/Abstract.php b/app/code/core/Mage/Core/Model/Session/Abstract.php index 0f617b50b8..4210ea0a81 100644 --- a/app/code/core/Mage/Core/Model/Session/Abstract.php +++ b/app/code/core/Mage/Core/Model/Session/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -220,7 +220,7 @@ public function getMessages($clear=false) } /** - * Not Mage exeption handling + * Not Mage exception handling * * @param Exception $exception * @param string $alternativeText @@ -278,7 +278,7 @@ public function addWarning($message) } /** - * Adding new nitice message + * Adding new notice message * * @param string $message * @return Mage_Core_Model_Session_Abstract @@ -379,12 +379,6 @@ public function setSessionId($id=null) $_queryParam = $this->getSessionIdQueryParam(); if (isset($_GET[$_queryParam]) && Mage::getSingleton('core/url')->isOwnOriginUrl()) { $id = $_GET[$_queryParam]; - /** - * No reason use crypt key for session - */ -// if ($tryId = Mage::helper('core')->decrypt($_GET[self::SESSION_ID_QUERY_PARAM])) { -// $id = $tryId; -// } } } @@ -393,20 +387,14 @@ public function setSessionId($id=null) } /** - * Get ecrypted session identifuer - * No reason use crypt key for session id encryption - * we can use session identifier as is + * Get encrypted session identifier. + * No reason use crypt key for session id encryption, we can use session identifier as is. * * @return string */ public function getEncryptedSessionId() { if (!self::$_encryptedSessionId) { -// $helper = Mage::helper('core'); -// if (!$helper) { -// return $this; -// } -// self::$_encryptedSessionId = $helper->encrypt($this->getSessionId()); self::$_encryptedSessionId = $this->getSessionId(); } return self::$_encryptedSessionId; @@ -444,7 +432,7 @@ public function getSkipSessionIdFlag() } /** - * If the host was switched but session cookie won't recognize it - add session id to query + * If session cookie is not applicable due to host or path mismatch - add session id to query * * @param string $urlHost can be host or url * @return string {session_id_key}={session_id_encrypted} @@ -455,7 +443,8 @@ public function getSessionIdForHost($urlHost) return ''; } - if (!$httpHost = Mage::app()->getFrontController()->getRequest()->getHttpHost()) { + $httpHost = Mage::app()->getFrontController()->getRequest()->getHttpHost(); + if (!$httpHost) { return ''; } @@ -463,23 +452,22 @@ public function getSessionIdForHost($urlHost) if (!empty($urlHostArr[2])) { $urlHost = $urlHostArr[2]; } + $urlPath = empty($urlHostArr[3]) ? '' : $urlHostArr[3]; if (!isset(self::$_urlHostCache[$urlHost])) { $urlHostArr = explode(':', $urlHost); $urlHost = $urlHostArr[0]; - - if ($httpHost !== $urlHost && !$this->isValidForHost($urlHost)) { - $sessionId = $this->getEncryptedSessionId(); - } else { - $sessionId = ''; - } + $sessionId = $httpHost !== $urlHost && !$this->isValidForHost($urlHost) + ? $this->getEncryptedSessionId() : ''; self::$_urlHostCache[$urlHost] = $sessionId; } - return self::$_urlHostCache[$urlHost]; + + return Mage::app()->getStore()->isAdmin() || $this->isValidForPath($urlPath) ? self::$_urlHostCache[$urlHost] + : $this->getEncryptedSessionId(); } /** - * Check is valid session for hostname + * Check if session is valid for given hostname * * @param string $host * @return bool @@ -488,7 +476,25 @@ public function isValidForHost($host) { $hostArr = explode(':', $host); $hosts = $this->getSessionHosts(); - return (!empty($hosts[$hostArr[0]])); + return !empty($hosts[$hostArr[0]]); + } + + /** + * Check if session is valid for given path + * + * @param string $path + * @return bool + */ + public function isValidForPath($path) + { + $cookiePath = trim($this->getCookiePath(), '/') . '/'; + if ($cookiePath == '/') { + return true; + } + + $urlPath = trim($path, '/') . '/'; + + return strpos($urlPath, $cookiePath) === 0; } /** @@ -574,5 +580,4 @@ public function renewSession() return $this; } - } diff --git a/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php b/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php index a2bd8e5c94..74166ea9ff 100644 --- a/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php +++ b/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -34,7 +34,7 @@ class Mage_Core_Model_Session_Abstract_Varien extends Varien_Object const VALIDATOR_REMOTE_ADDR_KEY = 'remote_addr'; /** - * Conigure and start session + * Configure and start session * * @param string $sessionName * @return Mage_Core_Model_Session_Abstract_Varien @@ -56,6 +56,10 @@ public function start($sessionName=null) ini_set('session.save_handler', 'memcache'); session_save_path($this->getSessionSavePath()); break; + case 'memcached': + ini_set('session.save_handler', 'memcached'); + session_save_path($this->getSessionSavePath()); + break; case 'eaccelerator': ini_set('session.save_handler', 'eaccelerator'); break; @@ -376,7 +380,13 @@ protected function _validate() } if ($this->useValidateHttpUserAgent() && $sessionData[self::VALIDATOR_HTTP_USER_AGENT_KEY] != $validatorData[self::VALIDATOR_HTTP_USER_AGENT_KEY] - && !in_array($validatorData[self::VALIDATOR_HTTP_USER_AGENT_KEY], $this->getValidateHttpUserAgentSkip())) { + ) { + $userAgentValidated = $this->getValidateHttpUserAgentSkip(); + foreach ($userAgentValidated as $agent) { + if (preg_match('/' . $agent . '/iu', $validatorData[self::VALIDATOR_HTTP_USER_AGENT_KEY])) { + return true; + } + } return false; } diff --git a/app/code/core/Mage/Core/Model/Session/Abstract/Zend.php b/app/code/core/Mage/Core/Model/Session/Abstract/Zend.php index 8e083f5deb..0eacf9abad 100644 --- a/app/code/core/Mage/Core/Model/Session/Abstract/Zend.php +++ b/app/code/core/Mage/Core/Model/Session/Abstract/Zend.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Session/Exception.php b/app/code/core/Mage/Core/Model/Session/Exception.php index f21bee10d6..07bfa6537e 100644 --- a/app/code/core/Mage/Core/Model/Session/Exception.php +++ b/app/code/core/Mage/Core/Model/Session/Exception.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Source/Email/Variables.php b/app/code/core/Mage/Core/Model/Source/Email/Variables.php index 65480ce5a5..31c8f35971 100644 --- a/app/code/core/Mage/Core/Model/Source/Email/Variables.php +++ b/app/code/core/Mage/Core/Model/Source/Email/Variables.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Store.php b/app/code/core/Mage/Core/Model/Store.php index b939d56153..bb9cd89079 100644 --- a/app/code/core/Mage/Core/Model/Store.php +++ b/app/code/core/Mage/Core/Model/Store.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -96,10 +96,15 @@ class Mage_Core_Model_Store extends Mage_Core_Model_Abstract */ const COOKIE_NAME = 'store'; + /** + * Cookie currency key + */ + const COOKIE_CURRENCY = 'currency'; + /** * Script name, which returns all the images */ - const MEDIA_REWRITE_SCRIPT = 'get.php/'; + const MEDIA_REWRITE_SCRIPT = 'get.php/'; /** * Cache flag @@ -787,9 +792,9 @@ public function setCurrentCurrencyCode($code) if (in_array($code, $this->getAvailableCurrencyCodes())) { $this->_getSession()->setCurrencyCode($code); if ($code == $this->getDefaultCurrency()) { - Mage::app()->getCookie()->delete('currency', $code); + Mage::app()->getCookie()->delete(self::COOKIE_CURRENCY, $code); } else { - Mage::app()->getCookie()->set('currency', $code); + Mage::app()->getCookie()->set(self::COOKIE_CURRENCY, $code); } } return $this; diff --git a/app/code/core/Mage/Core/Model/Store/Api.php b/app/code/core/Mage/Core/Model/Store/Api.php index 3271c070ad..9420ee59c0 100644 --- a/app/code/core/Mage/Core/Model/Store/Api.php +++ b/app/code/core/Mage/Core/Model/Store/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Store/Api/V2.php b/app/code/core/Mage/Core/Model/Store/Api/V2.php index 1e08e5ca00..138c697515 100644 --- a/app/code/core/Mage/Core/Model/Store/Api/V2.php +++ b/app/code/core/Mage/Core/Model/Store/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Store/Exception.php b/app/code/core/Mage/Core/Model/Store/Exception.php index 215e31f253..78f2395b08 100644 --- a/app/code/core/Mage/Core/Model/Store/Exception.php +++ b/app/code/core/Mage/Core/Model/Store/Exception.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Store/Group.php b/app/code/core/Mage/Core/Model/Store/Group.php index 60a7cf17b4..8b1cb01ff6 100644 --- a/app/code/core/Mage/Core/Model/Store/Group.php +++ b/app/code/core/Mage/Core/Model/Store/Group.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -227,6 +227,46 @@ public function getDefaultStore() return $this->_defaultStore; } + /** + * Get most suitable store by locale + * If no store with given locale is found - default store is returned + * If group has no stores - null is returned + * + * @param string $locale + * @return Mage_Core_Model_Store|null + */ + public function getDefaultStoreByLocale($locale) + { + if ($this->getDefaultStore() && $this->getDefaultStore()->getLocaleCode() == $locale) { + return $this->getDefaultStore(); + } else { + $stores = $this->getStoresByLocale($locale); + if (count($stores)) { + return $stores[0]; + } else { + return $this->getDefaultStore() ? $this->getDefaultStore() : null; + } + } + } + + /** + * Retrieve list of stores with given locale + * + * @param $locale + * @return array + */ + public function getStoresByLocale($locale) + { + $stores = array(); + foreach ($this->getStores() as $store) { + /* @var $store Mage_Core_Model_Store */ + if ($store->getLocaleCode() == $locale) { + array_push($stores, $store); + } + } + return $stores; + } + /** * Set website model * diff --git a/app/code/core/Mage/Core/Model/Template.php b/app/code/core/Mage/Core/Model/Template.php index dae8af5dca..1f04d4778a 100644 --- a/app/code/core/Mage/Core/Model/Template.php +++ b/app/code/core/Mage/Core/Model/Template.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Translate.php b/app/code/core/Mage/Core/Model/Translate.php index 87444f3cad..2e7847297b 100644 --- a/app/code/core/Mage/Core/Model/Translate.php +++ b/app/code/core/Mage/Core/Model/Translate.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Translate/Expr.php b/app/code/core/Mage/Core/Model/Translate/Expr.php index 9de35666c6..b5a785e52d 100644 --- a/app/code/core/Mage/Core/Model/Translate/Expr.php +++ b/app/code/core/Mage/Core/Model/Translate/Expr.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Translate/Inline.php b/app/code/core/Mage/Core/Model/Translate/Inline.php index 6db6a05f52..bdfe8e15a3 100644 --- a/app/code/core/Mage/Core/Model/Translate/Inline.php +++ b/app/code/core/Mage/Core/Model/Translate/Inline.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -69,6 +69,13 @@ class Mage_Core_Model_Translate_Inline */ protected $_isJson = false; + /** + * Get max translate block in same tag + * + * @var int + */ + protected $_maxTranslateBlocks = 7; + /** * List of global tags * @@ -87,7 +94,6 @@ class Mage_Core_Model_Translate_Inline protected $_allowedTagsSimple = array( 'legend' => 'Caption for the fieldset element', 'label' => 'Label for an input element.', - 'option' => 'Drop-down list option', 'button' => 'Push button', 'a' => 'Link label', 'b' => 'Bold text', @@ -108,7 +114,6 @@ class Mage_Core_Model_Translate_Inline 'dd' => 'Item description in a definition list.', 'caption' => 'Table caption', 'th' => 'Header cell in a table', - 'td' => 'Standard cell in a table', 'abbr' => 'Abbreviated phrase', 'acronym' => 'An acronym', 'var' => 'Variable part of a text', @@ -124,7 +129,8 @@ class Mage_Core_Model_Translate_Inline 'h6' => 'Heading level 6', 'p' => 'Paragraph', 'pre' => 'Preformatted text', - 'center' => 'Centered text' + 'center' => 'Centered text', + 'select' => 'List options', ); /** @@ -201,8 +207,7 @@ public function stripInlineTranslations(&$body) $this->stripInlineTranslations($part); } } else if (is_string($body)) { - $body = preg_replace('#'.$this->_tokenRegex.'#', '$1', $body); - $body = preg_replace('/{{escape.*?}}/', '', $body); + $body = preg_replace('#' . $this->_tokenRegex . '#', '$1', $body); } return $this; } @@ -229,17 +234,20 @@ public function processResponseBody(&$body) } else if (is_string($body)) { $this->_content = $body; - $this->_tagAttributes(); $this->_specialTags(); + $this->_tagAttributes(); $this->_otherText(); $this->_insertInlineScriptsHtml(); - $this->_escapeInline(); + $body = $this->_content; } return $this; } + /** + * Add translate js to body + */ protected function _insertInlineScriptsHtml() { if ($this->_isScriptInserted || stripos($this->_content, '</body>')===false) { @@ -253,11 +261,12 @@ protected function _insertInlineScriptsHtml() $trigImg = Mage::getDesign()->getSkinUrl('images/fam_book_open.png'); ob_start(); + $magentoSkinUrl = Mage::getDesign()->getSkinUrl('lib/prototype/windows/themes/magento.css'); ?> <!-- script type="text/javascript" src="<?php echo $baseJsUrl ?>prototype/effects.js"></script --> <script type="text/javascript" src="<?php echo $baseJsUrl ?>prototype/window.js"></script> <link rel="stylesheet" type="text/css" href="<?php echo $baseJsUrl ?>prototype/windows/themes/default.css"/> -<link rel="stylesheet" type="text/css" href="<?php echo $baseJsUrl ?>prototype/windows/themes/magento.css"/> +<link rel="stylesheet" type="text/css" href="<?php echo $magentoSkinUrl; ?>"/> <script type="text/javascript" src="<?php echo $baseJsUrl ?>mage/translate_inline.js"></script> <link rel="stylesheet" type="text/css" href="<?php echo $baseJsUrl ?>mage/translate_inline.css"/> @@ -270,7 +279,7 @@ protected function _insertInlineScriptsHtml() <?php $html = ob_get_clean(); - $this->_content = str_ireplace('</body>', $html.'</body>', $this->_content); + $this->_content = str_ireplace('</body>', $html . '</body>', $this->_content); $this->_isScriptInserted = true; } @@ -287,25 +296,63 @@ protected function _escape($string) } /** - * Escapes quoting inside inline translations. Useful when inline translation is inserted inside a JS string. - * @see Mage_Core_Helper_Translate::inlineTranslateStartMarker() - * @see Mage_Core_Helper_Translate::inlineTranslateEndMarker() - * @return Mage_Core_Model_Translate_Inline + * Get attribute location + * + * @param array $matches + * @param array $options + * @return string */ - protected function _escapeInline() + protected function _getAttributeLocation($matches, $options) { - // {{escape='}}some_javascript_with_'_inside{{escape}} - while (preg_match('/\{\{escape=(.)\}\}(.*?)\{\{escape\}\}/', $this->_content, $matches)) { - // escape double quote character to make it possible to use it inside "" - $charToEscape = str_replace('"', '\\"', $matches[1]); - // preg_replace() used to avoid escaping already escaped quotes - $part = preg_replace("/[^\\\\]{$charToEscape}/", "\\{$charToEscape}", $matches[2]); - // Replace markers+string with the string itself - $this->_content = str_replace($matches[0], $part, $this->_content); + return 'Tag attribute (ALT, TITLE, etc.)'; + } + + /** + * Get tag location + * + * @param array $matches + * @param array $options + * @return string + */ + protected function _getTagLocation($matches, $options) + { + $tagName = strtolower($options['tagName']); + + if (isset($options['tagList'][$tagName])) { + return $options['tagList'][$tagName]; } - return $this; + + return ucfirst($tagName) . ' Text'; } + /** + * Get translate data by regexp + * + * @param string $regexp + * @param string $text + * @param string|array $locationCallback + * @param array $options + * @return array + */ + protected function _getTranslateData($regexp, &$text, $locationCallback, $options = array()) + { + $trArr = array(); + $next = 0; + while (preg_match($regexp, $text, $m, PREG_OFFSET_CAPTURE, $next)) { + $trArr[] = json_encode(array( + 'shown' => $m[1][0], + 'translated' => $m[2][0], + 'original' => $m[3][0], + 'location' => call_user_func($locationCallback, $m, $options), + 'scope' => $m[4][0], + )); + $text = substr_replace($text, $m[1][0], $m[0][1], strlen($m[0][0])); + $next = $m[0][1]; + } + return $trArr; + } + + /** * Prepare tags inline translates * @@ -313,139 +360,192 @@ protected function _escapeInline() protected function _tagAttributes() { if ($this->getIsJson()) { - $quotePatern = '\\\\"'; $quoteHtml = '\"'; - $tagEndRegexp = '(\\\\/)?' . '>$'; } else { - $quotePatern = '"'; $quoteHtml = '"'; - $tagEndRegexp = '/?>$'; } $tagMatch = array(); $nextTag = 0; - $tagRegExp = '#<([a-z]+)\s*?[^>]+?((' . $this->_tokenRegex . ')[^/>]*?)+(/?(>))#i'; + $tagRegExp = '#<([a-z]+)\s*?[^>]+?((' . $this->_tokenRegex . ')[^>]*?)+/?>#i'; while (preg_match($tagRegExp, $this->_content, $tagMatch, PREG_OFFSET_CAPTURE, $nextTag)) { $next = 0; $tagHtml = $tagMatch[0][0]; - $trArr = array(); $m = array(); $attrRegExp = '#' . $this->_tokenRegex . '#'; - - while (preg_match($attrRegExp, $tagHtml, $m, PREG_OFFSET_CAPTURE, $next)) { - $trArr[] = '{shown:\''.$this->_escape($m[1][0]) . '\',' - . 'translated:\''.$this->_escape($m[2][0]) . '\',' - . 'original:\''.$this->_escape($m[3][0]) . '\',' - . 'location:\'Tag attribute (ALT, TITLE, etc.)\',' - . 'scope:\''.$this->_escape($m[4][0]) . '\'}'; - $tagHtml = substr_replace($tagHtml, $m[1][0], $m[0][1], strlen($m[0][0])); - $next = $m[0][1]; - } - - $transRegExp = '# translate='.$quotePatern.'\[(.+?)\]'.$quotePatern.'#i'; - if (preg_match($transRegExp, $tagHtml, $m, PREG_OFFSET_CAPTURE)) { - foreach ($trArr as $i => $tr) { - if (strpos($m[1][0], $tr) !== false) { - unset($trArr[$i]); - } + $trArr = $this->_getTranslateData($attrRegExp, $tagHtml, array($this, '_getAttributeLocation')); + if ($trArr) { + $transRegExp = '# translate=' . $quoteHtml . '\[([^'.preg_quote($quoteHtml).']*)]' . $quoteHtml . '#i'; + if (preg_match($transRegExp, $tagHtml, $m)) { + $tagHtml = str_replace($m[0], '', $tagHtml); //remove tra + $trAttr = ' translate=' . $quoteHtml + . htmlspecialchars('[' . $m[1] . ',' . join(',', $trArr) . ']') . $quoteHtml; + } else { + $trAttr = ' translate=' . $quoteHtml + . htmlspecialchars('[' . join(',', $trArr) . ']') . $quoteHtml; } - array_unshift($trArr, $m[1][0]); - $tagHtml = substr_replace($tagHtml, '', $m[0][1], strlen($m[0][0])); + $this->_content = substr_replace($this->_content, $tagHtml, $tagMatch[0][1], strlen($tagMatch[0][0])); } - $trAttr = ' translate=' . $quoteHtml . '[' . join(',', $trArr) . ']' . $quoteHtml; - $tagHtml = preg_replace('#' . $tagEndRegexp . '#', $trAttr . '$0', $tagHtml); + $nextTag = $tagMatch[0][1] + strlen($tagHtml); + } + } - $this->_content = substr_replace($this->_content, $tagHtml, $tagMatch[0][1], - $tagMatch[9][1]+1-$tagMatch[0][1]); - $nextTag = $tagMatch[0][1]; + /** + * Get html quote symbol + * + * @return string + */ + protected function _getHtmlQuote() + { + if ($this->getIsJson()) { + return '\"'; + } else { + return '"'; } } /** * Prepare special tags + */ + protected function _specialTags() { + $this->_translateTags($this->_content, $this->_allowedTagsGlobal, '_applySpecialTagsFormat', false); + $this->_translateTags($this->_content, $this->_allowedTagsSimple, '_applySimpleTagsFormat', true); + } + + /** + * Format translate for special tags + * + * @param string $tagHtml + * @param string $tagName + * @param array $trArr + * @return string + */ + protected function _applySpecialTagsFormat($tagHtml, $tagName, $trArr) + { + return $tagHtml . '<span class="translate-inline-' . $tagName + . '" translate=' + . $this->_getHtmlQuote() + . htmlspecialchars('[' . join(',', $trArr) . ']') + . $this->_getHtmlQuote() . '>' + . strtoupper($tagName) . '</span>'; + } + + /** + * Format translate for simple tags * + * @param string $tagHtml + * @param string $tagName + * @param array $trArr + * @return string */ - protected function _specialTags() + protected function _applySimpleTagsFormat($tagHtml, $tagName, $trArr) + { + return substr($tagHtml, 0, strlen($tagName) + 1) + . ' translate=' + . $this->_getHtmlQuote() . htmlspecialchars( '[' . join(',', $trArr) . ']') + . $this->_getHtmlQuote() + . substr($tagHtml, strlen($tagName) + 1); + } + + /** + * Prepare simple tags + * + * @param string $body + * @param array $tagsList + * @param string|array $formatCallback + * @param bool $isNeedTranslateAttributes + */ + protected function _translateTags(&$body, $tagsList, $formatCallback, $isNeedTranslateAttributes) { if ($this->getIsJson()) { - $quotePatern = '\\\\"'; $quoteHtml = '\"'; } else { - $quotePatern = '"'; $quoteHtml = '"'; } $nextTag = 0; - $location = array_merge($this->_allowedTagsGlobal, $this->_allowedTagsSimple); - $tags = implode('|', array_merge(array_keys($this->_allowedTagsGlobal), - array_keys($this->_allowedTagsSimple))); - $tagRegExp = '#<(' . $tags . ')(\s+[^>]*|)(>)#i'; + $tags = implode('|', array_keys($tagsList)); + $tagRegExp = '#<(' . $tags . ')(\s*[^>]*>)#i'; $tagMatch = array(); - while (preg_match($tagRegExp, $this->_content, $tagMatch, PREG_OFFSET_CAPTURE, $nextTag)) { - $tagClosure = '</'.$tagMatch[1][0].'>'; - $tagClosurePos = stripos($this->_content, $tagClosure, $tagMatch[0][1]); + while (preg_match($tagRegExp, $body, $tagMatch, PREG_OFFSET_CAPTURE, $nextTag)) { + $tagName = strtolower($tagMatch[1][0]); + $tagClosurePos = $this->findEndOfTag($body, $tagName, $tagMatch[0][1]); if ($tagClosurePos === false) { - $tagClosure = '<\/'.$tagMatch[1][0].'>'; - $tagClosurePos = stripos($this->_content, $tagClosure, $tagMatch[0][1]); + $nextTag += strlen($tagMatch[0][0]); + continue; } - $tagLength = $tagClosurePos-$tagMatch[0][1]+strlen($tagClosure); - $next = 0; - $tagHtml = substr($this->_content, $tagMatch[0][1], $tagLength); - $trArr = array(); - $m = array(); - while (preg_match('#'.$this->_tokenRegex.'#i', $tagHtml, $m, PREG_OFFSET_CAPTURE, $next)) { - $trArr[] = '{shown:\''.$this->_escape($m[1][0]).'\',' - .'translated:\''.$this->_escape($m[2][0]).'\',' - .'original:\''.$this->_escape($m[3][0]).'\',' - .'location:\''.$location[strtolower($tagMatch[1][0])].'\',' - .'scope:\''.$this->_escape($m[4][0]).'\'}'; - - $tagHtml = substr_replace($tagHtml, $m[1][0], $m[0][1], strlen($m[0][0])); - $next = $m[0][1]; + $tagLength = $tagClosurePos - $tagMatch[0][1]; + + $tagStartLength = strlen($tagMatch[0][0]); + + $tagHtml = $tagMatch[0][0] ; + $tagEnd = substr($body, $tagMatch[0][1] + $tagStartLength, $tagLength - $tagStartLength); + + if ($isNeedTranslateAttributes + && preg_match_all('#' . $this->_tokenRegex . '#', $tagEnd, $m) + && count($m[0]) > $this->_maxTranslateBlocks + ) { + $this->_translateTags($tagEnd, $tagsList, $formatCallback, $isNeedTranslateAttributes); + } + + if ($isNeedTranslateAttributes) { + $this->_tagAttributes($tagEnd); } + $tagHtml .= $tagEnd; + + $trArr = $this->_getTranslateData( + '#' . $this->_tokenRegex . '#i', + $tagHtml, + array($this, '_getTagLocation'), + array( + 'tagName' => $tagName, + 'tagList' => $tagsList + ) + ); + if (!empty($trArr)) { $trArr = array_unique($trArr); - $tag = strtolower($tagMatch[1][0]); + $tagHtml = call_user_func(array($this, $formatCallback), $tagHtml, $tagName, $trArr); - if (in_array($tag, array_keys($this->_allowedTagsGlobal))) { - $tagHtml .= '<span class="translate-inline-'.$tag - .'" translate='.$quoteHtml.'['.join(',', $trArr).']'.$quoteHtml.'>'.strtoupper($tag).'</span>'; - } - $this->_content = substr_replace($this->_content, $tagHtml, $tagMatch[0][1], $tagLength); - - if (in_array($tag, array_keys($this->_allowedTagsSimple))) { - if (preg_match('# translate='.$quotePatern.'\[(.+?)\]'.$quotePatern.'#i', - $tagMatch[0][0], $m, PREG_OFFSET_CAPTURE) - ) { - foreach ($trArr as $i=>$tr) { - if (strpos($m[1][0], $tr)!==false) { - unset($trArr[$i]); - } - } - array_unshift($trArr, $m[1][0]); - $start = $tagMatch[0][1]+$m[0][1]; - $len = strlen($m[0][0]); - } else { - $start = $tagMatch[2][1]; - $len = 0; - } - - $this->_content = substr_replace($this->_content, - ' translate='.$quoteHtml.'['.join(',', $trArr).']'.$quoteHtml, $start, $len); - } + $body = substr_replace($body, $tagHtml, $tagMatch[0][1], $tagLength); } - - $nextTag = $tagMatch[0][1]+10; + $nextTag = $tagClosurePos; } + } + /** + * Find end of tag + * + * @param $body + * @param $tagName + * @param $from + * @return bool|int return false if end of tag is not found + */ + private function findEndOfTag($body, $tagName, $from) + { + $openTag = '<' . $tagName; + $closeTag = '</' . $tagName; + $end = $from + strlen($openTag); + $length = $end - $from; + while (substr_count($body, $openTag, $from, $length) != substr_count($body, $closeTag, $from, $length)) { + $end = strpos($body, $closeTag, $end + strlen($closeTag) - 1); + if ($end === false) { + return false; + } + $length = $end - $from + strlen($closeTag); + } + if (preg_match('#<\/' . $tagName .'\s*?>#i', $body, $tagMatch, null, $end)) { + return $end + strlen($tagMatch[0]); + } else { + return false; + } } /** * Prepare other text inline translates - * */ protected function _otherText() { @@ -457,22 +557,19 @@ protected function _otherText() $next = 0; $m = array(); - while (preg_match('#(>|title=\")*('.$this->_tokenRegex.')#', $this->_content, $m, PREG_OFFSET_CAPTURE, $next)) { - if(-1 == $m[1][1])//title was not found - this is not an attribute - { - $tr = '{shown:\''.$this->_escape($m[3][0]).'\',' - .'translated:\''.$this->_escape($m[4][0]).'\',' - .'original:\''.$this->_escape($m[5][0]).'\',' - .'location:\'Text\',' - .'scope:\''.$this->_escape($m[6][0]).'\'}'; - $spanHtml = '<span translate='.$quoteHtml.'['.$tr.']'.$quoteHtml.'>'.$m[3][0].'</span>'; - } - else - { - $spanHtml = $m[3][0]; - } - $this->_content = substr_replace($this->_content, $spanHtml, $m[2][1], strlen($m[2][0]) ); - $next = $m[0][1]; + while (preg_match('#' . $this->_tokenRegex . '#', $this->_content, $m, PREG_OFFSET_CAPTURE, $next)) { + $tr = json_encode(array( + 'shown' => $m[1][0], + 'translated' => $m[2][0], + 'original' => $m[3][0], + 'location' => 'Text', + 'scope' => $m[4][0], + )); + + $spanHtml = '<span translate=' . $quoteHtml . htmlspecialchars('[' . $tr . ']') . $quoteHtml + . '>' . $m[1][0] . '</span>'; + $this->_content = substr_replace($this->_content, $spanHtml, $m[0][1], strlen($m[0][0])); + $next = $m[0][1] + strlen($spanHtml) - 1; } } @@ -523,4 +620,3 @@ public function setIsJson($flag) return $this; } } - diff --git a/app/code/core/Mage/Core/Model/Translate/String.php b/app/code/core/Mage/Core/Model/Translate/String.php index 2bd7a3e469..606eb190b1 100644 --- a/app/code/core/Mage/Core/Model/Translate/String.php +++ b/app/code/core/Mage/Core/Model/Translate/String.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Url.php b/app/code/core/Mage/Core/Model/Url.php index c51874fe9f..cef90cfc86 100644 --- a/app/code/core/Mage/Core/Model/Url.php +++ b/app/code/core/Mage/Core/Model/Url.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -89,7 +89,7 @@ class Mage_Core_Model_Url extends Varien_Object const DEFAULT_ACTION_NAME = 'index'; /** - * Configuration pathes + * Configuration paths */ const XML_PATH_UNSECURE_URL = 'web/unsecure/base_url'; const XML_PATH_SECURE_URL = 'web/secure/base_url'; @@ -111,7 +111,7 @@ class Mage_Core_Model_Url extends Varien_Object static protected $_encryptedSessionId; /** - * Reserved Route parametr keys + * Reserved Route parameter keys * * @var array */ @@ -136,7 +136,7 @@ class Mage_Core_Model_Url extends Varien_Object protected $_useSession; /** - * Initailize object + * Initialize object */ protected function _construct() { @@ -308,7 +308,7 @@ public function getType() public function getSecure() { if ($this->hasData('secure_is_forced')) { - return $this->getData('secure'); + return (bool)$this->getData('secure'); } $store = $this->getStore(); @@ -714,7 +714,7 @@ public function setRouteParam($key, $data) */ public function getRouteParam($key) { - return $this->_getData('route_params', $key); + return $this->getData('route_params', $key); } /** @@ -912,7 +912,7 @@ public function getQueryParam($key) if (!$this->hasData('query_params')) { $this->getQueryParams(); } - return $this->_getData('query_params', $key); + return $this->getData('query_params', $key); } /** @@ -948,8 +948,8 @@ public function getUrl($routePath = null, $routeParams = null) $escapeQuery = false; /** - * All system params should be unseted before we call getRouteUrl - * this method has condition for ading default controller anr actions names + * All system params should be unset before we call getRouteUrl + * this method has condition for adding default controller and action names * in case when we have params */ if (isset($routeParams['_fragment'])) { @@ -971,7 +971,7 @@ public function getUrl($routePath = null, $routeParams = null) $noSid = null; if (isset($routeParams['_nosid'])) { - $noSid = (bool) $routeParams['_nosid']; + $noSid = (bool)$routeParams['_nosid']; unset($routeParams['_nosid']); } $url = $this->getRouteUrl($routePath, $routeParams); @@ -1010,22 +1010,33 @@ public function getUrl($routePath = null, $routeParams = null) * Check and add session id to URL * * @param string $url + * * @return Mage_Core_Model_Url */ protected function _prepareSessionUrl($url) + { + return $this->_prepareSessionUrlWithParams($url, array()); + } + + /** + * Check and add session id to URL, session is obtained with parameters + * + * @param string $url + * @param array $params + * + * @return Mage_Core_Model_Url + */ + protected function _prepareSessionUrlWithParams($url, array $params) { if (!$this->getUseSession()) { return $this; } - $session = Mage::getSingleton('core/session'); + /** @var $session Mage_Core_Model_Session */ + $session = Mage::getSingleton('core/session', $params); + if (Mage::app()->getUseSessionVar() && !$session->getSessionIdForHost($url)) { - // secure URL - if ($this->getSecure()) { - $this->setQueryParam('___SID', 'S'); - } else { - $this->setQueryParam('___SID', 'U'); - } + $this->setQueryParam('___SID', $this->getSecure() ? 'S' : 'U'); // Secure/Unsecure } else { $sessionId = $session->getSessionIdForHost($url); if ($sessionId) { @@ -1177,4 +1188,25 @@ public function isOwnOriginUrl() } return false; } + + /** + * Return frontend redirect URL with SID and other session parameters if any + * + * @param string $url + * + * @return string + */ + public function getRedirectUrl($url) + { + $this->_prepareSessionUrlWithParams($url, array( + 'name' => Mage_Core_Controller_Front_Action::SESSION_NAMESPACE + )); + + $query = $this->getQuery(false); + if ($query) { + $url .= (strpos($url, '?') === false ? '?' : '&') . $query; + } + + return $url; + } } diff --git a/app/code/core/Mage/Core/Model/Url/Rewrite.php b/app/code/core/Mage/Core/Model/Url/Rewrite.php index 07cd5d3209..4af6d5c589 100644 --- a/app/code/core/Mage/Core/Model/Url/Rewrite.php +++ b/app/code/core/Mage/Core/Model/Url/Rewrite.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Variable.php b/app/code/core/Mage/Core/Model/Variable.php index 0b075aee4c..56f163a91d 100644 --- a/app/code/core/Mage/Core/Model/Variable.php +++ b/app/code/core/Mage/Core/Model/Variable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Variable/Config.php b/app/code/core/Mage/Core/Model/Variable/Config.php index 7637478c76..4df1d81eac 100644 --- a/app/code/core/Mage/Core/Model/Variable/Config.php +++ b/app/code/core/Mage/Core/Model/Variable/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Variable/Observer.php b/app/code/core/Mage/Core/Model/Variable/Observer.php index e4244a795e..a08b4c0cee 100644 --- a/app/code/core/Mage/Core/Model/Variable/Observer.php +++ b/app/code/core/Mage/Core/Model/Variable/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Website.php b/app/code/core/Mage/Core/Model/Website.php index 076f146106..7d91cf7a86 100644 --- a/app/code/core/Mage/Core/Model/Website.php +++ b/app/code/core/Mage/Core/Model/Website.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/controllers/AjaxController.php b/app/code/core/Mage/Core/controllers/AjaxController.php index 368ed11769..833d728c80 100644 --- a/app/code/core/Mage/Core/controllers/AjaxController.php +++ b/app/code/core/Mage/Core/controllers/AjaxController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/controllers/IndexController.php b/app/code/core/Mage/Core/controllers/IndexController.php index 13f2111037..ae0a7de8ab 100644 --- a/app/code/core/Mage/Core/controllers/IndexController.php +++ b/app/code/core/Mage/Core/controllers/IndexController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/etc/api.xml b/app/code/core/Mage/Core/etc/api.xml index 4e728d23d7..9a57a460d6 100644 --- a/app/code/core/Mage/Core/etc/api.xml +++ b/app/code/core/Mage/Core/etc/api.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Core/etc/config.xml b/app/code/core/Mage/Core/etc/config.xml index af1cf91ab5..15ca68af86 100644 --- a/app/code/core/Mage/Core/etc/config.xml +++ b/app/code/core/Mage/Core/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -134,8 +134,7 @@ <validation> <http_user_agent_skip> <flash>Shockwave Flash</flash> - <flash_9_mac>Adobe Flash Player 9</flash_9_mac> - <flash_10_mac>Adobe Flash Player 10</flash_10_mac> + <flash_mac><![CDATA[Adobe Flash Player\s{1,}\w{1,10}]]></flash_mac> </http_user_agent_skip> </validation> </session> @@ -338,6 +337,7 @@ <cookie> <cookie_lifetime>3600</cookie_lifetime> <cookie_httponly>1</cookie_httponly> + <cookie_restriction>0</cookie_restriction> </cookie> <session> <use_remote_addr>0</use_remote_addr> @@ -422,4 +422,16 @@ </web> </default> </stores> + <crontab> + <jobs> + <core_clean_cache> + <schedule> + <cron_expr>30 2 * * *</cron_expr> + </schedule> + <run> + <model>core/observer::cleanCache</model> + </run> + </core_clean_cache> + </jobs> + </crontab> </config> diff --git a/app/code/core/Mage/Core/etc/jstranslator.xml b/app/code/core/Mage/Core/etc/jstranslator.xml new file mode 100644 index 0000000000..4a552ea7df --- /dev/null +++ b/app/code/core/Mage/Core/etc/jstranslator.xml @@ -0,0 +1,205 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Core + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<jstranslator> + <!-- validation.js --> + <validate-no-html-tags translate="message" module="core"> + <message>HTML tags are not allowed</message> + </validate-no-html-tags> + <validate-select translate="message" module="core"> + <message>Please select an option.</message> + </validate-select> + <required-entry translate="message" module="core"> + <message>This is a required field.</message> + </required-entry> + <validate-number translate="message" module="core"> + <message>Please enter a valid number in this field.</message> + </validate-number> + <validate-number-range translate="message" module="core"> + <message>The value is not within the specified range.</message> + </validate-number-range> + <validate-digits translate="message" module="core"> + <message>Please use numbers only in this field. Please avoid spaces or other characters such as dots or commas.</message> + </validate-digits> + <validate-digits-range translate="message" module="core"> + <message>The value is not within the specified range.</message> + </validate-digits-range> + <validate-alpha translate="message" module="core"> + <message>Please use letters only (a-z or A-Z) in this field.</message> + </validate-alpha> + <validate-code translate="message" module="core"> + <message>Please use only letters (a-z), numbers (0-9) or underscore(_) in this field, first character should be a letter.</message> + </validate-code> + <validate-alphanum translate="message" module="core"> + <message>Please use only letters (a-z or A-Z) or numbers (0-9) only in this field. No spaces or other characters are allowed.</message> + </validate-alphanum> + <validate-street translate="message" module="core"> + <message>Please use only letters (a-z or A-Z) or numbers (0-9) or spaces and # only in this field.</message> + </validate-street> + <validate-phone-strict translate="message" module="core"> + <message>Please enter a valid phone number. For example (123) 456-7890 or 123-456-7890.</message> + </validate-phone-strict> + <validate-phone-lax translate="message" module="core"> + <message>Please enter a valid phone number. For example (123) 456-7890 or 123-456-7890.</message> + </validate-phone-lax> + <validate-fax translate="message" module="core"> + <message>Please enter a valid fax number. For example (123) 456-7890 or 123-456-7890.</message> + </validate-fax> + <validate-date translate="message" module="core"> + <message>Please enter a valid date.</message> + </validate-date> + <validate-email translate="message" module="core"> + <message>Please enter a valid email address. For example johndoe@domain.com.</message> + </validate-email> + <validate-email-sender translate="message" module="core"> + <message>Please use only visible characters and spaces.</message> + </validate-email-sender> + <validate-password translate="message" module="core"> + <message>Please enter 6 or more characters. Leading or trailing spaces will be ignored.</message> + </validate-password> + <validate-admin-password translate="message" module="core"> + <message>Please enter 7 or more characters. Password should contain both numeric and alphabetic characters.</message> + </validate-admin-password> + <validate-cpassword translate="message" module="core"> + <message>Please make sure your passwords match.</message> + </validate-cpassword> + <validate-url translate="message" module="core"> + <message>Please enter a valid URL. Protocol is required (http://, https:// or ftp://)</message> + </validate-url> + <validate-clean-url translate="message" module="core"> + <message>Please enter a valid URL. For example http://www.example.com or www.example.com</message> + </validate-clean-url> + <validate-identifier translate="message" module="core"> + <message>Please enter a valid URL Key. For example "example-page", "example-page.html" or "anotherlevel/example-page".</message> + </validate-identifier> + <validate-xml-identifier translate="message" module="core"> + <message>Please enter a valid XML-identifier. For example something_1, block5, id-4.</message> + </validate-xml-identifier> + <validate-ssn translate="message" module="core"> + <message>Please enter a valid social security number. For example 123-45-6789.</message> + </validate-ssn> + <validate-zip translate="message" module="core"> + <message>Please enter a valid zip code. For example 90602 or 90602-1234.</message> + </validate-zip> + <validate-zip-international translate="message" module="core"> + <message>Please enter a valid zip code.</message> + </validate-zip-international> + <validate-date-au translate="message" module="core"> + <message>Please use this date format: dd/mm/yyyy. For example 17/03/2006 for the 17th of March, 2006.</message> + </validate-date-au> + <validate-currency-dollar translate="message" module="core"> + <message>Please enter a valid $ amount. For example $100.00.</message> + </validate-currency-dollar> + <validate-one-required translate="message" module="core"> + <message>Please select one of the above options.</message> + </validate-one-required> + <validate-one-required-by-name translate="message" module="core"> + <message>Please select one of the options.</message> + </validate-one-required-by-name> + <validate-not-negative-number translate="message" module="core"> + <message>Please enter a valid number in this field.</message> + </validate-not-negative-number> + <validate-state translate="message" module="core"> + <message>Please select State/Province.</message> + </validate-state> + <validate-new-password translate="message" module="core"> + <message>Please enter 6 or more characters. Leading or trailing spaces will be ignored.</message> + </validate-new-password> + <validate-greater-than-zero translate="message" module="core"> + <message>Please enter a number greater than 0 in this field.</message> + </validate-greater-than-zero> + <validate-zero-or-greater translate="message" module="core"> + <message>Please enter a number 0 or greater in this field.</message> + </validate-zero-or-greater> + <validate-cc-number translate="message" module="core"> + <message>Please enter a valid credit card number.</message> + </validate-cc-number> + <validate-cc-type translate="message" module="core"> + <message>Credit card number does not match credit card type.</message> + </validate-cc-type> + <validate-cc-type-select translate="message" module="core"> + <message>Card type does not match credit card number.</message> + </validate-cc-type-select> + <validate-cc-exp translate="message" module="core"> + <message>Incorrect credit card expiration date.</message> + </validate-cc-exp> + <validate-cc-cvn translate="message" module="core"> + <message>Please enter a valid credit card verification number.</message> + </validate-cc-cvn> + <validate-data translate="message" module="core"> + <message>Please use only letters (a-z or A-Z), numbers (0-9) or underscore(_) in this field, first character should be a letter.</message> + </validate-data> + <validate-css-length translate="message" module="core"> + <message>Please input a valid CSS-length. For example 100px or 77pt or 20em or .5ex or 50%.</message> + </validate-css-length> + <validate-length translate="message" module="core"> + <message>Text length does not satisfy specified text range.</message> + </validate-length> + <validate-percents translate="message" module="core"> + <message>Please enter a number lower than 100.</message> + </validate-percents> + <required-file translate="message" module="core"> + <message>Please select a file</message> + </required-file> + <validate-cc-ukss translate="message" module="core"> + <message>Please enter issue number or start date for switch/solo card type.</message> + </validate-cc-ukss> + <!-- end validation.js --> + + <!-- rules.js --> + <loading translate="message" module="core"> + <message>Please wait, loading...</message> + </loading> + <!-- end rules.js --> + + <!-- js.js --> + <validate-date-required translate="message" module="core"> + <message>This date is a required value.</message> + </validate-date-required> + <validate-date-day translate="message" module="core"> + <message>Please enter a valid day (1-%d).</message> + </validate-date-day> + <validate-date-month translate="message" module="core"> + <message>Please enter a valid month (1-12).</message> + </validate-date-month> + <validate-date-year translate="message" module="core"> + <message>Please enter a valid year (1900-%d).</message> + </validate-date-year> + <validate-date-full-date translate="message" module="core"> + <message>Please enter a valid full date</message> + </validate-date-full-date> + <validate-date-date-between translate="message" module="core"> + <message>Please enter a valid date between %s and %s</message> + </validate-date-date-between> + <validate-date-greater translate="message" module="core"> + <message>Please enter a valid date equal to or greater than %s</message> + </validate-date-greater> + <validate-date-less translate="message" module="core"> + <message>Please enter a valid date less than or equal to %s</message> + </validate-date-less> + <!-- end js.js --> +</jstranslator> diff --git a/app/code/core/Mage/Core/etc/system.xml b/app/code/core/Mage/Core/etc/system.xml index 9675f9e97d..775910c632 100644 --- a/app/code/core/Mage/Core/etc/system.xml +++ b/app/code/core/Mage/Core/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -433,6 +433,35 @@ </anchor_text_for_next> </fields> </pagination> + <email translate="label"> + <label>Transactional Emails</label> + <frontend_type>text</frontend_type> + <sort_order>510</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>1</show_in_store> + <fields> + <logo translate="label"> + <label>Logo Image</label> + <comment>Allowed file types: jpg, jpeg, gif, png</comment> + <frontend_type>image</frontend_type> + <backend_model>adminhtml/system_config_backend_email_logo</backend_model> + <base_url type="media" scope_info="1">email/logo</base_url> + <sort_order>10</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>1</show_in_store> + </logo> + <logo_alt translate="label"> + <label>Logo Image Alt</label> + <frontend_type>text</frontend_type> + <sort_order>20</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>1</show_in_store> + </logo_alt> + </fields> + </email> </groups> </design> <dev translate="label" module="core"> @@ -962,8 +991,9 @@ </forgot_email_identity> <password_reset_link_expiration_period translate="label comment"> <label>Recovery Link Expiration Period (days)</label> - <comment>This value must be greater than 0.</comment> + <comment>Please enter a number 1 or greater in this field.</comment> <frontend_type>text</frontend_type> + <validate>required-entry validate-digits validate-digits-range digits-range-1-</validate> <backend_model>adminhtml/system_config_backend_admin_password_link_expirationperiod</backend_model> <sort_order>30</sort_order> <show_in_default>1</show_in_default> @@ -1377,6 +1407,15 @@ <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> </cookie_httponly> + <cookie_restriction translate="label"> + <label>Cookie Restriction Mode</label> + <frontend_type>select</frontend_type> + <source_model>adminhtml/system_config_source_yesno</source_model> + <sort_order>50</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + </cookie_restriction> </fields> </cookie> <session translate="label"> diff --git a/app/code/core/Mage/Core/functions.php b/app/code/core/Mage/Core/functions.php index 06894aeb3e..fbd0acc665 100644 --- a/app/code/core/Mage/Core/functions.php +++ b/app/code/core/Mage/Core/functions.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/sql/core_setup/install-1.6.0.0.php b/app/code/core/Mage/Core/sql/core_setup/install-1.6.0.0.php index c616047472..e34461cb54 100644 --- a/app/code/core/Mage/Core/sql/core_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Core/sql/core_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-install-0.7.0.php index 4d49bfe1bc..010bec1075 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-install-0.7.0.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-install-0.7.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-install-0.8.0.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-install-0.8.0.php index 7c98fd0b32..a8886121d9 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-install-0.8.0.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-install-0.8.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.6.26-0.7.0.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.6.26-0.7.0.php index 8f83ac3ddc..03db81f3c1 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.6.26-0.7.0.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.6.26-0.7.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.1-0.7.2.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.1-0.7.2.php index 6de0fd79e3..1d2eff78b1 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.1-0.7.2.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.1-0.7.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.2-0.7.3.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.2-0.7.3.php index 6170608a79..2269b5b9f2 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.2-0.7.3.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.2-0.7.3.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.3-0.7.4.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.3-0.7.4.php index 9e1715e02c..4c9b603668 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.3-0.7.4.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.3-0.7.4.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.4-0.7.5.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.4-0.7.5.php index ad7f7c23bd..87a52158c6 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.4-0.7.5.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.4-0.7.5.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.5-0.7.6.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.5-0.7.6.php index 3666f32d39..d60474e8a4 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.5-0.7.6.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.5-0.7.6.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.6-0.7.7.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.6-0.7.7.php index e2a9dbf73b..26fef5108b 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.6-0.7.7.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.6-0.7.7.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.7-0.7.8.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.7-0.7.8.php index 1ab752d59f..04282d4369 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.7-0.7.8.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.7-0.7.8.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.8-0.7.9.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.8-0.7.9.php index 9c1ac21736..c2d3209e69 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.8-0.7.9.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.8-0.7.9.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.0-0.8.1.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.0-0.8.1.php index 6f45c3d11b..ad5e42cadc 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.0-0.8.1.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.0-0.8.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.1-0.8.2.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.1-0.8.2.php index b01876d309..207f623c8d 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.1-0.8.2.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.1-0.8.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.10-0.8.11.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.10-0.8.11.php index 5bd452f77f..6021b0c7ec 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.10-0.8.11.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.10-0.8.11.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.11-0.8.12.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.11-0.8.12.php index a27a29df09..3ec4611d6e 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.11-0.8.12.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.11-0.8.12.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.12-0.8.13.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.12-0.8.13.php index 272155a2c2..12d2bd9813 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.12-0.8.13.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.12-0.8.13.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.13-0.8.14.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.13-0.8.14.php index e6e7f2777f..957477ae6a 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.13-0.8.14.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.13-0.8.14.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.14-0.8.15.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.14-0.8.15.php index d5ca99dff5..744981563e 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.14-0.8.15.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.14-0.8.15.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.15-0.8.16.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.15-0.8.16.php index 77c7c4022f..244068ae0a 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.15-0.8.16.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.15-0.8.16.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.16-0.8.17.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.16-0.8.17.php index f58989f887..afda2a0bc0 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.16-0.8.17.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.16-0.8.17.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.17-0.8.18.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.17-0.8.18.php index 91d5b0338a..374b70b917 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.17-0.8.18.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.17-0.8.18.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.18-0.8.19.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.18-0.8.19.php index 9a49909bea..6f8adf92ca 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.18-0.8.19.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.18-0.8.19.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.19-0.8.20.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.19-0.8.20.php index 01a67aa2c1..b41c1cfcc5 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.19-0.8.20.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.19-0.8.20.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.2-0.8.3.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.2-0.8.3.php index c64cae90a5..eebb5a8b07 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.2-0.8.3.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.2-0.8.3.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.20-0.8.21.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.20-0.8.21.php index b1a465c6b5..028213f9e1 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.20-0.8.21.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.20-0.8.21.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.21-0.8.22.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.21-0.8.22.php index 406e632ed1..0ac7b520ef 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.21-0.8.22.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.21-0.8.22.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.22-0.8.23.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.22-0.8.23.php index e22668fb14..d7e05ef5ff 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.22-0.8.23.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.22-0.8.23.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.23-0.8.24.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.23-0.8.24.php index 470d1e174d..9f91916823 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.23-0.8.24.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.23-0.8.24.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.24-0.8.25.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.24-0.8.25.php index fcf0340a79..7af090a2ef 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.24-0.8.25.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.24-0.8.25.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.25-0.8.26.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.25-0.8.26.php index 6a814bfba0..e9c25cddc3 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.25-0.8.26.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.25-0.8.26.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.26-0.8.27.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.26-0.8.27.php index e4ad568df8..72d5d9e6f5 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.26-0.8.27.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.26-0.8.27.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.27-0.8.28.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.27-0.8.28.php index e5b57464b5..7b7869ae27 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.27-0.8.28.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.27-0.8.28.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.3-0.8.4.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.3-0.8.4.php index 0f311c79e2..a5edcbcd7f 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.3-0.8.4.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.3-0.8.4.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.4-0.8.5.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.4-0.8.5.php index 7694357e81..e5dc2be1d0 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.4-0.8.5.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.4-0.8.5.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.5-0.8.6.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.5-0.8.6.php index e47b701c46..7de7d3d03a 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.5-0.8.6.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.5-0.8.6.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.6-0.8.7.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.6-0.8.7.php index 59ff8f9d7d..e30a934d8a 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.6-0.8.7.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.6-0.8.7.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.7-0.8.8.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.7-0.8.8.php index e151259862..5586993f2d 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.7-0.8.8.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.7-0.8.8.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.8-0.8.9.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.8-0.8.9.php index 3269a04912..b98d3f215c 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.8-0.8.9.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.8-0.8.9.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.9-0.8.10.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.9-0.8.10.php index ceaebcf6aa..dd57869079 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.9-0.8.10.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.9-0.8.10.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php index 8ef11ff8fd..72dcfd19d4 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/sql/core_setup/upgrade-1.6.0.1-1.6.0.2.php b/app/code/core/Mage/Core/sql/core_setup/upgrade-1.6.0.1-1.6.0.2.php index 137a8f46f9..01ca94b2f4 100644 --- a/app/code/core/Mage/Core/sql/core_setup/upgrade-1.6.0.1-1.6.0.2.php +++ b/app/code/core/Mage/Core/sql/core_setup/upgrade-1.6.0.1-1.6.0.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cron/Exception.php b/app/code/core/Mage/Cron/Exception.php index 4e4ed73371..15d27f92f9 100644 --- a/app/code/core/Mage/Cron/Exception.php +++ b/app/code/core/Mage/Cron/Exception.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cron - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cron/Helper/Data.php b/app/code/core/Mage/Cron/Helper/Data.php index d5649c2de6..e4a690370a 100644 --- a/app/code/core/Mage/Cron/Helper/Data.php +++ b/app/code/core/Mage/Cron/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cron - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cron/Model/Mysql4/Schedule.php b/app/code/core/Mage/Cron/Model/Mysql4/Schedule.php index c80b6f4f04..b5d3b26870 100644 --- a/app/code/core/Mage/Cron/Model/Mysql4/Schedule.php +++ b/app/code/core/Mage/Cron/Model/Mysql4/Schedule.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cron - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cron/Model/Mysql4/Schedule/Collection.php b/app/code/core/Mage/Cron/Model/Mysql4/Schedule/Collection.php index 7932ba0910..d4739f34dc 100644 --- a/app/code/core/Mage/Cron/Model/Mysql4/Schedule/Collection.php +++ b/app/code/core/Mage/Cron/Model/Mysql4/Schedule/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cron - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cron/Model/Observer.php b/app/code/core/Mage/Cron/Model/Observer.php index 1614271826..3057cb4377 100644 --- a/app/code/core/Mage/Cron/Model/Observer.php +++ b/app/code/core/Mage/Cron/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cron - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cron/Model/Resource/Schedule.php b/app/code/core/Mage/Cron/Model/Resource/Schedule.php index d36dcd71f3..b3dd22b98d 100755 --- a/app/code/core/Mage/Cron/Model/Resource/Schedule.php +++ b/app/code/core/Mage/Cron/Model/Resource/Schedule.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cron - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cron/Model/Resource/Schedule/Collection.php b/app/code/core/Mage/Cron/Model/Resource/Schedule/Collection.php index 1ee6188033..48f460a8b8 100755 --- a/app/code/core/Mage/Cron/Model/Resource/Schedule/Collection.php +++ b/app/code/core/Mage/Cron/Model/Resource/Schedule/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cron - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cron/Model/Schedule.php b/app/code/core/Mage/Cron/Model/Schedule.php index cd136077df..f3d91597a9 100644 --- a/app/code/core/Mage/Cron/Model/Schedule.php +++ b/app/code/core/Mage/Cron/Model/Schedule.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cron - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cron/etc/config.xml b/app/code/core/Mage/Cron/etc/config.xml index 93e4bd6f1f..e4da3ab834 100644 --- a/app/code/core/Mage/Cron/etc/config.xml +++ b/app/code/core/Mage/Cron/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Cron - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Cron/etc/system.xml b/app/code/core/Mage/Cron/etc/system.xml index c947686ee1..a0ae3c2966 100644 --- a/app/code/core/Mage/Cron/etc/system.xml +++ b/app/code/core/Mage/Cron/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Cron - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Cron/sql/cron_setup/install-1.6.0.0.php b/app/code/core/Mage/Cron/sql/cron_setup/install-1.6.0.0.php index cc9d323db2..1b95da555c 100644 --- a/app/code/core/Mage/Cron/sql/cron_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Cron/sql/cron_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cron - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cron/sql/cron_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/Cron/sql/cron_setup/mysql4-install-0.7.0.php index 26801fb71e..47a17c0f0e 100644 --- a/app/code/core/Mage/Cron/sql/cron_setup/mysql4-install-0.7.0.php +++ b/app/code/core/Mage/Cron/sql/cron_setup/mysql4-install-0.7.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cron - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cron/sql/cron_setup/mysql4-upgrade-0.7.0-0.7.1.php b/app/code/core/Mage/Cron/sql/cron_setup/mysql4-upgrade-0.7.0-0.7.1.php index dd965d2569..238b916d9c 100644 --- a/app/code/core/Mage/Cron/sql/cron_setup/mysql4-upgrade-0.7.0-0.7.1.php +++ b/app/code/core/Mage/Cron/sql/cron_setup/mysql4-upgrade-0.7.0-0.7.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cron - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cron/sql/cron_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/Cron/sql/cron_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php index 8148b69297..cc7ae41fd4 100644 --- a/app/code/core/Mage/Cron/sql/cron_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ b/app/code/core/Mage/Cron/sql/cron_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cron - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CurrencySymbol/Block/Adminhtml/System/Currencysymbol.php b/app/code/core/Mage/CurrencySymbol/Block/Adminhtml/System/Currencysymbol.php new file mode 100644 index 0000000000..3ff5f0a17c --- /dev/null +++ b/app/code/core/Mage/CurrencySymbol/Block/Adminhtml/System/Currencysymbol.php @@ -0,0 +1,144 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_CurrencySymbol + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Manage currency symbols block + * + * @category Mage + * @package Mage_CurrencySymbol + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Currencysymbol_Block_Adminhtml_System_Currencysymbol extends Mage_Adminhtml_Block_Widget_Form +{ + /** + * Constructor. Initialization required variables for class instance. + */ + public function __construct() + { + $this->_blockGroup = 'currencysymbol_system'; + $this->_controller = 'adminhtml_system_currencysymbol'; + parent::__construct(); + } + + /** + * Custom currency symbol properties + * + * @var array + */ + protected $_symbolsData = array(); + + /** + * Prepares layout + * + * @return Mage_Core_Block_Abstract + */ + protected function _prepareLayout() + { + return parent::_prepareLayout(); + } + + /** + * Returns page header + * + * @return bool|string + */ + public function getHeader() + { + return Mage::helper('adminhtml')->__('Manage Currency Symbols'); + } + + /** + * Returns 'Save Currency Symbol' button's HTML code + * + * @return string + */ + public function getSaveButtonHtml() + { + /** @var $block Mage_Core_Block_Abstract */ + $block = $this->getLayout()->createBlock('adminhtml/widget_button'); + $block->setData(array( + 'label' => Mage::helper('currencysymbol')->__('Save Currency Symbols'), + 'onclick' => 'currencySymbolsForm.submit();', + 'class' => 'save' + )); + + return $block->toHtml(); + } + + /** + * Returns URL for save action + * + * @return string + */ + public function getFormActionUrl() + { + return $this->getUrl('*/*/save'); + } + + /** + * Returns website id + * + * @return int + */ + public function getWebsiteId() + { + return $this->getRequest()->getParam('website'); + } + + /** + * Returns store id + * + * @return int + */ + public function getStoreId() + { + return $this->getRequest()->getParam('store'); + } + + /** + * Returns Custom currency symbol properties + * + * @return array + */ + public function getCurrencySymbolsData() + { + if(!$this->_symbolsData) { + $this->_symbolsData = Mage::getModel('currencysymbol/system_currencysymbol') + ->getCurrencySymbolsData(); + } + return $this->_symbolsData; + } + + /** + * Returns inheritance text + * + * @return string + */ + public function getInheritText() + { + return Mage::helper('currencysymbol')->__('Use Standard'); + } +} diff --git a/app/code/core/Mage/CurrencySymbol/Helper/Data.php b/app/code/core/Mage/CurrencySymbol/Helper/Data.php new file mode 100644 index 0000000000..53c17eae56 --- /dev/null +++ b/app/code/core/Mage/CurrencySymbol/Helper/Data.php @@ -0,0 +1,58 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_CurrencySymbol + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + + /** + * Currency Symbol helper + * + * @category Mage + * @package Mage_CurrencySymbol + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_CurrencySymbol_Helper_Data extends Mage_Core_Helper_Data +{ + + /** + * Get currency display options + * + * @param string $baseCode + * @return array + */ + public function getCurrencyOptions($baseCode) + { + $currencyOptions = array(); + $currencySymbol = Mage::getModel('currencysymbol/system_currencysymbol'); + if($currencySymbol) { + $customCurrencySymbol = $currencySymbol->getCurrencySymbol($baseCode); + + if ($customCurrencySymbol) { + $currencyOptions['symbol'] = $customCurrencySymbol; + $currencyOptions['display'] = Zend_Currency::USE_SYMBOL; + } + } + + return $currencyOptions; + } +} diff --git a/app/code/core/Mage/CurrencySymbol/Model/Observer.php b/app/code/core/Mage/CurrencySymbol/Model/Observer.php new file mode 100644 index 0000000000..d4cec8ba34 --- /dev/null +++ b/app/code/core/Mage/CurrencySymbol/Model/Observer.php @@ -0,0 +1,50 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_CurrencySymbol + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Currency Symbol Observer + * + * @category Mage + * @package Mage_CurrencySymbol + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_CurrencySymbol_Model_Observer +{ + /** + * Generate options for currency displaying with custom currency symbol + * + * @param Varien_Event_Observer $observer + * @return Mage_CurrencySymbol_Model__Observer + */ + public function currencyDisplayOptions(Varien_Event_Observer $observer) + { + $baseCode = $observer->getEvent()->getBaseCode(); + $currencyOptions = $observer->getEvent()->getCurrencyOptions(); + $currencyOptions->setData(Mage::helper('currencysymbol')->getCurrencyOptions($baseCode)); + + return $this; + } +} diff --git a/app/code/core/Mage/CurrencySymbol/Model/System/Currencysymbol.php b/app/code/core/Mage/CurrencySymbol/Model/System/Currencysymbol.php new file mode 100644 index 0000000000..86cbdc1efc --- /dev/null +++ b/app/code/core/Mage/CurrencySymbol/Model/System/Currencysymbol.php @@ -0,0 +1,282 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_CurrencySymbol + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Custom currency symbol model + * + * @category Mage + * @package Mage_CurrencySymbol + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_CurrencySymbol_Model_System_Currencysymbol +{ + /** + * Custom currency symbol properties + * + * @var array + */ + protected $_symbolsData = array(); + + /** + * Store id + * + * @var string | null + */ + protected $_storeId; + + /** + * Website id + * + * @var string | null + */ + protected $_websiteId; + /** + * Cache types which should be invalidated + * + * @var array + */ + protected $_cacheTypes = array( + 'config', + 'block_html', + 'layout' + ); + + /** + * Config path to custom currency symbol value + */ + const XML_PATH_CUSTOM_CURRENCY_SYMBOL = 'currency/options/customsymbol'; + const XML_PATH_ALLOWED_CURRENCIES = 'currency/options/allow'; + + /* + * Separator used in config in allowed currencies list + */ + const ALLOWED_CURRENCIES_CONFIG_SEPARATOR = ','; + + /** + * Config currency section + */ + const CONFIG_SECTION = 'currency'; + + /** + * Sets store Id + * + * @param $storeId + * @return Mage_CurrencySymbol_Model_System_Currencysymbol + */ + public function setStoreId($storeId=null) + { + $this->_storeId = $storeId; + $this->_symbolsData = array(); + + return $this; + } + + /** + * Sets website Id + * + * @param $websiteId + * @return Mage_CurrencySymbol_Model_System_Currencysymbol + */ + public function setWebsiteId($websiteId=null) + { + $this->_websiteId = $websiteId; + $this->_symbolsData = array(); + + return $this; + } + + /** + * Returns currency symbol properties array based on config values + * + * @return array + */ + public function getCurrencySymbolsData() + { + if ($this->_symbolsData) { + return $this->_symbolsData; + } + + $this->_symbolsData = array(); + + $allowedCurrencies = explode( + self::ALLOWED_CURRENCIES_CONFIG_SEPARATOR, + Mage::getStoreConfig(self::XML_PATH_ALLOWED_CURRENCIES, null) + ); + + /* @var $storeModel Mage_Adminhtml_Model_System_Store */ + $storeModel = Mage::getSingleton('adminhtml/system_store'); + foreach ($storeModel->getWebsiteCollection() as $website) { + $websiteShow = false; + foreach ($storeModel->getGroupCollection() as $group) { + if ($group->getWebsiteId() != $website->getId()) { + continue; + } + foreach ($storeModel->getStoreCollection() as $store) { + if ($store->getGroupId() != $group->getId()) { + continue; + } + if (!$websiteShow) { + $websiteShow = true; + $websiteSymbols = $website->getConfig(self::XML_PATH_ALLOWED_CURRENCIES); + $allowedCurrencies = array_merge($allowedCurrencies, explode( + self::ALLOWED_CURRENCIES_CONFIG_SEPARATOR, + $websiteSymbols + )); + } + $storeSymbols = Mage::getStoreConfig(self::XML_PATH_ALLOWED_CURRENCIES, $store); + $allowedCurrencies = array_merge($allowedCurrencies, explode( + self::ALLOWED_CURRENCIES_CONFIG_SEPARATOR, + $storeSymbols + )); + } + } + } + ksort($allowedCurrencies); + + $currentSymbols = $this->_unserializeStoreConfig(self::XML_PATH_CUSTOM_CURRENCY_SYMBOL); + + /** @var $locale Mage_Core_Model_Locale */ + $locale = Mage::app()->getLocale(); + foreach ($allowedCurrencies as $code) { + if (!$symbol = $locale->getTranslation($code, 'currencysymbol')) { + $symbol = $code; + } + $name = $locale->getTranslation($code, 'nametocurrency'); + if (!$name) { + $name = $code; + } + $this->_symbolsData[$code] = array( + 'parentSymbol' => $symbol, + 'displayName' => $name + ); + + if (isset($currentSymbols[$code]) && !empty($currentSymbols[$code])) { + $this->_symbolsData[$code]['displaySymbol'] = $currentSymbols[$code]; + } else { + $this->_symbolsData[$code]['displaySymbol'] = $this->_symbolsData[$code]['parentSymbol']; + } + if ($this->_symbolsData[$code]['parentSymbol'] == $this->_symbolsData[$code]['displaySymbol']) { + $this->_symbolsData[$code]['inherited'] = true; + } else { + $this->_symbolsData[$code]['inherited'] = false; + } + } + + return $this->_symbolsData; + } + + /** + * Saves currency symbol to config + * + * @param $symbols array + * @return Mage_CurrencySymbol_Model_System_Currencysymbol + */ + public function setCurrencySymbolsData($symbols=array()) + { + foreach ($this->getCurrencySymbolsData() as $code => $values) { + if (isset($symbols[$code])) { + if ($symbols[$code] == $values['parentSymbol'] || empty($symbols[$code])) + unset($symbols[$code]); + } + } + if ($symbols) { + $value['options']['fields']['customsymbol']['value'] = serialize($symbols); + } else { + $value['options']['fields']['customsymbol']['inherit'] = 1; + } + + Mage::getModel('adminhtml/config_data') + ->setSection(self::CONFIG_SECTION) + ->setWebsite(null) + ->setStore(null) + ->setGroups($value) + ->save(); + + Mage::dispatchEvent('admin_system_config_changed_section_currency_before_reinit', + array('website' => $this->_websiteId, 'store' => $this->_storeId) + ); + + // reinit configuration + Mage::getConfig()->reinit(); + Mage::app()->reinitStores(); + + $this->clearCache(); + + Mage::dispatchEvent('admin_system_config_changed_section_currency', + array('website' => $this->_websiteId, 'store' => $this->_storeId) + ); + + return $this; + } + + /** + * Returns custom currency symbol by currency code + * + * @param $code + * @return bool|string + */ + public function getCurrencySymbol($code) + { + $customSymbols = $this->_unserializeStoreConfig(self::XML_PATH_CUSTOM_CURRENCY_SYMBOL); + if (array_key_exists($code, $customSymbols)) { + return $customSymbols[$code]; + } + + return false; + } + + /** + * Clear translate cache + * + * @return Saas_Translate_Helper_Data + */ + public function clearCache() + { + // clear cache for frontend + foreach ($this->_cacheTypes as $cacheType) { + Mage::app()->getCacheInstance()->invalidateType($cacheType); + } + return $this; + } + + /** + * Unserialize data from Store Config. + * + * @param string $configPath + * @param int $storeId + * @return array + */ + protected function _unserializeStoreConfig($configPath, $storeId = null) + { + $result = array(); + $configData = (string)Mage::getStoreConfig($configPath, $storeId); + if ($configData) { + $result = unserialize($configData); + } + + return is_array($result) ? $result : array(); + } +} diff --git a/app/code/core/Mage/CurrencySymbol/controllers/Adminhtml/System/CurrencysymbolController.php b/app/code/core/Mage/CurrencySymbol/controllers/Adminhtml/System/CurrencysymbolController.php new file mode 100644 index 0000000000..bef8d380ec --- /dev/null +++ b/app/code/core/Mage/CurrencySymbol/controllers/Adminhtml/System/CurrencysymbolController.php @@ -0,0 +1,100 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_CurrencySymbol + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Adminhtml Currency Symbols Controller + * + * @category Mage + * @package currencysymbol + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_CurrencySymbol_Adminhtml_System_CurrencysymbolController extends Mage_Adminhtml_Controller_Action +{ + /** + * Show Currency Symbols Management dialog + */ + public function indexAction() + { + // set active menu and breadcrumbs + $this->loadLayout() + ->_setActiveMenu('system/currency') + ->_addBreadcrumb( + Mage::helper('currencysymbol')->__('System'), + Mage::helper('currencysymbol')->__('System') + ) + ->_addBreadcrumb( + Mage::helper('currencysymbol')->__('Manage Currency Rates'), + Mage::helper('currencysymbol')->__('Manage Currency Rates') + ); + + $this->_title($this->__('System')) + ->_title($this->__('Manage Currency Rates')); + $this->renderLayout(); + } + + /** + * Save custom Currency symbol + */ + public function saveAction() + { + $symbolsDataArray = $this->getRequest()->getParam('custom_currency_symbol', null); + if (is_array($symbolsDataArray)) { + foreach ($symbolsDataArray as &$symbolsData) { + $symbolsData = Mage::helper('adminhtml')->stripTags($symbolsData); + } + } + + try { + Mage::getModel('currencysymbol/system_currencysymbol')->setCurrencySymbolsData($symbolsDataArray); + Mage::getSingleton('connect/session')->addSuccess( + Mage::helper('currencysymbol')->__('Custom currency symbols were applied successfully.') + ); + } catch (Exception $e) { + Mage::getSingleton('adminhtml/session')->addError($e->getMessage()); + } + + $this->_redirectReferer(); + } + + /** + * Resets custom Currency symbol for all store views, websites and default value + */ + public function resetAction() + { + Mage::getModel('currencysymbol/system_currencysymbol')->resetValues(); + $this->_redirectReferer(); + } + + /** + * Check the permission to run it + * + * @return boolean + */ + protected function _isAllowed() + { + return Mage::getSingleton('admin/session')->isAllowed('system/currency/symbols'); + } +} diff --git a/app/code/core/Mage/CurrencySymbol/etc/adminhtml.xml b/app/code/core/Mage/CurrencySymbol/etc/adminhtml.xml new file mode 100644 index 0000000000..64b7849716 --- /dev/null +++ b/app/code/core/Mage/CurrencySymbol/etc/adminhtml.xml @@ -0,0 +1,76 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_CurrencySymbol + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<config> + <menu> + <system> + <children> + <currency translate="title" module="currencysymbol"> + <title>Manage Currency + + + Rates + adminhtml/system_currency + 50 + + + Symbols + adminhtml/system_currencysymbol + 100 + + + 50 + + + + + + + + + + + + Manage Currency + + + Rates + 50 + + + Symbols + 100 + + + + + + + + + + diff --git a/app/code/core/Mage/CurrencySymbol/etc/config.xml b/app/code/core/Mage/CurrencySymbol/etc/config.xml new file mode 100644 index 0000000000..72bab52bd0 --- /dev/null +++ b/app/code/core/Mage/CurrencySymbol/etc/config.xml @@ -0,0 +1,93 @@ + + + + + + 1.0.0.0.0 + + + + + + + Mage_CurrencySymbol_Model + + + + + Mage_CurrencySymbol_Helper + + + + + Mage_CurrencySymbol_Block + + + + + + + currencysymbol/observer + currencyDisplayOptions + + + + + + + + + + + + Mage_CurrencySymbol_Adminhtml + + + + + + + + + + + currencysymbol.xml + + + + + + + + Mage_CurrencySymbol.csv + + + + + + diff --git a/app/code/core/Mage/Customer/Block/Account.php b/app/code/core/Mage/Customer/Block/Account.php index 5ef4db3ad4..cc80ed4c18 100644 --- a/app/code/core/Mage/Customer/Block/Account.php +++ b/app/code/core/Mage/Customer/Block/Account.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Block/Account/Dashboard.php b/app/code/core/Mage/Customer/Block/Account/Dashboard.php index 097715abb2..6095b51d34 100644 --- a/app/code/core/Mage/Customer/Block/Account/Dashboard.php +++ b/app/code/core/Mage/Customer/Block/Account/Dashboard.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Block/Account/Dashboard/Address.php b/app/code/core/Mage/Customer/Block/Account/Dashboard/Address.php index 8c2235ad3d..7bf52bcfcf 100644 --- a/app/code/core/Mage/Customer/Block/Account/Dashboard/Address.php +++ b/app/code/core/Mage/Customer/Block/Account/Dashboard/Address.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Block/Account/Dashboard/Block.php b/app/code/core/Mage/Customer/Block/Account/Dashboard/Block.php index f518a2ddb5..8095a53cd4 100644 --- a/app/code/core/Mage/Customer/Block/Account/Dashboard/Block.php +++ b/app/code/core/Mage/Customer/Block/Account/Dashboard/Block.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Block/Account/Dashboard/Hello.php b/app/code/core/Mage/Customer/Block/Account/Dashboard/Hello.php index 650d0760cf..2061aa0404 100644 --- a/app/code/core/Mage/Customer/Block/Account/Dashboard/Hello.php +++ b/app/code/core/Mage/Customer/Block/Account/Dashboard/Hello.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Block/Account/Dashboard/Info.php b/app/code/core/Mage/Customer/Block/Account/Dashboard/Info.php index 01c5da5154..242d34b09a 100644 --- a/app/code/core/Mage/Customer/Block/Account/Dashboard/Info.php +++ b/app/code/core/Mage/Customer/Block/Account/Dashboard/Info.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Block/Account/Dashboard/Newsletter.php b/app/code/core/Mage/Customer/Block/Account/Dashboard/Newsletter.php index 4392a492a2..955f6d798e 100644 --- a/app/code/core/Mage/Customer/Block/Account/Dashboard/Newsletter.php +++ b/app/code/core/Mage/Customer/Block/Account/Dashboard/Newsletter.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Block/Account/Dashboard/Sidebar.php b/app/code/core/Mage/Customer/Block/Account/Dashboard/Sidebar.php index 95db64260b..8ebc3d9366 100644 --- a/app/code/core/Mage/Customer/Block/Account/Dashboard/Sidebar.php +++ b/app/code/core/Mage/Customer/Block/Account/Dashboard/Sidebar.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Block/Account/Forgotpassword.php b/app/code/core/Mage/Customer/Block/Account/Forgotpassword.php index d1e18c6d0d..f5544b6eef 100644 --- a/app/code/core/Mage/Customer/Block/Account/Forgotpassword.php +++ b/app/code/core/Mage/Customer/Block/Account/Forgotpassword.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Block/Account/Navigation.php b/app/code/core/Mage/Customer/Block/Account/Navigation.php index 14b514dc89..2a5e403a31 100644 --- a/app/code/core/Mage/Customer/Block/Account/Navigation.php +++ b/app/code/core/Mage/Customer/Block/Account/Navigation.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Block/Account/Resetpassword.php b/app/code/core/Mage/Customer/Block/Account/Resetpassword.php index fa36efb1b0..81624358ec 100644 --- a/app/code/core/Mage/Customer/Block/Account/Resetpassword.php +++ b/app/code/core/Mage/Customer/Block/Account/Resetpassword.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Block/Address/Book.php b/app/code/core/Mage/Customer/Block/Address/Book.php index 8957f6b1e2..2b295c580f 100644 --- a/app/code/core/Mage/Customer/Block/Address/Book.php +++ b/app/code/core/Mage/Customer/Block/Address/Book.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Block/Address/Edit.php b/app/code/core/Mage/Customer/Block/Address/Edit.php old mode 100644 new mode 100755 index d00f8b5766..ee872a1a3b --- a/app/code/core/Mage/Customer/Block/Address/Edit.php +++ b/app/code/core/Mage/Customer/Block/Address/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -61,8 +61,9 @@ protected function _prepareLayout() if ($headBlock = $this->getLayout()->getBlock('head')) { $headBlock->setTitle($this->getTitle()); } + if ($postedData = Mage::getSingleton('customer/session')->getAddressFormData(true)) { - $this->_address->setData($postedData); + $this->_address->addData($postedData); } } diff --git a/app/code/core/Mage/Customer/Block/Address/Renderer/Default.php b/app/code/core/Mage/Customer/Block/Address/Renderer/Default.php index 1e5e4dd17c..475044df7f 100644 --- a/app/code/core/Mage/Customer/Block/Address/Renderer/Default.php +++ b/app/code/core/Mage/Customer/Block/Address/Renderer/Default.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Block/Address/Renderer/Interface.php b/app/code/core/Mage/Customer/Block/Address/Renderer/Interface.php index 826c103970..8306a7e6c3 100644 --- a/app/code/core/Mage/Customer/Block/Address/Renderer/Interface.php +++ b/app/code/core/Mage/Customer/Block/Address/Renderer/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Block/Form/Edit.php b/app/code/core/Mage/Customer/Block/Form/Edit.php index f09e6ad023..1bc26c3c85 100644 --- a/app/code/core/Mage/Customer/Block/Form/Edit.php +++ b/app/code/core/Mage/Customer/Block/Form/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Block/Form/Login.php b/app/code/core/Mage/Customer/Block/Form/Login.php index c939a925fd..20076082f9 100644 --- a/app/code/core/Mage/Customer/Block/Form/Login.php +++ b/app/code/core/Mage/Customer/Block/Form/Login.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Block/Form/Register.php b/app/code/core/Mage/Customer/Block/Form/Register.php index 18ee03acad..408a6dc146 100644 --- a/app/code/core/Mage/Customer/Block/Form/Register.php +++ b/app/code/core/Mage/Customer/Block/Form/Register.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Block/Newsletter.php b/app/code/core/Mage/Customer/Block/Newsletter.php index 5dbe1e099d..f7271c1c8b 100644 --- a/app/code/core/Mage/Customer/Block/Newsletter.php +++ b/app/code/core/Mage/Customer/Block/Newsletter.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Block/Widget/Abstract.php b/app/code/core/Mage/Customer/Block/Widget/Abstract.php index 0d7fe0ecd4..0dade6d7eb 100644 --- a/app/code/core/Mage/Customer/Block/Widget/Abstract.php +++ b/app/code/core/Mage/Customer/Block/Widget/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Block/Widget/Dob.php b/app/code/core/Mage/Customer/Block/Widget/Dob.php index 5c5b4eed66..b2760ec648 100644 --- a/app/code/core/Mage/Customer/Block/Widget/Dob.php +++ b/app/code/core/Mage/Customer/Block/Widget/Dob.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Block/Widget/Gender.php b/app/code/core/Mage/Customer/Block/Widget/Gender.php index cadcdbf3c6..194ea89809 100644 --- a/app/code/core/Mage/Customer/Block/Widget/Gender.php +++ b/app/code/core/Mage/Customer/Block/Widget/Gender.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Block/Widget/Name.php b/app/code/core/Mage/Customer/Block/Widget/Name.php index 189c0ac97e..50c40addcc 100644 --- a/app/code/core/Mage/Customer/Block/Widget/Name.php +++ b/app/code/core/Mage/Customer/Block/Widget/Name.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -95,6 +95,16 @@ public function showMiddlename() return (bool)$this->_getAttribute('middlename')->getIsVisible(); } + /** + * Define if middlename attribute is required + * + * @return bool + */ + public function isMiddlenameRequired() + { + return (bool)$this->_getAttribute('middlename')->getIsRequired(); + } + /** * Define if suffix attribute can be shown * diff --git a/app/code/core/Mage/Customer/Block/Widget/Taxvat.php b/app/code/core/Mage/Customer/Block/Widget/Taxvat.php index 1fe6f4ebcb..111c853c0b 100644 --- a/app/code/core/Mage/Customer/Block/Widget/Taxvat.php +++ b/app/code/core/Mage/Customer/Block/Widget/Taxvat.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Exception.php b/app/code/core/Mage/Customer/Exception.php index 60763500c2..71c17eef4f 100644 --- a/app/code/core/Mage/Customer/Exception.php +++ b/app/code/core/Mage/Customer/Exception.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Helper/Address.php b/app/code/core/Mage/Customer/Helper/Address.php index 9ada743ed8..81c6d1b4f2 100644 --- a/app/code/core/Mage/Customer/Helper/Address.php +++ b/app/code/core/Mage/Customer/Helper/Address.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -37,6 +37,7 @@ class Mage_Customer_Helper_Address extends Mage_Core_Helper_Abstract const XML_PATH_VIV_DISABLE_AUTO_ASSIGN_DEFAULT = 'customer/create_account/viv_disable_auto_group_assign_default'; const XML_PATH_VIV_ON_EACH_TRANSACTION = 'customer/create_account/viv_on_each_transaction'; const XML_PATH_VAT_VALIDATION_ENABLED = 'customer/create_account/auto_group_assign'; + const XML_PATH_VIV_TAX_CALCULATION_ADDRESS_TYPE = 'customer/create_account/tax_calculation_address_type'; /** * Array of Customer Address Attributes @@ -239,4 +240,15 @@ public function getValidateOnEachTransaction($store = null) { return (bool)Mage::getStoreConfig(self::XML_PATH_VIV_ON_EACH_TRANSACTION, $store); } + + /** + * Retrieve customer address type on which tax calculation must be based + * + * @param Mage_Core_Model_Store|string|int|null $store + * @return string + */ + public function getTaxCalculationAddressType($store = null) + { + return (string)Mage::getStoreConfig(self::XML_PATH_VIV_TAX_CALCULATION_ADDRESS_TYPE, $store); + } } diff --git a/app/code/core/Mage/Customer/Helper/Data.php b/app/code/core/Mage/Customer/Helper/Data.php index 6dd82f6d37..fb746fb141 100644 --- a/app/code/core/Mage/Customer/Helper/Data.php +++ b/app/code/core/Mage/Customer/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -396,14 +396,13 @@ public function getDefaultCustomerGroupId($store = null) * @param string $customerCountryCode * @param Varien_Object $vatValidationResult * @param Mage_Core_Model_Store|string|int $store - * * @return null|int */ public function getCustomerGroupIdBasedOnVatNumber($customerCountryCode, $vatValidationResult, $store = null) { $groupId = null; - $vatClass = $this->getCustomerVatClass($customerCountryCode, $vatValidationResult); + $vatClass = $this->getCustomerVatClass($customerCountryCode, $vatValidationResult, $store); $vatClassToGroupXmlPathMap = array( self::VAT_CLASS_DOMESTIC => self::XML_PATH_CUSTOMER_VIV_DOMESTIC_GROUP, @@ -454,9 +453,9 @@ public function checkVatNumber($countryCode, $vatNumber, $requesterCountryCode = $requestParams = array(); $requestParams['countryCode'] = $countryCode; - $requestParams['vatNumber'] = $vatNumber; + $requestParams['vatNumber'] = str_replace(array(' ', '-'), array('', ''), $vatNumber); $requestParams['requesterCountryCode'] = $requesterCountryCode; - $requestParams['requesterVatNumber'] = $requesterVatNumber; + $requestParams['requesterVatNumber'] = str_replace(array(' ', '-'), array('', ''), $requesterVatNumber); // Send request to service $result = $soapClient->checkVatApprox($requestParams); @@ -512,9 +511,10 @@ public function canCheckVatNumber($countryCode, $vatNumber, $requesterCountryCod * * @param string $customerCountryCode * @param Varien_Object $vatValidationResult + * @param Mage_Core_Model_Store|string|int|null $store * @return null|string */ - public function getCustomerVatClass($customerCountryCode, $vatValidationResult) + public function getCustomerVatClass($customerCountryCode, $vatValidationResult, $store = null) { $vatClass = null; @@ -522,7 +522,7 @@ public function getCustomerVatClass($customerCountryCode, $vatValidationResult) if (is_string($customerCountryCode) && !empty($customerCountryCode) - && $customerCountryCode === Mage::helper('core')->getMerchantCountryCode() + && $customerCountryCode === Mage::helper('core')->getMerchantCountryCode($store) && $isVatNumberValid ) { $vatClass = self::VAT_CLASS_DOMESTIC; diff --git a/app/code/core/Mage/Customer/Model/Address.php b/app/code/core/Mage/Customer/Model/Address.php index 0576f82731..5e3d71c7c5 100644 --- a/app/code/core/Mage/Customer/Model/Address.php +++ b/app/code/core/Mage/Customer/Model/Address.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Address/Abstract.php b/app/code/core/Mage/Customer/Model/Address/Abstract.php index 426fcbf428..6742789ab3 100644 --- a/app/code/core/Mage/Customer/Model/Address/Abstract.php +++ b/app/code/core/Mage/Customer/Model/Address/Abstract.php @@ -20,19 +20,39 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** * Address abstract model * - * @author Magento Core Team + * @category Mage + * @package Mage_Customer + * @author Magento Core Team */ class Mage_Customer_Model_Address_Abstract extends Mage_Core_Model_Abstract { + /** + * Possible customer address types + */ + const TYPE_BILLING = 'billing'; + const TYPE_SHIPPING = 'shipping'; + + /** + * Prefix of model events + * + * @var string + */ protected $_eventPrefix = 'customer_address'; + + /** + * Name of event object + * + * @var string + */ protected $_eventObject = 'customer_address'; + /** * Directory country models * @@ -231,10 +251,8 @@ public function getRegionId() $this->setData('region_id', $region); $this->unsRegion(); } else { - $regionModel = Mage::getModel('directory/region')->loadByCode( - $this->getRegionCode(), - $this->getCountryId() - ); + $regionModel = Mage::getModel('directory/region') + ->loadByCode($this->getRegionCode(), $this->getCountryId()); $this->setData('region_id', $regionModel->getId()); } } @@ -243,6 +261,11 @@ public function getRegionId() public function getCountry() { + /*if ($this->getData('country_id') && !$this->getData('country')) { + $this->setData('country', Mage::getModel('directory/country') + ->load($this->getData('country_id'))->getIso2Code()); + } + return $this->getData('country');*/ $country = $this->getCountryId(); return $country ? $country : $this->getData('country'); } @@ -255,9 +278,8 @@ public function getCountry() public function getCountryModel() { if(!isset(self::$_countryModels[$this->getCountryId()])) { - self::$_countryModels[$this->getCountryId()] = Mage::getModel('directory/country')->load( - $this->getCountryId() - ); + self::$_countryModels[$this->getCountryId()] = Mage::getModel('directory/country') + ->load($this->getCountryId()); } return self::$_countryModels[$this->getCountryId()]; @@ -295,6 +317,7 @@ public function getHtmlFormat() public function getFormated($html=false) { return $this->format($html ? 'html' : 'text'); + //Mage::getModel('directory/country')->load($this->getCountryId())->formatAddress($this, $html); } public function format($type) @@ -365,7 +388,9 @@ public function validate() } if ($this->getCountryModel()->getRegionCollection()->getSize() - && !Zend_Validate::is($this->getRegionId(), 'NotEmpty')) { + && !Zend_Validate::is($this->getRegionId(), 'NotEmpty') + && Mage::helper('directory')->isRegionRequired($this->getCountryId()) + ) { $errors[] = Mage::helper('customer')->__('Please enter the state/province.'); } diff --git a/app/code/core/Mage/Customer/Model/Address/Api.php b/app/code/core/Mage/Customer/Model/Address/Api.php index c292bc38b9..224cccbfd2 100644 --- a/app/code/core/Mage/Customer/Model/Address/Api.php +++ b/app/code/core/Mage/Customer/Model/Address/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Address/Api/V2.php b/app/code/core/Mage/Customer/Model/Address/Api/V2.php index 29cef1aa98..93595e7ee1 100644 --- a/app/code/core/Mage/Customer/Model/Address/Api/V2.php +++ b/app/code/core/Mage/Customer/Model/Address/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Address/Config.php b/app/code/core/Mage/Customer/Model/Address/Config.php index e88171fcd5..7240b9041a 100644 --- a/app/code/core/Mage/Customer/Model/Address/Config.php +++ b/app/code/core/Mage/Customer/Model/Address/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Api/Resource.php b/app/code/core/Mage/Customer/Model/Api/Resource.php index b6a52df146..cf92c36b93 100644 --- a/app/code/core/Mage/Customer/Model/Api/Resource.php +++ b/app/code/core/Mage/Customer/Model/Api/Resource.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Attribute.php b/app/code/core/Mage/Customer/Model/Attribute.php index d7771f665c..b02487bc22 100644 --- a/app/code/core/Mage/Customer/Model/Attribute.php +++ b/app/code/core/Mage/Customer/Model/Attribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Attribute/Backend/Data/Boolean.php b/app/code/core/Mage/Customer/Model/Attribute/Backend/Data/Boolean.php index fe439b8d7d..59365d76a1 100644 --- a/app/code/core/Mage/Customer/Model/Attribute/Backend/Data/Boolean.php +++ b/app/code/core/Mage/Customer/Model/Attribute/Backend/Data/Boolean.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Attribute/Data.php b/app/code/core/Mage/Customer/Model/Attribute/Data.php index feffe7322c..5101f1f995 100644 --- a/app/code/core/Mage/Customer/Model/Attribute/Data.php +++ b/app/code/core/Mage/Customer/Model/Attribute/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Attribute/Data/Abstract.php b/app/code/core/Mage/Customer/Model/Attribute/Data/Abstract.php index 7280af9d26..7493f14ab1 100644 --- a/app/code/core/Mage/Customer/Model/Attribute/Data/Abstract.php +++ b/app/code/core/Mage/Customer/Model/Attribute/Data/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Attribute/Data/Boolean.php b/app/code/core/Mage/Customer/Model/Attribute/Data/Boolean.php index a7b092f3fe..650ade21d9 100644 --- a/app/code/core/Mage/Customer/Model/Attribute/Data/Boolean.php +++ b/app/code/core/Mage/Customer/Model/Attribute/Data/Boolean.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Attribute/Data/Date.php b/app/code/core/Mage/Customer/Model/Attribute/Data/Date.php index d7835299ae..3452abad31 100644 --- a/app/code/core/Mage/Customer/Model/Attribute/Data/Date.php +++ b/app/code/core/Mage/Customer/Model/Attribute/Data/Date.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Attribute/Data/File.php b/app/code/core/Mage/Customer/Model/Attribute/Data/File.php index 2eef4f7ea3..efbded70ed 100644 --- a/app/code/core/Mage/Customer/Model/Attribute/Data/File.php +++ b/app/code/core/Mage/Customer/Model/Attribute/Data/File.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Attribute/Data/Hidden.php b/app/code/core/Mage/Customer/Model/Attribute/Data/Hidden.php index 69330a9ec4..67fac25a2c 100644 --- a/app/code/core/Mage/Customer/Model/Attribute/Data/Hidden.php +++ b/app/code/core/Mage/Customer/Model/Attribute/Data/Hidden.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Attribute/Data/Image.php b/app/code/core/Mage/Customer/Model/Attribute/Data/Image.php index b56aa20683..efa7ab8116 100644 --- a/app/code/core/Mage/Customer/Model/Attribute/Data/Image.php +++ b/app/code/core/Mage/Customer/Model/Attribute/Data/Image.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Attribute/Data/Multiline.php b/app/code/core/Mage/Customer/Model/Attribute/Data/Multiline.php index 91c1cb9637..d45ed771df 100644 --- a/app/code/core/Mage/Customer/Model/Attribute/Data/Multiline.php +++ b/app/code/core/Mage/Customer/Model/Attribute/Data/Multiline.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Attribute/Data/Multiselect.php b/app/code/core/Mage/Customer/Model/Attribute/Data/Multiselect.php index c6b87fdbcc..55788d5830 100644 --- a/app/code/core/Mage/Customer/Model/Attribute/Data/Multiselect.php +++ b/app/code/core/Mage/Customer/Model/Attribute/Data/Multiselect.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Attribute/Data/Postcode.php b/app/code/core/Mage/Customer/Model/Attribute/Data/Postcode.php index 665468bc7d..5e18bccae4 100644 --- a/app/code/core/Mage/Customer/Model/Attribute/Data/Postcode.php +++ b/app/code/core/Mage/Customer/Model/Attribute/Data/Postcode.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Attribute/Data/Select.php b/app/code/core/Mage/Customer/Model/Attribute/Data/Select.php index fa38e70e67..49403867a9 100644 --- a/app/code/core/Mage/Customer/Model/Attribute/Data/Select.php +++ b/app/code/core/Mage/Customer/Model/Attribute/Data/Select.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Attribute/Data/Text.php b/app/code/core/Mage/Customer/Model/Attribute/Data/Text.php index 92371ed47f..ecdd3b9bb5 100644 --- a/app/code/core/Mage/Customer/Model/Attribute/Data/Text.php +++ b/app/code/core/Mage/Customer/Model/Attribute/Data/Text.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Attribute/Data/Textarea.php b/app/code/core/Mage/Customer/Model/Attribute/Data/Textarea.php index 3e5aa120eb..9a2aebdbda 100644 --- a/app/code/core/Mage/Customer/Model/Attribute/Data/Textarea.php +++ b/app/code/core/Mage/Customer/Model/Attribute/Data/Textarea.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Config/Share.php b/app/code/core/Mage/Customer/Model/Config/Share.php index d91ae036c5..a72dbf6211 100644 --- a/app/code/core/Mage/Customer/Model/Config/Share.php +++ b/app/code/core/Mage/Customer/Model/Config/Share.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Convert/Adapter/Customer.php b/app/code/core/Mage/Customer/Model/Convert/Adapter/Customer.php index aa8cbff738..d81150279d 100644 --- a/app/code/core/Mage/Customer/Model/Convert/Adapter/Customer.php +++ b/app/code/core/Mage/Customer/Model/Convert/Adapter/Customer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Convert/Parser/Customer.php b/app/code/core/Mage/Customer/Model/Convert/Parser/Customer.php index f6e578c6d6..b3b502ac33 100644 --- a/app/code/core/Mage/Customer/Model/Convert/Parser/Customer.php +++ b/app/code/core/Mage/Customer/Model/Convert/Parser/Customer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Customer.php b/app/code/core/Mage/Customer/Model/Customer.php index e0017c0596..75d5e9f59b 100644 --- a/app/code/core/Mage/Customer/Model/Customer.php +++ b/app/code/core/Mage/Customer/Model/Customer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Customer/Api.php b/app/code/core/Mage/Customer/Model/Customer/Api.php index 8eec34b85e..a7ddc64ecd 100644 --- a/app/code/core/Mage/Customer/Model/Customer/Api.php +++ b/app/code/core/Mage/Customer/Model/Customer/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Customer/Api/V2.php b/app/code/core/Mage/Customer/Model/Customer/Api/V2.php index 23fa81b79f..5586965400 100644 --- a/app/code/core/Mage/Customer/Model/Customer/Api/V2.php +++ b/app/code/core/Mage/Customer/Model/Customer/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Customer/Attribute/Backend/Billing.php b/app/code/core/Mage/Customer/Model/Customer/Attribute/Backend/Billing.php index d509f11d31..d5b69040f5 100644 --- a/app/code/core/Mage/Customer/Model/Customer/Attribute/Backend/Billing.php +++ b/app/code/core/Mage/Customer/Model/Customer/Attribute/Backend/Billing.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Customer/Attribute/Backend/Password.php b/app/code/core/Mage/Customer/Model/Customer/Attribute/Backend/Password.php index 37444a8773..f9d6ea45cb 100644 --- a/app/code/core/Mage/Customer/Model/Customer/Attribute/Backend/Password.php +++ b/app/code/core/Mage/Customer/Model/Customer/Attribute/Backend/Password.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Customer/Attribute/Backend/Shipping.php b/app/code/core/Mage/Customer/Model/Customer/Attribute/Backend/Shipping.php index 3a0197102d..68281940a3 100644 --- a/app/code/core/Mage/Customer/Model/Customer/Attribute/Backend/Shipping.php +++ b/app/code/core/Mage/Customer/Model/Customer/Attribute/Backend/Shipping.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Customer/Attribute/Backend/Store.php b/app/code/core/Mage/Customer/Model/Customer/Attribute/Backend/Store.php index 057ca7567b..2e99517f5c 100644 --- a/app/code/core/Mage/Customer/Model/Customer/Attribute/Backend/Store.php +++ b/app/code/core/Mage/Customer/Model/Customer/Attribute/Backend/Store.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Customer/Attribute/Backend/Website.php b/app/code/core/Mage/Customer/Model/Customer/Attribute/Backend/Website.php index 0f190f6f05..36764d3f1f 100644 --- a/app/code/core/Mage/Customer/Model/Customer/Attribute/Backend/Website.php +++ b/app/code/core/Mage/Customer/Model/Customer/Attribute/Backend/Website.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Customer/Attribute/Source/Group.php b/app/code/core/Mage/Customer/Model/Customer/Attribute/Source/Group.php index 00abb66067..cd9a1c3840 100644 --- a/app/code/core/Mage/Customer/Model/Customer/Attribute/Source/Group.php +++ b/app/code/core/Mage/Customer/Model/Customer/Attribute/Source/Group.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Customer/Attribute/Source/Store.php b/app/code/core/Mage/Customer/Model/Customer/Attribute/Source/Store.php index c6c0cc0e4f..0b15d84284 100644 --- a/app/code/core/Mage/Customer/Model/Customer/Attribute/Source/Store.php +++ b/app/code/core/Mage/Customer/Model/Customer/Attribute/Source/Store.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Customer/Attribute/Source/Website.php b/app/code/core/Mage/Customer/Model/Customer/Attribute/Source/Website.php index 29f8aa1d45..10e0ed54d1 100644 --- a/app/code/core/Mage/Customer/Model/Customer/Attribute/Source/Website.php +++ b/app/code/core/Mage/Customer/Model/Customer/Attribute/Source/Website.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Entity/Address.php b/app/code/core/Mage/Customer/Model/Entity/Address.php index 350aaaa844..0683d1c300 100644 --- a/app/code/core/Mage/Customer/Model/Entity/Address.php +++ b/app/code/core/Mage/Customer/Model/Entity/Address.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Entity/Address/Attribute/Backend/Region.php b/app/code/core/Mage/Customer/Model/Entity/Address/Attribute/Backend/Region.php index 433ee5f0ca..ce1a185170 100644 --- a/app/code/core/Mage/Customer/Model/Entity/Address/Attribute/Backend/Region.php +++ b/app/code/core/Mage/Customer/Model/Entity/Address/Attribute/Backend/Region.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Entity/Address/Attribute/Backend/Street.php b/app/code/core/Mage/Customer/Model/Entity/Address/Attribute/Backend/Street.php index 74bd16b89b..3cc343bedb 100644 --- a/app/code/core/Mage/Customer/Model/Entity/Address/Attribute/Backend/Street.php +++ b/app/code/core/Mage/Customer/Model/Entity/Address/Attribute/Backend/Street.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Entity/Address/Attribute/Collection.php b/app/code/core/Mage/Customer/Model/Entity/Address/Attribute/Collection.php index 9a20d0d629..f4ecb84487 100644 --- a/app/code/core/Mage/Customer/Model/Entity/Address/Attribute/Collection.php +++ b/app/code/core/Mage/Customer/Model/Entity/Address/Attribute/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Entity/Address/Attribute/Source/Country.php b/app/code/core/Mage/Customer/Model/Entity/Address/Attribute/Source/Country.php index 3f143be02a..b31de2fa92 100644 --- a/app/code/core/Mage/Customer/Model/Entity/Address/Attribute/Source/Country.php +++ b/app/code/core/Mage/Customer/Model/Entity/Address/Attribute/Source/Country.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Entity/Address/Attribute/Source/Region.php b/app/code/core/Mage/Customer/Model/Entity/Address/Attribute/Source/Region.php index be18d3135c..a40a34150c 100644 --- a/app/code/core/Mage/Customer/Model/Entity/Address/Attribute/Source/Region.php +++ b/app/code/core/Mage/Customer/Model/Entity/Address/Attribute/Source/Region.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Entity/Address/Collection.php b/app/code/core/Mage/Customer/Model/Entity/Address/Collection.php index cf93619c64..5d81e8b6bf 100644 --- a/app/code/core/Mage/Customer/Model/Entity/Address/Collection.php +++ b/app/code/core/Mage/Customer/Model/Entity/Address/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Entity/Attribute.php b/app/code/core/Mage/Customer/Model/Entity/Attribute.php index e6dc2a94b2..d1c5b77822 100644 --- a/app/code/core/Mage/Customer/Model/Entity/Attribute.php +++ b/app/code/core/Mage/Customer/Model/Entity/Attribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Entity/Attribute/Collection.php b/app/code/core/Mage/Customer/Model/Entity/Attribute/Collection.php index 189b5ac348..fc5ecbfa46 100644 --- a/app/code/core/Mage/Customer/Model/Entity/Attribute/Collection.php +++ b/app/code/core/Mage/Customer/Model/Entity/Attribute/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Entity/Customer.php b/app/code/core/Mage/Customer/Model/Entity/Customer.php index 3dbe8708ed..5477087324 100644 --- a/app/code/core/Mage/Customer/Model/Entity/Customer.php +++ b/app/code/core/Mage/Customer/Model/Entity/Customer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Entity/Customer/Collection.php b/app/code/core/Mage/Customer/Model/Entity/Customer/Collection.php index 7a1006e236..480e1c64b3 100644 --- a/app/code/core/Mage/Customer/Model/Entity/Customer/Collection.php +++ b/app/code/core/Mage/Customer/Model/Entity/Customer/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Entity/Form/Attribute.php b/app/code/core/Mage/Customer/Model/Entity/Form/Attribute.php index 29cd339ce4..a37722efd2 100644 --- a/app/code/core/Mage/Customer/Model/Entity/Form/Attribute.php +++ b/app/code/core/Mage/Customer/Model/Entity/Form/Attribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Entity/Form/Attribute/Collection.php b/app/code/core/Mage/Customer/Model/Entity/Form/Attribute/Collection.php index 9b83af265a..1205791c5c 100644 --- a/app/code/core/Mage/Customer/Model/Entity/Form/Attribute/Collection.php +++ b/app/code/core/Mage/Customer/Model/Entity/Form/Attribute/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Entity/Group.php b/app/code/core/Mage/Customer/Model/Entity/Group.php index 8fa0835c18..da841ad58c 100644 --- a/app/code/core/Mage/Customer/Model/Entity/Group.php +++ b/app/code/core/Mage/Customer/Model/Entity/Group.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Entity/Group/Collection.php b/app/code/core/Mage/Customer/Model/Entity/Group/Collection.php index a4a631ee0a..02a489caf1 100644 --- a/app/code/core/Mage/Customer/Model/Entity/Group/Collection.php +++ b/app/code/core/Mage/Customer/Model/Entity/Group/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Entity/Setup.php b/app/code/core/Mage/Customer/Model/Entity/Setup.php index 780848e082..6353256410 100644 --- a/app/code/core/Mage/Customer/Model/Entity/Setup.php +++ b/app/code/core/Mage/Customer/Model/Entity/Setup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Entity/Wishlist/Collection.php b/app/code/core/Mage/Customer/Model/Entity/Wishlist/Collection.php index 47f9b9c815..b818c30a3a 100644 --- a/app/code/core/Mage/Customer/Model/Entity/Wishlist/Collection.php +++ b/app/code/core/Mage/Customer/Model/Entity/Wishlist/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Form.php b/app/code/core/Mage/Customer/Model/Form.php index 71d8fd332a..797452b2f4 100644 --- a/app/code/core/Mage/Customer/Model/Form.php +++ b/app/code/core/Mage/Customer/Model/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Group.php b/app/code/core/Mage/Customer/Model/Group.php index 760e94a16f..4a17d9cc9d 100644 --- a/app/code/core/Mage/Customer/Model/Group.php +++ b/app/code/core/Mage/Customer/Model/Group.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Group/Api.php b/app/code/core/Mage/Customer/Model/Group/Api.php index 9dfd0e646f..91fa8f6b3a 100644 --- a/app/code/core/Mage/Customer/Model/Group/Api.php +++ b/app/code/core/Mage/Customer/Model/Group/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Group/Api/V2.php b/app/code/core/Mage/Customer/Model/Group/Api/V2.php index 7aec13a972..d1b5c56156 100644 --- a/app/code/core/Mage/Customer/Model/Group/Api/V2.php +++ b/app/code/core/Mage/Customer/Model/Group/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Observer.php b/app/code/core/Mage/Customer/Model/Observer.php index d5c56f333f..23e2931962 100644 --- a/app/code/core/Mage/Customer/Model/Observer.php +++ b/app/code/core/Mage/Customer/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -49,7 +49,20 @@ class Mage_Customer_Model_Observer */ protected function _isDefaultBilling($address) { - return $address->getId() && $address->getId() == $address->getCustomer()->getDefaultBilling(); + return ($address->getId() && $address->getId() == $address->getCustomer()->getDefaultBilling()) + || $address->getIsPrimaryBilling() || $address->getIsDefaultBilling(); + } + + /** + * Check whether specified shipping address is default for its customer + * + * @param Mage_Customer_Model_Address $address + * @return bool + */ + protected function _isDefaultShipping($address) + { + return ($address->getId() && $address->getId() == $address->getCustomer()->getDefaultShipping()) + || $address->getIsPrimaryShipping() || $address->getIsDefaultShipping(); } /** @@ -68,6 +81,10 @@ protected function _canProcessAddress($address) return false; } + $configAddressType = Mage::helper('customer/address')->getTaxCalculationAddressType(); + if ($configAddressType == Mage_Customer_Model_Address_Abstract::TYPE_SHIPPING) { + return $this->_isDefaultShipping($address); + } return $this->_isDefaultBilling($address); } @@ -99,10 +116,17 @@ public function beforeAddressSave($observer) $customerAddress = $observer->getCustomerAddress(); if ($customerAddress->getId()) { Mage::register(self::VIV_CURRENTLY_SAVED_ADDRESS, $customerAddress->getId()); - } elseif ($customerAddress->getIsDefaultBilling()) { - $customerAddress->setForceProcess(true); } else { - Mage::register(self::VIV_CURRENTLY_SAVED_ADDRESS, 'new_address'); + $configAddressType = Mage::helper('customer/address')->getTaxCalculationAddressType(); + + $forceProcess = ($configAddressType == Mage_Customer_Model_Address_Abstract::TYPE_SHIPPING) + ? $customerAddress->getIsDefaultShipping() : $customerAddress->getIsDefaultBilling(); + + if ($forceProcess) { + $customerAddress->setForceProcess(true); + } else { + Mage::register(self::VIV_CURRENTLY_SAVED_ADDRESS, 'new_address'); + } } } @@ -171,20 +195,6 @@ public function afterAddressSave($observer) } } - /** - * Assign custom renderer for VAT ID field in billing address form - * - * @param Varien_Event_Observer $observer - */ - public function prepareFormAfter($observer) - { - /** @var $formBlock Mage_Adminhtml_Block_Sales_Order_Create_Billing_Address */ - $formBlock = $observer->getForm(); - $formBlock->getForm()->getElement('vat_id')->setRenderer( - $formBlock->getLayout()->createBlock('adminhtml/customer_sales_order_address_form_billing_renderer_vat') - ); - } - /** * Revert emulated customer group_id * diff --git a/app/code/core/Mage/Customer/Model/Resource/Address.php b/app/code/core/Mage/Customer/Model/Resource/Address.php index ed3414f668..5c66c0c238 100755 --- a/app/code/core/Mage/Customer/Model/Resource/Address.php +++ b/app/code/core/Mage/Customer/Model/Resource/Address.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Backend/Region.php b/app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Backend/Region.php index a8bdebd0cb..9b10d19a3f 100755 --- a/app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Backend/Region.php +++ b/app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Backend/Region.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Backend/Street.php b/app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Backend/Street.php index 7ba4dab0e7..3549843e9d 100755 --- a/app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Backend/Street.php +++ b/app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Backend/Street.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Collection.php b/app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Collection.php index 006de12587..49123f0472 100755 --- a/app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Collection.php +++ b/app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Source/Country.php b/app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Source/Country.php index ce53c3bfa9..c7a0d890d7 100755 --- a/app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Source/Country.php +++ b/app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Source/Country.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Source/Region.php b/app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Source/Region.php index 8b113ff7a3..6cd355b387 100755 --- a/app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Source/Region.php +++ b/app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Source/Region.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Resource/Address/Collection.php b/app/code/core/Mage/Customer/Model/Resource/Address/Collection.php index cd908f1678..301f7c9891 100755 --- a/app/code/core/Mage/Customer/Model/Resource/Address/Collection.php +++ b/app/code/core/Mage/Customer/Model/Resource/Address/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Resource/Attribute.php b/app/code/core/Mage/Customer/Model/Resource/Attribute.php index 592b36e69c..4c91b77e09 100755 --- a/app/code/core/Mage/Customer/Model/Resource/Attribute.php +++ b/app/code/core/Mage/Customer/Model/Resource/Attribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Resource/Attribute/Collection.php b/app/code/core/Mage/Customer/Model/Resource/Attribute/Collection.php index 4489f51f8e..5fb283b7bd 100755 --- a/app/code/core/Mage/Customer/Model/Resource/Attribute/Collection.php +++ b/app/code/core/Mage/Customer/Model/Resource/Attribute/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Resource/Customer.php b/app/code/core/Mage/Customer/Model/Resource/Customer.php index 34ef426497..507a5e2566 100755 --- a/app/code/core/Mage/Customer/Model/Resource/Customer.php +++ b/app/code/core/Mage/Customer/Model/Resource/Customer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Resource/Customer/Collection.php b/app/code/core/Mage/Customer/Model/Resource/Customer/Collection.php index ddf1e9d9d2..20ba7af57f 100755 --- a/app/code/core/Mage/Customer/Model/Resource/Customer/Collection.php +++ b/app/code/core/Mage/Customer/Model/Resource/Customer/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Resource/Form/Attribute.php b/app/code/core/Mage/Customer/Model/Resource/Form/Attribute.php index b74875bec9..e0dc5d5126 100755 --- a/app/code/core/Mage/Customer/Model/Resource/Form/Attribute.php +++ b/app/code/core/Mage/Customer/Model/Resource/Form/Attribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Resource/Form/Attribute/Collection.php b/app/code/core/Mage/Customer/Model/Resource/Form/Attribute/Collection.php index abd1cd3e40..84ed8e8b34 100755 --- a/app/code/core/Mage/Customer/Model/Resource/Form/Attribute/Collection.php +++ b/app/code/core/Mage/Customer/Model/Resource/Form/Attribute/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Resource/Group.php b/app/code/core/Mage/Customer/Model/Resource/Group.php index 0764df6847..3df4b9efe5 100755 --- a/app/code/core/Mage/Customer/Model/Resource/Group.php +++ b/app/code/core/Mage/Customer/Model/Resource/Group.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Resource/Group/Collection.php b/app/code/core/Mage/Customer/Model/Resource/Group/Collection.php index ecbb83a93d..c42046d4f7 100755 --- a/app/code/core/Mage/Customer/Model/Resource/Group/Collection.php +++ b/app/code/core/Mage/Customer/Model/Resource/Group/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Resource/Setup.php b/app/code/core/Mage/Customer/Model/Resource/Setup.php index 71aacd9cb2..07dac07a0d 100755 --- a/app/code/core/Mage/Customer/Model/Resource/Setup.php +++ b/app/code/core/Mage/Customer/Model/Resource/Setup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Resource/Wishlist/Collection.php b/app/code/core/Mage/Customer/Model/Resource/Wishlist/Collection.php index e9d39351c1..2e34d09253 100755 --- a/app/code/core/Mage/Customer/Model/Resource/Wishlist/Collection.php +++ b/app/code/core/Mage/Customer/Model/Resource/Wishlist/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Session.php b/app/code/core/Mage/Customer/Model/Session.php index 9903e42f15..e89d4b6961 100644 --- a/app/code/core/Mage/Customer/Model/Session.php +++ b/app/code/core/Mage/Customer/Model/Session.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -100,7 +100,7 @@ public function setCustomer(Mage_Customer_Model_Customer $customer) } /** - * Retrieve costomer model object + * Retrieve customer model object * * @return Mage_Customer_Model_Customer */ @@ -175,7 +175,7 @@ public function getCustomerGroupId() } /** - * Checking custommer loggin status + * Checking customer login status * * @return bool */ diff --git a/app/code/core/Mage/Customer/controllers/AccountController.php b/app/code/core/Mage/Customer/controllers/AccountController.php index 473774680f..f6b8d9192c 100644 --- a/app/code/core/Mage/Customer/controllers/AccountController.php +++ b/app/code/core/Mage/Customer/controllers/AccountController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -395,9 +395,17 @@ protected function _welcomeCustomer(Mage_Customer_Model_Customer $customer, $isJ $this->__('Thank you for registering with %s.', Mage::app()->getStore()->getFrontendName()) ); if ($this->_isVatValidationEnabled()) { - $this->_getSession()->addSuccess( - $this->__('If you are a registered VAT customer, please click here to enter you billing address to see proper VAT calculated', Mage::getUrl('customer/address/edit')) - ); + // Show corresponding VAT message to customer + $configAddressType = Mage::helper('customer/address')->getTaxCalculationAddressType(); + $userPrompt = ''; + switch ($configAddressType) { + case Mage_Customer_Model_Address_Abstract::TYPE_SHIPPING: + $userPrompt = $this->__('If you are a registered VAT customer, please click here to enter you shipping address for proper VAT calculation', Mage::getUrl('customer/address/edit')); + break; + default: + $userPrompt = $this->__('If you are a registered VAT customer, please click here to enter you billing address for proper VAT calculation', Mage::getUrl('customer/address/edit')); + } + $this->_getSession()->addSuccess($userPrompt); } $customer->sendNewAccountEmail( diff --git a/app/code/core/Mage/Customer/controllers/AddressController.php b/app/code/core/Mage/Customer/controllers/AddressController.php index a410ff8fc2..22dcc23af8 100644 --- a/app/code/core/Mage/Customer/controllers/AddressController.php +++ b/app/code/core/Mage/Customer/controllers/AddressController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/controllers/ReviewController.php b/app/code/core/Mage/Customer/controllers/ReviewController.php index 5f3880bd9b..e1980501f3 100644 --- a/app/code/core/Mage/Customer/controllers/ReviewController.php +++ b/app/code/core/Mage/Customer/controllers/ReviewController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/etc/adminhtml.xml b/app/code/core/Mage/Customer/etc/adminhtml.xml index bbd0bcc866..bf0d839f58 100644 --- a/app/code/core/Mage/Customer/etc/adminhtml.xml +++ b/app/code/core/Mage/Customer/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Customer/etc/api.xml b/app/code/core/Mage/Customer/etc/api.xml index 2cef5bf12d..2a19936f41 100644 --- a/app/code/core/Mage/Customer/etc/api.xml +++ b/app/code/core/Mage/Customer/etc/api.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Customer/etc/config.xml b/app/code/core/Mage/Customer/etc/config.xml index 5f6d020ecc..edb5dc4374 100644 --- a/app/code/core/Mage/Customer/etc/config.xml +++ b/app/code/core/Mage/Customer/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -447,16 +447,6 @@ - - - - - customer/observer - prepareFormAfter - - - - @@ -514,6 +504,7 @@ 0 1 + billing example.com general customer_create_account_email_template diff --git a/app/code/core/Mage/Customer/etc/system.xml b/app/code/core/Mage/Customer/etc/system.xml index 65987d4176..766a8ed384 100644 --- a/app/code/core/Mage/Customer/etc/system.xml +++ b/app/code/core/Mage/Customer/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -75,8 +75,8 @@ text 1 1 - 1 - 1 + 0 + 0 Leave empty for default (15 minutes). @@ -97,6 +97,16 @@ 1 1 + + + select + adminhtml/system_config_source_customer_address_type + 10 + 1 + 1 + 1 + 1 + select @@ -157,14 +167,13 @@ 1 - + select adminhtml/system_config_source_yesno 57 1 0 0 - 1 @@ -268,8 +277,9 @@ - This value must be greater than 0. + Please enter a number 1 or greater in this field. text + required-entry validate-digits validate-digits-range digits-range-1- adminhtml/system_config_backend_customer_password_link_expirationperiod 40 1 diff --git a/app/code/core/Mage/Customer/sql/customer_setup/install-1.6.0.0.php b/app/code/core/Mage/Customer/sql/customer_setup/install-1.6.0.0.php index e4153f7f23..bbc9f61d06 100644 --- a/app/code/core/Mage/Customer/sql/customer_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Customer/sql/customer_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-data-upgrade-1.4.0.0.11-1.4.0.0.12.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-data-upgrade-1.4.0.0.11-1.4.0.0.12.php index dbcecba436..958c9680a5 100644 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-data-upgrade-1.4.0.0.11-1.4.0.0.12.php +++ b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-data-upgrade-1.4.0.0.11-1.4.0.0.12.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-data-upgrade-1.4.0.0.13-1.4.0.0.14.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-data-upgrade-1.4.0.0.13-1.4.0.0.14.php index e9835da5a2..b04fcb4c3c 100644 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-data-upgrade-1.4.0.0.13-1.4.0.0.14.php +++ b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-data-upgrade-1.4.0.0.13-1.4.0.0.14.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-data-upgrade-1.4.0.0.7-1.4.0.0.8.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-data-upgrade-1.4.0.0.7-1.4.0.0.8.php index 13aabf4ae8..df56325676 100644 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-data-upgrade-1.4.0.0.7-1.4.0.0.8.php +++ b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-data-upgrade-1.4.0.0.7-1.4.0.0.8.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-data-upgrade-1.4.0.0.8-1.4.0.0.9.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-data-upgrade-1.4.0.0.8-1.4.0.0.9.php index 20b6730fd9..124f6295e9 100644 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-data-upgrade-1.4.0.0.8-1.4.0.0.9.php +++ b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-data-upgrade-1.4.0.0.8-1.4.0.0.9.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-install-0.7.0.php index 8f6270b797..c378f1adb5 100644 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-install-0.7.0.php +++ b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-install-0.7.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-install-0.8.0.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-install-0.8.0.php index 20284f017c..8bb1b8cc54 100644 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-install-0.8.0.php +++ b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-install-0.8.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-install-1.4.0.0.0.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-install-1.4.0.0.0.php index 7593adc24a..b5d2e7c8c3 100644 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-install-1.4.0.0.0.php +++ b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-install-1.4.0.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.6.1-0.7.0.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.6.1-0.7.0.php index 82d6c79bdb..35649dbef1 100644 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.6.1-0.7.0.php +++ b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.6.1-0.7.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.7.1-0.7.2.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.7.1-0.7.2.php index ccd87e3b57..1bfe0b30f2 100644 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.7.1-0.7.2.php +++ b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.7.1-0.7.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.7.2-0.7.3.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.7.2-0.7.3.php index 66685c40be..8e9384c19c 100644 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.7.2-0.7.3.php +++ b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.7.2-0.7.3.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.0-0.8.1.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.0-0.8.1.php index 2caa498e19..ca85e5a652 100644 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.0-0.8.1.php +++ b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.0-0.8.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.10-0.8.11.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.10-0.8.11.php index 5deb240fc0..9dcd3f2b02 100644 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.10-0.8.11.php +++ b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.10-0.8.11.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.11-0.8.12.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.11-0.8.12.php index 2a730481cb..ed46231c7b 100644 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.11-0.8.12.php +++ b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.11-0.8.12.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.12-1.4.0.0.0.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.12-1.4.0.0.0.php index 5119602c66..b1007ab739 100644 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.12-1.4.0.0.0.php +++ b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.12-1.4.0.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.4-0.8.5.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.4-0.8.5.php index 19e26c85f1..8c171ba63e 100644 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.4-0.8.5.php +++ b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.4-0.8.5.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.5-0.8.6.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.5-0.8.6.php index 38581f481f..1f78bc3054 100644 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.5-0.8.6.php +++ b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.5-0.8.6.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.6-0.8.7.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.6-0.8.7.php index 17f77cf8f1..cb317fbc15 100644 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.6-0.8.7.php +++ b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.6-0.8.7.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.7-0.8.8.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.7-0.8.8.php index 02b1a057aa..69f16d6254 100644 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.7-0.8.8.php +++ b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.7-0.8.8.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.8-0.8.9.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.8-0.8.9.php index 883ef23770..4ba36238db 100644 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.8-0.8.9.php +++ b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.8-0.8.9.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.9-0.8.10.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.9-0.8.10.php index 2c320f27db..446e70b9ac 100644 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.9-0.8.10.php +++ b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-0.8.9-0.8.10.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.0-1.4.0.0.1.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.0-1.4.0.0.1.php index 846b0032ab..ab9bb658db 100644 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.0-1.4.0.0.1.php +++ b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.0-1.4.0.0.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.1-1.4.0.0.2.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.1-1.4.0.0.2.php index 94ef03f220..8800bda76d 100644 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.1-1.4.0.0.2.php +++ b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.1-1.4.0.0.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.10-1.4.0.0.11.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.10-1.4.0.0.11.php index e1a44b8718..6d185e6107 100644 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.10-1.4.0.0.11.php +++ b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.10-1.4.0.0.11.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.12-1.4.0.0.13.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.12-1.4.0.0.13.php index f880d73f3e..2169616f31 100644 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.12-1.4.0.0.13.php +++ b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.12-1.4.0.0.13.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.2-1.4.0.0.3.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.2-1.4.0.0.3.php index f44ee0b4ce..e7aa6d86f8 100644 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.2-1.4.0.0.3.php +++ b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.2-1.4.0.0.3.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.3-1.4.0.0.4.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.3-1.4.0.0.4.php index 2df7ddbce2..9a0eeae666 100644 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.3-1.4.0.0.4.php +++ b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.3-1.4.0.0.4.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.5-1.4.0.0.6.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.5-1.4.0.0.6.php index 6aacb733fe..f02f6c9f69 100644 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.5-1.4.0.0.6.php +++ b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.5-1.4.0.0.6.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.6-1.4.0.0.7.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.6-1.4.0.0.7.php index f9c3d19054..ba25b42b83 100644 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.6-1.4.0.0.7.php +++ b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.6-1.4.0.0.7.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /* @var $installer Mage_Customer_Model_Entity_Setup */ diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.7-1.4.0.0.8.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.7-1.4.0.0.8.php index 5d544a465f..9525f70eab 100644 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.7-1.4.0.0.8.php +++ b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.7-1.4.0.0.8.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.8-1.4.0.0.9.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.8-1.4.0.0.9.php index 3dc733d349..b3906cce46 100644 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.8-1.4.0.0.9.php +++ b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.8-1.4.0.0.9.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.9-1.4.0.0.10.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.9-1.4.0.0.10.php index ed54b05365..03f24ee8d7 100644 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.9-1.4.0.0.10.php +++ b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.9-1.4.0.0.10.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php index dac6d3dd76..e471d9a8c4 100644 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.6.0.0-1.6.1.0.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.6.0.0-1.6.1.0.php index df8407c5cb..061191ebf5 100644 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.6.0.0-1.6.1.0.php +++ b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.6.0.0-1.6.1.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/sql/customer_setup/upgrade-1.6.1.0-1.6.2.0.php b/app/code/core/Mage/Customer/sql/customer_setup/upgrade-1.6.1.0-1.6.2.0.php index 0c39c37e37..bb6260a2e9 100644 --- a/app/code/core/Mage/Customer/sql/customer_setup/upgrade-1.6.1.0-1.6.2.0.php +++ b/app/code/core/Mage/Customer/sql/customer_setup/upgrade-1.6.1.0-1.6.2.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -31,7 +31,7 @@ $installer->addAttribute('customer', $disableAGCAttributeCode, array( 'type' => 'static', - 'label' => 'Disable automatic group change', + 'label' => 'Disable automatic group change based on VAT ID', 'input' => 'boolean', 'backend' => 'customer/attribute_backend_data_boolean', 'position' => 28, diff --git a/app/code/core/Mage/Customer/sql/customer_setup/upgrade-1.6.2.0-1.6.2.0.1.php b/app/code/core/Mage/Customer/sql/customer_setup/upgrade-1.6.2.0-1.6.2.0.1.php index 0d655bf475..89926ac473 100644 --- a/app/code/core/Mage/Customer/sql/customer_setup/upgrade-1.6.2.0-1.6.2.0.1.php +++ b/app/code/core/Mage/Customer/sql/customer_setup/upgrade-1.6.2.0-1.6.2.0.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -32,5 +32,5 @@ 'unsigned' => true, 'nullable' => false, 'default' => '0', - 'comment' => 'Disable automatic group change' + 'comment' => 'Disable automatic group change based on VAT ID' )); diff --git a/app/code/core/Mage/Dataflow/Helper/Data.php b/app/code/core/Mage/Dataflow/Helper/Data.php index 6b812afa7b..017d1cb9dc 100644 --- a/app/code/core/Mage/Dataflow/Helper/Data.php +++ b/app/code/core/Mage/Dataflow/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Batch.php b/app/code/core/Mage/Dataflow/Model/Batch.php index d611b41454..12917787ed 100644 --- a/app/code/core/Mage/Dataflow/Model/Batch.php +++ b/app/code/core/Mage/Dataflow/Model/Batch.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Batch/Abstract.php b/app/code/core/Mage/Dataflow/Model/Batch/Abstract.php index ffbc721398..27e928dc0b 100644 --- a/app/code/core/Mage/Dataflow/Model/Batch/Abstract.php +++ b/app/code/core/Mage/Dataflow/Model/Batch/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Batch/Export.php b/app/code/core/Mage/Dataflow/Model/Batch/Export.php index 491d27e0b0..bde826983c 100644 --- a/app/code/core/Mage/Dataflow/Model/Batch/Export.php +++ b/app/code/core/Mage/Dataflow/Model/Batch/Export.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Batch/Import.php b/app/code/core/Mage/Dataflow/Model/Batch/Import.php index 603213d24d..76f9034389 100644 --- a/app/code/core/Mage/Dataflow/Model/Batch/Import.php +++ b/app/code/core/Mage/Dataflow/Model/Batch/Import.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Batch/Io.php b/app/code/core/Mage/Dataflow/Model/Batch/Io.php index fa8230e16e..9f4e301f98 100644 --- a/app/code/core/Mage/Dataflow/Model/Batch/Io.php +++ b/app/code/core/Mage/Dataflow/Model/Batch/Io.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert.php b/app/code/core/Mage/Dataflow/Model/Convert.php index 550761878c..b698c83c15 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert.php +++ b/app/code/core/Mage/Dataflow/Model/Convert.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Action.php b/app/code/core/Mage/Dataflow/Model/Convert/Action.php index 716261f625..036b33b749 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Action.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Action.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Action/Abstract.php b/app/code/core/Mage/Dataflow/Model/Convert/Action/Abstract.php index 794a9c303b..4a226296c7 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Action/Abstract.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Action/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Action/Interface.php b/app/code/core/Mage/Dataflow/Model/Convert/Action/Interface.php index 7be7af3324..c0c4b39eff 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Action/Interface.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Action/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Abstract.php b/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Abstract.php index 09ef1bd5c4..22cf1f3bab 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Abstract.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Db/Table.php b/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Db/Table.php index 24e8730f80..8d9e0d0fcd 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Db/Table.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Db/Table.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Http.php b/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Http.php index c90b1de774..2a0bb00222 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Http.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Http.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Http/Curl.php b/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Http/Curl.php index a9475f2efc..1a82e42b99 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Http/Curl.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Http/Curl.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Interface.php b/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Interface.php index d1882f3731..ca19b665c1 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Interface.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Io.php b/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Io.php index 272b8bd490..f414472516 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Io.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Io.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Soap.php b/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Soap.php index b214f41f2e..5f03a703e8 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Soap.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Soap.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Std.php b/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Std.php index cc1932786d..a868afb4ad 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Std.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Std.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Zend/Cache.php b/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Zend/Cache.php index aba25aa978..957af7b15c 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Zend/Cache.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Zend/Cache.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Zend/Db.php b/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Zend/Db.php index 1e69f8ce66..316cdf4d06 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Zend/Db.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Zend/Db.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Container/Abstract.php b/app/code/core/Mage/Dataflow/Model/Convert/Container/Abstract.php index 2b7c454d3d..39bf5b2631 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Container/Abstract.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Container/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Container/Collection.php b/app/code/core/Mage/Dataflow/Model/Convert/Container/Collection.php index e1c8f41bde..74b783f0dc 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Container/Collection.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Container/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Container/Generic.php b/app/code/core/Mage/Dataflow/Model/Convert/Container/Generic.php index 1b3ff6432c..f54f98438a 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Container/Generic.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Container/Generic.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Container/Interface.php b/app/code/core/Mage/Dataflow/Model/Convert/Container/Interface.php index c395b5ed02..10d45a8589 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Container/Interface.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Container/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Exception.php b/app/code/core/Mage/Dataflow/Model/Convert/Exception.php index b2307a6b7f..0d4b0b9a98 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Exception.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Exception.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Iterator.php b/app/code/core/Mage/Dataflow/Model/Convert/Iterator.php index a2086c89c4..aa49f6493d 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Iterator.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Iterator.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Dataflow_Model_Session_Adapter_Iterator extends Mage_Dataflow_Model_Convert_Adapter_Abstract diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Iterator/File/Csv.php b/app/code/core/Mage/Dataflow/Model/Convert/Iterator/File/Csv.php index 2d188ad59f..78a7c74f8d 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Iterator/File/Csv.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Iterator/File/Csv.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Dataflow_Model_Convert_Iterator_File_Csv extends Mage_Dataflow_Model_Convert_Parser_Abstract diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Iterator/Http.php b/app/code/core/Mage/Dataflow/Model/Convert/Iterator/Http.php index dcb2fc307d..9593e79b7a 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Iterator/Http.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Iterator/Http.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Iterator/Interface.php b/app/code/core/Mage/Dataflow/Model/Convert/Iterator/Interface.php index f8e68a7e0e..2fd0e1b21d 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Iterator/Interface.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Iterator/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Mapper/Abstract.php b/app/code/core/Mage/Dataflow/Model/Convert/Mapper/Abstract.php index a85df3906a..93c1e29ca6 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Mapper/Abstract.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Mapper/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Mapper/Column.php b/app/code/core/Mage/Dataflow/Model/Convert/Mapper/Column.php index fe3395641b..af342eb288 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Mapper/Column.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Mapper/Column.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Mapper/Interface.php b/app/code/core/Mage/Dataflow/Model/Convert/Mapper/Interface.php index 74429e2923..d768a32957 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Mapper/Interface.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Mapper/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Parser/Abstract.php b/app/code/core/Mage/Dataflow/Model/Convert/Parser/Abstract.php index 1ce6664643..ffacdad48e 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Parser/Abstract.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Parser/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Parser/Csv.php b/app/code/core/Mage/Dataflow/Model/Convert/Parser/Csv.php index bf67499de7..8ee65cc0f3 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Parser/Csv.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Parser/Csv.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Parser/Interface.php b/app/code/core/Mage/Dataflow/Model/Convert/Parser/Interface.php index 506718692f..03614ec13f 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Parser/Interface.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Parser/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Parser/Serialize.php b/app/code/core/Mage/Dataflow/Model/Convert/Parser/Serialize.php index 76abced338..bec6768591 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Parser/Serialize.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Parser/Serialize.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Parser/Xml/Excel.php b/app/code/core/Mage/Dataflow/Model/Convert/Parser/Xml/Excel.php index 80abebc3cd..5604259179 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Parser/Xml/Excel.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Parser/Xml/Excel.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Profile.php b/app/code/core/Mage/Dataflow/Model/Convert/Profile.php index 03339b3566..3cb78c2296 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Profile.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Profile.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Profile/Abstract.php b/app/code/core/Mage/Dataflow/Model/Convert/Profile/Abstract.php index ad99effbc1..ee11a250ef 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Profile/Abstract.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Profile/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Profile/Collection.php b/app/code/core/Mage/Dataflow/Model/Convert/Profile/Collection.php index b84085f367..10fab3a8f6 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Profile/Collection.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Profile/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Profile/Interface.php b/app/code/core/Mage/Dataflow/Model/Convert/Profile/Interface.php index 6eccbc2cfa..5f1960b4f5 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Profile/Interface.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Profile/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Validator/Abstract.php b/app/code/core/Mage/Dataflow/Model/Convert/Validator/Abstract.php index 19075d59d2..5ff5596ec5 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Validator/Abstract.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Validator/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Validator/Column.php b/app/code/core/Mage/Dataflow/Model/Convert/Validator/Column.php index 8ae9b7aba7..d4f38c9ea4 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Validator/Column.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Validator/Column.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Validator/Dryrun.php b/app/code/core/Mage/Dataflow/Model/Convert/Validator/Dryrun.php index d90222747c..23d550b09d 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Validator/Dryrun.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Validator/Dryrun.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Validator/Interface.php b/app/code/core/Mage/Dataflow/Model/Convert/Validator/Interface.php index 30fb32f1af..5b054ee426 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Validator/Interface.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Validator/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Import.php b/app/code/core/Mage/Dataflow/Model/Import.php index 21b9b0e854..81f3fe12d3 100644 --- a/app/code/core/Mage/Dataflow/Model/Import.php +++ b/app/code/core/Mage/Dataflow/Model/Import.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Mysql4/Batch.php b/app/code/core/Mage/Dataflow/Model/Mysql4/Batch.php index 5c78f931a0..3c08517134 100644 --- a/app/code/core/Mage/Dataflow/Model/Mysql4/Batch.php +++ b/app/code/core/Mage/Dataflow/Model/Mysql4/Batch.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Mysql4/Batch/Abstract.php b/app/code/core/Mage/Dataflow/Model/Mysql4/Batch/Abstract.php index 9b26e509d5..8402469850 100644 --- a/app/code/core/Mage/Dataflow/Model/Mysql4/Batch/Abstract.php +++ b/app/code/core/Mage/Dataflow/Model/Mysql4/Batch/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Mysql4/Batch/Collection.php b/app/code/core/Mage/Dataflow/Model/Mysql4/Batch/Collection.php index dbfeff38d5..c62f5ffc15 100755 --- a/app/code/core/Mage/Dataflow/Model/Mysql4/Batch/Collection.php +++ b/app/code/core/Mage/Dataflow/Model/Mysql4/Batch/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Mysql4/Batch/Export.php b/app/code/core/Mage/Dataflow/Model/Mysql4/Batch/Export.php index 6d0e081944..1e36232310 100644 --- a/app/code/core/Mage/Dataflow/Model/Mysql4/Batch/Export.php +++ b/app/code/core/Mage/Dataflow/Model/Mysql4/Batch/Export.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Mysql4/Batch/Import.php b/app/code/core/Mage/Dataflow/Model/Mysql4/Batch/Import.php index 741152098f..6315c7c675 100644 --- a/app/code/core/Mage/Dataflow/Model/Mysql4/Batch/Import.php +++ b/app/code/core/Mage/Dataflow/Model/Mysql4/Batch/Import.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Mysql4/Catalogold.php b/app/code/core/Mage/Dataflow/Model/Mysql4/Catalogold.php index ded78c0671..6d03cc7009 100644 --- a/app/code/core/Mage/Dataflow/Model/Mysql4/Catalogold.php +++ b/app/code/core/Mage/Dataflow/Model/Mysql4/Catalogold.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Mysql4/Import.php b/app/code/core/Mage/Dataflow/Model/Mysql4/Import.php index b8d6e5aeac..1cff4e47ea 100644 --- a/app/code/core/Mage/Dataflow/Model/Mysql4/Import.php +++ b/app/code/core/Mage/Dataflow/Model/Mysql4/Import.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Mysql4/Import/Collection.php b/app/code/core/Mage/Dataflow/Model/Mysql4/Import/Collection.php index 2539f1ea4a..60cee57f4f 100644 --- a/app/code/core/Mage/Dataflow/Model/Mysql4/Import/Collection.php +++ b/app/code/core/Mage/Dataflow/Model/Mysql4/Import/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Mysql4/Profile.php b/app/code/core/Mage/Dataflow/Model/Mysql4/Profile.php index 821434945b..6fc408357e 100644 --- a/app/code/core/Mage/Dataflow/Model/Mysql4/Profile.php +++ b/app/code/core/Mage/Dataflow/Model/Mysql4/Profile.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Mysql4/Profile/Collection.php b/app/code/core/Mage/Dataflow/Model/Mysql4/Profile/Collection.php index f923499099..f4db5ef5a5 100644 --- a/app/code/core/Mage/Dataflow/Model/Mysql4/Profile/Collection.php +++ b/app/code/core/Mage/Dataflow/Model/Mysql4/Profile/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Mysql4/Profile/History.php b/app/code/core/Mage/Dataflow/Model/Mysql4/Profile/History.php index c9f4ce9a2f..a4ee8e346e 100644 --- a/app/code/core/Mage/Dataflow/Model/Mysql4/Profile/History.php +++ b/app/code/core/Mage/Dataflow/Model/Mysql4/Profile/History.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Mysql4/Profile/History/Collection.php b/app/code/core/Mage/Dataflow/Model/Mysql4/Profile/History/Collection.php index 016bea299e..8c056c9aa0 100644 --- a/app/code/core/Mage/Dataflow/Model/Mysql4/Profile/History/Collection.php +++ b/app/code/core/Mage/Dataflow/Model/Mysql4/Profile/History/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Mysql4/Session.php b/app/code/core/Mage/Dataflow/Model/Mysql4/Session.php index 9475858b71..5a91b4f155 100644 --- a/app/code/core/Mage/Dataflow/Model/Mysql4/Session.php +++ b/app/code/core/Mage/Dataflow/Model/Mysql4/Session.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Profile.php b/app/code/core/Mage/Dataflow/Model/Profile.php index e37b1cb894..b6062cd2ba 100644 --- a/app/code/core/Mage/Dataflow/Model/Profile.php +++ b/app/code/core/Mage/Dataflow/Model/Profile.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Profile/History.php b/app/code/core/Mage/Dataflow/Model/Profile/History.php index 1365443c70..65bee5e9fa 100644 --- a/app/code/core/Mage/Dataflow/Model/Profile/History.php +++ b/app/code/core/Mage/Dataflow/Model/Profile/History.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Resource/Batch.php b/app/code/core/Mage/Dataflow/Model/Resource/Batch.php index 93f69a704a..9886f2a158 100755 --- a/app/code/core/Mage/Dataflow/Model/Resource/Batch.php +++ b/app/code/core/Mage/Dataflow/Model/Resource/Batch.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Resource/Batch/Abstract.php b/app/code/core/Mage/Dataflow/Model/Resource/Batch/Abstract.php index c65b9be361..e9a9055a02 100755 --- a/app/code/core/Mage/Dataflow/Model/Resource/Batch/Abstract.php +++ b/app/code/core/Mage/Dataflow/Model/Resource/Batch/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Resource/Batch/Collection.php b/app/code/core/Mage/Dataflow/Model/Resource/Batch/Collection.php index bc030ca525..291ad61931 100755 --- a/app/code/core/Mage/Dataflow/Model/Resource/Batch/Collection.php +++ b/app/code/core/Mage/Dataflow/Model/Resource/Batch/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Resource/Batch/Export.php b/app/code/core/Mage/Dataflow/Model/Resource/Batch/Export.php index 3404e2b1d3..55126ac1ba 100755 --- a/app/code/core/Mage/Dataflow/Model/Resource/Batch/Export.php +++ b/app/code/core/Mage/Dataflow/Model/Resource/Batch/Export.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Resource/Batch/Import.php b/app/code/core/Mage/Dataflow/Model/Resource/Batch/Import.php index 62e5fc21ca..6a769562b2 100755 --- a/app/code/core/Mage/Dataflow/Model/Resource/Batch/Import.php +++ b/app/code/core/Mage/Dataflow/Model/Resource/Batch/Import.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Resource/Import.php b/app/code/core/Mage/Dataflow/Model/Resource/Import.php index eec38ade54..16dc0be363 100755 --- a/app/code/core/Mage/Dataflow/Model/Resource/Import.php +++ b/app/code/core/Mage/Dataflow/Model/Resource/Import.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Resource/Import/Collection.php b/app/code/core/Mage/Dataflow/Model/Resource/Import/Collection.php index 2a10386fe4..cd562cd224 100755 --- a/app/code/core/Mage/Dataflow/Model/Resource/Import/Collection.php +++ b/app/code/core/Mage/Dataflow/Model/Resource/Import/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Resource/Profile.php b/app/code/core/Mage/Dataflow/Model/Resource/Profile.php index 66ca749843..e34d387e52 100755 --- a/app/code/core/Mage/Dataflow/Model/Resource/Profile.php +++ b/app/code/core/Mage/Dataflow/Model/Resource/Profile.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Resource/Profile/Collection.php b/app/code/core/Mage/Dataflow/Model/Resource/Profile/Collection.php index 8873b2c6f2..e43f33f24c 100755 --- a/app/code/core/Mage/Dataflow/Model/Resource/Profile/Collection.php +++ b/app/code/core/Mage/Dataflow/Model/Resource/Profile/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Resource/Profile/History.php b/app/code/core/Mage/Dataflow/Model/Resource/Profile/History.php index 14d3ca7474..c5255314dc 100755 --- a/app/code/core/Mage/Dataflow/Model/Resource/Profile/History.php +++ b/app/code/core/Mage/Dataflow/Model/Resource/Profile/History.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Resource/Profile/History/Collection.php b/app/code/core/Mage/Dataflow/Model/Resource/Profile/History/Collection.php index 97081a5a9f..dafe0b6cea 100755 --- a/app/code/core/Mage/Dataflow/Model/Resource/Profile/History/Collection.php +++ b/app/code/core/Mage/Dataflow/Model/Resource/Profile/History/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Resource/Session.php b/app/code/core/Mage/Dataflow/Model/Resource/Session.php index 0ddef06910..6e34db5a16 100755 --- a/app/code/core/Mage/Dataflow/Model/Resource/Session.php +++ b/app/code/core/Mage/Dataflow/Model/Resource/Session.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Session.php b/app/code/core/Mage/Dataflow/Model/Session.php index 2b2865bc53..f688ea02c6 100644 --- a/app/code/core/Mage/Dataflow/Model/Session.php +++ b/app/code/core/Mage/Dataflow/Model/Session.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Session/Adapter/Http.php b/app/code/core/Mage/Dataflow/Model/Session/Adapter/Http.php index 9d55eb3ff9..c1c9ff52be 100644 --- a/app/code/core/Mage/Dataflow/Model/Session/Adapter/Http.php +++ b/app/code/core/Mage/Dataflow/Model/Session/Adapter/Http.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Session/Parser/Csv.php b/app/code/core/Mage/Dataflow/Model/Session/Parser/Csv.php index 4d47cd1fda..6c32f6d693 100644 --- a/app/code/core/Mage/Dataflow/Model/Session/Parser/Csv.php +++ b/app/code/core/Mage/Dataflow/Model/Session/Parser/Csv.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/data/dataflow_setup/data-install-1.6.0.0.php b/app/code/core/Mage/Dataflow/data/dataflow_setup/data-install-1.6.0.0.php index dc04c38bfa..958bc6c851 100644 --- a/app/code/core/Mage/Dataflow/data/dataflow_setup/data-install-1.6.0.0.php +++ b/app/code/core/Mage/Dataflow/data/dataflow_setup/data-install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/etc/config.xml b/app/code/core/Mage/Dataflow/etc/config.xml index 8c6863ebf5..a2f5871015 100644 --- a/app/code/core/Mage/Dataflow/etc/config.xml +++ b/app/code/core/Mage/Dataflow/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Dataflow/sql/dataflow_setup/install-1.6.0.0.php b/app/code/core/Mage/Dataflow/sql/dataflow_setup/install-1.6.0.0.php index e247331fc6..6c7a611442 100644 --- a/app/code/core/Mage/Dataflow/sql/dataflow_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Dataflow/sql/dataflow_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/sql/dataflow_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/Dataflow/sql/dataflow_setup/mysql4-install-0.7.0.php index fe3b2fc102..e3830c072f 100644 --- a/app/code/core/Mage/Dataflow/sql/dataflow_setup/mysql4-install-0.7.0.php +++ b/app/code/core/Mage/Dataflow/sql/dataflow_setup/mysql4-install-0.7.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/sql/dataflow_setup/mysql4-upgrade-0.7.0-0.7.1.php b/app/code/core/Mage/Dataflow/sql/dataflow_setup/mysql4-upgrade-0.7.0-0.7.1.php index c4d6e7d435..18c7f2fa3b 100644 --- a/app/code/core/Mage/Dataflow/sql/dataflow_setup/mysql4-upgrade-0.7.0-0.7.1.php +++ b/app/code/core/Mage/Dataflow/sql/dataflow_setup/mysql4-upgrade-0.7.0-0.7.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ $this->startSetup()->run(" diff --git a/app/code/core/Mage/Dataflow/sql/dataflow_setup/mysql4-upgrade-0.7.1-0.7.2.php b/app/code/core/Mage/Dataflow/sql/dataflow_setup/mysql4-upgrade-0.7.1-0.7.2.php index 6d8f17286d..136a3e49a0 100755 --- a/app/code/core/Mage/Dataflow/sql/dataflow_setup/mysql4-upgrade-0.7.1-0.7.2.php +++ b/app/code/core/Mage/Dataflow/sql/dataflow_setup/mysql4-upgrade-0.7.1-0.7.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ $this->startSetup()->run(" diff --git a/app/code/core/Mage/Dataflow/sql/dataflow_setup/mysql4-upgrade-0.7.2-0.7.3.php b/app/code/core/Mage/Dataflow/sql/dataflow_setup/mysql4-upgrade-0.7.2-0.7.3.php index 45e01278f5..fc5cc7d7b2 100644 --- a/app/code/core/Mage/Dataflow/sql/dataflow_setup/mysql4-upgrade-0.7.2-0.7.3.php +++ b/app/code/core/Mage/Dataflow/sql/dataflow_setup/mysql4-upgrade-0.7.2-0.7.3.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/sql/dataflow_setup/mysql4-upgrade-0.7.3-0.7.4.php b/app/code/core/Mage/Dataflow/sql/dataflow_setup/mysql4-upgrade-0.7.3-0.7.4.php index 56a02bc137..b22b0b35dd 100644 --- a/app/code/core/Mage/Dataflow/sql/dataflow_setup/mysql4-upgrade-0.7.3-0.7.4.php +++ b/app/code/core/Mage/Dataflow/sql/dataflow_setup/mysql4-upgrade-0.7.3-0.7.4.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/sql/dataflow_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/Dataflow/sql/dataflow_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php index b53ab0e8a2..a0e8d8d981 100644 --- a/app/code/core/Mage/Dataflow/sql/dataflow_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ b/app/code/core/Mage/Dataflow/sql/dataflow_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Block/Adminhtml/Frontend/Currency/Base.php b/app/code/core/Mage/Directory/Block/Adminhtml/Frontend/Currency/Base.php index ce2acb57a4..2040040283 100644 --- a/app/code/core/Mage/Directory/Block/Adminhtml/Frontend/Currency/Base.php +++ b/app/code/core/Mage/Directory/Block/Adminhtml/Frontend/Currency/Base.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Block/Adminhtml/Frontend/Region/Updater.php b/app/code/core/Mage/Directory/Block/Adminhtml/Frontend/Region/Updater.php index b1032c59b8..b519155d7c 100644 --- a/app/code/core/Mage/Directory/Block/Adminhtml/Frontend/Region/Updater.php +++ b/app/code/core/Mage/Directory/Block/Adminhtml/Frontend/Region/Updater.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Block/Currency.php b/app/code/core/Mage/Directory/Block/Currency.php index bddd2df747..920507a699 100644 --- a/app/code/core/Mage/Directory/Block/Currency.php +++ b/app/code/core/Mage/Directory/Block/Currency.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Block/Data.php b/app/code/core/Mage/Directory/Block/Data.php index 47ca563bca..386f83a44e 100644 --- a/app/code/core/Mage/Directory/Block/Data.php +++ b/app/code/core/Mage/Directory/Block/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Exception.php b/app/code/core/Mage/Directory/Exception.php index a3c0c6041a..abf8a46b17 100644 --- a/app/code/core/Mage/Directory/Exception.php +++ b/app/code/core/Mage/Directory/Exception.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Helper/Data.php b/app/code/core/Mage/Directory/Helper/Data.php index f11270da7b..2ac0cf98bc 100644 --- a/app/code/core/Mage/Directory/Helper/Data.php +++ b/app/code/core/Mage/Directory/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -36,6 +36,16 @@ class Mage_Directory_Helper_Data extends Mage_Core_Helper_Abstract */ const OPTIONAL_ZIP_COUNTRIES_CONFIG_PATH = 'general/country/optional_zip_countries'; + /* + * Path to config value, which lists countries, for which state is required. + */ + const XML_PATH_STATES_REQUIRED = 'general/region/state_required'; + + /* + * Path to config value, which detects whether or not display the state for the country, if it is not required + */ + const XML_PATH_DISPLAY_ALL_STATES = 'general/region/display_all'; + /** * Country collection * @@ -122,7 +132,12 @@ public function getRegionJson() $collection = Mage::getModel('directory/region')->getResourceCollection() ->addCountryFilter($countryIds) ->load(); - $regions = array(); + $regions = array( + 'config' => array( + 'show_all_regions' => $this->getShowNonRequiredState(), + 'regions_required' => $this->getCountriesWithStatesRequired() + ) + ); foreach ($collection as $region) { if (!$region->getRegionId()) { continue; @@ -194,4 +209,44 @@ public function isZipCodeOptional($countryCode) $this->getCountriesWithOptionalZip(); return in_array($countryCode, $this->_optionalZipCountries); } + + /** + * Returns the list of countries, for which region is required + * + * @param boolean $asJson + * @return array + */ + public function getCountriesWithStatesRequired($asJson = false) + { + $countryList = explode(',', Mage::getStoreConfig(self::XML_PATH_STATES_REQUIRED)); + if ($asJson) { + return Mage::helper('core')->jsonEncode($countryList); + } + return $countryList; + } + + /** + * Return flag, which indicates whether or not non required state should be shown + * + * @return bool + */ + public function getShowNonRequiredState() + { + return (boolean)Mage::getStoreConfig(self::XML_PATH_DISPLAY_ALL_STATES); + } + + /** + * Returns flag, which indicates whether region is required for specified country + * + * @param string $countryId + * @return bool + */ + public function isRegionRequired($countryId) + { + $countyList = $this->getCountriesWithStatesRequired(); + if(!is_array($countyList)) { + return false; + } + return in_array($countryId, $countyList); + } } diff --git a/app/code/core/Mage/Directory/Helper/Url.php b/app/code/core/Mage/Directory/Helper/Url.php index f93cdf5cb4..77ec935c5e 100644 --- a/app/code/core/Mage/Directory/Helper/Url.php +++ b/app/code/core/Mage/Directory/Helper/Url.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Model/Country.php b/app/code/core/Mage/Directory/Model/Country.php index ce5c33001c..aefed9a242 100644 --- a/app/code/core/Mage/Directory/Model/Country.php +++ b/app/code/core/Mage/Directory/Model/Country.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Model/Country/Api.php b/app/code/core/Mage/Directory/Model/Country/Api.php index 4cdc71280e..66dbb14457 100644 --- a/app/code/core/Mage/Directory/Model/Country/Api.php +++ b/app/code/core/Mage/Directory/Model/Country/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Model/Country/Api/V2.php b/app/code/core/Mage/Directory/Model/Country/Api/V2.php index 1b24dfd16b..4723d03b3e 100644 --- a/app/code/core/Mage/Directory/Model/Country/Api/V2.php +++ b/app/code/core/Mage/Directory/Model/Country/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Model/Country/Format.php b/app/code/core/Mage/Directory/Model/Country/Format.php index df6c97e416..32477c394b 100644 --- a/app/code/core/Mage/Directory/Model/Country/Format.php +++ b/app/code/core/Mage/Directory/Model/Country/Format.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Model/Currency.php b/app/code/core/Mage/Directory/Model/Currency.php index f869780cfc..c5beff7425 100644 --- a/app/code/core/Mage/Directory/Model/Currency.php +++ b/app/code/core/Mage/Directory/Model/Currency.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Model/Currency/Filter.php b/app/code/core/Mage/Directory/Model/Currency/Filter.php index 9a69a520f6..ba92435ab8 100644 --- a/app/code/core/Mage/Directory/Model/Currency/Filter.php +++ b/app/code/core/Mage/Directory/Model/Currency/Filter.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Model/Currency/Import/Abstract.php b/app/code/core/Mage/Directory/Model/Currency/Import/Abstract.php index 32706271a7..928d068a08 100644 --- a/app/code/core/Mage/Directory/Model/Currency/Import/Abstract.php +++ b/app/code/core/Mage/Directory/Model/Currency/Import/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Model/Currency/Import/Webservicex.php b/app/code/core/Mage/Directory/Model/Currency/Import/Webservicex.php index 1a2799601b..b83bd8ab1a 100644 --- a/app/code/core/Mage/Directory/Model/Currency/Import/Webservicex.php +++ b/app/code/core/Mage/Directory/Model/Currency/Import/Webservicex.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Model/Mysql4/Country.php b/app/code/core/Mage/Directory/Model/Mysql4/Country.php index fdd5b87282..cd3440181c 100644 --- a/app/code/core/Mage/Directory/Model/Mysql4/Country.php +++ b/app/code/core/Mage/Directory/Model/Mysql4/Country.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Model/Mysql4/Country/Collection.php b/app/code/core/Mage/Directory/Model/Mysql4/Country/Collection.php index 124ddd1da8..061fc3e337 100644 --- a/app/code/core/Mage/Directory/Model/Mysql4/Country/Collection.php +++ b/app/code/core/Mage/Directory/Model/Mysql4/Country/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Model/Mysql4/Country/Format.php b/app/code/core/Mage/Directory/Model/Mysql4/Country/Format.php index f9713e1650..d2cdd81131 100644 --- a/app/code/core/Mage/Directory/Model/Mysql4/Country/Format.php +++ b/app/code/core/Mage/Directory/Model/Mysql4/Country/Format.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Model/Mysql4/Country/Format/Collection.php b/app/code/core/Mage/Directory/Model/Mysql4/Country/Format/Collection.php index b156454356..c0910a5355 100644 --- a/app/code/core/Mage/Directory/Model/Mysql4/Country/Format/Collection.php +++ b/app/code/core/Mage/Directory/Model/Mysql4/Country/Format/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Model/Mysql4/Currency.php b/app/code/core/Mage/Directory/Model/Mysql4/Currency.php index aff19b29a1..05f86e6060 100644 --- a/app/code/core/Mage/Directory/Model/Mysql4/Currency.php +++ b/app/code/core/Mage/Directory/Model/Mysql4/Currency.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Model/Mysql4/Currency/Collection.php b/app/code/core/Mage/Directory/Model/Mysql4/Currency/Collection.php index 561ffbd664..6c5eb6bb03 100644 --- a/app/code/core/Mage/Directory/Model/Mysql4/Currency/Collection.php +++ b/app/code/core/Mage/Directory/Model/Mysql4/Currency/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Model/Mysql4/Region.php b/app/code/core/Mage/Directory/Model/Mysql4/Region.php index 3796ce75b3..7d65b40659 100644 --- a/app/code/core/Mage/Directory/Model/Mysql4/Region.php +++ b/app/code/core/Mage/Directory/Model/Mysql4/Region.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Model/Mysql4/Region/Collection.php b/app/code/core/Mage/Directory/Model/Mysql4/Region/Collection.php index ba3f3a8c30..86d3b9ad4b 100644 --- a/app/code/core/Mage/Directory/Model/Mysql4/Region/Collection.php +++ b/app/code/core/Mage/Directory/Model/Mysql4/Region/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Model/Observer.php b/app/code/core/Mage/Directory/Model/Observer.php index 85e2584bf0..057987e9fb 100644 --- a/app/code/core/Mage/Directory/Model/Observer.php +++ b/app/code/core/Mage/Directory/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Model/Region.php b/app/code/core/Mage/Directory/Model/Region.php index d937e57e20..3966fb1a15 100644 --- a/app/code/core/Mage/Directory/Model/Region.php +++ b/app/code/core/Mage/Directory/Model/Region.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Model/Region/Api.php b/app/code/core/Mage/Directory/Model/Region/Api.php index 04befc72d7..145400388f 100644 --- a/app/code/core/Mage/Directory/Model/Region/Api.php +++ b/app/code/core/Mage/Directory/Model/Region/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Model/Region/Api/V2.php b/app/code/core/Mage/Directory/Model/Region/Api/V2.php index a6dae41a97..2a87944578 100644 --- a/app/code/core/Mage/Directory/Model/Region/Api/V2.php +++ b/app/code/core/Mage/Directory/Model/Region/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Model/Resource/Country.php b/app/code/core/Mage/Directory/Model/Resource/Country.php index 7c5ce5565d..f9d981a300 100755 --- a/app/code/core/Mage/Directory/Model/Resource/Country.php +++ b/app/code/core/Mage/Directory/Model/Resource/Country.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Model/Resource/Country/Collection.php b/app/code/core/Mage/Directory/Model/Resource/Country/Collection.php index bd16bce324..4a4e99718c 100755 --- a/app/code/core/Mage/Directory/Model/Resource/Country/Collection.php +++ b/app/code/core/Mage/Directory/Model/Resource/Country/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Model/Resource/Country/Format.php b/app/code/core/Mage/Directory/Model/Resource/Country/Format.php index f6daedd6ab..fd8d955161 100755 --- a/app/code/core/Mage/Directory/Model/Resource/Country/Format.php +++ b/app/code/core/Mage/Directory/Model/Resource/Country/Format.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Model/Resource/Country/Format/Collection.php b/app/code/core/Mage/Directory/Model/Resource/Country/Format/Collection.php index 2f5099d086..bc8f2d1a93 100755 --- a/app/code/core/Mage/Directory/Model/Resource/Country/Format/Collection.php +++ b/app/code/core/Mage/Directory/Model/Resource/Country/Format/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Model/Resource/Currency.php b/app/code/core/Mage/Directory/Model/Resource/Currency.php index 7bb4e3926e..1af1f1d84c 100755 --- a/app/code/core/Mage/Directory/Model/Resource/Currency.php +++ b/app/code/core/Mage/Directory/Model/Resource/Currency.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Model/Resource/Currency/Collection.php b/app/code/core/Mage/Directory/Model/Resource/Currency/Collection.php index 06a59b53d3..a8af67d050 100755 --- a/app/code/core/Mage/Directory/Model/Resource/Currency/Collection.php +++ b/app/code/core/Mage/Directory/Model/Resource/Currency/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Model/Resource/Region.php b/app/code/core/Mage/Directory/Model/Resource/Region.php index 8e7692046f..ddbe0b6f91 100755 --- a/app/code/core/Mage/Directory/Model/Resource/Region.php +++ b/app/code/core/Mage/Directory/Model/Resource/Region.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Model/Resource/Region/Collection.php b/app/code/core/Mage/Directory/Model/Resource/Region/Collection.php index a9464bf29f..7f0e29e70b 100755 --- a/app/code/core/Mage/Directory/Model/Resource/Region/Collection.php +++ b/app/code/core/Mage/Directory/Model/Resource/Region/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -58,6 +58,9 @@ protected function _construct() $this->_countryTable = $this->getTable('directory/country'); $this->_regionNameTable = $this->getTable('directory/country_region_name'); + + $this->addOrder('name', Varien_Data_Collection::SORT_ORDER_ASC); + $this->addOrder('default_name', Varien_Data_Collection::SORT_ORDER_ASC); } /** diff --git a/app/code/core/Mage/Directory/controllers/CurrencyController.php b/app/code/core/Mage/Directory/controllers/CurrencyController.php index 47c05da217..9b877ed406 100644 --- a/app/code/core/Mage/Directory/controllers/CurrencyController.php +++ b/app/code/core/Mage/Directory/controllers/CurrencyController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/data/directory_setup/data-install-1.6.0.0.php b/app/code/core/Mage/Directory/data/directory_setup/data-install-1.6.0.0.php index 521422590e..6ca3822b80 100644 --- a/app/code/core/Mage/Directory/data/directory_setup/data-install-1.6.0.0.php +++ b/app/code/core/Mage/Directory/data/directory_setup/data-install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/data/directory_setup/data-upgrade-1.6.0.0-1.6.0.1.php b/app/code/core/Mage/Directory/data/directory_setup/data-upgrade-1.6.0.0-1.6.0.1.php new file mode 100644 index 0000000000..1f8ff2dacc --- /dev/null +++ b/app/code/core/Mage/Directory/data/directory_setup/data-upgrade-1.6.0.0-1.6.0.1.php @@ -0,0 +1,58 @@ +getConnection()->insert( + $installer->getTable('core/config_data'), array( + 'scope' => 'default', + 'scope_id' => 0, + 'path' => Mage_Directory_Helper_Data::XML_PATH_DISPLAY_ALL_STATES, + 'value' => 1 + ) +); + +/** + * @var $countries array + */ +$countries = array(); +foreach(Mage::helper('directory')->getCountryCollection() as $country) { + if($country->getRegionCollection()->getSize() > 0) { + $countries[] = $country->getId(); + } +} + +$installer->getConnection()->insert( + $installer->getTable('core/config_data'), array( + 'scope' => 'default', + 'scope_id' => 0, + 'path' => Mage_Directory_Helper_Data::XML_PATH_STATES_REQUIRED, + 'value' => implode(',', $countries) + ) +); + diff --git a/app/code/core/Mage/Directory/etc/api.xml b/app/code/core/Mage/Directory/etc/api.xml index 503139b205..bd88cb2652 100644 --- a/app/code/core/Mage/Directory/etc/api.xml +++ b/app/code/core/Mage/Directory/etc/api.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Directory/etc/config.xml b/app/code/core/Mage/Directory/etc/config.xml index 9432c4e95c..496dca51dc 100644 --- a/app/code/core/Mage/Directory/etc/config.xml +++ b/app/code/core/Mage/Directory/etc/config.xml @@ -21,14 +21,14 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> - 1.6.0.0 + 1.6.0.1 diff --git a/app/code/core/Mage/Directory/etc/system.xml b/app/code/core/Mage/Directory/etc/system.xml index 34d00a173f..c2fc6717db 100644 --- a/app/code/core/Mage/Directory/etc/system.xml +++ b/app/code/core/Mage/Directory/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -209,6 +209,34 @@ + + + text + 4 + 1 + 0 + 0 + + + + multiselect + adminhtml/system_config_source_country + 1 + 1 + 0 + 0 + + + + select + adminhtml/system_config_source_yesno + 8 + 1 + 0 + 0 + + + diff --git a/app/code/core/Mage/Directory/sql/directory_setup/install-1.6.0.0.php b/app/code/core/Mage/Directory/sql/directory_setup/install-1.6.0.0.php index cc623d2772..4ef5d69fc3 100644 --- a/app/code/core/Mage/Directory/sql/directory_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Directory/sql/directory_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/Directory/sql/directory_setup/mysql4-install-0.7.0.php index 10553e4c26..fce3b5254a 100644 --- a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-install-0.7.0.php +++ b/app/code/core/Mage/Directory/sql/directory_setup/mysql4-install-0.7.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-install-0.8.0.php b/app/code/core/Mage/Directory/sql/directory_setup/mysql4-install-0.8.0.php index 629058f1c9..e22e1f99da 100644 --- a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-install-0.8.0.php +++ b/app/code/core/Mage/Directory/sql/directory_setup/mysql4-install-0.8.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.7.0-0.7.1.php b/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.7.0-0.7.1.php index a229cc5d10..e35ebdbf17 100644 --- a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.7.0-0.7.1.php +++ b/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.7.0-0.7.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.7.1-0.7.2.php b/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.7.1-0.7.2.php index 939364c067..5f89498c1c 100644 --- a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.7.1-0.7.2.php +++ b/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.7.1-0.7.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.0-0.8.1.php b/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.0-0.8.1.php index 73f2297412..401afe2695 100644 --- a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.0-0.8.1.php +++ b/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.0-0.8.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.1-0.8.2.php b/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.1-0.8.2.php index b4bfdd69a0..83dfa08034 100644 --- a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.1-0.8.2.php +++ b/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.1-0.8.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.10-0.8.11.php b/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.10-0.8.11.php index 0197dbcc32..2aadbdc2e3 100644 --- a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.10-0.8.11.php +++ b/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.10-0.8.11.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.2-0.8.3.php b/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.2-0.8.3.php index ecde70556b..d9c733e2f4 100644 --- a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.2-0.8.3.php +++ b/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.2-0.8.3.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.3-0.8.4.php b/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.3-0.8.4.php index ab8381a84a..855116fef7 100644 --- a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.3-0.8.4.php +++ b/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.3-0.8.4.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.4-0.8.5.php b/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.4-0.8.5.php index f88aded50e..1a38c8570f 100644 --- a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.4-0.8.5.php +++ b/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.4-0.8.5.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.5-0.8.6.php b/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.5-0.8.6.php index bb2631eb09..63a94a1fa5 100644 --- a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.5-0.8.6.php +++ b/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.5-0.8.6.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.6-0.8.7.php b/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.6-0.8.7.php index a5c6e84fd1..4e3a82b4bc 100644 --- a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.6-0.8.7.php +++ b/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.6-0.8.7.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.7-0.8.8.php b/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.7-0.8.8.php index cd2f5565dd..6a0023eaa7 100644 --- a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.7-0.8.8.php +++ b/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.7-0.8.8.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.8-0.8.9.php b/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.8-0.8.9.php index a32acd036a..32c8a8d4d6 100644 --- a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.8-0.8.9.php +++ b/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.8-0.8.9.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.9-0.8.10.php b/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.9-0.8.10.php index 3becb5c3ae..92ab30253d 100644 --- a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.9-0.8.10.php +++ b/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.9-0.8.10.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php index 305ef1ae4c..cb54211e4b 100644 --- a/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ b/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Downloadable.php b/app/code/core/Mage/Downloadable/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Downloadable.php index c3e17e6ba6..d840434a01 100644 --- a/app/code/core/Mage/Downloadable/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Downloadable.php +++ b/app/code/core/Mage/Downloadable/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Downloadable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable.php b/app/code/core/Mage/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable.php index fba6baf82a..fc7a87763e 100644 --- a/app/code/core/Mage/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable.php +++ b/app/code/core/Mage/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Links.php b/app/code/core/Mage/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Links.php index 77ddb28c5c..aedbed15b7 100644 --- a/app/code/core/Mage/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Links.php +++ b/app/code/core/Mage/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Links.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Samples.php b/app/code/core/Mage/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Samples.php index 5c50d21979..f6e1c41589 100644 --- a/app/code/core/Mage/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Samples.php +++ b/app/code/core/Mage/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Samples.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Block/Adminhtml/Sales/Items/Column/Downloadable/Name.php b/app/code/core/Mage/Downloadable/Block/Adminhtml/Sales/Items/Column/Downloadable/Name.php index c5b975116b..17a86fe7b6 100644 --- a/app/code/core/Mage/Downloadable/Block/Adminhtml/Sales/Items/Column/Downloadable/Name.php +++ b/app/code/core/Mage/Downloadable/Block/Adminhtml/Sales/Items/Column/Downloadable/Name.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Block/Catalog/Product/Links.php b/app/code/core/Mage/Downloadable/Block/Catalog/Product/Links.php index 1f6d9b1cc4..bc49135242 100644 --- a/app/code/core/Mage/Downloadable/Block/Catalog/Product/Links.php +++ b/app/code/core/Mage/Downloadable/Block/Catalog/Product/Links.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Block/Catalog/Product/Samples.php b/app/code/core/Mage/Downloadable/Block/Catalog/Product/Samples.php index 8b10805cda..87f5f980d8 100644 --- a/app/code/core/Mage/Downloadable/Block/Catalog/Product/Samples.php +++ b/app/code/core/Mage/Downloadable/Block/Catalog/Product/Samples.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Block/Catalog/Product/View/Type.php b/app/code/core/Mage/Downloadable/Block/Catalog/Product/View/Type.php index 3573fb01c9..c108b55823 100644 --- a/app/code/core/Mage/Downloadable/Block/Catalog/Product/View/Type.php +++ b/app/code/core/Mage/Downloadable/Block/Catalog/Product/View/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Block/Checkout/Cart/Item/Renderer.php b/app/code/core/Mage/Downloadable/Block/Checkout/Cart/Item/Renderer.php index bb99f505c9..e3126c753d 100644 --- a/app/code/core/Mage/Downloadable/Block/Checkout/Cart/Item/Renderer.php +++ b/app/code/core/Mage/Downloadable/Block/Checkout/Cart/Item/Renderer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Block/Checkout/Success.php b/app/code/core/Mage/Downloadable/Block/Checkout/Success.php index 6cd6a543cb..cb8f641645 100644 --- a/app/code/core/Mage/Downloadable/Block/Checkout/Success.php +++ b/app/code/core/Mage/Downloadable/Block/Checkout/Success.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Block/Customer/Products/List.php b/app/code/core/Mage/Downloadable/Block/Customer/Products/List.php index d42f9b1285..21d0d6c69e 100644 --- a/app/code/core/Mage/Downloadable/Block/Customer/Products/List.php +++ b/app/code/core/Mage/Downloadable/Block/Customer/Products/List.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Block/Sales/Order/Email/Items/Downloadable.php b/app/code/core/Mage/Downloadable/Block/Sales/Order/Email/Items/Downloadable.php index 3ca4c527b8..4d51e359b3 100644 --- a/app/code/core/Mage/Downloadable/Block/Sales/Order/Email/Items/Downloadable.php +++ b/app/code/core/Mage/Downloadable/Block/Sales/Order/Email/Items/Downloadable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Block/Sales/Order/Email/Items/Order/Downloadable.php b/app/code/core/Mage/Downloadable/Block/Sales/Order/Email/Items/Order/Downloadable.php index 801c79fae1..ee5e772241 100644 --- a/app/code/core/Mage/Downloadable/Block/Sales/Order/Email/Items/Order/Downloadable.php +++ b/app/code/core/Mage/Downloadable/Block/Sales/Order/Email/Items/Order/Downloadable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Block/Sales/Order/Item/Renderer/Downloadable.php b/app/code/core/Mage/Downloadable/Block/Sales/Order/Item/Renderer/Downloadable.php index c82c9ad734..5f307f11b9 100644 --- a/app/code/core/Mage/Downloadable/Block/Sales/Order/Item/Renderer/Downloadable.php +++ b/app/code/core/Mage/Downloadable/Block/Sales/Order/Item/Renderer/Downloadable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Helper/Catalog/Product/Configuration.php b/app/code/core/Mage/Downloadable/Helper/Catalog/Product/Configuration.php index 069a784e93..82585edbca 100644 --- a/app/code/core/Mage/Downloadable/Helper/Catalog/Product/Configuration.php +++ b/app/code/core/Mage/Downloadable/Helper/Catalog/Product/Configuration.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Helper/Data.php b/app/code/core/Mage/Downloadable/Helper/Data.php index 39070908d7..4221c8fc22 100644 --- a/app/code/core/Mage/Downloadable/Helper/Data.php +++ b/app/code/core/Mage/Downloadable/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Helper/Download.php b/app/code/core/Mage/Downloadable/Helper/Download.php index fedfc381bf..03abc38649 100644 --- a/app/code/core/Mage/Downloadable/Helper/Download.php +++ b/app/code/core/Mage/Downloadable/Helper/Download.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Helper/File.php b/app/code/core/Mage/Downloadable/Helper/File.php index 4e09b03533..8ec4dfb61d 100644 --- a/app/code/core/Mage/Downloadable/Helper/File.php +++ b/app/code/core/Mage/Downloadable/Helper/File.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Model/CatalogIndex/Data/Downloadable.php b/app/code/core/Mage/Downloadable/Model/CatalogIndex/Data/Downloadable.php index 135a5ba542..a49327a26f 100644 --- a/app/code/core/Mage/Downloadable/Model/CatalogIndex/Data/Downloadable.php +++ b/app/code/core/Mage/Downloadable/Model/CatalogIndex/Data/Downloadable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Model/Link.php b/app/code/core/Mage/Downloadable/Model/Link.php index c3a4e51657..207f3011b6 100644 --- a/app/code/core/Mage/Downloadable/Model/Link.php +++ b/app/code/core/Mage/Downloadable/Model/Link.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Model/Link/Api.php b/app/code/core/Mage/Downloadable/Model/Link/Api.php index 96a30973c1..ab49d27751 100644 --- a/app/code/core/Mage/Downloadable/Model/Link/Api.php +++ b/app/code/core/Mage/Downloadable/Model/Link/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Model/Link/Api/Uploader.php b/app/code/core/Mage/Downloadable/Model/Link/Api/Uploader.php index 5751f8dac6..7f6481c622 100644 --- a/app/code/core/Mage/Downloadable/Model/Link/Api/Uploader.php +++ b/app/code/core/Mage/Downloadable/Model/Link/Api/Uploader.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Model/Link/Api/V2.php b/app/code/core/Mage/Downloadable/Model/Link/Api/V2.php index 7b9eb1dcbb..7e98c4ac40 100644 --- a/app/code/core/Mage/Downloadable/Model/Link/Api/V2.php +++ b/app/code/core/Mage/Downloadable/Model/Link/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Model/Link/Api/Validator.php b/app/code/core/Mage/Downloadable/Model/Link/Api/Validator.php index 3684a6d5bd..ad1f7b3ca7 100644 --- a/app/code/core/Mage/Downloadable/Model/Link/Api/Validator.php +++ b/app/code/core/Mage/Downloadable/Model/Link/Api/Validator.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Model/Link/Purchased.php b/app/code/core/Mage/Downloadable/Model/Link/Purchased.php index b016dd00ef..f80f88f12a 100644 --- a/app/code/core/Mage/Downloadable/Model/Link/Purchased.php +++ b/app/code/core/Mage/Downloadable/Model/Link/Purchased.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Model/Link/Purchased/Item.php b/app/code/core/Mage/Downloadable/Model/Link/Purchased/Item.php index 48f4aa6c20..73b4f1f1e6 100644 --- a/app/code/core/Mage/Downloadable/Model/Link/Purchased/Item.php +++ b/app/code/core/Mage/Downloadable/Model/Link/Purchased/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Model/Mysql4/Indexer/Price.php b/app/code/core/Mage/Downloadable/Model/Mysql4/Indexer/Price.php index dd47549f87..f87e1d4ee0 100644 --- a/app/code/core/Mage/Downloadable/Model/Mysql4/Indexer/Price.php +++ b/app/code/core/Mage/Downloadable/Model/Mysql4/Indexer/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Model/Mysql4/Link.php b/app/code/core/Mage/Downloadable/Model/Mysql4/Link.php index 5387d864a0..7344f66093 100644 --- a/app/code/core/Mage/Downloadable/Model/Mysql4/Link.php +++ b/app/code/core/Mage/Downloadable/Model/Mysql4/Link.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Model/Mysql4/Link/Collection.php b/app/code/core/Mage/Downloadable/Model/Mysql4/Link/Collection.php index d6ea52dec8..d2aa349202 100644 --- a/app/code/core/Mage/Downloadable/Model/Mysql4/Link/Collection.php +++ b/app/code/core/Mage/Downloadable/Model/Mysql4/Link/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Model/Mysql4/Link/Purchased.php b/app/code/core/Mage/Downloadable/Model/Mysql4/Link/Purchased.php index 86f5fd8e75..ffb0a32579 100644 --- a/app/code/core/Mage/Downloadable/Model/Mysql4/Link/Purchased.php +++ b/app/code/core/Mage/Downloadable/Model/Mysql4/Link/Purchased.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Model/Mysql4/Link/Purchased/Collection.php b/app/code/core/Mage/Downloadable/Model/Mysql4/Link/Purchased/Collection.php index 4e4cc36920..926887d649 100644 --- a/app/code/core/Mage/Downloadable/Model/Mysql4/Link/Purchased/Collection.php +++ b/app/code/core/Mage/Downloadable/Model/Mysql4/Link/Purchased/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Model/Mysql4/Link/Purchased/Item.php b/app/code/core/Mage/Downloadable/Model/Mysql4/Link/Purchased/Item.php index 6d5c2f6b03..f649d7af4f 100644 --- a/app/code/core/Mage/Downloadable/Model/Mysql4/Link/Purchased/Item.php +++ b/app/code/core/Mage/Downloadable/Model/Mysql4/Link/Purchased/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Model/Mysql4/Link/Purchased/Item/Collection.php b/app/code/core/Mage/Downloadable/Model/Mysql4/Link/Purchased/Item/Collection.php index a2dff972c5..9de260c77f 100644 --- a/app/code/core/Mage/Downloadable/Model/Mysql4/Link/Purchased/Item/Collection.php +++ b/app/code/core/Mage/Downloadable/Model/Mysql4/Link/Purchased/Item/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Model/Mysql4/Sample.php b/app/code/core/Mage/Downloadable/Model/Mysql4/Sample.php index 1edb0651f6..9ff4f1e712 100644 --- a/app/code/core/Mage/Downloadable/Model/Mysql4/Sample.php +++ b/app/code/core/Mage/Downloadable/Model/Mysql4/Sample.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Model/Mysql4/Sample/Collection.php b/app/code/core/Mage/Downloadable/Model/Mysql4/Sample/Collection.php index f55cf604e2..e705b51092 100644 --- a/app/code/core/Mage/Downloadable/Model/Mysql4/Sample/Collection.php +++ b/app/code/core/Mage/Downloadable/Model/Mysql4/Sample/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Model/Observer.php b/app/code/core/Mage/Downloadable/Model/Observer.php index de7d35f396..1bb4e386cd 100644 --- a/app/code/core/Mage/Downloadable/Model/Observer.php +++ b/app/code/core/Mage/Downloadable/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -280,4 +280,17 @@ public function isAllowedGuestCheckout(Varien_Event_Observer $observer) return $this; } + + /** + * Initialize product options renderer with downloadable specific params + * + * @param Varien_Event_Observer $observer + * @return Mage_Downloadable_Model_Observer + */ + public function initOptionRenderer(Varien_Event_Observer $observer) + { + $block = $observer->getBlock(); + $block->addOptionsRenderCfg('downloadable', 'downloadable/catalog_product_configuration'); + return $this; + } } diff --git a/app/code/core/Mage/Downloadable/Model/Product/Price.php b/app/code/core/Mage/Downloadable/Model/Product/Price.php index 2ae499bece..152cbff060 100644 --- a/app/code/core/Mage/Downloadable/Model/Product/Price.php +++ b/app/code/core/Mage/Downloadable/Model/Product/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Model/Product/Type.php b/app/code/core/Mage/Downloadable/Model/Product/Type.php index 50255203c8..b98f6bb9b5 100644 --- a/app/code/core/Mage/Downloadable/Model/Product/Type.php +++ b/app/code/core/Mage/Downloadable/Model/Product/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -412,11 +412,6 @@ public function beforeSave($product = null) } } - /* - * After "Downloadable Information" tab was made non-ajax we should - * set this flag "true" to force saving of 'required_options' attribute - */ - $this->getProduct($product)->setCanSaveCustomOptions(true); $this->getProduct($product)->setTypeHasOptions($linksExist); $this->getProduct($product)->setLinksExist($linksExist); } diff --git a/app/code/core/Mage/Downloadable/Model/Resource/Indexer/Price.php b/app/code/core/Mage/Downloadable/Model/Resource/Indexer/Price.php index a040fdaff8..1d20f26f0b 100755 --- a/app/code/core/Mage/Downloadable/Model/Resource/Indexer/Price.php +++ b/app/code/core/Mage/Downloadable/Model/Resource/Indexer/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Model/Resource/Link.php b/app/code/core/Mage/Downloadable/Model/Resource/Link.php index 6277a626a7..d998b2815e 100755 --- a/app/code/core/Mage/Downloadable/Model/Resource/Link.php +++ b/app/code/core/Mage/Downloadable/Model/Resource/Link.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Model/Resource/Link/Collection.php b/app/code/core/Mage/Downloadable/Model/Resource/Link/Collection.php index f2429369b3..557974c5f2 100755 --- a/app/code/core/Mage/Downloadable/Model/Resource/Link/Collection.php +++ b/app/code/core/Mage/Downloadable/Model/Resource/Link/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Model/Resource/Link/Purchased.php b/app/code/core/Mage/Downloadable/Model/Resource/Link/Purchased.php index 0e66136cf8..f2a5770cc6 100755 --- a/app/code/core/Mage/Downloadable/Model/Resource/Link/Purchased.php +++ b/app/code/core/Mage/Downloadable/Model/Resource/Link/Purchased.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Model/Resource/Link/Purchased/Collection.php b/app/code/core/Mage/Downloadable/Model/Resource/Link/Purchased/Collection.php index adff65f5a0..b68d5cbac3 100755 --- a/app/code/core/Mage/Downloadable/Model/Resource/Link/Purchased/Collection.php +++ b/app/code/core/Mage/Downloadable/Model/Resource/Link/Purchased/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Model/Resource/Link/Purchased/Item.php b/app/code/core/Mage/Downloadable/Model/Resource/Link/Purchased/Item.php index 570fd2cf7e..87f31d6631 100755 --- a/app/code/core/Mage/Downloadable/Model/Resource/Link/Purchased/Item.php +++ b/app/code/core/Mage/Downloadable/Model/Resource/Link/Purchased/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Model/Resource/Link/Purchased/Item/Collection.php b/app/code/core/Mage/Downloadable/Model/Resource/Link/Purchased/Item/Collection.php index b613597391..8befce6c72 100755 --- a/app/code/core/Mage/Downloadable/Model/Resource/Link/Purchased/Item/Collection.php +++ b/app/code/core/Mage/Downloadable/Model/Resource/Link/Purchased/Item/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Model/Resource/Sample.php b/app/code/core/Mage/Downloadable/Model/Resource/Sample.php index b0bc3fc926..6150d8e19b 100755 --- a/app/code/core/Mage/Downloadable/Model/Resource/Sample.php +++ b/app/code/core/Mage/Downloadable/Model/Resource/Sample.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Model/Resource/Sample/Collection.php b/app/code/core/Mage/Downloadable/Model/Resource/Sample/Collection.php index 71aa90d215..e64bfa800b 100755 --- a/app/code/core/Mage/Downloadable/Model/Resource/Sample/Collection.php +++ b/app/code/core/Mage/Downloadable/Model/Resource/Sample/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Model/Sales/Order/Pdf/Items/Abstract.php b/app/code/core/Mage/Downloadable/Model/Sales/Order/Pdf/Items/Abstract.php index d420a07c9f..3f3f722eb4 100644 --- a/app/code/core/Mage/Downloadable/Model/Sales/Order/Pdf/Items/Abstract.php +++ b/app/code/core/Mage/Downloadable/Model/Sales/Order/Pdf/Items/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Model/Sales/Order/Pdf/Items/Creditmemo.php b/app/code/core/Mage/Downloadable/Model/Sales/Order/Pdf/Items/Creditmemo.php index 38c82bd606..40001be7e8 100644 --- a/app/code/core/Mage/Downloadable/Model/Sales/Order/Pdf/Items/Creditmemo.php +++ b/app/code/core/Mage/Downloadable/Model/Sales/Order/Pdf/Items/Creditmemo.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -32,7 +32,8 @@ * @package Mage_Downloadable * @author Magento Core Team */ -class Mage_Downloadable_Model_Sales_Order_Pdf_Items_Creditmemo extends Mage_Downloadable_Model_Sales_Order_Pdf_Items_Abstract +class Mage_Downloadable_Model_Sales_Order_Pdf_Items_Creditmemo + extends Mage_Downloadable_Model_Sales_Order_Pdf_Items_Abstract { /** * Draw item line @@ -65,13 +66,29 @@ public function draw() $x += 100; // draw Total (ex) - $lines[0][] = array( - 'text' => $order->formatPriceTxt($item->getRowTotal()), - 'feed' => $x, - 'font' => 'bold', - 'align' => 'right', - 'width' => 50, - ); + $i = 0; + $prices = $this->getItemPricesForDisplay(); + foreach ($prices as $priceData){ + if (isset($priceData['label'])) { + // draw Subtotal label + $lines[$i][] = array( + 'text' => $priceData['label'], + 'feed' => $x, + 'align' => 'right', + 'width' => 50, + ); + $i++; + } + // draw Subtotal + $lines[$i][] = array( + 'text' => $priceData['subtotal'], + 'feed' => $x, + 'font' => 'bold', + 'align' => 'right', + 'width' => 50, + ); + $i++; + } $x += 50; // draw Discount @@ -105,8 +122,10 @@ public function draw() $x += 45; // draw Subtotal + $subtotal = $item->getRowTotal() + + $item->getTaxAmount() + $item->getHiddenTaxAmount() - $item->getDiscountAmount(); $lines[0][] = array( - 'text' => $order->formatPriceTxt($item->getRowTotal() + $item->getTaxAmount() - $item->getDiscountAmount()), + 'text' => $order->formatPriceTxt($subtotal), 'feed' => $rightBound, 'font' => 'bold', 'align' => 'right' diff --git a/app/code/core/Mage/Downloadable/Model/Sales/Order/Pdf/Items/Invoice.php b/app/code/core/Mage/Downloadable/Model/Sales/Order/Pdf/Items/Invoice.php index 190232d292..ea6190d212 100644 --- a/app/code/core/Mage/Downloadable/Model/Sales/Order/Pdf/Items/Invoice.php +++ b/app/code/core/Mage/Downloadable/Model/Sales/Order/Pdf/Items/Invoice.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -32,7 +32,8 @@ * @package Mage_Downloadable * @author Magento Core Team */ -class Mage_Downloadable_Model_Sales_Order_Pdf_Items_Invoice extends Mage_Downloadable_Model_Sales_Order_Pdf_Items_Abstract +class Mage_Downloadable_Model_Sales_Order_Pdf_Items_Invoice + extends Mage_Downloadable_Model_Sales_Order_Pdf_Items_Abstract { /** * Draw item line @@ -64,13 +65,41 @@ public function draw() 'feed' => 435 ); - // draw Price - $lines[0][] = array( - 'text' => $order->formatPriceTxt($item->getPrice()), - 'feed' => 395, - 'font' => 'bold', - 'align' => 'right' - ); + // draw item Prices + $i = 0; + $prices = $this->getItemPricesForDisplay(); + foreach ($prices as $priceData){ + if (isset($priceData['label'])) { + // draw Price label + $lines[$i][] = array( + 'text' => $priceData['label'], + 'feed' => 395, + 'align' => 'right' + ); + // draw Subtotal label + $lines[$i][] = array( + 'text' => $priceData['label'], + 'feed' => 565, + 'align' => 'right' + ); + $i++; + } + // draw Price + $lines[$i][] = array( + 'text' => $priceData['price'], + 'feed' => 395, + 'font' => 'bold', + 'align' => 'right' + ); + // draw Subtotal + $lines[$i][] = array( + 'text' => $priceData['subtotal'], + 'feed' => 565, + 'font' => 'bold', + 'align' => 'right' + ); + $i++; + } // draw Tax $lines[0][] = array( @@ -80,14 +109,6 @@ public function draw() 'align' => 'right' ); - // draw Subtotal - $lines[0][] = array( - 'text' => $order->formatPriceTxt($item->getRowTotal()), - 'feed' => 565, - 'font' => 'bold', - 'align' => 'right' - ); - // custom options $options = $this->getItemOptions(); if ($options) { @@ -100,7 +121,11 @@ public function draw() ); if ($option['value']) { - $_printValue = isset($option['print_value']) ? $option['print_value'] : strip_tags($option['value']); + if (isset($option['print_value'])) { + $_printValue = $option['print_value']; + } else { + $_printValue = strip_tags($option['value']); + } $values = explode(', ', $_printValue); foreach ($values as $value) { $lines[][] = array( diff --git a/app/code/core/Mage/Downloadable/Model/Sample.php b/app/code/core/Mage/Downloadable/Model/Sample.php index aad0d343fc..2ccb6177a6 100644 --- a/app/code/core/Mage/Downloadable/Model/Sample.php +++ b/app/code/core/Mage/Downloadable/Model/Sample.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Model/System/Config/Source/Contentdisposition.php b/app/code/core/Mage/Downloadable/Model/System/Config/Source/Contentdisposition.php index 9512c81954..632e52fdc6 100644 --- a/app/code/core/Mage/Downloadable/Model/System/Config/Source/Contentdisposition.php +++ b/app/code/core/Mage/Downloadable/Model/System/Config/Source/Contentdisposition.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Model/System/Config/Source/Orderitemstatus.php b/app/code/core/Mage/Downloadable/Model/System/Config/Source/Orderitemstatus.php index f57ba6074b..02e4137f6a 100644 --- a/app/code/core/Mage/Downloadable/Model/System/Config/Source/Orderitemstatus.php +++ b/app/code/core/Mage/Downloadable/Model/System/Config/Source/Orderitemstatus.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/controllers/Adminhtml/Downloadable/FileController.php b/app/code/core/Mage/Downloadable/controllers/Adminhtml/Downloadable/FileController.php index 1d87939d8f..f979ca1fea 100644 --- a/app/code/core/Mage/Downloadable/controllers/Adminhtml/Downloadable/FileController.php +++ b/app/code/core/Mage/Downloadable/controllers/Adminhtml/Downloadable/FileController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/controllers/Adminhtml/Downloadable/Product/EditController.php b/app/code/core/Mage/Downloadable/controllers/Adminhtml/Downloadable/Product/EditController.php index c002eeb678..41c7b52f15 100644 --- a/app/code/core/Mage/Downloadable/controllers/Adminhtml/Downloadable/Product/EditController.php +++ b/app/code/core/Mage/Downloadable/controllers/Adminhtml/Downloadable/Product/EditController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/controllers/CustomerController.php b/app/code/core/Mage/Downloadable/controllers/CustomerController.php index 70faeea7a1..eb649d1a1d 100644 --- a/app/code/core/Mage/Downloadable/controllers/CustomerController.php +++ b/app/code/core/Mage/Downloadable/controllers/CustomerController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/controllers/DownloadController.php b/app/code/core/Mage/Downloadable/controllers/DownloadController.php index 57fc8776e1..cef5be6c47 100644 --- a/app/code/core/Mage/Downloadable/controllers/DownloadController.php +++ b/app/code/core/Mage/Downloadable/controllers/DownloadController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/controllers/FileController.php b/app/code/core/Mage/Downloadable/controllers/FileController.php index 778cf5c47c..f4059063ca 100644 --- a/app/code/core/Mage/Downloadable/controllers/FileController.php +++ b/app/code/core/Mage/Downloadable/controllers/FileController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/controllers/Product/EditController.php b/app/code/core/Mage/Downloadable/controllers/Product/EditController.php index 14cb23cf4f..23b9879a12 100644 --- a/app/code/core/Mage/Downloadable/controllers/Product/EditController.php +++ b/app/code/core/Mage/Downloadable/controllers/Product/EditController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/data/downloadable_setup/data-install-1.6.0.0.php b/app/code/core/Mage/Downloadable/data/downloadable_setup/data-install-1.6.0.0.php index 07bac6f538..eb64f202b2 100644 --- a/app/code/core/Mage/Downloadable/data/downloadable_setup/data-install-1.6.0.0.php +++ b/app/code/core/Mage/Downloadable/data/downloadable_setup/data-install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** @var $installer Mage_Downloadable_Model_Resource_Setup */ diff --git a/app/code/core/Mage/Downloadable/etc/adminhtml.xml b/app/code/core/Mage/Downloadable/etc/adminhtml.xml index 4956a1f875..a9d5e6e8c0 100644 --- a/app/code/core/Mage/Downloadable/etc/adminhtml.xml +++ b/app/code/core/Mage/Downloadable/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -35,7 +35,7 @@ - Downloadable product Section + Downloadable Product Section @@ -45,4 +45,18 @@ + + + + + + + Downloads + adminhtml/report_product/downloads + + + + + + diff --git a/app/code/core/Mage/Downloadable/etc/api.xml b/app/code/core/Mage/Downloadable/etc/api.xml index 21bb335751..86c2548f01 100644 --- a/app/code/core/Mage/Downloadable/etc/api.xml +++ b/app/code/core/Mage/Downloadable/etc/api.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Downloadable/etc/config.xml b/app/code/core/Mage/Downloadable/etc/config.xml index 22e7dc29f6..96409de891 100644 --- a/app/code/core/Mage/Downloadable/etc/config.xml +++ b/app/code/core/Mage/Downloadable/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -310,6 +310,14 @@ + + + + downloadable/observer + initOptionRenderer + + + diff --git a/app/code/core/Mage/Downloadable/etc/system.xml b/app/code/core/Mage/Downloadable/etc/system.xml index aea4f332e7..ac4cab9e85 100644 --- a/app/code/core/Mage/Downloadable/etc/system.xml +++ b/app/code/core/Mage/Downloadable/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Downloadable/sql/downloadable_setup/install-1.6.0.0.php b/app/code/core/Mage/Downloadable/sql/downloadable_setup/install-1.6.0.0.php index 10aefb639c..9861afe60c 100644 --- a/app/code/core/Mage/Downloadable/sql/downloadable_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Downloadable/sql/downloadable_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-install-0.1.0.php b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-install-0.1.0.php index 488b6e981b..5fc369cf77 100644 --- a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-install-0.1.0.php +++ b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-install-0.1.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-install-1.4.0.0.php b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-install-1.4.0.0.php index 6897a313c9..e7914ec027 100644 --- a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-install-1.4.0.0.php +++ b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-install-1.4.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.0-0.1.1.php b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.0-0.1.1.php index 3934e21426..04d9974d51 100644 --- a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.0-0.1.1.php +++ b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.0-0.1.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.1-0.1.2.php b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.1-0.1.2.php index fdeb5adade..29ca4be1d1 100644 --- a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.1-0.1.2.php +++ b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.1-0.1.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.10-0.1.11.php b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.10-0.1.11.php index 00daa4bd6b..30f1938032 100644 --- a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.10-0.1.11.php +++ b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.10-0.1.11.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.11-0.1.12.php b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.11-0.1.12.php index ac0e6e4e33..699ebc1fb3 100644 --- a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.11-0.1.12.php +++ b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.11-0.1.12.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.12-0.1.13.php b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.12-0.1.13.php index f4303e7484..ec7b034c1a 100644 --- a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.12-0.1.13.php +++ b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.12-0.1.13.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.13-0.1.14.php b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.13-0.1.14.php index b432d4ee8d..ce3c34ed9a 100644 --- a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.13-0.1.14.php +++ b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.13-0.1.14.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.14-0.1.15.php b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.14-0.1.15.php index fc9293baa4..63ca3d7c6b 100644 --- a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.14-0.1.15.php +++ b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.14-0.1.15.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.15-0.1.16.php b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.15-0.1.16.php index e6457c4850..516aeb66ad 100644 --- a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.15-0.1.16.php +++ b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.15-0.1.16.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.2-0.1.3.php b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.2-0.1.3.php index 7beabe1a2f..7d431df7d1 100644 --- a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.2-0.1.3.php +++ b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.2-0.1.3.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.3-0.1.4.php b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.3-0.1.4.php index ee2a1c0b68..c3f37932bb 100644 --- a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.3-0.1.4.php +++ b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.3-0.1.4.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.4-0.1.5.php b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.4-0.1.5.php index 127bc3e060..597496ecd1 100644 --- a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.4-0.1.5.php +++ b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.4-0.1.5.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.5-0.1.6.php b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.5-0.1.6.php index fe01d5cfd6..16dee9f79d 100644 --- a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.5-0.1.6.php +++ b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.5-0.1.6.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.6-0.1.7.php b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.6-0.1.7.php index aab5fcc8ec..920ba3d7a5 100644 --- a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.6-0.1.7.php +++ b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.6-0.1.7.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.7-0.1.8.php b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.7-0.1.8.php index e9771bfb35..b235fac03e 100644 --- a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.7-0.1.8.php +++ b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.7-0.1.8.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.8-0.1.9.php b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.8-0.1.9.php index 9a0283c432..5fc5f07120 100644 --- a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.8-0.1.9.php +++ b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.8-0.1.9.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.9-0.1.10.php b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.9-0.1.10.php index ffa3b60276..3cdfdc8ac3 100644 --- a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.9-0.1.10.php +++ b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.9-0.1.10.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-1.3.9-1.4.0.0.php b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-1.3.9-1.4.0.0.php index dc933cbd1e..cf556061b1 100644 --- a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-1.3.9-1.4.0.0.php +++ b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-1.3.9-1.4.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-1.4.0.0-1.4.0.1.php b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-1.4.0.0-1.4.0.1.php index 6608d6068b..0393742298 100644 --- a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-1.4.0.0-1.4.0.1.php +++ b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-1.4.0.0-1.4.0.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-1.4.0.1-1.4.0.2.php b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-1.4.0.1-1.4.0.2.php index 839aee5b6e..ea63ab57b3 100644 --- a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-1.4.0.1-1.4.0.2.php +++ b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-1.4.0.1-1.4.0.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-1.4.0.2-1.4.0.3.php b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-1.4.0.2-1.4.0.3.php index f3e4b3ee67..250a8708de 100644 --- a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-1.4.0.2-1.4.0.3.php +++ b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-1.4.0.2-1.4.0.3.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php index 164b8ac2cb..8062f777a0 100644 --- a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-1.6.0.0.1-1.6.0.0.2.php b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-1.6.0.0.1-1.6.0.0.2.php index a24f7f3ec3..05b36f649b 100644 --- a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-1.6.0.0.1-1.6.0.0.2.php +++ b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-1.6.0.0.1-1.6.0.0.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/sql/downloadable_setup/upgrade-1.6.0.0-1.6.0.0.1.php b/app/code/core/Mage/Downloadable/sql/downloadable_setup/upgrade-1.6.0.0-1.6.0.0.1.php index c3d97a24ef..05aa852dfe 100644 --- a/app/code/core/Mage/Downloadable/sql/downloadable_setup/upgrade-1.6.0.0-1.6.0.0.1.php +++ b/app/code/core/Mage/Downloadable/sql/downloadable_setup/upgrade-1.6.0.0-1.6.0.0.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/sql/downloadable_setup/upgrade-1.6.0.0.1-1.6.0.0.2.php b/app/code/core/Mage/Downloadable/sql/downloadable_setup/upgrade-1.6.0.0.1-1.6.0.0.2.php index 5d7e8f5384..375fcf5484 100644 --- a/app/code/core/Mage/Downloadable/sql/downloadable_setup/upgrade-1.6.0.0.1-1.6.0.0.2.php +++ b/app/code/core/Mage/Downloadable/sql/downloadable_setup/upgrade-1.6.0.0.1-1.6.0.0.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Js.php b/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Js.php index 10ac585a4f..07e3d9cc49 100644 --- a/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Js.php +++ b/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Js.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Main/Abstract.php b/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Main/Abstract.php index c3dedc3c71..c4d3d3d10a 100644 --- a/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Main/Abstract.php +++ b/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Main/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Options/Abstract.php b/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Options/Abstract.php index 44112f0595..913ce127db 100644 --- a/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Options/Abstract.php +++ b/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Options/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Grid/Abstract.php b/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Grid/Abstract.php index 0253b1b4ed..df3644a85f 100644 --- a/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Grid/Abstract.php +++ b/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Grid/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Exception.php b/app/code/core/Mage/Eav/Exception.php index 7792d9e7cd..7784d2acb9 100644 --- a/app/code/core/Mage/Eav/Exception.php +++ b/app/code/core/Mage/Eav/Exception.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Helper/Data.php b/app/code/core/Mage/Eav/Helper/Data.php index b7e733b7a3..ccf4e0e79d 100644 --- a/app/code/core/Mage/Eav/Helper/Data.php +++ b/app/code/core/Mage/Eav/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Adminhtml/System/Config/Source/Inputtype.php b/app/code/core/Mage/Eav/Model/Adminhtml/System/Config/Source/Inputtype.php index 84fb7ff0b6..51c832bae1 100644 --- a/app/code/core/Mage/Eav/Model/Adminhtml/System/Config/Source/Inputtype.php +++ b/app/code/core/Mage/Eav/Model/Adminhtml/System/Config/Source/Inputtype.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Eav_Model_Adminhtml_System_Config_Source_Inputtype diff --git a/app/code/core/Mage/Eav/Model/Adminhtml/System/Config/Source/Inputtype/Validator.php b/app/code/core/Mage/Eav/Model/Adminhtml/System/Config/Source/Inputtype/Validator.php index cbcdc5bcfb..23f24863ae 100644 --- a/app/code/core/Mage/Eav/Model/Adminhtml/System/Config/Source/Inputtype/Validator.php +++ b/app/code/core/Mage/Eav/Model/Adminhtml/System/Config/Source/Inputtype/Validator.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Attribute.php b/app/code/core/Mage/Eav/Model/Attribute.php index 5d2513c2f0..74c6693e17 100644 --- a/app/code/core/Mage/Eav/Model/Attribute.php +++ b/app/code/core/Mage/Eav/Model/Attribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Attribute/Data.php b/app/code/core/Mage/Eav/Model/Attribute/Data.php index bb4f4a9702..8ea55e6c0c 100644 --- a/app/code/core/Mage/Eav/Model/Attribute/Data.php +++ b/app/code/core/Mage/Eav/Model/Attribute/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Attribute/Data/Abstract.php b/app/code/core/Mage/Eav/Model/Attribute/Data/Abstract.php index 1ae78e4657..658e27e998 100644 --- a/app/code/core/Mage/Eav/Model/Attribute/Data/Abstract.php +++ b/app/code/core/Mage/Eav/Model/Attribute/Data/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Attribute/Data/Boolean.php b/app/code/core/Mage/Eav/Model/Attribute/Data/Boolean.php index c73a5371b1..bca2c004fd 100644 --- a/app/code/core/Mage/Eav/Model/Attribute/Data/Boolean.php +++ b/app/code/core/Mage/Eav/Model/Attribute/Data/Boolean.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Attribute/Data/Date.php b/app/code/core/Mage/Eav/Model/Attribute/Data/Date.php index 309c4aca04..3c25f9550d 100644 --- a/app/code/core/Mage/Eav/Model/Attribute/Data/Date.php +++ b/app/code/core/Mage/Eav/Model/Attribute/Data/Date.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Attribute/Data/File.php b/app/code/core/Mage/Eav/Model/Attribute/Data/File.php index b336a52227..12d19e3bbc 100644 --- a/app/code/core/Mage/Eav/Model/Attribute/Data/File.php +++ b/app/code/core/Mage/Eav/Model/Attribute/Data/File.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Attribute/Data/Hidden.php b/app/code/core/Mage/Eav/Model/Attribute/Data/Hidden.php index 7bf9091801..50735437d0 100644 --- a/app/code/core/Mage/Eav/Model/Attribute/Data/Hidden.php +++ b/app/code/core/Mage/Eav/Model/Attribute/Data/Hidden.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Attribute/Data/Image.php b/app/code/core/Mage/Eav/Model/Attribute/Data/Image.php index f74d275156..33e7669072 100644 --- a/app/code/core/Mage/Eav/Model/Attribute/Data/Image.php +++ b/app/code/core/Mage/Eav/Model/Attribute/Data/Image.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Attribute/Data/Multiline.php b/app/code/core/Mage/Eav/Model/Attribute/Data/Multiline.php index f9ff236274..b54f532c3d 100644 --- a/app/code/core/Mage/Eav/Model/Attribute/Data/Multiline.php +++ b/app/code/core/Mage/Eav/Model/Attribute/Data/Multiline.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Attribute/Data/Multiselect.php b/app/code/core/Mage/Eav/Model/Attribute/Data/Multiselect.php index 9d615f4588..2597649752 100644 --- a/app/code/core/Mage/Eav/Model/Attribute/Data/Multiselect.php +++ b/app/code/core/Mage/Eav/Model/Attribute/Data/Multiselect.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Attribute/Data/Select.php b/app/code/core/Mage/Eav/Model/Attribute/Data/Select.php index f2e1f7976d..7ad12b891b 100644 --- a/app/code/core/Mage/Eav/Model/Attribute/Data/Select.php +++ b/app/code/core/Mage/Eav/Model/Attribute/Data/Select.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Attribute/Data/Text.php b/app/code/core/Mage/Eav/Model/Attribute/Data/Text.php index 6650a85b78..60d631a545 100644 --- a/app/code/core/Mage/Eav/Model/Attribute/Data/Text.php +++ b/app/code/core/Mage/Eav/Model/Attribute/Data/Text.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Attribute/Data/Textarea.php b/app/code/core/Mage/Eav/Model/Attribute/Data/Textarea.php index 18e17505fa..bcc02692d3 100644 --- a/app/code/core/Mage/Eav/Model/Attribute/Data/Textarea.php +++ b/app/code/core/Mage/Eav/Model/Attribute/Data/Textarea.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Config.php b/app/code/core/Mage/Eav/Model/Config.php index 45edfac40e..fb51b52a45 100644 --- a/app/code/core/Mage/Eav/Model/Config.php +++ b/app/code/core/Mage/Eav/Model/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Convert/Adapter/Entity.php b/app/code/core/Mage/Eav/Model/Convert/Adapter/Entity.php index 29e8ac8265..15b2ea275c 100644 --- a/app/code/core/Mage/Eav/Model/Convert/Adapter/Entity.php +++ b/app/code/core/Mage/Eav/Model/Convert/Adapter/Entity.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Convert/Adapter/Grid.php b/app/code/core/Mage/Eav/Model/Convert/Adapter/Grid.php index 5303900351..01ec67c3ee 100644 --- a/app/code/core/Mage/Eav/Model/Convert/Adapter/Grid.php +++ b/app/code/core/Mage/Eav/Model/Convert/Adapter/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Convert/Parser/Abstract.php b/app/code/core/Mage/Eav/Model/Convert/Parser/Abstract.php index 79def77707..d9223182e0 100644 --- a/app/code/core/Mage/Eav/Model/Convert/Parser/Abstract.php +++ b/app/code/core/Mage/Eav/Model/Convert/Parser/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity.php b/app/code/core/Mage/Eav/Model/Entity.php index 623d176621..093af2d7f0 100644 --- a/app/code/core/Mage/Eav/Model/Entity.php +++ b/app/code/core/Mage/Eav/Model/Entity.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Abstract.php b/app/code/core/Mage/Eav/Model/Entity/Abstract.php index 267ca194f5..5898217b3c 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Abstract.php +++ b/app/code/core/Mage/Eav/Model/Entity/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute.php b/app/code/core/Mage/Eav/Model/Entity/Attribute.php index 15c644687b..32d2c82765 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Abstract.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Abstract.php index 4d729506eb..15bb5d005a 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Abstract.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Abstract.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Abstract.php index 162c036c5c..f9c488b6dd 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Abstract.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Array.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Array.php index bdc2056445..ea532dea51 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Array.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Array.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Datetime.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Datetime.php index 9928af04b8..ef24eea0fd 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Datetime.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Datetime.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Default.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Default.php index c883557e7a..5678e432e3 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Default.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Default.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Increment.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Increment.php index fe792813c4..7078d08af7 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Increment.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Increment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Interface.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Interface.php index d0a063dfb6..6d8f90667a 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Interface.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Serialized.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Serialized.php index 2d8474cfb3..e2e689f5a2 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Serialized.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Serialized.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Store.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Store.php index 7cc60a8750..f6edd877a9 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Store.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Store.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Time/Created.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Time/Created.php index e960ce23dc..29a141338b 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Time/Created.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Time/Created.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Time/Updated.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Time/Updated.php index 3233ff8322..0c3b06395f 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Time/Updated.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Time/Updated.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Exception.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Exception.php index 1c7dc0dde9..17298c9625 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Exception.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Exception.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Frontend/Abstract.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Frontend/Abstract.php index 9a26339915..7afb91e2d3 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Frontend/Abstract.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Frontend/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Frontend/Datetime.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Frontend/Datetime.php index 3adc4a5943..a5fed82299 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Frontend/Datetime.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Frontend/Datetime.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Frontend/Default.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Frontend/Default.php index 5d07cf217b..38a62fa940 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Frontend/Default.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Frontend/Default.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Frontend/Interface.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Frontend/Interface.php index 28a6507934..f9bba5102c 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Frontend/Interface.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Frontend/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Group.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Group.php index 46b630baa5..4a202bbf7c 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Group.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Group.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Interface.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Interface.php index e855040aa4..27d0feed93 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Interface.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Option.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Option.php index af1513eef1..7f2248a311 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Option.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Option.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Set.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Set.php index a428dbafbd..1f3cc674cb 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Set.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Set.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -43,6 +43,12 @@ */ class Mage_Eav_Model_Entity_Attribute_Set extends Mage_Core_Model_Abstract { + /** + * Prefix of model events names + * @var string + */ + protected $_eventPrefix = 'eav_entity_attribute_set'; + /** * Initialize resource model * diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Abstract.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Abstract.php index 33cce81dea..51ca14f3ad 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Abstract.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -74,8 +74,8 @@ public function getAttribute() /** * Get a text for option value * - * @param string|integer $value - * @return string + * @param string|integer $value + * @return string|bool */ public function getOptionText($value) { diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Boolean.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Boolean.php index bb9e382aca..79894c82f3 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Boolean.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Boolean.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Config.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Config.php index a9613dc65c..9b3cf0bf25 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Config.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Interface.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Interface.php index 26a648fdde..fb17a3c790 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Interface.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Store.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Store.php index 1bf10023e8..5b69309495 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Store.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Store.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Table.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Table.php index a99bbcecee..138247ec2d 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Table.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Table.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Collection.php b/app/code/core/Mage/Eav/Model/Entity/Collection.php index adaa14348b..39686d06a6 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Collection.php +++ b/app/code/core/Mage/Eav/Model/Entity/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php b/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php index d9bf3099dd..88b37d1031 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php +++ b/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -703,7 +703,7 @@ public function joinField($alias, $table, $field, $bind, $cond=null, $joinType=' // validate bind list($pk, $fk) = explode('=', $bind); $pk = $this->getSelect()->getAdapter()->quoteColumnAs(trim($pk), null); - $bindCond = $tableAlias . '.' . $pk . '=' . $this->_getAttributeFieldName($fk); + $bindCond = $tableAlias . '.' . trim($pk) . '=' . $this->_getAttributeFieldName(trim($fk)); // process join type switch ($joinType) { @@ -864,6 +864,7 @@ public function load($printQuery = false, $logQuery = false) Varien_Profiler::stop('__EAV_COLLECTION_BEFORE_LOAD__'); $this->_renderFilters(); + $this->_renderOrders(); Varien_Profiler::start('__EAV_COLLECTION_LOAD_ENT__'); $this->_loadEntities($printQuery, $logQuery); @@ -1407,12 +1408,10 @@ public function setOrder($attribute, $dir = self::SORT_ORDER_ASC) { if (is_array($attribute)) { foreach ($attribute as $attr) { - $this->addAttributeToSort($attr, $dir); + parent::setOrder($attr, $dir); } - } else { - $this->addAttributeToSort($attribute, $dir); } - return $this; + return parent::setOrder($attribute, $dir); } /** @@ -1431,12 +1430,18 @@ public function toArray($arrAttributes = array()) } /** - * Before load method + * Treat "order by" items as attributes to sort * * @return Mage_Eav_Model_Entity_Collection_Abstract */ - protected function _beforeLoad() + protected function _renderOrders() { + if (!$this->_isOrdersRendered) { + foreach ($this->_orders as $attribute => $direction) { + $this->addAttributeToSort($attribute, $direction); + } + $this->_isOrdersRendered = true; + } return $this; } diff --git a/app/code/core/Mage/Eav/Model/Entity/Increment/Abstract.php b/app/code/core/Mage/Eav/Model/Entity/Increment/Abstract.php index 9a55e8b371..b4328a9b17 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Increment/Abstract.php +++ b/app/code/core/Mage/Eav/Model/Entity/Increment/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Increment/Alphanum.php b/app/code/core/Mage/Eav/Model/Entity/Increment/Alphanum.php index c4233bd21e..654ea528af 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Increment/Alphanum.php +++ b/app/code/core/Mage/Eav/Model/Entity/Increment/Alphanum.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Increment/Interface.php b/app/code/core/Mage/Eav/Model/Entity/Increment/Interface.php index 0b93c64b65..e190c60d45 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Increment/Interface.php +++ b/app/code/core/Mage/Eav/Model/Entity/Increment/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Increment/Numeric.php b/app/code/core/Mage/Eav/Model/Entity/Increment/Numeric.php index 679c4d46db..d4cfd0ba29 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Increment/Numeric.php +++ b/app/code/core/Mage/Eav/Model/Entity/Increment/Numeric.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Interface.php b/app/code/core/Mage/Eav/Model/Entity/Interface.php index f469e3992d..92323ee2d7 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Interface.php +++ b/app/code/core/Mage/Eav/Model/Entity/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Setup.php b/app/code/core/Mage/Eav/Model/Entity/Setup.php index cae1249026..e2201b803c 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Setup.php +++ b/app/code/core/Mage/Eav/Model/Entity/Setup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Store.php b/app/code/core/Mage/Eav/Model/Entity/Store.php index 50c85621f7..b092089f90 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Store.php +++ b/app/code/core/Mage/Eav/Model/Entity/Store.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Type.php b/app/code/core/Mage/Eav/Model/Entity/Type.php index 15ee7b7bf8..6d7a187ba1 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Type.php +++ b/app/code/core/Mage/Eav/Model/Entity/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Form.php b/app/code/core/Mage/Eav/Model/Form.php index 66040852e0..432081d1ed 100644 --- a/app/code/core/Mage/Eav/Model/Form.php +++ b/app/code/core/Mage/Eav/Model/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Form/Element.php b/app/code/core/Mage/Eav/Model/Form/Element.php index 9292c6ddaf..b32afc09a6 100644 --- a/app/code/core/Mage/Eav/Model/Form/Element.php +++ b/app/code/core/Mage/Eav/Model/Form/Element.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Form/Fieldset.php b/app/code/core/Mage/Eav/Model/Form/Fieldset.php index 36e68879e9..f37af7cc22 100644 --- a/app/code/core/Mage/Eav/Model/Form/Fieldset.php +++ b/app/code/core/Mage/Eav/Model/Form/Fieldset.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Form/Type.php b/app/code/core/Mage/Eav/Model/Form/Type.php index 704583f470..4d5b300776 100644 --- a/app/code/core/Mage/Eav/Model/Form/Type.php +++ b/app/code/core/Mage/Eav/Model/Form/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Mysql4/Config.php b/app/code/core/Mage/Eav/Model/Mysql4/Config.php index 191740f5fc..c093d753d0 100644 --- a/app/code/core/Mage/Eav/Model/Mysql4/Config.php +++ b/app/code/core/Mage/Eav/Model/Mysql4/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Mysql4/Entity/Attribute.php b/app/code/core/Mage/Eav/Model/Mysql4/Entity/Attribute.php index 4415f24d65..b15012650b 100644 --- a/app/code/core/Mage/Eav/Model/Mysql4/Entity/Attribute.php +++ b/app/code/core/Mage/Eav/Model/Mysql4/Entity/Attribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Mysql4/Entity/Attribute/Collection.php b/app/code/core/Mage/Eav/Model/Mysql4/Entity/Attribute/Collection.php index 3b31f9dfa6..af3b760754 100644 --- a/app/code/core/Mage/Eav/Model/Mysql4/Entity/Attribute/Collection.php +++ b/app/code/core/Mage/Eav/Model/Mysql4/Entity/Attribute/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Mysql4/Entity/Attribute/Group.php b/app/code/core/Mage/Eav/Model/Mysql4/Entity/Attribute/Group.php index 343cd92180..1710f95160 100644 --- a/app/code/core/Mage/Eav/Model/Mysql4/Entity/Attribute/Group.php +++ b/app/code/core/Mage/Eav/Model/Mysql4/Entity/Attribute/Group.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Mysql4/Entity/Attribute/Group/Collection.php b/app/code/core/Mage/Eav/Model/Mysql4/Entity/Attribute/Group/Collection.php index 11f0a79a0c..6f7c9a664a 100644 --- a/app/code/core/Mage/Eav/Model/Mysql4/Entity/Attribute/Group/Collection.php +++ b/app/code/core/Mage/Eav/Model/Mysql4/Entity/Attribute/Group/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Mysql4/Entity/Attribute/Option.php b/app/code/core/Mage/Eav/Model/Mysql4/Entity/Attribute/Option.php index 84b28abb7c..db33e11370 100644 --- a/app/code/core/Mage/Eav/Model/Mysql4/Entity/Attribute/Option.php +++ b/app/code/core/Mage/Eav/Model/Mysql4/Entity/Attribute/Option.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Mysql4/Entity/Attribute/Option/Collection.php b/app/code/core/Mage/Eav/Model/Mysql4/Entity/Attribute/Option/Collection.php index 43c7dae543..6a80e46857 100644 --- a/app/code/core/Mage/Eav/Model/Mysql4/Entity/Attribute/Option/Collection.php +++ b/app/code/core/Mage/Eav/Model/Mysql4/Entity/Attribute/Option/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Mysql4/Entity/Attribute/Set.php b/app/code/core/Mage/Eav/Model/Mysql4/Entity/Attribute/Set.php index a7a73f32c4..0c7c483fea 100644 --- a/app/code/core/Mage/Eav/Model/Mysql4/Entity/Attribute/Set.php +++ b/app/code/core/Mage/Eav/Model/Mysql4/Entity/Attribute/Set.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Mysql4/Entity/Attribute/Set/Collection.php b/app/code/core/Mage/Eav/Model/Mysql4/Entity/Attribute/Set/Collection.php index 8f460d10e9..0ed3fffa41 100644 --- a/app/code/core/Mage/Eav/Model/Mysql4/Entity/Attribute/Set/Collection.php +++ b/app/code/core/Mage/Eav/Model/Mysql4/Entity/Attribute/Set/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Mysql4/Entity/Store.php b/app/code/core/Mage/Eav/Model/Mysql4/Entity/Store.php index 0d32bf0dc4..b834a35e1e 100644 --- a/app/code/core/Mage/Eav/Model/Mysql4/Entity/Store.php +++ b/app/code/core/Mage/Eav/Model/Mysql4/Entity/Store.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Mysql4/Entity/Type.php b/app/code/core/Mage/Eav/Model/Mysql4/Entity/Type.php index ec0f4b6bba..e17da6538e 100644 --- a/app/code/core/Mage/Eav/Model/Mysql4/Entity/Type.php +++ b/app/code/core/Mage/Eav/Model/Mysql4/Entity/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Mysql4/Entity/Type/Collection.php b/app/code/core/Mage/Eav/Model/Mysql4/Entity/Type/Collection.php index 26def99bc8..fd1bb325fd 100644 --- a/app/code/core/Mage/Eav/Model/Mysql4/Entity/Type/Collection.php +++ b/app/code/core/Mage/Eav/Model/Mysql4/Entity/Type/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Mysql4/Form/Element.php b/app/code/core/Mage/Eav/Model/Mysql4/Form/Element.php index 13975a1a88..628722362f 100644 --- a/app/code/core/Mage/Eav/Model/Mysql4/Form/Element.php +++ b/app/code/core/Mage/Eav/Model/Mysql4/Form/Element.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Mysql4/Form/Element/Collection.php b/app/code/core/Mage/Eav/Model/Mysql4/Form/Element/Collection.php index bdb61eb2f6..63b65266f7 100644 --- a/app/code/core/Mage/Eav/Model/Mysql4/Form/Element/Collection.php +++ b/app/code/core/Mage/Eav/Model/Mysql4/Form/Element/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Mysql4/Form/Fieldset.php b/app/code/core/Mage/Eav/Model/Mysql4/Form/Fieldset.php index 24e0cbf172..ebce9444d4 100644 --- a/app/code/core/Mage/Eav/Model/Mysql4/Form/Fieldset.php +++ b/app/code/core/Mage/Eav/Model/Mysql4/Form/Fieldset.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Mysql4/Form/Fieldset/Collection.php b/app/code/core/Mage/Eav/Model/Mysql4/Form/Fieldset/Collection.php index 602102701b..e044c1c509 100644 --- a/app/code/core/Mage/Eav/Model/Mysql4/Form/Fieldset/Collection.php +++ b/app/code/core/Mage/Eav/Model/Mysql4/Form/Fieldset/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Mysql4/Form/Type.php b/app/code/core/Mage/Eav/Model/Mysql4/Form/Type.php index 050ea021ed..15090f4b3b 100644 --- a/app/code/core/Mage/Eav/Model/Mysql4/Form/Type.php +++ b/app/code/core/Mage/Eav/Model/Mysql4/Form/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Mysql4/Form/Type/Collection.php b/app/code/core/Mage/Eav/Model/Mysql4/Form/Type/Collection.php index f3de4528aa..758d95b82f 100644 --- a/app/code/core/Mage/Eav/Model/Mysql4/Form/Type/Collection.php +++ b/app/code/core/Mage/Eav/Model/Mysql4/Form/Type/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Resource/Attribute.php b/app/code/core/Mage/Eav/Model/Resource/Attribute.php index 1a954b53b4..b111bed5a3 100755 --- a/app/code/core/Mage/Eav/Model/Resource/Attribute.php +++ b/app/code/core/Mage/Eav/Model/Resource/Attribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Resource/Attribute/Collection.php b/app/code/core/Mage/Eav/Model/Resource/Attribute/Collection.php index 6883d7580e..6f5ef4e833 100755 --- a/app/code/core/Mage/Eav/Model/Resource/Attribute/Collection.php +++ b/app/code/core/Mage/Eav/Model/Resource/Attribute/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -187,10 +187,10 @@ protected function _initSelect() } /** - * Specify attribute entity type filter - * Entity type is defined + * Specify attribute entity type filter. + * Entity type is defined. * - * @param mixed $type + * @param int $type * @return Mage_Eav_Model_Resource_Attribute_Collection */ public function setEntityTypeFilter($type) diff --git a/app/code/core/Mage/Eav/Model/Resource/Config.php b/app/code/core/Mage/Eav/Model/Resource/Config.php index 26152e5691..e651e0be08 100755 --- a/app/code/core/Mage/Eav/Model/Resource/Config.php +++ b/app/code/core/Mage/Eav/Model/Resource/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute.php b/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute.php index a83ecd0260..9c3bd6c2c9 100755 --- a/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute.php +++ b/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Collection.php b/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Collection.php index bc31613be0..395d950b36 100755 --- a/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Collection.php +++ b/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Group.php b/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Group.php index b77dea7105..2a435b0eb8 100755 --- a/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Group.php +++ b/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Group.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Group/Collection.php b/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Group/Collection.php index 869c9fe9df..6c727512e1 100755 --- a/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Group/Collection.php +++ b/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Group/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Option.php b/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Option.php index 114644f621..85e37e294f 100755 --- a/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Option.php +++ b/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Option.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Option/Collection.php b/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Option/Collection.php index e02af71ccc..70a9dc08c9 100755 --- a/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Option/Collection.php +++ b/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Option/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -101,7 +101,7 @@ public function setStoreFilter($storeId = null, $useDefaultValue = true) ->where('tsv.store_id = ?', $storeId); } - $this->setOrder('tsv.value', self::SORT_ORDER_ASC); + $this->setOrder('value', self::SORT_ORDER_ASC); return $this; } diff --git a/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Set.php b/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Set.php index 4995d47869..42c7367bd4 100755 --- a/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Set.php +++ b/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Set.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Set/Collection.php b/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Set/Collection.php index 84710e93e7..ffc940b67f 100755 --- a/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Set/Collection.php +++ b/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Set/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Resource/Entity/Store.php b/app/code/core/Mage/Eav/Model/Resource/Entity/Store.php index b0a4a7eef7..f00a1b0841 100755 --- a/app/code/core/Mage/Eav/Model/Resource/Entity/Store.php +++ b/app/code/core/Mage/Eav/Model/Resource/Entity/Store.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Resource/Entity/Type.php b/app/code/core/Mage/Eav/Model/Resource/Entity/Type.php index 6084681bdb..c0994d5ba4 100755 --- a/app/code/core/Mage/Eav/Model/Resource/Entity/Type.php +++ b/app/code/core/Mage/Eav/Model/Resource/Entity/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Resource/Entity/Type/Collection.php b/app/code/core/Mage/Eav/Model/Resource/Entity/Type/Collection.php index fd50e54653..4dad84e531 100755 --- a/app/code/core/Mage/Eav/Model/Resource/Entity/Type/Collection.php +++ b/app/code/core/Mage/Eav/Model/Resource/Entity/Type/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Resource/Form/Attribute.php b/app/code/core/Mage/Eav/Model/Resource/Form/Attribute.php index 1b579304a6..2f15ba09e8 100755 --- a/app/code/core/Mage/Eav/Model/Resource/Form/Attribute.php +++ b/app/code/core/Mage/Eav/Model/Resource/Form/Attribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Resource/Form/Attribute/Collection.php b/app/code/core/Mage/Eav/Model/Resource/Form/Attribute/Collection.php index 4ca808000b..0ba68834db 100755 --- a/app/code/core/Mage/Eav/Model/Resource/Form/Attribute/Collection.php +++ b/app/code/core/Mage/Eav/Model/Resource/Form/Attribute/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Resource/Form/Element.php b/app/code/core/Mage/Eav/Model/Resource/Form/Element.php index 2eaf000304..807e36aa47 100755 --- a/app/code/core/Mage/Eav/Model/Resource/Form/Element.php +++ b/app/code/core/Mage/Eav/Model/Resource/Form/Element.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Resource/Form/Element/Collection.php b/app/code/core/Mage/Eav/Model/Resource/Form/Element/Collection.php index 151e910026..e985ea0b2a 100755 --- a/app/code/core/Mage/Eav/Model/Resource/Form/Element/Collection.php +++ b/app/code/core/Mage/Eav/Model/Resource/Form/Element/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Resource/Form/Fieldset.php b/app/code/core/Mage/Eav/Model/Resource/Form/Fieldset.php index 4ee112201c..1d00eda565 100755 --- a/app/code/core/Mage/Eav/Model/Resource/Form/Fieldset.php +++ b/app/code/core/Mage/Eav/Model/Resource/Form/Fieldset.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Resource/Form/Fieldset/Collection.php b/app/code/core/Mage/Eav/Model/Resource/Form/Fieldset/Collection.php index b39225bfd9..f2643b5d86 100755 --- a/app/code/core/Mage/Eav/Model/Resource/Form/Fieldset/Collection.php +++ b/app/code/core/Mage/Eav/Model/Resource/Form/Fieldset/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Resource/Form/Type.php b/app/code/core/Mage/Eav/Model/Resource/Form/Type.php index 86f66b7b4d..23e42fa999 100755 --- a/app/code/core/Mage/Eav/Model/Resource/Form/Type.php +++ b/app/code/core/Mage/Eav/Model/Resource/Form/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Resource/Form/Type/Collection.php b/app/code/core/Mage/Eav/Model/Resource/Form/Type/Collection.php index 2350f42955..68dfe244be 100755 --- a/app/code/core/Mage/Eav/Model/Resource/Form/Type/Collection.php +++ b/app/code/core/Mage/Eav/Model/Resource/Form/Type/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Resource/Helper/Mysql4.php b/app/code/core/Mage/Eav/Model/Resource/Helper/Mysql4.php index a652c6839a..e328656a89 100644 --- a/app/code/core/Mage/Eav/Model/Resource/Helper/Mysql4.php +++ b/app/code/core/Mage/Eav/Model/Resource/Helper/Mysql4.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/etc/config.xml b/app/code/core/Mage/Eav/etc/config.xml index 0468570098..1a0e3fcb8c 100644 --- a/app/code/core/Mage/Eav/etc/config.xml +++ b/app/code/core/Mage/Eav/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Eav/sql/eav_setup/install-1.6.0.0.php b/app/code/core/Mage/Eav/sql/eav_setup/install-1.6.0.0.php index d31768d937..ac615af3e2 100644 --- a/app/code/core/Mage/Eav/sql/eav_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Eav/sql/eav_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-install-0.7.0.php index 20105062e0..4b413bf0e5 100644 --- a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-install-0.7.0.php +++ b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-install-0.7.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.0-0.7.1.php b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.0-0.7.1.php index 91115aecc4..cdd77a93cc 100644 --- a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.0-0.7.1.php +++ b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.0-0.7.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.1-0.7.2.php b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.1-0.7.2.php index c1d9f225ea..e31ea89a9a 100644 --- a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.1-0.7.2.php +++ b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.1-0.7.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.10-0.7.11.php b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.10-0.7.11.php index d550b65125..363c3b44d5 100644 --- a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.10-0.7.11.php +++ b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.10-0.7.11.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.11-0.7.12.php b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.11-0.7.12.php index 006677731c..990d5873fd 100644 --- a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.11-0.7.12.php +++ b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.11-0.7.12.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.12-0.7.13.php b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.12-0.7.13.php index 4d41f34c8c..1ef7f40486 100644 --- a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.12-0.7.13.php +++ b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.12-0.7.13.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.13-0.7.14.php b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.13-0.7.14.php index 257bd527ba..8cb5fcb445 100644 --- a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.13-0.7.14.php +++ b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.13-0.7.14.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.14-0.7.15.php b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.14-0.7.15.php index 890a58754c..2ddd41e280 100644 --- a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.14-0.7.15.php +++ b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.14-0.7.15.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.15-0.7.16.php b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.15-0.7.16.php index d48516f121..b2a3fd989f 100644 --- a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.15-0.7.16.php +++ b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.15-0.7.16.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.2-0.7.3.php b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.2-0.7.3.php index ba4ca73ea4..ee7d38c6f1 100644 --- a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.2-0.7.3.php +++ b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.2-0.7.3.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.3-0.7.4.php b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.3-0.7.4.php index 757265ac67..cca69d98b9 100644 --- a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.3-0.7.4.php +++ b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.3-0.7.4.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.4-0.7.5.php b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.4-0.7.5.php index 3f7a84c247..bdc6fb2bab 100644 --- a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.4-0.7.5.php +++ b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.4-0.7.5.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.5-0.7.6.php b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.5-0.7.6.php index b446d706c9..46ba070be8 100644 --- a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.5-0.7.6.php +++ b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.5-0.7.6.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.6-0.7.7.php b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.6-0.7.7.php index 3733927f8b..7250bb8375 100644 --- a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.6-0.7.7.php +++ b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.6-0.7.7.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.7-0.7.8.php b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.7-0.7.8.php index 6403521318..6672e6588a 100644 --- a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.7-0.7.8.php +++ b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.7-0.7.8.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.8-0.7.9.php b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.8-0.7.9.php index 9207e74d0a..aa813bbdbb 100644 --- a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.8-0.7.9.php +++ b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.8-0.7.9.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.9-0.7.10.php b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.9-0.7.10.php index b0f89935bf..ecd2be9403 100644 --- a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.9-0.7.10.php +++ b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.9-0.7.10.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php index e291ac00bd..46721c52b6 100644 --- a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GiftMessage/Block/Adminhtml/Product/Helper/Form/Config.php b/app/code/core/Mage/GiftMessage/Block/Adminhtml/Product/Helper/Form/Config.php index fbec821c35..e63e3f7711 100644 --- a/app/code/core/Mage/GiftMessage/Block/Adminhtml/Product/Helper/Form/Config.php +++ b/app/code/core/Mage/GiftMessage/Block/Adminhtml/Product/Helper/Form/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GiftMessage/Block/Adminhtml/Sales/Order/Create/Form.php b/app/code/core/Mage/GiftMessage/Block/Adminhtml/Sales/Order/Create/Form.php index cf121368ad..e2bab38b8d 100644 --- a/app/code/core/Mage/GiftMessage/Block/Adminhtml/Sales/Order/Create/Form.php +++ b/app/code/core/Mage/GiftMessage/Block/Adminhtml/Sales/Order/Create/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GiftMessage/Block/Adminhtml/Sales/Order/Create/Giftoptions.php b/app/code/core/Mage/GiftMessage/Block/Adminhtml/Sales/Order/Create/Giftoptions.php index aa68d28548..1b33f576b6 100644 --- a/app/code/core/Mage/GiftMessage/Block/Adminhtml/Sales/Order/Create/Giftoptions.php +++ b/app/code/core/Mage/GiftMessage/Block/Adminhtml/Sales/Order/Create/Giftoptions.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GiftMessage/Block/Adminhtml/Sales/Order/Create/Items.php b/app/code/core/Mage/GiftMessage/Block/Adminhtml/Sales/Order/Create/Items.php index 65f54e7b95..348a59436e 100644 --- a/app/code/core/Mage/GiftMessage/Block/Adminhtml/Sales/Order/Create/Items.php +++ b/app/code/core/Mage/GiftMessage/Block/Adminhtml/Sales/Order/Create/Items.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GiftMessage/Block/Adminhtml/Sales/Order/View/Form.php b/app/code/core/Mage/GiftMessage/Block/Adminhtml/Sales/Order/View/Form.php index a3ddbe355b..5c82141800 100644 --- a/app/code/core/Mage/GiftMessage/Block/Adminhtml/Sales/Order/View/Form.php +++ b/app/code/core/Mage/GiftMessage/Block/Adminhtml/Sales/Order/View/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GiftMessage/Block/Adminhtml/Sales/Order/View/Giftoptions.php b/app/code/core/Mage/GiftMessage/Block/Adminhtml/Sales/Order/View/Giftoptions.php index 1ae7f4cde2..86e57804ac 100644 --- a/app/code/core/Mage/GiftMessage/Block/Adminhtml/Sales/Order/View/Giftoptions.php +++ b/app/code/core/Mage/GiftMessage/Block/Adminhtml/Sales/Order/View/Giftoptions.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GiftMessage/Block/Adminhtml/Sales/Order/View/Items.php b/app/code/core/Mage/GiftMessage/Block/Adminhtml/Sales/Order/View/Items.php index 61aa686244..4fa0684df4 100644 --- a/app/code/core/Mage/GiftMessage/Block/Adminhtml/Sales/Order/View/Items.php +++ b/app/code/core/Mage/GiftMessage/Block/Adminhtml/Sales/Order/View/Items.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GiftMessage/Block/Message/Form.php b/app/code/core/Mage/GiftMessage/Block/Message/Form.php index b728a52ce8..0b43f9f524 100644 --- a/app/code/core/Mage/GiftMessage/Block/Message/Form.php +++ b/app/code/core/Mage/GiftMessage/Block/Message/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GiftMessage/Block/Message/Helper.php b/app/code/core/Mage/GiftMessage/Block/Message/Helper.php index 48eb3147cd..6831feb8fb 100644 --- a/app/code/core/Mage/GiftMessage/Block/Message/Helper.php +++ b/app/code/core/Mage/GiftMessage/Block/Message/Helper.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GiftMessage/Block/Message/Inline.php b/app/code/core/Mage/GiftMessage/Block/Message/Inline.php index a8c01b5727..585e0b90fd 100644 --- a/app/code/core/Mage/GiftMessage/Block/Message/Inline.php +++ b/app/code/core/Mage/GiftMessage/Block/Message/Inline.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GiftMessage/Helper/Data.php b/app/code/core/Mage/GiftMessage/Helper/Data.php index db5be0b396..302035c415 100644 --- a/app/code/core/Mage/GiftMessage/Helper/Data.php +++ b/app/code/core/Mage/GiftMessage/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GiftMessage/Helper/Message.php b/app/code/core/Mage/GiftMessage/Helper/Message.php index bd34c60d4e..743fd5de5c 100644 --- a/app/code/core/Mage/GiftMessage/Helper/Message.php +++ b/app/code/core/Mage/GiftMessage/Helper/Message.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GiftMessage/Helper/Url.php b/app/code/core/Mage/GiftMessage/Helper/Url.php index 60f7cd9301..347b89c8e8 100644 --- a/app/code/core/Mage/GiftMessage/Helper/Url.php +++ b/app/code/core/Mage/GiftMessage/Helper/Url.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GiftMessage/Model/Api.php b/app/code/core/Mage/GiftMessage/Model/Api.php index c444913e1b..cf0f0d275a 100644 --- a/app/code/core/Mage/GiftMessage/Model/Api.php +++ b/app/code/core/Mage/GiftMessage/Model/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GiftMessage/Model/Api/V2.php b/app/code/core/Mage/GiftMessage/Model/Api/V2.php index 62c9d32216..f90d06a1a2 100644 --- a/app/code/core/Mage/GiftMessage/Model/Api/V2.php +++ b/app/code/core/Mage/GiftMessage/Model/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GiftMessage/Model/Entity/Attribute/Backend/Boolean/Config.php b/app/code/core/Mage/GiftMessage/Model/Entity/Attribute/Backend/Boolean/Config.php index be091c320d..ee02445f43 100644 --- a/app/code/core/Mage/GiftMessage/Model/Entity/Attribute/Backend/Boolean/Config.php +++ b/app/code/core/Mage/GiftMessage/Model/Entity/Attribute/Backend/Boolean/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GiftMessage/Model/Entity/Attribute/Source/Boolean/Config.php b/app/code/core/Mage/GiftMessage/Model/Entity/Attribute/Source/Boolean/Config.php index 1e19bb589f..69714770e0 100644 --- a/app/code/core/Mage/GiftMessage/Model/Entity/Attribute/Source/Boolean/Config.php +++ b/app/code/core/Mage/GiftMessage/Model/Entity/Attribute/Source/Boolean/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GiftMessage/Model/Message.php b/app/code/core/Mage/GiftMessage/Model/Message.php index 031d36ec25..1586bba856 100644 --- a/app/code/core/Mage/GiftMessage/Model/Message.php +++ b/app/code/core/Mage/GiftMessage/Model/Message.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GiftMessage/Model/Mysql4/Message.php b/app/code/core/Mage/GiftMessage/Model/Mysql4/Message.php index 37fdb9d222..c046e89b21 100644 --- a/app/code/core/Mage/GiftMessage/Model/Mysql4/Message.php +++ b/app/code/core/Mage/GiftMessage/Model/Mysql4/Message.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GiftMessage/Model/Mysql4/Message/Collection.php b/app/code/core/Mage/GiftMessage/Model/Mysql4/Message/Collection.php index 4d02befac5..38deb1e6ac 100644 --- a/app/code/core/Mage/GiftMessage/Model/Mysql4/Message/Collection.php +++ b/app/code/core/Mage/GiftMessage/Model/Mysql4/Message/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GiftMessage/Model/Mysql4/Setup.php b/app/code/core/Mage/GiftMessage/Model/Mysql4/Setup.php index 45558f511d..a86319d9af 100644 --- a/app/code/core/Mage/GiftMessage/Model/Mysql4/Setup.php +++ b/app/code/core/Mage/GiftMessage/Model/Mysql4/Setup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GiftMessage/Model/Observer.php b/app/code/core/Mage/GiftMessage/Model/Observer.php index fabd9288a5..72c1cef9a8 100644 --- a/app/code/core/Mage/GiftMessage/Model/Observer.php +++ b/app/code/core/Mage/GiftMessage/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GiftMessage/Model/Resource/Message.php b/app/code/core/Mage/GiftMessage/Model/Resource/Message.php index 75067bebca..a96583b564 100755 --- a/app/code/core/Mage/GiftMessage/Model/Resource/Message.php +++ b/app/code/core/Mage/GiftMessage/Model/Resource/Message.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GiftMessage/Model/Resource/Message/Collection.php b/app/code/core/Mage/GiftMessage/Model/Resource/Message/Collection.php index b63b414636..2f54b5f874 100755 --- a/app/code/core/Mage/GiftMessage/Model/Resource/Message/Collection.php +++ b/app/code/core/Mage/GiftMessage/Model/Resource/Message/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GiftMessage/Model/Resource/Setup.php b/app/code/core/Mage/GiftMessage/Model/Resource/Setup.php index f5f4560d64..b75bed35cc 100755 --- a/app/code/core/Mage/GiftMessage/Model/Resource/Setup.php +++ b/app/code/core/Mage/GiftMessage/Model/Resource/Setup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GiftMessage/controllers/IndexController.php b/app/code/core/Mage/GiftMessage/controllers/IndexController.php index 938c66188e..e923bd4c8b 100644 --- a/app/code/core/Mage/GiftMessage/controllers/IndexController.php +++ b/app/code/core/Mage/GiftMessage/controllers/IndexController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GiftMessage/etc/api.xml b/app/code/core/Mage/GiftMessage/etc/api.xml index 955ea21876..3085891d9f 100644 --- a/app/code/core/Mage/GiftMessage/etc/api.xml +++ b/app/code/core/Mage/GiftMessage/etc/api.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/GiftMessage/etc/config.xml b/app/code/core/Mage/GiftMessage/etc/config.xml index f7b5b90893..3f08e3ce73 100644 --- a/app/code/core/Mage/GiftMessage/etc/config.xml +++ b/app/code/core/Mage/GiftMessage/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/GiftMessage/etc/system.xml b/app/code/core/Mage/GiftMessage/etc/system.xml index 90e14b2b1b..5e9f1893ef 100644 --- a/app/code/core/Mage/GiftMessage/etc/system.xml +++ b/app/code/core/Mage/GiftMessage/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/install-1.6.0.0.php b/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/install-1.6.0.0.php index 820c558b50..cf409a2658 100644 --- a/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-install-0.7.0.php index 796fe48cab..48b47911f1 100644 --- a/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-install-0.7.0.php +++ b/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-install-0.7.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-0.1.3-0.7.0.php b/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-0.1.3-0.7.0.php index 63847e559c..79b2635ec9 100644 --- a/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-0.1.3-0.7.0.php +++ b/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-0.1.3-0.7.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ $this->startSetup() diff --git a/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-0.7.0-0.7.1.php b/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-0.7.0-0.7.1.php index a0cb1e93cb..15679d323e 100644 --- a/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-0.7.0-0.7.1.php +++ b/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-0.7.0-0.7.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-0.7.1-0.7.2.php b/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-0.7.1-0.7.2.php index 495b8fd1ec..dca329db16 100644 --- a/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-0.7.1-0.7.2.php +++ b/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-0.7.1-0.7.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-0.7.2-0.7.3.php b/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-0.7.2-0.7.3.php index 6ba6d46ff1..677ef16ba5 100644 --- a/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-0.7.2-0.7.3.php +++ b/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-0.7.2-0.7.3.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-0.7.3-0.7.4.php b/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-0.7.3-0.7.4.php index ae0c9fe8cc..2917775716 100644 --- a/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-0.7.3-0.7.4.php +++ b/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-0.7.3-0.7.4.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-0.7.4-0.7.5.php b/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-0.7.4-0.7.5.php index 91cbebd9a4..735d7a6cdd 100644 --- a/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-0.7.4-0.7.5.php +++ b/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-0.7.4-0.7.5.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-0.7.5-0.7.6.php b/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-0.7.5-0.7.6.php index 0e9744859d..5780518191 100644 --- a/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-0.7.5-0.7.6.php +++ b/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-0.7.5-0.7.6.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php index e6755c77fb..3c91bac47f 100644 --- a/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ b/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleAnalytics/Block/Ga.php b/app/code/core/Mage/GoogleAnalytics/Block/Ga.php index beaf7a538b..c2d4ad0db2 100644 --- a/app/code/core/Mage/GoogleAnalytics/Block/Ga.php +++ b/app/code/core/Mage/GoogleAnalytics/Block/Ga.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleAnalytics - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleAnalytics/Helper/Data.php b/app/code/core/Mage/GoogleAnalytics/Helper/Data.php index bc988e3b11..0c7c044b08 100644 --- a/app/code/core/Mage/GoogleAnalytics/Helper/Data.php +++ b/app/code/core/Mage/GoogleAnalytics/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleAnalytics - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleAnalytics/Model/Observer.php b/app/code/core/Mage/GoogleAnalytics/Model/Observer.php index b0c645b252..3a02c448bf 100644 --- a/app/code/core/Mage/GoogleAnalytics/Model/Observer.php +++ b/app/code/core/Mage/GoogleAnalytics/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleAnalytics - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleAnalytics/etc/adminhtml.xml b/app/code/core/Mage/GoogleAnalytics/etc/adminhtml.xml index aa55a986f6..c44050431c 100644 --- a/app/code/core/Mage/GoogleAnalytics/etc/adminhtml.xml +++ b/app/code/core/Mage/GoogleAnalytics/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_GoogleAnalytics - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/GoogleAnalytics/etc/config.xml b/app/code/core/Mage/GoogleAnalytics/etc/config.xml index 9dc495e591..32a2671b54 100644 --- a/app/code/core/Mage/GoogleAnalytics/etc/config.xml +++ b/app/code/core/Mage/GoogleAnalytics/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_GoogleAnalytics - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/GoogleAnalytics/etc/system.xml b/app/code/core/Mage/GoogleAnalytics/etc/system.xml index 48e034a3e6..35313b4af4 100644 --- a/app/code/core/Mage/GoogleAnalytics/etc/system.xml +++ b/app/code/core/Mage/GoogleAnalytics/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_GoogleAnalytics - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/GoogleBase/Block/Adminhtml/Captcha.php b/app/code/core/Mage/GoogleBase/Block/Adminhtml/Captcha.php index a278708f26..a70c9142c0 100644 --- a/app/code/core/Mage/GoogleBase/Block/Adminhtml/Captcha.php +++ b/app/code/core/Mage/GoogleBase/Block/Adminhtml/Captcha.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleBase - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleBase/Block/Adminhtml/Items.php b/app/code/core/Mage/GoogleBase/Block/Adminhtml/Items.php index 43abb68b12..12259aab38 100644 --- a/app/code/core/Mage/GoogleBase/Block/Adminhtml/Items.php +++ b/app/code/core/Mage/GoogleBase/Block/Adminhtml/Items.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleBase - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleBase/Block/Adminhtml/Items/Item.php b/app/code/core/Mage/GoogleBase/Block/Adminhtml/Items/Item.php index 71aeaabf19..40c375f98e 100644 --- a/app/code/core/Mage/GoogleBase/Block/Adminhtml/Items/Item.php +++ b/app/code/core/Mage/GoogleBase/Block/Adminhtml/Items/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleBase - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleBase/Block/Adminhtml/Items/Product.php b/app/code/core/Mage/GoogleBase/Block/Adminhtml/Items/Product.php index 1dd0601e6b..a14f9ff013 100644 --- a/app/code/core/Mage/GoogleBase/Block/Adminhtml/Items/Product.php +++ b/app/code/core/Mage/GoogleBase/Block/Adminhtml/Items/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleBase - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleBase/Block/Adminhtml/Items/Renderer/Id.php b/app/code/core/Mage/GoogleBase/Block/Adminhtml/Items/Renderer/Id.php index e0fd55b668..1ed409b573 100644 --- a/app/code/core/Mage/GoogleBase/Block/Adminhtml/Items/Renderer/Id.php +++ b/app/code/core/Mage/GoogleBase/Block/Adminhtml/Items/Renderer/Id.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleBase - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleBase/Block/Adminhtml/Store/Switcher.php b/app/code/core/Mage/GoogleBase/Block/Adminhtml/Store/Switcher.php index 409cd4232d..c55efa8217 100644 --- a/app/code/core/Mage/GoogleBase/Block/Adminhtml/Store/Switcher.php +++ b/app/code/core/Mage/GoogleBase/Block/Adminhtml/Store/Switcher.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleBase - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleBase/Block/Adminhtml/Types.php b/app/code/core/Mage/GoogleBase/Block/Adminhtml/Types.php index f07108391e..c2fb6a9c92 100644 --- a/app/code/core/Mage/GoogleBase/Block/Adminhtml/Types.php +++ b/app/code/core/Mage/GoogleBase/Block/Adminhtml/Types.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleBase - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleBase/Block/Adminhtml/Types/Edit.php b/app/code/core/Mage/GoogleBase/Block/Adminhtml/Types/Edit.php index 5b246e234b..a19cb6794e 100644 --- a/app/code/core/Mage/GoogleBase/Block/Adminhtml/Types/Edit.php +++ b/app/code/core/Mage/GoogleBase/Block/Adminhtml/Types/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleBase - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleBase/Block/Adminhtml/Types/Edit/Attributes.php b/app/code/core/Mage/GoogleBase/Block/Adminhtml/Types/Edit/Attributes.php index c675b4c15c..691722d8e7 100644 --- a/app/code/core/Mage/GoogleBase/Block/Adminhtml/Types/Edit/Attributes.php +++ b/app/code/core/Mage/GoogleBase/Block/Adminhtml/Types/Edit/Attributes.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleBase - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleBase/Block/Adminhtml/Types/Edit/Form.php b/app/code/core/Mage/GoogleBase/Block/Adminhtml/Types/Edit/Form.php index a7426c335f..e8ef52db75 100644 --- a/app/code/core/Mage/GoogleBase/Block/Adminhtml/Types/Edit/Form.php +++ b/app/code/core/Mage/GoogleBase/Block/Adminhtml/Types/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleBase - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleBase/Block/Adminhtml/Types/Grid.php b/app/code/core/Mage/GoogleBase/Block/Adminhtml/Types/Grid.php index b697e539da..303762a438 100644 --- a/app/code/core/Mage/GoogleBase/Block/Adminhtml/Types/Grid.php +++ b/app/code/core/Mage/GoogleBase/Block/Adminhtml/Types/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleBase - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleBase/Block/Adminhtml/Types/Renderer/Country.php b/app/code/core/Mage/GoogleBase/Block/Adminhtml/Types/Renderer/Country.php index c569b4fb2d..ee53e59c69 100644 --- a/app/code/core/Mage/GoogleBase/Block/Adminhtml/Types/Renderer/Country.php +++ b/app/code/core/Mage/GoogleBase/Block/Adminhtml/Types/Renderer/Country.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleBase - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleBase/Helper/Data.php b/app/code/core/Mage/GoogleBase/Helper/Data.php index 7ae7c11957..5ed90fbda7 100644 --- a/app/code/core/Mage/GoogleBase/Helper/Data.php +++ b/app/code/core/Mage/GoogleBase/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleBase - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleBase/Model/Attribute.php b/app/code/core/Mage/GoogleBase/Model/Attribute.php index eab2bf953f..9fbc74f568 100644 --- a/app/code/core/Mage/GoogleBase/Model/Attribute.php +++ b/app/code/core/Mage/GoogleBase/Model/Attribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleBase - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleBase/Model/Config.php b/app/code/core/Mage/GoogleBase/Model/Config.php index 753b86e60e..120fc4fa8c 100644 --- a/app/code/core/Mage/GoogleBase/Model/Config.php +++ b/app/code/core/Mage/GoogleBase/Model/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleBase - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleBase/Model/Item.php b/app/code/core/Mage/GoogleBase/Model/Item.php index 7fb2170f3f..81b569b430 100644 --- a/app/code/core/Mage/GoogleBase/Model/Item.php +++ b/app/code/core/Mage/GoogleBase/Model/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleBase - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleBase/Model/Mysql4/Attribute.php b/app/code/core/Mage/GoogleBase/Model/Mysql4/Attribute.php index 8846a796a3..12496fcc32 100644 --- a/app/code/core/Mage/GoogleBase/Model/Mysql4/Attribute.php +++ b/app/code/core/Mage/GoogleBase/Model/Mysql4/Attribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleBase - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleBase/Model/Mysql4/Attribute/Collection.php b/app/code/core/Mage/GoogleBase/Model/Mysql4/Attribute/Collection.php index 3047ff99a6..82e72eeeaf 100644 --- a/app/code/core/Mage/GoogleBase/Model/Mysql4/Attribute/Collection.php +++ b/app/code/core/Mage/GoogleBase/Model/Mysql4/Attribute/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleBase - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleBase/Model/Mysql4/Item.php b/app/code/core/Mage/GoogleBase/Model/Mysql4/Item.php index 0755730899..c4f0de7ff2 100644 --- a/app/code/core/Mage/GoogleBase/Model/Mysql4/Item.php +++ b/app/code/core/Mage/GoogleBase/Model/Mysql4/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleBase - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleBase/Model/Mysql4/Item/Collection.php b/app/code/core/Mage/GoogleBase/Model/Mysql4/Item/Collection.php index 6fa9a7cf83..d24f5d85ee 100644 --- a/app/code/core/Mage/GoogleBase/Model/Mysql4/Item/Collection.php +++ b/app/code/core/Mage/GoogleBase/Model/Mysql4/Item/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleBase - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleBase/Model/Mysql4/Type.php b/app/code/core/Mage/GoogleBase/Model/Mysql4/Type.php index 048c048ab5..4c88f6bd54 100644 --- a/app/code/core/Mage/GoogleBase/Model/Mysql4/Type.php +++ b/app/code/core/Mage/GoogleBase/Model/Mysql4/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleBase - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleBase/Model/Mysql4/Type/Collection.php b/app/code/core/Mage/GoogleBase/Model/Mysql4/Type/Collection.php index ba2e43d8db..baef932a39 100644 --- a/app/code/core/Mage/GoogleBase/Model/Mysql4/Type/Collection.php +++ b/app/code/core/Mage/GoogleBase/Model/Mysql4/Type/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleBase - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleBase/Model/Observer.php b/app/code/core/Mage/GoogleBase/Model/Observer.php index 2b36d27931..eacbf9a218 100644 --- a/app/code/core/Mage/GoogleBase/Model/Observer.php +++ b/app/code/core/Mage/GoogleBase/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleBase - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleBase/Model/Resource/Attribute.php b/app/code/core/Mage/GoogleBase/Model/Resource/Attribute.php index 279bf23841..53b5ed5599 100755 --- a/app/code/core/Mage/GoogleBase/Model/Resource/Attribute.php +++ b/app/code/core/Mage/GoogleBase/Model/Resource/Attribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleBase - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleBase/Model/Resource/Attribute/Collection.php b/app/code/core/Mage/GoogleBase/Model/Resource/Attribute/Collection.php index 9386765994..b2bed6a2f6 100755 --- a/app/code/core/Mage/GoogleBase/Model/Resource/Attribute/Collection.php +++ b/app/code/core/Mage/GoogleBase/Model/Resource/Attribute/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleBase - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleBase/Model/Resource/Item.php b/app/code/core/Mage/GoogleBase/Model/Resource/Item.php index f9c8fbe8c6..9ca3d22d49 100755 --- a/app/code/core/Mage/GoogleBase/Model/Resource/Item.php +++ b/app/code/core/Mage/GoogleBase/Model/Resource/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleBase - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleBase/Model/Resource/Item/Collection.php b/app/code/core/Mage/GoogleBase/Model/Resource/Item/Collection.php index d156a0aadd..1d8f5338e6 100755 --- a/app/code/core/Mage/GoogleBase/Model/Resource/Item/Collection.php +++ b/app/code/core/Mage/GoogleBase/Model/Resource/Item/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleBase - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleBase/Model/Resource/Type.php b/app/code/core/Mage/GoogleBase/Model/Resource/Type.php index 847ff75f36..6809901e66 100755 --- a/app/code/core/Mage/GoogleBase/Model/Resource/Type.php +++ b/app/code/core/Mage/GoogleBase/Model/Resource/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleBase - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleBase/Model/Resource/Type/Collection.php b/app/code/core/Mage/GoogleBase/Model/Resource/Type/Collection.php index 7711e67ddf..eb8680756d 100755 --- a/app/code/core/Mage/GoogleBase/Model/Resource/Type/Collection.php +++ b/app/code/core/Mage/GoogleBase/Model/Resource/Type/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleBase - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleBase/Model/Service.php b/app/code/core/Mage/GoogleBase/Model/Service.php index deb998be36..f6064f919c 100644 --- a/app/code/core/Mage/GoogleBase/Model/Service.php +++ b/app/code/core/Mage/GoogleBase/Model/Service.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleBase - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleBase/Model/Service/Feed.php b/app/code/core/Mage/GoogleBase/Model/Service/Feed.php index 5a4968029e..c9b3169ed4 100644 --- a/app/code/core/Mage/GoogleBase/Model/Service/Feed.php +++ b/app/code/core/Mage/GoogleBase/Model/Service/Feed.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleBase - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleBase/Model/Service/Item.php b/app/code/core/Mage/GoogleBase/Model/Service/Item.php index f79957334d..7ac4e6ec8b 100644 --- a/app/code/core/Mage/GoogleBase/Model/Service/Item.php +++ b/app/code/core/Mage/GoogleBase/Model/Service/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleBase - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleBase/Model/Source/Accounttype.php b/app/code/core/Mage/GoogleBase/Model/Source/Accounttype.php index d483531766..4f6c45e766 100644 --- a/app/code/core/Mage/GoogleBase/Model/Source/Accounttype.php +++ b/app/code/core/Mage/GoogleBase/Model/Source/Accounttype.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleBase - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleBase/Model/Source/Authtype.php b/app/code/core/Mage/GoogleBase/Model/Source/Authtype.php index 4b049e4bcf..9db0941b4f 100644 --- a/app/code/core/Mage/GoogleBase/Model/Source/Authtype.php +++ b/app/code/core/Mage/GoogleBase/Model/Source/Authtype.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleBase - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleBase/Model/Source/Country.php b/app/code/core/Mage/GoogleBase/Model/Source/Country.php index e19e6eab32..3e4ec04017 100644 --- a/app/code/core/Mage/GoogleBase/Model/Source/Country.php +++ b/app/code/core/Mage/GoogleBase/Model/Source/Country.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleBase - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleBase/Model/Source/Statuses.php b/app/code/core/Mage/GoogleBase/Model/Source/Statuses.php index 44d68cb5e3..0a1d59a953 100644 --- a/app/code/core/Mage/GoogleBase/Model/Source/Statuses.php +++ b/app/code/core/Mage/GoogleBase/Model/Source/Statuses.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleBase - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleBase/Model/Type.php b/app/code/core/Mage/GoogleBase/Model/Type.php index c9d57fe18f..906e39cee1 100644 --- a/app/code/core/Mage/GoogleBase/Model/Type.php +++ b/app/code/core/Mage/GoogleBase/Model/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleBase - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleBase/controllers/Adminhtml/Googlebase/ItemsController.php b/app/code/core/Mage/GoogleBase/controllers/Adminhtml/Googlebase/ItemsController.php index cff64df43c..c3e2a82b47 100755 --- a/app/code/core/Mage/GoogleBase/controllers/Adminhtml/Googlebase/ItemsController.php +++ b/app/code/core/Mage/GoogleBase/controllers/Adminhtml/Googlebase/ItemsController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleBase - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleBase/controllers/Adminhtml/Googlebase/SelectionController.php b/app/code/core/Mage/GoogleBase/controllers/Adminhtml/Googlebase/SelectionController.php index ed362a8d5f..6f72511dfc 100755 --- a/app/code/core/Mage/GoogleBase/controllers/Adminhtml/Googlebase/SelectionController.php +++ b/app/code/core/Mage/GoogleBase/controllers/Adminhtml/Googlebase/SelectionController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleBase - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleBase/controllers/Adminhtml/Googlebase/TypesController.php b/app/code/core/Mage/GoogleBase/controllers/Adminhtml/Googlebase/TypesController.php index 2fba490bec..ba5611e30f 100755 --- a/app/code/core/Mage/GoogleBase/controllers/Adminhtml/Googlebase/TypesController.php +++ b/app/code/core/Mage/GoogleBase/controllers/Adminhtml/Googlebase/TypesController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleBase - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleBase/controllers/ItemsController.php b/app/code/core/Mage/GoogleBase/controllers/ItemsController.php index cf2ec99218..1ce0d76518 100644 --- a/app/code/core/Mage/GoogleBase/controllers/ItemsController.php +++ b/app/code/core/Mage/GoogleBase/controllers/ItemsController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleBase - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleBase/controllers/SelectionController.php b/app/code/core/Mage/GoogleBase/controllers/SelectionController.php index dc5cf26a43..79de46af00 100644 --- a/app/code/core/Mage/GoogleBase/controllers/SelectionController.php +++ b/app/code/core/Mage/GoogleBase/controllers/SelectionController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleBase - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleBase/controllers/TypesController.php b/app/code/core/Mage/GoogleBase/controllers/TypesController.php index 3043cfd1ce..704a109454 100644 --- a/app/code/core/Mage/GoogleBase/controllers/TypesController.php +++ b/app/code/core/Mage/GoogleBase/controllers/TypesController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleBase - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleBase/etc/adminhtml.xml b/app/code/core/Mage/GoogleBase/etc/adminhtml.xml index f0c80a2266..c3bab5c809 100644 --- a/app/code/core/Mage/GoogleBase/etc/adminhtml.xml +++ b/app/code/core/Mage/GoogleBase/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_GoogleBase - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/GoogleBase/etc/config.xml b/app/code/core/Mage/GoogleBase/etc/config.xml index 85c82997b4..ad7b9a63ea 100644 --- a/app/code/core/Mage/GoogleBase/etc/config.xml +++ b/app/code/core/Mage/GoogleBase/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_GoogleBase - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/GoogleBase/etc/system.xml b/app/code/core/Mage/GoogleBase/etc/system.xml index ffa9a6d672..94df1a9e35 100644 --- a/app/code/core/Mage/GoogleBase/etc/system.xml +++ b/app/code/core/Mage/GoogleBase/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_GoogleBase - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/GoogleBase/sql/googlebase_setup/install-1.6.0.0.php b/app/code/core/Mage/GoogleBase/sql/googlebase_setup/install-1.6.0.0.php index 69ac4a5287..fc87451a0f 100644 --- a/app/code/core/Mage/GoogleBase/sql/googlebase_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/GoogleBase/sql/googlebase_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleBase - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleBase/sql/googlebase_setup/mysql4-install-0.1.0.php b/app/code/core/Mage/GoogleBase/sql/googlebase_setup/mysql4-install-0.1.0.php index 1f1e46bda7..e47b7edeea 100644 --- a/app/code/core/Mage/GoogleBase/sql/googlebase_setup/mysql4-install-0.1.0.php +++ b/app/code/core/Mage/GoogleBase/sql/googlebase_setup/mysql4-install-0.1.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleBase - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleBase/sql/googlebase_setup/mysql4-upgrade-0.1.0-0.1.1.php b/app/code/core/Mage/GoogleBase/sql/googlebase_setup/mysql4-upgrade-0.1.0-0.1.1.php index b0239d00a6..2b6514c2c9 100644 --- a/app/code/core/Mage/GoogleBase/sql/googlebase_setup/mysql4-upgrade-0.1.0-0.1.1.php +++ b/app/code/core/Mage/GoogleBase/sql/googlebase_setup/mysql4-upgrade-0.1.0-0.1.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleBase - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleBase/sql/googlebase_setup/mysql4-upgrade-0.1.1-0.1.2.php b/app/code/core/Mage/GoogleBase/sql/googlebase_setup/mysql4-upgrade-0.1.1-0.1.2.php index fdaad09c15..4a8917d3b0 100644 --- a/app/code/core/Mage/GoogleBase/sql/googlebase_setup/mysql4-upgrade-0.1.1-0.1.2.php +++ b/app/code/core/Mage/GoogleBase/sql/googlebase_setup/mysql4-upgrade-0.1.1-0.1.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleBase - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleBase/sql/googlebase_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/GoogleBase/sql/googlebase_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php index a36142bbe9..fe446df904 100644 --- a/app/code/core/Mage/GoogleBase/sql/googlebase_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ b/app/code/core/Mage/GoogleBase/sql/googlebase_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleBase - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/Block/Adminhtml/Shipping/Applicable/Countries.php b/app/code/core/Mage/GoogleCheckout/Block/Adminhtml/Shipping/Applicable/Countries.php index 44c8143f27..576e03ff8a 100644 --- a/app/code/core/Mage/GoogleCheckout/Block/Adminhtml/Shipping/Applicable/Countries.php +++ b/app/code/core/Mage/GoogleCheckout/Block/Adminhtml/Shipping/Applicable/Countries.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/Block/Adminhtml/Shipping/Merchant.php b/app/code/core/Mage/GoogleCheckout/Block/Adminhtml/Shipping/Merchant.php index a55fbebbab..0a2d9b310f 100644 --- a/app/code/core/Mage/GoogleCheckout/Block/Adminhtml/Shipping/Merchant.php +++ b/app/code/core/Mage/GoogleCheckout/Block/Adminhtml/Shipping/Merchant.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/Block/Form.php b/app/code/core/Mage/GoogleCheckout/Block/Form.php index acf29bb8be..ffef645ac5 100644 --- a/app/code/core/Mage/GoogleCheckout/Block/Form.php +++ b/app/code/core/Mage/GoogleCheckout/Block/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/Block/Link.php b/app/code/core/Mage/GoogleCheckout/Block/Link.php index 3ed2392c22..1f419b9100 100644 --- a/app/code/core/Mage/GoogleCheckout/Block/Link.php +++ b/app/code/core/Mage/GoogleCheckout/Block/Link.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/Block/Redirect.php b/app/code/core/Mage/GoogleCheckout/Block/Redirect.php index 71f735f591..f9b65758f5 100644 --- a/app/code/core/Mage/GoogleCheckout/Block/Redirect.php +++ b/app/code/core/Mage/GoogleCheckout/Block/Redirect.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/Exception.php b/app/code/core/Mage/GoogleCheckout/Exception.php index 4eac7748c1..208c1dcc8d 100644 --- a/app/code/core/Mage/GoogleCheckout/Exception.php +++ b/app/code/core/Mage/GoogleCheckout/Exception.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/Helper/Data.php b/app/code/core/Mage/GoogleCheckout/Helper/Data.php index 674a4c2933..d422bd2ed4 100644 --- a/app/code/core/Mage/GoogleCheckout/Helper/Data.php +++ b/app/code/core/Mage/GoogleCheckout/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/Model/Api.php b/app/code/core/Mage/GoogleCheckout/Model/Api.php index 8a1c3a96ea..74deba2aad 100644 --- a/app/code/core/Mage/GoogleCheckout/Model/Api.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/Model/Api/Debug.php b/app/code/core/Mage/GoogleCheckout/Model/Api/Debug.php index b094321077..9dc5f5022c 100644 --- a/app/code/core/Mage/GoogleCheckout/Model/Api/Debug.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Api/Debug.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/Model/Api/Xml/Abstract.php b/app/code/core/Mage/GoogleCheckout/Model/Api/Xml/Abstract.php index c4ae8a80df..51a1d4030b 100644 --- a/app/code/core/Mage/GoogleCheckout/Model/Api/Xml/Abstract.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Api/Xml/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/Model/Api/Xml/Calculate.php b/app/code/core/Mage/GoogleCheckout/Model/Api/Xml/Calculate.php index c8f9a92fb4..5cf439b226 100644 --- a/app/code/core/Mage/GoogleCheckout/Model/Api/Xml/Calculate.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Api/Xml/Calculate.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/Model/Api/Xml/Callback.php b/app/code/core/Mage/GoogleCheckout/Model/Api/Xml/Callback.php index 05bf02c7d6..41620750c4 100644 --- a/app/code/core/Mage/GoogleCheckout/Model/Api/Xml/Callback.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Api/Xml/Callback.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -679,10 +679,7 @@ protected function _importGoogleTotals($qAddress) if (null !== ($shipping = $this->getData($prefix . 'carrier-calculated-shipping-adjustment'))) { $method = 'googlecheckout_carrier'; } else if (null !== ($shipping = $this->getData($prefix . 'merchant-calculated-shipping-adjustment'))) { - $method = $this->_getShippingMethodByName($shipping['shipping-name']['VALUE']); - if ($method === false) { - $method = 'googlecheckout_merchant'; - } + $method = 'googlecheckout_merchant'; } else if (null !== ($shipping = $this->getData($prefix . 'flat-rate-shipping-adjustment'))) { $method = 'googlecheckout_flatrate'; } else if (null !== ($shipping = $this->getData($prefix . 'pickup-shipping-adjustment'))) { @@ -792,8 +789,11 @@ protected function _responseAuthorizationAmountNotification() $order->addStatusToHistory($order->getStatus(), $msg); $order->setPaymentAuthorizationAmount($payment->getAmountAuthorized()); + $timestamp = Mage::getModel('core/date')->gmtTimestamp( + $this->getData('root/authorization-expiration-date/VALUE') + ); $order->setPaymentAuthorizationExpiration( - Mage::getModel('core/date')->gmtTimestamp($this->getData('root/authorization-expiration-date/VALUE')) + $timestamp ? $timestamp : Mage::getModel('core/date')->gmtTimestamp() ); $order->save(); diff --git a/app/code/core/Mage/GoogleCheckout/Model/Api/Xml/Checkout.php b/app/code/core/Mage/GoogleCheckout/Model/Api/Xml/Checkout.php index 3aa11ff685..b087b24fd7 100644 --- a/app/code/core/Mage/GoogleCheckout/Model/Api/Xml/Checkout.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Api/Xml/Checkout.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/Model/Api/Xml/Order.php b/app/code/core/Mage/GoogleCheckout/Model/Api/Xml/Order.php index 00e5c45853..bc2a651d03 100644 --- a/app/code/core/Mage/GoogleCheckout/Model/Api/Xml/Order.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Api/Xml/Order.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/Model/Mysql4/Api/Debug.php b/app/code/core/Mage/GoogleCheckout/Model/Mysql4/Api/Debug.php index 2fddaf725d..92018ebe70 100644 --- a/app/code/core/Mage/GoogleCheckout/Model/Mysql4/Api/Debug.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Mysql4/Api/Debug.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/Model/Mysql4/Api/Debug/Collection.php b/app/code/core/Mage/GoogleCheckout/Model/Mysql4/Api/Debug/Collection.php index 7f3767307d..1d7c99104a 100644 --- a/app/code/core/Mage/GoogleCheckout/Model/Mysql4/Api/Debug/Collection.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Mysql4/Api/Debug/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/Model/Mysql4/Notification.php b/app/code/core/Mage/GoogleCheckout/Model/Mysql4/Notification.php index 755a18b5d4..f7d2a93dc8 100644 --- a/app/code/core/Mage/GoogleCheckout/Model/Mysql4/Notification.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Mysql4/Notification.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/Model/Mysql4/Setup.php b/app/code/core/Mage/GoogleCheckout/Model/Mysql4/Setup.php index 775b594dca..215ad79f62 100644 --- a/app/code/core/Mage/GoogleCheckout/Model/Mysql4/Setup.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Mysql4/Setup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/Model/Mysql4/Tax.php b/app/code/core/Mage/GoogleCheckout/Model/Mysql4/Tax.php index a427b069ce..1d0064fed1 100644 --- a/app/code/core/Mage/GoogleCheckout/Model/Mysql4/Tax.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Mysql4/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/Model/Notification.php b/app/code/core/Mage/GoogleCheckout/Model/Notification.php index 4ec2cbfc87..6a0647e4d1 100644 --- a/app/code/core/Mage/GoogleCheckout/Model/Notification.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Notification.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/Model/Observer.php b/app/code/core/Mage/GoogleCheckout/Model/Observer.php index 251de42903..8070c84eac 100644 --- a/app/code/core/Mage/GoogleCheckout/Model/Observer.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -38,8 +38,20 @@ public function salesOrderShipmentTrackSaveAfter(Varien_Event_Observer $observer $track = $observer->getEvent()->getTrack(); $order = $track->getShipment()->getOrder(); + $shippingMethod = $order->getShippingMethod(); // String in format of 'carrier_method' + if (!$shippingMethod) { + return; + } - if ($order->getShippingMethod()!='googlecheckout_carrier') { + // Process only Google Checkout internal methods + /* @var $gcCarrier Mage_GoogleCheckout_Model_Shipping */ + $gcCarrier = Mage::getModel('googlecheckout/shipping'); + list($carrierCode, $methodCode) = explode('_', $shippingMethod); + if ($gcCarrier->getCarrierCode() != $carrierCode) { + return; + } + $internalMethods = $gcCarrier->getInternallyAllowedMethods(); + if (!isset($internalMethods[$methodCode])) { return; } diff --git a/app/code/core/Mage/GoogleCheckout/Model/Payment.php b/app/code/core/Mage/GoogleCheckout/Model/Payment.php index c944b0c847..28dfd8c73a 100644 --- a/app/code/core/Mage/GoogleCheckout/Model/Payment.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Payment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/Model/Resource/Api/Debug.php b/app/code/core/Mage/GoogleCheckout/Model/Resource/Api/Debug.php index 414976b95d..2eb4aa54e7 100755 --- a/app/code/core/Mage/GoogleCheckout/Model/Resource/Api/Debug.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Resource/Api/Debug.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/Model/Resource/Api/Debug/Collection.php b/app/code/core/Mage/GoogleCheckout/Model/Resource/Api/Debug/Collection.php index 79f10c04ad..66a64ebff8 100755 --- a/app/code/core/Mage/GoogleCheckout/Model/Resource/Api/Debug/Collection.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Resource/Api/Debug/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/Model/Resource/Notification.php b/app/code/core/Mage/GoogleCheckout/Model/Resource/Notification.php index fc9f4e6510..4834c1cc39 100755 --- a/app/code/core/Mage/GoogleCheckout/Model/Resource/Notification.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Resource/Notification.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/Model/Resource/Setup.php b/app/code/core/Mage/GoogleCheckout/Model/Resource/Setup.php index ec0fddd8bf..9f48d4288a 100755 --- a/app/code/core/Mage/GoogleCheckout/Model/Resource/Setup.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Resource/Setup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/Model/Resource/Tax.php b/app/code/core/Mage/GoogleCheckout/Model/Resource/Tax.php index 857325b4dc..8fa81018a0 100755 --- a/app/code/core/Mage/GoogleCheckout/Model/Resource/Tax.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Resource/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/Model/Shipping.php b/app/code/core/Mage/GoogleCheckout/Model/Shipping.php index c29aeb6f7b..e6c8516671 100644 --- a/app/code/core/Mage/GoogleCheckout/Model/Shipping.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Shipping.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/Model/Source/Checkout/Image.php b/app/code/core/Mage/GoogleCheckout/Model/Source/Checkout/Image.php index c9d3d64f5a..92b6c668fc 100644 --- a/app/code/core/Mage/GoogleCheckout/Model/Source/Checkout/Image.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Source/Checkout/Image.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/Model/Source/Locale.php b/app/code/core/Mage/GoogleCheckout/Model/Source/Locale.php index 41e743c574..58db644d41 100644 --- a/app/code/core/Mage/GoogleCheckout/Model/Source/Locale.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Source/Locale.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Carrier.php b/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Carrier.php index e20b8bd2e8..09883f2aa1 100644 --- a/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Carrier.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Carrier.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Category.php b/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Category.php index 390224cc43..8010e1729b 100644 --- a/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Category.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Category.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Units.php b/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Units.php index bc34bc101a..f5f5f08b78 100644 --- a/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Units.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Units.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Virtual/Method.php b/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Virtual/Method.php index faf863a427..9797b57135 100644 --- a/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Virtual/Method.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Virtual/Method.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Virtual/Schedule.php b/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Virtual/Schedule.php index 391b1ae810..4f9997d80b 100644 --- a/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Virtual/Schedule.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Virtual/Schedule.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/controllers/ApiController.php b/app/code/core/Mage/GoogleCheckout/controllers/ApiController.php index cf9bcc7869..41331828e6 100644 --- a/app/code/core/Mage/GoogleCheckout/controllers/ApiController.php +++ b/app/code/core/Mage/GoogleCheckout/controllers/ApiController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/controllers/RedirectController.php b/app/code/core/Mage/GoogleCheckout/controllers/RedirectController.php index 0f37aeff90..f14e901b8a 100644 --- a/app/code/core/Mage/GoogleCheckout/controllers/RedirectController.php +++ b/app/code/core/Mage/GoogleCheckout/controllers/RedirectController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -170,7 +170,6 @@ public function continueAction() public function redirectLogin() { $this->setFlag('', 'no-dispatch', true); - Mage::getSingleton('customer/session')->setBeforeAuthUrl(Mage::getUrl('*/*/*', array('_secure'=>true))); $this->getResponse()->setRedirect( Mage::helper('core/url')->addRequestParam( Mage::helper('customer')->getLoginUrl(), diff --git a/app/code/core/Mage/GoogleCheckout/etc/adminhtml.xml b/app/code/core/Mage/GoogleCheckout/etc/adminhtml.xml index 36138b6d40..fbfd4fb934 100644 --- a/app/code/core/Mage/GoogleCheckout/etc/adminhtml.xml +++ b/app/code/core/Mage/GoogleCheckout/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/GoogleCheckout/etc/config.xml b/app/code/core/Mage/GoogleCheckout/etc/config.xml index 9a6b7902d3..efbe5f33a4 100644 --- a/app/code/core/Mage/GoogleCheckout/etc/config.xml +++ b/app/code/core/Mage/GoogleCheckout/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/GoogleCheckout/etc/system.xml b/app/code/core/Mage/GoogleCheckout/etc/system.xml index f24b66aeda..8e04efaf45 100644 --- a/app/code/core/Mage/GoogleCheckout/etc/system.xml +++ b/app/code/core/Mage/GoogleCheckout/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/GoogleCheckout/sql/googlecheckout_setup/install-1.6.0.0.php b/app/code/core/Mage/GoogleCheckout/sql/googlecheckout_setup/install-1.6.0.0.php index cecca2cde2..aacb040735 100644 --- a/app/code/core/Mage/GoogleCheckout/sql/googlecheckout_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/GoogleCheckout/sql/googlecheckout_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/sql/googlecheckout_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/GoogleCheckout/sql/googlecheckout_setup/mysql4-install-0.7.0.php index 7affa14070..06b4141939 100644 --- a/app/code/core/Mage/GoogleCheckout/sql/googlecheckout_setup/mysql4-install-0.7.0.php +++ b/app/code/core/Mage/GoogleCheckout/sql/googlecheckout_setup/mysql4-install-0.7.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/sql/googlecheckout_setup/mysql4-upgrade-0.7.0-0.7.1.php b/app/code/core/Mage/GoogleCheckout/sql/googlecheckout_setup/mysql4-upgrade-0.7.0-0.7.1.php index b5b1966b79..2df9f58c51 100644 --- a/app/code/core/Mage/GoogleCheckout/sql/googlecheckout_setup/mysql4-upgrade-0.7.0-0.7.1.php +++ b/app/code/core/Mage/GoogleCheckout/sql/googlecheckout_setup/mysql4-upgrade-0.7.0-0.7.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/sql/googlecheckout_setup/mysql4-upgrade-0.7.1-0.7.2.php b/app/code/core/Mage/GoogleCheckout/sql/googlecheckout_setup/mysql4-upgrade-0.7.1-0.7.2.php index 1c0425edd8..c28dedf223 100644 --- a/app/code/core/Mage/GoogleCheckout/sql/googlecheckout_setup/mysql4-upgrade-0.7.1-0.7.2.php +++ b/app/code/core/Mage/GoogleCheckout/sql/googlecheckout_setup/mysql4-upgrade-0.7.1-0.7.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/sql/googlecheckout_setup/mysql4-upgrade-0.7.2-0.7.3.php b/app/code/core/Mage/GoogleCheckout/sql/googlecheckout_setup/mysql4-upgrade-0.7.2-0.7.3.php index 14a990e485..d1b274457e 100644 --- a/app/code/core/Mage/GoogleCheckout/sql/googlecheckout_setup/mysql4-upgrade-0.7.2-0.7.3.php +++ b/app/code/core/Mage/GoogleCheckout/sql/googlecheckout_setup/mysql4-upgrade-0.7.2-0.7.3.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/sql/googlecheckout_setup/mysql4-upgrade-0.7.3-0.7.4.php b/app/code/core/Mage/GoogleCheckout/sql/googlecheckout_setup/mysql4-upgrade-0.7.3-0.7.4.php index 0bf30c7ee9..bf27a41628 100644 --- a/app/code/core/Mage/GoogleCheckout/sql/googlecheckout_setup/mysql4-upgrade-0.7.3-0.7.4.php +++ b/app/code/core/Mage/GoogleCheckout/sql/googlecheckout_setup/mysql4-upgrade-0.7.3-0.7.4.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/sql/googlecheckout_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/GoogleCheckout/sql/googlecheckout_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php index 079f41c938..0a0311de24 100644 --- a/app/code/core/Mage/GoogleCheckout/sql/googlecheckout_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ b/app/code/core/Mage/GoogleCheckout/sql/googlecheckout_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/sql/googlecheckout_setup/mysql4-upgrade-1.6.0.0-1.6.0.1.php b/app/code/core/Mage/GoogleCheckout/sql/googlecheckout_setup/mysql4-upgrade-1.6.0.0-1.6.0.1.php index 4799c84e4b..658cc33c69 100644 --- a/app/code/core/Mage/GoogleCheckout/sql/googlecheckout_setup/mysql4-upgrade-1.6.0.0-1.6.0.1.php +++ b/app/code/core/Mage/GoogleCheckout/sql/googlecheckout_setup/mysql4-upgrade-1.6.0.0-1.6.0.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Block/Adminhtml/Export/Edit.php b/app/code/core/Mage/ImportExport/Block/Adminhtml/Export/Edit.php index b947a7d413..959abb8ad0 100644 --- a/app/code/core/Mage/ImportExport/Block/Adminhtml/Export/Edit.php +++ b/app/code/core/Mage/ImportExport/Block/Adminhtml/Export/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Block/Adminhtml/Export/Edit/Form.php b/app/code/core/Mage/ImportExport/Block/Adminhtml/Export/Edit/Form.php index f1b7b78f31..0b866aa103 100644 --- a/app/code/core/Mage/ImportExport/Block/Adminhtml/Export/Edit/Form.php +++ b/app/code/core/Mage/ImportExport/Block/Adminhtml/Export/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Block/Adminhtml/Export/Filter.php b/app/code/core/Mage/ImportExport/Block/Adminhtml/Export/Filter.php index 64fca7ceb4..4564995d61 100644 --- a/app/code/core/Mage/ImportExport/Block/Adminhtml/Export/Filter.php +++ b/app/code/core/Mage/ImportExport/Block/Adminhtml/Export/Filter.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -198,9 +198,8 @@ protected function _getDateFromToHtmlWithValue(Mage_Eav_Model_Entity_Attribute $ $dateBlock = new Mage_Core_Block_Html_Date(array( 'name' => $this->getFilterElementName($attribute->getAttributeCode()) . '[]', 'id' => $this->getFilterElementId($attribute->getAttributeCode()), - 'class' => 'input-text', + 'class' => 'input-text input-text-range-date', 'format' => Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT), - 'extra_params' => 'style="width:85px !important"', 'image' => $this->getSkinUrl('images/grid-cal.gif') )); $fromValue = null; @@ -227,7 +226,7 @@ protected function _getDateFromToHtmlWithValue(Mage_Eav_Model_Entity_Attribute $ protected function _getInputHtmlWithValue(Mage_Eav_Model_Entity_Attribute $attribute, $value) { $html = '_helper->escapeHtml($value) . '"'; } @@ -260,9 +259,8 @@ protected function _getMultiSelectHtmlWithValue(Mage_Eav_Model_Entity_Attribute $selectBlock = new Mage_Core_Block_Html_Select(array( 'name' => $this->getFilterElementName($attribute->getAttributeCode()). '[]', 'id' => $this->getFilterElementId($attribute->getAttributeCode()), - 'class' => 'multiselect', + 'class' => 'multiselect multiselect-export-filter', 'extra_params' => 'multiple="multiple" size="' . ($size > 5 ? 5 : ($size < 2 ? 2 : $size)) - . '" style="width:280px"' )); return $selectBlock->setOptions($options) ->setValue($value) @@ -290,11 +288,11 @@ protected function _getNumberFromToHtmlWithValue(Mage_Eav_Model_Entity_Attribute } return '' . $this->_helper->__('From') . ': ' - . ' ' + . ' ' . '' . $this->_helper->__('To') . ': '; + . '[]" class="input-text input-text-range" value="' . $toValue . '" />'; } /** @@ -327,8 +325,7 @@ protected function _getSelectHtmlWithValue(Mage_Eav_Model_Entity_Attribute $attr $selectBlock = new Mage_Core_Block_Html_Select(array( 'name' => $this->getFilterElementName($attribute->getAttributeCode()), 'id' => $this->getFilterElementId($attribute->getAttributeCode()), - 'class' => 'select', - 'extra_params' => 'style="width:280px"' + 'class' => 'select select-export-filter' )); return $selectBlock->setOptions($options) ->setValue($value) diff --git a/app/code/core/Mage/ImportExport/Block/Adminhtml/Import/Edit.php b/app/code/core/Mage/ImportExport/Block/Adminhtml/Import/Edit.php index abce0562ed..7989714bea 100644 --- a/app/code/core/Mage/ImportExport/Block/Adminhtml/Import/Edit.php +++ b/app/code/core/Mage/ImportExport/Block/Adminhtml/Import/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Block/Adminhtml/Import/Edit/Form.php b/app/code/core/Mage/ImportExport/Block/Adminhtml/Import/Edit/Form.php index 592d89498e..ee5f19568d 100644 --- a/app/code/core/Mage/ImportExport/Block/Adminhtml/Import/Edit/Form.php +++ b/app/code/core/Mage/ImportExport/Block/Adminhtml/Import/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Block/Adminhtml/Import/Frame/Result.php b/app/code/core/Mage/ImportExport/Block/Adminhtml/Import/Frame/Result.php index 163bb69c70..406ff3effe 100644 --- a/app/code/core/Mage/ImportExport/Block/Adminhtml/Import/Frame/Result.php +++ b/app/code/core/Mage/ImportExport/Block/Adminhtml/Import/Frame/Result.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -150,7 +150,7 @@ public function getImportButtonHtml() { return '  '; + . ' type="button">' . $this->__('Import') . ''; } /** diff --git a/app/code/core/Mage/ImportExport/Helper/Data.php b/app/code/core/Mage/ImportExport/Helper/Data.php index 4b13bf6e7d..e75a9455d4 100644 --- a/app/code/core/Mage/ImportExport/Helper/Data.php +++ b/app/code/core/Mage/ImportExport/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Abstract.php b/app/code/core/Mage/ImportExport/Model/Abstract.php index 4b8f1a48d6..d65a06a027 100644 --- a/app/code/core/Mage/ImportExport/Model/Abstract.php +++ b/app/code/core/Mage/ImportExport/Model/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Config.php b/app/code/core/Mage/ImportExport/Model/Config.php index 3c8ea7bc3b..4180d3e198 100644 --- a/app/code/core/Mage/ImportExport/Model/Config.php +++ b/app/code/core/Mage/ImportExport/Model/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Export.php b/app/code/core/Mage/ImportExport/Model/Export.php index c4c9584099..6396ffdb2b 100644 --- a/app/code/core/Mage/ImportExport/Model/Export.php +++ b/app/code/core/Mage/ImportExport/Model/Export.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Export/Adapter/Abstract.php b/app/code/core/Mage/ImportExport/Model/Export/Adapter/Abstract.php index 6229267a5e..7e84008534 100644 --- a/app/code/core/Mage/ImportExport/Model/Export/Adapter/Abstract.php +++ b/app/code/core/Mage/ImportExport/Model/Export/Adapter/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Export/Adapter/Csv.php b/app/code/core/Mage/ImportExport/Model/Export/Adapter/Csv.php index f3735fcd6e..56b0541863 100644 --- a/app/code/core/Mage/ImportExport/Model/Export/Adapter/Csv.php +++ b/app/code/core/Mage/ImportExport/Model/Export/Adapter/Csv.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Export/Entity/Abstract.php b/app/code/core/Mage/ImportExport/Model/Export/Entity/Abstract.php index 68ea2566ba..4d15e56350 100644 --- a/app/code/core/Mage/ImportExport/Model/Export/Entity/Abstract.php +++ b/app/code/core/Mage/ImportExport/Model/Export/Entity/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Export/Entity/Customer.php b/app/code/core/Mage/ImportExport/Model/Export/Entity/Customer.php index f9924bd514..4bd1801559 100644 --- a/app/code/core/Mage/ImportExport/Model/Export/Entity/Customer.php +++ b/app/code/core/Mage/ImportExport/Model/Export/Entity/Customer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Export/Entity/Product.php b/app/code/core/Mage/ImportExport/Model/Export/Entity/Product.php index c0e13a4902..d1e6fc0e11 100644 --- a/app/code/core/Mage/ImportExport/Model/Export/Entity/Product.php +++ b/app/code/core/Mage/ImportExport/Model/Export/Entity/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -250,6 +250,39 @@ protected function _prepareTierPrices(array $productIds) return $rowTierPrices; } + /** + * Prepare products group prices + * + * @param array $productIds + * @return array + */ + protected function _prepareGroupPrices(array $productIds) + { + if (empty($productIds)) { + return array(); + } + $resource = Mage::getSingleton('core/resource'); + $select = $this->_connection->select() + ->from($resource->getTableName('catalog/product_attribute_group_price')) + ->where('entity_id IN(?)', $productIds); + + $rowGroupPrices = array(); + $statement = $this->_connection->query($select); + while ($groupRow = $statement->fetch()) { + $rowGroupPrices[$groupRow['entity_id']][] = array( + '_group_price_customer_group' => $groupRow['all_groups'] + ? self::VALUE_ALL + : $groupRow['customer_group_id'], + '_group_price_website' => (0 == $groupRow['website_id']) + ? self::VALUE_ALL + : $this->_websiteIdToCode[$groupRow['website_id']], + '_group_price_price' => $groupRow['value'] + ); + } + + return $rowGroupPrices; + } + /** * Prepare products media gallery * @@ -526,6 +559,7 @@ public function export() $rowCategories = array(); $rowWebsites = array(); $rowTierPrices = array(); + $rowGroupPrices = array(); $rowMultiselects = array(); $mediaGalery = array(); @@ -547,8 +581,9 @@ public function export() if ($defaultStoreId == $storeId) { $collection->addCategoryIds()->addWebsiteNamesToResult(); - // tier price data getting only once + // tier and group price data getting only once $rowTierPrices = $this->_prepareTierPrices($collection->getAllIds()); + $rowGroupPrices = $this->_prepareGroupPrices($collection->getAllIds()); // getting media gallery data $mediaGalery = $this->_prepareMediaGallery($collection->getAllIds()); @@ -765,6 +800,7 @@ public function export() '_associated_sku', '_associated_default_qty', '_associated_position' ), array('_tier_price_website', '_tier_price_customer_group', '_tier_price_qty', '_tier_price_price'), + array('_group_price_website', '_group_price_customer_group', '_group_price_price'), array( '_media_attribute_id', '_media_image', @@ -809,6 +845,9 @@ public function export() if (!empty($rowTierPrices[$productId])) { $dataRow = array_merge($dataRow, array_shift($rowTierPrices[$productId])); } + if (!empty($rowGroupPrices[$productId])) { + $dataRow = array_merge($dataRow, array_shift($rowGroupPrices[$productId])); + } if (!empty($mediaGalery[$productId])) { $dataRow = array_merge($dataRow, array_shift($mediaGalery[$productId])); } @@ -856,6 +895,9 @@ public function export() if (!empty($rowTierPrices[$productId])) { $additionalRowsCount = max($additionalRowsCount, count($rowTierPrices[$productId])); } + if (!empty($rowGroupPrices[$productId])) { + $additionalRowsCount = max($additionalRowsCount, count($rowGroupPrices[$productId])); + } if (!empty($mediaGalery[$productId])) { $additionalRowsCount = max($additionalRowsCount, count($mediaGalery[$productId])); } @@ -885,6 +927,9 @@ public function export() if (!empty($rowTierPrices[$productId])) { $dataRow = array_merge($dataRow, array_shift($rowTierPrices[$productId])); } + if (!empty($rowGroupPrices[$productId])) { + $dataRow = array_merge($dataRow, array_shift($rowGroupPrices[$productId])); + } if (!empty($mediaGalery[$productId])) { $dataRow = array_merge($dataRow, array_shift($mediaGalery[$productId])); } diff --git a/app/code/core/Mage/ImportExport/Model/Export/Entity/Product/Type/Abstract.php b/app/code/core/Mage/ImportExport/Model/Export/Entity/Product/Type/Abstract.php index c460bc169c..ff7deea410 100644 --- a/app/code/core/Mage/ImportExport/Model/Export/Entity/Product/Type/Abstract.php +++ b/app/code/core/Mage/ImportExport/Model/Export/Entity/Product/Type/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Export/Entity/Product/Type/Configurable.php b/app/code/core/Mage/ImportExport/Model/Export/Entity/Product/Type/Configurable.php index e78478c9cb..2244a1c132 100644 --- a/app/code/core/Mage/ImportExport/Model/Export/Entity/Product/Type/Configurable.php +++ b/app/code/core/Mage/ImportExport/Model/Export/Entity/Product/Type/Configurable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Export/Entity/Product/Type/Grouped.php b/app/code/core/Mage/ImportExport/Model/Export/Entity/Product/Type/Grouped.php index 1619047ba6..105d51b110 100644 --- a/app/code/core/Mage/ImportExport/Model/Export/Entity/Product/Type/Grouped.php +++ b/app/code/core/Mage/ImportExport/Model/Export/Entity/Product/Type/Grouped.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Export/Entity/Product/Type/Simple.php b/app/code/core/Mage/ImportExport/Model/Export/Entity/Product/Type/Simple.php index 1d23a4a571..3f901e35c6 100644 --- a/app/code/core/Mage/ImportExport/Model/Export/Entity/Product/Type/Simple.php +++ b/app/code/core/Mage/ImportExport/Model/Export/Entity/Product/Type/Simple.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -51,5 +51,12 @@ class Mage_ImportExport_Model_Export_Entity_Product_Type_Simple * * @var array */ - protected $_disabledAttrs = array('old_id', 'recurring_profile', 'is_recurring', 'tier_price', 'category_ids'); + protected $_disabledAttrs = array( + 'old_id', + 'recurring_profile', + 'is_recurring', + 'tier_price', + 'group_price', + 'category_ids' + ); } diff --git a/app/code/core/Mage/ImportExport/Model/Import.php b/app/code/core/Mage/ImportExport/Model/Import.php index b253f82a9f..9d6ef28b49 100644 --- a/app/code/core/Mage/ImportExport/Model/Import.php +++ b/app/code/core/Mage/ImportExport/Model/Import.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Import/Adapter.php b/app/code/core/Mage/ImportExport/Model/Import/Adapter.php index 0c5dbd26ac..809395e86e 100644 --- a/app/code/core/Mage/ImportExport/Model/Import/Adapter.php +++ b/app/code/core/Mage/ImportExport/Model/Import/Adapter.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Import/Adapter/Abstract.php b/app/code/core/Mage/ImportExport/Model/Import/Adapter/Abstract.php index 5cf66948e8..c96a834fb6 100644 --- a/app/code/core/Mage/ImportExport/Model/Import/Adapter/Abstract.php +++ b/app/code/core/Mage/ImportExport/Model/Import/Adapter/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Import/Adapter/Csv.php b/app/code/core/Mage/ImportExport/Model/Import/Adapter/Csv.php index 5c24845131..79d893e5c6 100644 --- a/app/code/core/Mage/ImportExport/Model/Import/Adapter/Csv.php +++ b/app/code/core/Mage/ImportExport/Model/Import/Adapter/Csv.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Import/Entity/Abstract.php b/app/code/core/Mage/ImportExport/Model/Import/Entity/Abstract.php index 3dbc74271b..6aede50b19 100644 --- a/app/code/core/Mage/ImportExport/Model/Import/Entity/Abstract.php +++ b/app/code/core/Mage/ImportExport/Model/Import/Entity/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Import/Entity/Customer.php b/app/code/core/Mage/ImportExport/Model/Import/Entity/Customer.php index 9fe5f6ce57..d6509eb403 100644 --- a/app/code/core/Mage/ImportExport/Model/Import/Entity/Customer.php +++ b/app/code/core/Mage/ImportExport/Model/Import/Entity/Customer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Import/Entity/Customer/Address.php b/app/code/core/Mage/ImportExport/Model/Import/Entity/Customer/Address.php index b264f0d4ac..bf496a3bf2 100644 --- a/app/code/core/Mage/ImportExport/Model/Import/Entity/Customer/Address.php +++ b/app/code/core/Mage/ImportExport/Model/Import/Entity/Customer/Address.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -165,14 +165,16 @@ protected function _importData() /** @var $resource Mage_Customer_Model_Address */ $resource = Mage::getModel('customer/address'); $strftimeFormat = Varien_Date::convertZendToStrftime(Varien_Date::DATETIME_INTERNAL_FORMAT, true, true); - $table = $resource->getResource()->getEntityTable(); + $table = $resource->getResource()->getEntityTable(); $nextEntityId = Mage::getResourceHelper('importexport')->getNextAutoincrement($table); $customerId = null; $regionColName = self::getColNameForAttrCode('region'); $countryColName = self::getColNameForAttrCode('country_id'); + /** @var $regionIdAttr Mage_Customer_Model_Attribute */ $regionIdAttr = Mage::getSingleton('eav/config')->getAttribute($this->getEntityTypeCode(), 'region_id'); $regionIdTable = $regionIdAttr->getBackend()->getTable(); $regionIdAttrId = $regionIdAttr->getId(); + $isAppendMode = Mage_ImportExport_Model_Import::BEHAVIOR_APPEND == $this->_customer->getBehavior(); while ($bunch = $this->_dataSourceModel->getNextBunch()) { $entityRows = array(); @@ -191,6 +193,31 @@ protected function _importData() if (!$customerId || !$this->_isRowWithAddress($rowData) || !$this->validateRow($rowData, $rowNum)) { continue; } + + /** @var $addressCollection Mage_Customer_Model_Resource_Address_Collection */ + $addressCollection = Mage::getResourceModel('customer/address_collection'); + $addressCollection->addAttributeToFilter('parent_id', $customerId); + + $addressAttributes = array(); + foreach ($this->_attributes as $attrAlias => $attrParams) { + if (isset($rowData[$attrAlias]) && strlen($rowData[$attrAlias])) { + if ('select' == $attrParams['type']) { + $value = $attrParams['options'][strtolower($rowData[$attrAlias])]; + } elseif ('datetime' == $attrParams['type']) { + $value = gmstrftime($strftimeFormat, strtotime($rowData[$attrAlias])); + } else { + $value = $rowData[$attrAlias]; + } + $addressAttributes[$attrParams['id']] = $value; + $addressCollection->addAttributeToFilter($attrParams['code'], $value); + } + } + + // skip duplicate address + if ($isAppendMode && $addressCollection->getSize()) { + continue; + } + $entityId = $nextEntityId++; // entity table data @@ -203,15 +230,9 @@ protected function _importData() ); // attribute values foreach ($this->_attributes as $attrAlias => $attrParams) { - if (isset($rowData[$attrAlias]) && strlen($rowData[$attrAlias])) { - if ('select' == $attrParams['type']) { - $value = $attrParams['options'][strtolower($rowData[$attrAlias])]; - } elseif ('datetime' == $attrParams['type']) { - $value = gmstrftime($strftimeFormat, strtotime($rowData[$attrAlias])); - } else { - $value = $rowData[$attrAlias]; - } - $attributes[$attrParams['table']][$entityId][$attrParams['id']] = $value; + if (isset($addressAttributes[$attrParams['id']])) { + $attributes[$attrParams['table']][$entityId][$attrParams['id']] + = $addressAttributes[$attrParams['id']]; } } // customer default addresses @@ -237,8 +258,8 @@ protected function _importData() } } $this->_saveAddressEntity($entityRows) - ->_saveAddressAttributes($attributes) - ->_saveCustomerDefaults($defaults); + ->_saveAddressAttributes($attributes) + ->_saveCustomerDefaults($defaults); } return true; } @@ -251,8 +272,8 @@ protected function _importData() protected function _initAttributes() { $addrCollection = Mage::getResourceModel('customer/address_attribute_collection') - ->addSystemHiddenFilter() - ->addExcludeHiddenFrontendFilter(); + ->addSystemHiddenFilter() + ->addExcludeHiddenFrontendFilter(); foreach ($addrCollection as $attribute) { $this->_attributes[self::getColNameForAttrCode($attribute->getAttributeCode())] = array( diff --git a/app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php b/app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php index 70c9390cb6..4bd0abf3c5 100644 --- a/app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php +++ b/app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -88,6 +88,9 @@ class Mage_ImportExport_Model_Import_Entity_Product extends Mage_ImportExport_Mo const ERROR_INVALID_TIER_PRICE_SITE = 'tierPriceWebsiteInvalid'; const ERROR_INVALID_TIER_PRICE_GROUP = 'tierPriceGroupInvalid'; const ERROR_TIER_DATA_INCOMPLETE = 'tierPriceDataIsIncomplete'; + const ERROR_INVALID_GROUP_PRICE_SITE = 'groupPriceWebsiteInvalid'; + const ERROR_INVALID_GROUP_PRICE_GROUP = 'groupPriceGroupInvalid'; + const ERROR_GROUP_PRICE_DATA_INCOMPLETE = 'groupPriceDataIsIncomplete'; const ERROR_SKU_NOT_FOUND_FOR_DELETE = 'skuNotFoundToDelete'; const ERROR_SUPER_PRODUCTS_SKU_NOT_FOUND = 'superProductsSkuNotFound'; @@ -210,6 +213,7 @@ class Mage_ImportExport_Model_Import_Entity_Product extends Mage_ImportExport_Mo protected $_particularAttributes = array( '_store', '_attribute_set', '_type', '_category', '_product_websites', '_tier_price_website', '_tier_price_customer_group', '_tier_price_qty', '_tier_price_price', '_links_related_sku', + '_group_price_website', '_group_price_customer_group', '_group_price_price', '_links_related_position', '_links_crosssell_sku', '_links_crosssell_position', '_links_upsell_sku', '_links_upsell_position', '_custom_option_store', '_custom_option_type', '_custom_option_title', '_custom_option_is_required', '_custom_option_price', '_custom_option_sku', '_custom_option_max_characters', @@ -280,7 +284,6 @@ class Mage_ImportExport_Model_Import_Entity_Product extends Mage_ImportExport_Mo /** * Constructor. * - * @return void */ public function __construct() { @@ -539,7 +542,7 @@ protected function _prepareRowForDb(array $rowData) } /** - * Check tier orice data validity. + * Check tier price data validity. * * @param array $rowData * @param int $rowNum @@ -575,6 +578,40 @@ protected function _isTierPriceValid(array $rowData, $rowNum) return true; } + /** + * Check group price data validity. + * + * @param array $rowData + * @param int $rowNum + * @return bool + */ + protected function _isGroupPriceValid(array $rowData, $rowNum) + { + if ((isset($rowData['_group_price_website']) && strlen($rowData['_group_price_website'])) + || (isset($rowData['_group_price_customer_group']) && strlen($rowData['_group_price_customer_group'])) + || (isset($rowData['_group_price_price']) && strlen($rowData['_group_price_price'])) + ) { + if (!isset($rowData['_group_price_website']) || !isset($rowData['_group_price_customer_group']) + || !strlen($rowData['_group_price_website']) || !strlen($rowData['_group_price_customer_group']) + || !strlen($rowData['_group_price_price']) + ) { + $this->addRowError(self::ERROR_GROUP_PRICE_DATA_INCOMPLETE, $rowNum); + return false; + } elseif ($rowData['_group_price_website'] != self::VALUE_ALL + && !isset($this->_websiteCodeToId[$rowData['_group_price_website']]) + ) { + $this->addRowError(self::ERROR_INVALID_GROUP_PRICE_SITE, $rowNum); + return false; + } elseif ($rowData['_group_price_customer_group'] != self::VALUE_ALL + && !isset($this->_customerGroups[$rowData['_group_price_customer_group']]) + ) { + $this->addRowError(self::ERROR_INVALID_GROUP_PRICE_GROUP, $rowNum); + return false; + } + } + return true; + } + /** * Check super products SKU * @@ -602,13 +639,15 @@ protected function _isSuperProductsSkuValid($rowData, $rowNum) */ protected function _saveCustomOptions() { - $productTable = Mage::getSingleton('core/resource')->getTableName('catalog/product'); - $optionTable = Mage::getSingleton('core/resource')->getTableName('catalog/product_option'); - $priceTable = Mage::getSingleton('core/resource')->getTableName('catalog/product_option_price'); - $titleTable = Mage::getSingleton('core/resource')->getTableName('catalog/product_option_title'); - $typePriceTable = Mage::getSingleton('core/resource')->getTableName('catalog/product_option_type_price'); - $typeTitleTable = Mage::getSingleton('core/resource')->getTableName('catalog/product_option_type_title'); - $typeValueTable = Mage::getSingleton('core/resource')->getTableName('catalog/product_option_type_value'); + /** @var $coreResource Mage_Core_Model_Resource */ + $coreResource = Mage::getSingleton('core/resource'); + $productTable = $coreResource->getTableName('catalog/product'); + $optionTable = $coreResource->getTableName('catalog/product_option'); + $priceTable = $coreResource->getTableName('catalog/product_option_price'); + $titleTable = $coreResource->getTableName('catalog/product_option_title'); + $typePriceTable = $coreResource->getTableName('catalog/product_option_type_price'); + $typeTitleTable = $coreResource->getTableName('catalog/product_option_type_title'); + $typeValueTable = $coreResource->getTableName('catalog/product_option_type_value'); $nextOptionId = Mage::getResourceHelper('importexport')->getNextAutoincrement($optionTable); $nextValueId = Mage::getResourceHelper('importexport')->getNextAutoincrement($typeValueTable); $priceIsGlobal = Mage::helper('catalog')->isPriceGlobal(); @@ -773,10 +812,12 @@ protected function _saveCustomOptions() // if complex options does not contain values - ignore them foreach ($customOptions[$optionTable] as $key => $optionData) { if ($typeSpecific[$optionData['type']] === true - && !isset($customOptions[$typeValueTable][$optionData['option_id']])) { + && !isset($customOptions[$typeValueTable][$optionData['option_id']]) + ) { unset($customOptions[$optionTable][$key], $customOptions[$titleTable][$optionData['option_id']]); } } + if ($customOptions[$optionTable]) { $this->_connection->insertMultiple($optionTable, $customOptions[$optionTable]); } else { @@ -1074,6 +1115,7 @@ protected function _saveProducts() $websites = array(); $categories = array(); $tierPrices = array(); + $groupPrices = array(); $mediaGallery = array(); $uploadedGalleryFiles = array(); $previousType = null; @@ -1128,12 +1170,22 @@ protected function _saveProducts() if (!empty($rowData['_tier_price_website'])) { // 4. Tier prices phase $tierPrices[$rowSku][] = array( 'all_groups' => $rowData['_tier_price_customer_group'] == self::VALUE_ALL, - 'customer_group_id' => $rowData['_tier_price_customer_group'] == self::VALUE_ALL ? - 0 : $rowData['_tier_price_customer_group'], + 'customer_group_id' => ($rowData['_tier_price_customer_group'] == self::VALUE_ALL) + ? 0 : $rowData['_tier_price_customer_group'], 'qty' => $rowData['_tier_price_qty'], 'value' => $rowData['_tier_price_price'], - 'website_id' => self::VALUE_ALL == $rowData['_tier_price_website'] || $priceIsGlobal ? - 0 : $this->_websiteCodeToId[$rowData['_tier_price_website']] + 'website_id' => (self::VALUE_ALL == $rowData['_tier_price_website'] || $priceIsGlobal) + ? 0 : $this->_websiteCodeToId[$rowData['_tier_price_website']] + ); + } + if (!empty($rowData['_group_price_website'])) { // 5. Group prices phase + $groupPrices[$rowSku][] = array( + 'all_groups' => $rowData['_group_price_customer_group'] == self::VALUE_ALL, + 'customer_group_id' => ($rowData['_group_price_customer_group'] == self::VALUE_ALL) + ? 0 : $rowData['_group_price_customer_group'], + 'value' => $rowData['_group_price_price'], + 'website_id' => (self::VALUE_ALL == $rowData['_group_price_website'] || $priceIsGlobal) + ? 0 : $this->_websiteCodeToId[$rowData['_group_price_website']] ); } foreach ($this->_imagesArrayKeys as $imageCol) { @@ -1223,6 +1275,7 @@ protected function _saveProducts() ->_saveProductWebsites($websites) ->_saveProductCategories($categories) ->_saveProductTierPrices($tierPrices) + ->_saveProductGroupPrices($groupPrices) ->_saveMediaGallery($mediaGallery) ->_saveProductAttributes($attributes); } @@ -1269,6 +1322,46 @@ protected function _saveProductTierPrices(array $tierPriceData) return $this; } + /** + * Save product group prices. + * + * @param array $groupPriceData + * @return Mage_ImportExport_Model_Import_Entity_Product + */ + protected function _saveProductGroupPrices(array $groupPriceData) + { + static $tableName = null; + + if (!$tableName) { + $tableName = Mage::getModel('importexport/import_proxy_product_resource') + ->getTable('catalog/product_attribute_group_price'); + } + if ($groupPriceData) { + $groupPriceIn = array(); + $delProductId = array(); + + foreach ($groupPriceData as $delSku => $groupPriceRows) { + $productId = $this->_newSku[$delSku]['entity_id']; + $delProductId[] = $productId; + + foreach ($groupPriceRows as $row) { + $row['entity_id'] = $productId; + $groupPriceIn[] = $row; + } + } + if (Mage_ImportExport_Model_Import::BEHAVIOR_APPEND != $this->getBehavior()) { + $this->_connection->delete( + $tableName, + $this->_connection->quoteInto('entity_id IN (?)', $delProductId) + ); + } + if ($groupPriceIn) { + $this->_connection->insertOnDuplicate($tableName, $groupPriceIn, array('value')); + } + } + return $this; + } + /** * Returns an object for upload a media files */ @@ -1443,27 +1536,28 @@ protected function _saveProductWebsites(array $websiteData) protected function _saveStockItem() { $defaultStockData = array( - 'manage_stock' => 1, - 'use_config_manage_stock' => 1, - 'qty' => 0, - 'min_qty' => 0, - 'use_config_min_qty' => 1, - 'min_sale_qty' => 1, - 'use_config_min_sale_qty' => 1, - 'max_sale_qty' => 10000, - 'use_config_max_sale_qty' => 1, - 'is_qty_decimal' => 0, - 'backorders' => 0, - 'use_config_backorders' => 1, - 'notify_stock_qty' => 1, - 'use_config_notify_stock_qty' => 1, - 'enable_qty_increments' => 0, - 'use_config_enable_qty_inc' => 1, - 'qty_increments' => 0, - 'use_config_qty_increments' => 1, - 'is_in_stock' => 0, - 'low_stock_date' => null, - 'stock_status_changed_auto' => 0 + 'manage_stock' => 1, + 'use_config_manage_stock' => 1, + 'qty' => 0, + 'min_qty' => 0, + 'use_config_min_qty' => 1, + 'min_sale_qty' => 1, + 'use_config_min_sale_qty' => 1, + 'max_sale_qty' => 10000, + 'use_config_max_sale_qty' => 1, + 'is_qty_decimal' => 0, + 'backorders' => 0, + 'use_config_backorders' => 1, + 'notify_stock_qty' => 1, + 'use_config_notify_stock_qty' => 1, + 'enable_qty_increments' => 0, + 'use_config_enable_qty_inc' => 1, + 'qty_increments' => 0, + 'use_config_qty_increments' => 1, + 'is_in_stock' => 0, + 'low_stock_date' => null, + 'stock_status_changed_auto' => 0, + 'is_decimal_divided' => 0 ); $entityTable = Mage::getResourceModel('cataloginventory/stock_item')->getMainTable(); @@ -1482,14 +1576,22 @@ protected function _saveStockItem() continue; } - $row = array_merge( - $defaultStockData, - array_intersect_key($rowData, $defaultStockData) - ); $row['product_id'] = $this->_newSku[$rowData[self::COL_SKU]]['entity_id']; $row['stock_id'] = 1; + /** @var $stockItem Mage_CatalogInventory_Model_Stock_Item */ - $stockItem = Mage::getModel('cataloginventory/stock_item', $row); + $stockItem = Mage::getModel('cataloginventory/stock_item'); + $stockItem->loadByProduct($row['product_id']); + $existStockData = $stockItem->getData(); + + $row = array_merge( + $defaultStockData, + array_intersect_key($existStockData, $defaultStockData), + array_intersect_key($rowData, $defaultStockData), + $row + ); + + $stockItem->setData($row); if ($helper->isQty($this->_newSku[$rowData[self::COL_SKU]]['type_id'])) { if ($stockItem->verifyNotification()) { @@ -1635,6 +1737,7 @@ public function validateRow(array $rowData, $rowNum) $this->_isProductWebsiteValid($rowData, $rowNum); $this->_isProductCategoryValid($rowData, $rowNum); $this->_isTierPriceValid($rowData, $rowNum); + $this->_isGroupPriceValid($rowData, $rowNum); $this->_isSuperProductsSkuValid($rowData, $rowNum); if (self::SCOPE_DEFAULT == $rowScope) { // SKU is specified, row is SCOPE_DEFAULT, new product block begins diff --git a/app/code/core/Mage/ImportExport/Model/Import/Entity/Product/Type/Abstract.php b/app/code/core/Mage/ImportExport/Model/Import/Entity/Product/Type/Abstract.php index a18c1a580c..1d0889e4ea 100644 --- a/app/code/core/Mage/ImportExport/Model/Import/Entity/Product/Type/Abstract.php +++ b/app/code/core/Mage/ImportExport/Model/Import/Entity/Product/Type/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Import/Entity/Product/Type/Configurable.php b/app/code/core/Mage/ImportExport/Model/Import/Entity/Product/Type/Configurable.php index 736184f7f9..35bb2de77e 100644 --- a/app/code/core/Mage/ImportExport/Model/Import/Entity/Product/Type/Configurable.php +++ b/app/code/core/Mage/ImportExport/Model/Import/Entity/Product/Type/Configurable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Import/Entity/Product/Type/Grouped.php b/app/code/core/Mage/ImportExport/Model/Import/Entity/Product/Type/Grouped.php index 8361417c30..46a465b382 100644 --- a/app/code/core/Mage/ImportExport/Model/Import/Entity/Product/Type/Grouped.php +++ b/app/code/core/Mage/ImportExport/Model/Import/Entity/Product/Type/Grouped.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Import/Entity/Product/Type/Simple.php b/app/code/core/Mage/ImportExport/Model/Import/Entity/Product/Type/Simple.php index 4fff52364f..f976f9e781 100644 --- a/app/code/core/Mage/ImportExport/Model/Import/Entity/Product/Type/Simple.php +++ b/app/code/core/Mage/ImportExport/Model/Import/Entity/Product/Type/Simple.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -40,7 +40,7 @@ class Mage_ImportExport_Model_Import_Entity_Product_Type_Simple * @var array */ protected $_forcedAttributesCodes = array( - 'related_targetrule_position_behavior', 'related_targetrule_position_limit', - 'upsell_targetrule_position_behavior', 'upsell_targetrule_position_limit' + 'related_tgtr_position_behavior', 'related_tgtr_position_limit', + 'upsell_tgtr_position_behavior', 'upsell_tgtr_position_limit' ); } diff --git a/app/code/core/Mage/ImportExport/Model/Import/Proxy/Product.php b/app/code/core/Mage/ImportExport/Model/Import/Proxy/Product.php index 643c380c8c..8b61bb4b98 100644 --- a/app/code/core/Mage/ImportExport/Model/Import/Proxy/Product.php +++ b/app/code/core/Mage/ImportExport/Model/Import/Proxy/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Import/Proxy/Product/Resource.php b/app/code/core/Mage/ImportExport/Model/Import/Proxy/Product/Resource.php index 24070d4e2d..46e77e47ce 100644 --- a/app/code/core/Mage/ImportExport/Model/Import/Proxy/Product/Resource.php +++ b/app/code/core/Mage/ImportExport/Model/Import/Proxy/Product/Resource.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Import/Uploader.php b/app/code/core/Mage/ImportExport/Model/Import/Uploader.php index afc19477fe..e040261e0d 100644 --- a/app/code/core/Mage/ImportExport/Model/Import/Uploader.php +++ b/app/code/core/Mage/ImportExport/Model/Import/Uploader.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Mysql4/Import/Data.php b/app/code/core/Mage/ImportExport/Model/Mysql4/Import/Data.php index 1e55199b1d..22fad55da1 100644 --- a/app/code/core/Mage/ImportExport/Model/Mysql4/Import/Data.php +++ b/app/code/core/Mage/ImportExport/Model/Mysql4/Import/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Mysql4/Setup.php b/app/code/core/Mage/ImportExport/Model/Mysql4/Setup.php index 08f4d82029..9f49d196f2 100644 --- a/app/code/core/Mage/ImportExport/Model/Mysql4/Setup.php +++ b/app/code/core/Mage/ImportExport/Model/Mysql4/Setup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Resource/Helper/Mysql4.php b/app/code/core/Mage/ImportExport/Model/Resource/Helper/Mysql4.php index 40facc25ce..db6ac5e913 100644 --- a/app/code/core/Mage/ImportExport/Model/Resource/Helper/Mysql4.php +++ b/app/code/core/Mage/ImportExport/Model/Resource/Helper/Mysql4.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Resource/Import/Data.php b/app/code/core/Mage/ImportExport/Model/Resource/Import/Data.php index db6fecd1c3..c9068ff407 100644 --- a/app/code/core/Mage/ImportExport/Model/Resource/Import/Data.php +++ b/app/code/core/Mage/ImportExport/Model/Resource/Import/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -80,7 +80,7 @@ public function getIterator() */ public function cleanBunches() { - return $this->_getWriteAdapter()->truncateTable($this->getMainTable()); + return $this->_getWriteAdapter()->delete($this->getMainTable()); } /** diff --git a/app/code/core/Mage/ImportExport/Model/Resource/Setup.php b/app/code/core/Mage/ImportExport/Model/Resource/Setup.php index 15962428fe..b848513f25 100644 --- a/app/code/core/Mage/ImportExport/Model/Resource/Setup.php +++ b/app/code/core/Mage/ImportExport/Model/Resource/Setup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Source/Export/Entity.php b/app/code/core/Mage/ImportExport/Model/Source/Export/Entity.php index a15166668d..d6c0c642e7 100644 --- a/app/code/core/Mage/ImportExport/Model/Source/Export/Entity.php +++ b/app/code/core/Mage/ImportExport/Model/Source/Export/Entity.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Source/Export/Format.php b/app/code/core/Mage/ImportExport/Model/Source/Export/Format.php index d50ee0917e..20ac1a5ecc 100644 --- a/app/code/core/Mage/ImportExport/Model/Source/Export/Format.php +++ b/app/code/core/Mage/ImportExport/Model/Source/Export/Format.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Source/Import/Behavior.php b/app/code/core/Mage/ImportExport/Model/Source/Import/Behavior.php index bb369c05ab..f2e8630233 100644 --- a/app/code/core/Mage/ImportExport/Model/Source/Import/Behavior.php +++ b/app/code/core/Mage/ImportExport/Model/Source/Import/Behavior.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Source/Import/Entity.php b/app/code/core/Mage/ImportExport/Model/Source/Import/Entity.php index 78af736ea7..1396aaf09b 100644 --- a/app/code/core/Mage/ImportExport/Model/Source/Import/Entity.php +++ b/app/code/core/Mage/ImportExport/Model/Source/Import/Entity.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/controllers/Adminhtml/ExportController.php b/app/code/core/Mage/ImportExport/controllers/Adminhtml/ExportController.php index 63dd303c22..a544849c1f 100644 --- a/app/code/core/Mage/ImportExport/controllers/Adminhtml/ExportController.php +++ b/app/code/core/Mage/ImportExport/controllers/Adminhtml/ExportController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/controllers/Adminhtml/ImportController.php b/app/code/core/Mage/ImportExport/controllers/Adminhtml/ImportController.php index f98ff2f0f2..e1a3bebdbd 100644 --- a/app/code/core/Mage/ImportExport/controllers/Adminhtml/ImportController.php +++ b/app/code/core/Mage/ImportExport/controllers/Adminhtml/ImportController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -99,7 +99,7 @@ public function startAction() /** @var $resultBlock Mage_ImportExport_Block_Adminhtml_Import_Frame_Result */ $resultBlock = $this->getLayout()->getBlock('import.frame.result'); - + /** @var $importModel Mage_ImportExport_Model_Import */ $importModel = Mage::getModel('importexport/import'); try { diff --git a/app/code/core/Mage/ImportExport/etc/adminhtml.xml b/app/code/core/Mage/ImportExport/etc/adminhtml.xml index 0ffcddbe3c..ef3640e26d 100644 --- a/app/code/core/Mage/ImportExport/etc/adminhtml.xml +++ b/app/code/core/Mage/ImportExport/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/ImportExport/etc/config.xml b/app/code/core/Mage/ImportExport/etc/config.xml index d32d08f843..9a515fb7f8 100644 --- a/app/code/core/Mage/ImportExport/etc/config.xml +++ b/app/code/core/Mage/ImportExport/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/ImportExport/sql/importexport_setup/install-1.6.0.0.php b/app/code/core/Mage/ImportExport/sql/importexport_setup/install-1.6.0.0.php index 7ddff2bf27..a121ca7e51 100644 --- a/app/code/core/Mage/ImportExport/sql/importexport_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/ImportExport/sql/importexport_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/sql/importexport_setup/mysql4-install-0.1.0.php b/app/code/core/Mage/ImportExport/sql/importexport_setup/mysql4-install-0.1.0.php index 4eff7951f8..92d1a3b10f 100644 --- a/app/code/core/Mage/ImportExport/sql/importexport_setup/mysql4-install-0.1.0.php +++ b/app/code/core/Mage/ImportExport/sql/importexport_setup/mysql4-install-0.1.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/sql/importexport_setup/mysql4-upgrade-1.6.0.1-1.6.0.2.php b/app/code/core/Mage/ImportExport/sql/importexport_setup/mysql4-upgrade-1.6.0.1-1.6.0.2.php index 5562d3437c..6ccebc3e5b 100644 --- a/app/code/core/Mage/ImportExport/sql/importexport_setup/mysql4-upgrade-1.6.0.1-1.6.0.2.php +++ b/app/code/core/Mage/ImportExport/sql/importexport_setup/mysql4-upgrade-1.6.0.1-1.6.0.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Index/Block/Adminhtml/Notifications.php b/app/code/core/Mage/Index/Block/Adminhtml/Notifications.php index 93a92e03fb..509c0c9d73 100644 --- a/app/code/core/Mage/Index/Block/Adminhtml/Notifications.php +++ b/app/code/core/Mage/Index/Block/Adminhtml/Notifications.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Index/Block/Adminhtml/Process.php b/app/code/core/Mage/Index/Block/Adminhtml/Process.php index 49493b6284..06782cadab 100644 --- a/app/code/core/Mage/Index/Block/Adminhtml/Process.php +++ b/app/code/core/Mage/Index/Block/Adminhtml/Process.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Index/Block/Adminhtml/Process/Edit.php b/app/code/core/Mage/Index/Block/Adminhtml/Process/Edit.php index 867791a901..98d02d2ac6 100644 --- a/app/code/core/Mage/Index/Block/Adminhtml/Process/Edit.php +++ b/app/code/core/Mage/Index/Block/Adminhtml/Process/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Index/Block/Adminhtml/Process/Edit/Form.php b/app/code/core/Mage/Index/Block/Adminhtml/Process/Edit/Form.php index eb19e29951..0dde07ca2f 100644 --- a/app/code/core/Mage/Index/Block/Adminhtml/Process/Edit/Form.php +++ b/app/code/core/Mage/Index/Block/Adminhtml/Process/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Index/Block/Adminhtml/Process/Edit/Tab/Main.php b/app/code/core/Mage/Index/Block/Adminhtml/Process/Edit/Tab/Main.php index 8a10972abf..a450c27b8d 100644 --- a/app/code/core/Mage/Index/Block/Adminhtml/Process/Edit/Tab/Main.php +++ b/app/code/core/Mage/Index/Block/Adminhtml/Process/Edit/Tab/Main.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Index/Block/Adminhtml/Process/Edit/Tabs.php b/app/code/core/Mage/Index/Block/Adminhtml/Process/Edit/Tabs.php index 4bc1ac9973..eb70adc810 100644 --- a/app/code/core/Mage/Index/Block/Adminhtml/Process/Edit/Tabs.php +++ b/app/code/core/Mage/Index/Block/Adminhtml/Process/Edit/Tabs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Index/Block/Adminhtml/Process/Grid.php b/app/code/core/Mage/Index/Block/Adminhtml/Process/Grid.php index e7aa55bf93..b9ee489acc 100644 --- a/app/code/core/Mage/Index/Block/Adminhtml/Process/Grid.php +++ b/app/code/core/Mage/Index/Block/Adminhtml/Process/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Index/Block/Adminhtml/Process/Grid/Massaction.php b/app/code/core/Mage/Index/Block/Adminhtml/Process/Grid/Massaction.php index 6250266a19..c712c91a7c 100644 --- a/app/code/core/Mage/Index/Block/Adminhtml/Process/Grid/Massaction.php +++ b/app/code/core/Mage/Index/Block/Adminhtml/Process/Grid/Massaction.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Index/Helper/Data.php b/app/code/core/Mage/Index/Helper/Data.php index f9f8cb3798..45b90c801e 100644 --- a/app/code/core/Mage/Index/Helper/Data.php +++ b/app/code/core/Mage/Index/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Index/Model/Event.php b/app/code/core/Mage/Index/Model/Event.php index e6d4c3db1b..2f605e2418 100644 --- a/app/code/core/Mage/Index/Model/Event.php +++ b/app/code/core/Mage/Index/Model/Event.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Index/Model/Indexer.php b/app/code/core/Mage/Index/Model/Indexer.php index 9c0c29d02c..651d2d5d88 100644 --- a/app/code/core/Mage/Index/Model/Indexer.php +++ b/app/code/core/Mage/Index/Model/Indexer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -388,6 +388,28 @@ protected function _changeProcessKeyStatus($process, $enable = true) return false; } + /** + * Allow DDL operations while indexing + * + * @return Mage_Index_Model_Indexer + */ + public function allowTableChanges() + { + $this->_allowTableChanges = true; + return $this; + } + + /** + * Disallow DDL operations while indexing + * + * @return Mage_Index_Model_Indexer + */ + public function disallowTableChanges() + { + $this->_allowTableChanges = false; + return $this; + } + /** * Get event type name * diff --git a/app/code/core/Mage/Index/Model/Indexer/Abstract.php b/app/code/core/Mage/Index/Model/Indexer/Abstract.php index c633427359..99f8a1d523 100644 --- a/app/code/core/Mage/Index/Model/Indexer/Abstract.php +++ b/app/code/core/Mage/Index/Model/Indexer/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Index/Model/Mysql4/Abstract.php b/app/code/core/Mage/Index/Model/Mysql4/Abstract.php index dd4fc583da..54ce51fa01 100644 --- a/app/code/core/Mage/Index/Model/Mysql4/Abstract.php +++ b/app/code/core/Mage/Index/Model/Mysql4/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Index/Model/Mysql4/Event.php b/app/code/core/Mage/Index/Model/Mysql4/Event.php index ef45814a98..dda5fcb441 100644 --- a/app/code/core/Mage/Index/Model/Mysql4/Event.php +++ b/app/code/core/Mage/Index/Model/Mysql4/Event.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Index/Model/Mysql4/Event/Collection.php b/app/code/core/Mage/Index/Model/Mysql4/Event/Collection.php index b743b4e580..707fc48b4e 100644 --- a/app/code/core/Mage/Index/Model/Mysql4/Event/Collection.php +++ b/app/code/core/Mage/Index/Model/Mysql4/Event/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Index/Model/Mysql4/Process.php b/app/code/core/Mage/Index/Model/Mysql4/Process.php index 81042aae11..b38c5e1787 100644 --- a/app/code/core/Mage/Index/Model/Mysql4/Process.php +++ b/app/code/core/Mage/Index/Model/Mysql4/Process.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Index/Model/Mysql4/Process/Collection.php b/app/code/core/Mage/Index/Model/Mysql4/Process/Collection.php index 51b4bc66d5..4841a8b840 100644 --- a/app/code/core/Mage/Index/Model/Mysql4/Process/Collection.php +++ b/app/code/core/Mage/Index/Model/Mysql4/Process/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Index/Model/Mysql4/Setup.php b/app/code/core/Mage/Index/Model/Mysql4/Setup.php index 768e04c9ca..03a780a52a 100644 --- a/app/code/core/Mage/Index/Model/Mysql4/Setup.php +++ b/app/code/core/Mage/Index/Model/Mysql4/Setup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Index/Model/Observer.php b/app/code/core/Mage/Index/Model/Observer.php index 498bca0cf1..f373903d6d 100644 --- a/app/code/core/Mage/Index/Model/Observer.php +++ b/app/code/core/Mage/Index/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Index/Model/Process.php b/app/code/core/Mage/Index/Model/Process.php index b8c29699eb..014270af7f 100644 --- a/app/code/core/Mage/Index/Model/Process.php +++ b/app/code/core/Mage/Index/Model/Process.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -115,7 +115,8 @@ protected function _setEventNamespace(Mage_Index_Model_Event $event) /** * Remove indexer namespace from event * - * @return Mage_Index_Model_Process + * @param Mage_Index_Model_Event $event + * @return Mage_Index_Model_Process */ protected function _resetEventNamespace($event) { @@ -128,6 +129,7 @@ protected function _resetEventNamespace($event) * Register data required by process in event object * * @param Mage_Index_Model_Event $event + * @return Mage_Index_Model_Process */ public function register(Mage_Index_Model_Event $event) { @@ -500,6 +502,10 @@ public function __destruct() */ public function changeStatus($status) { + Mage::dispatchEvent('index_process_change_status', array( + 'process' => $this, + 'status' => $status + )); $this->_getResource()->updateStatus($this, $status); return $this; } diff --git a/app/code/core/Mage/Index/Model/Resource/Abstract.php b/app/code/core/Mage/Index/Model/Resource/Abstract.php index adf051f6f5..e9b02951dc 100755 --- a/app/code/core/Mage/Index/Model/Resource/Abstract.php +++ b/app/code/core/Mage/Index/Model/Resource/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Index/Model/Resource/Event.php b/app/code/core/Mage/Index/Model/Resource/Event.php index b411fce1c1..1f8da41538 100755 --- a/app/code/core/Mage/Index/Model/Resource/Event.php +++ b/app/code/core/Mage/Index/Model/Resource/Event.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Index/Model/Resource/Event/Collection.php b/app/code/core/Mage/Index/Model/Resource/Event/Collection.php index 1e1eb4c9f4..39996a9257 100755 --- a/app/code/core/Mage/Index/Model/Resource/Event/Collection.php +++ b/app/code/core/Mage/Index/Model/Resource/Event/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Index/Model/Resource/Helper/Mysql4.php b/app/code/core/Mage/Index/Model/Resource/Helper/Mysql4.php index d79387fd71..de7a0f6c7b 100644 --- a/app/code/core/Mage/Index/Model/Resource/Helper/Mysql4.php +++ b/app/code/core/Mage/Index/Model/Resource/Helper/Mysql4.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Index/Model/Resource/Process.php b/app/code/core/Mage/Index/Model/Resource/Process.php index ec35a2d653..5506eaa236 100755 --- a/app/code/core/Mage/Index/Model/Resource/Process.php +++ b/app/code/core/Mage/Index/Model/Resource/Process.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Index/Model/Resource/Process/Collection.php b/app/code/core/Mage/Index/Model/Resource/Process/Collection.php index 9b0b1e908c..ad8fff6712 100755 --- a/app/code/core/Mage/Index/Model/Resource/Process/Collection.php +++ b/app/code/core/Mage/Index/Model/Resource/Process/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Index/Model/Resource/Setup.php b/app/code/core/Mage/Index/Model/Resource/Setup.php index 4eab0bcde1..7b4fd82c55 100755 --- a/app/code/core/Mage/Index/Model/Resource/Setup.php +++ b/app/code/core/Mage/Index/Model/Resource/Setup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Index/controllers/Adminhtml/ProcessController.php b/app/code/core/Mage/Index/controllers/Adminhtml/ProcessController.php index dc0bfa1c04..c01f309aeb 100644 --- a/app/code/core/Mage/Index/controllers/Adminhtml/ProcessController.php +++ b/app/code/core/Mage/Index/controllers/Adminhtml/ProcessController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Index_Adminhtml_ProcessController extends Mage_Adminhtml_Controller_Action diff --git a/app/code/core/Mage/Index/etc/adminhtml.xml b/app/code/core/Mage/Index/etc/adminhtml.xml index 8bede62655..0eae737570 100644 --- a/app/code/core/Mage/Index/etc/adminhtml.xml +++ b/app/code/core/Mage/Index/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Index/etc/config.xml b/app/code/core/Mage/Index/etc/config.xml index 6dbe4f3d99..ddc1e8849c 100644 --- a/app/code/core/Mage/Index/etc/config.xml +++ b/app/code/core/Mage/Index/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Index/sql/index_setup/install-1.6.0.0.php b/app/code/core/Mage/Index/sql/index_setup/install-1.6.0.0.php index 01e4a12d41..f67946d7ff 100644 --- a/app/code/core/Mage/Index/sql/index_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Index/sql/index_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Index/sql/index_setup/mysql4-install-1.4.0.0.php b/app/code/core/Mage/Index/sql/index_setup/mysql4-install-1.4.0.0.php index afd875b49e..e2aea76bc7 100644 --- a/app/code/core/Mage/Index/sql/index_setup/mysql4-install-1.4.0.0.php +++ b/app/code/core/Mage/Index/sql/index_setup/mysql4-install-1.4.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Index/sql/index_setup/mysql4-upgrade-1.4.0.0-1.4.0.1.php b/app/code/core/Mage/Index/sql/index_setup/mysql4-upgrade-1.4.0.0-1.4.0.1.php index 6f6d733beb..ae7e33b176 100644 --- a/app/code/core/Mage/Index/sql/index_setup/mysql4-upgrade-1.4.0.0-1.4.0.1.php +++ b/app/code/core/Mage/Index/sql/index_setup/mysql4-upgrade-1.4.0.0-1.4.0.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Index/sql/index_setup/mysql4-upgrade-1.4.0.1-1.4.0.2.php b/app/code/core/Mage/Index/sql/index_setup/mysql4-upgrade-1.4.0.1-1.4.0.2.php index c64c0f6078..c88b0169d8 100644 --- a/app/code/core/Mage/Index/sql/index_setup/mysql4-upgrade-1.4.0.1-1.4.0.2.php +++ b/app/code/core/Mage/Index/sql/index_setup/mysql4-upgrade-1.4.0.1-1.4.0.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Index/sql/index_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/Index/sql/index_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php index f665567a63..2938cc37fe 100644 --- a/app/code/core/Mage/Index/sql/index_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ b/app/code/core/Mage/Index/sql/index_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/Block/Abstract.php b/app/code/core/Mage/Install/Block/Abstract.php index 7fa3b0ebf0..31ae59a478 100644 --- a/app/code/core/Mage/Install/Block/Abstract.php +++ b/app/code/core/Mage/Install/Block/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/Block/Admin.php b/app/code/core/Mage/Install/Block/Admin.php index e1287ba268..f9476898ed 100644 --- a/app/code/core/Mage/Install/Block/Admin.php +++ b/app/code/core/Mage/Install/Block/Admin.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/Block/Begin.php b/app/code/core/Mage/Install/Block/Begin.php index 47ef67ba32..0580d3e84d 100644 --- a/app/code/core/Mage/Install/Block/Begin.php +++ b/app/code/core/Mage/Install/Block/Begin.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/Block/Config.php b/app/code/core/Mage/Install/Block/Config.php index 5dbf971163..47b198861a 100644 --- a/app/code/core/Mage/Install/Block/Config.php +++ b/app/code/core/Mage/Install/Block/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/Block/Db/Main.php b/app/code/core/Mage/Install/Block/Db/Main.php index 461c81b5e9..6403e29e80 100644 --- a/app/code/core/Mage/Install/Block/Db/Main.php +++ b/app/code/core/Mage/Install/Block/Db/Main.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/Block/Db/Type.php b/app/code/core/Mage/Install/Block/Db/Type.php index 0263f49026..8be115d705 100644 --- a/app/code/core/Mage/Install/Block/Db/Type.php +++ b/app/code/core/Mage/Install/Block/Db/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/Block/Db/Type/Mysql4.php b/app/code/core/Mage/Install/Block/Db/Type/Mysql4.php index c0afd264de..0690dc55c2 100644 --- a/app/code/core/Mage/Install/Block/Db/Type/Mysql4.php +++ b/app/code/core/Mage/Install/Block/Db/Type/Mysql4.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/Block/Download.php b/app/code/core/Mage/Install/Block/Download.php index 4497d72a81..146ec6677b 100644 --- a/app/code/core/Mage/Install/Block/Download.php +++ b/app/code/core/Mage/Install/Block/Download.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/Block/End.php b/app/code/core/Mage/Install/Block/End.php index c216100552..5dbbb448d9 100644 --- a/app/code/core/Mage/Install/Block/End.php +++ b/app/code/core/Mage/Install/Block/End.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/Block/Locale.php b/app/code/core/Mage/Install/Block/Locale.php index f643c633f3..afed4d998f 100644 --- a/app/code/core/Mage/Install/Block/Locale.php +++ b/app/code/core/Mage/Install/Block/Locale.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/Block/State.php b/app/code/core/Mage/Install/Block/State.php index c5ae41a9ff..672af3ff44 100644 --- a/app/code/core/Mage/Install/Block/State.php +++ b/app/code/core/Mage/Install/Block/State.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/Controller/Action.php b/app/code/core/Mage/Install/Controller/Action.php index 31466a8d49..4d924b62a5 100644 --- a/app/code/core/Mage/Install/Controller/Action.php +++ b/app/code/core/Mage/Install/Controller/Action.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/Helper/Data.php b/app/code/core/Mage/Install/Helper/Data.php index cfe36d6094..b70f8a3730 100644 --- a/app/code/core/Mage/Install/Helper/Data.php +++ b/app/code/core/Mage/Install/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/Model/Config.php b/app/code/core/Mage/Install/Model/Config.php index 5ea19a7c99..4ac9d76c94 100644 --- a/app/code/core/Mage/Install/Model/Config.php +++ b/app/code/core/Mage/Install/Model/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/Model/Installer.php b/app/code/core/Mage/Install/Model/Installer.php index 607b2cbbf1..f29fbec0fb 100644 --- a/app/code/core/Mage/Install/Model/Installer.php +++ b/app/code/core/Mage/Install/Model/Installer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/Model/Installer/Abstract.php b/app/code/core/Mage/Install/Model/Installer/Abstract.php index 2b6d650777..ecad16ac1f 100644 --- a/app/code/core/Mage/Install/Model/Installer/Abstract.php +++ b/app/code/core/Mage/Install/Model/Installer/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/Model/Installer/Config.php b/app/code/core/Mage/Install/Model/Installer/Config.php index da0edfc988..441815a281 100644 --- a/app/code/core/Mage/Install/Model/Installer/Config.php +++ b/app/code/core/Mage/Install/Model/Installer/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/Model/Installer/Console.php b/app/code/core/Mage/Install/Model/Installer/Console.php index 1753e49ddd..c1d139563c 100644 --- a/app/code/core/Mage/Install/Model/Installer/Console.php +++ b/app/code/core/Mage/Install/Model/Installer/Console.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/Model/Installer/Data.php b/app/code/core/Mage/Install/Model/Installer/Data.php index 0efb75fd65..e01190aca2 100644 --- a/app/code/core/Mage/Install/Model/Installer/Data.php +++ b/app/code/core/Mage/Install/Model/Installer/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/Model/Installer/Db.php b/app/code/core/Mage/Install/Model/Installer/Db.php index 43c5b31d22..630a607855 100644 --- a/app/code/core/Mage/Install/Model/Installer/Db.php +++ b/app/code/core/Mage/Install/Model/Installer/Db.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/Model/Installer/Db/Abstract.php b/app/code/core/Mage/Install/Model/Installer/Db/Abstract.php index 2d2026ce19..ff1abf4f3d 100644 --- a/app/code/core/Mage/Install/Model/Installer/Db/Abstract.php +++ b/app/code/core/Mage/Install/Model/Installer/Db/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/Model/Installer/Db/Mysql4.php b/app/code/core/Mage/Install/Model/Installer/Db/Mysql4.php index 4ef7e60068..bc482b5d0f 100644 --- a/app/code/core/Mage/Install/Model/Installer/Db/Mysql4.php +++ b/app/code/core/Mage/Install/Model/Installer/Db/Mysql4.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/Model/Installer/Env.php b/app/code/core/Mage/Install/Model/Installer/Env.php index 09360b8aaa..8030e2c504 100644 --- a/app/code/core/Mage/Install/Model/Installer/Env.php +++ b/app/code/core/Mage/Install/Model/Installer/Env.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/Model/Installer/Filesystem.php b/app/code/core/Mage/Install/Model/Installer/Filesystem.php index 3ae5a88e67..de522604d0 100644 --- a/app/code/core/Mage/Install/Model/Installer/Filesystem.php +++ b/app/code/core/Mage/Install/Model/Installer/Filesystem.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/Model/Installer/Pear.php b/app/code/core/Mage/Install/Model/Installer/Pear.php index 65ebae8227..89e3b7988d 100644 --- a/app/code/core/Mage/Install/Model/Installer/Pear.php +++ b/app/code/core/Mage/Install/Model/Installer/Pear.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/Model/Observer.php b/app/code/core/Mage/Install/Model/Observer.php index 3d3df06d98..3fc54b440b 100644 --- a/app/code/core/Mage/Install/Model/Observer.php +++ b/app/code/core/Mage/Install/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/Model/Session.php b/app/code/core/Mage/Install/Model/Session.php index 1911d3822c..d96f67e9b6 100644 --- a/app/code/core/Mage/Install/Model/Session.php +++ b/app/code/core/Mage/Install/Model/Session.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/Model/Wizard.php b/app/code/core/Mage/Install/Model/Wizard.php index 50f9715909..eabffd9b51 100644 --- a/app/code/core/Mage/Install/Model/Wizard.php +++ b/app/code/core/Mage/Install/Model/Wizard.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/controllers/IndexController.php b/app/code/core/Mage/Install/controllers/IndexController.php index 08d8fb20eb..e4c04a0da1 100644 --- a/app/code/core/Mage/Install/controllers/IndexController.php +++ b/app/code/core/Mage/Install/controllers/IndexController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/controllers/WizardController.php b/app/code/core/Mage/Install/controllers/WizardController.php index 8756974e41..2ca8030bdf 100644 --- a/app/code/core/Mage/Install/controllers/WizardController.php +++ b/app/code/core/Mage/Install/controllers/WizardController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/etc/config.xml b/app/code/core/Mage/Install/etc/config.xml index 19278abd80..5606b3e1ee 100644 --- a/app/code/core/Mage/Install/etc/config.xml +++ b/app/code/core/Mage/Install/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Install/etc/install.xml b/app/code/core/Mage/Install/etc/install.xml index 7be419507d..fdc42f38f6 100644 --- a/app/code/core/Mage/Install/etc/install.xml +++ b/app/code/core/Mage/Install/etc/install.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Log/Helper/Data.php b/app/code/core/Mage/Log/Helper/Data.php index 3e373039a1..cfc6dd24f4 100644 --- a/app/code/core/Mage/Log/Helper/Data.php +++ b/app/code/core/Mage/Log/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Log - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Log/Model/Aggregation.php b/app/code/core/Mage/Log/Model/Aggregation.php index 11a0941052..2c042e8e75 100644 --- a/app/code/core/Mage/Log/Model/Aggregation.php +++ b/app/code/core/Mage/Log/Model/Aggregation.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Log - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Log/Model/Cron.php b/app/code/core/Mage/Log/Model/Cron.php index ee6cd561af..3b3081f292 100644 --- a/app/code/core/Mage/Log/Model/Cron.php +++ b/app/code/core/Mage/Log/Model/Cron.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Log - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Log/Model/Customer.php b/app/code/core/Mage/Log/Model/Customer.php index 74698f91d5..b27d3b51c2 100644 --- a/app/code/core/Mage/Log/Model/Customer.php +++ b/app/code/core/Mage/Log/Model/Customer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Log - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Log/Model/Log.php b/app/code/core/Mage/Log/Model/Log.php index 811f25f52e..c064001cdf 100644 --- a/app/code/core/Mage/Log/Model/Log.php +++ b/app/code/core/Mage/Log/Model/Log.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Log - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Log/Model/Mysql4/Aggregation.php b/app/code/core/Mage/Log/Model/Mysql4/Aggregation.php index 2591a9cb6e..68979d96aa 100644 --- a/app/code/core/Mage/Log/Model/Mysql4/Aggregation.php +++ b/app/code/core/Mage/Log/Model/Mysql4/Aggregation.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Log - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Log/Model/Mysql4/Customer.php b/app/code/core/Mage/Log/Model/Mysql4/Customer.php index 026b13b8ba..e74a29afc1 100644 --- a/app/code/core/Mage/Log/Model/Mysql4/Customer.php +++ b/app/code/core/Mage/Log/Model/Mysql4/Customer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Log - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Log/Model/Mysql4/Log.php b/app/code/core/Mage/Log/Model/Mysql4/Log.php index 137a7be2ae..ccc28610c3 100644 --- a/app/code/core/Mage/Log/Model/Mysql4/Log.php +++ b/app/code/core/Mage/Log/Model/Mysql4/Log.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Log - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Log/Model/Mysql4/Visitor.php b/app/code/core/Mage/Log/Model/Mysql4/Visitor.php index 0462f5a156..829dfe2e2a 100644 --- a/app/code/core/Mage/Log/Model/Mysql4/Visitor.php +++ b/app/code/core/Mage/Log/Model/Mysql4/Visitor.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Log - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Log/Model/Mysql4/Visitor/Collection.php b/app/code/core/Mage/Log/Model/Mysql4/Visitor/Collection.php index 1e592465d1..d33047af86 100644 --- a/app/code/core/Mage/Log/Model/Mysql4/Visitor/Collection.php +++ b/app/code/core/Mage/Log/Model/Mysql4/Visitor/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Log - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Log/Model/Mysql4/Visitor/Online.php b/app/code/core/Mage/Log/Model/Mysql4/Visitor/Online.php index ad700caf55..364a7e893d 100644 --- a/app/code/core/Mage/Log/Model/Mysql4/Visitor/Online.php +++ b/app/code/core/Mage/Log/Model/Mysql4/Visitor/Online.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Log - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Log/Model/Mysql4/Visitor/Online/Collection.php b/app/code/core/Mage/Log/Model/Mysql4/Visitor/Online/Collection.php index 71384dbb67..411825c334 100644 --- a/app/code/core/Mage/Log/Model/Mysql4/Visitor/Online/Collection.php +++ b/app/code/core/Mage/Log/Model/Mysql4/Visitor/Online/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Log - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Log/Model/Resource/Aggregation.php b/app/code/core/Mage/Log/Model/Resource/Aggregation.php index 719aaedb34..524f9f6fad 100644 --- a/app/code/core/Mage/Log/Model/Resource/Aggregation.php +++ b/app/code/core/Mage/Log/Model/Resource/Aggregation.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Log - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Log/Model/Resource/Customer.php b/app/code/core/Mage/Log/Model/Resource/Customer.php index 5f3c15d002..ce9c4a7709 100755 --- a/app/code/core/Mage/Log/Model/Resource/Customer.php +++ b/app/code/core/Mage/Log/Model/Resource/Customer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Log - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Log/Model/Resource/Log.php b/app/code/core/Mage/Log/Model/Resource/Log.php index a7ba21f871..617beee030 100755 --- a/app/code/core/Mage/Log/Model/Resource/Log.php +++ b/app/code/core/Mage/Log/Model/Resource/Log.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Log - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Log/Model/Resource/Visitor.php b/app/code/core/Mage/Log/Model/Resource/Visitor.php index aea1cac85f..a27fc48fda 100755 --- a/app/code/core/Mage/Log/Model/Resource/Visitor.php +++ b/app/code/core/Mage/Log/Model/Resource/Visitor.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Log - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Log/Model/Resource/Visitor/Collection.php b/app/code/core/Mage/Log/Model/Resource/Visitor/Collection.php index 2c8f9f5afc..ef906a7dab 100755 --- a/app/code/core/Mage/Log/Model/Resource/Visitor/Collection.php +++ b/app/code/core/Mage/Log/Model/Resource/Visitor/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Log - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Log/Model/Resource/Visitor/Online.php b/app/code/core/Mage/Log/Model/Resource/Visitor/Online.php index f0c7d541e3..4fe056792b 100755 --- a/app/code/core/Mage/Log/Model/Resource/Visitor/Online.php +++ b/app/code/core/Mage/Log/Model/Resource/Visitor/Online.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Log - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Log/Model/Resource/Visitor/Online/Collection.php b/app/code/core/Mage/Log/Model/Resource/Visitor/Online/Collection.php index d9504fd7c1..182f5dfff6 100755 --- a/app/code/core/Mage/Log/Model/Resource/Visitor/Online/Collection.php +++ b/app/code/core/Mage/Log/Model/Resource/Visitor/Online/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Log - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Log/Model/Visitor.php b/app/code/core/Mage/Log/Model/Visitor.php index f1620224eb..c8423ac82d 100644 --- a/app/code/core/Mage/Log/Model/Visitor.php +++ b/app/code/core/Mage/Log/Model/Visitor.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Log - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -165,6 +165,7 @@ public function initByRequest($observer) $this->setFirstVisitAt(now()); $this->setIsNewVisitor(true); $this->save(); + Mage::dispatchEvent('visitor_init', array('visitor' => $this)); } return $this; } diff --git a/app/code/core/Mage/Log/Model/Visitor/Online.php b/app/code/core/Mage/Log/Model/Visitor/Online.php index d7239eb199..886f87aeca 100644 --- a/app/code/core/Mage/Log/Model/Visitor/Online.php +++ b/app/code/core/Mage/Log/Model/Visitor/Online.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Log - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Log/data/log_setup/data-install-1.6.0.0.php b/app/code/core/Mage/Log/data/log_setup/data-install-1.6.0.0.php index 06a1737ee2..65b96f057b 100644 --- a/app/code/core/Mage/Log/data/log_setup/data-install-1.6.0.0.php +++ b/app/code/core/Mage/Log/data/log_setup/data-install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Log - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Log/etc/config.xml b/app/code/core/Mage/Log/etc/config.xml index a8c30af020..3516258b77 100644 --- a/app/code/core/Mage/Log/etc/config.xml +++ b/app/code/core/Mage/Log/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Log - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Log/etc/system.xml b/app/code/core/Mage/Log/etc/system.xml index d829e24632..ccac0a73d2 100644 --- a/app/code/core/Mage/Log/etc/system.xml +++ b/app/code/core/Mage/Log/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Log - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Log/sql/log_setup/install-1.6.0.0.php b/app/code/core/Mage/Log/sql/log_setup/install-1.6.0.0.php index ab67fc4530..161d3a8540 100644 --- a/app/code/core/Mage/Log/sql/log_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Log/sql/log_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Log - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Log/sql/log_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/Log/sql/log_setup/mysql4-install-0.7.0.php index 8bff39f5d8..2fad195566 100644 --- a/app/code/core/Mage/Log/sql/log_setup/mysql4-install-0.7.0.php +++ b/app/code/core/Mage/Log/sql/log_setup/mysql4-install-0.7.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Log - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-0.7.0-0.7.1.php b/app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-0.7.0-0.7.1.php index 77944931fd..35f950194b 100644 --- a/app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-0.7.0-0.7.1.php +++ b/app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-0.7.0-0.7.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Log - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-0.7.1-0.7.2.php b/app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-0.7.1-0.7.2.php index 2904f9309c..a70c5ce09d 100644 --- a/app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-0.7.1-0.7.2.php +++ b/app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-0.7.1-0.7.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Log - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-0.7.3-0.7.4.php b/app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-0.7.3-0.7.4.php index 6e39dfbd99..7a32bf38ed 100644 --- a/app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-0.7.3-0.7.4.php +++ b/app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-0.7.3-0.7.4.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Log - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-0.7.4-0.7.5.php b/app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-0.7.4-0.7.5.php index 13a328f1bb..08b3ed9b8c 100644 --- a/app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-0.7.4-0.7.5.php +++ b/app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-0.7.4-0.7.5.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Log - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-0.7.5-0.7.6.php b/app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-0.7.5-0.7.6.php index e7138a23fc..457285ee25 100644 --- a/app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-0.7.5-0.7.6.php +++ b/app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-0.7.5-0.7.6.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Log - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-0.7.6-0.7.7.php b/app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-0.7.6-0.7.7.php index c2c60bcca1..b9f9c97084 100644 --- a/app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-0.7.6-0.7.7.php +++ b/app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-0.7.6-0.7.7.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Log - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php index 9b91186bf2..17cf0afb73 100644 --- a/app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ b/app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Log - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Media/Helper/Data.php b/app/code/core/Mage/Media/Helper/Data.php index b5613f0f04..7680cc3f6f 100644 --- a/app/code/core/Mage/Media/Helper/Data.php +++ b/app/code/core/Mage/Media/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Media - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Media/Model/File/Image.php b/app/code/core/Mage/Media/Model/File/Image.php index 346c7c2e1c..1f75315a75 100644 --- a/app/code/core/Mage/Media/Model/File/Image.php +++ b/app/code/core/Mage/Media/Model/File/Image.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Media - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Media/Model/Image.php b/app/code/core/Mage/Media/Model/Image.php index e05bfd6c3d..0095dc6eb8 100644 --- a/app/code/core/Mage/Media/Model/Image.php +++ b/app/code/core/Mage/Media/Model/Image.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Media - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Media/Model/Image/Config/Interface.php b/app/code/core/Mage/Media/Model/Image/Config/Interface.php index 8b5fac849c..2efb2e44ad 100644 --- a/app/code/core/Mage/Media/Model/Image/Config/Interface.php +++ b/app/code/core/Mage/Media/Model/Image/Config/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Media - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Media/etc/config.xml b/app/code/core/Mage/Media/etc/config.xml index 61dbb37838..b619fd9510 100644 --- a/app/code/core/Mage/Media/etc/config.xml +++ b/app/code/core/Mage/Media/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Media - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Newsletter/Block/Subscribe.php b/app/code/core/Mage/Newsletter/Block/Subscribe.php index 2e104b2430..1b7b409eb3 100644 --- a/app/code/core/Mage/Newsletter/Block/Subscribe.php +++ b/app/code/core/Mage/Newsletter/Block/Subscribe.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Newsletter/Helper/Data.php b/app/code/core/Mage/Newsletter/Helper/Data.php index e1f06c2c5a..fdfa5f818f 100644 --- a/app/code/core/Mage/Newsletter/Helper/Data.php +++ b/app/code/core/Mage/Newsletter/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Newsletter/Model/Message.php b/app/code/core/Mage/Newsletter/Model/Message.php index b5b00aafdc..0a4928fb59 100644 --- a/app/code/core/Mage/Newsletter/Model/Message.php +++ b/app/code/core/Mage/Newsletter/Model/Message.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Newsletter/Model/Mysql4/Problem.php b/app/code/core/Mage/Newsletter/Model/Mysql4/Problem.php index 77ac9f478f..fc8494157f 100644 --- a/app/code/core/Mage/Newsletter/Model/Mysql4/Problem.php +++ b/app/code/core/Mage/Newsletter/Model/Mysql4/Problem.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Newsletter/Model/Mysql4/Problem/Collection.php b/app/code/core/Mage/Newsletter/Model/Mysql4/Problem/Collection.php index b6c44eef18..14ebcdf67d 100644 --- a/app/code/core/Mage/Newsletter/Model/Mysql4/Problem/Collection.php +++ b/app/code/core/Mage/Newsletter/Model/Mysql4/Problem/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Newsletter/Model/Mysql4/Queue.php b/app/code/core/Mage/Newsletter/Model/Mysql4/Queue.php index e8acfcd4c9..de677e55d7 100644 --- a/app/code/core/Mage/Newsletter/Model/Mysql4/Queue.php +++ b/app/code/core/Mage/Newsletter/Model/Mysql4/Queue.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Newsletter/Model/Mysql4/Queue/Collection.php b/app/code/core/Mage/Newsletter/Model/Mysql4/Queue/Collection.php index 158a02b92e..0b225746aa 100644 --- a/app/code/core/Mage/Newsletter/Model/Mysql4/Queue/Collection.php +++ b/app/code/core/Mage/Newsletter/Model/Mysql4/Queue/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Newsletter/Model/Mysql4/Subscriber.php b/app/code/core/Mage/Newsletter/Model/Mysql4/Subscriber.php index 9d0fcaa2db..124070668f 100644 --- a/app/code/core/Mage/Newsletter/Model/Mysql4/Subscriber.php +++ b/app/code/core/Mage/Newsletter/Model/Mysql4/Subscriber.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Newsletter/Model/Mysql4/Subscriber/Collection.php b/app/code/core/Mage/Newsletter/Model/Mysql4/Subscriber/Collection.php index 98741c10d3..2eb3b4fc2a 100644 --- a/app/code/core/Mage/Newsletter/Model/Mysql4/Subscriber/Collection.php +++ b/app/code/core/Mage/Newsletter/Model/Mysql4/Subscriber/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Newsletter/Model/Mysql4/Template.php b/app/code/core/Mage/Newsletter/Model/Mysql4/Template.php index bd0010ffe6..5ab0404ff0 100644 --- a/app/code/core/Mage/Newsletter/Model/Mysql4/Template.php +++ b/app/code/core/Mage/Newsletter/Model/Mysql4/Template.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Newsletter/Model/Mysql4/Template/Collection.php b/app/code/core/Mage/Newsletter/Model/Mysql4/Template/Collection.php index 0bcd66f4c1..e748746edc 100644 --- a/app/code/core/Mage/Newsletter/Model/Mysql4/Template/Collection.php +++ b/app/code/core/Mage/Newsletter/Model/Mysql4/Template/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Newsletter/Model/Observer.php b/app/code/core/Mage/Newsletter/Model/Observer.php index 26b3e1c793..e66008571f 100644 --- a/app/code/core/Mage/Newsletter/Model/Observer.php +++ b/app/code/core/Mage/Newsletter/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Newsletter/Model/Problem.php b/app/code/core/Mage/Newsletter/Model/Problem.php index 59b5b65783..c1eb96ac1c 100644 --- a/app/code/core/Mage/Newsletter/Model/Problem.php +++ b/app/code/core/Mage/Newsletter/Model/Problem.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Newsletter/Model/Queue.php b/app/code/core/Mage/Newsletter/Model/Queue.php index 9962077918..6a8385a449 100644 --- a/app/code/core/Mage/Newsletter/Model/Queue.php +++ b/app/code/core/Mage/Newsletter/Model/Queue.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Newsletter/Model/Resource/Problem.php b/app/code/core/Mage/Newsletter/Model/Resource/Problem.php index cbbd32b3c9..fec46baf21 100755 --- a/app/code/core/Mage/Newsletter/Model/Resource/Problem.php +++ b/app/code/core/Mage/Newsletter/Model/Resource/Problem.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Newsletter/Model/Resource/Problem/Collection.php b/app/code/core/Mage/Newsletter/Model/Resource/Problem/Collection.php index 9fc65ac49e..d03d252cf3 100755 --- a/app/code/core/Mage/Newsletter/Model/Resource/Problem/Collection.php +++ b/app/code/core/Mage/Newsletter/Model/Resource/Problem/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -85,7 +85,7 @@ public function addQueueInfo() 'main_table.queue_id = queue.queue_id', array('queue_start_at', 'queue_finish_at') ) - ->joinLeft(array('template'=>$this->getTable('newsletter/template')), 'main_table.queue_id = queue.queue_id', + ->joinLeft(array('template'=>$this->getTable('newsletter/template')), 'queue.template_id = template.template_id', array('template_subject','template_code','template_sender_name','template_sender_email') ); return $this; diff --git a/app/code/core/Mage/Newsletter/Model/Resource/Queue.php b/app/code/core/Mage/Newsletter/Model/Resource/Queue.php index 7d5ab93859..29350bb8b4 100755 --- a/app/code/core/Mage/Newsletter/Model/Resource/Queue.php +++ b/app/code/core/Mage/Newsletter/Model/Resource/Queue.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Newsletter/Model/Resource/Queue/Collection.php b/app/code/core/Mage/Newsletter/Model/Resource/Queue/Collection.php index b16383edb6..9671e3e0a3 100755 --- a/app/code/core/Mage/Newsletter/Model/Resource/Queue/Collection.php +++ b/app/code/core/Mage/Newsletter/Model/Resource/Queue/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Newsletter/Model/Resource/Subscriber.php b/app/code/core/Mage/Newsletter/Model/Resource/Subscriber.php index c94b2ef5df..bad288038d 100755 --- a/app/code/core/Mage/Newsletter/Model/Resource/Subscriber.php +++ b/app/code/core/Mage/Newsletter/Model/Resource/Subscriber.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Newsletter/Model/Resource/Subscriber/Collection.php b/app/code/core/Mage/Newsletter/Model/Resource/Subscriber/Collection.php index e76f0f4ff4..8162d4df6f 100755 --- a/app/code/core/Mage/Newsletter/Model/Resource/Subscriber/Collection.php +++ b/app/code/core/Mage/Newsletter/Model/Resource/Subscriber/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Newsletter/Model/Resource/Template.php b/app/code/core/Mage/Newsletter/Model/Resource/Template.php index 5b11aaf237..ff0fbd5405 100755 --- a/app/code/core/Mage/Newsletter/Model/Resource/Template.php +++ b/app/code/core/Mage/Newsletter/Model/Resource/Template.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Newsletter/Model/Resource/Template/Collection.php b/app/code/core/Mage/Newsletter/Model/Resource/Template/Collection.php index 028763f8f3..763ca2eab0 100755 --- a/app/code/core/Mage/Newsletter/Model/Resource/Template/Collection.php +++ b/app/code/core/Mage/Newsletter/Model/Resource/Template/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Newsletter/Model/Session.php b/app/code/core/Mage/Newsletter/Model/Session.php index 83b889bd05..3f9826b9d3 100644 --- a/app/code/core/Mage/Newsletter/Model/Session.php +++ b/app/code/core/Mage/Newsletter/Model/Session.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Newsletter/Model/Subscriber.php b/app/code/core/Mage/Newsletter/Model/Subscriber.php index b62834027b..fce94c6f6c 100644 --- a/app/code/core/Mage/Newsletter/Model/Subscriber.php +++ b/app/code/core/Mage/Newsletter/Model/Subscriber.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -445,7 +445,8 @@ public function subscribeCustomer($customer) ->setCustomerId($customer->getId()) ->setEmail($customer->getEmail()); } else { - $this->setEmail($customer->getEmail()); + $this->setStoreId($customer->getStoreId()) + ->setEmail($customer->getEmail()); } $this->save(); diff --git a/app/code/core/Mage/Newsletter/Model/Template.php b/app/code/core/Mage/Newsletter/Model/Template.php index 6eb6c65b8d..e6113f2a08 100644 --- a/app/code/core/Mage/Newsletter/Model/Template.php +++ b/app/code/core/Mage/Newsletter/Model/Template.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Newsletter/Model/Template/Filter.php b/app/code/core/Mage/Newsletter/Model/Template/Filter.php index 88835a0075..7bef97a92b 100644 --- a/app/code/core/Mage/Newsletter/Model/Template/Filter.php +++ b/app/code/core/Mage/Newsletter/Model/Template/Filter.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Newsletter/controllers/ManageController.php b/app/code/core/Mage/Newsletter/controllers/ManageController.php index e2140a7925..aa8319248f 100644 --- a/app/code/core/Mage/Newsletter/controllers/ManageController.php +++ b/app/code/core/Mage/Newsletter/controllers/ManageController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Newsletter/controllers/SubscriberController.php b/app/code/core/Mage/Newsletter/controllers/SubscriberController.php index f65a8181ef..e25c19f3f1 100644 --- a/app/code/core/Mage/Newsletter/controllers/SubscriberController.php +++ b/app/code/core/Mage/Newsletter/controllers/SubscriberController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Newsletter/data/newsletter_setup/data-upgrade-1.6.0.0-1.6.0.1.php b/app/code/core/Mage/Newsletter/data/newsletter_setup/data-upgrade-1.6.0.0-1.6.0.1.php index 14b76128b0..843964ee23 100644 --- a/app/code/core/Mage/Newsletter/data/newsletter_setup/data-upgrade-1.6.0.0-1.6.0.1.php +++ b/app/code/core/Mage/Newsletter/data/newsletter_setup/data-upgrade-1.6.0.0-1.6.0.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Newsletter/etc/adminhtml.xml b/app/code/core/Mage/Newsletter/etc/adminhtml.xml index 080085ae93..e9dd1c5f01 100644 --- a/app/code/core/Mage/Newsletter/etc/adminhtml.xml +++ b/app/code/core/Mage/Newsletter/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Newsletter/etc/config.xml b/app/code/core/Mage/Newsletter/etc/config.xml index 660540f165..131c5c7f04 100644 --- a/app/code/core/Mage/Newsletter/etc/config.xml +++ b/app/code/core/Mage/Newsletter/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Newsletter/etc/system.xml b/app/code/core/Mage/Newsletter/etc/system.xml index f5f6b7de09..b742dc266a 100644 --- a/app/code/core/Mage/Newsletter/etc/system.xml +++ b/app/code/core/Mage/Newsletter/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Newsletter/sql/newsletter_setup/install-1.6.0.0.php b/app/code/core/Mage/Newsletter/sql/newsletter_setup/install-1.6.0.0.php index 7a80417e85..21fc36fdbe 100644 --- a/app/code/core/Mage/Newsletter/sql/newsletter_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Newsletter/sql/newsletter_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-install-0.7.0.php index b633a5e87d..ead3161582 100644 --- a/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-install-0.7.0.php +++ b/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-install-0.7.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-install-0.8.0.php b/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-install-0.8.0.php index d0c74a5ee1..00f2d5afa0 100644 --- a/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-install-0.8.0.php +++ b/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-install-0.8.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-upgrade-0.7.0-0.7.1.php b/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-upgrade-0.7.0-0.7.1.php index 363ee92120..796c7a2072 100644 --- a/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-upgrade-0.7.0-0.7.1.php +++ b/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-upgrade-0.7.0-0.7.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-upgrade-0.8.0-0.8.1.php b/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-upgrade-0.8.0-0.8.1.php index 5192725c05..6e8cf49655 100644 --- a/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-upgrade-0.8.0-0.8.1.php +++ b/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-upgrade-0.8.0-0.8.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-upgrade-0.8.1-0.8.2.php b/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-upgrade-0.8.1-0.8.2.php index 80cc42cc07..b60c623347 100644 --- a/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-upgrade-0.8.1-0.8.2.php +++ b/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-upgrade-0.8.1-0.8.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-upgrade-0.8.2-0.8.3.php b/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-upgrade-0.8.2-0.8.3.php index d42dbc16d8..43907eac44 100644 --- a/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-upgrade-0.8.2-0.8.3.php +++ b/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-upgrade-0.8.2-0.8.3.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php index 691df63a5f..fe956c645d 100644 --- a/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ b/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Page/Block/Html.php b/app/code/core/Mage/Page/Block/Html.php index b85648f530..e444340856 100644 --- a/app/code/core/Mage/Page/Block/Html.php +++ b/app/code/core/Mage/Page/Block/Html.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Page - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Page/Block/Html/Breadcrumbs.php b/app/code/core/Mage/Page/Block/Html/Breadcrumbs.php index cb967f9143..440fd52fb5 100644 --- a/app/code/core/Mage/Page/Block/Html/Breadcrumbs.php +++ b/app/code/core/Mage/Page/Block/Html/Breadcrumbs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Page - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Page/Block/Html/Footer.php b/app/code/core/Mage/Page/Block/Html/Footer.php index 78edf8752b..985b0276f7 100644 --- a/app/code/core/Mage/Page/Block/Html/Footer.php +++ b/app/code/core/Mage/Page/Block/Html/Footer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Page - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Page/Block/Html/Head.php b/app/code/core/Mage/Page/Block/Html/Head.php index fe56438158..b081413cb0 100644 --- a/app/code/core/Mage/Page/Block/Html/Head.php +++ b/app/code/core/Mage/Page/Block/Html/Head.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Page - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Page/Block/Html/Header.php b/app/code/core/Mage/Page/Block/Html/Header.php index c74ee88770..654b1a0f60 100644 --- a/app/code/core/Mage/Page/Block/Html/Header.php +++ b/app/code/core/Mage/Page/Block/Html/Header.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Page - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Page/Block/Html/Notices.php b/app/code/core/Mage/Page/Block/Html/Notices.php index 07eb0bd995..f54c1bac6f 100644 --- a/app/code/core/Mage/Page/Block/Html/Notices.php +++ b/app/code/core/Mage/Page/Block/Html/Notices.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Page - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -33,6 +33,10 @@ */ class Mage_Page_Block_Html_Notices extends Mage_Core_Block_Template { + /** + * Path to configuration, check is enable cookie restriction mode + */ + const XML_PATH_COOKIE_RESTRICTION = 'web/cookie/cookie_restriction'; /** * Check if noscript notice should be displayed @@ -54,4 +58,49 @@ public function displayDemoNotice() return Mage::getStoreConfig('design/head/demonotice'); } + /** + * Check if cookie restriction notice should be displayed + * + * @return bool + */ + public function displayCookieRestrictionNotice() + { + $acceptedSaveCookiesWebsites = $this->_getAcceptedSaveCookiesWebsites(); + return Mage::getStoreConfig(self::XML_PATH_COOKIE_RESTRICTION) && + empty($acceptedSaveCookiesWebsites[Mage::app()->getWebsite()->getId()]); + } + + /** + * Get Link to cookie restriction privacy policy page + * + * @return string + */ + public function getPrivacyPolicyLink() + { + return Mage::getUrl('privacy-policy-cookie-restriction-mode'); + } + + /** + * Return serialzed list of accepted save cookie website + * + * @return string + */ + public function getAcceptedSaveCookiesWebsiteIds() + { + $acceptedSaveCookiesWebsites = $this->_getAcceptedSaveCookiesWebsites(); + $acceptedSaveCookiesWebsites[Mage::app()->getWebsite()->getId()] = 1; + return serialize($acceptedSaveCookiesWebsites); + } + + /** + * Get accepted save cookies websites + * + * @return array + */ + protected function _getAcceptedSaveCookiesWebsites() + { + $serializedList = Mage::getSingleton('core/cookie')->get(Mage_Page_Helper_Data::IS_USER_ALLOWED_SAVE_COOKIE); + $unSerializedList = unserialize($serializedList); + return is_array($unSerializedList) ? $unSerializedList : array(); + } } diff --git a/app/code/core/Mage/Page/Block/Html/Pager.php b/app/code/core/Mage/Page/Block/Html/Pager.php index 67efcdca1b..2063606417 100644 --- a/app/code/core/Mage/Page/Block/Html/Pager.php +++ b/app/code/core/Mage/Page/Block/Html/Pager.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Page - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Page/Block/Html/Toplinks.php b/app/code/core/Mage/Page/Block/Html/Toplinks.php index fe2cc8db1e..d8d6c0cf31 100644 --- a/app/code/core/Mage/Page/Block/Html/Toplinks.php +++ b/app/code/core/Mage/Page/Block/Html/Toplinks.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Page - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Page/Block/Html/Topmenu.php b/app/code/core/Mage/Page/Block/Html/Topmenu.php new file mode 100644 index 0000000000..2b7b162bbc --- /dev/null +++ b/app/code/core/Mage/Page/Block/Html/Topmenu.php @@ -0,0 +1,206 @@ + + */ +class Mage_Page_Block_Html_Topmenu extends Mage_Core_Block_Template +{ + /** + * Top menu data tree + * + * @var Varien_Data_Tree_Node + */ + protected $_menu; + + /** + * Init top menu tree structure + */ + public function _construct() + { + $this->_menu = new Varien_Data_Tree_Node(array(), 'root', new Varien_Data_Tree()); + } + + /** + * Get top menu html + * + * @param string $outermostClass + * @param string $childrenWrapClass + * @return string + */ + public function getHtml($outermostClass = '', $childrenWrapClass = '') + { + Mage::dispatchEvent('page_block_html_topmenu_gethtml_before', array( + 'menu' => $this->_menu + )); + + $this->_menu->setOutermostClass($outermostClass); + $this->_menu->setChildrenWrapClass($childrenWrapClass); + + $html = $this->_getHtml($this->_menu, $childrenWrapClass); + + Mage::dispatchEvent('page_block_html_topmenu_gethtml_after', array( + 'menu' => $this->_menu, + 'html' => $html + )); + + return $html; + } + + /** + * Recursively generates top menu html from data that is specified in $menuTree + * + * @param Varien_Data_Tree_Node $menuTree + * @param string $childrenWrapClass + * @return string + */ + protected function _getHtml(Varien_Data_Tree_Node $menuTree, $childrenWrapClass) + { + $html = ''; + + $children = $menuTree->getChildren(); + $parentLevel = $menuTree->getLevel(); + $childLevel = is_null($parentLevel) ? 0 : $parentLevel + 1; + + $counter = 1; + $childrenCount = $children->count(); + + $parentPositionClass = $menuTree->getPositionClass(); + $itemPositionClassPrefix = $parentPositionClass ? $parentPositionClass . '-' : 'nav-'; + + foreach ($children as $child) { + + $child->setLevel($childLevel); + $child->setIsFirst($counter == 1); + $child->setIsLast($counter == $childrenCount); + $child->setPositionClass($itemPositionClassPrefix . $counter); + + $outermostClassCode = ''; + $outermostClass = $menuTree->getOutermostClass(); + + if ($childLevel == 0 && $outermostClass) { + $outermostClassCode = ' class="' . $outermostClass . '" '; + $child->setClass($outermostClass); + } + + $html .= '
  • _getRenderedMenuItemAttributes($child) . '>'; + $html .= '' + . $this->escapeHtml($child->getName()) . ''; + + if ($child->hasChildren()) { + if (!empty($childrenWrapClass)) { + $html .= '
    '; + } + $html .= '
      '; + $html .= $this->_getHtml($child, $childrenWrapClass); + $html .= '
    '; + + if (!empty($childrenWrapClass)) { + $html .= '
    '; + } + } + $html .= '
  • '; + + $counter++; + } + + return $html; + } + + /** + * Generates string with all attributes that should be present in menu item element + * + * @param Varien_Data_Tree_Node $item + * @return string + */ + protected function _getRenderedMenuItemAttributes(Varien_Data_Tree_Node $item) + { + $html = ''; + $attributes = $this->_getMenuItemAttributes($item); + + foreach ($attributes as $attributeName => $attributeValue) { + $html .= ' ' . $attributeName . '="' . str_replace('"', '\"', $attributeValue) . '"'; + } + + return $html; + } + + /** + * Returns array of menu item's attributes + * + * @param Varien_Data_Tree_Node $item + * @return array + */ + protected function _getMenuItemAttributes(Varien_Data_Tree_Node $item) + { + $menuItemClasses = $this->_getMenuItemClasses($item); + $attributes = array( + 'class' => implode(' ', $menuItemClasses) + ); + + return $attributes; + } + + /** + * Returns array of menu item's classes + * + * @param Varien_Data_Tree_Node $item + * @return array + */ + protected function _getMenuItemClasses(Varien_Data_Tree_Node $item) + { + $classes = array(); + + $classes[] = 'level' . $item->getLevel(); + $classes[] = $item->getPositionClass(); + + if ($item->getIsFirst()) { + $classes[] = 'first'; + } + + if ($item->getIsActive()) { + $classes[] = 'active'; + } + + if ($item->getIsLast()) { + $classes[] = 'last'; + } + + if ($item->getClass()) { + $classes[] = $item->getClass(); + } + + if ($item->hasChildren()) { + $classes[] = 'parent'; + } + + return $classes; + } +} diff --git a/app/code/core/Mage/Page/Block/Html/Welcome.php b/app/code/core/Mage/Page/Block/Html/Welcome.php index 661e15dd8e..35a42db4c2 100644 --- a/app/code/core/Mage/Page/Block/Html/Welcome.php +++ b/app/code/core/Mage/Page/Block/Html/Welcome.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Page - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Page/Block/Html/Wrapper.php b/app/code/core/Mage/Page/Block/Html/Wrapper.php index 1364c8c580..a0ce0fa440 100644 --- a/app/code/core/Mage/Page/Block/Html/Wrapper.php +++ b/app/code/core/Mage/Page/Block/Html/Wrapper.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Page - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Page/Block/Js/Cookie.php b/app/code/core/Mage/Page/Block/Js/Cookie.php index 2082da4148..b6b778bc8c 100644 --- a/app/code/core/Mage/Page/Block/Js/Cookie.php +++ b/app/code/core/Mage/Page/Block/Js/Cookie.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Page - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Page/Block/Js/Translate.php b/app/code/core/Mage/Page/Block/Js/Translate.php index 13f378eb23..b9da1ec39c 100644 --- a/app/code/core/Mage/Page/Block/Js/Translate.php +++ b/app/code/core/Mage/Page/Block/Js/Translate.php @@ -20,18 +20,19 @@ * * @category Mage * @package Mage_Page - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - + /** * Js translation block * + * @deprecated since 1.7.0.0 (used in adminhtml/default/default/layout/main.xml) * @author Magento Core Team */ class Mage_Page_Block_Js_Translate extends Mage_Core_Block_Template { - public function __construct() + public function __construct() { parent::__construct(); } diff --git a/app/code/core/Mage/Page/Block/Redirect.php b/app/code/core/Mage/Page/Block/Redirect.php index 487b25bb6f..905a31730e 100644 --- a/app/code/core/Mage/Page/Block/Redirect.php +++ b/app/code/core/Mage/Page/Block/Redirect.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Page - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Page/Block/Switch.php b/app/code/core/Mage/Page/Block/Switch.php index 57e3096458..461795ebd0 100644 --- a/app/code/core/Mage/Page/Block/Switch.php +++ b/app/code/core/Mage/Page/Block/Switch.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Page - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -92,6 +92,11 @@ public function getRawStores() return $this->getData('raw_stores'); } + /** + * Retrieve list of store groups with default urls set + * + * @return array + */ public function getGroups() { if (!$this->hasData('groups')) { @@ -101,6 +106,7 @@ public function getGroups() $groups = array(); $localeCode = Mage::getStoreConfig('general/locale/code'); foreach ($rawGroups as $group) { + /* @var $group Mage_Core_Model_Store_Group */ if (!isset($rawStores[$group->getId()])) { continue; } @@ -108,16 +114,9 @@ public function getGroups() $groups[] = $group; continue; } - $store = false; - foreach ($rawStores[$group->getId()] as $s) { - if ($s->getLocaleCode() == $localeCode) { - $store = $s; - break; - } - } - if (!$store && isset($rawStores[$group->getId()][$group->getDefaultStoreId()])) { - $store = $rawStores[$group->getId()][$group->getDefaultStoreId()]; - } + + $store = $group->getDefaultStoreByLocale($localeCode); + if ($store) { $group->setHomeUrl($store->getHomeUrl()); $groups[] = $group; diff --git a/app/code/core/Mage/Page/Block/Template/Container.php b/app/code/core/Mage/Page/Block/Template/Container.php index f7ef18166c..94d9d3a520 100644 --- a/app/code/core/Mage/Page/Block/Template/Container.php +++ b/app/code/core/Mage/Page/Block/Template/Container.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Page - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Page/Block/Template/Links.php b/app/code/core/Mage/Page/Block/Template/Links.php index e34d6a6bb4..5982224128 100644 --- a/app/code/core/Mage/Page/Block/Template/Links.php +++ b/app/code/core/Mage/Page/Block/Template/Links.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Page - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -34,7 +34,6 @@ */ class Mage_Page_Block_Template_Links extends Mage_Core_Block_Template { - /** * All links * @@ -120,6 +119,22 @@ public function addLinkBlock($blockName) return $this; } + /** + * Remove Link block by blockName + * + * @param string $blockName + * @return Mage_Page_Block_Template_Links + */ + public function removeLinkBlock($blockName) + { + foreach ($this->_links as $key => $link) { + if ($link instanceof Mage_Core_Block_Abstract && $link->getNameInLayout() == $blockName) { + unset($this->_links[$key]); + } + } + return $this; + } + /** * Removes link by url * diff --git a/app/code/core/Mage/Page/Block/Template/Links/Block.php b/app/code/core/Mage/Page/Block/Template/Links/Block.php index a633ecf16a..d13cc97b6f 100644 --- a/app/code/core/Mage/Page/Block/Template/Links/Block.php +++ b/app/code/core/Mage/Page/Block/Template/Links/Block.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Page - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Page/Helper/Data.php b/app/code/core/Mage/Page/Helper/Data.php index 92305f92e3..9dd649ccaa 100644 --- a/app/code/core/Mage/Page/Helper/Data.php +++ b/app/code/core/Mage/Page/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Page - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -29,4 +29,8 @@ */ class Mage_Page_Helper_Data extends Mage_Core_Helper_Abstract { + /** + * Cookie name for users who allowed cookie save + */ + const IS_USER_ALLOWED_SAVE_COOKIE = 'user_allowed_save_cookie'; } diff --git a/app/code/core/Mage/Page/Helper/Html.php b/app/code/core/Mage/Page/Helper/Html.php index 235e337d75..20fd3e26fd 100644 --- a/app/code/core/Mage/Page/Helper/Html.php +++ b/app/code/core/Mage/Page/Helper/Html.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Page - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Page/Helper/Layout.php b/app/code/core/Mage/Page/Helper/Layout.php index 271887eea9..28456c66a6 100644 --- a/app/code/core/Mage/Page/Helper/Layout.php +++ b/app/code/core/Mage/Page/Helper/Layout.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Page - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Page/Model/Config.php b/app/code/core/Mage/Page/Model/Config.php index 5d81c049bd..6ce23e67db 100644 --- a/app/code/core/Mage/Page/Model/Config.php +++ b/app/code/core/Mage/Page/Model/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Page - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Page/Model/Source/Layout.php b/app/code/core/Mage/Page/Model/Source/Layout.php index 66b2c9b21f..27a75c2d5c 100644 --- a/app/code/core/Mage/Page/Model/Source/Layout.php +++ b/app/code/core/Mage/Page/Model/Source/Layout.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Page - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Page/etc/config.xml b/app/code/core/Mage/Page/etc/config.xml index 68db7d3d57..06bf6fd2ff 100644 --- a/app/code/core/Mage/Page/etc/config.xml +++ b/app/code/core/Mage/Page/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Page - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Page/etc/system.xml b/app/code/core/Mage/Page/etc/system.xml index 3e76f84327..bf7b976e47 100644 --- a/app/code/core/Mage/Page/etc/system.xml +++ b/app/code/core/Mage/Page/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Page - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -39,7 +39,7 @@ - Allowed file types: ICO, PNG, GIF, JPEG, APNG, SVG. Not all browsers support all these formats! + Allowed file types: ICO, PNG, GIF, JPG, JPEG, APNG, SVG. Not all browsers support all these formats! image adminhtml/system_config_backend_image_favicon favicon diff --git a/app/code/core/Mage/PageCache/Block/Adminhtml/Cache/Additional.php b/app/code/core/Mage/PageCache/Block/Adminhtml/Cache/Additional.php index b7a425d4f9..5b62e66328 100644 --- a/app/code/core/Mage/PageCache/Block/Adminhtml/Cache/Additional.php +++ b/app/code/core/Mage/PageCache/Block/Adminhtml/Cache/Additional.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_PageCache - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/PageCache/Helper/Data.php b/app/code/core/Mage/PageCache/Helper/Data.php index 8499d63185..3e2f00ff5a 100644 --- a/app/code/core/Mage/PageCache/Helper/Data.php +++ b/app/code/core/Mage/PageCache/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_PageCache - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/PageCache/Model/Control/Interface.php b/app/code/core/Mage/PageCache/Model/Control/Interface.php index e3dc6c4d68..c540b494e0 100644 --- a/app/code/core/Mage/PageCache/Model/Control/Interface.php +++ b/app/code/core/Mage/PageCache/Model/Control/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_PageCache - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/PageCache/Model/Control/Zend.php b/app/code/core/Mage/PageCache/Model/Control/Zend.php index 9df13fbd5b..6825dd5e4a 100644 --- a/app/code/core/Mage/PageCache/Model/Control/Zend.php +++ b/app/code/core/Mage/PageCache/Model/Control/Zend.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_PageCache - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/PageCache/Model/Observer.php b/app/code/core/Mage/PageCache/Model/Observer.php index 8bef649092..a2410e729d 100644 --- a/app/code/core/Mage/PageCache/Model/Observer.php +++ b/app/code/core/Mage/PageCache/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_PageCache - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/PageCache/Model/System/Config/Source/Controls.php b/app/code/core/Mage/PageCache/Model/System/Config/Source/Controls.php index b3955293b7..86149a3fcb 100644 --- a/app/code/core/Mage/PageCache/Model/System/Config/Source/Controls.php +++ b/app/code/core/Mage/PageCache/Model/System/Config/Source/Controls.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_PageCache - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/PageCache/controllers/Adminhtml/PageCacheController.php b/app/code/core/Mage/PageCache/controllers/Adminhtml/PageCacheController.php index 1c1ce2b69c..c4179b43c6 100644 --- a/app/code/core/Mage/PageCache/controllers/Adminhtml/PageCacheController.php +++ b/app/code/core/Mage/PageCache/controllers/Adminhtml/PageCacheController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_PageCache - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/PageCache/etc/adminhtml.xml b/app/code/core/Mage/PageCache/etc/adminhtml.xml index 0bda1d3bce..f1db7c2fb6 100644 --- a/app/code/core/Mage/PageCache/etc/adminhtml.xml +++ b/app/code/core/Mage/PageCache/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_PageCache - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/PageCache/etc/config.xml b/app/code/core/Mage/PageCache/etc/config.xml index 49983e7de5..b305548f6f 100644 --- a/app/code/core/Mage/PageCache/etc/config.xml +++ b/app/code/core/Mage/PageCache/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_PageCache - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/PageCache/etc/system.xml b/app/code/core/Mage/PageCache/etc/system.xml index 3f1850ace1..f78a9e3c9f 100644 --- a/app/code/core/Mage/PageCache/etc/system.xml +++ b/app/code/core/Mage/PageCache/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_PageCache - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Paygate/Block/Authorizenet/Form/Cc.php b/app/code/core/Mage/Paygate/Block/Authorizenet/Form/Cc.php index 4cd1fbe477..2c78280062 100644 --- a/app/code/core/Mage/Paygate/Block/Authorizenet/Form/Cc.php +++ b/app/code/core/Mage/Paygate/Block/Authorizenet/Form/Cc.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paygate - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paygate/Block/Authorizenet/Info/Cc.php b/app/code/core/Mage/Paygate/Block/Authorizenet/Info/Cc.php index 6bfe16de7e..db94fbebdb 100644 --- a/app/code/core/Mage/Paygate/Block/Authorizenet/Info/Cc.php +++ b/app/code/core/Mage/Paygate/Block/Authorizenet/Info/Cc.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paygate - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paygate/Helper/Data.php b/app/code/core/Mage/Paygate/Helper/Data.php index 9c13e888e7..7b6111d053 100644 --- a/app/code/core/Mage/Paygate/Helper/Data.php +++ b/app/code/core/Mage/Paygate/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paygate - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paygate/Model/Authorizenet.php b/app/code/core/Mage/Paygate/Model/Authorizenet.php index 312b3a2081..0ad8cf2bfa 100644 --- a/app/code/core/Mage/Paygate/Model/Authorizenet.php +++ b/app/code/core/Mage/Paygate/Model/Authorizenet.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paygate - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paygate/Model/Authorizenet/Cards.php b/app/code/core/Mage/Paygate/Model/Authorizenet/Cards.php index 5ef3869050..2c80134074 100644 --- a/app/code/core/Mage/Paygate/Model/Authorizenet/Cards.php +++ b/app/code/core/Mage/Paygate/Model/Authorizenet/Cards.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paygate - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paygate/Model/Authorizenet/Debug.php b/app/code/core/Mage/Paygate/Model/Authorizenet/Debug.php index 5a8b873a80..7058b9a4f9 100644 --- a/app/code/core/Mage/Paygate/Model/Authorizenet/Debug.php +++ b/app/code/core/Mage/Paygate/Model/Authorizenet/Debug.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paygate - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paygate/Model/Authorizenet/Request.php b/app/code/core/Mage/Paygate/Model/Authorizenet/Request.php index a787417a65..511f349f9c 100644 --- a/app/code/core/Mage/Paygate/Model/Authorizenet/Request.php +++ b/app/code/core/Mage/Paygate/Model/Authorizenet/Request.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paygate - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paygate/Model/Authorizenet/Result.php b/app/code/core/Mage/Paygate/Model/Authorizenet/Result.php index 56760c94f2..db0f641cd7 100644 --- a/app/code/core/Mage/Paygate/Model/Authorizenet/Result.php +++ b/app/code/core/Mage/Paygate/Model/Authorizenet/Result.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paygate - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paygate/Model/Authorizenet/Source/Cctype.php b/app/code/core/Mage/Paygate/Model/Authorizenet/Source/Cctype.php index aeeabc688e..8595c9ac49 100644 --- a/app/code/core/Mage/Paygate/Model/Authorizenet/Source/Cctype.php +++ b/app/code/core/Mage/Paygate/Model/Authorizenet/Source/Cctype.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paygate - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paygate/Model/Authorizenet/Source/PaymentAction.php b/app/code/core/Mage/Paygate/Model/Authorizenet/Source/PaymentAction.php index 16d0decc24..9e8bd3068b 100644 --- a/app/code/core/Mage/Paygate/Model/Authorizenet/Source/PaymentAction.php +++ b/app/code/core/Mage/Paygate/Model/Authorizenet/Source/PaymentAction.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paygate - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paygate/Model/Mysql4/Authorizenet/Debug.php b/app/code/core/Mage/Paygate/Model/Mysql4/Authorizenet/Debug.php index 9805f5633d..b3c0348812 100644 --- a/app/code/core/Mage/Paygate/Model/Mysql4/Authorizenet/Debug.php +++ b/app/code/core/Mage/Paygate/Model/Mysql4/Authorizenet/Debug.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paygate - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paygate/Model/Mysql4/Authorizenet/Debug/Collection.php b/app/code/core/Mage/Paygate/Model/Mysql4/Authorizenet/Debug/Collection.php index 8febd37e10..bf95ad3e0c 100644 --- a/app/code/core/Mage/Paygate/Model/Mysql4/Authorizenet/Debug/Collection.php +++ b/app/code/core/Mage/Paygate/Model/Mysql4/Authorizenet/Debug/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paygate - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paygate/Model/Resource/Authorizenet/Debug.php b/app/code/core/Mage/Paygate/Model/Resource/Authorizenet/Debug.php index ea36a63198..9683f11a65 100755 --- a/app/code/core/Mage/Paygate/Model/Resource/Authorizenet/Debug.php +++ b/app/code/core/Mage/Paygate/Model/Resource/Authorizenet/Debug.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paygate - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paygate/Model/Resource/Authorizenet/Debug/Collection.php b/app/code/core/Mage/Paygate/Model/Resource/Authorizenet/Debug/Collection.php index ce7b2fdad8..cbbfbdc23e 100755 --- a/app/code/core/Mage/Paygate/Model/Resource/Authorizenet/Debug/Collection.php +++ b/app/code/core/Mage/Paygate/Model/Resource/Authorizenet/Debug/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paygate - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paygate/controllers/Adminhtml/Paygate/Authorizenet/PaymentController.php b/app/code/core/Mage/Paygate/controllers/Adminhtml/Paygate/Authorizenet/PaymentController.php index 79330aee70..06ca118b6e 100644 --- a/app/code/core/Mage/Paygate/controllers/Adminhtml/Paygate/Authorizenet/PaymentController.php +++ b/app/code/core/Mage/Paygate/controllers/Adminhtml/Paygate/Authorizenet/PaymentController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paygate - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paygate/controllers/Authorizenet/PaymentController.php b/app/code/core/Mage/Paygate/controllers/Authorizenet/PaymentController.php index c589f6ccd3..53291ea058 100644 --- a/app/code/core/Mage/Paygate/controllers/Authorizenet/PaymentController.php +++ b/app/code/core/Mage/Paygate/controllers/Authorizenet/PaymentController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paygate - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paygate/etc/config.xml b/app/code/core/Mage/Paygate/etc/config.xml index 032f41d0fd..180e02b21d 100644 --- a/app/code/core/Mage/Paygate/etc/config.xml +++ b/app/code/core/Mage/Paygate/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Paygate - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Paygate/etc/system.xml b/app/code/core/Mage/Paygate/etc/system.xml index 4bf6b14d04..8182a54381 100644 --- a/app/code/core/Mage/Paygate/etc/system.xml +++ b/app/code/core/Mage/Paygate/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Paygate - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Paygate/sql/paygate_setup/install-1.6.0.0.php b/app/code/core/Mage/Paygate/sql/paygate_setup/install-1.6.0.0.php index 6fe4853369..c8bb5e7e58 100644 --- a/app/code/core/Mage/Paygate/sql/paygate_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Paygate/sql/paygate_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paygate - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paygate/sql/paygate_setup/mysql4-data-upgrade-0.7.0-0.7.1.php b/app/code/core/Mage/Paygate/sql/paygate_setup/mysql4-data-upgrade-0.7.0-0.7.1.php index 4d72fe041f..7999ce5eac 100644 --- a/app/code/core/Mage/Paygate/sql/paygate_setup/mysql4-data-upgrade-0.7.0-0.7.1.php +++ b/app/code/core/Mage/Paygate/sql/paygate_setup/mysql4-data-upgrade-0.7.0-0.7.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paygate - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paygate/sql/paygate_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/Paygate/sql/paygate_setup/mysql4-install-0.7.0.php index a7473c5701..f9b0e6e3a8 100644 --- a/app/code/core/Mage/Paygate/sql/paygate_setup/mysql4-install-0.7.0.php +++ b/app/code/core/Mage/Paygate/sql/paygate_setup/mysql4-install-0.7.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paygate - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paygate/sql/paygate_setup/mysql4-upgrade-0.7.0-0.7.1.php b/app/code/core/Mage/Paygate/sql/paygate_setup/mysql4-upgrade-0.7.0-0.7.1.php index 7214596ce9..ebbfa35c57 100644 --- a/app/code/core/Mage/Paygate/sql/paygate_setup/mysql4-upgrade-0.7.0-0.7.1.php +++ b/app/code/core/Mage/Paygate/sql/paygate_setup/mysql4-upgrade-0.7.0-0.7.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paygate - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Block/Catalog/Product/View/Profile.php b/app/code/core/Mage/Payment/Block/Catalog/Product/View/Profile.php index f0d4f4b88c..d4442af789 100644 --- a/app/code/core/Mage/Payment/Block/Catalog/Product/View/Profile.php +++ b/app/code/core/Mage/Payment/Block/Catalog/Product/View/Profile.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Block/Form.php b/app/code/core/Mage/Payment/Block/Form.php index a91cb15ea4..5283adc54e 100644 --- a/app/code/core/Mage/Payment/Block/Form.php +++ b/app/code/core/Mage/Payment/Block/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Block/Form/Cc.php b/app/code/core/Mage/Payment/Block/Form/Cc.php index 8ef87137c9..818c805780 100644 --- a/app/code/core/Mage/Payment/Block/Form/Cc.php +++ b/app/code/core/Mage/Payment/Block/Form/Cc.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Block/Form/Ccsave.php b/app/code/core/Mage/Payment/Block/Form/Ccsave.php index b807031972..8fb24a8d46 100644 --- a/app/code/core/Mage/Payment/Block/Form/Ccsave.php +++ b/app/code/core/Mage/Payment/Block/Form/Ccsave.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Block/Form/Checkmo.php b/app/code/core/Mage/Payment/Block/Form/Checkmo.php index 39a769ea36..aa50cc20e3 100644 --- a/app/code/core/Mage/Payment/Block/Form/Checkmo.php +++ b/app/code/core/Mage/Payment/Block/Form/Checkmo.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Block/Form/Container.php b/app/code/core/Mage/Payment/Block/Form/Container.php index 37e8c4a6ea..665f092bb8 100644 --- a/app/code/core/Mage/Payment/Block/Form/Container.php +++ b/app/code/core/Mage/Payment/Block/Form/Container.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Block/Form/Purchaseorder.php b/app/code/core/Mage/Payment/Block/Form/Purchaseorder.php index b12f832520..e9830624b1 100644 --- a/app/code/core/Mage/Payment/Block/Form/Purchaseorder.php +++ b/app/code/core/Mage/Payment/Block/Form/Purchaseorder.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Block/Info.php b/app/code/core/Mage/Payment/Block/Info.php index 1f44fccaeb..a72e77481b 100644 --- a/app/code/core/Mage/Payment/Block/Info.php +++ b/app/code/core/Mage/Payment/Block/Info.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Block/Info/Cc.php b/app/code/core/Mage/Payment/Block/Info/Cc.php index 920e54b9e7..b357d54881 100644 --- a/app/code/core/Mage/Payment/Block/Info/Cc.php +++ b/app/code/core/Mage/Payment/Block/Info/Cc.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Block/Info/Ccsave.php b/app/code/core/Mage/Payment/Block/Info/Ccsave.php index 511b643a8d..dadb3a0c71 100644 --- a/app/code/core/Mage/Payment/Block/Info/Ccsave.php +++ b/app/code/core/Mage/Payment/Block/Info/Ccsave.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Block/Info/Checkmo.php b/app/code/core/Mage/Payment/Block/Info/Checkmo.php index 3fd7ea3492..57572c039c 100644 --- a/app/code/core/Mage/Payment/Block/Info/Checkmo.php +++ b/app/code/core/Mage/Payment/Block/Info/Checkmo.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Block/Info/Container.php b/app/code/core/Mage/Payment/Block/Info/Container.php index 7e48946ab8..c172ed43ee 100644 --- a/app/code/core/Mage/Payment/Block/Info/Container.php +++ b/app/code/core/Mage/Payment/Block/Info/Container.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Block/Info/Purchaseorder.php b/app/code/core/Mage/Payment/Block/Info/Purchaseorder.php index 557ca81ffb..3c33f84395 100644 --- a/app/code/core/Mage/Payment/Block/Info/Purchaseorder.php +++ b/app/code/core/Mage/Payment/Block/Info/Purchaseorder.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Exception.php b/app/code/core/Mage/Payment/Exception.php index af6dfc129b..cc2b017fef 100644 --- a/app/code/core/Mage/Payment/Exception.php +++ b/app/code/core/Mage/Payment/Exception.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Helper/Data.php b/app/code/core/Mage/Payment/Helper/Data.php index 75f0db9da6..9053d8513a 100644 --- a/app/code/core/Mage/Payment/Helper/Data.php +++ b/app/code/core/Mage/Payment/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Model/Billing/Agreement/MethodInterface.php b/app/code/core/Mage/Payment/Model/Billing/Agreement/MethodInterface.php index 9d02c9b7bf..fc49d1b44e 100644 --- a/app/code/core/Mage/Payment/Model/Billing/Agreement/MethodInterface.php +++ b/app/code/core/Mage/Payment/Model/Billing/Agreement/MethodInterface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Model/Billing/AgreementAbstract.php b/app/code/core/Mage/Payment/Model/Billing/AgreementAbstract.php index b3b96792bc..430698a938 100644 --- a/app/code/core/Mage/Payment/Model/Billing/AgreementAbstract.php +++ b/app/code/core/Mage/Payment/Model/Billing/AgreementAbstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Model/Config.php b/app/code/core/Mage/Payment/Model/Config.php index 23042d9465..e7bc47f8a0 100644 --- a/app/code/core/Mage/Payment/Model/Config.php +++ b/app/code/core/Mage/Payment/Model/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Model/Info.php b/app/code/core/Mage/Payment/Model/Info.php index f138350f3c..8a1e33594c 100644 --- a/app/code/core/Mage/Payment/Model/Info.php +++ b/app/code/core/Mage/Payment/Model/Info.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Model/Info/Exception.php b/app/code/core/Mage/Payment/Model/Info/Exception.php index 1f1888328b..6293c7eafd 100644 --- a/app/code/core/Mage/Payment/Model/Info/Exception.php +++ b/app/code/core/Mage/Payment/Model/Info/Exception.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Model/Method/Abstract.php b/app/code/core/Mage/Payment/Model/Method/Abstract.php index d4aac27bfa..49d46906e7 100644 --- a/app/code/core/Mage/Payment/Model/Method/Abstract.php +++ b/app/code/core/Mage/Payment/Model/Method/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Model/Method/Cc.php b/app/code/core/Mage/Payment/Model/Method/Cc.php index 861f45329b..cae20a81bd 100644 --- a/app/code/core/Mage/Payment/Model/Method/Cc.php +++ b/app/code/core/Mage/Payment/Model/Method/Cc.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Model/Method/Ccsave.php b/app/code/core/Mage/Payment/Model/Method/Ccsave.php index a3bb814004..1d3c86ba28 100644 --- a/app/code/core/Mage/Payment/Model/Method/Ccsave.php +++ b/app/code/core/Mage/Payment/Model/Method/Ccsave.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Model/Method/Checkmo.php b/app/code/core/Mage/Payment/Model/Method/Checkmo.php index 3c67361a01..8051a771dc 100644 --- a/app/code/core/Mage/Payment/Model/Method/Checkmo.php +++ b/app/code/core/Mage/Payment/Model/Method/Checkmo.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Model/Method/Free.php b/app/code/core/Mage/Payment/Model/Method/Free.php index 0ca45647aa..a1aada4d73 100644 --- a/app/code/core/Mage/Payment/Model/Method/Free.php +++ b/app/code/core/Mage/Payment/Model/Method/Free.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -74,7 +74,7 @@ public function isAvailable($quote = null) public function getConfigPaymentAction() { if ('pending' == $this->getConfigData('order_status')) { - return Mage_Payment_Model_Method_Abstract::ACTION_AUTHORIZE; + return null; // do nothing if status pending } return parent::getConfigPaymentAction(); } diff --git a/app/code/core/Mage/Payment/Model/Method/Purchaseorder.php b/app/code/core/Mage/Payment/Model/Method/Purchaseorder.php index 2db666ee7c..6406e51263 100644 --- a/app/code/core/Mage/Payment/Model/Method/Purchaseorder.php +++ b/app/code/core/Mage/Payment/Model/Method/Purchaseorder.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Model/Observer.php b/app/code/core/Mage/Payment/Model/Observer.php index 2e4da4345a..e95381b3c4 100644 --- a/app/code/core/Mage/Payment/Model/Observer.php +++ b/app/code/core/Mage/Payment/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Model/Paygate/Request.php b/app/code/core/Mage/Payment/Model/Paygate/Request.php index 52fd18c6a6..85a4a79d85 100644 --- a/app/code/core/Mage/Payment/Model/Paygate/Request.php +++ b/app/code/core/Mage/Payment/Model/Paygate/Request.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Model/Paygate/Result.php b/app/code/core/Mage/Payment/Model/Paygate/Result.php index dcd7cdbbd2..545fd02c14 100644 --- a/app/code/core/Mage/Payment/Model/Paygate/Result.php +++ b/app/code/core/Mage/Payment/Model/Paygate/Result.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Model/Recurring/Profile.php b/app/code/core/Mage/Payment/Model/Recurring/Profile.php index 460dbfdbd4..4211f7e448 100644 --- a/app/code/core/Mage/Payment/Model/Recurring/Profile.php +++ b/app/code/core/Mage/Payment/Model/Recurring/Profile.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Model/Recurring/Profile/MethodInterface.php b/app/code/core/Mage/Payment/Model/Recurring/Profile/MethodInterface.php index b5674fb8eb..d4dd626134 100644 --- a/app/code/core/Mage/Payment/Model/Recurring/Profile/MethodInterface.php +++ b/app/code/core/Mage/Payment/Model/Recurring/Profile/MethodInterface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Model/Source/Cctype.php b/app/code/core/Mage/Payment/Model/Source/Cctype.php index ac39968917..f6413932df 100644 --- a/app/code/core/Mage/Payment/Model/Source/Cctype.php +++ b/app/code/core/Mage/Payment/Model/Source/Cctype.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Model/Source/Invoice.php b/app/code/core/Mage/Payment/Model/Source/Invoice.php index c80bef0206..ba30f3ae43 100644 --- a/app/code/core/Mage/Payment/Model/Source/Invoice.php +++ b/app/code/core/Mage/Payment/Model/Source/Invoice.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/etc/adminhtml.xml b/app/code/core/Mage/Payment/etc/adminhtml.xml index d3e3d6c9c7..6c410b8b2a 100644 --- a/app/code/core/Mage/Payment/etc/adminhtml.xml +++ b/app/code/core/Mage/Payment/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Payment/etc/config.xml b/app/code/core/Mage/Payment/etc/config.xml index 27e207e9b2..28890d5ee7 100644 --- a/app/code/core/Mage/Payment/etc/config.xml +++ b/app/code/core/Mage/Payment/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Payment/etc/system.xml b/app/code/core/Mage/Payment/etc/system.xml index 8cd6b1bfde..92a059f376 100644 --- a/app/code/core/Mage/Payment/etc/system.xml +++ b/app/code/core/Mage/Payment/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -301,6 +301,9 @@ 1 1 0 + + processing,processed_ogone + diff --git a/app/code/core/Mage/Paypal/Block/Adminhtml/Settlement/Details.php b/app/code/core/Mage/Paypal/Block/Adminhtml/Settlement/Details.php index e84ead6e60..81f630a87a 100644 --- a/app/code/core/Mage/Paypal/Block/Adminhtml/Settlement/Details.php +++ b/app/code/core/Mage/Paypal/Block/Adminhtml/Settlement/Details.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Block/Adminhtml/Settlement/Details/Form.php b/app/code/core/Mage/Paypal/Block/Adminhtml/Settlement/Details/Form.php index 730169cf1a..227c34824a 100644 --- a/app/code/core/Mage/Paypal/Block/Adminhtml/Settlement/Details/Form.php +++ b/app/code/core/Mage/Paypal/Block/Adminhtml/Settlement/Details/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Block/Adminhtml/Settlement/Report.php b/app/code/core/Mage/Paypal/Block/Adminhtml/Settlement/Report.php index 7352705112..69f351f596 100644 --- a/app/code/core/Mage/Paypal/Block/Adminhtml/Settlement/Report.php +++ b/app/code/core/Mage/Paypal/Block/Adminhtml/Settlement/Report.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Block/Adminhtml/Settlement/Report/Grid.php b/app/code/core/Mage/Paypal/Block/Adminhtml/Settlement/Report/Grid.php index 3fbe5230c2..a0a0b940c6 100644 --- a/app/code/core/Mage/Paypal/Block/Adminhtml/Settlement/Report/Grid.php +++ b/app/code/core/Mage/Paypal/Block/Adminhtml/Settlement/Report/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/ApiWizard.php b/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/ApiWizard.php index 0999ecf435..4a33b9696e 100644 --- a/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/ApiWizard.php +++ b/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/ApiWizard.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/Fieldset/Global.php b/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/Fieldset/Global.php index 523519d447..06e39eadd4 100644 --- a/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/Fieldset/Global.php +++ b/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/Fieldset/Global.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/Fieldset/Hint.php b/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/Fieldset/Hint.php index ed66555b55..0422da9a5c 100644 --- a/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/Fieldset/Hint.php +++ b/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/Fieldset/Hint.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/Fieldset/Store.php b/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/Fieldset/Store.php index 385dbf7ade..f522ffd6be 100644 --- a/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/Fieldset/Store.php +++ b/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/Fieldset/Store.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/Payflowlink/Advanced.php b/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/Payflowlink/Advanced.php index 1767bc98db..a78437f5f3 100644 --- a/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/Payflowlink/Advanced.php +++ b/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/Payflowlink/Advanced.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/Payflowlink/Info.php b/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/Payflowlink/Info.php index 6acdd25124..a3506bd75b 100644 --- a/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/Payflowlink/Info.php +++ b/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/Payflowlink/Info.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Block/Express/Form.php b/app/code/core/Mage/Paypal/Block/Express/Form.php index 39fc6e0fd5..f99b02bb11 100644 --- a/app/code/core/Mage/Paypal/Block/Express/Form.php +++ b/app/code/core/Mage/Paypal/Block/Express/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Block/Express/Review.php b/app/code/core/Mage/Paypal/Block/Express/Review.php index 51d810a684..fb6d70cc2c 100644 --- a/app/code/core/Mage/Paypal/Block/Express/Review.php +++ b/app/code/core/Mage/Paypal/Block/Express/Review.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -140,7 +140,9 @@ public function renderShippingRateOption($rate, $format = '%s - %s%s', $inclTaxF if ($rate->getErrorMessage()) { $price = $rate->getErrorMessage(); } else { - $price = $this->_getShippingPrice($rate->getPrice(), $this->helper('tax')->displayShippingPriceIncludingTax()); + $price = $this->_getShippingPrice($rate->getPrice(), + $this->helper('tax')->displayShippingPriceIncludingTax()); + $incl = $this->_getShippingPrice($rate->getPrice(), true); if (($incl != $price) && $this->helper('tax')->displayShippingBothPrices()) { $renderedInclTax = sprintf($inclTaxFormat, Mage::helper('tax')->__('Incl. Tax'), $incl); @@ -200,6 +202,8 @@ protected function _beforeToHtml() { $methodInstance = $this->_quote->getPayment()->getMethodInstance(); $this->setPaymentMethodTitle($methodInstance->getTitle()); + $this->setUpdateOrderSubmitUrl($this->getUrl("{$this->_paypalActionPrefix}/express/updateOrder")); + $this->setUpdateShippingMethodsUrl($this->getUrl("{$this->_paypalActionPrefix}/express/updateShippingMethods")); $this->setShippingRateRequired(true); if ($this->_quote->getIsVirtual()) { diff --git a/app/code/core/Mage/Paypal/Block/Express/Review/Billing.php b/app/code/core/Mage/Paypal/Block/Express/Review/Billing.php new file mode 100644 index 0000000000..b4594391a4 --- /dev/null +++ b/app/code/core/Mage/Paypal/Block/Express/Review/Billing.php @@ -0,0 +1,59 @@ + + */ +class Mage_Paypal_Block_Express_Review_Billing extends Mage_Checkout_Block_Onepage_Billing +{ + /** + * Return Sales Quote Address model + * + * @return Mage_Sales_Model_Quote_Address + */ + public function getAddress() + { + if (is_null($this->_address)) { + if ($this->isCustomerLoggedIn() || $this->getQuote()->getBillingAddress()) { + $this->_address = $this->getQuote()->getBillingAddress(); + if (!$this->_address->getFirstname()) { + $this->_address->setFirstname($this->getQuote()->getCustomer()->getFirstname()); + } + if (!$this->_address->getLastname()) { + $this->_address->setLastname($this->getQuote()->getCustomer()->getLastname()); + } + } else { + $this->_address = Mage::getModel('sales/quote_address'); + } + } + + return $this->_address; + } +} diff --git a/app/code/core/Mage/Paypal/Block/Express/Review/Details.php b/app/code/core/Mage/Paypal/Block/Express/Review/Details.php index b92efcef59..f1b699b310 100644 --- a/app/code/core/Mage/Paypal/Block/Express/Review/Details.php +++ b/app/code/core/Mage/Paypal/Block/Express/Review/Details.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Block/Express/Review/Shipping.php b/app/code/core/Mage/Paypal/Block/Express/Review/Shipping.php new file mode 100644 index 0000000000..ee30dedf03 --- /dev/null +++ b/app/code/core/Mage/Paypal/Block/Express/Review/Shipping.php @@ -0,0 +1,53 @@ + + */ +class Mage_Paypal_Block_Express_Review_Shipping extends Mage_Checkout_Block_Onepage_Shipping +{ + /** + * Return Sales Quote Address model (shipping address) + * + * @return Mage_Sales_Model_Quote_Address + */ + public function getAddress() + { + if (is_null($this->_address)) { + if ($this->isCustomerLoggedIn() || $this->getQuote()->getShippingAddress()) { + $this->_address = $this->getQuote()->getShippingAddress(); + } else { + $this->_address = Mage::getModel('sales/quote_address'); + } + } + + return $this->_address; + } +} diff --git a/app/code/core/Mage/Paypal/Block/Express/Shortcut.php b/app/code/core/Mage/Paypal/Block/Express/Shortcut.php index 8d28d1fc9c..9f2782603e 100644 --- a/app/code/core/Mage/Paypal/Block/Express/Shortcut.php +++ b/app/code/core/Mage/Paypal/Block/Express/Shortcut.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Block/Hosted/Pro/Form.php b/app/code/core/Mage/Paypal/Block/Hosted/Pro/Form.php index 73b7a778d2..0f02b046c5 100644 --- a/app/code/core/Mage/Paypal/Block/Hosted/Pro/Form.php +++ b/app/code/core/Mage/Paypal/Block/Hosted/Pro/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Block/Hosted/Pro/Iframe.php b/app/code/core/Mage/Paypal/Block/Hosted/Pro/Iframe.php index 393cde8c65..e0c2f4d22a 100644 --- a/app/code/core/Mage/Paypal/Block/Hosted/Pro/Iframe.php +++ b/app/code/core/Mage/Paypal/Block/Hosted/Pro/Iframe.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Block/Hosted/Pro/Info.php b/app/code/core/Mage/Paypal/Block/Hosted/Pro/Info.php index 5b33cf228d..7e47b5a508 100644 --- a/app/code/core/Mage/Paypal/Block/Hosted/Pro/Info.php +++ b/app/code/core/Mage/Paypal/Block/Hosted/Pro/Info.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Block/Iframe.php b/app/code/core/Mage/Paypal/Block/Iframe.php index 35ba60256b..90366cecf6 100644 --- a/app/code/core/Mage/Paypal/Block/Iframe.php +++ b/app/code/core/Mage/Paypal/Block/Iframe.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -75,8 +75,13 @@ protected function _construct() ->getMethod(); if (in_array($paymentCode, $this->helper('paypal/hss')->getHssMethods())) { $this->_paymentMethodCode = $paymentCode; - $template_path = str_replace('_', '', $paymentCode); - $this->setTemplate("paypal/{$template_path}/iframe.phtml"); + $templatePath = str_replace('_', '', $paymentCode); + $templateFile = "paypal/{$templatePath}/iframe.phtml"; + if (file_exists(Mage::getDesign()->getTemplateFilename($templateFile))) { + $this->setTemplate($templateFile); + } else { + $this->setTemplate('paypal/hss/iframe.phtml'); + } } } diff --git a/app/code/core/Mage/Paypal/Block/Logo.php b/app/code/core/Mage/Paypal/Block/Logo.php index a5fb0af7ff..843b4c75dd 100644 --- a/app/code/core/Mage/Paypal/Block/Logo.php +++ b/app/code/core/Mage/Paypal/Block/Logo.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Block/Payflow/Advanced/Form.php b/app/code/core/Mage/Paypal/Block/Payflow/Advanced/Form.php index 33999784ee..5978c1d0de 100644 --- a/app/code/core/Mage/Paypal/Block/Payflow/Advanced/Form.php +++ b/app/code/core/Mage/Paypal/Block/Payflow/Advanced/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Block/Payflow/Advanced/Iframe.php b/app/code/core/Mage/Paypal/Block/Payflow/Advanced/Iframe.php index c66b35e5ed..bbd06e90c3 100644 --- a/app/code/core/Mage/Paypal/Block/Payflow/Advanced/Iframe.php +++ b/app/code/core/Mage/Paypal/Block/Payflow/Advanced/Iframe.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Block/Payflow/Advanced/Info.php b/app/code/core/Mage/Paypal/Block/Payflow/Advanced/Info.php index 0fa276f768..0b2ac3cf7b 100644 --- a/app/code/core/Mage/Paypal/Block/Payflow/Advanced/Info.php +++ b/app/code/core/Mage/Paypal/Block/Payflow/Advanced/Info.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Block/Payflow/Advanced/Review.php b/app/code/core/Mage/Paypal/Block/Payflow/Advanced/Review.php index 0686af95a7..ec5f015ea6 100644 --- a/app/code/core/Mage/Paypal/Block/Payflow/Advanced/Review.php +++ b/app/code/core/Mage/Paypal/Block/Payflow/Advanced/Review.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Block/Payflow/Link/Form.php b/app/code/core/Mage/Paypal/Block/Payflow/Link/Form.php index bd84e7b001..ea9dc7a5b6 100644 --- a/app/code/core/Mage/Paypal/Block/Payflow/Link/Form.php +++ b/app/code/core/Mage/Paypal/Block/Payflow/Link/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Block/Payflow/Link/Iframe.php b/app/code/core/Mage/Paypal/Block/Payflow/Link/Iframe.php index d3b6866e4e..b2dcbae5c8 100644 --- a/app/code/core/Mage/Paypal/Block/Payflow/Link/Iframe.php +++ b/app/code/core/Mage/Paypal/Block/Payflow/Link/Iframe.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Block/Payflow/Link/Info.php b/app/code/core/Mage/Paypal/Block/Payflow/Link/Info.php index e521d4b1f8..16dbfd873b 100644 --- a/app/code/core/Mage/Paypal/Block/Payflow/Link/Info.php +++ b/app/code/core/Mage/Paypal/Block/Payflow/Link/Info.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Block/Payflow/Link/Review.php b/app/code/core/Mage/Paypal/Block/Payflow/Link/Review.php index 5e4747305c..12c7648422 100644 --- a/app/code/core/Mage/Paypal/Block/Payflow/Link/Review.php +++ b/app/code/core/Mage/Paypal/Block/Payflow/Link/Review.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Block/Payment/Info.php b/app/code/core/Mage/Paypal/Block/Payment/Info.php index c9542b7604..fb2750adc8 100644 --- a/app/code/core/Mage/Paypal/Block/Payment/Info.php +++ b/app/code/core/Mage/Paypal/Block/Payment/Info.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Block/Standard/Form.php b/app/code/core/Mage/Paypal/Block/Standard/Form.php index 0d4e34cd60..8b0686868a 100644 --- a/app/code/core/Mage/Paypal/Block/Standard/Form.php +++ b/app/code/core/Mage/Paypal/Block/Standard/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Block/Standard/Redirect.php b/app/code/core/Mage/Paypal/Block/Standard/Redirect.php index 48b1d363a2..abce5c6541 100644 --- a/app/code/core/Mage/Paypal/Block/Standard/Redirect.php +++ b/app/code/core/Mage/Paypal/Block/Standard/Redirect.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Paypal_Block_Standard_Redirect extends Mage_Core_Block_Abstract @@ -38,6 +38,13 @@ protected function _toHtml() foreach ($standard->getStandardCheckoutFormFields() as $field=>$value) { $form->addField($field, 'hidden', array('name'=>$field, 'value'=>$value)); } + $idSuffix = Mage::helper('core')->uniqHash(); + $submitButton = new Varien_Data_Form_Element_Submit(array( + 'value' => $this->__('Click here if you are not redirected within 10 seconds...'), + )); + $id = "submit_to_paypal_button_{$idSuffix}"; + $submitButton->setId($id); + $form->addElement($submitButton); $html = ''; $html.= $this->__('You will be redirected to the PayPal website in a few seconds.'); $html.= $form->toHtml(); diff --git a/app/code/core/Mage/Paypal/Controller/Express/Abstract.php b/app/code/core/Mage/Paypal/Controller/Express/Abstract.php index a661171277..b3ff3ef28c 100644 --- a/app/code/core/Mage/Paypal/Controller/Express/Abstract.php +++ b/app/code/core/Mage/Paypal/Controller/Express/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -183,10 +183,12 @@ public function reviewAction() $this->_checkout->prepareOrderReview($this->_initToken()); $this->loadLayout(); $this->_initLayoutMessages('paypal/session'); - $this->getLayout()->getBlock('paypal.express.review') - ->setQuote($this->_getQuote()) - ->getChild('details')->setQuote($this->_getQuote()) - ; + $reviewBlock = $this->getLayout()->getBlock('paypal.express.review'); + $reviewBlock->setQuote($this->_getQuote()); + $reviewBlock->getChild('details')->setQuote($this->_getQuote()); + if ($reviewBlock->getChild('shipping_method')) { + $reviewBlock->getChild('shipping_method')->setQuote($this->_getQuote()); + } $this->renderLayout(); return; } @@ -232,12 +234,64 @@ public function saveShippingMethodAction() ->toHtml()); return; } + } catch (Mage_Core_Exception $e) { + $this->_getSession()->addError($e->getMessage()); + } catch (Exception $e) { + $this->_getSession()->addError($this->__('Unable to update shipping method.')); + Mage::logException($e); } - catch (Mage_Core_Exception $e) { + if ($isAjax) { + $this->getResponse()->setBody(''); + } else { + $this->_redirect('*/*/review'); + } + } + + /** + * Update Order (combined action for ajax and regular request) + */ + public function updateShippingMethodsAction() + { + try { + $this->_initCheckout(); + $this->_checkout->prepareOrderReview($this->_initToken()); + $this->loadLayout('paypal_express_review'); + + $this->getResponse()->setBody($this->getLayout()->getBlock('express.review.shipping.method') + ->setQuote($this->_getQuote()) + ->toHtml()); + return; + } catch (Mage_Core_Exception $e) { $this->_getSession()->addError($e->getMessage()); + } catch (Exception $e) { + $this->_getSession()->addError($this->__('Unable to update Order data.')); + Mage::logException($e); } - catch (Exception $e) { - $this->_getSession()->addError($this->__('Unable to update shipping method.')); + $this->getResponse()->setBody(''); + } + + /** + * Update Order (combined action for ajax and regular request) + */ + public function updateOrderAction() + { + try { + $isAjax = $this->getRequest()->getParam('isAjax'); + $this->_initCheckout(); + $this->_checkout->updateOrder($this->getRequest()->getParams()); + if ($isAjax) { + $this->loadLayout('paypal_express_review_details'); + $this->getResponse()->setBody($this->getLayout()->getBlock('root') + ->setQuote($this->_getQuote()) + ->toHtml()); + return; + } + } catch (Mage_Core_Exception $e) { + $this->_getSession()->addError($e->getMessage()); + } catch (Exception $e) { + $this->_getSession()->addError($this->__('Unable to update Order data.')); Mage::logException($e); } if ($isAjax) { @@ -395,4 +449,19 @@ private function _getQuote() } return $this->_quote; } + + /** + * Redirect to login page + * + */ + public function redirectLogin() + { + $this->setFlag('', 'no-dispatch', true); + $this->getResponse()->setRedirect( + Mage::helper('core/url')->addRequestParam( + Mage::helper('customer')->getLoginUrl(), + array('context' => 'checkout') + ) + ); + } } diff --git a/app/code/core/Mage/Paypal/Exception.php b/app/code/core/Mage/Paypal/Exception.php index de8ed4c19c..07af944929 100644 --- a/app/code/core/Mage/Paypal/Exception.php +++ b/app/code/core/Mage/Paypal/Exception.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Helper/Data.php b/app/code/core/Mage/Paypal/Helper/Data.php index a32fc67a5e..99f7af7019 100644 --- a/app/code/core/Mage/Paypal/Helper/Data.php +++ b/app/code/core/Mage/Paypal/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Helper/Hss.php b/app/code/core/Mage/Paypal/Helper/Hss.php index 7764604705..5e0dcb79cc 100644 --- a/app/code/core/Mage/Paypal/Helper/Hss.php +++ b/app/code/core/Mage/Paypal/Helper/Hss.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/Api/Abstract.php b/app/code/core/Mage/Paypal/Model/Api/Abstract.php index f909132e94..bec3ba3faa 100644 --- a/app/code/core/Mage/Paypal/Model/Api/Abstract.php +++ b/app/code/core/Mage/Paypal/Model/Api/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/Api/Nvp.php b/app/code/core/Mage/Paypal/Model/Api/Nvp.php index f3783313eb..8021505466 100644 --- a/app/code/core/Mage/Paypal/Model/Api/Nvp.php +++ b/app/code/core/Mage/Paypal/Model/Api/Nvp.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -90,6 +90,7 @@ class Mage_Paypal_Model_Api_Nvp extends Mage_Paypal_Model_Api_Abstract 'ACTION' => 'action', 'REDIRECTREQUIRED' => 'redirect_required', 'SUCCESSPAGEREDIRECTREQUESTED' => 'redirect_requested', + 'REQBILLINGADDRESS' => 'require_billing_address', // style settings 'PAGESTYLE' => 'page_style', 'HDRIMG' => 'hdrimg', @@ -227,7 +228,7 @@ class Mage_Paypal_Model_Api_Nvp extends Mage_Paypal_Model_Api_Abstract 'PAYMENTACTION', 'AMT', 'CURRENCYCODE', 'RETURNURL', 'CANCELURL', 'INVNUM', 'SOLUTIONTYPE', 'NOSHIPPING', 'GIROPAYCANCELURL', 'GIROPAYSUCCESSURL', 'BANKTXNPENDINGURL', 'PAGESTYLE', 'HDRIMG', 'HDRBORDERCOLOR', 'HDRBACKCOLOR', 'PAYFLOWCOLOR', 'LOCALECODE', - 'BILLINGTYPE', 'SUBJECT', 'ITEMAMT', 'SHIPPINGAMT', 'TAXAMT', + 'BILLINGTYPE', 'SUBJECT', 'ITEMAMT', 'SHIPPINGAMT', 'TAXAMT', 'REQBILLINGADDRESS', ); protected $_setExpressCheckoutResponse = array('TOKEN'); @@ -630,6 +631,11 @@ public function callDoExpressCheckoutPayment() $request = $this->_exportToRequest($this->_doExpressCheckoutPaymentRequest); $this->_exportLineItems($request); + if ($this->getAddress()) { + $request = $this->_importAddresses($request); + $request['ADDROVERRIDE'] = 1; + } + $response = $this->call(self::DO_EXPRESS_CHECKOUT_PAYMENT, $request); $this->_importFromResponse($this->_paymentInformationResponse, $response); $this->_importFromResponse($this->_doExpressCheckoutPaymentResponse, $response); @@ -1136,11 +1142,17 @@ protected function _exportAddressses($data) Varien_Object_Mapper::accumulateByMap($data, $shippingAddress, $this->_shippingAddressMap); $this->_applyStreetAndRegionWorkarounds($shippingAddress); // PayPal doesn't provide detailed shipping name fields, so the name will be overwritten + $firstName = $data['SHIPTONAME']; + $lastName = null; + if (isset($data['FIRSTNAME']) && $data['LASTNAME']) { + $firstName = $data['FIRSTNAME']; + $lastName = $data['LASTNAME']; + } $shippingAddress->addData(array( 'prefix' => null, - 'firstname' => $data['SHIPTONAME'], + 'firstname' => $firstName, 'middlename' => null, - 'lastname' => null, + 'lastname' => $lastName, 'suffix' => null, )); $this->setExportedShippingAddress($shippingAddress); diff --git a/app/code/core/Mage/Paypal/Model/Api/Standard.php b/app/code/core/Mage/Paypal/Model/Api/Standard.php index cae9b4e0de..912eba4f3a 100644 --- a/app/code/core/Mage/Paypal/Model/Api/Standard.php +++ b/app/code/core/Mage/Paypal/Model/Api/Standard.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -57,6 +57,7 @@ class Mage_Paypal_Model_Api_Standard extends Mage_Paypal_Model_Api_Abstract 'cpp_headerborder_color' => 'hdrbordercolor', 'cpp_payflow_color' => 'payflowcolor', // 'cs' => '', // TODO + 'lc' => 'locale', ); protected $_exportToRequestFilters = array( 'amount' => '_filterAmount', @@ -72,7 +73,7 @@ class Mage_Paypal_Model_Api_Standard extends Mage_Paypal_Model_Api_Abstract protected $_commonRequestFields = array( 'business', 'invoice', 'currency_code', 'paymentaction', 'return', 'cancel_return', 'notify_url', 'bn', 'page_style', 'cpp_header_image', 'cpp_headerback_color', 'cpp_headerborder_color', 'cpp_payflow_color', - 'amount', 'shipping', 'tax', 'discount_amount', 'item_name', + 'amount', 'shipping', 'tax', 'discount_amount', 'item_name', 'lc', ); /** diff --git a/app/code/core/Mage/Paypal/Model/Cart.php b/app/code/core/Mage/Paypal/Model/Cart.php index 8254ebfef4..bf12cb0371 100644 --- a/app/code/core/Mage/Paypal/Model/Cart.php +++ b/app/code/core/Mage/Paypal/Model/Cart.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/Cert.php b/app/code/core/Mage/Paypal/Model/Cert.php index bfd9982641..85ea68a245 100644 --- a/app/code/core/Mage/Paypal/Model/Cert.php +++ b/app/code/core/Mage/Paypal/Model/Cert.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/Config.php b/app/code/core/Mage/Paypal/Model/Config.php index 2adf45ea60..49a81c5c89 100644 --- a/app/code/core/Mage/Paypal/Model/Config.php +++ b/app/code/core/Mage/Paypal/Model/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -106,6 +106,14 @@ class Mage_Paypal_Model_Config const AUTHORIZATION_AMOUNT_ONE = 1; const AUTHORIZATION_AMOUNT_FULL = 2; + /** + * Require Billing Address + * @var int + */ + const REQUIRE_BILLING_ADDRESS_NO = 0; + const REQUIRE_BILLING_ADDRESS_ALL = 1; + const REQUIRE_BILLING_ADDRESS_VIRTUAL = 2; + /** * Fraud management actions * @var string @@ -855,6 +863,20 @@ public function getPaymentActions() return $paymentActions; } + /** + * Require Billing Address source getter + * + * @return array + */ + public function getRequireBillingAddressOptions() + { + return array( + self::REQUIRE_BILLING_ADDRESS_ALL => Mage::helper('paypal')->__('Yes'), + self::REQUIRE_BILLING_ADDRESS_NO => Mage::helper('paypal')->__('No'), + self::REQUIRE_BILLING_ADDRESS_VIRTUAL => Mage::helper('paypal')->__('For Virtual Quotes Only'), + ); + } + /** * Mapper from PayPal-specific payment actions to Magento payment actions * @@ -1189,6 +1211,7 @@ protected function _mapExpressFieldset($fieldName) case 'solution_type': case 'visible_on_cart': case 'visible_on_product': + case 'require_billing_address': case 'authorization_honor_period': case 'order_valid_period': case 'child_authorization_number': diff --git a/app/code/core/Mage/Paypal/Model/Direct.php b/app/code/core/Mage/Paypal/Model/Direct.php index 2391d7780a..ce96693018 100644 --- a/app/code/core/Mage/Paypal/Model/Direct.php +++ b/app/code/core/Mage/Paypal/Model/Direct.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/Express.php b/app/code/core/Mage/Paypal/Model/Express.php index b870ea63db..2cc8d8fb67 100644 --- a/app/code/core/Mage/Paypal/Model/Express.php +++ b/app/code/core/Mage/Paypal/Model/Express.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -106,6 +106,21 @@ public function setStore($store) return $this; } + /** + * Can be used in regular checkout + * + * @return bool + */ + public function canUseCheckout() + { + if (Mage::getStoreConfigFlag('payment/hosted_pro/active') + && !Mage::getStoreConfigFlag('payment/hosted_pro/display_ec') + ) { + return false; + } + return parent::canUseCheckout(); + } + /** * Whether method is available for specified currency * @@ -535,6 +550,12 @@ protected function _placeOrder(Mage_Sales_Model_Order_Payment $payment, $amount) ->setPaypalCart(Mage::getModel('paypal/cart', array($order))) ->setIsLineItemsEnabled($this->_pro->getConfig()->lineItemsEnabled) ; + if ($order->getIsVirtual()) { + $api->setAddress($order->getBillingAddress())->setSuppressShipping(true); + } else { + $api->setAddress($order->getShippingAddress()); + $api->setBillingAddress($order->getBillingAddress()); + } // call api and get details from it $api->callDoExpressCheckoutPayment(); diff --git a/app/code/core/Mage/Paypal/Model/Express/Checkout.php b/app/code/core/Mage/Paypal/Model/Express/Checkout.php index 44fcd7821b..ebe6c27dc9 100644 --- a/app/code/core/Mage/Paypal/Model/Express/Checkout.php +++ b/app/code/core/Mage/Paypal/Model/Express/Checkout.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -194,6 +194,7 @@ public function getCheckoutShortcutImageUrl() * @param string $successUrl - payment success result * @param string $cancelUrl - payment cancellation result * @param string $pendingUrl - pending payment result + * @return Mage_Paypal_Model_Express_Checkout */ public function prepareGiropayUrls($successUrl, $cancelUrl, $pendingUrl) { @@ -256,7 +257,10 @@ public function setCustomerWithAddressChange($customer, $billingAddress = null, /** * Reserve order ID for specified quote and start checkout on PayPal - * @return string + * + * @param string $returnUrl + * @param string $cancelUrl + * @return mixed */ public function start($returnUrl, $cancelUrl) { @@ -288,8 +292,15 @@ public function start($returnUrl, $cancelUrl) $this->_setBillingAgreementRequest(); + if ($this->_config->requireBillingAddress == Mage_Paypal_Model_Config::REQUIRE_BILLING_ADDRESS_ALL) { + $this->_api->setRequireBillingAddress(1); + } + // supress or export shipping address if ($this->_quote->getIsVirtual()) { + if ($this->_config->requireBillingAddress == Mage_Paypal_Model_Config::REQUIRE_BILLING_ADDRESS_VIRTUAL) { + $this->_api->setRequireBillingAddress(1); + } $this->_api->setSuppressShipping(true); } else { $address = $this->_quote->getShippingAddress(); @@ -370,7 +381,18 @@ public function returnFromPaypal($token) $quote->setCustomerSuffix($billingAddress->getSuffix()); $quote->setCustomerNote($exportedBillingAddress->getData('note')); foreach ($exportedBillingAddress->getExportedKeys() as $key) { - if (!$billingAddress->getDataUsingMethod($key)) { + $oldData = $billingAddress->getDataUsingMethod($key); + $isEmpty = null; + if (is_array($oldData)) { + foreach($oldData as $val) { + if(!empty($val)) { + $isEmpty = false; + break; + } + $isEmpty = true; + } + } + if (empty($oldData) || $isEmpty === true) { $billingAddress->setDataUsingMethod($key, $exportedBillingAddress->getData($key)); } } @@ -485,11 +507,42 @@ public function updateShippingMethod($methodCode) if ($methodCode != $shippingAddress->getShippingMethod()) { $this->_ignoreAddressValidation(); $shippingAddress->setShippingMethod($methodCode)->setCollectShippingRates(true); - $this->_quote->collectTotals()->save(); + $this->_quote->collectTotals(); } } } + /** + * Update order data + * + * @param array $data + */ + public function updateOrder($data) + { + /** @var $checkout Mage_Checkout_Model_Type_Onepage */ + $checkout = Mage::getModel('checkout/type_onepage'); + + $this->_quote->setTotalsCollectedFlag(true); + $checkout->setQuote($this->_quote); + if (isset($data['billing'])) { + if (isset($data['customer-email'])) { + $data['billing']['email'] = $data['customer-email']; + } + $checkout->saveBilling($data['billing'], 0); + } + if (!$this->_quote->getIsVirtual() && isset($data['shipping'])) { + $checkout->saveShipping($data['shipping'], 0); + } + + if (isset($data['shipping_method'])) { + $this->updateShippingMethod($data['shipping_method']); + } + $this->_quote->setTotalsCollectedFlag(false); + $this->_quote->collectTotals(); + $this->_quote->setDataChanges(true); + $this->_quote->save(); + } + /** * Place the order and recurring payment profiles when customer returned from paypal * Until this moment all quote data must be valid @@ -504,7 +557,7 @@ public function place($token, $shippingMethodCode = null) } $isNewCustomer = false; - switch ($this->_quote->getCheckoutMethod()) { + switch ($this->getCheckoutMethod()) { case Mage_Checkout_Model_Type_Onepage::METHOD_GUEST: $this->_prepareGuestQuote(); break; @@ -570,13 +623,15 @@ private function _ignoreAddressValidation() $this->_quote->getBillingAddress()->setShouldIgnoreValidation(true); if (!$this->_quote->getIsVirtual()) { $this->_quote->getShippingAddress()->setShouldIgnoreValidation(true); + if (!$this->_config->requireBillingAddress && !$this->getCustomerSession()->isLoggedIn()) { + $this->_quote->getBillingAddress()->setSameAsShipping(1); + } } } /** * Determine whether redirect somewhere specifically is required * - * @param string $action * @return string */ public function getRedirectUrl() @@ -614,6 +669,26 @@ public function getOrder() return $this->_order; } + /** + * Get checkout method + * + * @return string + */ + public function getCheckoutMethod() + { + if ($this->getCustomerSession()->isLoggedIn()) { + return Mage_Checkout_Model_Type_Onepage::METHOD_CUSTOMER; + } + if (!$this->_quote->getCheckoutMethod()) { + if (Mage::helper('checkout')->isAllowedGuestCheckout($this->_quote)) { + $this->_quote->setCheckoutMethod(Mage_Checkout_Model_Type_Onepage::METHOD_GUEST); + } else { + $this->_quote->setCheckoutMethod(Mage_Checkout_Model_Type_Onepage::METHOD_REGISTER); + } + } + return $this->_quote->getCheckoutMethod(); + } + /** * Set create billing agreement flag to api call * @@ -835,8 +910,8 @@ protected function _prepareNewCustomerQuote() $customer->setSuffix($quote->getCustomerSuffix()); $customer->setPassword($customer->decryptPassword($quote->getPasswordHash())); $customer->setPasswordHash($customer->hashPassword($customer->getPassword())); - $quote->setCustomer($customer) - ->setCustomerId(true); + $customer->save(); + $quote->setCustomer($customer); return $this; } diff --git a/app/code/core/Mage/Paypal/Model/Hostedpro.php b/app/code/core/Mage/Paypal/Model/Hostedpro.php index b1b7514460..225e75abe5 100644 --- a/app/code/core/Mage/Paypal/Model/Hostedpro.php +++ b/app/code/core/Mage/Paypal/Model/Hostedpro.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/Hostedpro/Request.php b/app/code/core/Mage/Paypal/Model/Hostedpro/Request.php index c110e7f871..713d943b4c 100644 --- a/app/code/core/Mage/Paypal/Model/Hostedpro/Request.php +++ b/app/code/core/Mage/Paypal/Model/Hostedpro/Request.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/Info.php b/app/code/core/Mage/Paypal/Model/Info.php index d7ee29aaf5..9c54d69010 100644 --- a/app/code/core/Mage/Paypal/Model/Info.php +++ b/app/code/core/Mage/Paypal/Model/Info.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/Ipn.php b/app/code/core/Mage/Paypal/Model/Ipn.php index f84321fbb4..1fdf07716c 100644 --- a/app/code/core/Mage/Paypal/Model/Ipn.php +++ b/app/code/core/Mage/Paypal/Model/Ipn.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/Method/Agreement.php b/app/code/core/Mage/Paypal/Model/Method/Agreement.php index 497fd46355..10885cd1b8 100644 --- a/app/code/core/Mage/Paypal/Model/Method/Agreement.php +++ b/app/code/core/Mage/Paypal/Model/Method/Agreement.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/Mysql4/Cert.php b/app/code/core/Mage/Paypal/Model/Mysql4/Cert.php index 97e5e5c70f..040d002e48 100644 --- a/app/code/core/Mage/Paypal/Model/Mysql4/Cert.php +++ b/app/code/core/Mage/Paypal/Model/Mysql4/Cert.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/Mysql4/Report/Settlement.php b/app/code/core/Mage/Paypal/Model/Mysql4/Report/Settlement.php index 1e9fd6cbf7..7eda2d417c 100644 --- a/app/code/core/Mage/Paypal/Model/Mysql4/Report/Settlement.php +++ b/app/code/core/Mage/Paypal/Model/Mysql4/Report/Settlement.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/Mysql4/Report/Settlement/Row.php b/app/code/core/Mage/Paypal/Model/Mysql4/Report/Settlement/Row.php index dc3d39ebe8..d95dca2982 100644 --- a/app/code/core/Mage/Paypal/Model/Mysql4/Report/Settlement/Row.php +++ b/app/code/core/Mage/Paypal/Model/Mysql4/Report/Settlement/Row.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/Mysql4/Report/Settlement/Row/Collection.php b/app/code/core/Mage/Paypal/Model/Mysql4/Report/Settlement/Row/Collection.php index a7e8488dbc..386552f211 100644 --- a/app/code/core/Mage/Paypal/Model/Mysql4/Report/Settlement/Row/Collection.php +++ b/app/code/core/Mage/Paypal/Model/Mysql4/Report/Settlement/Row/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/Mysql4/Setup.php b/app/code/core/Mage/Paypal/Model/Mysql4/Setup.php index 432e4ef201..1eb75cc2e2 100644 --- a/app/code/core/Mage/Paypal/Model/Mysql4/Setup.php +++ b/app/code/core/Mage/Paypal/Model/Mysql4/Setup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/Observer.php b/app/code/core/Mage/Paypal/Model/Observer.php index 29aefce254..c860e9caad 100644 --- a/app/code/core/Mage/Paypal/Model/Observer.php +++ b/app/code/core/Mage/Paypal/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/Payflow/Request.php b/app/code/core/Mage/Paypal/Model/Payflow/Request.php index d3eff5f8d1..02b74aeb65 100644 --- a/app/code/core/Mage/Paypal/Model/Payflow/Request.php +++ b/app/code/core/Mage/Paypal/Model/Payflow/Request.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/Payflowadvanced.php b/app/code/core/Mage/Paypal/Model/Payflowadvanced.php index 3f6ee0becb..7c4facfe8e 100644 --- a/app/code/core/Mage/Paypal/Model/Payflowadvanced.php +++ b/app/code/core/Mage/Paypal/Model/Payflowadvanced.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/Payflowlink.php b/app/code/core/Mage/Paypal/Model/Payflowlink.php index 46b6f6e6c3..9fd92e25f2 100644 --- a/app/code/core/Mage/Paypal/Model/Payflowlink.php +++ b/app/code/core/Mage/Paypal/Model/Payflowlink.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -312,10 +312,12 @@ protected function _buildTokenRequest(Mage_Sales_Model_Order_Payment $payment) ->setCurrency($payment->getOrder()->getBaseCurrencyCode()) ->setInvnum($payment->getOrder()->getIncrementId()) ->setCustref($payment->getOrder()->getIncrementId()) - ->setPonum($payment->getOrder()->getId()) - ->setSubtotal($payment->getOrder()->getBaseSubtotal()) - ->setTaxamt($this->_formatStr('%.2F', $payment->getOrder()->getBaseTaxAmount())) - ->setFreightamt($this->_formatStr('%.2F', $payment->getOrder()->getBaseShippingAmount())); + ->setPonum($payment->getOrder()->getId()); + //This is PaPal issue with taxes and shipping + //->setSubtotal($this->_formatStr('%.2F', $payment->getOrder()->getBaseSubtotal())) + //->setTaxamt($this->_formatStr('%.2F', $payment->getOrder()->getBaseTaxAmount())) + //->setFreightamt($this->_formatStr('%.2F', $payment->getOrder()->getBaseShippingAmount())); + $order = $payment->getOrder(); if (empty($order)) { diff --git a/app/code/core/Mage/Paypal/Model/Payflowpro.php b/app/code/core/Mage/Paypal/Model/Payflowpro.php index 71336fd6ae..0993d7a83a 100644 --- a/app/code/core/Mage/Paypal/Model/Payflowpro.php +++ b/app/code/core/Mage/Paypal/Model/Payflowpro.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/Payment/Transaction.php b/app/code/core/Mage/Paypal/Model/Payment/Transaction.php index df0df23d5c..da1c155421 100644 --- a/app/code/core/Mage/Paypal/Model/Payment/Transaction.php +++ b/app/code/core/Mage/Paypal/Model/Payment/Transaction.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/Pro.php b/app/code/core/Mage/Paypal/Model/Pro.php index 21b6dd26a7..115d409106 100644 --- a/app/code/core/Mage/Paypal/Model/Pro.php +++ b/app/code/core/Mage/Paypal/Model/Pro.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/Report/Settlement.php b/app/code/core/Mage/Paypal/Model/Report/Settlement.php index 952868b65c..9e2a8d9171 100644 --- a/app/code/core/Mage/Paypal/Model/Report/Settlement.php +++ b/app/code/core/Mage/Paypal/Model/Report/Settlement.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/Report/Settlement/Row.php b/app/code/core/Mage/Paypal/Model/Report/Settlement/Row.php index 4ce472f95f..85befe9139 100644 --- a/app/code/core/Mage/Paypal/Model/Report/Settlement/Row.php +++ b/app/code/core/Mage/Paypal/Model/Report/Settlement/Row.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/Resource/Cert.php b/app/code/core/Mage/Paypal/Model/Resource/Cert.php index 78af06bac0..25c42b834e 100644 --- a/app/code/core/Mage/Paypal/Model/Resource/Cert.php +++ b/app/code/core/Mage/Paypal/Model/Resource/Cert.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/Resource/Payment/Transaction.php b/app/code/core/Mage/Paypal/Model/Resource/Payment/Transaction.php index 981f4c3889..af5bce2267 100644 --- a/app/code/core/Mage/Paypal/Model/Resource/Payment/Transaction.php +++ b/app/code/core/Mage/Paypal/Model/Resource/Payment/Transaction.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/Resource/Payment/Transaction/Collection.php b/app/code/core/Mage/Paypal/Model/Resource/Payment/Transaction/Collection.php index 569bc36a7e..c627da067a 100644 --- a/app/code/core/Mage/Paypal/Model/Resource/Payment/Transaction/Collection.php +++ b/app/code/core/Mage/Paypal/Model/Resource/Payment/Transaction/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/Resource/Report/Settlement.php b/app/code/core/Mage/Paypal/Model/Resource/Report/Settlement.php index 2c5a435aa7..66971084a4 100755 --- a/app/code/core/Mage/Paypal/Model/Resource/Report/Settlement.php +++ b/app/code/core/Mage/Paypal/Model/Resource/Report/Settlement.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/Resource/Report/Settlement/Row.php b/app/code/core/Mage/Paypal/Model/Resource/Report/Settlement/Row.php index 0bd52adf11..bc532749fc 100755 --- a/app/code/core/Mage/Paypal/Model/Resource/Report/Settlement/Row.php +++ b/app/code/core/Mage/Paypal/Model/Resource/Report/Settlement/Row.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/Resource/Report/Settlement/Row/Collection.php b/app/code/core/Mage/Paypal/Model/Resource/Report/Settlement/Row/Collection.php index a84d937d1b..0357859db8 100755 --- a/app/code/core/Mage/Paypal/Model/Resource/Report/Settlement/Row/Collection.php +++ b/app/code/core/Mage/Paypal/Model/Resource/Report/Settlement/Row/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/Resource/Setup.php b/app/code/core/Mage/Paypal/Model/Resource/Setup.php index 861cac4263..c9b945e2ac 100755 --- a/app/code/core/Mage/Paypal/Model/Resource/Setup.php +++ b/app/code/core/Mage/Paypal/Model/Resource/Setup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/Session.php b/app/code/core/Mage/Paypal/Model/Session.php index 8c7e727783..e762fd3e0a 100644 --- a/app/code/core/Mage/Paypal/Model/Session.php +++ b/app/code/core/Mage/Paypal/Model/Session.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/Standard.php b/app/code/core/Mage/Paypal/Model/Standard.php index c0103016b9..300ec044b8 100644 --- a/app/code/core/Mage/Paypal/Model/Standard.php +++ b/app/code/core/Mage/Paypal/Model/Standard.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -119,6 +119,7 @@ public function getStandardCheckoutFormFields() { $orderIncrementId = $this->getCheckout()->getLastRealOrderId(); $order = Mage::getModel('sales/order')->loadByIncrementId($orderIncrementId); + /* @var $api Mage_Paypal_Model_Api_Standard */ $api = Mage::getModel('paypal/api_standard')->setConfigObject($this->getConfig()); $api->setOrderId($orderIncrementId) ->setCurrencyCode($order->getBaseCurrencyCode()) @@ -142,7 +143,7 @@ public function getStandardCheckoutFormFields() ->setIsLineItemsEnabled($this->_config->lineItemsEnabled) ; $api->setCartSummary($this->_getAggregatedCartSummary()); - + $api->setLocale($api->getLocaleCode()); $result = $api->getStandardCheckoutRequest(); return $result; } diff --git a/app/code/core/Mage/Paypal/Model/System/Config/Backend/Cert.php b/app/code/core/Mage/Paypal/Model/System/Config/Backend/Cert.php index 8bd826244c..77ec077f26 100644 --- a/app/code/core/Mage/Paypal/Model/System/Config/Backend/Cert.php +++ b/app/code/core/Mage/Paypal/Model/System/Config/Backend/Cert.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/System/Config/Backend/Cron.php b/app/code/core/Mage/Paypal/Model/System/Config/Backend/Cron.php index 927246759b..d3778cd6b7 100644 --- a/app/code/core/Mage/Paypal/Model/System/Config/Backend/Cron.php +++ b/app/code/core/Mage/Paypal/Model/System/Config/Backend/Cron.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/System/Config/Backend/MerchantCountry.php b/app/code/core/Mage/Paypal/Model/System/Config/Backend/MerchantCountry.php index ff8c066e02..7f836362a1 100644 --- a/app/code/core/Mage/Paypal/Model/System/Config/Backend/MerchantCountry.php +++ b/app/code/core/Mage/Paypal/Model/System/Config/Backend/MerchantCountry.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/System/Config/Source/AuthorizationAmounts.php b/app/code/core/Mage/Paypal/Model/System/Config/Source/AuthorizationAmounts.php index eec78d64a9..5b45191ace 100644 --- a/app/code/core/Mage/Paypal/Model/System/Config/Source/AuthorizationAmounts.php +++ b/app/code/core/Mage/Paypal/Model/System/Config/Source/AuthorizationAmounts.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/System/Config/Source/BuyerCountry.php b/app/code/core/Mage/Paypal/Model/System/Config/Source/BuyerCountry.php index 3ab846ce25..d07e5202a9 100644 --- a/app/code/core/Mage/Paypal/Model/System/Config/Source/BuyerCountry.php +++ b/app/code/core/Mage/Paypal/Model/System/Config/Source/BuyerCountry.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/System/Config/Source/FetchingSchedule.php b/app/code/core/Mage/Paypal/Model/System/Config/Source/FetchingSchedule.php index 4b5853af77..4532508790 100644 --- a/app/code/core/Mage/Paypal/Model/System/Config/Source/FetchingSchedule.php +++ b/app/code/core/Mage/Paypal/Model/System/Config/Source/FetchingSchedule.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/System/Config/Source/Logo.php b/app/code/core/Mage/Paypal/Model/System/Config/Source/Logo.php index 0de192a1e8..b9b674899b 100644 --- a/app/code/core/Mage/Paypal/Model/System/Config/Source/Logo.php +++ b/app/code/core/Mage/Paypal/Model/System/Config/Source/Logo.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/System/Config/Source/MerchantCountry.php b/app/code/core/Mage/Paypal/Model/System/Config/Source/MerchantCountry.php index 8192387a6b..b9576fdefe 100644 --- a/app/code/core/Mage/Paypal/Model/System/Config/Source/MerchantCountry.php +++ b/app/code/core/Mage/Paypal/Model/System/Config/Source/MerchantCountry.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/System/Config/Source/PaymentActions.php b/app/code/core/Mage/Paypal/Model/System/Config/Source/PaymentActions.php index 657f94b9a6..7a9d36d3c9 100644 --- a/app/code/core/Mage/Paypal/Model/System/Config/Source/PaymentActions.php +++ b/app/code/core/Mage/Paypal/Model/System/Config/Source/PaymentActions.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/System/Config/Source/PaymentActions/Express.php b/app/code/core/Mage/Paypal/Model/System/Config/Source/PaymentActions/Express.php index 6071ec4705..ef2409b2ef 100644 --- a/app/code/core/Mage/Paypal/Model/System/Config/Source/PaymentActions/Express.php +++ b/app/code/core/Mage/Paypal/Model/System/Config/Source/PaymentActions/Express.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Freemethod.php b/app/code/core/Mage/Paypal/Model/System/Config/Source/RequireBillingAddress.php similarity index 69% rename from app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Freemethod.php rename to app/code/core/Mage/Paypal/Model/System/Config/Source/RequireBillingAddress.php index 5e3b4b843d..526df6b11e 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Freemethod.php +++ b/app/code/core/Mage/Paypal/Model/System/Config/Source/RequireBillingAddress.php @@ -19,23 +19,25 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage - * @package Mage_Usa - * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com) + * @package Mage_Paypal + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -class Mage_Usa_Model_Shipping_Carrier_Dhl_International_Source_Freemethod - extends Mage_Usa_Model_Shipping_Carrier_Dhl_International_Source_Method +/** + * Source model for Require Billing Address + */ +class Mage_Paypal_Model_System_Config_Source_RequireBillingAddress { /** - * Get Shipping Methods + * Options getter * * @return array */ public function toOptionArray() { - $arr = parent::toOptionArray(); - array_unshift($arr, array('value' => '', 'label' => Mage::helper('shipping')->__('None'))); - return $arr; + /** @var $configModel Mage_Paypal_Model_Config */ + $configModel = Mage::getModel('paypal/config'); + return $configModel->getRequireBillingAddressOptions(); } } diff --git a/app/code/core/Mage/Paypal/controllers/Adminhtml/Paypal/ReportsController.php b/app/code/core/Mage/Paypal/controllers/Adminhtml/Paypal/ReportsController.php index a032fc2376..2d31c6cd24 100644 --- a/app/code/core/Mage/Paypal/controllers/Adminhtml/Paypal/ReportsController.php +++ b/app/code/core/Mage/Paypal/controllers/Adminhtml/Paypal/ReportsController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/controllers/ExpressController.php b/app/code/core/Mage/Paypal/controllers/ExpressController.php index 211e1bf246..9ac9704b3a 100644 --- a/app/code/core/Mage/Paypal/controllers/ExpressController.php +++ b/app/code/core/Mage/Paypal/controllers/ExpressController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -49,20 +49,4 @@ class Mage_Paypal_ExpressController extends Mage_Paypal_Controller_Express_Abstr * @var string */ protected $_checkoutType = 'paypal/express_checkout'; - - /** - * Redirect to login page - * - */ - public function redirectLogin() - { - $this->setFlag('', 'no-dispatch', true); - Mage::getSingleton('customer/session')->setBeforeAuthUrl($this->_getRefererUrl()); - $this->getResponse()->setRedirect( - Mage::helper('core/url')->addRequestParam( - Mage::helper('customer')->getLoginUrl(), - array('context' => 'checkout') - ) - ); - } } diff --git a/app/code/core/Mage/Paypal/controllers/HostedproController.php b/app/code/core/Mage/Paypal/controllers/HostedproController.php index 1de750d28d..6c7be175b6 100644 --- a/app/code/core/Mage/Paypal/controllers/HostedproController.php +++ b/app/code/core/Mage/Paypal/controllers/HostedproController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/controllers/IpnController.php b/app/code/core/Mage/Paypal/controllers/IpnController.php index e2374febf9..d84e9b3039 100644 --- a/app/code/core/Mage/Paypal/controllers/IpnController.php +++ b/app/code/core/Mage/Paypal/controllers/IpnController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/controllers/PayflowController.php b/app/code/core/Mage/Paypal/controllers/PayflowController.php index c05edd5f5e..2f42695887 100644 --- a/app/code/core/Mage/Paypal/controllers/PayflowController.php +++ b/app/code/core/Mage/Paypal/controllers/PayflowController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -31,7 +31,7 @@ * @package Mage_Paypal * @author Magento Core Team */ -class Mage_Paypal_PayflowController extends Mage_Paypal_Controller_Express_Abstract +class Mage_Paypal_PayflowController extends Mage_Core_Controller_Front_Action { /** * When a customer cancel payment from payflow gateway. diff --git a/app/code/core/Mage/Paypal/controllers/PayflowadvancedController.php b/app/code/core/Mage/Paypal/controllers/PayflowadvancedController.php index 64c9840809..4c38141135 100644 --- a/app/code/core/Mage/Paypal/controllers/PayflowadvancedController.php +++ b/app/code/core/Mage/Paypal/controllers/PayflowadvancedController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/controllers/StandardController.php b/app/code/core/Mage/Paypal/controllers/StandardController.php index 80da34a773..870ae3f452 100644 --- a/app/code/core/Mage/Paypal/controllers/StandardController.php +++ b/app/code/core/Mage/Paypal/controllers/StandardController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/etc/adminhtml.xml b/app/code/core/Mage/Paypal/etc/adminhtml.xml index fb57830a40..d5b67ed94a 100644 --- a/app/code/core/Mage/Paypal/etc/adminhtml.xml +++ b/app/code/core/Mage/Paypal/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Paypal/etc/config.xml b/app/code/core/Mage/Paypal/etc/config.xml index d804cf46e1..50a06201d7 100644 --- a/app/code/core/Mage/Paypal/etc/config.xml +++ b/app/code/core/Mage/Paypal/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -276,6 +276,7 @@ Payment by cards or by PayPal account Authorization paypal + 0 diff --git a/app/code/core/Mage/Paypal/etc/system.xml b/app/code/core/Mage/Paypal/etc/system.xml index 7002b25677..07fbf8852c 100644 --- a/app/code/core/Mage/Paypal/etc/system.xml +++ b/app/code/core/Mage/Paypal/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -483,6 +483,16 @@ 1 1 + + + This feature needs be enabled first for the merchant account through PayPal technical support. + payment/paypal_express/require_billing_address + select + paypal/system_config_source_requireBillingAddress + 65 + 1 + 1 + Whether to create a billing agreement, if there are no active billing agreements available. @@ -1932,6 +1942,15 @@ 1 1 + + + payment/hosted_pro/display_ec + select + adminhtml/system_config_source_yesno + 45 + 1 + 1 + diff --git a/app/code/core/Mage/Paypal/sql/paypal_setup/install-1.6.0.0.php b/app/code/core/Mage/Paypal/sql/paypal_setup/install-1.6.0.0.php index 26e6873050..215a99a78d 100644 --- a/app/code/core/Mage/Paypal/sql/paypal_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Paypal/sql/paypal_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/sql/paypal_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/Paypal/sql/paypal_setup/mysql4-install-0.7.0.php index 5b2a4d409b..5dd7cec717 100644 --- a/app/code/core/Mage/Paypal/sql/paypal_setup/mysql4-install-0.7.0.php +++ b/app/code/core/Mage/Paypal/sql/paypal_setup/mysql4-install-0.7.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/sql/paypal_setup/mysql4-install-1.4.0.0.php b/app/code/core/Mage/Paypal/sql/paypal_setup/mysql4-install-1.4.0.0.php index 062c432819..198b3fcdb4 100644 --- a/app/code/core/Mage/Paypal/sql/paypal_setup/mysql4-install-1.4.0.0.php +++ b/app/code/core/Mage/Paypal/sql/paypal_setup/mysql4-install-1.4.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/sql/paypal_setup/mysql4-upgrade-0.7.1-0.7.2.php b/app/code/core/Mage/Paypal/sql/paypal_setup/mysql4-upgrade-0.7.1-0.7.2.php index 8227a56c7f..72d39220cc 100644 --- a/app/code/core/Mage/Paypal/sql/paypal_setup/mysql4-upgrade-0.7.1-0.7.2.php +++ b/app/code/core/Mage/Paypal/sql/paypal_setup/mysql4-upgrade-0.7.1-0.7.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ $installer = $this; diff --git a/app/code/core/Mage/Paypal/sql/paypal_setup/mysql4-upgrade-0.7.2-0.7.3.php b/app/code/core/Mage/Paypal/sql/paypal_setup/mysql4-upgrade-0.7.2-0.7.3.php index 7f7ddb894e..c56cd5ec66 100644 --- a/app/code/core/Mage/Paypal/sql/paypal_setup/mysql4-upgrade-0.7.2-0.7.3.php +++ b/app/code/core/Mage/Paypal/sql/paypal_setup/mysql4-upgrade-0.7.2-0.7.3.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ $installer = $this; diff --git a/app/code/core/Mage/Paypal/sql/paypal_setup/mysql4-upgrade-1.4.0.0-1.4.0.1.php b/app/code/core/Mage/Paypal/sql/paypal_setup/mysql4-upgrade-1.4.0.0-1.4.0.1.php index 1aba46fc36..b6d1d85782 100644 --- a/app/code/core/Mage/Paypal/sql/paypal_setup/mysql4-upgrade-1.4.0.0-1.4.0.1.php +++ b/app/code/core/Mage/Paypal/sql/paypal_setup/mysql4-upgrade-1.4.0.0-1.4.0.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/sql/paypal_setup/mysql4-upgrade-1.4.0.1-1.4.0.2.php b/app/code/core/Mage/Paypal/sql/paypal_setup/mysql4-upgrade-1.4.0.1-1.4.0.2.php index 5781777086..c061b91ca8 100644 --- a/app/code/core/Mage/Paypal/sql/paypal_setup/mysql4-upgrade-1.4.0.1-1.4.0.2.php +++ b/app/code/core/Mage/Paypal/sql/paypal_setup/mysql4-upgrade-1.4.0.1-1.4.0.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/sql/paypal_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/Paypal/sql/paypal_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php index 66d99e07a1..d5cf596e53 100644 --- a/app/code/core/Mage/Paypal/sql/paypal_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ b/app/code/core/Mage/Paypal/sql/paypal_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/sql/paypal_setup/upgrade-1.6.0.0-1.6.0.1.php b/app/code/core/Mage/Paypal/sql/paypal_setup/upgrade-1.6.0.0-1.6.0.1.php index 3c633eb734..f4be0b04a0 100644 --- a/app/code/core/Mage/Paypal/sql/paypal_setup/upgrade-1.6.0.0-1.6.0.1.php +++ b/app/code/core/Mage/Paypal/sql/paypal_setup/upgrade-1.6.0.0-1.6.0.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/sql/paypal_setup/upgrade-1.6.0.1-1.6.0.2.php b/app/code/core/Mage/Paypal/sql/paypal_setup/upgrade-1.6.0.1-1.6.0.2.php index 397b660940..2f432f5370 100644 --- a/app/code/core/Mage/Paypal/sql/paypal_setup/upgrade-1.6.0.1-1.6.0.2.php +++ b/app/code/core/Mage/Paypal/sql/paypal_setup/upgrade-1.6.0.1-1.6.0.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/PaypalUk/Block/Express/Form.php b/app/code/core/Mage/PaypalUk/Block/Express/Form.php index 199e02e618..bea0dae611 100644 --- a/app/code/core/Mage/PaypalUk/Block/Express/Form.php +++ b/app/code/core/Mage/PaypalUk/Block/Express/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_PaypalUk - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/PaypalUk/Block/Express/Shortcut.php b/app/code/core/Mage/PaypalUk/Block/Express/Shortcut.php index 119754eda1..fef56af7d5 100644 --- a/app/code/core/Mage/PaypalUk/Block/Express/Shortcut.php +++ b/app/code/core/Mage/PaypalUk/Block/Express/Shortcut.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_PaypalUk - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/PaypalUk/Helper/Data.php b/app/code/core/Mage/PaypalUk/Helper/Data.php index 347bb5411c..9c5c7a8d8f 100644 --- a/app/code/core/Mage/PaypalUk/Helper/Data.php +++ b/app/code/core/Mage/PaypalUk/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_PaypalUk - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/PaypalUk/Model/Api/Nvp.php b/app/code/core/Mage/PaypalUk/Model/Api/Nvp.php index a571d4be1e..d15b54064d 100644 --- a/app/code/core/Mage/PaypalUk/Model/Api/Nvp.php +++ b/app/code/core/Mage/PaypalUk/Model/Api/Nvp.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_PaypalUk - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -85,61 +85,61 @@ class Mage_PaypalUk_Model_Api_Nvp extends Mage_Paypal_Model_Api_Nvp */ protected $_globalMap = array( // each call - 'PARTNER' => 'partner', - 'VENDOR' => 'vendor', - 'USER' => 'user', - 'PWD' => 'password', - 'BUTTONSOURCE' => 'build_notation_code', - 'TENDER' => 'tender', + 'PARTNER' => 'partner', + 'VENDOR' => 'vendor', + 'USER' => 'user', + 'PWD' => 'password', + 'BUTTONSOURCE' => 'build_notation_code', + 'TENDER' => 'tender', // commands - 'RETURNURL' => 'return_url', - 'CANCELURL' => 'cancel_url', - 'INVNUM' => 'inv_num', - 'TOKEN' => 'token', + 'RETURNURL' => 'return_url', + 'CANCELURL' => 'cancel_url', + 'INVNUM' => 'inv_num', + 'TOKEN' => 'token', 'CORRELATIONID' => 'correlation_id', - 'CUSTIP' => 'ip_address', - 'NOTIFYURL' => 'notify_url', - 'NOTE' => 'note', + 'CUSTIP' => 'ip_address', + 'NOTIFYURL' => 'notify_url', + 'NOTE' => 'note', // style settings - 'PAGESTYLE' => 'page_style', - 'HDRIMG' => 'hdrimg', + 'PAGESTYLE' => 'page_style', + 'HDRIMG' => 'hdrimg', 'HDRBORDERCOLOR' => 'hdrbordercolor', - 'HDRBACKCOLOR' => 'hdrbackcolor', - 'PAYFLOWCOLOR' => 'payflowcolor', - 'LOCALECODE' => 'locale_code', + 'HDRBACKCOLOR' => 'hdrbackcolor', + 'PAYFLOWCOLOR' => 'payflowcolor', + 'LOCALECODE' => 'locale_code', // transaction info - 'PPREF' => 'paypal_transaction_id',//We need to store paypal trx id for correct IPN working - 'PNREF' => 'transaction_id', - 'ORIGID' => 'authorization_id', - 'CAPTURECOMPLETE' => 'complete_type', - 'AMT' => 'amount', - 'AVSADDR' => 'address_verification', - 'AVSZIP' => 'postcode_verification', + 'PPREF' => 'paypal_transaction_id', //We need to store paypal trx id for correct IPN working + 'PNREF' => 'transaction_id', + 'ORIGID' => 'authorization_id', + 'CAPTURECOMPLETE' => 'complete_type', + 'AMT' => 'amount', + 'AVSADDR' => 'address_verification', + 'AVSZIP' => 'postcode_verification', // payment/billing info - 'CURRENCY' => 'currency_code', + 'CURRENCY' => 'currency_code', 'PENDINGREASON' => 'pending_reason', 'PAYERID' => 'payer_id', 'PAYERSTATUS' => 'payer_status', - 'EMAIL' => 'email', + 'EMAIL' => 'email', // backwards compatibility - 'FIRSTNAME' => 'firstname', - 'LASTNAME' => 'lastname', + 'FIRSTNAME' => 'firstname', + 'LASTNAME' => 'lastname', // paypal direct credit card information - 'ACCT' => 'credit_card_number', - 'EXPDATE' => 'credit_card_expiration_date', - 'CVV2' => 'credit_card_cvv2', - 'CARDSTART' => 'maestro_solo_issue_date', // MMYY, including leading zero - 'CARDISSUE' => 'maestro_solo_issue_number', - 'CVV2MATCH' => 'cvv2_check_result', + 'ACCT' => 'credit_card_number', + 'EXPDATE' => 'credit_card_expiration_date', + 'CVV2' => 'credit_card_cvv2', + 'CARDSTART' => 'maestro_solo_issue_date', // MMYY, including leading zero + 'CARDISSUE' => 'maestro_solo_issue_number', + 'CVV2MATCH' => 'cvv2_check_result', // cardinal centinel 'AUTHSTATUS3DS' => 'centinel_authstatus', 'MPIVENDOR3DS' => 'centinel_mpivendor', - 'CAVV' => 'centinel_cavv', - 'ECI' => 'centinel_eci', - 'XID' => 'centinel_xid', - 'VPAS' => 'centinel_vpas_result', + 'CAVV' => 'centinel_cavv', + 'ECI' => 'centinel_eci', + 'XID' => 'centinel_xid', + 'VPAS' => 'centinel_vpas_result', 'ECISUBMITTED3DS' => 'centinel_eci_result', ); @@ -163,6 +163,7 @@ class Mage_PaypalUk_Model_Api_Nvp extends Mage_Paypal_Model_Api_Nvp 'AMT', 'CUSTIP', 'INVNUM', 'CARDISSUE', 'CARDSTART', 'AUTHSTATUS3DS', 'MPIVENDOR3DS', 'CAVV', 'ECI', 'XID',//cardinal centinel params + 'TAXAMT', 'FREIGHTAMT' ); protected $_doDirectPaymentResponse = array( 'PNREF', 'PPREF', 'CORRELATIONID', 'CVV2MATCH', 'AVSADDR', 'AVSZIP', 'PENDINGREASON' @@ -299,7 +300,11 @@ class Mage_PaypalUk_Model_Api_Nvp extends Mage_Paypal_Model_Api_Nvp * * @var array */ - protected $_lineItemTotalExportMap = array(); + protected $_lineItemTotalExportMap = array( + Mage_Paypal_Model_Cart::TOTAL_TAX => 'TAXAMT', + Mage_Paypal_Model_Cart::TOTAL_SHIPPING => 'FREIGHTAMT', + ); + protected $_lineItemExportItemsFormat = array( 'name' => 'L_NAME%d', 'qty' => 'L_QTY%d', diff --git a/app/code/core/Mage/PaypalUk/Model/Direct.php b/app/code/core/Mage/PaypalUk/Model/Direct.php index 860fed827c..96cb43861d 100644 --- a/app/code/core/Mage/PaypalUk/Model/Direct.php +++ b/app/code/core/Mage/PaypalUk/Model/Direct.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_PaypalUk - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/PaypalUk/Model/Express.php b/app/code/core/Mage/PaypalUk/Model/Express.php index a0ef0f123b..0d371aa560 100644 --- a/app/code/core/Mage/PaypalUk/Model/Express.php +++ b/app/code/core/Mage/PaypalUk/Model/Express.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_PaypalUk - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/PaypalUk/Model/Express/Checkout.php b/app/code/core/Mage/PaypalUk/Model/Express/Checkout.php index 8a0ed78c7f..21b979d3f0 100644 --- a/app/code/core/Mage/PaypalUk/Model/Express/Checkout.php +++ b/app/code/core/Mage/PaypalUk/Model/Express/Checkout.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_PaypalUk - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -43,4 +43,13 @@ class Mage_PaypalUk_Model_Express_Checkout extends Mage_Paypal_Model_Express_Che */ protected $_methodType = Mage_Paypal_Model_Config::METHOD_WPP_PE_EXPRESS; + /** + * Set shipping method to quote, if needed + * @param string $methodCode + */ + public function updateShippingMethod($methodCode) + { + parent::updateShippingMethod($methodCode); + $this->_quote->save(); + } } diff --git a/app/code/core/Mage/PaypalUk/Model/Pro.php b/app/code/core/Mage/PaypalUk/Model/Pro.php index 2620facee1..6c53cd7725 100644 --- a/app/code/core/Mage/PaypalUk/Model/Pro.php +++ b/app/code/core/Mage/PaypalUk/Model/Pro.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_PaypalUk - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/PaypalUk/Model/Session.php b/app/code/core/Mage/PaypalUk/Model/Session.php index 327b702429..e4e8f51446 100644 --- a/app/code/core/Mage/PaypalUk/Model/Session.php +++ b/app/code/core/Mage/PaypalUk/Model/Session.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_PaypalUk - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/PaypalUk/controllers/ExpressController.php b/app/code/core/Mage/PaypalUk/controllers/ExpressController.php index afcc7dbfd9..8f9ad4517a 100644 --- a/app/code/core/Mage/PaypalUk/controllers/ExpressController.php +++ b/app/code/core/Mage/PaypalUk/controllers/ExpressController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_PaypalUk - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/PaypalUk/etc/config.xml b/app/code/core/Mage/PaypalUk/etc/config.xml index c591592494..dfb468ef91 100644 --- a/app/code/core/Mage/PaypalUk/etc/config.xml +++ b/app/code/core/Mage/PaypalUk/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_PaypalUk - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/PaypalUk/sql/paypaluk_setup/install-1.6.0.0.php b/app/code/core/Mage/PaypalUk/sql/paypaluk_setup/install-1.6.0.0.php index 0689c15811..f974f2264a 100644 --- a/app/code/core/Mage/PaypalUk/sql/paypaluk_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/PaypalUk/sql/paypaluk_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_PaypalUk - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/PaypalUk/sql/paypaluk_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/PaypalUk/sql/paypaluk_setup/mysql4-install-0.7.0.php index 0be2f3e673..788ff9bf75 100644 --- a/app/code/core/Mage/PaypalUk/sql/paypaluk_setup/mysql4-install-0.7.0.php +++ b/app/code/core/Mage/PaypalUk/sql/paypaluk_setup/mysql4-install-0.7.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_PaypalUk - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Persistent/Block/Form/Remember.php b/app/code/core/Mage/Persistent/Block/Form/Remember.php index 134134d7fd..fdd91f8748 100644 --- a/app/code/core/Mage/Persistent/Block/Form/Remember.php +++ b/app/code/core/Mage/Persistent/Block/Form/Remember.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Persistent - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Persistent/Block/Header/Additional.php b/app/code/core/Mage/Persistent/Block/Header/Additional.php index 8fc27399ce..9fd32abe98 100644 --- a/app/code/core/Mage/Persistent/Block/Header/Additional.php +++ b/app/code/core/Mage/Persistent/Block/Header/Additional.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Persistent - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Persistent/Helper/Data.php b/app/code/core/Mage/Persistent/Helper/Data.php index 80e154f7f5..d7ae965f04 100644 --- a/app/code/core/Mage/Persistent/Helper/Data.php +++ b/app/code/core/Mage/Persistent/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Persistent - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Persistent/Helper/Session.php b/app/code/core/Mage/Persistent/Helper/Session.php index 8d219abd3b..bc00b003e9 100644 --- a/app/code/core/Mage/Persistent/Helper/Session.php +++ b/app/code/core/Mage/Persistent/Helper/Session.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Persistent - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -37,23 +37,23 @@ class Mage_Persistent_Helper_Session extends Mage_Core_Helper_Data /** * Instance of Session Model * - * @var Mage_Persistent_Model_Session + * @var null|Mage_Persistent_Model_Session */ - protected $_sessionModel = null; + protected $_sessionModel; /** * Persistent customer * - * @var Mage_Customer_Model_Customer + * @var null|Mage_Customer_Model_Customer */ - protected $_customer = null; + protected $_customer; /** * Is "Remember Me" checked * - * @var bool + * @var null|bool */ - protected $_isRememberMeChecked = null; + protected $_isRememberMeChecked; /** * Get Session model @@ -88,7 +88,7 @@ public function setSession($sessionModel) */ public function isPersistent() { - return (bool)$this->getSession()->getId() && Mage::helper('persistent')->isEnabled(); + return $this->getSession()->getId() && Mage::helper('persistent')->isEnabled(); } /** diff --git a/app/code/core/Mage/Persistent/Model/Observer.php b/app/code/core/Mage/Persistent/Model/Observer.php index dfce8bceb2..84eec86372 100644 --- a/app/code/core/Mage/Persistent/Model/Observer.php +++ b/app/code/core/Mage/Persistent/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Persistent - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -288,8 +288,7 @@ public function customerAuthenticatedEvent($observer) { /** @var $customerSession Mage_Customer_Model_Session */ $customerSession = Mage::getSingleton('customer/session'); - $customerSession->setCustomerId(null) - ->setCustomerGroupId(null); + $customerSession->setCustomerId(null)->setCustomerGroupId(null); if (Mage::app()->getRequest()->getParam('context') != 'checkout') { $this->_expirePersistentSession(); @@ -314,8 +313,7 @@ public function removePersistentCookie($observer) /** @var $customerSession Mage_Customer_Model_Session */ $customerSession = Mage::getSingleton('customer/session'); if (!$customerSession->isLoggedIn()) { - $customerSession->setCustomerId(null) - ->setCustomerGroupId(null); + $customerSession->setCustomerId(null)->setCustomerGroupId(null); } $this->setQuoteGuest(); @@ -347,7 +345,16 @@ public function preventExpressCheckout($observer) /** @var $controllerAction Mage_Core_Controller_Front_Action */ $controllerAction = $observer->getEvent()->getControllerAction(); if (is_callable(array($controllerAction, 'redirectLogin'))) { + Mage::getSingleton('core/session')->addNotice( + Mage::helper('persistent')->__('To proceed to Checkout, please log in using your email address.') + ); $controllerAction->redirectLogin(); + if ($controllerAction instanceof Mage_GoogleCheckout_RedirectController + || $controllerAction instanceof Mage_Paypal_Controller_Express_Abstract + ) { + Mage::getSingleton('customer/session') + ->setBeforeAuthUrl(Mage::getUrl('persistent/index/expressCheckout')); + } } } @@ -479,6 +486,8 @@ public function checkExpirePersistentQuote(Varien_Event_Observer $observer) && !$this->_isPersistent() && !$customerSession->isLoggedIn() && Mage::getSingleton('checkout/session')->getQuoteId() + && !($observer->getControllerAction() instanceof Mage_Checkout_OnepageController) + // persistent session does not expire on onepage checkout page to not spoil customer group id ) { Mage::dispatchEvent('persistent_session_expired'); $this->_expirePersistentSession(); diff --git a/app/code/core/Mage/Persistent/Model/Observer/Session.php b/app/code/core/Mage/Persistent/Model/Observer/Session.php index a40eed0169..88d2631d57 100644 --- a/app/code/core/Mage/Persistent/Model/Observer/Session.php +++ b/app/code/core/Mage/Persistent/Model/Observer/Session.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Persistent - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Persistent/Model/Persistent/Config.php b/app/code/core/Mage/Persistent/Model/Persistent/Config.php index 703b8ef2e2..cae76e3348 100644 --- a/app/code/core/Mage/Persistent/Model/Persistent/Config.php +++ b/app/code/core/Mage/Persistent/Model/Persistent/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Persistent - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Persistent/Model/Resource/Session.php b/app/code/core/Mage/Persistent/Model/Resource/Session.php index b7fba4a7c0..5ae5f8fad9 100644 --- a/app/code/core/Mage/Persistent/Model/Resource/Session.php +++ b/app/code/core/Mage/Persistent/Model/Resource/Session.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Persistent - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -61,7 +61,10 @@ protected function _getLoadSelect($field, $value, $object) { $select = parent::_getLoadSelect($field, $value, $object); if (!$object->getLoadExpired()) { - $select->where('updated_at >= ?', $object->getExpiredBefore()); + $tableName = $this->getMainTable(); + $select->join(array('customer' => $this->getTable('customer/entity')), + 'customer.entity_id = ' . $tableName . '.customer_id' + )->where($tableName . '.updated_at >= ?', $object->getExpiredBefore()); } return $select; diff --git a/app/code/core/Mage/Persistent/Model/Session.php b/app/code/core/Mage/Persistent/Model/Session.php index 09e9dfa1af..46845ebd2f 100644 --- a/app/code/core/Mage/Persistent/Model/Session.php +++ b/app/code/core/Mage/Persistent/Model/Session.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Persistent - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Persistent/controllers/IndexController.php b/app/code/core/Mage/Persistent/controllers/IndexController.php index a05d620740..622e8a1016 100644 --- a/app/code/core/Mage/Persistent/controllers/IndexController.php +++ b/app/code/core/Mage/Persistent/controllers/IndexController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Persistent - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -113,4 +113,16 @@ public function saveMethodAction() $checkoutUrl = $this->_getRefererUrl(); $this->_redirectUrl($checkoutUrl . (strpos($checkoutUrl, '?') ? '&' : '?') . 'register'); } + + /** + * Add appropriate session message and redirect to shopping cart + * used for google checkout and paypal express checkout + */ + public function expressCheckoutAction() + { + Mage::getSingleton('core/session')->addNotice( + Mage::helper('persistent')->__('Shopping cart has been updated with appropriate prices') + ); + $this->_redirect('checkout/cart'); + } } diff --git a/app/code/core/Mage/Persistent/etc/adminhtml.xml b/app/code/core/Mage/Persistent/etc/adminhtml.xml index 07b6d25611..20d0438fa2 100644 --- a/app/code/core/Mage/Persistent/etc/adminhtml.xml +++ b/app/code/core/Mage/Persistent/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Persistent - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Persistent/etc/config.xml b/app/code/core/Mage/Persistent/etc/config.xml index 0a6f42d6b9..a8bc9e756a 100644 --- a/app/code/core/Mage/Persistent/etc/config.xml +++ b/app/code/core/Mage/Persistent/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Persistent - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -231,6 +231,14 @@ + + + + persistent/observer + preventExpressCheckout + + + diff --git a/app/code/core/Mage/Persistent/etc/persistent.xml b/app/code/core/Mage/Persistent/etc/persistent.xml index d0acf654b8..1c71b1d81f 100644 --- a/app/code/core/Mage/Persistent/etc/persistent.xml +++ b/app/code/core/Mage/Persistent/etc/persistent.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Persistent - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Persistent/etc/system.xml b/app/code/core/Mage/Persistent/etc/system.xml index e1704a26fc..e8a3d79947 100644 --- a/app/code/core/Mage/Persistent/etc/system.xml +++ b/app/code/core/Mage/Persistent/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Persistent - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Persistent/sql/persistent_setup/install-1.0.0.0.php b/app/code/core/Mage/Persistent/sql/persistent_setup/install-1.0.0.0.php index c6023f86db..1781b1405e 100644 --- a/app/code/core/Mage/Persistent/sql/persistent_setup/install-1.0.0.0.php +++ b/app/code/core/Mage/Persistent/sql/persistent_setup/install-1.0.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Persistent - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Poll/Block/ActivePoll.php b/app/code/core/Mage/Poll/Block/ActivePoll.php index 8643b8708d..3beb480715 100755 --- a/app/code/core/Mage/Poll/Block/ActivePoll.php +++ b/app/code/core/Mage/Poll/Block/ActivePoll.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Poll - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -204,13 +204,20 @@ public function setPollTemplate($template, $type) */ protected function _toHtml() { + /** @var $coreSessionModel Mage_Core_Model_Session */ + $coreSessionModel = Mage::getSingleton('core/session'); + $justVotedPollId = $coreSessionModel->getJustVotedPoll(); + if ($justVotedPollId && !$this->_pollModel->isVoted($justVotedPollId)) { + $this->_pollModel->setVoted($justVotedPollId); + } + $pollId = $this->getPollToShow(); $data = $this->getPollData($pollId); $this->assign($data); - Mage::getSingleton('core/session')->setJustVotedPoll(false); + $coreSessionModel->setJustVotedPoll(false); - if ($this->_pollModel->isVoted($pollId) === true) { + if ($this->_pollModel->isVoted($pollId) === true || $justVotedPollId) { $this->setTemplate($this->_templates['results']); } else { $this->setTemplate($this->_templates['poll']); diff --git a/app/code/core/Mage/Poll/Block/Poll.php b/app/code/core/Mage/Poll/Block/Poll.php index 865a997cad..3d3c139d2e 100644 --- a/app/code/core/Mage/Poll/Block/Poll.php +++ b/app/code/core/Mage/Poll/Block/Poll.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Poll - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Poll/Helper/Data.php b/app/code/core/Mage/Poll/Helper/Data.php index 44d9c97359..a0b915e64f 100644 --- a/app/code/core/Mage/Poll/Helper/Data.php +++ b/app/code/core/Mage/Poll/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Poll - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Poll/Model/Mysql4/Poll.php b/app/code/core/Mage/Poll/Model/Mysql4/Poll.php index 6549587d91..b4d3fb6b69 100644 --- a/app/code/core/Mage/Poll/Model/Mysql4/Poll.php +++ b/app/code/core/Mage/Poll/Model/Mysql4/Poll.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Poll - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Poll/Model/Mysql4/Poll/Answer.php b/app/code/core/Mage/Poll/Model/Mysql4/Poll/Answer.php index 3dc060edf5..efe023643c 100644 --- a/app/code/core/Mage/Poll/Model/Mysql4/Poll/Answer.php +++ b/app/code/core/Mage/Poll/Model/Mysql4/Poll/Answer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Poll - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Poll/Model/Mysql4/Poll/Answer/Collection.php b/app/code/core/Mage/Poll/Model/Mysql4/Poll/Answer/Collection.php index 450152b5ac..8994ead17c 100644 --- a/app/code/core/Mage/Poll/Model/Mysql4/Poll/Answer/Collection.php +++ b/app/code/core/Mage/Poll/Model/Mysql4/Poll/Answer/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Poll - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Poll/Model/Mysql4/Poll/Collection.php b/app/code/core/Mage/Poll/Model/Mysql4/Poll/Collection.php index c138094253..9a981d783c 100644 --- a/app/code/core/Mage/Poll/Model/Mysql4/Poll/Collection.php +++ b/app/code/core/Mage/Poll/Model/Mysql4/Poll/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Poll - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Poll/Model/Mysql4/Poll/Vote.php b/app/code/core/Mage/Poll/Model/Mysql4/Poll/Vote.php index cf146f2296..e55ffc6d16 100644 --- a/app/code/core/Mage/Poll/Model/Mysql4/Poll/Vote.php +++ b/app/code/core/Mage/Poll/Model/Mysql4/Poll/Vote.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Poll - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Poll/Model/Poll.php b/app/code/core/Mage/Poll/Model/Poll.php index 0ed6d6c17b..a387d060ce 100644 --- a/app/code/core/Mage/Poll/Model/Poll.php +++ b/app/code/core/Mage/Poll/Model/Poll.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Poll - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -81,16 +81,28 @@ public function getCookie() */ public function getCookieName($pollId = null) { - return $this->_pollCookieDefaultName . $this->getPoolId($pollId); + return $this->_pollCookieDefaultName . $this->getPollId($pollId); } /** * Retrieve defined or current Id * + * @deprecated since 1.7.0.0 * @param int $pollId * @return int */ public function getPoolId($pollId = null) + { + return $this->getPollId($pollId); + } + + /** + * Retrieve defined or current Id + * + * @param int|null $pollId + * @return int + */ + public function getPollId($pollId = null) { if (is_null($pollId)) { $pollId = $this->getId(); @@ -116,7 +128,7 @@ public function isValidationByIp() */ public function setVoted($pollId=null) { - $this->getCookie()->set($this->getCookieName($pollId), $this->getPoolId($pollId)); + $this->getCookie()->set($this->getCookieName($pollId), $this->getPollId($pollId)); return $this; } @@ -129,7 +141,7 @@ public function setVoted($pollId=null) */ public function isVoted($pollId = null) { - $pollId = $this->getPoolId($pollId); + $pollId = $this->getPollId($pollId); // check if it is in cookie $cookie = $this->getCookie()->get($this->getCookieName($pollId)); diff --git a/app/code/core/Mage/Poll/Model/Poll/Answer.php b/app/code/core/Mage/Poll/Model/Poll/Answer.php index f846d2e56e..8d25f7cf3b 100644 --- a/app/code/core/Mage/Poll/Model/Poll/Answer.php +++ b/app/code/core/Mage/Poll/Model/Poll/Answer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Poll - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Poll/Model/Poll/Vote.php b/app/code/core/Mage/Poll/Model/Poll/Vote.php index 55216e3424..ef5e6ffb81 100644 --- a/app/code/core/Mage/Poll/Model/Poll/Vote.php +++ b/app/code/core/Mage/Poll/Model/Poll/Vote.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Poll - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Poll/Model/Resource/Poll.php b/app/code/core/Mage/Poll/Model/Resource/Poll.php index 5d3f098cd4..65a177e600 100755 --- a/app/code/core/Mage/Poll/Model/Resource/Poll.php +++ b/app/code/core/Mage/Poll/Model/Resource/Poll.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Poll - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Poll/Model/Resource/Poll/Answer.php b/app/code/core/Mage/Poll/Model/Resource/Poll/Answer.php index 448405ef93..6cebfa9fab 100755 --- a/app/code/core/Mage/Poll/Model/Resource/Poll/Answer.php +++ b/app/code/core/Mage/Poll/Model/Resource/Poll/Answer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Poll - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Poll/Model/Resource/Poll/Answer/Collection.php b/app/code/core/Mage/Poll/Model/Resource/Poll/Answer/Collection.php index 06cc774bef..eabeecd49d 100755 --- a/app/code/core/Mage/Poll/Model/Resource/Poll/Answer/Collection.php +++ b/app/code/core/Mage/Poll/Model/Resource/Poll/Answer/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Poll - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Poll/Model/Resource/Poll/Collection.php b/app/code/core/Mage/Poll/Model/Resource/Poll/Collection.php index 9ff9d16a5f..6c28cc7023 100755 --- a/app/code/core/Mage/Poll/Model/Resource/Poll/Collection.php +++ b/app/code/core/Mage/Poll/Model/Resource/Poll/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Poll - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Poll/Model/Resource/Poll/Vote.php b/app/code/core/Mage/Poll/Model/Resource/Poll/Vote.php index a1e3e74e1b..5c6548dc09 100755 --- a/app/code/core/Mage/Poll/Model/Resource/Poll/Vote.php +++ b/app/code/core/Mage/Poll/Model/Resource/Poll/Vote.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Poll - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Poll/controllers/VoteController.php b/app/code/core/Mage/Poll/controllers/VoteController.php index d287c32f82..d25680899c 100644 --- a/app/code/core/Mage/Poll/controllers/VoteController.php +++ b/app/code/core/Mage/Poll/controllers/VoteController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Poll - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Poll/data/poll_setup/data-install-1.6.0.0.php b/app/code/core/Mage/Poll/data/poll_setup/data-install-1.6.0.0.php index 5a64857969..152638343a 100644 --- a/app/code/core/Mage/Poll/data/poll_setup/data-install-1.6.0.0.php +++ b/app/code/core/Mage/Poll/data/poll_setup/data-install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Poll - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Poll/etc/adminhtml.xml b/app/code/core/Mage/Poll/etc/adminhtml.xml index 685fddad0b..97ce194bef 100644 --- a/app/code/core/Mage/Poll/etc/adminhtml.xml +++ b/app/code/core/Mage/Poll/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Poll - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Poll/etc/config.xml b/app/code/core/Mage/Poll/etc/config.xml index dad7ec0236..2c514975f6 100644 --- a/app/code/core/Mage/Poll/etc/config.xml +++ b/app/code/core/Mage/Poll/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Poll - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Poll/etc/system.xml b/app/code/core/Mage/Poll/etc/system.xml index a776ee1bba..c586b48496 100644 --- a/app/code/core/Mage/Poll/etc/system.xml +++ b/app/code/core/Mage/Poll/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Poll - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Poll/sql/poll_setup/install-1.6.0.0.php b/app/code/core/Mage/Poll/sql/poll_setup/install-1.6.0.0.php index 90aa24c861..99c1d492c2 100644 --- a/app/code/core/Mage/Poll/sql/poll_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Poll/sql/poll_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Poll - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Poll/sql/poll_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/Poll/sql/poll_setup/mysql4-install-0.7.0.php index f29ef39222..fdd8bf547c 100644 --- a/app/code/core/Mage/Poll/sql/poll_setup/mysql4-install-0.7.0.php +++ b/app/code/core/Mage/Poll/sql/poll_setup/mysql4-install-0.7.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Poll - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Poll/sql/poll_setup/mysql4-upgrade-0.6.0-0.6.1.php b/app/code/core/Mage/Poll/sql/poll_setup/mysql4-upgrade-0.6.0-0.6.1.php index 6d909b7cda..7f4f2b0acd 100644 --- a/app/code/core/Mage/Poll/sql/poll_setup/mysql4-upgrade-0.6.0-0.6.1.php +++ b/app/code/core/Mage/Poll/sql/poll_setup/mysql4-upgrade-0.6.0-0.6.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Poll - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Poll/sql/poll_setup/mysql4-upgrade-0.7.1-0.7.2.php b/app/code/core/Mage/Poll/sql/poll_setup/mysql4-upgrade-0.7.1-0.7.2.php index 02d5848ff5..8098bed6af 100644 --- a/app/code/core/Mage/Poll/sql/poll_setup/mysql4-upgrade-0.7.1-0.7.2.php +++ b/app/code/core/Mage/Poll/sql/poll_setup/mysql4-upgrade-0.7.1-0.7.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Poll - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Poll/sql/poll_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/Poll/sql/poll_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php index 8ca5d2fb2d..e62cc6c10a 100644 --- a/app/code/core/Mage/Poll/sql/poll_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ b/app/code/core/Mage/Poll/sql/poll_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Poll - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ProductAlert/Block/Email/Abstract.php b/app/code/core/Mage/ProductAlert/Block/Email/Abstract.php index b6ff4b950e..5dc880d069 100644 --- a/app/code/core/Mage/ProductAlert/Block/Email/Abstract.php +++ b/app/code/core/Mage/ProductAlert/Block/Email/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ProductAlert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ProductAlert/Block/Email/Price.php b/app/code/core/Mage/ProductAlert/Block/Email/Price.php index 1429568807..adcd3c3583 100644 --- a/app/code/core/Mage/ProductAlert/Block/Email/Price.php +++ b/app/code/core/Mage/ProductAlert/Block/Email/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ProductAlert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ProductAlert/Block/Email/Stock.php b/app/code/core/Mage/ProductAlert/Block/Email/Stock.php index ad68984f4b..caea35a5f0 100644 --- a/app/code/core/Mage/ProductAlert/Block/Email/Stock.php +++ b/app/code/core/Mage/ProductAlert/Block/Email/Stock.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ProductAlert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ProductAlert/Block/Price.php b/app/code/core/Mage/ProductAlert/Block/Price.php index 5d3bc9cef9..ffd2730d8e 100644 --- a/app/code/core/Mage/ProductAlert/Block/Price.php +++ b/app/code/core/Mage/ProductAlert/Block/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ProductAlert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ProductAlert/Block/Product/View.php b/app/code/core/Mage/ProductAlert/Block/Product/View.php index bb38c655c3..a2a22022ce 100644 --- a/app/code/core/Mage/ProductAlert/Block/Product/View.php +++ b/app/code/core/Mage/ProductAlert/Block/Product/View.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ProductAlert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -32,36 +32,45 @@ class Mage_ProductAlert_Block_Product_View extends Mage_Core_Block_Template /** * Current product instance * - * @var Mage_Catalog_Model_Product + * @var null|Mage_Catalog_Model_Product */ protected $_product = null; + /** + * Helper instance + * + * @var null|Mage_ProductAlert_Helper_Data + */ + protected $_helper = null; + /** * Check whether the stock alert data can be shown and prepare related data + * + * @return void */ public function prepareStockAlertData() { - if (!Mage::getStoreConfigFlag(Mage_ProductAlert_Model_Observer::XML_PATH_STOCK_ALLOW) - || !$this->_product || $this->_product->isAvailable() - ) { + if (!$this->_getHelper()->isStockAlertAllowed() || !$this->_product || $this->_product->isAvailable()) { $this->setTemplate(''); return; } - $this->setSignupUrl(Mage::helper('productalert')->getSaveUrl('stock')); + $this->setSignupUrl($this->_getHelper()->getSaveUrl('stock')); } /** * Check whether the price alert data can be shown and prepare related data + * + * @return void */ public function preparePriceAlertData() { - if (!Mage::getStoreConfigFlag(Mage_ProductAlert_Model_Observer::XML_PATH_PRICE_ALLOW) + if (!$this->_getHelper()->isPriceAlertAllowed() || !$this->_product || false === $this->_product->getCanShowPrice() ) { $this->setTemplate(''); return; } - $this->setSignupUrl(Mage::helper('productalert')->getSaveUrl('price')); + $this->setSignupUrl($this->_getHelper()->getSaveUrl('price')); } /** @@ -78,4 +87,17 @@ protected function _prepareLayout() return parent::_prepareLayout(); } + + /** + * Retrieve helper instance + * + * @return Mage_ProductAlert_Helper_Data|null + */ + protected function _getHelper() + { + if (is_null($this->_helper)) { + $this->_helper = Mage::helper('productalert'); + } + return $this->_helper; + } } diff --git a/app/code/core/Mage/ProductAlert/Block/Stock.php b/app/code/core/Mage/ProductAlert/Block/Stock.php index 645aaf7027..87a8616a0b 100644 --- a/app/code/core/Mage/ProductAlert/Block/Stock.php +++ b/app/code/core/Mage/ProductAlert/Block/Stock.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ProductAlert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ProductAlert/Helper/Data.php b/app/code/core/Mage/ProductAlert/Helper/Data.php index 87d5fe7eec..4a9a464b3f 100644 --- a/app/code/core/Mage/ProductAlert/Helper/Data.php +++ b/app/code/core/Mage/ProductAlert/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ProductAlert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -34,11 +34,38 @@ */ class Mage_ProductAlert_Helper_Data extends Mage_Core_Helper_Url { + /** + * Current product instance (override registry one) + * + * @var null|Mage_Catalog_Model_Product + */ + protected $_product = null; + + /** + * Get current product instance + * + * @return Mage_Catalog_Model_Product + */ public function getProduct() { + if (!is_null($this->_product)) { + return $this->_product; + } return Mage::registry('product'); } + /** + * Set current product instance + * + * @param Mage_Catalog_Model_Product $product + * @return Mage_ProductAlert_Helper_Data + */ + public function setProduct($product) + { + $this->_product = $product; + return $this; + } + public function getCustomer() { return Mage::getSingleton('customer/session'); @@ -77,4 +104,24 @@ public function createBlock($block) } return $block; } + + /** + * Check whether stock alert is allowed + * + * @return bool + */ + public function isStockAlertAllowed() + { + return Mage::getStoreConfigFlag(Mage_ProductAlert_Model_Observer::XML_PATH_STOCK_ALLOW); + } + + /** + * Check whether price alert is allowed + * + * @return bool + */ + public function isPriceAlertAllowed() + { + return Mage::getStoreConfigFlag(Mage_ProductAlert_Model_Observer::XML_PATH_PRICE_ALLOW); + } } diff --git a/app/code/core/Mage/ProductAlert/Model/Email.php b/app/code/core/Mage/ProductAlert/Model/Email.php index e0cac8991b..8a8660e41a 100644 --- a/app/code/core/Mage/ProductAlert/Model/Email.php +++ b/app/code/core/Mage/ProductAlert/Model/Email.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ProductAlert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ProductAlert/Model/Mysql4/Price.php b/app/code/core/Mage/ProductAlert/Model/Mysql4/Price.php index dd432f1a31..66a6370635 100644 --- a/app/code/core/Mage/ProductAlert/Model/Mysql4/Price.php +++ b/app/code/core/Mage/ProductAlert/Model/Mysql4/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ProductAlert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ProductAlert/Model/Mysql4/Price/Collection.php b/app/code/core/Mage/ProductAlert/Model/Mysql4/Price/Collection.php index 730a80fcd0..d3b5df3f60 100644 --- a/app/code/core/Mage/ProductAlert/Model/Mysql4/Price/Collection.php +++ b/app/code/core/Mage/ProductAlert/Model/Mysql4/Price/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ProductAlert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ProductAlert/Model/Mysql4/Price/Customer/Collection.php b/app/code/core/Mage/ProductAlert/Model/Mysql4/Price/Customer/Collection.php index 18f21ed58b..a4f7230fc9 100644 --- a/app/code/core/Mage/ProductAlert/Model/Mysql4/Price/Customer/Collection.php +++ b/app/code/core/Mage/ProductAlert/Model/Mysql4/Price/Customer/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ProductAlert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ProductAlert/Model/Mysql4/Stock.php b/app/code/core/Mage/ProductAlert/Model/Mysql4/Stock.php index 6fc93f4e45..5a184a0ee5 100644 --- a/app/code/core/Mage/ProductAlert/Model/Mysql4/Stock.php +++ b/app/code/core/Mage/ProductAlert/Model/Mysql4/Stock.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ProductAlert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ProductAlert/Model/Mysql4/Stock/Collection.php b/app/code/core/Mage/ProductAlert/Model/Mysql4/Stock/Collection.php index efb6184039..ce49ef297e 100644 --- a/app/code/core/Mage/ProductAlert/Model/Mysql4/Stock/Collection.php +++ b/app/code/core/Mage/ProductAlert/Model/Mysql4/Stock/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ProductAlert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ProductAlert/Model/Mysql4/Stock/Customer/Collection.php b/app/code/core/Mage/ProductAlert/Model/Mysql4/Stock/Customer/Collection.php index e60828a1b4..2fa0871122 100644 --- a/app/code/core/Mage/ProductAlert/Model/Mysql4/Stock/Customer/Collection.php +++ b/app/code/core/Mage/ProductAlert/Model/Mysql4/Stock/Customer/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ProductAlert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ProductAlert/Model/Observer.php b/app/code/core/Mage/ProductAlert/Model/Observer.php index cf4f3c722f..44570d3999 100644 --- a/app/code/core/Mage/ProductAlert/Model/Observer.php +++ b/app/code/core/Mage/ProductAlert/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ProductAlert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ProductAlert/Model/Price.php b/app/code/core/Mage/ProductAlert/Model/Price.php index dabbb06860..833387c5b0 100644 --- a/app/code/core/Mage/ProductAlert/Model/Price.php +++ b/app/code/core/Mage/ProductAlert/Model/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ProductAlert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ProductAlert/Model/Resource/Abstract.php b/app/code/core/Mage/ProductAlert/Model/Resource/Abstract.php index d09ed0894c..e44885b06d 100644 --- a/app/code/core/Mage/ProductAlert/Model/Resource/Abstract.php +++ b/app/code/core/Mage/ProductAlert/Model/Resource/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ProductAlert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ProductAlert/Model/Resource/Price.php b/app/code/core/Mage/ProductAlert/Model/Resource/Price.php index 81ffb2bfee..efa6801a9a 100755 --- a/app/code/core/Mage/ProductAlert/Model/Resource/Price.php +++ b/app/code/core/Mage/ProductAlert/Model/Resource/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ProductAlert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ProductAlert/Model/Resource/Price/Collection.php b/app/code/core/Mage/ProductAlert/Model/Resource/Price/Collection.php index 95f121269e..8049d3499e 100755 --- a/app/code/core/Mage/ProductAlert/Model/Resource/Price/Collection.php +++ b/app/code/core/Mage/ProductAlert/Model/Resource/Price/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ProductAlert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ProductAlert/Model/Resource/Price/Customer/Collection.php b/app/code/core/Mage/ProductAlert/Model/Resource/Price/Customer/Collection.php index af59ce42b8..d826218045 100755 --- a/app/code/core/Mage/ProductAlert/Model/Resource/Price/Customer/Collection.php +++ b/app/code/core/Mage/ProductAlert/Model/Resource/Price/Customer/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ProductAlert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ProductAlert/Model/Resource/Stock.php b/app/code/core/Mage/ProductAlert/Model/Resource/Stock.php index fa2754ea6d..6972932d23 100755 --- a/app/code/core/Mage/ProductAlert/Model/Resource/Stock.php +++ b/app/code/core/Mage/ProductAlert/Model/Resource/Stock.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ProductAlert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ProductAlert/Model/Resource/Stock/Collection.php b/app/code/core/Mage/ProductAlert/Model/Resource/Stock/Collection.php index dac383f1aa..6271e3a3a4 100755 --- a/app/code/core/Mage/ProductAlert/Model/Resource/Stock/Collection.php +++ b/app/code/core/Mage/ProductAlert/Model/Resource/Stock/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ProductAlert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ProductAlert/Model/Resource/Stock/Customer/Collection.php b/app/code/core/Mage/ProductAlert/Model/Resource/Stock/Customer/Collection.php index c36e0c603d..96d48d3d3d 100755 --- a/app/code/core/Mage/ProductAlert/Model/Resource/Stock/Customer/Collection.php +++ b/app/code/core/Mage/ProductAlert/Model/Resource/Stock/Customer/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ProductAlert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ProductAlert/Model/Stock.php b/app/code/core/Mage/ProductAlert/Model/Stock.php index 1bc45028d3..ef1cc17845 100644 --- a/app/code/core/Mage/ProductAlert/Model/Stock.php +++ b/app/code/core/Mage/ProductAlert/Model/Stock.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ProductAlert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ProductAlert/controllers/AddController.php b/app/code/core/Mage/ProductAlert/controllers/AddController.php index 14b792e26d..2bc3ebc721 100644 --- a/app/code/core/Mage/ProductAlert/controllers/AddController.php +++ b/app/code/core/Mage/ProductAlert/controllers/AddController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ProductAlert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -66,7 +66,11 @@ public function priceAction() if (!$product->getId()) { /* @var $product Mage_Catalog_Model_Product */ $session->addError($this->__('Not enough parameters.')); - $this->_redirectUrl($backUrl); + if ($this->_isUrlInternal($backUrl)) { + $this->_redirectUrl($backUrl); + } else { + $this->_redirect('/'); + } return ; } diff --git a/app/code/core/Mage/ProductAlert/controllers/UnsubscribeController.php b/app/code/core/Mage/ProductAlert/controllers/UnsubscribeController.php index 255633be8b..a313688aae 100644 --- a/app/code/core/Mage/ProductAlert/controllers/UnsubscribeController.php +++ b/app/code/core/Mage/ProductAlert/controllers/UnsubscribeController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ProductAlert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ProductAlert/etc/config.xml b/app/code/core/Mage/ProductAlert/etc/config.xml index eaaeceec29..95d2ae91d7 100644 --- a/app/code/core/Mage/ProductAlert/etc/config.xml +++ b/app/code/core/Mage/ProductAlert/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_ProductAlert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/ProductAlert/etc/system.xml b/app/code/core/Mage/ProductAlert/etc/system.xml index 098581a49c..7b327100d5 100644 --- a/app/code/core/Mage/ProductAlert/etc/system.xml +++ b/app/code/core/Mage/ProductAlert/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_ProductAlert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/ProductAlert/sql/productalert_setup/install-1.6.0.0.php b/app/code/core/Mage/ProductAlert/sql/productalert_setup/install-1.6.0.0.php index 162bb999a0..339ace6e29 100644 --- a/app/code/core/Mage/ProductAlert/sql/productalert_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/ProductAlert/sql/productalert_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ProductAlert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ProductAlert/sql/productalert_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/ProductAlert/sql/productalert_setup/mysql4-install-0.7.0.php index 8bd0001d78..6ad4a3ef40 100644 --- a/app/code/core/Mage/ProductAlert/sql/productalert_setup/mysql4-install-0.7.0.php +++ b/app/code/core/Mage/ProductAlert/sql/productalert_setup/mysql4-install-0.7.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ProductAlert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ProductAlert/sql/productalert_setup/mysql4-upgrade-0.7.1-0.7.2.php b/app/code/core/Mage/ProductAlert/sql/productalert_setup/mysql4-upgrade-0.7.1-0.7.2.php index 0da7010f76..06d02a0e0d 100644 --- a/app/code/core/Mage/ProductAlert/sql/productalert_setup/mysql4-upgrade-0.7.1-0.7.2.php +++ b/app/code/core/Mage/ProductAlert/sql/productalert_setup/mysql4-upgrade-0.7.1-0.7.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ProductAlert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ProductAlert/sql/productalert_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/ProductAlert/sql/productalert_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php index 14c05fd2ba..b05b90d75a 100644 --- a/app/code/core/Mage/ProductAlert/sql/productalert_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ b/app/code/core/Mage/ProductAlert/sql/productalert_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ProductAlert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rating/Block/Entity/Detailed.php b/app/code/core/Mage/Rating/Block/Entity/Detailed.php index 933a88034b..ba4ca16117 100644 --- a/app/code/core/Mage/Rating/Block/Entity/Detailed.php +++ b/app/code/core/Mage/Rating/Block/Entity/Detailed.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rating - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rating/Helper/Data.php b/app/code/core/Mage/Rating/Helper/Data.php index a71b6c2756..1c4e894cbc 100644 --- a/app/code/core/Mage/Rating/Helper/Data.php +++ b/app/code/core/Mage/Rating/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rating - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rating/Model/Mysql4/Rating.php b/app/code/core/Mage/Rating/Model/Mysql4/Rating.php index a5ad39b2ea..532bf56383 100644 --- a/app/code/core/Mage/Rating/Model/Mysql4/Rating.php +++ b/app/code/core/Mage/Rating/Model/Mysql4/Rating.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rating - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rating/Model/Mysql4/Rating/Collection.php b/app/code/core/Mage/Rating/Model/Mysql4/Rating/Collection.php index 653d5a537f..524d546e29 100644 --- a/app/code/core/Mage/Rating/Model/Mysql4/Rating/Collection.php +++ b/app/code/core/Mage/Rating/Model/Mysql4/Rating/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rating - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rating/Model/Mysql4/Rating/Entity.php b/app/code/core/Mage/Rating/Model/Mysql4/Rating/Entity.php index 7f145acef6..19d1e89b44 100644 --- a/app/code/core/Mage/Rating/Model/Mysql4/Rating/Entity.php +++ b/app/code/core/Mage/Rating/Model/Mysql4/Rating/Entity.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rating - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rating/Model/Mysql4/Rating/Option.php b/app/code/core/Mage/Rating/Model/Mysql4/Rating/Option.php index 54ecb8616b..9bdec2577d 100644 --- a/app/code/core/Mage/Rating/Model/Mysql4/Rating/Option.php +++ b/app/code/core/Mage/Rating/Model/Mysql4/Rating/Option.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rating - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rating/Model/Mysql4/Rating/Option/Collection.php b/app/code/core/Mage/Rating/Model/Mysql4/Rating/Option/Collection.php index 06a7e852d4..82f3fb2c01 100644 --- a/app/code/core/Mage/Rating/Model/Mysql4/Rating/Option/Collection.php +++ b/app/code/core/Mage/Rating/Model/Mysql4/Rating/Option/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rating - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rating/Model/Mysql4/Rating/Option/Vote.php b/app/code/core/Mage/Rating/Model/Mysql4/Rating/Option/Vote.php index 0e8b560f1e..2615caacb5 100644 --- a/app/code/core/Mage/Rating/Model/Mysql4/Rating/Option/Vote.php +++ b/app/code/core/Mage/Rating/Model/Mysql4/Rating/Option/Vote.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rating - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rating/Model/Mysql4/Rating/Option/Vote/Collection.php b/app/code/core/Mage/Rating/Model/Mysql4/Rating/Option/Vote/Collection.php index 2496d2b4a6..ba885dc4de 100644 --- a/app/code/core/Mage/Rating/Model/Mysql4/Rating/Option/Vote/Collection.php +++ b/app/code/core/Mage/Rating/Model/Mysql4/Rating/Option/Vote/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rating - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rating/Model/Observer.php b/app/code/core/Mage/Rating/Model/Observer.php index b010005995..1e148206a1 100644 --- a/app/code/core/Mage/Rating/Model/Observer.php +++ b/app/code/core/Mage/Rating/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rating - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rating/Model/Rating.php b/app/code/core/Mage/Rating/Model/Rating.php index 520b0310eb..f0fb2fd155 100644 --- a/app/code/core/Mage/Rating/Model/Rating.php +++ b/app/code/core/Mage/Rating/Model/Rating.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rating - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rating/Model/Rating/Entity.php b/app/code/core/Mage/Rating/Model/Rating/Entity.php index 381d7d19e1..3a1d8922b8 100644 --- a/app/code/core/Mage/Rating/Model/Rating/Entity.php +++ b/app/code/core/Mage/Rating/Model/Rating/Entity.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rating - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rating/Model/Rating/Option.php b/app/code/core/Mage/Rating/Model/Rating/Option.php index 5c075dc0b4..becf0e0088 100644 --- a/app/code/core/Mage/Rating/Model/Rating/Option.php +++ b/app/code/core/Mage/Rating/Model/Rating/Option.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rating - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rating/Model/Rating/Option/Vote.php b/app/code/core/Mage/Rating/Model/Rating/Option/Vote.php index 1a499407c3..c0b3febebc 100644 --- a/app/code/core/Mage/Rating/Model/Rating/Option/Vote.php +++ b/app/code/core/Mage/Rating/Model/Rating/Option/Vote.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rating - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rating/Model/Resource/Rating.php b/app/code/core/Mage/Rating/Model/Resource/Rating.php index a088700181..da00c6cfab 100755 --- a/app/code/core/Mage/Rating/Model/Resource/Rating.php +++ b/app/code/core/Mage/Rating/Model/Resource/Rating.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rating - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -109,15 +109,25 @@ protected function _afterLoad(Mage_Core_Model_Abstract $object) } // load rating available in stores - $select = $adapter->select() - ->from($this->getTable('rating/rating_store'), 'store_id') - ->where('rating_id=:rating_id'); - $result = $adapter->fetchCol($select, $bind); - $object->setStores($result); + $object->setStores($this->getStores((int)$object->getId())); return $this; } + /** + * Retrieve store IDs related to given rating + * + * @param int $ratingId + * @return array + */ + public function getStores($ratingId) + { + $select = $this->_getReadAdapter()->select() + ->from($this->getTable('rating/rating_store'), 'store_id') + ->where('rating_id = ?', $ratingId); + return $this->_getReadAdapter()->fetchCol($select); + } + /** * Actions after save * @@ -139,19 +149,21 @@ protected function _afterSave(Mage_Core_Model_Abstract $object) ->from($ratingTitleTable, array('store_id', 'value')) ->where('rating_id = :rating_id'); $old = $adapter->fetchPairs($select, array(':rating_id' => $ratingId)); - $new = $object->getRatingCodes(); + $new = array_filter(array_map('trim', $object->getRatingCodes())); $insert = array_diff_assoc($new, $old); $delete = array_diff_assoc($old, $new); + if (!empty($delete)) { + $where = array( + 'rating_id = ?' => $ratingId, + 'store_id IN(?)' => array_keys($delete) + ); + $adapter->delete($ratingTitleTable, $where); + } if ($insert) { $data = array(); foreach ($insert as $storeId => $title) { - //remove record if title is empty - if (empty($title)) { - $delete[$storeId] = $title; - continue; - } $data[] = array( 'rating_id' => $ratingId, 'store_id' => (int)$storeId, @@ -162,13 +174,6 @@ protected function _afterSave(Mage_Core_Model_Abstract $object) $adapter->insertMultiple($ratingTitleTable, $data); } } - if ($old && $delete) { - $where = array( - 'rating_id = ?' => $ratingId, - 'store_id IN(?)' => array_keys($delete) - ); - $adapter->delete($ratingTitleTable, $where); - } $adapter->commit(); } catch (Exception $e) { Mage::logException($e); diff --git a/app/code/core/Mage/Rating/Model/Resource/Rating/Collection.php b/app/code/core/Mage/Rating/Model/Resource/Rating/Collection.php index 8d5f31f5af..8dc09c1e0b 100755 --- a/app/code/core/Mage/Rating/Model/Resource/Rating/Collection.php +++ b/app/code/core/Mage/Rating/Model/Resource/Rating/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rating - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rating/Model/Resource/Rating/Entity.php b/app/code/core/Mage/Rating/Model/Resource/Rating/Entity.php index ffe5aca8f3..b9e3cefff2 100755 --- a/app/code/core/Mage/Rating/Model/Resource/Rating/Entity.php +++ b/app/code/core/Mage/Rating/Model/Resource/Rating/Entity.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rating - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rating/Model/Resource/Rating/Option.php b/app/code/core/Mage/Rating/Model/Resource/Rating/Option.php index 57c2e7565a..346c713693 100755 --- a/app/code/core/Mage/Rating/Model/Resource/Rating/Option.php +++ b/app/code/core/Mage/Rating/Model/Resource/Rating/Option.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rating - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rating/Model/Resource/Rating/Option/Collection.php b/app/code/core/Mage/Rating/Model/Resource/Rating/Option/Collection.php index 5bff514f5f..10534f50fb 100755 --- a/app/code/core/Mage/Rating/Model/Resource/Rating/Option/Collection.php +++ b/app/code/core/Mage/Rating/Model/Resource/Rating/Option/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rating - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rating/Model/Resource/Rating/Option/Vote.php b/app/code/core/Mage/Rating/Model/Resource/Rating/Option/Vote.php index 43f80451ee..2995f87606 100755 --- a/app/code/core/Mage/Rating/Model/Resource/Rating/Option/Vote.php +++ b/app/code/core/Mage/Rating/Model/Resource/Rating/Option/Vote.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rating - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rating/Model/Resource/Rating/Option/Vote/Collection.php b/app/code/core/Mage/Rating/Model/Resource/Rating/Option/Vote/Collection.php index dd8e4f5e2b..c51eeaccd3 100755 --- a/app/code/core/Mage/Rating/Model/Resource/Rating/Option/Vote/Collection.php +++ b/app/code/core/Mage/Rating/Model/Resource/Rating/Option/Vote/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rating - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rating/data/rating_setup/data-install-1.6.0.0.php b/app/code/core/Mage/Rating/data/rating_setup/data-install-1.6.0.0.php index bfdbd50f34..509cdcb67d 100644 --- a/app/code/core/Mage/Rating/data/rating_setup/data-install-1.6.0.0.php +++ b/app/code/core/Mage/Rating/data/rating_setup/data-install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rating - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rating/etc/adminhtml.xml b/app/code/core/Mage/Rating/etc/adminhtml.xml index 9ae6bf1de8..60fa5d23d8 100644 --- a/app/code/core/Mage/Rating/etc/adminhtml.xml +++ b/app/code/core/Mage/Rating/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Rating - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Rating/etc/config.xml b/app/code/core/Mage/Rating/etc/config.xml index 4300598b3c..d7f4aeffd7 100644 --- a/app/code/core/Mage/Rating/etc/config.xml +++ b/app/code/core/Mage/Rating/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Rating - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Rating/sql/rating_setup/install-1.6.0.0.php b/app/code/core/Mage/Rating/sql/rating_setup/install-1.6.0.0.php index a20da03968..080dd34a7b 100644 --- a/app/code/core/Mage/Rating/sql/rating_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Rating/sql/rating_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rating - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rating/sql/rating_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/Rating/sql/rating_setup/mysql4-install-0.7.0.php index 5efeb8aea3..c9420f7383 100644 --- a/app/code/core/Mage/Rating/sql/rating_setup/mysql4-install-0.7.0.php +++ b/app/code/core/Mage/Rating/sql/rating_setup/mysql4-install-0.7.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rating - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rating/sql/rating_setup/mysql4-upgrade-0.7.0-0.7.1.php b/app/code/core/Mage/Rating/sql/rating_setup/mysql4-upgrade-0.7.0-0.7.1.php index b817ca2e84..0835d6fabf 100644 --- a/app/code/core/Mage/Rating/sql/rating_setup/mysql4-upgrade-0.7.0-0.7.1.php +++ b/app/code/core/Mage/Rating/sql/rating_setup/mysql4-upgrade-0.7.0-0.7.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rating - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rating/sql/rating_setup/mysql4-upgrade-0.7.1-0.7.2.php b/app/code/core/Mage/Rating/sql/rating_setup/mysql4-upgrade-0.7.1-0.7.2.php index 8c4af4c9fe..d0e9019b9b 100644 --- a/app/code/core/Mage/Rating/sql/rating_setup/mysql4-upgrade-0.7.1-0.7.2.php +++ b/app/code/core/Mage/Rating/sql/rating_setup/mysql4-upgrade-0.7.1-0.7.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rating - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rating/sql/rating_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/Rating/sql/rating_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php index 34e2fdb421..e5e8ccc5c8 100644 --- a/app/code/core/Mage/Rating/sql/rating_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ b/app/code/core/Mage/Rating/sql/rating_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rating - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Block/Product/Abstract.php b/app/code/core/Mage/Reports/Block/Product/Abstract.php index 52cb7c11f4..91cc4aea29 100644 --- a/app/code/core/Mage/Reports/Block/Product/Abstract.php +++ b/app/code/core/Mage/Reports/Block/Product/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Block/Product/Compared.php b/app/code/core/Mage/Reports/Block/Product/Compared.php index 2730e72642..44fee821f1 100644 --- a/app/code/core/Mage/Reports/Block/Product/Compared.php +++ b/app/code/core/Mage/Reports/Block/Product/Compared.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Block/Product/Viewed.php b/app/code/core/Mage/Reports/Block/Product/Viewed.php index aa911d66bf..9b5b862cae 100644 --- a/app/code/core/Mage/Reports/Block/Product/Viewed.php +++ b/app/code/core/Mage/Reports/Block/Product/Viewed.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Block/Product/Widget/Compared.php b/app/code/core/Mage/Reports/Block/Product/Widget/Compared.php index da3f1b0a98..79292520c7 100644 --- a/app/code/core/Mage/Reports/Block/Product/Widget/Compared.php +++ b/app/code/core/Mage/Reports/Block/Product/Widget/Compared.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Block/Product/Widget/Viewed.php b/app/code/core/Mage/Reports/Block/Product/Widget/Viewed.php index c8dd21f4c1..809eaa3856 100644 --- a/app/code/core/Mage/Reports/Block/Product/Widget/Viewed.php +++ b/app/code/core/Mage/Reports/Block/Product/Widget/Viewed.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Exception.php b/app/code/core/Mage/Reports/Exception.php index bea573e35a..9696c56c88 100644 --- a/app/code/core/Mage/Reports/Exception.php +++ b/app/code/core/Mage/Reports/Exception.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Helper/Data.php b/app/code/core/Mage/Reports/Helper/Data.php index 354cdbe186..75857cfe03 100644 --- a/app/code/core/Mage/Reports/Helper/Data.php +++ b/app/code/core/Mage/Reports/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Config.php b/app/code/core/Mage/Reports/Model/Config.php index 64d8993a4a..93c5e25e24 100644 --- a/app/code/core/Mage/Reports/Model/Config.php +++ b/app/code/core/Mage/Reports/Model/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Event.php b/app/code/core/Mage/Reports/Model/Event.php index 8be3e59bb8..8541a2b6e1 100644 --- a/app/code/core/Mage/Reports/Model/Event.php +++ b/app/code/core/Mage/Reports/Model/Event.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Event/Observer.php b/app/code/core/Mage/Reports/Model/Event/Observer.php index 98d546329b..90e1d2eeb3 100644 --- a/app/code/core/Mage/Reports/Model/Event/Observer.php +++ b/app/code/core/Mage/Reports/Model/Event/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Event/Type.php b/app/code/core/Mage/Reports/Model/Event/Type.php index 180ae1ed5e..71566ef141 100644 --- a/app/code/core/Mage/Reports/Model/Event/Type.php +++ b/app/code/core/Mage/Reports/Model/Event/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Flag.php b/app/code/core/Mage/Reports/Model/Flag.php index b64b5b5114..891d1fdc36 100644 --- a/app/code/core/Mage/Reports/Model/Flag.php +++ b/app/code/core/Mage/Reports/Model/Flag.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Grouped/Collection.php b/app/code/core/Mage/Reports/Model/Grouped/Collection.php index 5503174b1d..1852b2c5ba 100644 --- a/app/code/core/Mage/Reports/Model/Grouped/Collection.php +++ b/app/code/core/Mage/Reports/Model/Grouped/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Reports_Model_Grouped_Collection diff --git a/app/code/core/Mage/Reports/Model/Mysql4/Accounts/Collection.php b/app/code/core/Mage/Reports/Model/Mysql4/Accounts/Collection.php index 28857c74cb..128b6bf73d 100644 --- a/app/code/core/Mage/Reports/Model/Mysql4/Accounts/Collection.php +++ b/app/code/core/Mage/Reports/Model/Mysql4/Accounts/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Mysql4/Coupons/Collection.php b/app/code/core/Mage/Reports/Model/Mysql4/Coupons/Collection.php index fe6c78cb21..de31ce2af3 100644 --- a/app/code/core/Mage/Reports/Model/Mysql4/Coupons/Collection.php +++ b/app/code/core/Mage/Reports/Model/Mysql4/Coupons/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Mysql4/Customer/Collection.php b/app/code/core/Mage/Reports/Model/Mysql4/Customer/Collection.php index c7806247d5..3643d6edea 100644 --- a/app/code/core/Mage/Reports/Model/Mysql4/Customer/Collection.php +++ b/app/code/core/Mage/Reports/Model/Mysql4/Customer/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Mysql4/Customer/Orders/Collection.php b/app/code/core/Mage/Reports/Model/Mysql4/Customer/Orders/Collection.php index c584ca8062..e1e56d9d6e 100644 --- a/app/code/core/Mage/Reports/Model/Mysql4/Customer/Orders/Collection.php +++ b/app/code/core/Mage/Reports/Model/Mysql4/Customer/Orders/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Mysql4/Customer/Totals/Collection.php b/app/code/core/Mage/Reports/Model/Mysql4/Customer/Totals/Collection.php index f51372e0ea..0b5d0bf101 100644 --- a/app/code/core/Mage/Reports/Model/Mysql4/Customer/Totals/Collection.php +++ b/app/code/core/Mage/Reports/Model/Mysql4/Customer/Totals/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Mysql4/Entity/Summary/Collection/Abstract.php b/app/code/core/Mage/Reports/Model/Mysql4/Entity/Summary/Collection/Abstract.php index 86b678faff..8dd7b315ce 100644 --- a/app/code/core/Mage/Reports/Model/Mysql4/Entity/Summary/Collection/Abstract.php +++ b/app/code/core/Mage/Reports/Model/Mysql4/Entity/Summary/Collection/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Mysql4/Event.php b/app/code/core/Mage/Reports/Model/Mysql4/Event.php index 5702f02bc5..073f96f852 100644 --- a/app/code/core/Mage/Reports/Model/Mysql4/Event.php +++ b/app/code/core/Mage/Reports/Model/Mysql4/Event.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Mysql4/Event/Collection.php b/app/code/core/Mage/Reports/Model/Mysql4/Event/Collection.php index 3098303d6f..ce71ddad11 100644 --- a/app/code/core/Mage/Reports/Model/Mysql4/Event/Collection.php +++ b/app/code/core/Mage/Reports/Model/Mysql4/Event/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Mysql4/Event/Type.php b/app/code/core/Mage/Reports/Model/Mysql4/Event/Type.php index b1fa5619d5..bbeb6572f1 100644 --- a/app/code/core/Mage/Reports/Model/Mysql4/Event/Type.php +++ b/app/code/core/Mage/Reports/Model/Mysql4/Event/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Mysql4/Event/Type/Collection.php b/app/code/core/Mage/Reports/Model/Mysql4/Event/Type/Collection.php index 6c9a3039ba..4416732523 100644 --- a/app/code/core/Mage/Reports/Model/Mysql4/Event/Type/Collection.php +++ b/app/code/core/Mage/Reports/Model/Mysql4/Event/Type/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Mysql4/Invoiced/Collection.php b/app/code/core/Mage/Reports/Model/Mysql4/Invoiced/Collection.php index 94a9c5722e..41762e0fb0 100644 --- a/app/code/core/Mage/Reports/Model/Mysql4/Invoiced/Collection.php +++ b/app/code/core/Mage/Reports/Model/Mysql4/Invoiced/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Mysql4/Order/Collection.php b/app/code/core/Mage/Reports/Model/Mysql4/Order/Collection.php index c2c115908f..e4c8faf494 100644 --- a/app/code/core/Mage/Reports/Model/Mysql4/Order/Collection.php +++ b/app/code/core/Mage/Reports/Model/Mysql4/Order/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Mysql4/Product/Collection.php b/app/code/core/Mage/Reports/Model/Mysql4/Product/Collection.php index 146ecc62ba..b1517f2c7f 100644 --- a/app/code/core/Mage/Reports/Model/Mysql4/Product/Collection.php +++ b/app/code/core/Mage/Reports/Model/Mysql4/Product/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Mysql4/Product/Downloads/Collection.php b/app/code/core/Mage/Reports/Model/Mysql4/Product/Downloads/Collection.php index c6813e80ee..839e4f5646 100644 --- a/app/code/core/Mage/Reports/Model/Mysql4/Product/Downloads/Collection.php +++ b/app/code/core/Mage/Reports/Model/Mysql4/Product/Downloads/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Mysql4/Product/Index/Abstract.php b/app/code/core/Mage/Reports/Model/Mysql4/Product/Index/Abstract.php index 4142cc0e1c..57fa832674 100644 --- a/app/code/core/Mage/Reports/Model/Mysql4/Product/Index/Abstract.php +++ b/app/code/core/Mage/Reports/Model/Mysql4/Product/Index/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Mysql4/Product/Index/Collection/Abstract.php b/app/code/core/Mage/Reports/Model/Mysql4/Product/Index/Collection/Abstract.php index 196c49017c..dcf178da66 100644 --- a/app/code/core/Mage/Reports/Model/Mysql4/Product/Index/Collection/Abstract.php +++ b/app/code/core/Mage/Reports/Model/Mysql4/Product/Index/Collection/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Mysql4/Product/Index/Compared.php b/app/code/core/Mage/Reports/Model/Mysql4/Product/Index/Compared.php index 274e46158e..815b71cea4 100644 --- a/app/code/core/Mage/Reports/Model/Mysql4/Product/Index/Compared.php +++ b/app/code/core/Mage/Reports/Model/Mysql4/Product/Index/Compared.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Mysql4/Product/Index/Compared/Collection.php b/app/code/core/Mage/Reports/Model/Mysql4/Product/Index/Compared/Collection.php index 1f6926bb2e..feef1a8dbe 100644 --- a/app/code/core/Mage/Reports/Model/Mysql4/Product/Index/Compared/Collection.php +++ b/app/code/core/Mage/Reports/Model/Mysql4/Product/Index/Compared/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Mysql4/Product/Index/Viewed.php b/app/code/core/Mage/Reports/Model/Mysql4/Product/Index/Viewed.php index 4e75191fb3..e2d32a50b2 100644 --- a/app/code/core/Mage/Reports/Model/Mysql4/Product/Index/Viewed.php +++ b/app/code/core/Mage/Reports/Model/Mysql4/Product/Index/Viewed.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Mysql4/Product/Index/Viewed/Collection.php b/app/code/core/Mage/Reports/Model/Mysql4/Product/Index/Viewed/Collection.php index d036c35421..4044ff7413 100644 --- a/app/code/core/Mage/Reports/Model/Mysql4/Product/Index/Viewed/Collection.php +++ b/app/code/core/Mage/Reports/Model/Mysql4/Product/Index/Viewed/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Mysql4/Product/Lowstock/Collection.php b/app/code/core/Mage/Reports/Model/Mysql4/Product/Lowstock/Collection.php index 588fba0acd..6810865951 100644 --- a/app/code/core/Mage/Reports/Model/Mysql4/Product/Lowstock/Collection.php +++ b/app/code/core/Mage/Reports/Model/Mysql4/Product/Lowstock/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Mysql4/Product/Ordered/Collection.php b/app/code/core/Mage/Reports/Model/Mysql4/Product/Ordered/Collection.php index 2a6a8cee49..369f60eece 100644 --- a/app/code/core/Mage/Reports/Model/Mysql4/Product/Ordered/Collection.php +++ b/app/code/core/Mage/Reports/Model/Mysql4/Product/Ordered/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Mysql4/Product/Sold/Collection.php b/app/code/core/Mage/Reports/Model/Mysql4/Product/Sold/Collection.php index d778acb4a7..81123fe2e5 100644 --- a/app/code/core/Mage/Reports/Model/Mysql4/Product/Sold/Collection.php +++ b/app/code/core/Mage/Reports/Model/Mysql4/Product/Sold/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Mysql4/Product/Viewed/Collection.php b/app/code/core/Mage/Reports/Model/Mysql4/Product/Viewed/Collection.php index 8fa10a375c..89de0f72cb 100644 --- a/app/code/core/Mage/Reports/Model/Mysql4/Product/Viewed/Collection.php +++ b/app/code/core/Mage/Reports/Model/Mysql4/Product/Viewed/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Mysql4/Quote/Collection.php b/app/code/core/Mage/Reports/Model/Mysql4/Quote/Collection.php index 8e2c9f7f90..7fee61dc61 100644 --- a/app/code/core/Mage/Reports/Model/Mysql4/Quote/Collection.php +++ b/app/code/core/Mage/Reports/Model/Mysql4/Quote/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Mysql4/Refunded/Collection.php b/app/code/core/Mage/Reports/Model/Mysql4/Refunded/Collection.php index 69381ecd83..f8a70d828e 100644 --- a/app/code/core/Mage/Reports/Model/Mysql4/Refunded/Collection.php +++ b/app/code/core/Mage/Reports/Model/Mysql4/Refunded/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Mysql4/Report/Abstract.php b/app/code/core/Mage/Reports/Model/Mysql4/Report/Abstract.php index ebe9c32730..2d48926f48 100644 --- a/app/code/core/Mage/Reports/Model/Mysql4/Report/Abstract.php +++ b/app/code/core/Mage/Reports/Model/Mysql4/Report/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Mysql4/Report/Collection.php b/app/code/core/Mage/Reports/Model/Mysql4/Report/Collection.php index 7122da7bc3..052fe8892b 100644 --- a/app/code/core/Mage/Reports/Model/Mysql4/Report/Collection.php +++ b/app/code/core/Mage/Reports/Model/Mysql4/Report/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Mysql4/Review/Collection.php b/app/code/core/Mage/Reports/Model/Mysql4/Review/Collection.php index 02294f7aa2..5e52130323 100644 --- a/app/code/core/Mage/Reports/Model/Mysql4/Review/Collection.php +++ b/app/code/core/Mage/Reports/Model/Mysql4/Review/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Mysql4/Review/Customer/Collection.php b/app/code/core/Mage/Reports/Model/Mysql4/Review/Customer/Collection.php index 6766d1982a..d40d595f27 100644 --- a/app/code/core/Mage/Reports/Model/Mysql4/Review/Customer/Collection.php +++ b/app/code/core/Mage/Reports/Model/Mysql4/Review/Customer/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Mysql4/Review/Product/Collection.php b/app/code/core/Mage/Reports/Model/Mysql4/Review/Product/Collection.php index 2ffe875d64..1f44ffb7d5 100644 --- a/app/code/core/Mage/Reports/Model/Mysql4/Review/Product/Collection.php +++ b/app/code/core/Mage/Reports/Model/Mysql4/Review/Product/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Mysql4/Shipping/Collection.php b/app/code/core/Mage/Reports/Model/Mysql4/Shipping/Collection.php index 87ec891a9c..7bfdac14ea 100644 --- a/app/code/core/Mage/Reports/Model/Mysql4/Shipping/Collection.php +++ b/app/code/core/Mage/Reports/Model/Mysql4/Shipping/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Mysql4/Shopcart/Product/Collection.php b/app/code/core/Mage/Reports/Model/Mysql4/Shopcart/Product/Collection.php index 6f02e3d22b..fca047504a 100644 --- a/app/code/core/Mage/Reports/Model/Mysql4/Shopcart/Product/Collection.php +++ b/app/code/core/Mage/Reports/Model/Mysql4/Shopcart/Product/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Mysql4/Tag/Collection.php b/app/code/core/Mage/Reports/Model/Mysql4/Tag/Collection.php index 7d7354a55b..7914c1ce73 100644 --- a/app/code/core/Mage/Reports/Model/Mysql4/Tag/Collection.php +++ b/app/code/core/Mage/Reports/Model/Mysql4/Tag/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Mysql4/Tag/Customer/Collection.php b/app/code/core/Mage/Reports/Model/Mysql4/Tag/Customer/Collection.php index ebc3b7687d..441a83457c 100644 --- a/app/code/core/Mage/Reports/Model/Mysql4/Tag/Customer/Collection.php +++ b/app/code/core/Mage/Reports/Model/Mysql4/Tag/Customer/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Mysql4/Tag/Product/Collection.php b/app/code/core/Mage/Reports/Model/Mysql4/Tag/Product/Collection.php index 7ee00a93b4..e1ba736ac6 100644 --- a/app/code/core/Mage/Reports/Model/Mysql4/Tag/Product/Collection.php +++ b/app/code/core/Mage/Reports/Model/Mysql4/Tag/Product/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Mysql4/Tax/Collection.php b/app/code/core/Mage/Reports/Model/Mysql4/Tax/Collection.php index 7becd9567c..f894a769c7 100644 --- a/app/code/core/Mage/Reports/Model/Mysql4/Tax/Collection.php +++ b/app/code/core/Mage/Reports/Model/Mysql4/Tax/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Mysql4/Wishlist/Collection.php b/app/code/core/Mage/Reports/Model/Mysql4/Wishlist/Collection.php index 851191120e..99f3541f7d 100644 --- a/app/code/core/Mage/Reports/Model/Mysql4/Wishlist/Collection.php +++ b/app/code/core/Mage/Reports/Model/Mysql4/Wishlist/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Mysql4/Wishlist/Product/Collection.php b/app/code/core/Mage/Reports/Model/Mysql4/Wishlist/Product/Collection.php index 3a4c832f4f..d28cb328be 100644 --- a/app/code/core/Mage/Reports/Model/Mysql4/Wishlist/Product/Collection.php +++ b/app/code/core/Mage/Reports/Model/Mysql4/Wishlist/Product/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Product/Index/Abstract.php b/app/code/core/Mage/Reports/Model/Product/Index/Abstract.php index 9e48d231c2..debc6ab9a6 100644 --- a/app/code/core/Mage/Reports/Model/Product/Index/Abstract.php +++ b/app/code/core/Mage/Reports/Model/Product/Index/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Product/Index/Compared.php b/app/code/core/Mage/Reports/Model/Product/Index/Compared.php index 029421ab95..3e173f10da 100644 --- a/app/code/core/Mage/Reports/Model/Product/Index/Compared.php +++ b/app/code/core/Mage/Reports/Model/Product/Index/Compared.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Product/Index/Viewed.php b/app/code/core/Mage/Reports/Model/Product/Index/Viewed.php index 65cd1e3428..011e239dda 100644 --- a/app/code/core/Mage/Reports/Model/Product/Index/Viewed.php +++ b/app/code/core/Mage/Reports/Model/Product/Index/Viewed.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Report.php b/app/code/core/Mage/Reports/Model/Report.php index 8644f53730..5f6ae7c015 100644 --- a/app/code/core/Mage/Reports/Model/Report.php +++ b/app/code/core/Mage/Reports/Model/Report.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Accounts/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Accounts/Collection.php index 143c50fbc6..d91f7826f0 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Accounts/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Accounts/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Coupons/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Coupons/Collection.php index 81bc3b6401..25d2d7f63d 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Coupons/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Coupons/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -91,7 +91,7 @@ public function joinFields($from, $to, $storeIds = array()) ->having('uses > ?', 0) ->order('uses ' . self::SORT_ORDER_DESC); - $storeIds = array_values($storeIds); + $storeIds = array_values($storeIds); if (count($storeIds) >= 1 && $storeIds[0] != '') { $this->addAttributeToFilter('store_id', array('in' => $storeIds)); $this->addExpressionAttributeToSelect( diff --git a/app/code/core/Mage/Reports/Model/Resource/Customer/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Customer/Collection.php index a1015277c0..bc3995e1f4 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Customer/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Customer/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Customer/Orders/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Customer/Orders/Collection.php index c5c42ceb88..dc2e763e10 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Customer/Orders/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Customer/Orders/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Customer/Totals/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Customer/Totals/Collection.php index d7c9045eb9..f42e1e628d 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Customer/Totals/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Customer/Totals/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Entity/Summary/Collection/Abstract.php b/app/code/core/Mage/Reports/Model/Resource/Entity/Summary/Collection/Abstract.php index 9bdd82060e..acb791253f 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Entity/Summary/Collection/Abstract.php +++ b/app/code/core/Mage/Reports/Model/Resource/Entity/Summary/Collection/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Event.php b/app/code/core/Mage/Reports/Model/Resource/Event.php index 74426167c2..da09e7ad4f 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Event.php +++ b/app/code/core/Mage/Reports/Model/Resource/Event.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Event/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Event/Collection.php index febaa2c234..ae9dde916c 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Event/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Event/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Event/Type.php b/app/code/core/Mage/Reports/Model/Resource/Event/Type.php index 93647dea9a..6b74d4f084 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Event/Type.php +++ b/app/code/core/Mage/Reports/Model/Resource/Event/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Event/Type/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Event/Type/Collection.php index 53ebbd2a25..cad0e3ec4b 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Event/Type/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Event/Type/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Helper/Interface.php b/app/code/core/Mage/Reports/Model/Resource/Helper/Interface.php index 8e2442e597..b7d48bc6af 100644 --- a/app/code/core/Mage/Reports/Model/Resource/Helper/Interface.php +++ b/app/code/core/Mage/Reports/Model/Resource/Helper/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Helper/Mysql4.php b/app/code/core/Mage/Reports/Model/Resource/Helper/Mysql4.php index bbc31c7d99..e420c9d1c7 100644 --- a/app/code/core/Mage/Reports/Model/Resource/Helper/Mysql4.php +++ b/app/code/core/Mage/Reports/Model/Resource/Helper/Mysql4.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Invoiced/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Invoiced/Collection.php index b1e9e82ba4..19044ddb18 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Invoiced/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Invoiced/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Order/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Order/Collection.php index 706bda5c7c..a03745bf3b 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Order/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Order/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Product/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Product/Collection.php index 6febdf40a4..2aa31425da 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Product/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Product/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Product/Downloads/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Product/Downloads/Collection.php index bd01f3bff3..756f375402 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Product/Downloads/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Product/Downloads/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Product/Index/Abstract.php b/app/code/core/Mage/Reports/Model/Resource/Product/Index/Abstract.php index 5207f4326c..fdb988bcd5 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Product/Index/Abstract.php +++ b/app/code/core/Mage/Reports/Model/Resource/Product/Index/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Product/Index/Collection/Abstract.php b/app/code/core/Mage/Reports/Model/Resource/Product/Index/Collection/Abstract.php index ee9e9624ee..394d77e108 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Product/Index/Collection/Abstract.php +++ b/app/code/core/Mage/Reports/Model/Resource/Product/Index/Collection/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Product/Index/Compared.php b/app/code/core/Mage/Reports/Model/Resource/Product/Index/Compared.php index 3fb5f01430..bc9df88e92 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Product/Index/Compared.php +++ b/app/code/core/Mage/Reports/Model/Resource/Product/Index/Compared.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Product/Index/Compared/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Product/Index/Compared/Collection.php index e6ee0b6b30..743935060a 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Product/Index/Compared/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Product/Index/Compared/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Product/Index/Viewed.php b/app/code/core/Mage/Reports/Model/Resource/Product/Index/Viewed.php index 06fcc6c7d4..8624131585 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Product/Index/Viewed.php +++ b/app/code/core/Mage/Reports/Model/Resource/Product/Index/Viewed.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Product/Index/Viewed/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Product/Index/Viewed/Collection.php index 3864e72307..96d414ad0c 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Product/Index/Viewed/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Product/Index/Viewed/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Product/Lowstock/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Product/Lowstock/Collection.php index c4429719b2..11f39aec5d 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Product/Lowstock/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Product/Lowstock/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Product/Ordered/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Product/Ordered/Collection.php index 840fec7365..698ea3653a 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Product/Ordered/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Product/Ordered/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Product/Sold/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Product/Sold/Collection.php index 6876c41aa2..3209daabaa 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Product/Sold/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Product/Sold/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Product/Viewed/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Product/Viewed/Collection.php index 6c7476732b..d6ec47e4e7 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Product/Viewed/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Product/Viewed/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Quote/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Quote/Collection.php index 1c8a10241b..fa95238eeb 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Quote/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Quote/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Refunded/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Refunded/Collection.php index 6b42ff46b1..04e26590be 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Refunded/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Refunded/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Report/Abstract.php b/app/code/core/Mage/Reports/Model/Resource/Report/Abstract.php index cde4d93a2f..853ab70c9a 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Report/Abstract.php +++ b/app/code/core/Mage/Reports/Model/Resource/Report/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Report/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Report/Collection.php index 93c6382670..8e317cea29 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Report/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Report/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Report/Collection/Abstract.php b/app/code/core/Mage/Reports/Model/Resource/Report/Collection/Abstract.php index d6326e2d65..d41ccd2e8c 100644 --- a/app/code/core/Mage/Reports/Model/Resource/Report/Collection/Abstract.php +++ b/app/code/core/Mage/Reports/Model/Resource/Report/Collection/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Report/Product/Viewed.php b/app/code/core/Mage/Reports/Model/Resource/Report/Product/Viewed.php index e4403e8717..4e576cfa83 100644 --- a/app/code/core/Mage/Reports/Model/Resource/Report/Product/Viewed.php +++ b/app/code/core/Mage/Reports/Model/Resource/Report/Product/Viewed.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Report/Product/Viewed/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Report/Product/Viewed/Collection.php index 1f95ddd16b..0edfd348b6 100644 --- a/app/code/core/Mage/Reports/Model/Resource/Report/Product/Viewed/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Report/Product/Viewed/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Review/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Review/Collection.php index 6463db8ee7..cb9ab77fa1 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Review/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Review/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Review/Customer/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Review/Customer/Collection.php index fd13f65050..08d384ac2b 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Review/Customer/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Review/Customer/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Review/Product/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Review/Product/Collection.php index 6043b418a1..80deb809bc 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Review/Product/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Review/Product/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -86,7 +86,7 @@ public function joinReview() 'avg_rating' => sprintf('%s/%s', $sumPercentField, $countRatingId), 'avg_rating_approved' => sprintf('%s/%s', $sumPercentApproved, $countRatingId), )); -//ECHO $this->getSelect();dd(); + return $this; } @@ -106,4 +106,30 @@ public function addAttributeToSort($attribute, $dir = self::SORT_ORDER_ASC) return parent::addAttributeToSort($attribute, $dir); } + + /** + * Get select count sql + * + * @return Varien_Db_Select + */ + public function getSelectCountSql() + { + $this->_renderFilters(); + + /* @var Varien_Db_Select $select */ + $select = clone $this->getSelect(); + $select->reset(Zend_Db_Select::ORDER); + $select->reset(Zend_Db_Select::LIMIT_COUNT); + $select->reset(Zend_Db_Select::LIMIT_OFFSET); + $select->reset(Zend_Db_Select::COLUMNS); + $select->resetJoinLeft(); + $select->columns(new Zend_Db_Expr('1')); + + /* @var Varien_Db_Select $countSelect */ + $countSelect = clone $select; + $countSelect->reset(); + $countSelect->from($select, "COUNT(*)"); + + return $countSelect; + } } diff --git a/app/code/core/Mage/Reports/Model/Resource/Shipping/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Shipping/Collection.php index 1d3de4ca6d..1fec2d2a61 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Shipping/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Shipping/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Shopcart/Product/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Shopcart/Product/Collection.php index b07208dc89..158ea02443 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Shopcart/Product/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Shopcart/Product/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Tag/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Tag/Collection.php index a119a8f54f..d5a5a98b48 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Tag/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Tag/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Tag/Customer/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Tag/Customer/Collection.php index 9c9ede3b60..863d21f60d 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Tag/Customer/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Tag/Customer/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Tag/Product/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Tag/Product/Collection.php index 10755d0478..e71fc7564f 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Tag/Product/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Tag/Product/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Tax/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Tax/Collection.php index 4523c5b7c2..e51f91f2d1 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Tax/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Tax/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Wishlist/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Wishlist/Collection.php index fccac19ade..6ac2378237 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Wishlist/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Wishlist/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Wishlist/Product/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Wishlist/Product/Collection.php index 1b446d7037..46040e44ce 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Wishlist/Product/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Wishlist/Product/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Session.php b/app/code/core/Mage/Reports/Model/Session.php index 6f948c7e04..e82cd80843 100644 --- a/app/code/core/Mage/Reports/Model/Session.php +++ b/app/code/core/Mage/Reports/Model/Session.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Test.php b/app/code/core/Mage/Reports/Model/Test.php index 3a45fad58c..e8912bfe19 100644 --- a/app/code/core/Mage/Reports/Model/Test.php +++ b/app/code/core/Mage/Reports/Model/Test.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Totals.php b/app/code/core/Mage/Reports/Model/Totals.php index 0610f6a108..cc4e54290c 100644 --- a/app/code/core/Mage/Reports/Model/Totals.php +++ b/app/code/core/Mage/Reports/Model/Totals.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/data/reports_setup/data-install-1.6.0.0.php b/app/code/core/Mage/Reports/data/reports_setup/data-install-1.6.0.0.php index b67be244a6..caf2852dc1 100644 --- a/app/code/core/Mage/Reports/data/reports_setup/data-install-1.6.0.0.php +++ b/app/code/core/Mage/Reports/data/reports_setup/data-install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/etc/adminhtml.xml b/app/code/core/Mage/Reports/etc/adminhtml.xml index 305f07debd..108b3bea6f 100644 --- a/app/code/core/Mage/Reports/etc/adminhtml.xml +++ b/app/code/core/Mage/Reports/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -99,10 +99,6 @@ Low stock adminhtml/report_product/lowstock - - Downloads - adminhtml/report_product/downloads - @@ -128,11 +124,11 @@ 60 adminhtml/report/search - + 65535 Refresh Statistics adminhtml/report_statistics - + diff --git a/app/code/core/Mage/Reports/etc/config.xml b/app/code/core/Mage/Reports/etc/config.xml index 64f21bbd15..2b00986066 100644 --- a/app/code/core/Mage/Reports/etc/config.xml +++ b/app/code/core/Mage/Reports/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Reports/etc/system.xml b/app/code/core/Mage/Reports/etc/system.xml index ab98a74082..48fd02e149 100644 --- a/app/code/core/Mage/Reports/etc/system.xml +++ b/app/code/core/Mage/Reports/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Reports/etc/widget.xml b/app/code/core/Mage/Reports/etc/widget.xml index c9a712ec4d..7fa925a418 100644 --- a/app/code/core/Mage/Reports/etc/widget.xml +++ b/app/code/core/Mage/Reports/etc/widget.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Reports/sql/reports_setup/install-1.6.0.0.php b/app/code/core/Mage/Reports/sql/reports_setup/install-1.6.0.0.php index 953477e477..4344b83316 100644 --- a/app/code/core/Mage/Reports/sql/reports_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Reports/sql/reports_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/sql/reports_setup/mysql4-install-0.7.1.php b/app/code/core/Mage/Reports/sql/reports_setup/mysql4-install-0.7.1.php index ab3d6ed026..bd3ba8ee6a 100644 --- a/app/code/core/Mage/Reports/sql/reports_setup/mysql4-install-0.7.1.php +++ b/app/code/core/Mage/Reports/sql/reports_setup/mysql4-install-0.7.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/sql/reports_setup/mysql4-install-1.5.0.0.php b/app/code/core/Mage/Reports/sql/reports_setup/mysql4-install-1.5.0.0.php index 703c290555..6fcbac9326 100644 --- a/app/code/core/Mage/Reports/sql/reports_setup/mysql4-install-1.5.0.0.php +++ b/app/code/core/Mage/Reports/sql/reports_setup/mysql4-install-1.5.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/sql/reports_setup/mysql4-install-1.6.0.0.php b/app/code/core/Mage/Reports/sql/reports_setup/mysql4-install-1.6.0.0.php index 204a21b588..2b4efda0eb 100644 --- a/app/code/core/Mage/Reports/sql/reports_setup/mysql4-install-1.6.0.0.php +++ b/app/code/core/Mage/Reports/sql/reports_setup/mysql4-install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.0-0.7.1.php b/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.0-0.7.1.php index bbe64feded..70c38dfb06 100644 --- a/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.0-0.7.1.php +++ b/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.0-0.7.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.1-0.7.2.php b/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.1-0.7.2.php index 89cc8923a2..444b79beb3 100644 --- a/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.1-0.7.2.php +++ b/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.1-0.7.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.2-0.7.3.php b/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.2-0.7.3.php index ce5e45026d..617cb927f0 100644 --- a/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.2-0.7.3.php +++ b/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.2-0.7.3.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.3-0.7.4.php b/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.3-0.7.4.php index 5fdfd6cca9..9aa0a52894 100644 --- a/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.3-0.7.4.php +++ b/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.3-0.7.4.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.4-0.7.5.php b/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.4-0.7.5.php index f409473b20..425d9117cc 100644 --- a/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.4-0.7.5.php +++ b/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.4-0.7.5.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.5-0.7.7.php b/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.5-0.7.7.php index fc19ffe6cb..1d63160349 100644 --- a/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.5-0.7.7.php +++ b/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.5-0.7.7.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.7-0.7.8.php b/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.7-0.7.8.php index 9f826be269..ae501979d5 100644 --- a/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.7-0.7.8.php +++ b/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.7-0.7.8.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.8-0.7.9.php b/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.8-0.7.9.php index 2ad6950c58..dc5b57dad3 100644 --- a/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.8-0.7.9.php +++ b/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.8-0.7.9.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.9-0.7.10.php b/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.9-0.7.10.php index 04eff8fbc7..035a6112e8 100644 --- a/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.9-0.7.10.php +++ b/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-0.7.9-0.7.10.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php index 9cde61ffd6..8d028270a2 100644 --- a/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ b/app/code/core/Mage/Reports/sql/reports_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/sql/reports_setup/upgrade-1.6.0.0-1.6.0.0.1.php b/app/code/core/Mage/Reports/sql/reports_setup/upgrade-1.6.0.0-1.6.0.0.1.php index be07726725..7a2482b700 100644 --- a/app/code/core/Mage/Reports/sql/reports_setup/upgrade-1.6.0.0-1.6.0.0.1.php +++ b/app/code/core/Mage/Reports/sql/reports_setup/upgrade-1.6.0.0-1.6.0.0.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Review/Block/Customer/List.php b/app/code/core/Mage/Review/Block/Customer/List.php index 7f62c936cb..e8d3e0cae7 100644 --- a/app/code/core/Mage/Review/Block/Customer/List.php +++ b/app/code/core/Mage/Review/Block/Customer/List.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -34,9 +34,16 @@ */ class Mage_Review_Block_Customer_List extends Mage_Customer_Block_Account_Dashboard { - + /** + * Product reviews collection + * + * @var Mage_Review_Model_Resource_Review_Product_Collection + */ protected $_collection; + /** + * Initializes collection + */ protected function _construct() { $this->_collection = Mage::getModel('review/review')->getProductCollection(); @@ -46,50 +53,94 @@ protected function _construct() ->setDateOrder(); } + /** + * Gets collection items count + * + * @return int + */ public function count() { return $this->_collection->getSize(); } + /** + * Get html code for toolbar + * + * @return string + */ public function getToolbarHtml() { return $this->getChildHtml('toolbar'); } + /** + * Initializes toolbar + * + * @return Mage_Core_Block_Abstract + */ protected function _prepareLayout() { $toolbar = $this->getLayout()->createBlock('page/html_pager', 'customer_review_list.toolbar') - ->setCollection($this->_getCollection()); + ->setCollection($this->getCollection()); $this->setChild('toolbar', $toolbar); return parent::_prepareLayout(); } + /** + * Get collection + * + * @return Mage_Review_Model_Resource_Review_Product_Collection + */ protected function _getCollection() { return $this->_collection; } + /** + * Get collection + * + * @return Mage_Review_Model_Resource_Review_Product_Collection + */ public function getCollection() { return $this->_getCollection(); } + /** + * Get review link + * + * @return string + */ public function getReviewLink() { return Mage::getUrl('review/customer/view/'); } + /** + * Get product link + * + * @return string + */ public function getProductLink() { return Mage::getUrl('catalog/product/view/'); } + /** + * Format date in short format + * + * @param $date + * @return string + */ public function dateFormat($date) { return $this->formatDate($date, Mage_Core_Model_Locale::FORMAT_TYPE_SHORT); } + /** + * @return Mage_Core_Block_Abstract + */ protected function _beforeToHtml() { $this->_getCollection() @@ -97,5 +148,4 @@ protected function _beforeToHtml() ->addReviewSummary(); return parent::_beforeToHtml(); } - } diff --git a/app/code/core/Mage/Review/Block/Customer/Recent.php b/app/code/core/Mage/Review/Block/Customer/Recent.php index cf848ea6dc..f8f343f928 100644 --- a/app/code/core/Mage/Review/Block/Customer/Recent.php +++ b/app/code/core/Mage/Review/Block/Customer/Recent.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Review/Block/Customer/View.php b/app/code/core/Mage/Review/Block/Customer/View.php index 205ebe8c3e..629ee49322 100644 --- a/app/code/core/Mage/Review/Block/Customer/View.php +++ b/app/code/core/Mage/Review/Block/Customer/View.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Review/Block/Form.php b/app/code/core/Mage/Review/Block/Form.php index 2736d4a6d8..f3d38af23e 100644 --- a/app/code/core/Mage/Review/Block/Form.php +++ b/app/code/core/Mage/Review/Block/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Review/Block/Helper.php b/app/code/core/Mage/Review/Block/Helper.php index e5377dc2f2..2a025d0474 100644 --- a/app/code/core/Mage/Review/Block/Helper.php +++ b/app/code/core/Mage/Review/Block/Helper.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Review/Block/Product/View.php b/app/code/core/Mage/Review/Block/Product/View.php index 9107c64283..91c50eb22b 100644 --- a/app/code/core/Mage/Review/Block/Product/View.php +++ b/app/code/core/Mage/Review/Block/Product/View.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Review/Block/Product/View/List.php b/app/code/core/Mage/Review/Block/Product/View/List.php index b0e83ba17c..10d5eecda0 100644 --- a/app/code/core/Mage/Review/Block/Product/View/List.php +++ b/app/code/core/Mage/Review/Block/Product/View/List.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Review/Block/View.php b/app/code/core/Mage/Review/Block/View.php index 3aae055ff2..8e7c696a0f 100644 --- a/app/code/core/Mage/Review/Block/View.php +++ b/app/code/core/Mage/Review/Block/View.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Review/Helper/Data.php b/app/code/core/Mage/Review/Helper/Data.php index 30d0077042..4a89c9bd23 100644 --- a/app/code/core/Mage/Review/Helper/Data.php +++ b/app/code/core/Mage/Review/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Review/Model/Mysql4/Review.php b/app/code/core/Mage/Review/Model/Mysql4/Review.php index ce7fac32e7..9f764e6e82 100644 --- a/app/code/core/Mage/Review/Model/Mysql4/Review.php +++ b/app/code/core/Mage/Review/Model/Mysql4/Review.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Review/Model/Mysql4/Review/Collection.php b/app/code/core/Mage/Review/Model/Mysql4/Review/Collection.php index 3f4f29db1c..7c9287d1de 100644 --- a/app/code/core/Mage/Review/Model/Mysql4/Review/Collection.php +++ b/app/code/core/Mage/Review/Model/Mysql4/Review/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Review/Model/Mysql4/Review/Product/Collection.php b/app/code/core/Mage/Review/Model/Mysql4/Review/Product/Collection.php index c32b02d624..df3763f9fd 100644 --- a/app/code/core/Mage/Review/Model/Mysql4/Review/Product/Collection.php +++ b/app/code/core/Mage/Review/Model/Mysql4/Review/Product/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Review/Model/Mysql4/Review/Status/Collection.php b/app/code/core/Mage/Review/Model/Mysql4/Review/Status/Collection.php index 8b194da200..c5cc1ce881 100644 --- a/app/code/core/Mage/Review/Model/Mysql4/Review/Status/Collection.php +++ b/app/code/core/Mage/Review/Model/Mysql4/Review/Status/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Review/Model/Mysql4/Review/Summary.php b/app/code/core/Mage/Review/Model/Mysql4/Review/Summary.php index ae142ee4eb..2e747210ca 100644 --- a/app/code/core/Mage/Review/Model/Mysql4/Review/Summary.php +++ b/app/code/core/Mage/Review/Model/Mysql4/Review/Summary.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Review/Model/Mysql4/Review/Summary/Collection.php b/app/code/core/Mage/Review/Model/Mysql4/Review/Summary/Collection.php index e84060df60..b4a629a2c6 100644 --- a/app/code/core/Mage/Review/Model/Mysql4/Review/Summary/Collection.php +++ b/app/code/core/Mage/Review/Model/Mysql4/Review/Summary/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Review/Model/Observer.php b/app/code/core/Mage/Review/Model/Observer.php index f4a54ec8f8..40c479cb86 100644 --- a/app/code/core/Mage/Review/Model/Observer.php +++ b/app/code/core/Mage/Review/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Review/Model/Resource/Review.php b/app/code/core/Mage/Review/Model/Resource/Review.php index 7203a60111..7c543ed8ca 100755 --- a/app/code/core/Mage/Review/Model/Resource/Review.php +++ b/app/code/core/Mage/Review/Model/Resource/Review.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Review/Model/Resource/Review/Collection.php b/app/code/core/Mage/Review/Model/Resource/Review/Collection.php index 1189620c6f..1ec8cfee5a 100755 --- a/app/code/core/Mage/Review/Model/Resource/Review/Collection.php +++ b/app/code/core/Mage/Review/Model/Resource/Review/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Review/Model/Resource/Review/Product/Collection.php b/app/code/core/Mage/Review/Model/Resource/Review/Product/Collection.php index 1101d18034..f799410e5b 100755 --- a/app/code/core/Mage/Review/Model/Resource/Review/Product/Collection.php +++ b/app/code/core/Mage/Review/Model/Resource/Review/Product/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -318,8 +318,9 @@ public function getAllIds($limit = null, $offset = null) public function getSelectCountSql() { $select = parent::getSelectCountSql(); - - $select->reset(Zend_Db_Select::HAVING); + $select->reset(Zend_Db_Select::COLUMNS) + ->columns('COUNT(e.entity_id)') + ->reset(Zend_Db_Select::HAVING); return $select; } diff --git a/app/code/core/Mage/Review/Model/Resource/Review/Status.php b/app/code/core/Mage/Review/Model/Resource/Review/Status.php index 3cf5396c8a..47d6ef7a75 100644 --- a/app/code/core/Mage/Review/Model/Resource/Review/Status.php +++ b/app/code/core/Mage/Review/Model/Resource/Review/Status.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Review/Model/Resource/Review/Status/Collection.php b/app/code/core/Mage/Review/Model/Resource/Review/Status/Collection.php index ce6a449349..ebcdd3b711 100755 --- a/app/code/core/Mage/Review/Model/Resource/Review/Status/Collection.php +++ b/app/code/core/Mage/Review/Model/Resource/Review/Status/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Review/Model/Resource/Review/Summary.php b/app/code/core/Mage/Review/Model/Resource/Review/Summary.php index f5c11b9548..0cd062280a 100755 --- a/app/code/core/Mage/Review/Model/Resource/Review/Summary.php +++ b/app/code/core/Mage/Review/Model/Resource/Review/Summary.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Review/Model/Resource/Review/Summary/Collection.php b/app/code/core/Mage/Review/Model/Resource/Review/Summary/Collection.php index 2b4dd5c8b8..2a83cbe800 100755 --- a/app/code/core/Mage/Review/Model/Resource/Review/Summary/Collection.php +++ b/app/code/core/Mage/Review/Model/Resource/Review/Summary/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Review/Model/Review.php b/app/code/core/Mage/Review/Model/Review.php index 116b32bbaa..20a41b1636 100644 --- a/app/code/core/Mage/Review/Model/Review.php +++ b/app/code/core/Mage/Review/Model/Review.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Review/Model/Review/Status.php b/app/code/core/Mage/Review/Model/Review/Status.php index 85981b5dda..c3f794eb51 100644 --- a/app/code/core/Mage/Review/Model/Review/Status.php +++ b/app/code/core/Mage/Review/Model/Review/Status.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Review/Model/Review/Summary.php b/app/code/core/Mage/Review/Model/Review/Summary.php index fa463b9c3a..782a111da0 100644 --- a/app/code/core/Mage/Review/Model/Review/Summary.php +++ b/app/code/core/Mage/Review/Model/Review/Summary.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Review/Model/Session.php b/app/code/core/Mage/Review/Model/Session.php index 0225f8b769..bc46d9626b 100644 --- a/app/code/core/Mage/Review/Model/Session.php +++ b/app/code/core/Mage/Review/Model/Session.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Review/controllers/CustomerController.php b/app/code/core/Mage/Review/controllers/CustomerController.php index f4594d0a6a..0adc2d212f 100644 --- a/app/code/core/Mage/Review/controllers/CustomerController.php +++ b/app/code/core/Mage/Review/controllers/CustomerController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Review/controllers/ProductController.php b/app/code/core/Mage/Review/controllers/ProductController.php index bfa26a6de9..db7b647bd6 100644 --- a/app/code/core/Mage/Review/controllers/ProductController.php +++ b/app/code/core/Mage/Review/controllers/ProductController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Review/data/review_setup/data-install-1.6.0.0.php b/app/code/core/Mage/Review/data/review_setup/data-install-1.6.0.0.php index 5aad520c99..05a3f20709 100644 --- a/app/code/core/Mage/Review/data/review_setup/data-install-1.6.0.0.php +++ b/app/code/core/Mage/Review/data/review_setup/data-install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Review/etc/adminhtml.xml b/app/code/core/Mage/Review/etc/adminhtml.xml index b7447d7c37..d93f16dbf1 100644 --- a/app/code/core/Mage/Review/etc/adminhtml.xml +++ b/app/code/core/Mage/Review/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Review/etc/config.xml b/app/code/core/Mage/Review/etc/config.xml index cdfa691a9f..d358df26ee 100644 --- a/app/code/core/Mage/Review/etc/config.xml +++ b/app/code/core/Mage/Review/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Review/etc/system.xml b/app/code/core/Mage/Review/etc/system.xml index b24512aaa4..297452af53 100644 --- a/app/code/core/Mage/Review/etc/system.xml +++ b/app/code/core/Mage/Review/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Review/sql/review_setup/install-1.6.0.0.php b/app/code/core/Mage/Review/sql/review_setup/install-1.6.0.0.php index b0318f6a14..eee692bc83 100644 --- a/app/code/core/Mage/Review/sql/review_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Review/sql/review_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Review/sql/review_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/Review/sql/review_setup/mysql4-install-0.7.0.php index 188f545ce2..5094f59750 100644 --- a/app/code/core/Mage/Review/sql/review_setup/mysql4-install-0.7.0.php +++ b/app/code/core/Mage/Review/sql/review_setup/mysql4-install-0.7.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Review/sql/review_setup/mysql4-upgrade-0.7.0-0.7.1.php b/app/code/core/Mage/Review/sql/review_setup/mysql4-upgrade-0.7.0-0.7.1.php index 091ba60457..08cc02f836 100644 --- a/app/code/core/Mage/Review/sql/review_setup/mysql4-upgrade-0.7.0-0.7.1.php +++ b/app/code/core/Mage/Review/sql/review_setup/mysql4-upgrade-0.7.0-0.7.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Review/sql/review_setup/mysql4-upgrade-0.7.1-0.7.2.php b/app/code/core/Mage/Review/sql/review_setup/mysql4-upgrade-0.7.1-0.7.2.php index 713627a3ec..006249083d 100644 --- a/app/code/core/Mage/Review/sql/review_setup/mysql4-upgrade-0.7.1-0.7.2.php +++ b/app/code/core/Mage/Review/sql/review_setup/mysql4-upgrade-0.7.1-0.7.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Review/sql/review_setup/mysql4-upgrade-0.7.2-0.7.3.php b/app/code/core/Mage/Review/sql/review_setup/mysql4-upgrade-0.7.2-0.7.3.php index f082f758aa..ad76d82b38 100644 --- a/app/code/core/Mage/Review/sql/review_setup/mysql4-upgrade-0.7.2-0.7.3.php +++ b/app/code/core/Mage/Review/sql/review_setup/mysql4-upgrade-0.7.2-0.7.3.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Review/sql/review_setup/mysql4-upgrade-0.7.3-0.7.4.php b/app/code/core/Mage/Review/sql/review_setup/mysql4-upgrade-0.7.3-0.7.4.php index aa23b24f17..4200c85599 100644 --- a/app/code/core/Mage/Review/sql/review_setup/mysql4-upgrade-0.7.3-0.7.4.php +++ b/app/code/core/Mage/Review/sql/review_setup/mysql4-upgrade-0.7.3-0.7.4.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Review/sql/review_setup/mysql4-upgrade-0.7.4-0.7.5.php b/app/code/core/Mage/Review/sql/review_setup/mysql4-upgrade-0.7.4-0.7.5.php index 63e22af4be..5ab9202ebb 100644 --- a/app/code/core/Mage/Review/sql/review_setup/mysql4-upgrade-0.7.4-0.7.5.php +++ b/app/code/core/Mage/Review/sql/review_setup/mysql4-upgrade-0.7.4-0.7.5.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Review/sql/review_setup/mysql4-upgrade-0.7.5-0.7.6.php b/app/code/core/Mage/Review/sql/review_setup/mysql4-upgrade-0.7.5-0.7.6.php index 7c49ba08f1..35cb6b6682 100644 --- a/app/code/core/Mage/Review/sql/review_setup/mysql4-upgrade-0.7.5-0.7.6.php +++ b/app/code/core/Mage/Review/sql/review_setup/mysql4-upgrade-0.7.5-0.7.6.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Review/sql/review_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/Review/sql/review_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php index d637ea23bb..7670a64157 100644 --- a/app/code/core/Mage/Review/sql/review_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ b/app/code/core/Mage/Review/sql/review_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rss/Block/Abstract.php b/app/code/core/Mage/Rss/Block/Abstract.php index f271f73289..404dbf5803 100644 --- a/app/code/core/Mage/Rss/Block/Abstract.php +++ b/app/code/core/Mage/Rss/Block/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rss - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Rss_Block_Abstract extends Mage_Core_Block_Template diff --git a/app/code/core/Mage/Rss/Block/Catalog/Abstract.php b/app/code/core/Mage/Rss/Block/Catalog/Abstract.php index 2bdfecf30c..81a3859c7b 100644 --- a/app/code/core/Mage/Rss/Block/Catalog/Abstract.php +++ b/app/code/core/Mage/Rss/Block/Catalog/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rss - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Rss_Block_Catalog_Abstract extends Mage_Rss_Block_Abstract diff --git a/app/code/core/Mage/Rss/Block/Catalog/Category.php b/app/code/core/Mage/Rss/Block/Catalog/Category.php index 3d123c2a9e..f4c995da14 100644 --- a/app/code/core/Mage/Rss/Block/Catalog/Category.php +++ b/app/code/core/Mage/Rss/Block/Catalog/Category.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rss - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rss/Block/Catalog/New.php b/app/code/core/Mage/Rss/Block/Catalog/New.php index 10f9abb4f7..4228d0bc4f 100644 --- a/app/code/core/Mage/Rss/Block/Catalog/New.php +++ b/app/code/core/Mage/Rss/Block/Catalog/New.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rss - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rss/Block/Catalog/NotifyStock.php b/app/code/core/Mage/Rss/Block/Catalog/NotifyStock.php index 106e7e5090..239036dccc 100644 --- a/app/code/core/Mage/Rss/Block/Catalog/NotifyStock.php +++ b/app/code/core/Mage/Rss/Block/Catalog/NotifyStock.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rss - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rss/Block/Catalog/Review.php b/app/code/core/Mage/Rss/Block/Catalog/Review.php index 006caad9a0..27c78aa648 100644 --- a/app/code/core/Mage/Rss/Block/Catalog/Review.php +++ b/app/code/core/Mage/Rss/Block/Catalog/Review.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rss - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rss/Block/Catalog/Salesrule.php b/app/code/core/Mage/Rss/Block/Catalog/Salesrule.php index 931af4a163..cfa9e508c5 100644 --- a/app/code/core/Mage/Rss/Block/Catalog/Salesrule.php +++ b/app/code/core/Mage/Rss/Block/Catalog/Salesrule.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rss - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -42,44 +42,41 @@ protected function _construct() $this->setCacheLifetime(600); } - + /** + * Generate RSS XML with sales rules data + * + * @return string + */ protected function _toHtml() { - //store id is store view id - $storeId = $this->_getStoreId(); - $websiteId = Mage::app()->getStore($storeId)->getWebsiteId(); - //customer group id - $custGroup = $this->_getCustomerGroupId(); - - $newurl = Mage::getUrl('rss/catalog/salesrule'); - $title = Mage::helper('rss')->__('%s - Discounts and Coupons',Mage::app()->getStore($storeId)->getName()); - $lang = Mage::getStoreConfig('general/locale/code'); - - $rssObj = Mage::getModel('rss/rss'); - $data = array('title' => $title, - 'description' => $title, - 'link' => $newurl, - 'charset' => 'UTF-8', - 'language' => $lang - ); - $rssObj->_addHeader($data); + $storeId = $this->_getStoreId(); + $websiteId = Mage::app()->getStore($storeId)->getWebsiteId(); + $customerGroup = $this->_getCustomerGroupId(); + $now = date('Y-m-d'); + $url = Mage::getUrl(''); + $newUrl = Mage::getUrl('rss/catalog/salesrule'); + $lang = Mage::getStoreConfig('general/locale/code'); + $title = Mage::helper('rss')->__('%s - Discounts and Coupons',Mage::app()->getStore($storeId)->getName()); - $now = date('Y-m-d'); - $_saleRule = Mage::getModel('salesrule/rule'); + /** @var $rssObject Mage_Rss_Model_Rss */ + $rssObject = Mage::getModel('rss/rss'); + /** @var $collection Mage_SalesRule_Model_Resource_Rule_Collection */ + $collection = Mage::getModel('salesrule/rule')->getResourceCollection(); - $collection = $_saleRule->getResourceCollection() - ->addFieldToFilter('from_date', array('date'=>true, 'to' => $now)) - ->addFieldToFilter('website_ids',array('finset' => $websiteId)) - ->addFieldToFilter('customer_group_ids', array('finset' => $custGroup)) - ->addFieldToFilter('is_rss',1) - ->addFieldToFilter('is_active',1) - ->setOrder('from_date','desc'); + $data = array( + 'title' => $title, + 'description' => $title, + 'link' => $newUrl, + 'charset' => 'UTF-8', + 'language' => $lang + ); + $rssObject->_addHeader($data); - $collection->getSelect()->where('to_date is null or to_date>=?', $now); + $collection->addWebsiteGroupDateFilter($websiteId, $customerGroup, $now) + ->addFieldToFilter('is_rss', 1) + ->setOrder('from_date','desc'); $collection->load(); - $url = Mage::getUrl(''); - foreach ($collection as $sr) { $description = ''. ''. '
    '.$sr->getDescription(). @@ -89,12 +86,13 @@ protected function _toHtml() '
    '; $data = array( - 'title' => $sr->getName(), - 'description' => $description, - 'link' => $url - ); - $rssObj->_addEntry($data); + 'title' => $sr->getName(), + 'description' => $description, + 'link' => $url + ); + $rssObject->_addEntry($data); } - return $rssObj->createRssXml(); + + return $rssObject->createRssXml(); } } diff --git a/app/code/core/Mage/Rss/Block/Catalog/Special.php b/app/code/core/Mage/Rss/Block/Catalog/Special.php index 8706b8b815..bf832d7318 100644 --- a/app/code/core/Mage/Rss/Block/Catalog/Special.php +++ b/app/code/core/Mage/Rss/Block/Catalog/Special.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rss - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rss/Block/Catalog/Tag.php b/app/code/core/Mage/Rss/Block/Catalog/Tag.php index f75f4fd23f..12d90d1512 100644 --- a/app/code/core/Mage/Rss/Block/Catalog/Tag.php +++ b/app/code/core/Mage/Rss/Block/Catalog/Tag.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rss - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rss/Block/List.php b/app/code/core/Mage/Rss/Block/List.php index 9f642649a8..0420f5f966 100644 --- a/app/code/core/Mage/Rss/Block/List.php +++ b/app/code/core/Mage/Rss/Block/List.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rss - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rss/Block/Order/Details.php b/app/code/core/Mage/Rss/Block/Order/Details.php index b83fbd74e2..4f6134174f 100644 --- a/app/code/core/Mage/Rss/Block/Order/Details.php +++ b/app/code/core/Mage/Rss/Block/Order/Details.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rss - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Rss_Block_Order_Details extends Mage_Core_Block_Template diff --git a/app/code/core/Mage/Rss/Block/Order/New.php b/app/code/core/Mage/Rss/Block/Order/New.php index bd9579ed37..0acb214092 100644 --- a/app/code/core/Mage/Rss/Block/Order/New.php +++ b/app/code/core/Mage/Rss/Block/Order/New.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rss - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rss/Block/Order/Status.php b/app/code/core/Mage/Rss/Block/Order/Status.php index 87812bdb58..b353f249b1 100644 --- a/app/code/core/Mage/Rss/Block/Order/Status.php +++ b/app/code/core/Mage/Rss/Block/Order/Status.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rss - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rss/Block/Wishlist.php b/app/code/core/Mage/Rss/Block/Wishlist.php index 9f57d8bd51..9a3d2e6aa9 100644 --- a/app/code/core/Mage/Rss/Block/Wishlist.php +++ b/app/code/core/Mage/Rss/Block/Wishlist.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rss - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -56,8 +56,16 @@ protected function _getWishlist() { if (is_null($this->_wishlist)) { $this->_wishlist = Mage::getModel('wishlist/wishlist'); - if ($this->_getCustomer()->getId()) { - $this->_wishlist->loadByCustomer($this->_getCustomer()); + $wishlistId = $this->getRequest()->getParam('wishlist_id'); + if ($wishlistId) { + $this->_wishlist->load($wishlistId); + if ($this->_wishlist->getCustomerId() != $this->_getCustomer()->getId()) { + $this->_wishlist->unsetData(); + } + } else { + if($this->_getCustomer()->getId()) { + $this->_wishlist->loadByCustomer($this->_getCustomer()); + } } } return $this->_wishlist; @@ -84,6 +92,16 @@ protected function _getCustomer() return $this->_customer; } + /** + * Build wishlist rss feed title + * + * @return string + */ + protected function _getTitle() + { + return Mage::helper('rss')->__('%s\'s Wishlist', $this->_getCustomer()->getName()); + } + /** * Render block HTML * @@ -99,7 +117,7 @@ protected function _toHtml() 'code' => $this->_getWishlist()->getSharingCode() )); - $title = Mage::helper('rss')->__('%s\'s Wishlist', $this->_getCustomer()->getName()); + $title = $this->_getTitle(); $lang = Mage::getStoreConfig('general/locale/code'); $rssObj->_addHeader(array( diff --git a/app/code/core/Mage/Rss/Helper/Catalog.php b/app/code/core/Mage/Rss/Helper/Catalog.php index e6d5ab6ec0..55825bc13c 100644 --- a/app/code/core/Mage/Rss/Helper/Catalog.php +++ b/app/code/core/Mage/Rss/Helper/Catalog.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rss - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rss/Helper/Data.php b/app/code/core/Mage/Rss/Helper/Data.php index a5f64b117f..6dff269bd3 100644 --- a/app/code/core/Mage/Rss/Helper/Data.php +++ b/app/code/core/Mage/Rss/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rss - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rss/Helper/Order.php b/app/code/core/Mage/Rss/Helper/Order.php index 9989e44363..68f8230da9 100644 --- a/app/code/core/Mage/Rss/Helper/Order.php +++ b/app/code/core/Mage/Rss/Helper/Order.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rss - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rss/Model/Mysql4/Order.php b/app/code/core/Mage/Rss/Model/Mysql4/Order.php index f8d8d8f18e..ddbda54ef4 100644 --- a/app/code/core/Mage/Rss/Model/Mysql4/Order.php +++ b/app/code/core/Mage/Rss/Model/Mysql4/Order.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rss - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rss/Model/Observer.php b/app/code/core/Mage/Rss/Model/Observer.php index 60c5493b70..ed78507fbc 100644 --- a/app/code/core/Mage/Rss/Model/Observer.php +++ b/app/code/core/Mage/Rss/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rss - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rss/Model/Resource/Order.php b/app/code/core/Mage/Rss/Model/Resource/Order.php index 298c3cf23b..1cf817b71d 100755 --- a/app/code/core/Mage/Rss/Model/Resource/Order.php +++ b/app/code/core/Mage/Rss/Model/Resource/Order.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rss - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rss/Model/Rss.php b/app/code/core/Mage/Rss/Model/Rss.php index 0b0ffb60ee..d76c84d415 100644 --- a/app/code/core/Mage/Rss/Model/Rss.php +++ b/app/code/core/Mage/Rss/Model/Rss.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rss - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rss/Model/Session.php b/app/code/core/Mage/Rss/Model/Session.php index ee64e5af7b..d3a90f80f4 100644 --- a/app/code/core/Mage/Rss/Model/Session.php +++ b/app/code/core/Mage/Rss/Model/Session.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rss - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rss/Model/System/Config/Backend/Links.php b/app/code/core/Mage/Rss/Model/System/Config/Backend/Links.php index 83166bbdff..3c4ea2c09a 100644 --- a/app/code/core/Mage/Rss/Model/System/Config/Backend/Links.php +++ b/app/code/core/Mage/Rss/Model/System/Config/Backend/Links.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rss - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rss/controllers/CatalogController.php b/app/code/core/Mage/Rss/controllers/CatalogController.php index 15a2c1f4c1..22a7349a4e 100644 --- a/app/code/core/Mage/Rss/controllers/CatalogController.php +++ b/app/code/core/Mage/Rss/controllers/CatalogController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rss - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rss/controllers/IndexController.php b/app/code/core/Mage/Rss/controllers/IndexController.php index e91072bda3..b81c68ee1b 100644 --- a/app/code/core/Mage/Rss/controllers/IndexController.php +++ b/app/code/core/Mage/Rss/controllers/IndexController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rss - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -33,6 +33,23 @@ class Mage_Rss_IndexController extends Mage_Core_Controller_Front_Action { + /** + * Current wishlist + * + * @var Mage_Wishlist_Model_Wishlist + */ + protected $_wishlist; + + /** + * Current customer + * + * @var Mage_Customer_Model_Customer + */ + protected $_customer; + + /** + * Index action + */ public function indexAction() { if (Mage::getStoreConfig('rss/config/active')) { @@ -45,27 +62,99 @@ public function indexAction() } } + /** + * Display feed not found message + */ public function nofeedAction() { $this->getResponse()->setHeader('HTTP/1.1','404 Not Found'); $this->getResponse()->setHeader('Status','404 File not found'); $this->loadLayout(false); - $this->renderLayout(); + $this->renderLayout(); } + /** + * Wishlist rss feed action + * Show all public wishlists and private wishlists that belong to current user + * + * @return mixed + */ public function wishlistAction() { - if ( Mage::getSingleton('customer/session')->authenticate($this) ) { - if (Mage::getStoreConfig('rss/wishlist/active')) { - $this->getResponse()->setHeader('Content-type', 'text/xml; charset=UTF-8'); - $this->loadLayout(false); - $this->renderLayout(); + if (!Mage::getStoreConfig('rss/wishlist/active')) { + $this->getResponse()->setHeader('HTTP/1.1','404 Not Found'); + $this->getResponse()->setHeader('Status','404 File not found'); + $this->_forward('nofeed','index','rss'); + return; + } + + $wishlist = $this->_getWishlist(); + if (!$wishlist) { + $this->_forward('nofeed','index','rss'); + return; + } + + if ($wishlist->getVisibility()) { + $this->_showWishlistRss(); + return ; + } else if (Mage::getSingleton('customer/session')->authenticate($this) + && $wishlist->getCustomerId() == $this->_getCustomer()->getId() + ) { + $this->_showWishlistRss(); + } else { + $this->_forward('nofeed','index','rss'); + } + } + + /** + * Show wishlist rss + */ + protected function _showWishlistRss() + { + $this->getResponse()->setHeader('Content-type', 'text/xml; charset=UTF-8'); + $this->loadLayout(false); + $this->renderLayout(); + } + + /** + * Retrieve Wishlist model + * + * @return Mage_Wishlist_Model_Wishlist + */ + protected function _getWishlist() + { + if (is_null($this->_wishlist)) { + $this->_wishlist = Mage::getModel('wishlist/wishlist'); + $wishlistId = $this->getRequest()->getParam('wishlist_id'); + if ($wishlistId) { + $this->_wishlist->load($wishlistId); } else { - $this->getResponse()->setHeader('HTTP/1.1','404 Not Found'); - $this->getResponse()->setHeader('Status','404 File not found'); - $this->_forward('nofeed','index','rss'); - return; + if($this->_getCustomer()->getId()) { + $this->_wishlist->loadByCustomer($this->_getCustomer()); + } + } + } + return $this->_wishlist; + } + + /** + * Retrieve Customer instance + * + * @return Mage_Customer_Model_Customer + */ + protected function _getCustomer() + { + if (is_null($this->_customer)) { + $this->_customer = Mage::getModel('customer/customer'); + + $params = Mage::helper('core')->urlDecode($this->getRequest()->getParam('data')); + $data = explode(',', $params); + $customerId = abs(intval($data[0])); + if ($customerId && ($customerId == Mage::getSingleton('customer/session')->getCustomerId()) ) { + $this->_customer->load($customerId); } } + + return $this->_customer; } } diff --git a/app/code/core/Mage/Rss/controllers/OrderController.php b/app/code/core/Mage/Rss/controllers/OrderController.php index c16b49b56c..df7e171fe4 100644 --- a/app/code/core/Mage/Rss/controllers/OrderController.php +++ b/app/code/core/Mage/Rss/controllers/OrderController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rss - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rss/etc/adminhtml.xml b/app/code/core/Mage/Rss/etc/adminhtml.xml index 14eef386b7..c5b0b918e1 100644 --- a/app/code/core/Mage/Rss/etc/adminhtml.xml +++ b/app/code/core/Mage/Rss/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Rss - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -35,7 +35,7 @@ - Rss Feeds Section + RSS Feeds Section 135 diff --git a/app/code/core/Mage/Rss/etc/config.xml b/app/code/core/Mage/Rss/etc/config.xml index 7b798df1e9..786c3df207 100644 --- a/app/code/core/Mage/Rss/etc/config.xml +++ b/app/code/core/Mage/Rss/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Rss - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Rss/etc/system.xml b/app/code/core/Mage/Rss/etc/system.xml index 41df19397b..93a903b69d 100644 --- a/app/code/core/Mage/Rss/etc/system.xml +++ b/app/code/core/Mage/Rss/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Rss - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Rule/Block/Actions.php b/app/code/core/Mage/Rule/Block/Actions.php index ea0a56ad62..0078e62c0c 100644 --- a/app/code/core/Mage/Rule/Block/Actions.php +++ b/app/code/core/Mage/Rule/Block/Actions.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rule/Block/Conditions.php b/app/code/core/Mage/Rule/Block/Conditions.php index 678e1ef62d..548c34fd6e 100644 --- a/app/code/core/Mage/Rule/Block/Conditions.php +++ b/app/code/core/Mage/Rule/Block/Conditions.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rule/Block/Editable.php b/app/code/core/Mage/Rule/Block/Editable.php index 951cd22c0c..339c1da2c4 100644 --- a/app/code/core/Mage/Rule/Block/Editable.php +++ b/app/code/core/Mage/Rule/Block/Editable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rule/Block/Newchild.php b/app/code/core/Mage/Rule/Block/Newchild.php index cf77582f78..0dce976a56 100644 --- a/app/code/core/Mage/Rule/Block/Newchild.php +++ b/app/code/core/Mage/Rule/Block/Newchild.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rule/Block/Rule.php b/app/code/core/Mage/Rule/Block/Rule.php index 4b8abbe987..7ed3f92471 100644 --- a/app/code/core/Mage/Rule/Block/Rule.php +++ b/app/code/core/Mage/Rule/Block/Rule.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rule/Helper/Data.php b/app/code/core/Mage/Rule/Helper/Data.php index 3f1ff71ddd..603b181201 100644 --- a/app/code/core/Mage/Rule/Helper/Data.php +++ b/app/code/core/Mage/Rule/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rule/Model/Abstract.php b/app/code/core/Mage/Rule/Model/Abstract.php new file mode 100644 index 0000000000..9650f2fed9 --- /dev/null +++ b/app/code/core/Mage/Rule/Model/Abstract.php @@ -0,0 +1,494 @@ + + */ +abstract class Mage_Rule_Model_Abstract extends Mage_Core_Model_Abstract +{ + /** + * Store rule combine conditions model + * + * @var Mage_Rule_Model_Condition_Combine + */ + protected $_conditions; + + /** + * Store rule actions model + * + * @var Mage_Rule_Model_Action_Collection + */ + protected $_actions; + + /** + * Store rule form instance + * + * @var Varien_Data_Form + */ + protected $_form; + + /** + * Is model can be deleted flag + * + * @var bool + */ + protected $_isDeleteable = true; + + /** + * Is model readonly + * + * @var bool + */ + protected $_isReadonly = false; + + /** + * Getter for rule combine conditions instance + * + * @return Mage_Rule_Model_Condition_Combine + */ + abstract public function getConditionsInstance(); + + /** + * Getter for rule actions collection instance + * + * @return Mage_Rule_Model_Action_Collection + */ + abstract public function getActionsInstance(); + + /** + * Prepare data before saving + * + * @return Mage_Rule_Model_Abstract + */ + protected function _beforeSave() + { + // Check if discount amount not negative + if ($this->hasDiscountAmount()) { + if ((int)$this->getDiscountAmount() < 0) { + Mage::throwException(Mage::helper('rule')->__('Invalid discount amount.')); + } + } + + // Serialize conditions + if ($this->getConditions()) { + $this->setConditionsSerialized(serialize($this->getConditions()->asArray())); + $this->unsConditions(); + } + + // Serialize actions + if ($this->getActions()) { + $this->setActionsSerialized(serialize($this->getActions()->asArray())); + $this->unsActions(); + } + + /** + * Prepare website Ids if applicable and if they were set as string in comma separated format. + * Backwards compatibility. + */ + if ($this->hasWebsiteIds()) { + $websiteIds = $this->getWebsiteIds(); + if (is_string($websiteIds) && !empty($websiteIds)) { + $this->setWebsiteIds(explode(',', $websiteIds)); + } + } + + /** + * Prepare customer group Ids if applicable and if they were set as string in comma separated format. + * Backwards compatibility. + */ + if ($this->hasCustomerGroupIds()) { + $groupIds = $this->getCustomerGroupIds(); + if (is_string($groupIds) && !empty($groupIds)) { + $this->setCustomerGroupIds(explode(',', $groupIds)); + } + } + + parent::_beforeSave(); + return $this; + } + + /** + * Set rule combine conditions model + * + * @param Mage_Rule_Model_Condition_Combine $conditions + * + * @return Mage_Rule_Model_Abstract + */ + public function setConditions($conditions) + { + $this->_conditions = $conditions; + return $this; + } + + /** + * Retrieve rule combine conditions model + * + * @return Mage_Rule_Model_Condition_Combine + */ + public function getConditions() + { + if (empty($this->_conditions)) { + $this->_resetConditions(); + } + + // Load rule conditions if it is applicable + if ($this->hasConditionsSerialized()) { + $conditions = $this->getConditionsSerialized(); + if (!empty($conditions)) { + $conditions = unserialize($conditions); + if (is_array($conditions) && !empty($conditions)) { + $this->_conditions->loadArray($conditions); + } + } + $this->unsConditionsSerialized(); + } + + return $this->_conditions; + } + + /** + * Set rule actions model + * + * @param Mage_Rule_Model_Action_Collection $actions + * + * @return Mage_Rule_Model_Abstract + */ + public function setActions($actions) + { + $this->_actions = $actions; + return $this; + } + + /** + * Retrieve rule actions model + * + * @return Mage_Rule_Model_Action_Collection + */ + public function getActions() + { + if (!$this->_actions) { + $this->_resetActions(); + } + + // Load rule actions if it is applicable + if ($this->hasActionsSerialized()) { + $actions = $this->getActionsSerialized(); + if (!empty($actions)) { + $actions = unserialize($actions); + if (is_array($actions) && !empty($actions)) { + $this->_actions->loadArray($actions); + } + } + $this->unsActionsSerialized(); + } + + return $this->_actions; + } + + /** + * Reset rule combine conditions + * + * @param null|Mage_Rule_Model_Condition_Combine $conditions + * + * @return Mage_Rule_Model_Abstract + */ + protected function _resetConditions($conditions = null) + { + if (is_null($conditions)) { + $conditions = $this->getConditionsInstance(); + } + $conditions->setRule($this)->setId('1')->setPrefix('conditions'); + $this->setConditions($conditions); + + return $this; + } + + /** + * Reset rule actions + * + * @param null|Mage_Rule_Model_Action_Collection $actions + * + * @return Mage_Rule_Model_Abstract + */ + protected function _resetActions($actions = null) + { + if (is_null($actions)) { + $actions = $this->getActionsInstance(); + } + $actions->setRule($this)->setId('1')->setPrefix('actions'); + $this->setActions($actions); + + return $this; + } + + /** + * Rule form getter + * + * @return Varien_Data_Form + */ + public function getForm() + { + if (!$this->_form) { + $this->_form = new Varien_Data_Form(); + } + return $this->_form; + } + + /** + * Initialize rule model data from array + * + * @param array $data + * + * @return Mage_Rule_Model_Abstract + */ + public function loadPost(array $data) + { + $arr = $this->_convertFlatToRecursive($data); + if (isset($arr['conditions'])) { + $this->getConditions()->setConditions(array())->loadArray($arr['conditions'][1]); + } + if (isset($arr['actions'])) { + $this->getActions()->setActions(array())->loadArray($arr['actions'][1], 'actions'); + } + + return $this; + } + + /** + * Set specified data to current rule. + * Set conditions and actions recursively. + * Convert dates into Zend_Date. + * + * @param array $data + * + * @return array + */ + protected function _convertFlatToRecursive(array $data) + { + $arr = array(); + foreach ($data as $key => $value) { + if (($key === 'conditions' || $key === 'actions') && is_array($value)) { + foreach ($value as $id=>$data) { + $path = explode('--', $id); + $node =& $arr; + for ($i=0, $l=sizeof($path); $i<$l; $i++) { + if (!isset($node[$key][$path[$i]])) { + $node[$key][$path[$i]] = array(); + } + $node =& $node[$key][$path[$i]]; + } + foreach ($data as $k => $v) { + $node[$k] = $v; + } + } + } else { + /** + * Convert dates into Zend_Date + */ + if (in_array($key, array('from_date', 'to_date')) && $value) { + $value = Mage::app()->getLocale()->date( + $value, + Varien_Date::DATE_INTERNAL_FORMAT, + null, + false + ); + } + $this->setData($key, $value); + } + } + + return $arr; + } + + /** + * Validate rule conditions to determine if rule can run + * + * @param Varien_Object $object + * + * @return bool + */ + public function validate(Varien_Object $object) + { + return $this->getConditions()->validate($object); + } + + /** + * Validate rule data + * + * @param Varien_Object $object + * + * @return bool|array - return true if validation passed successfully. Array with errors description otherwise + */ + public function validateData(Varien_Object $object) + { + $result = array(); + $fromDate = $toDate = null; + + if ($object->hasFromDate() && $object->hasToDate()) { + $fromDate = $object->getFromDate(); + $toDate = $object->getToDate(); + } + + if ($fromDate && $toDate) { + $fromDate = new Zend_Date($fromDate, Varien_Date::DATE_INTERNAL_FORMAT); + $toDate = new Zend_Date($toDate, Varien_Date::DATE_INTERNAL_FORMAT); + + if ($fromDate->compare($toDate) === 1) { + $result[] = Mage::helper('rule')->__('End Date must be greater than Start Date.'); + } + } + + if ($object->hasWebsiteIds()) { + $websiteIds = $object->getWebsiteIds(); + if (empty($websiteIds)) { + $result[] = Mage::helper('rule')->__('Websites must be specified.'); + } + } + if ($object->hasCustomerGroupIds()) { + $customerGroupIds = $object->getCustomerGroupIds(); + if (empty($customerGroupIds)) { + $result[] = Mage::helper('rule')->__('Customer Groups must be specified.'); + } + } + + return !empty($result) ? $result : true; + } + + /** + * Check availability to delete rule + * + * @return bool + */ + public function isDeleteable() + { + return $this->_isDeleteable; + } + + /** + * Set is rule can be deleted flag + * + * @param bool $value + * + * @return Mage_Rule_Model_Abstract + */ + public function setIsDeleteable($value) + { + $this->_isDeleteable = (bool) $value; + return $this; + } + + /** + * Check if rule is readonly + * + * @return bool + */ + public function isReadonly() + { + return $this->_isReadonly; + } + + /** + * Set is readonly flag to rule + * + * @param bool $value + * + * @return Mage_Rule_Model_Abstract + */ + public function setIsReadonly($value) + { + $this->_isReadonly = (bool) $value; + return $this; + } + + /** + * Get rule associated website Ids + * + * @return array + */ + public function getWebsiteIds() + { + if (!$this->hasWebsiteIds()) { + $websiteIds = $this->_getResource()->getWebsiteIds($this->getId()); + $this->setData('website_ids', (array)$websiteIds); + } + return $this->_getData('website_ids'); + } + + + + + /** + * @deprecated since 1.7.0.0 + * + * @param string $format + * + * @return string + */ + public function asString($format='') + { + return ''; + } + + /** + * @deprecated since 1.7.0.0 + * + * @return string + */ + public function asHtml() + { + return ''; + } + + /** + * Returns rule as an array for admin interface + * + * @deprecated since 1.7.0.0 + * + * @param array $arrAttributes + * + * @return array + */ + public function asArray(array $arrAttributes = array()) + { + return array(); + } + + /** + * Combine website ids to string + * + * @deprecated since 1.7.0.0 + * + * @return Mage_Rule_Model_Abstract + */ + protected function _prepareWebsiteIds() + { + return $this; + } +} diff --git a/app/code/core/Mage/Rule/Model/Action/Abstract.php b/app/code/core/Mage/Rule/Model/Action/Abstract.php index 6646a95e5e..22ab445fc6 100644 --- a/app/code/core/Mage/Rule/Model/Action/Abstract.php +++ b/app/code/core/Mage/Rule/Model/Action/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -61,7 +61,6 @@ public function asArray(array $arrAttributes = array()) public function asXml() { - extract($this->toArray()); $xml = "".$this->getType()."" ."".$this->getAttribute()."" ."".$this->getOperator()."" @@ -219,7 +218,8 @@ public function getAddLinkHtml() public function getRemoveLinkHtml() { $src = Mage::getDesign()->getSkinUrl('images/rule_component_remove.gif'); - $html = ''; + $html = ''; return $html; } diff --git a/app/code/core/Mage/Rule/Model/Action/Collection.php b/app/code/core/Mage/Rule/Model/Action/Collection.php index 5090e71786..4e66969bd1 100644 --- a/app/code/core/Mage/Rule/Model/Action/Collection.php +++ b/app/code/core/Mage/Rule/Model/Action/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rule/Model/Action/Interface.php b/app/code/core/Mage/Rule/Model/Action/Interface.php index 6710f98f0b..d65a3c8d33 100644 --- a/app/code/core/Mage/Rule/Model/Action/Interface.php +++ b/app/code/core/Mage/Rule/Model/Action/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rule/Model/Condition/Abstract.php b/app/code/core/Mage/Rule/Model/Condition/Abstract.php index 5646cc912e..3ab17afca5 100644 --- a/app/code/core/Mage/Rule/Model/Condition/Abstract.php +++ b/app/code/core/Mage/Rule/Model/Condition/Abstract.php @@ -20,14 +20,17 @@ * * @category Mage * @package Mage_Rule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** - * Abstract class for quote rule condition + * Abstract Rule condition data model * + * @category Mage + * @package Mage_Rule + * @author Magento Core Team */ abstract class Mage_Rule_Model_Condition_Abstract extends Varien_Object @@ -333,6 +336,11 @@ public function getValueName() return $value; } + /** + * Get inherited conditions selectors + * + * @return array + */ public function getNewChildSelectOptions() { return array( diff --git a/app/code/core/Mage/Rule/Model/Condition/Combine.php b/app/code/core/Mage/Rule/Model/Condition/Combine.php index 70e2a33327..f7de5f49de 100644 --- a/app/code/core/Mage/Rule/Model/Condition/Combine.php +++ b/app/code/core/Mage/Rule/Model/Condition/Combine.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rule/Model/Condition/Interface.php b/app/code/core/Mage/Rule/Model/Condition/Interface.php index d73bd79c1a..c3c449616d 100644 --- a/app/code/core/Mage/Rule/Model/Condition/Interface.php +++ b/app/code/core/Mage/Rule/Model/Condition/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rule/Model/Condition/Product/Abstract.php b/app/code/core/Mage/Rule/Model/Condition/Product/Abstract.php new file mode 100644 index 0000000000..28ba4dbe02 --- /dev/null +++ b/app/code/core/Mage/Rule/Model/Condition/Product/Abstract.php @@ -0,0 +1,516 @@ + + */ +abstract class Mage_Rule_Model_Condition_Product_Abstract extends Mage_Rule_Model_Condition_Abstract +{ + /** + * All attribute values as array in form: + * array( + * [entity_id_1] => array( + * [store_id_1] => store_value_1, + * [store_id_2] => store_value_2, + * ... + * [store_id_n] => store_value_n + * ), + * ... + * ) + * + * Will be set only for not global scope attribute + * + * @var array + */ + protected $_entityAttributeValues = null; + + /** + * Attribute data key that indicates whether it should be used for rules + * + * @var string + */ + protected $_isUsedForRuleProperty = 'is_used_for_promo_rules'; + + /** + * Customize default operator input by type mapper for some types + * + * @return array + */ + public function getDefaultOperatorInputByType() + { + if (null === $this->_defaultOperatorInputByType) { + parent::getDefaultOperatorInputByType(); + /* + * '{}' and '!{}' are left for back-compatibility and equal to '==' and '!=' + */ + $this->_defaultOperatorInputByType['category'] = array('==', '!=', '{}', '!{}', '()', '!()'); + $this->_arrayInputTypes[] = 'category'; + } + return $this->_defaultOperatorInputByType; + } + + /** + * Retrieve attribute object + * + * @return Mage_Catalog_Model_Resource_Eav_Attribute + */ + public function getAttributeObject() + { + try { + $obj = Mage::getSingleton('eav/config') + ->getAttribute(Mage_Catalog_Model_Product::ENTITY, $this->getAttribute()); + } + catch (Exception $e) { + $obj = new Varien_Object(); + $obj->setEntity(Mage::getResourceSingleton('catalog/product')) + ->setFrontendInput('text'); + } + return $obj; + } + + /** + * Add special attributes + * + * @param array $attributes + */ + protected function _addSpecialAttributes(array &$attributes) + { + $attributes['attribute_set_id'] = Mage::helper('catalogrule')->__('Attribute Set'); + $attributes['category_ids'] = Mage::helper('catalogrule')->__('Category'); + } + + /** + * Load attribute options + * + * @return Mage_CatalogRule_Model_Rule_Condition_Product + */ + public function loadAttributeOptions() + { + $productAttributes = Mage::getResourceSingleton('catalog/product') + ->loadAllAttributes() + ->getAttributesByCode(); + + $attributes = array(); + foreach ($productAttributes as $attribute) { + /* @var $attribute Mage_Catalog_Model_Resource_Eav_Attribute */ + if (!$attribute->isAllowedForRuleCondition() + || !$attribute->getDataUsingMethod($this->_isUsedForRuleProperty) + ) { + continue; + } + $attributes[$attribute->getAttributeCode()] = $attribute->getFrontendLabel(); + } + + $this->_addSpecialAttributes($attributes); + + asort($attributes); + $this->setAttributeOption($attributes); + + return $this; + } + + /** + * Prepares values options to be used as select options or hashed array + * Result is stored in following keys: + * 'value_select_options' - normal select array: array(array('value' => $value, 'label' => $label), ...) + * 'value_option' - hashed array: array($value => $label, ...), + * + * @return Mage_CatalogRule_Model_Rule_Condition_Product + */ + protected function _prepareValueOptions() + { + // Check that both keys exist. Maybe somehow only one was set not in this routine, but externally. + $selectReady = $this->getData('value_select_options'); + $hashedReady = $this->getData('value_option'); + if ($selectReady && $hashedReady) { + return $this; + } + + // Get array of select options. It will be used as source for hashed options + $selectOptions = null; + if ($this->getAttribute() === 'attribute_set_id') { + $entityTypeId = Mage::getSingleton('eav/config') + ->getEntityType(Mage_Catalog_Model_Product::ENTITY)->getId(); + $selectOptions = Mage::getResourceModel('eav/entity_attribute_set_collection') + ->setEntityTypeFilter($entityTypeId) + ->load() + ->toOptionArray(); + } else if (is_object($this->getAttributeObject())) { + $attributeObject = $this->getAttributeObject(); + if ($attributeObject->usesSource()) { + if ($attributeObject->getFrontendInput() == 'multiselect') { + $addEmptyOption = false; + } else { + $addEmptyOption = true; + } + $selectOptions = $attributeObject->getSource()->getAllOptions($addEmptyOption); + } + } + + // Set new values only if we really got them + if ($selectOptions !== null) { + // Overwrite only not already existing values + if (!$selectReady) { + $this->setData('value_select_options', $selectOptions); + } + if (!$hashedReady) { + $hashedOptions = array(); + foreach ($selectOptions as $o) { + if (is_array($o['value'])) { + continue; // We cannot use array as index + } + $hashedOptions[$o['value']] = $o['label']; + } + $this->setData('value_option', $hashedOptions); + } + } + + return $this; + } + + /** + * Retrieve value by option + * + * @param mixed $option + * @return string + */ + public function getValueOption($option=null) + { + $this->_prepareValueOptions(); + return $this->getData('value_option'.(!is_null($option) ? '/'.$option : '')); + } + + /** + * Retrieve select option values + * + * @return array + */ + public function getValueSelectOptions() + { + $this->_prepareValueOptions(); + return $this->getData('value_select_options'); + } + + /** + * Retrieve after element HTML + * + * @return string + */ + public function getValueAfterElementHtml() + { + $html = ''; + + switch ($this->getAttribute()) { + case 'sku': case 'category_ids': + $image = Mage::getDesign()->getSkinUrl('images/rule_chooser_trigger.gif'); + break; + } + + if (!empty($image)) { + $html = ''; + } + return $html; + } + + /** + * Retrieve attribute element + * + * @return Varien_Form_Element_Abstract + */ + public function getAttributeElement() + { + $element = parent::getAttributeElement(); + $element->setShowAsText(true); + return $element; + } + + /** + * Collect validated attributes + * + * @param Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection $productCollection + * @return Mage_CatalogRule_Model_Rule_Condition_Product + */ + public function collectValidatedAttributes($productCollection) + { + $attribute = $this->getAttribute(); + if ('category_ids' != $attribute) { + if ($this->getAttributeObject()->isScopeGlobal()) { + $attributes = $this->getRule()->getCollectedAttributes(); + $attributes[$attribute] = true; + $this->getRule()->setCollectedAttributes($attributes); + $productCollection->addAttributeToSelect($attribute, 'left'); + } else { + $this->_entityAttributeValues = $productCollection->getAllAttributeValues($attribute); + } + } + + return $this; + } + + /** + * Retrieve input type + * + * @return string + */ + public function getInputType() + { + if ($this->getAttribute()==='attribute_set_id') { + return 'select'; + } + if (!is_object($this->getAttributeObject())) { + return 'string'; + } + if ($this->getAttributeObject()->getAttributeCode() == 'category_ids') { + return 'category'; + } + switch ($this->getAttributeObject()->getFrontendInput()) { + case 'select': + return 'select'; + + case 'multiselect': + return 'multiselect'; + + case 'date': + return 'date'; + + case 'boolean': + return 'boolean'; + + default: + return 'string'; + } + } + + /** + * Retrieve value element type + * + * @return string + */ + public function getValueElementType() + { + if ($this->getAttribute()==='attribute_set_id') { + return 'select'; + } + if (!is_object($this->getAttributeObject())) { + return 'text'; + } + switch ($this->getAttributeObject()->getFrontendInput()) { + case 'select': + case 'boolean': + return 'select'; + + case 'multiselect': + return 'multiselect'; + + case 'date': + return 'date'; + + default: + return 'text'; + } + } + + /** + * Retrieve value element + * + * @return Varien_Data_Form_Element_Abstract + */ + public function getValueElement() + { + $element = parent::getValueElement(); + if (is_object($this->getAttributeObject())) { + switch ($this->getAttributeObject()->getFrontendInput()) { + case 'date': + $element->setImage(Mage::getDesign()->getSkinUrl('images/grid-cal.gif')); + break; + } + } + + return $element; + } + + /** + * Retrieve value element chooser URL + * + * @return string + */ + public function getValueElementChooserUrl() + { + $url = false; + switch ($this->getAttribute()) { + case 'sku': case 'category_ids': + $url = 'adminhtml/promo_widget/chooser' + .'/attribute/'.$this->getAttribute(); + if ($this->getJsFormObject()) { + $url .= '/form/'.$this->getJsFormObject(); + } + break; + } + return $url!==false ? Mage::helper('adminhtml')->getUrl($url) : ''; + } + + /** + * Retrieve Explicit Apply + * + * @return bool + */ + public function getExplicitApply() + { + switch ($this->getAttribute()) { + case 'sku': case 'category_ids': + return true; + } + if (is_object($this->getAttributeObject())) { + switch ($this->getAttributeObject()->getFrontendInput()) { + case 'date': + return true; + } + } + return false; + } + + /** + * Load array + * + * @param array $arr + * @return Mage_CatalogRule_Model_Rule_Condition_Product + */ + public function loadArray($arr) + { + $this->setAttribute(isset($arr['attribute']) ? $arr['attribute'] : false); + $attribute = $this->getAttributeObject(); + + $isContainsOperator = !empty($arr['operator']) && in_array($arr['operator'], array('{}', '!{}')); + if ($attribute && $attribute->getBackendType() == 'decimal' && !$isContainsOperator) { + if (isset($arr['value'])) { + if (!empty($arr['operator']) + && in_array($arr['operator'], array('!()', '()')) + && false !== strpos($arr['value'], ',')) { + + $tmp = array(); + foreach (explode(',', $arr['value']) as $value) { + $tmp[] = Mage::app()->getLocale()->getNumber($value); + } + $arr['value'] = implode(',', $tmp); + } else { + $arr['value'] = Mage::app()->getLocale()->getNumber($arr['value']); + } + } else { + $arr['value'] = false; + } + $arr['is_value_parsed'] = isset($arr['is_value_parsed']) + ? Mage::app()->getLocale()->getNumber($arr['is_value_parsed']) : false; + } + + return parent::loadArray($arr); + } + + /** + * Validate product attrbute value for condition + * + * @param Varien_Object $object + * @return bool + */ + public function validate(Varien_Object $object) + { + $attrCode = $this->getAttribute(); + + if ('category_ids' == $attrCode) { + return $this->validateAttribute($object->getAvailableInCategories()); + } elseif (! isset($this->_entityAttributeValues[$object->getId()])) { + if (!$object->getResource()) { + return false; + } + $attr = $object->getResource()->getAttribute($attrCode); + + if ($attr && $attr->getBackendType() == 'datetime' && !is_int($this->getValue())) { + $this->setValue(strtotime($this->getValue())); + $value = strtotime($object->getData($attrCode)); + return $this->validateAttribute($value); + } + + if ($attr && $attr->getFrontendInput() == 'multiselect') { + $value = $object->getData($attrCode); + $value = strlen($value) ? explode(',', $value) : array(); + return $this->validateAttribute($value); + } + + return parent::validate($object); + } else { + $result = false; // any valid value will set it to TRUE + // remember old attribute state + $oldAttrValue = $object->hasData($attrCode) ? $object->getData($attrCode) : null; + + foreach ($this->_entityAttributeValues[$object->getId()] as $storeId => $value) { + $attr = $object->getResource()->getAttribute($attrCode); + if ($attr && $attr->getBackendType() == 'datetime') { + $value = strtotime($value); + } else if ($attr && $attr->getFrontendInput() == 'multiselect') { + $value = strlen($value) ? explode(',', $value) : array(); + } + + $object->setData($attrCode, $value); + $result |= parent::validate($object); + + if ($result) { + break; + } + } + + if (is_null($oldAttrValue)) { + $object->unsetData($attrCode); + } else { + $object->setData($attrCode, $oldAttrValue); + } + + return (bool) $result; + } + } + + /** + * Correct '==' and '!=' operators + * Categories can't be equal because product is included categories selected by administrator and in their parents + * + * @return string + */ + public function getOperatorForValidate() + { + $op = $this->getOperator(); + if ($this->getInputType() == 'category') { + if ($op == '==') { + $op = '{}'; + } elseif ($op == '!=') { + $op = '!{}'; + } + } + + return $op; + } +} diff --git a/app/code/core/Mage/Rule/Model/Environment.php b/app/code/core/Mage/Rule/Model/Environment.php index fffd91e5c7..3d6c512759 100644 --- a/app/code/core/Mage/Rule/Model/Environment.php +++ b/app/code/core/Mage/Rule/Model/Environment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rule/Model/Mysql4/Rule.php b/app/code/core/Mage/Rule/Model/Mysql4/Rule.php index dadaf8e2c2..83c0385a1d 100644 --- a/app/code/core/Mage/Rule/Model/Mysql4/Rule.php +++ b/app/code/core/Mage/Rule/Model/Mysql4/Rule.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rule/Model/Mysql4/Rule/Collection.php b/app/code/core/Mage/Rule/Model/Mysql4/Rule/Collection.php index 7345e30ac0..c594aa531d 100644 --- a/app/code/core/Mage/Rule/Model/Mysql4/Rule/Collection.php +++ b/app/code/core/Mage/Rule/Model/Mysql4/Rule/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rule/Model/Renderer/Actions.php b/app/code/core/Mage/Rule/Model/Renderer/Actions.php index 33d429a917..b2a4f0e187 100644 --- a/app/code/core/Mage/Rule/Model/Renderer/Actions.php +++ b/app/code/core/Mage/Rule/Model/Renderer/Actions.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rule/Model/Renderer/Conditions.php b/app/code/core/Mage/Rule/Model/Renderer/Conditions.php index 6eea670f1f..396a1749fb 100644 --- a/app/code/core/Mage/Rule/Model/Renderer/Conditions.php +++ b/app/code/core/Mage/Rule/Model/Renderer/Conditions.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rule/Model/Resource/Abstract.php b/app/code/core/Mage/Rule/Model/Resource/Abstract.php new file mode 100644 index 0000000000..e0a0ffdced --- /dev/null +++ b/app/code/core/Mage/Rule/Model/Resource/Abstract.php @@ -0,0 +1,250 @@ + + */ +abstract class Mage_Rule_Model_Resource_Abstract extends Mage_Core_Model_Resource_Db_Abstract +{ + /** + * Store associated with rule entities information map + * + * Example: + * array( + * 'entity_type1' => array( + * 'associations_table' => 'table_name', + * 'rule_id_field' => 'rule_id', + * 'entity_id_field' => 'entity_id' + * ), + * 'entity_type2' => array( + * 'associations_table' => 'table_name', + * 'rule_id_field' => 'rule_id', + * 'entity_id_field' => 'entity_id' + * ) + * .... + * ) + * + * @var array + */ + protected $_associatedEntitiesMap = array(); + + /** + * Prepare rule's active "from" and "to" dates + * + * @param Mage_Core_Model_Abstract $object + * + * @return Mage_Rule_Model_Resource_Abstract + */ + public function _beforeSave(Mage_Core_Model_Abstract $object) + { + if ($object->getFromDate() instanceof Zend_Date) { + $object->setFromDate($object->getFromDate()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT)); + } else { + $object->setFromDate(null); + } + + if ($object->getToDate() instanceof Zend_Date) { + $object->setToDate($object->getToDate()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT)); + } else { + $object->setToDate(null); + } + + parent::_beforeSave($object); + return $this; + } + + /** + * Bind specified rules to entities + * + * @param array|int|string $ruleIds + * @param array|int|string $entityIds + * @param string $entityType + * + * @return Mage_Rule_Model_Resource_Abstract + */ + public function bindRuleToEntity($ruleIds, $entityIds, $entityType) + { + if (empty($ruleIds) || empty($entityIds)) { + return $this; + } + $adapter = $this->_getWriteAdapter(); + $entityInfo = $this->_getAssociatedEntityInfo($entityType); + + if (!is_array($ruleIds)) { + $ruleIds = array((int) $ruleIds); + } + if (!is_array($entityIds)) { + $entityIds = array((int) $entityIds); + } + + $data = array(); + $count = 0; + + $adapter->beginTransaction(); + + try { + foreach ($ruleIds as $ruleId) { + foreach ($entityIds as $entityId) { + $data[] = array( + $entityInfo['entity_id_field'] => $entityId, + $entityInfo['rule_id_field'] => $ruleId + ); + $count++; + if (($count % 1000) == 0) { + $adapter->insertOnDuplicate( + $this->getTable($entityInfo['associations_table']), + $data, + array($entityInfo['rule_id_field']) + ); + $data = array(); + } + } + } + if (!empty($data)) { + $adapter->insertOnDuplicate( + $this->getTable($entityInfo['associations_table']), + $data, + array($entityInfo['rule_id_field']) + ); + } + + $adapter->delete($this->getTable($entityInfo['associations_table']), + $adapter->quoteInto($entityInfo['rule_id_field'] . ' IN (?) AND ', $ruleIds) . + $adapter->quoteInto($entityInfo['entity_id_field'] . ' NOT IN (?)', $entityIds) + ); + } catch (Exception $e) { + $adapter->rollback(); + throw $e; + + } + + $adapter->commit(); + + return $this; + } + + /** + * Unbind specified rules from entities + * + * @param array|int|string $ruleIds + * @param array|int|string $entityIds + * @param string $entityType + * + * @return Mage_Rule_Model_Resource_Abstract + */ + public function unbindRuleFromEntity($ruleIds = array(), $entityIds = array(), $entityType) + { + $writeAdapter = $this->_getWriteAdapter(); + $entityInfo = $this->_getAssociatedEntityInfo($entityType); + + if (!is_array($entityIds)) { + $entityIds = array((int) $entityIds); + } + if (!is_array($ruleIds)) { + $ruleIds = array((int) $ruleIds); + } + + $where = array(); + if (!empty($ruleIds)) { + $where[] = $writeAdapter->quoteInto($entityInfo['rule_id_field'] . ' IN (?)', $ruleIds); + } + if (!empty($entityIds)) { + $where[] = $writeAdapter->quoteInto($entityInfo['entity_id_field'] . ' IN (?)', $entityIds); + } + + $writeAdapter->delete($this->getTable($entityInfo['associations_table']), implode(' AND ', $where)); + + return $this; + } + + /** + * Retrieve rule's associated entity Ids by entity type + * + * @param int $ruleId + * @param string $entityType + * + * @return array + */ + public function getAssociatedEntityIds($ruleId, $entityType) + { + $entityInfo = $this->_getAssociatedEntityInfo($entityType); + + $select = $this->_getReadAdapter()->select() + ->from($this->getTable($entityInfo['associations_table']), array($entityInfo['entity_id_field'])) + ->where($entityInfo['rule_id_field'] . ' = ?', $ruleId); + + return $this->_getReadAdapter()->fetchCol($select); + } + + /** + * Retrieve website ids of specified rule + * + * @param int $ruleId + * @return array + */ + public function getWebsiteIds($ruleId) + { + return $this->getAssociatedEntityIds($ruleId, 'website'); + } + + /** + * Retrieve customer group ids of specified rule + * + * @param int $ruleId + * @return array + */ + public function getCustomerGroupIds($ruleId) + { + return $this->getAssociatedEntityIds($ruleId, 'customer_group'); + } + + /** + * Retrieve correspondent entity information (associations table name, columns names) + * of rule's associated entity by specified entity type + * + * @param string $entityType + * + * @return array + */ + protected function _getAssociatedEntityInfo($entityType) + { + if (isset($this->_associatedEntitiesMap[$entityType])) { + return $this->_associatedEntitiesMap[$entityType]; + } + + $e = Mage::exception( + 'Mage_Core', + Mage::helper('rule')->__( + 'There is no information about associated entity type "%s".', $entityType + ) + ); + throw $e; + } +} diff --git a/app/code/core/Mage/Rule/Model/Resource/Rule.php b/app/code/core/Mage/Rule/Model/Resource/Rule.php index 65334ce89a..730596fc4f 100755 --- a/app/code/core/Mage/Rule/Model/Resource/Rule.php +++ b/app/code/core/Mage/Rule/Model/Resource/Rule.php @@ -20,23 +20,24 @@ * * @category Mage * @package Mage_Rule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** - * Quote rule resource model + * Abstract Rule entity resource model * - * @category Mage - * @package Mage_Rule - * @author Magento Core Team + * @deprecated since 1.7.0.0 use Mage_Rule_Model_Resource_Abstract instead + * + * @category Mage + * @package Mage_Rule + * @author Magento Core Team */ -class Mage_Rule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_Abstract +class Mage_Rule_Model_Resource_Rule extends Mage_Rule_Model_Resource_Abstract { /** - * Define main table - * + * Initialize main table and table id field */ protected function _construct() { diff --git a/app/code/core/Mage/Rule/Model/Resource/Rule/Collection.php b/app/code/core/Mage/Rule/Model/Resource/Rule/Collection.php index f1560b694e..3c5bc2f672 100755 --- a/app/code/core/Mage/Rule/Model/Resource/Rule/Collection.php +++ b/app/code/core/Mage/Rule/Model/Resource/Rule/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -28,116 +28,13 @@ /** * Abstract rules collection to be extended * - * @category Mage - * @package Mage_Rule - * @author Magento Core Team + * @deprecated since 1.7.0.0 use Mage_Rule_Model_Resource_Rule_Collection_Abstract instead + * + * @category Mage + * @package Mage_Rule + * @author Magento Core Team */ -class Mage_Rule_Model_Resource_Rule_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract +class Mage_Rule_Model_Resource_Rule_Collection extends Mage_Rule_Model_Resource_Rule_Collection_Abstract { - /** - * Quote rule environment - * - * @var Mage_Rule_Model_Environment - */ - protected $_env; - - /** - * Define resource model and model - * - */ - protected function _construct() - { - $this->_init('rule/rule'); - } - - /** - * Set environment for all rules in collection - * - * @param Mage_Rule_Model_Environment $env - * @return Mage_Rule_Model_Resource_Rule_Collection - */ - public function setEnv(Mage_Rule_Model_Environment $env = null) - { - $this->_env = $env; - return $this; - } - - /** - * Retrieve environment for the rules in collection - * - * @return Mage_Rule_Model_Resource_Rule_Collection - */ - public function getEnv() - { - if (!$this->_env) { - $this->_env = Mage::getModel('core/rule_environment'); - $this->_env->collect(); - } - return $this->_env; - } - - /** - * Overload default addItem method to set environment for the rules - * - * @param Mage_Rule_Model_Abstract $rule - * @return Mage_Rule_Model_Resource_Rule_Collection - */ - public function addItem(Varien_Object $rule) - { - $rule->setEnv($this->getEnv())->setIsCollectionValidated(true); - parent::addItem($rule); - return $this; - } - - /** - * Set filter for the collection based on the environment - * - * @return Mage_Rule_Model_Resource_Rule_Collection - */ - public function setActiveFilter() - { - $e = $this->getEnv()->getData(); - - $this->addFieldToFilter('is_active', 1); - - if (!empty($e['now'])) { - if (!is_numeric($e['now'])) { - $e['now'] = strtotime($e['now']); - } - $now = date("Y-m-d H:i:s", $e['now']); - } else { - $now = date("Y-m-d H:i:s"); - } - - $this->addFieldToFilter('start_at', array('to'=>$now)); - $this->addFieldToFilter('expire_at', array('from'=>$now)); - - return $this; - } - - /** - * Process the quote with all the rules in collection - * - * @return Mage_Rule_Model_Resource_Rule_Collection - */ - public function process() - { - $rules = $this->getItems(); - foreach ($rules as $rule) { - $rule->process(); - if ($rule->getStopProcessingRules()) { - break; - } - } - return $this; - } - /** - * Walk across collection after load - * - */ - protected function _afterLoad() - { - $this->walk('afterLoad'); - } } diff --git a/app/code/core/Mage/Rule/Model/Resource/Rule/Collection/Abstract.php b/app/code/core/Mage/Rule/Model/Resource/Rule/Collection/Abstract.php new file mode 100644 index 0000000000..cc2f4c7ba9 --- /dev/null +++ b/app/code/core/Mage/Rule/Model/Resource/Rule/Collection/Abstract.php @@ -0,0 +1,237 @@ + + */ +abstract class Mage_Rule_Model_Resource_Rule_Collection_Abstract + extends Mage_Core_Model_Resource_Db_Collection_Abstract +{ + /** + * Store associated with rule entities information map + * + * Example: + * array( + * 'entity_type1' => array( + * 'associations_table' => 'table_name', + * 'rule_id_field' => 'rule_id', + * 'entity_id_field' => 'entity_id' + * ), + * 'entity_type2' => array( + * 'associations_table' => 'table_name', + * 'rule_id_field' => 'rule_id', + * 'entity_id_field' => 'entity_id' + * ) + * .... + * ) + * + * @var array + */ + protected $_associatedEntitiesMap = array(); + + /** + * Quote rule environment + * + * @deprecated after 1.6.1.0 + * + * @var Mage_Rule_Model_Environment + */ + protected $_env; + + /** + * Add website ids to rules data + * + * @return Mage_Rule_Model_Resource_Rule_Collection_Abstract + */ + protected function _afterLoad() + { + parent::_afterLoad(); + if ($this->getFlag('add_websites_to_result') && $this->_items) { + /** @var Mage_Rule_Model_Abstract $item */ + foreach ($this->_items as $item) { + $item->afterLoad(); + } + } + + return $this; + } + + /** + * Init flag for adding rule website ids to collection result + * + * @param bool|null $flag + * + * @return Mage_Rule_Model_Resource_Rule_Collection_Abstract + */ + public function addWebsitesToResult($flag = null) + { + $flag = ($flag === null) ? true : $flag; + $this->setFlag('add_websites_to_result', $flag); + return $this; + } + + /** + * Limit rules collection by specific websites + * + * @param int|array|Mage_Core_Model_Website $websiteId + * + * @return Mage_Rule_Model_Resource_Rule_Collection_Abstract + */ + public function addWebsiteFilter($websiteId) + { + $entityInfo = $this->_getAssociatedEntityInfo('website'); + if (!$this->getFlag('is_website_table_joined')) { + $this->setFlag('is_website_table_joined', true); + if ($websiteId instanceof Mage_Core_Model_Website) { + $websiteId = $websiteId->getId(); + } + + $subSelect = $this->getConnection()->select() + ->from(array('website' => $this->getTable($entityInfo['associations_table'])), '') + ->where('website.' . $entityInfo['entity_id_field'] . ' IN (?)', $websiteId); + $this->getSelect()->exists( + $subSelect, + 'main_table.' . $entityInfo['rule_id_field'] . ' = website.' . $entityInfo['rule_id_field'] + ); + } + return $this; + } + + /** + * Provide support for website id filter + * + * @param string $field + * @param mixed $condition + * + * @return Mage_Rule_Model_Resource_Rule_Collection_Abstract + */ + public function addFieldToFilter($field, $condition = null) + { + if ($field == 'website_ids') { + return $this->addWebsiteFilter($condition); + } + + parent::addFieldToFilter($field, $condition); + return $this; + } + + /** + * Filter collection to only active or inactive rules + * + * @param int $isActive + * + * @return Mage_Rule_Model_Resource_Rule_Collection_Abstract + */ + public function addIsActiveFilter($isActive = 1) + { + if (!$this->getFlag('is_active_filter')) { + $this->addFieldToFilter('is_active', (int)$isActive ? 1 : 0); + $this->setFlag('is_active_filter', true); + } + return $this; + } + + /** + * Retrieve correspondent entity information (associations table name, columns names) + * of rule's associated entity by specified entity type + * + * @param string $entityType + * + * @return array + */ + protected function _getAssociatedEntityInfo($entityType) + { + if (isset($this->_associatedEntitiesMap[$entityType])) { + return $this->_associatedEntitiesMap[$entityType]; + } + + $e = Mage::exception( + 'Mage_Core', + Mage::helper('rule')->__( + 'There is no information about associated entity type "%s".', $entityType + ) + ); + throw $e; + } + + + + + + /** + * Set environment for all rules in collection + * + * @deprecated after 1.6.2.0 + * + * @param Mage_Rule_Model_Environment $env + * @return Mage_Rule_Model_Resource_Rule_Collection_Abstract + */ + public function setEnv(Mage_Rule_Model_Environment $env = null) + { + $this->_env = $env; + return $this; + } + + /** + * Retrieve environment for the rules in collection + * + * @deprecated after 1.6.2.0 + * + * @return Mage_Rule_Model_Resource_Rule_Collection_Abstract + */ + public function getEnv() + { + return $this->_env; + } + + /** + * Set filter for the collection based on the environment + * + * @deprecated after 1.6.2.0 + * + * @return Mage_Rule_Model_Resource_Rule_Collection_Abstract + */ + public function setActiveFilter() + { + return $this; + } + + /** + * Process the quote with all the rules in collection + * + * @deprecated after 1.6.2.0 + * + * @return Mage_Rule_Model_Resource_Rule_Collection_Abstract + */ + public function process() + { + return $this; + } +} diff --git a/app/code/core/Mage/Rule/Model/Rule.php b/app/code/core/Mage/Rule/Model/Rule.php index c3671a3040..411e52c7f6 100644 --- a/app/code/core/Mage/Rule/Model/Rule.php +++ b/app/code/core/Mage/Rule/Model/Rule.php @@ -20,355 +20,38 @@ * * @category Mage * @package Mage_Rule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -class Mage_Rule_Model_Rule extends Mage_Core_Model_Abstract +/** + * Abstract Rule entity data model + * + * @deprecated since 1.7.0.0 use Mage_Rule_Model_Abstract instead + * + * @category Mage + * @package Mage_Rule + * @author Magento Core Team + */ +class Mage_Rule_Model_Rule extends Mage_Rule_Model_Abstract { - protected $_conditions; - protected $_actions; - protected $_form; - - /** - * Is model deleteable - * - * @var boolean - */ - protected $_isDeleteable = true; - - /** - * Is model readonly - * - * @var boolean - */ - protected $_isReadonly = false; - /** - * Init resoirce + * Getter for rule combine conditions instance * - * @return unknown_type + * @return Mage_Rule_Model_Condition_Combine */ - protected function _construct() - { - $this->_init('rule/rule'); - parent::_construct(); - } - public function getConditionsInstance() { return Mage::getModel('rule/condition_combine'); } - public function _resetConditions($conditions=null) - { - if (is_null($conditions)) { - $conditions = $this->getConditionsInstance(); - } - $conditions->setRule($this)->setId('1')->setPrefix('conditions'); - $this->setConditions($conditions); - - return $this; - } - - public function setConditions($conditions) - { - $this->_conditions = $conditions; - return $this; - } - /** - * Retrieve Condition model + * Getter for rule actions collection instance * - * @return Mage_SalesRule_Model_Rule_Condition_Combine - */ - public function getConditions() - { - if (empty($this->_conditions)) { - $this->_resetConditions(); - } - return $this->_conditions; - } - - /** * @return Mage_Rule_Model_Action_Collection */ public function getActionsInstance() { return Mage::getModel('rule/action_collection'); } - - /** - * @param Mage_Rule_Model_Action_Collection $actions - * @return Mage_Rule_Model_Rule - */ - public function _resetActions($actions = null) - { - if (is_null($actions)) { - $actions = $this->getActionsInstance(); - } - $actions->setRule($this)->setId('1')->setPrefix('actions'); - $this->setActions($actions); - - return $this; - } - - public function setActions($actions) - { - $this->_actions = $actions; - return $this; - } - - public function getActions() - { - if (!$this->_actions) { - $this->_resetActions(); - } - return $this->_actions; - } - - public function getForm() - { - if (!$this->_form) { - $this->_form = new Varien_Data_Form(); - } - return $this->_form; - } - - public function asString($format='') - { - $str = Mage::helper('rule')->__("Name: %s", $this->getName()) ."\n" - . Mage::helper('rule')->__("Start at: %s", $this->getStartAt()) ."\n" - . Mage::helper('rule')->__("Expire at: %s", $this->getExpireAt()) ."\n" - . Mage::helper('rule')->__("Description: %s", $this->getDescription()) ."\n\n" - . $this->getConditions()->asStringRecursive() ."\n\n" - . $this->getActions()->asStringRecursive() ."\n\n"; - return $str; - } - - public function asHtml() - { - $str = Mage::helper('rule')->__("Name: %s", $this->getName()) ."
    " - . Mage::helper('rule')->__("Start at: %s", $this->getStartAt()) ."
    " - . Mage::helper('rule')->__("Expire at: %s", $this->getExpireAt()) ."
    " - . Mage::helper('rule')->__("Description: %s", $this->getDescription()) .'
    ' - . '
      '.$this->getConditions()->asHtmlRecursive().'
    ' - . '
      '.$this->getActions()->asHtmlRecursive()."
    "; - return $str; - } - - public function loadPost(array $rule) - { - $arr = $this->_convertFlatToRecursive($rule); - if (isset($arr['conditions'])) { - $this->getConditions()->setConditions(array())->loadArray($arr['conditions'][1]); - } - if (isset($arr['actions'])) { - $this->getActions()->setActions(array())->loadArray($arr['actions'][1]); - } - - return $this; - } - - protected function _convertFlatToRecursive(array $rule) - { - $arr = array(); - foreach ($rule as $key=>$value) { - if (($key==='conditions' || $key==='actions') && is_array($value)) { - foreach ($value as $id=>$data) { - $path = explode('--', $id); - $node =& $arr; - for ($i=0, $l=sizeof($path); $i<$l; $i++) { - if (!isset($node[$key][$path[$i]])) { - $node[$key][$path[$i]] = array(); - } - $node =& $node[$key][$path[$i]]; - } - foreach ($data as $k=>$v) { - $node[$k] = $v; - } - } - } else { - /** - * convert dates into Zend_Date - */ - if (in_array($key, array('from_date', 'to_date')) && $value) { - $value = Mage::app()->getLocale()->date( - $value, - Varien_Date::DATE_INTERNAL_FORMAT, - null, - false - ); - } - $this->setData($key, $value); - } - } - return $arr; - } - - /** - * Returns rule as an array for admin interface - * - * Output example: - * array( - * 'name'=>'Example rule', - * 'conditions'=>{condition_combine::asArray} - * 'actions'=>{action_collection::asArray} - * ) - * - * @return array - */ - public function asArray(array $arrAttributes = array()) - { - $out = array( - 'name'=>$this->getName(), - 'start_at'=>$this->getStartAt(), - 'expire_at'=>$this->getExpireAt(), - 'description'=>$this->getDescription(), - 'conditions'=>$this->getConditions()->asArray(), - 'actions'=>$this->getActions()->asArray(), - ); - - return $out; - } - - public function validate(Varien_Object $object) - { - return $this->getConditions()->validate($object); - } - - public function afterLoad() - { - $this->_afterLoad(); - } - - protected function _afterLoad() - { - parent::_afterLoad(); - $conditionsArr = unserialize($this->getConditionsSerialized()); - if (!empty($conditionsArr) && is_array($conditionsArr)) { - $this->getConditions()->loadArray($conditionsArr); - } - - $actionsArr = unserialize($this->getActionsSerialized()); - if (!empty($actionsArr) && is_array($actionsArr)) { - $this->getActions()->loadArray($actionsArr); - } - - $websiteIds = $this->_getData('website_ids'); - if (is_string($websiteIds)) { - $this->setWebsiteIds(explode(',', $websiteIds)); - } - $groupIds = $this->getCustomerGroupIds(); - if (is_string($groupIds)) { - $this->setCustomerGroupIds(explode(',', $groupIds)); - } - } - - /** - * Prepare data before saving - * - * @return Mage_Rule_Model_Rule - */ - protected function _beforeSave() - { - // check if discount amount > 0 - if ((int)$this->getDiscountAmount() < 0) { - Mage::throwException(Mage::helper('rule')->__('Invalid discount amount.')); - } - - - if ($this->getConditions()) { - $this->setConditionsSerialized(serialize($this->getConditions()->asArray())); - $this->unsConditions(); - } - if ($this->getActions()) { - $this->setActionsSerialized(serialize($this->getActions()->asArray())); - $this->unsActions(); - } - - $this->_prepareWebsiteIds(); - - if (is_array($this->getCustomerGroupIds())) { - $this->setCustomerGroupIds(join(',', $this->getCustomerGroupIds())); - } - parent::_beforeSave(); - } - - /** - * Combain website ids to string - * - * @return Mage_Rule_Model_Rule - */ - protected function _prepareWebsiteIds() - { - if (is_array($this->getWebsiteIds())) { - $this->setWebsiteIds(join(',', $this->getWebsiteIds())); - } - return $this; - } - - /** - * Check availabitlity to delete model - * - * @return boolean - */ - public function isDeleteable() - { - return $this->_isDeleteable; - } - - /** - * Set is deleteable flag - * - * @param boolean $flag - * @return Mage_Rule_Model_Rule - */ - public function setIsDeleteable($flag) - { - $this->_isDeleteable = (bool) $flag; - return $this; - } - - - /** - * Checks model is readonly - * - * @return boolean - */ - public function isReadonly() - { - return $this->_isReadonly; - } - - /** - * Set is readonly flag - * - * @param boolean $value - * @return Mage_Rule_Model_Rule - */ - public function setIsReadonly($value) - { - $this->_isReadonly = (boolean) $value; - return $this; - } - - /** - * Validates data for rule - * @param Varien_Object $object - * @returns boolean|array - returns true if validation passed successfully. Array with error - * description otherwise - */ - public function validateData(Varien_Object $object) - { - if ($object->getData('from_date') && $object->getData('to_date')) { - $dateStart = new Zend_Date($object->getData('from_date'), Varien_Date::DATE_INTERNAL_FORMAT); - $dateEnd = new Zend_Date($object->getData('to_date'), Varien_Date::DATE_INTERNAL_FORMAT); - - if ($dateStart->compare($dateEnd)===1) { - return array(Mage::helper('rule')->__("End Date should be greater than Start Date")); - } - } - return true; - } } diff --git a/app/code/core/Mage/Rule/etc/config.xml b/app/code/core/Mage/Rule/etc/config.xml index 8676009cf1..382c0925df 100644 --- a/app/code/core/Mage/Rule/etc/config.xml +++ b/app/code/core/Mage/Rule/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Rule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement.php b/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement.php index 3547b264d0..920cf3dfa3 100644 --- a/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement.php +++ b/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/Grid.php b/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/Grid.php index 7819615365..63e166af99 100644 --- a/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/Grid.php +++ b/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/View.php b/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/View.php index f767e67f51..1a5ff9c633 100644 --- a/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/View.php +++ b/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/View.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/View/Form.php b/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/View/Form.php index d62bedd231..ccf32aa477 100644 --- a/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/View/Form.php +++ b/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/View/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/View/Tab/Info.php b/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/View/Tab/Info.php index 97a0adeb1d..90173cbebb 100644 --- a/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/View/Tab/Info.php +++ b/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/View/Tab/Info.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/View/Tab/Orders.php b/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/View/Tab/Orders.php index 5ae0e99a3b..29944d2f4a 100644 --- a/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/View/Tab/Orders.php +++ b/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/View/Tab/Orders.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/View/Tabs.php b/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/View/Tabs.php index e85b2d8670..4abbd3a907 100644 --- a/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/View/Tabs.php +++ b/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/View/Tabs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Adminhtml/Customer/Edit/Tab/Agreement.php b/app/code/core/Mage/Sales/Block/Adminhtml/Customer/Edit/Tab/Agreement.php index d420dac074..bce75ca91d 100644 --- a/app/code/core/Mage/Sales/Block/Adminhtml/Customer/Edit/Tab/Agreement.php +++ b/app/code/core/Mage/Sales/Block/Adminhtml/Customer/Edit/Tab/Agreement.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Adminhtml/Customer/Edit/Tab/Recurring/Profile.php b/app/code/core/Mage/Sales/Block/Adminhtml/Customer/Edit/Tab/Recurring/Profile.php index 1a89433237..0ac484ffd9 100644 --- a/app/code/core/Mage/Sales/Block/Adminhtml/Customer/Edit/Tab/Recurring/Profile.php +++ b/app/code/core/Mage/Sales/Block/Adminhtml/Customer/Edit/Tab/Recurring/Profile.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile.php b/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile.php index 0c3d7ff7ca..065a70fe79 100644 --- a/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile.php +++ b/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/Edit/Form.php b/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/Edit/Form.php index 0672a3f9ac..be81c0f6c8 100644 --- a/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/Edit/Form.php +++ b/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/Grid.php b/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/Grid.php index 5804b69a18..f23273d9fc 100644 --- a/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/Grid.php +++ b/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/View.php b/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/View.php index 1f511bcbbf..36a4ec4980 100644 --- a/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/View.php +++ b/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/View.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/View/Getawayinfo.php b/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/View/Getawayinfo.php index 6251d4e375..71ccbfb0ed 100644 --- a/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/View/Getawayinfo.php +++ b/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/View/Getawayinfo.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/View/Info.php b/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/View/Info.php index 94c50a0e33..b706a1d269 100644 --- a/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/View/Info.php +++ b/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/View/Info.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/View/Items.php b/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/View/Items.php index 55b2ff2e68..4fcc4b8260 100644 --- a/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/View/Items.php +++ b/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/View/Items.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/View/Tab/Info.php b/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/View/Tab/Info.php index 9741f9d486..f541fc6c22 100644 --- a/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/View/Tab/Info.php +++ b/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/View/Tab/Info.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/View/Tab/Orders.php b/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/View/Tab/Orders.php index d56f5bf89e..91f89ec2bd 100644 --- a/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/View/Tab/Orders.php +++ b/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/View/Tab/Orders.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Adminhtml/Report/Filter/Form.php b/app/code/core/Mage/Sales/Block/Adminhtml/Report/Filter/Form.php index 1b8e600007..abbeef8d87 100644 --- a/app/code/core/Mage/Sales/Block/Adminhtml/Report/Filter/Form.php +++ b/app/code/core/Mage/Sales/Block/Adminhtml/Report/Filter/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Adminhtml/Report/Filter/Form/Coupon.php b/app/code/core/Mage/Sales/Block/Adminhtml/Report/Filter/Form/Coupon.php index bb35aa56b2..8a402f56f4 100644 --- a/app/code/core/Mage/Sales/Block/Adminhtml/Report/Filter/Form/Coupon.php +++ b/app/code/core/Mage/Sales/Block/Adminhtml/Report/Filter/Form/Coupon.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Adminhtml/Report/Filter/Form/Order.php b/app/code/core/Mage/Sales/Block/Adminhtml/Report/Filter/Form/Order.php index 8d3e91e459..eae509873c 100644 --- a/app/code/core/Mage/Sales/Block/Adminhtml/Report/Filter/Form/Order.php +++ b/app/code/core/Mage/Sales/Block/Adminhtml/Report/Filter/Form/Order.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Billing/Agreement/View.php b/app/code/core/Mage/Sales/Block/Billing/Agreement/View.php index f5a77406c0..1eda9f6570 100644 --- a/app/code/core/Mage/Sales/Block/Billing/Agreement/View.php +++ b/app/code/core/Mage/Sales/Block/Billing/Agreement/View.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Billing/Agreements.php b/app/code/core/Mage/Sales/Block/Billing/Agreements.php index 07b27b35eb..785f235f6d 100644 --- a/app/code/core/Mage/Sales/Block/Billing/Agreements.php +++ b/app/code/core/Mage/Sales/Block/Billing/Agreements.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Guest/Links.php b/app/code/core/Mage/Sales/Block/Guest/Links.php index 64d9ed555b..eb7f8fbb64 100644 --- a/app/code/core/Mage/Sales/Block/Guest/Links.php +++ b/app/code/core/Mage/Sales/Block/Guest/Links.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Items/Abstract.php b/app/code/core/Mage/Sales/Block/Items/Abstract.php index cfa69e03eb..cc4cb83273 100644 --- a/app/code/core/Mage/Sales/Block/Items/Abstract.php +++ b/app/code/core/Mage/Sales/Block/Items/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Order/Comments.php b/app/code/core/Mage/Sales/Block/Order/Comments.php index 0b702f2665..0698380287 100644 --- a/app/code/core/Mage/Sales/Block/Order/Comments.php +++ b/app/code/core/Mage/Sales/Block/Order/Comments.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Sales_Block_Order_Comments extends Mage_Core_Block_Template diff --git a/app/code/core/Mage/Sales/Block/Order/Creditmemo.php b/app/code/core/Mage/Sales/Block/Order/Creditmemo.php index 47d7c7b5f7..31a7ef19a5 100644 --- a/app/code/core/Mage/Sales/Block/Order/Creditmemo.php +++ b/app/code/core/Mage/Sales/Block/Order/Creditmemo.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Order/Creditmemo/Items.php b/app/code/core/Mage/Sales/Block/Order/Creditmemo/Items.php index 3ae64dafd5..bd70d99773 100644 --- a/app/code/core/Mage/Sales/Block/Order/Creditmemo/Items.php +++ b/app/code/core/Mage/Sales/Block/Order/Creditmemo/Items.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Order/Creditmemo/Totals.php b/app/code/core/Mage/Sales/Block/Order/Creditmemo/Totals.php index 63786743d2..eec15716ae 100644 --- a/app/code/core/Mage/Sales/Block/Order/Creditmemo/Totals.php +++ b/app/code/core/Mage/Sales/Block/Order/Creditmemo/Totals.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Sales_Block_Order_Creditmemo_Totals extends Mage_Sales_Block_Order_Totals diff --git a/app/code/core/Mage/Sales/Block/Order/Details.php b/app/code/core/Mage/Sales/Block/Order/Details.php index 8a0c227175..1378113bab 100644 --- a/app/code/core/Mage/Sales/Block/Order/Details.php +++ b/app/code/core/Mage/Sales/Block/Order/Details.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Order/Email/Creditmemo/Items.php b/app/code/core/Mage/Sales/Block/Order/Email/Creditmemo/Items.php index b73c865c6a..f1c4142665 100644 --- a/app/code/core/Mage/Sales/Block/Order/Email/Creditmemo/Items.php +++ b/app/code/core/Mage/Sales/Block/Order/Email/Creditmemo/Items.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Order/Email/Invoice/Items.php b/app/code/core/Mage/Sales/Block/Order/Email/Invoice/Items.php index 06dce45691..44af585547 100644 --- a/app/code/core/Mage/Sales/Block/Order/Email/Invoice/Items.php +++ b/app/code/core/Mage/Sales/Block/Order/Email/Invoice/Items.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Order/Email/Items.php b/app/code/core/Mage/Sales/Block/Order/Email/Items.php index 9b7e8f0b00..a2660a7ad0 100644 --- a/app/code/core/Mage/Sales/Block/Order/Email/Items.php +++ b/app/code/core/Mage/Sales/Block/Order/Email/Items.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Order/Email/Items/Default.php b/app/code/core/Mage/Sales/Block/Order/Email/Items/Default.php index 5ac17d2743..43227b166e 100644 --- a/app/code/core/Mage/Sales/Block/Order/Email/Items/Default.php +++ b/app/code/core/Mage/Sales/Block/Order/Email/Items/Default.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Order/Email/Items/Order/Default.php b/app/code/core/Mage/Sales/Block/Order/Email/Items/Order/Default.php index 41eaf71763..3e94544873 100644 --- a/app/code/core/Mage/Sales/Block/Order/Email/Items/Order/Default.php +++ b/app/code/core/Mage/Sales/Block/Order/Email/Items/Order/Default.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Order/Email/Items/Order/Grouped.php b/app/code/core/Mage/Sales/Block/Order/Email/Items/Order/Grouped.php index f428016dc6..1c6dcf7563 100644 --- a/app/code/core/Mage/Sales/Block/Order/Email/Items/Order/Grouped.php +++ b/app/code/core/Mage/Sales/Block/Order/Email/Items/Order/Grouped.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Order/Email/Shipment/Items.php b/app/code/core/Mage/Sales/Block/Order/Email/Shipment/Items.php index 9250f29f6b..9b681a7763 100644 --- a/app/code/core/Mage/Sales/Block/Order/Email/Shipment/Items.php +++ b/app/code/core/Mage/Sales/Block/Order/Email/Shipment/Items.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Order/History.php b/app/code/core/Mage/Sales/Block/Order/History.php index 45da66ea55..022e5ced72 100644 --- a/app/code/core/Mage/Sales/Block/Order/History.php +++ b/app/code/core/Mage/Sales/Block/Order/History.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Order/Info.php b/app/code/core/Mage/Sales/Block/Order/Info.php index 405f61c6de..e6f716ec8b 100644 --- a/app/code/core/Mage/Sales/Block/Order/Info.php +++ b/app/code/core/Mage/Sales/Block/Order/Info.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Order/Info/Buttons.php b/app/code/core/Mage/Sales/Block/Order/Info/Buttons.php index ee835f2d41..9583aa9bad 100644 --- a/app/code/core/Mage/Sales/Block/Order/Info/Buttons.php +++ b/app/code/core/Mage/Sales/Block/Order/Info/Buttons.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Order/Invoice.php b/app/code/core/Mage/Sales/Block/Order/Invoice.php index b9d930ac54..b664b77a96 100644 --- a/app/code/core/Mage/Sales/Block/Order/Invoice.php +++ b/app/code/core/Mage/Sales/Block/Order/Invoice.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Order/Invoice/Items.php b/app/code/core/Mage/Sales/Block/Order/Invoice/Items.php index 9788ff9732..6774b4c2ca 100644 --- a/app/code/core/Mage/Sales/Block/Order/Invoice/Items.php +++ b/app/code/core/Mage/Sales/Block/Order/Invoice/Items.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Order/Invoice/Totals.php b/app/code/core/Mage/Sales/Block/Order/Invoice/Totals.php index 9ce722c101..dc1d42276d 100644 --- a/app/code/core/Mage/Sales/Block/Order/Invoice/Totals.php +++ b/app/code/core/Mage/Sales/Block/Order/Invoice/Totals.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Sales_Block_Order_Invoice_Totals extends Mage_Sales_Block_Order_Totals diff --git a/app/code/core/Mage/Sales/Block/Order/Item/Renderer/Default.php b/app/code/core/Mage/Sales/Block/Order/Item/Renderer/Default.php index e9306fe472..0447a81112 100644 --- a/app/code/core/Mage/Sales/Block/Order/Item/Renderer/Default.php +++ b/app/code/core/Mage/Sales/Block/Order/Item/Renderer/Default.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Order/Item/Renderer/Grouped.php b/app/code/core/Mage/Sales/Block/Order/Item/Renderer/Grouped.php index 479141996c..519bfed984 100644 --- a/app/code/core/Mage/Sales/Block/Order/Item/Renderer/Grouped.php +++ b/app/code/core/Mage/Sales/Block/Order/Item/Renderer/Grouped.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Order/Items.php b/app/code/core/Mage/Sales/Block/Order/Items.php index 688e756e33..9d08b56732 100644 --- a/app/code/core/Mage/Sales/Block/Order/Items.php +++ b/app/code/core/Mage/Sales/Block/Order/Items.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Order/Print.php b/app/code/core/Mage/Sales/Block/Order/Print.php index 6def8989a2..098da7ced8 100644 --- a/app/code/core/Mage/Sales/Block/Order/Print.php +++ b/app/code/core/Mage/Sales/Block/Order/Print.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Order/Print/Creditmemo.php b/app/code/core/Mage/Sales/Block/Order/Print/Creditmemo.php index 70c0da09be..9929aacc35 100644 --- a/app/code/core/Mage/Sales/Block/Order/Print/Creditmemo.php +++ b/app/code/core/Mage/Sales/Block/Order/Print/Creditmemo.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Order/Print/Invoice.php b/app/code/core/Mage/Sales/Block/Order/Print/Invoice.php index 9055e7acaf..88be559f5d 100644 --- a/app/code/core/Mage/Sales/Block/Order/Print/Invoice.php +++ b/app/code/core/Mage/Sales/Block/Order/Print/Invoice.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Order/Print/Shipment.php b/app/code/core/Mage/Sales/Block/Order/Print/Shipment.php index 3fc11007ae..d3dbc5536c 100644 --- a/app/code/core/Mage/Sales/Block/Order/Print/Shipment.php +++ b/app/code/core/Mage/Sales/Block/Order/Print/Shipment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Order/Recent.php b/app/code/core/Mage/Sales/Block/Order/Recent.php index 651e9d3938..3254bb7413 100644 --- a/app/code/core/Mage/Sales/Block/Order/Recent.php +++ b/app/code/core/Mage/Sales/Block/Order/Recent.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Order/Shipment.php b/app/code/core/Mage/Sales/Block/Order/Shipment.php index 110ac66b4d..7ed147ecb6 100644 --- a/app/code/core/Mage/Sales/Block/Order/Shipment.php +++ b/app/code/core/Mage/Sales/Block/Order/Shipment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Order/Shipment/Items.php b/app/code/core/Mage/Sales/Block/Order/Shipment/Items.php index 207c107b62..cdfcc32c18 100644 --- a/app/code/core/Mage/Sales/Block/Order/Shipment/Items.php +++ b/app/code/core/Mage/Sales/Block/Order/Shipment/Items.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Order/Tax.php b/app/code/core/Mage/Sales/Block/Order/Tax.php index b35ec8bc4b..47f8b77916 100644 --- a/app/code/core/Mage/Sales/Block/Order/Tax.php +++ b/app/code/core/Mage/Sales/Block/Order/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Order/Totals.php b/app/code/core/Mage/Sales/Block/Order/Totals.php index 9517876a95..26c9e6d28c 100644 --- a/app/code/core/Mage/Sales/Block/Order/Totals.php +++ b/app/code/core/Mage/Sales/Block/Order/Totals.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Sales_Block_Order_Totals extends Mage_Core_Block_Template diff --git a/app/code/core/Mage/Sales/Block/Order/View.php b/app/code/core/Mage/Sales/Block/Order/View.php index 6d5120862a..1bad8073a3 100644 --- a/app/code/core/Mage/Sales/Block/Order/View.php +++ b/app/code/core/Mage/Sales/Block/Order/View.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Payment/Form/Billing/Agreement.php b/app/code/core/Mage/Sales/Block/Payment/Form/Billing/Agreement.php index d31c3c9e7c..ac02497f8c 100644 --- a/app/code/core/Mage/Sales/Block/Payment/Form/Billing/Agreement.php +++ b/app/code/core/Mage/Sales/Block/Payment/Form/Billing/Agreement.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Payment/Info/Billing/Agreement.php b/app/code/core/Mage/Sales/Block/Payment/Info/Billing/Agreement.php index 7c352ccfbf..b64bc9e0b1 100644 --- a/app/code/core/Mage/Sales/Block/Payment/Info/Billing/Agreement.php +++ b/app/code/core/Mage/Sales/Block/Payment/Info/Billing/Agreement.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Recurring/Profile/View.php b/app/code/core/Mage/Sales/Block/Recurring/Profile/View.php index 5c3da9007a..f563c9ed82 100644 --- a/app/code/core/Mage/Sales/Block/Recurring/Profile/View.php +++ b/app/code/core/Mage/Sales/Block/Recurring/Profile/View.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Recurring/Profiles.php b/app/code/core/Mage/Sales/Block/Recurring/Profiles.php index 5977fc60aa..801916b025 100644 --- a/app/code/core/Mage/Sales/Block/Recurring/Profiles.php +++ b/app/code/core/Mage/Sales/Block/Recurring/Profiles.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Reorder/Sidebar.php b/app/code/core/Mage/Sales/Block/Reorder/Sidebar.php index 923dc36b6c..0382a06473 100644 --- a/app/code/core/Mage/Sales/Block/Reorder/Sidebar.php +++ b/app/code/core/Mage/Sales/Block/Reorder/Sidebar.php @@ -20,13 +20,15 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** * Sales order view block * + * @method int|null getCustomerId() + * * @category Mage * @package Mage_Sales * @author Magento Core Team @@ -40,7 +42,7 @@ public function __construct() { parent::__construct(); - if (Mage::getSingleton('customer/session')->isLoggedIn()) { + if ($this->_getCustomerSession()->isLoggedIn()) { $this->setTemplate('sales/order/history.phtml'); $this->initOrders(); } @@ -53,7 +55,7 @@ public function __construct() public function initOrders() { $customerId = $this->getCustomerId() ? $this->getCustomerId() - : Mage::getSingleton('customer/session')->getCustomer()->getId(); + : $this->_getCustomerSession()->getCustomer()->getId(); $orders = Mage::getResourceModel('sales/order_collection') ->addAttributeToFilter('customer_id', $customerId) @@ -118,7 +120,7 @@ public function getFormActionUrl() /** * Last order getter * - * @return Mage_Sales_Model_Order | false + * @return Mage_Sales_Model_Order|false */ public function getLastOrder() { @@ -128,13 +130,23 @@ public function getLastOrder() return false; } + /** + * Render "My Orders" sidebar block + * + * @return string + */ protected function _toHtml() { - if (Mage::helper('sales/reorder')->isAllow() - && (Mage::getSingleton('customer/session')->isLoggedIn() || $this->getCustomerId()) - ) { - return parent::_toHtml(); - } - return ''; + return $this->_getCustomerSession()->isLoggedIn() || $this->getCustomerId() ? parent::_toHtml() : ''; + } + + /** + * Retrieve customer session instance + * + * @return Mage_Customer_Model_Session + */ + protected function _getCustomerSession() + { + return Mage::getSingleton('customer/session'); } } diff --git a/app/code/core/Mage/Sales/Block/Widget/Guest/Form.php b/app/code/core/Mage/Sales/Block/Widget/Guest/Form.php index 1d1a395e10..a4171afb80 100644 --- a/app/code/core/Mage/Sales/Block/Widget/Guest/Form.php +++ b/app/code/core/Mage/Sales/Block/Widget/Guest/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Controller/Abstract.php b/app/code/core/Mage/Sales/Controller/Abstract.php index f26dd1ced2..2f31389661 100644 --- a/app/code/core/Mage/Sales/Controller/Abstract.php +++ b/app/code/core/Mage/Sales/Controller/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Exception.php b/app/code/core/Mage/Sales/Exception.php index f59927a937..2877ce5434 100644 --- a/app/code/core/Mage/Sales/Exception.php +++ b/app/code/core/Mage/Sales/Exception.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Helper/Data.php b/app/code/core/Mage/Sales/Helper/Data.php index 306857cdfe..1dbadba25f 100644 --- a/app/code/core/Mage/Sales/Helper/Data.php +++ b/app/code/core/Mage/Sales/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Helper/Guest.php b/app/code/core/Mage/Sales/Helper/Guest.php index 8ecf8bc7af..d688e27893 100644 --- a/app/code/core/Mage/Sales/Helper/Guest.php +++ b/app/code/core/Mage/Sales/Helper/Guest.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Helper/Reorder.php b/app/code/core/Mage/Sales/Helper/Reorder.php index a67eecea06..cd62592c54 100644 --- a/app/code/core/Mage/Sales/Helper/Reorder.php +++ b/app/code/core/Mage/Sales/Helper/Reorder.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Abstract.php b/app/code/core/Mage/Sales/Model/Abstract.php index c98cda0f12..c56d934e13 100644 --- a/app/code/core/Mage/Sales/Model/Abstract.php +++ b/app/code/core/Mage/Sales/Model/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Api/Resource.php b/app/code/core/Mage/Sales/Model/Api/Resource.php index d04b5b9cfa..0711cd893c 100644 --- a/app/code/core/Mage/Sales/Model/Api/Resource.php +++ b/app/code/core/Mage/Sales/Model/Api/Resource.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Billing/Agreement.php b/app/code/core/Mage/Sales/Model/Billing/Agreement.php index 0801c53eb2..4060da21bd 100644 --- a/app/code/core/Mage/Sales/Model/Billing/Agreement.php +++ b/app/code/core/Mage/Sales/Model/Billing/Agreement.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Config.php b/app/code/core/Mage/Sales/Model/Config.php index 74c06b1cfd..f21886f767 100644 --- a/app/code/core/Mage/Sales/Model/Config.php +++ b/app/code/core/Mage/Sales/Model/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Config/Ordered.php b/app/code/core/Mage/Sales/Model/Config/Ordered.php new file mode 100644 index 0000000000..bd89d33294 --- /dev/null +++ b/app/code/core/Mage/Sales/Model/Config/Ordered.php @@ -0,0 +1,240 @@ + + */ +abstract class Mage_Sales_Model_Config_Ordered extends Mage_Core_Model_Config_Base +{ + /** + * Cache key for collectors + * + * @var string|null + */ + protected $_collectorsCacheKey = null; + + /** + * Configuration path where to collect registered totals + * + * @var string|null + */ + protected $_totalsConfigNode = null; + + /** + * Prepared models + * + * @var array + */ + protected $_models = array(); + + /** + * Models configuration + * + * @var array + */ + protected $_modelsConfig = array(); + + /** + * Sorted models + * + * @var array + */ + protected $_collectors = array(); + + /** + * Initialize total models configuration and objects + * + * @return Mage_Sales_Model_Config_Ordered + */ + protected function _initModels() + { + $totalsConfig = $this->getNode($this->_totalsConfigNode); + + foreach ($totalsConfig->children() as $totalCode => $totalConfig) { + $class = $totalConfig->getClassName(); + if (!empty($class)) { + $this->_models[$totalCode] = $this->_initModelInstance($class, $totalCode, $totalConfig); + } + } + return $this; + } + + /** + * Init model class by configuration + * + * @abstract + * @param string $class + * @param string $totalCode + * @param array $totalConfig + * @return mixed + */ + abstract protected function _initModelInstance($class, $totalCode, $totalConfig); + + /** + * Prepare configuration array for total model + * + * @param string $code + * @param Mage_Core_Model_Config_Element $totalConfig + * @return array + */ + protected function _prepareConfigArray($code, $totalConfig) + { + $totalConfig = (array)$totalConfig; + if (isset($totalConfig['before'])) { + $totalConfig['before'] = explode(',', $totalConfig['before']); + } else { + $totalConfig['before'] = array(); + } + if (isset($totalConfig['after'])) { + $totalConfig['after'] = explode(',', $totalConfig['after']); + } else { + $totalConfig['after'] = array(); + } + $totalConfig['_code'] = $code; + return $totalConfig; + } + + /** + * Aggregate before/after information from all items and sort totals based on this data + * + * @return array + */ + protected function _getSortedCollectorCodes() + { + if (Mage::app()->useCache('config')) { + $cachedData = Mage::app()->loadCache($this->_collectorsCacheKey); + if ($cachedData) { + return unserialize($cachedData); + } + } + $configArray = $this->_modelsConfig; + // invoke simple sorting if the first element contains the "sort_order" key + reset($configArray); + $element = current($configArray); + if (isset($element['sort_order'])) { + uasort($configArray, array($this, '_compareSortOrder')); + } else { + foreach ($configArray as $code => $data) { + foreach ($data['before'] as $beforeCode) { + if (!isset($configArray[$beforeCode])) { + continue; + } + $configArray[$code]['before'] = array_unique(array_merge( + $configArray[$code]['before'], $configArray[$beforeCode]['before'] + )); + $configArray[$beforeCode]['after'] = array_merge( + $configArray[$beforeCode]['after'], array($code), $data['after'] + ); + $configArray[$beforeCode]['after'] = array_unique($configArray[$beforeCode]['after']); + } + foreach ($data['after'] as $afterCode) { + if (!isset($configArray[$afterCode])) { + continue; + } + $configArray[$code]['after'] = array_unique(array_merge( + $configArray[$code]['after'], $configArray[$afterCode]['after'] + )); + $configArray[$afterCode]['before'] = array_merge( + $configArray[$afterCode]['before'], array($code), $data['before'] + ); + $configArray[$afterCode]['before'] = array_unique($configArray[$afterCode]['before']); + } + } + uasort($configArray, array($this, '_compareTotals')); + } + $sortedCollectors = array_keys($configArray); + if (Mage::app()->useCache('config')) { + Mage::app()->saveCache(serialize($sortedCollectors), $this->_collectorsCacheKey, array( + Mage_Core_Model_Config::CACHE_TAG + ) + ); + } + return $sortedCollectors; + } + + /** + * Initialize collectors array. + * Collectors array is array of total models ordered based on configuration settings + * + * @return Mage_Sales_Model_Config_Ordered + */ + protected function _initCollectors() + { + $sortedCodes = $this->_getSortedCollectorCodes(); + foreach ($sortedCodes as $code) { + $this->_collectors[$code] = $this->_models[$code]; + } + + return $this; + } + + /** + * Callback that uses after/before for comparison + * + * @param array $a + * @param array $b + * @return int + */ + protected function _compareTotals($a, $b) + { + $aCode = $a['_code']; + $bCode = $b['_code']; + if (in_array($aCode, $b['after']) || in_array($bCode, $a['before'])) { + $res = -1; + } elseif (in_array($bCode, $a['after']) || in_array($aCode, $b['before'])) { + $res = 1; + } else { + $res = 0; + } + return $res; + } + + /** + * Callback that uses sort_order for comparison + * + * @param array $a + * @param array $b + * @return int + */ + protected function _compareSortOrder($a, $b) + { + if (!isset($a['sort_order']) || !isset($b['sort_order'])) { + return 0; + } + if ($a['sort_order'] > $b['sort_order']) { + $res = 1; + } elseif ($a['sort_order'] < $b['sort_order']) { + $res = -1; + } else { + $res = 0; + } + return $res; + } +} diff --git a/app/code/core/Mage/Sales/Model/Convert/Order.php b/app/code/core/Mage/Sales/Model/Convert/Order.php index 4e20955602..1ef9466cb0 100644 --- a/app/code/core/Mage/Sales/Model/Convert/Order.php +++ b/app/code/core/Mage/Sales/Model/Convert/Order.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Convert/Quote.php b/app/code/core/Mage/Sales/Model/Convert/Quote.php index 414d45f67b..a8b3770137 100644 --- a/app/code/core/Mage/Sales/Model/Convert/Quote.php +++ b/app/code/core/Mage/Sales/Model/Convert/Quote.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Email/Template.php b/app/code/core/Mage/Sales/Model/Email/Template.php index b870d36059..ae86621ede 100644 --- a/app/code/core/Mage/Sales/Model/Email/Template.php +++ b/app/code/core/Mage/Sales/Model/Email/Template.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Order.php b/app/code/core/Mage/Sales/Model/Entity/Order.php index c0bf2d909c..b3097ae228 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Order.php +++ b/app/code/core/Mage/Sales/Model/Entity/Order.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Order/Address.php b/app/code/core/Mage/Sales/Model/Entity/Order/Address.php index 6a3092711d..17fb60b453 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Order/Address.php +++ b/app/code/core/Mage/Sales/Model/Entity/Order/Address.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Order/Address/Collection.php b/app/code/core/Mage/Sales/Model/Entity/Order/Address/Collection.php index f63e3ae024..30d1756f32 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Order/Address/Collection.php +++ b/app/code/core/Mage/Sales/Model/Entity/Order/Address/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Order/Attribute/Backend/Billing.php b/app/code/core/Mage/Sales/Model/Entity/Order/Attribute/Backend/Billing.php index 2d07c0c72b..4caa3dd36d 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Order/Attribute/Backend/Billing.php +++ b/app/code/core/Mage/Sales/Model/Entity/Order/Attribute/Backend/Billing.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Order/Attribute/Backend/Child.php b/app/code/core/Mage/Sales/Model/Entity/Order/Attribute/Backend/Child.php index 549c4bf9e8..7714366b58 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Order/Attribute/Backend/Child.php +++ b/app/code/core/Mage/Sales/Model/Entity/Order/Attribute/Backend/Child.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Order/Attribute/Backend/Parent.php b/app/code/core/Mage/Sales/Model/Entity/Order/Attribute/Backend/Parent.php index ca6a846992..087390b964 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Order/Attribute/Backend/Parent.php +++ b/app/code/core/Mage/Sales/Model/Entity/Order/Attribute/Backend/Parent.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Order/Attribute/Backend/Shipping.php b/app/code/core/Mage/Sales/Model/Entity/Order/Attribute/Backend/Shipping.php index 6919fe0ff3..019f11f0ad 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Order/Attribute/Backend/Shipping.php +++ b/app/code/core/Mage/Sales/Model/Entity/Order/Attribute/Backend/Shipping.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Order/Collection.php b/app/code/core/Mage/Sales/Model/Entity/Order/Collection.php index 168d235f0d..2462081d6c 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Order/Collection.php +++ b/app/code/core/Mage/Sales/Model/Entity/Order/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Order/Creditmemo.php b/app/code/core/Mage/Sales/Model/Entity/Order/Creditmemo.php index b7a0ef1682..80380e2059 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Order/Creditmemo.php +++ b/app/code/core/Mage/Sales/Model/Entity/Order/Creditmemo.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Order/Creditmemo/Attribute/Backend/Child.php b/app/code/core/Mage/Sales/Model/Entity/Order/Creditmemo/Attribute/Backend/Child.php index 4e8a405e70..6e2745e7fa 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Order/Creditmemo/Attribute/Backend/Child.php +++ b/app/code/core/Mage/Sales/Model/Entity/Order/Creditmemo/Attribute/Backend/Child.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Order/Creditmemo/Attribute/Backend/Parent.php b/app/code/core/Mage/Sales/Model/Entity/Order/Creditmemo/Attribute/Backend/Parent.php index 5820fbcae9..cce655a482 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Order/Creditmemo/Attribute/Backend/Parent.php +++ b/app/code/core/Mage/Sales/Model/Entity/Order/Creditmemo/Attribute/Backend/Parent.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Order/Creditmemo/Collection.php b/app/code/core/Mage/Sales/Model/Entity/Order/Creditmemo/Collection.php index a3a908979f..0ec85c7622 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Order/Creditmemo/Collection.php +++ b/app/code/core/Mage/Sales/Model/Entity/Order/Creditmemo/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Order/Creditmemo/Comment.php b/app/code/core/Mage/Sales/Model/Entity/Order/Creditmemo/Comment.php index cab166bdbc..155c58f1dc 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Order/Creditmemo/Comment.php +++ b/app/code/core/Mage/Sales/Model/Entity/Order/Creditmemo/Comment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Order/Creditmemo/Comment/Collection.php b/app/code/core/Mage/Sales/Model/Entity/Order/Creditmemo/Comment/Collection.php index b972890bc5..2e9ea4f955 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Order/Creditmemo/Comment/Collection.php +++ b/app/code/core/Mage/Sales/Model/Entity/Order/Creditmemo/Comment/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Order/Creditmemo/Item.php b/app/code/core/Mage/Sales/Model/Entity/Order/Creditmemo/Item.php index afd7f9ec57..770c747930 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Order/Creditmemo/Item.php +++ b/app/code/core/Mage/Sales/Model/Entity/Order/Creditmemo/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Order/Creditmemo/Item/Collection.php b/app/code/core/Mage/Sales/Model/Entity/Order/Creditmemo/Item/Collection.php index b8360429e5..43c0358bcc 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Order/Creditmemo/Item/Collection.php +++ b/app/code/core/Mage/Sales/Model/Entity/Order/Creditmemo/Item/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Order/Invoice.php b/app/code/core/Mage/Sales/Model/Entity/Order/Invoice.php index a5eac6c5ba..ce50a028c1 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Order/Invoice.php +++ b/app/code/core/Mage/Sales/Model/Entity/Order/Invoice.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Order/Invoice/Attribute/Backend/Child.php b/app/code/core/Mage/Sales/Model/Entity/Order/Invoice/Attribute/Backend/Child.php index 386c2df43d..a90be88062 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Order/Invoice/Attribute/Backend/Child.php +++ b/app/code/core/Mage/Sales/Model/Entity/Order/Invoice/Attribute/Backend/Child.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Order/Invoice/Attribute/Backend/Item.php b/app/code/core/Mage/Sales/Model/Entity/Order/Invoice/Attribute/Backend/Item.php index b2e15306aa..fadcd055b9 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Order/Invoice/Attribute/Backend/Item.php +++ b/app/code/core/Mage/Sales/Model/Entity/Order/Invoice/Attribute/Backend/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Order/Invoice/Attribute/Backend/Order.php b/app/code/core/Mage/Sales/Model/Entity/Order/Invoice/Attribute/Backend/Order.php index 8017c58250..74f1c2b70f 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Order/Invoice/Attribute/Backend/Order.php +++ b/app/code/core/Mage/Sales/Model/Entity/Order/Invoice/Attribute/Backend/Order.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Order/Invoice/Attribute/Backend/Parent.php b/app/code/core/Mage/Sales/Model/Entity/Order/Invoice/Attribute/Backend/Parent.php index 8a1c1a4707..9ab615a2f8 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Order/Invoice/Attribute/Backend/Parent.php +++ b/app/code/core/Mage/Sales/Model/Entity/Order/Invoice/Attribute/Backend/Parent.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Order/Invoice/Collection.php b/app/code/core/Mage/Sales/Model/Entity/Order/Invoice/Collection.php index 7dab1b3bba..75839f3f6a 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Order/Invoice/Collection.php +++ b/app/code/core/Mage/Sales/Model/Entity/Order/Invoice/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Order/Invoice/Comment.php b/app/code/core/Mage/Sales/Model/Entity/Order/Invoice/Comment.php index 3c47768525..e44175a6a2 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Order/Invoice/Comment.php +++ b/app/code/core/Mage/Sales/Model/Entity/Order/Invoice/Comment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Order/Invoice/Comment/Collection.php b/app/code/core/Mage/Sales/Model/Entity/Order/Invoice/Comment/Collection.php index 28a171af1b..d47487ba42 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Order/Invoice/Comment/Collection.php +++ b/app/code/core/Mage/Sales/Model/Entity/Order/Invoice/Comment/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Order/Invoice/Item.php b/app/code/core/Mage/Sales/Model/Entity/Order/Invoice/Item.php index d76114bb80..38cc9749b0 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Order/Invoice/Item.php +++ b/app/code/core/Mage/Sales/Model/Entity/Order/Invoice/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Order/Invoice/Item/Collection.php b/app/code/core/Mage/Sales/Model/Entity/Order/Invoice/Item/Collection.php index dbb4464e5d..ce6206ca72 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Order/Invoice/Item/Collection.php +++ b/app/code/core/Mage/Sales/Model/Entity/Order/Invoice/Item/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Order/Item.php b/app/code/core/Mage/Sales/Model/Entity/Order/Item.php index 75ea6c55d5..96801d0fec 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Order/Item.php +++ b/app/code/core/Mage/Sales/Model/Entity/Order/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Order/Item/Collection.php b/app/code/core/Mage/Sales/Model/Entity/Order/Item/Collection.php index 0d5b39e2a9..9114fef22a 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Order/Item/Collection.php +++ b/app/code/core/Mage/Sales/Model/Entity/Order/Item/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Order/Payment.php b/app/code/core/Mage/Sales/Model/Entity/Order/Payment.php index cd515614d2..7dac5ecc4d 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Order/Payment.php +++ b/app/code/core/Mage/Sales/Model/Entity/Order/Payment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Order/Payment/Collection.php b/app/code/core/Mage/Sales/Model/Entity/Order/Payment/Collection.php index 3213cf757d..ac5c868633 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Order/Payment/Collection.php +++ b/app/code/core/Mage/Sales/Model/Entity/Order/Payment/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Order/Shipment.php b/app/code/core/Mage/Sales/Model/Entity/Order/Shipment.php index 6398bd21e1..004aeae993 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Order/Shipment.php +++ b/app/code/core/Mage/Sales/Model/Entity/Order/Shipment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Order/Shipment/Attribute/Backend/Child.php b/app/code/core/Mage/Sales/Model/Entity/Order/Shipment/Attribute/Backend/Child.php index 5c17d5e20c..946752c645 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Order/Shipment/Attribute/Backend/Child.php +++ b/app/code/core/Mage/Sales/Model/Entity/Order/Shipment/Attribute/Backend/Child.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Order/Shipment/Attribute/Backend/Parent.php b/app/code/core/Mage/Sales/Model/Entity/Order/Shipment/Attribute/Backend/Parent.php index 43042077fc..74ee421303 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Order/Shipment/Attribute/Backend/Parent.php +++ b/app/code/core/Mage/Sales/Model/Entity/Order/Shipment/Attribute/Backend/Parent.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Order/Shipment/Collection.php b/app/code/core/Mage/Sales/Model/Entity/Order/Shipment/Collection.php index 1b73827eb1..afcaddb5b8 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Order/Shipment/Collection.php +++ b/app/code/core/Mage/Sales/Model/Entity/Order/Shipment/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Order/Shipment/Comment.php b/app/code/core/Mage/Sales/Model/Entity/Order/Shipment/Comment.php index 09dd76a790..9566330f01 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Order/Shipment/Comment.php +++ b/app/code/core/Mage/Sales/Model/Entity/Order/Shipment/Comment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Order/Shipment/Comment/Collection.php b/app/code/core/Mage/Sales/Model/Entity/Order/Shipment/Comment/Collection.php index d31aef060c..6c5ae1283e 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Order/Shipment/Comment/Collection.php +++ b/app/code/core/Mage/Sales/Model/Entity/Order/Shipment/Comment/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Order/Shipment/Item.php b/app/code/core/Mage/Sales/Model/Entity/Order/Shipment/Item.php index c11ab0b060..b4f8364d2b 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Order/Shipment/Item.php +++ b/app/code/core/Mage/Sales/Model/Entity/Order/Shipment/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Order/Shipment/Item/Collection.php b/app/code/core/Mage/Sales/Model/Entity/Order/Shipment/Item/Collection.php index d1fba08b77..a3c632275a 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Order/Shipment/Item/Collection.php +++ b/app/code/core/Mage/Sales/Model/Entity/Order/Shipment/Item/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Order/Shipment/Track.php b/app/code/core/Mage/Sales/Model/Entity/Order/Shipment/Track.php index 3d574cf559..ad6cc2a905 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Order/Shipment/Track.php +++ b/app/code/core/Mage/Sales/Model/Entity/Order/Shipment/Track.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Order/Shipment/Track/Collection.php b/app/code/core/Mage/Sales/Model/Entity/Order/Shipment/Track/Collection.php index 254381c8d4..64b2b0121f 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Order/Shipment/Track/Collection.php +++ b/app/code/core/Mage/Sales/Model/Entity/Order/Shipment/Track/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Order/Status/History.php b/app/code/core/Mage/Sales/Model/Entity/Order/Status/History.php index 28988d95e1..c62535ba9b 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Order/Status/History.php +++ b/app/code/core/Mage/Sales/Model/Entity/Order/Status/History.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Order/Status/History/Collection.php b/app/code/core/Mage/Sales/Model/Entity/Order/Status/History/Collection.php index f063eebf40..8322a0b85b 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Order/Status/History/Collection.php +++ b/app/code/core/Mage/Sales/Model/Entity/Order/Status/History/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Quote.php b/app/code/core/Mage/Sales/Model/Entity/Quote.php index e6d71a665a..104e0a030e 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Quote.php +++ b/app/code/core/Mage/Sales/Model/Entity/Quote.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Quote/Address.php b/app/code/core/Mage/Sales/Model/Entity/Quote/Address.php index 6ccb03ac2e..329227719e 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Quote/Address.php +++ b/app/code/core/Mage/Sales/Model/Entity/Quote/Address.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Attribute/Backend.php b/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Attribute/Backend.php index c7bee1d6dd..e5d5252b3a 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Attribute/Backend.php +++ b/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Attribute/Backend.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Attribute/Backend/Child.php b/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Attribute/Backend/Child.php index d5ec90fb86..862dacaace 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Attribute/Backend/Child.php +++ b/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Attribute/Backend/Child.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Attribute/Backend/Parent.php b/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Attribute/Backend/Parent.php index a8c040d622..2f4a1e77f6 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Attribute/Backend/Parent.php +++ b/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Attribute/Backend/Parent.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Attribute/Backend/Region.php b/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Attribute/Backend/Region.php index 218c56cb8b..62b83a8eba 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Attribute/Backend/Region.php +++ b/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Attribute/Backend/Region.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Attribute/Frontend.php b/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Attribute/Frontend.php index 8e29bef39f..4111094bac 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Attribute/Frontend.php +++ b/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Attribute/Frontend.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Attribute/Frontend/Custbalance.php b/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Attribute/Frontend/Custbalance.php index 57f51cb485..7590decc40 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Attribute/Frontend/Custbalance.php +++ b/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Attribute/Frontend/Custbalance.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Attribute/Frontend/Discount.php b/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Attribute/Frontend/Discount.php index eee7f5eb8b..ebfe202bf9 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Attribute/Frontend/Discount.php +++ b/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Attribute/Frontend/Discount.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Attribute/Frontend/Grand.php b/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Attribute/Frontend/Grand.php index cce73141e6..b3e50ed0b8 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Attribute/Frontend/Grand.php +++ b/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Attribute/Frontend/Grand.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Attribute/Frontend/Shipping.php b/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Attribute/Frontend/Shipping.php index 70dff763f0..3184c49259 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Attribute/Frontend/Shipping.php +++ b/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Attribute/Frontend/Shipping.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Attribute/Frontend/Subtotal.php b/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Attribute/Frontend/Subtotal.php index 192ef7c7f6..41166a1b8a 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Attribute/Frontend/Subtotal.php +++ b/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Attribute/Frontend/Subtotal.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Attribute/Frontend/Tax.php b/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Attribute/Frontend/Tax.php index d060e87c56..e68a8ee3fc 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Attribute/Frontend/Tax.php +++ b/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Attribute/Frontend/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Collection.php b/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Collection.php index 757666e97b..72365da399 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Collection.php +++ b/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Item.php b/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Item.php index a317a48c2f..193c87f8e3 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Item.php +++ b/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Item/Collection.php b/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Item/Collection.php index 1c11778542..22a86ae967 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Item/Collection.php +++ b/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Item/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Rate.php b/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Rate.php index fc7dc5dec8..598194bc44 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Rate.php +++ b/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Rate.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Rate/Collection.php b/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Rate/Collection.php index 8d41bbd82d..7ed159d238 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Rate/Collection.php +++ b/app/code/core/Mage/Sales/Model/Entity/Quote/Address/Rate/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Quote/Collection.php b/app/code/core/Mage/Sales/Model/Entity/Quote/Collection.php index fef6aded77..98593fd628 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Quote/Collection.php +++ b/app/code/core/Mage/Sales/Model/Entity/Quote/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Quote/Item.php b/app/code/core/Mage/Sales/Model/Entity/Quote/Item.php index 21139a9e1b..36c1418b2b 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Quote/Item.php +++ b/app/code/core/Mage/Sales/Model/Entity/Quote/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Quote/Item/Collection.php b/app/code/core/Mage/Sales/Model/Entity/Quote/Item/Collection.php index c8590a3a39..267355dfb6 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Quote/Item/Collection.php +++ b/app/code/core/Mage/Sales/Model/Entity/Quote/Item/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Quote/Payment.php b/app/code/core/Mage/Sales/Model/Entity/Quote/Payment.php index 4d6cd959dc..bc71f762f3 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Quote/Payment.php +++ b/app/code/core/Mage/Sales/Model/Entity/Quote/Payment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Quote/Payment/Collection.php b/app/code/core/Mage/Sales/Model/Entity/Quote/Payment/Collection.php index 1e7672abfd..1c4a658e24 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Quote/Payment/Collection.php +++ b/app/code/core/Mage/Sales/Model/Entity/Quote/Payment/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Sale/Collection.php b/app/code/core/Mage/Sales/Model/Entity/Sale/Collection.php index eb8e794fbe..7a7e1df153 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Sale/Collection.php +++ b/app/code/core/Mage/Sales/Model/Entity/Sale/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Entity/Setup.php b/app/code/core/Mage/Sales/Model/Entity/Setup.php index 7f27347a06..94e73627dc 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Setup.php +++ b/app/code/core/Mage/Sales/Model/Entity/Setup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Abstract.php b/app/code/core/Mage/Sales/Model/Mysql4/Abstract.php index e15afa35b3..0e86f3b720 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Abstract.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Billing/Agreement.php b/app/code/core/Mage/Sales/Model/Mysql4/Billing/Agreement.php index 7c585ba98e..4face9e531 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Billing/Agreement.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Billing/Agreement.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Billing/Agreement/Collection.php b/app/code/core/Mage/Sales/Model/Mysql4/Billing/Agreement/Collection.php index d7d2f06a16..0044c5839c 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Billing/Agreement/Collection.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Billing/Agreement/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Collection/Abstract.php b/app/code/core/Mage/Sales/Model/Mysql4/Collection/Abstract.php index fe24364a80..1ddb84ab02 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Collection/Abstract.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Collection/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order.php b/app/code/core/Mage/Sales/Model/Mysql4/Order.php index dfc0c78908..918afa496e 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Abstract.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Abstract.php index f56e11dd61..c97765fb79 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Abstract.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Address.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Address.php index 8cba5bcd93..86c2705861 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Address.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Address.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Address/Collection.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Address/Collection.php index 86f3d579f2..3b5f5903bb 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Address/Collection.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Address/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Attribute/Backend/Billing.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Attribute/Backend/Billing.php index d10bcc3ad5..dac97458d7 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Attribute/Backend/Billing.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Attribute/Backend/Billing.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Attribute/Backend/Child.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Attribute/Backend/Child.php index 25321dfe6c..e46cb10f60 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Attribute/Backend/Child.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Attribute/Backend/Child.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Attribute/Backend/Parent.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Attribute/Backend/Parent.php index 8f3219bc35..026ee69f31 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Attribute/Backend/Parent.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Attribute/Backend/Parent.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Attribute/Backend/Shipping.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Attribute/Backend/Shipping.php index ec0cfaf789..5f457d0dc4 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Attribute/Backend/Shipping.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Attribute/Backend/Shipping.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Collection.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Collection.php index a3f3483aa4..47354d11ca 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Collection.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Collection/Abstract.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Collection/Abstract.php index b66dba0e2f..00b5d7c286 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Collection/Abstract.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Collection/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Comment/Collection/Abstract.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Comment/Collection/Abstract.php index a432dfc270..ee5c87af36 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Comment/Collection/Abstract.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Comment/Collection/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Creditmemo.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Creditmemo.php index 8d1d630bce..507881ffda 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Creditmemo.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Creditmemo.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Creditmemo/Attribute/Backend/Child.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Creditmemo/Attribute/Backend/Child.php index 083a01da02..6721e6955f 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Creditmemo/Attribute/Backend/Child.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Creditmemo/Attribute/Backend/Child.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Creditmemo/Attribute/Backend/Parent.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Creditmemo/Attribute/Backend/Parent.php index a61a633e41..de9b205b81 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Creditmemo/Attribute/Backend/Parent.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Creditmemo/Attribute/Backend/Parent.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Creditmemo/Collection.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Creditmemo/Collection.php index fd31752016..16dc20fc3b 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Creditmemo/Collection.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Creditmemo/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Creditmemo/Comment.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Creditmemo/Comment.php index a2e4327ca7..dbf3665f66 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Creditmemo/Comment.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Creditmemo/Comment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Creditmemo/Comment/Collection.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Creditmemo/Comment/Collection.php index b467cb2568..6cb5ab586d 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Creditmemo/Comment/Collection.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Creditmemo/Comment/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Creditmemo/Grid/Collection.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Creditmemo/Grid/Collection.php index 903ebd1f61..2851acf7db 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Creditmemo/Grid/Collection.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Creditmemo/Grid/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Creditmemo/Item.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Creditmemo/Item.php index c78360d0b0..fbdc89fa06 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Creditmemo/Item.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Creditmemo/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Creditmemo/Item/Collection.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Creditmemo/Item/Collection.php index 344354b019..a5b8196364 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Creditmemo/Item/Collection.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Creditmemo/Item/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Grid/Collection.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Grid/Collection.php index 54c3d84edb..f899d6f5aa 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Grid/Collection.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Grid/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Invoice.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Invoice.php index 159655f283..a9bb7fe830 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Invoice.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Invoice.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Invoice/Attribute/Backend/Child.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Invoice/Attribute/Backend/Child.php index b995cd5ec9..4116c11a32 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Invoice/Attribute/Backend/Child.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Invoice/Attribute/Backend/Child.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Invoice/Attribute/Backend/Item.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Invoice/Attribute/Backend/Item.php index 413084d606..857b01ca4f 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Invoice/Attribute/Backend/Item.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Invoice/Attribute/Backend/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Invoice/Attribute/Backend/Order.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Invoice/Attribute/Backend/Order.php index 9d865e9d17..99b717b7b6 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Invoice/Attribute/Backend/Order.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Invoice/Attribute/Backend/Order.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Invoice/Attribute/Backend/Parent.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Invoice/Attribute/Backend/Parent.php index bde5ce00ad..9ee69782c9 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Invoice/Attribute/Backend/Parent.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Invoice/Attribute/Backend/Parent.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Invoice/Collection.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Invoice/Collection.php index bb7920242e..bed921cfe0 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Invoice/Collection.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Invoice/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Invoice/Comment.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Invoice/Comment.php index 410f9bff39..782bfb8458 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Invoice/Comment.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Invoice/Comment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Invoice/Comment/Collection.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Invoice/Comment/Collection.php index f839e85d11..a0f3886d2f 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Invoice/Comment/Collection.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Invoice/Comment/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Invoice/Grid/Collection.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Invoice/Grid/Collection.php index 09df19aa74..7142230afc 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Invoice/Grid/Collection.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Invoice/Grid/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Invoice/Item.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Invoice/Item.php index 660a478063..817ef94517 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Invoice/Item.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Invoice/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Invoice/Item/Collection.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Invoice/Item/Collection.php index 6ada48f80c..ff416e8056 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Invoice/Item/Collection.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Invoice/Item/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Item.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Item.php index 302a3e06e9..5e15c1b08e 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Item.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Item/Collection.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Item/Collection.php index 3ba443d9f8..6772b505f3 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Item/Collection.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Item/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Payment.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Payment.php index 146a50e419..b4ded581f8 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Payment.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Payment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Payment/Collection.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Payment/Collection.php index 127533df30..fdb406289d 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Payment/Collection.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Payment/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Payment/Transaction.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Payment/Transaction.php index b2067d4e61..664d9b963f 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Payment/Transaction.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Payment/Transaction.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Payment/Transaction/Collection.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Payment/Transaction/Collection.php index a5a4f6ee37..bc3b7ecce1 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Payment/Transaction/Collection.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Payment/Transaction/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Shipment.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Shipment.php index 23245beb9d..8d7c70b5a1 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Shipment.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Shipment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Shipment/Attribute/Backend/Child.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Shipment/Attribute/Backend/Child.php index 196381ce18..b77ba35f6f 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Shipment/Attribute/Backend/Child.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Shipment/Attribute/Backend/Child.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Shipment/Attribute/Backend/Parent.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Shipment/Attribute/Backend/Parent.php index e541bc9f3a..a78031d501 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Shipment/Attribute/Backend/Parent.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Shipment/Attribute/Backend/Parent.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Shipment/Collection.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Shipment/Collection.php index 8122e265f1..cfc8e92a4c 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Shipment/Collection.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Shipment/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Shipment/Comment.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Shipment/Comment.php index a6a448e1ad..9a9f1e3f79 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Shipment/Comment.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Shipment/Comment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Shipment/Comment/Collection.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Shipment/Comment/Collection.php index 440fd68330..4c586fe8fc 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Shipment/Comment/Collection.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Shipment/Comment/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Shipment/Grid/Collection.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Shipment/Grid/Collection.php index 963b37365a..f7cd1f636a 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Shipment/Grid/Collection.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Shipment/Grid/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Shipment/Item.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Shipment/Item.php index 5db6b6685b..6993c37253 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Shipment/Item.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Shipment/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Shipment/Item/Collection.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Shipment/Item/Collection.php index 20909f8a23..1c18f66cbb 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Shipment/Item/Collection.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Shipment/Item/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Shipment/Track.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Shipment/Track.php index bdbf6b160a..bdf55bdc48 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Shipment/Track.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Shipment/Track.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Shipment/Track/Collection.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Shipment/Track/Collection.php index 220e005bd5..547fc5fa82 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Shipment/Track/Collection.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Shipment/Track/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Status.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Status.php index 7b69fe3f97..25b1ce200e 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Status.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Status.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Status/Collection.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Status/Collection.php index 6730e36ed0..21bfa8242d 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Status/Collection.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Status/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Status/History.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Status/History.php index 41383d9086..7fb41d249c 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Status/History.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Status/History.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Status/History/Collection.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Status/History/Collection.php index c2d0037b72..e3c11067a5 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Status/History/Collection.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Status/History/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Tax.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Tax.php index 278be0989b..147b5f0128 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Tax.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Tax/Collection.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Tax/Collection.php index 8489891ff2..1aaf1bdd92 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Tax/Collection.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Tax/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Quote.php b/app/code/core/Mage/Sales/Model/Mysql4/Quote.php index a622cdcdab..fa01e56bec 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Quote.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Quote.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address.php b/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address.php index 5f6daf7ef5..72d65afddc 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Attribute/Backend.php b/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Attribute/Backend.php index 74157feda9..a20f0e4ac4 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Attribute/Backend.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Attribute/Backend.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Attribute/Backend/Child.php b/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Attribute/Backend/Child.php index cf2c1f1253..e45cd07471 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Attribute/Backend/Child.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Attribute/Backend/Child.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Attribute/Backend/Parent.php b/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Attribute/Backend/Parent.php index 4e312958f1..9b0c4c0b14 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Attribute/Backend/Parent.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Attribute/Backend/Parent.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Attribute/Backend/Region.php b/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Attribute/Backend/Region.php index 16d907cd67..2d75dd7194 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Attribute/Backend/Region.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Attribute/Backend/Region.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Attribute/Frontend.php b/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Attribute/Frontend.php index 2c760092da..21831934dc 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Attribute/Frontend.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Attribute/Frontend.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Attribute/Frontend/Custbalance.php b/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Attribute/Frontend/Custbalance.php index 47a3866a4e..96132e3ba3 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Attribute/Frontend/Custbalance.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Attribute/Frontend/Custbalance.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Attribute/Frontend/Discount.php b/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Attribute/Frontend/Discount.php index 484836631c..b2935f0ed0 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Attribute/Frontend/Discount.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Attribute/Frontend/Discount.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Attribute/Frontend/Grand.php b/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Attribute/Frontend/Grand.php index 20c90def76..ec1cdf039c 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Attribute/Frontend/Grand.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Attribute/Frontend/Grand.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Attribute/Frontend/Shipping.php b/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Attribute/Frontend/Shipping.php index 206144f5f5..e0db6ed224 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Attribute/Frontend/Shipping.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Attribute/Frontend/Shipping.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Attribute/Frontend/Subtotal.php b/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Attribute/Frontend/Subtotal.php index 1f044434f6..507fa3832f 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Attribute/Frontend/Subtotal.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Attribute/Frontend/Subtotal.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Attribute/Frontend/Tax.php b/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Attribute/Frontend/Tax.php index a66a920d47..61c3100cf1 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Attribute/Frontend/Tax.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Attribute/Frontend/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Collection.php b/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Collection.php index 24b8813f8f..e4b1100dff 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Collection.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Item.php b/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Item.php index 660ff5686d..89cc3fa5c1 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Item.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Item/Collection.php b/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Item/Collection.php index b80a4e07d2..f72ce9db5e 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Item/Collection.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Item/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Rate.php b/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Rate.php index e2ba1b893f..4a0b6f49be 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Rate.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Rate.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Rate/Collection.php b/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Rate/Collection.php index 051f75c1c6..07f3f91bcf 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Rate/Collection.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Quote/Address/Rate/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Quote/Collection.php b/app/code/core/Mage/Sales/Model/Mysql4/Quote/Collection.php index 1b302b3986..51ca4d3991 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Quote/Collection.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Quote/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Quote/Item.php b/app/code/core/Mage/Sales/Model/Mysql4/Quote/Item.php index d7a5098157..50ca99f990 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Quote/Item.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Quote/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Quote/Item/Collection.php b/app/code/core/Mage/Sales/Model/Mysql4/Quote/Item/Collection.php index 39a18856c2..1f909711f3 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Quote/Item/Collection.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Quote/Item/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Quote/Item/Option.php b/app/code/core/Mage/Sales/Model/Mysql4/Quote/Item/Option.php index 0964a6dd51..505e268ec0 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Quote/Item/Option.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Quote/Item/Option.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Quote/Item/Option/Collection.php b/app/code/core/Mage/Sales/Model/Mysql4/Quote/Item/Option/Collection.php index f9f85e352b..14f7044da4 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Quote/Item/Option/Collection.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Quote/Item/Option/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Quote/Payment.php b/app/code/core/Mage/Sales/Model/Mysql4/Quote/Payment.php index 622458b05f..1b43c5de4a 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Quote/Payment.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Quote/Payment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Quote/Payment/Collection.php b/app/code/core/Mage/Sales/Model/Mysql4/Quote/Payment/Collection.php index 45f525164a..f52d3bf38c 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Quote/Payment/Collection.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Quote/Payment/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Recurring/Profile.php b/app/code/core/Mage/Sales/Model/Mysql4/Recurring/Profile.php index 29ff751117..154f5bae0c 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Recurring/Profile.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Recurring/Profile.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Recurring/Profile/Collection.php b/app/code/core/Mage/Sales/Model/Mysql4/Recurring/Profile/Collection.php index 9217cb7775..286fc34651 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Recurring/Profile/Collection.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Recurring/Profile/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Report.php b/app/code/core/Mage/Sales/Model/Mysql4/Report.php index 6af0b31716..23eab32cd5 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Report.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Report.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Report/Abstract.php b/app/code/core/Mage/Sales/Model/Mysql4/Report/Abstract.php index 9292c9db2f..38b21547e9 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Report/Abstract.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Report/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Report/Bestsellers.php b/app/code/core/Mage/Sales/Model/Mysql4/Report/Bestsellers.php index 2806f0d7a3..7b402e2967 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Report/Bestsellers.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Report/Bestsellers.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Report/Bestsellers/Collection.php b/app/code/core/Mage/Sales/Model/Mysql4/Report/Bestsellers/Collection.php index 7b5f9251bc..131ea96597 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Report/Bestsellers/Collection.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Report/Bestsellers/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Report/Collection/Abstract.php b/app/code/core/Mage/Sales/Model/Mysql4/Report/Collection/Abstract.php index 054dc5c507..a867a64d52 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Report/Collection/Abstract.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Report/Collection/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Report/Invoiced.php b/app/code/core/Mage/Sales/Model/Mysql4/Report/Invoiced.php index 2a66513c1f..f541c1a433 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Report/Invoiced.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Report/Invoiced.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Report/Invoiced/Collection/Invoiced.php b/app/code/core/Mage/Sales/Model/Mysql4/Report/Invoiced/Collection/Invoiced.php index 1376a21ff3..7844d0db5b 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Report/Invoiced/Collection/Invoiced.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Report/Invoiced/Collection/Invoiced.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Report/Invoiced/Collection/Order.php b/app/code/core/Mage/Sales/Model/Mysql4/Report/Invoiced/Collection/Order.php index 9844ffbf9d..938277dc8a 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Report/Invoiced/Collection/Order.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Report/Invoiced/Collection/Order.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Report/Order.php b/app/code/core/Mage/Sales/Model/Mysql4/Report/Order.php index 32f4e288f7..3081c10839 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Report/Order.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Report/Order.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Report/Order/Collection.php b/app/code/core/Mage/Sales/Model/Mysql4/Report/Order/Collection.php index ceb259ad5d..a984afd379 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Report/Order/Collection.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Report/Order/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Report/Order/Updatedat/Collection.php b/app/code/core/Mage/Sales/Model/Mysql4/Report/Order/Updatedat/Collection.php index cb9ffda157..0df0d12eb1 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Report/Order/Updatedat/Collection.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Report/Order/Updatedat/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Report/Refunded.php b/app/code/core/Mage/Sales/Model/Mysql4/Report/Refunded.php index 757cc6c41f..90078f895a 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Report/Refunded.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Report/Refunded.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Report/Refunded/Collection/Order.php b/app/code/core/Mage/Sales/Model/Mysql4/Report/Refunded/Collection/Order.php index 032d0e9180..0b2bbd4930 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Report/Refunded/Collection/Order.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Report/Refunded/Collection/Order.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Report/Refunded/Collection/Refunded.php b/app/code/core/Mage/Sales/Model/Mysql4/Report/Refunded/Collection/Refunded.php index c76a854142..0737052a13 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Report/Refunded/Collection/Refunded.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Report/Refunded/Collection/Refunded.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Report/Shipping.php b/app/code/core/Mage/Sales/Model/Mysql4/Report/Shipping.php index 2f41d639ce..0bd6a7fb12 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Report/Shipping.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Report/Shipping.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Report/Shipping/Collection/Order.php b/app/code/core/Mage/Sales/Model/Mysql4/Report/Shipping/Collection/Order.php index 91b5a109af..4122fde586 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Report/Shipping/Collection/Order.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Report/Shipping/Collection/Order.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Report/Shipping/Collection/Shipment.php b/app/code/core/Mage/Sales/Model/Mysql4/Report/Shipping/Collection/Shipment.php index 96f7e5f989..f116810b84 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Report/Shipping/Collection/Shipment.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Report/Shipping/Collection/Shipment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Sale/Collection.php b/app/code/core/Mage/Sales/Model/Mysql4/Sale/Collection.php index 7e6bc87993..ca285970bd 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Sale/Collection.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Sale/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Setup.php b/app/code/core/Mage/Sales/Model/Mysql4/Setup.php index 68619eda1c..8a46a1e01a 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Setup.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Setup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Observer.php b/app/code/core/Mage/Sales/Model/Observer.php index 4700dd31bc..02f2c20960 100644 --- a/app/code/core/Mage/Sales/Model/Observer.php +++ b/app/code/core/Mage/Sales/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -336,51 +336,115 @@ public function setQuoteCanApplyMsrp(Varien_Event_Observer $observer) } /** - * Handle customer VAT number if needed + * Add VAT validation request date and identifier to order comments + * + * @param Varien_Event_Observer $observer + * @return null + */ + public function addVatRequestParamsOrderComment(Varien_Event_Observer $observer) + { + /** @var $orderInstance Mage_Sales_Model_Order */ + $orderInstance = $observer->getOrder(); + /** @var $orderAddress Mage_Sales_Model_Order_Address */ + $orderAddress = $this->_getVatRequiredSalesAddress($orderInstance); + if (!($orderAddress instanceof Mage_Sales_Model_Order_Address)) { + return; + } + + $vatRequestId = $orderAddress->getVatRequestId(); + $vatRequestDate = $orderAddress->getVatRequestDate(); + if (is_string($vatRequestId) && !empty($vatRequestId) && is_string($vatRequestDate) + && !empty($vatRequestDate) + ) { + $orderHistoryComment = Mage::helper('customer')->__('VAT Request Identifier') + . ': ' . $vatRequestId . '
    ' . Mage::helper('customer')->__('VAT Request Date') + . ': ' . $vatRequestDate; + $orderInstance->addStatusHistoryComment($orderHistoryComment, false); + } + } + + /** + * Retrieve sales address (order or quote) on which tax calculation must be based + * + * @param Mage_Core_Model_Abstract $salesModel + * @param Mage_Core_Model_Store|string|int|null $store + * @return Mage_Customer_Model_Address_Abstract|null + */ + protected function _getVatRequiredSalesAddress($salesModel, $store = null) + { + $configAddressType = Mage::helper('customer/address')->getTaxCalculationAddressType($store); + $requiredAddress = null; + switch ($configAddressType) { + case Mage_Customer_Model_Address_Abstract::TYPE_SHIPPING: + $requiredAddress = $salesModel->getShippingAddress(); + break; + default: + $requiredAddress = $salesModel->getBillingAddress(); + } + return $requiredAddress; + } + + /** + * Retrieve customer address (default billing or default shipping) ID on which tax calculation must be based + * + * @param Mage_Customer_Model_Customer $customer + * @param Mage_Core_Model_Store|string|int|null $store + * @return int|string + */ + protected function _getVatRequiredCustomerAddress(Mage_Customer_Model_Customer $customer, $store = null) + { + $configAddressType = Mage::helper('customer/address')->getTaxCalculationAddressType($store); + $requiredAddress = null; + switch ($configAddressType) { + case Mage_Customer_Model_Address_Abstract::TYPE_SHIPPING: + $requiredAddress = $customer->getDefaultShipping(); + break; + default: + $requiredAddress = $customer->getDefaultBilling(); + } + return $requiredAddress; + } + + /** + * Handle customer VAT number if needed on collect_totals_before event of quote address * * @param Varien_Event_Observer $observer */ - public function handleCustomerVatNumber(Varien_Event_Observer $observer) + public function changeQuoteCustomerGroupId(Varien_Event_Observer $observer) { /** @var $addressHelper Mage_Customer_Helper_Address */ $addressHelper = Mage::helper('customer/address'); - /** @var $customerInstance Mage_Customer_Model_Customer */ - $customerInstance = $observer->getQuote()->getCustomer(); + $quoteAddress = $observer->getQuoteAddress(); + $quoteInstance = $quoteAddress->getQuote(); + $customerInstance = $quoteInstance->getCustomer(); - if (!$addressHelper->isVatValidationEnabled($customerInstance->getStore())) { + $storeId = $customerInstance->getStore(); + + $configAddressType = Mage::helper('customer/address')->getTaxCalculationAddressType($storeId); + + // When VAT is based on billing address then Magento have to handle only billing addresses + $additionalBillingAddressCondition = ($configAddressType == Mage_Customer_Model_Address_Abstract::TYPE_BILLING) + ? $configAddressType != $quoteAddress->getAddressType() : false; + // Handle only addresses that corresponds to VAT configuration + if (!$addressHelper->isVatValidationEnabled($storeId) || $additionalBillingAddressCondition) { return; } - /** @var $quoteInstance Mage_Sales_Model_Quote */ - $quoteInstance = $observer->getQuote(); - $quoteBillingAddress = $quoteInstance->getBillingAddress(); - /** @var $customerHelper Mage_Customer_Helper_Data */ $customerHelper = Mage::helper('customer'); - $customerAddressId = $quoteBillingAddress->getCustomerAddressId(); - $customerDefaultBillingAddressId = $customerInstance->getDefaultBilling(); - - $customerCountryCode = $quoteBillingAddress->getCountryId(); - $customerVatNumber = $quoteBillingAddress->getVatId(); + $customerCountryCode = $quoteAddress->getCountryId(); + $customerVatNumber = $quoteAddress->getVatId(); if (empty($customerVatNumber) || !Mage::helper('core')->isCountryInEU($customerCountryCode)) { - $groupId = $customerHelper->getDefaultCustomerGroupId($customerInstance->getStore()); - - if ($groupId && $customerInstance->getGroupId() != $groupId) { - $quoteInstance->setCustomer($customerInstance->setGroupId($groupId)); - $quoteInstance->setCustomerGroupId($groupId); - } + $groupId = ($customerInstance->getId()) ? $customerHelper->getDefaultCustomerGroupId($storeId) + : Mage_Customer_Model_Group::NOT_LOGGED_IN_ID; - return; - } - - $mustValidateVat = $addressHelper->getValidateOnEachTransaction($customerInstance->getStore()) - || $customerCountryCode != $quoteBillingAddress->getValidatedCountryCode() - || $customerVatNumber != $quoteBillingAddress->getValidatedVatNumber(); + $quoteAddress->setPrevQuoteCustomerGroupId($quoteInstance->getCustomerGroupId()); + $customerInstance->setGroupId($groupId); + $quoteInstance->setCustomerGroupId($groupId); - if (!$mustValidateVat) { return; } @@ -389,58 +453,64 @@ public function handleCustomerVatNumber(Varien_Event_Observer $observer) $merchantCountryCode = $coreHelper->getMerchantCountryCode(); $merchantVatNumber = $coreHelper->getMerchantVatNumber(); - $gatewayResponse = $customerHelper->checkVatNumber( - $customerCountryCode, - $customerVatNumber, - ($merchantVatNumber !== '') ? $merchantCountryCode : '', - $merchantVatNumber + $gatewayResponse = null; + if ($addressHelper->getValidateOnEachTransaction($storeId) + || $customerCountryCode != $quoteAddress->getValidatedCountryCode() + || $customerVatNumber != $quoteAddress->getValidatedVatNumber() + ) { + // Send request to gateway + $gatewayResponse = $customerHelper->checkVatNumber( + $customerCountryCode, + $customerVatNumber, + ($merchantVatNumber !== '') ? $merchantCountryCode : '', + $merchantVatNumber + ); + + // Store validation results in corresponding quote address + $quoteAddress->setVatIsValid((int)$gatewayResponse->getIsValid()) + ->setVatRequestId($gatewayResponse->getRequestIdentifier()) + ->setVatRequestDate($gatewayResponse->getRequestDate()) + ->setVatRequestSuccess($gatewayResponse->getRequestSuccess()) + ->setValidatedVatNumber($customerVatNumber) + ->setValidatedCountryCode($customerCountryCode) + ->save(); + } else { + // Restore validation results from corresponding quote address + $gatewayResponse = new Varien_Object(array( + 'is_valid' => (int)$quoteAddress->getVatIsValid(), + 'request_identifier' => (string)$quoteAddress->getVatRequestId(), + 'request_date' => (string)$quoteAddress->getVatRequestDate(), + 'request_success' => (boolean)$quoteAddress->getVatRequestSuccess() + )); + } + + // Magento always has to emulate group even if customer uses default billing/shipping address + $groupId = $customerHelper->getCustomerGroupIdBasedOnVatNumber( + $customerCountryCode, $gatewayResponse, $customerInstance->getStore() ); - // Store validation results in quote billing address - $quoteBillingAddress->setVatIsValid((int) $gatewayResponse->getIsValid()) - ->setVatRequestId($gatewayResponse->getRequestIdentifier()) - ->setVatRequestDate($gatewayResponse->getRequestDate()) - ->setVatRequestSuccess($gatewayResponse->getRequestSuccess()) - ->setValidatedVatNumber($customerVatNumber) - ->setValidatedCountryCode($customerCountryCode) - ->save(); - - if ($customerAddressId != $customerDefaultBillingAddressId) { - $groupId = $customerHelper->getCustomerGroupIdBasedOnVatNumber( - $customerCountryCode, $gatewayResponse, $customerInstance->getStore()); - - if ($groupId) { - $quoteInstance->setCustomer($customerInstance->setGroupId($groupId)); - $quoteInstance->setCustomerGroupId($groupId); - } + if ($groupId) { + $quoteAddress->setPrevQuoteCustomerGroupId($quoteInstance->getCustomerGroupId()); + $customerInstance->setGroupId($groupId); + $quoteInstance->setCustomerGroupId($groupId); } } /** - * Add VAT validation request date and identifier to order comments + * Restore initial customer group ID in quote if needed on collect_totals_after event of quote address * * @param Varien_Event_Observer $observer - * @return null */ - public function addVatRequestParamsOrderComment(Varien_Event_Observer $observer) + public function restoreQuoteCustomerGroupId($observer) { - /** @var $orderInstance Mage_Sales_Model_Order */ - $orderInstance = $observer->getOrder(); - /** @var $billingAddress Mage_Sales_Model_Order_Address */ - $billingAddress = $orderInstance->getBillingAddress(); - if ($billingAddress instanceof Mage_Sales_Model_Order_Address) { - $vatRequestId = $billingAddress->getVatRequestId(); - $vatRequestDate = $billingAddress->getVatRequestDate(); - if (is_string($vatRequestId) - && !empty($vatRequestId) - && is_string($vatRequestDate) - && !empty($vatRequestDate) - ) { - $orderHistoryComment = Mage::helper('customer')->__('VAT Request Identifier') - . ': ' . $vatRequestId . '
    ' . Mage::helper('customer')->__('VAT Request Date') - . ': ' . $vatRequestDate; - $orderInstance->addStatusHistoryComment($orderHistoryComment, false); - } + $quoteAddress = $observer->getQuoteAddress(); + $configAddressType = Mage::helper('customer/address')->getTaxCalculationAddressType(); + // Restore initial customer group ID in quote only if VAT is calculated based on shipping address + if ($quoteAddress->hasPrevQuoteCustomerGroupId() + && $configAddressType == Mage_Customer_Model_Address_Abstract::TYPE_SHIPPING + ) { + $quoteAddress->getQuote()->setCustomerGroupId($quoteAddress->getPrevQuoteCustomerGroupId()); + $quoteAddress->unsPrevQuoteCustomerGroupId(); } } } diff --git a/app/code/core/Mage/Sales/Model/Order.php b/app/code/core/Mage/Sales/Model/Order.php index 95dd618a8e..3dc877dc11 100644 --- a/app/code/core/Mage/Sales/Model/Order.php +++ b/app/code/core/Mage/Sales/Model/Order.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -755,6 +755,27 @@ public function canEdit() * @return bool */ public function canReorder() + { + return $this->_canReorder(false); + } + + /** + * Check the ability to reorder ignoring the availability in stock or status of the ordered products + * + * @return bool + */ + public function canReorderIgnoreSalable() + { + return $this->_canReorder(true); + } + + /** + * Retrieve order reorder availability + * + * @param bool $ignoreSalable + * @return bool + */ + protected function _canReorder($ignoreSalable = false) { if ($this->canUnhold() || $this->isPaymentReview() || !$this->getCustomerId()) { return false; @@ -790,7 +811,7 @@ public function canReorder() $product = Mage::getModel('catalog/product') ->setStoreId($this->getStoreId()) ->load($productId); - if (!$product->getId() || !$product->isSalable()) { + if (!$product->getId() || (!$ignoreSalable && !$product->isSalable())) { return false; } } diff --git a/app/code/core/Mage/Sales/Model/Order/Address.php b/app/code/core/Mage/Sales/Model/Order/Address.php index 30ffe8ab10..ffe4784a5f 100644 --- a/app/code/core/Mage/Sales/Model/Order/Address.php +++ b/app/code/core/Mage/Sales/Model/Order/Address.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Api.php b/app/code/core/Mage/Sales/Model/Order/Api.php index 3976695cd3..20d19fa42f 100644 --- a/app/code/core/Mage/Sales/Model/Order/Api.php +++ b/app/code/core/Mage/Sales/Model/Order/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Api/V2.php b/app/code/core/Mage/Sales/Model/Order/Api/V2.php index 6dbecb538f..edc26b9bf2 100644 --- a/app/code/core/Mage/Sales/Model/Order/Api/V2.php +++ b/app/code/core/Mage/Sales/Model/Order/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Config.php b/app/code/core/Mage/Sales/Model/Order/Config.php index 6a330dcb98..42064fe171 100644 --- a/app/code/core/Mage/Sales/Model/Order/Config.php +++ b/app/code/core/Mage/Sales/Model/Order/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Creditmemo.php b/app/code/core/Mage/Sales/Model/Order/Creditmemo.php index f7ae46a412..dcddf60858 100644 --- a/app/code/core/Mage/Sales/Model/Order/Creditmemo.php +++ b/app/code/core/Mage/Sales/Model/Order/Creditmemo.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Api.php b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Api.php index 9fd46b4eb3..5a3a3aef12 100644 --- a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Api.php +++ b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Api/V2.php b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Api/V2.php index 1af1ffc6a1..6ce1ed39b1 100644 --- a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Api/V2.php +++ b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Comment.php b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Comment.php index 9a4ffe9596..c0c5d17872 100644 --- a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Comment.php +++ b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Comment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Config.php b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Config.php index 59a036f7b6..7c80acd8d5 100644 --- a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Config.php +++ b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -31,32 +31,20 @@ * @package Mage_Sales * @author Magento Core Team */ -class Mage_Sales_Model_Order_Creditmemo_Config extends Mage_Core_Model_Config_Base +class Mage_Sales_Model_Order_Creditmemo_Config extends Mage_Sales_Model_Order_Total_Config_Base { - protected $_totalModels = null; - - public function __construct() - { - parent::__construct(Mage::getConfig()->getNode('global/sales/order_creditmemo')); - } - /** - * Retrieve invoice total calculation models + * Cache key for collectors * - * @return array + * @var string */ - public function getTotalModels() + protected $_collectorsCacheKey = 'sorted_order_creditmemo_collectors'; + + /** + * Constructor + */ + public function __construct() { - if (is_null($this->_totalModels)) { - $this->_totalModels = array(); - $totalsConfig = $this->getNode('totals'); - foreach ($totalsConfig->children() as $totalCode=>$totalConfig) { - $class = $totalConfig->getClassName(); - if ($class && ($model = Mage::getModel($class))) { - $this->_totalModels[] = $model; - } - } - } - return $this->_totalModels; + parent::__construct(Mage::getConfig()->getNode('global/sales/order_creditmemo')); } } diff --git a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Item.php b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Item.php index 6539a7c837..db267613f6 100644 --- a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Item.php +++ b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Abstract.php b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Abstract.php index 729331da1f..3b029a01d1 100644 --- a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Abstract.php +++ b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Abstract.php @@ -20,14 +20,26 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - -abstract class Mage_Sales_Model_Order_Creditmemo_Total_Abstract +/** + * Base class for credit memo total + * + * @category Mage + * @package Mage_Sales + * @author Magento Core Team + */ +abstract class Mage_Sales_Model_Order_Creditmemo_Total_Abstract extends Mage_Sales_Model_Order_Total_Abstract { - public function collect(Mage_Sales_Model_Order_Creditmemo $invoice) + /** + * Collect credit memo subtotal + * + * @param Mage_Sales_Model_Order_Creditmemo $creditmemo + * @return Mage_Sales_Model_Order_Creditmemo_Total_Abstract + */ + public function collect(Mage_Sales_Model_Order_Creditmemo $creditmemo) { return $this; } diff --git a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Cost.php b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Cost.php index a837336140..68bd101bec 100644 --- a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Cost.php +++ b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Cost.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Discount.php b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Discount.php index bcc37f97b1..476e8d704e 100644 --- a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Discount.php +++ b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Discount.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Grand.php b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Grand.php index 539c97a712..6a3077a783 100644 --- a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Grand.php +++ b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Grand.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Shipping.php b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Shipping.php index 28a0b9a8c8..b25926860e 100644 --- a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Shipping.php +++ b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Shipping.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Subtotal.php b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Subtotal.php index 509a6722df..542a38f6b9 100644 --- a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Subtotal.php +++ b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Subtotal.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Tax.php b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Tax.php index b6fba96335..ce7c0e241d 100644 --- a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Tax.php +++ b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Invoice.php b/app/code/core/Mage/Sales/Model/Order/Invoice.php index 7e3f9a49b1..b9f21ca3b2 100644 --- a/app/code/core/Mage/Sales/Model/Order/Invoice.php +++ b/app/code/core/Mage/Sales/Model/Order/Invoice.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Invoice/Api.php b/app/code/core/Mage/Sales/Model/Order/Invoice/Api.php index 103f201489..8167ef38c1 100644 --- a/app/code/core/Mage/Sales/Model/Order/Invoice/Api.php +++ b/app/code/core/Mage/Sales/Model/Order/Invoice/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Invoice/Api/V2.php b/app/code/core/Mage/Sales/Model/Order/Invoice/Api/V2.php index bf7616e39f..710e48b508 100644 --- a/app/code/core/Mage/Sales/Model/Order/Invoice/Api/V2.php +++ b/app/code/core/Mage/Sales/Model/Order/Invoice/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Invoice/Comment.php b/app/code/core/Mage/Sales/Model/Order/Invoice/Comment.php index eee94262b9..7b2c73fdc0 100644 --- a/app/code/core/Mage/Sales/Model/Order/Invoice/Comment.php +++ b/app/code/core/Mage/Sales/Model/Order/Invoice/Comment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Invoice/Config.php b/app/code/core/Mage/Sales/Model/Order/Invoice/Config.php index 1050ff63fd..ce62386259 100644 --- a/app/code/core/Mage/Sales/Model/Order/Invoice/Config.php +++ b/app/code/core/Mage/Sales/Model/Order/Invoice/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -31,32 +31,20 @@ * @package Mage_Sales * @author Magento Core Team */ -class Mage_Sales_Model_Order_Invoice_Config extends Mage_Core_Model_Config_Base +class Mage_Sales_Model_Order_Invoice_Config extends Mage_Sales_Model_Order_Total_Config_Base { - protected $_totalModels = null; - - public function __construct() - { - parent::__construct(Mage::getConfig()->getNode('global/sales/order_invoice')); - } - /** - * Retrieve invoice total calculation models + * Cache key for collectors * - * @return array + * @var string */ - public function getTotalModels() + protected $_collectorsCacheKey = 'sorted_order_invoice_collectors'; + + /** + * Constructor + */ + public function __construct() { - if (is_null($this->_totalModels)) { - $this->_totalModels = array(); - $totalsConfig = $this->getNode('totals'); - foreach ($totalsConfig->children() as $totalCode=>$totalConfig) { - $class = $totalConfig->getClassName(); - if ($class && ($model = Mage::getModel($class))) { - $this->_totalModels[] = $model; - } - } - } - return $this->_totalModels; + parent::__construct(Mage::getConfig()->getNode('global/sales/order_invoice')); } } diff --git a/app/code/core/Mage/Sales/Model/Order/Invoice/Item.php b/app/code/core/Mage/Sales/Model/Order/Invoice/Item.php index 6e27f7e044..52154e41df 100644 --- a/app/code/core/Mage/Sales/Model/Order/Invoice/Item.php +++ b/app/code/core/Mage/Sales/Model/Order/Invoice/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Abstract.php b/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Abstract.php index dfca69d047..3a16ce424c 100644 --- a/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Abstract.php +++ b/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Abstract.php @@ -20,13 +20,25 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - -abstract class Mage_Sales_Model_Order_Invoice_Total_Abstract +/** + * Base class for invoice total + * + * @category Mage + * @package Mage_Sales + * @author Magento Core Team + */ +abstract class Mage_Sales_Model_Order_Invoice_Total_Abstract extends Mage_Sales_Model_Order_Total_Abstract { + /** + * Collect invoice subtotal + * + * @param Mage_Sales_Model_Order_Invoice $invoice + * @return Mage_Sales_Model_Order_Invoice_Total_Abstract + */ public function collect(Mage_Sales_Model_Order_Invoice $invoice) { return $this; diff --git a/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Cost.php b/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Cost.php index 230b1d8c40..7ad780b3de 100644 --- a/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Cost.php +++ b/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Cost.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Discount.php b/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Discount.php index 7d39444a28..da63378919 100644 --- a/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Discount.php +++ b/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Discount.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -54,10 +54,14 @@ public function collect(Mage_Sales_Model_Order_Invoice $invoice) /** @var $item Mage_Sales_Model_Order_Invoice_Item */ foreach ($invoice->getAllItems() as $item) { - if ($item->getOrderItem()->isDummy()) { - continue; - } $orderItem = $item->getOrderItem(); + $parentOrderItem = $orderItem->getParentItem(); + if (($orderItem->isDummy() && !$orderItem->getForceApplyDiscountToParentItem()) + || ($parentOrderItem && $orderItem->getForceApplyDiscountToParentItem()) + ) { + continue; + } + $orderItemDiscount = (float) $orderItem->getDiscountAmount(); $baseOrderItemDiscount = (float) $orderItem->getBaseDiscountAmount(); $orderItemQty = $orderItem->getQtyOrdered(); diff --git a/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Grand.php b/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Grand.php index c8e754d82f..33b5b207d3 100644 --- a/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Grand.php +++ b/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Grand.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Shipping.php b/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Shipping.php index 371e58fac5..8ccba86065 100644 --- a/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Shipping.php +++ b/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Shipping.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Subtotal.php b/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Subtotal.php index e61d1c393f..168ee52967 100644 --- a/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Subtotal.php +++ b/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Subtotal.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Tax.php b/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Tax.php index 8d5574f508..fc5a63ac62 100644 --- a/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Tax.php +++ b/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Item.php b/app/code/core/Mage/Sales/Model/Order/Item.php index 7e3692ef26..dbd23a0637 100644 --- a/app/code/core/Mage/Sales/Model/Order/Item.php +++ b/app/code/core/Mage/Sales/Model/Order/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -654,6 +654,21 @@ public function isChildrenCalculated() { } return false; } + /** + * Check if discount has to be applied to parent item + * + * @return bool + */ + public function getForceApplyDiscountToParentItem() + { + if ($this->getParentItem()) { + $product = $this->getParentItem()->getProduct(); + } else { + $product = $this->getProduct(); + } + + return $product->getTypeInstance()->getForceApplyDiscountToParentItem(); + } /** * Return checking of what shipment @@ -736,4 +751,19 @@ public function getBuyRequest() $buyRequest->setQty($this->getQtyOrdered() * 1); return $buyRequest; } + + /** + * Retrieve product + * + * @return Mage_Catalog_Model_Product + */ + public function getProduct() + { + if (!$this->getData('product')) { + $product = Mage::getModel('catalog/product')->load($this->getProductId()); + $this->setProduct($product); + } + + return $this->getData('product'); + } } diff --git a/app/code/core/Mage/Sales/Model/Order/Payment.php b/app/code/core/Mage/Sales/Model/Order/Payment.php index 6a96243724..e3c84ccc28 100644 --- a/app/code/core/Mage/Sales/Model/Order/Payment.php +++ b/app/code/core/Mage/Sales/Model/Order/Payment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Payment/Transaction.php b/app/code/core/Mage/Sales/Model/Order/Payment/Transaction.php index 64afb5fa8a..1fad0d304e 100644 --- a/app/code/core/Mage/Sales/Model/Order/Payment/Transaction.php +++ b/app/code/core/Mage/Sales/Model/Order/Payment/Transaction.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Pdf/Abstract.php b/app/code/core/Mage/Sales/Model/Order/Pdf/Abstract.php index 43a134ef15..f557e9a682 100644 --- a/app/code/core/Mage/Sales/Model/Order/Pdf/Abstract.php +++ b/app/code/core/Mage/Sales/Model/Order/Pdf/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -222,9 +222,10 @@ protected function insertOrder(&$page, $obj, $putOrderId = true) $paymentInfo = Mage::helper('payment')->getInfoBlock($order->getPayment()) ->setIsSecureMode(true) ->toPdf(); + $paymentInfo = htmlspecialchars_decode($paymentInfo, ENT_QUOTES); $payment = explode('{{pdf_row_separator}}', $paymentInfo); foreach ($payment as $key=>$value){ - if (strip_tags(trim($value))==''){ + if (strip_tags(trim($value)) == '') { unset($payment[$key]); } } diff --git a/app/code/core/Mage/Sales/Model/Order/Pdf/Creditmemo.php b/app/code/core/Mage/Sales/Model/Order/Pdf/Creditmemo.php index 7f9e69fcc9..ddbf5c12cc 100644 --- a/app/code/core/Mage/Sales/Model/Order/Pdf/Creditmemo.php +++ b/app/code/core/Mage/Sales/Model/Order/Pdf/Creditmemo.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Pdf/Invoice.php b/app/code/core/Mage/Sales/Model/Order/Pdf/Invoice.php index da5e56330d..2612b60fc0 100644 --- a/app/code/core/Mage/Sales/Model/Order/Pdf/Invoice.php +++ b/app/code/core/Mage/Sales/Model/Order/Pdf/Invoice.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Abstract.php b/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Abstract.php index c6fbc952a1..86cfec3526 100644 --- a/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Abstract.php +++ b/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -241,6 +241,48 @@ protected function _parseDescription() return array($description); } + /** + * Get array of arrays with item prices information for display in PDF + * array( + * $index => array( + * 'label' => $label, + * 'price' => $price, + * 'subtotal' => $subtotal + * ) + * ) + * @return array + */ + public function getItemPricesForDisplay() + { + $order = $this->getOrder(); + $item = $this->getItem(); + if (Mage::helper('tax')->displaySalesBothPrices()) { + $prices = array( + array( + 'label' => Mage::helper('tax')->__('Excl. Tax') . ':', + 'price' => $order->formatPriceTxt($item->getPrice()), + 'subtotal' => $order->formatPriceTxt($item->getRowTotal()) + ), + array( + 'label' => Mage::helper('tax')->__('Incl. Tax') . ':', + 'price' => $order->formatPriceTxt($item->getPriceInclTax()), + 'subtotal' => $order->formatPriceTxt($item->getRowTotalInclTax()) + ), + ); + } elseif (Mage::helper('tax')->displaySalesPriceInclTax()) { + $prices = array(array( + 'price' => $order->formatPriceTxt($item->getPriceInclTax()), + 'subtotal' => $order->formatPriceTxt($item->getRowTotalInclTax()), + )); + } else { + $prices = array(array( + 'price' => $order->formatPriceTxt($item->getPrice()), + 'subtotal' => $order->formatPriceTxt($item->getRowTotal()), + )); + } + return $prices; + } + public function getItemOptions() { $result = array(); if ($options = $this->getItem()->getOrderItem()->getProductOptions()) { diff --git a/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Creditmemo/Default.php b/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Creditmemo/Default.php index e984a11e13..bfeb865886 100644 --- a/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Creditmemo/Default.php +++ b/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Creditmemo/Default.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -61,13 +61,29 @@ public function draw() $x += 100; // draw Total (ex) - $lines[0][] = array( - 'text' => $order->formatPriceTxt($item->getRowTotal()), - 'feed' => $x, - 'font' => 'bold', - 'align' => 'right', - 'width' => 50, - ); + $i = 0; + $prices = $this->getItemPricesForDisplay(); + foreach ($prices as $priceData){ + if (isset($priceData['label'])) { + // draw Subtotal label + $lines[$i][] = array( + 'text' => $priceData['label'], + 'feed' => $x, + 'align' => 'right', + 'width' => 50, + ); + $i++; + } + // draw Subtotal + $lines[$i][] = array( + 'text' => $priceData['subtotal'], + 'feed' => $x, + 'font' => 'bold', + 'align' => 'right', + 'width' => 50, + ); + $i++; + } $x += 50; // draw Discount @@ -101,8 +117,10 @@ public function draw() $x += 45; // draw Subtotal + $subtotal = $item->getRowTotal() + + $item->getTaxAmount() + $item->getHiddenTaxAmount() - $item->getDiscountAmount(); $lines[0][] = array( - 'text' => $order->formatPriceTxt($item->getRowTotal() + $item->getTaxAmount() - $item->getDiscountAmount()), + 'text' => $order->formatPriceTxt($subtotal), 'feed' => $rightBound, 'font' => 'bold', 'align' => 'right' diff --git a/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Creditmemo/Grouped.php b/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Creditmemo/Grouped.php index 82e3baaf29..2133347a7e 100644 --- a/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Creditmemo/Grouped.php +++ b/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Creditmemo/Grouped.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Invoice/Default.php b/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Invoice/Default.php index 4bd3daef38..b174967038 100644 --- a/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Invoice/Default.php +++ b/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Invoice/Default.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -64,13 +64,41 @@ public function draw() 'feed' => 435 ); - // draw Price - $lines[0][] = array( - 'text' => $order->formatPriceTxt($item->getPrice()), - 'feed' => 395, - 'font' => 'bold', - 'align' => 'right' - ); + // draw item Prices + $i = 0; + $prices = $this->getItemPricesForDisplay(); + foreach ($prices as $priceData){ + if (isset($priceData['label'])) { + // draw Price label + $lines[$i][] = array( + 'text' => $priceData['label'], + 'feed' => 395, + 'align' => 'right' + ); + // draw Subtotal label + $lines[$i][] = array( + 'text' => $priceData['label'], + 'feed' => 565, + 'align' => 'right' + ); + $i++; + } + // draw Price + $lines[$i][] = array( + 'text' => $priceData['price'], + 'feed' => 395, + 'font' => 'bold', + 'align' => 'right' + ); + // draw Subtotal + $lines[$i][] = array( + 'text' => $priceData['subtotal'], + 'feed' => 565, + 'font' => 'bold', + 'align' => 'right' + ); + $i++; + } // draw Tax $lines[0][] = array( @@ -80,14 +108,6 @@ public function draw() 'align' => 'right' ); - // draw Subtotal - $lines[0][] = array( - 'text' => $order->formatPriceTxt($item->getRowTotal()), - 'feed' => 565, - 'font' => 'bold', - 'align' => 'right' - ); - // custom options $options = $this->getItemOptions(); if ($options) { @@ -100,7 +120,11 @@ public function draw() ); if ($option['value']) { - $_printValue = isset($option['print_value']) ? $option['print_value'] : strip_tags($option['value']); + if (isset($option['print_value'])) { + $_printValue = $option['print_value']; + } else { + $_printValue = strip_tags($option['value']); + } $values = explode(', ', $_printValue); foreach ($values as $value) { $lines[][] = array( diff --git a/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Invoice/Grouped.php b/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Invoice/Grouped.php index c77cd27ceb..71d764fe76 100644 --- a/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Invoice/Grouped.php +++ b/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Invoice/Grouped.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Shipment/Default.php b/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Shipment/Default.php index 8906af359e..1eb83eeee7 100644 --- a/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Shipment/Default.php +++ b/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Shipment/Default.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Pdf/Shipment.php b/app/code/core/Mage/Sales/Model/Order/Pdf/Shipment.php index b506370f85..84eded40d3 100644 --- a/app/code/core/Mage/Sales/Model/Order/Pdf/Shipment.php +++ b/app/code/core/Mage/Sales/Model/Order/Pdf/Shipment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Pdf/Shipment/Packaging.php b/app/code/core/Mage/Sales/Model/Order/Pdf/Shipment/Packaging.php index 30de9271c5..f2c4e40d7d 100644 --- a/app/code/core/Mage/Sales/Model/Order/Pdf/Shipment/Packaging.php +++ b/app/code/core/Mage/Sales/Model/Order/Pdf/Shipment/Packaging.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Pdf/Total/Default.php b/app/code/core/Mage/Sales/Model/Order/Pdf/Total/Default.php index cc41f5cd9a..d83a239a67 100644 --- a/app/code/core/Mage/Sales/Model/Order/Pdf/Total/Default.php +++ b/app/code/core/Mage/Sales/Model/Order/Pdf/Total/Default.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Shipment.php b/app/code/core/Mage/Sales/Model/Order/Shipment.php index 837963f1ef..7ec959ae0e 100644 --- a/app/code/core/Mage/Sales/Model/Order/Shipment.php +++ b/app/code/core/Mage/Sales/Model/Order/Shipment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Shipment/Api.php b/app/code/core/Mage/Sales/Model/Order/Shipment/Api.php index 8ec3dc3741..68ada16a84 100644 --- a/app/code/core/Mage/Sales/Model/Order/Shipment/Api.php +++ b/app/code/core/Mage/Sales/Model/Order/Shipment/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Shipment/Api/V2.php b/app/code/core/Mage/Sales/Model/Order/Shipment/Api/V2.php index 3484fe235f..73c87874ac 100644 --- a/app/code/core/Mage/Sales/Model/Order/Shipment/Api/V2.php +++ b/app/code/core/Mage/Sales/Model/Order/Shipment/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Shipment/Comment.php b/app/code/core/Mage/Sales/Model/Order/Shipment/Comment.php index d848dc01c4..5b961611fb 100644 --- a/app/code/core/Mage/Sales/Model/Order/Shipment/Comment.php +++ b/app/code/core/Mage/Sales/Model/Order/Shipment/Comment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Shipment/Item.php b/app/code/core/Mage/Sales/Model/Order/Shipment/Item.php index 3d5d82b1c8..8eb248d1a4 100644 --- a/app/code/core/Mage/Sales/Model/Order/Shipment/Item.php +++ b/app/code/core/Mage/Sales/Model/Order/Shipment/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Shipment/Track.php b/app/code/core/Mage/Sales/Model/Order/Shipment/Track.php index 393c2ba446..6d0bc6ff88 100644 --- a/app/code/core/Mage/Sales/Model/Order/Shipment/Track.php +++ b/app/code/core/Mage/Sales/Model/Order/Shipment/Track.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Status.php b/app/code/core/Mage/Sales/Model/Order/Status.php index 29859db4a3..4c1acb7fd9 100644 --- a/app/code/core/Mage/Sales/Model/Order/Status.php +++ b/app/code/core/Mage/Sales/Model/Order/Status.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Status/History.php b/app/code/core/Mage/Sales/Model/Order/Status/History.php index 29d0779c40..0aea627cce 100644 --- a/app/code/core/Mage/Sales/Model/Order/Status/History.php +++ b/app/code/core/Mage/Sales/Model/Order/Status/History.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Tax.php b/app/code/core/Mage/Sales/Model/Order/Tax.php index f094ef695c..1676dbfd8f 100644 --- a/app/code/core/Mage/Sales/Model/Order/Tax.php +++ b/app/code/core/Mage/Sales/Model/Order/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Total.php b/app/code/core/Mage/Sales/Model/Order/Total.php index a82ac34539..59d79d4774 100644 --- a/app/code/core/Mage/Sales/Model/Order/Total.php +++ b/app/code/core/Mage/Sales/Model/Order/Total.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Total/Abstract.php b/app/code/core/Mage/Sales/Model/Order/Total/Abstract.php new file mode 100644 index 0000000000..760f7aca9c --- /dev/null +++ b/app/code/core/Mage/Sales/Model/Order/Total/Abstract.php @@ -0,0 +1,47 @@ + + */ +abstract class Mage_Sales_Model_Order_Total_Abstract extends Varien_Object +{ + /** + * Process model configuration array. + * This method can be used for changing models apply sort order + * + * @param array $config + * @return array + */ + public function processConfigArray($config) + { + return $config; + } +} diff --git a/app/code/core/Mage/Sales/Model/Order/Total/Config/Base.php b/app/code/core/Mage/Sales/Model/Order/Total/Config/Base.php new file mode 100644 index 0000000000..cf8d96f1c2 --- /dev/null +++ b/app/code/core/Mage/Sales/Model/Order/Total/Config/Base.php @@ -0,0 +1,94 @@ + + */ +class Mage_Sales_Model_Order_Total_Config_Base extends Mage_Sales_Model_Config_Ordered +{ + /** + * Cache key for collectors + * + * @var string + */ + protected $_collectorsCacheKey = 'sorted_collectors'; + + /** + * Total models list + * + * @var array + */ + protected $_totalModels = array(); + + /** + * Configuration path where to collect registered totals + * + * @var string + */ + protected $_totalsConfigNode = 'totals'; + + /** + * Init model class by configuration + * + * @param string $class + * @param string $totalCode + * @param array $totalConfig + * @return Mage_Sales_Model_Order_Total_Abstract + */ + protected function _initModelInstance($class, $totalCode, $totalConfig) + { + $model = Mage::getModel($class); + if (!$model instanceof Mage_Sales_Model_Order_Total_Abstract) { + Mage::throwException(Mage::helper('sales')->__('Total model should be extended from Mage_Sales_Model_Order_Total_Abstract.')); + } + + $model->setCode($totalCode); + $model->setTotalConfigNode($totalConfig); + $this->_modelsConfig[$totalCode] = $this->_prepareConfigArray($totalCode, $totalConfig); + $this->_modelsConfig[$totalCode] = $model->processConfigArray($this->_modelsConfig[$totalCode]); + return $model; + } + + /** + * Retrieve total calculation models + * + * @return array + */ + public function getTotalModels() + { + if (empty($this->_totalModels)) { + $this->_initModels(); + $this->_initCollectors(); + $this->_totalModels = $this->_collectors; + } + return $this->_totalModels; + } +} diff --git a/app/code/core/Mage/Sales/Model/Payment/Method/Billing/AgreementAbstract.php b/app/code/core/Mage/Sales/Model/Payment/Method/Billing/AgreementAbstract.php index e35b8dcf7f..2b0aac57a5 100644 --- a/app/code/core/Mage/Sales/Model/Payment/Method/Billing/AgreementAbstract.php +++ b/app/code/core/Mage/Sales/Model/Payment/Method/Billing/AgreementAbstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Quote.php b/app/code/core/Mage/Sales/Model/Quote.php index 0ff6ee2c30..b60891b2dc 100644 --- a/app/code/core/Mage/Sales/Model/Quote.php +++ b/app/code/core/Mage/Sales/Model/Quote.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -129,6 +129,8 @@ * @method Mage_Sales_Model_Quote setExtShippingInfo(string $value) * @method int getGiftMessageId() * @method Mage_Sales_Model_Quote setGiftMessageId(int $value) + * @method bool|null getIsPersistent() + * @method Mage_Sales_Model_Quote setIsPersistent(bool $value) * * @category Mage * @package Mage_Sales @@ -174,6 +176,13 @@ class Mage_Sales_Model_Quote extends Mage_Core_Model_Abstract */ protected $_errorInfoGroups = array(); + /** + * Whether quote should not be saved + * + * @var bool + */ + protected $_preventSaving = false; + /** * Init resource model */ @@ -479,7 +488,7 @@ public function getCustomerTaxClassId() { /* * tax class can vary at any time. so instead of using the value from session, - * we need to retrieve from db everytime to get the correct tax class + * we need to retrieve from db every time to get the correct tax class */ //if (!$this->getData('customer_group_id') && !$this->getData('customer_tax_class_id')) { $classId = Mage::getModel('customer/group')->getTaxClassId($this->getCustomerGroupId()); @@ -690,6 +699,9 @@ public function addShippingAddress(Mage_Sales_Model_Quote_Address $address) */ public function getItemsCollection($useCache = true) { + if ($this->hasItemsCollection()) { + return $this->getData('items_collection'); + } if (is_null($this->_items)) { $this->_items = Mage::getModel('sales/quote_item')->getCollection(); $this->_items->setQuote($this); @@ -824,8 +836,12 @@ public function removeItem($itemId) */ public function removeAllItems() { - foreach ($this->getItemsCollection() as $item) { - $item->isDeleted(true); + foreach ($this->getItemsCollection() as $itemId => $item) { + if (is_null($item->getId())) { + $this->getItemsCollection()->removeItemByKey($itemId); + } else { + $item->isDeleted(true); + } } return $this; } @@ -928,7 +944,10 @@ public function addProductAdvanced(Mage_Catalog_Model_Product $product, $request // collect errors instead of throwing first one if ($item->getHasError()) { - $errors[] = $item->getMessage(); + $message = $item->getMessage(); + if (!in_array($message, $errors)) { // filter duplicate messages + $errors[] = $message; + } } } if (!empty($errors)) { @@ -1854,4 +1873,28 @@ public function isAllowedGuestCheckout() { return Mage::helper('checkout')->isAllowedGuestCheckout($this, $this->getStoreId()); } + + /** + * Prevent quote from saving + * + * @return Mage_Sales_Model_Quote + */ + public function preventSaving() + { + $this->_preventSaving = true; + return $this; + } + + /** + * Save quote with prevention checking + * + * @return Mage_Sales_Model_Quote + */ + public function save() + { + if ($this->_preventSaving) { + return $this; + } + return parent::save(); + } } diff --git a/app/code/core/Mage/Sales/Model/Quote/Address.php b/app/code/core/Mage/Sales/Model/Quote/Address.php index 2764d48de8..be1bab12b6 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Address.php +++ b/app/code/core/Mage/Sales/Model/Quote/Address.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -139,12 +139,21 @@ */ class Mage_Sales_Model_Quote_Address extends Mage_Customer_Model_Address_Abstract { - const TYPE_BILLING = 'billing'; - const TYPE_SHIPPING = 'shipping'; const RATES_FETCH = 1; const RATES_RECALCULATE = 2; + /** + * Prefix of model events + * + * @var string + */ protected $_eventPrefix = 'sales_quote_address'; + + /** + * Name of event object + * + * @var string + */ protected $_eventObject = 'quote_address'; /** @@ -943,9 +952,11 @@ public function getTotalModels() */ public function collectTotals() { + Mage::dispatchEvent($this->_eventPrefix . '_collect_totals_before', array($this->_eventObject => $this)); foreach ($this->getTotalCollector()->getCollectors() as $model) { $model->collect($this); } + Mage::dispatchEvent($this->_eventPrefix . '_collect_totals_after', array($this->_eventObject => $this)); return $this; } diff --git a/app/code/core/Mage/Sales/Model/Quote/Address/Item.php b/app/code/core/Mage/Sales/Model/Quote/Address/Item.php index cb4f05ae1e..f1170f9ef6 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Address/Item.php +++ b/app/code/core/Mage/Sales/Model/Quote/Address/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Quote/Address/Rate.php b/app/code/core/Mage/Sales/Model/Quote/Address/Rate.php index 8d5f0340e4..836d9f2d86 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Address/Rate.php +++ b/app/code/core/Mage/Sales/Model/Quote/Address/Rate.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Quote/Address/Total.php b/app/code/core/Mage/Sales/Model/Quote/Address/Total.php index 1d8696b1da..78a93be93a 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Address/Total.php +++ b/app/code/core/Mage/Sales/Model/Quote/Address/Total.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Abstract.php b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Abstract.php index 3761bd16e1..27b3b0f255 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Abstract.php +++ b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Collector.php b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Collector.php index 15edc7a546..f353092cee 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Collector.php +++ b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Collector.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -31,34 +31,13 @@ * @package Mage_Core * @author Magento Core Team */ -class Mage_Sales_Model_Quote_Address_Total_Collector +class Mage_Sales_Model_Quote_Address_Total_Collector extends Mage_Sales_Model_Config_Ordered { /** * Path to sort order values of checkout totals */ const XML_PATH_SALES_TOTALS_SORT = 'sales/totals_sort'; - /** - * Total models array - * - * @var array - */ - protected $_models = array(); - - /** - * Total models configuration - * - * @var array - */ - protected $_modelsConfig = array(); - - /** - * Total models array ordered for right calculation logic - * - * @var array - */ - protected $_collectors = array(); - /** * Total models array ordered for right display sequence * @@ -125,173 +104,48 @@ public function getRetrievers() } /** - * Initialize total models configuration and objects - * - * @return Mage_Sales_Model_Quote_Address_Total_Collector - */ - protected function _initModels() - { - $totalsConfig = Mage::getConfig()->getNode($this->_totalsConfigNode); - - foreach ($totalsConfig->children() as $totalCode=>$totalConfig) { - $class = $totalConfig->getClassName(); - if ($class) { - $model = Mage::getModel($class); - if ($model instanceof Mage_Sales_Model_Quote_Address_Total_Abstract) { - $model->setCode($totalCode); - $this->_modelsConfig[$totalCode]= $this->_prepareConfigArray($totalCode, $totalConfig); - $this->_modelsConfig[$totalCode]= $model->processConfigArray( - $this->_modelsConfig[$totalCode], - $this->_store - ); - $this->_models[$totalCode] = $model; - } else { - Mage::throwException( - Mage::helper('sales')->__('The address total model should be extended from Mage_Sales_Model_Quote_Address_Total_Abstract.') - ); - } - } - } - return $this; - } - - /** - * Prepare configuration array for total model - * - * @param string $code - * @param Mage_Core_Model_Config_Element $totalConfig - * @return array - */ - protected function _prepareConfigArray($code, $totalConfig) - { - $totalConfig = (array) $totalConfig; - if (isset($totalConfig['before'])) { - $totalConfig['before'] = explode(',',$totalConfig['before']); - } else { - $totalConfig['before'] = array(); - } - if (isset($totalConfig['after'])) { - $totalConfig['after'] = explode(',',$totalConfig['after']); - } else { - $totalConfig['after'] = array(); - } - $totalConfig['_code'] = $code; - return $totalConfig; - } - - /** - * Aggregate before/after information from all items and sort totals based on this data + * Init model class by configuration * - * @return array + * @param string $class + * @param string $totalCode + * @param array $totalConfig + * @return Mage_Sales_Model_Quote_Address_Total_Abstract */ - protected function _getSortedCollectorCodes() + protected function _initModelInstance($class, $totalCode, $totalConfig) { - if (Mage::app()->useCache('config')) { - $cachedData = Mage::app()->loadCache($this->_collectorsCacheKey); - if ($cachedData) { - return unserialize($cachedData); - } - } - $configArray = $this->_modelsConfig; - // invoke simple sorting if the first element contains the "sort_order" key - reset($configArray); $element = current($configArray); - if (isset($element['sort_order'])) { - uasort($configArray, array($this, '_compareSortOrder')); - } else { - foreach ($configArray as $code => $data) { - foreach ($data['before'] as $beforeCode) { - if (!isset($configArray[$beforeCode])) { - continue; - } - $configArray[$code]['before'] = array_merge( - $configArray[$code]['before'], $configArray[$beforeCode]['before'] - ); - $configArray[$beforeCode]['after'] = array_merge( - $configArray[$beforeCode]['after'], array($code), $data['after'] - ); - $configArray[$beforeCode]['after'] = array_unique($configArray[$beforeCode]['after']); - } - foreach ($data['after'] as $afterCode) { - if (!isset($configArray[$afterCode])) { - continue; - } - $configArray[$code]['after'] = array_merge( - $configArray[$code]['after'], $configArray[$afterCode]['after'] - ); - $configArray[$afterCode]['before'] = array_merge( - $configArray[$afterCode]['before'], array($code), $data['before'] - ); - $configArray[$afterCode]['before'] = array_unique($configArray[$afterCode]['before']); - } - } - uasort($configArray, array($this, '_compareTotals')); + $model = Mage::getModel($class); + if (!$model instanceof Mage_Sales_Model_Quote_Address_Total_Abstract) { + Mage::throwException( + Mage::helper('sales')->__('The address total model should be extended from Mage_Sales_Model_Quote_Address_Total_Abstract.') + ); } - $sortedCollectors = array_keys($configArray); - if (Mage::app()->useCache('config')) { - Mage::app()->saveCache(serialize($sortedCollectors), $this->_collectorsCacheKey, array( - Mage_Core_Model_Config::CACHE_TAG - )); - } - return $sortedCollectors; - } - /** - * Initialize collectors array. - * Collectors array is array of total models ordered based on configuration settings - * - * @return Mage_Sales_Model_Quote_Address_Total_Collector - */ - protected function _initCollectors() - { - $sortedCodes = $this->_getSortedCollectorCodes(); - foreach ($sortedCodes as $code) { - $this->_collectors[$code] = $this->_models[$code]; - } + $model->setCode($totalCode); + $this->_modelsConfig[$totalCode]= $this->_prepareConfigArray($totalCode, $totalConfig); + $this->_modelsConfig[$totalCode]= $model->processConfigArray( + $this->_modelsConfig[$totalCode], + $this->_store + ); - return $this; + return $model; } /** - * uasort callback function + * Initialize total models configuration and objects * - * @param array $a - * @param array $b - * @return int + * @return Mage_Sales_Model_Quote_Address_Total_Collector */ - protected function _compareTotals($a, $b) + protected function _initModels() { - $aCode = $a['_code']; - $bCode = $b['_code']; - if (in_array($aCode, $b['after']) || in_array($bCode, $a['before'])) { - $res = -1; - } elseif (in_array($bCode, $a['after']) || in_array($aCode, $b['before'])) { - $res = 1; - } else { - $res = 0; - } - return $res; - } + $totalsConfig = Mage::getConfig()->getNode($this->_totalsConfigNode); - /** - * uasort() callback that uses sort_order for comparison - * - * @param array $a - * @param array $b - * @return int - */ - protected function _compareSortOrder($a, $b) - { - if (!isset($a['sort_order']) || !isset($b['sort_order'])) { - return 0; - } - if ($a['sort_order'] > $b['sort_order']) { - $res = 1; - } elseif ($a['sort_order'] < $b['sort_order']) { - $res = -1; - } else { - $res = 0; + foreach ($totalsConfig->children() as $totalCode => $totalConfig) { + $class = $totalConfig->getClassName(); + if (!empty($class)) { + $this->_models[$totalCode] = $this->_initModelInstance($class, $totalCode, $totalConfig); + } } - return $res; + return $this; } /** diff --git a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Custbalance.php b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Custbalance.php index aa62d63bac..ef6642722f 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Custbalance.php +++ b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Custbalance.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Discount.php b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Discount.php index 5ba7816a67..f84dd6523c 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Discount.php +++ b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Discount.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Grand.php b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Grand.php index f52e404111..ffa168074b 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Grand.php +++ b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Grand.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -47,7 +47,7 @@ public function collect(Mage_Sales_Model_Quote_Address $address) } /** - * Add grand total information to adderess + * Add grand total information to address * * @param Mage_Sales_Model_Quote_Address $address * @return Mage_Sales_Model_Quote_Address_Total_Grand diff --git a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Msrp.php b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Msrp.php index 72f5dd624c..762b1934fe 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Msrp.php +++ b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Msrp.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Nominal.php b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Nominal.php index 252818621e..e04bcc0a73 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Nominal.php +++ b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Nominal.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Nominal/Collector.php b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Nominal/Collector.php index c96a0b3622..f9b5188e90 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Nominal/Collector.php +++ b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Nominal/Collector.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Nominal/Recurring/Initial.php b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Nominal/Recurring/Initial.php index a5739429b4..10be084466 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Nominal/Recurring/Initial.php +++ b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Nominal/Recurring/Initial.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Nominal/Recurring/Trial.php b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Nominal/Recurring/Trial.php index 12438d220e..06484f64fe 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Nominal/Recurring/Trial.php +++ b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Nominal/Recurring/Trial.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Nominal/RecurringAbstract.php b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Nominal/RecurringAbstract.php index ac0c77b096..5c11e993dc 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Nominal/RecurringAbstract.php +++ b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Nominal/RecurringAbstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -65,7 +65,10 @@ public function collect(Mage_Sales_Model_Quote_Address $address) if ($item->getProduct()->isRecurring()) { $profileData = $item->getProduct()->getRecurringProfile(); if (!empty($profileData[$this->_profileDataKey])) { - $item->setData($this->_itemRowTotalKey, $profileData[$this->_profileDataKey]); + $item->setData( + $this->_itemRowTotalKey, + $address->getQuote()->getStore()->convertPrice($profileData[$this->_profileDataKey]) + ); $this->_afterCollectSuccess($address, $item); } } diff --git a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Nominal/Shipping.php b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Nominal/Shipping.php index 0434115440..16b91ef64f 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Nominal/Shipping.php +++ b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Nominal/Shipping.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Nominal/Subtotal.php b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Nominal/Subtotal.php index 8b41e872a0..e5457f784c 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Nominal/Subtotal.php +++ b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Nominal/Subtotal.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Shipping.php b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Shipping.php index 4329fe555a..8622479d53 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Shipping.php +++ b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Shipping.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Subtotal.php b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Subtotal.php index d0cbed14b3..4889e314a6 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Subtotal.php +++ b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Subtotal.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Tax.php b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Tax.php index 1645cf7997..d32fc6d719 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Tax.php +++ b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -51,7 +51,12 @@ public function collect(Mage_Sales_Model_Quote_Address $address) $taxCalculationModel = Mage::getSingleton('tax/calculation'); /* @var $taxCalculationModel Mage_Tax_Model_Calculation */ - $request = $taxCalculationModel->getRateRequest($address, $address->getQuote()->getBillingAddress(), $custTaxClassId, $store); + $request = $taxCalculationModel->getRateRequest( + $address, + $address->getQuote()->getBillingAddress(), + $custTaxClassId, + $store + ); foreach ($items as $item) { /** @@ -69,17 +74,27 @@ public function collect(Mage_Sales_Model_Quote_Address $address) $discountBefore = $item->getDiscountAmount(); $baseDiscountBefore = $item->getBaseDiscountAmount(); - $rate = $taxCalculationModel->getRate($request->setProductClassId($child->getProduct()->getTaxClassId())); + $rate = $taxCalculationModel->getRate( + $request->setProductClassId($child->getProduct()->getTaxClassId()) + ); $child->setTaxPercent($rate); $child->calcTaxAmount(); if ($discountBefore != $item->getDiscountAmount()) { - $address->setDiscountAmount($address->getDiscountAmount()+($item->getDiscountAmount()-$discountBefore)); - $address->setBaseDiscountAmount($address->getBaseDiscountAmount()+($item->getBaseDiscountAmount()-$baseDiscountBefore)); - - $address->setGrandTotal($address->getGrandTotal() - ($item->getDiscountAmount()-$discountBefore)); - $address->setBaseGrandTotal($address->getBaseGrandTotal() - ($item->getBaseDiscountAmount()-$baseDiscountBefore)); + $address->setDiscountAmount( + $address->getDiscountAmount() + ($item->getDiscountAmount() - $discountBefore) + ); + $address->setBaseDiscountAmount( + $address->getBaseDiscountAmount() + ($item->getBaseDiscountAmount() - $baseDiscountBefore) + ); + + $address->setGrandTotal( + $address->getGrandTotal() - ($item->getDiscountAmount() - $discountBefore) + ); + $address->setBaseGrandTotal( + $address->getBaseGrandTotal() - ($item->getBaseDiscountAmount() - $baseDiscountBefore) + ); } $this->_saveAppliedTaxes( @@ -90,28 +105,42 @@ public function collect(Mage_Sales_Model_Quote_Address $address) $rate ); } - $address->setTaxAmount($address->getTaxAmount() + $item->getTaxAmount()); - $address->setBaseTaxAmount($address->getBaseTaxAmount() + $item->getBaseTaxAmount()); + $itemTaxAmount = $item->getTaxAmount() + $item->getDiscountTaxCompensation(); + $address->setTaxAmount($address->getTaxAmount() + $itemTaxAmount); + $itemBaseTaxAmount = $item->getBaseTaxAmount() + $item->getBaseDiscountTaxCompensation(); + $address->setBaseTaxAmount($address->getBaseTaxAmount() + $itemBaseTaxAmount); } else { $discountBefore = $item->getDiscountAmount(); $baseDiscountBefore = $item->getBaseDiscountAmount(); - $rate = $taxCalculationModel->getRate($request->setProductClassId($item->getProduct()->getTaxClassId())); + $rate = $taxCalculationModel->getRate( + $request->setProductClassId($item->getProduct()->getTaxClassId()) + ); $item->setTaxPercent($rate); $item->calcTaxAmount(); if ($discountBefore != $item->getDiscountAmount()) { - $address->setDiscountAmount($address->getDiscountAmount()+($item->getDiscountAmount()-$discountBefore)); - $address->setBaseDiscountAmount($address->getBaseDiscountAmount()+($item->getBaseDiscountAmount()-$baseDiscountBefore)); + $address->setDiscountAmount( + $address->getDiscountAmount() + ($item->getDiscountAmount() - $discountBefore) + ); + $address->setBaseDiscountAmount( + $address->getBaseDiscountAmount() + ($item->getBaseDiscountAmount() - $baseDiscountBefore) + ); - $address->setGrandTotal($address->getGrandTotal() - ($item->getDiscountAmount()-$discountBefore)); - $address->setBaseGrandTotal($address->getBaseGrandTotal() - ($item->getBaseDiscountAmount()-$baseDiscountBefore)); + $address->setGrandTotal( + $address->getGrandTotal() - ($item->getDiscountAmount() - $discountBefore) + ); + $address->setBaseGrandTotal( + $address->getBaseGrandTotal() - ($item->getBaseDiscountAmount() - $baseDiscountBefore) + ); } - $address->setTaxAmount($address->getTaxAmount() + $item->getTaxAmount()); - $address->setBaseTaxAmount($address->getBaseTaxAmount() + $item->getBaseTaxAmount()); + $itemTaxAmount = $item->getTaxAmount() + $item->getDiscountTaxCompensation(); + $address->setTaxAmount($address->getTaxAmount() + $itemTaxAmount); + $itemBaseTaxAmount = $item->getBaseTaxAmount() + $item->getBaseDiscountTaxCompensation(); + $address->setBaseTaxAmount($address->getBaseTaxAmount() + $itemBaseTaxAmount); $applied = $taxCalculationModel->getAppliedRates($request); $this->_saveAppliedTaxes( diff --git a/app/code/core/Mage/Sales/Model/Quote/Config.php b/app/code/core/Mage/Sales/Model/Quote/Config.php index f1842a6b13..6a0d60b0f7 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Config.php +++ b/app/code/core/Mage/Sales/Model/Quote/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Quote/Item.php b/app/code/core/Mage/Sales/Model/Quote/Item.php index 9dedadafe5..7b676ff2e8 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Item.php +++ b/app/code/core/Mage/Sales/Model/Quote/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -326,7 +326,9 @@ public function getQtyOptions() $qtyOptions = array(); foreach ($this->getOptions() as $option) { /** @var $option Mage_Sales_Model_Quote_Item_Option */ - if (is_object($option->getProduct()) && $option->getProduct()->getId() != $this->getProduct()->getId()) { + if (is_object($option->getProduct()) + && $option->getProduct()->getId() != $this->getProduct()->getId() + ) { $productIds[$option->getProduct()->getId()] = $option->getProduct()->getId(); } } @@ -502,7 +504,8 @@ public function compare($item) $itemOptionValue = $_itemOptionValue; $optionValue = $_optionValue; // looks like it does not break bundle selection qty - unset($itemOptionValue['qty'], $itemOptionValue['uenc'], $optionValue['qty'], $optionValue['uenc']); + unset($itemOptionValue['qty'], $itemOptionValue['uenc']); + unset($optionValue['qty'], $optionValue['uenc']); } } @@ -596,7 +599,7 @@ public function getOptionsByCode() /** * Add option to item * - * @param Mage_Sales_Model_Quote_Item_Option $option + * @param Mage_Sales_Model_Quote_Item_Option|Varien_Object $option * @return Mage_Sales_Model_Quote_Item */ public function addOption($option) diff --git a/app/code/core/Mage/Sales/Model/Quote/Item/Abstract.php b/app/code/core/Mage/Sales/Model/Quote/Item/Abstract.php index 38695cfa4c..4aa20f19e6 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Item/Abstract.php +++ b/app/code/core/Mage/Sales/Model/Quote/Item/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -559,6 +559,21 @@ public function isChildrenCalculated() return false; } + /** + * Check if force discount apply to parent item + * + * @return bool + */ + public function getForceApplyDiscountToParentItem() + { + if ($this->getParentItem()) { + $product = $this->getParentItem()->getProduct(); + } else { + $product = $this->getProduct(); + } + + return $product->getTypeInstance()->getForceApplyDiscountToParentItem(); + } /** * Checking can we ship product separatelly (each child separately) diff --git a/app/code/core/Mage/Sales/Model/Quote/Item/Option.php b/app/code/core/Mage/Sales/Model/Quote/Item/Option.php index 5791d29c81..16715a8363 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Item/Option.php +++ b/app/code/core/Mage/Sales/Model/Quote/Item/Option.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Quote/Payment.php b/app/code/core/Mage/Sales/Model/Quote/Payment.php index 8c6ba65269..796c8aae77 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Payment.php +++ b/app/code/core/Mage/Sales/Model/Quote/Payment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Recurring/Profile.php b/app/code/core/Mage/Sales/Model/Recurring/Profile.php index 8602916391..7a9b43230e 100644 --- a/app/code/core/Mage/Sales/Model/Recurring/Profile.php +++ b/app/code/core/Mage/Sales/Model/Recurring/Profile.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Abstract.php b/app/code/core/Mage/Sales/Model/Resource/Abstract.php index 3856210933..92f0533ea4 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Abstract.php +++ b/app/code/core/Mage/Sales/Model/Resource/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Billing/Agreement.php b/app/code/core/Mage/Sales/Model/Resource/Billing/Agreement.php index c76a6573b3..122f9cb122 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Billing/Agreement.php +++ b/app/code/core/Mage/Sales/Model/Resource/Billing/Agreement.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Billing/Agreement/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Billing/Agreement/Collection.php index 89b3b107a5..549828572c 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Billing/Agreement/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Billing/Agreement/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Collection/Abstract.php b/app/code/core/Mage/Sales/Model/Resource/Collection/Abstract.php index 5aa6010991..f8bbf82a66 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Collection/Abstract.php +++ b/app/code/core/Mage/Sales/Model/Resource/Collection/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Helper/Interface.php b/app/code/core/Mage/Sales/Model/Resource/Helper/Interface.php index 1f116f2d76..a28425f702 100644 --- a/app/code/core/Mage/Sales/Model/Resource/Helper/Interface.php +++ b/app/code/core/Mage/Sales/Model/Resource/Helper/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Helper/Mysql4.php b/app/code/core/Mage/Sales/Model/Resource/Helper/Mysql4.php index ed27a4ba7f..f2d4c6f96b 100644 --- a/app/code/core/Mage/Sales/Model/Resource/Helper/Mysql4.php +++ b/app/code/core/Mage/Sales/Model/Resource/Helper/Mysql4.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order.php b/app/code/core/Mage/Sales/Model/Resource/Order.php index fc474c2201..d6584eff81 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Abstract.php b/app/code/core/Mage/Sales/Model/Resource/Order/Abstract.php index 33d4d2c7bf..83a9f2ecd3 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Abstract.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -392,7 +392,7 @@ protected function _postSaveFieldsUpdate($object, $data) { if ($object->getId() && !empty($data)) { $table = $this->getMainTable(); - $this->_getWriteAdapter()->update($table, $data, + $this->_getWriteAdapter()->update($table, $data, array($this->getIdFieldName() . '=?' => (int) $object->getId()) ); $object->addData($data); @@ -427,4 +427,31 @@ public function save(Mage_Core_Model_Abstract $object) return $this; } + + /** + * Update grid table on entity update + * + * @param string $field + * @param int $entityId + * @return int + */ + public function updateOnRelatedRecordChanged($field, $entityId) + { + $adapter = $this->_getWriteAdapter(); + $column = array(); + $select = $adapter->select() + ->from(array('main_table' => $this->getMainTable()), $column) + ->where('main_table.' . $field .' = ?', $entityId); + $this->joinVirtualGridColumnsToSelect('main_table', $select, $column); + $fieldsToUpdate = $adapter->fetchRow($select); + if ($fieldsToUpdate) { + return $adapter->update( + $this->getGridTable(), + $fieldsToUpdate, + $adapter->quoteInto($this->getGridTable() . '.' . $field . ' = ?', $entityId) + ); + } + return 0; + } } + diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Address.php b/app/code/core/Mage/Sales/Model/Resource/Order/Address.php index 93675e4c40..0f599f9074 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Address.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Address.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -72,4 +72,33 @@ public function getAllAttributes() asort($attributes); return $attributes; } + + /** + * Update related grid table after object save + * + * @param Varien_Object $object + * @return Mage_Core_Model_Resource_Db_Abstract + */ + protected function _afterSave(Mage_Core_Model_Abstract $object) + { + $resource = parent::_afterSave($object); + if ($object->hasDataChanges() && $object->getOrder()) { + $gridList = array( + 'sales/order' => 'entity_id', + 'sales/order_invoice' => 'order_id', + 'sales/order_shipment' => 'order_id', + 'sales/order_creditmemo' => 'order_id' + ); + + // update grid table after grid update + foreach ($gridList as $gridResource => $field) { + Mage::getResourceModel($gridResource)->updateOnRelatedRecordChanged( + $field, + $object->getParentId() + ); + } + } + + return $resource; + } } diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Address/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Order/Address/Collection.php index 49ffe13075..2473b064f1 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Address/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Address/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Attribute/Backend/Billing.php b/app/code/core/Mage/Sales/Model/Resource/Order/Attribute/Backend/Billing.php index 96f4219698..03acfd47d6 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Attribute/Backend/Billing.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Attribute/Backend/Billing.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Attribute/Backend/Child.php b/app/code/core/Mage/Sales/Model/Resource/Order/Attribute/Backend/Child.php index 15857d1d5f..7dd3a5890f 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Attribute/Backend/Child.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Attribute/Backend/Child.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Attribute/Backend/Parent.php b/app/code/core/Mage/Sales/Model/Resource/Order/Attribute/Backend/Parent.php index c16d381a0a..52c8e42c9e 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Attribute/Backend/Parent.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Attribute/Backend/Parent.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Attribute/Backend/Shipping.php b/app/code/core/Mage/Sales/Model/Resource/Order/Attribute/Backend/Shipping.php index 73740a6320..94d6b78458 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Attribute/Backend/Shipping.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Attribute/Backend/Shipping.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Order/Collection.php index 9fa8e9425c..3fcc76fc79 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Collection/Abstract.php b/app/code/core/Mage/Sales/Model/Resource/Order/Collection/Abstract.php index c1ebe82a65..404fef86cb 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Collection/Abstract.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Collection/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Comment/Collection/Abstract.php b/app/code/core/Mage/Sales/Model/Resource/Order/Comment/Collection/Abstract.php index 22f912d2a6..f0948caff6 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Comment/Collection/Abstract.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Comment/Collection/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo.php b/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo.php index c5262d0ec0..5a95fc850f 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Attribute/Backend/Child.php b/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Attribute/Backend/Child.php index 3fa14d97bc..fbfefb82fb 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Attribute/Backend/Child.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Attribute/Backend/Child.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Attribute/Backend/Parent.php b/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Attribute/Backend/Parent.php index dd1394370b..a5e9bdfbdd 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Attribute/Backend/Parent.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Attribute/Backend/Parent.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Collection.php index 0edad5411e..7e3d51555d 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Comment.php b/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Comment.php index 53aab25ace..94e16c9815 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Comment.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Comment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Comment/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Comment/Collection.php index a9cff368fb..bafa141a93 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Comment/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Comment/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Grid/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Grid/Collection.php index dcdbd9a85e..02fb8629c1 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Grid/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Grid/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Item.php b/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Item.php index c9651021a6..fb071cb6e4 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Item.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Item/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Item/Collection.php index 1d0309cd31..f5d577ea65 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Item/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Item/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Grid/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Order/Grid/Collection.php index b2de6c4762..7630d4c718 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Grid/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Grid/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -50,7 +50,7 @@ class Mage_Sales_Model_Resource_Order_Grid_Collection extends Mage_Sales_Model_R /** * Customer mode flag - * + * * @var bool */ protected $_customerModeFlag = false; @@ -72,17 +72,21 @@ protected function _construct() */ public function getSelectCountSql() { - $this->_renderFilters(); + if ($this->getIsCustomerMode()) { + $this->_renderFilters(); - $unionSelect = clone $this->getSelect(); + $unionSelect = clone $this->getSelect(); - $unionSelect->reset(Zend_Db_Select::ORDER); - $unionSelect->reset(Zend_Db_Select::LIMIT_COUNT); - $unionSelect->reset(Zend_Db_Select::LIMIT_OFFSET); + $unionSelect->reset(Zend_Db_Select::ORDER); + $unionSelect->reset(Zend_Db_Select::LIMIT_COUNT); + $unionSelect->reset(Zend_Db_Select::LIMIT_OFFSET); - $countSelect = clone $this->getSelect(); - $countSelect->reset(); - $countSelect->from(array('a' => $unionSelect), 'COUNT(*)'); + $countSelect = clone $this->getSelect(); + $countSelect->reset(); + $countSelect->from(array('a' => $unionSelect), 'COUNT(*)'); + } else { + $countSelect = parent::getSelectCountSql(); + } return $countSelect; } diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Invoice.php b/app/code/core/Mage/Sales/Model/Resource/Order/Invoice.php index 9c3fa2fd92..caf783e22d 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Invoice.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Invoice.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Attribute/Backend/Child.php b/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Attribute/Backend/Child.php index 4a3fb85329..b8eb11d90a 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Attribute/Backend/Child.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Attribute/Backend/Child.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Attribute/Backend/Item.php b/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Attribute/Backend/Item.php index d77e31aeda..07240a4526 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Attribute/Backend/Item.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Attribute/Backend/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Attribute/Backend/Order.php b/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Attribute/Backend/Order.php index b522931dc6..33707831e3 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Attribute/Backend/Order.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Attribute/Backend/Order.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Attribute/Backend/Parent.php b/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Attribute/Backend/Parent.php index 67a9d09222..ca9c52df5e 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Attribute/Backend/Parent.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Attribute/Backend/Parent.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Collection.php index 4d0f63e975..5667e93afb 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Comment.php b/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Comment.php index 473c793835..6601612ac8 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Comment.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Comment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Comment/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Comment/Collection.php index 5d971fb350..661ff25634 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Comment/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Comment/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Grid/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Grid/Collection.php index ce34dc3f56..654bf54873 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Grid/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Grid/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Item.php b/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Item.php index 50534bf8e3..9b415fe1d4 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Item.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Item/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Item/Collection.php index fc26b31228..abb955ba24 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Item/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Item/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Item.php b/app/code/core/Mage/Sales/Model/Resource/Order/Item.php index da5b4ae20a..986d2458ac 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Item.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Item/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Order/Item/Collection.php index cc57da2537..855dc4d280 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Item/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Item/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Payment.php b/app/code/core/Mage/Sales/Model/Resource/Order/Payment.php index d2ae6ebf7e..830d7ab43f 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Payment.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Payment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Payment/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Order/Payment/Collection.php index 94e38d20f0..9a0576fd4d 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Payment/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Payment/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Payment/Transaction.php b/app/code/core/Mage/Sales/Model/Resource/Order/Payment/Transaction.php index 928f7cc705..7447967dbd 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Payment/Transaction.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Payment/Transaction.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Payment/Transaction/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Order/Payment/Transaction/Collection.php index dbc5f8c5ee..5d64706e4b 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Payment/Transaction/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Payment/Transaction/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Shipment.php b/app/code/core/Mage/Sales/Model/Resource/Order/Shipment.php index df07300008..aeeae52555 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Shipment.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Shipment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Attribute/Backend/Child.php b/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Attribute/Backend/Child.php index 260908e1ac..a27fd5c3b9 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Attribute/Backend/Child.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Attribute/Backend/Child.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Attribute/Backend/Parent.php b/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Attribute/Backend/Parent.php index e78baebaf8..91378d670a 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Attribute/Backend/Parent.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Attribute/Backend/Parent.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Collection.php index aa383f3fcb..6f3f8e859e 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Comment.php b/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Comment.php index 1dc0188151..d062ec49dc 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Comment.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Comment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Comment/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Comment/Collection.php index f35894cc36..f499eb10f0 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Comment/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Comment/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Grid/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Grid/Collection.php index db0de8352f..f3d203f89f 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Grid/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Grid/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Item.php b/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Item.php index fbd4f4c4b6..f507307b06 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Item.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Item/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Item/Collection.php index 375e427501..7b3422d72b 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Item/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Item/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Track.php b/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Track.php index 5db8d62760..e24cb75de1 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Track.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Track.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Track/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Track/Collection.php index 4090546ecb..5f6d512b48 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Track/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Track/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Status.php b/app/code/core/Mage/Sales/Model/Resource/Order/Status.php index 730495fe44..f2393750dc 100644 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Status.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Status.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Status/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Order/Status/Collection.php index e2929f5992..fa4f7e709a 100644 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Status/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Status/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Status/History.php b/app/code/core/Mage/Sales/Model/Resource/Order/Status/History.php index 7369846fec..2f2a072f71 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Status/History.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Status/History.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Status/History/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Order/Status/History/Collection.php index 299a939231..9b9b5c6b91 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Status/History/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Status/History/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Tax.php b/app/code/core/Mage/Sales/Model/Resource/Order/Tax.php index fe4dd117e7..8388b276ca 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Tax.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Tax/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Order/Tax/Collection.php index adbcdde32f..ab08315c2e 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Tax/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Tax/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Quote.php b/app/code/core/Mage/Sales/Model/Resource/Quote.php index 99f3d89c9e..fb37c3e90a 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Quote.php +++ b/app/code/core/Mage/Sales/Model/Resource/Quote.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -181,20 +181,23 @@ public function isOrderIncrementIdUsed($orderIncrementId) */ public function markQuotesRecollectOnCatalogRules() { - $readAdapter = $this->_getReadAdapter(); - $selectProductId = $readAdapter->select() - ->from($this->getTable('catalogrule/rule_product_price'), 'product_id') - ->distinct(); - - $selectQuoteId = $readAdapter->select() - ->from($this->getTable('sales/quote_item'), 'quote_id') - ->where('product_id IN(?)', $selectProductId) - ->distinct(); + $tableQuote = $this->getTable('sales/quote'); + $subSelect = $this->_getReadAdapter() + ->select() + ->from(array('t2' => $this->getTable('sales/quote_item')), array('entity_id' => 'quote_id')) + ->from(array('t3' => $this->getTable('catalogrule/rule_product_price')), array()) + ->where('t2.product_id = t3.product_id') + ->group('quote_id'); + + $select = $this->_getReadAdapter()->select()->join( + array('t2' => $subSelect), + 't1.entity_id = t2.entity_id', + array('trigger_recollect' => new Zend_Db_Expr('1')) + ); - $data = array('trigger_recollect' => 1); - $where = array('entity_id IN(?)' => $selectQuoteId); + $updateQuery = $select->crossUpdateFromSelect(array('t1' => $tableQuote)); - $this->_getWriteAdapter()->update($this->getTable('sales/quote'), $data, $where); + $this->_getWriteAdapter()->query($updateQuery); return $this; } @@ -239,19 +242,26 @@ public function substractProductFromQuotes($product) /** * Mark recollect contain product(s) quotes * - * @param array|int $productIds + * @param array|int|Zend_Db_Expr $productIds * @return Mage_Sales_Model_Resource_Quote */ public function markQuotesRecollect($productIds) { - $select = $this->_getReadAdapter()->select() - ->from($this->getTable('sales/quote_item'), 'quote_id') - ->where('product_id IN(?)', $productIds) - ->distinct(true); - - $data = array('trigger_recollect' => 1); - $where = array('entity_id IN(?)' => $select); - $this->_getWriteAdapter()->update($this->getTable('sales/quote'), $data, $where); + $tableQuote = $this->getTable('sales/quote'); + $tableItem = $this->getTable('sales/quote_item'); + $subSelect = $this->_getReadAdapter() + ->select() + ->from($tableItem, array('entity_id' => 'quote_id')) + ->where('product_id IN ( ? )', $productIds) + ->group('quote_id'); + + $select = $this->_getReadAdapter()->select()->join( + array('t2' => $subSelect), + 't1.entity_id = t2.entity_id', + array('trigger_recollect' => new Zend_Db_Expr('1')) + ); + $updateQuery = $select->crossUpdateFromSelect(array('t1' => $tableQuote)); + $this->_getWriteAdapter()->query($updateQuery); return $this; } diff --git a/app/code/core/Mage/Sales/Model/Resource/Quote/Address.php b/app/code/core/Mage/Sales/Model/Resource/Quote/Address.php index 2af8f4e1a4..ab79f2af7d 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Quote/Address.php +++ b/app/code/core/Mage/Sales/Model/Resource/Quote/Address.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Backend.php b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Backend.php index 56dbb43236..3f4c02a9f2 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Backend.php +++ b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Backend.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Backend/Child.php b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Backend/Child.php index cdb00856ed..10a9ca141d 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Backend/Child.php +++ b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Backend/Child.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Backend/Parent.php b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Backend/Parent.php index 445ed2e4a6..957c159d7e 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Backend/Parent.php +++ b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Backend/Parent.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Backend/Region.php b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Backend/Region.php index 8ed21576ed..97dbf6b5ed 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Backend/Region.php +++ b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Backend/Region.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend.php b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend.php index 20640c9558..d6f4ebc8fb 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend.php +++ b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend/Custbalance.php b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend/Custbalance.php index c39bf93b08..f54d004c5d 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend/Custbalance.php +++ b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend/Custbalance.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend/Discount.php b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend/Discount.php index 577ca0bc1b..fa9674e4cc 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend/Discount.php +++ b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend/Discount.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend/Grand.php b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend/Grand.php index aa3b5bd312..0e6e597ddb 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend/Grand.php +++ b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend/Grand.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend/Shipping.php b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend/Shipping.php index e41da0daef..48868438d2 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend/Shipping.php +++ b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend/Shipping.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend/Subtotal.php b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend/Subtotal.php index e1bf4ca73a..f4a618ac30 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend/Subtotal.php +++ b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend/Subtotal.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend/Tax.php b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend/Tax.php index b1f3b99a35..54f2986eaa 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend/Tax.php +++ b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Collection.php index e51624cff4..a9bbb9d3a3 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Item.php b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Item.php index 4309ba7c9c..8625a41d11 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Item.php +++ b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Item/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Item/Collection.php index b578863484..547d93b7c6 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Item/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Item/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Rate.php b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Rate.php index 1d45e968ea..8e88e7aef5 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Rate.php +++ b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Rate.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Rate/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Rate/Collection.php index 803d4a4e93..0fc2c33212 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Rate/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Rate/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Quote/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Quote/Collection.php index 5a5a10d597..fef7eaba36 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Quote/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Quote/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Quote/Item.php b/app/code/core/Mage/Sales/Model/Resource/Quote/Item.php index 415a82612d..7815fe5c2f 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Quote/Item.php +++ b/app/code/core/Mage/Sales/Model/Resource/Quote/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Quote/Item/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Quote/Item/Collection.php index 0e482230b9..d9aac63199 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Quote/Item/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Quote/Item/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Quote/Item/Option.php b/app/code/core/Mage/Sales/Model/Resource/Quote/Item/Option.php index 70aff70216..d18fb309ae 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Quote/Item/Option.php +++ b/app/code/core/Mage/Sales/Model/Resource/Quote/Item/Option.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Quote/Item/Option/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Quote/Item/Option/Collection.php index 8e74cafdc5..3abbf426cb 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Quote/Item/Option/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Quote/Item/Option/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Quote/Payment.php b/app/code/core/Mage/Sales/Model/Resource/Quote/Payment.php index c36456b7be..8f8f0d14e9 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Quote/Payment.php +++ b/app/code/core/Mage/Sales/Model/Resource/Quote/Payment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Quote/Payment/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Quote/Payment/Collection.php index a04e532c65..f816a6cfef 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Quote/Payment/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Quote/Payment/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Recurring/Profile.php b/app/code/core/Mage/Sales/Model/Resource/Recurring/Profile.php index 6c020f3ec7..d637be3bd0 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Recurring/Profile.php +++ b/app/code/core/Mage/Sales/Model/Resource/Recurring/Profile.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Recurring/Profile/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Recurring/Profile/Collection.php index a40e6de6b9..77fd291469 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Recurring/Profile/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Recurring/Profile/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Report.php b/app/code/core/Mage/Sales/Model/Resource/Report.php index e010dc4d64..d6b45d204d 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Report.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Abstract.php b/app/code/core/Mage/Sales/Model/Resource/Report/Abstract.php index 1db59e0a59..a765965742 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Report/Abstract.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Bestsellers.php b/app/code/core/Mage/Sales/Model/Resource/Report/Bestsellers.php index 039ea5252b..25937f694a 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Report/Bestsellers.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report/Bestsellers.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Bestsellers/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Report/Bestsellers/Collection.php index d5b445480b..b802a56b06 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Report/Bestsellers/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report/Bestsellers/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Collection/Abstract.php b/app/code/core/Mage/Sales/Model/Resource/Report/Collection/Abstract.php index 3b73b63db1..c0f750990e 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Report/Collection/Abstract.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report/Collection/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Invoiced.php b/app/code/core/Mage/Sales/Model/Resource/Report/Invoiced.php index 419416af85..90c30e8014 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Report/Invoiced.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report/Invoiced.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Invoiced/Collection/Invoiced.php b/app/code/core/Mage/Sales/Model/Resource/Report/Invoiced/Collection/Invoiced.php index d90addd025..d0778d3bff 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Report/Invoiced/Collection/Invoiced.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report/Invoiced/Collection/Invoiced.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Invoiced/Collection/Order.php b/app/code/core/Mage/Sales/Model/Resource/Report/Invoiced/Collection/Order.php index fb95dd1e7b..87a78ebb57 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Report/Invoiced/Collection/Order.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report/Invoiced/Collection/Order.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Order.php b/app/code/core/Mage/Sales/Model/Resource/Report/Order.php index 01720951eb..42d4b21e5e 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Report/Order.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report/Order.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Order/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Report/Order/Collection.php index 8ec0b8c7e7..af402d23bf 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Report/Order/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report/Order/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Order/Createdat.php b/app/code/core/Mage/Sales/Model/Resource/Report/Order/Createdat.php index 69deb503f7..c21da52fd1 100644 --- a/app/code/core/Mage/Sales/Model/Resource/Report/Order/Createdat.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report/Order/Createdat.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Order/Updatedat.php b/app/code/core/Mage/Sales/Model/Resource/Report/Order/Updatedat.php index 65b56a7206..a97a24b07b 100644 --- a/app/code/core/Mage/Sales/Model/Resource/Report/Order/Updatedat.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report/Order/Updatedat.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Order/Updatedat/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Report/Order/Updatedat/Collection.php index 98e63cca62..d10bbc7a37 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Report/Order/Updatedat/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report/Order/Updatedat/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Refunded.php b/app/code/core/Mage/Sales/Model/Resource/Report/Refunded.php index 99cf198938..9285f76021 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Report/Refunded.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report/Refunded.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Refunded/Collection/Order.php b/app/code/core/Mage/Sales/Model/Resource/Report/Refunded/Collection/Order.php index 57168b3456..ce5f9af209 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Report/Refunded/Collection/Order.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report/Refunded/Collection/Order.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Refunded/Collection/Refunded.php b/app/code/core/Mage/Sales/Model/Resource/Report/Refunded/Collection/Refunded.php index d295af28bf..cb5b4c09e6 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Report/Refunded/Collection/Refunded.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report/Refunded/Collection/Refunded.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Shipping.php b/app/code/core/Mage/Sales/Model/Resource/Report/Shipping.php index c1e3d7189d..7450395932 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Report/Shipping.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report/Shipping.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Shipping/Collection/Order.php b/app/code/core/Mage/Sales/Model/Resource/Report/Shipping/Collection/Order.php index 80725fc945..971ad0c518 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Report/Shipping/Collection/Order.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report/Shipping/Collection/Order.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Shipping/Collection/Shipment.php b/app/code/core/Mage/Sales/Model/Resource/Report/Shipping/Collection/Shipment.php index 1d7297c711..5ed04ca243 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Report/Shipping/Collection/Shipment.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report/Shipping/Collection/Shipment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Sale/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Sale/Collection.php index 638954b13c..b6bec223f0 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Sale/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Sale/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Setup.php b/app/code/core/Mage/Sales/Model/Resource/Setup.php index b58d962d4a..52789f93a7 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Setup.php +++ b/app/code/core/Mage/Sales/Model/Resource/Setup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Service/Order.php b/app/code/core/Mage/Sales/Model/Service/Order.php index 458c3e879f..c899b26379 100644 --- a/app/code/core/Mage/Sales/Model/Service/Order.php +++ b/app/code/core/Mage/Sales/Model/Service/Order.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -187,6 +187,7 @@ public function prepareCreditmemo($data = array()) $item = $this->_convertor->itemToCreditmemoItem($orderItem); if ($orderItem->isDummy()) { $qty = 1; + $orderItem->setLockedDoShip(true); } else { if (isset($qtys[$orderItem->getId()])) { $qty = (float) $qtys[$orderItem->getId()]; diff --git a/app/code/core/Mage/Sales/Model/Service/Quote.php b/app/code/core/Mage/Sales/Model/Service/Quote.php index 18b37e3655..06890c1ab1 100644 --- a/app/code/core/Mage/Sales/Model/Service/Quote.php +++ b/app/code/core/Mage/Sales/Model/Service/Quote.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Status/List.php b/app/code/core/Mage/Sales/Model/Status/List.php index b32fabb6ae..b22c4ecbd5 100644 --- a/app/code/core/Mage/Sales/Model/Status/List.php +++ b/app/code/core/Mage/Sales/Model/Status/List.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/controllers/Billing/AgreementController.php b/app/code/core/Mage/Sales/controllers/Billing/AgreementController.php index 353a1f4bb9..8899dcb5a8 100644 --- a/app/code/core/Mage/Sales/controllers/Billing/AgreementController.php +++ b/app/code/core/Mage/Sales/controllers/Billing/AgreementController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/controllers/DownloadController.php b/app/code/core/Mage/Sales/controllers/DownloadController.php index 2fb7e71504..c9b2631dad 100644 --- a/app/code/core/Mage/Sales/controllers/DownloadController.php +++ b/app/code/core/Mage/Sales/controllers/DownloadController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/controllers/GuestController.php b/app/code/core/Mage/Sales/controllers/GuestController.php index 2ce468bbe7..38d6dd0710 100644 --- a/app/code/core/Mage/Sales/controllers/GuestController.php +++ b/app/code/core/Mage/Sales/controllers/GuestController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/controllers/OrderController.php b/app/code/core/Mage/Sales/controllers/OrderController.php index b9626898f3..5a3b94fdde 100644 --- a/app/code/core/Mage/Sales/controllers/OrderController.php +++ b/app/code/core/Mage/Sales/controllers/OrderController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/controllers/Recurring/ProfileController.php b/app/code/core/Mage/Sales/controllers/Recurring/ProfileController.php index 84b160b535..d3844e54d8 100644 --- a/app/code/core/Mage/Sales/controllers/Recurring/ProfileController.php +++ b/app/code/core/Mage/Sales/controllers/Recurring/ProfileController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/data/sales_setup/data-install-1.6.0.0.php b/app/code/core/Mage/Sales/data/sales_setup/data-install-1.6.0.0.php index 30e582420a..f33a720954 100644 --- a/app/code/core/Mage/Sales/data/sales_setup/data-install-1.6.0.0.php +++ b/app/code/core/Mage/Sales/data/sales_setup/data-install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/data/sales_setup/data-upgrade-1.6.0.4-1.6.0.5.php b/app/code/core/Mage/Sales/data/sales_setup/data-upgrade-1.6.0.4-1.6.0.5.php index 608d430bac..5eb0f0d7a6 100644 --- a/app/code/core/Mage/Sales/data/sales_setup/data-upgrade-1.6.0.4-1.6.0.5.php +++ b/app/code/core/Mage/Sales/data/sales_setup/data-upgrade-1.6.0.4-1.6.0.5.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/doc/test.php b/app/code/core/Mage/Sales/doc/test.php index 081543f24e..e176c2e16a 100644 --- a/app/code/core/Mage/Sales/doc/test.php +++ b/app/code/core/Mage/Sales/doc/test.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ include "lib/Varien/Object.php"; diff --git a/app/code/core/Mage/Sales/etc/adminhtml.xml b/app/code/core/Mage/Sales/etc/adminhtml.xml index ddb53242bc..5e57ccd07e 100644 --- a/app/code/core/Mage/Sales/etc/adminhtml.xml +++ b/app/code/core/Mage/Sales/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -101,7 +101,7 @@ Accept or Deny Payment Capture Invoice - Creditmemo + Credit Memos Hold Unhold Ship diff --git a/app/code/core/Mage/Sales/etc/api.xml b/app/code/core/Mage/Sales/etc/api.xml index d01713a76c..f4a47abfb6 100644 --- a/app/code/core/Mage/Sales/etc/api.xml +++ b/app/code/core/Mage/Sales/etc/api.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Sales/etc/config.xml b/app/code/core/Mage/Sales/etc/config.xml index 46db3b3716..4c8820deb6 100644 --- a/app/code/core/Mage/Sales/etc/config.xml +++ b/app/code/core/Mage/Sales/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -1368,18 +1368,25 @@ sales/order_invoice_total_discount + subtotal sales/order_invoice_total_shipping + subtotal,discount + grand_total,tax sales/order_invoice_total_tax + subtotal sales/order_invoice_total_grand + shipping sales/order_invoice_total_cost + discount + grand_total @@ -1390,18 +1397,25 @@ sales/order_creditmemo_total_shipping + subtotal,discount + grand_total,tax sales/order_creditmemo_total_tax + subtotal sales/order_creditmemo_total_discount + subtotal sales/order_creditmemo_total_grand + shipping,subtotal sales/order_creditmemo_total_cost + discount + grand_total @@ -1465,14 +1479,6 @@ - - - - sales/observer - handleCustomerVatNumber - - - @@ -1519,6 +1525,22 @@ + + + + sales/observer + changeQuoteCustomerGroupId + + + + + + + sales/observer + restoreQuoteCustomerGroupId + + + diff --git a/app/code/core/Mage/Sales/etc/system.xml b/app/code/core/Mage/Sales/etc/system.xml index 265175a700..0622812922 100644 --- a/app/code/core/Mage/Sales/etc/system.xml +++ b/app/code/core/Mage/Sales/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -43,6 +43,25 @@ 1 1 + + + text + 5 + 1 + 1 + 1 + + + + Controls whether customer IP is shown in orders, invoices, shipments, credit memos. + select + adminhtml/system_config_source_yesno + 1 + 1 + 1 + + + text diff --git a/app/code/core/Mage/Sales/etc/widget.xml b/app/code/core/Mage/Sales/etc/widget.xml index c1977d874b..81e3a9f22f 100644 --- a/app/code/core/Mage/Sales/etc/widget.xml +++ b/app/code/core/Mage/Sales/etc/widget.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Sales/sql/sales_setup/install-1.6.0.0.php b/app/code/core/Mage/Sales/sql/sales_setup/install-1.6.0.0.php index ade1513598..e5f1bbaedd 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-install-0.7.0.php index 904c82ed6b..76820abaa5 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-install-0.7.0.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-install-0.7.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-install-0.8.11.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-install-0.8.11.php index cbe1c071ee..3f54ded0a9 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-install-0.8.11.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-install-0.8.11.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-install-0.9.0.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-install-0.9.0.php index 3aeb3ad690..cde09dffec 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-install-0.9.0.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-install-0.9.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-install-1.4.0.0.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-install-1.4.0.0.php index 30f3a3058b..713bf3eba5 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-install-1.4.0.0.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-install-1.4.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.6.2-0.7.0.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.6.2-0.7.0.php index 8373eb02ea..b02e6a7389 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.6.2-0.7.0.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.6.2-0.7.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ $installer = $this; diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.7.0-0.7.1.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.7.0-0.7.1.php index 17d407e5fc..89ce6f8006 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.7.0-0.7.1.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.7.0-0.7.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ $installer = $this; diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.7.1-0.7.2.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.7.1-0.7.2.php index ae2579cd28..647d770963 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.7.1-0.7.2.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.7.1-0.7.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ $installer = $this; diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.7.2-0.7.3.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.7.2-0.7.3.php index 983dd6c476..b5f49bfd68 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.7.2-0.7.3.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.7.2-0.7.3.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ $installer = $this; diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.7.9-0.7.10.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.7.9-0.7.10.php index e31409c06c..dadd541218 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.7.9-0.7.10.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.7.9-0.7.10.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ $installer = $this; diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.0-0.8.1.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.0-0.8.1.php index 8ed6efc812..71e3fef6e5 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.0-0.8.1.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.0-0.8.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ $installer = $this; diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.1-0.8.2.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.1-0.8.2.php index 90709cf009..5a859955b6 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.1-0.8.2.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.1-0.8.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ $installer = $this; diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.11-0.8.12.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.11-0.8.12.php index f4e6633e8f..119b583756 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.11-0.8.12.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.11-0.8.12.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ $installer = $this; diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.12-0.8.13.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.12-0.8.13.php index 95394181a3..a7ee336028 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.12-0.8.13.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.12-0.8.13.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.13-0.8.14.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.13-0.8.14.php index d5435d7797..364856cac0 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.13-0.8.14.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.13-0.8.14.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.14-0.8.15.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.14-0.8.15.php index 20cfecbd06..b194d76556 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.14-0.8.15.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.14-0.8.15.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.15-0.8.16.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.15-0.8.16.php index 0782b73e4f..c9f42b4ca6 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.15-0.8.16.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.15-0.8.16.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.16-0.8.17.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.16-0.8.17.php index 7ac80c6f94..fc01fb9b7d 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.16-0.8.17.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.16-0.8.17.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.17-0.8.18.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.17-0.8.18.php index e8d8a62c1f..84d9d857ec 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.17-0.8.18.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.17-0.8.18.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.18-0.8.19.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.18-0.8.19.php index 14e3322c26..867a0b913b 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.18-0.8.19.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.18-0.8.19.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.19-0.8.20.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.19-0.8.20.php index da4d4f86b7..bdb77fd1ce 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.19-0.8.20.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.19-0.8.20.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.2-0.8.3.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.2-0.8.3.php index 233c192b89..8ca6b79717 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.2-0.8.3.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.2-0.8.3.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ $installer = $this; diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.20-0.8.21.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.20-0.8.21.php index dd2960644d..58d470552a 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.20-0.8.21.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.20-0.8.21.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.21-0.8.22.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.21-0.8.22.php index f8ddde2e35..1a13580fab 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.21-0.8.22.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.21-0.8.22.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.22-0.8.23.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.22-0.8.23.php index 4869254a45..94fd80b642 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.22-0.8.23.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.22-0.8.23.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.23-0.8.24.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.23-0.8.24.php index 277452603e..b4f1021395 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.23-0.8.24.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.23-0.8.24.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.24-0.8.25.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.24-0.8.25.php index a2432c087c..efa9e52998 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.24-0.8.25.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.24-0.8.25.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.25-0.8.26.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.25-0.8.26.php index 203c861140..aed1791704 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.25-0.8.26.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.25-0.8.26.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.26-0.8.27.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.26-0.8.27.php index 38dc933790..f02cf7f07f 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.26-0.8.27.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.26-0.8.27.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.27-0.8.28.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.27-0.8.28.php index 74705ccf0e..d5d44e0614 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.27-0.8.28.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.27-0.8.28.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.28-0.8.29.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.28-0.8.29.php index e8b0e0400b..69eb7856d9 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.28-0.8.29.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.28-0.8.29.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.29-0.9.0.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.29-0.9.0.php index 6b7ea8294b..f0e2f737fc 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.29-0.9.0.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.29-0.9.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.3-0.8.4.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.3-0.8.4.php index 92c14742e8..333bb9e093 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.3-0.8.4.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.3-0.8.4.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ $installer = $this; diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.6-0.8.7.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.6-0.8.7.php index 233c192b89..8ca6b79717 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.6-0.8.7.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.6-0.8.7.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ $installer = $this; diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.7-0.8.8.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.7-0.8.8.php index 8aa1f006c0..8813ebaba0 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.7-0.8.8.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.7-0.8.8.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.8-0.8.9.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.8-0.8.9.php index 7119292bb3..5998e8450c 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.8-0.8.9.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.8-0.8.9.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ $installer = $this; diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.0-0.9.1.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.0-0.9.1.php index 93dc06bfd2..de466fa471 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.0-0.9.1.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.0-0.9.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.1-0.9.2.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.1-0.9.2.php index 99347057f4..db8b591087 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.1-0.9.2.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.1-0.9.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.10-0.9.11.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.10-0.9.11.php index ca485ff1e2..977ab98383 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.10-0.9.11.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.10-0.9.11.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.11-0.9.12.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.11-0.9.12.php index da73b325c2..edf2eff72c 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.11-0.9.12.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.11-0.9.12.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.12-0.9.13.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.12-0.9.13.php index 1eb501a12a..d20117765b 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.12-0.9.13.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.12-0.9.13.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.13-0.9.14.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.13-0.9.14.php index 4584800fce..7d8d5153e7 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.13-0.9.14.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.13-0.9.14.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.14-0.9.15.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.14-0.9.15.php index f6a24ab027..70dd93f836 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.14-0.9.15.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.14-0.9.15.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.15-0.9.16.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.15-0.9.16.php index 8b9bf8fa30..17adbf2248 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.15-0.9.16.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.15-0.9.16.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.16-0.9.17.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.16-0.9.17.php index 4e5bf60880..08cf720058 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.16-0.9.17.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.16-0.9.17.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.17-0.9.18.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.17-0.9.18.php index 24b69f89eb..b40bebf17f 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.17-0.9.18.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.17-0.9.18.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.18-0.9.19.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.18-0.9.19.php index 4e8c94d17c..ae7a716a7a 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.18-0.9.19.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.18-0.9.19.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.19-0.9.20.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.19-0.9.20.php index 4de229f669..63d037971f 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.19-0.9.20.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.19-0.9.20.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.2-0.9.3.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.2-0.9.3.php index 3d4b673816..2c808c12c6 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.2-0.9.3.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.2-0.9.3.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.20-0.9.21.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.20-0.9.21.php index e452b05971..d1af530558 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.20-0.9.21.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.20-0.9.21.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.21-0.9.22.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.21-0.9.22.php index ce90b73072..782937cbe9 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.21-0.9.22.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.21-0.9.22.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.22-0.9.23.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.22-0.9.23.php index 00abc56230..1471a18063 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.22-0.9.23.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.22-0.9.23.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.23-0.9.24.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.23-0.9.24.php index a766648b9e..24db81b3f7 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.23-0.9.24.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.23-0.9.24.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.24-0.9.25.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.24-0.9.25.php index 4565c00aca..c6f9fbf356 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.24-0.9.25.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.24-0.9.25.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.25-0.9.26.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.25-0.9.26.php index c0ae895cea..dff1a50937 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.25-0.9.26.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.25-0.9.26.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.26-0.9.27.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.26-0.9.27.php index 7631192c69..f5d066c3b8 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.26-0.9.27.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.26-0.9.27.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.27-0.9.28.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.27-0.9.28.php index ba5860d4db..d8463175bc 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.27-0.9.28.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.27-0.9.28.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.28-0.9.29.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.28-0.9.29.php index 8c6afb8906..9b6cb25672 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.28-0.9.29.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.28-0.9.29.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.29-0.9.30.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.29-0.9.30.php index 92c3d3c7ad..ca83fab66a 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.29-0.9.30.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.29-0.9.30.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.3-0.9.4.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.3-0.9.4.php index 2acb8c2a25..623de1f56f 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.3-0.9.4.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.3-0.9.4.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.30-0.9.31.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.30-0.9.31.php index be2805e2be..87d2022bbf 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.30-0.9.31.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.30-0.9.31.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.31-0.9.32.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.31-0.9.32.php index 41018f0d45..01c4069251 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.31-0.9.32.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.31-0.9.32.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.32-0.9.33.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.32-0.9.33.php index e48308c0e8..3b4c24a322 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.32-0.9.33.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.32-0.9.33.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.33-0.9.34.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.33-0.9.34.php index 729760a431..35f045fa51 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.33-0.9.34.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.33-0.9.34.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.34-0.9.35.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.34-0.9.35.php index 950068647d..5fb5158915 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.34-0.9.35.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.34-0.9.35.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.35-0.9.36.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.35-0.9.36.php index d72ff1c3be..406cc1a7f4 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.35-0.9.36.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.35-0.9.36.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.36-0.9.37.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.36-0.9.37.php index bc9d64e1d2..f1697318ad 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.36-0.9.37.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.36-0.9.37.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.37-0.9.38.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.37-0.9.38.php index c277591b29..ca6c5ae8f3 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.37-0.9.38.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.37-0.9.38.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.38-0.9.39.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.38-0.9.39.php index d548f59b16..62ee4fd146 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.38-0.9.39.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.38-0.9.39.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.39-0.9.40.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.39-0.9.40.php index d98f53e8e0..f5ce9c856a 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.39-0.9.40.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.39-0.9.40.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.4-0.9.5.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.4-0.9.5.php index 5e99299036..0d4befe75f 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.4-0.9.5.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.4-0.9.5.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.40-0.9.41.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.40-0.9.41.php index 76e2765253..1ed1a503a6 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.40-0.9.41.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.40-0.9.41.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.41-0.9.42.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.41-0.9.42.php index b5e06a1b9f..ab5c2a94a6 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.41-0.9.42.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.41-0.9.42.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.42-0.9.43.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.42-0.9.43.php index c9ace5506e..d5dae39198 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.42-0.9.43.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.42-0.9.43.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.43-0.9.44.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.43-0.9.44.php index a2016447cc..c27ecc9a84 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.43-0.9.44.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.43-0.9.44.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.44-0.9.45.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.44-0.9.45.php index 88ae83b32d..406a6121be 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.44-0.9.45.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.44-0.9.45.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.45-0.9.46.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.45-0.9.46.php index e7e216c67e..7f7e607ab5 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.45-0.9.46.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.45-0.9.46.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.46-0.9.47.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.46-0.9.47.php index 7298a0214c..ff722d2dce 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.46-0.9.47.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.46-0.9.47.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.47-0.9.48.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.47-0.9.48.php index e238efbf85..583ff18f06 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.47-0.9.48.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.47-0.9.48.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.48-0.9.49.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.48-0.9.49.php index 925e61de39..92134dd43f 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.48-0.9.49.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.48-0.9.49.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.49-0.9.50.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.49-0.9.50.php index 35fd149ad4..1dbc622462 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.49-0.9.50.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.49-0.9.50.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.5-0.9.6.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.5-0.9.6.php index bbef9b53dc..b888019429 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.5-0.9.6.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.5-0.9.6.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.50-0.9.51.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.50-0.9.51.php index 7f760226b0..c1f2e86e00 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.50-0.9.51.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.50-0.9.51.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.51-0.9.52.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.51-0.9.52.php index 08ff1780f0..63ab20553c 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.51-0.9.52.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.51-0.9.52.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.52-0.9.53.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.52-0.9.53.php index 9fce796aa7..26b8400b40 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.52-0.9.53.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.52-0.9.53.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.53-0.9.54.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.53-0.9.54.php index 0f8d88de57..e5a3837766 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.53-0.9.54.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.53-0.9.54.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.54-0.9.55.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.54-0.9.55.php index cecd4d163b..0b271abbda 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.54-0.9.55.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.54-0.9.55.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.55-0.9.56.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.55-0.9.56.php index 66abf86827..ccb68ba872 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.55-0.9.56.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.55-0.9.56.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.6-0.9.7.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.6-0.9.7.php index 536d155e60..12892b9eee 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.6-0.9.7.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.6-0.9.7.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.7-0.9.8.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.7-0.9.8.php index ed0bd3ee45..c0d0952896 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.7-0.9.8.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.7-0.9.8.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.8-0.9.9.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.8-0.9.9.php index bc532d92c6..1c298ffddb 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.8-0.9.9.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.8-0.9.9.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.9-0.9.10.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.9-0.9.10.php index 1d2a4ff6a8..dc39993026 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.9-0.9.10.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.9-0.9.10.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.3.99-1.4.0.0.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.3.99-1.4.0.0.php index daca9b0a84..7ed5ecb026 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.3.99-1.4.0.0.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.3.99-1.4.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.0-1.4.0.1.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.0-1.4.0.1.php index ea5ebedaf9..176ab4e415 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.0-1.4.0.1.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.0-1.4.0.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.1-1.4.0.2.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.1-1.4.0.2.php index ed98946eb2..7bce9f2f5f 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.1-1.4.0.2.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.1-1.4.0.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.15-1.4.0.16.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.15-1.4.0.16.php index be4daabef7..6654694845 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.15-1.4.0.16.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.15-1.4.0.16.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.16-1.4.0.17.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.16-1.4.0.17.php index e5f8201871..63bf1c58a7 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.16-1.4.0.17.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.16-1.4.0.17.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.17-1.4.0.18.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.17-1.4.0.18.php index 94cd413a27..8bffd590eb 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.17-1.4.0.18.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.17-1.4.0.18.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.18-1.4.0.19.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.18-1.4.0.19.php index 1766ca5a3a..7c2b0dc7ea 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.18-1.4.0.19.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.18-1.4.0.19.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.19-1.4.0.20.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.19-1.4.0.20.php index c87473b56a..79f1b2ee6c 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.19-1.4.0.20.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.19-1.4.0.20.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.2-1.4.0.3.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.2-1.4.0.3.php index 026045fa2d..9eab78b734 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.2-1.4.0.3.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.2-1.4.0.3.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.20-1.4.0.21.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.20-1.4.0.21.php index f198c75eac..1ed48bcc3a 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.20-1.4.0.21.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.20-1.4.0.21.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.21-1.4.0.22.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.21-1.4.0.22.php index e6ae0d7d9f..bdfc9e82ae 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.21-1.4.0.22.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.21-1.4.0.22.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.22-1.4.0.23.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.22-1.4.0.23.php index 86e0757661..7542eaadf1 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.22-1.4.0.23.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.22-1.4.0.23.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.23-1.4.0.24.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.23-1.4.0.24.php index bc737d36e6..549763dc23 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.23-1.4.0.24.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.23-1.4.0.24.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /* @var $installer Mage_Sales_Model_Entity_Setup */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.24-1.4.0.25.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.24-1.4.0.25.php index 43984549f4..6bcfa85e0d 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.24-1.4.0.25.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.24-1.4.0.25.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /* @var $installer Mage_Sales_Model_Entity_Setup */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.3-1.4.0.4.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.3-1.4.0.4.php index 841400246b..3301130d47 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.3-1.4.0.4.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.3-1.4.0.4.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.4-1.4.0.5.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.4-1.4.0.5.php index c8a2ccd35c..f8a108a75b 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.4-1.4.0.5.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.4-1.4.0.5.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.5-1.4.0.6.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.5-1.4.0.6.php index bb2ece782b..07c338f16f 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.5-1.4.0.6.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.5-1.4.0.6.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.6-1.4.0.7.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.6-1.4.0.7.php index 96937171bc..d2a1937b96 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.6-1.4.0.7.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.6-1.4.0.7.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.7-1.4.0.8.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.7-1.4.0.8.php index 252c464230..e762ccbfd4 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.7-1.4.0.8.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.7-1.4.0.8.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.8-1.4.0.15.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.8-1.4.0.15.php index c4ab9310ab..c6adea7531 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.8-1.4.0.15.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.8-1.4.0.15.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php index a7140ce5db..7b741e6271 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.0-1.6.0.1.php b/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.0-1.6.0.1.php index dc76ecd8d2..61e74961c7 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.0-1.6.0.1.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.0-1.6.0.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.1-1.6.0.2.php b/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.1-1.6.0.2.php index 8e3f60fee2..717264db03 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.1-1.6.0.2.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.1-1.6.0.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.2-1.6.0.3.php b/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.2-1.6.0.3.php index f61e7af945..890cb09dec 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.2-1.6.0.3.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.2-1.6.0.3.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.3-1.6.0.4.php b/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.3-1.6.0.4.php index b54a220986..f4751e80fe 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.3-1.6.0.4.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.3-1.6.0.4.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.4-1.6.0.5.php b/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.4-1.6.0.5.php index ed4255763c..13368f8d12 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.4-1.6.0.5.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.4-1.6.0.5.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.5-1.6.0.6.php b/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.5-1.6.0.6.php index a7d3f63621..6f244cb647 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.5-1.6.0.6.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.5-1.6.0.6.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.6-1.6.0.7.php b/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.6-1.6.0.7.php index 7fb9f66f47..2aa5a95cd8 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.6-1.6.0.7.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.6-1.6.0.7.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Exception.php b/app/code/core/Mage/SalesRule/Exception.php index 5db103e8d8..1f47bae403 100644 --- a/app/code/core/Mage/SalesRule/Exception.php +++ b/app/code/core/Mage/SalesRule/Exception.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Helper/Coupon.php b/app/code/core/Mage/SalesRule/Helper/Coupon.php index 240967ec2a..950dc5aaa7 100644 --- a/app/code/core/Mage/SalesRule/Helper/Coupon.php +++ b/app/code/core/Mage/SalesRule/Helper/Coupon.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -91,7 +91,7 @@ public function getDefaultLength() */ public function getDefaultFormat() { - return (int)Mage::getStoreConfig(self::XML_PATH_SALES_RULE_COUPON_FORMAT); + return Mage::getStoreConfig(self::XML_PATH_SALES_RULE_COUPON_FORMAT); } /** diff --git a/app/code/core/Mage/SalesRule/Helper/Data.php b/app/code/core/Mage/SalesRule/Helper/Data.php index 5a1c7541e6..6bf91eef9b 100644 --- a/app/code/core/Mage/SalesRule/Helper/Data.php +++ b/app/code/core/Mage/SalesRule/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Model/Coupon.php b/app/code/core/Mage/SalesRule/Model/Coupon.php index 0a1f10412c..655ff595d1 100644 --- a/app/code/core/Mage/SalesRule/Model/Coupon.php +++ b/app/code/core/Mage/SalesRule/Model/Coupon.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Model/Coupon/Codegenerator.php b/app/code/core/Mage/SalesRule/Model/Coupon/Codegenerator.php index a4216854fb..5f43eacf4a 100644 --- a/app/code/core/Mage/SalesRule/Model/Coupon/Codegenerator.php +++ b/app/code/core/Mage/SalesRule/Model/Coupon/Codegenerator.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Model/Coupon/CodegeneratorInterface.php b/app/code/core/Mage/SalesRule/Model/Coupon/CodegeneratorInterface.php index 1cc8e3e053..40c991328e 100644 --- a/app/code/core/Mage/SalesRule/Model/Coupon/CodegeneratorInterface.php +++ b/app/code/core/Mage/SalesRule/Model/Coupon/CodegeneratorInterface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Model/Coupon/Massgenerator.php b/app/code/core/Mage/SalesRule/Model/Coupon/Massgenerator.php index 0107f6f26a..557b344ea6 100644 --- a/app/code/core/Mage/SalesRule/Model/Coupon/Massgenerator.php +++ b/app/code/core/Mage/SalesRule/Model/Coupon/Massgenerator.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -77,9 +77,10 @@ public function generateCode() $charset = Mage::helper('salesrule/coupon')->getCharset($format); $code = ''; + $charsetSize = count($charset); for ($i=0; $i<$length; $i++) { - $char = $charset[array_rand($charset)]; - if ($split > 0 && ($i%$split) == 0 && $i != 0) { + $char = $charset[mt_rand(0, $charsetSize - 1)]; + if ($split > 0 && ($i % $split) == 0 && $i != 0) { $char = $splitChar . $char; } $code .= $char; @@ -133,6 +134,10 @@ public function generatePool() $this->setLength($length); } + $now = $this->getResource()->formatDate( + Mage::getSingleton('core/date')->gmtTimestamp() + ); + for ($i = 0; $i < $size; $i++) { $attempt = 0; do { @@ -153,6 +158,7 @@ public function generatePool() ->setUsageLimit($this->getUsesPerCoupon()) ->setUsagePerCustomer($this->getUsesPerCustomer()) ->setExpirationDate($expirationDate) + ->setCreatedAt($now) ->setType(Mage_SalesRule_Helper_Coupon::COUPON_TYPE_SPECIFIC_AUTOGENERATED) ->setCode($code) ->save(); diff --git a/app/code/core/Mage/SalesRule/Model/Mysql4/Coupon.php b/app/code/core/Mage/SalesRule/Model/Mysql4/Coupon.php index 155706acb5..747cd929be 100644 --- a/app/code/core/Mage/SalesRule/Model/Mysql4/Coupon.php +++ b/app/code/core/Mage/SalesRule/Model/Mysql4/Coupon.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Model/Mysql4/Coupon/Collection.php b/app/code/core/Mage/SalesRule/Model/Mysql4/Coupon/Collection.php index 6b1b2c68a6..31a22db1d8 100644 --- a/app/code/core/Mage/SalesRule/Model/Mysql4/Coupon/Collection.php +++ b/app/code/core/Mage/SalesRule/Model/Mysql4/Coupon/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Model/Mysql4/Coupon/Usage.php b/app/code/core/Mage/SalesRule/Model/Mysql4/Coupon/Usage.php index 3a3910b12c..e8445d0770 100644 --- a/app/code/core/Mage/SalesRule/Model/Mysql4/Coupon/Usage.php +++ b/app/code/core/Mage/SalesRule/Model/Mysql4/Coupon/Usage.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Model/Mysql4/Report/Collection.php b/app/code/core/Mage/SalesRule/Model/Mysql4/Report/Collection.php index 9ccf59f036..0062fe3c02 100644 --- a/app/code/core/Mage/SalesRule/Model/Mysql4/Report/Collection.php +++ b/app/code/core/Mage/SalesRule/Model/Mysql4/Report/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Model/Mysql4/Report/Rule.php b/app/code/core/Mage/SalesRule/Model/Mysql4/Report/Rule.php index 70af07fc49..913c6d16cb 100644 --- a/app/code/core/Mage/SalesRule/Model/Mysql4/Report/Rule.php +++ b/app/code/core/Mage/SalesRule/Model/Mysql4/Report/Rule.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Model/Mysql4/Report/Updatedat/Collection.php b/app/code/core/Mage/SalesRule/Model/Mysql4/Report/Updatedat/Collection.php index 14ab798b20..adf0b5b305 100644 --- a/app/code/core/Mage/SalesRule/Model/Mysql4/Report/Updatedat/Collection.php +++ b/app/code/core/Mage/SalesRule/Model/Mysql4/Report/Updatedat/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Model/Mysql4/Rule.php b/app/code/core/Mage/SalesRule/Model/Mysql4/Rule.php index b7f85da73a..85d57c2f19 100644 --- a/app/code/core/Mage/SalesRule/Model/Mysql4/Rule.php +++ b/app/code/core/Mage/SalesRule/Model/Mysql4/Rule.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Model/Mysql4/Rule/Collection.php b/app/code/core/Mage/SalesRule/Model/Mysql4/Rule/Collection.php index e9a0a9d93c..4530579fa9 100644 --- a/app/code/core/Mage/SalesRule/Model/Mysql4/Rule/Collection.php +++ b/app/code/core/Mage/SalesRule/Model/Mysql4/Rule/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Model/Mysql4/Rule/Customer.php b/app/code/core/Mage/SalesRule/Model/Mysql4/Rule/Customer.php index 623db6acc1..ab10cf2855 100644 --- a/app/code/core/Mage/SalesRule/Model/Mysql4/Rule/Customer.php +++ b/app/code/core/Mage/SalesRule/Model/Mysql4/Rule/Customer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Model/Mysql4/Rule/Customer/Collection.php b/app/code/core/Mage/SalesRule/Model/Mysql4/Rule/Customer/Collection.php index ef5f41a3f2..b8af9d4cc8 100644 --- a/app/code/core/Mage/SalesRule/Model/Mysql4/Rule/Customer/Collection.php +++ b/app/code/core/Mage/SalesRule/Model/Mysql4/Rule/Customer/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Model/Mysql4/Rule/Product.php b/app/code/core/Mage/SalesRule/Model/Mysql4/Rule/Product.php index 0f31ba7380..6d46b3328b 100644 --- a/app/code/core/Mage/SalesRule/Model/Mysql4/Rule/Product.php +++ b/app/code/core/Mage/SalesRule/Model/Mysql4/Rule/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Model/Mysql4/Rule/Product/Collection.php b/app/code/core/Mage/SalesRule/Model/Mysql4/Rule/Product/Collection.php index 9bc2ee28c7..5fe886fb71 100644 --- a/app/code/core/Mage/SalesRule/Model/Mysql4/Rule/Product/Collection.php +++ b/app/code/core/Mage/SalesRule/Model/Mysql4/Rule/Product/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Model/Observer.php b/app/code/core/Mage/SalesRule/Model/Observer.php index 14745af65b..745eede950 100644 --- a/app/code/core/Mage/SalesRule/Model/Observer.php +++ b/app/code/core/Mage/SalesRule/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Model/Quote/Discount.php b/app/code/core/Mage/SalesRule/Model/Quote/Discount.php index 5f884b899c..fb51963241 100644 --- a/app/code/core/Mage/SalesRule/Model/Quote/Discount.php +++ b/app/code/core/Mage/SalesRule/Model/Quote/Discount.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -85,7 +85,9 @@ public function collect(Mage_Sales_Model_Quote_Address $address) $eventArgs['item'] = $item; Mage::dispatchEvent('sales_quote_address_discount_item', $eventArgs); - if ($item->getHasChildren() && $item->isChildrenCalculated()) { + if ($item->getHasChildren() && $item->isChildrenCalculated() + && !$item->getForceApplyDiscountToParentItem() + ) { foreach ($item->getChildren() as $child) { $this->_calculator->process($child); $eventArgs['item'] = $child; diff --git a/app/code/core/Mage/SalesRule/Model/Quote/Freeshipping.php b/app/code/core/Mage/SalesRule/Model/Quote/Freeshipping.php index ae6d546aa8..c7a428e5c5 100644 --- a/app/code/core/Mage/SalesRule/Model/Quote/Freeshipping.php +++ b/app/code/core/Mage/SalesRule/Model/Quote/Freeshipping.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Model/Quote/Nominal/Discount.php b/app/code/core/Mage/SalesRule/Model/Quote/Nominal/Discount.php index afdce233d0..eac3aad20b 100644 --- a/app/code/core/Mage/SalesRule/Model/Quote/Nominal/Discount.php +++ b/app/code/core/Mage/SalesRule/Model/Quote/Nominal/Discount.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Model/Resource/Coupon.php b/app/code/core/Mage/SalesRule/Model/Resource/Coupon.php index 3fa2d14c3c..3b3a1642bb 100755 --- a/app/code/core/Mage/SalesRule/Model/Resource/Coupon.php +++ b/app/code/core/Mage/SalesRule/Model/Resource/Coupon.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -55,7 +55,7 @@ protected function _construct() public function _beforeSave(Mage_Core_Model_Abstract $object) { if (!$object->getExpirationDate()) { - $object->setExpirationDate(new Zend_Db_Expr('NULL')); + $object->setExpirationDate(null); } else if ($object->getExpirationDate() instanceof Zend_Date) { $object->setExpirationDate($object->getExpirationDate()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT)); } diff --git a/app/code/core/Mage/SalesRule/Model/Resource/Coupon/Collection.php b/app/code/core/Mage/SalesRule/Model/Resource/Coupon/Collection.php index 77115ff227..5227e105ca 100755 --- a/app/code/core/Mage/SalesRule/Model/Resource/Coupon/Collection.php +++ b/app/code/core/Mage/SalesRule/Model/Resource/Coupon/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Model/Resource/Coupon/Usage.php b/app/code/core/Mage/SalesRule/Model/Resource/Coupon/Usage.php index debbf653cd..6d4e994a81 100755 --- a/app/code/core/Mage/SalesRule/Model/Resource/Coupon/Usage.php +++ b/app/code/core/Mage/SalesRule/Model/Resource/Coupon/Usage.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Model/Resource/Report/Collection.php b/app/code/core/Mage/SalesRule/Model/Resource/Report/Collection.php index bc7d552f9d..d6bc8c52c6 100755 --- a/app/code/core/Mage/SalesRule/Model/Resource/Report/Collection.php +++ b/app/code/core/Mage/SalesRule/Model/Resource/Report/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Model/Resource/Report/Rule.php b/app/code/core/Mage/SalesRule/Model/Resource/Report/Rule.php index 927a342d67..506fbd6aa6 100755 --- a/app/code/core/Mage/SalesRule/Model/Resource/Report/Rule.php +++ b/app/code/core/Mage/SalesRule/Model/Resource/Report/Rule.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Model/Resource/Report/Rule/Createdat.php b/app/code/core/Mage/SalesRule/Model/Resource/Report/Rule/Createdat.php index f1aa2ec8a4..085fa34ba4 100644 --- a/app/code/core/Mage/SalesRule/Model/Resource/Report/Rule/Createdat.php +++ b/app/code/core/Mage/SalesRule/Model/Resource/Report/Rule/Createdat.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Model/Resource/Report/Rule/Updatedat.php b/app/code/core/Mage/SalesRule/Model/Resource/Report/Rule/Updatedat.php index b804c4d062..c736454ffb 100644 --- a/app/code/core/Mage/SalesRule/Model/Resource/Report/Rule/Updatedat.php +++ b/app/code/core/Mage/SalesRule/Model/Resource/Report/Rule/Updatedat.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Model/Resource/Report/Updatedat/Collection.php b/app/code/core/Mage/SalesRule/Model/Resource/Report/Updatedat/Collection.php index ab55e46025..a4cbb500f3 100755 --- a/app/code/core/Mage/SalesRule/Model/Resource/Report/Updatedat/Collection.php +++ b/app/code/core/Mage/SalesRule/Model/Resource/Report/Updatedat/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Model/Resource/Rule.php b/app/code/core/Mage/SalesRule/Model/Resource/Rule.php index a35bc90f18..76fbc7b68a 100755 --- a/app/code/core/Mage/SalesRule/Model/Resource/Rule.php +++ b/app/code/core/Mage/SalesRule/Model/Resource/Rule.php @@ -20,23 +20,40 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** - * SalesRule resource model + * Sales Rule resource model * - * @category Mage - * @package Mage_SalesRule - * @author Magento Core Team + * @category Mage + * @package Mage_SalesRule + * @author Magento Core Team */ -class Mage_SalesRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_Abstract +class Mage_SalesRule_Model_Resource_Rule extends Mage_Rule_Model_Resource_Abstract { /** - * Constructor + * Store associated with rule entities information map * + * @var array + */ + protected $_associatedEntitiesMap = array( + 'website' => array( + 'associations_table' => 'salesrule/website', + 'rule_id_field' => 'rule_id', + 'entity_id_field' => 'website_id' + ), + 'customer_group' => array( + 'associations_table' => 'salesrule/customer_group', + 'rule_id_field' => 'rule_id', + 'entity_id_field' => 'customer_group_id' + ) + ); + + /** + * Initialize main table and table id field */ protected function _construct() { @@ -44,40 +61,92 @@ protected function _construct() } /** - * On beforeSave + * Add customer group ids and website ids to rule data after load + * + * @param Mage_Core_Model_Abstract $object + * + * @return Mage_SalesRule_Model_Resource_Rule + */ + protected function _afterLoad(Mage_Core_Model_Abstract $object) + { + $object->setData('customer_group_ids', (array)$this->getCustomerGroupIds($object->getId())); + $object->setData('website_ids', (array)$this->getWebsiteIds($object->getId())); + + parent::_afterLoad($object); + return $this; + } + + /** + * Prepare sales rule's discount quantity * * @param Mage_Core_Model_Abstract $object + * + * @return Mage_SalesRule_Model_Resource_Rule */ public function _beforeSave(Mage_Core_Model_Abstract $object) { - if (!$object->getFromDate()) { - $object->setFromDate(Mage::app()->getLocale()->date()); + if (!$object->getDiscountQty()) { + $object->setDiscountQty(new Zend_Db_Expr('NULL')); } - if ($object->getFromDate() instanceof Zend_Date) { - $object->setFromDate($object->getFromDate()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT)); + + parent::_beforeSave($object); + return $this; + } + + /** + * Bind sales rule to customer group(s) and website(s). + * Save rule's associated store labels. + * Save product attributes used in rule. + * + * @param Mage_Core_Model_Abstract $object + * + * @return Mage_SalesRule_Model_Resource_Rule + */ + protected function _afterSave(Mage_Core_Model_Abstract $object) + { + if ($object->hasStoreLabels()) { + $this->saveStoreLabels($object->getId(), $object->getStoreLabels()); } - if (!$object->getToDate()) { - $object->setToDate(null); - } else { - if ($object->getToDate() instanceof Zend_Date) { - $object->setToDate($object->getToDate()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT)); + if ($object->hasWebsiteIds()) { + $websiteIds = $object->getWebsiteIds(); + if (!is_array($websiteIds)) { + $websiteIds = explode(',', (string)$websiteIds); } + $this->bindRuleToEntity($object->getId(), $websiteIds, 'website'); } - if (!$object->getDiscountQty()) { - $object->setDiscountQty(null); + if ($object->hasCustomerGroupIds()) { + $customerGroupIds = $object->getCustomerGroupIds(); + if (!is_array($customerGroupIds)) { + $customerGroupIds = explode(',', (string)$customerGroupIds); + } + $this->bindRuleToEntity($object->getId(), $customerGroupIds, 'customer_group'); } - parent::_beforeSave($object); + // Save product attributes used in rule + $ruleProductAttributes = array_merge( + $this->getProductAttributes(serialize($object->getConditions()->asArray())), + $this->getProductAttributes(serialize($object->getActions()->asArray())) + ); + if (count($ruleProductAttributes)) { + $this->setActualProductAttributes($object, $ruleProductAttributes); + } + + // Update auto geterated specific coupons if exists + if ($object->getUseAutoGeneration() && $object->hasDataChanges()) { + Mage::getResourceModel('salesrule/coupon')->updateSpecificCoupons($object); + } + return parent::_afterSave($object); } /** - * Get customer uses + * Retrieve coupon/rule uses for specified customer * - * @param unknown_type $rule - * @param unknown_type $customerId - * @return unknown + * @param Mage_SalesRule_Model_Rule $rule + * @param int $customerId + * + * @return string */ public function getCustomerUses($rule, $customerId) { @@ -93,29 +162,47 @@ public function getCustomerUses($rule, $customerId) * * @param int $ruleId * @param array $labels + * * @return Mage_SalesRule_Model_Resource_Rule */ public function saveStoreLabels($ruleId, $labels) { - $delete = array(); - $table = $this->getTable('salesrule/label'); + $deleteByStoreIds = array(); + $table = $this->getTable('salesrule/label'); $adapter = $this->_getWriteAdapter(); + $data = array(); foreach ($labels as $storeId => $label) { if (Mage::helper('core/string')->strlen($label)) { - $data = array('rule_id' => $ruleId, 'store_id' => $storeId, 'label' => $label); - $adapter->insertOnDuplicate($table, $data, array('label')); + $data[] = array('rule_id' => $ruleId, 'store_id' => $storeId, 'label' => $label); } else { - $delete[] = $storeId; + $deleteByStoreIds[] = $storeId; } } - if (!empty($delete)) { - $adapter->delete($table, array( - 'rule_id=?' => $ruleId, - 'store_id IN (?)' => $delete - )); + $adapter->beginTransaction(); + try { + if (!empty($data)) { + $adapter->insertOnDuplicate( + $table, + $data, + array('label') + ); + } + + if (!empty($deleteByStoreIds)) { + $adapter->delete($table, array( + 'rule_id=?' => $ruleId, + 'store_id IN (?)' => $deleteByStoreIds + )); + } + } catch (Exception $e) { + $adapter->rollback(); + throw $e; + } + $adapter->commit(); + return $this; } @@ -172,7 +259,7 @@ public function getActiveAttributes($websiteId, $customerGroupId) * * @param Mage_SalesRule_Model_Rule $rule * @param mixed $attributes - * return Mage_SalesRule_Model_Mysql4_Rule + * @return Mage_SalesRule_Model_Resource_Rule */ public function setActualProductAttributes($rule, $attributes) { @@ -182,8 +269,8 @@ public function setActualProductAttributes($rule, $attributes) //Getting attribute IDs for attribute codes $attributeIds = array(); $select = $this->_getReadAdapter()->select() - ->from(array('a'=>$this->getTable('eav/attribute')), array('a.attribute_id')) - ->where('a.attribute_code IN (?)', array($attributes)); + ->from(array('a' => $this->getTable('eav/attribute')), array('a.attribute_id')) + ->where('a.attribute_code IN (?)', array($attributes)); $attributesFound = $this->_getReadAdapter()->fetchAll($select); if ($attributesFound) { foreach ($attributesFound as $attribute) { @@ -191,8 +278,8 @@ public function setActualProductAttributes($rule, $attributes) } $data = array(); - foreach (explode(',', $rule->getCustomerGroupIds()) as $customerGroupId) { - foreach (explode(',', $rule->getWebsiteIds()) as $websiteId) { + foreach ($rule->getCustomerGroupIds() as $customerGroupId) { + foreach ($rule->getWebsiteIds() as $websiteId) { foreach ($attributeIds as $attribute) { $data[] = array ( 'rule_id' => $rule->getId(), @@ -205,6 +292,27 @@ public function setActualProductAttributes($rule, $attributes) } $write->insertMultiple($this->getTable('salesrule/product_attribute'), $data); } + return $this; } + + /** + * Collect all product attributes used in serialized rule's action or condition + * + * @param string $serializedString + * + * @return array + */ + public function getProductAttributes($serializedString) + { + $result = array(); + if (preg_match_all('~s:32:"salesrule/rule_condition_product";s:9:"attribute";s:\d+:"(.*?)"~s', + $serializedString, $matches)){ + foreach ($matches[1] as $offset => $attributeCode) { + $result[] = $attributeCode; + } + } + + return $result; + } } diff --git a/app/code/core/Mage/SalesRule/Model/Resource/Rule/Collection.php b/app/code/core/Mage/SalesRule/Model/Resource/Rule/Collection.php index e7443c5a74..9b2a0574f6 100755 --- a/app/code/core/Mage/SalesRule/Model/Resource/Rule/Collection.php +++ b/app/code/core/Mage/SalesRule/Model/Resource/Rule/Collection.php @@ -20,23 +20,40 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** - * SalesRule Model Resource Rule_Collection + * Sales Rules resource collection model * * @category Mage * @package Mage_SalesRule * @author Magento Core Team */ -class Mage_SalesRule_Model_Resource_Rule_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract +class Mage_SalesRule_Model_Resource_Rule_Collection extends Mage_Rule_Model_Resource_Rule_Collection_Abstract { /** - * Constructor + * Store associated with rule entities information map * + * @var array + */ + protected $_associatedEntitiesMap = array( + 'website' => array( + 'associations_table' => 'salesrule/website', + 'rule_id_field' => 'rule_id', + 'entity_id_field' => 'website_id' + ), + 'customer_group' => array( + 'associations_table' => 'salesrule/customer_group', + 'rule_id_field' => 'rule_id', + 'entity_id_field' => 'customer_group_id' + ) + ); + + /** + * Set resource model and determine field mapping */ protected function _construct() { @@ -45,72 +62,100 @@ protected function _construct() } /** - * Set filter to select rules that matches current criteria + * Filter collection by specified website, customer group, coupon code, date. + * Filter collection to use only active rules. + * Involved sorting by sort_order column. * * @param int $websiteId * @param int $customerGroupId * @param string $couponCode - * @param string $now + * @param string|null $now + * @use $this->addWebsiteGroupDateFilter() + * * @return Mage_SalesRule_Model_Resource_Rule_Collection */ public function setValidationFilter($websiteId, $customerGroupId, $couponCode = '', $now = null) { - if (is_null($now)) { - $now = Mage::getModel('core/date')->date('Y-m-d'); - } - /* We need to overwrite joinLeft if coupon is applied */ - $this->getSelect()->reset(); - parent::_initSelect(); + if (!$this->getFlag('validation_filter')) { - $this->addFieldToFilter('website_ids', array('finset' => (int)$websiteId)) - ->addFieldToFilter('customer_group_ids', array('finset' => (int)$customerGroupId)) - ->addFieldToFilter('is_active', 1); + /* We need to overwrite joinLeft if coupon is applied */ + $this->getSelect()->reset(); + parent::_initSelect(); - if (strlen($couponCode)) { - $this->getSelect() - ->joinLeft( + $this->addWebsiteGroupDateFilter($websiteId, $customerGroupId, $now); + $select = $this->getSelect(); + + if (strlen($couponCode)) { + $select->joinLeft( array('rule_coupons' => $this->getTable('salesrule/coupon')), 'main_table.rule_id = rule_coupons.rule_id ', array('code') ); - $this->getSelect()->where( - '(main_table.coupon_type = ? ', Mage_SalesRule_Model_Rule::COUPON_TYPE_NO_COUPON - ); - $this->getSelect()->orWhere('rule_coupons.code = ?)', $couponCode); - } else { - $this->addFieldToFilter('main_table.coupon_type', Mage_SalesRule_Model_Rule::COUPON_TYPE_NO_COUPON); + $select->where('(main_table.coupon_type = ? ', Mage_SalesRule_Model_Rule::COUPON_TYPE_NO_COUPON) + ->orWhere('(main_table.coupon_type = ? AND rule_coupons.type = 0', + Mage_SalesRule_Model_Rule::COUPON_TYPE_AUTO) + ->orWhere('main_table.coupon_type = ? AND main_table.use_auto_generation = 1 ' . + 'AND rule_coupons.type = 1', Mage_SalesRule_Model_Rule::COUPON_TYPE_SPECIFIC) + ->orWhere('main_table.coupon_type = ? AND main_table.use_auto_generation = 0 ' . + 'AND rule_coupons.type = 0)', Mage_SalesRule_Model_Rule::COUPON_TYPE_SPECIFIC) + ->where('rule_coupons.code = ?)', $couponCode); + } else { + $this->addFieldToFilter('main_table.coupon_type', Mage_SalesRule_Model_Rule::COUPON_TYPE_NO_COUPON); + } + $this->setOrder('sort_order', self::SORT_ORDER_ASC); + $this->setFlag('validation_filter', true); } - $this->getSelect()->where('from_date is null or from_date <= ?', $now); - $this->getSelect()->where('to_date is null or to_date >= ?', $now); - $this->getSelect()->order('sort_order'); + return $this; } /** - * Filter collection by specified website IDs + * Filter collection by website(s), customer group(s) and date. + * Filter collection to only active rules. + * Sorting is not involved * - * @param int|array $websiteIds - * @return Mage_SalesRule_Model_Resource_Rule_Collection + * @param int $websiteId + * @param int $customerGroupId + * @param string|null $now + * @use $this->addWebsiteFilter() + * + * @return Mage_SalesRule_Model_Mysql4_Rule_Collection */ - public function addWebsiteFilter($websiteIds) + public function addWebsiteGroupDateFilter($websiteId, $customerGroupId, $now = null) { - if (!is_array($websiteIds)) { - $websiteIds = array($websiteIds); - } - $parts = array(); - foreach ($websiteIds as $websiteId) { - $parts[] = $this->getConnection() - ->prepareSqlCondition('main_table.website_ids', array('finset' => $websiteId)); - } - if ($parts) { - $this->getSelect()->where(new Zend_Db_Expr(implode(' OR ', $parts))); + if (!$this->getFlag('website_group_date_filter')) { + if (is_null($now)) { + $now = Mage::getModel('core/date')->date('Y-m-d'); + } + + $this->addWebsiteFilter($websiteId); + + $entityInfo = $this->_getAssociatedEntityInfo('customer_group'); + $connection = $this->getConnection(); + $this->getSelect() + ->joinInner( + array('customer_group_ids' => $this->getTable($entityInfo['associations_table'])), + $connection->quoteInto( + 'main_table.' . $entityInfo['rule_id_field'] + . ' = customer_group_ids.' . $entityInfo['rule_id_field'] + . ' AND customer_group_ids.' . $entityInfo['entity_id_field'] . ' = ?', + (int)$customerGroupId + ), + array() + ) + ->where('from_date is null or from_date <= ?', $now) + ->where('to_date is null or to_date >= ?', $now); + + $this->addIsActiveFilter(); + + $this->setFlag('website_group_date_filter', true); } + return $this; } /** - * Init collection select - * + * Add primary coupon to collection * * @return Mage_SalesRule_Model_Resource_Rule_Collection */ @@ -130,6 +175,7 @@ public function _initSelect() * Find product attribute in conditions or actions * * @param string $attributeCode + * * @return Mage_SalesRule_Model_Resource_Rule_Collection */ public function addAttributeInConditionFilter($attributeCode) diff --git a/app/code/core/Mage/SalesRule/Model/Resource/Rule/Customer.php b/app/code/core/Mage/SalesRule/Model/Resource/Rule/Customer.php index d80343aaad..510eb48d1f 100755 --- a/app/code/core/Mage/SalesRule/Model/Resource/Rule/Customer.php +++ b/app/code/core/Mage/SalesRule/Model/Resource/Rule/Customer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Model/Resource/Rule/Customer/Collection.php b/app/code/core/Mage/SalesRule/Model/Resource/Rule/Customer/Collection.php index 6c26d253c6..b20a6fc971 100755 --- a/app/code/core/Mage/SalesRule/Model/Resource/Rule/Customer/Collection.php +++ b/app/code/core/Mage/SalesRule/Model/Resource/Rule/Customer/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Model/Resource/Rule/Product.php b/app/code/core/Mage/SalesRule/Model/Resource/Rule/Product.php index 4cf2e7abc1..589bac783a 100755 --- a/app/code/core/Mage/SalesRule/Model/Resource/Rule/Product.php +++ b/app/code/core/Mage/SalesRule/Model/Resource/Rule/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Model/Resource/Rule/Product/Collection.php b/app/code/core/Mage/SalesRule/Model/Resource/Rule/Product/Collection.php index 3b4f58fb42..6b57b890b1 100755 --- a/app/code/core/Mage/SalesRule/Model/Resource/Rule/Product/Collection.php +++ b/app/code/core/Mage/SalesRule/Model/Resource/Rule/Product/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Model/Rule.php b/app/code/core/Mage/SalesRule/Model/Rule.php index 372bf41aed..20c829599e 100644 --- a/app/code/core/Mage/SalesRule/Model/Rule.php +++ b/app/code/core/Mage/SalesRule/Model/Rule.php @@ -20,13 +20,13 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** - * SalesRule Model + * Shopping Cart Rule data model * * @method Mage_SalesRule_Model_Resource_Rule _getResource() * @method Mage_SalesRule_Model_Resource_Rule getResource() @@ -87,12 +87,16 @@ * @package Mage_SalesRule * @author Magento Core Team */ -class Mage_SalesRule_Model_Rule extends Mage_Rule_Model_Rule +class Mage_SalesRule_Model_Rule extends Mage_Rule_Model_Abstract { /** - * Free shipping for Item and Address constants + * Free Shipping option "For matching items only" + */ + const FREE_SHIPPING_ITEM = 1; + + /** + * Free Shipping option "For shipment with matching items" */ - const FREE_SHIPPING_ITEM = 1; const FREE_SHIPPING_ADDRESS = 2; /** @@ -113,6 +117,8 @@ class Mage_SalesRule_Model_Rule extends Mage_Rule_Model_Rule const BUY_X_GET_Y_ACTION = 'buy_x_get_y'; /** + * Store coupon code generator instance + * * @var Mage_SalesRule_Model_Coupon_CodegeneratorInterface */ protected static $_couponCodeGenerator; @@ -134,7 +140,9 @@ class Mage_SalesRule_Model_Rule extends Mage_Rule_Model_Rule protected $_eventObject = 'rule'; /** - * Rule labels for stores + * Contain sores labels + * + * @deprecated after 1.6.2.0 * * @var array */ @@ -162,14 +170,14 @@ class Mage_SalesRule_Model_Rule extends Mage_Rule_Model_Rule protected $_couponTypes; /** - * Array of already validated addresses and validation results + * Store already validated addresses and validation results * * @var array */ protected $_validatedAddresses = array(); /** - * Initializes resource and sets ID field name + * Set resource model and Id field name */ protected function _construct() { @@ -189,55 +197,62 @@ public static function getCouponMassGenerator() } /** - * Returns code generator instance for auto generated coupons + * Set coupon code and uses per coupon * - * @return Mage_SalesRule_Model_Coupon_CodegeneratorInterface + * @return Mage_SalesRule_Model_Rule */ - public static function getCouponCodeGenerator() + protected function _afterLoad() { - if (!self::$_couponCodeGenerator) { - return Mage::getSingleton('salesrule/coupon_codegenerator', array('length' => 16)); + $this->setCouponCode($this->getPrimaryCoupon()->getCode()); + if ($this->getUsesPerCoupon() !== null && !$this->getUseAutoGeneration()) { + $this->setUsesPerCoupon($this->getPrimaryCoupon()->getUsageLimit()); } - return self::$_couponCodeGenerator; - } - - /** - * Set code generator instance for auto generated coupons - * - * @param Mage_SalesRule_Model_Coupon_CodegeneratorInterface - */ - public static function setCouponCodeGenerator(Mage_SalesRule_Model_Coupon_CodegeneratorInterface $codeGenerator) - { - self::$_couponCodeGenerator = $codeGenerator; + return parent::_afterLoad(); } /** - * Retrieve rule's primary coupon + * Save/delete coupon * - * @return Mage_SalesRule_Model_Coupon + * @return Mage_SalesRule_Model_Rule */ - public function getPrimaryCoupon() + protected function _afterSave() { - if ($this->_primaryCoupon === null) { - $this->_primaryCoupon = Mage::getModel('salesrule/coupon'); - $this->_primaryCoupon->loadPrimaryByRule($this->getId()); - $this->_primaryCoupon->setRule($this)->setIsPrimary(true); + $couponCode = trim($this->getCouponCode()); + if (strlen($couponCode) + && $this->getCouponType() == self::COUPON_TYPE_SPECIFIC + && !$this->getUseAutoGeneration() + ) { + $this->getPrimaryCoupon() + ->setCode($couponCode) + ->setUsageLimit($this->getUsesPerCoupon() ? $this->getUsesPerCoupon() : null) + ->setUsagePerCustomer($this->getUsesPerCustomer() ? $this->getUsesPerCustomer() : null) + ->setExpirationDate($this->getToDate()) + ->save(); + } else { + $this->getPrimaryCoupon()->delete(); } - return $this->_primaryCoupon; + + parent::_afterSave(); + return $this; } /** - * Processing object after load data + * Initialize rule model data from array. + * Set store labels if applicable. + * + * @param array $data * - * @return Mage_Core_Model_Abstract + * @return Mage_SalesRule_Model_Rule */ - protected function _afterLoad() + public function loadPost(array $data) { - $this->setCouponCode($this->getPrimaryCoupon()->getCode()); - if ($this->getUsesPerCoupon() !== null && !$this->getUseAutoGeneration()) { - $this->setUsesPerCoupon($this->getPrimaryCoupon()->getUsageLimit()); + parent::loadPost($data); + + if (isset($data['store_labels'])) { + $this->setStoreLabels($data['store_labels']); } - return parent::_afterLoad(); + + return $this; } /** @@ -261,103 +276,80 @@ public function getActionsInstance() } /** - * Initialize rule model data from array - * + * Returns code generator instance for auto generated coupons * - * @param array $rule - * @return Mage_SalesRule_Model_Rule + * @return Mage_SalesRule_Model_Coupon_CodegeneratorInterface */ - public function loadPost(array $rule) + public static function getCouponCodeGenerator() { - $arr = $this->_convertFlatToRecursive($rule); - if (isset($arr['conditions'])) { - $this->getConditions()->setConditions(array())->loadArray($arr['conditions'][1]); - } - if (isset($arr['actions'])) { - $this->getActions()->setActions(array())->loadArray($arr['actions'][1], 'actions'); - } - if (isset($rule['store_labels'])) { - $this->setStoreLabels($rule['store_labels']); + if (!self::$_couponCodeGenerator) { + return Mage::getSingleton('salesrule/coupon_codegenerator', array('length' => 16)); } - return $this; + return self::$_couponCodeGenerator; } /** - * Get resource collection + * Set code generator instance for auto generated coupons * - * @return Mage_SalesRule_Model_Resource_Rule_Collection + * @param Mage_SalesRule_Model_Coupon_CodegeneratorInterface */ - public function getResourceCollection() + public static function setCouponCodeGenerator(Mage_SalesRule_Model_Coupon_CodegeneratorInterface $codeGenerator) { - return Mage::getResourceModel('salesrule/rule_collection'); + self::$_couponCodeGenerator = $codeGenerator; } /** - * Save rule labels after rule save and process product attributes used in actions and conditions + * Retrieve rule's primary coupon * - * @return Mage_SalesRule_Model_Rule + * @return Mage_SalesRule_Model_Coupon */ - protected function _afterSave() + public function getPrimaryCoupon() { - if ($this->hasStoreLabels()) { - $this->_getResource()->saveStoreLabels($this->getId(), $this->getStoreLabels()); - } - $couponCode = trim($this->getCouponCode()); - if (strlen($couponCode) - && $this->getCouponType() == self::COUPON_TYPE_SPECIFIC - && !$this->getUseAutoGeneration() - ) { - $this->getPrimaryCoupon() - ->setCode($couponCode) - ->setUsageLimit($this->getUsesPerCoupon() ? $this->getUsesPerCoupon() : null) - ->setUsagePerCustomer($this->getUsesPerCustomer() ? $this->getUsesPerCustomer() : null) - ->setExpirationDate($this->getToDate()) - ->save(); - } else { - $this->getPrimaryCoupon()->delete(); - } - - //Saving attributes used in rule - $ruleProductAttributes = array_merge( - $this->_getUsedAttributes($this->getConditionsSerialized()), - $this->_getUsedAttributes($this->getActionsSerialized()) - ); - if (count($ruleProductAttributes)) { - $this->getResource()->setActualProductAttributes($this, $ruleProductAttributes); + if ($this->_primaryCoupon === null) { + $this->_primaryCoupon = Mage::getModel('salesrule/coupon'); + $this->_primaryCoupon->loadPrimaryByRule($this->getId()); + $this->_primaryCoupon->setRule($this)->setIsPrimary(true); } + return $this->_primaryCoupon; + } - //Update auto geterated specific coupons if exists - if ($this->getUseAutoGeneration() && $this->hasDataChanges()) { - Mage::getResourceModel('salesrule/coupon')->updateSpecificCoupons($this); + /** + * Get sales rule customer group Ids + * + * @return array + */ + public function getCustomerGroupIds() + { + if (!$this->hasCustomerGroupIds()) { + $customerGroupIds = $this->_getResource()->getCustomerGroupIds($this->getId()); + $this->setData('customer_group_ids', (array)$customerGroupIds); } - return parent::_afterSave(); + return $this->_getData('customer_group_ids'); } /** - * Get Rule label for specific store + * Get Rule label by specified store + * + * @param Mage_Core_Model_Store|int|bool|null $store * - * @param store $store - * @return string | false + * @return string|bool */ - public function getStoreLabel($store=null) + public function getStoreLabel($store = null) { $storeId = Mage::app()->getStore($store)->getId(); - if ($this->hasStoreLabels()) { - $labels = $this->_getData('store_labels'); - if (isset($labels[$storeId])) { - return $labels[$storeId]; - } elseif ($labels[0]) { - return $labels[0]; - } - return false; - } elseif (!isset($this->_labels[$storeId])) { - $this->_labels[$storeId] = $this->_getResource()->getStoreLabel($this->getId(), $storeId); + $labels = (array)$this->getStoreLabels(); + + if (isset($labels[$storeId])) { + return $labels[$storeId]; + } elseif (isset($labels[0]) && $labels[0]) { + return $labels[0]; } - return $this->_labels[$storeId]; + + return false; } /** - * Get all existing rule labels + * Set if not yet and retrieve rule store labels * * @return array */ @@ -367,6 +359,7 @@ public function getStoreLabels() $labels = $this->_getResource()->getStoreLabels($this->getId()); $this->setStoreLabels($labels); } + return $this->_getData('store_labels'); } @@ -379,7 +372,7 @@ public function getCoupons() { if ($this->_coupons === null) { $collection = Mage::getResourceModel('salesrule/coupon_collection'); - /** @var Mage_SalesRule_Model_Mysql4_Coupon_Collection */ + /** @var Mage_SalesRule_Model_Resource_Coupon_Collection */ $collection->addRuleToFilter($this); $this->_coupons = $collection->getItems(); } @@ -399,8 +392,8 @@ public function getCouponTypes() Mage_SalesRule_Model_Rule::COUPON_TYPE_SPECIFIC => Mage::helper('salesrule')->__('Specific Coupon'), ); $transport = new Varien_Object(array( - 'coupon_types' => $this->_couponTypes, - 'is_coupon_type_auto_visible' => false + 'coupon_types' => $this->_couponTypes, + 'is_coupon_type_auto_visible' => false )); Mage::dispatchEvent('salesrule_rule_get_coupon_types', array('transport' => $transport)); $this->_couponTypes = $transport->getCouponTypes(); @@ -414,8 +407,9 @@ public function getCouponTypes() /** * Acquire coupon instance * - * @param bool Whether or not to save newly created coupon - * @param int Number of attempts to save newly created coupon + * @param bool $saveNewlyCreated Whether or not to save newly created coupon + * @param int $saveAttemptCount Number of attempts to save newly created coupon + * * @return Mage_SalesRule_Model_Coupon|null */ public function acquireCoupon($saveNewlyCreated = true, $saveAttemptCount = 10) @@ -428,13 +422,15 @@ public function acquireCoupon($saveNewlyCreated = true, $saveAttemptCount = 10) } /** @var Mage_SalesRule_Model_Coupon $coupon */ $coupon = Mage::getModel('salesrule/coupon'); - $coupon->setRule($this)->setIsPrimary(false); - $coupon->setUsageLimit($this->getUsesPerCoupon() ? $this->getUsesPerCoupon() : null) - ->setUsagePerCustomer($this->getUsesPerCustomer() ? $this->getUsesPerCustomer() : null) - ->setExpirationDate($this->getToDate()); + $coupon->setRule($this) + ->setIsPrimary(false) + ->setUsageLimit($this->getUsesPerCoupon() ? $this->getUsesPerCoupon() : null) + ->setUsagePerCustomer($this->getUsesPerCustomer() ? $this->getUsesPerCustomer() : null) + ->setExpirationDate($this->getToDate()); $couponCode = self::getCouponCodeGenerator()->generateCode(); $coupon->setCode($couponCode); + $ok = false; if (!$saveNewlyCreated) { $ok = true; @@ -464,24 +460,6 @@ public function acquireCoupon($saveNewlyCreated = true, $saveAttemptCount = 10) return $coupon; } - /** - * Return all product attributes used on serialized action or condition - * - * @param string $serializedString - * @return array - */ - protected function _getUsedAttributes($serializedString) - { - $result = array(); - if (preg_match_all('~s:32:"salesrule/rule_condition_product";s:9:"attribute";s:\d+:"(.*?)"~s', - $serializedString, $matches)){ - foreach ($matches[1] as $attributeCode) { - $result[] = $attributeCode; - } - } - return $result; - } - /** * Check cached validation result for specific address * @@ -532,4 +510,55 @@ private function _getAddressId($address) { } return $address; } + + + + + + /** + * Collect all product attributes used in serialized rule's action or condition + * + * @deprecated after 1.6.2.0 use Mage_SalesRule_Model_Resource_Rule::getProductAttributes() instead + * + * @param string $serializedString + * + * @return array + */ + protected function _getUsedAttributes($serializedString) + { + return $this->_getResource()->getProductAttributes($serializedString); + } + + /** + * @deprecated after 1.6.2.0 + * + * @param string $format + * + * @return string + */ + public function toString($format='') + { + return ''; + } + + /** + * Returns rule as an array for admin interface + * + * @deprecated after 1.6.2.0 + * + * @param array $arrAttributes + * + * Output example: + * array( + * 'name'=>'Example rule', + * 'conditions'=>{condition_combine::toArray} + * 'actions'=>{action_collection::toArray} + * ) + * + * @return array + */ + public function toArray(array $arrAttributes = array()) + { + return parent::toArray($arrAttributes); + } } diff --git a/app/code/core/Mage/SalesRule/Model/Rule/Action/Collection.php b/app/code/core/Mage/SalesRule/Model/Rule/Action/Collection.php index a14deafd8c..3543910eb8 100644 --- a/app/code/core/Mage/SalesRule/Model/Rule/Action/Collection.php +++ b/app/code/core/Mage/SalesRule/Model/Rule/Action/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Model/Rule/Action/Product.php b/app/code/core/Mage/SalesRule/Model/Rule/Action/Product.php index 1e01b8c790..af35f73786 100644 --- a/app/code/core/Mage/SalesRule/Model/Rule/Action/Product.php +++ b/app/code/core/Mage/SalesRule/Model/Rule/Action/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Model/Rule/Condition/Address.php b/app/code/core/Mage/SalesRule/Model/Rule/Condition/Address.php index 24d0114ef8..0785223cfe 100644 --- a/app/code/core/Mage/SalesRule/Model/Rule/Condition/Address.php +++ b/app/code/core/Mage/SalesRule/Model/Rule/Condition/Address.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Model/Rule/Condition/Combine.php b/app/code/core/Mage/SalesRule/Model/Rule/Condition/Combine.php index 91d7c23a47..27e5d6fa05 100644 --- a/app/code/core/Mage/SalesRule/Model/Rule/Condition/Combine.php +++ b/app/code/core/Mage/SalesRule/Model/Rule/Condition/Combine.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product.php b/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product.php index fbf5416338..04055109a5 100644 --- a/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product.php +++ b/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product.php @@ -20,14 +20,25 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -class Mage_SalesRule_Model_Rule_Condition_Product extends Mage_CatalogRule_Model_Rule_Condition_Product +/** + * Product rule condition data model + * + * @category Mage + * @package Mage_SalesRule + * @author Magento Core Team + */ +class Mage_SalesRule_Model_Rule_Condition_Product extends Mage_Rule_Model_Condition_Product_Abstract { - + /** + * Add special attributes + * + * @param array $attributes + */ protected function _addSpecialAttributes(array &$attributes) { parent::_addSpecialAttributes($attributes); @@ -40,6 +51,7 @@ protected function _addSpecialAttributes(array &$attributes) * Validate Product Rule Condition * * @param Varien_Object $object + * * @return bool */ public function validate(Varien_Object $object) diff --git a/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Combine.php b/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Combine.php index 4f3f32db2c..fea93f7258 100644 --- a/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Combine.php +++ b/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Combine.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Found.php b/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Found.php index 3aa3e54e81..408fdda1a2 100644 --- a/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Found.php +++ b/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Found.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Subselect.php b/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Subselect.php index 04bd530db9..10fecc0e08 100644 --- a/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Subselect.php +++ b/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Subselect.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Model/Rule/Customer.php b/app/code/core/Mage/SalesRule/Model/Rule/Customer.php index 42b96625ab..63c6763294 100644 --- a/app/code/core/Mage/SalesRule/Model/Rule/Customer.php +++ b/app/code/core/Mage/SalesRule/Model/Rule/Customer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Model/Rule/Product.php b/app/code/core/Mage/SalesRule/Model/Rule/Product.php index 3ea4fbdf99..cacce2afc9 100644 --- a/app/code/core/Mage/SalesRule/Model/Rule/Product.php +++ b/app/code/core/Mage/SalesRule/Model/Rule/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Model/System/Config/Source/Coupon/Format.php b/app/code/core/Mage/SalesRule/Model/System/Config/Source/Coupon/Format.php index 8980237bcb..1a38761468 100644 --- a/app/code/core/Mage/SalesRule/Model/System/Config/Source/Coupon/Format.php +++ b/app/code/core/Mage/SalesRule/Model/System/Config/Source/Coupon/Format.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Model/Validator.php b/app/code/core/Mage/SalesRule/Model/Validator.php index e426d62d9e..ad8788d7e1 100644 --- a/app/code/core/Mage/SalesRule/Model/Validator.php +++ b/app/code/core/Mage/SalesRule/Model/Validator.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -397,7 +397,7 @@ public function process(Mage_Sales_Model_Quote_Item_Abstract $item) case Mage_SalesRule_Model_Rule::BUY_X_GET_Y_ACTION: $x = $rule->getDiscountStep(); $y = $rule->getDiscountAmount(); - if (!$x || $y>=$x) { + if (!$x || $y > $x) { break; } $buyAndDiscountQty = $x + $y; @@ -692,7 +692,7 @@ protected function _maintainAddressCouponCode($address, $rule) Rule is a part of rules collection, which includes only rules with 'No Coupon' type or with validated coupon. As a result, if rule uses coupon code(s) ('Specific' or 'Auto' Coupon Type), it always contains validated coupon */ - if ($rule->getCoponType() != Mage_SalesRule_Model_Rule::COUPON_TYPE_NO_COUPON) { + if ($rule->getCouponType() != Mage_SalesRule_Model_Rule::COUPON_TYPE_NO_COUPON) { $address->setCouponCode($this->getCouponCode()); } diff --git a/app/code/core/Mage/SalesRule/etc/adminhtml.xml b/app/code/core/Mage/SalesRule/etc/adminhtml.xml index 3e4a7fad83..640138f558 100644 --- a/app/code/core/Mage/SalesRule/etc/adminhtml.xml +++ b/app/code/core/Mage/SalesRule/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -48,6 +48,17 @@ + + + + + + Shopping Cart Price Rules + + + + +
    diff --git a/app/code/core/Mage/SalesRule/etc/config.xml b/app/code/core/Mage/SalesRule/etc/config.xml index 23d3d53968..8008fb37b6 100644 --- a/app/code/core/Mage/SalesRule/etc/config.xml +++ b/app/code/core/Mage/SalesRule/etc/config.xml @@ -21,14 +21,14 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> - 1.6.0.2 + 1.6.0.3 @@ -73,6 +73,12 @@ salesrule_product_attribute
    + + salesrule_website
    +
    + + salesrule_customer_group
    +
    diff --git a/app/code/core/Mage/SalesRule/etc/system.xml b/app/code/core/Mage/SalesRule/etc/system.xml index a6f9131240..548fc2ba78 100644 --- a/app/code/core/Mage/SalesRule/etc/system.xml +++ b/app/code/core/Mage/SalesRule/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/SalesRule/sql/salesrule_setup/install-1.6.0.0.php b/app/code/core/Mage/SalesRule/sql/salesrule_setup/install-1.6.0.0.php index e96737cec9..b85cf5bc1f 100644 --- a/app/code/core/Mage/SalesRule/sql/salesrule_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/SalesRule/sql/salesrule_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-install-0.7.0.php index bf6b5c35b9..22a7a5a137 100644 --- a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-install-0.7.0.php +++ b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-install-0.7.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-install-1.4.0.0.0.php b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-install-1.4.0.0.0.php index a8f1ed4af0..07afc846a4 100644 --- a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-install-1.4.0.0.0.php +++ b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-install-1.4.0.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.0-0.7.1.php b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.0-0.7.1.php index 3ca4aaf977..b915cf55d5 100644 --- a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.0-0.7.1.php +++ b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.0-0.7.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.1-0.7.2.php b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.1-0.7.2.php index 9ceb9f3c1f..1ad722312f 100644 --- a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.1-0.7.2.php +++ b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.1-0.7.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.10-0.7.11.php b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.10-0.7.11.php index dbf95a5439..bd7dc6e6f9 100644 --- a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.10-0.7.11.php +++ b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.10-0.7.11.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.11-0.7.12.php b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.11-0.7.12.php index 18c55bb551..32dbe32030 100644 --- a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.11-0.7.12.php +++ b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.11-0.7.12.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.2-0.7.3.php b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.2-0.7.3.php index 2ed6964806..47f443425f 100644 --- a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.2-0.7.3.php +++ b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.2-0.7.3.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.3-0.7.4.php b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.3-0.7.4.php index 77e93b1220..aeb4407b49 100644 --- a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.3-0.7.4.php +++ b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.3-0.7.4.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.4-0.7.5.php b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.4-0.7.5.php index e750aed4c9..24c8b07958 100644 --- a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.4-0.7.5.php +++ b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.4-0.7.5.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.5-0.7.6.php b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.5-0.7.6.php index 802d6c0dbc..fab84804de 100644 --- a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.5-0.7.6.php +++ b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.5-0.7.6.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.6-0.7.7.php b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.6-0.7.7.php index b23ac0b2c3..d8bac0e906 100644 --- a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.6-0.7.7.php +++ b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.6-0.7.7.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.7-0.7.8.php b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.7-0.7.8.php index dd69db4793..b948c92abe 100644 --- a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.7-0.7.8.php +++ b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.7-0.7.8.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.8-0.7.9.php b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.8-0.7.9.php index 1f69fa7cba..b8d138a178 100644 --- a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.8-0.7.9.php +++ b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.8-0.7.9.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.9-0.7.10.php b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.9-0.7.10.php index eaba3fd6cb..78f03e9dca 100644 --- a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.9-0.7.10.php +++ b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.9-0.7.10.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-1.4.0.0.0-1.4.0.0.1.php b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-1.4.0.0.0-1.4.0.0.1.php index cce3d821a4..54c3a98a9a 100644 --- a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-1.4.0.0.0-1.4.0.0.1.php +++ b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-1.4.0.0.0-1.4.0.0.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-1.4.0.0.1-1.4.0.0.2.php b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-1.4.0.0.1-1.4.0.0.2.php index e3777c4d67..af92a9e7f0 100644 --- a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-1.4.0.0.1-1.4.0.0.2.php +++ b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-1.4.0.0.1-1.4.0.0.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-1.4.0.0.2-1.4.0.0.3.php b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-1.4.0.0.2-1.4.0.0.3.php index 012e298396..2d99e3b090 100644 --- a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-1.4.0.0.2-1.4.0.0.3.php +++ b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-1.4.0.0.2-1.4.0.0.3.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-1.4.0.0.3-1.4.0.0.4.php b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-1.4.0.0.3-1.4.0.0.4.php index 5f41aca548..165eac8404 100644 --- a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-1.4.0.0.3-1.4.0.0.4.php +++ b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-1.4.0.0.3-1.4.0.0.4.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-1.4.0.0.4-1.4.0.0.5.php b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-1.4.0.0.4-1.4.0.0.5.php index 2374e2264c..493c8936f3 100644 --- a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-1.4.0.0.4-1.4.0.0.5.php +++ b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-1.4.0.0.4-1.4.0.0.5.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-1.4.0.0.5-1.4.0.0.6.php b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-1.4.0.0.5-1.4.0.0.6.php index 123e4c91d4..b3c6f788dc 100644 --- a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-1.4.0.0.5-1.4.0.0.6.php +++ b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-1.4.0.0.5-1.4.0.0.6.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php index 553f257fb5..6fa3388bfa 100644 --- a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/sql/salesrule_setup/upgrade-1.6.0.0-1.6.0.1.php b/app/code/core/Mage/SalesRule/sql/salesrule_setup/upgrade-1.6.0.0-1.6.0.1.php index abaeaf830e..386d339dd4 100644 --- a/app/code/core/Mage/SalesRule/sql/salesrule_setup/upgrade-1.6.0.0-1.6.0.1.php +++ b/app/code/core/Mage/SalesRule/sql/salesrule_setup/upgrade-1.6.0.0-1.6.0.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/sql/salesrule_setup/upgrade-1.6.0.1-1.6.0.2.php b/app/code/core/Mage/SalesRule/sql/salesrule_setup/upgrade-1.6.0.1-1.6.0.2.php index 5f4af2ccb9..52f570f61e 100644 --- a/app/code/core/Mage/SalesRule/sql/salesrule_setup/upgrade-1.6.0.1-1.6.0.2.php +++ b/app/code/core/Mage/SalesRule/sql/salesrule_setup/upgrade-1.6.0.1-1.6.0.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/sql/salesrule_setup/upgrade-1.6.0.2-1.6.0.3.php b/app/code/core/Mage/SalesRule/sql/salesrule_setup/upgrade-1.6.0.2-1.6.0.3.php new file mode 100644 index 0000000000..2f72e9ff5f --- /dev/null +++ b/app/code/core/Mage/SalesRule/sql/salesrule_setup/upgrade-1.6.0.2-1.6.0.3.php @@ -0,0 +1,182 @@ +getConnection(); + +$rulesTable = $installer->getTable('salesrule/rule'); +$websitesTable = $installer->getTable('core/website'); +$customerGroupsTable = $installer->getTable('customer/customer_group'); +$rulesWebsitesTable = $installer->getTable('salesrule/website'); +$rulesCustomerGroupsTable = $installer->getTable('salesrule/customer_group'); + +$installer->startSetup(); +/** + * Create table 'salesrule/website' if not exists. This table will be used instead of + * column website_ids of main catalog rules table + */ +$table = $connection->newTable($rulesWebsitesTable) + ->addColumn('rule_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array( + 'unsigned' => true, + 'nullable' => false, + 'primary' => true + ), + 'Rule Id' + ) + ->addColumn('website_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array( + 'unsigned' => true, + 'nullable' => false, + 'primary' => true + ), + 'Website Id' + ) + ->addIndex( + $installer->getIdxName('salesrule/website', array('rule_id')), + array('rule_id') + ) + ->addIndex( + $installer->getIdxName('salesrule/website', array('website_id')), + array('website_id') + ) + ->addForeignKey($installer->getFkName('salesrule/website', 'rule_id', 'salesrule/rule', 'rule_id'), + 'rule_id', $rulesTable, 'rule_id', + Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE + ) + ->addForeignKey($installer->getFkName('salesrule/website', 'website_id', 'core/website', 'website_id'), + 'website_id', $websitesTable, 'website_id', + Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE + ) + ->setComment('Sales Rules To Websites Relations'); + +$connection->createTable($table); + + +/** + * Create table 'salesrule/customer_group' if not exists. This table will be used instead of + * column customer_group_ids of main catalog rules table + */ +$table = $connection->newTable($rulesCustomerGroupsTable) + ->addColumn('rule_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array( + 'unsigned' => true, + 'nullable' => false, + 'primary' => true + ), + 'Rule Id' + ) + ->addColumn('customer_group_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array( + 'unsigned' => true, + 'nullable' => false, + 'primary' => true + ), + 'Customer Group Id' + ) + ->addIndex( + $installer->getIdxName('salesrule/customer_group', array('rule_id')), + array('rule_id') + ) + ->addIndex( + $installer->getIdxName('salesrule/customer_group', array('customer_group_id')), + array('customer_group_id') + ) + ->addForeignKey($installer->getFkName('salesrule/customer_group', 'rule_id', 'salesrule/rule', 'rule_id'), + 'rule_id', $rulesTable, 'rule_id', + Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE + ) + ->addForeignKey( + $installer->getFkName('salesrule/customer_group', 'customer_group_id', + 'customer/customer_group', 'customer_group_id' + ), + 'customer_group_id', $customerGroupsTable, 'customer_group_id', + Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE + ) + ->setComment('Sales Rules To Customer Groups Relations'); + +$connection->createTable($table); + + +/** + * Fill out relation table 'salesrule/website' with website Ids + */ +$select = $connection->select() + ->from(array('sr' => $rulesTable), array('sr.rule_id', 'cw.website_id')) + ->join( + array('cw' => $websitesTable), + $connection->prepareSqlCondition( + 'sr.website_ids', array('finset' => new Zend_Db_Expr('cw.website_id')) + ), + array() + ); +$query = $select->insertFromSelect($rulesWebsitesTable, array('rule_id', 'website_id')); +$connection->query($query); + + +/** + * Fill out relation table 'salesrule/customer_group' with customer group Ids + */ + +$select = $connection->select() + ->from(array('sr' => $rulesTable), array('sr.rule_id', 'cg.customer_group_id')) + ->join( + array('cg' => $customerGroupsTable), + $connection->prepareSqlCondition( + 'sr.customer_group_ids', array('finset' => new Zend_Db_Expr('cg.customer_group_id')) + ), + array() + ); +$query = $select->insertFromSelect($rulesCustomerGroupsTable, array('rule_id', 'customer_group_id')); +$connection->query($query); + +/** + * Eliminate obsolete columns + */ +$connection->dropColumn($rulesTable, 'website_ids'); +$connection->dropColumn($rulesTable, 'customer_group_ids'); + +/** + * Change default value to "null" for "from" and "to" dates columns + */ +$connection->modifyColumn( + $rulesTable, + 'from_date', + array( + 'type' => Varien_Db_Ddl_Table::TYPE_DATE, + 'nullable' => true, + 'default' => null + ) +); + +$connection->modifyColumn( + $rulesTable, + 'to_date', + array( + 'type' => Varien_Db_Ddl_Table::TYPE_DATE, + 'nullable' => true, + 'default' => null + ) +); + +$installer->endSetup(); diff --git a/app/code/core/Mage/Sendfriend/Block/Send.php b/app/code/core/Mage/Sendfriend/Block/Send.php index 74d0e88505..2a0d0bf40e 100644 --- a/app/code/core/Mage/Sendfriend/Block/Send.php +++ b/app/code/core/Mage/Sendfriend/Block/Send.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sendfriend - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sendfriend/Helper/Data.php b/app/code/core/Mage/Sendfriend/Helper/Data.php index 0279d8a3ab..561982771a 100644 --- a/app/code/core/Mage/Sendfriend/Helper/Data.php +++ b/app/code/core/Mage/Sendfriend/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sendfriend - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sendfriend/Model/Mysql4/Sendfriend.php b/app/code/core/Mage/Sendfriend/Model/Mysql4/Sendfriend.php index 1b1e74ecaf..c0e1e46983 100644 --- a/app/code/core/Mage/Sendfriend/Model/Mysql4/Sendfriend.php +++ b/app/code/core/Mage/Sendfriend/Model/Mysql4/Sendfriend.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sendfriend - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sendfriend/Model/Mysql4/Sendfriend/Collection.php b/app/code/core/Mage/Sendfriend/Model/Mysql4/Sendfriend/Collection.php index c251bbc1e3..4aac28772e 100644 --- a/app/code/core/Mage/Sendfriend/Model/Mysql4/Sendfriend/Collection.php +++ b/app/code/core/Mage/Sendfriend/Model/Mysql4/Sendfriend/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sendfriend - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sendfriend/Model/Mysql4/Setup.php b/app/code/core/Mage/Sendfriend/Model/Mysql4/Setup.php index 4f5b062d45..be18f5d3f1 100644 --- a/app/code/core/Mage/Sendfriend/Model/Mysql4/Setup.php +++ b/app/code/core/Mage/Sendfriend/Model/Mysql4/Setup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sendfriend - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sendfriend/Model/Observer.php b/app/code/core/Mage/Sendfriend/Model/Observer.php index ccb3b3267b..fe81e08f0d 100644 --- a/app/code/core/Mage/Sendfriend/Model/Observer.php +++ b/app/code/core/Mage/Sendfriend/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sendfriend - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sendfriend/Model/Resource/Sendfriend.php b/app/code/core/Mage/Sendfriend/Model/Resource/Sendfriend.php index d95a3c5508..4db1dfca7c 100755 --- a/app/code/core/Mage/Sendfriend/Model/Resource/Sendfriend.php +++ b/app/code/core/Mage/Sendfriend/Model/Resource/Sendfriend.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sendfriend - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sendfriend/Model/Resource/Sendfriend/Collection.php b/app/code/core/Mage/Sendfriend/Model/Resource/Sendfriend/Collection.php index c6a5dd72fb..751ea1cf74 100755 --- a/app/code/core/Mage/Sendfriend/Model/Resource/Sendfriend/Collection.php +++ b/app/code/core/Mage/Sendfriend/Model/Resource/Sendfriend/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sendfriend - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sendfriend/Model/Resource/Setup.php b/app/code/core/Mage/Sendfriend/Model/Resource/Setup.php index 001e7057e6..4028991a55 100755 --- a/app/code/core/Mage/Sendfriend/Model/Resource/Setup.php +++ b/app/code/core/Mage/Sendfriend/Model/Resource/Setup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sendfriend - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sendfriend/Model/Sendfriend.php b/app/code/core/Mage/Sendfriend/Model/Sendfriend.php index 1e70d5202b..c98165a614 100644 --- a/app/code/core/Mage/Sendfriend/Model/Sendfriend.php +++ b/app/code/core/Mage/Sendfriend/Model/Sendfriend.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sendfriend - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sendfriend/controllers/ProductController.php b/app/code/core/Mage/Sendfriend/controllers/ProductController.php index bb420c30d9..2267581f2e 100644 --- a/app/code/core/Mage/Sendfriend/controllers/ProductController.php +++ b/app/code/core/Mage/Sendfriend/controllers/ProductController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sendfriend - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sendfriend/etc/config.xml b/app/code/core/Mage/Sendfriend/etc/config.xml index cfeecf3537..1392904ad5 100644 --- a/app/code/core/Mage/Sendfriend/etc/config.xml +++ b/app/code/core/Mage/Sendfriend/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Sendfriend - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Sendfriend/etc/system.xml b/app/code/core/Mage/Sendfriend/etc/system.xml index 060fcc001f..b0d0cf1679 100644 --- a/app/code/core/Mage/Sendfriend/etc/system.xml +++ b/app/code/core/Mage/Sendfriend/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Sendfriend - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Sendfriend/sql/sendfriend_setup/install-1.6.0.0.php b/app/code/core/Mage/Sendfriend/sql/sendfriend_setup/install-1.6.0.0.php index 8bc136df4b..2f5420eff2 100644 --- a/app/code/core/Mage/Sendfriend/sql/sendfriend_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Sendfriend/sql/sendfriend_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sendfriend - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sendfriend/sql/sendfriend_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/Sendfriend/sql/sendfriend_setup/mysql4-install-0.7.0.php index c5d3427f8d..bb0992fc93 100644 --- a/app/code/core/Mage/Sendfriend/sql/sendfriend_setup/mysql4-install-0.7.0.php +++ b/app/code/core/Mage/Sendfriend/sql/sendfriend_setup/mysql4-install-0.7.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sendfriend - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sendfriend/sql/sendfriend_setup/mysql4-upgrade-0.7.1-0.7.2.php b/app/code/core/Mage/Sendfriend/sql/sendfriend_setup/mysql4-upgrade-0.7.1-0.7.2.php index 9f85c7ec53..5c460da6d5 100644 --- a/app/code/core/Mage/Sendfriend/sql/sendfriend_setup/mysql4-upgrade-0.7.1-0.7.2.php +++ b/app/code/core/Mage/Sendfriend/sql/sendfriend_setup/mysql4-upgrade-0.7.1-0.7.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sendfriend - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sendfriend/sql/sendfriend_setup/mysql4-upgrade-0.7.2-0.7.3.php b/app/code/core/Mage/Sendfriend/sql/sendfriend_setup/mysql4-upgrade-0.7.2-0.7.3.php index 1dfd03a790..67dc38a1c9 100644 --- a/app/code/core/Mage/Sendfriend/sql/sendfriend_setup/mysql4-upgrade-0.7.2-0.7.3.php +++ b/app/code/core/Mage/Sendfriend/sql/sendfriend_setup/mysql4-upgrade-0.7.2-0.7.3.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sendfriend - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sendfriend/sql/sendfriend_setup/mysql4-upgrade-0.7.3-0.7.4.php b/app/code/core/Mage/Sendfriend/sql/sendfriend_setup/mysql4-upgrade-0.7.3-0.7.4.php index b84aeead40..d2031c3b5b 100644 --- a/app/code/core/Mage/Sendfriend/sql/sendfriend_setup/mysql4-upgrade-0.7.3-0.7.4.php +++ b/app/code/core/Mage/Sendfriend/sql/sendfriend_setup/mysql4-upgrade-0.7.3-0.7.4.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sendfriend - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sendfriend/sql/sendfriend_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/Sendfriend/sql/sendfriend_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php index 6ec3a80840..3a8c105696 100644 --- a/app/code/core/Mage/Sendfriend/sql/sendfriend_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ b/app/code/core/Mage/Sendfriend/sql/sendfriend_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sendfriend - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Shipping/Block/Tracking/Ajax.php b/app/code/core/Mage/Shipping/Block/Tracking/Ajax.php index 80d900c843..18340342fc 100644 --- a/app/code/core/Mage/Shipping/Block/Tracking/Ajax.php +++ b/app/code/core/Mage/Shipping/Block/Tracking/Ajax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Shipping/Block/Tracking/Popup.php b/app/code/core/Mage/Shipping/Block/Tracking/Popup.php index 30e2f417c3..5f95ae7ca0 100644 --- a/app/code/core/Mage/Shipping/Block/Tracking/Popup.php +++ b/app/code/core/Mage/Shipping/Block/Tracking/Popup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Shipping/Exception.php b/app/code/core/Mage/Shipping/Exception.php index 737caa97f3..cc7911275f 100644 --- a/app/code/core/Mage/Shipping/Exception.php +++ b/app/code/core/Mage/Shipping/Exception.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Shipping/Helper/Data.php b/app/code/core/Mage/Shipping/Helper/Data.php index e0f951c53e..07a8e9675c 100644 --- a/app/code/core/Mage/Shipping/Helper/Data.php +++ b/app/code/core/Mage/Shipping/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Shipping/Model/Carrier/Abstract.php b/app/code/core/Mage/Shipping/Model/Carrier/Abstract.php index b043a217dc..ea5ff0b909 100644 --- a/app/code/core/Mage/Shipping/Model/Carrier/Abstract.php +++ b/app/code/core/Mage/Shipping/Model/Carrier/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -521,11 +521,12 @@ public function isCityRequired() } /** - * Check if zip code option required + * Determine whether zip-code is required for the country of destination * - * @return boolean + * @param Mage_Shipping_Model_Rate_Request|null $request + * @return bool */ - public function isZipCodeRequired() + public function isZipCodeRequired(Mage_Shipping_Model_Rate_Request $request = null) { return false; } diff --git a/app/code/core/Mage/Shipping/Model/Carrier/Flatrate.php b/app/code/core/Mage/Shipping/Model/Carrier/Flatrate.php index e225934be3..5e13aa1abe 100644 --- a/app/code/core/Mage/Shipping/Model/Carrier/Flatrate.php +++ b/app/code/core/Mage/Shipping/Model/Carrier/Flatrate.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Shipping/Model/Carrier/Freeshipping.php b/app/code/core/Mage/Shipping/Model/Carrier/Freeshipping.php index eec6ddd615..1679776182 100644 --- a/app/code/core/Mage/Shipping/Model/Carrier/Freeshipping.php +++ b/app/code/core/Mage/Shipping/Model/Carrier/Freeshipping.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Shipping/Model/Carrier/Interface.php b/app/code/core/Mage/Shipping/Model/Carrier/Interface.php index 9bc201dac3..b6edd0c5f6 100644 --- a/app/code/core/Mage/Shipping/Model/Carrier/Interface.php +++ b/app/code/core/Mage/Shipping/Model/Carrier/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Shipping/Model/Carrier/Pickup.php b/app/code/core/Mage/Shipping/Model/Carrier/Pickup.php index 53a708049e..c86d211e36 100644 --- a/app/code/core/Mage/Shipping/Model/Carrier/Pickup.php +++ b/app/code/core/Mage/Shipping/Model/Carrier/Pickup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Shipping/Model/Carrier/Tablerate.php b/app/code/core/Mage/Shipping/Model/Carrier/Tablerate.php index fc1b184a78..083316f750 100644 --- a/app/code/core/Mage/Shipping/Model/Carrier/Tablerate.php +++ b/app/code/core/Mage/Shipping/Model/Carrier/Tablerate.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Shipping/Model/Config.php b/app/code/core/Mage/Shipping/Model/Config.php index f724d731ec..ee9f555814 100644 --- a/app/code/core/Mage/Shipping/Model/Config.php +++ b/app/code/core/Mage/Shipping/Model/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Shipping/Model/Info.php b/app/code/core/Mage/Shipping/Model/Info.php index 9a4ef03421..f958b63bac 100644 --- a/app/code/core/Mage/Shipping/Model/Info.php +++ b/app/code/core/Mage/Shipping/Model/Info.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Shipping/Model/Mysql4/Carrier/Tablerate.php b/app/code/core/Mage/Shipping/Model/Mysql4/Carrier/Tablerate.php index 0b15309c4f..a2d2ddc29a 100644 --- a/app/code/core/Mage/Shipping/Model/Mysql4/Carrier/Tablerate.php +++ b/app/code/core/Mage/Shipping/Model/Mysql4/Carrier/Tablerate.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Shipping/Model/Mysql4/Carrier/Tablerate/Collection.php b/app/code/core/Mage/Shipping/Model/Mysql4/Carrier/Tablerate/Collection.php index 4778e31317..17be65e6c8 100644 --- a/app/code/core/Mage/Shipping/Model/Mysql4/Carrier/Tablerate/Collection.php +++ b/app/code/core/Mage/Shipping/Model/Mysql4/Carrier/Tablerate/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Shipping/Model/Rate/Abstract.php b/app/code/core/Mage/Shipping/Model/Rate/Abstract.php index 8125a3f8dd..abd46ced51 100644 --- a/app/code/core/Mage/Shipping/Model/Rate/Abstract.php +++ b/app/code/core/Mage/Shipping/Model/Rate/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Shipping/Model/Rate/Request.php b/app/code/core/Mage/Shipping/Model/Rate/Request.php index 7990f862e3..adb127a90f 100644 --- a/app/code/core/Mage/Shipping/Model/Rate/Request.php +++ b/app/code/core/Mage/Shipping/Model/Rate/Request.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Shipping/Model/Rate/Result.php b/app/code/core/Mage/Shipping/Model/Rate/Result.php index fc6d23394c..63d9035463 100644 --- a/app/code/core/Mage/Shipping/Model/Rate/Result.php +++ b/app/code/core/Mage/Shipping/Model/Rate/Result.php @@ -20,18 +20,31 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Shipping_Model_Rate_Result { + /** + * Shippin method rates + * + * @var array + */ protected $_rates = array(); + + /** + * Shipping errors + * + * @var null|bool + */ protected $_error = null; /** * Reset result + * + * @return Mage_Shipping_Model_Rate_Result */ public function reset() { @@ -39,11 +52,22 @@ public function reset() return $this; } + /** + * Set Error + * + * @param bool $error + * @return void + */ public function setError($error) { $this->_error = $error; } + /** + * Get Error + * + * @return null|bool; + */ public function getError() { return $this->_error; @@ -53,6 +77,7 @@ public function getError() * Add a rate to the result * * @param Mage_Shipping_Model_Rate_Result_Abstract|Mage_Shipping_Model_Rate_Result $result + * @return Mage_Shipping_Model_Rate_Result */ public function append($result) { @@ -73,6 +98,8 @@ public function append($result) /** * Return all quotes in the result + * + * @return array */ public function getAllRates() { @@ -81,6 +108,9 @@ public function getAllRates() /** * Return rate by id in array + * + * @param int $id + * @return Mage_Shipping_Model_Rate_Result_Method|null */ public function getRateById($id) { @@ -90,19 +120,25 @@ public function getRateById($id) /** * Return quotes for specified type * - * @param string $type + * @param string $carrier + * @return array */ public function getRatesByCarrier($carrier) { $result = array(); foreach ($this->_rates as $rate) { - if ($rate->getCarrier()===$carrier) { + if ($rate->getCarrier() === $carrier) { $result[] = $rate; } } return $result; } + /** + * Converts object to array + * + * @return array + */ public function asArray() { $currencyFilter = Mage::app()->getStore()->getPriceFilter(); @@ -111,20 +147,25 @@ public function asArray() foreach ($allRates as $rate) { $rates[$rate->getCarrier()]['title'] = $rate->getCarrierTitle(); $rates[$rate->getCarrier()]['methods'][$rate->getMethod()] = array( - 'title'=>$rate->getMethodTitle(), - 'price'=>$rate->getPrice(), - 'price_formatted'=>$currencyFilter->filter($rate->getPrice()), + 'title' => $rate->getMethodTitle(), + 'price' => $rate->getPrice(), + 'price_formatted' => $currencyFilter->filter($rate->getPrice()), ); } return $rates; } + /** + * Get cheapest rate + * + * @return null|Mage_Shipping_Model_Rate_Result_Method + */ public function getCheapestRate() { $cheapest = null; $minPrice = 100000; foreach ($this->getAllRates() as $rate) { - if (is_numeric($rate->getPrice()) && $rate->getPrice()<$minPrice) { + if (is_numeric($rate->getPrice()) && $rate->getPrice() < $minPrice) { $cheapest = $rate; $minPrice = $rate->getPrice(); } @@ -133,11 +174,11 @@ public function getCheapestRate() } /** - * Sort rates by price from min to max + * Sort rates by price from min to max * - * @return Mage_Shipping_Model_Rate_Result + * @return Mage_Shipping_Model_Rate_Result */ - public function sortRatesByPrice () + public function sortRatesByPrice() { if (!is_array($this->_rates) || !count($this->_rates)) { return $this; @@ -157,4 +198,21 @@ public function sortRatesByPrice () $this->_rates = $result; return $this; } + + /** + * Set price for each rate according to count of packages + * + * @param int $packageCount + * @return Mage_Shipping_Model_Rate_Result + */ + public function updateRatePrice($packageCount) + { + if ($packageCount > 1) { + foreach ($this->_rates as $rate) { + $rate->setPrice($rate->getPrice() * $packageCount); + } + } + + return $this; + } } diff --git a/app/code/core/Mage/Shipping/Model/Rate/Result/Abstract.php b/app/code/core/Mage/Shipping/Model/Rate/Result/Abstract.php index 91975e7c51..6d7a4698a7 100644 --- a/app/code/core/Mage/Shipping/Model/Rate/Result/Abstract.php +++ b/app/code/core/Mage/Shipping/Model/Rate/Result/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Shipping/Model/Rate/Result/Error.php b/app/code/core/Mage/Shipping/Model/Rate/Result/Error.php index e0a3704e5e..53e0a32d6a 100644 --- a/app/code/core/Mage/Shipping/Model/Rate/Result/Error.php +++ b/app/code/core/Mage/Shipping/Model/Rate/Result/Error.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Shipping/Model/Rate/Result/Method.php b/app/code/core/Mage/Shipping/Model/Rate/Result/Method.php index 9f2e454970..1342150cc4 100644 --- a/app/code/core/Mage/Shipping/Model/Rate/Result/Method.php +++ b/app/code/core/Mage/Shipping/Model/Rate/Result/Method.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Shipping/Model/Resource/Carrier/Tablerate.php b/app/code/core/Mage/Shipping/Model/Resource/Carrier/Tablerate.php index 7568ab16dc..33352bd672 100755 --- a/app/code/core/Mage/Shipping/Model/Resource/Carrier/Tablerate.php +++ b/app/code/core/Mage/Shipping/Model/Resource/Carrier/Tablerate.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -267,7 +267,7 @@ public function uploadAndImport(Varien_Object $object) $adapter->commit(); if ($this->_importErrors) { - $error = Mage::helper('shipping')->__('%1$d records have been imported. See the following list of errors for each record that has not been imported: %2$s', $this->_importedRows, implode(" \n", $this->_importErrors)); + $error = Mage::helper('shipping')->__('File has not been imported. See the following list of errors: %s', implode(" \n", $this->_importErrors)); Mage::throwException($error); } diff --git a/app/code/core/Mage/Shipping/Model/Resource/Carrier/Tablerate/Collection.php b/app/code/core/Mage/Shipping/Model/Resource/Carrier/Tablerate/Collection.php index 097bf13d25..74b0cbfd02 100755 --- a/app/code/core/Mage/Shipping/Model/Resource/Carrier/Tablerate/Collection.php +++ b/app/code/core/Mage/Shipping/Model/Resource/Carrier/Tablerate/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Shipping/Model/Shipment/Request.php b/app/code/core/Mage/Shipping/Model/Shipment/Request.php index 5856f3f2c6..fbed26528c 100644 --- a/app/code/core/Mage/Shipping/Model/Shipment/Request.php +++ b/app/code/core/Mage/Shipping/Model/Shipment/Request.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Shipping/Model/Shipment/Return.php b/app/code/core/Mage/Shipping/Model/Shipment/Return.php index f57ef82882..620b4ba6f1 100644 --- a/app/code/core/Mage/Shipping/Model/Shipment/Return.php +++ b/app/code/core/Mage/Shipping/Model/Shipment/Return.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Shipping/Model/Shipping.php b/app/code/core/Mage/Shipping/Model/Shipping.php index 24d3fe787a..ae02d95c9f 100644 --- a/app/code/core/Mage/Shipping/Model/Shipping.php +++ b/app/code/core/Mage/Shipping/Model/Shipping.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -169,7 +169,43 @@ public function collectCarrierRates($carrierCode, $request) */ if (false !== $result){ if (!$result instanceof Mage_Shipping_Model_Rate_Result_Error) { - $result = $carrier->collectRates($request); + if ($carrier->getConfigData('shipment_requesttype')) { + $packages = $this->composePackagesForCarrier($carrier, $request); + if (!empty($packages)) { + $sumResults = array(); + foreach ($packages as $weight => $packageCount) { + $request->setPackageWeight($weight); + $result = $carrier->collectRates($request); + if (!$result) { + return $this; + } else { + $result->updateRatePrice($packageCount); + } + $sumResults[] = $result; + } + if (!empty($sumResults) && count($sumResults) > 1) { + $result = array(); + foreach ($sumResults as $res) { + if (empty($result)) { + $result = $res; + continue; + } + foreach ($res->getAllRates() as $method) { + foreach ($result->getAllRates() as $resultMethod) { + if ($method->getMethod() == $resultMethod->getMethod()) { + $resultMethod->setPrice($method->getPrice() + $resultMethod->getPrice()); + continue; + } + } + } + } + } + } else { + $result = $carrier->collectRates($request); + } + } else { + $result = $carrier->collectRates($request); + } if (!$result) { return $this; } @@ -186,6 +222,141 @@ public function collectCarrierRates($carrierCode, $request) return $this; } + /** + * Compose Packages For Carrier. + * Devides order into items and items into parts if it's neccesary + * + * @param Mage_Shipping_Model_Carrier_Abstract $carrier + * @param Mage_Shipping_Model_Rate_Request $request + * @return array [int, float] + */ + public function composePackagesForCarrier($carrier, $request) + { + $allItems = $request->getAllItems(); + $fullItems = array(); + + $maxWeight = (float) $carrier->getConfigData('max_package_weight'); + + foreach ($allItems as $item) { + if ($item->getProductType() == Mage_Catalog_Model_Product_Type::TYPE_BUNDLE + && $item->getProduct()->getShipmentType() + ) { + continue; + } + + $qty = $item->getQty(); + $changeQty = true; + $checkWeight = true; + $decimalItems = array(); + + if ($item->getParentItem()) { + if (!$item->getParentItem()->getProduct()->getShipmentType()) { + continue; + } + $qty = $item->getIsQtyDecimal() + ? $item->getParentItem()->getQty() + : $item->getParentItem()->getQty() * $item->getQty(); + } + + $itemWeight = $item->getWeight(); + if ($item->getIsQtyDecimal() && $item->getProductType() != Mage_Catalog_Model_Product_Type::TYPE_BUNDLE) { + $stockItem = $item->getProduct()->getStockItem(); + if ($stockItem->getIsDecimalDivided()) { + if ($stockItem->getEnableQtyIncrements() && $stockItem->getQtyIncrements()) { + $itemWeight = $itemWeight * $stockItem->getQtyIncrements(); + $qty = round(($item->getWeight() / $itemWeight) * $qty); + $changeQty = false; + } else { + $itemWeight = $itemWeight * $item->getQty(); + if ($itemWeight > $maxWeight) { + $qtyItem = floor($itemWeight / $maxWeight); + $decimalItems[] = array('weight' => $maxWeight, 'qty' => $qtyItem); + $weightItem = Mage::helper('core')->getExactDivision($itemWeight, $maxWeight); + if ($weightItem) { + $decimalItems[] = array('weight' => $weightItem, 'qty' => 1); + } + $checkWeight = false; + } else { + $itemWeight = $itemWeight * $item->getQty(); + } + } + } else { + $itemWeight = $itemWeight * $item->getQty(); + } + } + + if ($checkWeight && $maxWeight && $itemWeight > $maxWeight) { + return array(); + } + + if ($changeQty && !$item->getParentItem() && $item->getIsQtyDecimal() + && $item->getProductType() != Mage_Catalog_Model_Product_Type::TYPE_BUNDLE + ) { + $qty = 1; + } + + if (!empty($decimalItems)) { + foreach ($decimalItems as $decimalItem) { + $fullItems = array_merge($fullItems, + array_fill(0, $decimalItem['qty'] * $qty, $decimalItem['weight']) + ); + } + } else { + $fullItems = array_merge($fullItems, array_fill(0, $qty, $itemWeight)); + } + } + sort($fullItems); + + return $this->_makePieces($fullItems, $maxWeight); + } + + /** + * Make pieces + * Compose packeges list based on given items, so that each package is as heavy as possible + * + * @param array $items + * @param float $maxWeight + * @return array + */ + protected function _makePieces($items, $maxWeight) + { + $pieces = array(); + if (!empty($items)) { + $sumWeight = 0; + + $reverseOrderItems = $items; + arsort($reverseOrderItems); + + foreach ($reverseOrderItems as $key => $weight) { + if (!isset($items[$key])) { + continue; + } + unset($items[$key]); + $sumWeight = $weight; + foreach ($items as $key => $weight) { + if (($sumWeight + $weight) < $maxWeight) { + unset($items[$key]); + $sumWeight += $weight; + } elseif (($sumWeight + $weight) > $maxWeight) { + $pieces[] = (string)(float)$sumWeight; + break; + } else { + unset($items[$key]); + $pieces[] = (string)(float)($sumWeight + $weight); + $sumWeight = 0; + break; + } + } + } + if ($sumWeight > 0) { + $pieces[] = (string)(float)$sumWeight; + } + $pieces = array_count_values($pieces); + } + + return $pieces; + } + /** * Collect rates by address * @@ -317,7 +488,7 @@ public function requestToShipment(Mage_Sales_Model_Order_Shipment $orderShipment $request->setRecipientAddressStreet1($address->getStreet1()); $request->setRecipientAddressStreet2($address->getStreet2()); $request->setRecipientAddressCity($address->getCity()); - $request->setRecipientAddressStateOrProvinceCode($address->getRegion()); + $request->setRecipientAddressStateOrProvinceCode($address->getRegionCode()); $request->setRecipientAddressRegionCode($recipientRegionCode); $request->setRecipientAddressPostalCode($address->getPostcode()); $request->setRecipientAddressCountryCode($address->getCountryId()); diff --git a/app/code/core/Mage/Shipping/Model/Source/HandlingAction.php b/app/code/core/Mage/Shipping/Model/Source/HandlingAction.php index 6e1a0d5740..307bf367c7 100644 --- a/app/code/core/Mage/Shipping/Model/Source/HandlingAction.php +++ b/app/code/core/Mage/Shipping/Model/Source/HandlingAction.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Shipping_Model_Source_HandlingAction diff --git a/app/code/core/Mage/Shipping/Model/Source/HandlingType.php b/app/code/core/Mage/Shipping/Model/Source/HandlingType.php index e192ce7359..2a3e31f52f 100644 --- a/app/code/core/Mage/Shipping/Model/Source/HandlingType.php +++ b/app/code/core/Mage/Shipping/Model/Source/HandlingType.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Shipping_Model_Source_HandlingType diff --git a/app/code/core/Mage/Shipping/Model/Tracking/Result.php b/app/code/core/Mage/Shipping/Model/Tracking/Result.php index 188d1bc458..507351ea57 100644 --- a/app/code/core/Mage/Shipping/Model/Tracking/Result.php +++ b/app/code/core/Mage/Shipping/Model/Tracking/Result.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Shipping/Model/Tracking/Result/Abstract.php b/app/code/core/Mage/Shipping/Model/Tracking/Result/Abstract.php index b1e79fa1d6..6b6f0f7350 100644 --- a/app/code/core/Mage/Shipping/Model/Tracking/Result/Abstract.php +++ b/app/code/core/Mage/Shipping/Model/Tracking/Result/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Shipping/Model/Tracking/Result/Error.php b/app/code/core/Mage/Shipping/Model/Tracking/Result/Error.php index 283b1aef71..cef786f842 100644 --- a/app/code/core/Mage/Shipping/Model/Tracking/Result/Error.php +++ b/app/code/core/Mage/Shipping/Model/Tracking/Result/Error.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Shipping/Model/Tracking/Result/Status.php b/app/code/core/Mage/Shipping/Model/Tracking/Result/Status.php index 21e1765afb..818312c5a0 100644 --- a/app/code/core/Mage/Shipping/Model/Tracking/Result/Status.php +++ b/app/code/core/Mage/Shipping/Model/Tracking/Result/Status.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Shipping/controllers/ShippingController.php b/app/code/core/Mage/Shipping/controllers/ShippingController.php index ae36401f29..b4b6e46de3 100644 --- a/app/code/core/Mage/Shipping/controllers/ShippingController.php +++ b/app/code/core/Mage/Shipping/controllers/ShippingController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Shipping/controllers/TrackingController.php b/app/code/core/Mage/Shipping/controllers/TrackingController.php index e21429a6ca..c7499f42fe 100644 --- a/app/code/core/Mage/Shipping/controllers/TrackingController.php +++ b/app/code/core/Mage/Shipping/controllers/TrackingController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Shipping/etc/adminhtml.xml b/app/code/core/Mage/Shipping/etc/adminhtml.xml index c59716dc17..bc916754fd 100644 --- a/app/code/core/Mage/Shipping/etc/adminhtml.xml +++ b/app/code/core/Mage/Shipping/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Shipping/etc/config.xml b/app/code/core/Mage/Shipping/etc/config.xml index ffad8c882e..4c8d97befd 100644 --- a/app/code/core/Mage/Shipping/etc/config.xml +++ b/app/code/core/Mage/Shipping/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Shipping/etc/system.xml b/app/code/core/Mage/Shipping/etc/system.xml index 2d865b5baa..36393e76e7 100644 --- a/app/code/core/Mage/Shipping/etc/system.xml +++ b/app/code/core/Mage/Shipping/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -56,6 +56,7 @@ text + validate-number 2 1 1 @@ -162,6 +163,7 @@ text + validate-number validate-zero-or-greater 5 1 1 @@ -179,6 +181,7 @@ text + validate-number validate-zero-or-greater 8 1 1 @@ -268,6 +271,7 @@ text + validate-number validate-zero-or-greater 4 1 1 @@ -356,6 +360,7 @@ text + validate-number validate-zero-or-greater 8 1 1 diff --git a/app/code/core/Mage/Shipping/sql/shipping_setup/install-1.6.0.0.php b/app/code/core/Mage/Shipping/sql/shipping_setup/install-1.6.0.0.php index e7abec0eed..c470f904d7 100644 --- a/app/code/core/Mage/Shipping/sql/shipping_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Shipping/sql/shipping_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Shipping/sql/shipping_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/Shipping/sql/shipping_setup/mysql4-install-0.7.0.php index 542f18222f..0ad57ef7d7 100644 --- a/app/code/core/Mage/Shipping/sql/shipping_setup/mysql4-install-0.7.0.php +++ b/app/code/core/Mage/Shipping/sql/shipping_setup/mysql4-install-0.7.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Shipping/sql/shipping_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/Shipping/sql/shipping_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php index 7f5aa58018..0b05e714c6 100644 --- a/app/code/core/Mage/Shipping/sql/shipping_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ b/app/code/core/Mage/Shipping/sql/shipping_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sitemap/Helper/Data.php b/app/code/core/Mage/Sitemap/Helper/Data.php index 1cf500a0e0..7c26c17dd5 100644 --- a/app/code/core/Mage/Sitemap/Helper/Data.php +++ b/app/code/core/Mage/Sitemap/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sitemap - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sitemap/Model/Mysql4/Catalog/Category.php b/app/code/core/Mage/Sitemap/Model/Mysql4/Catalog/Category.php index d299a03773..f78bbf38fa 100644 --- a/app/code/core/Mage/Sitemap/Model/Mysql4/Catalog/Category.php +++ b/app/code/core/Mage/Sitemap/Model/Mysql4/Catalog/Category.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sitemap - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sitemap/Model/Mysql4/Catalog/Product.php b/app/code/core/Mage/Sitemap/Model/Mysql4/Catalog/Product.php index 0ec4c74e88..9cfaec2e58 100644 --- a/app/code/core/Mage/Sitemap/Model/Mysql4/Catalog/Product.php +++ b/app/code/core/Mage/Sitemap/Model/Mysql4/Catalog/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sitemap - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sitemap/Model/Mysql4/Cms/Page.php b/app/code/core/Mage/Sitemap/Model/Mysql4/Cms/Page.php index 630a5b9ad1..40c67e1aeb 100644 --- a/app/code/core/Mage/Sitemap/Model/Mysql4/Cms/Page.php +++ b/app/code/core/Mage/Sitemap/Model/Mysql4/Cms/Page.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sitemap - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sitemap/Model/Mysql4/Sitemap.php b/app/code/core/Mage/Sitemap/Model/Mysql4/Sitemap.php index 348dac0cf6..8643d7086e 100644 --- a/app/code/core/Mage/Sitemap/Model/Mysql4/Sitemap.php +++ b/app/code/core/Mage/Sitemap/Model/Mysql4/Sitemap.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sitemap - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sitemap/Model/Mysql4/Sitemap/Collection.php b/app/code/core/Mage/Sitemap/Model/Mysql4/Sitemap/Collection.php index 2fd92c6557..3bdc5e9c05 100644 --- a/app/code/core/Mage/Sitemap/Model/Mysql4/Sitemap/Collection.php +++ b/app/code/core/Mage/Sitemap/Model/Mysql4/Sitemap/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sitemap - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sitemap/Model/Observer.php b/app/code/core/Mage/Sitemap/Model/Observer.php index da0075f123..605a8b5978 100644 --- a/app/code/core/Mage/Sitemap/Model/Observer.php +++ b/app/code/core/Mage/Sitemap/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sitemap - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sitemap/Model/Resource/Catalog/Category.php b/app/code/core/Mage/Sitemap/Model/Resource/Catalog/Category.php index 03fde11376..987be8b5b9 100755 --- a/app/code/core/Mage/Sitemap/Model/Resource/Catalog/Category.php +++ b/app/code/core/Mage/Sitemap/Model/Resource/Catalog/Category.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sitemap - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sitemap/Model/Resource/Catalog/Product.php b/app/code/core/Mage/Sitemap/Model/Resource/Catalog/Product.php index 5ad70dd46d..8dcca57e52 100755 --- a/app/code/core/Mage/Sitemap/Model/Resource/Catalog/Product.php +++ b/app/code/core/Mage/Sitemap/Model/Resource/Catalog/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sitemap - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sitemap/Model/Resource/Cms/Page.php b/app/code/core/Mage/Sitemap/Model/Resource/Cms/Page.php index abaaa2bb8c..044a2aa7ea 100755 --- a/app/code/core/Mage/Sitemap/Model/Resource/Cms/Page.php +++ b/app/code/core/Mage/Sitemap/Model/Resource/Cms/Page.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sitemap - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sitemap/Model/Resource/Sitemap.php b/app/code/core/Mage/Sitemap/Model/Resource/Sitemap.php index cb09364746..b7da17d0eb 100755 --- a/app/code/core/Mage/Sitemap/Model/Resource/Sitemap.php +++ b/app/code/core/Mage/Sitemap/Model/Resource/Sitemap.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sitemap - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sitemap/Model/Resource/Sitemap/Collection.php b/app/code/core/Mage/Sitemap/Model/Resource/Sitemap/Collection.php index 569b5d18b2..95605c01b5 100755 --- a/app/code/core/Mage/Sitemap/Model/Resource/Sitemap/Collection.php +++ b/app/code/core/Mage/Sitemap/Model/Resource/Sitemap/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sitemap - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sitemap/Model/Sitemap.php b/app/code/core/Mage/Sitemap/Model/Sitemap.php index 492a7da754..a9fadb1a15 100644 --- a/app/code/core/Mage/Sitemap/Model/Sitemap.php +++ b/app/code/core/Mage/Sitemap/Model/Sitemap.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sitemap - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sitemap/etc/adminhtml.xml b/app/code/core/Mage/Sitemap/etc/adminhtml.xml index a34d8636c2..6f2fff38fc 100644 --- a/app/code/core/Mage/Sitemap/etc/adminhtml.xml +++ b/app/code/core/Mage/Sitemap/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Sitemap - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Sitemap/etc/config.xml b/app/code/core/Mage/Sitemap/etc/config.xml index 9985cf4652..a6dfdcbde7 100644 --- a/app/code/core/Mage/Sitemap/etc/config.xml +++ b/app/code/core/Mage/Sitemap/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Sitemap - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Sitemap/etc/system.xml b/app/code/core/Mage/Sitemap/etc/system.xml index 9c0b4aa5cc..50e6b07c68 100644 --- a/app/code/core/Mage/Sitemap/etc/system.xml +++ b/app/code/core/Mage/Sitemap/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Sitemap - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Sitemap/sql/sitemap_setup/install-1.6.0.0.php b/app/code/core/Mage/Sitemap/sql/sitemap_setup/install-1.6.0.0.php index 822ad40177..b193515477 100644 --- a/app/code/core/Mage/Sitemap/sql/sitemap_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Sitemap/sql/sitemap_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sitemap - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sitemap/sql/sitemap_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/Sitemap/sql/sitemap_setup/mysql4-install-0.7.0.php index 6c25d7c256..39b41fe687 100644 --- a/app/code/core/Mage/Sitemap/sql/sitemap_setup/mysql4-install-0.7.0.php +++ b/app/code/core/Mage/Sitemap/sql/sitemap_setup/mysql4-install-0.7.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sitemap - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sitemap/sql/sitemap_setup/mysql4-upgrade-0.7.0-0.7.1.php b/app/code/core/Mage/Sitemap/sql/sitemap_setup/mysql4-upgrade-0.7.0-0.7.1.php index d8802212f0..775e43123b 100644 --- a/app/code/core/Mage/Sitemap/sql/sitemap_setup/mysql4-upgrade-0.7.0-0.7.1.php +++ b/app/code/core/Mage/Sitemap/sql/sitemap_setup/mysql4-upgrade-0.7.0-0.7.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sitemap - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sitemap/sql/sitemap_setup/mysql4-upgrade-0.7.1-0.7.2.php b/app/code/core/Mage/Sitemap/sql/sitemap_setup/mysql4-upgrade-0.7.1-0.7.2.php index 126a0c5144..86e1864523 100644 --- a/app/code/core/Mage/Sitemap/sql/sitemap_setup/mysql4-upgrade-0.7.1-0.7.2.php +++ b/app/code/core/Mage/Sitemap/sql/sitemap_setup/mysql4-upgrade-0.7.1-0.7.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sitemap - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sitemap/sql/sitemap_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/Sitemap/sql/sitemap_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php index 5c3fc44d08..e12a11d153 100644 --- a/app/code/core/Mage/Sitemap/sql/sitemap_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ b/app/code/core/Mage/Sitemap/sql/sitemap_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sitemap - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/Block/All.php b/app/code/core/Mage/Tag/Block/All.php index 3387daeafb..d66358742b 100644 --- a/app/code/core/Mage/Tag/Block/All.php +++ b/app/code/core/Mage/Tag/Block/All.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/Block/Customer/Edit.php b/app/code/core/Mage/Tag/Block/Customer/Edit.php index 9848ddd870..1f3ac67c00 100644 --- a/app/code/core/Mage/Tag/Block/Customer/Edit.php +++ b/app/code/core/Mage/Tag/Block/Customer/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/Block/Customer/Recent.php b/app/code/core/Mage/Tag/Block/Customer/Recent.php index cc12f951c2..9e0363e139 100644 --- a/app/code/core/Mage/Tag/Block/Customer/Recent.php +++ b/app/code/core/Mage/Tag/Block/Customer/Recent.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/Block/Customer/Tags.php b/app/code/core/Mage/Tag/Block/Customer/Tags.php index 472c3c6062..f261326e81 100644 --- a/app/code/core/Mage/Tag/Block/Customer/Tags.php +++ b/app/code/core/Mage/Tag/Block/Customer/Tags.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/Block/Customer/View.php b/app/code/core/Mage/Tag/Block/Customer/View.php index 34aa19058a..ea2fb64176 100644 --- a/app/code/core/Mage/Tag/Block/Customer/View.php +++ b/app/code/core/Mage/Tag/Block/Customer/View.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/Block/Popular.php b/app/code/core/Mage/Tag/Block/Popular.php index ae4754a302..10fa8f67b0 100644 --- a/app/code/core/Mage/Tag/Block/Popular.php +++ b/app/code/core/Mage/Tag/Block/Popular.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/Block/Product/List.php b/app/code/core/Mage/Tag/Block/Product/List.php index 938c326023..b082278085 100644 --- a/app/code/core/Mage/Tag/Block/Product/List.php +++ b/app/code/core/Mage/Tag/Block/Product/List.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/Block/Product/Result.php b/app/code/core/Mage/Tag/Block/Product/Result.php index 38bb1562e9..d3c6ae3d46 100644 --- a/app/code/core/Mage/Tag/Block/Product/Result.php +++ b/app/code/core/Mage/Tag/Block/Product/Result.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/Helper/Data.php b/app/code/core/Mage/Tag/Helper/Data.php index 95307308b2..66701f9aa9 100644 --- a/app/code/core/Mage/Tag/Helper/Data.php +++ b/app/code/core/Mage/Tag/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/Model/Api.php b/app/code/core/Mage/Tag/Model/Api.php index e6a3fee04b..1edc8e9f46 100644 --- a/app/code/core/Mage/Tag/Model/Api.php +++ b/app/code/core/Mage/Tag/Model/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/Model/Api/V2.php b/app/code/core/Mage/Tag/Model/Api/V2.php index a0bc9acc16..454b8a58fd 100644 --- a/app/code/core/Mage/Tag/Model/Api/V2.php +++ b/app/code/core/Mage/Tag/Model/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/Model/Entity/Customer/Collection.php b/app/code/core/Mage/Tag/Model/Entity/Customer/Collection.php index a08d6f3728..97df93008d 100644 --- a/app/code/core/Mage/Tag/Model/Entity/Customer/Collection.php +++ b/app/code/core/Mage/Tag/Model/Entity/Customer/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/Model/Indexer/Summary.php b/app/code/core/Mage/Tag/Model/Indexer/Summary.php index ae4bc93816..7e4d991a46 100644 --- a/app/code/core/Mage/Tag/Model/Indexer/Summary.php +++ b/app/code/core/Mage/Tag/Model/Indexer/Summary.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/Model/Mysql4/Customer/Collection.php b/app/code/core/Mage/Tag/Model/Mysql4/Customer/Collection.php index f9c354e980..d8938f14ae 100644 --- a/app/code/core/Mage/Tag/Model/Mysql4/Customer/Collection.php +++ b/app/code/core/Mage/Tag/Model/Mysql4/Customer/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/Model/Mysql4/Indexer/Summary.php b/app/code/core/Mage/Tag/Model/Mysql4/Indexer/Summary.php index 8059a59f4d..17fb4f886b 100644 --- a/app/code/core/Mage/Tag/Model/Mysql4/Indexer/Summary.php +++ b/app/code/core/Mage/Tag/Model/Mysql4/Indexer/Summary.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/Model/Mysql4/Popular/Collection.php b/app/code/core/Mage/Tag/Model/Mysql4/Popular/Collection.php index 0f529250e2..86e9cd9f95 100644 --- a/app/code/core/Mage/Tag/Model/Mysql4/Popular/Collection.php +++ b/app/code/core/Mage/Tag/Model/Mysql4/Popular/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/Model/Mysql4/Product/Collection.php b/app/code/core/Mage/Tag/Model/Mysql4/Product/Collection.php index 23716a7032..5f51c915d9 100644 --- a/app/code/core/Mage/Tag/Model/Mysql4/Product/Collection.php +++ b/app/code/core/Mage/Tag/Model/Mysql4/Product/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/Model/Mysql4/Tag.php b/app/code/core/Mage/Tag/Model/Mysql4/Tag.php index 41d2d4fe01..b0f43b7dc9 100644 --- a/app/code/core/Mage/Tag/Model/Mysql4/Tag.php +++ b/app/code/core/Mage/Tag/Model/Mysql4/Tag.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/Model/Mysql4/Tag/Collection.php b/app/code/core/Mage/Tag/Model/Mysql4/Tag/Collection.php index 49c7c88680..82990e0662 100644 --- a/app/code/core/Mage/Tag/Model/Mysql4/Tag/Collection.php +++ b/app/code/core/Mage/Tag/Model/Mysql4/Tag/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/Model/Mysql4/Tag/Relation.php b/app/code/core/Mage/Tag/Model/Mysql4/Tag/Relation.php index 0fb3171c72..3c823d2bfc 100644 --- a/app/code/core/Mage/Tag/Model/Mysql4/Tag/Relation.php +++ b/app/code/core/Mage/Tag/Model/Mysql4/Tag/Relation.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/Model/Resource/Customer/Collection.php b/app/code/core/Mage/Tag/Model/Resource/Customer/Collection.php index 6cf9ac9411..13879830fa 100755 --- a/app/code/core/Mage/Tag/Model/Resource/Customer/Collection.php +++ b/app/code/core/Mage/Tag/Model/Resource/Customer/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/Model/Resource/Indexer/Summary.php b/app/code/core/Mage/Tag/Model/Resource/Indexer/Summary.php index 080c8b1928..3626828220 100755 --- a/app/code/core/Mage/Tag/Model/Resource/Indexer/Summary.php +++ b/app/code/core/Mage/Tag/Model/Resource/Indexer/Summary.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/Model/Resource/Popular/Collection.php b/app/code/core/Mage/Tag/Model/Resource/Popular/Collection.php index 2318fa27a5..a466ef3eae 100755 --- a/app/code/core/Mage/Tag/Model/Resource/Popular/Collection.php +++ b/app/code/core/Mage/Tag/Model/Resource/Popular/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/Model/Resource/Product/Collection.php b/app/code/core/Mage/Tag/Model/Resource/Product/Collection.php index ffeb3ebc18..8cb3685ccf 100755 --- a/app/code/core/Mage/Tag/Model/Resource/Product/Collection.php +++ b/app/code/core/Mage/Tag/Model/Resource/Product/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/Model/Resource/Tag.php b/app/code/core/Mage/Tag/Model/Resource/Tag.php index 2becd70de7..020249903d 100755 --- a/app/code/core/Mage/Tag/Model/Resource/Tag.php +++ b/app/code/core/Mage/Tag/Model/Resource/Tag.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/Model/Resource/Tag/Collection.php b/app/code/core/Mage/Tag/Model/Resource/Tag/Collection.php index f5b7e36ea5..7c10505311 100755 --- a/app/code/core/Mage/Tag/Model/Resource/Tag/Collection.php +++ b/app/code/core/Mage/Tag/Model/Resource/Tag/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/Model/Resource/Tag/Relation.php b/app/code/core/Mage/Tag/Model/Resource/Tag/Relation.php index 17d3dcd417..74a4b3dbc0 100755 --- a/app/code/core/Mage/Tag/Model/Resource/Tag/Relation.php +++ b/app/code/core/Mage/Tag/Model/Resource/Tag/Relation.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -174,8 +174,7 @@ public function addRelations($model) $select = $write->select() ->from($this->getMainTable(), 'product_id') ->where('tag_id = :tag_id') - ->where('store_id = :store_id') - ->where('customer_id IS NULL'); + ->where('store_id = :store_id'); $oldRelationIds = $write->fetchCol($select, $bind); $insert = array_diff($addedIds, $oldRelationIds); @@ -199,7 +198,6 @@ public function addRelations($model) $write->delete($this->getMainTable(), array( 'product_id IN (?)' => $delete, 'store_id = ?' => $model->getStoreId(), - 'customer_id IS NULL' )); } diff --git a/app/code/core/Mage/Tag/Model/Session.php b/app/code/core/Mage/Tag/Model/Session.php index 6ba1055208..c92a58eac3 100644 --- a/app/code/core/Mage/Tag/Model/Session.php +++ b/app/code/core/Mage/Tag/Model/Session.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/Model/Tag.php b/app/code/core/Mage/Tag/Model/Tag.php index 11bf6ffec6..200c61380b 100644 --- a/app/code/core/Mage/Tag/Model/Tag.php +++ b/app/code/core/Mage/Tag/Model/Tag.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/Model/Tag/Relation.php b/app/code/core/Mage/Tag/Model/Tag/Relation.php index 4c85ae27c5..58d93a97df 100644 --- a/app/code/core/Mage/Tag/Model/Tag/Relation.php +++ b/app/code/core/Mage/Tag/Model/Tag/Relation.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/controllers/CustomerController.php b/app/code/core/Mage/Tag/controllers/CustomerController.php index 05d64f920a..85a1a30c38 100644 --- a/app/code/core/Mage/Tag/controllers/CustomerController.php +++ b/app/code/core/Mage/Tag/controllers/CustomerController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/controllers/IndexController.php b/app/code/core/Mage/Tag/controllers/IndexController.php index cbb1f7035f..027d7c293d 100644 --- a/app/code/core/Mage/Tag/controllers/IndexController.php +++ b/app/code/core/Mage/Tag/controllers/IndexController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/controllers/ListController.php b/app/code/core/Mage/Tag/controllers/ListController.php index cc7d4dbd24..6f1fa89327 100644 --- a/app/code/core/Mage/Tag/controllers/ListController.php +++ b/app/code/core/Mage/Tag/controllers/ListController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/controllers/ProductController.php b/app/code/core/Mage/Tag/controllers/ProductController.php index 033d47b132..852818ea85 100644 --- a/app/code/core/Mage/Tag/controllers/ProductController.php +++ b/app/code/core/Mage/Tag/controllers/ProductController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/etc/adminhtml.xml b/app/code/core/Mage/Tag/etc/adminhtml.xml index fe6eca11fb..eb27d9a242 100644 --- a/app/code/core/Mage/Tag/etc/adminhtml.xml +++ b/app/code/core/Mage/Tag/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Tag/etc/api.xml b/app/code/core/Mage/Tag/etc/api.xml index 3f64d1d415..f9a4d9b292 100644 --- a/app/code/core/Mage/Tag/etc/api.xml +++ b/app/code/core/Mage/Tag/etc/api.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Tag/etc/config.xml b/app/code/core/Mage/Tag/etc/config.xml index be4ccece23..f7fe1f9440 100644 --- a/app/code/core/Mage/Tag/etc/config.xml +++ b/app/code/core/Mage/Tag/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Tag/sql/tag_setup/install-1.6.0.0.php b/app/code/core/Mage/Tag/sql/tag_setup/install-1.6.0.0.php index 08f663c3d4..b595246d0a 100644 --- a/app/code/core/Mage/Tag/sql/tag_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Tag/sql/tag_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/sql/tag_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/Tag/sql/tag_setup/mysql4-install-0.7.0.php index 25be2c1e28..a5e6447d09 100644 --- a/app/code/core/Mage/Tag/sql/tag_setup/mysql4-install-0.7.0.php +++ b/app/code/core/Mage/Tag/sql/tag_setup/mysql4-install-0.7.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-0.7.0-0.7.1.php b/app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-0.7.0-0.7.1.php index d9950f1b24..2632646344 100644 --- a/app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-0.7.0-0.7.1.php +++ b/app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-0.7.0-0.7.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-0.7.1-0.7.2.php b/app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-0.7.1-0.7.2.php index a02fd10274..cb2fa34f5b 100644 --- a/app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-0.7.1-0.7.2.php +++ b/app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-0.7.1-0.7.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-0.7.2-0.7.3.php b/app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-0.7.2-0.7.3.php index 4918a40bc6..cd45bbd606 100644 --- a/app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-0.7.2-0.7.3.php +++ b/app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-0.7.2-0.7.3.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-0.7.3-0.7.4.php b/app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-0.7.3-0.7.4.php index a051d00093..2c348b92bf 100644 --- a/app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-0.7.3-0.7.4.php +++ b/app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-0.7.3-0.7.4.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-0.7.4-0.7.5.php b/app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-0.7.4-0.7.5.php index 31e533c313..843faef4f9 100644 --- a/app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-0.7.4-0.7.5.php +++ b/app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-0.7.4-0.7.5.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-0.7.5-0.7.6.php b/app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-0.7.5-0.7.6.php index ee59427e05..b733915765 100644 --- a/app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-0.7.5-0.7.6.php +++ b/app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-0.7.5-0.7.6.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-0.7.6-0.7.7.php b/app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-0.7.6-0.7.7.php index 8a4d58dc3c..a9d6b38c8c 100644 --- a/app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-0.7.6-0.7.7.php +++ b/app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-0.7.6-0.7.7.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php index 3326d49c43..048e10244e 100644 --- a/app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ b/app/code/core/Mage/Tag/sql/tag_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Block/Adminhtml/Frontend/Region/Updater.php b/app/code/core/Mage/Tax/Block/Adminhtml/Frontend/Region/Updater.php index 007539941b..e4e64cf7d1 100644 --- a/app/code/core/Mage/Tax/Block/Adminhtml/Frontend/Region/Updater.php +++ b/app/code/core/Mage/Tax/Block/Adminhtml/Frontend/Region/Updater.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Block/Checkout/Discount.php b/app/code/core/Mage/Tax/Block/Checkout/Discount.php index f8de23db8f..2fd90cb726 100644 --- a/app/code/core/Mage/Tax/Block/Checkout/Discount.php +++ b/app/code/core/Mage/Tax/Block/Checkout/Discount.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Block/Checkout/Grandtotal.php b/app/code/core/Mage/Tax/Block/Checkout/Grandtotal.php index 300fdb2621..9440d023e3 100644 --- a/app/code/core/Mage/Tax/Block/Checkout/Grandtotal.php +++ b/app/code/core/Mage/Tax/Block/Checkout/Grandtotal.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Block/Checkout/Shipping.php b/app/code/core/Mage/Tax/Block/Checkout/Shipping.php index 523f0f7095..d580fd9edc 100644 --- a/app/code/core/Mage/Tax/Block/Checkout/Shipping.php +++ b/app/code/core/Mage/Tax/Block/Checkout/Shipping.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Block/Checkout/Subtotal.php b/app/code/core/Mage/Tax/Block/Checkout/Subtotal.php index 78f736fdbd..effb489171 100644 --- a/app/code/core/Mage/Tax/Block/Checkout/Subtotal.php +++ b/app/code/core/Mage/Tax/Block/Checkout/Subtotal.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Block/Checkout/Tax.php b/app/code/core/Mage/Tax/Block/Checkout/Tax.php index c7bedf4c8c..6ad9b042dd 100644 --- a/app/code/core/Mage/Tax/Block/Checkout/Tax.php +++ b/app/code/core/Mage/Tax/Block/Checkout/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Block/Sales/Order/Tax.php b/app/code/core/Mage/Tax/Block/Sales/Order/Tax.php index 5161b31111..7b81bef3cd 100644 --- a/app/code/core/Mage/Tax/Block/Sales/Order/Tax.php +++ b/app/code/core/Mage/Tax/Block/Sales/Order/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Exception.php b/app/code/core/Mage/Tax/Exception.php index 572fc88706..eb77e3bc90 100644 --- a/app/code/core/Mage/Tax/Exception.php +++ b/app/code/core/Mage/Tax/Exception.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Helper/Data.php b/app/code/core/Mage/Tax/Helper/Data.php index 83f6ecea3b..36e6cb2df8 100644 --- a/app/code/core/Mage/Tax/Helper/Data.php +++ b/app/code/core/Mage/Tax/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Calculation.php b/app/code/core/Mage/Tax/Model/Calculation.php index 117c93bd05..78a260b491 100644 --- a/app/code/core/Mage/Tax/Model/Calculation.php +++ b/app/code/core/Mage/Tax/Model/Calculation.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Calculation/Rate.php b/app/code/core/Mage/Tax/Model/Calculation/Rate.php index 32415a5295..e0c8f3ded0 100644 --- a/app/code/core/Mage/Tax/Model/Calculation/Rate.php +++ b/app/code/core/Mage/Tax/Model/Calculation/Rate.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Calculation/Rate/Title.php b/app/code/core/Mage/Tax/Model/Calculation/Rate/Title.php index eca6c03ced..eae9577605 100644 --- a/app/code/core/Mage/Tax/Model/Calculation/Rate/Title.php +++ b/app/code/core/Mage/Tax/Model/Calculation/Rate/Title.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Calculation/Rule.php b/app/code/core/Mage/Tax/Model/Calculation/Rule.php index b1ecab0539..654c107595 100644 --- a/app/code/core/Mage/Tax/Model/Calculation/Rule.php +++ b/app/code/core/Mage/Tax/Model/Calculation/Rule.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Class.php b/app/code/core/Mage/Tax/Model/Class.php index 1eb958ffe0..3c84e8017a 100644 --- a/app/code/core/Mage/Tax/Model/Class.php +++ b/app/code/core/Mage/Tax/Model/Class.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Class/Source/Customer.php b/app/code/core/Mage/Tax/Model/Class/Source/Customer.php index 852467816d..7e8856434f 100644 --- a/app/code/core/Mage/Tax/Model/Class/Source/Customer.php +++ b/app/code/core/Mage/Tax/Model/Class/Source/Customer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Class/Source/Product.php b/app/code/core/Mage/Tax/Model/Class/Source/Product.php index a02f3aaca2..776f05490c 100644 --- a/app/code/core/Mage/Tax/Model/Class/Source/Product.php +++ b/app/code/core/Mage/Tax/Model/Class/Source/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Config.php b/app/code/core/Mage/Tax/Model/Config.php index 3350370f60..90dc0825dd 100644 --- a/app/code/core/Mage/Tax/Model/Config.php +++ b/app/code/core/Mage/Tax/Model/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Config/Price/Include.php b/app/code/core/Mage/Tax/Model/Config/Price/Include.php index e0258d81ca..06cd76fb86 100644 --- a/app/code/core/Mage/Tax/Model/Config/Price/Include.php +++ b/app/code/core/Mage/Tax/Model/Config/Price/Include.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Tax_Model_Config_Price_Include extends Mage_Core_Model_Config_Data diff --git a/app/code/core/Mage/Tax/Model/Mysql4/Calculation.php b/app/code/core/Mage/Tax/Model/Mysql4/Calculation.php index 8f4b3a096a..d650d80f06 100644 --- a/app/code/core/Mage/Tax/Model/Mysql4/Calculation.php +++ b/app/code/core/Mage/Tax/Model/Mysql4/Calculation.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Mysql4/Calculation/Collection.php b/app/code/core/Mage/Tax/Model/Mysql4/Calculation/Collection.php index 96e91a0967..75c9a1c6f6 100644 --- a/app/code/core/Mage/Tax/Model/Mysql4/Calculation/Collection.php +++ b/app/code/core/Mage/Tax/Model/Mysql4/Calculation/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Mysql4/Calculation/Rate.php b/app/code/core/Mage/Tax/Model/Mysql4/Calculation/Rate.php index 728bff6694..d54c42fbb3 100644 --- a/app/code/core/Mage/Tax/Model/Mysql4/Calculation/Rate.php +++ b/app/code/core/Mage/Tax/Model/Mysql4/Calculation/Rate.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Mysql4/Calculation/Rate/Collection.php b/app/code/core/Mage/Tax/Model/Mysql4/Calculation/Rate/Collection.php index 4f5bcb8031..7a06779dd4 100644 --- a/app/code/core/Mage/Tax/Model/Mysql4/Calculation/Rate/Collection.php +++ b/app/code/core/Mage/Tax/Model/Mysql4/Calculation/Rate/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Mysql4/Calculation/Rate/Title.php b/app/code/core/Mage/Tax/Model/Mysql4/Calculation/Rate/Title.php index 9374c9fbc2..efeb5beb48 100644 --- a/app/code/core/Mage/Tax/Model/Mysql4/Calculation/Rate/Title.php +++ b/app/code/core/Mage/Tax/Model/Mysql4/Calculation/Rate/Title.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Mysql4/Calculation/Rate/Title/Collection.php b/app/code/core/Mage/Tax/Model/Mysql4/Calculation/Rate/Title/Collection.php index 7731488d51..f556299643 100644 --- a/app/code/core/Mage/Tax/Model/Mysql4/Calculation/Rate/Title/Collection.php +++ b/app/code/core/Mage/Tax/Model/Mysql4/Calculation/Rate/Title/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Mysql4/Calculation/Rule.php b/app/code/core/Mage/Tax/Model/Mysql4/Calculation/Rule.php index 4f5d38a411..1e913ae3fa 100644 --- a/app/code/core/Mage/Tax/Model/Mysql4/Calculation/Rule.php +++ b/app/code/core/Mage/Tax/Model/Mysql4/Calculation/Rule.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Mysql4/Calculation/Rule/Collection.php b/app/code/core/Mage/Tax/Model/Mysql4/Calculation/Rule/Collection.php index 2f2a8323de..d43b92cce4 100644 --- a/app/code/core/Mage/Tax/Model/Mysql4/Calculation/Rule/Collection.php +++ b/app/code/core/Mage/Tax/Model/Mysql4/Calculation/Rule/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Mysql4/Class.php b/app/code/core/Mage/Tax/Model/Mysql4/Class.php index c20bfebe06..eba5d3031c 100644 --- a/app/code/core/Mage/Tax/Model/Mysql4/Class.php +++ b/app/code/core/Mage/Tax/Model/Mysql4/Class.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Mysql4/Class/Collection.php b/app/code/core/Mage/Tax/Model/Mysql4/Class/Collection.php index 2040e5b226..746c2ad357 100644 --- a/app/code/core/Mage/Tax/Model/Mysql4/Class/Collection.php +++ b/app/code/core/Mage/Tax/Model/Mysql4/Class/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Mysql4/Report/Collection.php b/app/code/core/Mage/Tax/Model/Mysql4/Report/Collection.php index 5dc866dec2..91bd18c4b7 100644 --- a/app/code/core/Mage/Tax/Model/Mysql4/Report/Collection.php +++ b/app/code/core/Mage/Tax/Model/Mysql4/Report/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Mysql4/Report/Tax.php b/app/code/core/Mage/Tax/Model/Mysql4/Report/Tax.php index dbfc058c7b..dabb5951ef 100644 --- a/app/code/core/Mage/Tax/Model/Mysql4/Report/Tax.php +++ b/app/code/core/Mage/Tax/Model/Mysql4/Report/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Mysql4/Report/Updatedat/Collection.php b/app/code/core/Mage/Tax/Model/Mysql4/Report/Updatedat/Collection.php index 6d2132cd92..98f5c617fc 100644 --- a/app/code/core/Mage/Tax/Model/Mysql4/Report/Updatedat/Collection.php +++ b/app/code/core/Mage/Tax/Model/Mysql4/Report/Updatedat/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Mysql4/Sales/Order/Tax.php b/app/code/core/Mage/Tax/Model/Mysql4/Sales/Order/Tax.php index 72ff1696ca..76b82d172a 100644 --- a/app/code/core/Mage/Tax/Model/Mysql4/Sales/Order/Tax.php +++ b/app/code/core/Mage/Tax/Model/Mysql4/Sales/Order/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Mysql4/Sales/Order/Tax/Collection.php b/app/code/core/Mage/Tax/Model/Mysql4/Sales/Order/Tax/Collection.php index ef27102200..6fd6ad3d60 100644 --- a/app/code/core/Mage/Tax/Model/Mysql4/Sales/Order/Tax/Collection.php +++ b/app/code/core/Mage/Tax/Model/Mysql4/Sales/Order/Tax/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Mysql4/Setup.php b/app/code/core/Mage/Tax/Model/Mysql4/Setup.php index bde2ad78d5..efd446d66f 100644 --- a/app/code/core/Mage/Tax/Model/Mysql4/Setup.php +++ b/app/code/core/Mage/Tax/Model/Mysql4/Setup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Observer.php b/app/code/core/Mage/Tax/Model/Observer.php index e14d6d178f..6e9c97943d 100644 --- a/app/code/core/Mage/Tax/Model/Observer.php +++ b/app/code/core/Mage/Tax/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Resource/Calculation.php b/app/code/core/Mage/Tax/Model/Resource/Calculation.php index cb048adfed..2a38f6cd18 100755 --- a/app/code/core/Mage/Tax/Model/Resource/Calculation.php +++ b/app/code/core/Mage/Tax/Model/Resource/Calculation.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Resource/Calculation/Collection.php b/app/code/core/Mage/Tax/Model/Resource/Calculation/Collection.php index 7b8b0b74a8..b24a05e526 100755 --- a/app/code/core/Mage/Tax/Model/Resource/Calculation/Collection.php +++ b/app/code/core/Mage/Tax/Model/Resource/Calculation/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Resource/Calculation/Rate.php b/app/code/core/Mage/Tax/Model/Resource/Calculation/Rate.php index acfba89215..9bd87107f7 100755 --- a/app/code/core/Mage/Tax/Model/Resource/Calculation/Rate.php +++ b/app/code/core/Mage/Tax/Model/Resource/Calculation/Rate.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Resource/Calculation/Rate/Collection.php b/app/code/core/Mage/Tax/Model/Resource/Calculation/Rate/Collection.php index ae43196bf1..9539fdbfeb 100755 --- a/app/code/core/Mage/Tax/Model/Resource/Calculation/Rate/Collection.php +++ b/app/code/core/Mage/Tax/Model/Resource/Calculation/Rate/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Resource/Calculation/Rate/Title.php b/app/code/core/Mage/Tax/Model/Resource/Calculation/Rate/Title.php index b4d18cc18e..3c78482c99 100755 --- a/app/code/core/Mage/Tax/Model/Resource/Calculation/Rate/Title.php +++ b/app/code/core/Mage/Tax/Model/Resource/Calculation/Rate/Title.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Resource/Calculation/Rate/Title/Collection.php b/app/code/core/Mage/Tax/Model/Resource/Calculation/Rate/Title/Collection.php index f3fa4668a4..b293b3eee2 100755 --- a/app/code/core/Mage/Tax/Model/Resource/Calculation/Rate/Title/Collection.php +++ b/app/code/core/Mage/Tax/Model/Resource/Calculation/Rate/Title/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Resource/Calculation/Rule.php b/app/code/core/Mage/Tax/Model/Resource/Calculation/Rule.php index 4cfb06401d..329e911ec7 100755 --- a/app/code/core/Mage/Tax/Model/Resource/Calculation/Rule.php +++ b/app/code/core/Mage/Tax/Model/Resource/Calculation/Rule.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Resource/Calculation/Rule/Collection.php b/app/code/core/Mage/Tax/Model/Resource/Calculation/Rule/Collection.php index 349a98ce3a..77afa20227 100755 --- a/app/code/core/Mage/Tax/Model/Resource/Calculation/Rule/Collection.php +++ b/app/code/core/Mage/Tax/Model/Resource/Calculation/Rule/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Resource/Class.php b/app/code/core/Mage/Tax/Model/Resource/Class.php index 102232ee46..1412a0d392 100755 --- a/app/code/core/Mage/Tax/Model/Resource/Class.php +++ b/app/code/core/Mage/Tax/Model/Resource/Class.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Resource/Class/Collection.php b/app/code/core/Mage/Tax/Model/Resource/Class/Collection.php index b823414b4a..4a64a58712 100755 --- a/app/code/core/Mage/Tax/Model/Resource/Class/Collection.php +++ b/app/code/core/Mage/Tax/Model/Resource/Class/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Resource/Report/Collection.php b/app/code/core/Mage/Tax/Model/Resource/Report/Collection.php index 8766b191e5..8e45da7354 100755 --- a/app/code/core/Mage/Tax/Model/Resource/Report/Collection.php +++ b/app/code/core/Mage/Tax/Model/Resource/Report/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Resource/Report/Tax.php b/app/code/core/Mage/Tax/Model/Resource/Report/Tax.php index 7a0acfc70b..07904b4616 100755 --- a/app/code/core/Mage/Tax/Model/Resource/Report/Tax.php +++ b/app/code/core/Mage/Tax/Model/Resource/Report/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Resource/Report/Tax/Createdat.php b/app/code/core/Mage/Tax/Model/Resource/Report/Tax/Createdat.php index af7cf473f3..32c78fb204 100644 --- a/app/code/core/Mage/Tax/Model/Resource/Report/Tax/Createdat.php +++ b/app/code/core/Mage/Tax/Model/Resource/Report/Tax/Createdat.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Resource/Report/Tax/Updatedat.php b/app/code/core/Mage/Tax/Model/Resource/Report/Tax/Updatedat.php index 48588495cb..a15cb2180d 100644 --- a/app/code/core/Mage/Tax/Model/Resource/Report/Tax/Updatedat.php +++ b/app/code/core/Mage/Tax/Model/Resource/Report/Tax/Updatedat.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Resource/Report/Updatedat/Collection.php b/app/code/core/Mage/Tax/Model/Resource/Report/Updatedat/Collection.php index bac46a4de3..b2a2c7f326 100755 --- a/app/code/core/Mage/Tax/Model/Resource/Report/Updatedat/Collection.php +++ b/app/code/core/Mage/Tax/Model/Resource/Report/Updatedat/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Resource/Sales/Order/Tax.php b/app/code/core/Mage/Tax/Model/Resource/Sales/Order/Tax.php index d408b28b1b..35b1f51031 100755 --- a/app/code/core/Mage/Tax/Model/Resource/Sales/Order/Tax.php +++ b/app/code/core/Mage/Tax/Model/Resource/Sales/Order/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Resource/Sales/Order/Tax/Collection.php b/app/code/core/Mage/Tax/Model/Resource/Sales/Order/Tax/Collection.php index 555eef5e37..31a0c9ccf6 100755 --- a/app/code/core/Mage/Tax/Model/Resource/Sales/Order/Tax/Collection.php +++ b/app/code/core/Mage/Tax/Model/Resource/Sales/Order/Tax/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Resource/Sales/Order/Tax/Item.php b/app/code/core/Mage/Tax/Model/Resource/Sales/Order/Tax/Item.php index c986b31e6f..3377044de8 100755 --- a/app/code/core/Mage/Tax/Model/Resource/Sales/Order/Tax/Item.php +++ b/app/code/core/Mage/Tax/Model/Resource/Sales/Order/Tax/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Resource/Sales/Order/Tax/Item/Collection.php b/app/code/core/Mage/Tax/Model/Resource/Sales/Order/Tax/Item/Collection.php index dbdb22871b..c1217161d8 100755 --- a/app/code/core/Mage/Tax/Model/Resource/Sales/Order/Tax/Item/Collection.php +++ b/app/code/core/Mage/Tax/Model/Resource/Sales/Order/Tax/Item/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Resource/Setup.php b/app/code/core/Mage/Tax/Model/Resource/Setup.php index 5c5b5a34ab..bb2b957f56 100755 --- a/app/code/core/Mage/Tax/Model/Resource/Setup.php +++ b/app/code/core/Mage/Tax/Model/Resource/Setup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Sales/Order/Tax.php b/app/code/core/Mage/Tax/Model/Sales/Order/Tax.php index 0111d77fa7..bf279715b1 100644 --- a/app/code/core/Mage/Tax/Model/Sales/Order/Tax.php +++ b/app/code/core/Mage/Tax/Model/Sales/Order/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Sales/Order/Tax/Item.php b/app/code/core/Mage/Tax/Model/Sales/Order/Tax/Item.php index fa0f811aea..3092a16be9 100644 --- a/app/code/core/Mage/Tax/Model/Sales/Order/Tax/Item.php +++ b/app/code/core/Mage/Tax/Model/Sales/Order/Tax/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Sales/Pdf/Grandtotal.php b/app/code/core/Mage/Tax/Model/Sales/Pdf/Grandtotal.php index f9d81baf7b..033f73005d 100644 --- a/app/code/core/Mage/Tax/Model/Sales/Pdf/Grandtotal.php +++ b/app/code/core/Mage/Tax/Model/Sales/Pdf/Grandtotal.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Sales/Pdf/Shipping.php b/app/code/core/Mage/Tax/Model/Sales/Pdf/Shipping.php index 4e0b9138b7..65913b6bca 100644 --- a/app/code/core/Mage/Tax/Model/Sales/Pdf/Shipping.php +++ b/app/code/core/Mage/Tax/Model/Sales/Pdf/Shipping.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Sales/Pdf/Subtotal.php b/app/code/core/Mage/Tax/Model/Sales/Pdf/Subtotal.php index 1843b0e48c..3318792298 100644 --- a/app/code/core/Mage/Tax/Model/Sales/Pdf/Subtotal.php +++ b/app/code/core/Mage/Tax/Model/Sales/Pdf/Subtotal.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Sales/Pdf/Tax.php b/app/code/core/Mage/Tax/Model/Sales/Pdf/Tax.php index 1bbe320670..5d3c91e508 100644 --- a/app/code/core/Mage/Tax/Model/Sales/Pdf/Tax.php +++ b/app/code/core/Mage/Tax/Model/Sales/Pdf/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Discount.php b/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Discount.php index efd0f29218..7cdbb337b8 100644 --- a/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Discount.php +++ b/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Discount.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Nominal/Subtotal.php b/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Nominal/Subtotal.php index 94c946bf63..3618738003 100644 --- a/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Nominal/Subtotal.php +++ b/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Nominal/Subtotal.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Nominal/Tax.php b/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Nominal/Tax.php index db346692e0..d33cadb96e 100644 --- a/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Nominal/Tax.php +++ b/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Nominal/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Shipping.php b/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Shipping.php index 43bc21c56b..b02aef5f2a 100644 --- a/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Shipping.php +++ b/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Shipping.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Subtotal.php b/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Subtotal.php index 80c0013e7e..d4062b2d46 100644 --- a/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Subtotal.php +++ b/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Subtotal.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -91,7 +91,7 @@ public function __construct() /** * Calculate item price including/excluding tax, row total including/excluding tax - * and subotal including/excluding tax. + * and subtotal including/excluding tax. * Determine discount price if needed * * @param Mage_Sales_Model_Quote_Address $address @@ -273,10 +273,8 @@ protected function _unitBaseCalculation($item, $request) $item->getOriginalPrice(); $item->setCustomPrice($price); $item->setBaseCustomPrice($basePrice); - } else { - $item->setConvertedPrice($price); } - $item->setPrice($price); + $item->setPrice($basePrice); $item->setBasePrice($basePrice); $item->setRowTotal($subtotal); $item->setBaseRowTotal($baseSubtotal); @@ -386,10 +384,8 @@ protected function _rowBaseCalculation($item, $request) $item->getOriginalPrice(); $item->setCustomPrice($price); $item->setBaseCustomPrice($basePrice); - } else { - $item->setConvertedPrice($price); } - $item->setPrice($price); + $item->setPrice($basePrice); $item->setBasePrice($basePrice); $item->setRowTotal($subtotal); $item->setBaseRowTotal($baseSubtotal); diff --git a/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Tax.php b/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Tax.php index f4a4cfa329..2c16e5ebd0 100644 --- a/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Tax.php +++ b/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -567,7 +567,6 @@ protected function _totalBaseCalculation(Mage_Sales_Model_Quote_Address $address $taxGroups = array(); $itemTaxGroups = array(); - $inclTax = false; foreach ($items as $item) { if ($item->getParentItem()) { continue; @@ -579,8 +578,8 @@ protected function _totalBaseCalculation(Mage_Sales_Model_Quote_Address $address $rate = $this->_calculator->getRate($taxRateRequest); $applied_rates = $this->_calculator->getAppliedRates($taxRateRequest); $taxGroups[(string)$rate]['applied_rates'] = $applied_rates; + $taxGroups[(string)$rate]['incl_tax'] = $child->getIsPriceInclTax(); $this->_aggregateTaxPerRate($child, $rate, $taxGroups); - $inclTax = $child->getIsPriceInclTax(); if ($rate > 0) { $itemTaxGroups[$child->getId()] = $applied_rates; } @@ -591,8 +590,8 @@ protected function _totalBaseCalculation(Mage_Sales_Model_Quote_Address $address $rate = $this->_calculator->getRate($taxRateRequest); $applied_rates = $this->_calculator->getAppliedRates($taxRateRequest); $taxGroups[(string)$rate]['applied_rates'] = $applied_rates; + $taxGroups[(string)$rate]['incl_tax'] = $item->getIsPriceInclTax(); $this->_aggregateTaxPerRate($item, $rate, $taxGroups); - $inclTax = $item->getIsPriceInclTax(); if ($rate > 0) { $itemTaxGroups[$item->getId()] = $applied_rates; } @@ -606,6 +605,7 @@ protected function _totalBaseCalculation(Mage_Sales_Model_Quote_Address $address foreach ($taxGroups as $rateKey => $data) { $rate = (float) $rateKey; + $inclTax = $data['incl_tax']; $totalTax = $this->_calculator->calcTaxAmount(array_sum($data['totals']), $rate, $inclTax); $baseTotalTax = $this->_calculator->calcTaxAmount(array_sum($data['base_totals']), $rate, $inclTax); $this->_addAmount($totalTax); @@ -658,6 +658,21 @@ protected function _aggregateTaxPerRate($item, $rate, &$taxGroups) $baseTaxSubtotal = max($baseSubtotal - $baseDiscount, 0); $rowTax = $this->_calculator->calcTaxAmount($taxSubtotal, $rate, $inclTax, false); $baseRowTax = $this->_calculator->calcTaxAmount($baseTaxSubtotal, $rate, $inclTax, false); + if (!$item->getNoDiscount() && $item->getWeeeTaxApplied()) { + $rowTaxBeforeDiscount = $this->_calculator->calcTaxAmount( + $subtotal, + $rate, + $inclTax, + false + ); + $baseRowTaxBeforeDiscount = $this->_calculator->calcTaxAmount( + $baseSubtotal, + $rate, + $inclTax, + false + ); + } + if ($inclTax && $discount > 0) { $hiddenTax = $this->_calculator->calcTaxAmount($discount, $rate, $inclTax, false); $baseHiddenTax = $this->_calculator->calcTaxAmount($baseDiscount, $rate, $inclTax, false); @@ -678,6 +693,20 @@ protected function _aggregateTaxPerRate($item, $rate, &$taxGroups) $item->setTaxAmount(max(0, $rowTax)); $item->setBaseTaxAmount(max(0, $baseRowTax)); + if (isset($rowTaxBeforeDiscount) && isset($baseRowTaxBeforeDiscount)) { + $taxBeforeDiscount = max( + 0, + $this->_deltaRound($rowTaxBeforeDiscount, $rateKey, $inclTax) + ); + $baseTaxBeforeDiscount = max( + 0, + $this->_deltaRound($baseRowTaxBeforeDiscount, $rateKey, $inclTax, 'base') + ); + + $item->setDiscountTaxCompensation($taxBeforeDiscount - max(0, $rowTax)); + $item->setBaseDiscountTaxCompensation($baseTaxBeforeDiscount - max(0, $baseRowTax)); + } + $taxGroups[$rateKey]['totals'][] = max(0, $taxSubtotal); $taxGroups[$rateKey]['base_totals'][] = max(0, $baseTaxSubtotal); return $this; @@ -786,12 +815,20 @@ public function fetch(Mage_Sales_Model_Quote_Address $address) $applied = $address->getAppliedTaxes(); $store = $address->getQuote()->getStore(); $amount = $address->getTaxAmount(); + + $items = $this->_getAddressItems($address); + $discountTaxCompensation = 0; + foreach ($items as $item) { + $discountTaxCompensation += $item->getDiscountTaxCompensation(); + } + $taxAmount = $amount + $discountTaxCompensation; + $area = null; if ($this->_config->displayCartTaxWithGrandTotal($store) && $address->getGrandTotal()) { $area = 'taxes'; } - if (($amount!=0) || ($this->_config->displayCartZeroTax($store))) { + if (($amount != 0) || ($this->_config->displayCartZeroTax($store))) { $address->addTotal(array( 'code' => $this->getCode(), 'title' => Mage::helper('tax')->__('Tax'), @@ -809,7 +846,7 @@ public function fetch(Mage_Sales_Model_Quote_Address $address) if ($address->getSubtotalInclTax() > 0) { $subtotalInclTax = $address->getSubtotalInclTax(); } else { - $subtotalInclTax = $address->getSubtotal()+$address->getTaxAmount()-$address->getShippingTaxAmount(); + $subtotalInclTax = $address->getSubtotal() + $taxAmount - $address->getShippingTaxAmount(); } $address->addTotal(array( diff --git a/app/code/core/Mage/Tax/Model/System/Config/Source/Algorithm.php b/app/code/core/Mage/Tax/Model/System/Config/Source/Algorithm.php index 507792a162..1db48cf988 100644 --- a/app/code/core/Mage/Tax/Model/System/Config/Source/Algorithm.php +++ b/app/code/core/Mage/Tax/Model/System/Config/Source/Algorithm.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/System/Config/Source/Apply.php b/app/code/core/Mage/Tax/Model/System/Config/Source/Apply.php index 6940a402a2..dc5de21dcb 100644 --- a/app/code/core/Mage/Tax/Model/System/Config/Source/Apply.php +++ b/app/code/core/Mage/Tax/Model/System/Config/Source/Apply.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/System/Config/Source/PriceType.php b/app/code/core/Mage/Tax/Model/System/Config/Source/PriceType.php index 29d1ea72f3..54fc2d696a 100644 --- a/app/code/core/Mage/Tax/Model/System/Config/Source/PriceType.php +++ b/app/code/core/Mage/Tax/Model/System/Config/Source/PriceType.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/System/Config/Source/Tax/Country.php b/app/code/core/Mage/Tax/Model/System/Config/Source/Tax/Country.php index 000cf61782..0c8de4484a 100644 --- a/app/code/core/Mage/Tax/Model/System/Config/Source/Tax/Country.php +++ b/app/code/core/Mage/Tax/Model/System/Config/Source/Tax/Country.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/System/Config/Source/Tax/Display/Type.php b/app/code/core/Mage/Tax/Model/System/Config/Source/Tax/Display/Type.php index b4c8a223ef..2515d6ca0f 100644 --- a/app/code/core/Mage/Tax/Model/System/Config/Source/Tax/Display/Type.php +++ b/app/code/core/Mage/Tax/Model/System/Config/Source/Tax/Display/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/System/Config/Source/Tax/Region.php b/app/code/core/Mage/Tax/Model/System/Config/Source/Tax/Region.php index a900aa1209..1bc64cdb6f 100644 --- a/app/code/core/Mage/Tax/Model/System/Config/Source/Tax/Region.php +++ b/app/code/core/Mage/Tax/Model/System/Config/Source/Tax/Region.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/data/tax_setup/data-install-1.6.0.0.php b/app/code/core/Mage/Tax/data/tax_setup/data-install-1.6.0.0.php index a7b8e9b7f1..2beb0ddae3 100644 --- a/app/code/core/Mage/Tax/data/tax_setup/data-install-1.6.0.0.php +++ b/app/code/core/Mage/Tax/data/tax_setup/data-install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** @var $installer Mage_Tax_Model_Resource_Setup */ diff --git a/app/code/core/Mage/Tax/etc/adminhtml.xml b/app/code/core/Mage/Tax/etc/adminhtml.xml index 3b7f5c2d61..af1a438bfe 100644 --- a/app/code/core/Mage/Tax/etc/adminhtml.xml +++ b/app/code/core/Mage/Tax/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Tax/etc/config.xml b/app/code/core/Mage/Tax/etc/config.xml index e25aa95302..5be814944f 100644 --- a/app/code/core/Mage/Tax/etc/config.xml +++ b/app/code/core/Mage/Tax/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -132,14 +132,14 @@ - + tax/observer prepareCatalogIndexPriceSelect - + diff --git a/app/code/core/Mage/Tax/etc/system.xml b/app/code/core/Mage/Tax/etc/system.xml index caf25e9074..904acc29c6 100644 --- a/app/code/core/Mage/Tax/etc/system.xml +++ b/app/code/core/Mage/Tax/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -267,7 +267,7 @@ - + 60 1 1 diff --git a/app/code/core/Mage/Tax/sql/tax_setup/install-1.6.0.0.php b/app/code/core/Mage/Tax/sql/tax_setup/install-1.6.0.0.php index 215710269e..f02af4773d 100644 --- a/app/code/core/Mage/Tax/sql/tax_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Tax/sql/tax_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** @var $installer Mage_Tax_Model_Resource_Setup */ diff --git a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-install-0.7.0.php index 5f266b2111..64456bce62 100644 --- a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-install-0.7.0.php +++ b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-install-0.7.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-install-1.4.0.0.php b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-install-1.4.0.0.php index f103bb7055..1fbcee3be1 100644 --- a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-install-1.4.0.0.php +++ b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-install-1.4.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.6.1-0.7.0.php b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.6.1-0.7.0.php index eb0479322c..cda2862406 100644 --- a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.6.1-0.7.0.php +++ b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.6.1-0.7.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.0-0.7.1.php b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.0-0.7.1.php index 76417d25f9..d399797f07 100644 --- a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.0-0.7.1.php +++ b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.0-0.7.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.1-0.7.2.php b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.1-0.7.2.php index 40448eb56c..13bf822869 100644 --- a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.1-0.7.2.php +++ b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.1-0.7.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.10-0.7.11.php b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.10-0.7.11.php index 9b55276b7d..8f82593113 100644 --- a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.10-0.7.11.php +++ b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.10-0.7.11.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.11-0.7.12.php b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.11-0.7.12.php index ee2435214c..61e99c7ff4 100644 --- a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.11-0.7.12.php +++ b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.11-0.7.12.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.12-0.7.13.php b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.12-0.7.13.php index 6664b12ea7..c46bad1d3a 100644 --- a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.12-0.7.13.php +++ b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.12-0.7.13.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.2-0.7.3.php b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.2-0.7.3.php index baa406da10..75d57879da 100644 --- a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.2-0.7.3.php +++ b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.2-0.7.3.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.3-0.7.4.php b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.3-0.7.4.php index d5fd4c14d9..1d9f7c3a8d 100644 --- a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.3-0.7.4.php +++ b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.3-0.7.4.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.4-0.7.5.php b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.4-0.7.5.php index a4ca8245ea..90d64426e2 100644 --- a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.4-0.7.5.php +++ b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.4-0.7.5.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.5-0.7.6.php b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.5-0.7.6.php index 86af095fcc..5597f5da25 100644 --- a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.5-0.7.6.php +++ b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.5-0.7.6.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.6-0.7.7.php b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.6-0.7.7.php index b5b96d56b4..3713a9f528 100644 --- a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.6-0.7.7.php +++ b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.6-0.7.7.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.7-0.7.8.php b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.7-0.7.8.php index 1463009895..55aa84d575 100644 --- a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.7-0.7.8.php +++ b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.7-0.7.8.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.8-0.7.9.php b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.8-0.7.9.php index 93294b7f9a..49bd7f5e63 100644 --- a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.8-0.7.9.php +++ b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.8-0.7.9.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.9-0.7.10.php b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.9-0.7.10.php index 87b2931415..e570f288a0 100644 --- a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.9-0.7.10.php +++ b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.9-0.7.10.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-1.3.9-1.4.0.php b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-1.3.9-1.4.0.php index d2e8880503..d38167b733 100644 --- a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-1.3.9-1.4.0.php +++ b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-1.3.9-1.4.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-1.4.0.0-1.4.0.1.php b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-1.4.0.0-1.4.0.1.php index 4d226c2299..5774fee2c4 100644 --- a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-1.4.0.0-1.4.0.1.php +++ b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-1.4.0.0-1.4.0.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-1.4.0.1-1.4.0.2.php b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-1.4.0.1-1.4.0.2.php new file mode 100644 index 0000000000..5d0e1a9ef3 --- /dev/null +++ b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-1.4.0.1-1.4.0.2.php @@ -0,0 +1,36 @@ +startSetup(); +$installer->getConnection()->changeColumn( + $installer->getTable('tax/tax_calculation_rate'), + 'tax_postcode', + 'tax_postcode', + 'VARCHAR(21) NULL DEFAULT NULL' +); +$installer->endSetup(); diff --git a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php index fedda0c387..0fadf54059 100644 --- a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/sql/tax_setup/upgrade-1.6.0.0-1.6.0.1.php b/app/code/core/Mage/Tax/sql/tax_setup/upgrade-1.6.0.0-1.6.0.1.php index 43ee81dfd4..dee60efc99 100644 --- a/app/code/core/Mage/Tax/sql/tax_setup/upgrade-1.6.0.0-1.6.0.1.php +++ b/app/code/core/Mage/Tax/sql/tax_setup/upgrade-1.6.0.0-1.6.0.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/sql/tax_setup/upgrade-1.6.0.1-1.6.0.2.php b/app/code/core/Mage/Tax/sql/tax_setup/upgrade-1.6.0.1-1.6.0.2.php index 01e02eb424..92813e5a34 100644 --- a/app/code/core/Mage/Tax/sql/tax_setup/upgrade-1.6.0.1-1.6.0.2.php +++ b/app/code/core/Mage/Tax/sql/tax_setup/upgrade-1.6.0.1-1.6.0.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/sql/tax_setup/upgrade-1.6.0.2-1.6.0.3.php b/app/code/core/Mage/Tax/sql/tax_setup/upgrade-1.6.0.2-1.6.0.3.php index 8dcf938873..757eb01aea 100644 --- a/app/code/core/Mage/Tax/sql/tax_setup/upgrade-1.6.0.2-1.6.0.3.php +++ b/app/code/core/Mage/Tax/sql/tax_setup/upgrade-1.6.0.2-1.6.0.3.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/Block/Adminhtml/Dhl/Unitofmeasure.php b/app/code/core/Mage/Usa/Block/Adminhtml/Dhl/Unitofmeasure.php index a8d6519d7c..3c93c4cf0a 100644 --- a/app/code/core/Mage/Usa/Block/Adminhtml/Dhl/Unitofmeasure.php +++ b/app/code/core/Mage/Usa/Block/Adminhtml/Dhl/Unitofmeasure.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/Helper/Data.php b/app/code/core/Mage/Usa/Helper/Data.php index 1b66194c1c..8818068929 100644 --- a/app/code/core/Mage/Usa/Helper/Data.php +++ b/app/code/core/Mage/Usa/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Abstract.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Abstract.php index 5cdebbc2f4..fb202e190d 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Abstract.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -108,12 +108,16 @@ public function isCityRequired() } /** - * Check if zip code option required + * Determine whether zip-code is required for the country of destination * - * @return boolean + * @param Mage_Shipping_Model_Rate_Request|null $request + * @return bool */ - public function isZipCodeRequired() + public function isZipCodeRequired(Mage_Shipping_Model_Rate_Request $request = null) { + if ($request instanceof Mage_Shipping_Model_Rate_Request) { + return !Mage::helper('directory')->isZipCodeOptional($request->getDestCountryId()); + } return true; } @@ -128,14 +132,37 @@ public function isShippingLabelsAvailable() } /** - * Some carriers need to override this method to get the correct quote + * Return items for further shipment rate evaluation. We need to pass children of a bundle instead passing the + * bundle itself, otherwise we may not get a rate at all (e.g. when total weight of a bundle exceeds max weight + * despite each item by itself is not) * * @param Mage_Shipping_Model_Rate_Request $request * @return array */ public function getAllItems(Mage_Shipping_Model_Rate_Request $request) { - return $request->getAllItems(); + $items = array(); + if ($request->getAllItems()) { + foreach ($request->getAllItems() as $item) { + /* @var $item Mage_Sales_Model_Quote_Item */ + if ($item->getProduct()->isVirtual() || $item->getParentItem()) { + // Don't process children here - we will process (or already have processed) them below + continue; + } + + if ($item->getHasChildren() && $item->isShipSeparately()) { + foreach ($item->getChildren() as $child) { + if (!$child->getFreeShipping() && !$child->getProduct()->isVirtual()) { + $items[] = $child; + } + } + } else { + // Ship together - count compound item as one solid + $items[] = $item; + } + } + } + return $items; } /** @@ -151,22 +178,36 @@ public function proccessAdditionalValidation(Mage_Shipping_Model_Rate_Request $r return $this; } - $maxAllowedWeight = (float) $this->getConfigData('max_package_weight'); - $errorMsg = ''; - $configErrorMsg = $this->getConfigData('specificerrmsg'); - $defaultErrorMsg = Mage::helper('shipping')->__('The shipping module is not available.'); - $showMethod = $this->getConfigData('showmethod'); + $maxAllowedWeight = (float) $this->getConfigData('max_package_weight'); + $errorMsg = ''; + $configErrorMsg = $this->getConfigData('specificerrmsg'); + $defaultErrorMsg = Mage::helper('shipping')->__('The shipping module is not available.'); + $showMethod = $this->getConfigData('showmethod'); foreach ($this->getAllItems($request) as $item) { if ($item->getProduct() && $item->getProduct()->getId()) { - if ($item->getProduct()->getWeight() * $item->getProduct()->getQty() > $maxAllowedWeight) { + $weight = $item->getProduct()->getWeight(); + $stockItem = $item->getProduct()->getStockItem(); + $doValidation = true; + + if ($stockItem->getIsQtyDecimal() && $stockItem->getIsDecimalDivided()) { + if ($stockItem->getEnableQtyIncrements() && $stockItem->getQtyIncrements()) { + $weight = $weight * $stockItem->getQtyIncrements(); + } else { + $doValidation = false; + } + } elseif ($stockItem->getIsQtyDecimal() && !$stockItem->getIsDecimalDivided()) { + $weight = $weight * $item->getQty(); + } + + if ($doValidation && $weight > $maxAllowedWeight) { $errorMsg = ($configErrorMsg) ? $configErrorMsg : $defaultErrorMsg; break; } } } - if (!$errorMsg && !$request->getDestPostcode() && $this->isZipCodeRequired()) { + if (!$errorMsg && !$request->getDestPostcode() && $this->isZipCodeRequired($request)) { $errorMsg = Mage::helper('shipping')->__('This shipping method is not available, please specify ZIP-code'); } diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Mode.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Abstract/Source/Mode.php similarity index 78% rename from app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Mode.php rename to app/code/core/Mage/Usa/Model/Shipping/Carrier/Abstract/Source/Mode.php index 6df5ff0422..fa8e70456a 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Mode.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Abstract/Source/Mode.php @@ -20,24 +20,30 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** - * UPS (UPS XML) Modesource model + * Shippers Modesource model * * @category Mage * @package Mage_Usa - * @author Magento Core Team + * @author Magento Core Team */ -class Mage_Usa_Model_Shipping_Carrier_Ups_Source_Mode + +class Mage_Usa_Model_Shipping_Carrier_Abstract_Source_Mode { + /** + * Returns array to be used in packages request type on back-end + * + * @return array + */ public function toOptionArray() { return array( - array('value' => '1', 'label' => Mage::helper('usa')->__('Live')), array('value' => '0', 'label' => Mage::helper('usa')->__('Development')), + array('value' => '1', 'label' => Mage::helper('usa')->__('Live')), ); } } diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/All.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Abstract/Source/Requesttype.php similarity index 62% rename from app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/All.php rename to app/code/core/Mage/Usa/Model/Shipping/Carrier/Abstract/Source/Requesttype.php index 3d6b0bdf12..9902631fdb 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/All.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Abstract/Source/Requesttype.php @@ -19,28 +19,30 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage - * @package Mage_Core - * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com) + * @package Mage_Usa + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** - * Source model for DHL shipping methods for documentation + * Source model for Shippers Request Type * * @category Mage * @package Mage_Usa * @author Magento Core Team */ -class Mage_Usa_Model_Shipping_Carrier_Dhl_International_Source_Method_All +class Mage_Usa_Model_Shipping_Carrier_Abstract_Source_Requesttype { + /** + * Returns array to be used in packages request type on back-end + * + * @return array + */ public function toOptionArray() { - /* @var $dhl Mage_Usa_Model_Shipping_Carrier_Dhl_International */ - $dhl = Mage::getModel('usa/shipping_carrier_dhl_international'); - $options = array(); - foreach ($dhl->getDhlProducts(Mage_Usa_Model_Shipping_Carrier_Dhl_International::DOC_EVERYTHING) as $k => $v) { - $options[] = array('value' => $k, 'label' => $v); - } - return $options; + return array( + array('value' => 0, 'label' => Mage::helper('shipping')->__('Divide to equal weight (one request)')), + array('value' => 1, 'label' => Mage::helper('shipping')->__('Use origin weight (few requests)')), + ); } } diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl.php index 72f9b1c07f..ed20e08cbf 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International.php index 24456206b8..dc49ba2328 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -41,6 +41,12 @@ class Mage_Usa_Model_Shipping_Carrier_Dhl_International const DHL_CONTENT_TYPE_DOC = 'D'; const DHL_CONTENT_TYPE_NON_DOC = 'N'; + /** + * Minimum allowed values for shipping package dimensions + */ + const DIMENSION_MIN_CM = 3; + const DIMENSION_MIN_IN = 1; + /** * Container types that could be customized * @@ -123,6 +129,13 @@ class Mage_Usa_Model_Shipping_Carrier_Dhl_International */ protected $_maxWeight = 70; + /** + * Flag if response is for shipping label creating + * + * @var bool + */ + protected $_isShippingLabelFlag = false; + /** * Request variables array * @@ -409,9 +422,9 @@ public function getCode($type, $code = '') 'C' => Mage::helper('usa')->__('cm'), ), 'dimensions' => array( - 'height' => Mage::helper('usa')->__('Height'), - 'depth' => Mage::helper('usa')->__('Depth'), - 'width' => Mage::helper('usa')->__('Width'), + 'HEIGHT' => Mage::helper('usa')->__('Height'), + 'DEPTH' => Mage::helper('usa')->__('Depth'), + 'WIDTH' => Mage::helper('usa')->__('Width'), ), 'size' => array( '0' => Mage::helper('usa')->__('Regular'), @@ -440,6 +453,7 @@ public function getCode($type, $code = '') return $codes[$type]; } + $code = strtoupper($code); if (!isset($codes[$type][$code])) { return false; } else { @@ -517,30 +531,27 @@ public function getDhlProductTitle($code) * * @param float $weight * @param bool $maxWeight + * @param string|bool $configWeightUnit * @return float */ - protected function _getWeight($weight, $maxWeight = false) + protected function _getWeight($weight, $maxWeight = false, $configWeightUnit = false) { if ($maxWeight) { $configWeightUnit = Zend_Measure_Weight::KILOGRAM; + } elseif ($configWeightUnit) { + $configWeightUnit = $this->getCode('dimensions_variables', $configWeightUnit); } else { - $configWeightUnit = $this->getCode( - 'dimensions_variables', - strtoupper((string)$this->getConfigData('unit_of_measure')) - ); + $configWeightUnit = $this->getCode('dimensions_variables', (string)$this->getConfigData('unit_of_measure')); } - $countryWeightUnit = $this->getCode( - 'dimensions_variables', - strtoupper($this->_getWeightUnit()) - ); + $countryWeightUnit = $this->getCode('dimensions_variables', $this->_getWeightUnit()); if ($configWeightUnit != $countryWeightUnit) { - $weight = round(Mage::helper('usa')->convertMeasureWeight( - $weight, + $weight = Mage::helper('usa')->convertMeasureWeight( + round($weight,3), $configWeightUnit, $countryWeightUnit - ), 3); + ); } return round($weight, 3); @@ -563,7 +574,10 @@ protected function _getAllItems() continue; } - $qty = $item->getQty(); + $qty = $item->getQty(); + $changeQty = true; + $checkWeight = true; + $decimalItems = array(); if ($item->getParentItem()) { if (!$item->getParentItem()->getProduct()->getShipmentType()) { @@ -576,19 +590,51 @@ protected function _getAllItems() $itemWeight = $item->getWeight(); if ($item->getIsQtyDecimal() && $item->getProductType() != Mage_Catalog_Model_Product_Type::TYPE_BUNDLE) { - $itemWeight = $itemWeight * $item->getQty(); + $stockItem = $item->getProduct()->getStockItem(); + if ($stockItem->getIsDecimalDivided()) { + if ($stockItem->getEnableQtyIncrements() && $stockItem->getQtyIncrements()) { + $itemWeight = $itemWeight * $stockItem->getQtyIncrements(); + $qty = round(($item->getWeight() / $itemWeight) * $qty); + $changeQty = false; + } else { + $itemWeight = $this->_getWeight($itemWeight * $item->getQty()); + $maxWeight = $this->_getWeight($this->_maxWeight, true); + if ($itemWeight > $maxWeight) { + $qtyItem = floor($itemWeight / $maxWeight); + $decimalItems[] = array('weight' => $maxWeight, 'qty' => $qtyItem); + $weightItem = Mage::helper('core')->getExactDivision($itemWeight, $maxWeight); + if ($weightItem) { + $decimalItems[] = array('weight' => $weightItem, 'qty' => 1); + } + $checkWeight = false; + } else { + $itemWeight = $itemWeight * $item->getQty(); + } + } + } else { + $itemWeight = $itemWeight * $item->getQty(); + } } - if ($this->_getWeight($itemWeight) > $this->_getWeight($this->_maxWeight, true)) { + if ($checkWeight && $this->_getWeight($itemWeight) > $this->_getWeight($this->_maxWeight, true)) { return array(); } - if (!$item->getParentItem() && $item->getIsQtyDecimal() + if ($changeQty && !$item->getParentItem() && $item->getIsQtyDecimal() && $item->getProductType() != Mage_Catalog_Model_Product_Type::TYPE_BUNDLE ) { $qty = 1; } - $fullItems = array_merge($fullItems, array_fill(0, $qty, $this->_getWeight($itemWeight))); + + if (!empty($decimalItems)) { + foreach ($decimalItems as $decimalItem) { + $fullItems = array_merge($fullItems, + array_fill(0, $decimalItem['qty'] * $qty, $decimalItem['weight']) + ); + } + } else { + $fullItems = array_merge($fullItems, array_fill(0, $qty, $this->_getWeight($itemWeight))); + } } sort($fullItems); @@ -670,33 +716,31 @@ protected function _makePieces(SimpleXMLElement $nodeBkgDetails) * Convert item dimension to needed dimension based on config dimension unit of measure * * @param float $dimension + * @param string|bool $configWeightUnit * @return float */ - protected function _getDimension($dimension) + protected function _getDimension($dimension, $configWeightUnit = false) { - $configWeightUnit = $this->getCode( - 'dimensions_variables', - strtoupper((string)$this->getConfigData('unit_of_measure')) - ); + if (!$configWeightUnit) { + $configWeightUnit = $this->getCode('dimensions_variables', (string)$this->getConfigData('unit_of_measure')); + } else { + $configWeightUnit = $this->getCode('dimensions_variables', $configWeightUnit); + } if ($configWeightUnit == Zend_Measure_Weight::POUND) { - $configWeightUnit = Zend_Measure_Length::INCH; + $configDimensionUnit = Zend_Measure_Length::INCH; } else { - $configWeightUnit = Zend_Measure_Length::CENTIMETER; + $configDimensionUnit = Zend_Measure_Length::CENTIMETER; } + $countryDimensionUnit = $this->getCode('dimensions_variables', $this->_getDimensionUnit()); - $countryDimensionUnit = $this->getCode( - 'dimensions_variables', - strtoupper($this->_getDimensionUnit()) - ); - - if ($configWeightUnit != $countryDimensionUnit) { - $dimension = round(Mage::helper('usa')->convertMeasureDimension( - $dimension, - $configWeightUnit, + if ($configDimensionUnit != $countryDimensionUnit) { + $dimension = Mage::helper('usa')->convertMeasureDimension( + round($dimension, 3), + $configDimensionUnit, $countryDimensionUnit - ), 3); + ); } return round($dimension, 3); @@ -772,7 +816,7 @@ protected function _getQuotes() $nodeDutiable = $nodeGetQuote->addChild('Dutiable'); $baseCurrencyCode = Mage::app()->getWebsite($this->_request->getWebsiteId())->getBaseCurrencyCode(); $nodeDutiable->addChild('DeclaredCurrency', $baseCurrencyCode); - $nodeDutiable->addChild('DeclaredValue', $rawRequest->getValue()); + $nodeDutiable->addChild('DeclaredValue', sprintf("%.2F", $rawRequest->getValue())); } $request = $xml->asXML(); @@ -810,22 +854,37 @@ protected function _parseResponse($response) unset($htmlTranslationTable['<'], $htmlTranslationTable['>'], $htmlTranslationTable['"']); $response = str_replace(array_keys($htmlTranslationTable), array_values($htmlTranslationTable), $response); + $responseError = Mage::helper('usa')->__('The response is in wrong format.'); + if (strlen(trim($response)) > 0) { if (strpos(trim($response), 'Response->Status->ActionStatus) && $xml->Response->Status->ActionStatus == 'Error') - || (isset($xml->GetQuoteResponse->Note->Condition)) + if (in_array($xml->getName(), array('ErrorResponse', 'ShipmentValidateErrorResponse')) + || isset($xml->GetQuoteResponse->Note->Condition) ) { + $code = null; + $data = null; if (isset($xml->Response->Status->Condition)) { $nodeCondition = $xml->Response->Status->Condition; } else { $nodeCondition = $xml->GetQuoteResponse->Note->Condition; } + if ($this->_isShippingLabelFlag) { + foreach ($nodeCondition as $condition) { + $code = isset($condition->ConditionCode) ? (string)$condition->ConditionCode : 0; + $data = isset($condition->ConditionData) ? (string)$condition->ConditionData : ''; + if (!empty($code) && !empty($data)) { + break; + } + } + Mage::throwException(Mage::helper('usa')->__('Error #%s : %s', trim($code), trim($data))); + } + $code = isset($nodeCondition->ConditionCode) ? (string)$nodeCondition->ConditionCode : 0; $data = isset($nodeCondition->ConditionData) ? (string)$nodeCondition->ConditionData : ''; - $this->_errors[$code] = Mage::helper('usa')->__('Error #%s : %s', $code, $data); + $this->_errors[$code] = Mage::helper('usa')->__('Error #%s : %s', trim($code), trim($data)); } else { if (isset($xml->GetQuoteResponse->BkgDetails->QtdShp)) { foreach ($xml->GetQuoteResponse->BkgDetails->QtdShp as $quotedShipment) { @@ -834,16 +893,24 @@ protected function _parseResponse($response) } elseif (isset($xml->AirwayBillNumber)) { $result = new Varien_Object(); $result->setTrackingNumber((string)$xml->AirwayBillNumber); - $result->setShippingLabelContent(base64_decode((string)$xml->Barcodes->OriginDestnBarcode)); + try { + /* @var $pdf Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf */ + $pdf = Mage::getModel('usa/shipping_carrier_dhl_label_pdf', array('info' => $xml)); + $result->setShippingLabelContent($pdf->render()); + } catch (Exception $e) { + Mage::throwException(Mage::helper('usa')->__($e->getMessage())); + } return $result; } else { - $this->_errors[] = Mage::helper('usa')->__('The response is in wrong format.'); + $this->_errors[] = $responseError; } } } } else { - $this->_errors[] = Mage::helper('usa')->__('The response is in wrong format.'); + $this->_errors[] = $responseError; } + } else { + $this->_errors[] = $responseError; } /* @var $result Mage_Shipping_Model_Rate_Result */ @@ -863,7 +930,10 @@ protected function _parseResponse($response) $result->append($rate); } } else if (!empty($this->_errors)) { - return $this->_showError(); + if ($this->_isShippingLabelFlag) { + Mage::throwException($responseError); + } + return $this->_showError(); } return $result; } @@ -1064,16 +1134,53 @@ public function getContainerTypes(Varien_Object $params = null) */ protected function _mapRequestToShipment(Varien_Object $request) { - $customsValue = $request->getPackageParams()->getCustomsValue(); - - $request->getLimitMethod($request->getShippingMethod()); - $request->getPackageValue($customsValue); - $request->getValueWithDiscount($customsValue); - $request->getPackageCustomsValue($customsValue); - $request->getFreeMethodWeight(0); - $request->getDhlShipmentType($request->getPackagingType()); + + $request->setOrigCountryId($request->getShipperAddressCountryCode()); + $this->_rawRequest = $request; + $customsValue = 0; + $packageWeight = 0; + $packages = $request->getPackages(); + foreach ($packages as &$piece) { + $params = $piece['params']; + if ($params['width'] || $params['length'] || $params['height']) { + $minValue = $this->_getMinDimension($params['dimension_units']); + if ($params['width'] < $minValue || $params['length'] < $minValue || $params['height'] < $minValue) { + $message = Mage::helper('usa')->__('Height, width and length should be equal or greater than %s', $minValue); + Mage::throwException($message); + } + } + + $weightUnits = $piece['params']['weight_units']; + $piece['params']['height'] = $this->_getDimension($piece['params']['height'], $weightUnits); + $piece['params']['length'] = $this->_getDimension($piece['params']['length'], $weightUnits); + $piece['params']['width'] = $this->_getDimension($piece['params']['width'], $weightUnits); + $piece['params']['dimension_units'] = $this->_getDimensionUnit(); + $piece['params']['weight'] = $this->_getWeight($piece['params']['weight'], false, $weightUnits); + $piece['params']['weight_units'] = $this->_getWeightUnit(); + + $customsValue += $piece['params']['customs_value']; + $packageWeight += $piece['params']['weight']; + } + + $request->setPackages($packages) + ->setPackageWeight($packageWeight) + ->setPackageValue($customsValue) + ->setValueWithDiscount($customsValue) + ->setPackageCustomsValue($customsValue) + ->setFreeMethodWeight(0); } + /** + * Retrieve minimum allowed value for dimensions in given dimension unit + * + * @param string $dimensionUnit + * @return int + */ + protected function _getMinDimension($dimensionUnit) + { + return $dimensionUnit == "CENTIMETER" ? self::DIMENSION_MIN_CM : self::DIMENSION_MIN_IN; + } + /** * Do rate request and handle errors * @@ -1108,6 +1215,10 @@ protected function _doRequest() $nodeServiceHeader->addChild('SiteID', (string)$this->getConfigData('id')); $nodeServiceHeader->addChild('Password', (string)$this->getConfigData('password')); + if (!$originRegion) { + $xml->addChild('RequestedPickupTime', 'N', ''); + } + $xml->addChild('NewShipper', 'N', ''); $xml->addChild('LanguageCode', 'EN', ''); $xml->addChild('PiecesEnabled', 'Y', ''); @@ -1125,9 +1236,9 @@ protected function _doRequest() /* * Shipment bill to account – required if Shipping PaymentType is other than 'S' */ - //$nodeBilling->addChild('BillingAccountNumber', (string)$this->getConfigData('password')); - //$nodeBilling->addChild('DutyPaymentType', ''); - //$nodeBilling->addChild('DutyAccountNumber', ''); + $nodeBilling->addChild('BillingAccountNumber', (string)$this->getConfigData('account')); + $nodeBilling->addChild('DutyPaymentType', 'S'); + $nodeBilling->addChild('DutyAccountNumber', (string)$this->getConfigData('account')); /* Receiver */ $nodeConsignee = $xml->addChild('Consignee', '', ''); @@ -1139,10 +1250,10 @@ protected function _doRequest() $nodeConsignee->addChild('CompanyName', substr($companyName, 0, 35)); $address = $rawRequest->getRecipientAddressStreet1(). ' ' . $rawRequest->getRecipientAddressStreet2(); - $addressLength = strlen($address); - if ($addressLength > 35) { - for ($i = 0; $i < $addressLength; $i += 35) { - $nodeConsignee->addChild('AddressLine', substr($address, $i, 35)); + $address = Mage::helper('core/string')->str_split($address, 35, false, true); + if (is_array($address)) { + foreach ($address as $addressLine) { + $nodeConsignee->addChild('AddressLine', $addressLine); } } else { $nodeConsignee->addChild('AddressLine', $address); @@ -1159,8 +1270,7 @@ protected function _doRequest() $nodeContact->addChild('PersonName', substr($rawRequest->getRecipientContactPersonName(), 0, 34)); $nodeContact->addChild('PhoneNumber', substr($rawRequest->getRecipientContactPhoneNumber(), 0, 24)); - /* Commodity */ - /* + /* Commodity * The CommodityCode element contains commodity code for shipment contents. Its * value should lie in between 1 to 9999.This field is mandatory. */ @@ -1171,14 +1281,13 @@ protected function _doRequest() if ($this->getConfigData('content_type') == self::DHL_CONTENT_TYPE_NON_DOC) { $nodeDutiable = $xml->addChild('Dutiable', '', ''); $nodeDutiable->addChild('DeclaredValue', - round($rawRequest->getOrderShipment()->getOrder()->getSubtotal(), 2) + sprintf("%.2F", $rawRequest->getOrderShipment()->getOrder()->getSubtotal()) ); $baseCurrencyCode = Mage::app()->getWebsite($rawRequest->getWebsiteId())->getBaseCurrencyCode(); $nodeDutiable->addChild('DeclaredCurrency', $baseCurrencyCode); } - /* Reference */ - /* + /* Reference * This element identifies the reference information. It is an optional field in the * shipment validation request. Only the first reference will be taken currently. */ @@ -1187,72 +1296,19 @@ protected function _doRequest() $nodeReference->addChild('ReferenceType', 'St'); /* Shipment Details */ - $nodeShipmentDetails = $xml->addChild('ShipmentDetails', '', ''); - $nodeShipmentDetails->addChild('NumberOfPieces', count($rawRequest->getPackages())); - $nodeShipmentDetails->addChild('CurrencyCode', - Mage::app()->getWebsite($this->_request->getWebsiteId())->getBaseCurrencyCode() - ); - $nodePieces = $nodeShipmentDetails->addChild('Pieces', '', ''); - - /* - * Package type - * EE (DHL Express Envelope), OD (Other DHL Packaging), CP (Custom Packaging) - * DC (Document), DM (Domestic), ED (Express Document), FR (Freight) - * BD (Jumbo Document), BP (Jumbo Parcel), JD (Jumbo Junior Document) - * JP (Jumbo Junior Parcel), PA (Parcel), DF (DHL Flyer) - */ - foreach ($rawRequest->getPackages() as $package) { - $nodePiece = $nodePieces->addChild('Piece', '', ''); - $packageType = 'DC'; - if ($package['params']['container'] == self::DHL_CONTENT_TYPE_NON_DOC) { - $packageType = 'CP'; - } - //$niodePiece->addChild('PieceID', ''); - $nodePiece->addChild('PackageType', $packageType); - $nodePiece->addChild('Weight', $package['params']['weight']); - $nodePiece->addChild('Depth', $package['params']['length']); - $nodePiece->addChild('Width', $package['params']['width']); - $nodePiece->addChild('Height', $package['params']['height']); - } - - if ($package['params']['container'] == self::DHL_CONTENT_TYPE_NON_DOC) { - $packageType = 'CP'; - } - $nodeShipmentDetails->addChild('PackageType', $packageType); - $nodeShipmentDetails->addChild('Weight', $rawRequest->getPackageWeight()); - - $dimensionUnit = $rawRequest->getPackageParams()->getDimensionUnits(); - $weightUnits = $rawRequest->getPackageParams()->getWeightUnits(); - - $nodeShipmentDetails->addChild('DimensionUnit', $dimensionUnit[0]); - $nodeShipmentDetails->addChild('WeightUnit', $weightUnits[0]); - - $nodeShipmentDetails->addChild('GlobalProductCode', $rawRequest->getShippingMethod()); - $nodeShipmentDetails->addChild('LocalProductCode', $rawRequest->getShippingMethod()); - - /* - * The DoorTo Element defines the type of delivery service that applies to the shipment. - * The valid values are DD (Door to Door), DA (Door to Airport) , AA and DC (Door to - * Door non-compliant) - */ - $nodeShipmentDetails->addChild('DoorTo', 'DD'); - $nodeShipmentDetails->addChild('Date', Mage::getModel('core/date')->date('Y-m-d')); - $nodeShipmentDetails->addChild('Contents', 'DHL Parcel TEST'); - if ($this->getConfigData('content_type') == self::DHL_CONTENT_TYPE_NON_DOC) { - $nodeShipmentDetails->addChild('IsDutiable', 'Y'); - } + $this->_shipmentDetails($xml, $rawRequest, $originRegion); /* Shipper */ $nodeShipper = $xml->addChild('Shipper', '', ''); $nodeShipper->addChild('ShipperID', (string)$this->getConfigData('account')); $nodeShipper->addChild('CompanyName', $rawRequest->getShipperContactCompanyName()); - //$nodeShipper->addChild('RegisteredAccount', ''); + $nodeShipper->addChild('RegisteredAccount', (string)$this->getConfigData('account')); $address = $rawRequest->getShipperAddressStreet1(). ' ' . $rawRequest->getShipperAddressStreet2(); - $addressLength = strlen($address); - if ($addressLength > 35) { - for ($i = 0; $i < $addressLength; $i += 35) { - $nodeShipper->addChild('AddressLine', substr($address, $i, 35)); + $address = Mage::helper('core/string')->str_split($address, 35, false, true); + if (is_array($address)) { + foreach ($address as $addressLine) { + $nodeShipper->addChild('AddressLine', $addressLine); } } else { $nodeShipper->addChild('AddressLine', $address); @@ -1271,6 +1327,7 @@ protected function _doRequest() $request = $xml->asXML(); $request = utf8_encode($request); + $responseBody = $this->_getCachedQuotes($request); if ($responseBody === null) { $debugData = array('request' => $request); @@ -1288,10 +1345,118 @@ protected function _doRequest() } $this->_debug($debugData); } - + $this->_isShippingLabelFlag = true; return $this->_parseResponse($responseBody); } + /** + * Generation Shipment Details Node according to origin region + * + * @param SimpleXMLElement $xml + * @param Mage_Shipping_Model_Rate_Request $rawRequest + * @param string $originRegion + * @return void + */ + protected function _shipmentDetails($xml, $rawRequest, $originRegion = '') + { + $nodeShipmentDetails = $xml->addChild('ShipmentDetails', '', ''); + $nodeShipmentDetails->addChild('NumberOfPieces', count($rawRequest->getPackages())); + + if ($originRegion) { + $nodeShipmentDetails->addChild('CurrencyCode', + Mage::app()->getWebsite($this->_request->getWebsiteId())->getBaseCurrencyCode() + ); + } + + $nodePieces = $nodeShipmentDetails->addChild('Pieces', '', ''); + + /* + * Package type + * EE (DHL Express Envelope), OD (Other DHL Packaging), CP (Custom Packaging) + * DC (Document), DM (Domestic), ED (Express Document), FR (Freight) + * BD (Jumbo Document), BP (Jumbo Parcel), JD (Jumbo Junior Document) + * JP (Jumbo Junior Parcel), PA (Parcel), DF (DHL Flyer) + */ + $i = 0; + foreach ($rawRequest->getPackages() as $package) { + $nodePiece = $nodePieces->addChild('Piece', '', ''); + $packageType = 'DC'; + if ($package['params']['container'] == self::DHL_CONTENT_TYPE_NON_DOC) { + $packageType = 'CP'; + } + $nodePiece->addChild('PieceID', ++$i); + $nodePiece->addChild('PackageType', $packageType); + $nodePiece->addChild('Weight', round($package['params']['weight'],1)); + $params = $package['params']; + if ($params['width'] && $params['length'] && $params['height']) { + if (!$originRegion) { + $nodePiece->addChild('Width', round($params['width'])); + $nodePiece->addChild('Height', round($params['height'])); + $nodePiece->addChild('Depth', round($params['length'])); + } else { + $nodePiece->addChild('Depth', round($params['length'])); + $nodePiece->addChild('Width', round($params['width'])); + $nodePiece->addChild('Height', round($params['height'])); + } + } + $content = array(); + foreach ($package['items'] as $item) { + $content[] = $item['name']; + } + $nodePiece->addChild('PieceContents', substr(implode(',', $content), 0, 34)); + } + + if (!$originRegion) { + $nodeShipmentDetails->addChild('Weight', round($rawRequest->getPackageWeight(),1)); + + $nodeShipmentDetails->addChild('WeightUnit', substr($this->_getWeightUnit(),0,1)); + + $nodeShipmentDetails->addChild('GlobalProductCode', $rawRequest->getShippingMethod()); + $nodeShipmentDetails->addChild('LocalProductCode', $rawRequest->getShippingMethod()); + + $nodeShipmentDetails->addChild('Date', Mage::getModel('core/date')->date('Y-m-d')); + $nodeShipmentDetails->addChild('Contents', 'DHL Parcel TEST'); + /* + * The DoorTo Element defines the type of delivery service that applies to the shipment. + * The valid values are DD (Door to Door), DA (Door to Airport) , AA and DC (Door to + * Door non-compliant) + */ + $nodeShipmentDetails->addChild('DoorTo', 'DD'); + $nodeShipmentDetails->addChild('DimensionUnit', substr($this->_getDimensionUnit(),0,1)); + if ($package['params']['container'] == self::DHL_CONTENT_TYPE_NON_DOC) { + $packageType = 'CP'; + } + $nodeShipmentDetails->addChild('PackageType', $packageType); + if ($this->getConfigData('content_type') == self::DHL_CONTENT_TYPE_NON_DOC) { + $nodeShipmentDetails->addChild('IsDutiable', 'Y'); + } + $nodeShipmentDetails->addChild('CurrencyCode', + Mage::app()->getWebsite($this->_request->getWebsiteId())->getBaseCurrencyCode() + ); + } else { + if ($package['params']['container'] == self::DHL_CONTENT_TYPE_NON_DOC) { + $packageType = 'CP'; + } + $nodeShipmentDetails->addChild('PackageType', $packageType); + $nodeShipmentDetails->addChild('Weight', $rawRequest->getPackageWeight()); + + $nodeShipmentDetails->addChild('DimensionUnit', substr($this->_getDimensionUnit(),0,1)); + $nodeShipmentDetails->addChild('WeightUnit', substr($this->_getWeightUnit(),0,1)); + + $nodeShipmentDetails->addChild('GlobalProductCode', $rawRequest->getShippingMethod()); + $nodeShipmentDetails->addChild('LocalProductCode', $rawRequest->getShippingMethod()); + + /* + * The DoorTo Element defines the type of delivery service that applies to the shipment. + * The valid values are DD (Door to Door), DA (Door to Airport) , AA and DC (Door to + * Door non-compliant) + */ + $nodeShipmentDetails->addChild('DoorTo', 'DD'); + $nodeShipmentDetails->addChild('Date', Mage::getModel('core/date')->date('Y-m-d')); + $nodeShipmentDetails->addChild('Contents', 'DHL Parcel TEST'); + } + } + /** * Get tracking * @@ -1487,4 +1652,30 @@ protected function _getPerpackagePrice($cost, $handlingType, $handlingFee) return $cost + $this->_numBoxes * $handlingFee; } + + /** + * Do request to shipment + * + * @param Mage_Shipping_Model_Shipment_Request $request + * @return Varien_Object + */ + public function requestToShipment(Mage_Shipping_Model_Shipment_Request $request) + { + $packages = $request->getPackages(); + if (!is_array($packages) || !$packages) { + Mage::throwException(Mage::helper('usa')->__('No packages for request')); + } + $result = $this->_doShipmentRequest($request); + + $response = new Varien_Object(array( + 'info' => array(array( + 'tracking_number' => $result->getTrackingNumber(), + 'label_content' => $result->getShippingLabelContent() + )) + )); + + $request->setMasterTrackingId($result->getTrackingNumber()); + + return $response; + } } diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Contenttype.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Contenttype.php index 755a1c0f64..34e1d57ddb 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Contenttype.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Contenttype.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Abstract.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Abstract.php index 3b2939e7b3..8df6118564 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Abstract.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Doc.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Doc.php index e27c6b0842..a3205c50e8 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Doc.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Doc.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Freedoc.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Freedoc.php index 8e190f334f..6e74cde1be 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Freedoc.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Freedoc.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Freenondoc.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Freenondoc.php index d01a2ef9a8..c824a26feb 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Freenondoc.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Freenondoc.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Nondoc.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Nondoc.php index 784098a290..a5c3a3ab60 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Nondoc.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Nondoc.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Size.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Size.php index a2f08177e1..ae8735a353 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Size.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Size.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Unitofmeasure.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Unitofmeasure.php index 218feb7f64..8d0763aac1 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Unitofmeasure.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Unitofmeasure.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf.php new file mode 100644 index 0000000000..f4582b44bc --- /dev/null +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf.php @@ -0,0 +1,104 @@ + + */ +class Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf +{ + /** + * @var SimpleXMLElement + */ + protected $_info; + + /** + * Dhl International Label Creation Class constructor + * + * @param array $arguments + */ + public function __construct(array $arguments) + { + $this->_info = $arguments['info']; + } + + /** + * Create Label + * + * @return string + * @throws Zend_Pdf_Exception + * @throws InvalidArgumentException + */ + public function render() + { + $pdf = new Zend_Pdf(); + + $pdfBuilder = new Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_PageBuilder(); + + $template = new Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_Page(Zend_Pdf_Page::SIZE_A4_LANDSCAPE); + $pdfBuilder->setPage($template) + ->addProductName((string)$this->_info->ProductShortName) + ->addProductContentCode((string)$this->_info->ProductContentCode) + //->addUnitId({unitId}) + //->addReferenceData({referenceData}) + ->addSenderInfo($this->_info->Shipper) + ->addOriginInfo((string)$this->_info->OriginServiceArea->ServiceAreaCode) + ->addReceiveInfo($this->_info->Consignee) + ->addDestinationFacilityCode( + (string)$this->_info->Consignee->CountryCode, + (string)$this->_info->DestinationServiceArea->ServiceAreaCode, + (string)$this->_info->DestinationServiceArea->FacilityCode + ) + ->addServiceFeaturesCodes() + ->addDeliveryDateCode() + ->addShipmentInformation() + ->addDateInfo($this->_info->ShipmentDate) + ->addWeightInfo((string)$this->_info->ChargeableWeight, (string)$this->_info->WeightUnit) + ->addWaybillBarcode((string)$this->_info->AirwayBillNumber, (string)$this->_info->Barcodes->AWBBarCode) + ->addRoutingBarcode( + (string)$this->_info->DHLRoutingCode, + (string)$this->_info->DHLRoutingDataId, + (string)$this->_info->Barcodes->DHLRoutingBarCode + ) + ->addBorder(); + + foreach ($this->_info->Pieces->Piece as $piece) { + $page = new Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_Page($template); + $pdfBuilder->setPage($page) + ->addPieceNumber((int)$piece->PieceNumber, (int)$this->_info->Piece) + ->addPieceIdBarcode( + (string)$piece->DataIdentifier, + (string)$piece->LicensePlate, + (string)$piece->LicensePlateBarCode + ); + array_push($pdf->pages, $page); + } + return $pdf->render(); + } +} diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf/Page.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf/Page.php new file mode 100644 index 0000000000..d1b5dea011 --- /dev/null +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf/Page.php @@ -0,0 +1,150 @@ + + */ +class Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_Page extends Zend_Pdf_Page +{ + /** + * Text align constants + */ + const ALIGN_RIGHT = 'right'; + const ALIGN_LEFT = 'left'; + const ALIGN_CENTER = 'center'; + + /** + * Dhl International Label Creation Class Pdf Page constructor + * Create/Make a copy of pdf page + * + * @param Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_Page|string $param1 + * @param null $param2 + * @param null $param3 + */ + public function __construct($param1, $param2 = null, $param3 = null) + { + if ($param1 instanceof Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_Page + && $param2 === null && $param3 === null + ) { + $this->_contents = $param1->getContents(); + } + parent::__construct($param1, $param2, $param3); + } + + /** + * Get PDF Page contents + * + * @return string + */ + public function getContents() + { + return $this->_contents; + } + + /** + * Calculate the width of given text in points taking into account current font and font-size + * + * @param string $text + * @param Zend_Pdf_Resource_Font $font + * @param float $font_size + * @return float + */ + public function getTextWidth($text, Zend_Pdf_Resource_Font $font, $font_size) + { + $drawing_text = iconv('', 'UTF-16BE', $text); + $characters = array(); + for ($i = 0; $i < strlen($drawing_text); $i++) { + $characters[] = (ord($drawing_text[$i++]) << 8) | ord($drawing_text[$i]); + } + $glyphs = $font->glyphNumbersForCharacters($characters); + $widths = $font->widthsForGlyphs($glyphs); + $text_width = (array_sum($widths) / $font->getUnitsPerEm()) * $font_size; + return $text_width; + } + + /** + * Draw a line of text at the specified position. + * + * @param string $text + * @param float $x + * @param float $y + * @param string $charEncoding (optional) Character encoding of source text. + * Defaults to current locale. + * @param $align + * @throws Zend_Pdf_Exception + * @return Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_Page + */ + public function drawText($text, $x, $y, $charEncoding = '', $align = self::ALIGN_LEFT) + { + $left = null; + switch ($align) { + case self::ALIGN_LEFT: + $left = $x; + break; + + case self::ALIGN_CENTER: + $textWidth = $this->getTextWidth($text, $this->getFont(), $this->getFontSize()); + $left = $x - ($textWidth / 2); + break; + + case self::ALIGN_RIGHT: + $textWidth = $this->getTextWidth($text, $this->getFont(), $this->getFontSize()); + $left = $x - $textWidth; + break; + } + return parent::drawText($text, $left, $y, $charEncoding); + } + + /** + * Draw a text paragraph taking into account the maximum number of symbols in a row. + * If line is longer - spit it. + * + * @param array $lines + * @param int $x + * @param int $y + * @param int $maxWidth - number of symbols + * @param string $align + * @throws Zend_Pdf_Exception + * @return float + */ + public function drawLines($lines, $x, $y, $maxWidth, $align = self::ALIGN_LEFT) + { + foreach ($lines as $line) { + if (strlen($line) > $maxWidth) { + $subLines = Mage::helper('core/string')->str_split($line, $maxWidth, true, true); + $y = $this->drawLines(array_filter($subLines), $x, $y, $maxWidth, $align); + continue; + } + $this->drawText($line, $x, $y, null, $align); + $y -= ceil($this->getFontSize()); + } + return $y; + } +} diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf/PageBuilder.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf/PageBuilder.php new file mode 100644 index 0000000000..de9ca8bf1c --- /dev/null +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf/PageBuilder.php @@ -0,0 +1,625 @@ + + */ +class Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_PageBuilder +{ + /** + * X coordinate of a block + */ + const X_INDENT = 60; + + /** + * Y coordinate of a block + */ + const Y_INDENT = 15; + + /** + * Pdf Page Instance + * + * @var Zend_Pdf_Page + */ + protected $_page; + + /** + * Create font instances + */ + public function __construct() + { + $this->_fontNormal = Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA); + $this->_fontBold = Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA_BOLD); + } + + /** + * Get Page + * + * @return Zend_Pdf_Page + */ + public function getPage() + { + return $this->_page; + } + + /** + * Set Page + * + * @param Zend_Pdf_Page $page + * @return Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_PageBuilder + */ + public function setPage(Zend_Pdf_Page $page) + { + $this->_page = $page; + return $this; + } + + /** + * Calculate x coordinate with identation + * + * @param int $pt + * @return int + */ + protected function _x($pt) + { + return $pt + self::X_INDENT; + } + + /** + * Calculate y coordinate with identation + * + * @param int $pt + * @return int + */ + protected function _y($pt) + { + return 595 - self::Y_INDENT - $pt; + } + + /** + * Add Border + * + * @return Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_Page + * @throws Zend_Pdf_Exception + */ + public function addBorder() + { + $x = $this->_x(0); + $y = $this->_y(0); + + $image = new Zend_Pdf_Resource_Image_Jpeg(Mage::getBaseDir('media') . DS . 'dhl' . DS . 'logo.jpg'); + $this->_page->drawImage($image, $x + 191, $this->_y(27), $x + 287, $this->_y(1)); + + /* Vertical borders */ + $this->_page->drawLine($x, $y, $x, $this->_y(568)); + $this->_page->drawLine($x + 287.5, $y, $x + 287.5, $this->_y(568)); + $this->_page->drawLine($x + 139.5, $y, $x + 139.5, $this->_y(28)); + $this->_page->drawLine($x + 190.5, $y, $x + 190.5, $this->_y(28)); + + /* Horisontal borders */ + $this->_page->drawLine($x, $y, $x + 288, $y); + $this->_page->drawLine($x, $this->_y(28), $x + 288, $this->_y(28)); + $this->_page->drawLine($x, $this->_y(80.5), $x + 288, $this->_y(80.5)); + $this->_page->drawLine($x, $this->_y(164), $x + 288, $this->_y(164)); + $this->_page->drawLine($x, $this->_y(194), $x + 288, $this->_y(194)); + $this->_page->drawLine($x, $this->_y(217.5), $x + 288, $this->_y(217.5)); + $this->_page->drawLine($x, $this->_y(245.5), $x + 288, $this->_y(245.5)); + $this->_page->drawLine($x, $this->_y(568.5), $x + 288, $this->_y(568.5)); + + $this->_page->setLineWidth(0.3); + $x = $this->_x(3); + $y = $this->_y(83); + $this->_page->drawLine($x, $y, $x + 10, $y); + $this->_page->drawLine($x, $y, $x, $y - 10); + + $x = $this->_x(3); + $y = $this->_y(161); + $this->_page->drawLine($x, $y, $x + 10, $y); + $this->_page->drawLine($x, $y, $x, $y + 10); + + $x = $this->_x(285); + $y = $this->_y(83); + $this->_page->drawLine($x, $y, $x - 10, $y); + $this->_page->drawLine($x, $y, $x, $y - 10); + + $x = $this->_x(285); + $y = $this->_y(161); + $this->_page->drawLine($x, $y, $x - 10, $y); + $this->_page->drawLine($x, $y, $x, $y + 10); + + return $this; + } + + /** + * Add Product Name + * + * @param string $name + * @return Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_PageBuilder + * @throws InvalidArgumentException + * @throws Zend_Pdf_Exception + */ + public function addProductName($name) + { + $this->_page->saveGS(); + $this->_page->setFont($this->_fontBold, 9); + if (!strlen($name)) { + throw new InvalidArgumentException(Mage::helper('usa')->__('Product name is missing')); + } + $this->_page->drawText($name, $this->_x(8), $this->_y(12)); + $this->_page->restoreGS(); + return $this; + } + + /** + * Add Product Content Code + * + * @param string $code + * @return Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_PageBuilder + * @throws Zend_Pdf_Exception + * @throws InvalidArgumentException + */ + public function addProductContentCode($code) + { + $this->_page->saveGS(); + $codes = array( + 'TDK' => 0, 'TDE' => 1, 'TDL' => 0, 'TDM' => 1, 'TDT' => 0, + 'TDY' => 1, 'XPD' => 0, 'DOX' => 0, 'WPX' => 1, 'DOM' => 0 + ); + if (!key_exists($code, $codes)) { + throw new InvalidArgumentException(Mage::helper('usa')->__('Product content code is invalid')); + } + $font = null; + if ($codes[$code]) { + $this->_page->drawRectangle( + $this->_x(140), + $this->_y(0), + $this->_x(190), + $this->_y(28), + Zend_Pdf_Page::SHAPE_DRAW_FILL + ); + $this->_page->setFillColor(new Zend_Pdf_Color_Html("#ffffff")); + $font = $this->_fontBold; + } else { + $font = $this->_fontNormal; + } + $this->_page->setFont($font, 17); + $this->_page->drawText($code, $this->_x(146), $this->_y(21)); + $this->_page->restoreGS(); + return $this; + } + + /** + * Add Unit Id + * + * @param int $id + * @return Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_Page + * @throws Zend_Pdf_Exception + */ + public function addUnitId($id) + { + $this->_page->saveGS(); + $this->_page->setFont($this->_fontNormal, 6); + + $this->_page->drawText('Unit ID', $this->_x(8), $this->_y(20)); + $this->_page->restoreGS(); + return $this; + } + + /** + * Add Reference Data + * + * @param $data + * @return Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_Page + * @throws Zend_Pdf_Exception + */ + public function addReferenceData($data) + { + $this->_page->saveGS(); + $this->_page->setFont($this->_fontNormal, 6); + $this->_page->drawText('GREF', $this->_x(80), $this->_y(20)); + //TODO: Add reference data rendering + $this->_page->restoreGS(); + return $this; + } + + /** + * Add Sender Info + * + * @param SimpleXMLElement $sender + * @return Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_PageBuilder + * @throws InvalidArgumentException + * @throws Zend_Pdf_Exception + */ + public function addSenderInfo(SimpleXMLElement $sender) + { + $this->_page->saveGS(); + $this->_page->setFont($this->_fontNormal, 6); + $this->_page->drawText('From:', $this->_x(8), $this->_y(36)); + $contactName = implode(' ', array_filter(array((string)$sender->CompanyName, + (string)$sender->Contact->PersonName)) + ); + if (!$contactName) { + throw new InvalidArgumentException(Mage::helper('usa')->__('Sender contact name is missing')); + } + $this->_page->drawText($contactName, $this->_x(25), $this->_y(36)); + + $phoneNumber = implode(' ', array_filter(array((string)$sender->Contact->PhoneNumber, + (string)$sender->Contact->PhoneExtension)) + ); + $phoneNumber = $phoneNumber ? "Phone: " . $phoneNumber : null; + $pageY = $this->_drawSenderAddress($sender->AddressLine, $phoneNumber); + + $divisionCode = (string)(strlen($sender->DivisionCode) ? $sender->DivisionCode . ' ' : null); + $cityInfo = implode(' ', array_filter(array($sender->City, $divisionCode, $sender->PostalCode))); + if (!strlen($cityInfo)) { + throw new InvalidArgumentException(Mage::helper('usa')->__('Sender city info is missing')); + } + $this->_page->drawText($cityInfo, $this->_x(25), $pageY); + + $this->_page->setFont($this->_fontBold, 6); + $countryInfo = (string)(($sender->CountryName) ? $sender->CountryName : $sender->CountryCode); + if (!strlen($countryInfo)) { + throw new InvalidArgumentException(Mage::helper('usa')->__('Sender country info is missing')); + } + $this->_page->drawText($countryInfo, $this->_x(25), $pageY - $this->_page->getFontSize()); + + $this->_page->restoreGS(); + return $this; + } + + /** + * Draw Sender Address + * + * @param SimpleXMLElement $addressLines + * @param string $phoneNumber + * @return float + * @throws Zend_Pdf_Exception + */ + protected function _drawSenderAddress(SimpleXMLElement $addressLines, $phoneNumber) + { + $lines = array(); + foreach ($addressLines as $line) { + $lines [] = $line; + } + + $pageY = 0; + if (strlen($lines[0]) > 28) { + $firstLine = array_shift($lines); + $pageY = $this->_page->drawLines(array($firstLine), $this->_x(25), $this->_y(42), 28); + $this->_page->drawText($phoneNumber, $this->_x(103), $this->_y(42)); + } else { + $pageY = $this->_y(42); + $lineLength = $this->_page->getTextWidth( + $lines[0] . ' ', $this->_page->getFont(), $this->_page->getFontSize() + ); + $this->_page->drawText($phoneNumber, $this->_x(25 + $lineLength), $this->_y(42)); + } + + return $this->_page->drawLines($lines, $this->_x(25), $pageY, 49); + } + + /** + * Add Origin Info + * + * @param string $serviceAreaCode + * @return Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_PageBuilder + * @throws InvalidArgumentException + * @throws Zend_Pdf_Exception + */ + public function addOriginInfo($serviceAreaCode) + { + if (strlen(!$serviceAreaCode)) { + throw new InvalidArgumentException(Mage::helper('usa')->__('Origin serviceAreaCode is missing')); + } + $this->_page->saveGS(); + $this->_page->setFont($this->_fontNormal, 6); + $this->_page->drawText("Origin:", $this->_x(260), $this->_y(36)); + $this->_page->setFont($this->_fontBold, 9); + $this->_page->drawText($serviceAreaCode, $this->_x(260), $this->_y(45)); + + $this->_page->restoreGS(); + return $this; + } + + /** + * Add Receive Info + * + * @param SimpleXMLElement $consignee + * @return Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_PageBuilder + * @throws Zend_Pdf_Exception + */ + public function addReceiveInfo(SimpleXMLElement $consignee) + { + $this->_page->saveGS(); + + $this->_page->setFont($this->_fontNormal, 9); + $this->_page->drawText("To:", $this->_x(5), $this->_y(92)); + $this->_page->drawText($consignee->CompanyName, $this->_x(20), $this->_y(90)); + $y = $this->_page->drawLines($consignee->AddressLine, $this->_x(19), $this->_y(100), 50); + + $this->_page->setFont($this->_fontBold, 11); + $cityInfo = implode(' ', array_filter(array($consignee->PostalCode, $consignee->City, + $consignee->DivisionCode)) + ); + $y = min($y - 3, 460); + $this->_page->drawLines(array($cityInfo, $consignee->CountryName), $this->_x(20), $y, 44); + + $this->_page->setFont($this->_fontNormal, 6); + $this->_page->drawText('Contact:', $this->_x(260), $this->_y(90)); + + $y = $this->_page->drawLines(array($consignee->Contact->PersonName), $this->_x(283), $this->_y(98), 25, + Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_Page::ALIGN_RIGHT + ); + $phoneNumber = implode(' ', array_filter(array($consignee->Contact->PhoneNumber, + $consignee->Contact->PhoneExtension)) + ); + $this->_page->drawText($phoneNumber, $this->_x(283), $y, null, + Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_Page::ALIGN_RIGHT + ); + + $this->_page->restoreGS(); + return $this; + } + + /** + * Add Destination Facility Code + * + * @param string $countryCode + * @param string $serviceAreaCode + * @param string $facilityCode + * @return Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_PageBuilder + * @throws InvalidArgumentException + * @throws Zend_Pdf_Exception + */ + public function addDestinationFacilityCode($countryCode, $serviceAreaCode, $facilityCode) + { + $this->_page->saveGS(); + $this->_page->setFont($this->_fontNormal, 20); + $code = implode('-', array_filter(array($countryCode, $serviceAreaCode, $facilityCode))); + + if (!strlen($code)) { + throw new InvalidArgumentException(Mage::helper('usa')->__('Destination facility code is empty')); + } + $this->_page->drawText($code, $this->_x(144), $this->_y(186), null, + Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_Page::ALIGN_CENTER + ); + + $this->_page->restoreGS(); + return $this; + } + + /** + * Add Service Features Codes + * + * @return Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_PageBuilder + * @throws Zend_Pdf_Exception + */ + public function addServiceFeaturesCodes() + { + $this->_page->saveGS(); + $this->_page->drawRectangle($this->_x(0), $this->_y(195), $this->_x(218), $this->_y(217), + Zend_Pdf_Page::SHAPE_DRAW_FILL + ); + $this->_page->restoreGS(); + return $this; + } + + /** + * Add Delivery Date Code + * + * @return Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_PageBuilder + * @throws Zend_Pdf_Exception + */ + public function addDeliveryDateCode() + { + $this->_page->saveGS(); + + $this->_page->setFont($this->_fontNormal, 6); + $this->_page->drawText('Day:', $this->_x(220), $this->_y(201)); + $this->_page->drawText('Time:', $this->_x(250), $this->_y(201)); + + $this->_page->setFont($this->_fontNormal, 20); + + $this->_page->restoreGS(); + return $this; + } + + /** + * Add Shipment Information + * + * @return Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_PageBuilder + */ + public function addShipmentInformation() + { + $this->_page->saveGS(); + + $this->_page->restoreGS(); + return $this; + } + + /** + * Add Date Info + * @param string $date + * @return Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_PageBuilder + * @throws Zend_Pdf_Exception + */ + public function addDateInfo($date) + { + $this->_page->saveGS(); + + $this->_page->setFont($this->_fontNormal, 6); + $this->_page->drawText('Date:', $this->_x(160), $this->_y(224)); + $this->_page->drawText($date, $this->_x(150), $this->_y(231)); + + $this->_page->restoreGS(); + return $this; + } + + /** + * Add Weight Info + * + * @param string $weight + * @param string $unit + * @return Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_PageBuilder + * @throws InvalidArgumentException + * @throws Zend_Pdf_Exception + */ + public function addWeightInfo($weight, $unit) + { + $this->_page->saveGS(); + + $units = array("K" => 'kg', "L" => 'lb'); + if (!isset($units[$unit])) { + throw new InvalidArgumentException(Mage::helper('usa')->__('Weight unit is invalid')); + } + $unit = $units[$unit]; + + $this->_page->setFont($this->_fontNormal, 6); + $this->_page->drawText('Shpt Weight:', $this->_x(196), $this->_y(224)); + $this->_page->setFont($this->_fontBold, 11); + $this->_page->drawText($weight . ' ' . $unit, $this->_x(195), $this->_y(234)); + + $this->_page->restoreGS(); + return $this; + } + + /** + * Add Waybill Barcode + * + * @param string $number + * @param string $barCode + * @return Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_PageBuilder + * @throws InvalidArgumentException + * @throws Zend_Pdf_Exception + */ + public function addWaybillBarcode($number, $barCode) + { + $this->_page->saveGS(); + + if(!strlen($number) || !strlen($barCode)) { + throw new InvalidArgumentException(Mage::helper('usa')->__('Waybill barcode information is missing')); + } + $image = new Zend_Pdf_Resource_Image_Png("data://image/png;base64," . $barCode); + $this->_page->drawImage($image, $this->_x(0), $this->_y(296), $this->_x(232), $this->_y(375)); + + $this->_page->setFont($this->_fontNormal, 9); + $number = substr($number, 0, 2) . ' ' . substr($number, 2, 4) . ' ' . substr($number, 6, 4); + $this->_page->drawText("WAYBILL " . $number, $this->_x(13.5), $this->_y(382)); + + $this->_page->restoreGS(); + return $this; + } + + /** + * Add Routing Barcode + * + * @param string $routingCode + * @param string $id + * @param string $barCode + * @return Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_PageBuilder + * @throws InvalidArgumentException + * @throws Zend_Pdf_Exception + */ + public function addRoutingBarcode($routingCode, $id, $barCode) + { + $this->_page->saveGS(); + + if(!$barCode) { + throw new InvalidArgumentException(Mage::helper('usa')->__('Routing barcode is missing')); + } + + $image = new Zend_Pdf_Resource_Image_Png("data://image/png;base64," . $barCode); + $this->_page->drawImage($image, $this->_x(0), $this->_y(386), $this->_x(232), $this->_y(465)); + + $this->_page->setFont($this->_fontNormal, 9); + $routingText = '(' . $id . ')' . $routingCode; + $this->_page->drawText($routingText, $this->_x(12), $this->_y(472)); + + $this->_page->restoreGS(); + return $this; + } + + /** + * Add Piece Id Barcode + * + * @param string $dataIdentifier + * @param string $licensePlate + * @param string $barCode + * @return Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_PageBuilder + * @throws InvalidArgumentException + * @throws Zend_Pdf_Exception + */ + public function addPieceIdBarcode($dataIdentifier, $licensePlate, $barCode) + { + $this->_page->saveGS(); + + if (!strlen($barCode)) { + throw new InvalidArgumentException(Mage::helper('usa')->__('Piece Id barcode is missing')); + } + + $image = new Zend_Pdf_Resource_Image_Png('data://image/png;base64,' . $barCode); + $this->_page->drawImage($image, $this->_x(29), $this->_y(476), $this->_x(261), $this->_y(555)); + + $this->_page->setFont($this->_fontNormal, 9); + $routingText = '(' . $dataIdentifier . ')' . $licensePlate; + $this->_page->drawText($routingText, $this->_x(144), $this->_y(563), '', + Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_Page::ALIGN_CENTER + ); + + $this->_page->restoreGS(); + return $this; + } + + /** + * Add Piece Number + * + * @param int $pieceNumber + * @param int $piecesTotal + * @return Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_PageBuilder + * @throws InvalidArgumentException + * @throws Zend_Pdf_Exception + */ + public function addPieceNumber($pieceNumber, $piecesTotal) + { + $this->_page->saveGS(); + + if (!$pieceNumber || !$piecesTotal) { + throw new InvalidArgumentException(Mage::helper('usa')->__('Piece number information is missing')); + } + + $this->_page->setFont($this->_fontNormal, 6); + $this->_page->drawText('Piece:', $this->_x(256), $this->_y(224)); + $this->_page->setFont($this->_fontBold, 11); + $this->_page->drawText($pieceNumber . '/' . $piecesTotal, $this->_x(256), $this->_y(234)); + + $this->_page->restoreGS(); + return $this; + } +} diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Source/Dutypaymenttype.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Source/Dutypaymenttype.php index e0d6841ac0..0c90875b1a 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Source/Dutypaymenttype.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Source/Dutypaymenttype.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Source/Freemethod.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Source/Freemethod.php index 9d6e77f778..06a5a5473b 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Source/Freemethod.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Source/Freemethod.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Source/Method.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Source/Method.php index 476ed37d2e..389f3aee70 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Source/Method.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Source/Method.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Source/Protection/Rounding.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Source/Protection/Rounding.php index 5c5acd6298..41dc5aefbf 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Source/Protection/Rounding.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Source/Protection/Rounding.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Source/Protection/Value.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Source/Protection/Value.php index 6d81ca6e5b..7d367c1e9c 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Source/Protection/Value.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Source/Protection/Value.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Source/Shipmenttype.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Source/Shipmenttype.php index 45b2b11db8..691b749cac 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Source/Shipmenttype.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Source/Shipmenttype.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php index 91833f666a..afc97a8200 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -29,7 +29,7 @@ * * @category Mage * @package Mage_Usa - * @author Magento Core Team + * @author Magento Core Team */ class Mage_Usa_Model_Shipping_Carrier_Fedex extends Mage_Usa_Model_Shipping_Carrier_Abstract @@ -103,8 +103,8 @@ public function __construct() { parent::__construct(); $wsdlBasePath = Mage::getModuleDir('etc', 'Mage_Usa') . DS . 'wsdl' . DS . 'FedEx' . DS; - $this->_shipServiceWsdl = $wsdlBasePath . 'ShipService_v9.wsdl'; - $this->_rateServiceWsdl = $wsdlBasePath . 'RateService_v9.wsdl'; + $this->_shipServiceWsdl = $wsdlBasePath . 'ShipService_v10.wsdl'; + $this->_rateServiceWsdl = $wsdlBasePath . 'RateService_v10.wsdl'; $this->_trackServiceWsdl = $wsdlBasePath . 'TrackService_v5.wsdl'; } @@ -287,7 +287,7 @@ public function getVersionInfo() { return array( 'ServiceId' => 'crs', - 'Major' => '9', + 'Major' => '10', 'Intermediate' => '0', 'Minor' => '0' ); @@ -318,7 +318,7 @@ protected function _getQuotes() 'ShipTimestamp' => date('c'), 'PackagingType' => $r->getPackaging(), 'TotalInsuredValue' => array( - 'Ammount' => $r->getValue(), + 'Amount' => $r->getValue(), 'Currency' => $this->getCurrencyCode() ), 'Shipper' => array( @@ -341,6 +341,12 @@ protected function _getQuotes() 'CountryCode' => $r->getOrigCountry() ) ), + 'CustomsClearanceDetail' => array( + 'CustomsValue' => array( + 'Amount' => $r->getValue(), + 'Currency' => $this->getCurrencyCode() + ) + ), 'RateRequestTypes' => 'LIST', 'PackageCount' => '1', 'PackageDetail' => 'INDIVIDUAL_PACKAGES', @@ -349,7 +355,12 @@ protected function _getQuotes() 'Weight' => array( 'Value' => (float)$r->getWeight(), 'Units' => 'LB' - ) + ), + 'InsuredValue' => array( + 'Amount' => $r->getValue(), + 'Currency' => $this->getCurrencyCode() + ), + 'GroupPackageCount' => 1, ) ) ) @@ -416,10 +427,9 @@ protected function _prepareRateResponse($response) } $result = Mage::getModel('shipping/rate_result'); - $defaults = $this->getDefaults(); if (empty($priceArr)) { $error = Mage::getModel('shipping/rate_result_error'); - $error->setCarrier('fedex'); + $error->setCarrier($this->_code); $error->setCarrierTitle($this->getConfigData('title')); $error->setErrorMessage($errorTitle); $error->setErrorMessage($this->getConfigData('specificerrmsg')); @@ -427,7 +437,7 @@ protected function _prepareRateResponse($response) } else { foreach ($priceArr as $method=>$price) { $rate = Mage::getModel('shipping/rate_result_method'); - $rate->setCarrier('fedex'); + $rate->setCarrier($this->_code); $rate->setCarrierTitle($this->getConfigData('title')); $rate->setMethod($method); $rate->setMethodTitle($this->getCode('method', $method)); @@ -448,19 +458,29 @@ protected function _prepareRateResponse($response) protected function _getRateAmountOriginBased($rate) { $amount = null; + $rateTypeAmounts = array(); + if (is_object($rate)) { - foreach($rate->RatedShipmentDetails as $ratedShipmentDetail) { - $shipmentRateDetail = $ratedShipmentDetail->ShipmentRateDetail; - // The "RATED..." rates are expressed in the currency of the origin country - if ((string)$shipmentRateDetail->RateType == 'RATED_ACCOUNT_SHIPMENT') { - $amount = (string)$shipmentRateDetail->TotalNetCharge->Amount; + // The "RATED..." rates are expressed in the currency of the origin country + foreach ($rate->RatedShipmentDetails as $ratedShipmentDetail) { + $netAmount = (string)$ratedShipmentDetail->ShipmentRateDetail->TotalNetCharge->Amount; + $rateType = (string)$ratedShipmentDetail->ShipmentRateDetail->RateType; + $rateTypeAmounts[$rateType] = $netAmount; + } + + // Order is important + foreach (array('RATED_ACCOUNT_SHIPMENT', 'RATED_LIST_SHIPMENT', 'RATED_LIST_PACKAGE') as $rateType) { + if (!empty($rateTypeAmounts[$rateType])) { + $amount = $rateTypeAmounts[$rateType]; + break; } } + if (is_null($amount)) { - $amount = (string)$rate->RatedShipmentDetails[0]->ShipmentRateDetail - ->TotalNetCharge->Amount; + $amount = (string)$rate->RatedShipmentDetails[0]->ShipmentRateDetail->TotalNetCharge->Amount; } } + return $amount; } @@ -522,7 +542,7 @@ protected function _getXmlQuotes() if ($this->getConfigData('residence_delivery')) { $specialServices = $xml->addChild('SpecialServices'); - $specialServices->addChild('ResidentialDelivery', 'true'); + $specialServices->addChild('ResidentialDelivery', 'true'); } $xml->addChild('PackageCount', '1'); @@ -603,7 +623,6 @@ protected function _parseXmlResponse($response) } $result = Mage::getModel('shipping/rate_result'); - $defaults = $this->getDefaults(); if (empty($priceArr)) { $error = Mage::getModel('shipping/rate_result_error'); $error->setCarrier('fedex'); @@ -660,6 +679,7 @@ public function getCode($type, $code='') 'FEDEX_1_DAY_FREIGHT' => Mage::helper('usa')->__('1 Day Freight'), 'FEDEX_2_DAY_FREIGHT' => Mage::helper('usa')->__('2 Day Freight'), 'FEDEX_2_DAY' => Mage::helper('usa')->__('2 Day'), + 'FEDEX_2_DAY_AM' => Mage::helper('usa')->__('2 Day AM'), 'FEDEX_3_DAY_FREIGHT' => Mage::helper('usa')->__('3 Day Freight'), 'FEDEX_EXPRESS_SAVER' => Mage::helper('usa')->__('Express Saver'), 'FEDEX_GROUND' => Mage::helper('usa')->__('Ground'), @@ -701,6 +721,7 @@ public function getCode($type, $code='') 'method' => array( 'FEDEX_EXPRESS_SAVER', 'FEDEX_2_DAY', + 'FEDEX_2_DAY_AM', 'STANDARD_OVERNIGHT', 'PRIORITY_OVERNIGHT', 'FIRST_OVERNIGHT', @@ -721,6 +742,7 @@ public function getCode($type, $code='') 'within_us' => array( 'method' => array( 'FEDEX_2_DAY', + 'FEDEX_2_DAY_AM', 'STANDARD_OVERNIGHT', 'PRIORITY_OVERNIGHT', 'FIRST_OVERNIGHT', @@ -757,6 +779,7 @@ public function getCode($type, $code='') 'SMART_POST', 'FEDEX_EXPRESS_SAVER', 'FEDEX_2_DAY', + 'FEDEX_2_DAY_AM', 'STANDARD_OVERNIGHT', 'PRIORITY_OVERNIGHT', 'FIRST_OVERNIGHT', @@ -796,7 +819,7 @@ public function getCode($type, $code='') if (!isset($codes[$type])) { return false; - } elseif (''===$code) { + } elseif ('' === $code) { return $codes[$type]; } @@ -1013,11 +1036,11 @@ protected function _parseTrackingResponse($trackingValue, $response) } } - if(!$this->_result){ + if (!$this->_result) { $this->_result = Mage::getModel('shipping/tracking_result'); } - if(isset($resultArray)) { + if (isset($resultArray)) { $tracking = Mage::getModel('shipping/tracking_result_status'); $tracking->setCarrier('fedex'); $tracking->setCarrierTitle($this->getConfigData('title')); @@ -1099,19 +1122,18 @@ protected function _parseXmlTrackingResponse($trackingvalue, $response) $errorTitle = false; } - if(!$this->_result){ + if (!$this->_result) { $this->_result = Mage::getModel('shipping/tracking_result'); } - $defaults = $this->getDefaults(); - if($resultArr){ + if ($resultArr) { $tracking = Mage::getModel('shipping/tracking_result_status'); $tracking->setCarrier('fedex'); $tracking->setCarrierTitle($this->getConfigData('title')); $tracking->setTracking($trackingvalue); $tracking->addData($resultArr); $this->_result->append($tracking); - }else{ + } else { $error = Mage::getModel('shipping/tracking_result_error'); $error->setCarrier('fedex'); $error->setCarrierTitle($this->getConfigData('title')); @@ -1129,14 +1151,14 @@ protected function _parseXmlTrackingResponse($trackingvalue, $response) public function getResponse() { $statuses = ''; - if ($this->_result instanceof Mage_Shipping_Model_Tracking_Result){ + if ($this->_result instanceof Mage_Shipping_Model_Tracking_Result) { if ($trackings = $this->_result->getAllTrackings()) { foreach ($trackings as $tracking){ if($data = $tracking->getAllData()){ if (!empty($data['status'])) { - $statuses .= Mage::helper('usa')->__($data['status'])."\n
    "; + $statuses .= Mage::helper('usa')->__($data['status']) . "\n
    "; } else { - $statuses .= Mage::helper('usa')->__('Empty response')."\n
    "; + $statuses .= Mage::helper('usa')->__('Empty response') . "\n
    "; } } } diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex/Source/Dropoff.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex/Source/Dropoff.php index 19072853a3..7be687f24b 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex/Source/Dropoff.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex/Source/Dropoff.php @@ -20,19 +20,25 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - +/** + * Fedex dropoff source implementation + * + * @category Mage + * @package Mage_Usa + * @author Magento Core Team + */ class Mage_Usa_Model_Shipping_Carrier_Fedex_Source_Dropoff { public function toOptionArray() { $fedex = Mage::getSingleton('usa/shipping_carrier_fedex'); $arr = array(); - foreach ($fedex->getCode('dropoff') as $k=>$v) { - $arr[] = array('value'=>$k, 'label'=>$v); + foreach ($fedex->getCode('dropoff') as $k => $v) { + $arr[] = array('value' => $k, 'label' => $v); } return $arr; } diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex/Source/Freemethod.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex/Source/Freemethod.php index e7188fef49..167000e411 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex/Source/Freemethod.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex/Source/Freemethod.php @@ -20,17 +20,24 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - -class Mage_Usa_Model_Shipping_Carrier_Fedex_Source_Freemethod extends Mage_Usa_Model_Shipping_Carrier_Fedex_Source_Method +/** + * Fedex freemethod source implementation + * + * @category Mage + * @package Mage_Usa + * @author Magento Core Team + */ +class Mage_Usa_Model_Shipping_Carrier_Fedex_Source_Freemethod + extends Mage_Usa_Model_Shipping_Carrier_Fedex_Source_Method { public function toOptionArray() { $arr = parent::toOptionArray(); - array_unshift($arr, array('value'=>'', 'label'=>Mage::helper('shipping')->__('None'))); + array_unshift($arr, array('value' => '', 'label' => Mage::helper('shipping')->__('None'))); return $arr; } } diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex/Source/Method.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex/Source/Method.php index 88135c4d45..e8e39bb56f 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex/Source/Method.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex/Source/Method.php @@ -20,19 +20,25 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - +/** + * Fedex method source implementation + * + * @category Mage + * @package Mage_Usa + * @author Magento Core Team + */ class Mage_Usa_Model_Shipping_Carrier_Fedex_Source_Method { public function toOptionArray() { $fedex = Mage::getSingleton('usa/shipping_carrier_fedex'); $arr = array(); - foreach ($fedex->getCode('method') as $k=>$v) { - $arr[] = array('value'=>$k, 'label'=>$v); + foreach ($fedex->getCode('method') as $k => $v) { + $arr[] = array('value' => $k, 'label' => $v); } return $arr; } diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex/Source/Packaging.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex/Source/Packaging.php index 74e771570f..463dfb87c2 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex/Source/Packaging.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex/Source/Packaging.php @@ -20,19 +20,25 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - +/** + * Fedex packaging source implementation + * + * @category Mage + * @package Mage_Usa + * @author Magento Core Team + */ class Mage_Usa_Model_Shipping_Carrier_Fedex_Source_Packaging { public function toOptionArray() { $fedex = Mage::getSingleton('usa/shipping_carrier_fedex'); $arr = array(); - foreach ($fedex->getCode('packaging') as $k=>$v) { - $arr[] = array('value'=>$k, 'label'=>$v); + foreach ($fedex->getCode('packaging') as $k => $v) { + $arr[] = array('value' => $k, 'label' => $v); } return $arr; } diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php index 2ce88521d1..a026a7e847 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -489,7 +489,7 @@ protected function _parseCgiResponse($response) /** * Get configuration data of carrier * - * @param strin $type + * @param string $type * @param string $code * @return array|bool */ @@ -1733,7 +1733,7 @@ public function getContainerTypesAll() return $result; } - + /** * Return structured data of containers witch related with shipping methods * @@ -1806,38 +1806,4 @@ protected function _getDeliveryConfirmationLevel($countyDest = null) { return self::DELIVERY_CONFIRMATION_SHIPMENT; } - - /** - * Return items for further shipment rate evaluation. We need to pass children of a bundle instead passing the - * bundle itself, otherwise we may not get a rate at all (e.g. when total weight of a bundle exceeds max weight - * despite each item by itself is not) - * - * @param Mage_Shipping_Model_Rate_Request $request - * @return array - */ - public function getAllItems(Mage_Shipping_Model_Rate_Request $request) - { - $items = array(); - if ($request->getAllItems()) { - foreach ($request->getAllItems() as $item) { - /* @var $item Mage_Sales_Model_Quote_Item */ - if ($item->getProduct()->isVirtual() || $item->getParentItem()) { - // Don't process children here - we will process (or already have processed) them below - continue; - } - - if ($item->getHasChildren() && $item->isShipSeparately()) { - foreach ($item->getChildren() as $child) { - if (!$child->getFreeShipping() && !$child->getProduct()->isVirtual()) { - $items[] = $child; - } - } - } else { - // Ship together - count compound item as one solid - $items[] = $item; - } - } - } - return $items; - } } diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Container.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Container.php index 13b78bda06..5a0c3d9182 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Container.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Container.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/DestType.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/DestType.php index 53afeafaca..baedd9007e 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/DestType.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/DestType.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Freemethod.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Freemethod.php index dffe74c5c3..eff2682053 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Freemethod.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Freemethod.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Method.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Method.php index 0962aff35f..619ed084a5 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Method.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Method.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/OriginShipment.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/OriginShipment.php index cd337a6323..d64a55ca35 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/OriginShipment.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/OriginShipment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Pickup.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Pickup.php index 4eae390581..2ca648abda 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Pickup.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Pickup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Type.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Type.php index 31e7b07b04..12ef0c15fa 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Type.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Unitofmeasure.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Unitofmeasure.php index 7535edefea..df107b0fbb 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Unitofmeasure.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Unitofmeasure.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps.php index 3685d97bc3..98c45df50a 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -53,7 +53,7 @@ class Mage_Usa_Model_Shipping_Carrier_Usps const SIZE_LARGE = 'LARGE'; /** - * Destination Zip Code required flag + * Default api revision * * @var int */ @@ -79,9 +79,10 @@ class Mage_Usa_Model_Shipping_Carrier_Usps protected $_code = self::CODE; /** - * Is zip code required + * Destination Zip Code required flag * - * @var bool + * @var boolean + * @deprecated since 1.7.0 functionality implemented in Mage_Usa_Model_Shipping_Carrier_Abstract */ protected $_isZipCodeRequired; @@ -120,34 +121,6 @@ class Mage_Usa_Model_Shipping_Carrier_Usps */ protected $_customizableContainerTypes = array('VARIABLE', 'RECTANGULAR', 'NONRECTANGULAR'); - /** - * Check is Zip Code Required - * - * @return boolean - */ - public function isZipCodeRequired() - { - if (!is_null($this->_isZipCodeRequired)) { - return $this->_isZipCodeRequired; - } - - return parent::isZipCodeRequired(); - } - - /** - * Processing additional validation to check is carrier applicable. - * - * @param Mage_Shipping_Model_Rate_Request $request - * @return Mage_Shipping_Model_Carrier_Abstract|Mage_Shipping_Model_Rate_Result_Error|boolean - */ - public function proccessAdditionalValidation(Mage_Shipping_Model_Rate_Request $request) - { - // zip code required for US - $this->_isZipCodeRequired = $this->_isUSCountry($request->getDestCountryId()); - - return parent::proccessAdditionalValidation($request); - } - /** * Collect and get rates * @@ -590,6 +563,7 @@ public function getCode($type, $code='') 'First-Class Mail International Large Envelope' => 'FIRST CLASS', 'First-Class Mail International Letter' => 'FIRST CLASS', 'First-Class Mail International Package' => 'FIRST CLASS', + 'First-Class Mail International Parcel' => 'FIRST CLASS', 'First-Class Mail' => 'FIRST CLASS', 'First-Class Mail Flat' => 'FIRST CLASS', 'First-Class Mail Large Envelope' => 'FIRST CLASS', @@ -1336,7 +1310,11 @@ protected function _formUsSignatureConfirmationShipmentRequest(Varien_Object $re list($fromZip5, $fromZip4) = $this->_parseZip($request->getShipperAddressPostalCode()); list($toZip5, $toZip4) = $this->_parseZip($request->getRecipientAddressPostalCode(), true); - $rootNode = 'SigConfirmCertifyV3.0Request'; + if ($this->getConfigData('mode')) { + $rootNode = 'SignatureConfirmationV3.0Request'; + } else { + $rootNode = 'SigConfirmCertifyV3.0Request'; + } // the wrap node needs for remove xml declaration above $xmlWrap = new SimpleXMLElement(''); $xml = $xmlWrap->addChild($rootNode); @@ -1637,7 +1615,11 @@ protected function _doShipmentRequest(Varien_Object $request) $api = 'ExpressMailLabel'; } else if ($recipientUSCountry) { $requestXml = $this->_formUsSignatureConfirmationShipmentRequest($request, $service); - $api = 'SignatureConfirmationCertifyV3'; + if ($this->getConfigData('mode')) { + $api = 'SignatureConfirmationV3'; + } else { + $api = 'SignatureConfirmationCertifyV3'; + } } else if ($service == 'FIRST CLASS') { $requestXml = $this->_formIntlShipmentRequest($request); $api = 'FirstClassMailIntl'; diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps/Source/Container.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps/Source/Container.php index de7dde9dbf..3d9ba42bf2 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps/Source/Container.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps/Source/Container.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps/Source/Freemethod.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps/Source/Freemethod.php index f5a9c83d30..025cc14a18 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps/Source/Freemethod.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps/Source/Freemethod.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps/Source/Machinable.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps/Source/Machinable.php index 347bad4126..30896f7b51 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps/Source/Machinable.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps/Source/Machinable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps/Source/Method.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps/Source/Method.php index 537e3ade61..642a62b78c 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps/Source/Method.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps/Source/Method.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps/Source/Size.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps/Source/Size.php index ede643ac5f..d7f19313de 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps/Source/Size.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps/Source/Size.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/etc/config.xml b/app/code/core/Mage/Usa/etc/config.xml index 2f14f1e17b..15031918b6 100644 --- a/app/code/core/Mage/Usa/etc/config.xml +++ b/app/code/core/Mage/Usa/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -101,7 +101,7 @@ 0 0 - E,N,S,G,IE,E SAT,E 10:30AM + IE,E SAT,E 10:30AM,E,N,S,G Big Box R @@ -110,6 +110,7 @@ usa/shipping_carrier_dhl + 0 P @@ -128,9 +129,10 @@ 0 + 0 0 0 - EUROPE_FIRST_INTERNATIONAL_PRIORITY,FEDEX_1_DAY_FREIGHT,FEDEX_2_DAY_FREIGHT,FEDEX_2_DAY,FEDEX_3_DAY_FREIGHT,FEDEX_EXPRESS_SAVER,FEDEX_GROUND,FIRST_OVERNIGHT,GROUND_HOME_DELIVERY,INTERNATIONAL_ECONOMY,INTERNATIONAL_ECONOMY_FREIGHT,INTERNATIONAL_FIRST,INTERNATIONAL_GROUNDINTERNATIONAL_PRIORITY,INTERNATIONAL_PRIORITY_FREIGHT,PRIORITY_OVERNIGHT,SMART_POSTSTANDARD_OVERNIGHT + EUROPE_FIRST_INTERNATIONAL_PRIORITY,FEDEX_1_DAY_FREIGHT,FEDEX_2_DAY_FREIGHT,FEDEX_2_DAY,FEDEX_2_DAY_AM,FEDEX_3_DAY_FREIGHT,FEDEX_EXPRESS_SAVER,FEDEX_GROUND,FIRST_OVERNIGHT,GROUND_HOME_DELIVERY,INTERNATIONAL_ECONOMY,INTERNATIONAL_ECONOMY_FREIGHT,INTERNATIONAL_FIRST,INTERNATIONAL_GROUND,INTERNATIONAL_PRIORITY,INTERNATIONAL_PRIORITY_FREIGHT,PRIORITY_OVERNIGHT,SMART_POST,STANDARD_OVERNIGHT,FEDEX_FREIGHT,FEDEX_NATIONAL_FREIGHT REGULAR_PICKUP FEDEX_GROUND @@ -147,8 +149,9 @@ 0 0 - 1DM,1DML,1DA,1DAL,1DAPI,1DP,1DPL,2DM,2DML,2DA,2DAL,3DS,GND,GNDCOM,GNDRES,STD,XPR,WXS,XPRL,XDM,XDML,XPD + 1DM,1DML,1DA,1DAL,1DAPI,1DP,1DPL,2DM,2DML,2DA,2DAL,3DS,GND,GNDCOM,GNDRES,STD,XPR,WXS,XPRL,XDM,XDML,XPD,01,02,03,07,08,11,12,14,54,59,65 Shipments Originating in United States + 0 CP RES @@ -175,20 +178,22 @@ 0 0 - Bound Printed Matter,Express Mail,Express Mail Flat Rate Envelope,Express Mail Flat Rate Envelope Hold For Pickup,Express Mail Flat-Rate Envelope Sunday/Holiday Guarantee,Express Mail Hold For Pickup,Express Mail International,Express Mail International Flat Rate Envelope,Express Mail PO to PO,Express Mail Sunday/Holiday Guarantee,First-Class Mail International Large Envelope,First-Class Mail International Letters,First-Class Mail International Package,First-Class,First-Class Mail,First-Class Mail Flat,First-Class Mail Large Envelope,First-Class Mail International,First-Class Mail Letter,First-Class Mail Parcel,First-Class Mail Package,Global Express Guaranteed (GXG),Global Express Guaranteed Non-Document Non-Rectangular,Global Express Guaranteed Non-Document Rectangular,Library Mail,Media Mail,Parcel Post,Priority Mail,Priority Mail Small Flat Rate Box,Priority Mail Medium Flat Rate Box,Priority Mail Large Flat Rate Box,Priority Mail Flat Rate Box,Priority Mail Flat Rate Envelope,Priority Mail International,Priority Mail International Flat Rate Box,Priority Mail International Flat Rate Envelope,Priority Mail International Small Flat Rate Box,Priority Mail International Medium Flat Rate Box,Priority Mail International Large Flat Rate Box,USPS GXG Envelopes + Bound Printed Matter,Express Mail,Express Mail Flat Rate Envelope,Express Mail Flat Rate Envelope Hold For Pickup,Express Mail Flat-Rate Envelope Sunday/Holiday Guarantee,Express Mail Hold For Pickup,Express Mail International,Express Mail International Flat Rate Envelope,Express Mail PO to PO,Express Mail Sunday/Holiday Guarantee,First-Class Mail International Large Envelope,First-Class Mail International Letters,First-Class Mail International Package,First-Class Mail International Parcel,First-Class,First-Class Mail,First-Class Mail Flat,First-Class Mail Large Envelope,First-Class Mail International,First-Class Mail Letter,First-Class Mail Parcel,First-Class Mail Package,Global Express Guaranteed (GXG),Global Express Guaranteed Non-Document Non-Rectangular,Global Express Guaranteed Non-Document Rectangular,Library Mail,Media Mail,Parcel Post,Priority Mail,Priority Mail Small Flat Rate Box,Priority Mail Medium Flat Rate Box,Priority Mail Large Flat Rate Box,Priority Mail Flat Rate Box,Priority Mail Flat Rate Envelope,Priority Mail International,Priority Mail International Flat Rate Box,Priority Mail International Flat Rate Envelope,Priority Mail International Small Flat Rate Box,Priority Mail International Medium Flat Rate Box,Priority Mail International Large Flat Rate Box,USPS GXG Envelopes VARIABLE http://production.shippingapis.com/ShippingAPI.dll https://secure.shippingapis.com/ShippingAPI.dll + 0 true - Bound Printed Matter,Express Mail,Express Mail Flat Rate Envelope,Express Mail Flat Rate Envelope Hold For Pickup,Express Mail Flat-Rate Envelope Sunday/Holiday Guarantee,Express Mail Hold For Pickup,Express Mail International,Express Mail International Flat Rate Envelope,Express Mail PO to PO,Express Mail Sunday/Holiday Guarantee,First-Class Mail International Large Envelope,First-Class Mail International Letters,First-Class Mail International Package,First-Class,First-Class Mail,First-Class Mail Flat,First-Class Mail Large Envelope,First-Class Mail International,First-Class Mail Letter,First-Class Mail Parcel,First-Class Mail Package,Global Express Guaranteed (GXG),Global Express Guaranteed Non-Document Non-Rectangular,Global Express Guaranteed Non-Document Rectangular,Library Mail,Media Mail,Parcel Post,Priority Mail,Priority Mail Small Flat Rate Box,Priority Mail Medium Flat Rate Box,Priority Mail Large Flat Rate Box,Priority Mail Flat Rate Box,Priority Mail Flat Rate Envelope,Priority Mail International,Priority Mail International Flat Rate Box,Priority Mail International Flat Rate Envelope,Priority Mail International Small Flat Rate Box,Priority Mail International Medium Flat Rate Box,Priority Mail International Large Flat Rate Box,USPS GXG Envelopes + Bound Printed Matter,Express Mail,Express Mail Flat Rate Envelope,Express Mail Flat Rate Envelope Hold For Pickup,Express Mail Flat-Rate Envelope Sunday/Holiday Guarantee,Express Mail Hold For Pickup,Express Mail International,Express Mail International Flat Rate Envelope,Express Mail PO to PO,Express Mail Sunday/Holiday Guarantee,First-Class Mail International Large Envelope,First-Class Mail International Letters,First-Class Mail International Package,First-Class Mail International Parcel,First-Class,First-Class Mail,First-Class Mail Flat,First-Class Mail Large Envelope,First-Class Mail International,First-Class Mail Letter,First-Class Mail Parcel,First-Class Mail Package,Global Express Guaranteed (GXG),Global Express Guaranteed Non-Document Non-Rectangular,Global Express Guaranteed Non-Document Rectangular,Library Mail,Media Mail,Parcel Post,Priority Mail,Priority Mail Small Flat Rate Box,Priority Mail Medium Flat Rate Box,Priority Mail Large Flat Rate Box,Priority Mail Flat Rate Box,Priority Mail Flat Rate Envelope,Priority Mail International,Priority Mail International Flat Rate Box,Priority Mail International Flat Rate Envelope,Priority Mail International Small Flat Rate Box,Priority Mail International Medium Flat Rate Box,Priority Mail International Large Flat Rate Box,USPS GXG Envelopes usa/shipping_carrier_usps REGULAR United States Postal Service + 0 This shipping method is currently unavailable. If you would like to ship using this shipping method, please contact us. 70 F @@ -200,7 +205,8 @@ 0 DHL 0 - 1,2,3,4,5,6,7,8,9,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y + 1,3,4,8,P,Q,E,F,H,J,M,V,Y + 2,5,6,7,9,B,C,D,U,K,L,G,W,I,N,O,R,S,T,X G https://xmlpitest-ea.dhl.com/XMLShippingServlet diff --git a/app/code/core/Mage/Usa/etc/dhl/international/countries.xml b/app/code/core/Mage/Usa/etc/dhl/international/countries.xml index 24deccbff6..75854bca59 100644 --- a/app/code/core/Mage/Usa/etc/dhl/international/countries.xml +++ b/app/code/core/Mage/Usa/etc/dhl/international/countries.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Usa/etc/system.xml b/app/code/core/Mage/Usa/etc/system.xml index 613205f3f2..f21f556971 100644 --- a/app/code/core/Mage/Usa/etc/system.xml +++ b/app/code/core/Mage/Usa/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -88,6 +88,7 @@ text + validate-number validate-zero-or-greater 1220 1 1 @@ -150,6 +151,7 @@ text + validate-number validate-zero-or-greater 120 1 1 @@ -158,6 +160,7 @@ text + validate-number validate-zero-or-greater 130 1 1 @@ -181,6 +184,15 @@ 1 0 + + + select + usa/shipping_carrier_abstract_source_requesttype + 85 + 1 + 1 + 0 + select @@ -275,6 +287,7 @@ text + validate-number validate-zero-or-greater 1310 1 1 @@ -446,7 +459,16 @@ 1 1 0 - + + + + select + usa/shipping_carrier_abstract_source_requesttype + 77 + 1 + 1 + 0 + select @@ -468,6 +490,7 @@ text + validate-number validate-zero-or-greater 100 1 1 @@ -494,6 +517,7 @@ text + validate-number validate-zero-or-greater 130 1 1 @@ -540,6 +564,7 @@ text + validate-number validate-zero-or-greater 180 1 1 @@ -638,6 +663,15 @@ 0 1 + + + select + usa/shipping_carrier_abstract_source_requesttype + 47 + 1 + 1 + 0 + select @@ -659,6 +693,7 @@ text + validate-number validate-zero-or-greater 220 1 1 @@ -720,6 +755,7 @@ text + validate-number validate-zero-or-greater 130 1 1 @@ -728,6 +764,7 @@ text + validate-number validate-zero-or-greater 80 1 1 @@ -736,6 +773,7 @@ text + validate-number validate-zero-or-greater 90 1 1 @@ -879,7 +917,7 @@ Enables/Disables SSL verification of Magento server by UPS. select - usa/shipping_carrier_ups_source_mode + usa/shipping_carrier_abstract_source_mode 30 1 1 @@ -950,11 +988,29 @@ obscure adminhtml/system_config_backend_encrypted - 54 + 53 1 1 0 + + + select + 54 + usa/shipping_carrier_abstract_source_mode + 1 + 1 + 0 + + + + select + usa/shipping_carrier_abstract_source_requesttype + 55 + 1 + 1 + 0 + select @@ -1021,6 +1077,7 @@ text + validate-number validate-zero-or-greater 90 1 1 @@ -1047,6 +1104,7 @@ text + validate-number validate-zero-or-greater 120 1 1 @@ -1084,6 +1142,7 @@ text + validate-number validate-zero-or-greater 160 1 1 @@ -1236,6 +1295,7 @@ text + validate-number validate-zero-or-greater 120 1 1 @@ -1372,6 +1432,7 @@ text + validate-number validate-zero-or-greater 1220 1 1 diff --git a/app/code/core/Mage/Usa/etc/wsdl/FedEx/RateService_v10.wsdl b/app/code/core/Mage/Usa/etc/wsdl/FedEx/RateService_v10.wsdl new file mode 100644 index 0000000000..d7e635a525 --- /dev/null +++ b/app/code/core/Mage/Usa/etc/wsdl/FedEx/RateService_v10.wsdl @@ -0,0 +1,4870 @@ + + + + + + + + Specifies additional labels to be produced. All required labels for shipments will be produced without the need to request additional labels. These are only available as thermal labels. + + + + + The type of additional labels to return. + + + + + The number of this type label to return + + + + + + + Identifies the type of additional labels. + + + + + + + + + + + + + + + Descriptive data for a physical location. May be used as an actual physical address (place to which one could go), or as a container of "address parts" which should be handled as a unit (such as a city-state-ZIP combination within the US). + + + + + Combination of number, street name, etc. At least one line is required for a valid physical address; empty lines should not be included. + + + + + Name of city, town, etc. + + + + + Identifying abbreviation for US state, Canada province, etc. Format and presence of this field will vary, depending on country. + + + + + Identification of a region (usually small) for mail/package delivery. Format and presence of this field will vary, depending on country. + + + + + Relevant only to addresses in Puerto Rico. + + + + + The two-letter code used to identify a country. + + + + + Indicates whether this address residential (as opposed to commercial). + + + + + + + + Specifies which filing option is being exercised by the customer. + Required for non-document shipments originating in Canada destined for any country other than Canada, the United States, Puerto Rico or the U.S. Virgin Islands. + + + + + + + + + + + + Identification of the type of barcode (symbology) used on FedEx documents and labels. + + + + + + + + + + + + + + + + + + Identification of a FedEx operating company (transportation). + + + + + + + + + + + + + The instructions indicating how to print the Certificate of Origin ( e.g. whether or not to include the instructions, image type, etc ...) + + + + + Specifies characteristics of a shipping document to be produced. + + + + + Specifies the usage and identification of customer supplied images to be used on this document. + + + + + + + + + + + + + Specifies the type of brokerage to be applied to a shipment. + + + + + + + + + + + + Descriptive data for the client submitting a transaction. + + + + + The FedEx account number associated with this transaction. + + + + + This number is assigned by FedEx and identifies the unique device from which the request is originating + + + + + Only used in transactions which require identification of the Fed Ex Office integrator. + + + + + Indicates the region from which the transaction is submitted. + + + + + The language to be used for human-readable Notification.localizedMessages in responses to the request containing this ClientDetail object. Different requests from the same client may contain different Localization data. (Contrast with TransactionDetail.localization, which governs data payload language/translation.) + + + + + + + + + + + + + + + + + + + + + + Identifies the type of funds FedEx should collect upon shipment delivery. + + + + + + + + + + Descriptive data required for a FedEx COD (Collect-On-Delivery) shipment. + + + + + + Specifies the details of the charges are to be added to the COD collect amount. + + + + + Identifies the type of funds FedEx should collect upon package delivery + + + + + For Express this is the descriptive data that is used for the recipient of the FedEx Letter containing the COD payment. For Ground this is the descriptive data for the party to receive the payment that prints the COD receipt. + + + + + Indicates which type of reference information to include on the COD return shipping label. + + + + + + + Indicates which type of reference information to include on the COD return shipping label. + + + + + + + + + + + CommercialInvoice element is required for electronic upload of CI data. It will serve to create/transmit an Electronic Commercial Invoice through the FedEx Systems. Customers are responsible for printing their own Commercial Invoice.If you would likeFedEx to generate a Commercial Invoice and transmit it to Customs. for clearance purposes, you need to specify that in the ShippingDocumentSpecification element. If you would like a copy of the Commercial Invoice that FedEx generated returned to you in reply it needs to be specified in the ETDDetail/RequestedDocumentCopies element. Commercial Invoice support consists of maximum of 99 commodity line items. + + + + + Any comments that need to be communicated about this shipment. + + + + + Any freight charges that are associated with this shipment. + + + + + Any taxes or miscellaneous charges(other than Freight charges or Insurance charges) that are associated with this shipment. + + + + + Specifies which kind of charge is being recorded in the preceding field. + + + + + Any packing costs that are associated with this shipment. + + + + + Any handling costs that are associated with this shipment. + + + + + Free-form text. + + + + + Free-form text. + + + + + Free-form text. + + + + + The reason for the shipment. Note: SOLD is not a valid purpose for a Proforma Invoice. + + + + + Customer assigned Invoice number + + + + + Name of the International Expert that completed the Commercial Invoice different from Sender. + + + + + Required for dutiable international Express or Ground shipment. This field is not applicable to an international PIB(document) or a non-document which does not require a Commercial Invoice + + + + + + + The instructions indicating how to print the Commercial Invoice( e.g. image type) Specifies characteristics of a shipping document to be produced. + + + + + + Specifies the usage and identification of a customer supplied image to be used on this document. + + + + + + + Information about the transit time and delivery commitment date and time. + + + + + The Commodity applicable to this commitment. + + + + + The FedEx service type applicable to this commitment. + + + + + Shows the specific combination of service options combined with the service type that produced this committment in the set returned to the caller. + + + + + Supporting detail for applied options identified in preceding field. + + + + + THe delivery commitment date/time. Express Only. + + + + + The delivery commitment day of the week. + + + + + The number of transit days; applies to Ground and LTL Freight; indicates minimum transit time for SmartPost. + + + + + Maximum number of transit days, for SmartPost shipments. + + + + + The service area code for the destination of this shipment. Express only. + + + + + The address of the broker to be used for this shipment. + + + + + The FedEx location identifier for the broker. + + + + + The delivery commitment date/time the shipment will arrive at the border. + + + + + The delivery commitment day of the week the shipment will arrive at the border. + + + + + The number of days it will take for the shipment to make it from broker to destination + + + + + The delivery commitment date for shipment served by GSP (Global Service Provider) + + + + + The delivery commitment day of the week for the shipment served by GSP (Global Service Provider) + + + + + Messages concerning the ability to provide an accurate delivery commitment on an International commit quote. These could be messages providing information about why a commitment could not be returned or a successful message such as "REQUEST COMPLETED" + + + + + Messages concerning the delivery commitment on an International commit quote such as "0:00 A.M. IF NO CUSTOMS DELAY" + + + + + Information about why a shipment delivery is delayed and at what level (country/service etc.). + + + + + + Required documentation for this shipment. + + + + + Freight origin and destination city center information and total distance between origin and destination city centers. + + + + + + + The type of delay this shipment will encounter. + + + + + + + + + + + + + + + + + + + For international multiple piece shipments, commodity information must be passed in the Master and on each child transaction. + If this shipment cotains more than four commodities line items, the four highest valued should be included in the first 4 occurances for this request. + + + + + + total number of pieces of this commodity + + + + + total number of pieces of this commodity + + + + + Complete and accurate description of this commodity. + + 450 + + + + + + Country code where commodity contents were produced or manufactured in their final form. + + 2 + + + + + + + Unique alpha/numeric representing commodity item. + At least one occurrence is required for US Export shipments if the Customs Value is greater than $2500 or if a valid US Export license is required. + + + 14 + + + + + + Total weight of this commodity. 1 explicit decimal position. Max length 11 including decimal. + + + + + Number of units of a commodity in total number of pieces for this line item. Max length is 9 + + + + + Unit of measure used to express the quantity of this commodity line item. + + 3 + + + + + + Contains only additional quantitative information other than weight and quantity to calculate duties and taxes. + + + + + Value of each unit in Quantity. Six explicit decimal positions, Max length 18 including decimal. + + + + + + Total customs value for this line item. + It should equal the commodity unit quantity times commodity unit value. + Six explicit decimal positions, max length 18 including decimal. + + + + + + Defines additional characteristic of commodity used to calculate duties and taxes + + + + + Applicable to US export shipping only. + + 12 + + + + + + + + An identifying mark or number used on the packaging of a shipment to help customers identify a particular shipment. + + + 15 + + + + + + All data required for this commodity in NAFTA Certificate of Origin. + + + + + + + Defines additional data to print in the Configurable portion of the label, this allows you to print the same type information on the label that can also be printed on the doc tab. + + + + + 1 of 12 possible zones to position data. + + + + + The identifiying text for the data in this zone. + + + + + A reference to a field in either the request or reply to print in this zone following the header. + + + + + A literal value to print after the header in this zone. + + + + + + + The descriptive data for a point-of-contact person. + + + + + Client provided identifier corresponding to this contact information. + + + + + Identifies the contact person's name. + + + + + Identifies the contact person's title. + + + + + Identifies the company this contact is associated with. + + + + + Identifies the phone number associated with this contact. + + + + + Identifies the phone extension associated with this contact. + + + + + Identifies the pager number associated with this contact. + + + + + Identifies the fax number associated with this contact. + + + + + Identifies the email address associated with this contact. + + + + + + + + + + + + + + + + + + + + + Specifies the currency exchange performed on financial amounts for this rate. + + + + + The currency code for the original (converted FROM) currency. + + + + + The currency code for the final (converted INTO) currency. + + + + + Multiplier used to convert fromCurrency units to intoCurrency units. + + + + + + + + + Indicates the type of custom delivery being requested. + + + + + Time by which delivery is requested. + + + + + Range of dates for custom delivery request; only used if type is BETWEEN. + + + + + Date for custom delivery request; only used for types of ON, BETWEEN, or AFTER. + + + + + + + + + + + + + + + Data required to produce a custom-specified document, either at shipment or package level. + + + + + Common information controlling document production. + + + + + Applicable only to documents produced on thermal printers with roll stock. + + + + + Applicable only to documents produced on thermal printers with roll stock. + + + + + Identifies the formatting specification used to construct this custom document. + + + + + + + Constructed string, based on format and zero or more data fields, printed in specified barcode symbology. + + + + + + + + + Width of thinnest bar/space element in the barcode. + + + + + + + + Solid (filled) rectangular area on label. + + + + + + + + + + + + + + + + + + + + + + + + Image to be included from printer's memory, or from a local file for offline clients. + + + + + + Printer-specific index of graphic image to be printed. + + + + + Fully-qualified path and file name for graphic image to be printed. + + + + + + + + + Horizontal position, relative to left edge of custom area. + + + + + Vertical position, relative to top edge of custom area. + + + + + + + Constructed string, based on format and zero or more data fields, printed in specified printer font (for thermal labels) or generic font/size (for plain paper labels). + + + + + + + + Printer-specific font name for use with thermal printer labels. + + + + + Generic font name for use with plain paper labels. + + + + + Generic font size for use with plain paper labels. + + + + + + + + + + + + + + + + + + + Reference information to be associated with this package. + + + + + + + + + + + + + + + + + + + + + + + Allows customer-specified control of label content. + + + + + If omitted, no doc tab will be produced (i.e. default = former NONE type). + + + + + Defines any custom content to print on the label. + + + + + Defines additional data to print in the Configurable portion of the label, this allows you to print the same type information on the label that can also be printed on the doc tab. + + + + + Controls which data/sections will be suppressed. + + + + + For customers producing their own Ground labels, this field specifies which secondary barcode will be printed on the label; so that the primary barcode produced by FedEx has the corect SCNC. + + + + + The language to use when printing the terms and conditions on the label. + + + + + Controls the number of additional copies of supplemental labels. + + + + + This value reduces the default quantity of destination/consignee air waybill labels. A value of zero indicates no change to default. A minimum of one copy will always be produced. + + + + + + + + + + Descriptive data identifying the Broker responsible for the shipmet. + Required if BROKER_SELECT_OPTION is requested in Special Services. + + + + + + Interacts both with properties of the shipment and contractual relationship with the shipper. + + + + + + Applicable only for Commercial Invoice. If the consignee and importer are not the same, the Following importer fields are required. + Importer/Contact/PersonName + Importer/Contact/CompanyName + Importer/Contact/PhoneNumber + Importer/Address/StreetLine[0] + Importer/Address/City + Importer/Address/StateOrProvinceCode - if Importer Country Code is US or CA + Importer/Address/PostalCode - if Importer Country Code is US or CA + Importer/Address/CountryCode + + + + + + Specifies how the recipient is identified for customs purposes; the requirements on this information vary with destination country. + + + + + Indicates how payment of duties for the shipment will be made. + + + + + Indicates whether this shipment contains documents only or non-documents. + + + + + The total customs value for the shipment. This total will rrepresent th esum of the values of all commodities, and may include freight, miscellaneous, and insurance charges. Must contain 2 explicit decimal positions with a max length of 17 including the decimal. For Express International MPS, the Total Customs Value is in the master transaction and all child transactions + + + + + Identifies responsibilities with respect to loss, damage, etc. + + + + + Documents amount paid to third party for coverage of shipment content. + + + + + + CommercialInvoice element is required for electronic upload of CI data. It will serve to create/transmit an Electronic Commercial Invoice through FedEx System. Customers are responsible for printing their own Commercial Invoice. Commercial Invoice support consists of a maximum of 20 commodity line items. + + + + + + For international multiple piece shipments, commodity information must be passed in the Master and on each child transaction. + If this shipment cotains more than four commodities line items, the four highest valued should be included in the first 4 occurances for this request. + + + + + + Country specific details of an International shipment. + + + + + FOOD_OR_PERISHABLE is required by FDA/BTA; must be true for food/perishable items coming to US or PR from non-US/non-PR origin. + + + + + + + Identifies whether or not the products being shipped are required to be accessible during delivery. + + + + + + + + + The descriptive data required for a FedEx shipment containing dangerous goods (hazardous materials). + + + + + Identifies whether or not the products being shipped are required to be accessible during delivery. + + + + + Shipment is packaged/documented for movement ONLY on cargo aircraft. + + + + + Indicates which kinds of hazardous content are in the current package. + + + + + Documents the kinds and quantities of all hazardous commodities in the current package. + + + + + Description of the packaging of this commodity, suitable for use on OP-900 and OP-950 forms. + + + + + Telephone number to use for contact in the event of an emergency. + + + + + Offeror's name or contract number, per DOT regulation. + + + + + + + + + + + + + + + + + + + + + + + + Information about why a shipment delivery is delayed and at what level( country/service etc.). + + + + + The date of the delay + + + + + + The attribute of the shipment that caused the delay(e.g. Country, City, LocationId, Zip, service area, special handling ) + + + + + The point where the delay is occurring (e.g. Origin, Destination, Broker location) + + + + + The reason for the delay (e.g. holiday, weekend, etc.). + + + + + The name of the holiday in that country that is causing the delay. + + + + + + + The attribute of the shipment that caused the delay(e.g. Country, City, LocationId, Zip, service area, special handling ) + + + + + + + + + + + + + + The point where the delay is occurring ( e.g. Origin, Destination, Broker location). + + + + + + + + + + + + Data required to complete the Destionation Control Statement for US exports. + + + + + + Comma-separated list of up to four country codes, required for DEPARTMENT_OF_STATE statement. + + + + + Name of end user, required for DEPARTMENT_OF_STATE statement. + + + + + + + Used to indicate whether the Destination Control Statement is of type Department of Commerce, Department of State or both. + + + + + + + + + The dimensions of this package and the unit type used for the measurements. + + + + + + + + + + + Driving or other transportation distances, distinct from dimension measurements. + + + + + Identifies the distance quantity. + + + + + Identifies the unit of measure for the distance value. + + + + + + + + + + + + + + + The DocTabContentType options available. + + + + + The DocTabContentType should be set to ZONE001 to specify additional Zone details. + + + + + The DocTabContentType should be set to BARCODED to specify additional BarCoded details. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Zone number can be between 1 and 12. + + + + + Header value on this zone. + + + + + Reference path to the element in the request/reply whose value should be printed on this zone. + + + + + Free form-text to be printed in this zone. + + + + + Justification for the text printed on this zone. + + + + + + + Identifies the method by which the package is to be tendered to FedEx. This element does not dispatch a courier for package pickup. + + + + + + + + + + + + Specific information about the delivery of the email and options for the shipment. + + + + + Email address to send the URL to. + + + + + A message to be inserted into the email. + + + + + + + Information describing email notifications that will be sent in relation to events that occur during package movement + + + + + A message that will be included in the email notifications + + + + + Information describing the destination of the email, format of the email and events to be notified on + + + + + + + + + + + + + + + The format of the email + + + + + + + + + + The descriptive data for a FedEx email notification recipient. + + + + + Identifies the relationship this email recipient has to the shipment. + + + + + The email address to send the notification to + + + + + The types of email notifications being requested for this recipient. + + + + + The format of the email notification. + + + + + The language/locale to be used in this email notification. + + + + + + + Identifies the set of valid email notification recipient types. For SHIPPER, RECIPIENT and BROKER the email address asssociated with their definitions will be used, any email address sent with the email notification for these three email notification recipient types will be ignored. + + + + + + + + + + + + + + + + + + + + Customer-declared value, with data type and legal values depending on excise condition, used in defining the taxable value of the item. + + + + + + + Specifies the types of Estimated Duties and Taxes to be included in a rate quotation for an international shipment. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Electronic Trade document references used with the ETD special service. + + + + + Indicates the types of shipping documents produced for the shipper by FedEx (see ShippingDocumentSpecification) which should be copied back to the shipper in the shipment result data. + + + + + Currently not supported. + + + + + + + + Country specific details of an International shipment. + + + + + + Specifies which filing option is being exercised by the customer. + Required for non-document shipments originating in Canada destined for any country other than Canada, the United States, Puerto Rico or the U.S. Virgin Islands. + + + + + + General field for exporting-country-specific export data (e.g. B13A for CA, FTSR Exemption or AES Citation for US). + + + + + This field is applicable only to Canada export non-document shipments of any value to any destination. No special characters allowed. + + 10 + + + + + + Department of Commerce/Department of State information about this shipment. + + + + + + + Details specific to an Express freight shipment. + + + + + Indicates whether or nor a packing list is enclosed. + + + + + + Total shipment pieces. + ie. 3 boxes and 3 pallets of 100 pieces each = Shippers Load and Count of 303. + Applicable to International Priority Freight and International Economy Freight. + Values must be in the range of 1 - 99999 + + + + + + Required for International Freight shipping. Values must be 8- 12 characters in length. + + 12 + + + + + + Currently not supported. + + + + + Currently not supported. + + + + + Currently not supported. + + + + + + + Currently not supported. Delivery contact information for an Express freight shipment. + + + + + + + + + Indicates a FedEx Express operating region. + + + + + + + + + + + + Identifies a kind of FedEx facility. + + + + + + + + + + Specifies the optional features/characteristics requested for a Freight shipment utilizing a flatbed trailer. + + + + + + + + + + + + + + + + + + + + Individual charge which contributes to the total base charge for the shipment. + + + + + Freight class for this line item. + + + + + Effective freight class used for rating this line item. + + + + + NMFC Code for commodity. + + + + + Customer-provided description for this commodity or class line. + + + + + Weight for this commodity or class line. + + + + + Rate or factor applied to this line item. + + + + + Identifies the manner in which the chargeRate for this line item was applied. + + + + + The net or extended charge for this line item. + + + + + + + Specifies the way in which base charges for a Freight shipment or shipment leg are calculated. + + + + + + + + + + + + + + + + These values represent the industry-standard freight classes used for FedEx Freight and FedEx National Freight shipment description. (Note: The alphabetic prefixes are required to distinguish these values from decimal numbers on some client platforms.) + + + + + + + + + + + + + + + + + + + + + + + + + Information about the Freight Service Centers associated with this shipment. + + + + + Information about the origin Freight Service Center. + + + + + Information about the destination Freight Service Center. + + + + + The distance between the origin and destination FreightService Centers + + + + + + + + + + Date for all Freight guarantee types. + + + + + + + + + + + + + Identifies responsibilities with respect to loss, damage, etc. + + + + + + + + + Rate data specific to FedEx Freight or FedEx National Freight services. + + + + + A unique identifier for a specific rate quotation. + + + + + Specifies how total base charge is determined. + + + + + Freight charges which accumulate to the total base charge for the shipment. + + + + + Human-readable descriptions of additional information on this shipment rating. + + + + + + + Additional non-monetary data returned with Freight rates. + + + + + Unique identifier for notation. + + + + + Human-readable explanation of notation. + + + + + + + This class describes the relationship between a customer-specified address and the FedEx Freight / FedEx National Freight Service Center that supports that address. + + + + + Freight Industry standard non-FedEx carrier identification + + + + + The name of the Interline carrier. + + + + + Additional time it might take at the origin or destination to pickup or deliver the freight. This is usually due to the remoteness of the location. This time is included in the total transit time. + + + + + Service branding which may be used for local pickup or delivery, distinct from service used for line-haul of customer's shipment. + + + + + Distance between customer address (pickup or delivery) and the supporting Freight / National Freight service center. + + + + + Time to travel between customer address (pickup or delivery) and the supporting Freight / National Freight service center. + + + + + Specifies when/how the customer can arrange for pickup or delivery. + + + + + Specifies days of operation if localServiceScheduling is LIMITED. + + + + + Freight service center that is a gateway on the border of Canada or Mexico. + + + + + Alphabetical code identifying a Freight Service Center + + + + + Freight service center Contact and Address + + + + + + + Specifies the type of service scheduling offered from a Freight or National Freight Service Center to a customer-supplied address. + + + + + + + + + + Data applicable to shipments using FEDEX_FREIGHT and FEDEX_NATIONAL_FREIGHT services. + + + + + Account number used with FEDEX_FREIGHT service. + + + + + Used for validating FedEx Freight account number and (optionally) identifying third party payment on the bill of lading. + + + + + Account number used with FEDEX_NATIONAL_FREIGHT service. + + + + + Used for validating FedEx National Freight account number and (optionally) identifying third party payment on the bill of lading. + + + + + Indicates the role of the party submitting the transaction. + + + + + Designates which of the requester's tariffs will be used for rating. + + + + + Identifies the declared value for the shipment + + + + + Identifies the declared value units corresponding to the above defined declared value + + + + + + Identifiers for promotional discounts offered to customers. + + + + + Total number of individual handling units in the entire shipment (for unit pricing). + + + + + Estimated discount rate provided by client for unsecured rate quote. + + + + + Total weight of pallets used in shipment. + + + + + Overall shipment dimensions. + + + + + Description for the shipment. + + + + + Specifies which party will pay surcharges for any special services which support split billing. + + + + + Details of the commodities in the shipment. + + + + + + + Description of an individual commodity or class of content in a shipment. + + + + + Freight class for this line item. + + + + + Specification of handling-unit packaging for this commodity or class line. + + + + + Customer-provided description for this commodity or class line. + + + + + Weight for this commodity or class line. + + + + + FED EX INTERNAL USE ONLY - Individual line item dimensions. + + + + + Volume (cubic measure) for this commodity or class line. + + + + + + + Indicates the role of the party submitting the transaction. + + + + + + + + + + Specifies which party will be responsible for payment of any surcharges for Freight special services for which split billing is allowed. + + + + + Identifies the special service. + + + + + Indicates who will pay for the special service. + + + + + + + Data required to produce a General Agency Agreement document. Remaining content (business data) to be defined once requirements have been completed. + + + + + + + + Documents the kind and quantity of an individual hazardous commodity in a package. + + + + + Identifies and describes an individual hazardous commodity. + + + + + Specifies the amount of the commodity in alternate units. + + + + + Customer-provided specifications for handling individual commodities. + + + + + + + Identifies and describes an individual hazardous commodity. For 201001 load, this is based on data from the FedEx Ground Hazardous Materials Shipping Guide. + + + + + Regulatory identifier for a commodity (e.g. "UN ID" value). + + + + + + + + + + + + + Specifies how the commodity is to be labeled. + + + + + + + + + + Customer-provided specifications for handling individual commodities. + + + + + Specifies how the customer wishes the label text to be handled for this commodity in this package. + + + + + Text used in labeling the commodity under control of the labelTextOption field. + + + + + + + Indicates which kind of hazardous content (as defined by DOT) is being reported. + + + + + + + + + + + + Identifies number and type of packaging units for hazardous commodities. + + + + + Number of units of the type below. + + + + + Units in which the hazardous commodity is packaged. + + + + + + + Identifies DOT packing group for a hazardous commodity. + + + + + + + + + + Identifies amount and units for quantity of hazardous commodities. + + + + + Number of units of the type below. + + + + + Units by which the hazardous commodity is measured. + + + + + + + Descriptive data required for a FedEx shipment that is to be held at the destination FedEx location for pickup by the recipient. + + + + + Contact phone number for recipient of shipment. + + + + + Contact and address of FedEx facility at which shipment is to be held. + + + + + Type of facility at which package/shipment is to be held. + + + + + Location identification (for facilities identified by an alphanumeric location code). + + + + + Location identification (for facilities identified by an numeric location code). + + + + + + + The descriptive data required by FedEx for home delivery services. + + + + + + Required for Date Certain Home Delivery. + + + + + Required for Date Certain and Appointment Home Delivery. + + 15 + + + + + + + + + + + + + + + + + + + + + + + + The type of International shipment. + + + + + + + + + Specifies the type of label to be returned. + + + + + + + + + + + + + Names for data elements / areas which may be suppressed from printing on labels. + + + + + + + + + + + + + + + + + This indicates if the top or bottom of the label comes out of the printer first. + + + + + + + + + Relative to normal orientation for the printer. + + + + + + + + + + + Description of shipping label to be returned in the reply + + + + + Specify type of label to be returned + + + + + + The type of image or printer commands the label is to be formatted in. + DPL = Unimark thermal printer language + EPL2 = Eltron thermal printer language + PDF = a label returned as a pdf image + PNG = a label returned as a png image + ZPLII = Zebra thermal printer language + + + + + + For thermal printer lables this indicates the size of the label and the location of the doc tab if present. + + + + + This indicates if the top or bottom of the label comes out of the printer first. + + + + + Relative to normal orientation for the printer. RIGHT=90 degrees clockwise, UPSIDE_DOWN=180 degrees, LEFT=90 degrees counterclockwise. + + + + + If present, this contact and address information will replace the return address information on the label. + + + + + Allows customer-specified control of label content. + + + + + + + For thermal printer labels this indicates the size of the label and the location of the doc tab if present. + + + + + + + + + + + + + + + + + + + + + + Identifies the Liability Coverage Amount. For Jan 2010 this value represents coverage amount per pound + + + + + + + + + + + + + Represents a one-dimensional measurement in small units (e.g. suitable for measuring a package or document), contrasted with Distance, which represents a large one-dimensional measurement (e.g. distance between cities). + + + + + The numerical quantity of this measurement. + + + + + The units for this measurement. + + + + + + + CM = centimeters, IN = inches + + + + + + + + + Identifies the representation of human-readable text. + + + + + Two-letter code for language (e.g. EN, FR, etc.) + + + + + Two-letter code for the region (e.g. us, ca, etc..). + + + + + + + + + + + + + Internal FedEx use only. + + + + + + + + + + + + + + + + + + Data required to produce a Certificate of Origin document. Remaining content (business data) to be defined once requirements have been completed. + + + + + + + Indicates which Party (if any) from the shipment is to be used as the source of importer data on the NAFTA COO form. + + + + + Contact information for "Authorized Signature" area of form. + + + + + + + + + + + + Defined by NAFTA regulations. + + + + + Defined by NAFTA regulations. + + + + + Identification of which producer is associated with this commodity (if multiple producers are used in a single shipment). + + + + + + Date range over which RVC net cost was calculated. + + + + + + + + + + + + + + + + Net cost method used. + + + + + + + + + + See instructions for NAFTA Certificate of Origin for code definitions. + + + + + + + + + + + + + + + + + + + See instructions for NAFTA Certificate of Origin for code definitions. + + + + + + + + + + + + + + + + + + + + The descriptive data regarding the result of the submitted transaction. + + + + + The severity of this notification. This can indicate success or failure or some other information about the request. The values that can be returned are SUCCESS - Your transaction succeeded with no other applicable information. NOTE - Additional information that may be of interest to you about your transaction. WARNING - Additional information that you need to know about your transaction that you may need to take action on. ERROR - Information about an error that occurred while processing your transaction. FAILURE - FedEx was unable to process your transaction at this time due to a system failure. Please try again later + + + + + Indicates the source of this notification. Combined with the Code it uniquely identifies this notification + + + + + A code that represents this notification. Combined with the Source it uniquely identifies this notification. + + + + + Human-readable text that explains this notification. + + + + + The translated message. The language and locale specified in the ClientDetail. Localization are used to determine the representation. Currently only supported in a TrackReply. + + + + + A collection of name/value pairs that provide specific data to help the client determine the nature of an error (or warning, etc.) witout having to parse the message string. + + + + + + + + + Identifies the type of data contained in Value (e.g. SERVICE_TYPE, PACKAGE_SEQUENCE, etc..). + + + + + The value of the parameter (e.g. PRIORITY_OVERNIGHT, 2, etc..). + + + + + + + Identifies the set of severity values for a Notification. + + + + + + + + + + + + The instructions indicating how to print the OP-900 form for hazardous materials packages. + + + + + Specifies characteristics of a shipping document to be produced. + + + + + Identifies which reference type (from the package's customer references) is to be used as the source for the reference on this OP-900. + + + + + Specifies the usage and identification of customer supplied images to be used on this document. + + + + + Data field to be used when a name is to be printed in the document instead of (or in addition to) a signature image. + + + + + + + The Oversize classification for a package. + + + + + + + + + + Data for a package's rates, as calculated per a specific rate type. + + + + + Type used for this specific set of rate data. + + + + + Indicates which weight was used. + + + + + INTERNAL FEDEX USE ONLY. + + + + + The weight that was used to calculate the rate. + + + + + The dimensional weight of this package (if greater than actual). + + + + + The oversize weight of this package (if the package is oversize). + + + + + The transportation charge only (prior to any discounts applied) for this package. + + + + + The sum of all discounts on this package. + + + + + This package's baseCharge - totalFreightDiscounts. + + + + + The sum of all surcharges on this package. + + + + + This package's netFreight + totalSurcharges (not including totalTaxes). + + + + + The sum of all taxes on this package. + + + + + This package's netFreight + totalSurcharges + totalTaxes. + + + + + The total sum of all rebates applied to this package. + + + + + All rate discounts that apply to this package. + + + + + All rebates that apply to this package. + + + + + All surcharges that apply to this package (either because of characteristics of the package itself, or because it is carrying per-shipment surcharges for the shipment of which it is a part). + + + + + All taxes applicable (or distributed to) this package. + + + + + The variable handling charges calculated based on the type variable handling charges requested. + + + + + + + Identifies the collection of special services offered by FedEx. + + + + + + + + + + + + + + + These special services are available at the package level for some or all service types. If the shipper is requesting a special service which requires additional data, the package special service type must be present in the specialServiceTypes collection, and the supporting detail must be provided in the appropriate sub-object below. + + + + + The types of all special services requested for the enclosing shipment or package. + + + + + For use with FedEx Ground services only; COD must be present in shipment's special services. + + + + + Descriptive data required for a FedEx shipment containing dangerous materials. This element is required when SpecialServiceType.DANGEROUS_GOODS or HAZARDOUS_MATERIAL is present in the SpecialServiceTypes collection. + + + + + Descriptive data required for a FedEx shipment containing dry ice. This element is required when SpecialServiceType.DRY_ICE is present in the SpecialServiceTypes collection. + + + + + The descriptive data required for FedEx signature services. This element is required when SpecialServiceType.SIGNATURE_OPTION is present in the SpecialServiceTypes collection. + + + + + To be filled. + + + + + + + Identifies the packaging used by the requestor for the package. See PackagingType for list of valid enumerated values. + + + + + + + + + + + + + + The descriptive data for a person or company entitiy doing business with FedEx. + + + + + Identifies the FedEx account number assigned to the customer. + + 12 + + + + + + Descriptive data for taxpayer identification information. + + + + + Descriptive data identifying the point-of-contact person. + + + + + The descriptive data for a physical location. + + + + + + + The descriptive data for the monetary compensation given to FedEx for services rendered to the customer. + + + + + Identifies the method of payment for a service. See PaymentType for list of valid enumerated values. + + + + + Descriptive data identifying the party responsible for payment for a service. + + + + + + + Identifies the method of payment for a service. + + + + + + + + Descriptive data identifying the party responsible for payment for a service. + + + + + Identifies the FedEx account number assigned to the payor. + + 12 + + + + + + Identifies the country of the payor. + + + + + + + This information describes the kind of pending shipment being requested. + + + + + + Date after which the pending shipment will no longer be available for completion. + + + + + Only used with type of EMAIL. + + + + + + + + + + + + This enumeration rationalizes the former FedEx Express international "admissibility package" types (based on ANSI X.12) and the FedEx Freight packaging types. The values represented are those common to both carriers. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This class describes the pickup characteristics of a shipment (e.g. for use in a tag request). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Currently not supported. + + + + + + + + + + + + + + + + + + Indicates the reason that a dim divisor value was chose. + + + + + + + + + + + + Identifies a discount applied to the shipment. + + + + + Identifies the type of discount applied to the shipment. + + + + + + The amount of the discount applied to the shipment. + + + + + The percentage of the discount applied to the shipment. + + + + + + + Identifies the type of discount applied to the shipment. + + + + + + + + + + + + Selects the value from a set of rate data to which the percentage is applied. + + + + + + + + + + + The response to a RateRequest. The Notifications indicate whether the request was successful or not. + + + + + This indicates the highest level of severity of all the notifications returned in this reply. + + + + + The descriptive data regarding the results of the submitted transaction. + + + + + Contains the CustomerTransactionId that was sent in the request. + + + + + The version of this reply. + + + + + Each element contains all rate data for a single service. If service was specified in the request, there will be a single entry in this array; if service was omitted in the request, there will be a separate entry in this array for each service being compared. + + + + + + + + + Identifies the FedEx service to use in shipping the package. See ServiceType for list of valid enumerated values. + + + + + Identifies the packaging used by the requestor for the package. See PackagingType for list of valid enumerated values. + + + + + Shows the specific combination of service options combined with the service type that produced this committment in the set returned to the caller. + + + + + Supporting detail for applied options identified in preceding field. + + + + + + + + + Identification of an airport, using standard three-letter abbreviations. + + + + + Indicates whether or not this shipment is eligible for a money back guarantee. + + + + + Commitment code for the origin. + + + + + Commitment code for the destination. + + + + + Time in transit from pickup to delivery. + + + + + Maximum expected transit time + + + + + The signature option for this package. + + + + + The actual rate type of the charges for this package. + + + + + Each element contains all rate data for a single rate type. + + + + + + + Descriptive data sent to FedEx by a customer in order to rate a package/shipment. + + + + + Descriptive data to be used in authentication of the sender's identity (and right to use FedEx web services). + + + + + Descriptive data identifying the client submitting the transaction. + + + + + Descriptive data for this customer transaction. The TransactionDetail from the request is echoed back to the caller in the corresponding reply. + + + + + Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply). + + + + + Allows the caller to specify that the transit time and commit data are to be returned in the reply. + + + + + Candidate carriers for rate-shopping use case. This field is only considered if requestedShipment/serviceType is omitted. + + + + + Contains zero or more service options whose combinations are to be considered when replying with available services. + + + + + The shipment for which a rate quote (or rate-shopping comparison) is desired. + + + + + + + Indicates the type of rates to be returned. + + + + + + + + + Select the type of rate from which the element is to be selected. + + + + + + + + + If requesting rates using the PackageDetails element (one package at a time) in the request, the rates for each package will be returned in this element. Currently total piece total weight rates are also retuned in this element. + + + + + Echoed from the corresponding package in the rate request (if provided). + + + + + Used with request containing PACKAGE_GROUPS, to identify which group of identical packages was used to produce a reply item. + + + + + The difference between "list" and "account" net charge. + + + + + Ground COD is shipment level. + + + + + + Rate data that are tied to a specific package and rate type combination. + + + + + + + This class groups the shipment and package rating data for a specific rate type for use in a rating reply, which groups result data by rate type. + + + + + The difference between "list" and "account" total net charge. + + + + + Express COD is shipment level. + + + + + The shipment-level totals for this rate type. + + + + + The package-level data for this rate type. + + + + + + + The method used to calculate the weight to be used in rating the package.. + + + + + + + + + + + + + + + + + + + Identifies a discount applied to the shipment. + + + + + + + The amount of the discount applied to the shipment. + + + + + The percentage of the discount applied to the shipment. + + + + + + + Identifies the type of discount applied to the shipment. + + + + + + + + + + Specifies how the recipient is identified for customs purposes; the requirements on this information vary with destination country. + + + + + Specifies the kind of identification being used. + + + + + Contains the actual ID value, of the type specified above. + + + + + + + Type of Brazilian taxpayer identifier provided in Recipient/TaxPayerIdentification/Number. For shipments bound for Brazil this overrides the value in Recipient/TaxPayerIdentification/TinType + + + + + + + + + + FOOD_OR_PERISHABLE is required by FDA/BTA; must be true for food/perishable items coming to US or PR from non-US/non-PR origin + + + + + + + + + + This class rationalizes RequestedPackage and RequestedPackageSummary from previous interfaces. The way in which it is uses within a RequestedShipment depends on the RequestedPackageDetailType value specified for that shipment. + + + + + Used only with INDIVIDUAL_PACKAGE, as a unique identifier of each requested package. + + + + + Used only with PACKAGE_GROUPS, as a unique identifier of each group of identical packages. + + + + + Used only with PACKAGE_GROUPS, as a count of packages within a group of identical packages. + + + + + + Only used for INDIVIDUAL_PACKAGES and PACKAGE_GROUPS. Ignored for PACKAGE_SUMMARY, in which case totalInsuredValue and packageCount on the shipment will be used to determine this value. + + + + + Only used for INDIVIDUAL_PACKAGES and PACKAGE_GROUPS. Ignored for PACKAGE_SUMMARY, in which case totalweight and packageCount on the shipment will be used to determine this value. + + + + + + Provides additional detail on how the customer has physically packaged this item. As of June 2009, required for packages moving under international and SmartPost services. + + + + + Human-readable text describing the package. + + + + + + + Only used for INDIVIDUAL_PACKAGES and PACKAGE_GROUPS. + + + + + + + The descriptive data for the shipment being tendered to FedEx. + + + + + Identifies the date and time the package is tendered to FedEx. Both the date and time portions of the string are expected to be used. The date should not be a past date or a date more than 10 days in the future. The time is the local time of the shipment based on the shipper's time zone. The date component must be in the format: YYYY-MM-DD (e.g. 2006-06-26). The time component must be in the format: HH:MM:SS using a 24 hour clock (e.g. 11:00 a.m. is 11:00:00, whereas 5:00 p.m. is 17:00:00). The date and time parts are separated by the letter T (e.g. 2006-06-26T17:00:00). There is also a UTC offset component indicating the number of hours/mainutes from UTC (e.g 2006-06-26T17:00:00-0400 is defined form June 26, 2006 5:00 pm Eastern Time). + + + + + Identifies the method by which the package is to be tendered to FedEx. This element does not dispatch a courier for package pickup. See DropoffType for list of valid enumerated values. + + + + + Identifies the FedEx service to use in shipping the package. See ServiceType for list of valid enumerated values. + + + + + Identifies the packaging used by the requestor for the package. See PackagingType for list of valid enumerated values. + + + + + Identifies the total weight of the shipment being conveyed to FedEx.This is only applicable to International shipments and should only be used on the first package of a mutiple piece shipment.This value contains 1 explicit decimal position + + + + + Total insured amount. + + + + + Descriptive data identifying the party responsible for shipping the package. Shipper and Origin should have the same address. + + + + + Descriptive data identifying the party receiving the package. + + + + + A unique identifier for a recipient location + + 10 + + + + + + Physical starting address for the shipment, if different from shipper's address. + + + + + Descriptive data indicating the method and means of payment to FedEx for providing shipping services. + + + + + Descriptive data regarding special services requested by the shipper for this shipment. If the shipper is requesting a special service which requires additional data (e.g. COD), the special service type must be present in the specialServiceTypes collection, and the supporting detail must be provided in the appropriate sub-object. For example, to request COD, "COD" must be included in the SpecialServiceTypes collection and the CodDetail object must contain the required data. + + + + + Details specific to an Express freight shipment. + + + + + Data applicable to shipments using FEDEX_FREIGHT and FEDEX_NATIONAL_FREIGHT services. + + + + + Used with Ground Home Delivery and Freight. + + + + + Details about how to calculate variable handling charges at the shipment level. + + + + + Customs clearance data, used for both international and intra-country shipping. + + + + + For use in "process tag" transaction. + + + + + Specifies the characteristics of a shipment pertaining to SmartPost services. + + + + + If true, only the shipper/payor will have visibility of this shipment. + + + + + Details about the image format and printer type the label is to returned in. + + + + + Contains data used to create additional (non-label) shipping documents. + + + + + Specifies whether and what kind of rates the customer wishes to have quoted on this shipment. The reply will also be constrained by other data on the shipment and customer. + + + + + Specifies whether the customer wishes to have Estimated Duties and Taxes provided with the rate quotation on this shipment. Only applies with shipments moving under international services. + + + + + The total number of packages in the entire shipment (even when the shipment spans multiple transactions.) + + + + + Specifies which package-level data values are provided at the shipment-level only. The package-level data values types specified here will not be provided at the package-level. + + + + + One or more package-attribute descriptions, each of which describes an individual package, a group of identical packages, or (for the total-piece-total-weight case) common characteristics all packages in the shipment. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + These values are used to control the availability of certain special services at the time when a customer uses the e-mail label link to create a return shipment. + + + + + + + + + + + + Identifies the allowed (merchant-authorized) special services which may be selected when the subsequent shipment is created. Only services represented in EMailLabelAllowedSpecialServiceType will be controlled by this list. + + + + + + + Information relating to a return shipment. + + + + + The type of return shipment that is being requested. At present the only type of retrun shipment that is supported is PRINT_RETURN_LABEL. With this option you can print a return label to insert into the box of an outbound shipment. This option can not be used to print an outbound label. + + + + + Return Merchant Authorization + + + + + Specific information about the delivery of the email and options for the shipment. + + + + + + + The type of return shipment that is being requested. + + + + + + + + + + The "PAYOR..." rates are expressed in the currency identified in the payor's rate table(s). The "RATED..." rates are expressed in the currency of the origin country. Former "...COUNTER..." values have become "...RETAIL..." values, except for PAYOR_COUNTER and RATED_COUNTER, which have been removed. + + + + + + + + + + + + + + + Return Merchant Authorization + + + + + Return Merchant Authorization Number + + 20 + + + + + + The reason for the return. + + 60 + + + + + + + + + + + + + + + + These values control the optional features of service that may be combined in a commitment/rate comparision transaction. + + + + + + + + + + + Supporting detail for applied options identified in a rate quote. + + + + + Identifies the type of Freight Guarantee applied, if FREIGHT_GUARANTEE is applied to the rate quote. + + + + + Identifies the smartPostHubId used during rate quote, if SMART_POST_HUB_ID is a variable option on the rate request. + + + + + Identifies the indicia used during rate quote, if SMART_POST_ALLOWED_INDICIA is a variable option on the rate request. + + + + + + + Identifies the FedEx service to use in shipping the package. See ServiceType for list of valid enumerated values. + + + + + + + + + + + + + + + + + + + + + + + + + + + + Shipment-level totals of dry ice data across all packages. + + + + + Total number of packages in the shipment that contain dry ice. + + + + + Total shipment dry ice weight for all packages. + + + + + + + Data for a single leg of a shipment's total/summary rates, as calculated per a specific rate type. + + + + + Human-readable text describing the shipment leg. + + + + + Origin for this leg. + + + + + Destination for this leg. + + + + + Type used for this specific set of rate data. + + + + + Indicates the rate scale used. + + + + + Indicates the rate zone used (based on origin and destination). + + + + + + Indicates which weight was used. + + + + + INTERNAL FEDEX USE ONLY. + + + + + Specifies the currency exchange performed on financial amounts for this rate. + + + + + Indicates which special rating cases applied to this shipment. + + + + + + Identifies the type of dim divisor that was applied. + + + + + + + Sum of dimensional weights for all packages. + + + + + + + + + This shipment's totalNetFreight + totalSurcharges (not including totalTaxes). + + + + + Total of the transportation-based taxes. + + + + + + + Total of all values under this shipment's dutiesAndTaxes; only provided if estimated duties and taxes were calculated for this shipment. + + + + + This shipment's totalNetCharge + totalDutiesAndTaxes; only provided if estimated duties and taxes were calculated for this shipment AND duties, taxes and transportation charges are all paid by the same sender's account. + + + + + Rate data specific to FedEx Freight and FedEx National Freight services. + + + + + All rate discounts that apply to this shipment. + + + + + All rebates that apply to this shipment. + + + + + All surcharges that apply to this shipment. + + + + + All transportation-based taxes applicable to this shipment. + + + + + All commodity-based duties and taxes applicable to this shipment. + + + + + The "order level" variable handling charges. + + + + + The total of all variable handling charges at both shipment (order) and package level. + + + + + + + These values identify which package-level data values will be provided at the shipment-level. + + + + + + + + + + Data for a shipment's total/summary rates, as calculated per a specific rate type. The "total..." fields may differ from the sum of corresponding package data for Multiweight or Express MPS. + + + + + Type used for this specific set of rate data. + + + + + Indicates the rate scale used. + + + + + Indicates the rate zone used (based on origin and destination). + + + + + Indicates the type of pricing used for this shipment. + + + + + Indicates which weight was used. + + + + + INTERNAL FEDEX USE ONLY. + + + + + Specifies the currency exchange performed on financial amounts for this rate. + + + + + Indicates which special rating cases applied to this shipment. + + + + + The value used to calculate the weight based on the dimensions. + + + + + Identifies the type of dim divisor that was applied. + + + + + + The weight used to calculate these rates. + + + + + Sum of dimensional weights for all packages. + + + + + + The total discounts used in the rate calculation. + + + + + The freight charge minus discounts. + + + + + The total amount of all surcharges applied to this shipment. + + + + + This shipment's totalNetFreight + totalSurcharges (not including totalTaxes). + + + + + Total of the transportation-based taxes. + + + + + The net charge after applying all discounts and surcharges. + + + + + The total sum of all rebates applied to this shipment. + + + + + Total of all values under this shipment's dutiesAndTaxes; only provided if estimated duties and taxes were calculated for this shipment. + + + + + This shipment's totalNetCharge + totalDutiesAndTaxes; only provided if estimated duties and taxes were calculated for this shipment AND duties, taxes and transportation charges are all paid by the same sender's account. + + + + + Identifies the Rate Details per each leg in a Freight Shipment + + + + + Rate data specific to FedEx Freight and FedEx National Freight services. + + + + + All rate discounts that apply to this shipment. + + + + + All rebates that apply to this shipment. + + + + + All surcharges that apply to this shipment. + + + + + All transportation-based taxes applicable to this shipment. + + + + + All commodity-based duties and taxes applicable to this shipment. + + + + + The "order level" variable handling charges. + + + + + The total of all variable handling charges at both shipment (order) and package level. + + + + + + + Identifies the collection of special service offered by FedEx. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + These special services are available at the shipment level for some or all service types. If the shipper is requesting a special service which requires additional data (such as the COD amount), the shipment special service type must be present in the specialServiceTypes collection, and the supporting detail must be provided in the appropriate sub-object below. + + + + + The types of all special services requested for the enclosing shipment (or other shipment-level transaction). + + + + + Descriptive data required for a FedEx COD (Collect-On-Delivery) shipment. This element is required when SpecialServiceType.COD is present in the SpecialServiceTypes collection. + + + + + Descriptive data required for a FedEx shipment that is to be held at the destination FedEx location for pickup by the recipient. This element is required when SpecialServiceType.HOLD_AT_LOCATION is present in the SpecialServiceTypes collection. + + + + + Descriptive data required for FedEx to provide email notification to the customer regarding the shipment. This element is required when SpecialServiceType.EMAIL_NOTIFICATION is present in the SpecialServiceTypes collection. + + + + + The descriptive data required for FedEx Printed Return Label. This element is required when SpecialServiceType.PRINTED_RETURN_LABEL is present in the SpecialServiceTypes collection + + + + + This field should be populated for pending shipments (e.g. e-mail label) It is required by a PENDING_SHIPMENT special service type. + + + + + The number of packages with dry ice and the total weight of the dry ice. + + + + + The descriptive data required for FedEx Home Delivery options. This element is required when SpecialServiceType.HOME_DELIVERY_PREMIUM is present in the SpecialServiceTypes collection + + + + + + + Electronic Trade document references. + + + + + Specification for date or range of dates on which delivery is to be attempted. + + + + + + + Each occurrence of this class specifies a particular way in which a kind of shipping document is to be produced and provided. + + + + + Values in this field specify how to create and return the document. + + + + + Specifies how to organize all documents of this type. + + + + + Specifies how to e-mail document images. + + + + + Specifies how a queued document is to be printed. + + + + + + + Specifies how to return a shipping document to the caller. + + + + + + + + + + + + + + Specifies how to e-mail shipping documents. + + + + + Provides the roles and email addresses for e-mail recipients. + + + + + Identifies the convention by which documents are to be grouped as e-mail attachments. + + + + + + + + + + + + + Specifies an individual recipient of e-mailed shipping document(s). + + + + + Identifies the relationship of this recipient in the shipment. + + + + + Address to which the document is to be sent. + + + + + + + Specifies characteristics of a shipping document to be produced. + + + + + Specifies how to create, organize, and return the document. + + + + + Specifies how far down the page to move the beginning of the image; allows for printing on letterhead and other pre-printed stock. + + + + + + + For those shipping document types which have both a "form" and "instructions" component (e.g. NAFTA Certificate of Origin and General Agency Agreement), this field indicates whether to provide the instructions. + + + + + Governs the language to be used for this individual document, independently from other content returned for the same shipment. + + + + + + + Specifies how to organize all shipping documents of the same type. + + + + + + + + + Specifies the image format used for a shipping document. + + + + + + + + + + + + Specifies printing options for a shipping document. + + + + + Provides environment-specific printer identification. + + + + + + + Contains all data required for additional (non-label) shipping documents to be produced in conjunction with a specific shipment. + + + + + Indicates the types of shipping documents requested by the shipper. + + + + + + + Specifies the production of each package-level custom document (the same specification is used for all packages). + + + + + Specifies the production of a shipment-level custom document. + + + + + Details pertaining to the GAA. + + + + + Details pertaining to NAFTA COO. + + + + + Specifies the production of the OP-900 document for hazardous materials packages. + + + + + + + Specifies the type of paper (stock) on which a document will be printed. + + + + + + + + + + + + + + + + + The descriptive data required for FedEx delivery signature services. + + + + + Identifies the delivery signature services option selected by the customer for this shipment. See OptionType for the list of valid values. + + + + + Identifies the delivery signature release authorization number. + + 10 + + + + + + + + Identifies the delivery signature services options offered by FedEx. + + + + + + + + + + + + These values are mutually exclusive; at most one of them can be attached to a SmartPost shipment. + + + + + + + + + + + + + + + + + + + + + Data required for shipments handled under the SMART_POST and GROUND_SMART_POST service types. + + + + + + + + + + + Indicates which special rating cases applied to this shipment. + + + + + + + + + Identifies each surcharge applied to the shipment. + + + + + The type of surcharge applied to the shipment. + + + + + + + The amount of the surcharge applied to the shipment. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Identifies each tax applied to the shipment. + + + + + + + + + + + + + + + + + + + + + Specifice the kind of tax or miscellaneous charge being reported on a Commercial Invoice. + + + + + + + + + + + + + The descriptive data for taxpayer identification information. + + + + + Identifies the category of the taxpayer identification number. See TinType for the list of values. + + + + + Identifies the taxpayer identification number. + + 18 + + + + + + Identifies the usage of Tax Identification Number in Shipment processing + + + + + + + + Required for dutiable international express or ground shipment. This field is not applicable to an international PIB (document) or a non-document which does not require a commercial invoice express shipment. + CFR_OR_CPT (Cost and Freight/Carriage Paid TO) + CIF_OR_CIP (Cost Insurance and Freight/Carraige Insurance Paid) + DDP (Delivered Duty Paid) + DDU (Delivered Duty Unpaid) + EXW (Ex Works) + FOB_OR_FCA (Free On Board/Free Carrier) + + + + + + + + + + + + + + Identifies the category of the taxpayer identification number. + + + + + + + + + + + + + + + + + + + + + + + + + + Descriptive data for this customer transaction. The TransactionDetail from the request is echoed back to the caller in the corresponding reply. + + + + + Free form text to be echoed back in the reply. Used to match requests and replies. + + + + + Governs data payload language/translations (contrasted with ClientDetail.localization, which governs Notification.localizedMessage language selection). + + + + + + + Time in transit from pickup to delivery. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This definition of variable handling charge detail is intended for use in Jan 2011 corp load. + + + + + Used with Variable handling charge type of FIXED_VALUE. Contains the amount to be added to the freight charge. Contains 2 explicit decimal positions with a total max length of 10 including the decimal. + + + + + Actual percentage (10 means 10%, which is a mutiplier of 0.1) + + + + + Select the value from a set of rate data to which the percentage is applied. + + + + + Select the type of rate from which the element is to be selected. + + + + + + + The variable handling charges calculated based on the type variable handling charges requested. + + + + + The variable handling charge amount calculated based on the requested variable handling charge detail. + + + + + The calculated varibale handling charge plus the net charge. + + + + + + + Three-dimensional volume/cubic measurement. + + + + + + + + + Units of three-dimensional volume/cubic measure. + + + + + + + + + The descriptive data for the heaviness of an object. + + + + + Identifies the unit of measure associated with a weight value. + + + + + Identifies the weight value of a package/shipment. + + + + + + + Identifies the unit of measure associated with a weight value. See WeightUnits for the list of valid enumerated values. + + + + + + + + + Used in authentication of the sender's identity. + + + + + Credential used to authenticate a specific software application. This value is provided by FedEx after registration. + + + + + + + Two part authentication string used for the sender's identity + + + + + Identifying part of authentication credential. This value is provided by FedEx after registration + + + + + Secret part of authentication key. This value is provided by FedEx after registration. + + + + + + + Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply). + + + + + Identifies a system or sub-system which performs an operation. + + + + + Identifies the service business level. + + + + + Identifies the service interface level. + + + + + Identifies the service code level. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/code/core/Mage/Usa/etc/wsdl/FedEx/ShipService_v10.wsdl b/app/code/core/Mage/Usa/etc/wsdl/FedEx/ShipService_v10.wsdl new file mode 100644 index 0000000000..aca35b6b05 --- /dev/null +++ b/app/code/core/Mage/Usa/etc/wsdl/FedEx/ShipService_v10.wsdl @@ -0,0 +1,5472 @@ + + + + + + + + + + + + + + + + + + Specifies additional labels to be produced. All required labels for shipments will be produced without the need to request additional labels. These are only available as thermal labels. + + + + + The type of additional labels to return. + + + + + The number of this type label to return + + + + + + + Identifies the type of additional labels. + + + + + + + + + + + + + + + + Descriptive data for a physical location. May be used as an actual physical address (place to which one could go), or as a container of "address parts" which should be handled as a unit (such as a city-state-ZIP combination within the US). + + + + + Combination of number, street name, etc. At least one line is required for a valid physical address; empty lines should not be included. + + + + + Name of city, town, etc. + + + + + Identifying abbreviation for US state, Canada province, etc. Format and presence of this field will vary, depending on country. + + + + + Identification of a region (usually small) for mail/package delivery. Format and presence of this field will vary, depending on country. + + + + + Relevant only to addresses in Puerto Rico. + + + + + The two-letter code used to identify a country. + + + + + Indicates whether this address residential (as opposed to commercial). + + + + + + + + + Position of Astra element + + + + + Content corresponding to the Astra Element + + + + + + + + Specifies which filing option is being exercised by the customer. + Required for non-document shipments originating in Canada destined for any country other than Canada, the United States, Puerto Rico or the U.S. Virgin Islands. + + + + + + + + + + + + Identification of the type of barcode (symbology) used on FedEx documents and labels. + + + + + + + + + + Each instance of this data type represents a barcode whose content must be represented as binary data (i.e. not ASCII text). + + + + + The kind of barcode data in this instance. + + + + + The data content of this instance. + + + + + + + + + + + + + + + + + + + + Descriptive data sent to FedEx by a customer in order to Cancel a Pending shipment. + + + + + Descriptive data to be used in authentication of the sender's identity (and right to use FedEx web services). + + + + + Descriptive data identifying the client submitting the transaction. + + + + + Descriptive data for this customer transaction. The TransactionDetail from the request is echoed back to the caller in the corresponding reply. + + + + + Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply). + + + + + + + + Identification of a FedEx operating company (transportation). + + + + + + + + + + + + + The instructions indicating how to print the Certificate of Origin ( e.g. whether or not to include the instructions, image type, etc ...) + + + + + Specifies characteristics of a shipping document to be produced. + + + + + Specifies the usage and identification of customer supplied images to be used on this document. + + + + + + + Specifies the type of brokerage to be applied to a shipment. + + + + + + + + + + + + Descriptive data for the client submitting a transaction. + + + + + The FedEx account number associated with this transaction. + + + + + This number is assigned by FedEx and identifies the unique device from which the request is originating + + + + + Only used in transactions which require identification of the Fed Ex Office integrator. + + + + + The language to be used for human-readable Notification.localizedMessages in responses to the request containing this ClientDetail object. Different requests from the same client may contain different Localization data. (Contrast with TransactionDetail.localization, which governs data payload language/translation.) + + + + + + + Identifies what freight charges should be added to the COD collect amount. + + + + + + + + + + + + + + + + + + + Identifies the type of funds FedEx should collect upon shipment delivery. + + + + + + + + + + + + Descriptive data required for a FedEx COD (Collect-On-Delivery) shipment. + + + + + + Identifies if freight charges are to be added to the COD amount. This element determines which freight charges should be added to the COD collect amount. See CodAddTransportationChargesType for a list of valid enumerated values. + + + + + Identifies the type of funds FedEx should collect upon package delivery + + + + + For Express this is the descriptive data that is used for the recipient of the FedEx Letter containing the COD payment. For Ground this is the descriptive data for the party to receive the payment that prints the COD receipt. + + + + + Indicates which type of reference information to include on the COD return shipping label. + + + + + + + + + The COD amount (after any accumulations) that must be collected upon delivery of a package shipped using the COD special service. + + + + + + Contains the data which form the Astra and 2DCommon barcodes that print on the COD return label. + + + + + The label image or printer commands to print the label. + + + + + + + Indicates which type of reference information to include on the COD return shipping label. + + + + + + + + + + + + + The COD amount (after any accumulations) that must be collected upon delivery of a package shipped using the COD special service. + + + + + Currently not supported. + + TBD + + + + + + The description of the FedEx service type used for the COD return shipment. Currently not supported. + + 70 + + + + + + The description of the packaging used for the COD return shipment. + + 40 + + + + + + Currently not supported. + + TBD + + + + + + Currently not supported. + + + + + Currently not supported. + + + + + + The CodRoutingDetail element will contain the COD return tracking number and form id. In the case of a COD multiple piece shipment these will need to be inserted in the request for the last piece of the multiple piece shipment. + The service commitment is the only other element of the RoutingDetail that is used for a CodRoutingDetail. + + + + + + Contains the data which form the Astra and 2DCommon barcodes that print on the COD return label. + + + + + The label image or printer commands to print the label. + + + + + + + CommercialInvoice element is required for electronic upload of CI data. It will serve to create/transmit an Electronic Commercial Invoice through the FedEx Systems. Customers are responsible for printing their own Commercial Invoice.If you would likeFedEx to generate a Commercial Invoice and transmit it to Customs. for clearance purposes, you need to specify that in the ShippingDocumentSpecification element. If you would like a copy of the Commercial Invoice that FedEx generated returned to you in reply it needs to be specified in the ETDDetail/RequestedDocumentCopies element. Commercial Invoice support consists of maximum of 99 commodity line items. + + + + + Any comments that need to be communicated about this shipment. + + + + + Any freight charges that are associated with this shipment. + + + + + Any taxes or miscellaneous charges(other than Freight charges or Insurance charges) that are associated with this shipment. + + + + + Any packing costs that are associated with this shipment. + + + + + Any handling costs that are associated with this shipment. + + + + + Free-form text. + + + + + Free-form text. + + + + + Free-form text. + + + + + The reason for the shipment. Note: SOLD is not a valid purpose for a Proforma Invoice. + + + + + Customer assigned Invoice number + + + + + Name of the International Expert that completed the Commercial Invoice different from Sender. + + + + + Required for dutiable international Express or Ground shipment. This field is not applicable to an international PIB(document) or a non-document which does not require a Commercial Invoice + + + + + + + The instructions indicating how to print the Commercial Invoice( e.g. image type) Specifies characteristics of a shipping document to be produced. + + + + + + Specifies the usage and identification of a customer supplied image to be used on this document. + + + + + + + + For international multiple piece shipments, commodity information must be passed in the Master and on each child transaction. + If this shipment cotains more than four commodities line items, the four highest valued should be included in the first 4 occurances for this request. + + + + + + Name of this commodity. + + + + + Total number of pieces of this commodity + + + + + Complete and accurate description of this commodity. + + 450 + + + + + + Country code where commodity contents were produced or manufactured in their final form. + + 2 + + + + + + + Unique alpha/numeric representing commodity item. + At least one occurrence is required for US Export shipments if the Customs Value is greater than $2500 or if a valid US Export license is required. + + + 14 + + + + + + Total weight of this commodity. 1 explicit decimal position. Max length 11 including decimal. + + + + + Number of units of a commodity in total number of pieces for this line item. Max length is 9 + + + + + Unit of measure used to express the quantity of this commodity line item. + + 3 + + + + + + Contains only additional quantitative information other than weight and quantity to calculate duties and taxes. + + + + + Value of each unit in Quantity. Six explicit decimal positions, Max length 18 including decimal. + + + + + + Total customs value for this line item. + It should equal the commodity unit quantity times commodity unit value. + Six explicit decimal positions, max length 18 including decimal. + + + + + + Defines additional characteristic of commodity used to calculate duties and taxes + + + + + Applicable to US export shipping only. + + 12 + + + + + + + Date of expiration. Must be at least 1 day into future. + The date that the Commerce Export License expires. Export License commodities may not be exported from the U.S. on an expired license. + Applicable to US Export shipping only. + Required only if commodity is shipped on commerce export license, and Export License Number is supplied. + + + + + + + An identifying mark or number used on the packaging of a shipment to help customers identify a particular shipment. + + + 15 + + + + + + All data required for this commodity in NAFTA Certificate of Origin. + + + + + + + + + The identifier for all clearance documents associated with this shipment. + + + + + + + + + + Identifies the branded location name, the hold at location phone number and the address of the location. + + + + + Identifies the type of FedEx location. + + + + + + + + + The package sequence number of this package in a multiple piece shipment. + + + + + The Tracking number and form id for this package. + + + + + Used with request containing PACKAGE_GROUPS, to identify which group of identical packages was used to produce a reply item. + + + + + Oversize class for this package. + + + + + All package-level rating data for this package, which may include data for multiple rate types. + + + + + Associated with package, due to interaction with per-package hazardous materials presence/absence. + + + + + The data that is used to from the Astra and 2DCommon barcodes for the label.. + + + + + The textual description of the special service applied to the package. + + + + + + The label image or printer commands to print the label. + + + + + All package-level shipping documents (other than labels and barcodes). For use in loads after January, 2008. + + + + + Information about the COD return shipment. + + + + + Actual signature option applied, to allow for cases in which the original value conflicted with other service features in the shipment. + + + + + Documents the kinds and quantities of all hazardous commodities in the current package, using updated hazardous commodity description data. + + + + + + + + + Indicates whether or not this is a US Domestic shipment. + + + + + Indicates the carrier that will be used to deliver this shipment. + + + + + The master tracking number and form id of this multiple piece shipment. This information is to be provided for each subsequent of a multiple piece shipment. + + + + + Description of the FedEx service used for this shipment. Currently not supported. + + 70 + + + + + + Description of the packaging used for this shipment. Currently not supported. + + 40 + + + + + + Information about the routing, origin, destination and delivery of a shipment. + + + + + Only used with pending shipments. + + + + + Only used in the reply to tag requests. + + + + + Provides reply information specific to SmartPost shipments. + + + + + All shipment-level rating data for this shipment, which may include data for multiple rate types. + + + + + Information about the COD return shipment. + + + + + Returns the default holding location information when HOLD_AT_LOCATION special service is requested and the client does not specify the hold location address. + + + + + Indicates whether or not this shipment is eligible for a money back guarantee. + + + + + Returns any defaults or updates applied to RequestedShipment.exportDetail.exportComplianceStatement. + + + + + + All shipment-level shipping documents (other than labels and barcodes). + + + + + Package level details about this package. + + + + + + + Provides reply information specific to SmartPost shipments. + + + + + Identifies the carrier that will pick up the SmartPost shipment. + + + + + Indicates whether the shipment is deemed to be machineable, based on dimensions, weight, and packaging. + + + + + + + Provides reply information specific to a tag request. + + + + + . + + + + + As of June 2007, returned only for FedEx Express services. + + + + + As of June 2007, returned only for FedEx Express services. + + + + + As of June 2007, returned only for FedEx Express services. + + + + + As of June 2007, returned only for FedEx Express services. + + + + + FEDEX INTERNAL USE ONLY: for use by INET. + + + + + + + Defines additional data to print in the Configurable portion of the label, this allows you to print the same type information on the label that can also be printed on the doc tab. + + + + + 1 of 12 possible zones to position data. + + + + + The identifiying text for the data in this zone. + + + + + A reference to a field in either the request or reply to print in this zone following the header. + + + + + A literal value to print after the header in this zone. + + + + + + + The descriptive data for a point-of-contact person. + + + + + Client provided identifier corresponding to this contact information. + + + + + Identifies the contact person's name. + + + + + Identifies the contact person's title. + + + + + Identifies the company this contact is associated with. + + + + + Identifies the phone number associated with this contact. + + + + + Identifies the phone extension associated with this contact. + + + + + Identifies the pager number associated with this contact. + + + + + Identifies the fax number associated with this contact. + + + + + Identifies the email address associated with this contact. + + + + + + + + + + + + + Content Record. + + + + + Part Number. + + + + + Item Number. + + + + + Received Quantity. + + + + + Description. + + + + + + + Reply to the Close Request transaction. The Close Reply bring back the ASCII data buffer which will be used to print the Close Manifest. The Manifest is essential at the time of pickup. + + + + + Identifies the highest severity encountered when executing the request; in order from high to low: FAILURE, ERROR, WARNING, NOTE, SUCCESS. + + + + + The descriptive data detailing the status of a sumbitted transaction. + + + + + Descriptive data that governs data payload language/translations. The TransactionDetail from the request is echoed back to the caller in the corresponding reply. + + + + + Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply). + + + + + The reply payload. All of the returned information about this shipment/package. + + + + + + + Create Pending Shipment Request + + + + + Descriptive data to be used in authentication of the sender's identity (and right to use FedEx web services). + + + + + The descriptive data identifying the client submitting the transaction. + + + + + The descriptive data for this customer transaction. The TransactionDetail from the request is echoed back to the caller in the corresponding reply. + + + + + Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply). + + + + + Descriptive data about the shipment being sent by the requestor. + + + + + + + Currency exchange rate information. + + + + + The currency code for the original (converted FROM) currency. + + + + + The currency code for the final (converted INTO) currency. + + + + + Multiplier used to convert fromCurrency units to intoCurrency units. + + + + + + + + + Indicates the type of custom delivery being requested. + + + + + Time by which delivery is requested. + + + + + Range of dates for custom delivery request; only used if type is BETWEEN. + + + + + Date for custom delivery request; only used for types of ON, BETWEEN, or AFTER. + + + + + + + + + + + + + + + Data required to produce a custom-specified document, either at shipment or package level. + + + + + Common information controlling document production. + + + + + Applicable only to documents produced on thermal printers with roll stock. + + + + + Applicable only to documents produced on thermal printers with roll stock. + + + + + Identifies the formatting specification used to construct this custom document. + + + + + Identifies the individual document specified by the client. + + + + + If provided, thermal documents will include specified doc tab content. If omitted, document will be produced without doc tab content. + + + + + + + Constructed string, based on format and zero or more data fields, printed in specified barcode symbology. + + + + + + + + + Width of thinnest bar/space element in the barcode. + + + + + + + + Solid (filled) rectangular area on label. + + + + + + + + + Valid values for CustomLabelCoordinateUnits + + + + + + + + + + + + + + + + + + Image to be included from printer's memory, or from a local file for offline clients. + + + + + + Printer-specific index of graphic image to be printed. + + + + + Fully-qualified path and file name for graphic image to be printed. + + + + + + + + + Horizontal position, relative to left edge of custom area. + + + + + Vertical position, relative to top edge of custom area. + + + + + + + Constructed string, based on format and zero or more data fields, printed in specified printer font (for thermal labels) or generic font/size (for plain paper labels). + + + + + + + + Printer-specific font name for use with thermal printer labels. + + + + + Generic font name for use with plain paper labels. + + + + + Generic font size for use with plain paper labels. + + + + + + + + + + + + + + + + + + + Reference information to be associated with this package. + + + + + The reference type to be associated with this reference data. + + + + + + + + The types of references available for use. + + + + + + + + + + + + + + + + Allows customer-specified control of label content. + + + + + If omitted, no doc tab will be produced (i.e. default = former NONE type). + + + + + Defines any custom content to print on the label. + + + + + Defines additional data to print in the Configurable portion of the label, this allows you to print the same type information on the label that can also be printed on the doc tab. + + + + + Controls which data/sections will be suppressed. + + + + + Customer-provided SCNC for use with label-data-only processing of FedEx Ground shipments. + + + + + + Controls the number of additional copies of supplemental labels. + + + + + This value reduces the default quantity of destination/consignee air waybill labels. A value of zero indicates no change to default. A minimum of one copy will always be produced. + + + + + + + + + + Interacts both with properties of the shipment and contractual relationship with the shipper. + + + + + + Specifies how the recipient is identified for customs purposes; the requirements on this information vary with destination country. + + + + + + + + Identifies responsibilities with respect to loss, damage, etc. + + + + + Documents amount paid to third party for coverage of shipment content. + + + + + + + + + + + + + + + + + + The descriptive data required for a FedEx shipment containing dangerous goods (hazardous materials). + + + + + Identifies whether or not the products being shipped are required to be accessible during delivery. + + + + + Shipment is packaged/documented for movement ONLY on cargo aircraft. + + + + + Indicates which kinds of hazardous content are in the current package. + + + + + Documents the kinds and quantities of all hazardous commodities in the current package. + + + + + Description of the packaging of this commodity, suitable for use on OP-900 and OP-950 forms. + + + + + Telephone number to use for contact in the event of an emergency. + + + + + Offeror's name or contract number, per DOT regulation. + + + + + + + + + The beginning date in a date range. + + + + + The end date in a date range. + + + + + + + Valid values for DayofWeekType + + + + + + + + + + + + + + Descriptive data sent to FedEx by a customer in order to delete a package. + + + + + Descriptive data to be used in authentication of the sender's identity (and right to use FedEx web services). + + + + + Descriptive data identifying the client submitting the transaction. + + + + + Descriptive data for this customer transaction. The TransactionDetail from the request is echoed back to the caller in the corresponding reply. + + + + + Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply). + + + + + The timestamp of the shipment request. + + + + + Identifies the FedEx tracking number of the package being cancelled. + + + + + Determines the type of deletion to be performed in relation to package level vs shipment level. + + + + + + + + + Descriptive data to be used in authentication of the sender's identity (and right to use FedEx web services). + + + + + Descriptive data identifying the client submitting the transaction. + + + + + Descriptive data for this customer transaction. The TransactionDetail from the request is echoed back to the caller in the corresponding reply. + + + + + Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply). + + + + + Only used for tags which had FedEx Express services. + + + + + Only used for tags which had FedEx Express services. + + + + + If the original ProcessTagRequest specified third-party payment, then the delete request must contain the same pay type and payor account number for security purposes. + + + + + Also known as Pickup Confirmation Number or Dispatch Number + + + + + + + Specifies the type of deletion to be performed on a shipment. + + + + + + + + + + Data required to complete the Destionation Control Statement for US exports. + + + + + List of applicable Statment types. + + + + + Comma-separated list of up to four country codes, required for DEPARTMENT_OF_STATE statement. + + + + + Name of end user, required for DEPARTMENT_OF_STATE statement. + + + + + + + Used to indicate whether the Destination Control Statement is of type Department of Commerce, Department of State or both. + + + + + + + + + The dimensions of this package and the unit type used for the measurements. + + + + + + + + + + + + + The DocTabContentType options available. + + + + + The DocTabContentType should be set to ZONE001 to specify additional Zone details. + + + + + The DocTabContentType should be set to BARCODED to specify additional BarCoded details. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Zone number can be between 1 and 12. + + + + + Header value on this zone. + + + + + Reference path to the element in the request/reply whose value should be printed on this zone. + + + + + Free form-text to be printed in this zone. + + + + + Justification for the text printed on this zone. + + + + + + + Identifies the method by which the package is to be tendered to FedEx. This element does not dispatch a courier for package pickup. + + + + + + + + + + + + Describes specific information about the email label shipment. + + + + + Notification email will be sent to this email address + + + + + Message to be sent in the notification email + + + + + + + + + + + + + Information describing email notifications that will be sent in relation to events that occur during package movement + + + + + Specifies whether/how email notifications are grouped. + + + + + A message that will be included in the email notifications + + + + + Information describing the destination of the email, format of the email and events to be notified on + + + + + + + The format of the email + + + + + + + + + + The descriptive data for a FedEx email notification recipient. + + + + + Identifies the relationship this email recipient has to the shipment. + + + + + The email address to send the notification to + + + + + Notify the email recipient when this shipment has been shipped. + + + + + Notify the email recipient if this shipment encounters a problem while in route + + + + + Notify the email recipient when this shipment has been delivered. + + + + + The format of the email notification. + + + + + The language/locale to be used in this email notification. + + + + + + + Identifies the set of valid email notification recipient types. For SHIPPER, RECIPIENT and BROKER the email address asssociated with their definitions will be used, any email address sent with the email notification for these three email notification recipient types will be ignored. + + + + + + + + + + + + + + + + + + + + + Customer-declared value, with data type and legal values depending on excise condition, used in defining the taxable value of the item. + + + + + + + Specifies the types of Estimated Duties and Taxes to be included in a rate quotation for an international shipment. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Specifies the client-requested response in the event of errors within shipment. + PACKAGE_ERROR_LABELS : Return per-package error label in addition to error Notifications. + STANDARD : Return error Notifications only. + + + + + + + + + + Electronic Trade document references used with the ETD special service. + + + + + Indicates the types of shipping documents produced for the shipper by FedEx (see ShippingDocumentSpecification) which should be copied back to the shipper in the shipment result data. + + + + + + + + Country specific details of an International shipment. + + + + + + Specifies which filing option is being exercised by the customer. + Required for non-document shipments originating in Canada destined for any country other than Canada, the United States, Puerto Rico or the U.S. Virgin Islands. + + + + + + General field for exporting-country-specific export data (e.g. B13A for CA, FTSR Exemption or AES Citation for US). + + + + + This field is applicable only to Canada export non-document shipments of any value to any destination. No special characters allowed. + + 10 + + + + + + Department of Commerce/Department of State information about this shipment. + + + + + + + Details specific to an Express freight shipment. + + + + + Indicates whether or nor a packing list is enclosed. + + + + + + Total shipment pieces. + e.g. 3 boxes and 3 pallets of 100 pieces each = Shippers Load and Count of 303. + Applicable to International Priority Freight and International Economy Freight. + Values must be in the range of 1 - 99999 + + + + + + Required for International Freight shipping. Values must be 8- 12 characters in length. + + 12 + + + + + + + + Identifies a kind of FedEx facility. + + + + + + + + + + + + + + + + Data required to produce the Freight handling-unit-level address labels. Note that the number of UNIQUE labels (the N as in 1 of N, 2 of N, etc.) is determined by total handling units. + + + + + + Indicates the number of copies to be produced for each unique label. + + + + + If omitted, no doc tab will be produced (i.e. default = former NONE type). + + + + + + + Individual charge which contributes to the total base charge for the shipment. + + + + + Freight class for this line item. + + + + + Effective freight class used for rating this line item. + + + + + NMFC Code for commodity. + + + + + Customer-provided description for this commodity or class line. + + + + + Weight for this commodity or class line. + + + + + Rate or factor applied to this line item. + + + + + Identifies the manner in which the chargeRate for this line item was applied. + + + + + The net or extended charge for this line item. + + + + + + + + + + + + + + These values represent the industry-standard freight classes used for FedEx Freight and FedEx National Freight shipment description. (Note: The alphabetic prefixes are required to distinguish these values from decimal numbers on some client platforms.) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Identifies responsibilities with respect to loss, damage, etc. + + + + + + + + + Rate data specific to FedEx Freight or FedEx National Freight services. + + + + + A unique identifier for a specific rate quotation. + + + + + Freight charges which accumulate to the total base charge for the shipment. + + + + + Human-readable descriptions of additional information on this shipment rating. + + + + + + + Additional non-monetary data returned with Freight rates. + + + + + Unique identifier for notation. + + + + + Human-readable explanation of notation. + + + + + + + Data applicable to shipments using FEDEX_FREIGHT and FEDEX_NATIONAL_FREIGHT services. + + + + + Account number used with FEDEX_FREIGHT service. + + + + + Used for validating FedEx Freight account number and (optionally) identifying third party payment on the bill of lading. + + + + + Identification values to be printed during creation of a Freight bill of lading. + + + + + Indicates the role of the party submitting the transaction. + + + + + Designates which of the requester's tariffs will be used for rating. + + + + + Designates the terms of the "collect" payment for a Freight Shipment. + + + + + Identifies the declared value for the shipment + + + + + Identifies the declared value units corresponding to the above defined declared value + + + + + + Identifiers for promotional discounts offered to customers. + + + + + Total number of individual handling units in the entire shipment (for unit pricing). + + + + + Estimated discount rate provided by client for unsecured rate quote. + + + + + Total weight of pallets used in shipment. + + + + + Overall shipment dimensions. + + + + + Description for the shipment. + + + + + Specifies which party will pay surcharges for any special services which support split billing. + + + + + Must be populated if any line items contain hazardous materials. + + + + + Details of the commodities in the shipment. + + + + + + + Description of an individual commodity or class of content in a shipment. + + + + + Freight class for this line item. + + + + + FEDEX INTERNAL USE ONLY: for FedEx system that estimate freight class from customer-provided dimensions and weight. + + + + + Number of individual handling units to which this line applies. (NOTE: Total of line-item-level handling units may not balance to shipment-level total handling units.) + + + + + Specification of handling-unit packaging for this commodity or class line. + + + + + Number of pieces for this commodity or class line. + + + + + NMFC Code for commodity. + + + + + Indicates the kind of hazardous material content in this line item. + + + + + For printed reference per line item. + + + + + For printed reference per line item. + + + + + Customer-provided description for this commodity or class line. + + + + + Weight for this commodity or class line. + + + + + FED EX INTERNAL USE ONLY - Individual line item dimensions. + + + + + Volume (cubic measure) for this commodity or class line. + + + + + + + Indicates the role of the party submitting the transaction. + + + + + + + + + + Specifies which party will be responsible for payment of any surcharges for Freight special services for which split billing is allowed. + + + + + Identifies the special service. + + + + + Indicates who will pay for the special service. + + + + + + + Data required to produce a General Agency Agreement document. Remaining content (business data) to be defined once requirements have been completed. + + + + + + + + Documents the kind and quantity of an individual hazardous commodity in a package. + + + + + Identifies and describes an individual hazardous commodity. + + + + + Specifies the amount of the commodity in alternate units. + + + + + Customer-provided specifications for handling individual commodities. + + + + + + + Identifies and describes an individual hazardous commodity. For 201001 load, this is based on data from the FedEx Ground Hazardous Materials Shipping Guide. + + + + + Regulatory identifier for a commodity (e.g. "UN ID" value). + + + + + + + + + + + + + Specifies how the commodity is to be labeled. + + + + + + + + + + Customer-provided specifications for handling individual commodities. + + + + + Specifies how the customer wishes the label text to be handled for this commodity in this package. + + + + + Text used in labeling the commodity under control of the labelTextOption field. + + + + + + + Indicates which kind of hazardous content (as defined by DOT) is being reported. + + + + + + + + + + + + Identifies number and type of packaging units for hazardous commodities. + + + + + Number of units of the type below. + + + + + Units in which the hazardous commodity is packaged. + + + + + + + Identifies DOT packing group for a hazardous commodity. + + + + + + + + + + Identifies amount and units for quantity of hazardous commodities. + + + + + Number of units of the type below. + + + + + Units by which the hazardous commodity is measured. + + + + + + + Descriptive data required for a FedEx shipment that is to be held at the destination FedEx location for pickup by the recipient. + + + + + Contact phone number for recipient of shipment. + + + + + Contact and address of FedEx facility at which shipment is to be held. + + + + + Type of facility at which package/shipment is to be held. + + + + + + + The descriptive data required by FedEx for home delivery services. + + + + + The type of Home Delivery Premium service being requested. + + + + + Required for Date Certain Home Delivery. + + + + + Required for Date Certain and Appointment Home Delivery. + + 15 + + + + + + + + The type of Home Delivery Premium service being requested. + + + + + + + + + + + + + + + + + + + The type of International shipment. + + + + + + + + + + Specifies the type of label to be returned. + + + + + + + + + + + Names for data elements / areas which may be suppressed from printing on labels. + + + + + + + + + + + + This indicates if the top or bottom of the label comes out of the printer first. + + + + + + + + + Relative to normal orientation for the printer. + + + + + + + + + + + Description of shipping label to be returned in the reply + + + + + Specifies how to create, organize, and return the document. + + + + + Specify type of label to be returned + + + + + Specifies the image format used for a shipping document. + + + + + For thermal printer lables this indicates the size of the label and the location of the doc tab if present. + + + + + This indicates if the top or bottom of the label comes out of the printer first. + + + + + If present, this contact and address information will replace the return address information on the label. + + + + + Allows customer-specified control of label content. + + + + + + + For thermal printer labels this indicates the size of the label and the location of the doc tab if present. + + + + + + + + + + + + + + + + + + + + + + + Identifies the Liability Coverage Amount. For Jan 2010 this value represents coverage amount per pound + + + + + + + + + + + + + Represents a one-dimensional measurement in small units (e.g. suitable for measuring a package or document), contrasted with Distance, which represents a large one-dimensional measurement (e.g. distance between cities). + + + + + The numerical quantity of this measurement. + + + + + The units for this measurement. + + + + + + + CM = centimeters, IN = inches + + + + + + + + + Identifies the representation of human-readable text. + + + + + Two-letter code for language (e.g. EN, FR, etc.) + + + + + Two-letter code for the region (e.g. us, ca, etc..). + + + + + + + + + + + + + Identifies which type minimum charge was applied. + + + + + + + + + + + + The descriptive data for the medium of exchange for FedEx services. + + + + + Identifies the currency of the monetary amount. + + 3 + + + + + + Identifies the monetary amount. + + + + + + + Data required to produce a Certificate of Origin document. Remaining content (business data) to be defined once requirements have been completed. + + + + + + + Indicates which Party (if any) from the shipment is to be used as the source of importer data on the NAFTA COO form. + + + + + Contact information for "Authorized Signature" area of form. + + + + + + + + + + This element is currently not supported and is for the future use. + + + + + Defined by NAFTA regulations. + + + + + Defined by NAFTA regulations. + + + + + Identification of which producer is associated with this commodity (if multiple producers are used in a single shipment). + + + + + + Date range over which RVC net cost was calculated. + + + + + + + + + + + + + + + Net cost method used. + + + + + + + + + See instructions for NAFTA Certificate of Origin for code definitions. + + + + + + + + + + + + + This element is currently not supported and is for the future use. + + + + + + + + + See instructions for NAFTA Certificate of Origin for code definitions. + + + + + + + + + + + This element is currently not supported and is for the future use. + + + + + + + + + + + + The descriptive data regarding the result of the submitted transaction. + + + + + The severity of this notification. This can indicate success or failure or some other information about the request. The values that can be returned are SUCCESS - Your transaction succeeded with no other applicable information. NOTE - Additional information that may be of interest to you about your transaction. WARNING - Additional information that you need to know about your transaction that you may need to take action on. ERROR - Information about an error that occurred while processing your transaction. FAILURE - FedEx was unable to process your transaction at this time due to a system failure. Please try again later + + + + + Indicates the source of this notification. Combined with the Code it uniquely identifies this notification + + + + + A code that represents this notification. Combined with the Source it uniquely identifies this notification. + + + + + Human-readable text that explains this notification. + + + + + The translated message. The language and locale specified in the ClientDetail. Localization are used to determine the representation. Currently only supported in a TrackReply. + + + + + A collection of name/value pairs that provide specific data to help the client determine the nature of an error (or warning, etc.) witout having to parse the message string. + + + + + + + + + Identifies the type of data contained in Value (e.g. SERVICE_TYPE, PACKAGE_SEQUENCE, etc..). + + + + + The value of the parameter (e.g. PRIORITY_OVERNIGHT, 2, etc..). + + + + + + + Identifies the set of severity values for a Notification. + + + + + + + + + + + + The instructions indicating how to print the OP-900 form for hazardous materials packages. + + + + + Specifies characteristics of a shipping document to be produced. + + + + + Identifies which reference type (from the package's customer references) is to be used as the source for the reference on this OP-900. + + + + + Specifies the usage and identification of customer supplied images to be used on this document. + + + + + Data field to be used when a name is to be printed in the document instead of (or in addition to) a signature image. + + + + + + + The oversize class types. + + + + + + + + + + Each instance of this data type represents the set of barcodes (of all types) which are associated with a specific package. + + + + + Binary-style barcodes for this package. + + + + + String-style barcodes for this package. + + + + + + + Data for a package's rates, as calculated per a specific rate type. + + + + + Type used for this specific set of rate data. + + + + + Indicates which weight was used. + + + + + INTERNAL FEDEX USE ONLY. + + + + + The weight that was used to calculate the rate. + + + + + The dimensional weight of this package (if greater than actual). + + + + + The oversize weight of this package (if the package is oversize). + + + + + The transportation charge only (prior to any discounts applied) for this package. + + + + + The sum of all discounts on this package. + + + + + This package's baseCharge - totalFreightDiscounts. + + + + + The sum of all surcharges on this package. + + + + + This package's netFreight + totalSurcharges (not including totalTaxes). + + + + + The sum of all taxes on this package. + + + + + This package's netFreight + totalSurcharges + totalTaxes. + + + + + The total sum of all rebates applied to this package. + + + + + All rate discounts that apply to this package. + + + + + All rebates that apply to this package. + + + + + All surcharges that apply to this package (either because of characteristics of the package itself, or because it is carrying per-shipment surcharges for the shipment of which it is a part). + + + + + All taxes applicable (or distributed to) this package. + + + + + The variable handling charges calculated based on the type variable handling charges requested. + + + + + + + This class groups together for a single package all package-level rate data (across all rate types) as part of the response to a shipping request, which groups shipment-level data together and groups package-level data by package. + + + + + This rate type identifies which entry in the following array is considered as presenting the "actual" rates for the package. + + + + + The "list" net charge minus "actual" net charge. + + + + + Each element of this field provides package-level rate data for a specific rate type. + + + + + + + Identifies the collection of special service offered by FedEx. BROKER_SELECT_OPTION should be used for Ground shipments only. + + + + + + + + + + + + + + These special services are available at the package level for some or all service types. If the shipper is requesting a special service which requires additional data, the package special service type must be present in the specialServiceTypes collection, and the supporting detail must be provided in the appropriate sub-object below. + + + + + The types of all special services requested for the enclosing shipment or package. + + + + + For use with FedEx Ground services only; COD must be present in shipment's special services. + + + + + Descriptive data required for a FedEx shipment containing dangerous materials. This element is required when SpecialServiceType.DANGEROUS_GOODS or HAZARDOUS_MATERIAL is present in the SpecialServiceTypes collection. + + + + + Descriptive data required for a FedEx shipment containing dry ice. This element is required when SpecialServiceType.DRY_ICE is present in the SpecialServiceTypes collection. + + + + + The descriptive data required for FedEx signature services. This element is required when SpecialServiceType.SIGNATURE_OPTION is present in the SpecialServiceTypes collection. + + + + + The descriptive data required for FedEx Priority Alert service. This element is required when SpecialServiceType.PRIORITY_ALERT is present in the SpecialServiceTypes collection. + + + + + + + Identifies the collection of available FedEx or customer packaging options. + + + + + + + + + + + + + + The descriptive data for a person or company entitiy doing business with FedEx. + + + + + Identifies the FedEx account number assigned to the customer. + + 12 + + + + + + + Descriptive data identifying the point-of-contact person. + + + + + The descriptive data for a physical location. + + + + + + + The descriptive data for the monetary compensation given to FedEx for services rendered to the customer. + + + + + Identifies the method of payment for a service. See PaymentType for list of valid enumerated values. + + + + + Descriptive data identifying the party responsible for payment for a service. + + + + + + + Identifies the method of payment for a service. + + + + + + + + + + + The descriptive data identifying the party responsible for payment for a service. + + + + + Identifies the FedEx account number assigned to the payor. + + 12 + + + + + + Identifies the country of the payor. + + 2 + + + + + + + + This information describes how and when a pending shipment may be accessed for completion. + + + + + Only for pending shipment type of "EMAIL" + + + + + Only for pending shipment type of "EMAIL" + + + + + Only for pending shipment type of "EMAIL" + + + + + This element is currently not supported and is for the future use. + + + + + + + This information describes the kind of pending shipment being requested. + + + + + Identifies the type of FedEx pending shipment + + + + + Date after which the pending shipment will no longer be available for completion. + + + + + Only used with type of EMAIL. + + + + + + + Identifies the type of service for a pending shipment. + + + + + + + + This enumeration rationalizes the former FedEx Express international "admissibility package" types (based on ANSI X.12) and the FedEx Freight packaging types. The values represented are those common to both carriers. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This class describes the pickup characteristics of a shipment (e.g. for use in a tag request). + + + + + + + + Identifies the type of Pickup request + + + + + Identifies the type of source for Pickup request + + + + + + + Identifies the type of source for pickup request service. + + + + + + + + + Identifies the type of pickup request service. + + + + + + + + + Identifies the type of pricing used for this shipment. + + + + + + + + + + + + + + + + + + + + Represents a reference identifier printed on Freight bills of lading + + + + + + + + + Identifies a particular reference identifier printed on a Freight bill of lading. + + + + + + + + + + + + + + + + This indicates the highest level of severity of all the notifications returned in this reply + + + + + The descriptive data regarding the results of the submitted transaction. + + + + + Descriptive data for this customer transaction. The TransactionDetail from the request is echoed back to the caller in the corresponding reply. + + + + + Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply). + + + + + The reply payload. All of the returned information about this shipment/package. + + + + + Empty unless error label behavior is PACKAGE_ERROR_LABELS and one or more errors occured during transaction processing. + + + + + + + Descriptive data sent to FedEx by a customer in order to ship a package. + + + + + Descriptive data to be used in authentication of the sender's identity (and right to use FedEx web services). + + + + + Descriptive data identifying the client submitting the transaction. + + + + + Descriptive data for this customer transaction. The TransactionDetail from the request is echoed back to the caller in the corresponding reply. + + + + + Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply). + + + + + Descriptive data about the shipment being sent by the requestor. + + + + + + + + + + + + + + + + Descriptive data sent to FedEx by a customer in order to ship a package. + + + + + Descriptive data to be used in authentication of the sender's identity (and right to use FedEx web services). + + + + + Descriptive data identifying the client submitting the transaction. + + + + + Descriptive data for this customer transaction. The TransactionDetail from the request is echoed back to the caller in the corresponding reply. + + + + + Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply). + + + + + Descriptive data about the shipment being sent by the requestor. + + + + + + + Test for the Commercial Invoice. Note that Sold is not a valid Purpose for a Proforma Invoice. + + + + + + + + + + + + + Indicates the reason that a dim divisor value was chose. + + + + + + + + + + + + Identifies a discount applied to the shipment. + + + + + Identifies the type of discount applied to the shipment. + + + + + + The amount of the discount applied to the shipment. + + + + + The percentage of the discount applied to the shipment. + + + + + + + The type of the discount. + + + + + + + + + + + + + Identifies the type(s) of rates to be returned in the reply. + + + + + + + + + + The weight method used to calculate the rate. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Specifies how the recipient is identified for customs purposes; the requirements on this information vary with destination country. + + + + + Specifies the kind of identification being used. + + + + + Contains the actual ID value, of the type specified above. + + + + + + + Type of Brazilian taxpayer identifier provided in Recipient/TaxPayerIdentification/Number. For shipments bound for Brazil this overrides the value in Recipient/TaxPayerIdentification/TinType + + + + + + + + + + FOOD_OR_PERISHABLE is required by FDA/BTA; must be true for food/perishable items coming to US or PR from non-US/non-PR origin + + + + + + + + + + + + + + + + + This class rationalizes RequestedPackage and RequestedPackageSummary from previous interfaces. The way in which it is uses within a RequestedShipment depends on the RequestedPackageDetailType value specified for that shipment. + + + + + Used only with INDIVIDUAL_PACKAGE, as a unique identifier of each requested package. + + + + + Used only with PACKAGE_GROUPS, as a unique identifier of each group of identical packages. + + + + + Used only with PACKAGE_GROUPS, as a count of packages within a group of identical packages. + + + + + + Only used for INDIVIDUAL_PACKAGES and PACKAGE_GROUPS. Ignored for PACKAGE_SUMMARY, in which case totalInsuredValue and packageCount on the shipment will be used to determine this value. + + + + + Only used for INDIVIDUAL_PACKAGES and PACKAGE_GROUPS. Ignored for PACKAGE_SUMMARY, in which case totalweight and packageCount on the shipment will be used to determine this value. + + + + + + Provides additional detail on how the customer has physically packaged this item. As of June 2009, required for packages moving under international and SmartPost services. + + + + + Human-readable text describing the package. + + + + + + + Only used for INDIVIDUAL_PACKAGES and PACKAGE_GROUPS. + + + + + + + The descriptive data for the shipment being tendered to FedEx. + + + + + Identifies the date and time the package is tendered to FedEx. Both the date and time portions of the string are expected to be used. The date should not be a past date or a date more than 10 days in the future. The time is the local time of the shipment based on the shipper's time zone. The date component must be in the format: YYYY-MM-DD (e.g. 2006-06-26). The time component must be in the format: HH:MM:SS using a 24 hour clock (e.g. 11:00 a.m. is 11:00:00, whereas 5:00 p.m. is 17:00:00). The date and time parts are separated by the letter T (e.g. 2006-06-26T17:00:00). There is also a UTC offset component indicating the number of hours/mainutes from UTC (e.g 2006-06-26T17:00:00-0400 is defined form June 26, 2006 5:00 pm Eastern Time). + + + + + Identifies the method by which the package is to be tendered to FedEx. This element does not dispatch a courier for package pickup. See DropoffType for list of valid enumerated values. + + + + + Identifies the FedEx service to use in shipping the package. See ServiceType for list of valid enumerated values. + + + + + Identifies the packaging used by the requestor for the package. See PackagingType for list of valid enumerated values. + + + + + Identifies the total weight of the shipment being conveyed to FedEx.This is only applicable to International shipments and should only be used on the first package of a mutiple piece shipment.This value contains 1 explicit decimal position + + + + + Total insured amount. + + + + + + Descriptive data identifying the party responsible for shipping the package. Shipper and Origin should have the same address. + + + + + Descriptive data identifying the party receiving the package. + + + + + A unique identifier for a recipient location + + 10 + + + + + + Physical starting address for the shipment, if different from shipper's address. + + + + + Descriptive data indicating the method and means of payment to FedEx for providing shipping services. + + + + + Descriptive data regarding special services requested by the shipper for this shipment. If the shipper is requesting a special service which requires additional data (e.g. COD), the special service type must be present in the specialServiceTypes collection, and the supporting detail must be provided in the appropriate sub-object. For example, to request COD, "COD" must be included in the SpecialServiceTypes collection and the CodDetail object must contain the required data. + + + + + Details specific to an Express freight shipment. + + + + + Data applicable to shipments using FEDEX_FREIGHT and FEDEX_NATIONAL_FREIGHT services. + + + + + Used with Ground Home Delivery and Freight. + + + + + Details about how to calculate variable handling charges at the shipment level. + + + + + Customs clearance data, used for both international and intra-country shipping. + + + + + For use in "process tag" transaction. + + + + + + If true, only the shipper/payor will have visibility of this shipment. + + + + + Specifies the client-requested response in the event of errors within shipment. + + + + + Details about the image format and printer type the label is to returned in. + + + + + Contains data used to create additional (non-label) shipping documents. + + + + + Specifies whether and what kind of rates the customer wishes to have quoted on this shipment. The reply will also be constrained by other data on the shipment and customer. + + + + + Specifies the type of rate the customer wishes to have used as the actual rate type. + + + + + Specifies whether the customer wishes to have Estimated Duties and Taxes provided with the rate quotation on this shipment. Only applies with shipments moving under international services. + + + + + Only used with multiple-transaction shipments. + + + + + Only used with multi-piece COD shipments sent in multiple transactions. Required on last transaction only. + + + + + The total number of packages in the entire shipment (even when the shipment spans multiple transactions.) + + + + + Specifies whether packages are described individually, in groups, or summarized in a single description for total-piece-total-weight. This field controls which fields of the RequestedPackageLineItem will be used, and how many occurrences are expected. + + + + + One or more package-attribute descriptions, each of which describes an individual package, a group of identical packages, or (for the total-piece-total-weight case) common characteristics all packages in the shipment. + + + + + + + + + + + + + + + + + + + + + + + These values are used to control the availability of certain special services at the time when a customer uses the e-mail label link to create a return shipment. + + + + + + + + + Return Email Details + + + + + Phone number of the merchant + + + + + Identifies the allowed (merchant-authorized) special services which may be selected when the subsequent shipment is created. Only services represented in EMailLabelAllowedSpecialServiceType will be controlled by this list. + + + + + + + Information relating to a return shipment. + + + + + The type of return shipment that is being requested. + + + + + Return Merchant Authorization + + + + + Describes specific information about the email label for return shipment. + + + + + + + The type of return shipment that is being requested. + + + + + + + + + + The "PAYOR..." rates are expressed in the currency identified in the payor's rate table(s). The "RATED..." rates are expressed in the currency of the origin country. Former "...COUNTER..." values have become "...RETAIL..." values, except for PAYOR_COUNTER and RATED_COUNTER, which have been removed. + + + + + + + + + + + + + + + + Shipping document type. + + + + + + + + + + + + + + + + + + + + + + + + + + + + Return Merchant Authorization + + + + + The RMA number. + + 20 + + + + + + The reason for the return. + + 60 + + + + + + + + The tracking number information and the data to form the Astra barcode for the label. + + + + + The tracking number information for the shipment. + + + + + + The textual description of the special service applied to the package. + + + + + + + + Information about the routing, origin, destination and delivery of a shipment. + + + + + The routing information detail for this shipment. + + + + + The tracking number information and the data to form the Astra barcode for the label. + + + + + + + Identifies the collection of available FedEx service options. + + + + + + + + + + + + + + + + + + + + + + + + + Shipment-level totals of dry ice data across all packages. + + + + + Total number of packages in the shipment that contain dry ice. + + + + + Total shipment dry ice weight for all packages. + + + + + + + Data for a shipment's total/summary rates, as calculated per a specific rate type. The "total..." fields may differ from the sum of corresponding package data for Multiweight or Express MPS. + + + + + Type used for this specific set of rate data. + + + + + Indicates the rate scale used. + + + + + Indicates the rate zone used (based on origin and destination). + + + + + Identifies the type of pricing used for this shipment. + + + + + Indicates which weight was used. + + + + + INTERNAL FEDEX USE ONLY. + + + + + Specifies the currency exchange performed on financial amounts for this rate. + + + + + Indicates which special rating cases applied to this shipment. + + + + + The value used to calculate the weight based on the dimensions. + + + + + Identifies the type of dim divisor that was applied. + + + + + Specifies a fuel surcharge percentage. + + + + + The weight used to calculate these rates. + + + + + Sum of dimensional weights for all packages. + + + + + The total freight charge that was calculated for this package before surcharges, discounts and taxes. + + + + + The total discounts used in the rate calculation. + + + + + The freight charge minus discounts. + + + + + The total amount of all surcharges applied to this shipment. + + + + + This shipment's totalNetFreight + totalSurcharges (not including totalTaxes). + + + + + Total of the transportation-based taxes. + + + + + The net charge after applying all discounts and surcharges. + + + + + The total sum of all rebates applied to this shipment. + + + + + Total of all values under this shipment's dutiesAndTaxes; only provided if estimated duties and taxes were calculated for this shipment. + + + + + This shipment's totalNetCharge + totalDutiesAndTaxes; only provided if estimated duties and taxes were calculated for this shipment AND duties, taxes and transportation charges are all paid by the same sender's account. + + + + + Rate data specific to FedEx Freight and FedEx National Freight services. + + + + + All rate discounts that apply to this shipment. + + + + + All rebates that apply to this shipment. + + + + + All surcharges that apply to this shipment. + + + + + All transportation-based taxes applicable to this shipment. + + + + + All commodity-based duties and taxes applicable to this shipment. + + + + + The "order level" variable handling charges. + + + + + The total of all variable handling charges at both shipment (order) and package level. + + + + + + + This class groups together all shipment-level rate data (across all rate types) as part of the response to a shipping request, which groups shipment-level data together and groups package-level data by package. + + + + + This rate type identifies which entry in the following array is considered as presenting the "actual" rates for the shipment. + + + + + The "list" total net charge minus "actual" total net charge. + + + + + Each element of this field provides shipment-level rate totals for a specific rate type. + + + + + + + + + This indicates the highest level of severity of all the notifications returned in this reply + + + + + The descriptive data regarding the results of the submitted transaction. + + + + + Descriptive data for this customer transaction. The TransactionDetail from the request is echoed back to the caller in the corresponding reply. + + + + + Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply). + + + + + + + Information about the routing, origin, destination and delivery of a shipment. + + + + + The prefix portion of the URSA (Universal Routing and Sort Aid) code. + + 2 + + + + + + The suffix portion of the URSA code. + + 5 + + + + + + The identifier of the origin location of the shipment. Express only. + + 5 + + + + + + + The identifier of the destination location of the shipment. Express only. + + 5 + + + + + + + This is the state of the destination location ID, and is not necessarily the same as the postal state. + + + + + Expected/estimated date of delivery. + + + + + Expected/estimated day of week of delivery. + + + + + Committed date of delivery. + + + + + Committed day of week of delivery. + + + + + Standard transit time per origin, destination, and service. + + + + + Maximum expected transit time + + + + + Text describing planned delivery. + + + + + Currently not supported. + + TBD + + + + + + The postal code of the destination of the shipment. + + 16 + + + + + + The state or province code of the destination of the shipment. + + 14 + + + + + + The country code of the destination of the shipment. + + 2 + + + + + + The identifier for the airport of the destination of the shipment. + + 4 + + + + + + + + Identifies the collection of special service offered by FedEx. BROKER_SELECT_OPTION should be used for Express shipments only. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + These special services are available at the shipment level for some or all service types. If the shipper is requesting a special service which requires additional data (such as the COD amount), the shipment special service type must be present in the specialServiceTypes collection, and the supporting detail must be provided in the appropriate sub-object below. + + + + + The types of all special services requested for the enclosing shipment (or other shipment-level transaction). + + + + + Descriptive data required for a FedEx COD (Collect-On-Delivery) shipment. This element is required when SpecialServiceType.COD is present in the SpecialServiceTypes collection. + + + + + Descriptive data required for a FedEx shipment that is to be held at the destination FedEx location for pickup by the recipient. This element is required when SpecialServiceType.HOLD_AT_LOCATION is present in the SpecialServiceTypes collection. + + + + + Descriptive data required for FedEx to provide email notification to the customer regarding the shipment. This element is required when SpecialServiceType.EMAIL_NOTIFICATION is present in the SpecialServiceTypes collection. + + + + + The descriptive data required for FedEx Printed Return Label. This element is required when SpecialServiceType.PRINTED_RETURN_LABEL is present in the SpecialServiceTypes collection + + + + + This field should be populated for pending shipments (e.g. e-mail label) It is required by a PENDING_SHIPMENT special service type. + + + + + Number of packages in this shipment which contain dry ice and the total weight of the dry ice for this shipment. + + + + + The descriptive data required for FedEx Home Delivery options. This element is required when SpecialServiceType.HOME_DELIVERY_PREMIUM is present in the SpecialServiceTypes collection + + + + + Electronic Trade document references. + + + + + Specification for date or range of dates on which delivery is to be attempted. + + + + + + + All package-level shipping documents (other than labels and barcodes). + + + + + Shipping Document Type + + + + + Specifies how this document image/file is organized. + + + + + + The name under which a STORED or DEFERRED document is written. + + + + + Specifies the image resolution in DPI (dots per inch). + + + + + Can be zero for documents whose disposition implies that no content is included. + + + + + One or more document parts which make up a single logical document, such as multiple pages of a single form. + + + + + + + Each occurrence of this class specifies a particular way in which a kind of shipping document is to be produced and provided. + + + + + Values in this field specify how to create and return the document. + + + + + Specifies how to organize all documents of this type. + + + + + Specifies how to e-mail document images. + + + + + Specifies how a queued document is to be printed. + + + + + + + Specifies how to return a shipping document to the caller. + + + + + + + + + + + + + + Specifies how to e-mail shipping documents. + + + + + Provides the roles and email addresses for e-mail recipients. + + + + + Identifies the convention by which documents are to be grouped as e-mail attachments. + + + + + + + + + + + + + Specifies an individual recipient of e-mailed shipping document(s). + + + + + Identifies the relationship of this recipient in the shipment. + + + + + Address to which the document is to be sent. + + + + + + + Specifies characteristics of a shipping document to be produced. + + + + + Specifies how to create, organize, and return the document. + + + + + Specifies how far down the page to move the beginning of the image; allows for printing on letterhead and other pre-printed stock. + + + + + + + For those shipping document types which have both a "form" and "instructions" component (e.g. NAFTA Certificate of Origin and General Agency Agreement), this field indicates whether to provide the instructions. + + + + + Governs the language to be used for this individual document, independently from other content returned for the same shipment. + + + + + Identifies the individual document specified by the client. + + + + + + + Specifies how to organize all shipping documents of the same type. + + + + + + + + + Specifies the image format used for a shipping document. + + + + + + + + + + + + + + + A single part of a shipping document, such as one page of a multiple-page document whose format requires a separate image per page. + + + + + The one-origin position of this part within a document. + + + + + Graphic or printer commands for this image within a document. + + + + + + + Specifies printing options for a shipping document. + + + + + Provides environment-specific printer identification. + + + + + + + Contains all data required for additional (non-label) shipping documents to be produced in conjunction with a specific shipment. + + + + + Indicates the types of shipping documents requested by the shipper. + + + + + + + Specifies the production of each package-level custom document (the same specification is used for all packages). + + + + + Specifies the production of a shipment-level custom document. + + + + + This element is currently not supported and is for the future use. (Details pertaining to the GAA.) + + + + + + Specifies the production of the OP-900 document for hazardous materials packages. + + + + + Specifies the production of the OP-900 document for hazardous materials. + + + + + + + Specifies the type of paper (stock) on which a document will be printed. + + + + + + + + + + + + + + + + + + The descriptive data required for FedEx delivery signature services. + + + + + Identifies the delivery signature services option selected by the customer for this shipment. See OptionType for the list of valid values. + + + + + Identifies the delivery signature release authorization number. + + 10 + + + + + + + + Identifies the delivery signature services options offered by FedEx. + + + + + + + + + + + + These values are mutually exclusive; at most one of them can be attached to a SmartPost shipment. + + + + + + + + + + + + + + + + + + + + + Data required for shipments handled under the SMART_POST and GROUND_SMART_POST service types. + + + + + + + + + The CustomerManifestId is used to group Smart Post packages onto a manifest for each trailer that is being prepared. If you do not have multiple trailers this field can be omitted. If you have multiple trailers, you + must assign the same Manifest Id to each SmartPost package as determined by its trailer. In other words, all packages on a trailer must have the same Customer Manifest Id. The manifest Id must be unique to your account number for a minimum of 6 months + and cannot exceed 8 characters in length. We recommend you use the day of year + the trailer id (this could simply be a sequential number for that trailer). So if you had 3 trailers that you started loading on Feb 10 + the 3 manifest ids would be 041001, 041002, 041003 (in this case we used leading zeros on the trailer numbers). + + + + + + + + Special circumstance rating used for this shipment. + + + + + + + + + Each instance of this data type represents a barcode whose content must be represented as ASCII text (i.e. not binary data). + + + + + The kind of barcode data in this instance. + + + + + The data content of this instance. + + + + + + + + + + + + + + + + + Identifies each surcharge applied to the shipment. + + + + + The type of surcharge applied to the shipment. + + + + + + + The amount of the surcharge applied to the shipment. + + + + + + + + + + + + + The type of the surcharge. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Identifies each tax applied to the shipment. + + + + + The type of tax applied to the shipment. + + + + + + The amount of the tax applied to the shipment. + + + + + + + The type of the tax. + + + + + + + + + + + + + + The descriptive data for taxpayer identification information. + + + + + Identifies the category of the taxpayer identification number. See TinType for the list of values. + + + + + Identifies the taxpayer identification number. + + 15 + + + + + + Identifies the usage of Tax Identification Number in Shipment processing + + + + + + + + Required for dutiable international express or ground shipment. This field is not applicable to an international PIB (document) or a non-document which does not require a commercial invoice express shipment. + CFR_OR_CPT (Cost and Freight/Carriage Paid TO) + CIF_OR_CIP (Cost Insurance and Freight/Carraige Insurance Paid) + DDP (Delivered Duty Paid) + DDU (Delivered Duty Unpaid) + EXW (Ex Works) + FOB_OR_FCA (Free On Board/Free Carrier) + + + + + + + + + + + + + + Identifies the category of the taxpayer identification number. + + + + + + + + + + + + + + + For use with SmartPost tracking IDs only + + + + + + + + TrackingIdType + + + + + + + + + + + Descriptive data for this customer transaction. The TransactionDetail from the request is echoed back to the caller in the corresponding reply. + + + + + Free form text to be echoed back in the reply. Used to match requests and replies. + + + + + Governs data payload language/translations (contrasted with ClientDetail.localization, which governs Notification.localizedMessage language selection). + + + + + + + Identifies the set of valid shipment transit time values. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Descriptive data sent to FedEx by a customer in order to validate a shipment. + + + + + Descriptive data to be used in authentication of the sender's identity (and right to use FedEx web services). + + + + + Descriptive data identifying the client submitting the transaction. + + + + + Descriptive data for this customer transaction. The TransactionDetail from the request is echoed back to the caller in the corresponding reply. + + + + + Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply). + + + + + Descriptive data about the shipment being sent by the requestor. + + + + + + + Documents the kind and quantity of an individual hazardous commodity in a package. + + + + + Identifies and describes an individual hazardous commodity. + + + + + Specifies the amount of the commodity in alternate units. + + + + + Customer-provided specifications for handling individual commodities. + + + + + + + Identifies and describes an individual hazardous commodity. For 201001 load, this is based on data from the FedEx Ground Hazardous Materials Shipping Guide. + + + + + Regulatory identifier for a commodity (e.g. "UN ID" value). + + + + + + + Fully-expanded descriptive text for a hazardous commodity. + + + + + + + + Coded indications for special requirements or constraints. + + + + + + + + Details about how to calculate variable handling charges at the shipment level. + + + + + The type of handling charge to be calculated and returned in the reply. + + + + + + Used with Variable handling charge type of FIXED_VALUE. + Contains the amount to be added to the freight charge. + Contains 2 explicit decimal positions with a total max length of 10 including the decimal. + + + + + + Actual percentage (10 means 10%, which is a mutiplier of 0.1) + + + + + + + The type of handling charge to be calculated and returned in the reply. + + + + + + + + + + + The variable handling charges calculated based on the type variable handling charges requested. + + + + + The variable handling charge amount calculated based on the requested variable handling charge detail. + + + + + The calculated varibale handling charge plus the net charge. + + + + + + + Three-dimensional volume/cubic measurement. + + + + + + + + + Units of three-dimensional volume/cubic measure. + + + + + + + + + The descriptive data for the heaviness of an object. + + + + + Identifies the unit of measure associated with a weight value. + + + + + Identifies the weight value of a package/shipment. + + + + + + + Identifies the unit of measure associated with a weight value. See the list of enumerated types for valid values. + + + + + + + + + Used in authentication of the sender's identity. + + + + + Credential used to authenticate a specific software application. This value is provided by FedEx after registration. + + + + + + + Two part authentication string used for the sender's identity + + + + + Identifying part of authentication credential. This value is provided by FedEx after registration + + + + + Secret part of authentication key. This value is provided by FedEx after registration. + + + + + + + Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply). + + + + + Identifies a system or sub-system which performs an operation. + + + + + Identifies the service business level. + + + + + Identifies the service interface level. + + + + + Identifies the service code level. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/code/core/Mage/Usa/sql/usa_setup/install-1.6.0.0.php b/app/code/core/Mage/Usa/sql/usa_setup/install-1.6.0.0.php index 24fbca59ca..a6724261fb 100644 --- a/app/code/core/Mage/Usa/sql/usa_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Usa/sql/usa_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/sql/usa_setup/mysql4-upgrade-0.7.0-0.7.1.php b/app/code/core/Mage/Usa/sql/usa_setup/mysql4-upgrade-0.7.0-0.7.1.php index e8df0ee550..9d3c8c7a49 100644 --- a/app/code/core/Mage/Usa/sql/usa_setup/mysql4-upgrade-0.7.0-0.7.1.php +++ b/app/code/core/Mage/Usa/sql/usa_setup/mysql4-upgrade-0.7.0-0.7.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/sql/usa_setup/upgrade-1.6.0.0-1.6.0.1.php b/app/code/core/Mage/Usa/sql/usa_setup/upgrade-1.6.0.0-1.6.0.1.php index bf889d4243..d33d196864 100644 --- a/app/code/core/Mage/Usa/sql/usa_setup/upgrade-1.6.0.0-1.6.0.1.php +++ b/app/code/core/Mage/Usa/sql/usa_setup/upgrade-1.6.0.0-1.6.0.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Weee/Block/Element/Weee/Tax.php b/app/code/core/Mage/Weee/Block/Element/Weee/Tax.php index a83d7b2484..967d49d247 100644 --- a/app/code/core/Mage/Weee/Block/Element/Weee/Tax.php +++ b/app/code/core/Mage/Weee/Block/Element/Weee/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Weee - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Weee/Block/Renderer/Weee/Tax.php b/app/code/core/Mage/Weee/Block/Renderer/Weee/Tax.php index 2e1c1f6eb1..958bf64b40 100644 --- a/app/code/core/Mage/Weee/Block/Renderer/Weee/Tax.php +++ b/app/code/core/Mage/Weee/Block/Renderer/Weee/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Weee - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Weee/Helper/Data.php b/app/code/core/Mage/Weee/Helper/Data.php index 4f119e59d9..d0b18bbb99 100644 --- a/app/code/core/Mage/Weee/Helper/Data.php +++ b/app/code/core/Mage/Weee/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Weee - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -344,4 +344,26 @@ public function isEnabled($store = null) { return Mage::getStoreConfig(self::XML_PATH_FPT_ENABLED, $store); } + + /** + * Returns all summed WEEE taxes with all local taxes applied + * + * @throws Mage_Exception + * @param array $attributes Array of Varien_Object, result from getProductWeeeAttributes() + * @return float + */ + public function getAmountInclTaxes($attributes) + { + if (is_array($attributes)) { + $amount = 0; + foreach ($attributes as $attribute) { + /* @var $attribute Varien_Object */ + $amount += $attribute->getAmount() + $attribute->getTaxAmount(); + } + } else { + throw new Mage_Exception('$attributes must be an array'); + } + + return (float)$amount; + } } diff --git a/app/code/core/Mage/Weee/Model/Attribute/Backend/Weee/Tax.php b/app/code/core/Mage/Weee/Model/Attribute/Backend/Weee/Tax.php index bd500378fe..937eed9356 100644 --- a/app/code/core/Mage/Weee/Model/Attribute/Backend/Weee/Tax.php +++ b/app/code/core/Mage/Weee/Model/Attribute/Backend/Weee/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Weee - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Weee/Model/Config/Source/Display.php b/app/code/core/Mage/Weee/Model/Config/Source/Display.php index d8a2fd4230..e212d1a358 100644 --- a/app/code/core/Mage/Weee/Model/Config/Source/Display.php +++ b/app/code/core/Mage/Weee/Model/Config/Source/Display.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Weee - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Weee_Model_Config_Source_Display diff --git a/app/code/core/Mage/Weee/Model/Mysql4/Attribute/Backend/Weee/Tax.php b/app/code/core/Mage/Weee/Model/Mysql4/Attribute/Backend/Weee/Tax.php index 38c29cf93d..9d34b48126 100644 --- a/app/code/core/Mage/Weee/Model/Mysql4/Attribute/Backend/Weee/Tax.php +++ b/app/code/core/Mage/Weee/Model/Mysql4/Attribute/Backend/Weee/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Weee - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Weee/Model/Mysql4/Setup.php b/app/code/core/Mage/Weee/Model/Mysql4/Setup.php index a9348617c0..fe96cd4d71 100644 --- a/app/code/core/Mage/Weee/Model/Mysql4/Setup.php +++ b/app/code/core/Mage/Weee/Model/Mysql4/Setup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Weee - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Weee/Model/Mysql4/Tax.php b/app/code/core/Mage/Weee/Model/Mysql4/Tax.php index b11f64bc9f..6b9a3d8305 100644 --- a/app/code/core/Mage/Weee/Model/Mysql4/Tax.php +++ b/app/code/core/Mage/Weee/Model/Mysql4/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Weee - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Weee/Model/Observer.php b/app/code/core/Mage/Weee/Model/Observer.php index d7bbc01843..cd298b1fc2 100644 --- a/app/code/core/Mage/Weee/Model/Observer.php +++ b/app/code/core/Mage/Weee/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Weee - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -115,7 +115,8 @@ public function prepareCatalogIndexSelect(Varien_Event_Observer $observer) array() ); } - $checkDiscountField = $select->getAdapter()->getCheckSql('discount_percent.value IS NULL', 0, 'discount_percent.value'); + $checkDiscountField = $select->getAdapter()->getCheckSql( + 'discount_percent.value IS NULL', 0, 'discount_percent.value'); foreach ($attributes as $attribute) { $fieldAlias = sprintf('weee_%s_table.value', $attribute); $checkAdditionalCalculation = $select->getAdapter()->getCheckSql("{$fieldAlias} IS NULL", 0, $fieldAlias); @@ -132,7 +133,8 @@ public function prepareCatalogIndexSelect(Varien_Event_Observer $observer) $attributes = Mage::getSingleton('weee/tax')->getWeeeTaxAttributeCodes(); foreach ($attributes as $attribute) { - $attributeId = (int)Mage::getSingleton('eav/entity_attribute')->getIdByCode(Mage_Catalog_Model_Product::ENTITY, $attribute); + $attributeId = (int)Mage::getSingleton('eav/entity_attribute') + ->getIdByCode(Mage_Catalog_Model_Product::ENTITY, $attribute); $tableAlias = sprintf('weee_%s_table', $attribute); $quotedTableAlias = $select->getAdapter()->quoteTableAs($tableAlias, null); $attributeSelect = $this->_getSelect(); @@ -141,8 +143,7 @@ public function prepareCatalogIndexSelect(Varien_Event_Observer $observer) ->where("{$quotedTableAlias}.attribute_id = ?", $attributeId) ->where("{$quotedTableAlias}.website_id IN(?)", array($websiteId, 0)) ->where("{$quotedTableAlias}.country = ?", $rateRequest->getCountryId()) - ->where("{$quotedTableAlias}.state IN(?)", array($rateRequest->getRegionId(), '*')) - ->limit(1); + ->where("{$quotedTableAlias}.state IN(?)", array($rateRequest->getRegionId(), '*')); $order = array( sprintf('%s.state %s', $tableAlias, Varien_Db_Select::SQL_DESC), @@ -278,7 +279,9 @@ public function updateDiscountPercents(Varien_Event_Observer $observer) */ public function updateCofigurableProductOptions(Varien_Event_Observer $observer) { - if (!Mage::helper('weee')->isEnabled()) { + /* @var $weeeHelper Mage_Weee_Helper_Data */ + $weeeHelper = Mage::helper('weee'); + if (!$weeeHelper->isEnabled()) { return $this; } @@ -289,14 +292,21 @@ public function updateCofigurableProductOptions(Varien_Event_Observer $observer) if (!$_product) { return $this; } - if (!Mage::helper('weee')->typeOfDisplay($_product, array(0, 1, 4))) { - return $this; - } - $amount = Mage::helper('weee')->getAmount($_product); - $origAmount = Mage::helper('weee')->getOriginalAmount($_product); + + $amount = $weeeHelper->getAmount($_product); + $origAmount = $weeeHelper->getOriginalAmount($_product); + $attributes = $weeeHelper->getProductWeeeAttributes($_product, null, null, null, $weeeHelper->isTaxable()); + $amountInclTaxes = $weeeHelper->getAmountInclTaxes($attributes); + $taxes = $amountInclTaxes - $amount; $options['oldPlusDisposition'] = $origAmount; - $options['plusDisposition'] = $amount; + $options['plusDisposition'] = $amount; + $options['plusDispositionTax'] = ($taxes < 0) ? 0 : $taxes; + + // Exclude Weee amount from excluding tax amount + if (!$weeeHelper->typeOfDisplay($_product, array(0, 1, 4))) { + $options['exclDisposition'] = true; + } $response->setAdditionalOptions($options); @@ -311,7 +321,9 @@ public function updateCofigurableProductOptions(Varien_Event_Observer $observer) */ public function updateBundleProductOptions(Varien_Event_Observer $observer) { - if (!Mage::helper('weee')->isEnabled()) { + /* @var $weeeHelper Mage_Weee_Helper_Data */ + $weeeHelper = Mage::helper('weee'); + if (!$weeeHelper->isEnabled()) { return $this; } @@ -320,16 +332,22 @@ public function updateBundleProductOptions(Varien_Event_Observer $observer) $options = $response->getAdditionalOptions(); $_product = Mage::registry('current_product'); - if (!Mage::helper('weee')->typeOfDisplay($_product, array(0, 1, 4))) { - return $this; - } + $typeDynamic = Mage_Bundle_Block_Adminhtml_Catalog_Product_Edit_Tab_Attributes_Extend::DYNAMIC; if (!$_product || $_product->getPriceType() != $typeDynamic) { return $this; } - $amount = Mage::helper('weee')->getAmount($selection); - $options['plusDisposition'] = $amount; + $amount = $weeeHelper->getAmount($selection); + $attributes = $weeeHelper->getProductWeeeAttributes($_product, null, null, null, $weeeHelper->isTaxable()); + $amountInclTaxes = $weeeHelper->getAmountInclTaxes($attributes); + $taxes = $amountInclTaxes - $amount; + $options['plusDisposition'] = $amount; + $options['plusDispositionTax'] = ($taxes < 0) ? 0 : $taxes; + // Exclude Weee amount from excluding tax amount + if (!$weeeHelper->typeOfDisplay($_product, array(0, 1, 4))) { + $options['exclDisposition'] = true; + } $response->setAdditionalOptions($options); diff --git a/app/code/core/Mage/Weee/Model/Resource/Attribute/Backend/Weee/Tax.php b/app/code/core/Mage/Weee/Model/Resource/Attribute/Backend/Weee/Tax.php index 4fbe732049..95f412981b 100755 --- a/app/code/core/Mage/Weee/Model/Resource/Attribute/Backend/Weee/Tax.php +++ b/app/code/core/Mage/Weee/Model/Resource/Attribute/Backend/Weee/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Weee - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Weee/Model/Resource/Setup.php b/app/code/core/Mage/Weee/Model/Resource/Setup.php index d736d91468..15738964c1 100755 --- a/app/code/core/Mage/Weee/Model/Resource/Setup.php +++ b/app/code/core/Mage/Weee/Model/Resource/Setup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Weee - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Weee/Model/Resource/Tax.php b/app/code/core/Mage/Weee/Model/Resource/Tax.php index fe599ce36d..12339f665a 100755 --- a/app/code/core/Mage/Weee/Model/Resource/Tax.php +++ b/app/code/core/Mage/Weee/Model/Resource/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Weee - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Weee/Model/Tax.php b/app/code/core/Mage/Weee/Model/Tax.php index aba12e0126..11dc7efd1f 100644 --- a/app/code/core/Mage/Weee/Model/Tax.php +++ b/app/code/core/Mage/Weee/Model/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Weee - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -85,7 +85,7 @@ public function getWeeeAttributeCodes($forceEnabled = false) /** * Retrieve Wee tax attribute codes - * + * * @param bool $forceEnabled * @return array */ @@ -117,8 +117,8 @@ public function getProductWeeeAttributes( $websiteId = Mage::app()->getWebsite($website)->getId(); $store = Mage::app()->getWebsite($website)->getDefaultGroup()->getDefaultStore(); - $customer = null; + if ($shipping) { $customerTaxClass = $shipping->getQuote()->getCustomerTaxClassId(); $customer = $shipping->getQuote()->getCustomer(); @@ -132,8 +132,8 @@ public function getProductWeeeAttributes( } $rateRequest = $calculator->getRateRequest($shipping, $billing, $customerTaxClass, $store); $defaultRateRequest = $calculator->getRateRequest(false, false, false, $store); - $discountPercent = 0; + if (!$ignoreDiscount && Mage::helper('weee')->isDiscounted($store)) { $discountPercent = $this->_getDiscountPercentForProduct($product); } @@ -141,7 +141,6 @@ public function getProductWeeeAttributes( $productAttributes = $product->getTypeInstance(true)->getSetAttributes($product); foreach ($productAttributes as $code => $attribute) { if (in_array($code, $allWeee)) { - $attributeSelect = $this->getResource()->getReadConnection()->select(); $attributeSelect ->from($this->getResource()->getTable('weee/tax'), 'value') @@ -154,27 +153,26 @@ public function getProductWeeeAttributes( $order = array('state ' . Varien_Db_Select::SQL_DESC, 'website_id ' . Varien_Db_Select::SQL_DESC); $attributeSelect->order($order); - $value = $this->getResource()->getReadConnection()->fetchOne($attributeSelect); + if ($value) { if ($discountPercent) { - $value = Mage::app()->getStore()->roundPrice($value-($value*$discountPercent/100)); + $value = Mage::app()->getStore()->roundPrice($value - ($value * $discountPercent / 100)); } - $taxAmount = $amount = 0; + $taxAmount = 0; $amount = $value; - /** - * We can't use FPT imcluding/excluding tax - */ -// if ($calculateTax && Mage::helper('weee')->isTaxable($store)) { -// $defaultPercent = Mage::getModel('tax/calculation') -// ->getRate($defaultRateRequest -// ->setProductClassId($product->getTaxClassId())); -// $currentPercent = $product->getTaxPercent(); -// -// $taxAmount = Mage::app()->getStore()->roundPrice($value/(100+$defaultPercent)*$currentPercent); -// $amount = $value - $taxAmount; -// } + if ($calculateTax && Mage::helper('weee')->isTaxable($store)) { + $defaultPercent = Mage::getModel('tax/calculation') + ->getRate($defaultRateRequest + ->setProductClassId($product->getTaxClassId())); + $currentPercent = $product->getTaxPercent(); + if (Mage::helper('tax')->priceIncludesTax($store)) { + $taxAmount = Mage::app()->getStore()->roundPrice($value/(100+$defaultPercent)*$currentPercent); + } else { + $taxAmount = Mage::app()->getStore()->roundPrice($value*$defaultPercent/100); + } + } $one = new Varien_Object(); $one->setName(Mage::helper('catalog')->__($attribute->getFrontend()->getLabel())) diff --git a/app/code/core/Mage/Weee/Model/Total/Creditmemo/Weee.php b/app/code/core/Mage/Weee/Model/Total/Creditmemo/Weee.php index 71bc49fbb9..b61a554727 100644 --- a/app/code/core/Mage/Weee/Model/Total/Creditmemo/Weee.php +++ b/app/code/core/Mage/Weee/Model/Total/Creditmemo/Weee.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Weee - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Weee/Model/Total/Invoice/Weee.php b/app/code/core/Mage/Weee/Model/Total/Invoice/Weee.php index 6b0827cd24..e342ccf887 100644 --- a/app/code/core/Mage/Weee/Model/Total/Invoice/Weee.php +++ b/app/code/core/Mage/Weee/Model/Total/Invoice/Weee.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Weee - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Weee/Model/Total/Quote/Nominal/Weee.php b/app/code/core/Mage/Weee/Model/Total/Quote/Nominal/Weee.php index bd99fbea00..272a11074d 100644 --- a/app/code/core/Mage/Weee/Model/Total/Quote/Nominal/Weee.php +++ b/app/code/core/Mage/Weee/Model/Total/Quote/Nominal/Weee.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Weee - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Weee/Model/Total/Quote/Weee.php b/app/code/core/Mage/Weee/Model/Total/Quote/Weee.php index 903190257e..bdb36808ae 100644 --- a/app/code/core/Mage/Weee/Model/Total/Quote/Weee.php +++ b/app/code/core/Mage/Weee/Model/Total/Quote/Weee.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Weee - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Weee/etc/config.xml b/app/code/core/Mage/Weee/etc/config.xml index 848d22bb9b..1a6af75e66 100644 --- a/app/code/core/Mage/Weee/etc/config.xml +++ b/app/code/core/Mage/Weee/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Weee - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -64,7 +64,7 @@ - + model @@ -72,7 +72,7 @@ prepareCatalogIndexSelect - + @@ -196,8 +196,8 @@ weee/total_invoice_weee - subtotal,tax - grand_total + subtotal + tax,discount,grand_total @@ -205,8 +205,8 @@ weee/total_creditmemo_weee - subtotal,tax - grand_total + subtotal + tax,discount,grand_total diff --git a/app/code/core/Mage/Weee/etc/system.xml b/app/code/core/Mage/Weee/etc/system.xml index 113094e5d8..e0615a4c90 100644 --- a/app/code/core/Mage/Weee/etc/system.xml +++ b/app/code/core/Mage/Weee/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Weee - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Weee/sql/weee_setup/install-1.6.0.0.php b/app/code/core/Mage/Weee/sql/weee_setup/install-1.6.0.0.php index a7434f6282..6fcce7c5c8 100644 --- a/app/code/core/Mage/Weee/sql/weee_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Weee/sql/weee_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Weee - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-install-0.1.php b/app/code/core/Mage/Weee/sql/weee_setup/mysql4-install-0.1.php index ae0fc4a826..56be4ea1cc 100644 --- a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-install-0.1.php +++ b/app/code/core/Mage/Weee/sql/weee_setup/mysql4-install-0.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Weee - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.1-0.2.php b/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.1-0.2.php index 592bbfba7d..3a3b855951 100644 --- a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.1-0.2.php +++ b/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.1-0.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Weee - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.10-0.11.php b/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.10-0.11.php index 87af06a333..ebbde65f59 100644 --- a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.10-0.11.php +++ b/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.10-0.11.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Weee - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.11-0.12.php b/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.11-0.12.php index 0706ec9337..ee20e618bb 100644 --- a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.11-0.12.php +++ b/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.11-0.12.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Weee - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.12-0.13.php b/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.12-0.13.php index 40fe1386ca..fbddd86918 100644 --- a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.12-0.13.php +++ b/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.12-0.13.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Weee - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.2-0.3.php b/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.2-0.3.php index f6d388050a..d90ecdf9b9 100644 --- a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.2-0.3.php +++ b/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.2-0.3.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Weee - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.3-0.4.php b/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.3-0.4.php index 661052cfb3..c727a8fbff 100644 --- a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.3-0.4.php +++ b/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.3-0.4.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Weee - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.4-0.5.php b/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.4-0.5.php index aedfb8856b..a1b6dab19a 100644 --- a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.4-0.5.php +++ b/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.4-0.5.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Weee - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.5-0.6.php b/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.5-0.6.php index 610ea31632..dd084bb9ad 100644 --- a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.5-0.6.php +++ b/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.5-0.6.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Weee - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.6-0.7.php b/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.6-0.7.php index a9043165bb..f43d90f464 100644 --- a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.6-0.7.php +++ b/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.6-0.7.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Weee - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.7-0.8.php b/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.7-0.8.php index 9f24169d69..53fde81981 100644 --- a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.7-0.8.php +++ b/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.7-0.8.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Weee - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.8-0.9.php b/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.8-0.9.php index 80c101cc61..7d2107f353 100644 --- a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.8-0.9.php +++ b/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.8-0.9.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Weee - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.9-0.10.php b/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.9-0.10.php index 842d7e8149..b0e2214527 100644 --- a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.9-0.10.php +++ b/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.9-0.10.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Weee - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php index e035854ff1..5d53f3a5ff 100644 --- a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ b/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Weee - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Widget/Block/Adminhtml/Widget.php b/app/code/core/Mage/Widget/Block/Adminhtml/Widget.php index c94853a7ae..9f73884e4b 100644 --- a/app/code/core/Mage/Widget/Block/Adminhtml/Widget.php +++ b/app/code/core/Mage/Widget/Block/Adminhtml/Widget.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -40,7 +40,7 @@ public function __construct() $this->_blockGroup = 'widget'; $this->_controller = 'adminhtml'; $this->_mode = 'widget'; - $this->_headerText = 'Widget Insertion'; + $this->_headerText = $this->helper('widget')->__('Widget Insertion'); $this->removeButton('reset'); $this->removeButton('back'); @@ -49,7 +49,8 @@ public function __construct() $this->_updateButton('save', 'id', 'insert_button'); $this->_updateButton('save', 'onclick', 'wWidget.insertWidget()'); - $this->_formScripts[] = 'wWidget = new WysiwygWidget.Widget("widget_options_form", "select_widget_type", "widget_options", "' - . $this->getUrl('*/*/loadOptions').'", "' . $this->getRequest()->getParam('widget_target_id') . '");'; + $this->_formScripts[] = 'wWidget = new WysiwygWidget.Widget(' + . '"widget_options_form", "select_widget_type", "widget_options", "' + . $this->getUrl('*/*/loadOptions') .'", "' . $this->getRequest()->getParam('widget_target_id') . '");'; } } diff --git a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Chooser.php b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Chooser.php index 9b5f279c42..434617b27d 100644 --- a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Chooser.php +++ b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Chooser.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -182,18 +182,21 @@ protected function _toHtml() diff --git a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Form.php b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Form.php index 0a6b27d87d..a1c0a43fb6 100644 --- a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Form.php +++ b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance.php b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance.php index 804e1795e2..6dd928cf14 100644 --- a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance.php +++ b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit.php b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit.php index 0b389e08fb..7c8d5fe7c3 100644 --- a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit.php +++ b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Block.php b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Block.php index 0e9019e43b..1bdd161e7e 100644 --- a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Block.php +++ b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Block.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -66,7 +66,7 @@ public function setAllowedBlocks($allowedBlocks) */ public function addAllowedBlock($block) { - $this->_allowedBlocks[] = $type; + $this->_allowedBlocks[] = $block; return $this; } @@ -92,7 +92,7 @@ public function setLayoutHandle($layoutHandle) if (is_string($layoutHandle)) { $layoutHandle = explode(',', $layoutHandle); } - $this->_layoutHandle = array_merge(array('default'), $layoutHandle); + $this->_layoutHandle = array_merge(array('default'), (array)$layoutHandle); return $this; } @@ -155,7 +155,8 @@ protected function _toHtml() $selectBlock = $this->getLayout()->createBlock('core/html_select') ->setName('block') ->setClass('required-entry select') - ->setExtraParams('onchange="WidgetInstance.loadSelectBoxByType(\'block_template\', this.up(\'div.group_container\'), this.value)"') + ->setExtraParams('onchange="WidgetInstance.loadSelectBoxByType(\'block_template\',' + .' this.up(\'div.group_container\'), this.value)"') ->setOptions($this->getBlocks()) ->setValue($this->getSelected()); return parent::_toHtml().$selectBlock->toHtml(); diff --git a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Layout.php b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Layout.php index 60144db9c1..ab42b76e6e 100644 --- a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Layout.php +++ b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Layout.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Template.php b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Template.php index acde4b225c..8af2d5ad70 100644 --- a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Template.php +++ b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Template.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Form.php b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Form.php index dad0347233..272c81afd4 100644 --- a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Form.php +++ b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Main.php b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Main.php index 3b0e183190..6edf148269 100644 --- a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Main.php +++ b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Main.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -154,6 +154,7 @@ protected function _prepareForm() 'title' => Mage::helper('widget')->__('Assign to Store Views'), 'required' => true, 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, true), + 'after_element_html' => Mage::getBlockSingleton('adminhtml/store_switcher')->getHintHtml() )); } diff --git a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Main/Layout.php b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Main/Layout.php index 9bcfe2f7f6..c71935de6e 100644 --- a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Main/Layout.php +++ b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Main/Layout.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Properties.php b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Properties.php index cbeaafeeb6..6cf78e2cca 100644 --- a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Properties.php +++ b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Properties.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Settings.php b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Settings.php index ce7da0159c..82918d606c 100644 --- a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Settings.php +++ b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Settings.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tabs.php b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tabs.php index 5ac217db3b..ddcb11a9dc 100644 --- a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tabs.php +++ b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tabs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Grid.php b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Grid.php index 15ca9ec5c3..1bb357ecf4 100644 --- a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Grid.php +++ b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Options.php b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Options.php index 64a827f6f1..75cef7f451 100644 --- a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Options.php +++ b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Options.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Widget/Block/Interface.php b/app/code/core/Mage/Widget/Block/Interface.php index e53e5cb173..caa8ce6375 100644 --- a/app/code/core/Mage/Widget/Block/Interface.php +++ b/app/code/core/Mage/Widget/Block/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Widget/Helper/Data.php b/app/code/core/Mage/Widget/Helper/Data.php index b1e121a251..923988b5dd 100644 --- a/app/code/core/Mage/Widget/Helper/Data.php +++ b/app/code/core/Mage/Widget/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Widget/Model/Mysql4/Widget.php b/app/code/core/Mage/Widget/Model/Mysql4/Widget.php index 457483c7c9..1904bb7e83 100644 --- a/app/code/core/Mage/Widget/Model/Mysql4/Widget.php +++ b/app/code/core/Mage/Widget/Model/Mysql4/Widget.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Widget/Model/Mysql4/Widget/Instance.php b/app/code/core/Mage/Widget/Model/Mysql4/Widget/Instance.php index 92428d08ee..608a0f932b 100644 --- a/app/code/core/Mage/Widget/Model/Mysql4/Widget/Instance.php +++ b/app/code/core/Mage/Widget/Model/Mysql4/Widget/Instance.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Widget/Model/Mysql4/Widget/Instance/Collection.php b/app/code/core/Mage/Widget/Model/Mysql4/Widget/Instance/Collection.php index 6885d71bcc..36a5201925 100644 --- a/app/code/core/Mage/Widget/Model/Mysql4/Widget/Instance/Collection.php +++ b/app/code/core/Mage/Widget/Model/Mysql4/Widget/Instance/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Widget/Model/Observer.php b/app/code/core/Mage/Widget/Model/Observer.php index b1466a45b8..43432abe73 100644 --- a/app/code/core/Mage/Widget/Model/Observer.php +++ b/app/code/core/Mage/Widget/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Widget/Model/Resource/Widget.php b/app/code/core/Mage/Widget/Model/Resource/Widget.php index a3147b1ad5..d709c0c5f4 100755 --- a/app/code/core/Mage/Widget/Model/Resource/Widget.php +++ b/app/code/core/Mage/Widget/Model/Resource/Widget.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Widget/Model/Resource/Widget/Instance.php b/app/code/core/Mage/Widget/Model/Resource/Widget/Instance.php index b85db7aaff..b2c84017b6 100755 --- a/app/code/core/Mage/Widget/Model/Resource/Widget/Instance.php +++ b/app/code/core/Mage/Widget/Model/Resource/Widget/Instance.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Widget/Model/Resource/Widget/Instance/Collection.php b/app/code/core/Mage/Widget/Model/Resource/Widget/Instance/Collection.php index 00d1567a03..8c63ced095 100755 --- a/app/code/core/Mage/Widget/Model/Resource/Widget/Instance/Collection.php +++ b/app/code/core/Mage/Widget/Model/Resource/Widget/Instance/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Widget/Model/Template/Filter.php b/app/code/core/Mage/Widget/Model/Template/Filter.php index 39848de7f8..cf6961ab03 100644 --- a/app/code/core/Mage/Widget/Model/Template/Filter.php +++ b/app/code/core/Mage/Widget/Model/Template/Filter.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Widget/Model/Widget.php b/app/code/core/Mage/Widget/Model/Widget.php index 7b01d970e5..b2579029e3 100644 --- a/app/code/core/Mage/Widget/Model/Widget.php +++ b/app/code/core/Mage/Widget/Model/Widget.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Widget/Model/Widget/Config.php b/app/code/core/Mage/Widget/Model/Widget/Config.php index 10e0c1ba0d..8d7c7841ab 100644 --- a/app/code/core/Mage/Widget/Model/Widget/Config.php +++ b/app/code/core/Mage/Widget/Model/Widget/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Widget/Model/Widget/Instance.php b/app/code/core/Mage/Widget/Model/Widget/Instance.php index c85b0c7799..b5e316cc43 100644 --- a/app/code/core/Mage/Widget/Model/Widget/Instance.php +++ b/app/code/core/Mage/Widget/Model/Widget/Instance.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -64,6 +64,13 @@ class Mage_Widget_Model_Widget_Instance extends Mage_Core_Model_Abstract */ protected $_widgetConfigXml = null; + /** + * Prefix of model events names + * + * @var string + */ + protected $_eventPrefix = 'widget_widget_instance'; + /** * Internal Constructor */ @@ -342,11 +349,11 @@ public function getWidgetParameters() if (is_string($this->getData('widget_parameters'))) { return unserialize($this->getData('widget_parameters')); } - return $this->getData('widget_parameters'); + return (is_array($this->getData('widget_parameters'))) ? $this->getData('widget_parameters') : array(); } /** - * Retrieve option arra of widget types + * Retrieve option array of widget types * * @return array */ diff --git a/app/code/core/Mage/Widget/controllers/Adminhtml/Widget/InstanceController.php b/app/code/core/Mage/Widget/controllers/Adminhtml/Widget/InstanceController.php index 4f1de1a2aa..48517492a1 100644 --- a/app/code/core/Mage/Widget/controllers/Adminhtml/Widget/InstanceController.php +++ b/app/code/core/Mage/Widget/controllers/Adminhtml/Widget/InstanceController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -130,6 +130,17 @@ public function editAction() $this->renderLayout(); } + /** + * Set body to response + * + * @param string $body + */ + private function setBody($body) + { + Mage::getSingleton('core/translate_inline')->processResponseBody($body); + $this->getResponse()->setBody($body); + } + /** * Validate action * @@ -146,7 +157,7 @@ public function validateAction() $response->setError(true); $response->setMessage($this->getLayout()->getMessagesBlock()->getGroupedHtml()); } - $this->getResponse()->setBody($response->toJson()); + $this->setBody($response->toJson()); } /** @@ -223,7 +234,7 @@ public function categoriesAction() ->setId(Mage::helper('core')->uniqHash('categories')) ->setIsAnchorOnly($isAnchorOnly) ->setSelectedCategories(explode(',', $selected)); - $this->getResponse()->setBody($chooser->toHtml()); + $this->setBody($chooser->toHtml()); } /** @@ -243,7 +254,7 @@ public function productsAction() /* @var $serializer Mage_Adminhtml_Block_Widget_Grid_Serializer */ $serializer = $this->getLayout()->createBlock('adminhtml/widget_grid_serializer'); $serializer->initSerializerBlock($chooser, 'getSelectedProducts', 'selected_products', 'selected_products'); - $this->getResponse()->setBody($chooser->toHtml().$serializer->toHtml()); + $this->setBody($chooser->toHtml().$serializer->toHtml()); } /** @@ -264,7 +275,7 @@ public function blocksAction() ->setLayoutHandle($layout) ->setSelected($selected) ->setAllowedBlocks($widgetInstance->getWidgetSupportedBlocks()); - $this->getResponse()->setBody($blocksChooser->toHtml()); + $this->setBody($blocksChooser->toHtml()); } /** @@ -281,7 +292,7 @@ public function templateAction() ->createBlock('widget/adminhtml_widget_instance_edit_chooser_template') ->setSelected($selected) ->setWidgetTemplates($widgetInstance->getWidgetSupportedTemplatesByBlock($block)); - $this->getResponse()->setBody($templateChooser->toHtml()); + $this->setBody($templateChooser->toHtml()); } /** diff --git a/app/code/core/Mage/Widget/controllers/Adminhtml/WidgetController.php b/app/code/core/Mage/Widget/controllers/Adminhtml/WidgetController.php index a0dc564c6d..3ffa1bdc84 100644 --- a/app/code/core/Mage/Widget/controllers/Adminhtml/WidgetController.php +++ b/app/code/core/Mage/Widget/controllers/Adminhtml/WidgetController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Widget/etc/adminhtml.xml b/app/code/core/Mage/Widget/etc/adminhtml.xml index 8531d281fe..faee7eff20 100644 --- a/app/code/core/Mage/Widget/etc/adminhtml.xml +++ b/app/code/core/Mage/Widget/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Widget/etc/config.xml b/app/code/core/Mage/Widget/etc/config.xml index 7a5a475246..7fbd471131 100644 --- a/app/code/core/Mage/Widget/etc/config.xml +++ b/app/code/core/Mage/Widget/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Widget/etc/jstranslator.xml b/app/code/core/Mage/Widget/etc/jstranslator.xml new file mode 100644 index 0000000000..8036b54879 --- /dev/null +++ b/app/code/core/Mage/Widget/etc/jstranslator.xml @@ -0,0 +1,34 @@ + + + + + + Insert Widget... + + + diff --git a/app/code/core/Mage/Widget/sql/widget_setup/install-1.6.0.0.php b/app/code/core/Mage/Widget/sql/widget_setup/install-1.6.0.0.php index 2a90ebaca5..652fb8703c 100644 --- a/app/code/core/Mage/Widget/sql/widget_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Widget/sql/widget_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Widget/sql/widget_setup/mysql4-install-1.4.0.0.0.php b/app/code/core/Mage/Widget/sql/widget_setup/mysql4-install-1.4.0.0.0.php index cf571baa6c..feb4c7ed54 100644 --- a/app/code/core/Mage/Widget/sql/widget_setup/mysql4-install-1.4.0.0.0.php +++ b/app/code/core/Mage/Widget/sql/widget_setup/mysql4-install-1.4.0.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Widget/sql/widget_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/Widget/sql/widget_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php index ca8330f7bb..dbbcf38bdf 100644 --- a/app/code/core/Mage/Widget/sql/widget_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ b/app/code/core/Mage/Widget/sql/widget_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/Block/Abstract.php b/app/code/core/Mage/Wishlist/Block/Abstract.php index adf0da4073..7de2e927e0 100644 --- a/app/code/core/Mage/Wishlist/Block/Abstract.php +++ b/app/code/core/Mage/Wishlist/Block/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -37,7 +37,7 @@ abstract class Mage_Wishlist_Block_Abstract extends Mage_Catalog_Block_Product_A /** * Wishlist Product Items Collection * - * @var Mage_Wishlist_Model_Mysql4_Item_Collection + * @var Mage_Wishlist_Model_Resource_Item_Collection */ protected $_collection; @@ -105,7 +105,7 @@ protected function _getWishlist() /** * Prepare additional conditions to collection * - * @param Mage_Wishlist_Model_Mysql4_Item_Collection $collection + * @param Mage_Wishlist_Model_Resource_Item_Collection $collection * @return Mage_Wishlist_Block_Customer_Wishlist */ protected function _prepareCollection($collection) @@ -113,22 +113,41 @@ protected function _prepareCollection($collection) return $this; } + /** + * Create wishlist item collection + * + * @return Mage_Wishlist_Model_Resource_Item_Collection + */ + protected function _createWishlistItemCollection() + { + return $this->_getWishlist()->getItemCollection(); + } + /** * Retrieve Wishlist Product Items collection * - * @return Mage_Wishlist_Model_Mysql4_Item_Collection + * @return Mage_Wishlist_Model_Resource_Item_Collection */ public function getWishlistItems() { if (is_null($this->_collection)) { - $this->_collection = $this->_getWishlist() - ->getItemCollection(); + $this->_collection = $this->_createWishlistItemCollection(); $this->_prepareCollection($this->_collection); } return $this->_collection; } + /** + * Retrieve wishlist instance + * + * @return Mage_Wishlist_Model_Wishlist + */ + public function getWishlistInstance() + { + return $this->_getWishlist(); + } + /** * Back compatibility retrieve wishlist product items * diff --git a/app/code/core/Mage/Wishlist/Block/Customer/Sharing.php b/app/code/core/Mage/Wishlist/Block/Customer/Sharing.php index a632009ddc..7961da0e16 100644 --- a/app/code/core/Mage/Wishlist/Block/Customer/Sharing.php +++ b/app/code/core/Mage/Wishlist/Block/Customer/Sharing.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -84,4 +84,14 @@ public function getEnteredData($key) return $this->htmlEscape($this->_enteredData[$key]); } } + + /** + * Retrieve back button url + * + * @return string + */ + public function getBackUrl() + { + return $this->getUrl('*/*/index'); + } } diff --git a/app/code/core/Mage/Wishlist/Block/Customer/Sidebar.php b/app/code/core/Mage/Wishlist/Block/Customer/Sidebar.php index c1cae4e840..dbea4d88b1 100644 --- a/app/code/core/Mage/Wishlist/Block/Customer/Sidebar.php +++ b/app/code/core/Mage/Wishlist/Block/Customer/Sidebar.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -34,6 +34,16 @@ */ class Mage_Wishlist_Block_Customer_Sidebar extends Mage_Wishlist_Block_Abstract { + /** + * Retrieve block title + * + * @return string + */ + public function getTitle() + { + return $this->__('My Wishlist (%d)', $this->getItemCount()); + } + /** * Add sidebar conditions to collection * @@ -57,7 +67,7 @@ protected function _prepareCollection($collection) */ protected function _toHtml() { - if (($this->getCustomWishlist() && $this->getItemCount()) || $this->hasWishlistItems()) { + if ($this->getItemCount()) { return parent::_toHtml(); } @@ -67,6 +77,7 @@ protected function _toHtml() /** * Can Display wishlist * + * @deprecated after 1.6.2.0 * @return bool */ public function getCanDisplayWishlist() @@ -99,19 +110,19 @@ public function getAddToCartItemUrl($product) } /** - * Retrieve Wishlist model + * Retrieve Wishlist Product Items collection * - * @return Mage_Wishlist_Model_Wishlist + * @return Mage_Wishlist_Model_Resource_Item_Collection */ - protected function _getWishlist() + public function getWishlistItems() { - - if (!$this->getCustomWishlist() || !is_null($this->_wishlist)) { - return parent::_getWishlist(); + if (is_null($this->_collection)) { + $this->_collection = clone $this->_createWishlistItemCollection(); + $this->_collection->clear(); + $this->_prepareCollection($this->_collection); } - $this->_wishlist = $this->getCustomWishlist(); - return $this->_wishlist; + return $this->_collection; } /** @@ -121,10 +132,16 @@ protected function _getWishlist() */ public function getItemCount() { - if ($this->getCustomWishlist()) { - return $this->getCustomWishlist()->getItemsCount(); - } + return $this->_getHelper()->getItemCount(); + } - return $this->getWishlistItemsCount(); + /** + * Check whether user has items in his wishlist + * + * @return bool + */ + public function hasWishlistItems() + { + return $this->getItemCount() > 0; } } diff --git a/app/code/core/Mage/Wishlist/Block/Customer/Wishlist.php b/app/code/core/Mage/Wishlist/Block/Customer/Wishlist.php index 22fe09e18d..97f3e66a52 100644 --- a/app/code/core/Mage/Wishlist/Block/Customer/Wishlist.php +++ b/app/code/core/Mage/Wishlist/Block/Customer/Wishlist.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -35,19 +35,10 @@ class Mage_Wishlist_Block_Customer_Wishlist extends Mage_Wishlist_Block_Abstract { /* - * List of product type configuration to render options list + * List of product options rendering configurations by product type */ protected $_optionsCfg = array(); - /* - * Constructor of block - adds default renderer for product configuration - */ - public function _construct() - { - parent::_construct(); - $this->addOptionsRenderCfg('default', 'catalog/product_configuration', 'wishlist/options_list.phtml'); - } - /** * Add wishlist conditions to collection * @@ -81,15 +72,13 @@ protected function _prepareLayout() */ public function getBackUrl() { - if ($this->getRefererUrl()) { - return $this->getRefererUrl(); - } return $this->getUrl('customer/account/'); } /** * Sets all options render configurations * + * @deprecated after 1.6.2.0 * @param null|array $optionCfg * @return Mage_Wishlist_Block_Customer_Wishlist */ @@ -102,6 +91,7 @@ public function setOptionsRenderCfgs($optionCfg) /** * Returns all options render configurations * + * @deprecated after 1.6.2.0 * @return array */ public function getOptionsRenderCfgs() @@ -111,8 +101,8 @@ public function getOptionsRenderCfgs() /* * Adds config for rendering product type options - * If template is null - later default will be used * + * @deprecated after 1.6.2.0 * @param string $productType * @param string $helperName * @param null|string $template @@ -127,6 +117,7 @@ public function addOptionsRenderCfg($productType, $helperName, $template = null) /** * Returns html for showing item options * + * @deprecated after 1.6.2.0 * @param string $productType * @return array|null */ @@ -144,6 +135,7 @@ public function getOptionsRenderCfg($productType) /** * Returns html for showing item options * + * @deprecated after 1.6.2.0 * @param Mage_Wishlist_Model_Item $item * @return string */ @@ -179,20 +171,10 @@ public function getDetailsHtml(Mage_Wishlist_Model_Item $item) ->toHtml(); } - /** - * Returns default description to show in textarea field - * - * @param Mage_Wishlist_Model_Item $item - * @return string - */ - public function getCommentValue(Mage_Wishlist_Model_Item $item) - { - return $this->hasDescription($item) ? $this->getEscapedDescription($item) : Mage::helper('wishlist')->defaultCommentString(); - } - /** * Returns qty to show visually to user * + * @deprecated after 1.6.2.0 * @param Mage_Wishlist_Model_Item $item * @return float */ diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method.php b/app/code/core/Mage/Wishlist/Block/Customer/Wishlist/Button.php similarity index 63% rename from app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method.php rename to app/code/core/Mage/Wishlist/Block/Customer/Wishlist/Button.php index 8eedc1c94b..cc4ba3efc0 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method.php +++ b/app/code/core/Mage/Wishlist/Block/Customer/Wishlist/Button.php @@ -19,25 +19,27 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage - * @package Mage_Usa - * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com) + * @package Mage_Wishlist + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -class Mage_Usa_Model_Shipping_Carrier_Dhl_International_Source_Method +/** + * Wishlist block customer item cart column + * + * @category Mage + * @package Mage_Wishlist + * @author Magento Core Team + */ +class Mage_Wishlist_Block_Customer_Wishlist_Button extends Mage_Core_Block_Template { /** - * Get Shipping Methods + * Retrieve current wishlist * - * @return array + * @return Mage_Wishlist_Model_Wishlist */ - public function toOptionArray() + public function getWishlist() { - $dhl = Mage::getSingleton('usa/shipping_carrier_dhl_international'); - $arr = array(); - foreach ($dhl->getDhlProducts() as $code => $title) { - $arr[] = array('value' => $code, 'label' => $title); - } - return $arr; + return Mage::helper('wishlist')->getWishlist(); } } diff --git a/app/code/core/Mage/Wishlist/Block/Customer/Wishlist/Item/Column.php b/app/code/core/Mage/Wishlist/Block/Customer/Wishlist/Item/Column.php new file mode 100644 index 0000000000..bfc8f8d98d --- /dev/null +++ b/app/code/core/Mage/Wishlist/Block/Customer/Wishlist/Item/Column.php @@ -0,0 +1,84 @@ + + */ +class Mage_Wishlist_Block_Customer_Wishlist_Item_Column extends Mage_Wishlist_Block_Abstract +{ + /** + * Checks whether column should be shown in table + * + * @return bool + */ + public function isEnabled() + { + return true; + } + + /** + * Retrieve block html + * + * @return string + */ + protected function _toHtml() + { + if ($this->isEnabled()) { + return parent::_toHtml(); + } + return ''; + } + + /** + * Retrieve child blocks html + * + * @param string $name + * @param Mage_Core_Block_Abstract $child + * @return string + */ + protected function _beforeChildToHtml($name, $child) + { + $child->setItem($this->getItem()); + } + + /** + * Retrieve column related javascript code + * + * @return string + */ + public function getJs() + { + $js = ''; + foreach ($this->getSortedChildBlocks() as $child) { + $js .= $child->getJs(); + } + return $js; + } +} diff --git a/app/code/core/Mage/Wishlist/Block/Customer/Wishlist/Item/Column/Cart.php b/app/code/core/Mage/Wishlist/Block/Customer/Wishlist/Item/Column/Cart.php new file mode 100644 index 0000000000..f7d8cdc7de --- /dev/null +++ b/app/code/core/Mage/Wishlist/Block/Customer/Wishlist/Item/Column/Cart.php @@ -0,0 +1,74 @@ + + */ +class Mage_Wishlist_Block_Customer_Wishlist_Item_Column_Cart extends Mage_Wishlist_Block_Customer_Wishlist_Item_Column +{ + /** + * Returns qty to show visually to user + * + * @param Mage_Wishlist_Model_Item $item + * @return float + */ + public function getAddToCartQty(Mage_Wishlist_Model_Item $item) + { + $qty = $item->getQty(); + return $qty ? $qty : 1; + } + + /** + * Retrieve column related javascript code + * + * @return string + */ + public function getJs() + { + $js = " + function addWItemToCart(itemId) { + var url = '" . $this->getItemAddToCartUrl('%item%') . "'; + url = url.gsub('%item%', itemId); + var form = $('wishlist-view-form'); + if (form) { + var input = form['qty[' + itemId + ']']; + if (input) { + var separator = (url.indexOf('?') >= 0) ? '&' : '?'; + url += separator + input.name + '=' + encodeURIComponent(input.value); + } + } + setLocation(url); + } + "; + + $js .= parent::getJs(); + return $js; + } +} diff --git a/app/code/core/Mage/Wishlist/Block/Customer/Wishlist/Item/Column/Comment.php b/app/code/core/Mage/Wishlist/Block/Customer/Wishlist/Item/Column/Comment.php new file mode 100644 index 0000000000..4e007a1f3a --- /dev/null +++ b/app/code/core/Mage/Wishlist/Block/Customer/Wishlist/Item/Column/Comment.php @@ -0,0 +1,54 @@ + + */ +class Mage_Wishlist_Block_Customer_Wishlist_Item_Column_Comment + extends Mage_Wishlist_Block_Customer_Wishlist_Item_Column +{ + /** + * Retrieve column javascript code + * + * @return string + */ + public function getJs() + { + return parent::getJs() . " + function focusComment(obj) { + if( obj.value == '" . $this->helper('wishlist')->defaultCommentString() . "' ) { + obj.value = ''; + } else if( obj.value == '' ) { + obj.value = '" . $this->helper('wishlist')->defaultCommentString() . "'; + } + } + "; + } +} diff --git a/app/code/core/Mage/Wishlist/Block/Customer/Wishlist/Item/Column/Image.php b/app/code/core/Mage/Wishlist/Block/Customer/Wishlist/Item/Column/Image.php new file mode 100644 index 0000000000..1804c269d2 --- /dev/null +++ b/app/code/core/Mage/Wishlist/Block/Customer/Wishlist/Item/Column/Image.php @@ -0,0 +1,36 @@ + + */ +class Mage_Wishlist_Block_Customer_Wishlist_Item_Column_Image extends Mage_Wishlist_Block_Customer_Wishlist_Item_Column +{ +} diff --git a/app/code/core/Mage/Wishlist/Block/Customer/Wishlist/Item/Column/Remove.php b/app/code/core/Mage/Wishlist/Block/Customer/Wishlist/Item/Column/Remove.php new file mode 100644 index 0000000000..25dd0b517a --- /dev/null +++ b/app/code/core/Mage/Wishlist/Block/Customer/Wishlist/Item/Column/Remove.php @@ -0,0 +1,49 @@ + + */ +class Mage_Wishlist_Block_Customer_Wishlist_Item_Column_Remove extends Mage_Wishlist_Block_Customer_Wishlist_Item_Column +{ + /** + * Retrieve block javascript + * + * @return string + */ + public function getJs() + { + return parent::getJs() . " + function confirmRemoveWishlistItem() { + return confirm('" . $this->__('Are you sure you want to remove this product from your wishlist?') . "'); + } + "; + } +} diff --git a/app/code/core/Mage/Wishlist/Block/Customer/Wishlist/Item/Options.php b/app/code/core/Mage/Wishlist/Block/Customer/Wishlist/Item/Options.php index 0e07231d41..8dc5d0be07 100644 --- a/app/code/core/Mage/Wishlist/Block/Customer/Wishlist/Item/Options.php +++ b/app/code/core/Mage/Wishlist/Block/Customer/Wishlist/Item/Options.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -33,4 +33,85 @@ */ class Mage_Wishlist_Block_Customer_Wishlist_Item_Options extends Mage_Wishlist_Block_Abstract { + /* + * List of product options rendering configurations by product type + * + * @var array + */ + protected $_optionsCfg = array('default' => array( + 'helper' => 'catalog/product_configuration', + 'template' => 'wishlist/options_list.phtml' + )); + + /** + * Initialize block + */ + public function __construct() + { + parent::__construct(); + Mage::dispatchEvent('product_option_renderer_init', array('block' => $this)); + } + + /* + * Adds config for rendering product type options + * + * @param string $productType + * @param string $helperName + * @param null|string $template + * @return Mage_Wishlist_Block_Customer_Wishlist_Item_Options + */ + public function addOptionsRenderCfg($productType, $helperName, $template = null) + { + $this->_optionsCfg[$productType] = array('helper' => $helperName, 'template' => $template); + return $this; + } + + /** + * Get item options renderer config + * + * @param string $productType + * @return array|null + */ + public function getOptionsRenderCfg($productType) + { + if (isset($this->_optionsCfg[$productType])) { + return $this->_optionsCfg[$productType]; + } elseif (isset($this->_optionsCfg['default'])) { + return $this->_optionsCfg['default']; + } else { + return null; + } + } + + /** + * Render block html + * + * @return string + */ + protected function _toHtml() + { + $cfg = $this->getOptionsRenderCfg($this->getItem()->getProduct()->getTypeId()); + if (!$cfg) { + return ''; + } + + $helper = Mage::helper($cfg['helper']); + if (!($helper instanceof Mage_Catalog_Helper_Product_Configuration_Interface)) { + Mage::throwException($this->__("Helper for wishlist options rendering doesn't implement required interface.")); + } + + if ($cfg['template']) { + $template = $cfg['template']; + } else { + $cfgDefault = $this->getOptionsRenderCfg('default'); + if (!$cfgDefault) { + return ''; + } + $template = $cfgDefault['template']; + } + + $this->setTemplate($template) + ->setOptionList($helper->getOptions($this->getItem())); + return parent::_toHtml(); + } } diff --git a/app/code/core/Mage/Wishlist/Block/Customer/Wishlist/Items.php b/app/code/core/Mage/Wishlist/Block/Customer/Wishlist/Items.php new file mode 100644 index 0000000000..f3ca9ada76 --- /dev/null +++ b/app/code/core/Mage/Wishlist/Block/Customer/Wishlist/Items.php @@ -0,0 +1,52 @@ + + */ +class Mage_Wishlist_Block_Customer_Wishlist_Items extends Mage_Core_Block_Template +{ + /** + * Retreive table column object list + * + * @return array + */ + public function getColumns() + { + $columns = array(); + foreach ($this->getSortedChildren() as $code) { + $child = $this->getChild($code); + if ($child->isEnabled()){ + $columns[] = $child; + } + } + return $columns; + } +} diff --git a/app/code/core/Mage/Wishlist/Block/Item/Configure.php b/app/code/core/Mage/Wishlist/Block/Item/Configure.php index d83e9cbd4d..2b7835404f 100644 --- a/app/code/core/Mage/Wishlist/Block/Item/Configure.php +++ b/app/code/core/Mage/Wishlist/Block/Item/Configure.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/Block/Links.php b/app/code/core/Mage/Wishlist/Block/Links.php index c30c797d93..f1d15d753d 100644 --- a/app/code/core/Mage/Wishlist/Block/Links.php +++ b/app/code/core/Mage/Wishlist/Block/Links.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -41,31 +41,57 @@ class Mage_Wishlist_Block_Links extends Mage_Page_Block_Template_Links_Block protected $_position = 30; /** - * Set link title, label and url + * @return string */ - public function __construct() + protected function _toHtml() { - parent::__construct(); - $this->initLinkProperties(); + if ($this->helper('wishlist')->isAllow()) { + $text = $this->_createLabel($this->_getItemCount()); + $this->_label = $text; + $this->_title = $text; + $this->_url = $this->getUrl('wishlist'); + return parent::_toHtml(); + } + return ''; } /** * Define label, title and url for wishlist link + * + * @deprecated after 1.6.2.0 */ public function initLinkProperties() { - if ($this->helper('wishlist')->isAllow()) { - $count = $this->getItemCount() ? $this->getItemCount() : $this->helper('wishlist')->getItemCount(); - if ($count > 1) { - $text = $this->__('My Wishlist (%d items)', $count); - } else if ($count == 1) { - $text = $this->__('My Wishlist (%d item)', $count); - } else { - $text = $this->__('My Wishlist'); - } - $this->_label = $text; - $this->_title = $text; - $this->_url = $this->getUrl('wishlist'); + $text = $this->_createLabel($this->_getItemCount()); + $this->_label = $text; + $this->_title = $text; + $this->_url = $this->getUrl('wishlist'); + } + + /** + * Count items in wishlist + * + * @return int + */ + protected function _getItemCount() + { + return $this->helper('wishlist')->getItemCount(); + } + + /** + * Create button label based on wishlist item quantity + * + * @param int $count + * @return string + */ + protected function _createLabel($count) + { + if ($count > 1) { + return $this->__('My Wishlist (%d items)', $count); + } else if ($count == 1) { + return $this->__('My Wishlist (%d item)', $count); + } else { + return $this->__('My Wishlist'); } } diff --git a/app/code/core/Mage/Wishlist/Block/Render/Item/Price.php b/app/code/core/Mage/Wishlist/Block/Render/Item/Price.php index 0d0cd9ff96..922d80b90e 100644 --- a/app/code/core/Mage/Wishlist/Block/Render/Item/Price.php +++ b/app/code/core/Mage/Wishlist/Block/Render/Item/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/Block/Share/Email/Items.php b/app/code/core/Mage/Wishlist/Block/Share/Email/Items.php index 1b60b3cf0e..eaf01c9220 100644 --- a/app/code/core/Mage/Wishlist/Block/Share/Email/Items.php +++ b/app/code/core/Mage/Wishlist/Block/Share/Email/Items.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/Block/Share/Email/Rss.php b/app/code/core/Mage/Wishlist/Block/Share/Email/Rss.php index a2bbf166f1..f3f6f14ca3 100644 --- a/app/code/core/Mage/Wishlist/Block/Share/Email/Rss.php +++ b/app/code/core/Mage/Wishlist/Block/Share/Email/Rss.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/Block/Share/Wishlist.php b/app/code/core/Mage/Wishlist/Block/Share/Wishlist.php index c09ef2f5cc..a5289db9e3 100644 --- a/app/code/core/Mage/Wishlist/Block/Share/Wishlist.php +++ b/app/code/core/Mage/Wishlist/Block/Share/Wishlist.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/Controller/Abstract.php b/app/code/core/Mage/Wishlist/Controller/Abstract.php index aa040888c4..ee1d08ba57 100644 --- a/app/code/core/Mage/Wishlist/Controller/Abstract.php +++ b/app/code/core/Mage/Wishlist/Controller/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -49,9 +49,11 @@ abstract class Mage_Wishlist_Controller_Abstract extends Mage_Core_Controller_Fr protected function _processLocalizedQty($qty) { if (!$this->_localFilter) { - $this->_localFilter = new Zend_Filter_LocalizedToNormalized(array('locale' => Mage::app()->getLocale()->getLocaleCode())); + $this->_localFilter = new Zend_Filter_LocalizedToNormalized( + array('locale' => Mage::app()->getLocale()->getLocaleCode()) + ); } - $qty = $this->_localFilter->filter($qty); + $qty = $this->_localFilter->filter((float)$qty); if ($qty < 0) { $qty = null; } @@ -91,6 +93,7 @@ public function allcartAction() foreach ($collection as $item) { /** @var Mage_Wishlist_Model_Item */ try { + $disableAddToCart = $item->getProduct()->getDisableAddToCart(); $item->unsProduct(); // Set qty @@ -100,7 +103,7 @@ public function allcartAction() $item->setQty($qty); } } - + $item->getProduct()->setDisableAddToCart($disableAddToCart); // Add to cart if ($item->addToCart($cart, $isOwner)) { $addedItems[] = $item->getProduct(); @@ -121,7 +124,7 @@ public function allcartAction() } if ($isOwner) { - $indexUrl = Mage::helper('wishlist')->getListUrl(); + $indexUrl = Mage::helper('wishlist')->getListUrl($wishlist->getId()); } else { $indexUrl = Mage::getUrl('wishlist/shared', array('code' => $wishlist->getSharingCode())); } diff --git a/app/code/core/Mage/Wishlist/Helper/Data.php b/app/code/core/Mage/Wishlist/Helper/Data.php index 3940e0d83b..93a1e7f1d8 100644 --- a/app/code/core/Mage/Wishlist/Helper/Data.php +++ b/app/code/core/Mage/Wishlist/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -44,6 +44,13 @@ class Mage_Wishlist_Helper_Data extends Mage_Core_Helper_Abstract */ const XML_PATH_CATALOGINVENTORY_SHOW_OUT_OF_STOCK = 'cataloginventory/options/show_out_of_stock'; + /** + * Currently logged in customer + * + * @var Mage_Customer_Model_Customer + */ + protected $_currentCustomer = null; + /** * Customer Wishlist instance * @@ -61,7 +68,7 @@ class Mage_Wishlist_Helper_Data extends Mage_Core_Helper_Abstract /** * Wishlist Items Collection * - * @var Mage_Wishlist_Model_Mysql4_Item_Collection + * @var Mage_Wishlist_Model_Resource_Item_Collection */ protected $_wishlistItemCollection = null; @@ -92,7 +99,30 @@ protected function _isCustomerLogIn() */ protected function _getCurrentCustomer() { - return $this->_getCustomerSession()->getCustomer(); + return $this->getCustomer(); + } + + /** + * Set current customer + * + * @param Mage_Customer_Model_Customer $customer + */ + public function setCustomer(Mage_Customer_Model_Customer $customer) + { + $this->_currentCustomer = $customer; + } + + /** + * Retrieve current customer + * + * @return Mage_Customer_Model_Customer|null + */ + public function getCustomer() + { + if (!$this->_currentCustomer && $this->_getCustomerSession()->isLoggedIn()) { + $this->_currentCustomer = $this->_getCustomerSession()->getCustomer(); + } + return $this->_currentCustomer; } /** @@ -111,8 +141,8 @@ public function getWishlist() } else { $this->_wishlist = Mage::getModel('wishlist/wishlist'); - if ($this->_getCustomerSession()->isLoggedIn()) { - $this->_wishlist->loadByCustomer($this->_getCustomerSession()->getCustomer()); + if ($this->getCustomer()) { + $this->_wishlist->loadByCustomer($this->getCustomer()); } } } @@ -169,22 +199,29 @@ public function getItemCollection() return $this->getProductCollection(); } + /** + * Create wishlist item collection + * + * @return Mage_Wishlist_Model_Resource_Item_Collection + */ + protected function _createWishlistItemCollection() + { + return $this->getWishlist()->getItemCollection(); + } /** * Retrieve wishlist items collection * - * @return Mage_Wishlist_Model_Mysql4_Item_Collection + * @return Mage_Wishlist_Model_Resource_Item_Collection */ public function getWishlistItemCollection() { if (is_null($this->_wishlistItemCollection)) { - $this->_wishlistItemCollection = $this->getWishlist() - ->getItemCollection(); + $this->_wishlistItemCollection = $this->_createWishlistItemCollection(); } return $this->_wishlistItemCollection; } - /** * Retrieve wishlist product items collection * @@ -269,6 +306,18 @@ public function getAddUrl($item) return $this->getAddUrlWithParams($item); } + /** + * Retrieve url for adding product to wishlist + * + * @param int $itemId + * + * @return string + */ + public function getMoveFromCartUrl($itemId) + { + return $this->_getUrl('wishlist/index/fromcart', array('item' => $itemId)); + } + /** * Retrieve url for updating product in wishlist * @@ -287,8 +336,7 @@ public function getUpdateUrl($item) } if ($itemId) { - $params['id'] = $itemId; - return $this->_getUrlStore($item)->getUrl('wishlist/index/updateItemOptions', $params); + return $this->_getUrl('wishlist/index/updateItemOptions', array('id' => $itemId)); } return false; @@ -382,11 +430,16 @@ public function getAddToCartUrlBase64($item) /** * Retrieve customer wishlist url * + * @param int $wishlistId * @return string */ - public function getListUrl() + public function getListUrl($wishlistId = null) { - return $this->_getUrl('wishlist'); + $params = array(); + if ($wishlistId) { + $params['wishlist_id'] = $wishlistId; + } + return $this->_getUrl('wishlist', $params); } /** @@ -409,34 +462,44 @@ public function isAllow() */ public function isAllowInCart() { - return $this->isAllow() && $this->_isCustomerLogIn(); + return $this->isAllow() && $this->getCustomer(); } /** * Retrieve customer name * - * @return string + * @return string|null */ public function getCustomerName() { - return $this->_getCurrentCustomer()->getName(); + $customer = $this->_getCurrentCustomer(); + if ($customer) { + return $customer->getName(); + } } /** * Retrieve RSS URL * + * @param $wishlistId * @return string */ - public function getRssUrl() + public function getRssUrl($wishlistId = null) { $customer = $this->_getCurrentCustomer(); - $key = $customer->getId().','.$customer->getEmail(); + if ($customer) { + $key = $customer->getId() . ',' . $customer->getEmail(); + $params = array( + 'data' => Mage::helper('core')->urlEncode($key), + '_secure' => false, + ); + } + if ($wishlistId) { + $params['wishlist_id'] = $wishlistId; + } return $this->_getUrl( 'rss/index/wishlist', - array( - 'data' => Mage::helper('core')->urlEncode($key), - '_secure' => false - ) + $params ); } @@ -460,6 +523,16 @@ public function defaultCommentString() return $this->__('Please, enter your comments...'); } + /** + * Retrieve default empty comment message + * + * @return string + */ + public function getDefaultWishlistName() + { + return $this->__('Wishlist'); + } + /** * Calculate count of wishlist items and put value to customer session. * Method called after wishlist modifications and trigger 'wishlist_items_renewed' event. @@ -471,7 +544,7 @@ public function calculate() { $session = $this->_getCustomerSession(); $count = 0; - if ($this->_isCustomerLogIn()) { + if ($this->getCustomer()) { $collection = $this->getWishlistItemCollection()->setInStockFilter(true); if (Mage::getStoreConfig(self::XML_PATH_WISHLIST_LINK_USE_QTY)) { $count = $collection->getItemsQty(); @@ -487,4 +560,14 @@ public function calculate() Mage::dispatchEvent('wishlist_items_renewed'); return $this; } + + /** + * Should display item quantities in my wishlist link + * + * @return bool + */ + public function isDisplayQty() + { + return Mage::getStoreConfig(self::XML_PATH_WISHLIST_LINK_USE_QTY); + } } diff --git a/app/code/core/Mage/Wishlist/Model/Config.php b/app/code/core/Mage/Wishlist/Model/Config.php index 9c8c7d30c6..dd1c5510e5 100644 --- a/app/code/core/Mage/Wishlist/Model/Config.php +++ b/app/code/core/Mage/Wishlist/Model/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/Model/Config/Source/Summary.php b/app/code/core/Mage/Wishlist/Model/Config/Source/Summary.php index 7765170c63..78f24857fd 100644 --- a/app/code/core/Mage/Wishlist/Model/Config/Source/Summary.php +++ b/app/code/core/Mage/Wishlist/Model/Config/Source/Summary.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Wishlist_Model_Config_Source_Summary diff --git a/app/code/core/Mage/Wishlist/Model/Item.php b/app/code/core/Mage/Wishlist/Model/Item.php index 9f21df760c..a4b1458467 100644 --- a/app/code/core/Mage/Wishlist/Model/Item.php +++ b/app/code/core/Mage/Wishlist/Model/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -50,7 +50,13 @@ class Mage_Wishlist_Model_Item extends Mage_Core_Model_Abstract { const EXCEPTION_CODE_NOT_SALABLE = 901; const EXCEPTION_CODE_HAS_REQUIRED_OPTIONS = 902; - const EXCEPTION_CODE_IS_GROUPED_PRODUCT = 903; // deprecated after 1.4.2.0, because we can store product configuration and add grouped products + /** + * We can store product store product configuration + * and add grouped attributes after 1.4.2.0 + * + * @deprecated after 1.4.2.0 + */ + const EXCEPTION_CODE_IS_GROUPED_PRODUCT = 903; /** * Custom path to download attached file @@ -110,6 +116,18 @@ protected function _construct() $this->_init('wishlist/item'); } + /** + * Set quantity. If quantity is less than 0 - set it to 1 + * + * @param int $qty + * @return Mage_Wishlist_Model_Item + */ + public function setQty($qty) + { + $this->setData('qty', ($qty >= 0) ? $qty : 1 ); + return $this; + } + /** * Retrieve resource instance wrapper * diff --git a/app/code/core/Mage/Wishlist/Model/Item/Option.php b/app/code/core/Mage/Wishlist/Model/Item/Option.php index 209f8a1a27..9b35dbf3de 100644 --- a/app/code/core/Mage/Wishlist/Model/Item/Option.php +++ b/app/code/core/Mage/Wishlist/Model/Item/Option.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/Model/Mysql4/Item.php b/app/code/core/Mage/Wishlist/Model/Mysql4/Item.php index 3b3cb93f7d..4730e66a70 100644 --- a/app/code/core/Mage/Wishlist/Model/Mysql4/Item.php +++ b/app/code/core/Mage/Wishlist/Model/Mysql4/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/Model/Mysql4/Item/Collection.php b/app/code/core/Mage/Wishlist/Model/Mysql4/Item/Collection.php index 5e17ef1b33..ea9242c84f 100644 --- a/app/code/core/Mage/Wishlist/Model/Mysql4/Item/Collection.php +++ b/app/code/core/Mage/Wishlist/Model/Mysql4/Item/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/Model/Mysql4/Item/Option.php b/app/code/core/Mage/Wishlist/Model/Mysql4/Item/Option.php index 0857fd2580..63e41f9827 100644 --- a/app/code/core/Mage/Wishlist/Model/Mysql4/Item/Option.php +++ b/app/code/core/Mage/Wishlist/Model/Mysql4/Item/Option.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/Model/Mysql4/Item/Option/Collection.php b/app/code/core/Mage/Wishlist/Model/Mysql4/Item/Option/Collection.php index 849b93318c..a2eb00b61d 100644 --- a/app/code/core/Mage/Wishlist/Model/Mysql4/Item/Option/Collection.php +++ b/app/code/core/Mage/Wishlist/Model/Mysql4/Item/Option/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/Model/Mysql4/Product/Collection.php b/app/code/core/Mage/Wishlist/Model/Mysql4/Product/Collection.php index cd3abea11f..6765fd29b4 100644 --- a/app/code/core/Mage/Wishlist/Model/Mysql4/Product/Collection.php +++ b/app/code/core/Mage/Wishlist/Model/Mysql4/Product/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/Model/Mysql4/Wishlist.php b/app/code/core/Mage/Wishlist/Model/Mysql4/Wishlist.php index 1757a613eb..32dd6ae7d7 100644 --- a/app/code/core/Mage/Wishlist/Model/Mysql4/Wishlist.php +++ b/app/code/core/Mage/Wishlist/Model/Mysql4/Wishlist.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/Model/Mysql4/Wishlist/Collection.php b/app/code/core/Mage/Wishlist/Model/Mysql4/Wishlist/Collection.php index 3d557c78ad..5fed31be3d 100644 --- a/app/code/core/Mage/Wishlist/Model/Mysql4/Wishlist/Collection.php +++ b/app/code/core/Mage/Wishlist/Model/Mysql4/Wishlist/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/Model/Observer.php b/app/code/core/Mage/Wishlist/Model/Observer.php index 71fea8aea4..c5f4d5766d 100644 --- a/app/code/core/Mage/Wishlist/Model/Observer.php +++ b/app/code/core/Mage/Wishlist/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/Model/Resource/Item.php b/app/code/core/Mage/Wishlist/Model/Resource/Item.php index 3974c327b8..414018d826 100755 --- a/app/code/core/Mage/Wishlist/Model/Resource/Item.php +++ b/app/code/core/Mage/Wishlist/Model/Resource/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/Model/Resource/Item/Collection.php b/app/code/core/Mage/Wishlist/Model/Resource/Item/Collection.php index 30954dabaf..e449325204 100755 --- a/app/code/core/Mage/Wishlist/Model/Resource/Item/Collection.php +++ b/app/code/core/Mage/Wishlist/Model/Resource/Item/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -52,7 +52,7 @@ class Mage_Wishlist_Model_Resource_Item_Collection extends Mage_Core_Model_Resou * If product out of stock, its item will be removed after load * * @var bool - */ + */ protected $_productInStock = false; /** @@ -173,6 +173,11 @@ protected function _assignProducts() foreach ($storeIds as $id) { $productCollection->addStoreFilter($id); } + + if ($this->_productVisible) { + Mage::getSingleton('catalog/product_visibility')->addVisibleInSiteFilterToCollection($productCollection); + } + $productCollection->addPriceData() ->addTaxPercents() ->addIdFilter($this->_productIds) @@ -180,9 +185,6 @@ protected function _assignProducts() ->addOptionsToResult() ->addUrlRewrite(); - if ($this->_productVisible) { - Mage::getSingleton('catalog/product_visibility')->addVisibleInSiteFilterToCollection($productCollection); - } if ($this->_productSalable) { $productCollection = Mage::helper('adminhtml/sales')->applySalableProductTypesFilter($productCollection); } @@ -196,7 +198,7 @@ protected function _assignProducts() foreach ($this as $item) { $product = $productCollection->getItemById($item->getProductId()); if ($product) { - if ($checkInStock && !$product->isSalable()) { + if ($checkInStock && !$product->isInStock()) { $this->removeItemByKey($item->getId()); } else { $product->setCustomOptions(array()); @@ -227,6 +229,24 @@ public function addWishlistFilter(Mage_Wishlist_Model_Wishlist $wishlist) return $this; } + /** + * Add filtration by customer id + * + * @param int $customerId + * @return Mage_Wishlist_Model_Resource_Item_Collection + */ + public function addCustomerIdFilter($customerId) + { + $this->getSelect() + ->join( + array('wishlist' => $this->getTable('wishlist/wishlist')), + 'main_table.wishlist_id = wishlist.wishlist_id', + array() + ) + ->where('wishlist.customer_id = ?', $customerId); + return $this; + } + /** * Add filter by shared stores * diff --git a/app/code/core/Mage/Wishlist/Model/Resource/Item/Option.php b/app/code/core/Mage/Wishlist/Model/Resource/Item/Option.php index a47a869966..8751dfcc05 100644 --- a/app/code/core/Mage/Wishlist/Model/Resource/Item/Option.php +++ b/app/code/core/Mage/Wishlist/Model/Resource/Item/Option.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/Model/Resource/Item/Option/Collection.php b/app/code/core/Mage/Wishlist/Model/Resource/Item/Option/Collection.php index c9336178c4..4798fca31b 100644 --- a/app/code/core/Mage/Wishlist/Model/Resource/Item/Option/Collection.php +++ b/app/code/core/Mage/Wishlist/Model/Resource/Item/Option/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/Model/Resource/Product/Collection.php b/app/code/core/Mage/Wishlist/Model/Resource/Product/Collection.php index 466e09e2b3..d84e84a916 100755 --- a/app/code/core/Mage/Wishlist/Model/Resource/Product/Collection.php +++ b/app/code/core/Mage/Wishlist/Model/Resource/Product/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/Model/Resource/Wishlist.php b/app/code/core/Mage/Wishlist/Model/Resource/Wishlist.php index b4e42feb86..9976606f6a 100755 --- a/app/code/core/Mage/Wishlist/Model/Resource/Wishlist.php +++ b/app/code/core/Mage/Wishlist/Model/Resource/Wishlist.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -56,6 +56,24 @@ protected function _construct() $this->_init('wishlist/wishlist', 'wishlist_id'); } + /** + * Prepare wishlist load select query + * + * @param string $field + * @param mixed $value + * @param mixed $object + * @return Zend_Db_Select + */ + protected function _getLoadSelect($field, $value, $object) + { + $select = parent::_getLoadSelect($field, $value, $object); + if ($field == $this->_customerIdFieldName) { + $select->order('wishlist_id ' . Zend_Db_Select::SQL_ASC) + ->limit(1); + } + return $select; + } + /** * Getter for customer ID field name * diff --git a/app/code/core/Mage/Wishlist/Model/Resource/Wishlist/Collection.php b/app/code/core/Mage/Wishlist/Model/Resource/Wishlist/Collection.php index 26142332fd..9499501bbc 100755 --- a/app/code/core/Mage/Wishlist/Model/Resource/Wishlist/Collection.php +++ b/app/code/core/Mage/Wishlist/Model/Resource/Wishlist/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -42,4 +42,39 @@ protected function _construct() { $this->_init('wishlist/wishlist'); } + + /** + * Filter collection by customer + * + * @param Mage_Customer_Model_Customer $customer + * @return Mage_Wishlist_Model_Resource_Wishlist_Collection + */ + public function filterByCustomer(Mage_Customer_Model_Customer $customer) + { + return $this->filterByCustomerId($customer->getId()); + } + + /** + * Filter collection by customer id + * + * @param int $customerId + * @return Mage_Wishlist_Model_Resource_Wishlist_Collection + */ + public function filterByCustomerId($customerId) + { + $this->addFieldToFilter('customer_id', $customerId); + return $this; + } + + /** + * Filter collection by customer ids + * + * @param array $customerIds + * @return Mage_Wishlist_Model_Resource_Wishlist_Collection + */ + public function filterByCustomerIds(array $customerIds) + { + $this->addFieldToFilter('customer_id', array('in' => $customerIds)); + return $this; + } } diff --git a/app/code/core/Mage/Wishlist/Model/Session.php b/app/code/core/Mage/Wishlist/Model/Session.php index 0e8f11bef7..1087e78aa0 100644 --- a/app/code/core/Mage/Wishlist/Model/Session.php +++ b/app/code/core/Mage/Wishlist/Model/Session.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/Model/Wishlist.php b/app/code/core/Mage/Wishlist/Model/Wishlist.php index df9965b8ed..c28ebf22b3 100644 --- a/app/code/core/Mage/Wishlist/Model/Wishlist.php +++ b/app/code/core/Mage/Wishlist/Model/Wishlist.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -43,6 +43,12 @@ */ class Mage_Wishlist_Model_Wishlist extends Mage_Core_Model_Abstract { + /** + * Prefix of model events names + * + * @var string + */ + protected $_eventPrefix = 'wishlist'; /** * Wishlist item collection * @@ -97,6 +103,31 @@ public function loadByCustomer($customer, $create = false) return $this; } + /** + * Retrieve wishlist name + * + * @return string + */ + public function getName() + { + $name = $this->_getData('name'); + if (!strlen($name)) { + return Mage::helper('wishlist')->getDefaultWishlistName(); + } + return $name; + } + + /** + * Set random sharing code + * + * @return Mage_Wishlist_Model_Wishlist + */ + public function generateSharingCode() + { + $this->setSharingCode($this->_getSharingRandomCode()); + return $this; + } + /** * Load by sharing code * @@ -180,6 +211,9 @@ protected function _addCatalogProduct(Mage_Catalog_Model_Product $product, $qty ->setProduct($product) ->setQty($qty) ->save(); + if ($item->getId()) { + $this->getItemCollection()->addItem($item); + } } else { $qty = $forciblySetQty ? $qty : $item->getQty() + $qty; $item->setQty($qty) @@ -357,7 +391,7 @@ public function setCustomerId($customerId) /** * Retrieve customer id * - * @return Mage_Wishlist_Model_Wishlist + * @return int */ public function getCustomerId() { @@ -489,7 +523,7 @@ public function isOwner($customerId) * * For more options see Mage_Catalog_Helper_Product->addParamsToBuyRequest() * - * @param int $itemId + * @param int|Mage_Wishlist_Model_Item $itemId * @param Varien_Object $buyRequest * @param null|array|Varien_Object $params * @return Mage_Wishlist_Model_Wishlist @@ -498,7 +532,12 @@ public function isOwner($customerId) */ public function updateItem($itemId, $buyRequest, $params = null) { - $item = $this->getItem((int)$itemId); + $item = null; + if ($itemId instanceof Mage_Wishlist_Model_Item) { + $item = $itemId; + } else { + $item = $this->getItem((int)$itemId); + } if (!$item) { Mage::throwException(Mage::helper('wishlist')->__('Cannot specify wishlist item.')); } @@ -549,4 +588,15 @@ public function updateItem($itemId, $buyRequest, $params = null) } return $this; } + + /** + * Save wishlist. + * + * @return Mage_Wishlist_Model_Wishlist + */ + public function save() + { + $this->_hasDataChanges = true; + return parent::save(); + } } diff --git a/app/code/core/Mage/Wishlist/controllers/IndexController.php b/app/code/core/Mage/Wishlist/controllers/IndexController.php index 37c97c554e..ca92d79e83 100644 --- a/app/code/core/Mage/Wishlist/controllers/IndexController.php +++ b/app/code/core/Mage/Wishlist/controllers/IndexController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -54,7 +54,7 @@ public function preDispatch() if (!$this->_skipAuthentication && !Mage::getSingleton('customer/session')->authenticate($this)) { $this->setFlag('', 'no-dispatch', true); - if(!Mage::getSingleton('customer/session')->getBeforeWishlistUrl()) { + if (!Mage::getSingleton('customer/session')->getBeforeWishlistUrl()) { Mage::getSingleton('customer/session')->setBeforeWishlistUrl($this->_getRefererUrl()); } Mage::getSingleton('customer/session')->setBeforeWishlistRequest($this->getRequest()->getParams()); @@ -78,10 +78,10 @@ public function skipAuthentication() /** * Retrieve wishlist object - * + * @param int $wishlistId * @return Mage_Wishlist_Model_Wishlist|bool */ - protected function _getWishlist() + protected function _getWishlist($wishlistId = null) { $wishlist = Mage::registry('wishlist'); if ($wishlist) { @@ -89,14 +89,32 @@ protected function _getWishlist() } try { - $wishlist = Mage::getModel('wishlist/wishlist') - ->loadByCustomer(Mage::getSingleton('customer/session')->getCustomer(), true); + if (!$wishlistId) { + $wishlistId = $this->getRequest()->getParam('wishlist_id'); + } + $customerId = Mage::getSingleton('customer/session')->getCustomerId(); + /* @var Mage_Wishlist_Model_Wishlist $wishlist */ + $wishlist = Mage::getModel('wishlist/wishlist'); + if ($wishlistId) { + $wishlist->load($wishlistId); + } else { + $wishlist->loadByCustomer($customerId, true); + } + + if (!$wishlist->getId() || $wishlist->getCustomerId() != $customerId) { + $wishlist = null; + Mage::throwException( + Mage::helper('wishlist')->__("Requested wishlist doesn't exist") + ); + } + Mage::register('wishlist', $wishlist); } catch (Mage_Core_Exception $e) { Mage::getSingleton('wishlist/session')->addError($e->getMessage()); + return false; } catch (Exception $e) { Mage::getSingleton('wishlist/session')->addException($e, - Mage::helper('wishlist')->__('Cannot create wishlist.') + Mage::helper('wishlist')->__('Wishlist could not be created.') ); return false; } @@ -109,10 +127,11 @@ protected function _getWishlist() */ public function indexAction() { - $this->_getWishlist(); + if (!$this->_getWishlist()) { + return $this->norouteAction(); + } $this->loadLayout(); - $session = Mage::getSingleton('customer/session'); $block = $this->getLayout()->getBlock('customer.wishlist'); $referer = $session->getAddActionReferer(true); @@ -136,13 +155,13 @@ public function indexAction() */ public function addAction() { - $session = Mage::getSingleton('customer/session'); $wishlist = $this->_getWishlist(); if (!$wishlist) { - $this->_redirect('*/'); - return; + return $this->norouteAction(); } + $session = Mage::getSingleton('customer/session'); + $productId = (int) $this->getRequest()->getParam('product'); if (!$productId) { $this->_redirect('*/'); @@ -203,7 +222,7 @@ public function addAction() $session->addError($this->__('An error occurred while adding item to wishlist.')); } - $this->_redirect('*'); + $this->_redirect('*', array('wishlist_id' => $wishlist->getId())); } /** @@ -212,13 +231,16 @@ public function addAction() public function configureAction() { $id = (int) $this->getRequest()->getParam('id'); - $wishlist = $this->_getWishlist(); - /* @var $item Mage_Wishlist_Model_Item */ - $item = $wishlist->getItem($id); - try { - if (!$item) { - throw new Exception($this->__('Cannot load wishlist item')); + /* @var $item Mage_Wishlist_Model_Item */ + $item = Mage::getModel('wishlist/item'); + $item->loadWithOptions($id); + if (!$item->getId()) { + Mage::throwException($this->__('Cannot load wishlist item')); + } + $wishlist = $this->_getWishlist($item->getWishlistId()); + if (!$wishlist) { + return $this->norouteAction(); } Mage::register('wishlist_item', $item); @@ -226,7 +248,6 @@ public function configureAction() $params = new Varien_Object(); $params->setCategoryId(false); $params->setConfigureMode(true); - $buyRequest = $item->getBuyRequest(); if (!$buyRequest->getQty() && $item->getQty()) { $buyRequest->setQty($item->getQty()); @@ -236,7 +257,6 @@ public function configureAction() Mage::helper('wishlist')->calculate(); } $params->setBuyRequest($buyRequest); - Mage::helper('catalog/product_view')->prepareAndRender($item->getProductId(), $this, $params); } catch (Mage_Core_Exception $e) { Mage::getSingleton('customer/session')->addError($e->getMessage()); @@ -256,12 +276,6 @@ public function configureAction() public function updateItemOptionsAction() { $session = Mage::getSingleton('customer/session'); - $wishlist = $this->_getWishlist(); - if (!$wishlist) { - $this->_redirect('*/'); - return; - } - $productId = (int) $this->getRequest()->getParam('product'); if (!$productId) { $this->_redirect('*/'); @@ -277,6 +291,15 @@ public function updateItemOptionsAction() try { $id = (int) $this->getRequest()->getParam('id'); + /* @var Mage_Wishlist_Model_Item */ + $item = Mage::getModel('wishlist/item'); + $item->load($id); + $wishlist = $this->_getWishlist($item->getWishlistId()); + if (!$wishlist) { + $this->_redirect('*/'); + return; + } + $buyRequest = new Varien_Object($this->getRequest()->getParams()); $wishlist->updateItem($id, $buyRequest) @@ -297,7 +320,7 @@ public function updateItemOptionsAction() $session->addError($this->__('An error occurred while updating wishlist.')); Mage::logException($e); } - $this->_redirect('*/*'); + $this->_redirect('*/*', array('wishlist_id' => $wishlist->getId())); } /** @@ -308,9 +331,13 @@ public function updateAction() if (!$this->_validateFormKey()) { return $this->_redirect('*/*/'); } + $wishlist = $this->_getWishlist(); + if (!$wishlist) { + return $this->norouteAction(); + } + $post = $this->getRequest()->getPost(); if($post && isset($post['description']) && is_array($post['description'])) { - $wishlist = $this->_getWishlist(); $updatedItems = 0; foreach ($post['description'] as $itemId => $description) { @@ -373,11 +400,11 @@ public function updateAction() } if (isset($post['save_and_share'])) { - $this->_redirect('*/*/share'); + $this->_redirect('*/*/share', array('wishlist_id' => $wishlist->getId())); return; } } - $this->_redirect('*'); + $this->_redirect('*', array('wishlist_id' => $wishlist->getId())); } /** @@ -385,25 +412,26 @@ public function updateAction() */ public function removeAction() { - $wishlist = $this->_getWishlist(); $id = (int) $this->getRequest()->getParam('item'); $item = Mage::getModel('wishlist/item')->load($id); - - if($item->getWishlistId() == $wishlist->getId()) { - try { - $item->delete(); - $wishlist->save(); - } - catch (Mage_Core_Exception $e) { - Mage::getSingleton('customer/session')->addError( - $this->__('An error occurred while deleting the item from wishlist: %s', $e->getMessage()) - ); - } - catch(Exception $e) { - Mage::getSingleton('customer/session')->addError( - $this->__('An error occurred while deleting the item from wishlist.') - ); - } + if (!$item->getId()) { + return $this->norouteAction(); + } + $wishlist = $this->_getWishlist($item->getWishlistId()); + if (!$wishlist) { + return $this->norouteAction(); + } + try { + $item->delete(); + $wishlist->save(); + } catch (Mage_Core_Exception $e) { + Mage::getSingleton('customer/session')->addError( + $this->__('An error occurred while deleting the item from wishlist: %s', $e->getMessage()) + ); + } catch(Exception $e) { + Mage::getSingleton('customer/session')->addError( + $this->__('An error occurred while deleting the item from wishlist.') + ); } Mage::helper('wishlist')->calculate(); @@ -416,21 +444,18 @@ public function removeAction() * * If Product has required options - item removed from wishlist and redirect * to product view page with message about needed defined required options - * */ public function cartAction() { - $wishlist = $this->_getWishlist(); - if (!$wishlist) { - return $this->_redirect('*/*'); - } - $itemId = (int) $this->getRequest()->getParam('item'); /* @var $item Mage_Wishlist_Model_Item */ $item = Mage::getModel('wishlist/item')->load($itemId); - - if (!$item->getId() || $item->getWishlistId() != $wishlist->getId()) { + if (!$item->getId()) { + return $this->_redirect('*/*'); + } + $wishlist = $this->_getWishlist($item->getWishlistId()); + if (!$wishlist) { return $this->_redirect('*/*'); } @@ -496,20 +521,81 @@ public function cartAction() return $this->_redirectUrl($redirectUrl); } + /** + * Add cart item to wishlist and remove from cart + */ + public function fromcartAction() + { + $wishlist = $this->_getWishlist(); + if (!$wishlist) { + return $this->norouteAction(); + } + $itemId = (int) $this->getRequest()->getParam('item'); + + /* @var Mage_Checkout_Model_Cart $cart */ + $cart = Mage::getSingleton('checkout/cart'); + $session = Mage::getSingleton('checkout/session'); + + try{ + $item = $cart->getQuote()->getItemById($itemId); + if (!$item) { + Mage::throwException( + Mage::helper('wishlist')->__("Requested cart item doesn't exist") + ); + } + + $productId = $item->getProductId(); + $buyRequest = $item->getBuyRequest(); + + $wishlist->addNewItem($productId, $buyRequest); + + $productIds[] = $productId; + $cart->getQuote()->removeItem($itemId); + $cart->save(); + Mage::helper('wishlist')->calculate(); + $productName = Mage::helper('core')->escapeHtml($item->getProduct()->getName()); + $wishlistName = Mage::helper('core')->escapeHtml($wishlist->getName()); + $session->addSuccess( + Mage::helper('wishlist')->__("%s has been moved to wishlist %s", $productName, $wishlistName) + ); + $wishlist->save(); + } catch (Mage_Core_Exception $e) { + $session->addError($e->getMessage()); + } catch (Exception $e) { + $session->addException($e, Mage::helper('wishlist')->__('Cannot move item to wishlist')); + } + + return $this->_redirectUrl(Mage::helper('checkout/cart')->getCartUrl()); + } + + /** + * Prepare wishlist for share + */ public function shareAction() { + $this->_getWishlist(); $this->loadLayout(); $this->_initLayoutMessages('customer/session'); $this->_initLayoutMessages('wishlist/session'); $this->renderLayout(); } + /** + * Share wishlist + * + * @return Mage_Core_Controller_Varien_Action|void + */ public function sendAction() { if (!$this->_validateFormKey()) { return $this->_redirect('*/*/'); } + $wishlist = $this->_getWishlist(); + if (!$wishlist) { + return $this->norouteAction(); + } + $emails = explode(',', $this->getRequest()->getPost('emails')); $message = nl2br(htmlspecialchars((string) $this->getRequest()->getPost('message'))); $error = false; @@ -539,11 +625,13 @@ public function sendAction() try { $customer = Mage::getSingleton('customer/session')->getCustomer(); - $wishlist = $this->_getWishlist(); /*if share rss added rss feed to email template*/ if ($this->getRequest()->getParam('rss_url')) { - $rss_url = $this->getLayout()->createBlock('wishlist/share_email_rss')->toHtml(); + $rss_url = $this->getLayout() + ->createBlock('wishlist/share_email_rss') + ->setWishlistId($wishlist->getId()) + ->toHtml(); $message .=$rss_url; } $wishlistBlock = $this->getLayout()->createBlock('wishlist/share_email_items')->toHtml(); @@ -579,7 +667,7 @@ public function sendAction() Mage::getSingleton('customer/session')->addSuccess( $this->__('Your Wishlist has been shared.') ); - $this->_redirect('*/*'); + $this->_redirect('*/*', array('wishlist_id' => $wishlist->getId())); } catch (Exception $e) { $translate->setTranslateInline(true); @@ -592,28 +680,45 @@ public function sendAction() /** * Custom options download action - * * @return void */ public function downloadCustomOptionAction() { + $option = Mage::getModel('wishlist/item_option')->load($this->getRequest()->getParam('id')); + + if (!$option->getId()) { + return $this->_forward('noRoute'); + } + + $optionId = null; + if (strpos($option->getCode(), Mage_Catalog_Model_Product_Type_Abstract::OPTION_PREFIX) === 0) { + $optionId = str_replace(Mage_Catalog_Model_Product_Type_Abstract::OPTION_PREFIX, '', $option->getCode()); + if ((int)$optionId != $optionId) { + return $this->_forward('noRoute'); + } + } + $productOption = Mage::getModel('catalog/product_option')->load($optionId); + + if (!$productOption + || !$productOption->getId() + || $productOption->getProductId() != $option->getProductId() + || $productOption->getType() != 'file' + ) { + return $this->_forward('noRoute'); + } + try { - $optionId = $this->getRequest()->getParam('id'); - $option = Mage::getModel('wishlist/item_option')->load($optionId); - $hasError = false; - - if ($option->getId() && $option->getCode() !== 'info_buyRequest') { - $info = unserialize($option->getValue()); - $filePath = Mage::getBaseDir() . $info['quote_path']; - $secretKey = $this->getRequest()->getParam('key'); - - if ($secretKey == $info['secret_key']) { - $this->_prepareDownloadResponse($info['title'], array( - 'value' => $filePath, - 'type' => 'filename' - )); - } + $info = unserialize($option->getValue()); + $filePath = Mage::getBaseDir() . $info['quote_path']; + $secretKey = $this->getRequest()->getParam('key'); + + if ($secretKey == $info['secret_key']) { + $this->_prepareDownloadResponse($info['title'], array( + 'value' => $filePath, + 'type' => 'filename' + )); } + } catch(Exception $e) { $this->_forward('noRoute'); } diff --git a/app/code/core/Mage/Wishlist/controllers/SharedController.php b/app/code/core/Mage/Wishlist/controllers/SharedController.php index 947718b619..cfbfa19781 100644 --- a/app/code/core/Mage/Wishlist/controllers/SharedController.php +++ b/app/code/core/Mage/Wishlist/controllers/SharedController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -66,7 +66,7 @@ public function indexAction() $customerId = Mage::getSingleton('customer/session')->getCustomerId(); if ($wishlist && $wishlist->getCustomerId() && $wishlist->getCustomerId() == $customerId) { - $this->_redirectUrl(Mage::helper('wishlist')->getListUrl()); + $this->_redirectUrl(Mage::helper('wishlist')->getListUrl($wishlist->getId())); return; } diff --git a/app/code/core/Mage/Wishlist/etc/adminhtml.xml b/app/code/core/Mage/Wishlist/etc/adminhtml.xml index 207896588b..5fbdd6cfcd 100644 --- a/app/code/core/Mage/Wishlist/etc/adminhtml.xml +++ b/app/code/core/Mage/Wishlist/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Wishlist/etc/config.xml b/app/code/core/Mage/Wishlist/etc/config.xml index 511cfbadbc..ff10c2d6b2 100644 --- a/app/code/core/Mage/Wishlist/etc/config.xml +++ b/app/code/core/Mage/Wishlist/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Wishlist/etc/system.xml b/app/code/core/Mage/Wishlist/etc/system.xml index 67d8670481..d54af4ad52 100644 --- a/app/code/core/Mage/Wishlist/etc/system.xml +++ b/app/code/core/Mage/Wishlist/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Wishlist/sql/wishlist_setup/install-1.6.0.0.php b/app/code/core/Mage/Wishlist/sql/wishlist_setup/install-1.6.0.0.php index 6037dd7376..a79af091af 100644 --- a/app/code/core/Mage/Wishlist/sql/wishlist_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Wishlist/sql/wishlist_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-install-0.7.0.php index 6ce20da535..14de2d562e 100644 --- a/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-install-0.7.0.php +++ b/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-install-0.7.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.0-0.7.1.php b/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.0-0.7.1.php index 99959a99db..e7279966af 100644 --- a/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.0-0.7.1.php +++ b/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.0-0.7.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.1-0.7.2.php b/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.1-0.7.2.php index a4a6a7818e..a7a29c25cd 100644 --- a/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.1-0.7.2.php +++ b/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.1-0.7.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.2-0.7.4.php b/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.2-0.7.4.php index a675cd4f33..5d9873a941 100644 --- a/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.2-0.7.4.php +++ b/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.2-0.7.4.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.4-0.7.5.php b/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.4-0.7.5.php index a3983c5c1b..08b0a9e1cf 100644 --- a/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.4-0.7.5.php +++ b/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.4-0.7.5.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.5-0.7.6.php b/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.5-0.7.6.php index 5983890e2b..5e855d74c3 100644 --- a/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.5-0.7.6.php +++ b/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.5-0.7.6.php @@ -20,6 +20,6 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.6-0.7.7.php b/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.6-0.7.7.php index 0e985ece64..eb9f3a2352 100644 --- a/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.6-0.7.7.php +++ b/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.6-0.7.7.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.7-0.7.8.php b/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.7-0.7.8.php index 7d3bfc6a9f..8e6594296e 100644 --- a/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.7-0.7.8.php +++ b/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.7-0.7.8.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.8-0.7.9.php b/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.8-0.7.9.php index 44d5b5f63f..962ac036ca 100644 --- a/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.8-0.7.9.php +++ b/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.8-0.7.9.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php index 2b673b396c..a1157432dd 100644 --- a/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ b/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/History.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/History.php index eb4169af97..7c360ebdd5 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/History.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/History.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/History/Grid.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/History/Grid.php index 79fb163932..85dce07e86 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/History/Grid.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/History/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile.php index 310acf8d36..81359d4a45 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit.php index 2144e9bab0..0062010544 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Form.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Form.php index 0117686836..7a0dbc7963 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Form.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Submission.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Submission.php index 6c1af9ac6e..2318d01c85 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Submission.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Submission.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Cache.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Cache.php index fd5ed70bce..4f10bc15b3 100755 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Cache.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Cache.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Content.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Content.php index 57e97bb4e6..94a972135a 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Content.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Content.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design.php index 5ef12f4e69..b6a249a667 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Accordion.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Accordion.php index 5045b69c57..ff110010fc 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Accordion.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Accordion.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Accordion/Images.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Accordion/Images.php index 38f366cc6e..a6200ce42c 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Accordion/Images.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Accordion/Images.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Accordion/Tabs.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Accordion/Tabs.php index d62626d6fb..f2e6def2ca 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Accordion/Tabs.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Accordion/Tabs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Accordion/Themes.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Accordion/Themes.php index 85c10048ce..fe6ba24350 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Accordion/Themes.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Accordion/Themes.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Preview.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Preview.php index 527edf358a..1a22792209 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Preview.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Preview.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Themes.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Themes.php index 4307b30df1..aebee48234 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Themes.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Themes.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Flurryanalytics.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Flurryanalytics.php index 2a4124638e..ca2381bbc8 100755 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Flurryanalytics.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Flurryanalytics.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/General.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/General.php index 0b325ccf95..01cb42cc77 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/General.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/General.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Notification.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Notification.php index e339b4065b..df98f93347 100755 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Notification.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Notification.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Payment.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Payment.php index 742d212785..536cab6e6d 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Payment.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Payment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Settings.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Settings.php index faac69b2e4..567aa0c5f2 100755 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Settings.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Settings.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Social.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Social.php index a1c6807a3a..284a542aeb 100755 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Social.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Social.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Submission/History.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Submission/History.php index c73fc34e76..16e1aedee2 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Submission/History.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Submission/History.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tabs.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tabs.php index 7cfc88b7ba..439cb31473 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tabs.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tabs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Addrow.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Addrow.php index 67cabb2c70..5b7f08f57c 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Addrow.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Addrow.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -48,9 +48,9 @@ public function getElementHtml() . '" value="'.$this->getEscapedValue() . '" ' . $this->serialize($this->getHtmlAttributes()) - . ' >' + . ' >' . $this->getEscapedValue() - . '' + . '' . $this->getAfterElementHtml(); return $html; } diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Color.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Color.php index b4e7472c54..1bedd5149d 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Color.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Color.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Country.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Country.php index 75143b51d8..432cdc0104 100755 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Country.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Country.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Datetime.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Datetime.php index cf421029ed..0e4e4e15b7 100755 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Datetime.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Datetime.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Font.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Font.php index ab86d400b1..148f26ae4b 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Font.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Font.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Image.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Image.php index b355132b42..eb3eb99298 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Image.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Image.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Page.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Page.php index cca94ca4f5..9a0af5a78b 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Page.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Page.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -100,8 +100,8 @@ public function getElementHtml() list($label, $element) = $this->getElements(); return $element->toHtml() . '
    ' - . ''; + . ''; } } diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Tabs.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Tabs.php index e9b55f0087..3a587bd61c 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Tabs.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Tabs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Theme.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Theme.php index 387a0594c4..fbb6eba69c 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Theme.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Theme.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Grid.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Grid.php index f8104e89b3..3535a635a4 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Grid.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Grid/Renderer/Bool.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Grid/Renderer/Bool.php index b7ad0302cf..669565e8e3 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Grid/Renderer/Bool.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Grid/Renderer/Bool.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Grid/Renderer/Type.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Grid/Renderer/Type.php index 1e4ef26887..ee1aea56c3 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Grid/Renderer/Type.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Grid/Renderer/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Preview/Content.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Preview/Content.php index b404f60ce4..e186e706de 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Preview/Content.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Preview/Content.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Preview/Tabitems.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Preview/Tabitems.php index 686d041f95..0479082e56 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Preview/Tabitems.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Preview/Tabitems.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission.php index 4a40c9f1da..408c52b022 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Form.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Form.php index c68925f62d..324b717b76 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Form.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Renderer/Country/Androidmarket.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Renderer/Country/Androidmarket.php index 88727eb231..c1208ef9f1 100755 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Renderer/Country/Androidmarket.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Renderer/Country/Androidmarket.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Renderer/Country/Istore.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Renderer/Country/Istore.php index 36aec5fa42..c3b5818b50 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Renderer/Country/Istore.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Renderer/Country/Istore.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Tab/Container.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Tab/Container.php index 0ef2f1e2c3..714421eff0 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Tab/Container.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Tab/Container.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Tab/Container/Submission.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Tab/Container/Submission.php index 179bd6b834..88e1fa6772 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Tab/Container/Submission.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Tab/Container/Submission.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Tabs.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Tabs.php index 864ede2790..22e87602d1 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Tabs.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Tabs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Widget/Form.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Widget/Form.php index 79b93c2167..02cbc90487 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Widget/Form.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Widget/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue.php index 7c6dcc0b11..a7f1f9936b 100755 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Edit.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Edit.php index ef150e638a..c0ff18aa2d 100755 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Edit.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Edit/Form.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Edit/Form.php index 875d4831b8..42543a31b6 100755 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Edit/Form.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid.php index aa690dd73b..f20f38f663 100755 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Action.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Action.php index 4c550dc62c..d7e64838d1 100755 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Action.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Action.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Application.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Application.php index b094db007e..622ba3b850 100755 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Application.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Application.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Id.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Id.php index d0e8ca4396..5f38dbda85 100755 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Id.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Id.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Msgtitle.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Msgtitle.php index 29639ebcad..d327133c99 100755 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Msgtitle.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Msgtitle.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Pushtitle.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Pushtitle.php index 7e28ee3e6a..b646151319 100755 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Pushtitle.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Pushtitle.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Status.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Status.php index c097e2881c..726ce287d3 100755 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Status.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Status.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Template.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Template.php index 622603e809..4e0974a241 100755 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Template.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Template.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template.php index 7244adfd0f..81e41bacde 100755 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Edit.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Edit.php index ecf2dc965a..930ae08125 100755 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Edit.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Edit/Form.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Edit/Form.php index ffa43c1632..28e19ff1d9 100755 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Edit/Form.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Grid.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Grid.php index 1ab0ee9d8b..9e0e9eb840 100755 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Grid.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Grid/Renderer/Application.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Grid/Renderer/Application.php index bb47be885b..be448d7b66 100755 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Grid/Renderer/Application.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Grid/Renderer/Application.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Grid/Renderer/Name.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Grid/Renderer/Name.php index e2f3fce37b..d51810f6e7 100755 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Grid/Renderer/Name.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Grid/Renderer/Name.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Preview.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Preview.php index bc44abd4c9..632ad10790 100755 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Preview.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Preview.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Preview/Form.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Preview/Form.php index 51b7d068e8..d52ecd7347 100755 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Preview/Form.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Preview/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Cart.php b/app/code/core/Mage/XmlConnect/Block/Cart.php index b126dc84b4..bb0eb2df99 100644 --- a/app/code/core/Mage/XmlConnect/Block/Cart.php +++ b/app/code/core/Mage/XmlConnect/Block/Cart.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Cart/Crosssell.php b/app/code/core/Mage/XmlConnect/Block/Cart/Crosssell.php index ed7bc5e15c..ea0e1c0215 100644 --- a/app/code/core/Mage/XmlConnect/Block/Cart/Crosssell.php +++ b/app/code/core/Mage/XmlConnect/Block/Cart/Crosssell.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Cart/Info.php b/app/code/core/Mage/XmlConnect/Block/Cart/Info.php index ad7e66cd24..20e8b395e2 100644 --- a/app/code/core/Mage/XmlConnect/Block/Cart/Info.php +++ b/app/code/core/Mage/XmlConnect/Block/Cart/Info.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Cart/Item/Renderer.php b/app/code/core/Mage/XmlConnect/Block/Cart/Item/Renderer.php index 3ab6f66d0a..a66085894d 100644 --- a/app/code/core/Mage/XmlConnect/Block/Cart/Item/Renderer.php +++ b/app/code/core/Mage/XmlConnect/Block/Cart/Item/Renderer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Cart/Item/Renderer/Configurable.php b/app/code/core/Mage/XmlConnect/Block/Cart/Item/Renderer/Configurable.php index 86e2b530c5..1a1e3d3a6c 100644 --- a/app/code/core/Mage/XmlConnect/Block/Cart/Item/Renderer/Configurable.php +++ b/app/code/core/Mage/XmlConnect/Block/Cart/Item/Renderer/Configurable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Cart/Item/Renderer/Grouped.php b/app/code/core/Mage/XmlConnect/Block/Cart/Item/Renderer/Grouped.php index 49e539e4c6..9d4a0870fc 100644 --- a/app/code/core/Mage/XmlConnect/Block/Cart/Item/Renderer/Grouped.php +++ b/app/code/core/Mage/XmlConnect/Block/Cart/Item/Renderer/Grouped.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Cart/Paypal/Mecl/Details.php b/app/code/core/Mage/XmlConnect/Block/Cart/Paypal/Mecl/Details.php index 59561df5b8..b2be761c90 100644 --- a/app/code/core/Mage/XmlConnect/Block/Cart/Paypal/Mecl/Details.php +++ b/app/code/core/Mage/XmlConnect/Block/Cart/Paypal/Mecl/Details.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Cart/Paypal/Mecl/Review.php b/app/code/core/Mage/XmlConnect/Block/Cart/Paypal/Mecl/Review.php index a2c8a07e87..17547b1b26 100644 --- a/app/code/core/Mage/XmlConnect/Block/Cart/Paypal/Mecl/Review.php +++ b/app/code/core/Mage/XmlConnect/Block/Cart/Paypal/Mecl/Review.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Cart/Paypal/Mecl/Shippingmethods.php b/app/code/core/Mage/XmlConnect/Block/Cart/Paypal/Mecl/Shippingmethods.php index d8d5f2dff9..2af5205d77 100644 --- a/app/code/core/Mage/XmlConnect/Block/Cart/Paypal/Mecl/Shippingmethods.php +++ b/app/code/core/Mage/XmlConnect/Block/Cart/Paypal/Mecl/Shippingmethods.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Cart/Paypal/Mep/Totals.php b/app/code/core/Mage/XmlConnect/Block/Cart/Paypal/Mep/Totals.php index 0903d6b3f1..a47933edde 100644 --- a/app/code/core/Mage/XmlConnect/Block/Cart/Paypal/Mep/Totals.php +++ b/app/code/core/Mage/XmlConnect/Block/Cart/Paypal/Mep/Totals.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Cart/Totals.php b/app/code/core/Mage/XmlConnect/Block/Cart/Totals.php index 67c786c5b7..8ae9270f5a 100644 --- a/app/code/core/Mage/XmlConnect/Block/Cart/Totals.php +++ b/app/code/core/Mage/XmlConnect/Block/Cart/Totals.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog.php b/app/code/core/Mage/XmlConnect/Block/Catalog.php index 91399be2a9..1ab02e34a4 100644 --- a/app/code/core/Mage/XmlConnect/Block/Catalog.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Category.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Category.php index 28bd9e207a..ce7cc19188 100644 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Category.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Category.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Category/Info.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Category/Info.php index 9d24ae57be..7956c05cd0 100644 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Category/Info.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Category/Info.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Filters.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Filters.php index dadbce1c4b..86a7c1e515 100644 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Filters.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Filters.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Product.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Product.php index 095e01bf86..cfb7e9cc57 100644 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Product.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Attributes.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Attributes.php index 6daac159e8..f58be5d712 100644 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Attributes.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Attributes.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Gallery.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Gallery.php index 44c78c096e..4222bbaa10 100644 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Gallery.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Gallery.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/List.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/List.php index 602028af47..cf41a14f0a 100644 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/List.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/List.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options.php index 7d276e29cf..aa90b448fa 100644 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Bundle.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Bundle.php index 690021844b..96626b9510 100644 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Bundle.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Bundle.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Configurable.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Configurable.php index 6edc281770..a7e6424b2d 100644 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Configurable.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Configurable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Giftcard.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Giftcard.php index 5aee915c91..9d9013d3a4 100755 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Giftcard.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Giftcard.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Grouped.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Grouped.php index cdedcea493..6c5569254e 100644 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Grouped.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Grouped.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Simple.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Simple.php index a4e1d42e0e..a30022fb19 100644 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Simple.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Simple.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Virtual.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Virtual.php index 8c6b189cd6..dedeb1f853 100644 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Virtual.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Virtual.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Price.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Price.php index 7e8fca1128..cab8818363 100644 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Price.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Price/Bundle.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Price/Bundle.php index 7670fd4ea2..648c85c60d 100644 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Price/Bundle.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Price/Bundle.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Price/Default.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Price/Default.php index c136f84d49..484840c780 100644 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Price/Default.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Price/Default.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Price/Giftcard.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Price/Giftcard.php index 5924e86c9d..d36c4e807b 100755 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Price/Giftcard.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Price/Giftcard.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Related.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Related.php index 5a15f6d6a0..4886320b95 100644 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Related.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Related.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Review.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Review.php index 3194eb4ac4..b80996181c 100644 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Review.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Review.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Review/List.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Review/List.php index 9ed4353766..c835c35c1f 100644 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Review/List.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Review/List.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Search.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Search.php index a2c884779e..1c8873e942 100644 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Search.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Search.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Search/Suggest.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Search/Suggest.php index a3e4ea8cc5..01fe87f091 100644 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Search/Suggest.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Search/Suggest.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Address/Billing.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Address/Billing.php index 891d2b72c2..cf5804faf2 100644 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Address/Billing.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Address/Billing.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Address/Form.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Address/Form.php index 8e1cc2d555..096ce88da9 100644 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Address/Form.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Address/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Address/Shipping.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Address/Shipping.php index f29eef62bf..97b4d52f3e 100644 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Address/Shipping.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Address/Shipping.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Agreements.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Agreements.php index bb6f3285f2..78be124d63 100644 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Agreements.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Agreements.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Order/Review.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Order/Review.php index edf07c3e5f..0c90502e07 100644 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Order/Review.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Order/Review.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Order/Review/Info.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Order/Review/Info.php index 3988c74f86..58edca8f9c 100644 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Order/Review/Info.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Order/Review/Info.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Authorizenet.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Authorizenet.php index 11a06acec3..0223d2cda6 100644 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Authorizenet.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Authorizenet.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Ccsave.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Ccsave.php index 3b2c1da1f7..384a15d165 100644 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Ccsave.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Ccsave.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Checkmo.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Checkmo.php index 937646312f..dc4d969a8e 100644 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Checkmo.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Checkmo.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Authorizenet.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Authorizenet.php index 5cc6f656f6..5769e517ba 100755 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Authorizenet.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Authorizenet.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Ccsave.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Ccsave.php index 5b49907254..e0a006bd76 100755 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Ccsave.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Ccsave.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Checkmo.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Checkmo.php index 71527a7105..11a060457e 100755 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Checkmo.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Checkmo.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Free.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Free.php index 82a9ec85eb..680d6230b2 100644 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Free.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Free.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Paypal/Abstract.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Paypal/Abstract.php index 807ef7d069..2017fa0b26 100644 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Paypal/Abstract.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Paypal/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Paypal/Express.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Paypal/Express.php index 1979debbd7..f9d783d8dc 100644 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Paypal/Express.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Paypal/Express.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Paypal/Mecl.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Paypal/Mecl.php index ea2eec0dbb..f20cb7cc97 100644 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Paypal/Mecl.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Paypal/Mecl.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Pbridge/Authorizenet.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Pbridge/Authorizenet.php index d0f6362706..bd9b955798 100644 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Pbridge/Authorizenet.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Pbridge/Authorizenet.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Pbridge/Paypal/Direct.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Pbridge/Paypal/Direct.php index dd5080b97f..c059afb404 100644 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Pbridge/Paypal/Direct.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Pbridge/Paypal/Direct.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Pbridge/Paypaluk/Direct.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Pbridge/Paypaluk/Direct.php index 3b885046dc..f721725c9e 100644 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Pbridge/Paypaluk/Direct.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Pbridge/Paypaluk/Direct.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Pbridge/Verisign.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Pbridge/Verisign.php index d614df0d69..1626d14502 100644 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Pbridge/Verisign.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Pbridge/Verisign.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Purchaseorder.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Purchaseorder.php index b238223924..f953091701 100755 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Purchaseorder.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Purchaseorder.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/List.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/List.php index 8096a237eb..3e85846913 100644 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/List.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/List.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Paypal/Direct.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Paypal/Direct.php index ace6306a33..c37cf5cb39 100644 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Paypal/Direct.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Paypal/Direct.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Paypal/Payflow.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Paypal/Payflow.php index 97b9bb7cc2..a3b108d4c6 100644 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Paypal/Payflow.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Paypal/Payflow.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Pbridge/Abstract.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Pbridge/Abstract.php index 2f52acfd17..27e4f2ac1c 100755 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Pbridge/Abstract.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Pbridge/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Pbridge/Authorizenet.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Pbridge/Authorizenet.php index 0315456e42..dfd69b09be 100755 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Pbridge/Authorizenet.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Pbridge/Authorizenet.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Pbridge/Paypal.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Pbridge/Paypal.php index 1b7fd0b102..b45e20d617 100755 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Pbridge/Paypal.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Pbridge/Paypal.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Pbridge/Paypaluk.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Pbridge/Paypaluk.php index 6af2fad556..97732f80b7 100755 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Pbridge/Paypaluk.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Pbridge/Paypaluk.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Pbridge/Verisign.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Pbridge/Verisign.php index 2fdbe679ed..176414ead2 100755 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Pbridge/Verisign.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Pbridge/Verisign.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Purchaseorder.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Purchaseorder.php index 7ceb780d7a..98348c9360 100644 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Purchaseorder.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Purchaseorder.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Pbridge/Result.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Pbridge/Result.php index 9cb4ebabbc..929f2b49b9 100755 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Pbridge/Result.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Pbridge/Result.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Shipping/Method/Available.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Shipping/Method/Available.php index a2aa2cfdb8..36266d6015 100644 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Shipping/Method/Available.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Shipping/Method/Available.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Cms/Page.php b/app/code/core/Mage/XmlConnect/Block/Cms/Page.php index be878e7134..dabd59c7e2 100644 --- a/app/code/core/Mage/XmlConnect/Block/Cms/Page.php +++ b/app/code/core/Mage/XmlConnect/Block/Cms/Page.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Configuration.php b/app/code/core/Mage/XmlConnect/Block/Configuration.php index 6d6ba86331..f8cb2101e6 100644 --- a/app/code/core/Mage/XmlConnect/Block/Configuration.php +++ b/app/code/core/Mage/XmlConnect/Block/Configuration.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Customer/Address/Form.php b/app/code/core/Mage/XmlConnect/Block/Customer/Address/Form.php index 4a00292e7f..f4b92ffec9 100644 --- a/app/code/core/Mage/XmlConnect/Block/Customer/Address/Form.php +++ b/app/code/core/Mage/XmlConnect/Block/Customer/Address/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Customer/Address/List.php b/app/code/core/Mage/XmlConnect/Block/Customer/Address/List.php index d4f0e0534f..5300ba2c93 100644 --- a/app/code/core/Mage/XmlConnect/Block/Customer/Address/List.php +++ b/app/code/core/Mage/XmlConnect/Block/Customer/Address/List.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Customer/Form.php b/app/code/core/Mage/XmlConnect/Block/Customer/Form.php index 8e1d18bf96..a5515a5436 100644 --- a/app/code/core/Mage/XmlConnect/Block/Customer/Form.php +++ b/app/code/core/Mage/XmlConnect/Block/Customer/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Customer/Form/Renderer/Boolean.php b/app/code/core/Mage/XmlConnect/Block/Customer/Form/Renderer/Boolean.php index fa6d20a8fd..fc8e1a7caa 100644 --- a/app/code/core/Mage/XmlConnect/Block/Customer/Form/Renderer/Boolean.php +++ b/app/code/core/Mage/XmlConnect/Block/Customer/Form/Renderer/Boolean.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Customer/Form/Renderer/Date.php b/app/code/core/Mage/XmlConnect/Block/Customer/Form/Renderer/Date.php index b410dc34a0..9ef0f90644 100644 --- a/app/code/core/Mage/XmlConnect/Block/Customer/Form/Renderer/Date.php +++ b/app/code/core/Mage/XmlConnect/Block/Customer/Form/Renderer/Date.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Customer/Form/Renderer/File.php b/app/code/core/Mage/XmlConnect/Block/Customer/Form/Renderer/File.php index 4cb85354b7..8842398675 100644 --- a/app/code/core/Mage/XmlConnect/Block/Customer/Form/Renderer/File.php +++ b/app/code/core/Mage/XmlConnect/Block/Customer/Form/Renderer/File.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Customer/Form/Renderer/Image.php b/app/code/core/Mage/XmlConnect/Block/Customer/Form/Renderer/Image.php index 784e6f0e6b..dbf2485e0b 100644 --- a/app/code/core/Mage/XmlConnect/Block/Customer/Form/Renderer/Image.php +++ b/app/code/core/Mage/XmlConnect/Block/Customer/Form/Renderer/Image.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Customer/Form/Renderer/Multiline.php b/app/code/core/Mage/XmlConnect/Block/Customer/Form/Renderer/Multiline.php index 5c625721ab..943a1056ae 100644 --- a/app/code/core/Mage/XmlConnect/Block/Customer/Form/Renderer/Multiline.php +++ b/app/code/core/Mage/XmlConnect/Block/Customer/Form/Renderer/Multiline.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Customer/Form/Renderer/Multiselect.php b/app/code/core/Mage/XmlConnect/Block/Customer/Form/Renderer/Multiselect.php index f529399c48..1b462f1d86 100644 --- a/app/code/core/Mage/XmlConnect/Block/Customer/Form/Renderer/Multiselect.php +++ b/app/code/core/Mage/XmlConnect/Block/Customer/Form/Renderer/Multiselect.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Customer/Form/Renderer/Select.php b/app/code/core/Mage/XmlConnect/Block/Customer/Form/Renderer/Select.php index 8f4af08613..88bf810873 100644 --- a/app/code/core/Mage/XmlConnect/Block/Customer/Form/Renderer/Select.php +++ b/app/code/core/Mage/XmlConnect/Block/Customer/Form/Renderer/Select.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Customer/Form/Renderer/Text.php b/app/code/core/Mage/XmlConnect/Block/Customer/Form/Renderer/Text.php index 21cbace073..e7c7fd3947 100644 --- a/app/code/core/Mage/XmlConnect/Block/Customer/Form/Renderer/Text.php +++ b/app/code/core/Mage/XmlConnect/Block/Customer/Form/Renderer/Text.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Customer/Form/Renderer/Textarea.php b/app/code/core/Mage/XmlConnect/Block/Customer/Form/Renderer/Textarea.php index ced68edd34..7840d9306d 100644 --- a/app/code/core/Mage/XmlConnect/Block/Customer/Form/Renderer/Textarea.php +++ b/app/code/core/Mage/XmlConnect/Block/Customer/Form/Renderer/Textarea.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Customer/GiftcardCheck.php b/app/code/core/Mage/XmlConnect/Block/Customer/GiftcardCheck.php index fccd8e5ac8..4361054f1c 100644 --- a/app/code/core/Mage/XmlConnect/Block/Customer/GiftcardCheck.php +++ b/app/code/core/Mage/XmlConnect/Block/Customer/GiftcardCheck.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Customer/Order/Details.php b/app/code/core/Mage/XmlConnect/Block/Customer/Order/Details.php index 5cf64fc278..194fa95a7e 100755 --- a/app/code/core/Mage/XmlConnect/Block/Customer/Order/Details.php +++ b/app/code/core/Mage/XmlConnect/Block/Customer/Order/Details.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Customer/Order/Item/Renderer/Bundle.php b/app/code/core/Mage/XmlConnect/Block/Customer/Order/Item/Renderer/Bundle.php index 6efc33fe0c..7cc1b2c33a 100644 --- a/app/code/core/Mage/XmlConnect/Block/Customer/Order/Item/Renderer/Bundle.php +++ b/app/code/core/Mage/XmlConnect/Block/Customer/Order/Item/Renderer/Bundle.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Customer/Order/Item/Renderer/Default.php b/app/code/core/Mage/XmlConnect/Block/Customer/Order/Item/Renderer/Default.php index 3f6b45d5c8..1e78f86e3d 100644 --- a/app/code/core/Mage/XmlConnect/Block/Customer/Order/Item/Renderer/Default.php +++ b/app/code/core/Mage/XmlConnect/Block/Customer/Order/Item/Renderer/Default.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Customer/Order/Item/Renderer/Downloadable.php b/app/code/core/Mage/XmlConnect/Block/Customer/Order/Item/Renderer/Downloadable.php index b6f00368e0..a89d77f313 100644 --- a/app/code/core/Mage/XmlConnect/Block/Customer/Order/Item/Renderer/Downloadable.php +++ b/app/code/core/Mage/XmlConnect/Block/Customer/Order/Item/Renderer/Downloadable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Customer/Order/Item/Renderer/Giftcard.php b/app/code/core/Mage/XmlConnect/Block/Customer/Order/Item/Renderer/Giftcard.php index 0b700a2d12..826f917182 100644 --- a/app/code/core/Mage/XmlConnect/Block/Customer/Order/Item/Renderer/Giftcard.php +++ b/app/code/core/Mage/XmlConnect/Block/Customer/Order/Item/Renderer/Giftcard.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Customer/Order/Item/Renderer/Grouped.php b/app/code/core/Mage/XmlConnect/Block/Customer/Order/Item/Renderer/Grouped.php index d7fe114c3b..44e974503d 100644 --- a/app/code/core/Mage/XmlConnect/Block/Customer/Order/Item/Renderer/Grouped.php +++ b/app/code/core/Mage/XmlConnect/Block/Customer/Order/Item/Renderer/Grouped.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Customer/Order/Items.php b/app/code/core/Mage/XmlConnect/Block/Customer/Order/Items.php index 536d420611..6be03c18cd 100644 --- a/app/code/core/Mage/XmlConnect/Block/Customer/Order/Items.php +++ b/app/code/core/Mage/XmlConnect/Block/Customer/Order/Items.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Customer/Order/List.php b/app/code/core/Mage/XmlConnect/Block/Customer/Order/List.php index 8e3a4e789b..96254f1890 100644 --- a/app/code/core/Mage/XmlConnect/Block/Customer/Order/List.php +++ b/app/code/core/Mage/XmlConnect/Block/Customer/Order/List.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Customer/Order/Totals.php b/app/code/core/Mage/XmlConnect/Block/Customer/Order/Totals.php index 5f0a980e68..1cdbaf15ec 100644 --- a/app/code/core/Mage/XmlConnect/Block/Customer/Order/Totals.php +++ b/app/code/core/Mage/XmlConnect/Block/Customer/Order/Totals.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Customer/Order/Totals/Customerbalance.php b/app/code/core/Mage/XmlConnect/Block/Customer/Order/Totals/Customerbalance.php index 7bed9048b3..21440b5785 100644 --- a/app/code/core/Mage/XmlConnect/Block/Customer/Order/Totals/Customerbalance.php +++ b/app/code/core/Mage/XmlConnect/Block/Customer/Order/Totals/Customerbalance.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Customer/Order/Totals/Customerbalance/Refunded.php b/app/code/core/Mage/XmlConnect/Block/Customer/Order/Totals/Customerbalance/Refunded.php index 4faca89b0a..0d0e2dd414 100644 --- a/app/code/core/Mage/XmlConnect/Block/Customer/Order/Totals/Customerbalance/Refunded.php +++ b/app/code/core/Mage/XmlConnect/Block/Customer/Order/Totals/Customerbalance/Refunded.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Customer/Order/Totals/Giftcards.php b/app/code/core/Mage/XmlConnect/Block/Customer/Order/Totals/Giftcards.php index 68d24a0206..b66db805bb 100644 --- a/app/code/core/Mage/XmlConnect/Block/Customer/Order/Totals/Giftcards.php +++ b/app/code/core/Mage/XmlConnect/Block/Customer/Order/Totals/Giftcards.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Customer/Order/Totals/Tax.php b/app/code/core/Mage/XmlConnect/Block/Customer/Order/Totals/Tax.php index 328aaad6a0..220f5a34a2 100644 --- a/app/code/core/Mage/XmlConnect/Block/Customer/Order/Totals/Tax.php +++ b/app/code/core/Mage/XmlConnect/Block/Customer/Order/Totals/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Customer/Storecredit.php b/app/code/core/Mage/XmlConnect/Block/Customer/Storecredit.php index 59792ac05d..6a61446465 100644 --- a/app/code/core/Mage/XmlConnect/Block/Customer/Storecredit.php +++ b/app/code/core/Mage/XmlConnect/Block/Customer/Storecredit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Home.php b/app/code/core/Mage/XmlConnect/Block/Home.php index d058c3eceb..e6f12eb49c 100644 --- a/app/code/core/Mage/XmlConnect/Block/Home.php +++ b/app/code/core/Mage/XmlConnect/Block/Home.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Review/Form.php b/app/code/core/Mage/XmlConnect/Block/Review/Form.php index 28dbf76031..9a5b5609e0 100644 --- a/app/code/core/Mage/XmlConnect/Block/Review/Form.php +++ b/app/code/core/Mage/XmlConnect/Block/Review/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Wishlist.php b/app/code/core/Mage/XmlConnect/Block/Wishlist.php index e2fb0f7ae4..766844312f 100644 --- a/app/code/core/Mage/XmlConnect/Block/Wishlist.php +++ b/app/code/core/Mage/XmlConnect/Block/Wishlist.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Controller/Action.php b/app/code/core/Mage/XmlConnect/Controller/Action.php index 670aeb9cb3..f70c6372a4 100644 --- a/app/code/core/Mage/XmlConnect/Controller/Action.php +++ b/app/code/core/Mage/XmlConnect/Controller/Action.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Helper/Android.php b/app/code/core/Mage/XmlConnect/Helper/Android.php index 961612bd39..bac53177fa 100755 --- a/app/code/core/Mage/XmlConnect/Helper/Android.php +++ b/app/code/core/Mage/XmlConnect/Helper/Android.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Helper/Catalog/Category/Image.php b/app/code/core/Mage/XmlConnect/Helper/Catalog/Category/Image.php index 8165166a58..8084df3982 100644 --- a/app/code/core/Mage/XmlConnect/Helper/Catalog/Category/Image.php +++ b/app/code/core/Mage/XmlConnect/Helper/Catalog/Category/Image.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Helper/Customer/Form/Renderer.php b/app/code/core/Mage/XmlConnect/Helper/Customer/Form/Renderer.php index b7adcfc13a..ca3dd41095 100644 --- a/app/code/core/Mage/XmlConnect/Helper/Customer/Form/Renderer.php +++ b/app/code/core/Mage/XmlConnect/Helper/Customer/Form/Renderer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Helper/Customer/Order.php b/app/code/core/Mage/XmlConnect/Helper/Customer/Order.php index fe877b1135..a854e3aa61 100644 --- a/app/code/core/Mage/XmlConnect/Helper/Customer/Order.php +++ b/app/code/core/Mage/XmlConnect/Helper/Customer/Order.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Helper/Data.php b/app/code/core/Mage/XmlConnect/Helper/Data.php index 1413a32a9f..e910c5e01e 100644 --- a/app/code/core/Mage/XmlConnect/Helper/Data.php +++ b/app/code/core/Mage/XmlConnect/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Helper/Image.php b/app/code/core/Mage/XmlConnect/Helper/Image.php index 7d94289c51..c644782063 100644 --- a/app/code/core/Mage/XmlConnect/Helper/Image.php +++ b/app/code/core/Mage/XmlConnect/Helper/Image.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Helper/Ipad.php b/app/code/core/Mage/XmlConnect/Helper/Ipad.php index a128537611..546591d625 100755 --- a/app/code/core/Mage/XmlConnect/Helper/Ipad.php +++ b/app/code/core/Mage/XmlConnect/Helper/Ipad.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Helper/Iphone.php b/app/code/core/Mage/XmlConnect/Helper/Iphone.php index 73f8954ac2..d41dd0b0ef 100644 --- a/app/code/core/Mage/XmlConnect/Helper/Iphone.php +++ b/app/code/core/Mage/XmlConnect/Helper/Iphone.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Helper/Payment.php b/app/code/core/Mage/XmlConnect/Helper/Payment.php index 4a1df2f794..9826dc008e 100644 --- a/app/code/core/Mage/XmlConnect/Helper/Payment.php +++ b/app/code/core/Mage/XmlConnect/Helper/Payment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Helper/Theme.php b/app/code/core/Mage/XmlConnect/Helper/Theme.php index bb69bc374b..9d6bf66ec1 100644 --- a/app/code/core/Mage/XmlConnect/Helper/Theme.php +++ b/app/code/core/Mage/XmlConnect/Helper/Theme.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -382,7 +382,7 @@ public function deleteTheme($themeId) $result = false; $ioFile = new Varien_Io_File(); $ioFile->cd($this->getMediaThemePath()); - $themeFile = $themeId . '.xml'; + $themeFile = basename($themeId . '.xml'); if ($ioFile->fileExists($themeFile)) { $result = $ioFile->rm($themeFile); } diff --git a/app/code/core/Mage/XmlConnect/Model/Adminhtml/System/Config/Backend/Baseurl.php b/app/code/core/Mage/XmlConnect/Model/Adminhtml/System/Config/Backend/Baseurl.php index e1a658cb99..661a2b711c 100644 --- a/app/code/core/Mage/XmlConnect/Model/Adminhtml/System/Config/Backend/Baseurl.php +++ b/app/code/core/Mage/XmlConnect/Model/Adminhtml/System/Config/Backend/Baseurl.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Adminhtml/System/Config/Backend/Currency/Default.php b/app/code/core/Mage/XmlConnect/Model/Adminhtml/System/Config/Backend/Currency/Default.php index f8ae325735..87fe118335 100644 --- a/app/code/core/Mage/XmlConnect/Model/Adminhtml/System/Config/Backend/Currency/Default.php +++ b/app/code/core/Mage/XmlConnect/Model/Adminhtml/System/Config/Backend/Currency/Default.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Application.php b/app/code/core/Mage/XmlConnect/Model/Application.php index fe57afaccd..969c327619 100644 --- a/app/code/core/Mage/XmlConnect/Model/Application.php +++ b/app/code/core/Mage/XmlConnect/Model/Application.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Catalog/Category/Image.php b/app/code/core/Mage/XmlConnect/Model/Catalog/Category/Image.php index 3e801a346a..52766753e0 100644 --- a/app/code/core/Mage/XmlConnect/Model/Catalog/Category/Image.php +++ b/app/code/core/Mage/XmlConnect/Model/Catalog/Category/Image.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Catalog/Category/Media/Config.php b/app/code/core/Mage/XmlConnect/Model/Catalog/Category/Media/Config.php index f4b47d32c5..7b99a5fc00 100644 --- a/app/code/core/Mage/XmlConnect/Model/Catalog/Category/Media/Config.php +++ b/app/code/core/Mage/XmlConnect/Model/Catalog/Category/Media/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/ConfigData.php b/app/code/core/Mage/XmlConnect/Model/ConfigData.php index 486ff1c137..8e9a73a093 100644 --- a/app/code/core/Mage/XmlConnect/Model/ConfigData.php +++ b/app/code/core/Mage/XmlConnect/Model/ConfigData.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/History.php b/app/code/core/Mage/XmlConnect/Model/History.php index 0a84cc8398..b93742028e 100644 --- a/app/code/core/Mage/XmlConnect/Model/History.php +++ b/app/code/core/Mage/XmlConnect/Model/History.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Mysql4/Application.php b/app/code/core/Mage/XmlConnect/Model/Mysql4/Application.php index cec269874c..c2a5e5bb95 100644 --- a/app/code/core/Mage/XmlConnect/Model/Mysql4/Application.php +++ b/app/code/core/Mage/XmlConnect/Model/Mysql4/Application.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Mysql4/Application/Collection.php b/app/code/core/Mage/XmlConnect/Model/Mysql4/Application/Collection.php index 9a77500bb3..8d21f00073 100644 --- a/app/code/core/Mage/XmlConnect/Model/Mysql4/Application/Collection.php +++ b/app/code/core/Mage/XmlConnect/Model/Mysql4/Application/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Mysql4/Cms/Page/Collection.php b/app/code/core/Mage/XmlConnect/Model/Mysql4/Cms/Page/Collection.php index 42869e945f..b18cd849fc 100644 --- a/app/code/core/Mage/XmlConnect/Model/Mysql4/Cms/Page/Collection.php +++ b/app/code/core/Mage/XmlConnect/Model/Mysql4/Cms/Page/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Mysql4/ConfigData.php b/app/code/core/Mage/XmlConnect/Model/Mysql4/ConfigData.php index d86f5d2fc0..c32e9796ba 100644 --- a/app/code/core/Mage/XmlConnect/Model/Mysql4/ConfigData.php +++ b/app/code/core/Mage/XmlConnect/Model/Mysql4/ConfigData.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Mysql4/ConfigData/Collection.php b/app/code/core/Mage/XmlConnect/Model/Mysql4/ConfigData/Collection.php index 79608a5c10..9d884d38ee 100644 --- a/app/code/core/Mage/XmlConnect/Model/Mysql4/ConfigData/Collection.php +++ b/app/code/core/Mage/XmlConnect/Model/Mysql4/ConfigData/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Mysql4/Filter/Collection.php b/app/code/core/Mage/XmlConnect/Model/Mysql4/Filter/Collection.php index 440deb8b61..56bec0775e 100644 --- a/app/code/core/Mage/XmlConnect/Model/Mysql4/Filter/Collection.php +++ b/app/code/core/Mage/XmlConnect/Model/Mysql4/Filter/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Mysql4/History.php b/app/code/core/Mage/XmlConnect/Model/Mysql4/History.php index b9c43e0f6e..cd178ed2da 100644 --- a/app/code/core/Mage/XmlConnect/Model/Mysql4/History.php +++ b/app/code/core/Mage/XmlConnect/Model/Mysql4/History.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Mysql4/History/Collection.php b/app/code/core/Mage/XmlConnect/Model/Mysql4/History/Collection.php index 4419e5bd96..f1b1204f2a 100644 --- a/app/code/core/Mage/XmlConnect/Model/Mysql4/History/Collection.php +++ b/app/code/core/Mage/XmlConnect/Model/Mysql4/History/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Mysql4/Queue.php b/app/code/core/Mage/XmlConnect/Model/Mysql4/Queue.php index 3423248849..524dfa60db 100755 --- a/app/code/core/Mage/XmlConnect/Model/Mysql4/Queue.php +++ b/app/code/core/Mage/XmlConnect/Model/Mysql4/Queue.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Mysql4/Queue/Collection.php b/app/code/core/Mage/XmlConnect/Model/Mysql4/Queue/Collection.php index e2643c75d2..1b043467ca 100755 --- a/app/code/core/Mage/XmlConnect/Model/Mysql4/Queue/Collection.php +++ b/app/code/core/Mage/XmlConnect/Model/Mysql4/Queue/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Mysql4/Setup.php b/app/code/core/Mage/XmlConnect/Model/Mysql4/Setup.php index d7b60f601d..b41277c5d4 100644 --- a/app/code/core/Mage/XmlConnect/Model/Mysql4/Setup.php +++ b/app/code/core/Mage/XmlConnect/Model/Mysql4/Setup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Mysql4/Template.php b/app/code/core/Mage/XmlConnect/Model/Mysql4/Template.php index 0d9e803ea2..cee534c508 100755 --- a/app/code/core/Mage/XmlConnect/Model/Mysql4/Template.php +++ b/app/code/core/Mage/XmlConnect/Model/Mysql4/Template.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Mysql4/Template/Collection.php b/app/code/core/Mage/XmlConnect/Model/Mysql4/Template/Collection.php index fe7ea4390b..2a52bf20e9 100755 --- a/app/code/core/Mage/XmlConnect/Model/Mysql4/Template/Collection.php +++ b/app/code/core/Mage/XmlConnect/Model/Mysql4/Template/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Observer.php b/app/code/core/Mage/XmlConnect/Model/Observer.php index 398d059143..09f50d799e 100644 --- a/app/code/core/Mage/XmlConnect/Model/Observer.php +++ b/app/code/core/Mage/XmlConnect/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Payment/Method/Paypal/Config.php b/app/code/core/Mage/XmlConnect/Model/Payment/Method/Paypal/Config.php index 30ff9fab3e..9088db2f0c 100644 --- a/app/code/core/Mage/XmlConnect/Model/Payment/Method/Paypal/Config.php +++ b/app/code/core/Mage/XmlConnect/Model/Payment/Method/Paypal/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Payment/Method/Paypal/Mecl.php b/app/code/core/Mage/XmlConnect/Model/Payment/Method/Paypal/Mecl.php index e22886200f..eb9419e9b5 100644 --- a/app/code/core/Mage/XmlConnect/Model/Payment/Method/Paypal/Mecl.php +++ b/app/code/core/Mage/XmlConnect/Model/Payment/Method/Paypal/Mecl.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Payment/Method/Paypal/Mep.php b/app/code/core/Mage/XmlConnect/Model/Payment/Method/Paypal/Mep.php index f527565154..8cc36f0a58 100644 --- a/app/code/core/Mage/XmlConnect/Model/Payment/Method/Paypal/Mep.php +++ b/app/code/core/Mage/XmlConnect/Model/Payment/Method/Paypal/Mep.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Paypal/Mecl/Checkout.php b/app/code/core/Mage/XmlConnect/Model/Paypal/Mecl/Checkout.php index 02ce8c2ead..ef4cc78dde 100644 --- a/app/code/core/Mage/XmlConnect/Model/Paypal/Mecl/Checkout.php +++ b/app/code/core/Mage/XmlConnect/Model/Paypal/Mecl/Checkout.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Paypal/Mep/Checkout.php b/app/code/core/Mage/XmlConnect/Model/Paypal/Mep/Checkout.php index 111b28b99d..896ec23505 100644 --- a/app/code/core/Mage/XmlConnect/Model/Paypal/Mep/Checkout.php +++ b/app/code/core/Mage/XmlConnect/Model/Paypal/Mep/Checkout.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Preview/Abstract.php b/app/code/core/Mage/XmlConnect/Model/Preview/Abstract.php index 34794c2b8a..4e5ca26cc4 100755 --- a/app/code/core/Mage/XmlConnect/Model/Preview/Abstract.php +++ b/app/code/core/Mage/XmlConnect/Model/Preview/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Preview/Android.php b/app/code/core/Mage/XmlConnect/Model/Preview/Android.php index 275b65b639..29adb13244 100755 --- a/app/code/core/Mage/XmlConnect/Model/Preview/Android.php +++ b/app/code/core/Mage/XmlConnect/Model/Preview/Android.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Preview/Ipad.php b/app/code/core/Mage/XmlConnect/Model/Preview/Ipad.php index 60aa8cb210..b571015abd 100755 --- a/app/code/core/Mage/XmlConnect/Model/Preview/Ipad.php +++ b/app/code/core/Mage/XmlConnect/Model/Preview/Ipad.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Preview/Iphone.php b/app/code/core/Mage/XmlConnect/Model/Preview/Iphone.php index 9a946e12e5..ecb427aad0 100755 --- a/app/code/core/Mage/XmlConnect/Model/Preview/Iphone.php +++ b/app/code/core/Mage/XmlConnect/Model/Preview/Iphone.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Queue.php b/app/code/core/Mage/XmlConnect/Model/Queue.php index 343b1bec06..b6d109c875 100755 --- a/app/code/core/Mage/XmlConnect/Model/Queue.php +++ b/app/code/core/Mage/XmlConnect/Model/Queue.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Resource/Application.php b/app/code/core/Mage/XmlConnect/Model/Resource/Application.php index 7e78710983..845cb39f4f 100755 --- a/app/code/core/Mage/XmlConnect/Model/Resource/Application.php +++ b/app/code/core/Mage/XmlConnect/Model/Resource/Application.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Resource/Application/Collection.php b/app/code/core/Mage/XmlConnect/Model/Resource/Application/Collection.php index 8bcde33208..c6881dfb89 100755 --- a/app/code/core/Mage/XmlConnect/Model/Resource/Application/Collection.php +++ b/app/code/core/Mage/XmlConnect/Model/Resource/Application/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Resource/Cms/Page/Collection.php b/app/code/core/Mage/XmlConnect/Model/Resource/Cms/Page/Collection.php index 46fd005de2..c81b206629 100755 --- a/app/code/core/Mage/XmlConnect/Model/Resource/Cms/Page/Collection.php +++ b/app/code/core/Mage/XmlConnect/Model/Resource/Cms/Page/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Resource/ConfigData.php b/app/code/core/Mage/XmlConnect/Model/Resource/ConfigData.php index 37801f09b4..f6a2399ee6 100644 --- a/app/code/core/Mage/XmlConnect/Model/Resource/ConfigData.php +++ b/app/code/core/Mage/XmlConnect/Model/Resource/ConfigData.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Resource/ConfigData/Collection.php b/app/code/core/Mage/XmlConnect/Model/Resource/ConfigData/Collection.php index 13705353a9..1f729b4627 100644 --- a/app/code/core/Mage/XmlConnect/Model/Resource/ConfigData/Collection.php +++ b/app/code/core/Mage/XmlConnect/Model/Resource/ConfigData/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Resource/Filter/Collection.php b/app/code/core/Mage/XmlConnect/Model/Resource/Filter/Collection.php index bf6e2c6562..ede671350c 100755 --- a/app/code/core/Mage/XmlConnect/Model/Resource/Filter/Collection.php +++ b/app/code/core/Mage/XmlConnect/Model/Resource/Filter/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Resource/History.php b/app/code/core/Mage/XmlConnect/Model/Resource/History.php index b538fe7ff8..711a10526d 100755 --- a/app/code/core/Mage/XmlConnect/Model/Resource/History.php +++ b/app/code/core/Mage/XmlConnect/Model/Resource/History.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Resource/History/Collection.php b/app/code/core/Mage/XmlConnect/Model/Resource/History/Collection.php index 889f7b9159..a5cd4eed61 100755 --- a/app/code/core/Mage/XmlConnect/Model/Resource/History/Collection.php +++ b/app/code/core/Mage/XmlConnect/Model/Resource/History/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Resource/Queue.php b/app/code/core/Mage/XmlConnect/Model/Resource/Queue.php index 21d483d3a9..c97f2c610d 100755 --- a/app/code/core/Mage/XmlConnect/Model/Resource/Queue.php +++ b/app/code/core/Mage/XmlConnect/Model/Resource/Queue.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Resource/Queue/Collection.php b/app/code/core/Mage/XmlConnect/Model/Resource/Queue/Collection.php index c9fb3bc50c..1b04a8ff73 100755 --- a/app/code/core/Mage/XmlConnect/Model/Resource/Queue/Collection.php +++ b/app/code/core/Mage/XmlConnect/Model/Resource/Queue/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Resource/Setup.php b/app/code/core/Mage/XmlConnect/Model/Resource/Setup.php index 38fd725905..132cd9817e 100755 --- a/app/code/core/Mage/XmlConnect/Model/Resource/Setup.php +++ b/app/code/core/Mage/XmlConnect/Model/Resource/Setup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Resource/Template.php b/app/code/core/Mage/XmlConnect/Model/Resource/Template.php index 03dae7d771..c134ccddc3 100755 --- a/app/code/core/Mage/XmlConnect/Model/Resource/Template.php +++ b/app/code/core/Mage/XmlConnect/Model/Resource/Template.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Resource/Template/Collection.php b/app/code/core/Mage/XmlConnect/Model/Resource/Template/Collection.php index f0f00699dd..6b9d0ee251 100755 --- a/app/code/core/Mage/XmlConnect/Model/Resource/Template/Collection.php +++ b/app/code/core/Mage/XmlConnect/Model/Resource/Template/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Simplexml/Element.php b/app/code/core/Mage/XmlConnect/Model/Simplexml/Element.php index 2f60848fef..83605ace3f 100644 --- a/app/code/core/Mage/XmlConnect/Model/Simplexml/Element.php +++ b/app/code/core/Mage/XmlConnect/Model/Simplexml/Element.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form.php b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form.php index 7af540c994..1cc3f0c2bb 100644 --- a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form.php +++ b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Abstract.php b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Abstract.php index 78ce6bc426..9400d1f63c 100644 --- a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Abstract.php +++ b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Abstract.php b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Abstract.php index 2aed90b334..c7be7c237a 100644 --- a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Abstract.php +++ b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Checkbox.php b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Checkbox.php index 62bf94a76b..ee8fc1605c 100644 --- a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Checkbox.php +++ b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Checkbox.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Collection.php b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Collection.php index 0694dd4d9a..1ea98bb64f 100644 --- a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Collection.php +++ b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/CountryListSelect.php b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/CountryListSelect.php index 9872e45779..735ea487b0 100644 --- a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/CountryListSelect.php +++ b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/CountryListSelect.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Date.php b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Date.php index 921364960f..27797d2843 100644 --- a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Date.php +++ b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Date.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Email.php b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Email.php index 382b75fdcc..6b00f4b2ef 100644 --- a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Email.php +++ b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Email.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Fieldset.php b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Fieldset.php index aa6fa3c0e0..865f50d00b 100644 --- a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Fieldset.php +++ b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Fieldset.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/File.php b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/File.php index 286b8ef8f4..d58c73f06b 100644 --- a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/File.php +++ b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/File.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Image.php b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Image.php index ca7570af62..3203054ec1 100644 --- a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Image.php +++ b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Image.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Multiline.php b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Multiline.php index efb68d98bb..51bc8af766 100644 --- a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Multiline.php +++ b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Multiline.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Multiselect.php b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Multiselect.php index 7349989dca..2dbc66dad8 100644 --- a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Multiselect.php +++ b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Multiselect.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Renderer/Interface.php b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Renderer/Interface.php index c71fd3795a..cf5bdbe481 100644 --- a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Renderer/Interface.php +++ b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Renderer/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Select.php b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Select.php index 7eda8e14d2..ac5c798b3f 100644 --- a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Select.php +++ b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Select.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Text.php b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Text.php index c664e9c4e0..38d96a3c73 100644 --- a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Text.php +++ b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Text.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Textarea.php b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Textarea.php index 92e1b3c9da..b342fe9cce 100644 --- a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Textarea.php +++ b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Textarea.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Validator.php b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Validator.php index 5449685a94..9faec81d93 100644 --- a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Validator.php +++ b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Validator.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Validator/Abstract.php b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Validator/Abstract.php index 348e76a2f3..abb6dbe680 100644 --- a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Validator/Abstract.php +++ b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Validator/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Validator/Rule.php b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Validator/Rule.php index bd47829a6f..0eee1fcf72 100644 --- a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Validator/Rule.php +++ b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Validator/Rule.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Tabs.php b/app/code/core/Mage/XmlConnect/Model/Tabs.php index 58da61abe6..c0d327814d 100644 --- a/app/code/core/Mage/XmlConnect/Model/Tabs.php +++ b/app/code/core/Mage/XmlConnect/Model/Tabs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Template.php b/app/code/core/Mage/XmlConnect/Model/Template.php index 95998f3a52..53d4a5526a 100755 --- a/app/code/core/Mage/XmlConnect/Model/Template.php +++ b/app/code/core/Mage/XmlConnect/Model/Template.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Theme.php b/app/code/core/Mage/XmlConnect/Model/Theme.php index 00acf46e23..d7ed1a226b 100644 --- a/app/code/core/Mage/XmlConnect/Model/Theme.php +++ b/app/code/core/Mage/XmlConnect/Model/Theme.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/controllers/Adminhtml/MobileController.php b/app/code/core/Mage/XmlConnect/controllers/Adminhtml/MobileController.php index 273e0ce38e..f054be13cb 100644 --- a/app/code/core/Mage/XmlConnect/controllers/Adminhtml/MobileController.php +++ b/app/code/core/Mage/XmlConnect/controllers/Adminhtml/MobileController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -1165,9 +1165,8 @@ public function saveMessageAction() break; } if ($temporaryObject->getExecTime()) { - $message->setExecTime( - Mage::getSingleton('core/date')->gmtDate(null, $temporaryObject->getExecTime()) - ); + $execTime = Mage::getSingleton('core/date')->gmtDate(null, $temporaryObject->getExecTime()); + $message->setExecTime($execTime ? $execTime : Mage::getSingleton('core/date')->gmtDate()); } else { $message->setExecTime(new Zend_Db_Expr('NULL')); } diff --git a/app/code/core/Mage/XmlConnect/controllers/CartController.php b/app/code/core/Mage/XmlConnect/controllers/CartController.php index b48bfe6457..7c2a180515 100644 --- a/app/code/core/Mage/XmlConnect/controllers/CartController.php +++ b/app/code/core/Mage/XmlConnect/controllers/CartController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/controllers/CatalogController.php b/app/code/core/Mage/XmlConnect/controllers/CatalogController.php index a8775f1aff..552ab22d9c 100644 --- a/app/code/core/Mage/XmlConnect/controllers/CatalogController.php +++ b/app/code/core/Mage/XmlConnect/controllers/CatalogController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/controllers/CheckoutController.php b/app/code/core/Mage/XmlConnect/controllers/CheckoutController.php index c7a0161136..e4323b9c05 100644 --- a/app/code/core/Mage/XmlConnect/controllers/CheckoutController.php +++ b/app/code/core/Mage/XmlConnect/controllers/CheckoutController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/controllers/CmsController.php b/app/code/core/Mage/XmlConnect/controllers/CmsController.php index 0ea582df1e..e9618778b3 100644 --- a/app/code/core/Mage/XmlConnect/controllers/CmsController.php +++ b/app/code/core/Mage/XmlConnect/controllers/CmsController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/controllers/ConfigurationController.php b/app/code/core/Mage/XmlConnect/controllers/ConfigurationController.php index 68c24a2e7e..8440490e05 100644 --- a/app/code/core/Mage/XmlConnect/controllers/ConfigurationController.php +++ b/app/code/core/Mage/XmlConnect/controllers/ConfigurationController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/controllers/CustomerController.php b/app/code/core/Mage/XmlConnect/controllers/CustomerController.php index d28f38207d..06f32129ff 100644 --- a/app/code/core/Mage/XmlConnect/controllers/CustomerController.php +++ b/app/code/core/Mage/XmlConnect/controllers/CustomerController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/controllers/IndexController.php b/app/code/core/Mage/XmlConnect/controllers/IndexController.php index f4c8c2281b..b5c90257cb 100644 --- a/app/code/core/Mage/XmlConnect/controllers/IndexController.php +++ b/app/code/core/Mage/XmlConnect/controllers/IndexController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/controllers/Paypal/MeclController.php b/app/code/core/Mage/XmlConnect/controllers/Paypal/MeclController.php index 9fa4427ca7..e811634afb 100644 --- a/app/code/core/Mage/XmlConnect/controllers/Paypal/MeclController.php +++ b/app/code/core/Mage/XmlConnect/controllers/Paypal/MeclController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/controllers/Paypal/MepController.php b/app/code/core/Mage/XmlConnect/controllers/Paypal/MepController.php index 9ae6d5b99e..e25999bfa1 100644 --- a/app/code/core/Mage/XmlConnect/controllers/Paypal/MepController.php +++ b/app/code/core/Mage/XmlConnect/controllers/Paypal/MepController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/controllers/PbridgeController.php b/app/code/core/Mage/XmlConnect/controllers/PbridgeController.php index c9ee4ea260..3940270c9f 100755 --- a/app/code/core/Mage/XmlConnect/controllers/PbridgeController.php +++ b/app/code/core/Mage/XmlConnect/controllers/PbridgeController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/controllers/ReviewController.php b/app/code/core/Mage/XmlConnect/controllers/ReviewController.php index 0c99bdcb62..29e23352a2 100644 --- a/app/code/core/Mage/XmlConnect/controllers/ReviewController.php +++ b/app/code/core/Mage/XmlConnect/controllers/ReviewController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/controllers/WishlistController.php b/app/code/core/Mage/XmlConnect/controllers/WishlistController.php index 7fad737b17..fb7baf8564 100644 --- a/app/code/core/Mage/XmlConnect/controllers/WishlistController.php +++ b/app/code/core/Mage/XmlConnect/controllers/WishlistController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/etc/adminhtml.xml b/app/code/core/Mage/XmlConnect/etc/adminhtml.xml index 356987446b..4dd8b11176 100644 --- a/app/code/core/Mage/XmlConnect/etc/adminhtml.xml +++ b/app/code/core/Mage/XmlConnect/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/XmlConnect/etc/config.xml b/app/code/core/Mage/XmlConnect/etc/config.xml index 5e9b71ab25..18a3fc7221 100644 --- a/app/code/core/Mage/XmlConnect/etc/config.xml +++ b/app/code/core/Mage/XmlConnect/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/XmlConnect/etc/system.xml b/app/code/core/Mage/XmlConnect/etc/system.xml index 4408c82ca1..be77b17c2e 100644 --- a/app/code/core/Mage/XmlConnect/etc/system.xml +++ b/app/code/core/Mage/XmlConnect/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/XmlConnect/etc/themes/custom.xml b/app/code/core/Mage/XmlConnect/etc/themes/custom.xml index 840ac1dc46..ee5c6459cf 100644 --- a/app/code/core/Mage/XmlConnect/etc/themes/custom.xml +++ b/app/code/core/Mage/XmlConnect/etc/themes/custom.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/XmlConnect/etc/themes/default.xml b/app/code/core/Mage/XmlConnect/etc/themes/default.xml index 6a4c5c0169..312188091f 100644 --- a/app/code/core/Mage/XmlConnect/etc/themes/default.xml +++ b/app/code/core/Mage/XmlConnect/etc/themes/default.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/XmlConnect/etc/themes/funk_leaf.xml b/app/code/core/Mage/XmlConnect/etc/themes/funk_leaf.xml index 4d6dca58d4..7996d84845 100644 --- a/app/code/core/Mage/XmlConnect/etc/themes/funk_leaf.xml +++ b/app/code/core/Mage/XmlConnect/etc/themes/funk_leaf.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/XmlConnect/etc/themes/hot_red.xml b/app/code/core/Mage/XmlConnect/etc/themes/hot_red.xml index 65d6632046..5d1ac641b5 100644 --- a/app/code/core/Mage/XmlConnect/etc/themes/hot_red.xml +++ b/app/code/core/Mage/XmlConnect/etc/themes/hot_red.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/XmlConnect/etc/themes/sky_blue.xml b/app/code/core/Mage/XmlConnect/etc/themes/sky_blue.xml index 0a620056d3..a61a581280 100644 --- a/app/code/core/Mage/XmlConnect/etc/themes/sky_blue.xml +++ b/app/code/core/Mage/XmlConnect/etc/themes/sky_blue.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/install-1.6.0.0.php b/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/install-1.6.0.0.php index f8c43f8ef5..dee95a8257 100755 --- a/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-data-upgrade-1.4.0.13-1.4.0.14.php b/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-data-upgrade-1.4.0.13-1.4.0.14.php index 09844425c0..7b278fa139 100644 --- a/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-data-upgrade-1.4.0.13-1.4.0.14.php +++ b/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-data-upgrade-1.4.0.13-1.4.0.14.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-install-1.4.0.8.php b/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-install-1.4.0.8.php index 37a2f800b6..988741b5c1 100644 --- a/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-install-1.4.0.8.php +++ b/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-install-1.4.0.8.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-upgrade-1.4.0.10-1.4.0.11.php b/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-upgrade-1.4.0.10-1.4.0.11.php index 144c139f02..e0476b5068 100755 --- a/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-upgrade-1.4.0.10-1.4.0.11.php +++ b/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-upgrade-1.4.0.10-1.4.0.11.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-upgrade-1.4.0.11-1.4.0.12.php b/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-upgrade-1.4.0.11-1.4.0.12.php index 4bb010134d..5da937e395 100755 --- a/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-upgrade-1.4.0.11-1.4.0.12.php +++ b/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-upgrade-1.4.0.11-1.4.0.12.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-upgrade-1.4.0.12-1.4.0.13.php b/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-upgrade-1.4.0.12-1.4.0.13.php index 9dc7871211..71682ebb30 100644 --- a/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-upgrade-1.4.0.12-1.4.0.13.php +++ b/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-upgrade-1.4.0.12-1.4.0.13.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-upgrade-1.4.0.13-1.4.0.14.php b/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-upgrade-1.4.0.13-1.4.0.14.php index 2bd7e40c01..5ac2854e9e 100644 --- a/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-upgrade-1.4.0.13-1.4.0.14.php +++ b/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-upgrade-1.4.0.13-1.4.0.14.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-upgrade-1.4.0.8-1.4.0.9.php b/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-upgrade-1.4.0.8-1.4.0.9.php index 9773b412ec..a83540cc3b 100755 --- a/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-upgrade-1.4.0.8-1.4.0.9.php +++ b/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-upgrade-1.4.0.8-1.4.0.9.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-upgrade-1.4.0.9-1.4.0.10.php b/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-upgrade-1.4.0.9-1.4.0.10.php index 80f39d72b7..a06ed8ba61 100755 --- a/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-upgrade-1.4.0.9-1.4.0.10.php +++ b/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-upgrade-1.4.0.9-1.4.0.10.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php index 8a1ac12aad..49b8ddafe3 100755 --- a/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ b/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/design/adminhtml/default/default/layout/admin.xml b/app/design/adminhtml/default/default/layout/admin.xml index 0edf5a0577..72d80a01f3 100644 --- a/app/design/adminhtml/default/default/layout/admin.xml +++ b/app/design/adminhtml/default/default/layout/admin.xml @@ -21,7 +21,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/design/adminhtml/default/default/layout/adminnotification.xml b/app/design/adminhtml/default/default/layout/adminnotification.xml index 508a8645f1..b1fbbf7ee0 100644 --- a/app/design/adminhtml/default/default/layout/adminnotification.xml +++ b/app/design/adminhtml/default/default/layout/adminnotification.xml @@ -21,7 +21,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/design/adminhtml/default/default/layout/authorizenet.xml b/app/design/adminhtml/default/default/layout/authorizenet.xml index 423270a232..c8a299ed74 100644 --- a/app/design/adminhtml/default/default/layout/authorizenet.xml +++ b/app/design/adminhtml/default/default/layout/authorizenet.xml @@ -21,7 +21,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/adminhtml/default/default/layout/bundle.xml b/app/design/adminhtml/default/default/layout/bundle.xml index 9d7e1c3c71..0116e159b4 100644 --- a/app/design/adminhtml/default/default/layout/bundle.xml +++ b/app/design/adminhtml/default/default/layout/bundle.xml @@ -21,7 +21,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/design/adminhtml/default/default/layout/captcha.xml b/app/design/adminhtml/default/default/layout/captcha.xml index 0615f967d7..56b7b5fc1f 100755 --- a/app/design/adminhtml/default/default/layout/captcha.xml +++ b/app/design/adminhtml/default/default/layout/captcha.xml @@ -21,7 +21,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/adminhtml/default/default/layout/catalog.xml b/app/design/adminhtml/default/default/layout/catalog.xml index a52053bff3..b86c9c9014 100644 --- a/app/design/adminhtml/default/default/layout/catalog.xml +++ b/app/design/adminhtml/default/default/layout/catalog.xml @@ -21,7 +21,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/design/adminhtml/default/default/layout/centinel.xml b/app/design/adminhtml/default/default/layout/centinel.xml index ae1f72f22c..ff0783a980 100644 --- a/app/design/adminhtml/default/default/layout/centinel.xml +++ b/app/design/adminhtml/default/default/layout/centinel.xml @@ -21,7 +21,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/adminhtml/default/default/layout/cms.xml b/app/design/adminhtml/default/default/layout/cms.xml index f822d9bdff..67fbc2062d 100644 --- a/app/design/adminhtml/default/default/layout/cms.xml +++ b/app/design/adminhtml/default/default/layout/cms.xml @@ -21,7 +21,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/design/adminhtml/default/default/layout/compiler.xml b/app/design/adminhtml/default/default/layout/compiler.xml index 51c177ee4c..7ff96fd7fc 100644 --- a/app/design/adminhtml/default/default/layout/compiler.xml +++ b/app/design/adminhtml/default/default/layout/compiler.xml @@ -21,7 +21,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/design/adminhtml/default/default/layout/connect.xml b/app/design/adminhtml/default/default/layout/connect.xml index f15ca59f47..4bca2a0abe 100644 --- a/app/design/adminhtml/default/default/layout/connect.xml +++ b/app/design/adminhtml/default/default/layout/connect.xml @@ -21,7 +21,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/design/adminhtml/default/default/layout/currencysymbol.xml b/app/design/adminhtml/default/default/layout/currencysymbol.xml new file mode 100644 index 0000000000..413383259b --- /dev/null +++ b/app/design/adminhtml/default/default/layout/currencysymbol.xml @@ -0,0 +1,34 @@ + + + + + + + + + diff --git a/app/design/adminhtml/default/default/layout/customer.xml b/app/design/adminhtml/default/default/layout/customer.xml index 5b439d8c93..5e5d3f6bdb 100644 --- a/app/design/adminhtml/default/default/layout/customer.xml +++ b/app/design/adminhtml/default/default/layout/customer.xml @@ -21,7 +21,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/design/adminhtml/default/default/layout/dataflow.xml b/app/design/adminhtml/default/default/layout/dataflow.xml index 534129275b..de0a420ea3 100644 --- a/app/design/adminhtml/default/default/layout/dataflow.xml +++ b/app/design/adminhtml/default/default/layout/dataflow.xml @@ -21,7 +21,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/design/adminhtml/default/default/layout/downloadable.xml b/app/design/adminhtml/default/default/layout/downloadable.xml index b675fd26e8..51f88f6fdd 100644 --- a/app/design/adminhtml/default/default/layout/downloadable.xml +++ b/app/design/adminhtml/default/default/layout/downloadable.xml @@ -21,7 +21,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/design/adminhtml/default/default/layout/giftmessage.xml b/app/design/adminhtml/default/default/layout/giftmessage.xml index 1807b0c565..3362fe7da6 100644 --- a/app/design/adminhtml/default/default/layout/giftmessage.xml +++ b/app/design/adminhtml/default/default/layout/giftmessage.xml @@ -21,7 +21,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/design/adminhtml/default/default/layout/index.xml b/app/design/adminhtml/default/default/layout/index.xml index 4cfe406b76..de77d959ef 100644 --- a/app/design/adminhtml/default/default/layout/index.xml +++ b/app/design/adminhtml/default/default/layout/index.xml @@ -21,7 +21,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/design/adminhtml/default/default/layout/main.xml b/app/design/adminhtml/default/default/layout/main.xml index eb72265b83..f3ce2d94b7 100644 --- a/app/design/adminhtml/default/default/layout/main.xml +++ b/app/design/adminhtml/default/default/layout/main.xml @@ -21,7 +21,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ @@ -124,6 +124,8 @@ Default layout, loads most of the pages + + @@ -174,7 +176,7 @@ Layout for editor element js_cssprototype/windows/themes/default.css - js_cssprototype/windows/themes/magento.css + lib/prototype/windows/themes/magento.css diff --git a/app/design/adminhtml/default/default/layout/moneybookers.xml b/app/design/adminhtml/default/default/layout/moneybookers.xml index 862ab1ad4f..b06e0450be 100644 --- a/app/design/adminhtml/default/default/layout/moneybookers.xml +++ b/app/design/adminhtml/default/default/layout/moneybookers.xml @@ -15,7 +15,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) + * @copyright Copyright (c) 2012 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ --> diff --git a/app/design/adminhtml/default/default/layout/newsletter.xml b/app/design/adminhtml/default/default/layout/newsletter.xml index 6aedea1f47..bb0d48bd2b 100644 --- a/app/design/adminhtml/default/default/layout/newsletter.xml +++ b/app/design/adminhtml/default/default/layout/newsletter.xml @@ -21,7 +21,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/design/adminhtml/default/default/layout/pagecache.xml b/app/design/adminhtml/default/default/layout/pagecache.xml index a58dd03f1f..4ce93c3039 100644 --- a/app/design/adminhtml/default/default/layout/pagecache.xml +++ b/app/design/adminhtml/default/default/layout/pagecache.xml @@ -21,7 +21,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/design/adminhtml/default/default/layout/promo.xml b/app/design/adminhtml/default/default/layout/promo.xml index b76eed4c57..c6f85ea0d8 100644 --- a/app/design/adminhtml/default/default/layout/promo.xml +++ b/app/design/adminhtml/default/default/layout/promo.xml @@ -21,7 +21,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/design/adminhtml/default/default/layout/report.xml b/app/design/adminhtml/default/default/layout/report.xml index c76ca36561..b1a327731e 100644 --- a/app/design/adminhtml/default/default/layout/report.xml +++ b/app/design/adminhtml/default/default/layout/report.xml @@ -21,7 +21,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/design/adminhtml/default/default/layout/rss.xml b/app/design/adminhtml/default/default/layout/rss.xml index d2cef7e84e..64bd1e4dd1 100644 --- a/app/design/adminhtml/default/default/layout/rss.xml +++ b/app/design/adminhtml/default/default/layout/rss.xml @@ -21,7 +21,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/design/adminhtml/default/default/layout/sales.xml b/app/design/adminhtml/default/default/layout/sales.xml index c7ac871b38..be6baa2145 100644 --- a/app/design/adminhtml/default/default/layout/sales.xml +++ b/app/design/adminhtml/default/default/layout/sales.xml @@ -21,7 +21,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/design/adminhtml/default/default/layout/search.xml b/app/design/adminhtml/default/default/layout/search.xml index 92d266f100..04b7800fa8 100644 --- a/app/design/adminhtml/default/default/layout/search.xml +++ b/app/design/adminhtml/default/default/layout/search.xml @@ -21,7 +21,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/design/adminhtml/default/default/layout/tag.xml b/app/design/adminhtml/default/default/layout/tag.xml index 1af8f3d49b..d5ed685ffc 100644 --- a/app/design/adminhtml/default/default/layout/tag.xml +++ b/app/design/adminhtml/default/default/layout/tag.xml @@ -21,7 +21,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/design/adminhtml/default/default/layout/widget.xml b/app/design/adminhtml/default/default/layout/widget.xml index 756652ceac..2eba73bb13 100644 --- a/app/design/adminhtml/default/default/layout/widget.xml +++ b/app/design/adminhtml/default/default/layout/widget.xml @@ -21,7 +21,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -47,7 +47,7 @@ jsprototype/window.js js_cssprototype/windows/themes/default.css - js_cssprototype/windows/themes/magento.css + lib/prototype/windows/themes/magento.css diff --git a/app/design/adminhtml/default/default/layout/xmlconnect.xml b/app/design/adminhtml/default/default/layout/xmlconnect.xml index 3bdea0a1f3..9ae04dcf20 100644 --- a/app/design/adminhtml/default/default/layout/xmlconnect.xml +++ b/app/design/adminhtml/default/default/layout/xmlconnect.xml @@ -21,7 +21,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -80,7 +80,7 @@ js_cssprototype/windows/themes/default.css - js_cssprototype/windows/themes/magento.css + lib/prototype/windows/themes/magento.css diff --git a/app/design/adminhtml/default/default/template/access_denied.phtml b/app/design/adminhtml/default/default/template/access_denied.phtml index fd916949f6..0e49161e1e 100644 --- a/app/design/adminhtml/default/default/template/access_denied.phtml +++ b/app/design/adminhtml/default/default/template/access_denied.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/api/role_users_grid_js.phtml b/app/design/adminhtml/default/default/template/api/role_users_grid_js.phtml index 838135e745..79ffafe5fe 100644 --- a/app/design/adminhtml/default/default/template/api/role_users_grid_js.phtml +++ b/app/design/adminhtml/default/default/template/api/role_users_grid_js.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/api/roleinfo.phtml b/app/design/adminhtml/default/default/template/api/roleinfo.phtml index e74f891234..053723aeba 100644 --- a/app/design/adminhtml/default/default/template/api/roleinfo.phtml +++ b/app/design/adminhtml/default/default/template/api/roleinfo.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/api/roles.phtml b/app/design/adminhtml/default/default/template/api/roles.phtml index 4713c7b0d1..cebb8dcb14 100644 --- a/app/design/adminhtml/default/default/template/api/roles.phtml +++ b/app/design/adminhtml/default/default/template/api/roles.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -29,7 +29,7 @@

    __('Roles') ?>

    - +
    diff --git a/app/design/adminhtml/default/default/template/api/rolesedit.phtml b/app/design/adminhtml/default/default/template/api/rolesedit.phtml index 07c06c7b75..e031b7da66 100644 --- a/app/design/adminhtml/default/default/template/api/rolesedit.phtml +++ b/app/design/adminhtml/default/default/template/api/rolesedit.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/api/rolesusers.phtml b/app/design/adminhtml/default/default/template/api/rolesusers.phtml index 3727f5c4ac..e09eb58a42 100644 --- a/app/design/adminhtml/default/default/template/api/rolesusers.phtml +++ b/app/design/adminhtml/default/default/template/api/rolesusers.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/api/user_roles_grid_js.phtml b/app/design/adminhtml/default/default/template/api/user_roles_grid_js.phtml index 57a60860f8..cc042e99e8 100644 --- a/app/design/adminhtml/default/default/template/api/user_roles_grid_js.phtml +++ b/app/design/adminhtml/default/default/template/api/user_roles_grid_js.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/api/userinfo.phtml b/app/design/adminhtml/default/default/template/api/userinfo.phtml index c9be39d10b..5290bbcf43 100644 --- a/app/design/adminhtml/default/default/template/api/userinfo.phtml +++ b/app/design/adminhtml/default/default/template/api/userinfo.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/api/usernroles.phtml b/app/design/adminhtml/default/default/template/api/usernroles.phtml index 8106d8e6ff..9ccb82acbf 100644 --- a/app/design/adminhtml/default/default/template/api/usernroles.phtml +++ b/app/design/adminhtml/default/default/template/api/usernroles.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/api/userroles.phtml b/app/design/adminhtml/default/default/template/api/userroles.phtml index e0addd3939..4724e29760 100644 --- a/app/design/adminhtml/default/default/template/api/userroles.phtml +++ b/app/design/adminhtml/default/default/template/api/userroles.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/api/users.phtml b/app/design/adminhtml/default/default/template/api/users.phtml index da6c6b1ade..f4df96e9ef 100644 --- a/app/design/adminhtml/default/default/template/api/users.phtml +++ b/app/design/adminhtml/default/default/template/api/users.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -29,7 +29,7 @@

    __('Users') ?>

    - +
    diff --git a/app/design/adminhtml/default/default/template/authorizenet/directpost/iframe.phtml b/app/design/adminhtml/default/default/template/authorizenet/directpost/iframe.phtml index 1532c0a9cc..54efe2c88c 100644 --- a/app/design/adminhtml/default/default/template/authorizenet/directpost/iframe.phtml +++ b/app/design/adminhtml/default/default/template/authorizenet/directpost/iframe.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/adminhtml/default/default/template/authorizenet/directpost/info.phtml b/app/design/adminhtml/default/default/template/authorizenet/directpost/info.phtml index c05c2ec9c2..c09eccc7dc 100644 --- a/app/design/adminhtml/default/default/template/authorizenet/directpost/info.phtml +++ b/app/design/adminhtml/default/default/template/authorizenet/directpost/info.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/adminhtml/default/default/template/backup/dialogs.phtml b/app/design/adminhtml/default/default/template/backup/dialogs.phtml index e19bbc9c94..3db94d4f8e 100644 --- a/app/design/adminhtml/default/default/template/backup/dialogs.phtml +++ b/app/design/adminhtml/default/default/template/backup/dialogs.phtml @@ -26,20 +26,59 @@
    __("The backup's creation process will take time.")?>
    __('You will need to wait when the action ends.')?>
    __('Do you really want to proceed?')?>
    -
    - - -
    - +
    + +
    getReadOnly()):?> disabled="disabled"/><\/td>'+ 'getReadOnly()):?> disabled="disabled"/><\/td>'+ - ''+ + ''+ ''+ getReadOnly()):?> 'getDeleteButtonHtml() ?>'+ @@ -129,16 +129,21 @@ var attributeOption = { templateText : templateText, itemCount : 0, totalItems : 0, + isReadOnly: getReadOnly(); ?>, add : function(data) { this.template = new Template(this.templateText, this.templateSyntax); + var isNewOption = false; if(!data.id){ data = {}; data.id = 'option_'+this.itemCount; + isNewOption = true; } if (!data.intype) data.intype = optionDefaultInputType; - Element.insert(this.table, {after: this.template.evaluate(data)}); + if (isNewOption && !this.isReadOnly) { + this.enableNewOptionDeleteButton(data.id); + } this.bindRemoveButtons(); this.itemCount++; this.totalItems++; @@ -178,6 +183,12 @@ var attributeOption = { $('option-count-check').value = ''; } }, + enableNewOptionDeleteButton: function(id) { + $$('#delete_button_container_' + id + ' button').each(function(button) { + button.enable(); + button.removeClassName('disabled'); + }); + }, bindRemoveButtons : function(){ var buttons = $$('.delete-option'); for(var i=0;i diff --git a/app/design/adminhtml/default/default/template/catalog/product/attribute/set/main/tree/attribute.phtml b/app/design/adminhtml/default/default/template/catalog/product/attribute/set/main/tree/attribute.phtml index 2acd065758..06b9fcb86a 100644 --- a/app/design/adminhtml/default/default/template/catalog/product/attribute/set/main/tree/attribute.phtml +++ b/app/design/adminhtml/default/default/template/catalog/product/attribute/set/main/tree/attribute.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/catalog/product/attribute/set/main/tree/group.phtml b/app/design/adminhtml/default/default/template/catalog/product/attribute/set/main/tree/group.phtml index 91fe9250a4..dc4ec6d0c3 100644 --- a/app/design/adminhtml/default/default/template/catalog/product/attribute/set/main/tree/group.phtml +++ b/app/design/adminhtml/default/default/template/catalog/product/attribute/set/main/tree/group.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/catalog/product/attribute/set/toolbar/add.phtml b/app/design/adminhtml/default/default/template/catalog/product/attribute/set/toolbar/add.phtml index c6584ab878..2bfd88b872 100644 --- a/app/design/adminhtml/default/default/template/catalog/product/attribute/set/toolbar/add.phtml +++ b/app/design/adminhtml/default/default/template/catalog/product/attribute/set/toolbar/add.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/catalog/product/attribute/set/toolbar/main.phtml b/app/design/adminhtml/default/default/template/catalog/product/attribute/set/toolbar/main.phtml index f441969008..a8d0cc85ef 100644 --- a/app/design/adminhtml/default/default/template/catalog/product/attribute/set/toolbar/main.phtml +++ b/app/design/adminhtml/default/default/template/catalog/product/attribute/set/toolbar/main.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/catalog/product/composite/configure.phtml b/app/design/adminhtml/default/default/template/catalog/product/composite/configure.phtml index 10db89f251..5592e46854 100644 --- a/app/design/adminhtml/default/default/template/catalog/product/composite/configure.phtml +++ b/app/design/adminhtml/default/default/template/catalog/product/composite/configure.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -39,8 +39,8 @@
    - - + +
    diff --git a/app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/configurable.phtml b/app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/configurable.phtml index a3c805a84d..70e9239c5e 100644 --- a/app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/configurable.phtml +++ b/app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/configurable.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -28,7 +28,8 @@ getProduct(); ?> decorateArray($this->getAllowAttributes()); ?> -isSaleable() && count($_attributes)):?> +getSkipSaleableCheck(); ?> +isSaleable() || $_skipSaleableCheck) && count($_attributes)):?>

    __('Associated Products') ?>

    diff --git a/app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/grouped.phtml b/app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/grouped.phtml index 838da270e8..216436ae26 100644 --- a/app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/grouped.phtml +++ b/app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/grouped.phtml @@ -20,12 +20,13 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> - + +getSkipSaleableCheck(); ?>

    __('Associated Products') ?>

    @@ -33,7 +34,7 @@ setPreconfiguredValue(); ?> getAssociatedProducts(); ?> 0; ?> - isAvailable() || !$_hasAssociatedProducts): ?> + isAvailable() && !$_skipSaleableCheck) || !$_hasAssociatedProducts): ?>

    __('Availability:') ?> __('Out of stock') ?>

    @@ -50,7 +51,7 @@ getCanShowProductPrice($_product)): ?> - isSaleable()): ?> + isSaleable() || $_skipSaleableCheck): ?> @@ -62,8 +63,8 @@ helper('tax')->getPrice($_item, $_item->getFinalPrice(), true) ?> - - + + getCanShowProductPrice($_product)): ?> - isSaleable()): ?> + isSaleable() || $_skipSaleableCheck): ?> - + diff --git a/app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options.phtml b/app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options.phtml index 23f32a90ef..51f09f7698 100644 --- a/app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options.phtml +++ b/app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options/js.phtml b/app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options/js.phtml index d5d6361a36..30f453aa28 100644 --- a/app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options/js.phtml +++ b/app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options/js.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options/type/date.phtml b/app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options/type/date.phtml index 15f2f2c65a..85982c5253 100644 --- a/app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options/type/date.phtml +++ b/app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options/type/date.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options/type/default.phtml b/app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options/type/default.phtml index 8337938533..df324cd804 100644 --- a/app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options/type/default.phtml +++ b/app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options/type/default.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options/type/file.phtml b/app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options/type/file.phtml index 8bf3b9cc67..af12f08394 100644 --- a/app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options/type/file.phtml +++ b/app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options/type/file.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options/type/select.phtml b/app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options/type/select.phtml index c22d95f248..909ab44c61 100644 --- a/app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options/type/select.phtml +++ b/app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options/type/select.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options/type/text.phtml b/app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options/type/text.phtml index 2cfdcb4117..07b5dc641c 100644 --- a/app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options/type/text.phtml +++ b/app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options/type/text.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/qty.phtml b/app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/qty.phtml index 21615723eb..4d90e14aff 100644 --- a/app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/qty.phtml +++ b/app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/qty.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/catalog/product/created.phtml b/app/design/adminhtml/default/default/template/catalog/product/created.phtml index 7f5cd5e680..0306b20a29 100644 --- a/app/design/adminhtml/default/default/template/catalog/product/created.phtml +++ b/app/design/adminhtml/default/default/template/catalog/product/created.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/catalog/product/edit.phtml b/app/design/adminhtml/default/default/template/catalog/product/edit.phtml index c1deda643d..2d28e7c5b3 100644 --- a/app/design/adminhtml/default/default/template/catalog/product/edit.phtml +++ b/app/design/adminhtml/default/default/template/catalog/product/edit.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/catalog/product/edit/action/attribute.phtml b/app/design/adminhtml/default/default/template/catalog/product/edit/action/attribute.phtml index 9884f9373b..09c3b1ab3c 100644 --- a/app/design/adminhtml/default/default/template/catalog/product/edit/action/attribute.phtml +++ b/app/design/adminhtml/default/default/template/catalog/product/edit/action/attribute.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/catalog/product/edit/action/inventory.phtml b/app/design/adminhtml/default/default/template/catalog/product/edit/action/inventory.phtml index 768e6b28b9..8e1eaf8a9f 100644 --- a/app/design/adminhtml/default/default/template/catalog/product/edit/action/inventory.phtml +++ b/app/design/adminhtml/default/default/template/catalog/product/edit/action/inventory.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/catalog/product/edit/action/websites.phtml b/app/design/adminhtml/default/default/template/catalog/product/edit/action/websites.phtml index 55b852f27e..cbf06e8a68 100644 --- a/app/design/adminhtml/default/default/template/catalog/product/edit/action/websites.phtml +++ b/app/design/adminhtml/default/default/template/catalog/product/edit/action/websites.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/catalog/product/edit/categories.phtml b/app/design/adminhtml/default/default/template/catalog/product/edit/categories.phtml index 9c3a17048e..4840c09ceb 100644 --- a/app/design/adminhtml/default/default/template/catalog/product/edit/categories.phtml +++ b/app/design/adminhtml/default/default/template/catalog/product/edit/categories.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/catalog/product/edit/options.phtml b/app/design/adminhtml/default/default/template/catalog/product/edit/options.phtml index 208a28b038..5a3f70b424 100644 --- a/app/design/adminhtml/default/default/template/catalog/product/edit/options.phtml +++ b/app/design/adminhtml/default/default/template/catalog/product/edit/options.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/catalog/product/edit/options/option.phtml b/app/design/adminhtml/default/default/template/catalog/product/edit/options/option.phtml index a1280547a2..1aa6091d10 100644 --- a/app/design/adminhtml/default/default/template/catalog/product/edit/options/option.phtml +++ b/app/design/adminhtml/default/default/template/catalog/product/edit/options/option.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -330,7 +330,7 @@ if($('getAddButtonId() ?>')){ //validation for selected input type Validation.addAllThese([ - ['required-option-select', '__('Select type of option') ?>', function(v, elm) { + ['required-option-select', helper('core')->jsonEncode(Mage::helper('catalog')->__('Select type of option')) ?>, function(v, elm) { if (elm.getValue() == '') { return false; } diff --git a/app/design/adminhtml/default/default/template/catalog/product/edit/options/type/date.phtml b/app/design/adminhtml/default/default/template/catalog/product/edit/options/type/date.phtml index 06a286dca2..0ac9d9b25e 100644 --- a/app/design/adminhtml/default/default/template/catalog/product/edit/options/type/date.phtml +++ b/app/design/adminhtml/default/default/template/catalog/product/edit/options/type/date.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -36,7 +36,7 @@ OptionTemplateDate = '
    __('Price') ?> __('Qty') ?>
    getId() ?>htmlEscape($_item->getSku()) ?>htmlEscape($_item->getName()) ?>escapeHtml($_item->getSku()) ?>escapeHtml($_item->getName()) ?> getCanShowProductPrice($_item)): ?> @@ -71,9 +72,9 @@ - isSaleable()) : ?> + isSaleable() || $_skipSaleableCheck) : ?> @@ -85,7 +86,7 @@
    __('No options of this product are available.') ?>__('No options of this product are available.') ?>
    '+ ''+ ''+ getCanReadPrice() !== false) : ?> - '' + + '' + '' + '' + diff --git a/app/design/adminhtml/default/default/template/catalog/product/edit/options/type/file.phtml b/app/design/adminhtml/default/default/template/catalog/product/edit/options/type/file.phtml index 05c0e499b1..1b56d899e0 100644 --- a/app/design/adminhtml/default/default/template/catalog/product/edit/options/type/file.phtml +++ b/app/design/adminhtml/default/default/template/catalog/product/edit/options/type/file.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -29,24 +29,28 @@ OptionTemplateFile = '
    getCanEditPrice() === false) : ?> disabled="disabled">getCanEditPrice() === false) : ?> disabled="disabled">getPriceTypeSelectHtml() ?>{{checkboxScopePrice}}
    '+ ''+ getCanReadPrice() !== false) : ?> - '' + - '' + + '' + + '' + - ''+ - ''+ - ''+ - ''+ - ''+ + '' + + ''+ + '' + + '' + + '' + getCanReadPrice() !== false) : ?> '' + - '' + + '' + '' + '' + - ''+ - ''+ - ''+ + '' + + '' + + '' + ''+ '
    __('Price') ?>__('Price Type') ?>' + helper('core')->jsonEncode(Mage::helper('catalog')->__('Price')); ?> + '' + helper('core')->jsonEncode(Mage::helper('catalog')->__('Price Type')); ?> + '__('SKU') ?>__('Allowed File Extensions') ?>__('Maximum Image Size') ?>
    ' + helper('core')->jsonEncode(Mage::helper('catalog')->__('SKU')); ?> + '' + helper('core')->jsonEncode(Mage::helper('catalog')->__('Allowed File Extensions')); ?> + '' + helper('core')->jsonEncode(Mage::helper('catalog')->__('Maximum Image Size')); ?> + '
    getCanEditPrice() === false) : ?> disabled="disabled">getPriceTypeSelectHtml() ?>' + helper('core')->jsonEncode($this->getPriceTypeSelectHtml()) ?> + ' __('x') ?> __('px.') ?>
    __('leave blank if its not an image') ?>
    ' + + helper('core')->jsonEncode(Mage::helper('catalog')->__('x')) ?> + + '' + + helper('core')->jsonEncode(Mage::helper('catalog')->__('px.')) ?> + + '
    ' + helper('core')->jsonEncode(Mage::helper('catalog')->__('leave blank if its not an image')) ?> + '
    '; diff --git a/app/design/adminhtml/default/default/template/catalog/product/edit/options/type/select.phtml b/app/design/adminhtml/default/default/template/catalog/product/edit/options/type/select.phtml index acb16f8bd5..87bb684099 100644 --- a/app/design/adminhtml/default/default/template/catalog/product/edit/options/type/select.phtml +++ b/app/design/adminhtml/default/default/template/catalog/product/edit/options/type/select.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -153,7 +153,7 @@ if ($('option_panel_type_select')) { selectOptionType.bindRemoveButtons(); Validation.addAllThese([ - ['required-option-select-type-rows', '__('Please add rows to option.') ?>', function(v, elm) { + ['required-option-select-type-rows', helper('core')->jsonEncode(Mage::helper('catalog')->__('Please add rows to option.')); ?>, function(v, elm) { var optionContainerElm = elm.up('div.grid'); var selectTypesFlag = false; selectTypeElements = $$('#'+optionContainerElm.id+' .select-type-title'); diff --git a/app/design/adminhtml/default/default/template/catalog/product/edit/options/type/text.phtml b/app/design/adminhtml/default/default/template/catalog/product/edit/options/type/text.phtml index 192949a7d6..524c8208d9 100644 --- a/app/design/adminhtml/default/default/template/catalog/product/edit/options/type/text.phtml +++ b/app/design/adminhtml/default/default/template/catalog/product/edit/options/type/text.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/catalog/product/edit/price/group.phtml b/app/design/adminhtml/default/default/template/catalog/product/edit/price/group.phtml index 38a353cda7..d736b928fb 100644 --- a/app/design/adminhtml/default/default/template/catalog/product/edit/price/group.phtml +++ b/app/design/adminhtml/default/default/template/catalog/product/edit/price/group.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -30,7 +30,7 @@ $_htmlId = $this->getElement()->getHtmlId(); $_htmlClass = $this->getElement()->getClass(); $_htmlName = $this->getElement()->getName(); $_readonly = $this->getElement()->getReadonly(); -$_priceValueValidation = $this->getPriceValidation('validate-greater-than-zero'); +$_priceValueValidation = $this->getPriceValidation('validate-zero-or-greater'); $_showWebsite= $this->isMultiWebsites(); ?> diff --git a/app/design/adminhtml/default/default/template/catalog/product/edit/price/tier.phtml b/app/design/adminhtml/default/default/template/catalog/product/edit/price/tier.phtml index 877844d540..23a7fcdbf7 100644 --- a/app/design/adminhtml/default/default/template/catalog/product/edit/price/tier.phtml +++ b/app/design/adminhtml/default/default/template/catalog/product/edit/price/tier.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* @var $this Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Price_Tier */ @@ -84,7 +84,7 @@ var tierPriceRowTemplate = '
    ' + '
    - getStoreCollection($_group) as $_store): ?> - - - - +
    + getHintHtml() ?> +
    + getWebsiteCollection() as $_website): ?> +
    + isReadonly()):?> disabled="disabled" class="checkbox website-checkbox" id="product_website_getId() ?>" type="checkbox"hasWebsite($_website->getId())): ?> checked="checked" /> + +
    +
    + getGroupCollection($_website) as $_group): ?> +

    escapeHtml($_group->getName()) ?>

    +
    +
    escapeHtml($_store->getName()) ?> - getWebsites() && !$this->hasWebsite($_website->getId())): ?> - - -
    + getStoreCollection($_group) as $_store): ?> + + + + + +
    escapeHtml($_store->getName()) ?> + getWebsites() && !$this->hasWebsite($_website->getId())): ?> + + +
    +
    -
    - + - diff --git a/app/design/adminhtml/default/default/template/catalog/product/widget/chooser/container.phtml b/app/design/adminhtml/default/default/template/catalog/product/widget/chooser/container.phtml index beaccd822d..89af4ea1bb 100644 --- a/app/design/adminhtml/default/default/template/catalog/product/widget/chooser/container.phtml +++ b/app/design/adminhtml/default/default/template/catalog/product/widget/chooser/container.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/catalog/wysiwyg/js.phtml b/app/design/adminhtml/default/default/template/catalog/wysiwyg/js.phtml index 926b55367d..96c56085bb 100644 --- a/app/design/adminhtml/default/default/template/catalog/wysiwyg/js.phtml +++ b/app/design/adminhtml/default/default/template/catalog/wysiwyg/js.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/centinel/authentication/complete.phtml b/app/design/adminhtml/default/default/template/centinel/authentication/complete.phtml index c7eaa698bc..a1d5041761 100644 --- a/app/design/adminhtml/default/default/template/centinel/authentication/complete.phtml +++ b/app/design/adminhtml/default/default/template/centinel/authentication/complete.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/centinel/authentication/start.phtml b/app/design/adminhtml/default/default/template/centinel/authentication/start.phtml index 7d57ed85cb..11b2d86acf 100644 --- a/app/design/adminhtml/default/default/template/centinel/authentication/start.phtml +++ b/app/design/adminhtml/default/default/template/centinel/authentication/start.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/centinel/validation/form.phtml b/app/design/adminhtml/default/default/template/centinel/validation/form.phtml index f572a48bf4..afa509dd3f 100644 --- a/app/design/adminhtml/default/default/template/centinel/validation/form.phtml +++ b/app/design/adminhtml/default/default/template/centinel/validation/form.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -29,7 +29,7 @@ - + + diff --git a/app/design/adminhtml/default/default/template/customer/edit/js.phtml b/app/design/adminhtml/default/default/template/customer/edit/js.phtml index 90a187665f..24e7c31dc6 100644 --- a/app/design/adminhtml/default/default/template/customer/edit/js.phtml +++ b/app/design/adminhtml/default/default/template/customer/edit/js.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/customer/edit/tab/account/form/renderer/group.phtml b/app/design/adminhtml/default/default/template/customer/edit/tab/account/form/renderer/group.phtml index f3c877ed0b..36684c8912 100644 --- a/app/design/adminhtml/default/default/template/customer/edit/tab/account/form/renderer/group.phtml +++ b/app/design/adminhtml/default/default/template/customer/edit/tab/account/form/renderer/group.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/customer/edit/tab/view/grid/item.phtml b/app/design/adminhtml/default/default/template/customer/edit/tab/view/grid/item.phtml index 7fce785e0d..7dab73d693 100644 --- a/app/design/adminhtml/default/default/template/customer/edit/tab/view/grid/item.phtml +++ b/app/design/adminhtml/default/default/template/customer/edit/tab/view/grid/item.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/customer/online.phtml b/app/design/adminhtml/default/default/template/customer/online.phtml index 3f54eccf21..77e535a7ad 100644 --- a/app/design/adminhtml/default/default/template/customer/online.phtml +++ b/app/design/adminhtml/default/default/template/customer/online.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/customer/sales/order/create/billing/form/renderer/vat.phtml b/app/design/adminhtml/default/default/template/customer/sales/order/create/address/form/renderer/vat.phtml similarity index 72% rename from app/design/adminhtml/default/default/template/customer/sales/order/create/billing/form/renderer/vat.phtml rename to app/design/adminhtml/default/default/template/customer/sales/order/create/address/form/renderer/vat.phtml index d133d352cb..89299ce938 100644 --- a/app/design/adminhtml/default/default/template/customer/sales/order/create/billing/form/renderer/vat.phtml +++ b/app/design/adminhtml/default/default/template/customer/sales/order/create/address/form/renderer/vat.phtml @@ -20,28 +20,28 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> getElement(); -$_note = $_element->getNote(); -$_trId = $_element->getHtmlContainerId(); -$_class = $_element->getFieldsetHtmlClass(); +$_note = $_element->getNote(); +$_trId = $_element->getHtmlContainerId(); +$_class = $_element->getFieldsetHtmlClass(); $_validateButton = $this->getValidateButton(); ?> getNoDisplay()): ?> - id=""> + id=""> getType()=='hidden'): ?> -
    ">getLabelHtml()) ?>"> - getElementHtml()) ?> + ">getLabelHtml()); ?>"> + getElementHtml()); ?> -

    " id="note_getId()?>">

    - +

    " id="note_getId(); ?>">

    +
    toHtml(); ?>
    diff --git a/app/design/adminhtml/default/default/template/customer/system/config/validatevat.phtml b/app/design/adminhtml/default/default/template/customer/system/config/validatevat.phtml index bb950c7cae..f31b51554e 100644 --- a/app/design/adminhtml/default/default/template/customer/system/config/validatevat.phtml +++ b/app/design/adminhtml/default/default/template/customer/system/config/validatevat.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/customer/tab/addresses.phtml b/app/design/adminhtml/default/default/template/customer/tab/addresses.phtml index 5ef8ccc96f..6cd1b699e8 100644 --- a/app/design/adminhtml/default/default/template/customer/tab/addresses.phtml +++ b/app/design/adminhtml/default/default/template/customer/tab/addresses.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -146,6 +146,8 @@ addressesModel.prototype = { this.loader = new varienLoader(true); this.regionsUrl = 'getRegionsUrl() ?>'; + this.requiredStateForCountries = helper('directory')->getCountriesWithStatesRequired(true) ?>; + this.showAllRegions = helper('directory')->getShowNonRequiredState() ? 1 : 0; ?>; this.reloadItemList(1); @@ -206,7 +208,10 @@ addressesModel.prototype = { if($('no_address_message')){ $('no_address_message').hide(); } - + // preventing duplication of ids for fields and blocks + while ($$("div[id='form_address_item_" + this.itemCount + "']").length) { + this.itemCount++; + } // create new form elements Element.insert(this.formContainer, {bottom: '
    ' @@ -330,6 +335,16 @@ addressesModel.prototype = { //new Effect.Appear($('form_'+item.id), {duration : 0.3 }); //$('form_'+item.id).focus(); this.addFieldChangeObserver($('form_'+item.id)); + var regionIdElement = $('_item' + item.id.replace(/address_item_/, '') + 'region_id'); + var regionElement = $('_item' + item.id.replace(/address_item_/, '') + 'region'); + this.countryEl = $('_item' + item.id.replace(/address_item_/, '') + 'country_id'); + if (regionIdElement && regionElement) { + var actualId = regionElement.id; + if (('select' == regionIdElement.tagName.toLowerCase()) && regionIdElement) { + actualId = regionIdElement.id; + } + this._checkRegionRequired([regionIdElement, regionElement], actualId); + } } this.activeItem = item; @@ -480,6 +495,7 @@ addressesModel.prototype = { var regionElement = $(countryElement.id.replace(/country_id/, 'region')); if(regionElement){ this.regionElement = regionElement; + this.countryEl = countryElement; if (countryElement.value) { var url = this.regionsUrl + 'parent/' + countryElement.value; this.loader.load(url, {}, this.refreshRegionField.bind(this)); @@ -553,6 +569,61 @@ addressesModel.prototype = { var newInput = $(newInputId); Event.observe(newInput, 'change', this.onItemFormFieldChange); // Restore observing to update address info this.syncFormData(newInput); // Update address info now + var activeElementId = regionHtmlId; + if (('select' == $(regionIdHtmlId).tagName.toLowerCase()) && regionIdHtmlId) { + activeElementId = regionIdHtmlId; + } + this._checkRegionRequired([$(regionHtmlId), $(regionIdHtmlId)], activeElementId); + }, + + _checkRegionRequired: function(elements, activeElementId) + { + var label, wildCard; + var that = this; + var regionRequired = this.requiredStateForCountries.indexOf(this.countryEl.value) >= 0; + + elements.each(function(currentElement) { + Validation.reset(currentElement); + label = $$('label[for="' + currentElement.id + '"]')[0]; + if (label) { + wildCard = label.down('em') || label.down('span.required'); + if (!that.showAllRegions) { + if (regionRequired) { + label.up('tr').show(); + } else { + label.up('tr').hide(); + } + } + } + + if (label && wildCard) { + if (!regionRequired) { + wildCard.hide(); + } else { + wildCard.show(); + } + } + + if (!regionRequired) { + if (currentElement.hasClassName('required-entry')) { + currentElement.removeClassName('required-entry'); + } + if ('select' == currentElement.tagName.toLowerCase() && + currentElement.hasClassName('validate-select') + ) { + currentElement.removeClassName('validate-select'); + } + } else if (activeElementId == currentElement.id) { + if (!currentElement.hasClassName('required-entry')) { + currentElement.addClassName('required-entry'); + } + if ('select' == currentElement.tagName.toLowerCase() && + !currentElement.hasClassName('validate-select') + ) { + currentElement.addClassName('validate-select'); + } + } + }); } } diff --git a/app/design/adminhtml/default/default/template/customer/tab/cart.phtml b/app/design/adminhtml/default/default/template/customer/tab/cart.phtml index 6bde7d40df..b27f73853f 100644 --- a/app/design/adminhtml/default/default/template/customer/tab/cart.phtml +++ b/app/design/adminhtml/default/default/template/customer/tab/cart.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/customer/tab/newsletter.phtml b/app/design/adminhtml/default/default/template/customer/tab/newsletter.phtml index 1e3ddc990e..fa2b24de4b 100644 --- a/app/design/adminhtml/default/default/template/customer/tab/newsletter.phtml +++ b/app/design/adminhtml/default/default/template/customer/tab/newsletter.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/customer/tab/view.phtml b/app/design/adminhtml/default/default/template/customer/tab/view.phtml index dc22466d85..5c2701a3ef 100644 --- a/app/design/adminhtml/default/default/template/customer/tab/view.phtml +++ b/app/design/adminhtml/default/default/template/customer/tab/view.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/customer/tab/view/sales.phtml b/app/design/adminhtml/default/default/template/customer/tab/view/sales.phtml index c35ab690b1..30d51f63ef 100644 --- a/app/design/adminhtml/default/default/template/customer/tab/view/sales.phtml +++ b/app/design/adminhtml/default/default/template/customer/tab/view/sales.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/customer/tab/wishlist.phtml b/app/design/adminhtml/default/default/template/customer/tab/wishlist.phtml index 57e4a6e0c6..663a772ea0 100644 --- a/app/design/adminhtml/default/default/template/customer/tab/wishlist.phtml +++ b/app/design/adminhtml/default/default/template/customer/tab/wishlist.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/dashboard/graph.phtml b/app/design/adminhtml/default/default/template/dashboard/graph.phtml index 4382550c3e..11a8f3efee 100644 --- a/app/design/adminhtml/default/default/template/dashboard/graph.phtml +++ b/app/design/adminhtml/default/default/template/dashboard/graph.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* diff --git a/app/design/adminhtml/default/default/template/dashboard/graph/disabled.phtml b/app/design/adminhtml/default/default/template/dashboard/graph/disabled.phtml index b5ca4cf6f0..fe3b4667af 100644 --- a/app/design/adminhtml/default/default/template/dashboard/graph/disabled.phtml +++ b/app/design/adminhtml/default/default/template/dashboard/graph/disabled.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/dashboard/grid.phtml b/app/design/adminhtml/default/default/template/dashboard/grid.phtml index 8f8b526d71..c334ca2459 100644 --- a/app/design/adminhtml/default/default/template/dashboard/grid.phtml +++ b/app/design/adminhtml/default/default/template/dashboard/grid.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/dashboard/index.phtml b/app/design/adminhtml/default/default/template/dashboard/index.phtml index 588504bd14..1f302d5e2c 100644 --- a/app/design/adminhtml/default/default/template/dashboard/index.phtml +++ b/app/design/adminhtml/default/default/template/dashboard/index.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/dashboard/salebar.phtml b/app/design/adminhtml/default/default/template/dashboard/salebar.phtml index ca849d1ec2..c41191acae 100644 --- a/app/design/adminhtml/default/default/template/dashboard/salebar.phtml +++ b/app/design/adminhtml/default/default/template/dashboard/salebar.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/dashboard/searches.phtml b/app/design/adminhtml/default/default/template/dashboard/searches.phtml index 02928d0534..46fd023001 100644 --- a/app/design/adminhtml/default/default/template/dashboard/searches.phtml +++ b/app/design/adminhtml/default/default/template/dashboard/searches.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/dashboard/store/switcher.phtml b/app/design/adminhtml/default/default/template/dashboard/store/switcher.phtml index 52c1d4daeb..d991bd23a4 100644 --- a/app/design/adminhtml/default/default/template/dashboard/store/switcher.phtml +++ b/app/design/adminhtml/default/default/template/dashboard/store/switcher.phtml @@ -20,11 +20,12 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> -

    +

    +getHintHtml() ?>

    '+ - ''+ + ''+ '
    '+ - ''+ + ''+ '
    @@ -89,7 +92,7 @@ trackingControl = { diff --git a/app/design/adminhtml/default/default/template/sales/order/invoice/view/form.phtml b/app/design/adminhtml/default/default/template/sales/order/invoice/view/form.phtml index 9907196626..417e0a1a36 100644 --- a/app/design/adminhtml/default/default/template/sales/order/invoice/view/form.phtml +++ b/app/design/adminhtml/default/default/template/sales/order/invoice/view/form.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/sales/order/invoice/view/items.phtml b/app/design/adminhtml/default/default/template/sales/order/invoice/view/items.phtml index 43fc351d7f..e481068c1f 100644 --- a/app/design/adminhtml/default/default/template/sales/order/invoice/view/items.phtml +++ b/app/design/adminhtml/default/default/template/sales/order/invoice/view/items.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/sales/order/invoice/view/items/renderer/configurable.phtml b/app/design/adminhtml/default/default/template/sales/order/invoice/view/items/renderer/configurable.phtml index 8fa65f7052..80fa4b2d6d 100644 --- a/app/design/adminhtml/default/default/template/sales/order/invoice/view/items/renderer/configurable.phtml +++ b/app/design/adminhtml/default/default/template/sales/order/invoice/view/items/renderer/configurable.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -227,7 +227,6 @@ - diff --git a/app/design/adminhtml/default/default/template/sales/order/invoice/view/items/renderer/default.phtml b/app/design/adminhtml/default/default/template/sales/order/invoice/view/items/renderer/default.phtml index 57e9087b55..eb40057808 100644 --- a/app/design/adminhtml/default/default/template/sales/order/invoice/view/items/renderer/default.phtml +++ b/app/design/adminhtml/default/default/template/sales/order/invoice/view/items/renderer/default.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -221,7 +221,6 @@ - diff --git a/app/design/adminhtml/default/default/template/sales/order/shipment/create/form.phtml b/app/design/adminhtml/default/default/template/sales/order/shipment/create/form.phtml index c0e1a1b995..df21370ec7 100644 --- a/app/design/adminhtml/default/default/template/sales/order/shipment/create/form.phtml +++ b/app/design/adminhtml/default/default/template/sales/order/shipment/create/form.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/sales/order/shipment/create/items.phtml b/app/design/adminhtml/default/default/template/sales/order/shipment/create/items.phtml index 2d38348d41..38478943a0 100644 --- a/app/design/adminhtml/default/default/template/sales/order/shipment/create/items.phtml +++ b/app/design/adminhtml/default/default/template/sales/order/shipment/create/items.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/sales/order/shipment/create/items/renderer/configurable.phtml b/app/design/adminhtml/default/default/template/sales/order/shipment/create/items/renderer/configurable.phtml index 1cc67f2a09..cca9e03bf9 100644 --- a/app/design/adminhtml/default/default/template/sales/order/shipment/create/items/renderer/configurable.phtml +++ b/app/design/adminhtml/default/default/template/sales/order/shipment/create/items/renderer/configurable.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/sales/order/shipment/create/items/renderer/default.phtml b/app/design/adminhtml/default/default/template/sales/order/shipment/create/items/renderer/default.phtml index d735fc08df..e1861670e1 100644 --- a/app/design/adminhtml/default/default/template/sales/order/shipment/create/items/renderer/default.phtml +++ b/app/design/adminhtml/default/default/template/sales/order/shipment/create/items/renderer/default.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/sales/order/shipment/create/tracking.phtml b/app/design/adminhtml/default/default/template/sales/order/shipment/create/tracking.phtml index 568eb229ab..9d8e6de589 100644 --- a/app/design/adminhtml/default/default/template/sales/order/shipment/create/tracking.phtml +++ b/app/design/adminhtml/default/default/template/sales/order/shipment/create/tracking.phtml @@ -20,17 +20,14 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> - +
    displayPriceAttribute('tax_amount') ?> displayPriceAttribute('discount_amount') ?> displayPriceAttribute('tax_amount') ?> displayPriceAttribute('discount_amount') ?>
    @@ -94,7 +92,7 @@ trackingControl = { diff --git a/app/design/adminhtml/default/default/template/sales/order/shipment/packaging/grid.phtml b/app/design/adminhtml/default/default/template/sales/order/shipment/packaging/grid.phtml index 4781cad987..4c3ba8174d 100644 --- a/app/design/adminhtml/default/default/template/sales/order/shipment/packaging/grid.phtml +++ b/app/design/adminhtml/default/default/template/sales/order/shipment/packaging/grid.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -81,7 +81,7 @@   diff --git a/app/design/adminhtml/default/default/template/sales/order/shipment/packaging/packed.phtml b/app/design/adminhtml/default/default/template/sales/order/shipment/packaging/packed.phtml index 1f94a6efcc..48bb7eadf9 100644 --- a/app/design/adminhtml/default/default/template/sales/order/shipment/packaging/packed.phtml +++ b/app/design/adminhtml/default/default/template/sales/order/shipment/packaging/packed.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -69,7 +69,7 @@ displayCustomsValue()): ?> - + @@ -85,7 +85,7 @@ getContentType() != null): ?> getContentType() == 'OTHER'): ?> - + @@ -170,7 +170,7 @@ getWeight(); ?> displayCustomsValue()): ?> - + @@ -198,7 +198,7 @@ document.observe("dom:loaded", function() {
    diff --git a/app/design/adminhtml/default/default/template/sales/order/shipment/tracking/info.phtml b/app/design/adminhtml/default/default/template/sales/order/shipment/tracking/info.phtml index d4df9d10c9..e134686dba 100644 --- a/app/design/adminhtml/default/default/template/sales/order/shipment/tracking/info.phtml +++ b/app/design/adminhtml/default/default/template/sales/order/shipment/tracking/info.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/sales/order/shipment/view/form.phtml b/app/design/adminhtml/default/default/template/sales/order/shipment/view/form.phtml index 40537f9ab3..43ceb73c4c 100644 --- a/app/design/adminhtml/default/default/template/sales/order/shipment/view/form.phtml +++ b/app/design/adminhtml/default/default/template/sales/order/shipment/view/form.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/sales/order/shipment/view/items.phtml b/app/design/adminhtml/default/default/template/sales/order/shipment/view/items.phtml index 226f7a7c6f..9ccb5fd0d2 100644 --- a/app/design/adminhtml/default/default/template/sales/order/shipment/view/items.phtml +++ b/app/design/adminhtml/default/default/template/sales/order/shipment/view/items.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/sales/order/shipment/view/items/renderer/configurable.phtml b/app/design/adminhtml/default/default/template/sales/order/shipment/view/items/renderer/configurable.phtml index 372700c126..5bdf2a91a6 100644 --- a/app/design/adminhtml/default/default/template/sales/order/shipment/view/items/renderer/configurable.phtml +++ b/app/design/adminhtml/default/default/template/sales/order/shipment/view/items/renderer/configurable.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/sales/order/shipment/view/items/renderer/default.phtml b/app/design/adminhtml/default/default/template/sales/order/shipment/view/items/renderer/default.phtml index 148d0f69d7..5b5e0f62aa 100644 --- a/app/design/adminhtml/default/default/template/sales/order/shipment/view/items/renderer/default.phtml +++ b/app/design/adminhtml/default/default/template/sales/order/shipment/view/items/renderer/default.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/sales/order/shipment/view/tracking.phtml b/app/design/adminhtml/default/default/template/sales/order/shipment/view/tracking.phtml index e06a029c06..91380cc43b 100644 --- a/app/design/adminhtml/default/default/template/sales/order/shipment/view/tracking.phtml +++ b/app/design/adminhtml/default/default/template/sales/order/shipment/view/tracking.phtml @@ -20,10 +20,11 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> +
    __('Customs Value') ?>displayPrice($params->getCustomsValue()) ?>displayCustomsPrice($params->getCustomsValue()) ?> __('Total Weight') ?> getWeight() .' '. Mage::helper('usa')->getMeasureWeightName($params->getWeightUnits()) ?>__('Contents') ?> getContentTypeOther() ?>escapeHtml($params->getContentTypeOther()) ?> getContentTypeByCode($params->getContentType()) ?> displayPrice($item->getCustomsValue()) ?>displayCustomsPrice($item->getCustomsValue()) ?> getQtyOrderedItem($item->getOrderItemId()); ?> @@ -190,7 +190,7 @@
    getPrintButton() ?>
    diff --git a/app/design/adminhtml/default/default/template/sales/order/shipment/packaging/popup.phtml b/app/design/adminhtml/default/default/template/sales/order/shipment/packaging/popup.phtml index aacd90daba..7c4bfd1500 100644 --- a/app/design/adminhtml/default/default/template/sales/order/shipment/packaging/popup.phtml +++ b/app/design/adminhtml/default/default/template/sales/order/shipment/packaging/popup.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -46,7 +46,7 @@ document.observe("dom:loaded", function() {

    __('Create Packages') ?>

    @@ -156,12 +156,12 @@ document.observe("dom:loaded", function() {
    @@ -43,7 +44,7 @@ @@ -56,7 +57,7 @@ - +
    getCarrierTitle($_track->getCarrierCode()) ?>escapeHtml($this->getCarrierTitle($_track->getCarrierCode())) ?> escapeHtml($_track->getTitle()) ?> isCustom()): ?> @@ -74,14 +75,10 @@
    diff --git a/app/design/adminhtml/default/default/template/sales/order/totalbar.phtml b/app/design/adminhtml/default/default/template/sales/order/totalbar.phtml index cae1e44e9a..81448cb2a2 100644 --- a/app/design/adminhtml/default/default/template/sales/order/totalbar.phtml +++ b/app/design/adminhtml/default/default/template/sales/order/totalbar.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/sales/order/totals.phtml b/app/design/adminhtml/default/default/template/sales/order/totals.phtml index d139701bcc..536e9aa713 100644 --- a/app/design/adminhtml/default/default/template/sales/order/totals.phtml +++ b/app/design/adminhtml/default/default/template/sales/order/totals.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -35,52 +35,52 @@ - getTotals('')?> + getTotals('footer')?> - - $_total): ?> + + getTotals('footer') as $_code => $_total): ?> getBlockName()): ?> getChildHtml($_total->getBlockName(), false); ?> - getStrong()):?> - + - getTotals('footer')?> + getTotals('')?> - - getTotals('footer') as $_code => $_total): ?> + + $_total): ?> getBlockName()): ?> getChildHtml($_total->getBlockName(), false); ?> + getStrong()):?> - +
    getLabelProperties()?> class="label"> - getStrong()):?> escapeHtml($_total->getLabel()); ?> - - escapeHtml($_total->getLabel()); ?> - getValueProperties()?> class="emph"> formatValue($_total) ?> - - getValueProperties()?>> - formatValue($_total) ?> -
    getLabelProperties()?> class="label"> + getStrong()):?> escapeHtml($_total->getLabel()); ?> + + escapeHtml($_total->getLabel()); ?> + getValueProperties()?> class="emph"> formatValue($_total) ?> + + getValueProperties()?>> + formatValue($_total) ?> +
    diff --git a/app/design/adminhtml/default/default/template/sales/order/totals/discount.phtml b/app/design/adminhtml/default/default/template/sales/order/totals/discount.phtml index 62372133f6..76293f1735 100644 --- a/app/design/adminhtml/default/default/template/sales/order/totals/discount.phtml +++ b/app/design/adminhtml/default/default/template/sales/order/totals/discount.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/sales/order/totals/due.phtml b/app/design/adminhtml/default/default/template/sales/order/totals/due.phtml index 78c2244930..10e1d07c50 100644 --- a/app/design/adminhtml/default/default/template/sales/order/totals/due.phtml +++ b/app/design/adminhtml/default/default/template/sales/order/totals/due.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/sales/order/totals/footer.phtml b/app/design/adminhtml/default/default/template/sales/order/totals/footer.phtml index bf027e603a..5618bbe5b7 100644 --- a/app/design/adminhtml/default/default/template/sales/order/totals/footer.phtml +++ b/app/design/adminhtml/default/default/template/sales/order/totals/footer.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/sales/order/totals/grand.phtml b/app/design/adminhtml/default/default/template/sales/order/totals/grand.phtml index d47126c9d2..9dde7bcd34 100644 --- a/app/design/adminhtml/default/default/template/sales/order/totals/grand.phtml +++ b/app/design/adminhtml/default/default/template/sales/order/totals/grand.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/sales/order/totals/item.phtml b/app/design/adminhtml/default/default/template/sales/order/totals/item.phtml index de35649b9a..055f73bd14 100644 --- a/app/design/adminhtml/default/default/template/sales/order/totals/item.phtml +++ b/app/design/adminhtml/default/default/template/sales/order/totals/item.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/sales/order/totals/main.phtml b/app/design/adminhtml/default/default/template/sales/order/totals/main.phtml index c85a611c6a..518a2ceecd 100644 --- a/app/design/adminhtml/default/default/template/sales/order/totals/main.phtml +++ b/app/design/adminhtml/default/default/template/sales/order/totals/main.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/sales/order/totals/paid.phtml b/app/design/adminhtml/default/default/template/sales/order/totals/paid.phtml index 91775300f0..22656a0533 100644 --- a/app/design/adminhtml/default/default/template/sales/order/totals/paid.phtml +++ b/app/design/adminhtml/default/default/template/sales/order/totals/paid.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/sales/order/totals/refunded.phtml b/app/design/adminhtml/default/default/template/sales/order/totals/refunded.phtml index 266d2b1fd6..fe84cbb188 100644 --- a/app/design/adminhtml/default/default/template/sales/order/totals/refunded.phtml +++ b/app/design/adminhtml/default/default/template/sales/order/totals/refunded.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/sales/order/totals/shipping.phtml b/app/design/adminhtml/default/default/template/sales/order/totals/shipping.phtml index 293a73d6c6..d651bf5ca9 100644 --- a/app/design/adminhtml/default/default/template/sales/order/totals/shipping.phtml +++ b/app/design/adminhtml/default/default/template/sales/order/totals/shipping.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/sales/order/totals/subtotal.phtml b/app/design/adminhtml/default/default/template/sales/order/totals/subtotal.phtml index b451b7eb08..34ed264933 100644 --- a/app/design/adminhtml/default/default/template/sales/order/totals/subtotal.phtml +++ b/app/design/adminhtml/default/default/template/sales/order/totals/subtotal.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/sales/order/totals/tax.phtml b/app/design/adminhtml/default/default/template/sales/order/totals/tax.phtml index dd43abc3d1..14092573ab 100644 --- a/app/design/adminhtml/default/default/template/sales/order/totals/tax.phtml +++ b/app/design/adminhtml/default/default/template/sales/order/totals/tax.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /** @var $this Mage_Adminhtml_Block_Sales_Order_Totals_Tax */ @@ -73,9 +73,9 @@ $_fullInfo = $this->getFullTaxInfo();
    getRemoteIp(); echo ($_order->getXForwardedFor())?' (' . $_order->getXForwardedFor() . ')':''; ?>
    - +
    - getOrder()->getTrackingNumbers()): ?> - - - - __('Delete') ?>
    - - + getOrder()->getTrackingNumbers(); ?> + + + + __('Delete') ?>
    + + getSaveButtonHtml() ?> @@ -44,4 +45,4 @@
    - + diff --git a/app/design/adminhtml/default/default/template/sales/payment/form/billing/agreement.phtml b/app/design/adminhtml/default/default/template/sales/payment/form/billing/agreement.phtml index 20deed0b7f..1a08f00659 100644 --- a/app/design/adminhtml/default/default/template/sales/payment/form/billing/agreement.phtml +++ b/app/design/adminhtml/default/default/template/sales/payment/form/billing/agreement.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/sales/recurring/profile/view.phtml b/app/design/adminhtml/default/default/template/sales/recurring/profile/view.phtml index 37bdcf1d14..f749b6cc4d 100644 --- a/app/design/adminhtml/default/default/template/sales/recurring/profile/view.phtml +++ b/app/design/adminhtml/default/default/template/sales/recurring/profile/view.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/sales/recurring/profile/view/info.phtml b/app/design/adminhtml/default/default/template/sales/recurring/profile/view/info.phtml index 83ac037063..45585d7dfc 100644 --- a/app/design/adminhtml/default/default/template/sales/recurring/profile/view/info.phtml +++ b/app/design/adminhtml/default/default/template/sales/recurring/profile/view/info.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/sales/transactions/detail.phtml b/app/design/adminhtml/default/default/template/sales/transactions/detail.phtml index ec029946e1..9c6ab7a905 100644 --- a/app/design/adminhtml/default/default/template/sales/transactions/detail.phtml +++ b/app/design/adminhtml/default/default/template/sales/transactions/detail.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/store/switcher.phtml b/app/design/adminhtml/default/default/template/store/switcher.phtml index dd4cfd63d3..ccdcefe9e4 100644 --- a/app/design/adminhtml/default/default/template/store/switcher.phtml +++ b/app/design/adminhtml/default/default/template/store/switcher.phtml @@ -20,30 +20,31 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> + getWebsites()): ?> -

    +

    +getHintHtml() ?>

    diff --git a/app/design/adminhtml/default/default/template/store/switcher/enhanced.phtml b/app/design/adminhtml/default/default/template/store/switcher/enhanced.phtml index 7b30a4e632..70aef2a930 100644 --- a/app/design/adminhtml/default/default/template/store/switcher/enhanced.phtml +++ b/app/design/adminhtml/default/default/template/store/switcher/enhanced.phtml @@ -20,14 +20,14 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> getWebsiteCollection() ?> getSize()): ?>
    -

    +

    +getHintHtml() ?>

    diff --git a/app/design/adminhtml/default/default/template/system/variable/js.phtml b/app/design/adminhtml/default/default/template/system/variable/js.phtml index 8dc7adb279..65f2a32c38 100644 --- a/app/design/adminhtml/default/default/template/system/variable/js.phtml +++ b/app/design/adminhtml/default/default/template/system/variable/js.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/tag/edit/container.phtml b/app/design/adminhtml/default/default/template/tag/edit/container.phtml index 14af436f9f..0d7f20b9d3 100644 --- a/app/design/adminhtml/default/default/template/tag/edit/container.phtml +++ b/app/design/adminhtml/default/default/template/tag/edit/container.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/tag/index.phtml b/app/design/adminhtml/default/default/template/tag/index.phtml index e5c5e79af6..6a64592b2d 100644 --- a/app/design/adminhtml/default/default/template/tag/index.phtml +++ b/app/design/adminhtml/default/default/template/tag/index.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/tax/class/page/edit.phtml b/app/design/adminhtml/default/default/template/tax/class/page/edit.phtml index 23ed082ffd..7a5391e95d 100644 --- a/app/design/adminhtml/default/default/template/tax/class/page/edit.phtml +++ b/app/design/adminhtml/default/default/template/tax/class/page/edit.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/tax/importExport.phtml b/app/design/adminhtml/default/default/template/tax/importExport.phtml index 93e1a1bbbf..1d98aafef5 100644 --- a/app/design/adminhtml/default/default/template/tax/importExport.phtml +++ b/app/design/adminhtml/default/default/template/tax/importExport.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/tax/rate/form.phtml b/app/design/adminhtml/default/default/template/tax/rate/form.phtml index f66424dfb8..4b5c5d5fd7 100644 --- a/app/design/adminhtml/default/default/template/tax/rate/form.phtml +++ b/app/design/adminhtml/default/default/template/tax/rate/form.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/tax/rate/title.phtml b/app/design/adminhtml/default/default/template/tax/rate/title.phtml index 721438fe3f..e64b44a393 100644 --- a/app/design/adminhtml/default/default/template/tax/rate/title.phtml +++ b/app/design/adminhtml/default/default/template/tax/rate/title.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/tax/toolbar/class/add.phtml b/app/design/adminhtml/default/default/template/tax/toolbar/class/add.phtml index 99381fe949..94d4407e2e 100644 --- a/app/design/adminhtml/default/default/template/tax/toolbar/class/add.phtml +++ b/app/design/adminhtml/default/default/template/tax/toolbar/class/add.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -29,7 +29,7 @@

    - +
    diff --git a/app/design/adminhtml/default/default/template/tax/toolbar/class/save.phtml b/app/design/adminhtml/default/default/template/tax/toolbar/class/save.phtml index 0f846b5d71..29dc54c21e 100644 --- a/app/design/adminhtml/default/default/template/tax/toolbar/class/save.phtml +++ b/app/design/adminhtml/default/default/template/tax/toolbar/class/save.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/tax/toolbar/rate/add.phtml b/app/design/adminhtml/default/default/template/tax/toolbar/rate/add.phtml index c099c6227c..f1edfc322b 100644 --- a/app/design/adminhtml/default/default/template/tax/toolbar/rate/add.phtml +++ b/app/design/adminhtml/default/default/template/tax/toolbar/rate/add.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/tax/toolbar/rate/save.phtml b/app/design/adminhtml/default/default/template/tax/toolbar/rate/save.phtml index 5f7e4ef326..cdde037d88 100644 --- a/app/design/adminhtml/default/default/template/tax/toolbar/rate/save.phtml +++ b/app/design/adminhtml/default/default/template/tax/toolbar/rate/save.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/tax/toolbar/rule/add.phtml b/app/design/adminhtml/default/default/template/tax/toolbar/rule/add.phtml index 1a275a6a98..41fdbcd955 100644 --- a/app/design/adminhtml/default/default/template/tax/toolbar/rule/add.phtml +++ b/app/design/adminhtml/default/default/template/tax/toolbar/rule/add.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -29,7 +29,7 @@

    - +
    diff --git a/app/design/adminhtml/default/default/template/tax/toolbar/rule/save.phtml b/app/design/adminhtml/default/default/template/tax/toolbar/rule/save.phtml index e9b12ec301..356fe3e6a6 100644 --- a/app/design/adminhtml/default/default/template/tax/toolbar/rule/save.phtml +++ b/app/design/adminhtml/default/default/template/tax/toolbar/rule/save.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/urlrewrite/categories.phtml b/app/design/adminhtml/default/default/template/urlrewrite/categories.phtml index 614e4ffc48..f688f88f0c 100644 --- a/app/design/adminhtml/default/default/template/urlrewrite/categories.phtml +++ b/app/design/adminhtml/default/default/template/urlrewrite/categories.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/adminhtml/default/default/template/urlrewrite/edit.phtml b/app/design/adminhtml/default/default/template/urlrewrite/edit.phtml index 57be9648f4..7ae6052b52 100644 --- a/app/design/adminhtml/default/default/template/urlrewrite/edit.phtml +++ b/app/design/adminhtml/default/default/template/urlrewrite/edit.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/adminhtml/default/default/template/urlrewrite/selector.phtml b/app/design/adminhtml/default/default/template/urlrewrite/selector.phtml index 0045e204e4..1db892ed6a 100644 --- a/app/design/adminhtml/default/default/template/urlrewrite/selector.phtml +++ b/app/design/adminhtml/default/default/template/urlrewrite/selector.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/adminhtml/default/default/template/usa/dhl/unitofmeasure.phtml b/app/design/adminhtml/default/default/template/usa/dhl/unitofmeasure.phtml index 0c2e61c9ff..05db0021ba 100644 --- a/app/design/adminhtml/default/default/template/usa/dhl/unitofmeasure.phtml +++ b/app/design/adminhtml/default/default/template/usa/dhl/unitofmeasure.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/weee/renderer/tax.phtml b/app/design/adminhtml/default/default/template/weee/renderer/tax.phtml index a6307c5b8a..52b6d19fbc 100644 --- a/app/design/adminhtml/default/default/template/weee/renderer/tax.phtml +++ b/app/design/adminhtml/default/default/template/weee/renderer/tax.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -69,7 +69,7 @@
    - +
    + getHideFormElement() !== true):?>
    + getBlockHtml('formkey')?>
    @@ -60,7 +62,9 @@ getApplyButtonHtml() ?>
    + getHideFormElement() !== true):?>
    +
    diff --git a/app/design/adminhtml/default/default/template/widget/grid/serializer.phtml b/app/design/adminhtml/default/default/template/widget/grid/serializer.phtml index 86dd54e07f..cda25d5e38 100644 --- a/app/design/adminhtml/default/default/template/widget/grid/serializer.phtml +++ b/app/design/adminhtml/default/default/template/widget/grid/serializer.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/widget/instance/edit/layout.phtml b/app/design/adminhtml/default/default/template/widget/instance/edit/layout.phtml index dcdee212f8..8b754d51d9 100644 --- a/app/design/adminhtml/default/default/template/widget/instance/edit/layout.phtml +++ b/app/design/adminhtml/default/default/template/widget/instance/edit/layout.phtml @@ -20,12 +20,10 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> - -

    __('Layout Updates') ?>

    getAddLayoutButtonHtml() ?>
    @@ -43,7 +41,7 @@ var pageGroupTemplate = '
    '+ 'getRemoveLayoutButtonHtml() ?>'+ ''+ - 'inlineEscapeStartMarker() . $this->getDisplayOnSelectHtml() . $translateHelper->inlineEscapeEndMarker() ?>'+ + 'getDisplayOnSelectHtml(); ?>'+ '
    '+ getDisplayOnContainers() as $container): ?> '
    '+ @@ -89,11 +87,11 @@ var pageGroupTemplate = '
    '+ '

    ' + ' ' + - 'inlineEscapeStartMarker() ?> title="helper('core')->jsQuoteEscape(Mage::helper('widget')->__('Open Chooser')) ?>">inlineEscapeEndMarker() ?>' + - 'inlineEscapeStartMarker() ?><?php echo $this->helper('core')->jsQuoteEscape(Mage::helper('widget')->__('Open Chooser')); ?>inlineEscapeEndMarker() ?>' + + '' + + '<?php echo $this->helper('core')->jsQuoteEscape(Mage::helper('widget')->__('Open Chooser')); ?>' + ' ' + - 'inlineEscapeStartMarker() ?> title="helper('core')->jsQuoteEscape(Mage::helper('widget')->__('Apply')); ?>">inlineEscapeEndMarker() ?>' + - 'inlineEscapeStartMarker() ?><?php echo $this->helper('core')->jsQuoteEscape(Mage::helper('widget')->__('Apply')); ?>inlineEscapeEndMarker() ?>' + + '' + + '<?php echo $this->helper('core')->jsQuoteEscape(Mage::helper('widget')->__('Apply')); ?>' + '' + '

    '+ '
    '+ @@ -187,11 +185,11 @@ var WidgetInstance = { data.entities = ''; } data.id = this.count++; - if (data.all_products_entities) { - var selected_entities = data.all_products_entities.split(','); + if (data[data.group + '_entities']) { + var selected_entities = data[data.group + '_entities'].split(','); if (selected_entities.length > 0) { for (var i = 0; i < selected_entities.length; i++) { - this.addProductItemToSelection('all_products_ids_' + data.id, selected_entities[i]); + this.addProductItemToSelection(data.group + '_ids_' + data.id, selected_entities[i]); } } } diff --git a/app/design/adminhtml/default/default/template/widget/instance/js.phtml b/app/design/adminhtml/default/default/template/widget/instance/js.phtml index 9489e92208..cbe89a5667 100644 --- a/app/design/adminhtml/default/default/template/widget/instance/js.phtml +++ b/app/design/adminhtml/default/default/template/widget/instance/js.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/widget/tabs.phtml b/app/design/adminhtml/default/default/template/widget/tabs.phtml index 760c858bc3..723f9c4e82 100644 --- a/app/design/adminhtml/default/default/template/widget/tabs.phtml +++ b/app/design/adminhtml/default/default/template/widget/tabs.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/widget/tabshoriz.phtml b/app/design/adminhtml/default/default/template/widget/tabshoriz.phtml index c90300dbe9..81f5df1d47 100644 --- a/app/design/adminhtml/default/default/template/widget/tabshoriz.phtml +++ b/app/design/adminhtml/default/default/template/widget/tabshoriz.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/widget/tabsleft.phtml b/app/design/adminhtml/default/default/template/widget/tabsleft.phtml index c7e8e4bb36..fec2c9b0f7 100644 --- a/app/design/adminhtml/default/default/template/widget/tabsleft.phtml +++ b/app/design/adminhtml/default/default/template/widget/tabsleft.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/widget/view/container.phtml b/app/design/adminhtml/default/default/template/widget/view/container.phtml index e4e318581d..2fed877582 100644 --- a/app/design/adminhtml/default/default/template/widget/view/container.phtml +++ b/app/design/adminhtml/default/default/template/widget/view/container.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design.phtml b/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design.phtml index fd8cbeecc8..560e9ffc0c 100644 --- a/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design.phtml +++ b/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview/catalog_android.phtml b/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview/catalog_android.phtml index c187215393..48bb5764c2 100644 --- a/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview/catalog_android.phtml +++ b/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview/catalog_android.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview/catalog_hor_ipad.phtml b/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview/catalog_hor_ipad.phtml index 7c158040ef..948c295c2e 100644 --- a/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview/catalog_hor_ipad.phtml +++ b/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview/catalog_hor_ipad.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview/catalog_ipad.phtml b/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview/catalog_ipad.phtml index 0545749896..e77e478949 100644 --- a/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview/catalog_ipad.phtml +++ b/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview/catalog_ipad.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview/catalog_iphone.phtml b/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview/catalog_iphone.phtml index 2952a29c98..f1360a7878 100755 --- a/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview/catalog_iphone.phtml +++ b/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview/catalog_iphone.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview/home_android.phtml b/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview/home_android.phtml index 55e6b4586e..35ae9672d1 100755 --- a/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview/home_android.phtml +++ b/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview/home_android.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview/home_hor_ipad.phtml b/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview/home_hor_ipad.phtml index 304fcfd4be..27dee756a4 100755 --- a/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview/home_hor_ipad.phtml +++ b/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview/home_hor_ipad.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview/home_ipad.phtml b/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview/home_ipad.phtml index 0b146b78a4..59a66b596f 100755 --- a/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview/home_ipad.phtml +++ b/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview/home_ipad.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview/home_iphone.phtml b/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview/home_iphone.phtml index e04976a59c..d61abb85af 100755 --- a/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview/home_iphone.phtml +++ b/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview/home_iphone.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview/productinfo_iphone.phtml b/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview/productinfo_iphone.phtml index f1b6744ef7..6b5a24d0cc 100755 --- a/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview/productinfo_iphone.phtml +++ b/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview/productinfo_iphone.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview/tab_items_android.phtml b/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview/tab_items_android.phtml index 471de1f6f8..333745b3cc 100644 --- a/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview/tab_items_android.phtml +++ b/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview/tab_items_android.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview/tab_items_ipad.phtml b/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview/tab_items_ipad.phtml index 2c91855124..7ca0c8b022 100644 --- a/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview/tab_items_ipad.phtml +++ b/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview/tab_items_ipad.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview/tab_items_iphone.phtml b/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview/tab_items_iphone.phtml index 8abe0efc20..0f0b5960c4 100755 --- a/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview/tab_items_iphone.phtml +++ b/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview/tab_items_iphone.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview_android.phtml b/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview_android.phtml index 58e3bdccef..9d46f86de5 100644 --- a/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview_android.phtml +++ b/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview_android.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -30,7 +30,7 @@
    - +


    To preview the newly uploaded images, please save your application first.

    diff --git a/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview_ipad.phtml b/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview_ipad.phtml index 92a9bf5c90..2e0351a645 100644 --- a/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview_ipad.phtml +++ b/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview_ipad.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -39,8 +39,8 @@
    - - + +


    To preview the newly uploaded images, please save your application first.

    diff --git a/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview_iphone.phtml b/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview_iphone.phtml index 45c3087675..66afea8b31 100644 --- a/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview_iphone.phtml +++ b/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview_iphone.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -30,7 +30,7 @@
    - +


    To preview the newly uploaded images, please save your application first.

    diff --git a/app/design/adminhtml/default/default/template/xmlconnect/form/element/addrow.phtml b/app/design/adminhtml/default/default/template/xmlconnect/form/element/addrow.phtml index 4efec2284d..b1eeee731a 100644 --- a/app/design/adminhtml/default/default/template/xmlconnect/form/element/addrow.phtml +++ b/app/design/adminhtml/default/default/template/xmlconnect/form/element/addrow.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -58,8 +58,8 @@ function getTdValueInnerHtml() { * @return string */ function getTdButtonInnerHtml(id) { - return ''; + return ''; } /** diff --git a/app/design/adminhtml/default/default/template/xmlconnect/form/element/app_tabs_android.phtml b/app/design/adminhtml/default/default/template/xmlconnect/form/element/app_tabs_android.phtml index 6351b8112a..621820bfa8 100755 --- a/app/design/adminhtml/default/default/template/xmlconnect/form/element/app_tabs_android.phtml +++ b/app/design/adminhtml/default/default/template/xmlconnect/form/element/app_tabs_android.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/xmlconnect/form/element/app_tabs_ipad.phtml b/app/design/adminhtml/default/default/template/xmlconnect/form/element/app_tabs_ipad.phtml index 6dc8261474..becc27905e 100755 --- a/app/design/adminhtml/default/default/template/xmlconnect/form/element/app_tabs_ipad.phtml +++ b/app/design/adminhtml/default/default/template/xmlconnect/form/element/app_tabs_ipad.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/xmlconnect/form/element/app_tabs_iphone.phtml b/app/design/adminhtml/default/default/template/xmlconnect/form/element/app_tabs_iphone.phtml index c5ba0fb0f3..e4de0ba1fb 100755 --- a/app/design/adminhtml/default/default/template/xmlconnect/form/element/app_tabs_iphone.phtml +++ b/app/design/adminhtml/default/default/template/xmlconnect/form/element/app_tabs_iphone.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/xmlconnect/form/element/country/androidmarket.phtml b/app/design/adminhtml/default/default/template/xmlconnect/form/element/country/androidmarket.phtml index 5e5544a90a..08ace20ee4 100644 --- a/app/design/adminhtml/default/default/template/xmlconnect/form/element/country/androidmarket.phtml +++ b/app/design/adminhtml/default/default/template/xmlconnect/form/element/country/androidmarket.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/xmlconnect/form/element/country/istore.phtml b/app/design/adminhtml/default/default/template/xmlconnect/form/element/country/istore.phtml index c500135794..a6d3360d07 100644 --- a/app/design/adminhtml/default/default/template/xmlconnect/form/element/country/istore.phtml +++ b/app/design/adminhtml/default/default/template/xmlconnect/form/element/country/istore.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/xmlconnect/form/element/themes.phtml b/app/design/adminhtml/default/default/template/xmlconnect/form/element/themes.phtml index 15239b5edd..770421bed5 100644 --- a/app/design/adminhtml/default/default/template/xmlconnect/form/element/themes.phtml +++ b/app/design/adminhtml/default/default/template/xmlconnect/form/element/themes.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -500,10 +500,10 @@ function deleteTheme() {
    @@ -516,10 +516,10 @@ function deleteTheme() {
    @@ -601,11 +601,11 @@ $id2observe = array();
    diff --git a/app/design/adminhtml/default/default/template/xmlconnect/mobile/notification_helper.phtml b/app/design/adminhtml/default/default/template/xmlconnect/mobile/notification_helper.phtml index 50fc3c3475..2b5fcac70d 100644 --- a/app/design/adminhtml/default/default/template/xmlconnect/mobile/notification_helper.phtml +++ b/app/design/adminhtml/default/default/template/xmlconnect/mobile/notification_helper.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/xmlconnect/submission/app_icons_preview.phtml b/app/design/adminhtml/default/default/template/xmlconnect/submission/app_icons_preview.phtml index 4b87ce3c33..a4b3cca977 100644 --- a/app/design/adminhtml/default/default/template/xmlconnect/submission/app_icons_preview.phtml +++ b/app/design/adminhtml/default/default/template/xmlconnect/submission/app_icons_preview.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/xmlconnect/submission/container.phtml b/app/design/adminhtml/default/default/template/xmlconnect/submission/container.phtml index 86980133bb..dc8a3dcb14 100644 --- a/app/design/adminhtml/default/default/template/xmlconnect/submission/container.phtml +++ b/app/design/adminhtml/default/default/template/xmlconnect/submission/container.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/xmlconnect/template/preview.phtml b/app/design/adminhtml/default/default/template/xmlconnect/template/preview.phtml index 25e1ff9207..f78b987bb6 100755 --- a/app/design/adminhtml/default/default/template/xmlconnect/template/preview.phtml +++ b/app/design/adminhtml/default/default/template/xmlconnect/template/preview.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/base/default/etc/widget.xml b/app/design/frontend/base/default/etc/widget.xml index 27e8c0cc23..2acaecb8ed 100644 --- a/app/design/frontend/base/default/etc/widget.xml +++ b/app/design/frontend/base/default/etc/widget.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/design/frontend/base/default/layout/authorizenet.xml b/app/design/frontend/base/default/layout/authorizenet.xml index e23bbef54c..6d489c7945 100644 --- a/app/design/frontend/base/default/layout/authorizenet.xml +++ b/app/design/frontend/base/default/layout/authorizenet.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/base/default/layout/bundle.xml b/app/design/frontend/base/default/layout/bundle.xml index 9fecbe8c4b..62632b55c5 100644 --- a/app/design/frontend/base/default/layout/bundle.xml +++ b/app/design/frontend/base/default/layout/bundle.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ @@ -92,12 +92,6 @@ Adding custom product price block - - - bundlebundle/catalog_product_configuration - - - bundlebundle/catalog_product_price diff --git a/app/design/frontend/base/default/layout/captcha.xml b/app/design/frontend/base/default/layout/captcha.xml index 794dbc132d..25aaf030b2 100755 --- a/app/design/frontend/base/default/layout/captcha.xml +++ b/app/design/frontend/base/default/layout/captcha.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/base/default/layout/catalog.xml b/app/design/frontend/base/default/layout/catalog.xml index 7b9e1a86d0..5cbf8ca318 100644 --- a/app/design/frontend/base/default/layout/catalog.xml +++ b/app/design/frontend/base/default/layout/catalog.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ @@ -45,9 +45,6 @@ Default layout, loads most of the pages - - - images/media/col_left_callout.jpg diff --git a/app/design/frontend/base/default/layout/catalog_msrp.xml b/app/design/frontend/base/default/layout/catalog_msrp.xml index 4244b59a1a..c41cf5aeee 100644 --- a/app/design/frontend/base/default/layout/catalog_msrp.xml +++ b/app/design/frontend/base/default/layout/catalog_msrp.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/base/default/layout/cataloginventory.xml b/app/design/frontend/base/default/layout/cataloginventory.xml index 51d7f76824..3d1ce281ce 100644 --- a/app/design/frontend/base/default/layout/cataloginventory.xml +++ b/app/design/frontend/base/default/layout/cataloginventory.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/base/default/layout/catalogsearch.xml b/app/design/frontend/base/default/layout/catalogsearch.xml index 1bc67e7a11..e349ebd931 100644 --- a/app/design/frontend/base/default/layout/catalogsearch.xml +++ b/app/design/frontend/base/default/layout/catalogsearch.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/base/default/layout/centinel.xml b/app/design/frontend/base/default/layout/centinel.xml index e2d1b6768e..8851fe7016 100644 --- a/app/design/frontend/base/default/layout/centinel.xml +++ b/app/design/frontend/base/default/layout/centinel.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/base/default/layout/checkout.xml b/app/design/frontend/base/default/layout/checkout.xml index 125404e860..2120f7151b 100644 --- a/app/design/frontend/base/default/layout/checkout.xml +++ b/app/design/frontend/base/default/layout/checkout.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/base/default/layout/cms.xml b/app/design/frontend/base/default/layout/cms.xml index 0ef960e3c5..344bd11dcf 100644 --- a/app/design/frontend/base/default/layout/cms.xml +++ b/app/design/frontend/base/default/layout/cms.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/design/frontend/base/default/layout/contacts.xml b/app/design/frontend/base/default/layout/contacts.xml index 90d9370c20..825085083b 100644 --- a/app/design/frontend/base/default/layout/contacts.xml +++ b/app/design/frontend/base/default/layout/contacts.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/design/frontend/base/default/layout/core.xml b/app/design/frontend/base/default/layout/core.xml index 4c266b52d8..2623059634 100644 --- a/app/design/frontend/base/default/layout/core.xml +++ b/app/design/frontend/base/default/layout/core.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/base/default/layout/customer.xml b/app/design/frontend/base/default/layout/customer.xml index a9ea64fa07..96f98e9398 100644 --- a/app/design/frontend/base/default/layout/customer.xml +++ b/app/design/frontend/base/default/layout/customer.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/base/default/layout/directory.xml b/app/design/frontend/base/default/layout/directory.xml index 9585608b6a..d73d343f78 100644 --- a/app/design/frontend/base/default/layout/directory.xml +++ b/app/design/frontend/base/default/layout/directory.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/base/default/layout/downloadable.xml b/app/design/frontend/base/default/layout/downloadable.xml index 680554f2c2..cee35e45ae 100644 --- a/app/design/frontend/base/default/layout/downloadable.xml +++ b/app/design/frontend/base/default/layout/downloadable.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ @@ -127,12 +127,6 @@ - - - downloadabledownloadable/catalog_product_configuration - - - diff --git a/app/design/frontend/base/default/layout/googleanalytics.xml b/app/design/frontend/base/default/layout/googleanalytics.xml index 31384d9af4..922f0e011e 100644 --- a/app/design/frontend/base/default/layout/googleanalytics.xml +++ b/app/design/frontend/base/default/layout/googleanalytics.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/base/default/layout/googlecheckout.xml b/app/design/frontend/base/default/layout/googlecheckout.xml index b424f529f6..07b2813b78 100644 --- a/app/design/frontend/base/default/layout/googlecheckout.xml +++ b/app/design/frontend/base/default/layout/googlecheckout.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/base/default/layout/moneybookers.xml b/app/design/frontend/base/default/layout/moneybookers.xml index a01f621629..e99ec56cc4 100644 --- a/app/design/frontend/base/default/layout/moneybookers.xml +++ b/app/design/frontend/base/default/layout/moneybookers.xml @@ -15,7 +15,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) + * @copyright Copyright (c) 2012 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/design/frontend/base/default/layout/newsletter.xml b/app/design/frontend/base/default/layout/newsletter.xml index b85697c4c0..01d76f0bc2 100644 --- a/app/design/frontend/base/default/layout/newsletter.xml +++ b/app/design/frontend/base/default/layout/newsletter.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/base/default/layout/page.xml b/app/design/frontend/base/default/layout/page.xml index 68aacdd5c7..286f624acc 100644 --- a/app/design/frontend/base/default/layout/page.xml +++ b/app/design/frontend/base/default/layout/page.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -71,6 +71,7 @@ Default layout, loads most of the pages + diff --git a/app/design/frontend/base/default/layout/pagecache.xml b/app/design/frontend/base/default/layout/pagecache.xml index 01444bfe5a..88b1a8544e 100644 --- a/app/design/frontend/base/default/layout/pagecache.xml +++ b/app/design/frontend/base/default/layout/pagecache.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/base/default/layout/payment.xml b/app/design/frontend/base/default/layout/payment.xml index 1921feca89..929947c317 100644 --- a/app/design/frontend/base/default/layout/payment.xml +++ b/app/design/frontend/base/default/layout/payment.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/base/default/layout/paypal.xml b/app/design/frontend/base/default/layout/paypal.xml index 8b61e9fe0e..386ce1621e 100644 --- a/app/design/frontend/base/default/layout/paypal.xml +++ b/app/design/frontend/base/default/layout/paypal.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ @@ -53,6 +53,9 @@ + + + defaultcheckout/cart_item_renderer groupedcheckout/cart_item_renderer_grouped diff --git a/app/design/frontend/base/default/layout/paypaluk.xml b/app/design/frontend/base/default/layout/paypaluk.xml index 1566812990..8f2be04dab 100644 --- a/app/design/frontend/base/default/layout/paypaluk.xml +++ b/app/design/frontend/base/default/layout/paypaluk.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ @@ -51,7 +51,7 @@ - + paypaluk defaultcheckout/cart_item_renderer diff --git a/app/design/frontend/base/default/layout/persistent.xml b/app/design/frontend/base/default/layout/persistent.xml index 717ffa5aa6..e3dddd5f5b 100644 --- a/app/design/frontend/base/default/layout/persistent.xml +++ b/app/design/frontend/base/default/layout/persistent.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/base/default/layout/poll.xml b/app/design/frontend/base/default/layout/poll.xml index 6f6c378ecd..3b48488d49 100644 --- a/app/design/frontend/base/default/layout/poll.xml +++ b/app/design/frontend/base/default/layout/poll.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/base/default/layout/productalert.xml b/app/design/frontend/base/default/layout/productalert.xml index 499bcab89e..2b7c9a4b50 100644 --- a/app/design/frontend/base/default/layout/productalert.xml +++ b/app/design/frontend/base/default/layout/productalert.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/design/frontend/base/default/layout/reports.xml b/app/design/frontend/base/default/layout/reports.xml index e389898e32..2ce664a4f2 100644 --- a/app/design/frontend/base/default/layout/reports.xml +++ b/app/design/frontend/base/default/layout/reports.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/base/default/layout/review.xml b/app/design/frontend/base/default/layout/review.xml index 82e7ef055c..f47347f4cf 100644 --- a/app/design/frontend/base/default/layout/review.xml +++ b/app/design/frontend/base/default/layout/review.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/base/default/layout/rss.xml b/app/design/frontend/base/default/layout/rss.xml index c16824cb2f..d707dff9b6 100644 --- a/app/design/frontend/base/default/layout/rss.xml +++ b/app/design/frontend/base/default/layout/rss.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/design/frontend/base/default/layout/sales.xml b/app/design/frontend/base/default/layout/sales.xml index c3448fa4dd..6450d556aa 100644 --- a/app/design/frontend/base/default/layout/sales.xml +++ b/app/design/frontend/base/default/layout/sales.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/base/default/layout/sales/billing_agreement.xml b/app/design/frontend/base/default/layout/sales/billing_agreement.xml index 2642b3c958..6ffa423e60 100644 --- a/app/design/frontend/base/default/layout/sales/billing_agreement.xml +++ b/app/design/frontend/base/default/layout/sales/billing_agreement.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/base/default/layout/sales/recurring_profile.xml b/app/design/frontend/base/default/layout/sales/recurring_profile.xml index b50e92e94c..7a4fccafe9 100644 --- a/app/design/frontend/base/default/layout/sales/recurring_profile.xml +++ b/app/design/frontend/base/default/layout/sales/recurring_profile.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/base/default/layout/sendfriend.xml b/app/design/frontend/base/default/layout/sendfriend.xml index 08bb0327ce..43d774fb7b 100644 --- a/app/design/frontend/base/default/layout/sendfriend.xml +++ b/app/design/frontend/base/default/layout/sendfriend.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/design/frontend/base/default/layout/shipping.xml b/app/design/frontend/base/default/layout/shipping.xml index 4d74304d93..d6c6b31c19 100644 --- a/app/design/frontend/base/default/layout/shipping.xml +++ b/app/design/frontend/base/default/layout/shipping.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/base/default/layout/tag.xml b/app/design/frontend/base/default/layout/tag.xml index d950e6d49a..b05faaf118 100644 --- a/app/design/frontend/base/default/layout/tag.xml +++ b/app/design/frontend/base/default/layout/tag.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/base/default/layout/weee.xml b/app/design/frontend/base/default/layout/weee.xml index 97622d41df..6f64056644 100644 --- a/app/design/frontend/base/default/layout/weee.xml +++ b/app/design/frontend/base/default/layout/weee.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/base/default/layout/wishlist.xml b/app/design/frontend/base/default/layout/wishlist.xml index 0b4b143799..8b608c84f6 100644 --- a/app/design/frontend/base/default/layout/wishlist.xml +++ b/app/design/frontend/base/default/layout/wishlist.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ @@ -77,7 +77,29 @@ Wishlist pages - + + My Wishlist + + + + + + Product Details and Comment + + + + + Add to Cart + + + + + + + + + + @@ -96,7 +118,7 @@ Wishlist pages wishlist_customer_sidebar - + diff --git a/app/design/frontend/base/default/layout/xmlconnect.xml b/app/design/frontend/base/default/layout/xmlconnect.xml index 004d24bfc0..b74b5b83e6 100644 --- a/app/design/frontend/base/default/layout/xmlconnect.xml +++ b/app/design/frontend/base/default/layout/xmlconnect.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/design/frontend/base/default/template/authorizenet/directpost/form.phtml b/app/design/frontend/base/default/template/authorizenet/directpost/form.phtml index 20c70648b4..8638c8b698 100644 --- a/app/design/frontend/base/default/template/authorizenet/directpost/form.phtml +++ b/app/design/frontend/base/default/template/authorizenet/directpost/form.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/base/default/template/authorizenet/directpost/iframe.phtml b/app/design/frontend/base/default/template/authorizenet/directpost/iframe.phtml index c274c7a387..ca33b690bc 100644 --- a/app/design/frontend/base/default/template/authorizenet/directpost/iframe.phtml +++ b/app/design/frontend/base/default/template/authorizenet/directpost/iframe.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/base/default/template/authorizenet/directpost/info.phtml b/app/design/frontend/base/default/template/authorizenet/directpost/info.phtml index d4ba4ac82a..d8e6ff2275 100644 --- a/app/design/frontend/base/default/template/authorizenet/directpost/info.phtml +++ b/app/design/frontend/base/default/template/authorizenet/directpost/info.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/base/default/template/bundle/catalog/product/list/partof.phtml b/app/design/frontend/base/default/template/bundle/catalog/product/list/partof.phtml index 6855f3e30c..3404c26758 100644 --- a/app/design/frontend/base/default/template/bundle/catalog/product/list/partof.phtml +++ b/app/design/frontend/base/default/template/bundle/catalog/product/list/partof.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/base/default/template/bundle/catalog/product/price.phtml b/app/design/frontend/base/default/template/bundle/catalog/product/price.phtml index 394230292a..440f0f5bdd 100644 --- a/app/design/frontend/base/default/template/bundle/catalog/product/price.phtml +++ b/app/design/frontend/base/default/template/bundle/catalog/product/price.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -35,12 +35,17 @@ getPriceType() == 1) { $_weeeTaxAmount = Mage::helper('weee')->getAmount($_product); + $_weeeTaxAmountInclTaxes = $_weeeTaxAmount; + if (Mage::helper('weee')->isTaxable()) { + $_attributes = Mage::helper('weee')->getProductWeeeAttributesForRenderer($_product, null, null, null, true); + $_weeeTaxAmountInclTaxes = Mage::helper('weee')->getAmountInclTaxes($_attributes); + } if ($_weeeTaxAmount && Mage::helper('weee')->typeOfDisplay($_product, array(0, 1, 4))) { $_minimalPriceTax += $_weeeTaxAmount; - $_minimalPriceInclTax += $_weeeTaxAmount; + $_minimalPriceInclTax += $_weeeTaxAmountInclTaxes; } if ($_weeeTaxAmount && Mage::helper('weee')->typeOfDisplay($_product, 2)) { - $_minimalPriceInclTax += $_weeeTaxAmount; + $_minimalPriceInclTax += $_weeeTaxAmountInclTaxes; } if (Mage::helper('weee')->typeOfDisplay($_product, array(1, 2, 4))) { @@ -153,10 +158,10 @@ if ($_product->getPriceType() == 1) { if ($_product->getPriceType() == 1) { if ($_weeeTaxAmount && Mage::helper('weee')->typeOfDisplay($_product, array(0, 1, 4))) { $_maximalPriceTax += $_weeeTaxAmount; - $_maximalPriceInclTax += $_weeeTaxAmount; + $_maximalPriceInclTax += $_weeeTaxAmountInclTaxes; } if ($_weeeTaxAmount && Mage::helper('weee')->typeOfDisplay($_product, 2)) { - $_maximalPriceInclTax += $_weeeTaxAmount; + $_maximalPriceInclTax += $_weeeTaxAmountInclTaxes; } } ?> diff --git a/app/design/frontend/base/default/template/bundle/catalog/product/view/options/notice.phtml b/app/design/frontend/base/default/template/bundle/catalog/product/view/options/notice.phtml index 8a4b97da0f..93c8ff90e2 100644 --- a/app/design/frontend/base/default/template/bundle/catalog/product/view/options/notice.phtml +++ b/app/design/frontend/base/default/template/bundle/catalog/product/view/options/notice.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/base/default/template/bundle/catalog/product/view/price.phtml b/app/design/frontend/base/default/template/bundle/catalog/product/view/price.phtml index d6fdd0a3b7..a08a54e218 100644 --- a/app/design/frontend/base/default/template/bundle/catalog/product/view/price.phtml +++ b/app/design/frontend/base/default/template/bundle/catalog/product/view/price.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/base/default/template/bundle/catalog/product/view/tierprices.phtml b/app/design/frontend/base/default/template/bundle/catalog/product/view/tierprices.phtml index 80576267be..adf0f60e55 100644 --- a/app/design/frontend/base/default/template/bundle/catalog/product/view/tierprices.phtml +++ b/app/design/frontend/base/default/template/bundle/catalog/product/view/tierprices.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/base/default/template/bundle/catalog/product/view/type/bundle.phtml b/app/design/frontend/base/default/template/bundle/catalog/product/view/type/bundle.phtml index 99cf57ba04..ac76d7271d 100644 --- a/app/design/frontend/base/default/template/bundle/catalog/product/view/type/bundle.phtml +++ b/app/design/frontend/base/default/template/bundle/catalog/product/view/type/bundle.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/base/default/template/bundle/catalog/product/view/type/bundle/option/checkbox.phtml b/app/design/frontend/base/default/template/bundle/catalog/product/view/type/bundle/option/checkbox.phtml index 1eb7186b45..d6d3cba34a 100644 --- a/app/design/frontend/base/default/template/bundle/catalog/product/view/type/bundle/option/checkbox.phtml +++ b/app/design/frontend/base/default/template/bundle/catalog/product/view/type/bundle/option/checkbox.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/base/default/template/bundle/catalog/product/view/type/bundle/option/multi.phtml b/app/design/frontend/base/default/template/bundle/catalog/product/view/type/bundle/option/multi.phtml index 93ab865254..58870fb4a4 100644 --- a/app/design/frontend/base/default/template/bundle/catalog/product/view/type/bundle/option/multi.phtml +++ b/app/design/frontend/base/default/template/bundle/catalog/product/view/type/bundle/option/multi.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/base/default/template/bundle/catalog/product/view/type/bundle/option/radio.phtml b/app/design/frontend/base/default/template/bundle/catalog/product/view/type/bundle/option/radio.phtml index e6ef32bd75..e35a5a3e1c 100644 --- a/app/design/frontend/base/default/template/bundle/catalog/product/view/type/bundle/option/radio.phtml +++ b/app/design/frontend/base/default/template/bundle/catalog/product/view/type/bundle/option/radio.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/base/default/template/bundle/catalog/product/view/type/bundle/option/select.phtml b/app/design/frontend/base/default/template/bundle/catalog/product/view/type/bundle/option/select.phtml index a39373561e..f1ea3024a1 100644 --- a/app/design/frontend/base/default/template/bundle/catalog/product/view/type/bundle/option/select.phtml +++ b/app/design/frontend/base/default/template/bundle/catalog/product/view/type/bundle/option/select.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/base/default/template/bundle/catalog/product/view/type/bundle/options.phtml b/app/design/frontend/base/default/template/bundle/catalog/product/view/type/bundle/options.phtml index 65055564c3..95cbdc4799 100644 --- a/app/design/frontend/base/default/template/bundle/catalog/product/view/type/bundle/options.phtml +++ b/app/design/frontend/base/default/template/bundle/catalog/product/view/type/bundle/options.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/base/default/template/bundle/email/order/items/creditmemo/default.phtml b/app/design/frontend/base/default/template/bundle/email/order/items/creditmemo/default.phtml index 6a558be08a..8d2d217de9 100644 --- a/app/design/frontend/base/default/template/bundle/email/order/items/creditmemo/default.phtml +++ b/app/design/frontend/base/default/template/bundle/email/order/items/creditmemo/default.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/base/default/template/bundle/email/order/items/invoice/default.phtml b/app/design/frontend/base/default/template/bundle/email/order/items/invoice/default.phtml index a7f1b5822a..1b5b9b2e56 100644 --- a/app/design/frontend/base/default/template/bundle/email/order/items/invoice/default.phtml +++ b/app/design/frontend/base/default/template/bundle/email/order/items/invoice/default.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/base/default/template/bundle/email/order/items/order/default.phtml b/app/design/frontend/base/default/template/bundle/email/order/items/order/default.phtml index 253685b980..4f16505f4f 100644 --- a/app/design/frontend/base/default/template/bundle/email/order/items/order/default.phtml +++ b/app/design/frontend/base/default/template/bundle/email/order/items/order/default.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/base/default/template/bundle/email/order/items/shipment/default.phtml b/app/design/frontend/base/default/template/bundle/email/order/items/shipment/default.phtml index 8609a493be..0f2ae13286 100644 --- a/app/design/frontend/base/default/template/bundle/email/order/items/shipment/default.phtml +++ b/app/design/frontend/base/default/template/bundle/email/order/items/shipment/default.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/base/default/template/bundle/rss/catalog/product/price.phtml b/app/design/frontend/base/default/template/bundle/rss/catalog/product/price.phtml index a548576bd5..b8f788d348 100644 --- a/app/design/frontend/base/default/template/bundle/rss/catalog/product/price.phtml +++ b/app/design/frontend/base/default/template/bundle/rss/catalog/product/price.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/base/default/template/bundle/sales/order/creditmemo/items/renderer.phtml b/app/design/frontend/base/default/template/bundle/sales/order/creditmemo/items/renderer.phtml index 111963b77e..6677c72a23 100644 --- a/app/design/frontend/base/default/template/bundle/sales/order/creditmemo/items/renderer.phtml +++ b/app/design/frontend/base/default/template/bundle/sales/order/creditmemo/items/renderer.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/base/default/template/bundle/sales/order/invoice/items/renderer.phtml b/app/design/frontend/base/default/template/bundle/sales/order/invoice/items/renderer.phtml index 1f0cf366ee..5ae806234d 100644 --- a/app/design/frontend/base/default/template/bundle/sales/order/invoice/items/renderer.phtml +++ b/app/design/frontend/base/default/template/bundle/sales/order/invoice/items/renderer.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/base/default/template/bundle/sales/order/items/renderer.phtml b/app/design/frontend/base/default/template/bundle/sales/order/items/renderer.phtml index 1be38981a8..f39d86acb8 100644 --- a/app/design/frontend/base/default/template/bundle/sales/order/items/renderer.phtml +++ b/app/design/frontend/base/default/template/bundle/sales/order/items/renderer.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/base/default/template/bundle/sales/order/shipment/items/renderer.phtml b/app/design/frontend/base/default/template/bundle/sales/order/shipment/items/renderer.phtml index 8f1b54a562..e77bcf8047 100644 --- a/app/design/frontend/base/default/template/bundle/sales/order/shipment/items/renderer.phtml +++ b/app/design/frontend/base/default/template/bundle/sales/order/shipment/items/renderer.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/base/default/template/callouts/left_col.phtml b/app/design/frontend/base/default/template/callouts/left_col.phtml index 5248e8bfb4..8f8202d9e3 100644 --- a/app/design/frontend/base/default/template/callouts/left_col.phtml +++ b/app/design/frontend/base/default/template/callouts/left_col.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/base/default/template/callouts/right_col.phtml b/app/design/frontend/base/default/template/callouts/right_col.phtml index 5248e8bfb4..8f8202d9e3 100644 --- a/app/design/frontend/base/default/template/callouts/right_col.phtml +++ b/app/design/frontend/base/default/template/callouts/right_col.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/base/default/template/captcha/zend.phtml b/app/design/frontend/base/default/template/captcha/zend.phtml index af045512a8..7c140ad0ad 100644 --- a/app/design/frontend/base/default/template/captcha/zend.phtml +++ b/app/design/frontend/base/default/template/captcha/zend.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -29,19 +29,19 @@ getCaptchaModel() ?>
  • - +
    - +
  • - <?php echo $this->__('Reload captcha') ?> + <?php echo $this->__('Reload captcha') ?> isCaseSensitive()) :?>
    diff --git a/app/design/frontend/base/default/template/catalog/category/page.phtml b/app/design/frontend/base/default/template/catalog/category/page.phtml index 797a7f7aa3..d39af22d48 100644 --- a/app/design/frontend/base/default/template/catalog/category/page.phtml +++ b/app/design/frontend/base/default/template/catalog/category/page.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/base/default/template/catalog/category/view.phtml b/app/design/frontend/base/default/template/catalog/category/view.phtml index 7ba9cafad2..0af0974d48 100644 --- a/app/design/frontend/base/default/template/catalog/category/view.phtml +++ b/app/design/frontend/base/default/template/catalog/category/view.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/base/default/template/catalog/category/widget/link/link_block.phtml b/app/design/frontend/base/default/template/catalog/category/widget/link/link_block.phtml index 79b7138bc1..2aac71b529 100644 --- a/app/design/frontend/base/default/template/catalog/category/widget/link/link_block.phtml +++ b/app/design/frontend/base/default/template/catalog/category/widget/link/link_block.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/base/default/template/catalog/category/widget/link/link_inline.phtml b/app/design/frontend/base/default/template/catalog/category/widget/link/link_inline.phtml index aee65cd5ca..709d5f9542 100644 --- a/app/design/frontend/base/default/template/catalog/category/widget/link/link_inline.phtml +++ b/app/design/frontend/base/default/template/catalog/category/widget/link/link_inline.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/base/default/template/catalog/layer/filter.phtml b/app/design/frontend/base/default/template/catalog/layer/filter.phtml index 4d3532d80b..a0477dcd55 100644 --- a/app/design/frontend/base/default/template/catalog/layer/filter.phtml +++ b/app/design/frontend/base/default/template/catalog/layer/filter.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -39,7 +39,9 @@ getLabel() ?> getLabel() ?> + shouldDisplayProductCount()): ?> (getCount() ?>) +
  • diff --git a/app/design/frontend/base/default/template/catalog/layer/state.phtml b/app/design/frontend/base/default/template/catalog/layer/state.phtml index f6d7a7828c..59af49888c 100644 --- a/app/design/frontend/base/default/template/catalog/layer/state.phtml +++ b/app/design/frontend/base/default/template/catalog/layer/state.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -38,11 +38,18 @@
    1. - __('Remove This Item') ?> - __($_filter->getName()) ?>: stripTags($_filter->getLabel()) ?> + __($_filter->getName()) ?>: stripTags($_filter->getLabel()) ?> + getClearLinkUrl(); + if ($clearLinkUrl): + ?> + __('Previous') ?> + escapeHtml($_filter->getFilter()->getClearLinkText()) ?> + + __('Remove This Item') ?> +
    -
    diff --git a/app/design/frontend/base/default/template/catalog/layer/view.phtml b/app/design/frontend/base/default/template/catalog/layer/view.phtml index ad6e3c3603..06a5a65364 100644 --- a/app/design/frontend/base/default/template/catalog/layer/view.phtml +++ b/app/design/frontend/base/default/template/catalog/layer/view.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -38,6 +38,9 @@
    getStateHtml() ?> + getLayer()->getState()->getFilters()): ?> + + canShowOptions()): ?>

    __('Shopping Options') ?>

    diff --git a/app/design/frontend/base/default/template/catalog/msrp/popup.phtml b/app/design/frontend/base/default/template/catalog/msrp/popup.phtml index b3d338accd..e075c672bf 100644 --- a/app/design/frontend/base/default/template/catalog/msrp/popup.phtml +++ b/app/design/frontend/base/default/template/catalog/msrp/popup.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/base/default/template/catalog/navigation/left.phtml b/app/design/frontend/base/default/template/catalog/navigation/left.phtml index 5cfde4b1e4..d7b8125d22 100644 --- a/app/design/frontend/base/default/template/catalog/navigation/left.phtml +++ b/app/design/frontend/base/default/template/catalog/navigation/left.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/base/default/template/catalog/navigation/top.phtml b/app/design/frontend/base/default/template/catalog/navigation/top.phtml index f5914a1e08..26bd72708f 100644 --- a/app/design/frontend/base/default/template/catalog/navigation/top.phtml +++ b/app/design/frontend/base/default/template/catalog/navigation/top.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/base/default/template/catalog/product/compare/list.phtml b/app/design/frontend/base/default/template/catalog/product/compare/list.phtml index 00d5bb460e..5af0427ec3 100644 --- a/app/design/frontend/base/default/template/catalog/product/compare/list.phtml +++ b/app/design/frontend/base/default/template/catalog/product/compare/list.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* @var $this Mage_Catalog_Block_Product_Compare_List */ @@ -71,7 +71,7 @@ helper('wishlist')->isAllow()) : ?>
    @@ -74,7 +75,7 @@ $canApplyMsrp = Mage::helper('catalog')->canApplyMsrp($_item->getProduct(), Mage helper('wishlist')->isAllowInCart()) : ?> - + __('Move'); ?> typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> @@ -225,7 +226,7 @@ $canApplyMsrp = Mage::helper('catalog')->canApplyMsrp($_item->getProduct(), Mage helper('checkout')->getSubtotalInclTax($_item); ?> typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> diff --git a/app/design/frontend/base/default/template/checkout/cart/noItems.phtml b/app/design/frontend/base/default/template/checkout/cart/noItems.phtml index f8f4ad1c4d..a250788582 100644 --- a/app/design/frontend/base/default/template/checkout/cart/noItems.phtml +++ b/app/design/frontend/base/default/template/checkout/cart/noItems.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -29,6 +29,8 @@
    getMessagesBlock()->getGroupedHtml() ?> + getChildHtml('checkout_cart_empty_widget'); ?>

    __('You have no items in your shopping cart.') ?>

    __('Click here to continue shopping.', $this->getContinueShoppingUrl()) ?>

    + getChildHtml('shopping.cart.table.after'); ?>
    diff --git a/app/design/frontend/base/default/template/checkout/cart/render/default.phtml b/app/design/frontend/base/default/template/checkout/cart/render/default.phtml index 9eda84bc04..bf7952ac6b 100644 --- a/app/design/frontend/base/default/template/checkout/cart/render/default.phtml +++ b/app/design/frontend/base/default/template/checkout/cart/render/default.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ @@ -41,7 +41,7 @@
    - + __('Move'); ?> - + __('Move'); ?>
    getLabelProperties()?>> getStrong()):?> - getLabel()?> + escapeHtml($_total->getLabel());?> - getLabel()?> + escapeHtml($_total->getLabel());?> getValueProperties()?>> diff --git a/app/design/frontend/base/default/template/sales/order/trackinginfo.phtml b/app/design/frontend/base/default/template/sales/order/trackinginfo.phtml index bd6c6635c7..93337cb36b 100644 --- a/app/design/frontend/base/default/template/sales/order/trackinginfo.phtml +++ b/app/design/frontend/base/default/template/sales/order/trackinginfo.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/base/default/template/sales/order/view.phtml b/app/design/frontend/base/default/template/sales/order/view.phtml index 99769e25e0..00458fdade 100644 --- a/app/design/frontend/base/default/template/sales/order/view.phtml +++ b/app/design/frontend/base/default/template/sales/order/view.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/base/default/template/sales/payment/form/billing/agreement.phtml b/app/design/frontend/base/default/template/sales/payment/form/billing/agreement.phtml index 8e2ade9429..986aaced57 100644 --- a/app/design/frontend/base/default/template/sales/payment/form/billing/agreement.phtml +++ b/app/design/frontend/base/default/template/sales/payment/form/billing/agreement.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/base/default/template/sales/recurring/grid.phtml b/app/design/frontend/base/default/template/sales/recurring/grid.phtml index 1adf2bd237..47a16debd3 100644 --- a/app/design/frontend/base/default/template/sales/recurring/grid.phtml +++ b/app/design/frontend/base/default/template/sales/recurring/grid.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/base/default/template/sales/recurring/profile/view.phtml b/app/design/frontend/base/default/template/sales/recurring/profile/view.phtml index 7de4ee8cff..1aafd0f1d7 100644 --- a/app/design/frontend/base/default/template/sales/recurring/profile/view.phtml +++ b/app/design/frontend/base/default/template/sales/recurring/profile/view.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/base/default/template/sales/recurring/profile/view/info.phtml b/app/design/frontend/base/default/template/sales/recurring/profile/view/info.phtml index 38bef14b69..fa931d9707 100644 --- a/app/design/frontend/base/default/template/sales/recurring/profile/view/info.phtml +++ b/app/design/frontend/base/default/template/sales/recurring/profile/view/info.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/base/default/template/sales/recurring/profiles.phtml b/app/design/frontend/base/default/template/sales/recurring/profiles.phtml index 05d99802ab..945de336ce 100644 --- a/app/design/frontend/base/default/template/sales/recurring/profiles.phtml +++ b/app/design/frontend/base/default/template/sales/recurring/profiles.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/base/default/template/sales/reorder/sidebar.phtml b/app/design/frontend/base/default/template/sales/reorder/sidebar.phtml index 2fdf176482..8d3490ff7c 100644 --- a/app/design/frontend/base/default/template/sales/reorder/sidebar.phtml +++ b/app/design/frontend/base/default/template/sales/reorder/sidebar.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/base/default/template/sales/widget/guest/form.phtml b/app/design/frontend/base/default/template/sales/widget/guest/form.phtml index 614e626236..c9c12da7e2 100644 --- a/app/design/frontend/base/default/template/sales/widget/guest/form.phtml +++ b/app/design/frontend/base/default/template/sales/widget/guest/form.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /** @var $this Mage_Sales_Block_Widget_Guest_Form */ diff --git a/app/design/frontend/base/default/template/sendfriend/send.phtml b/app/design/frontend/base/default/template/sendfriend/send.phtml index 7c0d8e976e..9cf0ae2494 100644 --- a/app/design/frontend/base/default/template/sendfriend/send.phtml +++ b/app/design/frontend/base/default/template/sendfriend/send.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* @var $this Mage_Sendfriend_Block_Send */ diff --git a/app/design/frontend/base/default/template/shipping/tracking/ajax.phtml b/app/design/frontend/base/default/template/shipping/tracking/ajax.phtml index 91c289cf65..c29c61e5d4 100644 --- a/app/design/frontend/base/default/template/shipping/tracking/ajax.phtml +++ b/app/design/frontend/base/default/template/shipping/tracking/ajax.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/base/default/template/shipping/tracking/popup.phtml b/app/design/frontend/base/default/template/shipping/tracking/popup.phtml index 5b350dcc74..abe7448594 100644 --- a/app/design/frontend/base/default/template/shipping/tracking/popup.phtml +++ b/app/design/frontend/base/default/template/shipping/tracking/popup.phtml @@ -20,12 +20,12 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ -/* @var $this Mage_Shipping_Block_Tracking_Popup */ ?> -getTrackingInfo() ?> + +getTrackingInfo(); ?>

    __('Tracking Information'); ?>

    @@ -45,12 +45,12 @@
    __('Tracking Number:'); ?>getTracking(); ?>escapeHtml($track->getTracking()); ?>
    __('Carrier:'); ?>getCarrierTitle(); ?>escapeHtml($track->getCarrierTitle()); ?>
    __('Track:'); ?>getUrl(); ?>escapeHtml($track->getUrl()); ?>
    - getTotal()->getTitle() ?> + escapeHtml($this->getTotal()->getTitle()) ?> helper('checkout')->formatPrice($this->getShippingExcludeTax()) ?> diff --git a/app/design/frontend/base/default/template/tax/checkout/subtotal.phtml b/app/design/frontend/base/default/template/tax/checkout/subtotal.phtml index c17f15eae9..af57374446 100644 --- a/app/design/frontend/base/default/template/tax/checkout/subtotal.phtml +++ b/app/design/frontend/base/default/template/tax/checkout/subtotal.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /** diff --git a/app/design/frontend/base/default/template/tax/checkout/tax.phtml b/app/design/frontend/base/default/template/tax/checkout/tax.phtml index 491aaa0586..195f31b69d 100644 --- a/app/design/frontend/base/default/template/tax/checkout/tax.phtml +++ b/app/design/frontend/base/default/template/tax/checkout/tax.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /** @@ -45,7 +45,7 @@
    getLabelProperties()?>> - + escapeHtml($rate['title']); ?> (%) diff --git a/app/design/frontend/base/default/template/wishlist/button/share.phtml b/app/design/frontend/base/default/template/wishlist/button/share.phtml new file mode 100644 index 0000000000..65f0667bb8 --- /dev/null +++ b/app/design/frontend/base/default/template/wishlist/button/share.phtml @@ -0,0 +1,30 @@ + + +getWishlist()->getItemsCount()): ?> + + diff --git a/app/design/frontend/base/default/template/wishlist/button/tocart.phtml b/app/design/frontend/base/default/template/wishlist/button/tocart.phtml new file mode 100644 index 0000000000..70922fad21 --- /dev/null +++ b/app/design/frontend/base/default/template/wishlist/button/tocart.phtml @@ -0,0 +1,30 @@ + + +getWishlist()->getItemsCount() && $this->getWishlist()->isSalable()): ?> + + diff --git a/app/design/frontend/base/default/template/wishlist/button/update.phtml b/app/design/frontend/base/default/template/wishlist/button/update.phtml new file mode 100644 index 0000000000..8fa47d07b0 --- /dev/null +++ b/app/design/frontend/base/default/template/wishlist/button/update.phtml @@ -0,0 +1,30 @@ + + +getWishlist()->getItemsCount()): ?> + + diff --git a/app/design/frontend/base/default/template/wishlist/email/items.phtml b/app/design/frontend/base/default/template/wishlist/email/items.phtml index fd8c6469e6..ded418821a 100644 --- a/app/design/frontend/base/default/template/wishlist/email/items.phtml +++ b/app/design/frontend/base/default/template/wishlist/email/items.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* @var $this Mage_Wishlist_Block_Share_Email_Items */ diff --git a/app/design/frontend/base/default/template/wishlist/email/rss.phtml b/app/design/frontend/base/default/template/wishlist/email/rss.phtml index 28892e9ea3..df9ad4816b 100644 --- a/app/design/frontend/base/default/template/wishlist/email/rss.phtml +++ b/app/design/frontend/base/default/template/wishlist/email/rss.phtml @@ -20,12 +20,12 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?>

    __("RSS link to %s's wishlist",$this->helper('wishlist')->getCustomerName()) ?>
    - helper('wishlist')->getRssUrl(); ?> + helper('wishlist')->getRssUrl($this->getWishlistId()); ?>

    diff --git a/app/design/frontend/base/default/template/wishlist/item/column/cart.phtml b/app/design/frontend/base/default/template/wishlist/item/column/cart.phtml new file mode 100644 index 0000000000..612fa81cbf --- /dev/null +++ b/app/design/frontend/base/default/template/wishlist/item/column/cart.phtml @@ -0,0 +1,54 @@ +getItem(); +$product = $item->getProduct(); +?> +
    +getPriceHtml($product);?> +
    +canHaveQty() && $item->getProduct()->isVisibleInSiteVisibility()): ?> + + +isSaleable()): ?> + + + getIsSalable()): ?> +

    __('In stock') ?>

    + +

    __('Out of stock') ?>

    + + +
    +getSortedChildren() as $childName):?> + getChildHtml($childName, false);?> + +isVisibleInSiteVisibility()): ?> +

    __('Edit') ?>

    + +
    diff --git a/app/design/frontend/base/default/template/wishlist/item/column/image.phtml b/app/design/frontend/base/default/template/wishlist/item/column/image.phtml new file mode 100644 index 0000000000..292bd596f1 --- /dev/null +++ b/app/design/frontend/base/default/template/wishlist/item/column/image.phtml @@ -0,0 +1,33 @@ +getItem(); +$product = $item->getProduct(); +?> + + <?php echo $this->escapeHtml($product->getName()) ?> + diff --git a/app/design/frontend/base/default/template/wishlist/item/column/info.phtml b/app/design/frontend/base/default/template/wishlist/item/column/info.phtml new file mode 100644 index 0000000000..895a0b6bd9 --- /dev/null +++ b/app/design/frontend/base/default/template/wishlist/item/column/info.phtml @@ -0,0 +1,40 @@ +getItem(); +$product = $item->getProduct(); +?> +

    escapeHtml($product->getName()) ?>

    +
    escapeHtml($this->stripTags($product->getShortDescription()));?>
    + +getSortedChildren()): ?> +
    + getSortedChildren() as $childName):?> + getChildHtml($childName, false);?> + +
    + diff --git a/app/design/frontend/base/default/template/wishlist/item/column/remove.phtml b/app/design/frontend/base/default/template/wishlist/item/column/remove.phtml new file mode 100644 index 0000000000..15ea90eff9 --- /dev/null +++ b/app/design/frontend/base/default/template/wishlist/item/column/remove.phtml @@ -0,0 +1,29 @@ + +__('Remove item');?> diff --git a/app/design/frontend/base/default/template/wishlist/item/configure/addto.phtml b/app/design/frontend/base/default/template/wishlist/item/configure/addto.phtml index 5588ac60bd..7f720b8146 100644 --- a/app/design/frontend/base/default/template/wishlist/item/configure/addto.phtml +++ b/app/design/frontend/base/default/template/wishlist/item/configure/addto.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -29,7 +29,7 @@ helper('wishlist')->getUpdateUrl($_wishlistItem); ?>
    - - - - - - - - - - - - - - - - getWishlistItems() as $item): ?> - getProduct(); - $isVisibleProduct = $product->isVisibleInSiteVisibility(); - ?> - - - - - - - - - -
    __('Product') ?>__('Comment') ?>__('Added On') ?>__('Add to Cart') ?> 
    - <?php echo $this->escapeHtml($product->getName()) ?> -

    escapeHtml($product->getName()) ?>

    - getPriceHtml($product) ?> - getDetailsHtml($item) ?> -
    - - - getFormatedDate($item->getAddedAt()) ?> - - canHaveQty() && $isVisibleProduct): ?> -

    - - isSaleable()): ?> - - - - -

    __('Out of stock') ?>

    - - -

    __('Edit') ?>

    - -
    - __('Remove item')?> -
    - -
    - - isSaleable()):?> - - - -
    -
    - - -

    __('You have no items in your wishlist.') ?>

    - - + +

    __('You have no items in your wishlist.') ?>

    + +
    + getChild('control_buttons')->toHtml();?> +
    +
    + - function addWItemToCart(itemId) { - var url = 'getItemAddToCartUrl('%item%') ?>'; - url = url.gsub('%item%', itemId); - var form = $('wishlist-view-form'); - if (form) { - var input = form['qty[' + itemId + ']']; - if (input) { - var separator = (url.indexOf('?') >= 0) ? '&' : '?'; - url += separator + input.name + '=' + encodeURIComponent(input.value); - } + - - + //]]> + + + getChildHtml('bottom'); ?> + diff --git a/app/design/frontend/base/default/template/xmlconnect/pbridge/result.phtml b/app/design/frontend/base/default/template/xmlconnect/pbridge/result.phtml index d76d8bd0c2..9a1ddad9b8 100755 --- a/app/design/frontend/base/default/template/xmlconnect/pbridge/result.phtml +++ b/app/design/frontend/base/default/template/xmlconnect/pbridge/result.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/default/blank/etc/widget.xml b/app/design/frontend/default/blank/etc/widget.xml index 0f571585d2..638dcff349 100644 --- a/app/design/frontend/default/blank/etc/widget.xml +++ b/app/design/frontend/default/blank/etc/widget.xml @@ -21,7 +21,7 @@ * * @category design * @package default_blank - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/design/frontend/default/default/etc/widget.xml b/app/design/frontend/default/default/etc/widget.xml index 1f43bcea57..7b64744d67 100644 --- a/app/design/frontend/default/default/etc/widget.xml +++ b/app/design/frontend/default/default/etc/widget.xml @@ -21,7 +21,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/design/frontend/default/iphone/etc/widget.xml b/app/design/frontend/default/iphone/etc/widget.xml index e2e5932480..66eab25c6b 100644 --- a/app/design/frontend/default/iphone/etc/widget.xml +++ b/app/design/frontend/default/iphone/etc/widget.xml @@ -21,7 +21,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/design/frontend/default/iphone/layout/catalog.xml b/app/design/frontend/default/iphone/layout/catalog.xml index d07b9be2cf..656f3473c2 100644 --- a/app/design/frontend/default/iphone/layout/catalog.xml +++ b/app/design/frontend/default/iphone/layout/catalog.xml @@ -21,7 +21,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ @@ -44,9 +44,6 @@ Default layout, loads most of the pages - - - @@ -68,11 +65,11 @@ Default layout, loads most of the pages - + - + diff --git a/app/design/frontend/default/iphone/layout/catalogsearch.xml b/app/design/frontend/default/iphone/layout/catalogsearch.xml index 301618798f..c0fae3e2bf 100644 --- a/app/design/frontend/default/iphone/layout/catalogsearch.xml +++ b/app/design/frontend/default/iphone/layout/catalogsearch.xml @@ -21,7 +21,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/default/iphone/layout/checkout.xml b/app/design/frontend/default/iphone/layout/checkout.xml index a4a0c40371..bb723a1556 100644 --- a/app/design/frontend/default/iphone/layout/checkout.xml +++ b/app/design/frontend/default/iphone/layout/checkout.xml @@ -21,7 +21,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/default/iphone/layout/cms.xml b/app/design/frontend/default/iphone/layout/cms.xml index eda9fc12f5..a1f7caa774 100644 --- a/app/design/frontend/default/iphone/layout/cms.xml +++ b/app/design/frontend/default/iphone/layout/cms.xml @@ -21,7 +21,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/design/frontend/default/iphone/layout/contacts.xml b/app/design/frontend/default/iphone/layout/contacts.xml index 5c50f406bd..83e6f65108 100644 --- a/app/design/frontend/default/iphone/layout/contacts.xml +++ b/app/design/frontend/default/iphone/layout/contacts.xml @@ -21,7 +21,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/design/frontend/default/iphone/layout/customer.xml b/app/design/frontend/default/iphone/layout/customer.xml index ae39782fe1..48ee8fa6dd 100644 --- a/app/design/frontend/default/iphone/layout/customer.xml +++ b/app/design/frontend/default/iphone/layout/customer.xml @@ -21,7 +21,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/default/iphone/layout/page.xml b/app/design/frontend/default/iphone/layout/page.xml index 814beb045c..e5a957550a 100644 --- a/app/design/frontend/default/iphone/layout/page.xml +++ b/app/design/frontend/default/iphone/layout/page.xml @@ -21,7 +21,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -65,6 +65,7 @@ Default layout, loads most of the pages + diff --git a/app/design/frontend/default/iphone/layout/persistent.xml b/app/design/frontend/default/iphone/layout/persistent.xml index 3608710cba..427223b3a0 100644 --- a/app/design/frontend/default/iphone/layout/persistent.xml +++ b/app/design/frontend/default/iphone/layout/persistent.xml @@ -21,7 +21,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/design/frontend/default/iphone/layout/review.xml b/app/design/frontend/default/iphone/layout/review.xml index e6eb492821..54e855fb28 100644 --- a/app/design/frontend/default/iphone/layout/review.xml +++ b/app/design/frontend/default/iphone/layout/review.xml @@ -21,7 +21,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/default/iphone/layout/sendfriend.xml b/app/design/frontend/default/iphone/layout/sendfriend.xml index b865f7eada..96d1dd400f 100644 --- a/app/design/frontend/default/iphone/layout/sendfriend.xml +++ b/app/design/frontend/default/iphone/layout/sendfriend.xml @@ -21,7 +21,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/design/frontend/default/iphone/layout/tag.xml b/app/design/frontend/default/iphone/layout/tag.xml index eae6804ea3..fc9888ec5f 100644 --- a/app/design/frontend/default/iphone/layout/tag.xml +++ b/app/design/frontend/default/iphone/layout/tag.xml @@ -21,7 +21,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/default/iphone/template/bundle/sales/order/items/renderer.phtml b/app/design/frontend/default/iphone/template/bundle/sales/order/items/renderer.phtml index b5275b5047..5a71eae303 100644 --- a/app/design/frontend/default/iphone/template/bundle/sales/order/items/renderer.phtml +++ b/app/design/frontend/default/iphone/template/bundle/sales/order/items/renderer.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/default/iphone/template/catalog/layer/view.phtml b/app/design/frontend/default/iphone/template/catalog/layer/view.phtml index 317f477402..9d57c48577 100644 --- a/app/design/frontend/default/iphone/template/catalog/layer/view.phtml +++ b/app/design/frontend/default/iphone/template/catalog/layer/view.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/default/iphone/template/catalog/navigation/top.phtml b/app/design/frontend/default/iphone/template/catalog/navigation/top.phtml index f766d75a72..a48fa28b19 100644 --- a/app/design/frontend/default/iphone/template/catalog/navigation/top.phtml +++ b/app/design/frontend/default/iphone/template/catalog/navigation/top.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/default/iphone/template/catalog/product/compare/list.phtml b/app/design/frontend/default/iphone/template/catalog/product/compare/list.phtml index 11bfa1d419..27def95c51 100644 --- a/app/design/frontend/default/iphone/template/catalog/product/compare/list.phtml +++ b/app/design/frontend/default/iphone/template/catalog/product/compare/list.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* @var $this Mage_Catalog_Block_Product_Compare_List */ @@ -63,7 +63,7 @@ helper('wishlist')->isAllow()) : ?>
    helper('tax')->displayCartBothPrices()): ?> colspan="2"> @@ -164,7 +165,7 @@ __('Qty'); ?> typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> @@ -209,7 +210,7 @@ helper('checkout')->getSubtotalInclTax($_item); ?> typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> diff --git a/app/design/frontend/default/iphone/template/checkout/cart/noItemsHeader.phtml b/app/design/frontend/default/iphone/template/checkout/cart/noItemsHeader.phtml index ef2b3d7e07..5eb698c227 100644 --- a/app/design/frontend/default/iphone/template/checkout/cart/noItemsHeader.phtml +++ b/app/design/frontend/default/iphone/template/checkout/cart/noItemsHeader.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/default/iphone/template/checkout/cart/sidebar.phtml b/app/design/frontend/default/iphone/template/checkout/cart/sidebar.phtml index b8e4dbcef7..068d258a3d 100644 --- a/app/design/frontend/default/iphone/template/checkout/cart/sidebar.phtml +++ b/app/design/frontend/default/iphone/template/checkout/cart/sidebar.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/default/iphone/template/checkout/cartheader.phtml b/app/design/frontend/default/iphone/template/checkout/cartheader.phtml index 389e1a3c63..683bb85a4a 100644 --- a/app/design/frontend/default/iphone/template/checkout/cartheader.phtml +++ b/app/design/frontend/default/iphone/template/checkout/cartheader.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/default/iphone/template/checkout/onepage/login.phtml b/app/design/frontend/default/iphone/template/checkout/onepage/login.phtml index efd3e24dc7..f9c3b9270d 100644 --- a/app/design/frontend/default/iphone/template/checkout/onepage/login.phtml +++ b/app/design/frontend/default/iphone/template/checkout/onepage/login.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/default/iphone/template/customer/form/edit.phtml b/app/design/frontend/default/iphone/template/customer/form/edit.phtml index f71f9b9154..544617230b 100644 --- a/app/design/frontend/default/iphone/template/customer/form/edit.phtml +++ b/app/design/frontend/default/iphone/template/customer/form/edit.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/default/iphone/template/customer/form/forgotpassword.phtml b/app/design/frontend/default/iphone/template/customer/form/forgotpassword.phtml index 53d199047b..03fa51d3d9 100644 --- a/app/design/frontend/default/iphone/template/customer/form/forgotpassword.phtml +++ b/app/design/frontend/default/iphone/template/customer/form/forgotpassword.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/default/iphone/template/customer/form/login.phtml b/app/design/frontend/default/iphone/template/customer/form/login.phtml index d6ec03816b..aac0e2ac4a 100644 --- a/app/design/frontend/default/iphone/template/customer/form/login.phtml +++ b/app/design/frontend/default/iphone/template/customer/form/login.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/default/iphone/template/customer/form/register.phtml b/app/design/frontend/default/iphone/template/customer/form/register.phtml index 95a182d397..2416e61394 100644 --- a/app/design/frontend/default/iphone/template/customer/form/register.phtml +++ b/app/design/frontend/default/iphone/template/customer/form/register.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/default/iphone/template/page/1column.phtml b/app/design/frontend/default/iphone/template/page/1column.phtml index 0ff5cce312..e2e6d84c91 100644 --- a/app/design/frontend/default/iphone/template/page/1column.phtml +++ b/app/design/frontend/default/iphone/template/page/1column.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/default/iphone/template/page/html/footer.phtml b/app/design/frontend/default/iphone/template/page/html/footer.phtml index 9719e392dc..267a560dbc 100644 --- a/app/design/frontend/default/iphone/template/page/html/footer.phtml +++ b/app/design/frontend/default/iphone/template/page/html/footer.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/default/iphone/template/page/html/head.phtml b/app/design/frontend/default/iphone/template/page/html/head.phtml index 3ff3587703..7cbdec3679 100644 --- a/app/design/frontend/default/iphone/template/page/html/head.phtml +++ b/app/design/frontend/default/iphone/template/page/html/head.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/default/iphone/template/page/html/header.phtml b/app/design/frontend/default/iphone/template/page/html/header.phtml index 2381c22ae7..ef75ef2c4b 100644 --- a/app/design/frontend/default/iphone/template/page/html/header.phtml +++ b/app/design/frontend/default/iphone/template/page/html/header.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /** diff --git a/app/design/frontend/default/iphone/template/page/html/pager.phtml b/app/design/frontend/default/iphone/template/page/html/pager.phtml index 0283083ce1..005354d89d 100644 --- a/app/design/frontend/default/iphone/template/page/html/pager.phtml +++ b/app/design/frontend/default/iphone/template/page/html/pager.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/default/iphone/template/page/switch/languages.phtml b/app/design/frontend/default/iphone/template/page/switch/languages.phtml index 6ee5459731..b28ee0ac79 100644 --- a/app/design/frontend/default/iphone/template/page/switch/languages.phtml +++ b/app/design/frontend/default/iphone/template/page/switch/languages.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/default/iphone/template/page/switch/stores.phtml b/app/design/frontend/default/iphone/template/page/switch/stores.phtml index a212888862..aa5b449fc7 100644 --- a/app/design/frontend/default/iphone/template/page/switch/stores.phtml +++ b/app/design/frontend/default/iphone/template/page/switch/stores.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/default/iphone/template/persistent/checkout/onepage/login.phtml b/app/design/frontend/default/iphone/template/persistent/checkout/onepage/login.phtml index 54fea170f5..22da54237f 100644 --- a/app/design/frontend/default/iphone/template/persistent/checkout/onepage/login.phtml +++ b/app/design/frontend/default/iphone/template/persistent/checkout/onepage/login.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -108,6 +108,8 @@ --> getQuote()->isAllowedGuestCheckout()): ?> + helper('checkout')->isCustomerMustBeLogged()): ?> +
    diff --git a/app/design/frontend/default/iphone/template/persistent/customer/form/login.phtml b/app/design/frontend/default/iphone/template/persistent/customer/form/login.phtml index 8b6cc0936e..33a3c99ffc 100644 --- a/app/design/frontend/default/iphone/template/persistent/customer/form/login.phtml +++ b/app/design/frontend/default/iphone/template/persistent/customer/form/login.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -73,17 +73,6 @@

    __('By creating an account with our store, you will be able to move through the checkout process faster, store multiple shipping addresses, view and track your orders in your account and more.') ?>

    - isContextCheckout()): ?> - - -
    - -
    -
    -

    __('New Customers') ?>

    -

    __('By creating an account with our store, you will be able to move through the checkout process faster, store multiple shipping addresses, view and track your orders in your account and more.') ?>

    - -
    ' ); } - $form->getElement('website_id')->setAfterElementHtml( - Mage::getBlockSingleton('adminhtml/store_switcher')->getHintHtml() - ); + $renderer = $this->getLayout()->createBlock('adminhtml/store_switcher_form_renderer_fieldset_element'); + $form->getElement('website_id')->setRenderer($renderer); // if (Mage::app()->isSingleStoreMode()) { // $fieldset->removeField('website_id'); diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Edit/Form.php index 79cf05d384..344a90c7f5 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Edit/Form.php @@ -36,9 +36,9 @@ class Mage_Adminhtml_Block_Newsletter_Queue_Edit_Form extends Mage_Adminhtml_Blo { /** * Prepare form for newsletter queue editing. - * Form can be run from newsletter template grid by option "Queue newsletter" + * Form can be run from newsletter template grid by option "Queue newsletter" * or from newsletter queue grid by edit option. - * + * * @param void * @return Mage_Adminhtml_Block_Newsletter_Queue_Edit_Form */ @@ -50,7 +50,8 @@ protected function _prepareForm() $form = new Varien_Data_Form(); $fieldset = $form->addFieldset('base_fieldset', array( - 'legend' => Mage::helper('newsletter')->__('Queue Information') + 'legend' => Mage::helper('newsletter')->__('Queue Information'), + 'class' => 'fieldset-wide' )); $outputFormat = Mage::app()->getLocale()->getDateTimeFormat(Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM); @@ -118,7 +119,9 @@ protected function _prepareForm() 'name' =>'subject', 'label' => Mage::helper('newsletter')->__('Subject'), 'required' => true, - 'value' => ($queue->isNew() ? $queue->getTemplate()->getTemplateSubject() : $queue->getNewsletterSubject()) + 'value' => ( + $queue->isNew() ? $queue->getTemplate()->getTemplateSubject() : $queue->getNewsletterSubject() + ) )); $fieldset->addField('sender_name', 'text', array( @@ -126,7 +129,9 @@ protected function _prepareForm() 'label' => Mage::helper('newsletter')->__('Sender Name'), 'title' => Mage::helper('newsletter')->__('Sender Name'), 'required' => true, - 'value' => ($queue->isNew() ? $queue->getTemplate()->getTemplateSenderName() : $queue->getNewsletterSenderName()) + 'value' => ( + $queue->isNew() ? $queue->getTemplate()->getTemplateSenderName() : $queue->getNewsletterSenderName() + ) )); $fieldset->addField('sender_email', 'text', array( @@ -135,11 +140,14 @@ protected function _prepareForm() 'title' => Mage::helper('newsletter')->__('Sender Email'), 'class' => 'validate-email', 'required' => true, - 'value' => ($queue->isNew() ? $queue->getTemplate()->getTemplateSenderEmail() : $queue->getNewsletterSenderEmail()) + 'value' => ( + $queue->isNew() ? $queue->getTemplate()->getTemplateSenderEmail() : $queue->getNewsletterSenderEmail() + ) )); $widgetFilters = array('is_email_compatible' => 1); - $wysiwygConfig = Mage::getSingleton('cms/wysiwyg_config')->getConfig(array('widget_filters' => $widgetFilters)); + $wysiwygConfig = Mage::getSingleton('cms/wysiwyg_config') + ->getConfig(array('widget_filters' => $widgetFilters)); if ($queue->isNew()) { $fieldset->addField('text','editor', array( @@ -148,7 +156,7 @@ protected function _prepareForm() 'state' => 'html', 'required' => true, 'value' => $queue->getTemplate()->getTemplateText(), - 'style' => 'width:98%; height: 600px;', + 'style' => 'height: 600px;', 'config' => $wysiwygConfig )); @@ -184,7 +192,7 @@ protected function _prepareForm() 'state' => 'html', 'required' => true, 'value' => $queue->getNewsletterText(), - 'style' => 'width:98%; height: 600px;', + 'style' => 'height: 600px;', 'config' => $wysiwygConfig )); @@ -192,7 +200,7 @@ protected function _prepareForm() 'name' =>'styles', 'label' => Mage::helper('newsletter')->__('Newsletter Styles'), 'value' => $queue->getNewsletterStyles(), - 'style' => 'width:98%; height: 300px;', + 'style' => 'height: 300px;', )); } diff --git a/app/code/core/Mage/Adminhtml/Block/Page/Menu.php b/app/code/core/Mage/Adminhtml/Block/Page/Menu.php index c551e023ac..5634f0a448 100644 --- a/app/code/core/Mage/Adminhtml/Block/Page/Menu.php +++ b/app/code/core/Mage/Adminhtml/Block/Page/Menu.php @@ -275,4 +275,36 @@ protected function _callbackSecretKey($match) return Mage_Adminhtml_Model_Url::SECRET_KEY_PARAM_NAME . '/' . $this->_url->getSecretKey($match[1], $match[2]); } + + /** + * Get menu level HTML code + * + * @param array $menu + * @param int $level + * @return string + */ + public function getMenuLevel($menu, $level = 0) + { + $html = '
      ' . PHP_EOL; + foreach ($menu as $item) { + $html .= '
    • ' + . $this->escapeHtml($item['label']) . '' . PHP_EOL; + + if (!empty($item['children'])) { + $html .= $this->getMenuLevel($item['children'], $level + 1); + } + $html .= '
    • ' . PHP_EOL; + } + $html .= '
    ' . PHP_EOL; + + return $html; + } } diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Tab/Main.php b/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Tab/Main.php index dc6e9a0980..b0a6f55c0d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Tab/Main.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Tab/Main.php @@ -108,7 +108,7 @@ protected function _prepareForm() 'name' => 'description', 'label' => Mage::helper('catalogrule')->__('Description'), 'title' => Mage::helper('catalogrule')->__('Description'), - 'style' => 'width: 98%; height: 100px;', + 'style' => 'height: 100px;', )); $fieldset->addField('is_active', 'select', array( @@ -130,14 +130,15 @@ protected function _prepareForm() )); $model->setWebsiteIds($websiteId); } else { - $fieldset->addField('website_ids', 'multiselect', array( + $field = $fieldset->addField('website_ids', 'multiselect', array( 'name' => 'website_ids[]', 'label' => Mage::helper('catalogrule')->__('Websites'), 'title' => Mage::helper('catalogrule')->__('Websites'), 'required' => true, - 'values' => Mage::getSingleton('adminhtml/system_store')->getWebsiteValuesForForm(), - 'after_element_html' => Mage::getBlockSingleton('adminhtml/store_switcher')->getHintHtml() + 'values' => Mage::getSingleton('adminhtml/system_store')->getWebsiteValuesForForm() )); + $renderer = $this->getLayout()->createBlock('adminhtml/store_switcher_form_renderer_fieldset_element'); + $field->setRenderer($renderer); } $fieldset->addField('customer_group_ids', 'multiselect', array( diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Main.php b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Main.php index 9a7f6df0ed..241eb8a0b7 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Main.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Main.php @@ -107,7 +107,7 @@ protected function _prepareForm() 'name' => 'description', 'label' => Mage::helper('salesrule')->__('Description'), 'title' => Mage::helper('salesrule')->__('Description'), - 'style' => 'width: 98%; height: 100px;', + 'style' => 'height: 100px;', )); $fieldset->addField('is_active', 'select', array( @@ -129,19 +129,19 @@ protected function _prepareForm() $websiteId = Mage::app()->getStore(true)->getWebsiteId(); $fieldset->addField('website_ids', 'hidden', array( 'name' => 'website_ids[]', - 'value' => $websiteId, - 'after_element_html' => Mage::getBlockSingleton('adminhtml/store_switcher')->getHintHtml() + 'value' => $websiteId )); $model->setWebsiteIds($websiteId); } else { - $fieldset->addField('website_ids', 'multiselect', array( + $field = $fieldset->addField('website_ids', 'multiselect', array( 'name' => 'website_ids[]', 'label' => Mage::helper('salesrule')->__('Websites'), 'title' => Mage::helper('salesrule')->__('Websites'), 'required' => true, - 'values' => Mage::getSingleton('adminhtml/system_store')->getWebsiteValuesForForm(), - 'after_element_html' => Mage::getBlockSingleton('adminhtml/store_switcher')->getHintHtml() + 'values' => Mage::getSingleton('adminhtml/system_store')->getWebsiteValuesForForm() )); + $renderer = $this->getLayout()->createBlock('adminhtml/store_switcher_form_renderer_fieldset_element'); + $field->setRenderer($renderer); } $customerGroups = Mage::getResourceModel('customer/group_collection')->load()->toOptionArray(); diff --git a/app/code/core/Mage/Adminhtml/Block/Rating/Edit/Tab/Form.php b/app/code/core/Mage/Adminhtml/Block/Rating/Edit/Tab/Form.php index 60ecf278ff..de2b8ffc32 100644 --- a/app/code/core/Mage/Adminhtml/Block/Rating/Edit/Tab/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Rating/Edit/Tab/Form.php @@ -106,12 +106,13 @@ protected function _prepareForm() 'legend' => Mage::helper('rating')->__('Rating Visibility') )); - $fieldset->addField('stores', 'multiselect', array( + $field = $fieldset->addField('stores', 'multiselect', array( 'label' => Mage::helper('rating')->__('Visible In'), 'name' => 'stores[]', - 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(), - 'after_element_html' => Mage::getBlockSingleton('adminhtml/store_switcher')->getHintHtml() + 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm() )); + $renderer = $this->getLayout()->createBlock('adminhtml/store_switcher_form_renderer_fieldset_element'); + $field->setRenderer($renderer); $fieldset->addField('position', 'text', array( 'label' => Mage::helper('rating')->__('Sort Order'), diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Config/Form/Field/YtdStart.php b/app/code/core/Mage/Adminhtml/Block/Report/Config/Form/Field/YtdStart.php index cf16cab47e..b29e6afc11 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Config/Form/Field/YtdStart.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Config/Form/Field/YtdStart.php @@ -40,7 +40,7 @@ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element) for ($i = 1; $i <= 12; $i++) { $_months[$i] = Mage::app()->getLocale() ->date(mktime(null,null,null,$i)) - ->get(Zend_date::MONTH_NAME); + ->get(Zend_Date::MONTH_NAME); } $_days = array(); diff --git a/app/code/core/Mage/Adminhtml/Block/Review/Add/Form.php b/app/code/core/Mage/Adminhtml/Block/Review/Add/Form.php index 54d28bd2a2..45ed9edf95 100644 --- a/app/code/core/Mage/Adminhtml/Block/Review/Add/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Review/Add/Form.php @@ -68,13 +68,14 @@ protected function _prepareForm() * Check is single store mode */ if (!Mage::app()->isSingleStoreMode()) { - $fieldset->addField('select_stores', 'multiselect', array( + $field = $fieldset->addField('select_stores', 'multiselect', array( 'label' => Mage::helper('review')->__('Visible In'), 'required' => true, 'name' => 'select_stores[]', 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(), - 'after_element_html' => Mage::getBlockSingleton('adminhtml/store_switcher')->getHintHtml() )); + $renderer = $this->getLayout()->createBlock('adminhtml/store_switcher_form_renderer_fieldset_element'); + $field->setRenderer($renderer); } $fieldset->addField('nickname', 'text', array( @@ -97,7 +98,7 @@ protected function _prepareForm() 'name' => 'detail', 'title' => Mage::helper('review')->__('Review'), 'label' => Mage::helper('review')->__('Review'), - 'style' => 'width: 98%; height: 600px;', + 'style' => 'height: 600px;', 'required' => true, )); diff --git a/app/code/core/Mage/Adminhtml/Block/Review/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Review/Edit/Form.php index 4646545bd2..d9efa34bde 100644 --- a/app/code/core/Mage/Adminhtml/Block/Review/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Review/Edit/Form.php @@ -96,13 +96,14 @@ protected function _prepareForm() * Check is single store mode */ if (!Mage::app()->isSingleStoreMode()) { - $fieldset->addField('select_stores', 'multiselect', array( + $field = $fieldset->addField('select_stores', 'multiselect', array( 'label' => Mage::helper('review')->__('Visible In'), 'required' => true, 'name' => 'stores[]', 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(), - 'after_element_html' => Mage::getBlockSingleton('adminhtml/store_switcher')->getHintHtml() )); + $renderer = $this->getLayout()->createBlock('adminhtml/store_switcher_form_renderer_fieldset_element'); + $field->setRenderer($renderer); $review->setSelectStores($review->getStores()); } else { diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form/Address.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form/Address.php index b9b5694486..b00f89d4a7 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form/Address.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form/Address.php @@ -166,7 +166,7 @@ protected function _prepareForm() } } } - if (!$this->_form->getElement('country_id')->getValue()) { + if (is_null($this->_form->getElement('country_id')->getValue())) { $this->_form->getElement('country_id')->setValue( Mage::helper('core')->getDefaultCountry($this->getStore()) ); diff --git a/app/code/core/Mage/Adminhtml/Block/Sitemap/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Sitemap/Edit/Form.php index ced91e6be8..725795ad2b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sitemap/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Sitemap/Edit/Form.php @@ -81,15 +81,16 @@ protected function _prepareForm() )); if (!Mage::app()->isSingleStoreMode()) { - $fieldset->addField('store_id', 'select', array( + $field = $fieldset->addField('store_id', 'select', array( 'label' => Mage::helper('sitemap')->__('Store View'), 'title' => Mage::helper('sitemap')->__('Store View'), 'name' => 'store_id', 'required' => true, 'value' => $model->getStoreId(), 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(), - 'after_element_html' => Mage::getBlockSingleton('adminhtml/store_switcher')->getHintHtml() )); + $renderer = $this->getLayout()->createBlock('adminhtml/store_switcher_form_renderer_fieldset_element'); + $field->setRenderer($renderer); } else { $fieldset->addField('store_id', 'hidden', array( diff --git a/app/code/core/Mage/Adminhtml/Block/Store/Switcher.php b/app/code/core/Mage/Adminhtml/Block/Store/Switcher.php index df939db2f1..a0b83f2697 100644 --- a/app/code/core/Mage/Adminhtml/Block/Store/Switcher.php +++ b/app/code/core/Mage/Adminhtml/Block/Store/Switcher.php @@ -251,7 +251,7 @@ public function getHintHtml() . ' href="'. $this->escapeUrl($url) . '"' . ' onclick="this.target=\'_blank\'"' . ' title="' . $this->__('What is this?') . '"' - . ' class="link-storeScope">' + . ' class="link-store-scope">' . $this->__('What is this?') . ''; } diff --git a/app/code/core/Mage/Adminhtml/Block/Store/Switcher/Form/Renderer/Fieldset/Element.php b/app/code/core/Mage/Adminhtml/Block/Store/Switcher/Form/Renderer/Fieldset/Element.php new file mode 100644 index 0000000000..64f8c4514a --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Block/Store/Switcher/Form/Renderer/Fieldset/Element.php @@ -0,0 +1,84 @@ + + */ +class Mage_Adminhtml_Block_Store_Switcher_Form_Renderer_Fieldset_Element + extends Mage_Adminhtml_Block_Widget_Form_Renderer_Fieldset_Element + implements Varien_Data_Form_Element_Renderer_Interface +{ + /** + * Form element which re-rendering + * + * @var Varien_Data_Form_Element_Fieldset + */ + protected $_element; + + /** + * Constructor + */ + protected function _construct() + { + $this->setTemplate('store/switcher/form/renderer/fieldset/element.phtml'); + } + + /** + * Retrieve an element + * + * @return Varien_Data_Form_Element_Fieldset + */ + public function getElement() + { + return $this->_element; + } + + /** + * Render element + * + * @param Varien_Data_Form_Element_Abstract $element + * @return string + */ + public function render(Varien_Data_Form_Element_Abstract $element) + { + $this->_element = $element; + return $this->toHtml(); + } + + /** + * Return html for store switcher hint + * + * @return string + */ + public function getHintHtml() + { + return Mage::getBlockSingleton('adminhtml/store_switcher')->getHintHtml(); + } +} diff --git a/app/code/core/Mage/Adminhtml/Block/System/Design/Edit/Tab/General.php b/app/code/core/Mage/Adminhtml/Block/System/Design/Edit/Tab/General.php index 6035f890a2..9c38b9bc31 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Design/Edit/Tab/General.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Design/Edit/Tab/General.php @@ -33,14 +33,15 @@ protected function _prepareForm() $fieldset = $form->addFieldset('general', array('legend'=>Mage::helper('core')->__('General Settings'))); if (!Mage::app()->isSingleStoreMode()) { - $fieldset->addField('store_id', 'select', array( + $field = $fieldset->addField('store_id', 'select', array( 'label' => Mage::helper('core')->__('Store'), 'title' => Mage::helper('core')->__('Store'), 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(), 'name' => 'store_id', 'required' => true, - 'after_element_html' => Mage::getBlockSingleton('adminhtml/store_switcher')->getHintHtml() )); + $renderer = $this->getLayout()->createBlock('adminhtml/store_switcher_form_renderer_fieldset_element'); + $field->setRenderer($renderer); } else { $fieldset->addField('store_id', 'hidden', array( 'name' => 'store_id', diff --git a/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Form.php b/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Form.php index 86d77e3c93..31e8d6e4a8 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Form.php @@ -45,15 +45,10 @@ public function __construct() protected function _prepareForm() { - $rateId = (int)$this->getRequest()->getParam('rate'); - $rateObject = new Varien_Object(); - $rateModel = Mage::getSingleton('tax/calculation_rate'); - $rateObject->setData($rateModel->getData()); - + $rateObject = new Varien_Object(Mage::getSingleton('tax/calculation_rate')->getData()); $form = new Varien_Data_Form(); - $countries = Mage::getModel('adminhtml/system_config_source_country') - ->toOptionArray(); + $countries = Mage::getModel('adminhtml/system_config_source_country')->toOptionArray(); unset($countries[0]); if (!$rateObject->hasTaxCountryId()) { @@ -69,127 +64,84 @@ protected function _prepareForm() ->addCountryFilter($rateObject->getTaxCountryId()); $regions = $regionCollection->toOptionArray(); - if ($regions) { $regions[0]['label'] = '*'; } else { - $regions = array(array('value'=>'', 'label'=>'*')); + $regions = array(array('value' => '', 'label' => '*')); } - $fieldset = $form->addFieldset('base_fieldset', array('legend'=>Mage::helper('tax')->__('Tax Rate Information'))); + $fieldset = $form->addFieldset('base_fieldset', array('legend' => Mage::helper('tax')->__('Tax Rate Information'))); - if( $rateObject->getTaxCalculationRateId() > 0 ) { - $fieldset->addField('tax_calculation_rate_id', 'hidden', - array( - 'name' => "tax_calculation_rate_id", - 'value' => $rateObject->getTaxCalculationRateId() - ) - ); + if ($rateObject->getTaxCalculationRateId() > 0) { + $fieldset->addField('tax_calculation_rate_id', 'hidden', array( + 'name' => 'tax_calculation_rate_id', + 'value' => $rateObject->getTaxCalculationRateId() + )); } - $fieldset->addField('code', 'text', - array( - 'name' => 'code', - 'label' => Mage::helper('tax')->__('Tax Identifier'), - 'title' => Mage::helper('tax')->__('Tax Identifier'), - 'class' => 'required-entry', - 'value' => $rateModel->getCode(), - 'required' => true, - ) - ); - - $fieldset->addField('tax_country_id', 'select', - array( - 'name' => 'tax_country_id', - 'label' => Mage::helper('tax')->__('Country'), - 'required' => true, - 'values' => $countries - ) - ); + $fieldset->addField('code', 'text', array( + 'name' => 'code', + 'label' => Mage::helper('tax')->__('Tax Identifier'), + 'title' => Mage::helper('tax')->__('Tax Identifier'), + 'class' => 'required-entry', + 'required' => true, + )); - $fieldset->addField('tax_region_id', 'select', - array( - 'name' => 'tax_region_id', - 'label' => Mage::helper('tax')->__('State'), - 'values' => $regions - ) - ); + $fieldset->addField('tax_country_id', 'select', array( + 'name' => 'tax_country_id', + 'label' => Mage::helper('tax')->__('Country'), + 'required' => true, + 'values' => $countries + )); - /* FIXME!!! {* - $fieldset->addField('tax_county_id', 'select', - array( - 'name' => 'tax_county_id', - 'label' => Mage::helper('tax')->__('County'), - 'values' => array( - array( - 'label' => '*', - 'value' => '' - ) - ), - 'value' => $rateObject->getTaxCountyId() - ) - ); - } */ + $fieldset->addField('tax_region_id', 'select', array( + 'name' => 'tax_region_id', + 'label' => Mage::helper('tax')->__('State'), + 'values' => $regions + )); $fieldset->addField('zip_is_range', 'select', array( - 'name' => 'zip_is_range', - 'label' => Mage::helper('tax')->__('Zip/Post is Range'), - 'options' => array( - '0' => Mage::helper('tax')->__('No'), - '1' => Mage::helper('tax')->__('Yes'), - ) + 'name' => 'zip_is_range', + 'label' => Mage::helper('tax')->__('Zip/Post is Range'), + 'options' => array( + '0' => Mage::helper('tax')->__('No'), + '1' => Mage::helper('tax')->__('Yes'), + ) )); if (!$rateObject->hasTaxPostcode()) { $rateObject->setTaxPostcode(Mage::getStoreConfig(Mage_Tax_Model_Config::CONFIG_XML_PATH_DEFAULT_POSTCODE)); } - $fieldset->addField('tax_postcode', 'text', - array( - 'name' => 'tax_postcode', - 'label' => Mage::helper('tax')->__('Zip/Post Code'), - 'note' => Mage::helper('tax')->__("'*' - matches any; 'xyz*' - matches any that begins on 'xyz' and not longer than %d.", Mage::helper('tax')->getPostCodeSubStringLength()), - ) - ); - - $fieldset->addField('zip_from', 'text', - array( - 'name' => 'zip_from', - 'label' => Mage::helper('tax')->__('Range From'), - 'value' => $rateObject->getZipFrom(), - 'required' => true, - 'maxlength' => 9, - 'class' => 'validate-digits' - ) - ); + $fieldset->addField('tax_postcode', 'text', array( + 'name' => 'tax_postcode', + 'label' => Mage::helper('tax')->__('Zip/Post Code'), + 'note' => Mage::helper('tax')->__("'*' - matches any; 'xyz*' - matches any that begins on 'xyz' and not longer than %d.", Mage::helper('tax')->getPostCodeSubStringLength()), + )); - $fieldset->addField('zip_to', 'text', - array( - 'name' => 'zip_to', - 'label' => Mage::helper('tax')->__('Range To'), - 'value' => $rateObject->getZipTo(), - 'required' => true, - 'maxlength' => 9, - 'class' => 'validate-digits' - ) - ); + $fieldset->addField('zip_from', 'text', array( + 'name' => 'zip_from', + 'label' => Mage::helper('tax')->__('Range From'), + 'required' => true, + 'maxlength' => 9, + 'class' => 'validate-digits' + )); - if ($rateObject->getRate()) { - $value = 1*$rateObject->getRate(); - } else { - $value = 0; - } + $fieldset->addField('zip_to', 'text', array( + 'name' => 'zip_to', + 'label' => Mage::helper('tax')->__('Range To'), + 'required' => true, + 'maxlength' => 9, + 'class' => 'validate-digits' + )); - $fieldset->addField('rate', 'text', - array( - 'name' => "rate", - 'label' => Mage::helper('tax')->__('Rate Percent'), - 'title' => Mage::helper('tax')->__('Rate Percent'), - 'value' => number_format($value, 4), - 'required' => true, - 'class' => 'validate-not-negative-number' - ) - ); + $fieldset->addField('rate', 'text', array( + 'name' => 'rate', + 'label' => Mage::helper('tax')->__('Rate Percent'), + 'title' => Mage::helper('tax')->__('Rate Percent'), + 'required' => true, + 'class' => 'validate-not-negative-number' + )); $form->setAction($this->getUrl('*/tax_rate/save')); $form->setUseContainer(true); @@ -200,18 +152,23 @@ protected function _prepareForm() $form->addElement(Mage::getBlockSingleton('adminhtml/tax_rate_title_fieldset')->setLegend(Mage::helper('tax')->__('Tax Titles'))); } - $form->setValues($rateObject->getData()); + $rateData = $rateObject->getData(); + if ($rateObject->getZipIsRange()) { + list($rateData['zip_from'], $rateData['zip_to']) = explode('-', $rateData['tax_postcode']); + } + $form->setValues($rateData); $this->setForm($form); - $this->setChild('form_after', + $this->setChild( + 'form_after', $this->getLayout()->createBlock('adminhtml/widget_form_element_dependence') - ->addFieldMap("zip_is_range", 'zip_is_range') - ->addFieldMap("tax_postcode", 'tax_postcode') - ->addFieldMap("zip_from", 'zip_from') - ->addFieldMap("zip_to", 'zip_to') - ->addFieldDependence('zip_from', 'zip_is_range', '1') - ->addFieldDependence('zip_to', 'zip_is_range', '1') - ->addFieldDependence('tax_postcode', 'zip_is_range', '0') + ->addFieldMap('zip_is_range', 'zip_is_range') + ->addFieldMap('tax_postcode', 'tax_postcode') + ->addFieldMap('zip_from', 'zip_from') + ->addFieldMap('zip_to', 'zip_to') + ->addFieldDependence('zip_from', 'zip_is_range', '1') + ->addFieldDependence('zip_to', 'zip_is_range', '1') + ->addFieldDependence('tax_postcode', 'zip_is_range', '0') ); return parent::_prepareForm(); diff --git a/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit/Form.php index f47cc35fce..0d4ca91d97 100644 --- a/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit/Form.php @@ -157,8 +157,9 @@ protected function _prepareForm() 'values' => $stores, 'disabled' => true, 'value' => $formValues['store_id'], - 'after_element_html' => Mage::getBlockSingleton('adminhtml/store_switcher')->getHintHtml() )); + $renderer = $this->getLayout()->createBlock('adminhtml/store_switcher_form_renderer_fieldset_element'); + $element->setRenderer($renderer); if ($noStoreError) { $element->setAfterElementHtml($noStoreError); } diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php index 915e6dc9a4..c5c38be9b0 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php @@ -801,7 +801,7 @@ public function setDefaultFilter($filter) /** * Retrieve grid export types * - * @return array + * @return array|false */ public function getExportTypes() { diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Customer/GroupAutoAssign.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Cookie.php similarity index 56% rename from app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Customer/GroupAutoAssign.php rename to app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Cookie.php index 84c37fe375..17dbcf270b 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Customer/GroupAutoAssign.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Cookie.php @@ -25,33 +25,13 @@ */ /** - * Auto-assign customer group Model + * Config Cookie Restriction mode backend * * @category Mage * @package Mage_Adminhtml * @author Magento Core Team */ -class Mage_Adminhtml_Model_System_Config_Backend_Customer_GroupAutoAssign extends Mage_Core_Model_Config_Data +class Mage_Adminhtml_Model_System_Config_Backend_Cookie extends Mage_Core_Model_Config_Data { - /** - * If merchant country is not in EU, VAT Validation should be disabled - * - * @return Mage_Core_Model_Abstract - */ - protected function _beforeSave() - { - $storeId = $this->getScopeId(); - $merchantCountry = Mage::getStoreConfig('general/store_information/merchant_country', $storeId); - - if (!Mage::helper('core')->isCountryInEU($merchantCountry, $storeId)) { - Mage::getConfig()->saveConfig( - Mage_Customer_Helper_Address::XML_PATH_VAT_VALIDATION_ENABLED, - 0, - $this->getScope(), - $storeId - ); - } - - return parent::_beforeSave(); - } + protected $_eventPrefix = 'adminhtml_system_config_backend_cookie'; } diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Email/Logo.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Email/Logo.php index a02a2f024f..4cf9be100b 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Email/Logo.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Email/Logo.php @@ -78,14 +78,17 @@ protected function _addWhetherScopeInfo() * * Save changes and delete file if "delete" option passed * - * @return Mage_Adminhtml_Model_System_Config_Backend_Email_logo + * @return Mage_Adminhtml_Model_System_Config_Backend_Email_Logo */ protected function _beforeSave() { - $value = $this->getValue(); - if (is_array($value) && !empty($value['delete'])) { + $value = $this->getValue(); + $deleteFlag = (is_array($value) && !empty($value['delete'])); + $fileTmpName = $_FILES['groups']['tmp_name'][$this->getGroupId()]['fields'][$this->getField()]['value']; + + if ($this->getOldValue() && ($fileTmpName || $deleteFlag)) { $io = new Varien_Io_File(); - $io->rm($this->_getUploadRoot(self::UPLOAD_ROOT_TOKEN) . DS . self::UPLOAD_DIR . DS . $value['value']); + $io->rm($this->_getUploadRoot(self::UPLOAD_ROOT_TOKEN) . DS . self::UPLOAD_DIR . DS . $this->getOldValue()); } return parent::_beforeSave(); } diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/File.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/File.php index df8607c06d..11d421d4a8 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/File.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/File.php @@ -48,10 +48,6 @@ class Mage_Adminhtml_Model_System_Config_Backend_File extends Mage_Core_Model_Co protected function _beforeSave() { $value = $this->getValue(); - if (is_array($value) && !empty($value['delete'])) { - $this->setValue(''); - } - if ($_FILES['groups']['tmp_name'][$this->getGroupId()]['fields'][$this->getField()]['value']){ $uploadDir = $this->_getUploadDir(); @@ -80,6 +76,12 @@ protected function _beforeSave() } $this->setValue($filename); } + } else { + if (is_array($value) && !empty($value['delete'])) { + $this->setValue(''); + } else { + $this->unsValue(); + } } return $this; diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Price/Step.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Price/Step.php index 44e9cca44b..4c5de773e1 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Price/Step.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Price/Step.php @@ -31,11 +31,11 @@ public function toOptionArray() return array( array( 'value' => Mage_Catalog_Model_Layer_Filter_Price::RANGE_CALCULATION_AUTO, - 'label' => Mage::helper('adminhtml')->__('Automatic') + 'label' => Mage::helper('adminhtml')->__('Automatic (equalize price ranges)') ), array( 'value' => Mage_Catalog_Model_Layer_Filter_Price::RANGE_CALCULATION_IMPROVED, - 'label' => Mage::helper('adminhtml')->__('Continuous') + 'label' => Mage::helper('adminhtml')->__('Automatic (equalize product counts)') ), array( 'value' => Mage_Catalog_Model_Layer_Filter_Price::RANGE_CALCULATION_MANUAL, diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Yesno.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Yesno.php index aec989e7bc..1c26199109 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Yesno.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Yesno.php @@ -44,4 +44,17 @@ public function toOptionArray() ); } + /** + * Get options in "key-value" format + * + * @return array + */ + public function toArray() + { + return array( + 0 => Mage::helper('adminhtml')->__('No'), + 1 => Mage::helper('adminhtml')->__('Yes'), + ); + } + } diff --git a/app/code/core/Mage/Adminhtml/controllers/Permissions/RoleController.php b/app/code/core/Mage/Adminhtml/controllers/Permissions/RoleController.php index 3ff5a131e5..88ce01896a 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Permissions/RoleController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Permissions/RoleController.php @@ -185,7 +185,7 @@ public function saveRoleAction() } try { - $roleName = Mage::helper('adminhtml')->stripTags($this->getRequest()->getParam('rolename', false)); + $roleName = $this->getRequest()->getParam('rolename', false); $role->setName($roleName) ->setPid($this->getRequest()->getParam('parent_id', false)) diff --git a/app/code/core/Mage/Adminhtml/controllers/System/BackupController.php b/app/code/core/Mage/Adminhtml/controllers/System/BackupController.php index 0267626e67..7dfa172529 100644 --- a/app/code/core/Mage/Adminhtml/controllers/System/BackupController.php +++ b/app/code/core/Mage/Adminhtml/controllers/System/BackupController.php @@ -105,8 +105,8 @@ public function createAction() if (!$turnedOn) { $response->setError( - Mage::helper('backup')->__("Warning! System couldn't put store on the maintenance mode.") . ' ' - . Mage::helper('backup')->__("Please deselect the sufficient check-box, if you want to continue backup's creation") + Mage::helper('backup')->__('You do not have sufficient permissions to enable Maintenance Mode during this operation.') + . ' ' . Mage::helper('backup')->__('Please either unselect the "Put store on the maintenance mode" checkbox or update your permissions to proceed with the backup."') ); $backupManager->setErrorMessage(Mage::helper('backup')->__("System couldn't put store on the maintenance mode")); return $this->getResponse()->setBody($response->toJson()); @@ -233,8 +233,8 @@ public function rollbackAction() if (!$turnedOn) { $response->setError( - Mage::helper('backup')->__("Warning! System couldn't put store on the maintenance mode.") . ' ' - . Mage::helper('backup')->__("Please deselect the sufficient check-box, if you want to continue rollback processing") + Mage::helper('backup')->__('You do not have sufficient permissions to enable Maintenance Mode during this operation.') + . ' ' . Mage::helper('backup')->__('Please either unselect the "Put store on the maintenance mode" checkbox or update your permissions to proceed with the rollback."') ); $backupManager->setErrorMessage(Mage::helper('backup')->__("System couldn't put store on the maintenance mode")); return $this->getResponse()->setBody($response->toJson()); diff --git a/app/code/core/Mage/Adminhtml/controllers/Tax/RateController.php b/app/code/core/Mage/Adminhtml/controllers/Tax/RateController.php index 5ba26a8d42..074f57092b 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Tax/RateController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Tax/RateController.php @@ -110,11 +110,9 @@ public function saveAction() $this->getResponse()->setRedirect($this->getUrl("*/*/")); return true; } catch (Mage_Core_Exception $e) { - //save entered by the user values in session, for re-rendering of form. Mage::getSingleton('adminhtml/session')->setFormData($ratePost); Mage::getSingleton('adminhtml/session')->addError($e->getMessage()); } catch (Exception $e) { - //Mage::getSingleton('adminhtml/session')->addError(Mage::helper('tax')->__('An error occurred while saving this rate.')); Mage::getSingleton('adminhtml/session')->addError($e->getMessage()); } diff --git a/app/code/core/Mage/Adminhtml/etc/config.xml b/app/code/core/Mage/Adminhtml/etc/config.xml index 16d9da1205..8b8af78a8a 100644 --- a/app/code/core/Mage/Adminhtml/etc/config.xml +++ b/app/code/core/Mage/Adminhtml/etc/config.xml @@ -174,6 +174,11 @@ + + + email + + system_emails_forgot_email_template general diff --git a/app/code/core/Mage/Api/Helper/Data.php b/app/code/core/Mage/Api/Helper/Data.php index b604fc672b..2307dcc3fe 100644 --- a/app/code/core/Mage/Api/Helper/Data.php +++ b/app/code/core/Mage/Api/Helper/Data.php @@ -35,6 +35,16 @@ class Mage_Api_Helper_Data extends Mage_Core_Helper_Abstract { const XML_PATH_API_WSI = 'api/config/compliance_wsi'; + /** + * Method to find adapter code depending on WS-I compatibility setting + * + * @return string + */ + public function getV2AdapterCode() + { + return $this->isComplianceWSI() ? 'soap_wsi' : 'soap_v2'; + } + /** * @return boolean */ @@ -165,7 +175,11 @@ public function clearWsiFootprints(&$obj) foreach ($objectKeys as $key) { if (is_object($obj->$key) && isset($obj->$key->complexObjectArray)) { - $obj->$key = $obj->$key->complexObjectArray; + if (is_array($obj->$key->complexObjectArray)) { + $obj->$key = $obj->$key->complexObjectArray; + } else { // for one element array + $obj->$key = array($obj->$key->complexObjectArray); + } $modifiedKeys[] = $key; } } diff --git a/app/code/core/Mage/Api/Model/Config.php b/app/code/core/Mage/Api/Model/Config.php index 625cc3af01..31ff058bc4 100644 --- a/app/code/core/Mage/Api/Model/Config.php +++ b/app/code/core/Mage/Api/Model/Config.php @@ -71,6 +71,24 @@ protected function _construct() return $this; } + /** + * Retrieve adapter aliases from config. + * + * @return array + */ + public function getAdapterAliases() + { + $aliases = array(); + + foreach ($this->getNode('adapter_aliases')->children() as $alias => $adapter) { + $aliases[$alias] = array( + (string) $adapter->suggest_class, // model class name + (string) $adapter->suggest_method // model method name + ); + } + return $aliases; + } + /** * Retrieve all adapters * diff --git a/app/code/core/Mage/Api/Model/Role.php b/app/code/core/Mage/Api/Model/Role.php index 70268c7667..1376281bfc 100644 --- a/app/code/core/Mage/Api/Model/Role.php +++ b/app/code/core/Mage/Api/Model/Role.php @@ -25,7 +25,7 @@ */ /** - * Enter description here ... + * Role item model * * @method Mage_Api_Model_Resource_Role _getResource() * @method Mage_Api_Model_Resource_Role getResource() @@ -48,6 +48,9 @@ */ class Mage_Api_Model_Role extends Mage_Core_Model_Abstract { + /** + * Initialize resource + */ protected function _construct() { $this->_init('api/role'); diff --git a/app/code/core/Mage/Api/Model/Roles.php b/app/code/core/Mage/Api/Model/Roles.php index 3b4173608f..553fd3ea7d 100644 --- a/app/code/core/Mage/Api/Model/Roles.php +++ b/app/code/core/Mage/Api/Model/Roles.php @@ -41,6 +41,8 @@ * @method Mage_Api_Model_Roles setUserId(int $value) * @method string getRoleName() * @method Mage_Api_Model_Roles setRoleName(string $value) + * @method string getName() + * @method Mage_Api_Model_Role setName() setName(string $name) * * @category Mage * @package Mage_Api @@ -48,6 +50,14 @@ */ class Mage_Api_Model_Roles extends Mage_Core_Model_Abstract { + /** + * Filters + * + * @var array + */ + protected $_filters; + + protected function _construct() { $this->_init('api/roles'); @@ -84,8 +94,10 @@ public function getRoleUsers() return $this->getResource()->getRoleUsers($this); } - protected function _buildResourcesArray(Varien_Simplexml_Element $resource=null, $parentName=null, $level=0, $represent2Darray=null, $rawNodes = false, $module = 'adminhtml') - { + protected function _buildResourcesArray( + Varien_Simplexml_Element $resource = null, $parentName = null, $level = 0, $represent2Darray = null, + $rawNodes = false, $module = 'adminhtml' + ) { static $result; if (is_null($resource)) { @@ -94,7 +106,9 @@ protected function _buildResourcesArray(Varien_Simplexml_Element $resource=null, $level = -1; } else { $resourceName = $parentName; - if ($resource->getName()!='title' && $resource->getName()!='sort_order' && $resource->getName() != 'children') { + if ($resource->getName()!='title' && $resource->getName()!='sort_order' + && $resource->getName() != 'children' + ) { $resourceName = (is_null($parentName) ? '' : $parentName.'/').$resource->getName(); //assigning module for its' children nodes @@ -135,4 +149,33 @@ protected function _buildResourcesArray(Varien_Simplexml_Element $resource=null, } } + /** + * Filter data before save + * + * @return Mage_Api_Model_Roles + */ + protected function _beforeSave() + { + $this->filter(); + parent::_beforeSave(); + return $this; + } + + /** + * Filter set data + * + * @return Mage_Api_Model_Roles + */ + public function filter() + { + $data = $this->getData(); + if (!$this->_filters || !$data) { + return $this; + } + /** @var $filter Mage_Core_Model_Input_Filter */ + $filter = Mage::getModel('core/input_filter'); + $filter->setFilters($this->_filters); + $this->setData($filter->filter($data)); + return $this; + } } diff --git a/app/code/core/Mage/Api/Model/Server.php b/app/code/core/Mage/Api/Model/Server.php index 9a24a319ac..a9589c5819 100644 --- a/app/code/core/Mage/Api/Model/Server.php +++ b/app/code/core/Mage/Api/Model/Server.php @@ -43,35 +43,89 @@ class Mage_Api_Model_Server /** * Web service adapter * - * @var Mage_Api_Model_Server_Adaper_Interface + * @var Mage_Api_Model_Server_Adapter_Interface */ protected $_adapter; - public function init(Mage_Api_Controller_Action $controller, $adapter='default', $handler='default') + /** + * Complex retrieve adapter code by calling auxiliary model method + * + * @param string $alias Alias name + * @return string|null Returns NULL if no alias found + */ + public function getAdapterCodeByAlias($alias) + { + /** @var $config Mage_Api_Model_Config */ + $config = Mage::getSingleton('api/config'); + $aliases = $config->getAdapterAliases(); + + if (!isset($aliases[$alias])) { + return null; + } + $object = Mage::getModel($aliases[$alias][0]); + $method = $aliases[$alias][1]; + + if (!method_exists($object, $method)) { + Mage::throwException(Mage::helper('api')->__('Can not find webservice adapter.')); + } + return $object->$method(); + } + + /** + * Initialize server components + * + * @param Mage_Api_Controller_Action $controller + * @param string $adapter Adapter name + * @param string $handler Handler name + * @return Mage_Api_Model_Server + */ + public function init(Mage_Api_Controller_Action $controller, $adapter = 'default', $handler = 'default') + { + $this->initialize($adapter, $handler); + + $this->_adapter->setController($controller); + + return $this; + } + + /** + * Initialize server components. Lightweight implementation of init() method + * + * @param string $adapterCode Adapter code + * @param string $handler OPTIONAL Handler name (if not specified, it will be found from config) + * @return Mage_Api_Model_Server + */ + public function initialize($adapterCode, $handler = null) { - $adapters = Mage::getSingleton('api/config')->getActiveAdapters(); - $handlers = Mage::getSingleton('api/config')->getHandlers(); - $this->_api = $adapter; - if (isset($adapters[$adapter])) { - $adapterModel = Mage::getModel((string) $adapters[$adapter]->model); - /* @var $adapterModel Mage_Api_Model_Server_Adapter_Interface */ + /** @var $helper Mage_Api_Model_Config */ + $helper = Mage::getSingleton('api/config'); + $adapters = $helper->getActiveAdapters(); + + if (isset($adapters[$adapterCode])) { + /** @var $adapterModel Mage_Api_Model_Server_Adapter_Interface */ + $adapterModel = Mage::getModel((string) $adapters[$adapterCode]->model); + if (!($adapterModel instanceof Mage_Api_Model_Server_Adapter_Interface)) { Mage::throwException(Mage::helper('api')->__('Invalid webservice adapter specified.')); } - $this->_adapter = $adapterModel; - $this->_adapter->setController($controller); + $this->_api = $adapterCode; + + // get handler code from config if no handler passed as argument + if (null === $handler && !empty($adapters[$adapterCode]->handler)) { + $handler = (string) $adapters[$adapterCode]->handler; + } + $handlers = $helper->getHandlers(); if (!isset($handlers->$handler)) { Mage::throwException(Mage::helper('api')->__('Invalid webservice handler specified.')); } - $handlerClassName = Mage::getConfig()->getModelClassName((string) $handlers->$handler->model); + $this->_adapter->setHandler($handlerClassName); } else { Mage::throwException(Mage::helper('api')->__('Invalid webservice adapter specified.')); } - return $this; } @@ -96,7 +150,7 @@ public function getApiName() /** * Retrieve web service adapter * - * @return Mage_Api_Model_Server_Adaper_Interface + * @return Mage_Api_Model_Server_Adapter_Interface */ public function getAdapter() { diff --git a/app/code/core/Mage/Api/Model/Server/Adapter/Soap.php b/app/code/core/Mage/Api/Model/Server/Adapter/Soap.php index 7f84c82a99..abc69335bf 100644 --- a/app/code/core/Mage/Api/Model/Server/Adapter/Soap.php +++ b/app/code/core/Mage/Api/Model/Server/Adapter/Soap.php @@ -77,13 +77,22 @@ public function setController(Mage_Api_Controller_Action $controller) } /** - * Retrive webservice api controller + * Retrive webservice api controller. If no controller have been set - emulate it by the use of Varien_Object * - * @return Mage_Api_Controller_Action + * @return Mage_Api_Controller_Action|Varien_Object */ public function getController() { - return $this->getData('controller'); + $controller = $this->getData('controller'); + + if (null === $controller) { + $controller = new Varien_Object( + array('request' => Mage::app()->getRequest(), 'response' => Mage::app()->getResponse()) + ); + + $this->setData('controller', $controller); + } + return $controller; } /** @@ -181,7 +190,7 @@ public function fault($code, $message) /** * Check whether Soap extension is loaded * - * @return boolean + * @return boolean */ protected function _extensionLoaded() { @@ -199,7 +208,9 @@ protected function getWsdlUrl($params = null, $withAuth = true) $urlModel = Mage::getModel('core/url') ->setUseSession(false); - $wsdlUrl = ($params !== null)? $urlModel->getUrl('*/*/*', $params) : $urlModel->getUrl('*/*/*'); + $wsdlUrl = $params !== null + ? $urlModel->getUrl('*/*/*', array('_current' => true, '_query' => $params)) + : $urlModel->getUrl('*/*/*'); if( $withAuth ) { $phpAuthUser = $this->getController()->getRequest()->getServer('PHP_AUTH_USER', false); @@ -227,9 +238,12 @@ protected function _instantiateServer() do { $retry = false; try { - $this->_soap = new Zend_Soap_Server($this->getWsdlUrl(array("wsdl" => 1)), array('encoding' => $apiConfigCharset)); + $this->_soap = new Zend_Soap_Server( + $this->getWsdlUrl(array("wsdl" => 1)), array('encoding' => $apiConfigCharset) + ); } catch (SoapFault $e) { - if (false !== strpos($e->getMessage(), "can't import schema from 'http://schemas.xmlsoap.org/soap/encoding/'")) { + $importMessage = "can't import schema from 'http://schemas.xmlsoap.org/soap/encoding/'"; + if (false !== strpos($e->getMessage(), $importMessage)) { $retry = true; sleep(1); } else { diff --git a/app/code/core/Mage/Api/Model/Server/Adapter/Xmlrpc.php b/app/code/core/Mage/Api/Model/Server/Adapter/Xmlrpc.php index 18b8bebeaf..0241284402 100644 --- a/app/code/core/Mage/Api/Model/Server/Adapter/Xmlrpc.php +++ b/app/code/core/Mage/Api/Model/Server/Adapter/Xmlrpc.php @@ -77,25 +77,33 @@ public function setController(Mage_Api_Controller_Action $controller) } /** - * Retrive webservice api controller + * Retrive webservice api controller. If no controller have been set - emulate it by the use of Varien_Object * - * @return Mage_Api_Controller_Action + * @return Mage_Api_Controller_Action|Varien_Object */ public function getController() { - return $this->getData('controller'); + $controller = $this->getData('controller'); + + if (null === $controller) { + $controller = new Varien_Object( + array('request' => Mage::app()->getRequest(), 'response' => Mage::app()->getResponse()) + ); + + $this->setData('controller', $controller); + } + return $controller; } /** * Run webservice * - * @param Mage_Api_Controller_Action $controller * @return Mage_Api_Model_Server_Adapter_Xmlrpc */ public function run() { $apiConfigCharset = Mage::getStoreConfig("api/config/charset"); - + $this->_xmlRpc = new Zend_XmlRpc_Server(); $this->_xmlRpc->setEncoding($apiConfigCharset) ->setClass($this->getHandler()); diff --git a/app/code/core/Mage/Api/Model/Server/Handler/Abstract.php b/app/code/core/Mage/Api/Model/Server/Handler/Abstract.php index 366e4b2ccd..2661d131fb 100644 --- a/app/code/core/Mage/Api/Model/Server/Handler/Abstract.php +++ b/app/code/core/Mage/Api/Model/Server/Handler/Abstract.php @@ -110,7 +110,7 @@ protected function _isAllowed($resource, $privilege=null) /** * Check session expiration * - * @return boolean + * @return boolean */ protected function _isSessionExpired () { @@ -210,10 +210,14 @@ protected function _prepareResourceModelName($resource) * @param string $apiKey * @return string */ - public function login($username, $apiKey) + public function login($username, $apiKey = null) { - $this->_startSession(); + if (empty($username) || empty($apiKey)) { + return $this->_fault('invalid_request_param'); + } + try { + $this->_startSession(); $this->_getSession()->login($username, $apiKey); } catch (Exception $e) { return $this->_fault('access_denied'); @@ -225,7 +229,7 @@ public function login($username, $apiKey) * Call resource functionality * * @param string $sessionId - * @param string $resourcePath + * @param string $apiPath * @param array $args * @return mixed */ diff --git a/app/code/core/Mage/Api/Model/Server/Wsi/Adapter/Soap.php b/app/code/core/Mage/Api/Model/Server/Wsi/Adapter/Soap.php index f4badbaf8e..327c4ad315 100644 --- a/app/code/core/Mage/Api/Model/Server/Wsi/Adapter/Soap.php +++ b/app/code/core/Mage/Api/Model/Server/Wsi/Adapter/Soap.php @@ -77,21 +77,17 @@ public function run() ->clearHeaders() ->setHeader('Content-Type','text/xml; charset='.$apiConfigCharset) ->setBody( - preg_replace( - '/(\>\<)/i', - ">\n<", + str_replace( + '', + "\n", str_replace( - '', - "\n", - str_replace( - '', - "\n", - preg_replace( - '/<\?xml version="([^\"]+)"([^\>]+)>/i', - '', - $this->_soap->handle() - ) - ) + '', + "\n", + preg_replace( + '/<\?xml version="([^\"]+)"([^\>]+)>/i', + '', + $this->_soap->handle() + ) ) ) ); diff --git a/app/code/core/Mage/Api/Model/Server/Wsi/Handler.php b/app/code/core/Mage/Api/Model/Server/Wsi/Handler.php index fa829c3e18..b1b6711b94 100644 --- a/app/code/core/Mage/Api/Model/Server/Wsi/Handler.php +++ b/app/code/core/Mage/Api/Model/Server/Wsi/Handler.php @@ -91,11 +91,8 @@ public function __call ($function, $args) * @param string $apiKey * @return string */ - public function login($username, $apiKey=null) + public function login($username, $apiKey = null) { - - /** @todo implement WS-I support check */ -// if (is_object($username)) { $apiKey = $username->apiKey; $username = $username->username; @@ -110,7 +107,7 @@ public function login($username, $apiKey=null) * Return called class and method names * * @param String $apiPath - * @return Array + * @return Array */ protected function _getResourceName($apiPath){ @@ -139,7 +136,7 @@ protected function _getResourceName($apiPath){ /** * Return an array of parameters for the callable method. - * + * * @param String $modelName * @param String $methodName * @return Array of ReflectionParameter @@ -171,7 +168,7 @@ public function prepareArgs($params, $args) { if($parameter->isOptional()){ $callArgs[$pName] = $parameter->getDefaultValue(); } else { - Mage::logException(new Exception("Required parameter \"$pName\" is missing.", 0, null)); + Mage::logException(new Exception("Required parameter \"$pName\" is missing.", 0)); $this->_fault('invalid_request_param'); } } diff --git a/app/code/core/Mage/Api/Model/Session.php b/app/code/core/Mage/Api/Model/Session.php index c97d4b38f2..57f0c51d94 100644 --- a/app/code/core/Mage/Api/Model/Session.php +++ b/app/code/core/Mage/Api/Model/Session.php @@ -39,7 +39,7 @@ class Mage_Api_Model_Session extends Mage_Core_Model_Session_Abstract public function start($sessionName=null) { // parent::start($sessionName=null); - $this->_currentSessId = md5(time() . $sessionName); + $this->_currentSessId = md5(time() . uniqid('', true) . $sessionName); $this->sessionIds[] = $this->getSessionId(); return $this; } @@ -83,10 +83,6 @@ public function clear() { public function login($username, $apiKey) { - if (empty($username) || empty($apiKey)) { - return; - } - $user = Mage::getModel('api/user') ->setSessid($this->getSessionId()) ->login($username, $apiKey); @@ -157,7 +153,7 @@ public function isAllowed($resource, $privilege=null) /** * Check session expiration * - * @return boolean + * @return boolean */ public function isSessionExpired ($user) { @@ -187,7 +183,7 @@ public function isLoggedIn($sessId = false) * Renew user by session ID if session not expired * * @param string $sessId - * @return boolean + * @return boolean */ protected function _renewBySessId ($sessId) { diff --git a/app/code/core/Mage/Api/Model/Wsdl/Config/Base.php b/app/code/core/Mage/Api/Model/Wsdl/Config/Base.php index fbe95f1f70..6e6540f1ec 100644 --- a/app/code/core/Mage/Api/Model/Wsdl/Config/Base.php +++ b/app/code/core/Mage/Api/Model/Wsdl/Config/Base.php @@ -45,6 +45,18 @@ class Mage_Api_Model_Wsdl_Config_Base extends Varien_Simplexml_Config public function __construct($sourceData=null) { $this->_elementClass = 'Mage_Api_Model_Wsdl_Config_Element'; + + // remove wsdl parameter from query + $queryParams = Mage::app()->getRequest()->getQuery(); + unset($queryParams['wsdl']); + + // set up default WSDL template variables + $this->_wsdlVariables = new Varien_Object( + array( + 'name' => 'Magento', + 'url' => htmlspecialchars(Mage::getUrl('*/*/*', array('_query' => $queryParams))) + ) + ); parent::__construct($sourceData); } @@ -78,20 +90,14 @@ public function getHandler() */ public function processFileData($text) { + /** @var $template Mage_Core_Model_Email_Template_Filter */ $template = Mage::getModel('core/email_template_filter'); - if (null === $this->_wsdlVariables) { - $this->_wsdlVariables = new Varien_Object(); - $this->_wsdlVariables->setUrl(Mage::getUrl('*/*/*')); - $this->_wsdlVariables->setName('Magento'); - $this->_wsdlVariables->setHandler($this->getHandler()); - } + $this->_wsdlVariables->setHandler($this->getHandler()); $template->setVariables(array('wsdl'=>$this->_wsdlVariables)); - $text = $template->filter($text); - - return $text; + return $template->filter($text); } public function addLoadedFile($file) @@ -113,4 +119,18 @@ public function loadFile($file) } return $this; } + + /** + * Set variable to be used in WSDL template processing + * + * @param string $key Varible key + * @param string $value Variable value + * @return Mage_Api_Model_Wsdl_Config_Base + */ + public function setWsdlVariable($key, $value) + { + $this->_wsdlVariables->setData($key, $value); + + return $this; + } } diff --git a/app/code/core/Mage/Api/etc/adminhtml.xml b/app/code/core/Mage/Api/etc/adminhtml.xml index 10bbb8116b..e2a4909b1e 100644 --- a/app/code/core/Mage/Api/etc/adminhtml.xml +++ b/app/code/core/Mage/Api/etc/adminhtml.xml @@ -37,11 +37,11 @@ 0 - Users + SOAP/XML-RPC - Users 10 - Roles + SOAP/XML-RPC - Roles 20 @@ -67,12 +67,14 @@ 25 - Users + SOAP/XML-RPC - Users adminhtml/api_user + 10 - Roles + SOAP/XML-RPC - Roles adminhtml/api_role + 20 diff --git a/app/code/core/Mage/Api/etc/api.xml b/app/code/core/Mage/Api/etc/api.xml index 6c33f82659..84aa261626 100644 --- a/app/code/core/Mage/Api/etc/api.xml +++ b/app/code/core/Mage/Api/etc/api.xml @@ -27,6 +27,12 @@ --> + + + Mage_Api_Helper_Data + getV2AdapterCode + + api/server_adapter_soap @@ -139,5 +145,148 @@ + + + + + + + Request is executed. + + + + Request is executed. Created new resource. + + + + Request is carried out. + + + + Parameter "%s" is not valid. + + + + + API version "%s" not found. + + + + You must provide an authenticated user for this method. + Token in request is not valid. + + + + Invalid API key + + + + Requested item %s not found. + Requested resource %s not found. + + + + Method "%s" is not allowed. + + + + Api version is required. + + + + + API version "%s" is deprecated. + + Resource "%s" is deprecated. + + + + + + There was unknown error while processing your request. + + There was internal error while processing your request. + + Server has internal error. %s: %s + + + + This resource is not implemented so far. + This method is not implemented so far. + + + + + + + + + + 200 + notification + + + + 201 + notification + + + + 202 + notification + + + + + 400 + error + + + + 400 + error + + + + 401 + error + + + + 403 + error + + + + 404 + error + + + + 405 + error + + + + 406 + error + + + + 410 + error + + + + 500 + error + + + + 501 + error + + + diff --git a/app/code/core/Mage/Api/etc/wsdl2.xml b/app/code/core/Mage/Api/etc/wsdl2.xml index 8d2db7c8a9..117cbcae32 100644 --- a/app/code/core/Mage/Api/etc/wsdl2.xml +++ b/app/code/core/Mage/Api/etc/wsdl2.xml @@ -18,6 +18,25 @@ + + + + + + + + + + + + + + + + + + + @@ -34,7 +53,7 @@ - + diff --git a/app/code/core/Mage/Api/etc/wsi.xml b/app/code/core/Mage/Api/etc/wsi.xml index 0db28ab286..9cac135868 100644 --- a/app/code/core/Mage/Api/etc/wsi.xml +++ b/app/code/core/Mage/Api/etc/wsi.xml @@ -33,7 +33,7 @@ - + diff --git a/app/code/core/Mage/Api2/Block/Adminhtml/Attribute.php b/app/code/core/Mage/Api2/Block/Adminhtml/Attribute.php new file mode 100644 index 0000000000..8a6c6453cb --- /dev/null +++ b/app/code/core/Mage/Api2/Block/Adminhtml/Attribute.php @@ -0,0 +1,48 @@ + + */ +class Mage_Api2_Block_Adminhtml_Attribute extends Mage_Adminhtml_Block_Widget_Grid_Container +{ + /** + * Construct grid container + */ + public function __construct() + { + parent::__construct(); + + $this->_blockGroup = 'api2'; + $this->_controller = 'adminhtml_attribute'; + $this->_headerText = $this->__('REST Attributes'); + $this->_removeButton('add'); + } +} diff --git a/app/code/core/Mage/Api2/Block/Adminhtml/Attribute/Buttons.php b/app/code/core/Mage/Api2/Block/Adminhtml/Attribute/Buttons.php new file mode 100644 index 0000000000..442c15b651 --- /dev/null +++ b/app/code/core/Mage/Api2/Block/Adminhtml/Attribute/Buttons.php @@ -0,0 +1,112 @@ + + */ +class Mage_Api2_Block_Adminhtml_Attribute_Buttons extends Mage_Adminhtml_Block_Template +{ + /** + * Construct + */ + public function __construct() + { + parent::__construct(); + $this->setTemplate('api2/attribute/buttons.phtml'); + } + + /** + * Prepare global layout + * + * @return Mage_Core_Block_Abstract + */ + protected function _prepareLayout() + { + $buttons = array( + 'backButton' => array( + 'label' => $this->__('Back'), + 'onclick' => sprintf("window.location.href='%s';", $this->getUrl('*/*/')), + 'class' => 'back' + ), + 'saveButton' => array( + 'label' => $this->__('Save'), + 'onclick' => 'form.submit(); return false;', + 'class' => 'save' + ), + ); + + foreach ($buttons as $name => $data) { + $button = $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data); + $this->setChild($name, $button); + } + + return parent::_prepareLayout(); + } + + /** + * Get back button HTML + * + * @return string + */ + public function getBackButtonHtml() + { + return $this->getChildHtml('backButton'); + } + + /** + * Get reset button HTML + * + * @return string + */ + public function getResetButtonHtml() + { + return $this->getChildHtml('resetButton'); + } + + /** + * Get save button HTML + * + * @return string + */ + public function getSaveButtonHtml() + { + return $this->getChildHtml('saveButton'); + } + + /** + * Get block caption + * + * @return string + */ + public function getCaption() + { + return $this->__('Edit'); + } +} diff --git a/app/code/core/Mage/Api2/Block/Adminhtml/Attribute/Edit.php b/app/code/core/Mage/Api2/Block/Adminhtml/Attribute/Edit.php new file mode 100644 index 0000000000..3e59a51a09 --- /dev/null +++ b/app/code/core/Mage/Api2/Block/Adminhtml/Attribute/Edit.php @@ -0,0 +1,61 @@ + + */ +class Mage_Api2_Block_Adminhtml_Attribute_Edit extends Mage_Adminhtml_Block_Widget_Form_Container +{ + /** + * Initialize edit form container + */ + public function __construct() + { + $this->_objectId = 'id'; + $this->_blockGroup = 'api2'; + $this->_controller = 'adminhtml_attribute'; + + parent::__construct(); + + $this->_updateButton('save', 'label', $this->__('Save')) + ->_removeButton('delete'); + } + + /** + * Retrieve text for header element depending on loaded page + * + * @return string + */ + public function getHeaderText() + { + $userTypes = Mage_Api2_Model_Auth_User::getUserTypes(); + return $this->__('Edit attribute rules for %s Role', $userTypes[$this->getRequest()->getParam('type')]); + } +} diff --git a/app/code/core/Mage/Api2/Block/Adminhtml/Attribute/Edit/Form.php b/app/code/core/Mage/Api2/Block/Adminhtml/Attribute/Edit/Form.php new file mode 100644 index 0000000000..b917c9340f --- /dev/null +++ b/app/code/core/Mage/Api2/Block/Adminhtml/Attribute/Edit/Form.php @@ -0,0 +1,58 @@ + + */ +class Mage_Api2_Block_Adminhtml_Attribute_Edit_Form extends Mage_Adminhtml_Block_Widget_Form +{ + /** + * Prepare form before rendering HTML + * + * @return Mage_Api2_Block_Adminhtml_Attribute_Edit_Form + */ + protected function _prepareForm() + { + $form = new Varien_Data_Form(array( + 'id' => 'edit_form', + 'action' => $this->getData('action'), + 'method' => 'post' + )); + + + $form->setAction($this->getUrl('*/*/save', array('type' => $this->getRequest()->getParam('type')))) + ->setUseContainer(true); + + $this->setForm($form); + + return parent::_prepareForm(); + } +} diff --git a/app/code/core/Mage/Api2/Block/Adminhtml/Attribute/Grid.php b/app/code/core/Mage/Api2/Block/Adminhtml/Attribute/Grid.php new file mode 100644 index 0000000000..6e06ca5ed5 --- /dev/null +++ b/app/code/core/Mage/Api2/Block/Adminhtml/Attribute/Grid.php @@ -0,0 +1,107 @@ + + */ +class Mage_Api2_Block_Adminhtml_Attribute_Grid extends Mage_Adminhtml_Block_Widget_Grid +{ + /** + * Set grid ID + * + * @param array $attributes + */ + public function __construct($attributes = array()) + { + parent::__construct($attributes); + $this->setId('api2_attributes'); + } + + /** + * Collection object set up + */ + protected function _prepareCollection() + { + $collection = new Varien_Data_Collection(); + + foreach (Mage_Api2_Model_Auth_User::getUserTypes() as $type => $label) { + $collection->addItem( + new Varien_Object(array('user_type_name' => $label, 'user_type_code' => $type)) + ); + } + + $this->setCollection($collection); + } + + /** + * Prepare grid columns + * + * @return Mage_Api2_Block_Adminhtml_Attribute_Grid + */ + protected function _prepareColumns() + { + $this->addColumn('user_type_name', array( + 'header' => $this->__('User Type'), + 'index' => 'user_type_name' + )); + + return parent::_prepareColumns(); + } + + /** + * Disable unnecessary functionality + * + * @return Mage_Api2_Block_Adminhtml_Attribute_Grid + */ + public function _prepareLayout() + { + $this->setFilterVisibility(false); + $this->setPagerVisibility(false); + + return $this; + } + + /** + * Get row URL + * + * @param Varien_Object $row + * @return string|null + */ + public function getRowUrl($row) + { + /** @var $session Mage_Admin_Model_Session */ + $session = Mage::getSingleton('admin/session'); + if ($session->isAllowed('system/api/attributes/edit')) { + return $this->getUrl('*/*/edit', array('type' => $row->getUserTypeCode())); + } + + return null; + } +} diff --git a/app/code/core/Mage/Api2/Block/Adminhtml/Attribute/Tab/Resource.php b/app/code/core/Mage/Api2/Block/Adminhtml/Attribute/Tab/Resource.php new file mode 100644 index 0000000000..f05d1f661e --- /dev/null +++ b/app/code/core/Mage/Api2/Block/Adminhtml/Attribute/Tab/Resource.php @@ -0,0 +1,141 @@ + + * @method Mage_Api2_Model_Acl_Global_Role getRole() + * @method Mage_Api2_Block_Adminhtml_Attribute_Tab_Resource setRole(Mage_Api2_Model_Acl_Global_Role $role) + */ +class Mage_Api2_Block_Adminhtml_Attribute_Tab_Resource extends Mage_Adminhtml_Block_Widget_Form + implements Mage_Adminhtml_Block_Widget_Tab_Interface +{ + /** + * Tree model + * + * @var Mage_Api2_Model_Acl_Global_Rule_Tree + */ + protected $_treeModel = false; + + /** + * Constructor + */ + public function __construct() + { + parent::__construct(); + + $this->setId('api2_attribute_section_resources') + ->setData('default_dir', Varien_Db_Select::SQL_ASC) + ->setData('default_sort', 'sort_order') + ->setData('title', $this->__('Attribute Rules Information')) + ->setData('use_ajax', true); + + $this->_treeModel = Mage::getModel( + 'api2/acl_global_rule_tree', + array('type' => Mage_Api2_Model_Acl_Global_Rule_Tree::TYPE_ATTRIBUTE)); + + /** @var $permissions Mage_Api2_Model_Acl_Filter_Attribute_ResourcePermission */ + $permissions = Mage::getModel('api2/acl_filter_attribute_resourcePermission'); + $permissions->setFilterValue($this->getRequest()->getParam('type')); + $this->_treeModel->setResourcesPermissions($permissions->getResourcesPermissions()) + ->setHasEntityOnlyAttributes($permissions->getHasEntityOnlyAttributes()); + } + + /** + * Get Json Representation of Resource Tree + * + * @return string + */ + public function getResTreeJson() + { + /** @var $helper Mage_Core_Helper_Data */ + $helper = Mage::helper('core'); + return $helper->jsonEncode($this->_treeModel->getTreeResources()); + } + + /** + * Check if everything is allowed + * + * @return boolean + */ + public function getEverythingAllowed() + { + return $this->_treeModel->getEverythingAllowed(); + } + + /** + * Check if tree has entity only attributes + * + * @return bool + */ + public function hasEntityOnlyAttributes() + { + return $this->_treeModel->getHasEntityOnlyAttributes(); + } + + /** + * Get tab label + * + * @return string + */ + public function getTabLabel() + { + return $this->__('ACL Attribute Rules'); + } + + /** + * Get tab title + * + * @return string + */ + public function getTabTitle() + { + return $this->getTabLabel(); + } + + /** + * Whether tab is available + * + * @return bool + */ + public function canShowTab() + { + return true; + } + + /** + * Whether tab is hidden + * + * @return bool + */ + public function isHidden() + { + return false; + } +} diff --git a/app/code/core/Mage/Api2/Block/Adminhtml/Attribute/Tabs.php b/app/code/core/Mage/Api2/Block/Adminhtml/Attribute/Tabs.php new file mode 100644 index 0000000000..a964a95fc9 --- /dev/null +++ b/app/code/core/Mage/Api2/Block/Adminhtml/Attribute/Tabs.php @@ -0,0 +1,47 @@ + + */ +class Mage_Api2_Block_Adminhtml_Attribute_Tabs extends Mage_Adminhtml_Block_Widget_Tabs +{ + /** + * Constructor + */ + public function __construct() + { + parent::__construct(); + + $this->setId('api2_attribute_section_main') + ->setDestElementId('edit_form') + ->setData('title', $this->__('ACL Attributes Information')); + } +} diff --git a/app/code/core/Mage/Api2/Block/Adminhtml/Permissions/User/Edit/Tab/Roles.php b/app/code/core/Mage/Api2/Block/Adminhtml/Permissions/User/Edit/Tab/Roles.php new file mode 100644 index 0000000000..6f3762bd41 --- /dev/null +++ b/app/code/core/Mage/Api2/Block/Adminhtml/Permissions/User/Edit/Tab/Roles.php @@ -0,0 +1,203 @@ + + */ +class Mage_Api2_Block_Adminhtml_Permissions_User_Edit_Tab_Roles + extends Mage_Adminhtml_Block_Widget_Grid + implements Mage_Adminhtml_Block_Widget_Tab_Interface +{ + /** + * Selected API2 roles for grid + * + * @var array + */ + protected $_selectedRoles; + + /** + * Constructor + * Prepare grid parameters + */ + public function __construct() + { + parent::__construct(); + + $this->setId('api2_roles_section') + ->setDefaultSort('sort_order') + ->setDefaultDir(Varien_Db_Select::SQL_ASC) + ->setTitle($this->__('REST Roles Information')) + ->setUseAjax(true); + } + + /** + * Prepare grid collection object + * + * @return Mage_Api2_Block_Adminhtml_Permissions_User_Edit_Tab_Roles + */ + protected function _prepareCollection() + { + /** @var $collection Mage_Api2_Model_Resource_Acl_Global_Role_Collection */ + $collection = Mage::getResourceModel('api2/acl_global_role_collection'); + $collection->addFieldToFilter('entity_id', array('nin' => Mage_Api2_Model_Acl_Global_Role::getSystemRoles())); + + $this->setCollection($collection); + + return parent::_prepareCollection(); + } + + /** + * Prepare grid columns + * + * @return Mage_Api2_Block_Adminhtml_Permissions_User_Edit_Tab_Roles + */ + protected function _prepareColumns() + { + $this->addColumn('assigned_user_role', array( + 'header_css_class' => 'a-center', + 'header' => $this->__('Assigned'), + 'type' => 'radio', + 'html_name' => 'api2_roles[]', + 'values' => $this->_getSelectedRoles(), + 'align' => 'center', + 'index' => 'entity_id' + )); + + $this->addColumn('role_name', array( + 'header' => $this->__('Role Name'), + 'index' => 'role_name' + )); + + return parent::_prepareColumns(); + } + + /** + * Add custom column filter to collection + * + * @param Mage_Adminhtml_Block_Widget_Grid_Column $column + * @return Mage_Api2_Block_Adminhtml_Permissions_User_Edit_Tab_Roles + */ + protected function _addColumnFilterToCollection($column) + { + if ($column->getId() == 'assigned_user_role') { + $userRoles = $this->_getSelectedRoles(); + if ($column->getFilter()->getValue()) { + $this->getCollection()->addFieldToFilter('entity_id', array('in' => $userRoles)); + } elseif (!empty($userRoles)) { + $this->getCollection()->addFieldToFilter('entity_id', array('nin' => $userRoles)); + } else { + $this->getCollection(); + } + } else { + parent::_addColumnFilterToCollection($column); + } + + return $this; + } + + /** + * Get selected API2 roles for grid + * + * @return array + */ + protected function _getSelectedRoles() + { + if (null === $this->_selectedRoles) { + $userRoles = array(); + + /* @var $user Mage_Admin_Model_User */ + $user = Mage::registry('permissions_user'); + if ($user->getId()) { + /** @var $collection Mage_Api2_Model_Resource_Acl_Global_Role_Collection */ + $collection = Mage::getResourceModel('api2/acl_global_role_collection'); + $collection->addFilterByAdminId($user->getId()); + + $userRoles = $collection->getAllIds(); + } + + $this->_selectedRoles = $userRoles; + } + + return $this->_selectedRoles; + } + + /** + * Prepare label for tab + * + * @return string + */ + public function getTabLabel() + { + return $this->__('REST Role'); + } + + /** + * Prepare title for tab + * + * @return string + */ + public function getTabTitle() + { + return $this->__('REST Role'); + } + + /** + * Returns status flag about this tab can be shown or not + * + * @return true + */ + public function canShowTab() + { + return true; + } + + /** + * Returns status flag about this tab hidden or not + * + * @return true + */ + public function isHidden() + { + return false; + } + + /** + * Get controller action url for grid ajax actions + * + * @return string + */ + public function getGridUrl() + { + return $this->getUrl( + '*/api2_role/rolesGrid', + array('user_id' => Mage::registry('permissions_user')->getUserId()) + ); + } +} diff --git a/app/code/core/Mage/Api2/Block/Adminhtml/Roles.php b/app/code/core/Mage/Api2/Block/Adminhtml/Roles.php new file mode 100644 index 0000000000..3e69348fd6 --- /dev/null +++ b/app/code/core/Mage/Api2/Block/Adminhtml/Roles.php @@ -0,0 +1,56 @@ + + */ +class Mage_Api2_Block_Adminhtml_Roles extends Mage_Adminhtml_Block_Widget_Grid_Container +{ + /** + * Construct grid container + */ + public function __construct() + { + parent::__construct(); + + $this->_blockGroup = 'api2'; + $this->_controller = 'adminhtml_roles'; + $this->_headerText = Mage::helper('adminhtml')->__('REST Roles'); + + //check allow edit + /** @var $session Mage_Admin_Model_Session */ + $session = Mage::getSingleton('admin/session'); + if ($session->isAllowed('system/api/roles/add')) { + $this->_updateButton('add', 'label', $this->__('Add Admin Role')); + } else { + $this->_removeButton('add'); + } + } +} diff --git a/app/code/core/Mage/Api2/Block/Adminhtml/Roles/Buttons.php b/app/code/core/Mage/Api2/Block/Adminhtml/Roles/Buttons.php new file mode 100644 index 0000000000..34892fde06 --- /dev/null +++ b/app/code/core/Mage/Api2/Block/Adminhtml/Roles/Buttons.php @@ -0,0 +1,146 @@ + + * @method Mage_Api2_Block_Adminhtml_Roles_Buttons setRole(Mage_Api2_Model_Acl_Global_Role $role) + * @method Mage_Api2_Model_Acl_Global_Role getRole() + */ +class Mage_Api2_Block_Adminhtml_Roles_Buttons extends Mage_Adminhtml_Block_Template +{ + /** + * Construct + */ + public function __construct() + { + parent::__construct(); + $this->setTemplate('api2/role/buttons.phtml'); + } + + /** + * Preparing global layout + * + * @return Mage_Api2_Block_Adminhtml_Roles_Buttons + */ + protected function _prepareLayout() + { + $buttons = array( + 'backButton' => array( + 'label' => Mage::helper('adminhtml')->__('Back'), + 'onclick' => sprintf("window.location.href='%s';", $this->getUrl('*/*/')), + 'class' => 'back' + ), + 'resetButton' => array( + 'label' => Mage::helper('adminhtml')->__('Reset'), + 'onclick' => 'window.location.reload()' + ), + 'saveButton' => array( + 'label' => Mage::helper('adminhtml')->__('Save Role'), + 'onclick' => 'roleForm.submit(); return false;', + 'class' => 'save' + ), + 'deleteButton' => array( + 'label' => Mage::helper('adminhtml')->__('Delete Role'), + 'onclick' => '', //roleId is not set at this moment, so we set script later + 'class' => 'delete' + ), + ); + + foreach ($buttons as $name=>$data) { + $button = $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data); + $this->setChild($name, $button); + } + + return parent::_prepareLayout(); + } + + /** + * Get back button HTML + * + * @return string + */ + public function getBackButtonHtml() + { + return $this->getChildHtml('backButton'); + } + + /** + * Get reset button HTML + * + * @return string + */ + public function getResetButtonHtml() + { + return $this->getChildHtml('resetButton'); + } + + /** + * Get save button HTML + * + * @return string + */ + public function getSaveButtonHtml() + { + return $this->getChildHtml('saveButton'); + } + + /** + * Get delete button HTML + * + * @return string + */ + public function getDeleteButtonHtml() + { + if(!$this->getRole() || !$this->getRole()->getId() + || Mage_Api2_Model_Acl_Global_Role::isSystemRole($this->getRole())) { + + return ''; + } + + $this->getChild('deleteButton')->setData('onclick', sprintf("deleteConfirm('%s', '%s')", + Mage::helper('adminhtml')->__('Are you sure you want to do this?'), + $this->getUrl('*/*/delete', array('id' => $this->getRole()->getId())) + )); + + return $this->getChildHtml('deleteButton'); + } + + /** + * Get block caption + * + * @return string + */ + public function getCaption() + { + return $this->getRole() && $this->getRole()->getId() + ? ($this->__('Edit Role') . " '{$this->escapeHtml($this->getRole()->getRoleName())}'") + : $this->__('Add New Role'); + } +} diff --git a/app/code/core/Mage/Api2/Block/Adminhtml/Roles/Grid.php b/app/code/core/Mage/Api2/Block/Adminhtml/Roles/Grid.php new file mode 100644 index 0000000000..0807b6b9a2 --- /dev/null +++ b/app/code/core/Mage/Api2/Block/Adminhtml/Roles/Grid.php @@ -0,0 +1,149 @@ + + */ +class Mage_Api2_Block_Adminhtml_Roles_Grid extends Mage_Adminhtml_Block_Widget_Grid +{ + /** + * Construct grid block + */ + public function __construct() + { + parent::__construct(); + $this->setId('rolesGrid'); + $this->setUseAjax(true); + $this->setSaveParametersInSession(true); + $this->setDefaultSort('entity_id') + ->setDefaultDir(Varien_Db_Select::SQL_DESC); + } + + /** + * Prepare collection + * + * @return Mage_Api2_Block_Adminhtml_Roles_Grid + */ + protected function _prepareCollection() + { + /** @var $collection Mage_Api2_Model_Resource_Acl_Global_Role_Collection */ + $collection = Mage::getModel('api2/acl_global_role')->getCollection(); + $this->setCollection($collection); + parent::_prepareCollection(); + return $this; + } + + /** + * Prepare columns + * + * @return Mage_Api2_Block_Adminhtml_Roles_Grid + */ + protected function _prepareColumns() + { + $this->addColumn('entity_id', array( + 'header' => Mage::helper('oauth')->__('ID'), + 'index' => 'entity_id', + 'align' => 'right', + 'width' => '50px', + )); + + $this->addColumn('role_name', array( + 'header' => Mage::helper('oauth')->__('Role Name'), + 'index' => 'role_name', + 'escape' => true, + )); + + $this->addColumn('tole_user_type', array( + 'header' => Mage::helper('oauth')->__('User Type'), + 'sortable' => false, + 'frame_callback' => array($this, 'decorateUserType') + )); + + $this->addColumn('created_at', array( + 'header' => Mage::helper('oauth')->__('Created At'), + 'index' => 'created_at' + )); + + parent::_prepareColumns(); + return $this; + } + + /** + * Get grid URL + * + * @return string + */ + public function getGridUrl() + { + return $this->getUrl('*/*/grid', array('_current' => true)); + } + + /** + * Get row URL + * + * @param Mage_Api2_Model_Acl_Global_Role $row + * @return string|null + */ + public function getRowUrl($row) + { + /** @var $session Mage_Admin_Model_Session */ + $session = Mage::getSingleton('admin/session'); + + if ($session->isAllowed('system/api/roles/edit')) { + return $this->getUrl('*/*/edit', array('id' => $row->getId())); + } + return null; + } + + /** + * Decorate 'User Type' column + * + * @param string $renderedValue Rendered value + * @param Mage_OAuth_Model_Token $row + * @param Mage_Adminhtml_Block_Widget_Grid_Column $column + * @param bool $isExport + * @return string + */ + public function decorateUserType($renderedValue, $row, $column, $isExport) + { + switch ($row->getEntityId()) { + case Mage_Api2_Model_Acl_Global_Role::ROLE_GUEST_ID: + $userType = Mage::helper('api2')->__('Guest'); + break; + case Mage_Api2_Model_Acl_Global_Role::ROLE_CUSTOMER_ID: + $userType = Mage::helper('api2')->__('Customer'); + break; + default: + $userType = Mage::helper('api2')->__('Admin'); + break; + } + return $userType; + } +} diff --git a/app/code/core/Mage/Api2/Block/Adminhtml/Roles/Tab/Info.php b/app/code/core/Mage/Api2/Block/Adminhtml/Roles/Tab/Info.php new file mode 100644 index 0000000000..2c587c06b3 --- /dev/null +++ b/app/code/core/Mage/Api2/Block/Adminhtml/Roles/Tab/Info.php @@ -0,0 +1,131 @@ + + * @method Mage_Api2_Model_Acl_Global_Role getRole() + * @method Mage_Api2_Block_Adminhtml_Roles_Tab_Info setRole(Mage_Api2_Model_Acl_Global_Role $role) + */ +class Mage_Api2_Block_Adminhtml_Roles_Tab_Info extends Mage_Adminhtml_Block_Widget_Form + implements Mage_Adminhtml_Block_Widget_Tab_Interface +{ + /** + * Prepare form object + */ + protected function _prepareForm() + { + $form = new Varien_Data_Form(); + + $fieldset = $form->addFieldset('base_fieldset', array( + 'legend' => Mage::helper('adminhtml')->__('Role Information') + )); + + $data = array( + 'name' => 'role_name', + 'label' => Mage::helper('adminhtml')->__('Role Name'), + 'id' => 'role_name', + 'class' => 'required-entry', + 'required' => true, + ); + + if ($this->isHidden()) { + /** @var $helper Mage_Core_Helper_Data */ + $helper = Mage::helper('core'); + + $data['note'] = Mage::helper('api2')->__( + '%s role is protected.', + $helper->escapeHtml($this->getRole()->getRoleName()) + ); + $data['readonly'] = 'readonly'; + } + $fieldset->addField('role_name', 'text', $data); + + $fieldset->addField('entity_id', 'hidden', + array( + 'name' => 'id', + ) + ); + + $fieldset->addField('in_role_users', 'hidden', + array( + 'name' => 'in_role_users', + 'id' => 'in_role_userz', + ) + ); + + $fieldset->addField('in_role_users_old', 'hidden', array('name' => 'in_role_users_old')); + + if ($this->getRole()) { + $form->setValues($this->getRole()->getData()); + } + $this->setForm($form); + } + + /** + * Get tab label + * + * @return string + */ + public function getTabLabel() + { + return Mage::helper('api2')->__('Role Info'); + } + + /** + * Get tab title + * + * @return string + */ + public function getTabTitle() + { + return $this->getTabLabel(); + } + + /** + * Whether tab is available + * + * @return bool + */ + public function canShowTab() + { + return true; + } + + /** + * Whether tab is hidden + * + * @return bool + */ + public function isHidden() + { + return $this->getRole() && Mage_Api2_Model_Acl_Global_Role::isSystemRole($this->getRole()); + } +} diff --git a/app/code/core/Mage/Api2/Block/Adminhtml/Roles/Tab/Resources.php b/app/code/core/Mage/Api2/Block/Adminhtml/Roles/Tab/Resources.php new file mode 100644 index 0000000000..22a9e68726 --- /dev/null +++ b/app/code/core/Mage/Api2/Block/Adminhtml/Roles/Tab/Resources.php @@ -0,0 +1,153 @@ + + * @method Mage_Api2_Model_Acl_Global_Role getRole() + * @method Mage_Api2_Block_Adminhtml_Roles_Tab_Resources setRole(Mage_Api2_Model_Acl_Global_Role $role) + */ +class Mage_Api2_Block_Adminhtml_Roles_Tab_Resources extends Mage_Adminhtml_Block_Widget_Form + implements Mage_Adminhtml_Block_Widget_Tab_Interface +{ + /** + * Role model + * + * @var Mage_Api2_Model_Acl_Global_Role + */ + protected $_role; + + /** + * Tree model + * + * @var Mage_Api2_Model_Acl_Global_Rule_Tree + */ + protected $_treeModel = false; + + /** + * Constructor + */ + public function __construct() + { + parent::__construct(); + + $this->setId('api2_role_section_resources') + ->setData('default_dir', Varien_Db_Select::SQL_ASC) + ->setData('default_sort', 'sort_order') + ->setData('title', Mage::helper('api2')->__('Api Rules Information')) + ->setData('use_ajax', true); + + $this->_treeModel = Mage::getModel( + 'api2/acl_global_rule_tree', array('type' => Mage_Api2_Model_Acl_Global_Rule_Tree::TYPE_PRIVILEGE) + ); + } + + /** + * Get Json Representation of Resource Tree + * + * @return string + */ + public function getResTreeJson() + { + $this->_prepareTreeModel(); + /** @var $helper Mage_Core_Helper_Data */ + $helper = Mage::helper('core'); + return $helper->jsonEncode($this->_treeModel->getTreeResources()); + } + + /** + * Prepare tree model + * + * @return Mage_Api2_Block_Adminhtml_Roles_Tab_Resources + */ + public function _prepareTreeModel() + { + $role = $this->getRole(); + if ($role) { + $permissionModel = $role->getPermissionModel(); + $permissionModel->setFilterValue($role); + $this->_treeModel->setResourcesPermissions($permissionModel->getResourcesPermissions()); + } else { + $role = Mage::getModel('api2/acl_global_role'); + } + $this->_treeModel->setRole($role); + return $this; + } + + /** + * Check if everything is allowed + * + * @return boolean + */ + public function getEverythingAllowed() + { + $this->_prepareTreeModel(); + return $this->_treeModel->getEverythingAllowed(); + } + + /** + * Get tab label + * + * @return string + */ + public function getTabLabel() + { + return Mage::helper('api2')->__('Role API Resources'); + } + + /** + * Get tab title + * + * @return string + */ + public function getTabTitle() + { + return $this->getTabLabel(); + } + + /** + * Whether tab is available + * + * @return bool + */ + public function canShowTab() + { + return true; + } + + /** + * Whether tab is hidden + * + * @return bool + */ + public function isHidden() + { + return false; + } +} diff --git a/app/code/core/Mage/Api2/Block/Adminhtml/Roles/Tab/Users.php b/app/code/core/Mage/Api2/Block/Adminhtml/Roles/Tab/Users.php new file mode 100644 index 0000000000..ff8dcdb45d --- /dev/null +++ b/app/code/core/Mage/Api2/Block/Adminhtml/Roles/Tab/Users.php @@ -0,0 +1,239 @@ + + * @method Mage_Api2_Model_Acl_Global_Role getRole() + * @method Mage_Api2_Block_Adminhtml_Roles_Tab_Users setRole(Mage_Api2_Model_Acl_Global_Role $role) + * @method Mage_Api2_Block_Adminhtml_Roles_Tab_Users setUsers(array $users) + * @method Mage_Admin_Model_Resource_User_Collection getCollection() + */ +class Mage_Api2_Block_Adminhtml_Roles_Tab_Users extends Mage_Adminhtml_Block_Widget_Grid + implements Mage_Adminhtml_Block_Widget_Tab_Interface +{ + /** + * Construct grid block + */ + public function __construct() + { + parent::__construct(); + $this->setId('roleUsersGrid'); + $this->setData('use_ajax', true); + $this->setSaveParametersInSession(true); + $this->setDefaultSort('user_id') + ->setDefaultDir(Varien_Db_Select::SQL_DESC); + $this->setDefaultFilter(array('filter_in_role_users'=>1)); + } + + /** + * Prepare collection + * + * @return Mage_Api2_Block_Adminhtml_Roles_Tab_Users + */ + protected function _prepareCollection() + { + /** @var $collection Mage_Admin_Model_Resource_User_Collection */ + $collection = Mage::getModel('admin/user')->getCollection(); + $collection->getSelect()->joinLeft( + array('acl' => $collection->getTable('api2/acl_user')), + 'acl.admin_id = main_table.user_id', + 'role_id' + ); + if ($this->getRole() && $this->getRole()->getId()) { + $collection->addFilter('acl.role_id', $this->getRole()->getId()); + } + + $this->setCollection($collection); + parent::_prepareCollection(); + return $this; + } + + /** + * Prepare columns + * + * @return Mage_Api2_Block_Adminhtml_Roles_Tab_Users + */ + protected function _prepareColumns() + { + $this->addColumn('filter_in_role_users', array( + 'header_css_class' => 'a-center', + 'type' => 'checkbox', + 'name' => 'filter_in_role_users', + 'values' => $this->getUsers(), + 'align' => 'center', + 'index' => 'user_id' + )); + + $this->addColumn('user_id', array( + 'header' => Mage::helper('api2')->__('ID'), 'index' => 'user_id', 'align' => 'right', 'width' => '50px', + )); + + $this->addColumn('username', array( + 'header' => Mage::helper('adminhtml')->__('User Name'), 'align' => 'left', 'index' => 'username' + )); + + $this->addColumn('firstname', array( + 'header' => Mage::helper('adminhtml')->__('First Name'), 'align' => 'left', 'index' => 'firstname' + )); + + $this->addColumn('lastname', array( + 'header' => Mage::helper('adminhtml')->__('Last Name'), 'align' => 'left', 'index' => 'lastname' + )); + + return parent::_prepareColumns(); + } + + /** + * Get grid URL + * + * @return string + */ + public function getGridUrl() + { + return $this->getUrl('*/*/usersGrid', array('_current' => true)); + } + + /** + * Get row URL + * + * @param Mage_Api2_Model_Acl_Global_Role $row + * @return string|null + */ + public function getRowUrl($row) + { + return null; + } + + /** + * Get tab label + * + * @return string + */ + public function getTabLabel() + { + return Mage::helper('api2')->__('Role Users'); + } + + /** + * Get tab title + * + * @return string + */ + public function getTabTitle() + { + return $this->getTabLabel(); + } + + /** + * Whether tab is available + * + * @return bool + */ + public function canShowTab() + { + return !$this->isHidden(); + } + + /** + * Whether tab is hidden + * + * @return bool + */ + public function isHidden() + { + return $this->getRole() && Mage_Api2_Model_Acl_Global_Role::isSystemRole($this->getRole()); + } + + /** + * Render block only when not hidden + * + * @return string + */ + public function _toHtml() + { + if (!$this->isHidden()) { + return parent::_toHtml(); + } + return ''; + } + + /** + * @param Mage_Adminhtml_Block_Widget_Grid_Column $column + * @return Mage_Api2_Block_Adminhtml_Roles_Tab_Users + */ + protected function _addColumnFilterToCollection($column) + { + if ($column->getId() == 'filter_in_role_users') { + $inRoleIds = $this->getUsers(); + if (empty($inRoleIds)) { + $inRoleIds = 0; + } + + if ($column->getFilter()->getValue()) { + $this->getCollection()->addFieldToFilter('user_id', array('in' => $inRoleIds)); + } else { + if($inRoleIds) { + $this->getCollection()->addFieldToFilter('user_id', array('nin' => $inRoleIds)); + } + } + } else { + parent::_addColumnFilterToCollection($column); + } + return $this; + } + + /** + * Get users + * + * @param bool $json + * @return array|string + */ + public function getUsers($json = false) + { + $users = $this->getData('users'); + + if ($json) { + if ($users === array()) { + return '{}'; + } + $jsonUsers = array(); + foreach($users as $usrId) { + $jsonUsers[$usrId] = 0; + } + /** @var $helper Mage_Core_Helper_Data */ + $helper = Mage::helper('core'); + $result = $helper->jsonEncode((object) $jsonUsers); + } else { + $result = array_values($users); + } + + return $result; + } +} diff --git a/app/code/core/Mage/Api2/Block/Adminhtml/Roles/Tabs.php b/app/code/core/Mage/Api2/Block/Adminhtml/Roles/Tabs.php new file mode 100644 index 0000000000..9de62eaaaf --- /dev/null +++ b/app/code/core/Mage/Api2/Block/Adminhtml/Roles/Tabs.php @@ -0,0 +1,65 @@ + + * @method Mage_Api2_Block_Adminhtml_Roles_Tabs setRole(Mage_Api2_Model_Acl_Global_Role $role) + * @method Mage_Api2_Model_Acl_Global_Role getRole() + */ +class Mage_Api2_Block_Adminhtml_Roles_Tabs extends Mage_Adminhtml_Block_Widget_Tabs +{ + + /** + * Constructor + */ + public function __construct() + { + parent::__construct(); + $this->setId('role_info_tabs'); + $this->setDestElementId('role_edit_form'); + $this->setData('title', Mage::helper('api2')->__('Role Information')); + } + + /** + * Hook before html rendering + * + * @return Mage_Api2_Block_Adminhtml_Roles_Tabs + */ + protected function _beforeToHtml() + { + $role = $this->getRole(); + if ($role && Mage_Api2_Model_Acl_Global_Role::isSystemRole($role)) { + $this->setActiveTab('api2_role_section_resources'); + } else { + $this->setActiveTab('api2_role_section_info'); + } + return parent::_beforeToHtml(); + } +} diff --git a/app/code/core/Mage/Api2/Exception.php b/app/code/core/Mage/Api2/Exception.php new file mode 100644 index 0000000000..4752b0c641 --- /dev/null +++ b/app/code/core/Mage/Api2/Exception.php @@ -0,0 +1,50 @@ + + */ +class Mage_Api2_Exception extends Exception +{ + /** + * Exception constructor + * + * @param string $message + * @param int $code + */ + public function __construct($message, $code) + { + if ($code <= 100 || $code >= 599) { + throw new Exception(sprintf('Invalid Exception code "%d"', $code)); + } + + parent::__construct($message, $code); + } +} diff --git a/app/code/core/Mage/Api2/Helper/Data.php b/app/code/core/Mage/Api2/Helper/Data.php new file mode 100644 index 0000000000..48e04c793d --- /dev/null +++ b/app/code/core/Mage/Api2/Helper/Data.php @@ -0,0 +1,198 @@ + + */ +class Mage_Api2_Helper_Data extends Mage_Core_Helper_Abstract +{ + /** + * Request interpret adapters + */ + const XML_PATH_API2_REQUEST_INTERPRETERS = 'global/api2/request/interpreters'; + + /** + * Response render adapters + */ + const XML_PATH_API2_RESPONSE_RENDERS = 'global/api2/response/renders'; + + /**#@+ + * Config paths + */ + const XML_PATH_AUTH_ADAPTERS = 'global/api2/auth_adapters'; + const XML_PATH_USER_TYPES = 'global/api2/user_types'; + /**#@- */ + + /** + * Compare order to be used in adapters list sort + * + * @param int $a + * @param int $b + * @return int + */ + protected static function _compareOrder($a, $b) + { + if ($a['order'] == $b['order']) { + return 0; + } + return ($a['order'] < $b['order']) ? -1 : 1; + } + + /** + * Retrieve Auth adapters info from configuration file as array + * + * @param bool $enabledOnly + * @return array + */ + public function getAuthAdapters($enabledOnly = false) + { + $adapters = Mage::getConfig()->getNode(self::XML_PATH_AUTH_ADAPTERS); + + if (!$adapters) { + return array(); + } + $adapters = $adapters->asArray(); + + if ($enabledOnly) { + foreach ($adapters as $adapter) { + if (empty($adapter['enabled'])) { + unset($adapters); + } + } + $adapters = (array) $adapters; + } + uasort($adapters, array('Mage_Api2_Helper_Data', '_compareOrder')); + + return $adapters; + } + + /** + * Retrieve enabled user types in form of user type => user model pairs + * + * @return array + */ + public function getUserTypes() + { + $userModels = array(); + $types = Mage::getConfig()->getNode(self::XML_PATH_USER_TYPES); + + if ($types) { + foreach ($types->asArray() as $type => $params) { + if (!empty($params['allowed'])) { + $userModels[$type] = $params['model']; + } + } + } + return $userModels; + } + + /** + * Get interpreter type for Request body according to Content-type HTTP header + * + * @return array + */ + public function getRequestInterpreterAdapters() + { + return (array) Mage::app()->getConfig()->getNode(self::XML_PATH_API2_REQUEST_INTERPRETERS); + } + + /** + * Get interpreter type for Request body according to Content-type HTTP header + * + * @return array + */ + public function getResponseRenderAdapters() + { + return (array) Mage::app()->getConfig()->getNode(self::XML_PATH_API2_RESPONSE_RENDERS); + } + + /** + * Check API type support + * + * @param string $type + * @return bool + */ + public function isApiTypeSupported($type) + { + return in_array($type, Mage_Api2_Model_Server::getApiTypes()); + } + + /** + * Get allowed attributes of a rule + * + * @param string $userType + * @param string $resourceId + * @param string $operation One of Mage_Api2_Model_Resource::OPERATION_ATTRIBUTE_... constant + * @return array + */ + public function getAllowedAttributes($userType, $resourceId, $operation) + { + /** @var $resource Mage_Api2_Model_Resource_Acl_Filter_Attribute */ + $resource = Mage::getResourceModel('api2/acl_filter_attribute'); + + $attributes = $resource->getAllowedAttributes($userType, $resourceId, $operation); + + return ($attributes === false || $attributes === null ? array() : explode(',', $attributes)); + } + + /** + * Check if ALL attributes are allowed + * + * @param string $userType + * @return bool + */ + public function isAllAttributesAllowed($userType) + { + /** @var $resource Mage_Api2_Model_Resource_Acl_Filter_Attribute */ + $resource = Mage::getResourceModel('api2/acl_filter_attribute'); + + return $resource->isAllAttributesAllowed($userType); + } + + /** + * Get operation type for specified operation + * + * @param string $operation One of Mage_Api2_Model_Resource::OPERATION_... constant + * @return string One of Mage_Api2_Model_Resource::OPERATION_ATTRIBUTE_... constant + * @throws Exception + */ + public function getTypeOfOperation($operation) + { + if (Mage_Api2_Model_Resource::OPERATION_RETRIEVE === $operation) { + return Mage_Api2_Model_Resource::OPERATION_ATTRIBUTE_READ; + } elseif (Mage_Api2_Model_Resource::OPERATION_CREATE === $operation) { + return Mage_Api2_Model_Resource::OPERATION_ATTRIBUTE_WRITE; + } elseif (Mage_Api2_Model_Resource::OPERATION_UPDATE === $operation) { + return Mage_Api2_Model_Resource::OPERATION_ATTRIBUTE_WRITE; + } else { + throw new Exception('Can not determine operation type'); + } + } +} diff --git a/app/code/core/Mage/Api2/Model/Acl.php b/app/code/core/Mage/Api2/Model/Acl.php new file mode 100644 index 0000000000..296e519c7f --- /dev/null +++ b/app/code/core/Mage/Api2/Model/Acl.php @@ -0,0 +1,187 @@ + + */ +class Mage_Api2_Model_Acl extends Zend_Acl +{ + /** + * REST ACL roles collection + * + * @var Mage_Api2_Model_Resource_Acl_Global_Role_Collection + */ + protected $_rolesCollection; + + /** + * API2 config model instance + * + * @var Mage_Api2_Model_Config + */ + protected $_config; + + /** + * Resource type of request + * + * @var string + */ + protected $_resourceType; + + /** + * Operation of request + * + * @var string + */ + protected $_operation; + + /** + * Constructor + * + * @param array $options + */ + public function __construct($options) + { + if (!isset($options['resource_type']) || empty($options['resource_type'])) { + throw new Exception("Passed parameter 'resource_type' is wrong."); + } + if (!isset($options['operation']) || empty($options['operation'])) { + throw new Exception("Passed parameter 'operation' is wrong."); + } + $this->_resourceType = $options['resource_type']; + $this->_operation = $options['operation']; + + $this->_setResources(); + $this->_setRoles(); + $this->_setRules(); + } + + /** + * Retrieve REST ACL roles collection + * + * @return Mage_Api2_Model_Resource_Acl_Global_Role_Collection + */ + protected function _getRolesCollection() + { + if (null === $this->_rolesCollection) { + $this->_rolesCollection = Mage::getResourceModel('api2/acl_global_role_collection'); + } + return $this->_rolesCollection; + } + + /** + * Retrieve API2 config model instance + * + * @return Mage_Api2_Model_Config + */ + protected function _getConfig() + { + if (null === $this->_config) { + $this->_config = Mage::getModel('api2/config'); + } + return $this->_config; + } + + /** + * Retrieve resources types and set into ACL + * + * @return Mage_Api2_Model_Acl + */ + protected function _setResources() + { + foreach ($this->_getConfig()->getResourcesTypes() as $type) { + $this->addResource($type); + } + return $this; + } + + /** + * Retrieve roles from DB and set into ACL + * + * @return Mage_Api2_Model_Acl + */ + protected function _setRoles() + { + /** @var $role Mage_Api2_Model_Acl_Global_Role */ + foreach ($this->_getRolesCollection() as $role) { + $this->addRole($role->getId()); + } + return $this; + } + + /** + * Retrieve rules data from DB and inject it into ACL + * + * @return Mage_Api2_Model_Acl + */ + protected function _setRules() + { + /** @var $rulesCollection Mage_Api2_Model_Resource_Acl_Global_Rule_Collection */ + $rulesCollection = Mage::getResourceModel('api2/acl_global_rule_collection'); + + /** @var $rule Mage_Api2_Model_Acl_Global_Rule */ + foreach ($rulesCollection as $rule) { + if (Mage_Api2_Model_Acl_Global_Rule::RESOURCE_ALL === $rule->getResourceId()) { + if (in_array($rule->getRoleId(), Mage_Api2_Model_Acl_Global_Role::getSystemRoles())) { + /** @var $role Mage_Api2_Model_Acl_Global_Role */ + $role = $this->_getRolesCollection()->getItemById($rule->getRoleId()); + $privileges = $this->_getConfig()->getResourceUserPrivileges( + $this->_resourceType, + $role->getConfigNodeName() + ); + + if (!array_key_exists($this->_operation, $privileges)) { + continue; + } + } + + $this->allow($rule->getRoleId()); + } else { + $this->allow($rule->getRoleId(), $rule->getResourceId(), $rule->getPrivilege()); + } + } + return $this; + } + + /** + * Adds a Role having an identifier unique to the registry + * OVERRIDE to allow numeric roles identifiers + * + * @param int $roleId Role identifier + * @param Zend_Acl_Role_Interface|string|array $parents + * @return Zend_Acl Provides a fluent interface + */ + public function addRole($roleId, $parents = null) + { + if (!is_numeric($roleId)) { + throw new Exception('Invalid role identifier'); + } + return parent::addRole((string) $roleId); + } +} diff --git a/app/code/core/Mage/Api2/Model/Acl/Filter.php b/app/code/core/Mage/Api2/Model/Acl/Filter.php new file mode 100644 index 0000000000..85517d0516 --- /dev/null +++ b/app/code/core/Mage/Api2/Model/Acl/Filter.php @@ -0,0 +1,193 @@ + + */ +class Mage_Api2_Model_Acl_Filter +{ + /** + * Attributes allowed for use + * + * @var array + */ + protected $_allowedAttributes; + + /** + * A list of attributes to be included into output + * + * @var array + */ + protected $_attributesToInclude; + + /** + * Associated resource model + * + * @var Mage_Api2_Model_Resource + */ + protected $_resource; + + /** + * Object constructor + * + * @param Mage_Api2_Model_Resource $resource + */ + public function __construct(Mage_Api2_Model_Resource $resource) + { + $this->_resource = $resource; + } + + /** + * Return only the data which keys are allowed + * + * @param array $allowedAttributes List of attributes available to use + * @param array $data Associative array attribute to value + * @return array + */ + protected function _filter(array $allowedAttributes, array $data) + { + foreach ($data as $attribute => $value) { + if (!in_array($attribute, $allowedAttributes)) { + unset($data[$attribute]); + } + } + return $data; + } + + /** + * Strip attributes in of collection items + * + * @param array $items + * @return array + */ + public function collectionIn($items) + { + foreach ($items as &$data) { + $data = is_array($data) ? $this->in($data) : array(); + } + return $items; + } + + /** + * Strip attributes out of collection items + * + * @param array $items + * @return array + */ + public function collectionOut($items) + { + foreach ($items as &$data) { + $data = $this->out($data); + } + return $items; + } + + /** + * Fetch array of allowed attributes for given resource type, operation and user type. + * + * @param string $operationType OPTIONAL One of Mage_Api2_Model_Resource::OPERATION_ATTRIBUTE_... constant + * @return array + */ + public function getAllowedAttributes($operationType = null) + { + if (null === $this->_allowedAttributes) { + /** @var $helper Mage_Api2_Helper_Data */ + $helper = Mage::helper('api2/data'); + + if (null === $operationType) { + $operationType = $helper->getTypeOfOperation($this->_resource->getOperation()); + } + if ($helper->isAllAttributesAllowed($this->_resource->getUserType())) { + $this->_allowedAttributes = array_keys($this->_resource->getAvailableAttributes( + $this->_resource->getUserType(), $operationType + )); + } else { + $this->_allowedAttributes = $helper->getAllowedAttributes( + $this->_resource->getUserType(), $this->_resource->getResourceType(), $operationType + ); + } + // force attributes to be no filtered + foreach ($this->_resource->getForcedAttributes() as $forcedAttr) { + if (!in_array($forcedAttr, $this->_allowedAttributes)) { + $this->_allowedAttributes[] = $forcedAttr; + } + } + } + return $this->_allowedAttributes; + } + + /** + * Retrieve a list of attributes to be included in output based on available and requested attributes + * + * @return array + */ + public function getAttributesToInclude() + { + if (null === $this->_attributesToInclude) { + $allowedAttrs = $this->getAllowedAttributes(Mage_Api2_Model_Resource::OPERATION_ATTRIBUTE_READ); + $requestedAttrs = $this->_resource->getRequest()->getRequestedAttributes(); + + if ($requestedAttrs) { + foreach ($allowedAttrs as $allowedAttr) { + if (in_array($allowedAttr, $requestedAttrs)) { + $this->_attributesToInclude[] = $allowedAttr; + } + } + } else { + $this->_attributesToInclude = $allowedAttrs; + } + } + return $this->_attributesToInclude; + } + + /** + * Filter data for write operations + * + * @param array $requestData + * @return array + */ + public function in(array $requestData) + { + $allowedAttributes = $this->getAllowedAttributes(Mage_Api2_Model_Resource::OPERATION_ATTRIBUTE_WRITE); + + return $this->_filter($allowedAttributes, $requestData); + } + + /** + * Filter data before output + * + * @param array $retrievedData + * @return array + */ + public function out(array $retrievedData) + { + return $this->_filter($this->getAttributesToInclude(), $retrievedData); + } +} diff --git a/app/code/core/Mage/Api2/Model/Acl/Filter/Attribute.php b/app/code/core/Mage/Api2/Model/Acl/Filter/Attribute.php new file mode 100644 index 0000000000..4dab281917 --- /dev/null +++ b/app/code/core/Mage/Api2/Model/Acl/Filter/Attribute.php @@ -0,0 +1,77 @@ + + * @method Mage_Api2_Model_Resource_Acl_Filter_Attribute_Collection getCollection() + * @method Mage_Api2_Model_Resource_Acl_Filter_Attribute_Collection getResourceCollection() + * @method Mage_Api2_Model_Resource_Acl_Filter_Attribute getResource() + * @method Mage_Api2_Model_Resource_Acl_Filter_Attribute _getResource() + * @method string getUserType() + * @method Mage_Api2_Model_Acl_Filter_Attribute setUserType() setUserType(string $type) + * @method string getResourceId() + * @method Mage_Api2_Model_Acl_Filter_Attribute setResourceId() setResourceId(string $resource) + * @method string getOperation() + * @method Mage_Api2_Model_Acl_Filter_Attribute setOperation() setOperation(string $operation) + * @method string getAllowedAttributes() + * @method Mage_Api2_Model_Acl_Filter_Attribute setAllowedAttributes() setAllowedAttributes(string $attributes) + */ +class Mage_Api2_Model_Acl_Filter_Attribute extends Mage_Core_Model_Abstract +{ + /** + * Permissions model + * + * @var Mage_Api2_Model_Acl_Filter_Attribute_ResourcePermission + */ + protected $_permissionModel; + + /** + * Initialize resource model + * + * @return void + */ + protected function _construct() + { + $this->_init('api2/acl_filter_attribute'); + } + + /** + * Get pairs resources-permissions for current attribute + * + * @return Mage_Api2_Model_Acl_Filter_Attribute_ResourcePermission + */ + public function getPermissionModel() + { + if (null == $this->_permissionModel) { + $this->_permissionModel = Mage::getModel('api2/acl_filter_attribute_resourcePermission'); + } + return $this->_permissionModel; + } +} diff --git a/app/code/core/Mage/Api2/Model/Acl/Filter/Attribute/Operation.php b/app/code/core/Mage/Api2/Model/Acl/Filter/Attribute/Operation.php new file mode 100644 index 0000000000..1b19c00b0d --- /dev/null +++ b/app/code/core/Mage/Api2/Model/Acl/Filter/Attribute/Operation.php @@ -0,0 +1,67 @@ + + */ +class Mage_Api2_Model_Acl_Filter_Attribute_Operation +{ + /** + * Get options paramets + * + * @return array + */ + static public function toOptionArray() + { + return array( + array( + 'value' => Mage_Api2_Model_Resource::OPERATION_ATTRIBUTE_READ, + 'label' => Mage::helper('api2')->__('Read') + ), + array( + 'value' => Mage_Api2_Model_Resource::OPERATION_ATTRIBUTE_WRITE, + 'label' => Mage::helper('api2')->__('Write') + ) + ); + } + + /** + * Get options in "key-value" format + * + * @return array + */ + static public function toArray() + { + return array( + Mage_Api2_Model_Resource::OPERATION_ATTRIBUTE_READ => Mage::helper('api2')->__('Read'), + Mage_Api2_Model_Resource::OPERATION_ATTRIBUTE_WRITE => Mage::helper('api2')->__('Write') + ); + } +} diff --git a/app/code/core/Mage/Api2/Model/Acl/Filter/Attribute/ResourcePermission.php b/app/code/core/Mage/Api2/Model/Acl/Filter/Attribute/ResourcePermission.php new file mode 100644 index 0000000000..161883174f --- /dev/null +++ b/app/code/core/Mage/Api2/Model/Acl/Filter/Attribute/ResourcePermission.php @@ -0,0 +1,181 @@ + + */ +class Mage_Api2_Model_Acl_Filter_Attribute_ResourcePermission + implements Mage_Api2_Model_Acl_PermissionInterface +{ + /** + * Resources permissions + * + * @var array + */ + protected $_resourcesPermissions; + + /** + * Filter item value + * + * @var string + */ + protected $_userType; + + /** + * Flag if resource has entity only attributes + * + * @var bool + */ + protected $_hasEntityOnlyAttributes = false; + + /** + * Get resources permissions for selected role + * + * @return array + */ + public function getResourcesPermissions() + { + if (null === $this->_resourcesPermissions) { + $rulesPairs = array(); + + if ($this->_userType) { + $allowedAttributes = array(); + + /** @var $rules Mage_Api2_Model_Resource_Acl_Filter_Attribute_Collection */ + $rules = Mage::getResourceModel('api2/acl_filter_attribute_collection'); + $rules->addFilterByUserType($this->_userType); + + foreach ($rules as $rule) { + if (Mage_Api2_Model_Acl_Global_Rule::RESOURCE_ALL === $rule->getResourceId()) { + $rulesPairs[$rule->getResourceId()] = Mage_Api2_Model_Acl_Global_Rule_Permission::TYPE_ALLOW; + } + + /** @var $rule Mage_Api2_Model_Acl_Filter_Attribute */ + if (null !== $rule->getAllowedAttributes()) { + $allowedAttributes[$rule->getResourceId()][$rule->getOperation()] = explode( + ',', $rule->getAllowedAttributes() + ); + } + } + + /** @var $config Mage_Api2_Model_Config */ + $config = Mage::getModel('api2/config'); + + /** @var $operationSource Mage_Api2_Model_Acl_Filter_Attribute_Operation */ + $operationSource = Mage::getModel('api2/acl_filter_attribute_operation'); + + foreach ($config->getResourcesTypes() as $resource) { + $resourceUserPrivileges = $config->getResourceUserPrivileges($resource, $this->_userType); + + if (!$resourceUserPrivileges) { // skip user without any privileges for resource + continue; + } + $operations = $operationSource->toArray(); + + if (empty($resourceUserPrivileges[Mage_Api2_Model_Resource::OPERATION_CREATE]) + && empty($resourceUserPrivileges[Mage_Api2_Model_Resource::OPERATION_UPDATE]) + ) { + unset($operations[Mage_Api2_Model_Resource::OPERATION_ATTRIBUTE_WRITE]); + } + if (empty($resourceUserPrivileges[Mage_Api2_Model_Resource::OPERATION_RETRIEVE])) { + unset($operations[Mage_Api2_Model_Resource::OPERATION_ATTRIBUTE_READ]); + } + if (!$operations) { // skip resource without any operations allowed + continue; + } + try { + /** @var $resourceModel Mage_Api2_Model_Resource */ + $resourceModel = Mage::getModel($config->getResourceModel($resource)); + if ($resourceModel) { + $resourceModel->setResourceType($resource) + ->setUserType($this->_userType); + + foreach ($operations as $operation => $operationLabel) { + if (!$this->_hasEntityOnlyAttributes + && $config->getResourceEntityOnlyAttributes($resource, $this->_userType, $operation) + ) { + $this->_hasEntityOnlyAttributes = true; + } + $availableAttributes = $resourceModel->getAvailableAttributes( + $this->_userType, + $operation + ); + asort($availableAttributes); + foreach ($availableAttributes as $attribute => $attributeLabel) { + $status = isset($allowedAttributes[$resource][$operation]) + && in_array($attribute, $allowedAttributes[$resource][$operation]) + ? Mage_Api2_Model_Acl_Global_Rule_Permission::TYPE_ALLOW + : Mage_Api2_Model_Acl_Global_Rule_Permission::TYPE_DENY; + + $rulesPairs[$resource]['operations'][$operation]['attributes'][$attribute] = array( + 'status' => $status, + 'title' => $attributeLabel + ); + } + } + } + } catch (Exception $e) { + // getModel() throws exception when application is in development mode + Mage::logException($e); + } + } + } + $this->_resourcesPermissions = $rulesPairs; + } + return $this->_resourcesPermissions; + } + + /** + * Set filter value + * + * Set user type + * + * @param string $userType + * @return Mage_Api2_Model_Acl_Filter_Attribute_ResourcePermission + */ + public function setFilterValue($userType) + { + if (!array_key_exists($userType, Mage_Api2_Model_Auth_User::getUserTypes())) { + throw new Exception('Unknown user type.'); + } + $this->_userType = $userType; + return $this; + } + + /** + * Get flag value + * + * @return bool + */ + public function getHasEntityOnlyAttributes() + { + return $this->_hasEntityOnlyAttributes; + } +} diff --git a/app/code/core/Mage/Api2/Model/Acl/Global.php b/app/code/core/Mage/Api2/Model/Acl/Global.php new file mode 100644 index 0000000000..a20b4ae3a6 --- /dev/null +++ b/app/code/core/Mage/Api2/Model/Acl/Global.php @@ -0,0 +1,65 @@ + + */ +class Mage_Api2_Model_Acl_Global +{ + /** + * Check if the operation is allowed on resources of given type type for given user type/role + * + * @param Mage_Api2_Model_Auth_User_Abstract $apiUser + * @param string $resourceType + * @param string $operation + * @return boolean + * @throws Mage_Api2_Exception + */ + public function isAllowed(Mage_Api2_Model_Auth_User_Abstract $apiUser, $resourceType, $operation) + { + // skip user without role, e.g. Customer + if (null === $apiUser->getRole()) { + return true; + } + /** @var $aclInstance Mage_Api2_Model_Acl */ + $aclInstance = Mage::getSingleton( + 'api2/acl', + array('resource_type' => $resourceType, 'operation' => $operation) + ); + + if (!$aclInstance->hasRole($apiUser->getRole())) { + throw new Mage_Api2_Exception('Role not found', Mage_Api2_Model_Server::HTTP_UNAUTHORIZED); + } + if (!$aclInstance->has($resourceType)) { + throw new Mage_Api2_Exception('Resource not found', Mage_Api2_Model_Server::HTTP_NOT_FOUND); + } + return $aclInstance->isAllowed($apiUser->getRole(), $resourceType, $operation); + } +} diff --git a/app/code/core/Mage/Api2/Model/Acl/Global/Role.php b/app/code/core/Mage/Api2/Model/Acl/Global/Role.php new file mode 100644 index 0000000000..512361c93a --- /dev/null +++ b/app/code/core/Mage/Api2/Model/Acl/Global/Role.php @@ -0,0 +1,185 @@ + + * @method Mage_Api2_Model_Resource_Acl_Global_Role_Collection getCollection() + * @method Mage_Api2_Model_Resource_Acl_Global_Role_Collection getResourceCollection() + * @method Mage_Api2_Model_Resource_Acl_Global_Role getResource() + * @method Mage_Api2_Model_Resource_Acl_Global_Role _getResource() + * @method string getCreatedAt() + * @method Mage_Api2_Model_Acl_Global_Role setCreatedAt() setCreatedAt(string $createdAt) + * @method string getUpdatedAt() + * @method Mage_Api2_Model_Acl_Global_Role setUpdatedAt() setUpdatedAt(string $updatedAt) + * @method string getRoleName() + * @method Mage_Api2_Model_Acl_Global_Role setRoleName() setRoleName(string $roleName) + */ +class Mage_Api2_Model_Acl_Global_Role extends Mage_Core_Model_Abstract +{ + /**#@+ + * System roles identifiers + */ + const ROLE_GUEST_ID = 1; + const ROLE_CUSTOMER_ID = 2; + /**#@-*/ + + /**#@+ + * Config node identifiers + */ + const ROLE_CONFIG_NODE_NAME_GUEST = 'guest'; + const ROLE_CONFIG_NODE_NAME_CUSTOMER = 'customer'; + const ROLE_CONFIG_NODE_NAME_ADMIN = 'admin'; + /**#@-*/ + + /** + * Permissions model + * + * @var Mage_Api2_Model_Acl_Global_Rule_ResourcePermission + */ + protected $_permissionModel; + + /** + * Initialize resource model + * + * @return void + */ + protected function _construct() + { + $this->_init('api2/acl_global_role'); + } + + /** + * Before save actions + * + * @return Mage_Api2_Model_Acl_Global_Role + */ + protected function _beforeSave() + { + if ($this->isObjectNew() && null === $this->getCreatedAt()) { + $this->setCreatedAt(Varien_Date::now()); + } else { + $this->setUpdatedAt(Varien_Date::now()); + } + + //check and protect guest role + if (Mage_Api2_Model_Acl_Global_Role::isSystemRole($this) + && $this->getRoleName() != $this->getOrigData('role_name')) { + + /** @var $helper Mage_Core_Helper_Data */ + $helper = Mage::helper('core'); + + Mage::throwException( + Mage::helper('api2')->__('%s role is a special one and can\'t be changed.', + $helper->escapeHtml($this->getRoleName())) + ); + } + + parent::_beforeSave(); + return $this; + } + + /** + * Perform checks before role delete + * + * @return Mage_Api2_Model_Acl_Global_Role + */ + protected function _beforeDelete() + { + if (Mage_Api2_Model_Acl_Global_Role::isSystemRole($this)) { + /** @var $helper Mage_Core_Helper_Data */ + $helper = Mage::helper('core'); + + Mage::throwException( + Mage::helper('api2')->__('%s role is a special one and can\'t be deleted.', + $helper->escapeHtml($this->getRoleName())) + ); + } + + parent::_beforeDelete(); + return $this; + } + + /** + * Get pairs resources-permissions for current role + * + * @return Mage_Api2_Model_Acl_Global_Rule_ResourcePermission + */ + public function getPermissionModel() + { + if (null == $this->_permissionModel) { + $this->_permissionModel = Mage::getModel('api2/acl_global_rule_resourcePermission'); + } + return $this->_permissionModel; + } + + /** + * Retrieve system roles + * + * @return array + */ + static public function getSystemRoles() + { + return array( + self::ROLE_GUEST_ID, + self::ROLE_CUSTOMER_ID + ); + } + + /** + * Get role system belonging + * + * @param Mage_Api2_Model_Acl_Global_Role $role + * @return bool + */ + public static function isSystemRole($role) + { + return in_array($role->getId(), self::getSystemRoles()); + } + + /** + * Get config node identifiers + * + * @return string + */ + public function getConfigNodeName() + { + switch ($this->getId()) { + case self::ROLE_GUEST_ID: + $roleNodeName = self::ROLE_CONFIG_NODE_NAME_GUEST; + break; + case self::ROLE_CUSTOMER_ID: + $roleNodeName = self::ROLE_CONFIG_NODE_NAME_CUSTOMER; + break; + default: + $roleNodeName = self::ROLE_CONFIG_NODE_NAME_ADMIN; + } + return $roleNodeName; + } +} diff --git a/app/code/core/Mage/Api2/Model/Acl/Global/Rule.php b/app/code/core/Mage/Api2/Model/Acl/Global/Rule.php new file mode 100644 index 0000000000..31f76c21bb --- /dev/null +++ b/app/code/core/Mage/Api2/Model/Acl/Global/Rule.php @@ -0,0 +1,65 @@ + + * @method Mage_Api2_Model_Resource_Acl_Global_Rule_Collection getCollection() + * @method Mage_Api2_Model_Resource_Acl_Global_Rule_Collection getResourceCollection() + * @method Mage_Api2_Model_Resource_Acl_Global_Rule getResource() + * @method Mage_Api2_Model_Resource_Acl_Global_Rule _getResource() + * @method int getRoleId() + * @method Mage_Api2_Model_Acl_Global_Rule setRoleId() setRoleId(int $roleId) + * @method string getResourceId() + * @method Mage_Api2_Model_Acl_Global_Rule setResourceId() setResourceId(string $resource) + * @method string getPrivilege() + * @method int getPermission() + * @method Mage_Api2_Model_Acl_Global_Rule setPermission() setPermission(int $permission) + * @method string getPrivilege() + * @method Mage_Api2_Model_Acl_Global_Rule setPrivilege() setPrivilege(string $privilege) + * @method string getAllowedAttributes() + * @method Mage_Api2_Model_Acl_Global_Rule setAllowedAttributes() setAllowedAttributes(string $allowedAttributes) + */ +class Mage_Api2_Model_Acl_Global_Rule extends Mage_Core_Model_Abstract +{ + /** + * Root resource ID "all" + */ + const RESOURCE_ALL = 'all'; + + /** + * Initialize resource model + * + * @return void + */ + protected function _construct() + { + $this->_init('api2/acl_global_rule'); + } +} diff --git a/app/code/core/Mage/Api2/Model/Acl/Global/Rule/Permission.php b/app/code/core/Mage/Api2/Model/Acl/Global/Rule/Permission.php new file mode 100644 index 0000000000..2c96262518 --- /dev/null +++ b/app/code/core/Mage/Api2/Model/Acl/Global/Rule/Permission.php @@ -0,0 +1,74 @@ + + */ +class Mage_Api2_Model_Acl_Global_Rule_Permission +{ + /**#@+ + * Source keys + */ + const TYPE_ALLOW = 1; + const TYPE_DENY = 0; + /**#@-*/ + + /** + * Get options parameters + * + * @return array + */ + static public function toOptionArray() + { + return array( + array( + 'value' => self::TYPE_DENY, + 'label' => Mage::helper('api2')->__('Deny') + ), + array( + 'value' => self::TYPE_ALLOW, + 'label' => Mage::helper('api2')->__('Allow') + ), + ); + } + + /** + * Get options in "key-value" format + * + * @return array + */ + static public function toArray() + { + return array( + self::TYPE_DENY => Mage::helper('api2')->__('Deny'), + self::TYPE_ALLOW => Mage::helper('api2')->__('Allow'), + ); + } +} diff --git a/app/code/core/Mage/Api2/Model/Acl/Global/Rule/Privilege.php b/app/code/core/Mage/Api2/Model/Acl/Global/Rule/Privilege.php new file mode 100644 index 0000000000..f105df9402 --- /dev/null +++ b/app/code/core/Mage/Api2/Model/Acl/Global/Rule/Privilege.php @@ -0,0 +1,77 @@ + + */ +class Mage_Api2_Model_Acl_Global_Rule_Privilege +{ + /** + * Get options parameters + * + * @return array + */ + static public function toOptionArray() + { + return array( + array( + 'value' => Mage_Api2_Model_Resource::OPERATION_CREATE, + 'label' => Mage::helper('api2')->__('Create') + ), + array( + 'value' => Mage_Api2_Model_Resource::OPERATION_RETRIEVE, + 'label' => Mage::helper('api2')->__('Retrieve') + ), + array( + 'value' => Mage_Api2_Model_Resource::OPERATION_UPDATE, + 'label' => Mage::helper('api2')->__('Update') + ), + array( + 'value' => Mage_Api2_Model_Resource::OPERATION_DELETE, + 'label' => Mage::helper('api2')->__('Delete') + ) + ); + } + + /** + * Get options in "key-value" format + * + * @return array + */ + static public function toArray() + { + return array( + Mage_Api2_Model_Resource::OPERATION_CREATE => Mage::helper('api2')->__('Create'), + Mage_Api2_Model_Resource::OPERATION_RETRIEVE => Mage::helper('api2')->__('Retrieve'), + Mage_Api2_Model_Resource::OPERATION_UPDATE => Mage::helper('api2')->__('Update'), + Mage_Api2_Model_Resource::OPERATION_DELETE => Mage::helper('api2')->__('Delete') + ); + } +} diff --git a/app/code/core/Mage/Api2/Model/Acl/Global/Rule/ResourcePermission.php b/app/code/core/Mage/Api2/Model/Acl/Global/Rule/ResourcePermission.php new file mode 100644 index 0000000000..4904c98606 --- /dev/null +++ b/app/code/core/Mage/Api2/Model/Acl/Global/Rule/ResourcePermission.php @@ -0,0 +1,122 @@ + + */ +class Mage_Api2_Model_Acl_Global_Rule_ResourcePermission + implements Mage_Api2_Model_Acl_PermissionInterface +{ + /** + * Resources permissions + * + * @var array + */ + protected $_resourcesPermissions; + + /** + * Role + * + * @var Mage_Api2_Model_Acl_Global_Role + */ + protected $_role; + + /** + * Get resources permissions for selected role + * + * @return array + */ + public function getResourcesPermissions() + { + if (null === $this->_resourcesPermissions) { + $roleConfigNodeName = $this->_role->getConfigNodeName(); + $rulesPairs = array(); + $allowedType = Mage_Api2_Model_Acl_Global_Rule_Permission::TYPE_ALLOW; + + if ($this->_role) { + /** @var $rules Mage_Api2_Model_Resource_Acl_Global_Rule_Collection */ + $rules = Mage::getResourceModel('api2/acl_global_rule_collection'); + $rules->addFilterByRoleId($this->_role->getId()); + + /** @var $rule Mage_Api2_Model_Acl_Global_Rule */ + foreach ($rules as $rule) { + $resourceId = $rule->getResourceId(); + $rulesPairs[$resourceId]['privileges'][$roleConfigNodeName][$rule->getPrivilege()] = $allowedType; + } + } else { + //make resource "all" as default for new item + $rulesPairs = array(Mage_Api2_Model_Acl_Global_Rule::RESOURCE_ALL => $allowedType); + } + + //set permissions to resources + /** @var $config Mage_Api2_Model_Config */ + $config = Mage::getModel('api2/config'); + /** @var $privilegeSource Mage_Api2_Model_Acl_Global_Rule_Privilege */ + $privilegeSource = Mage::getModel('api2/acl_global_rule_privilege'); + $privileges = array_keys($privilegeSource->toArray()); + + /** @var $node Varien_Simplexml_Element */ + foreach ($config->getResources() as $resourceType => $node) { + $resourceId = (string)$resourceType; + $allowedRoles = (array)$node->privileges; + $allowedPrivileges = array(); + if (isset($allowedRoles[$roleConfigNodeName])) { + $allowedPrivileges = $allowedRoles[$roleConfigNodeName]; + } + foreach ($privileges as $privilege) { + if (empty($allowedPrivileges[$privilege]) + && isset($rulesPairs[$resourceId][$roleConfigNodeName]['privileges'][$privilege]) + ) { + unset($rulesPairs[$resourceId][$roleConfigNodeName]['privileges'][$privilege]); + } elseif (!empty($allowedPrivileges[$privilege]) + && !isset($rulesPairs[$resourceId][$roleConfigNodeName]['privileges'][$privilege]) + ) { + $deniedType = Mage_Api2_Model_Acl_Global_Rule_Permission::TYPE_DENY; + $rulesPairs[$resourceId]['privileges'][$roleConfigNodeName][$privilege] = $deniedType; + } + } + } + $this->_resourcesPermissions = $rulesPairs; + } + return $this->_resourcesPermissions; + } + + /** + * Set filter value + * + * @param Mage_Api2_Model_Acl_Global_Role $role + */ + public function setFilterValue($role) + { + if ($role && $role->getId()) { + $this->_role = $role; + } + } +} diff --git a/app/code/core/Mage/Api2/Model/Acl/Global/Rule/Tree.php b/app/code/core/Mage/Api2/Model/Acl/Global/Rule/Tree.php new file mode 100644 index 0000000000..3b6ebb1069 --- /dev/null +++ b/app/code/core/Mage/Api2/Model/Acl/Global/Rule/Tree.php @@ -0,0 +1,546 @@ + + */ +class Mage_Api2_Model_Acl_Global_Rule_Tree extends Mage_Core_Helper_Abstract +{ + /**#@+ + * Tree types + */ + const TYPE_ATTRIBUTE = 'attribute'; + const TYPE_PRIVILEGE = 'privilege'; + /**#@-*/ + + /**#@+ + * Names + */ + const NAME_CHILDREN = 'children'; + const NAME_PRIVILEGE = 'privilege'; + const NAME_OPERATION = 'operation'; + const NAME_ATTRIBUTE = 'attribute'; + const NAME_RESOURCE = 'resource'; + const NAME_RESOURCE_GROUPS = 'resource_groups'; + const NAME_GROUP = 'group'; + /**#@-*/ + + /** + * Separator for tree ID + */ + const ID_SEPARATOR = '-'; + + /** + * Role + * + * @var Mage_Api2_Model_Acl_Global_Role + */ + protected $_role; + + /** + * Resources permissions + * + * @var array + */ + protected $_resourcesPermissions; + + /** + * Resources from config model + * + * @var Varien_Simplexml_Element + */ + protected $_resourcesConfig; + + /** + * Exist privileges + * + * @var array + */ + protected $_existPrivileges; + + /** + * Exist operations + * + * @var array + */ + protected $_existOperations; + + /** + * Tree type + * + * @var string + */ + protected $_type; + + /** + * Initialized + * + * @var bool + */ + protected $_initialized = false; + + /** + * Flag if resource has entity only attributes + * + * @var bool + */ + protected $_hasEntityOnlyAttributes = false; + + /** + * Constructor + * + * In the constructor should be set tree type: attributes or privileges. + * Attributes for tree with resources, operations and attributes. + * Privileges for tree with resources and privileges. + * + * @param array $options + */ + public function __construct($options) + { + $this->_type = $options['type']; + + switch ($this->_type) { + case self::TYPE_ATTRIBUTE: + /** @var $operationSource Mage_Api2_Model_Acl_Filter_Attribute_Operation */ + $operationSource = Mage::getModel('api2/acl_filter_attribute_operation'); + $this->_existOperations = $operationSource->toArray(); + break; + + case self::TYPE_PRIVILEGE: + /** @var $privilegeSource Mage_Api2_Model_Acl_Global_Rule_Privilege */ + $privilegeSource = Mage::getModel('api2/acl_global_rule_privilege'); + $this->_existPrivileges = $privilegeSource->toArray(); + break; + + default: + throw new Exception(sprintf('Unknown tree type "%s".', $this->_type)); + break; + } + } + + /** + * Initialize block + * + * @return Mage_Api2_Model_Acl_Global_Rule_Tree + * @throws Exception + */ + protected function _init() + { + if ($this->_initialized) { + return $this; + } + + /** @var $config Mage_Api2_Model_Config */ + $config = Mage::getModel('api2/config'); + $this->_resourcesConfig = $config->getResourceGroups(); + + if ($this->_type == self::TYPE_ATTRIBUTE && !$this->_existOperations) { + throw new Exception('Operations is not set'); + } + + if ($this->_type == self::TYPE_PRIVILEGE && !$this->_existPrivileges) { + throw new Exception('Privileges is not set.'); + } + + return $this; + } + + /** + * Convert to array serialized post data from tree grid + * + * @return array + */ + public function getPostResources() + { + $isAll = Mage::app()->getRequest()->getParam(Mage_Api2_Model_Acl_Global_Rule::RESOURCE_ALL); + $allow = Mage_Api2_Model_Acl_Global_Rule_Permission::TYPE_ALLOW; + if ($isAll) { + $resources = array( + Mage_Api2_Model_Acl_Global_Rule::RESOURCE_ALL => array( + null => $allow + ) + ); + } else { + $resources = array(); + $checkedResources = explode(',', Mage::app()->getRequest()->getParam('resource')); + $prefixResource = self::NAME_RESOURCE . self::ID_SEPARATOR; + switch ($this->_type) { + case self::TYPE_PRIVILEGE: + $prefixPrivilege = self::NAME_PRIVILEGE . self::ID_SEPARATOR; + $nameResource = null; + foreach ($checkedResources as $i => $item) { + if (0 === strpos($item, $prefixResource)) { + $nameResource = substr($item, mb_strlen($prefixResource, 'UTF-8')); + $resources[$nameResource] = array(); + } elseif (0 === strpos($item, $prefixPrivilege)) { + $name = substr($item, mb_strlen($prefixPrivilege, 'UTF-8')); + $namePrivilege = str_replace($nameResource . self::ID_SEPARATOR, '', $name); + $resources[$nameResource][$namePrivilege] = $allow; + } else { + unset($checkedResources[$i]); + } + } + break; + + case self::TYPE_ATTRIBUTE: + $prefixOperation = self::NAME_OPERATION . self::ID_SEPARATOR; + $prefixAttribute = self::NAME_ATTRIBUTE . self::ID_SEPARATOR; + $nameResource = null; + foreach ($checkedResources as $i => $item) { + if (0 === strpos($item, $prefixResource)) { + $nameResource = substr($item, mb_strlen($prefixResource, 'UTF-8')); + $resources[$nameResource] = array(); + } elseif (0 === strpos($item, $prefixOperation)) { + $name = substr($item, mb_strlen($prefixOperation, 'UTF-8')); + $operationName = str_replace($nameResource . self::ID_SEPARATOR, '', $name); + $resources[$nameResource][$operationName] = array(); + } elseif (0 === strpos($item, $prefixAttribute)) { + $name = substr($item, mb_strlen($prefixOperation, 'UTF-8')); + $attributeName = str_replace( + $nameResource . self::ID_SEPARATOR . $operationName . self::ID_SEPARATOR, + '', + $name + ); + $resources[$nameResource][$operationName][$attributeName] = $allow; + } else { + unset($checkedResources[$i]); + } + } + break; + + //no default + } + } + return $resources; + } + + /** + * Check if everything is allowed + * + * @return boolean + */ + public function getEverythingAllowed() + { + $this->_init(); + + $all = Mage_Api2_Model_Acl_Global_Rule::RESOURCE_ALL; + return !empty($this->_resourcesPermissions[$all]); + } + + /** + * Get tree resources + * + * @return array + */ + public function getTreeResources() + { + $this->_init(); + $root = $this->_getTreeNode($this->_resourcesConfig, 1); + return isset($root[self::NAME_CHILDREN]) ? $root[self::NAME_CHILDREN] : array(); + } + + /** + * Get tree node + * + * @param Varien_Simplexml_Element|array $node + * @param int $level + * @return array + */ + protected function _getTreeNode($node, $level = 0) + { + $item = array(); + + $isResource = false; + $isGroup = false; + $name = null; + + if ($level != 0) { + $name = $node->getName(); + if (!(int) $node->resource) { + if (self::NAME_RESOURCE_GROUPS != $name) { + $isGroup = true; + $item['id'] = self::NAME_GROUP . self::ID_SEPARATOR . $name; + } + $item['text'] = (string) $node->title; + } else { + $isResource = true; + $item['id'] = self::NAME_RESOURCE . self::ID_SEPARATOR . $name; + $item['text'] = $this->__('%s', (string) $node->title); + } + $item['checked'] = false; + $item['sort_order'] = isset($node->sort_order) ? (string) $node->sort_order : 0; + } + if (isset($node->children)) { + $children = $node->children->children(); + } else { + $children = $node->children(); + } + + if (empty($children)) { + /** + * Node doesn't have any child nodes + * and it should be skipped + */ + return $item; + } + + $item[self::NAME_CHILDREN] = array(); + + if ($isResource) { + if (self::TYPE_ATTRIBUTE == $this->_type) { + if (!$this->_addOperations($item, $node, $name)) { + return null; + } + } elseif (self::TYPE_PRIVILEGE == $this->_type) { + if (!$this->_addPrivileges($item, $node, $name)) { + return null; + } + } + } + + /** @var $child Varien_Simplexml_Element */ + foreach ($children as $child) { + if ($child->getName() != 'title' && $child->getName() != 'sort_order') { + if (!(string) $child->title) { + continue; + } + + if ($level != 0) { + $subNode = $this->_getTreeNode($child, $level + 1); + if (!$subNode) { + continue; + } + //if sub-node check then check current node + if (!empty($subNode['checked'])) { + $item['checked'] = true; + } + $item[self::NAME_CHILDREN][] = $subNode; + } else { + $item = $this->_getTreeNode($child, $level + 1); + } + } + } + if (!empty($item[self::NAME_CHILDREN])) { + usort($item[self::NAME_CHILDREN], array($this, '_sortTree')); + } elseif ($isGroup) { + //skip empty group + return null; + } + return $item; + } + + /** + * Add privileges + * + * @param array $item Tree node + * @param Varien_Simplexml_Element $node XML node + * @param string $name Resource name + * @return bool + */ + protected function _addPrivileges(&$item, Varien_Simplexml_Element $node, $name) + { + $roleConfigNodeName = $this->getRole()->getConfigNodeName(); + $possibleList = array(); + if (isset($node->privileges)) { + $possibleRoles = $node->privileges->asArray(); + if (isset($possibleRoles[$roleConfigNodeName])) { + $possibleList = $possibleRoles[$roleConfigNodeName]; + } + } + + if (!$possibleList) { + return false; + } + + $cnt = 0; + foreach ($this->_existPrivileges as $key => $title) { + if (empty($possibleList[$key])) { + continue; + } + $checked = !empty($this->_resourcesPermissions[$name]['privileges'][$roleConfigNodeName][$key]); + $item['checked'] = $checked ? $checked : $item['checked']; + $subItem = array( + 'id' => self::NAME_PRIVILEGE . self::ID_SEPARATOR . $name . self::ID_SEPARATOR . $key, + 'text' => $title, + 'checked' => $checked, + 'sort_order' => ++$cnt, + ); + $item[self::NAME_CHILDREN][] = $subItem; + } + return true; + } + + /** + * Add operation + * + * @param array $item Tree node + * @param Varien_Simplexml_Element $node XML node + * @param string $name Resource name + * @return bool + */ + protected function _addOperations(&$item, Varien_Simplexml_Element $node, $name) + { + $cnt = 0; + foreach ($this->_existOperations as $key => $title) { + $subItem = array( + 'id' => self::NAME_OPERATION . self::ID_SEPARATOR . $name . self::ID_SEPARATOR . $key, + 'text' => $title, + 'checked' => false, + 'sort_order' => ++$cnt, + ); + + if (!empty($this->_resourcesPermissions[$name]['operations'][$key]['attributes'])) { + if (!$this->_addAttribute($subItem, $node, $name, $key)) { + $cnt--; + continue; + } + } else { + $cnt--; + continue; + } + if (!empty($subItem['checked'])) { + $item['checked'] = true; + } + $item[self::NAME_CHILDREN][] = $subItem; + } + if (!$cnt) { + return false; + } + return true; + } + + /** + * Add privileges + * + * @param array $item Tree node + * @param Varien_Simplexml_Element $node XML node + * @param string $name Node name + * @param string $privilege Privilege name + * @return bool + */ + protected function _addAttribute(&$item, Varien_Simplexml_Element $node, $name, $privilege) + { + $cnt = 0; + foreach ($this->_resourcesPermissions[$name]['operations'][$privilege]['attributes'] as $key => $attribute) { + $title = $attribute['title']; + $status = $attribute['status']; + + $checked = $status == Mage_Api2_Model_Acl_Global_Rule_Permission::TYPE_ALLOW; + $item['checked'] = $checked ? $checked : $item['checked']; + $item[self::NAME_CHILDREN][] = array( + 'id' => self::NAME_ATTRIBUTE . self::ID_SEPARATOR . $name . self::ID_SEPARATOR . $privilege + . self::ID_SEPARATOR . $key, + 'text' => $title, + 'checked' => $checked, + 'sort_order' => ++$cnt, + ); + } + + return true; + } + + /** + * Compare two nodes of the Resource Tree + * + * @param array $a + * @param array $b + * @return int + */ + protected function _sortTree($a, $b) + { + return $a['sort_order'] < $b['sort_order'] ? -1 : ($a['sort_order'] > $b['sort_order'] ? 1 : 0); + } + + /** + * Set role + * + * @param Mage_Api2_Model_Acl_Global_Role $role + * @return Mage_Api2_Model_Acl_Global_Rule_Tree + */ + public function setRole($role) + { + $this->_role = $role; + return $this; + } + + /** + * Get role + * + * @return Mage_Api2_Model_Acl_Global_Role + */ + public function getRole() + { + return $this->_role; + } + + /** + * Set resources permissions + * + * @param array $resourcesPermissions + * @return Mage_Api2_Model_Acl_Global_Rule_Tree + */ + public function setResourcesPermissions($resourcesPermissions) + { + $this->_resourcesPermissions = $resourcesPermissions; + return $this; + } + + /** + * Get resources permissions + * + * @return array + */ + public function getResourcesPermissions() + { + return $this->_resourcesPermissions; + } + + /** + * Set has entity only attributes flag + * + * @param bool $hasEntityOnlyAttributes + * @return Mage_Api2_Model_Acl_Global_Rule_Tree + */ + public function setHasEntityOnlyAttributes($hasEntityOnlyAttributes) + { + $this->_hasEntityOnlyAttributes = $hasEntityOnlyAttributes; + return $this; + } + + /** + * Get has entity only attributes flag + * + * @return bool + */ + public function getHasEntityOnlyAttributes() + { + return $this->_hasEntityOnlyAttributes; + } +} diff --git a/app/code/core/Mage/Api2/Model/Acl/PermissionInterface.php b/app/code/core/Mage/Api2/Model/Acl/PermissionInterface.php new file mode 100644 index 0000000000..04afbf7c7a --- /dev/null +++ b/app/code/core/Mage/Api2/Model/Acl/PermissionInterface.php @@ -0,0 +1,52 @@ + + */ +interface Mage_Api2_Model_Acl_PermissionInterface +{ + /** + * Get ACL resources permissions + * + * Get permissions list with set permissions + * + * @return array + */ + public function getResourcesPermissions(); + + /** + * Set filter value + * + * @param mixed $filterValue + * @return Mage_Api2_Model_Acl_PermissionInterface + */ + public function setFilterValue($filterValue); +} diff --git a/app/code/core/Mage/Api2/Model/Auth.php b/app/code/core/Mage/Api2/Model/Auth.php new file mode 100644 index 0000000000..37a79c528b --- /dev/null +++ b/app/code/core/Mage/Api2/Model/Auth.php @@ -0,0 +1,80 @@ + + */ +class Mage_Api2_Model_Auth +{ + /** + * Use this type if no authentication adapter is applied + */ + const DEFAULT_USER_TYPE = 'guest'; + + /** + * Figure out API user type and create user model instance + * + * @param Mage_Api2_Model_Request $request + * @throws Exception + * @return Mage_Api2_Model_Auth_User_Abstract + */ + public function authenticate(Mage_Api2_Model_Request $request) + { + /** @var $helper Mage_Api2_Helper_Data */ + $helper = Mage::helper('api2/data'); + $userTypes = $helper->getUserTypes(); + + if (!$userTypes) { + throw new Exception('No allowed user types found'); + } + /** @var $authAdapter Mage_Api2_Model_Auth_Adapter */ + $authAdapter = Mage::getModel('api2/auth_adapter'); + $userParamsObj = $authAdapter->getUserParams($request); + + if (!isset($userTypes[$userParamsObj->type])) { + throw new Mage_Api2_Exception( + 'Invalid user type or type is not allowed', Mage_Api2_Model_Server::HTTP_UNAUTHORIZED + ); + } + /** @var $userModel Mage_Api2_Model_Auth_User_Abstract */ + $userModel = Mage::getModel($userTypes[$userParamsObj->type]); + + if (!$userModel instanceof Mage_Api2_Model_Auth_User_Abstract) { + throw new Exception('User model must to extend Mage_Api2_Model_Auth_User_Abstract'); + } + // check user type consistency + if ($userModel->getType() != $userParamsObj->type) { + throw new Exception('User model type does not match appropriate type in config'); + } + $userModel->setUserId($userParamsObj->id); + + return $userModel; + } +} diff --git a/app/code/core/Mage/Api2/Model/Auth/Adapter.php b/app/code/core/Mage/Api2/Model/Auth/Adapter.php new file mode 100644 index 0000000000..783196f600 --- /dev/null +++ b/app/code/core/Mage/Api2/Model/Auth/Adapter.php @@ -0,0 +1,93 @@ + + */ +class Mage_Api2_Model_Auth_Adapter +{ + /** + * Adapter models + * + * @var array + */ + protected $_adapters = array(); + + /** + * Load adapters configuration and create adapters models + * + * @return Mage_Api2_Model_Auth_Adapter + * @throws Exception + */ + protected function _initAdapters() + { + /** @var $helper Mage_Api2_Helper_Data */ + $helper = Mage::helper('api2'); + + foreach ($helper->getAuthAdapters(true) as $adapterKey => $adapterParams) { + $adapterModel = Mage::getModel($adapterParams['model']); + + if (!$adapterModel instanceof Mage_Api2_Model_Auth_Adapter_Abstract) { + throw new Exception('Authentication adapter must to extend Mage_Api2_Model_Auth_Adapter_Abstract'); + } + $this->_adapters[$adapterKey] = $adapterModel; + } + if (!$this->_adapters) { + throw new Exception('No active authentication adapters found'); + } + return $this; + } + + /** + * Process request and figure out an API user type and its identifier + * + * Returns stdClass object with two properties: type and id + * + * @param Mage_Api2_Model_Request $request + * @return stdClass + */ + public function getUserParams(Mage_Api2_Model_Request $request) + { + $this->_initAdapters(); + + foreach ($this->_adapters as $adapterModel) { + /** @var $adapterModel Mage_Api2_Model_Auth_Adapter_Abstract */ + if ($adapterModel->isApplicableToRequest($request)) { + $userParams = $adapterModel->getUserParams($request); + + if (null !== $userParams->type) { + return $userParams; + } + throw new Mage_Api2_Exception('Can not determine user type', Mage_Api2_Model_Server::HTTP_UNAUTHORIZED); + } + } + return (object) array('type' => Mage_Api2_Model_Auth::DEFAULT_USER_TYPE, 'id' => null); + } +} diff --git a/app/code/core/Mage/Api2/Model/Auth/Adapter/Abstract.php b/app/code/core/Mage/Api2/Model/Auth/Adapter/Abstract.php new file mode 100644 index 0000000000..bbae92f6cd --- /dev/null +++ b/app/code/core/Mage/Api2/Model/Auth/Adapter/Abstract.php @@ -0,0 +1,53 @@ + + */ +abstract class Mage_Api2_Model_Auth_Adapter_Abstract +{ + /** + * Process request and figure out an API user type and its identifier + * + * Returns stdClass object with two properties: type and id + * + * @param Mage_Api2_Model_Request $request + * @return stdClass + */ + abstract public function getUserParams(Mage_Api2_Model_Request $request); + + /** + * Check if request contains authentication info for adapter + * + * @param Mage_Api2_Model_Request $request + * @return boolean + */ + abstract public function isApplicableToRequest(Mage_Api2_Model_Request $request); +} diff --git a/app/code/core/Mage/Api2/Model/Auth/Adapter/Oauth.php b/app/code/core/Mage/Api2/Model/Auth/Adapter/Oauth.php new file mode 100644 index 0000000000..c8a437bb26 --- /dev/null +++ b/app/code/core/Mage/Api2/Model/Auth/Adapter/Oauth.php @@ -0,0 +1,78 @@ + + */ +class Mage_Api2_Model_Auth_Adapter_Oauth extends Mage_Api2_Model_Auth_Adapter_Abstract +{ + /** + * Process request and figure out an API user type and its identifier + * + * Returns stdClass object with two properties: type and id + * + * @param Mage_Api2_Model_Request $request + * @return stdClass + */ + public function getUserParams(Mage_Api2_Model_Request $request) + { + /** @var $oauthServer Mage_OAuth_Model_Server */ + $oauthServer = Mage::getModel('oAuth/server', $request); + $userParamsObj = (object) array('type' => null, 'id' => null); + + try { + $token = $oauthServer->checkAccessRequest(); + $userType = $token->getUserType(); + + if (Mage_OAuth_Model_Token::USER_TYPE_ADMIN == $userType) { + $userParamsObj->id = $token->getAdminId(); + } else { + $userParamsObj->id = $token->getCustomerId(); + } + $userParamsObj->type = $userType; + } catch (Exception $e) { + throw new Mage_Api2_Exception($oauthServer->reportProblem($e), Mage_Api2_Model_Server::HTTP_UNAUTHORIZED); + } + return $userParamsObj; + } + + /** + * Check if request contains authentication info for adapter + * + * @param Mage_Api2_Model_Request $request + * @return boolean + */ + public function isApplicableToRequest(Mage_Api2_Model_Request $request) + { + $headerValue = $request->getHeader('Authorization'); + + return $headerValue && 'oauth' === strtolower(substr($headerValue, 0, 5)); + } +} diff --git a/app/code/core/Mage/Api2/Model/Auth/User.php b/app/code/core/Mage/Api2/Model/Auth/User.php new file mode 100644 index 0000000000..49ba4cd593 --- /dev/null +++ b/app/code/core/Mage/Api2/Model/Auth/User.php @@ -0,0 +1,61 @@ + + */ +class Mage_Api2_Model_Auth_User +{ + /** + * Get options in "key-value" format + * + * @param boolean $asOptionArray OPTIONAL If TRUE - return an options array, plain array - otherwise + * @return array + */ + static public function getUserTypes($asOptionArray = false) + { + $userTypes = array(); + + /** @var $helper Mage_Api2_Helper_Data */ + $helper = Mage::helper('api2'); + + foreach ($helper->getUserTypes() as $modelPath) { + /** @var $userModel Mage_Api2_Model_Auth_User_Abstract */ + $userModel = Mage::getModel($modelPath); + + if ($asOptionArray) { + $userTypes[] = array('value' => $userModel->getType(), 'label' => $userModel->getLabel()); + } else { + $userTypes[$userModel->getType()] = $userModel->getLabel(); + } + } + return $userTypes; + } +} diff --git a/app/code/core/Mage/Api2/Model/Auth/User/Abstract.php b/app/code/core/Mage/Api2/Model/Auth/User/Abstract.php new file mode 100644 index 0000000000..10aa60e39e --- /dev/null +++ b/app/code/core/Mage/Api2/Model/Auth/User/Abstract.php @@ -0,0 +1,96 @@ + + */ +abstract class Mage_Api2_Model_Auth_User_Abstract +{ + /** + * Customer/Admin identifier + * + * @var int + */ + protected $_userId; + + /** + * User Role + * + * @var int + */ + protected $_role; + + /** + * Retrieve user human-readable label + * + * @return string + */ + public function getLabel() + { + return $this->getType(); + } + + /** + * Retrieve user role + * + * @return int + */ + abstract public function getRole(); + + /** + * Retrieve user type + * + * @return string + */ + abstract public function getType(); + + /** + * Retrieve user identifier + * + * @return int + */ + public function getUserId() + { + return $this->_userId; + } + + /** + * Set user identifier + * + * @param int $userId User identifier + * @return Mage_Api2_Model_Auth_User_Abstract + */ + public function setUserId($userId) + { + $this->_userId = $userId; + + return $this; + } +} diff --git a/app/code/core/Mage/Api2/Model/Auth/User/Admin.php b/app/code/core/Mage/Api2/Model/Auth/User/Admin.php new file mode 100644 index 0000000000..7a87d8a226 --- /dev/null +++ b/app/code/core/Mage/Api2/Model/Auth/User/Admin.php @@ -0,0 +1,106 @@ + + */ +class Mage_Api2_Model_Auth_User_Admin extends Mage_Api2_Model_Auth_User_Abstract +{ + /** + * User type + */ + const USER_TYPE = 'admin'; + + /** + * Retrieve user human-readable label + * + * @return string + */ + public function getLabel() + { + return Mage::helper('api2')->__('Admin'); + } + + /** + * Retrieve user role + * + * @return int + * @throws Exception + */ + public function getRole() + { + if (!$this->_role) { + if (!$this->getUserId()) { + throw new Exception('Admin identifier is not set'); + } + + /** @var $collection Mage_Api2_Model_Resource_Acl_Global_Role_Collection */ + $collection = Mage::getModel('api2/acl_global_role')->getCollection(); + $collection->addFilterByAdminId($this->getUserId()); + + /** @var $role Mage_Api2_Model_Acl_Global_Role */ + $role = $collection->getFirstItem(); + if (!$role->getId()) { + throw new Exception('Admin role not found'); + } + + $this->setRole($role->getId()); + } + + return $this->_role; + } + + /** + * Retrieve user type + * + * @return string + */ + public function getType() + { + return self::USER_TYPE; + } + + /** + * Set user role + * + * @param int $role + * @return Mage_Api2_Model_Auth_User_Admin + * @throws Exception + */ + public function setRole($role) + { + if ($this->_role) { + throw new Exception('Admin role has been already set'); + } + $this->_role = $role; + + return $this; + } +} diff --git a/app/code/core/Mage/Api2/Model/Auth/User/Customer.php b/app/code/core/Mage/Api2/Model/Auth/User/Customer.php new file mode 100644 index 0000000000..20cdb14680 --- /dev/null +++ b/app/code/core/Mage/Api2/Model/Auth/User/Customer.php @@ -0,0 +1,80 @@ + + */ +class Mage_Api2_Model_Auth_User_Customer extends Mage_Api2_Model_Auth_User_Abstract +{ + /** + * User type + */ + const USER_TYPE = 'customer'; + + /** + * Retrieve user human-readable label + * + * @return string + */ + public function getLabel() + { + return Mage::helper('api2')->__('Customer'); + } + + /** + * Retrieve user type + * + * @return string + */ + public function getType() + { + return self::USER_TYPE; + } + + /** + * Retrieve user role + * + * @return int + */ + public function getRole() + { + if (!$this->_role) { + /** @var $role Mage_Api2_Model_Acl_Global_Role */ + $role = Mage::getModel('api2/acl_global_role')->load(Mage_Api2_Model_Acl_Global_Role::ROLE_CUSTOMER_ID); + if (!$role->getId()) { + throw new Exception('Customer role not found'); + } + + $this->_role = Mage_Api2_Model_Acl_Global_Role::ROLE_CUSTOMER_ID; + } + + return $this->_role; + } +} diff --git a/app/code/core/Mage/Api2/Model/Auth/User/Guest.php b/app/code/core/Mage/Api2/Model/Auth/User/Guest.php new file mode 100644 index 0000000000..c9367f18d3 --- /dev/null +++ b/app/code/core/Mage/Api2/Model/Auth/User/Guest.php @@ -0,0 +1,80 @@ + + */ +class Mage_Api2_Model_Auth_User_Guest extends Mage_Api2_Model_Auth_User_Abstract +{ + /** + * User type + */ + const USER_TYPE = 'guest'; + + /** + * Retrieve user human-readable label + * + * @return string + */ + public function getLabel() + { + return Mage::helper('api2')->__('Guest'); + } + + /** + * Retrieve user type + * + * @return string + */ + public function getType() + { + return self::USER_TYPE; + } + + /** + * Retrieve user role + * + * @return int + */ + public function getRole() + { + if (!$this->_role) { + /** @var $role Mage_Api2_Model_Acl_Global_Role */ + $role = Mage::getModel('api2/acl_global_role')->load(Mage_Api2_Model_Acl_Global_Role::ROLE_GUEST_ID); + if (!$role->getId()) { + throw new Exception('Guest role not found'); + } + + $this->_role = Mage_Api2_Model_Acl_Global_Role::ROLE_GUEST_ID; + } + + return $this->_role; + } +} diff --git a/app/code/core/Mage/Api2/Model/Config.php b/app/code/core/Mage/Api2/Model/Config.php new file mode 100644 index 0000000000..89048609cc --- /dev/null +++ b/app/code/core/Mage/Api2/Model/Config.php @@ -0,0 +1,449 @@ + + */ +class Mage_Api2_Model_Config extends Varien_Simplexml_Config +{ + /** + * Node name of resource groups + */ + const NODE_RESOURCE_GROUPS = 'resource_groups'; + + /** + * Id for config cache + */ + const CACHE_ID = 'config_api2'; + + /** + * Tag name for config cache + */ + const CACHE_TAG = 'CONFIG_API2'; + + /** + * Is resources added to group + * + * @var boolean + */ + protected $_resourcesGrouped = false; + + /** + * Constructor + * Initializes XML for this configuration + * Local cache configuration + * + * @param string|Varien_Simplexml_Element|null $sourceData + */ + public function __construct($sourceData = null) + { + parent::__construct($sourceData); + + $canUserCache = Mage::app()->useCache('config'); + if ($canUserCache) { + $this->setCacheId(self::CACHE_ID) + ->setCacheTags(array(self::CACHE_TAG)) + ->setCacheChecksum(null) + ->setCache(Mage::app()->getCache()); + + if ($this->loadCache()) { + return; + } + } + + // Load data of config files api2.xml + $config = Mage::getConfig()->loadModulesConfiguration('api2.xml'); + $this->setXml($config->getNode('api2')); + + if ($canUserCache) { + $this->saveCache(); + } + } + + /** + * Fetch all routes of the given api type from config files api2.xml + * + * @param string $apiType + * @throws Mage_Api2_Exception + * @return array + */ + public function getRoutes($apiType) + { + /** @var $helper Mage_Api2_Helper_Data */ + $helper = Mage::helper('api2'); + if (!$helper->isApiTypeSupported($apiType)) { + throw new Mage_Api2_Exception(sprintf('API type "%s" is not supported', $apiType), + Mage_Api2_Model_Server::HTTP_BAD_REQUEST); + } + + $routes = array(); + foreach ($this->getResources() as $resourceKey => $resource) { + if (!$resource->routes) { + continue; + } + + /** @var $routes Varien_Simplexml_Element */ + foreach ($resource->routes->children() as $route) { + $arguments = array( + Mage_Api2_Model_Route_Abstract::PARAM_ROUTE => (string)$route->route, + Mage_Api2_Model_Route_Abstract::PARAM_DEFAULTS => array( + 'model' => (string)$resource->model, + 'type' => (string)$resourceKey, + 'action_type' => (string)$route->action_type + ) + ); + + $routes[] = Mage::getModel('api2/route_' . $apiType, $arguments); + } + } + return $routes; + } + + /** + * Retrieve all resources from config files api2.xml + * + * @return Varien_Simplexml_Element + */ + public function getResources() + { + return $this->getNode('resources')->children(); + } + + /** + * Retrieve all resources types + * + * @return array + */ + public function getResourcesTypes() + { + $list = array(); + + foreach ($this->getResources() as $resourceType => $resourceCfg) { + $list[] = (string) $resourceType; + } + return $list; + } + + /** + * Retrieve all resource groups from config files api2.xml + * + * @return Varien_Simplexml_Element|boolean + */ + public function getResourceGroups() + { + $groups = $this->getXpath('//' . self::NODE_RESOURCE_GROUPS); + if (!$groups) { + return false; + } + + /** @var $groups Varien_Simplexml_Element */ + $groups = $groups[0]; + + if (!$this->_resourcesGrouped) { + /** @var $node Varien_Simplexml_Element */ + foreach ($this->getResources() as $node) { + $result = $node->xpath('group'); + if (!$result) { + continue; + } + $groupName = (string) $result[0]; + if ($groupName) { + $result = $groups->xpath('.//' . $groupName); + if (!$result) { + continue; + } + + /** @var $group Varien_Simplexml_Element */ + $group = $result[0]; + + if (!isset($group->children)) { + $children = new Varien_Simplexml_Element(''); + } else { + $children = $group->children; + } + $node->resource = 1; + $children->appendChild($node); + $group->appendChild($children); + } + } + } + return $groups; + } + + /** + * Retrieve resource group from config files api2.xml + * + * @param string $name + * @return Mage_Core_Model_Config_Element|boolean + */ + public function getResourceGroup($name) + { + $group = $this->getResourceGroups()->xpath('.//' . $name); + if (!$group) { + return false; + } + return $group[0]; + } + + /** + * Retrieve resource by type (node) + * + * @param string $node + * @return Varien_Simplexml_Element|boolean + */ + public function getResource($node) + { + return $this->getNode('resources/' . $node); + } + + /** + * Retrieve resource attributes + * + * @param string $node + * @return array + */ + public function getResourceAttributes($node) + { + $attributes = $this->getNode('resources/' . $node . '/attributes'); + return $attributes ? (array) $attributes : array(); + } + + /** + * Get excluded attributes of API resource + * + * @param string $resource + * @param string $userType + * @param string $operation + * @return array + */ + public function getResourceExcludedAttributes($resource, $userType, $operation) + { + $node = $this->getNode('resources/' . $resource . '/exclude_attributes/' . $userType . '/' . $operation); + $exclAttributes = array(); + + if ($node) { + foreach ($node->children() as $attribute => $status) { + if ((string) $status) { + $exclAttributes[] = $attribute; + } + } + } + return $exclAttributes; + } + + /** + * Get forced attributes of API resource + * + * @param string $resource + * @param string $userType + * @return array + */ + public function getResourceForcedAttributes($resource, $userType) + { + $node = $this->getNode('resources/' . $resource . '/force_attributes/' . $userType); + $forcedAttributes = array(); + + if ($node) { + foreach ($node->children() as $attribute => $status) { + if ((string) $status) { + $forcedAttributes[] = $attribute; + } + } + } + return $forcedAttributes; + } + + /** + * Get included attributes + * + * @param string $resource API resource ID + * @param string $userType API user type + * @param string $operationType Type of operation: one of Mage_Api2_Model_Resource::OPERATION_ATTRIBUTE_... constant + * @return array + */ + public function getResourceIncludedAttributes($resource, $userType, $operationType) + { + $node = $this->getNode('resources/' . $resource . '/include_attributes/' . $userType . '/' . $operationType); + $inclAttributes = array(); + + if ($node) { + foreach ($node->children() as $attribute => $status) { + if ((string) $status) { + $inclAttributes[] = $attribute; + } + } + } + return $inclAttributes; + } + + /** + * Get entity only attributes + * + * @param string $resource API resource ID + * @param string $userType API user type + * @param string $operationType Type of operation: one of Mage_Api2_Model_Resource::OPERATION_ATTRIBUTE_... constant + * @return array + */ + public function getResourceEntityOnlyAttributes($resource, $userType, $operationType) + { + $node = $this->getNode('resources/' . $resource . '/entity_only_attributes/' . $userType . '/' . + $operationType); + $entityOnlyAttributes = array(); + + if ($node) { + foreach ($node->children() as $attribute => $status) { + if ((string) $status) { + $entityOnlyAttributes[] = $attribute; + } + } + } + return $entityOnlyAttributes; + } + + /** + * Retrieve resource working model + * + * @param string $node + * @return string + */ + public function getResourceWorkingModel($node) + { + return (string)$this->getNode('resources/' . $node . '/working_model'); + } + + /** + * Get resource allowed versions sorted in reverse order + * + * @param string $node + * @return array + * @throws Exception + */ + public function getVersions($node) + { + $element = $this->getNode('resources/' . $node . '/versions'); + if (!$element) { + throw new Exception( + sprintf('Resource "%s" does not have node in config.', htmlspecialchars($node)) + ); + } + + $versions = explode(',', (string)$element); + if (count(array_filter($versions, 'is_numeric')) != count($versions)) { + throw new Exception(sprintf('Invalid resource "%s" versions in config.', htmlspecialchars($node))); + } + + rsort($versions, SORT_NUMERIC); + + return $versions; + } + + /** + * Retrieve resource model + * + * @param string $node + * @return string + */ + public function getResourceModel($node) + { + return (string)$this->getNode('resources/' . $node . '/model'); + } + + /** + * Retrieve API user privileges for specified resource + * + * @param string $resource + * @param string $userType + * @return array + */ + public function getResourceUserPrivileges($resource, $userType) + { + $attributes = $this->getNode('resources/' . $resource . '/privileges/' . $userType); + return $attributes ? (array)$attributes : array(); + } + + /** + * Retrieve resource subresources + * + * @param string $node + * @return array + */ + public function getResourceSubresources($node) + { + $subresources = $this->getNode('resources/' . $node . '/subresources'); + return $subresources ? (array)$subresources : array(); + } + + /** + * Get validation config by validator type + * + * @param string $resourceType + * @param string $validatorType + * @return array + */ + public function getValidationConfig($resourceType, $validatorType) + { + $config = $this->getNode('resources/' . $resourceType . '/validators/' . $validatorType); + return $config ? $config->asArray() : array(); + } + + /** + * Get latest version of resource model. If second arg is specified - use it as a limiter + * + * @param string $resourceType Resource type + * @param int $lowerOrEqualsTo OPTIONAL If specified - return version equal or lower to + * @return int + */ + public function getResourceLastVersion($resourceType, $lowerOrEqualsTo = null) + { + $availVersions = $this->getVersions($resourceType); // already ordered in reverse order + $useVersion = reset($availVersions); + + if (null !== $lowerOrEqualsTo) { + foreach ($availVersions as $availVersion) { + if ($availVersion <= $lowerOrEqualsTo) { + $useVersion = $availVersion; + break; + } + } + } + return (int)$useVersion; + } + + /** + * Get route with Mage_Api2_Model_Resource::ACTION_TYPE_ENTITY type + * + * @param string $node + * @return string + */ + public function getRouteWithEntityTypeAction($node) + { + return (string)$this->getNode('resources/' . $node . '/routes/route_entity/route'); + } +} diff --git a/app/code/core/Mage/Api2/Model/Dispatcher.php b/app/code/core/Mage/Api2/Model/Dispatcher.php new file mode 100644 index 0000000000..857ff131fa --- /dev/null +++ b/app/code/core/Mage/Api2/Model/Dispatcher.php @@ -0,0 +1,162 @@ + + */ +class Mage_Api2_Model_Dispatcher +{ + /** + * Template for retrieve resource class name + */ + const RESOURCE_CLASS_TEMPLATE = ':resource_:api_:user_v:version'; + + /** + * API User object + * + * @var Mage_Api2_Model_Auth_User_Abstract + */ + protected $_apiUser; + + /** + * Instantiate resource class, set parameters to the instance, run resource internal dispatch method + * + * @param Mage_Api2_Model_Request $request + * @param Mage_Api2_Model_Response $response + * @return Mage_Api2_Model_Dispatcher + * @throws Mage_Api2_Exception + */ + public function dispatch(Mage_Api2_Model_Request $request, Mage_Api2_Model_Response $response) + { + if (!$request->getModel() || !$request->getApiType()) { + throw new Mage_Api2_Exception( + 'Request does not contains all necessary data', Mage_Api2_Model_Server::HTTP_BAD_REQUEST + ); + } + $model = self::loadResourceModel( + $request->getModel(), + $request->getApiType(), + $this->getApiUser()->getType(), + $this->getVersion($request->getResourceType(), $request->getVersion()) + ); + + $model->setRequest($request); + $model->setResponse($response); + $model->setApiUser($this->getApiUser()); + + $model->dispatch(); + + return $this; + } + + /** + * Pack resource model class path from components and try to load it + * + * @param string $apiType API type + * @param string $userType API User type (e.g. admin, customer, guest) + * @param int $version Requested version + * @return Mage_Api2_Model_Resource + * @throws Mage_Api2_Exception + */ + public static function loadResourceModel($model, $apiType, $userType, $version) + { + $class = strtr( + self::RESOURCE_CLASS_TEMPLATE, + array(':resource' => $model, ':api' => $apiType, ':user' => $userType, ':version' => $version) + ); + + try { + /** @var $modelObj Mage_Api2_Model_Resource */ + $modelObj = Mage::getModel($class); + } catch (Exception $e) { + // getModel() throws exception when in application is in development mode - skip it to next check + } + if (empty($modelObj) || !$modelObj instanceof Mage_Api2_Model_Resource) { + throw new Mage_Api2_Exception('Resource not found', Mage_Api2_Model_Server::HTTP_NOT_FOUND); + } + return $modelObj; + } + + /** + * Set API user object + * + * @param Mage_Api2_Model_Auth_User_Abstract $apiUser + * @return Mage_Api2_Model_Dispatcher + */ + public function setApiUser(Mage_Api2_Model_Auth_User_Abstract $apiUser) + { + $this->_apiUser = $apiUser; + + return $this; + } + + /** + * Get API user object + * + * @return Mage_Api2_Model_Auth_User_Abstract + */ + public function getApiUser() + { + if (!$this->_apiUser) { + throw new Exception('API user is not set.'); + } + + return $this->_apiUser; + } + + /** + * Get correct version of the resource model + * + * @param string $resourceType + * @param string|bool $requestedVersion + * @return int + * @throws Mage_Api2_Exception + */ + public function getVersion($resourceType, $requestedVersion) + { + if (false !== $requestedVersion && !preg_match('/^[1-9]\d*$/', $requestedVersion)) { + throw new Mage_Api2_Exception( + sprintf('Invalid version "%s" requested.', htmlspecialchars($requestedVersion)), + Mage_Api2_Model_Server::HTTP_BAD_REQUEST + ); + } + return $this->getConfig()->getResourceLastVersion($resourceType, $requestedVersion); + } + + /** + * Get config + * + * @return Mage_Api2_Model_Config + */ + public function getConfig() + { + return Mage::getModel('api2/config'); + } +} diff --git a/app/code/core/Mage/Api2/Model/Multicall.php b/app/code/core/Mage/Api2/Model/Multicall.php new file mode 100644 index 0000000000..9ade4b02a3 --- /dev/null +++ b/app/code/core/Mage/Api2/Model/Multicall.php @@ -0,0 +1,278 @@ + + */ +class Mage_Api2_Model_Multicall +{ + + /** + * @var Mage_Api2_Model_Request + */ + protected $_parentCallRequest; + + /** + * @var string + */ + protected $_parentResourceId; + + /** + * Multicall to subresources of specified resource + * + * @param string $parentResourceId + * @param string $parentResourceName + * @param Mage_Api2_Model_Request $parentCallRequest + * @return Mage_Api2_Model_Response + */ + public function call($parentResourceId, $parentResourceName, Mage_Api2_Model_Request $parentCallRequest) + { + $this->_parentResourceId = $parentResourceId; + $this->_parentCallRequest = $parentCallRequest; + $subresources = $this->_getDeclaredSubresources($parentResourceName); + foreach ($subresources as $subresource) { + $this->_callSubresource($subresource); + } + + return $this->_getResponse(); + } + + /** + * Make call to specified subresource with data from request + * + * @param Mage_Core_Model_Config_Element $subresource + * @return Mage_Api2_Model_Multicall + */ + protected function _callSubresource($subresource) + { + $bodyParams = $this->_getRequest()->getBodyParams(); + // check if subresource data exists in request + $requestParamName = (string)$subresource->request_param_name; + if (!(is_array($bodyParams) && array_key_exists($requestParamName, $bodyParams) + && is_array($bodyParams[$requestParamName])) + ) { + return $this; + } + // make internal call + $subresourceType = (string)$subresource->type; + $requestData = $bodyParams[$requestParamName]; + switch ($subresourceType) { + case 'collection': + foreach ($requestData as $subresourceData) { + $this->_internalCall($subresource, $subresourceData); + } + break; + case 'instance': + default: + $this->_internalCall($subresource, $requestData); + break; + } + return $this; + } + + /** + * Make internal call to specified subresource on with specified data via API2 server + * + * @param Mage_Core_Model_Config_Element $subresource + * @param array $requestData + * @throws Mage_Api2_Exception + * @return Mage_Api2_Model_Multicall + */ + protected function _internalCall($subresource, $requestData) + { + try { + if (!is_array($requestData)) { + throw new Mage_Api2_Exception('Invalid data format', Mage_Api2_Model_Server::HTTP_BAD_REQUEST); + } + $subresourceIdKey = (string)$subresource->id_param_name; + /** @var $server Mage_Api2_Model_Server */ + $server = Mage::getSingleton('api2/server'); + + // create subresource item before linking it to main resource + if (!array_key_exists($subresourceIdKey, $requestData)) { + $subresourceCreateResourceName = (string)$subresource->create_resource_name; + $internalRequest = $this->_prepareRequest($subresourceCreateResourceName, $requestData); + /** @var $internalCreateResponse Mage_Api2_Model_Response */ + $internalCreateResponse = Mage::getModel('api2/response'); + $server->internalCall($internalRequest, $internalCreateResponse); + $createdSubresourceInstanceId = $this->_getCreatedResourceId($internalCreateResponse); + if (empty($createdSubresourceInstanceId)) { + throw new Mage_Api2_Exception('Error during subresource creation', + Mage_Api2_Model_Server::HTTP_INTERNAL_ERROR); + } + $requestData[$subresourceIdKey] = $createdSubresourceInstanceId; + } + + // link subresource to main resource + $subresourceName = (string)$subresource->name; + $parentResourceIdFieldName = (string)$subresource->parent_resource_id_field_name; + $internalRequest = $this->_prepareRequest($subresourceName, $requestData, $parentResourceIdFieldName); + + /** @var $internalResponse Mage_Api2_Model_Response */ + $internalResponse = Mage::getModel('api2/response'); + $server->internalCall($internalRequest, $internalResponse); + } catch (Exception $e) { + // TODO: implement strict mode + Mage::logException($e); + $this->_getResponse()->setException($e); + // TODO: Refactor partial success idintification process + $this->_getResponse()->setHttpResponseCode(Mage_Api2_Model_Server::HTTP_CREATED); + } + + if (isset($internalCreateResponse)) { + $this->_aggregateResponse($internalCreateResponse); + } + if (isset($internalResponse)) { + $this->_aggregateResponse($internalResponse); + } + + return $this; + } + + /** + * Prepare internal request + * + * @param string $subresourceName + * @param array $data + * @param string|null $parentResourceIdFieldName + * @return Mage_Api2_Model_Request_Internal + */ + protected function _prepareRequest($subresourceName, $data, $parentResourceIdFieldName = null) + { + $subresourceUri = $this->_createSubresourceUri($subresourceName, $parentResourceIdFieldName); + /** @var $internalRequest Mage_Api2_Model_Request_Internal */ + $internalRequest = Mage::getModel('api2/request_internal'); + $internalRequest->setRequestUri($subresourceUri); + $internalRequest->setBodyParams($data); + $internalRequest->setMethod('POST'); + return $internalRequest; + } + + /** + * Generate subresource uri + * + * @param string $subresourceName + * @param string $parentResourceIdFieldName + * @return string + */ + protected function _createSubresourceUri($subresourceName, $parentResourceIdFieldName = null) + { + /** @var $apiTypeRoute Mage_Api2_Model_Route_ApiType */ + $apiTypeRoute = Mage::getModel('api2/route_apiType'); + + $chain = $apiTypeRoute->chain( + new Zend_Controller_Router_Route($this->_getConfig()->getMainRoute($subresourceName)) + ); + $params = array(); + $params['api_type'] = 'rest'; + if (null !== $parentResourceIdFieldName) { + $params[$parentResourceIdFieldName] = $this->_parentResourceId; + } + $uri = $chain->assemble($params); + + return '/' . $uri; + } + + /** + * Retrieve list of subresources declared in configuration + * + * @param string $parentResourceName + * @return array + */ + protected function _getDeclaredSubresources($parentResourceName) + { + return $this->_getConfig()->getResourceSubresources($parentResourceName); + } + + /** + * Retrieve API2 config + * + * @return Mage_Api2_Model_Config + */ + protected function _getConfig() + { + return Mage::getSingleton('api2/config'); + } + + /** + * Retrieve global response + * + * @return Mage_Api2_Model_Response + */ + protected function _getResponse() + { + return Mage::getSingleton('api2/response'); + } + + /** + * Retrieve parent request + * + * @return Mage_Api2_Model_Request + */ + protected function _getRequest() + { + return $this->_parentCallRequest; + } + + /** + * Add internal call response to global response + * + * @param Mage_Api2_Model_Response $response + */ + protected function _aggregateResponse(Mage_Api2_Model_Response $response) + { + if ($response->isException()) { + $errors = $response->getException(); + // @TODO: add subresource prefix to error messages + foreach ($errors as $error) { + $this->_getResponse()->setException($error); + } + } + } + + /** + * Retrieve created resource id from response + * + * @param Mage_Api2_Model_Response $response + * @return string|int + */ + protected function _getCreatedResourceId($response) + { + $resourceId = 0; + $headers = $response->getHeaders(); + foreach ($headers as $header) { + if ($header['name'] == 'Location') { + list($resourceId) = array_reverse(explode('/', $header['value'])); + break; + } + } + return $resourceId; + } +} diff --git a/app/code/core/Mage/Api2/Model/Observer.php b/app/code/core/Mage/Api2/Model/Observer.php new file mode 100644 index 0000000000..ce54ab708a --- /dev/null +++ b/app/code/core/Mage/Api2/Model/Observer.php @@ -0,0 +1,86 @@ + + */ +class Mage_Api2_Model_Observer +{ + /** + * Save relation of admin user to API2 role + * + * @param Varien_Event_Observer $observer + * @return void + */ + public function saveAdminToRoleRelation(Varien_Event_Observer $observer) + { + /** @var $user Mage_Admin_Model_User Object */ + $user = $observer->getObject(); + + if ($user->hasData('api2_roles')) { + $roles = $user->getData('api2_roles'); + + if (!is_array($roles) || !isset($roles[0])) { + throw new Exception('API2 roles property has wrong data format.'); + } + + /** @var $resourceModel Mage_Api2_Model_Resource_Acl_Global_Role */ + $resourceModel = Mage::getResourceModel('api2/acl_global_role'); + $resourceModel->saveAdminToRoleRelation($user->getId(), $roles[0]); + } + } + + /** + * After save attribute if it is not visible on front remove it from Attribute ACL + * + * @param Varien_Event_Observer $observer + * @return Mage_Api2_Model_Observer + */ + public function catalogAttributeSaveAfter(Varien_Event_Observer $observer) + { + /** @var $attribute Mage_Catalog_Model_Resource_Eav_Attribute */ + $attribute = $observer->getEvent()->getAttribute(); + if ($attribute->getIsUserDefined() && $attribute->dataHasChangedFor('is_visible_on_front') + && !$attribute->getIsVisibleOnFront()) { + /** @var $collection Mage_Api2_Model_Resource_Acl_Filter_Attribute_Collection */ + $collection = Mage::getResourceModel('api2/acl_filter_attribute_collection'); + /** @var $aclFilter Mage_Api2_Model_Acl_Filter_Attribute */ + foreach ($collection as $aclFilter) { + if ($aclFilter->getResourceId() != Mage_Api2_Model_Acl_Global_Rule::RESOURCE_ALL) { + $allowedAttributes = explode(',', $aclFilter->getAllowedAttributes()); + $allowedAttributes = array_diff($allowedAttributes, array($attribute->getAttributeCode())); + $aclFilter->setAllowedAttributes(implode(',', $allowedAttributes))->save(); + } + } + } + + return $this; + } +} diff --git a/app/code/core/Mage/Api2/Model/Renderer.php b/app/code/core/Mage/Api2/Model/Renderer.php new file mode 100644 index 0000000000..2e5b2d21cf --- /dev/null +++ b/app/code/core/Mage/Api2/Model/Renderer.php @@ -0,0 +1,83 @@ + + */ +abstract class Mage_Api2_Model_Renderer +{ + /** + * Get Renderer of given type + * + * @param array|string $acceptTypes + * @throws Mage_Api2_Exception + * @throws Exception + * @return Mage_Api2_Model_Renderer_Interface + */ + public static function factory($acceptTypes) + { + /** @var $helper Mage_Api2_Helper_Data */ + $helper = Mage::helper('api2'); + $adapters = $helper->getResponseRenderAdapters(); + + if (!is_array($acceptTypes)) { + $acceptTypes = array($acceptTypes); + } + + $type = null; + $adapterPath = null; + foreach ($acceptTypes as $type) { + foreach ($adapters as $item) { + $itemType = $item->type; + if ($type == $itemType + || $type == current(explode('/', $itemType)) . '/*' || $type == '*/*' + ) { + $adapterPath = $item->model; + break 2; + } + } + } + + //if server can't respond in any of accepted types it SHOULD send 406(not acceptable) + if (null === $adapterPath) { + throw new Mage_Api2_Exception( + 'Server can not understand Accept HTTP header media type.', + Mage_Api2_Model_Server::HTTP_NOT_ACCEPTABLE + ); + } + + $adapter = Mage::getModel($adapterPath); + if (!$adapter) { + throw new Exception(sprintf('Response renderer adapter for content type "%s" not found.', $type)); + } + + return $adapter; + } +} diff --git a/app/code/core/Mage/Api2/Model/Renderer/Interface.php b/app/code/core/Mage/Api2/Model/Renderer/Interface.php new file mode 100644 index 0000000000..c833863d90 --- /dev/null +++ b/app/code/core/Mage/Api2/Model/Renderer/Interface.php @@ -0,0 +1,50 @@ + + */ +interface Mage_Api2_Model_Renderer_Interface +{ + /** + * Render content in a certain format + * + * @param array|object $data + * @return string + */ + public function render($data); + + /** + * Get MIME type generated by renderer + * + * @return string + */ + public function getMimeType(); +} diff --git a/app/code/core/Mage/Api2/Model/Renderer/Json.php b/app/code/core/Mage/Api2/Model/Renderer/Json.php new file mode 100644 index 0000000000..e0d6750333 --- /dev/null +++ b/app/code/core/Mage/Api2/Model/Renderer/Json.php @@ -0,0 +1,61 @@ + + */ +class Mage_Api2_Model_Renderer_Json implements Mage_Api2_Model_Renderer_Interface +{ + /** + * Adapter mime type + */ + const MIME_TYPE = 'application/json'; + + /** + * Convert Array to JSON + * + * @param array|object $data + * @return string + */ + public function render($data) + { + return Zend_Json::encode($data); + } + + /** + * Get MIME type generated by renderer + * + * @return string + */ + public function getMimeType() + { + return self::MIME_TYPE; + } +} diff --git a/app/code/core/Mage/Api2/Model/Renderer/Query.php b/app/code/core/Mage/Api2/Model/Renderer/Query.php new file mode 100644 index 0000000000..4aece41353 --- /dev/null +++ b/app/code/core/Mage/Api2/Model/Renderer/Query.php @@ -0,0 +1,62 @@ + + */ +class Mage_Api2_Model_Renderer_Query implements Mage_Api2_Model_Renderer_Interface +{ + /** + * Adapter mime type + */ + const MIME_TYPE = 'text/plain'; + + /** + * Convert Array to URL-encoded query string + * + * @param array|object $data + * @return string + */ + public function render($data) + { + $query = http_build_query($data); + return $query; + } + + /** + * Get MIME type generated by renderer + * + * @return string + */ + public function getMimeType() + { + return self::MIME_TYPE; + } +} diff --git a/app/code/core/Mage/Api2/Model/Renderer/Xml.php b/app/code/core/Mage/Api2/Model/Renderer/Xml.php new file mode 100644 index 0000000000..02e3c0429d --- /dev/null +++ b/app/code/core/Mage/Api2/Model/Renderer/Xml.php @@ -0,0 +1,162 @@ + + */ +class Mage_Api2_Model_Renderer_Xml implements Mage_Api2_Model_Renderer_Interface +{ + /** + * Adapter mime type + */ + const MIME_TYPE = 'application/xml'; + + /** + * Default name for item of non-associative array + */ + const ARRAY_NON_ASSOC_ITEM_NAME = 'data_item'; + + /** + * Chars for replacement in the tag name + * + * @var array + */ + protected $_replacementInTagName = array( + '!' => '', '"' => '', '#' => '', '$' => '', '%' => '', '&' => '', '\'' => '', + '(' => '', ')' => '', '*' => '', '+' => '', ',' => '', '/' => '', ';' => '', + '<' => '', '=' => '', '>' => '', '?' => '', '@' => '', '[' => '', '\\' => '', + ']' => '', '^' => '', '`' => '', '{' => '', '|' => '', '}' => '', '~' => '', + ' ' => '_', ':' => '_' + ); + + /** + * Chars for replacement in the tag value + * + * @var array + */ + protected $_replacementInTagValue = array( + '&' => '&' // replace "&" with HTML entity, because by default not replaced + ); + + /** + * Protected pattern for check chars in the begin of tag name + * + * @var string + */ + protected $_protectedTagNamePattern = '/^[0-9,.-]/'; + + /** + * Convert Array to XML + * + * @param mixed $data + * @return string + */ + public function render($data) + { + /* @var $writer Mage_Api2_Model_Renderer_Xml_Writer */ + $writer = Mage::getModel('api2/renderer_xml_writer', array( + 'config' => new Zend_Config($this->_prepareData($data, true)) + )); + return $writer->render(); + } + + /** + * Prepare convert data + * + * @param array|Varien_Object $data + * @param bool $root + * @return array + * @throws Exception + */ + protected function _prepareData($data, $root = false) + { + if (!is_array($data) && !is_object($data)) { + if ($root) { + $data = array($data); + } else { + throw new Exception('Prepare data must be an object or an array.'); + } + } + $data = $data instanceof Varien_Object ? $data->toArray() : (array)$data; + $isAssoc = !preg_match('/^\d+$/', implode(array_keys($data), '')); + + $preparedData = array(); + foreach ($data as $key => $value) { + $value = is_array($value) || is_object($value) ? $this->_prepareData($value) : $this->_prepareValue($value); + if ($isAssoc) { + $preparedData[$this->_prepareKey($key)] = $value; + } else { + $preparedData[self::ARRAY_NON_ASSOC_ITEM_NAME][] = $value; + } + } + return $preparedData; + } + + /** + * Prepare value + * + * @param string $value + * @return string + */ + protected function _prepareValue($value) + { + return str_replace( + array_keys($this->_replacementInTagValue), + array_values($this->_replacementInTagValue), + $value + ); + } + + /** + * Prepare key and replace unavailable chars + * + * @param string $key + * @return string + */ + protected function _prepareKey($key) + { + $key = str_replace(array_keys($this->_replacementInTagName), array_values($this->_replacementInTagName), $key); + $key = trim($key, '_'); + if (preg_match($this->_protectedTagNamePattern, $key)) { + $key = self::ARRAY_NON_ASSOC_ITEM_NAME . '_' . $key; + } + return $key; + } + + /** + * Get MIME type generated by renderer + * + * @return string + */ + public function getMimeType() + { + return self::MIME_TYPE; + } +} diff --git a/app/code/core/Mage/Api2/Model/Renderer/Xml/Writer.php b/app/code/core/Mage/Api2/Model/Renderer/Xml/Writer.php new file mode 100644 index 0000000000..6d616c1f6f --- /dev/null +++ b/app/code/core/Mage/Api2/Model/Renderer/Xml/Writer.php @@ -0,0 +1,80 @@ + + */ +class Mage_Api2_Model_Renderer_Xml_Writer extends Zend_Config_Writer_Xml +{ + /** + * Root node in XML output + */ + const XML_ROOT_NODE = 'magento_api'; + + /** + * Render a Zend_Config into a XML config string. + * OVERRIDE to avoid using zend-config string in XML + * + * @return string + */ + public function render() + { + $xml = new SimpleXMLElement('<' . self::XML_ROOT_NODE . '/>'); + $extends = $this->_config->getExtends(); + $sectionName = $this->_config->getSectionName(); + + if (is_string($sectionName)) { + $child = $xml->addChild($sectionName); + + $this->_addBranch($this->_config, $child, $xml); + } else { + foreach ($this->_config as $sectionName => $data) { + if (!($data instanceof Zend_Config)) { + $xml->addChild($sectionName, (string) $data); + } else { + $child = $xml->addChild($sectionName); + + if (isset($extends[$sectionName])) { + $child->addAttribute('zf:extends', $extends[$sectionName], Zend_Config_Xml::XML_NAMESPACE); + } + + $this->_addBranch($data, $child, $xml); + } + } + } + + $dom = dom_import_simplexml($xml)->ownerDocument; + $dom->formatOutput = true; + + $xmlString = $dom->saveXML(); + + return $xmlString; + } +} diff --git a/app/code/core/Mage/Api2/Model/Request.php b/app/code/core/Mage/Api2/Model/Request.php new file mode 100644 index 0000000000..6b40def624 --- /dev/null +++ b/app/code/core/Mage/Api2/Model/Request.php @@ -0,0 +1,325 @@ + + */ +class Mage_Api2_Model_Request extends Zend_Controller_Request_Http +{ + /** + * Character set which must be used in request + */ + const REQUEST_CHARSET = 'utf-8'; + + /**#@+ + * Name of query ($_GET) parameters to use in navigation and so on + */ + const QUERY_PARAM_REQ_ATTRS = 'attrs'; + const QUERY_PARAM_PAGE_NUM = 'page'; + const QUERY_PARAM_PAGE_SIZE = 'limit'; + const QUERY_PARAM_ORDER_FIELD = 'order'; + const QUERY_PARAM_ORDER_DIR = 'dir'; + const QUERY_PARAM_FILTER = 'filter'; + /**#@- */ + + /** + * Interpreter adapter + * + * @var Mage_Api2_Model_Request_Interpreter_Interface + */ + protected $_interpreter; + + /** + * Body params + * + * @var array + */ + protected $_bodyParams; + + /** + * Constructor + * + * If a $uri is passed, the object will attempt to populate itself using + * that information. + * Override parent class to allow object instance get via Mage::getSingleton() + * + * @param string|Zend_Uri $uri + */ + public function __construct($uri = null) + { + parent::__construct($uri ? $uri : null); + } + + /** + * Get request interpreter + * + * @return Mage_Api2_Model_Request_Interpreter_Interface + */ + protected function _getInterpreter() + { + if (null === $this->_interpreter) { + $this->_interpreter = Mage_Api2_Model_Request_Interpreter::factory($this->getContentType()); + } + return $this->_interpreter; + } + + /** + * Retrieve accept types understandable by requester in a form of array sorted by quality descending + * + * @return array + */ + public function getAcceptTypes() + { + $qualityToTypes = array(); + $orderedTypes = array(); + + foreach (preg_split('/,\s*/', $this->getHeader('Accept')) as $definition) { + $typeWithQ = explode(';', $definition); + $mimeType = trim(array_shift($typeWithQ)); + + // check MIME type validity + if (!preg_match('~^([0-9a-z*+\-]+)(?:/([0-9a-z*+\-\.]+))?$~i', $mimeType)) { + continue; + } + $quality = '1.0'; // default value for quality + + if ($typeWithQ) { + $qAndValue = explode('=', $typeWithQ[0]); + + if (2 == count($qAndValue)) { + $quality = $qAndValue[1]; + } + } + $qualityToTypes[$quality][$mimeType] = true; + } + krsort($qualityToTypes); + + foreach ($qualityToTypes as $typeList) { + $orderedTypes += $typeList; + } + return array_keys($orderedTypes); + } + + /** + * Get api type from Request + * + * @return string + */ + public function getApiType() + { + // getParam() is not used to avoid parameter fetch from $_GET or $_POST + return isset($this->_params['api_type']) ? $this->_params['api_type'] : null; + } + + /** + * Fetch data from HTTP Request body + * + * @return array + */ + public function getBodyParams() + { + if (null == $this->_bodyParams) { + $this->_bodyParams = $this->_getInterpreter()->interpret((string)$this->getRawBody()); + } + return $this->_bodyParams; + } + + /** + * Get Content-Type of request + * + * @return string + * @throws Mage_Api2_Exception + */ + public function getContentType() + { + $headerValue = $this->getHeader('Content-Type'); + + if (!$headerValue) { + throw new Mage_Api2_Exception('Content-Type header is empty', Mage_Api2_Model_Server::HTTP_BAD_REQUEST); + } + if (!preg_match('~^([a-z\d/\-+.]+)(?:; *charset=(.+))?$~Ui', $headerValue, $matches)) { + throw new Mage_Api2_Exception('Invalid Content-Type header', Mage_Api2_Model_Server::HTTP_BAD_REQUEST); + } + // request encoding check if it is specified in header + if (isset($matches[2]) && self::REQUEST_CHARSET != strtolower($matches[2])) { + throw new Mage_Api2_Exception( + 'UTF-8 is the only supported charset', Mage_Api2_Model_Server::HTTP_BAD_REQUEST + ); + } + return $matches[1]; + } + + /** + * Get filter settings passed by API user + * + * @return mixed + */ + public function getFilter() + { + return $this->getQuery(self::QUERY_PARAM_FILTER); + } + + /** + * Get resource model class name + * + * @return string|null + */ + public function getModel() + { + // getParam() is not used to avoid parameter fetch from $_GET or $_POST + return isset($this->_params['model']) ? $this->_params['model'] : null; + } + + /** + * Retrieve one of CRUD operation dependent on HTTP method + * + * @return string + * @throws Mage_Api2_Exception + */ + public function getOperation() + { + if (!$this->isGet() && !$this->isPost() && !$this->isPut() && !$this->isDelete()) { + throw new Mage_Api2_Exception('Invalid request method', Mage_Api2_Model_Server::HTTP_BAD_REQUEST); + } + // Map HTTP methods to classic CRUD verbs + $operationByMethod = array( + 'GET' => Mage_Api2_Model_Resource::OPERATION_RETRIEVE, + 'POST' => Mage_Api2_Model_Resource::OPERATION_CREATE, + 'PUT' => Mage_Api2_Model_Resource::OPERATION_UPDATE, + 'DELETE' => Mage_Api2_Model_Resource::OPERATION_DELETE + ); + + return $operationByMethod[$this->getMethod()]; + } + + /** + * Get sort order direction requested by API user + * + * @return mixed + */ + public function getOrderDirection() + { + return $this->getQuery(self::QUERY_PARAM_ORDER_DIR); + } + + /** + * Get sort order field requested by API user + * + * @return mixed + */ + public function getOrderField() + { + return $this->getQuery(self::QUERY_PARAM_ORDER_FIELD); + } + + /** + * Retrieve page number requested by API user + * + * @return mixed + */ + public function getPageNumber() + { + return $this->getQuery(self::QUERY_PARAM_PAGE_NUM); + } + + /** + * Retrieve page size requested by API user + * + * @return mixed + */ + public function getPageSize() + { + return $this->getQuery(self::QUERY_PARAM_PAGE_SIZE); + } + + /** + * Get an array of attribute codes requested by API user + * + * @return array + */ + public function getRequestedAttributes() + { + $include = $this->getQuery(self::QUERY_PARAM_REQ_ATTRS, array()); + + //transform comma-separated list + if (!is_array($include)) { + $include = explode(',', $include); + } + return array_map('trim', $include); + } + + /** + * Retrieve resource type + * + * @return string + */ + public function getResourceType() + { + // getParam() is not used to avoid parameter fetch from $_GET or $_POST + return isset($this->_params['type']) ? $this->_params['type'] : null; + } + + /** + * Get Version header from headers + * + * @return string + */ + public function getVersion() + { + return $this->getHeader('Version'); + } + + /** + * Retrieve action type + * + * @return string|null + */ + public function getActionType() + { + // getParam() is not used to avoid parameter fetch from $_GET or $_POST + return isset($this->_params['action_type']) ? $this->_params['action_type'] : null; + } + + /** + * It checks if the array in the request body is an associative one. + * It is required for definition of the dynamic aaction type (multi or single) + * + * @return bool + */ + public function isAssocArrayInRequestBody() + { + $params = $this->getBodyParams(); + if (count($params)) { + $keys = array_keys($params); + return !is_numeric($keys[0]); + } + return false; + } +} diff --git a/app/code/core/Mage/Api2/Model/Request/Internal.php b/app/code/core/Mage/Api2/Model/Request/Internal.php new file mode 100644 index 0000000000..bfbfe1d3a8 --- /dev/null +++ b/app/code/core/Mage/Api2/Model/Request/Internal.php @@ -0,0 +1,105 @@ + + */ +class Mage_Api2_Model_Request_Internal extends Mage_Api2_Model_Request +{ + /** + * Request body data + * + * @var array + */ + protected $_bodyParams; + + /** + * Request method + * + * @var string + */ + protected $_method; + + /** + * Fetch data from HTTP Request body + * + * @return array + */ + public function getBodyParams() + { + if ($this->_bodyParams === null) { + $this->_bodyParams = $this->_getInterpreter()->interpret((string) $this->getRawBody()); + } + return $this->_bodyParams; + } + + /** + * Set request body data + * + * @param array $data + * @return Mage_Api2_Model_Request + */ + public function setBodyParams($data) + { + $this->_bodyParams = $data; + return $this; + } + + /** + * Set HTTP request method for request emulation during internal call + * + * @param string $method + * @return Mage_Api2_Model_Request_Internal + */ + public function setMethod($method) + { + $availableMethod = array('GET', 'POST', 'PUT', 'DELETE'); + if (in_array($method, $availableMethod)) { + $this->_method = $method; + } else { + throw new Mage_Api2_Exception('Invalid method provided', Mage_Api2_Model_Server::HTTP_INTERNAL_ERROR); + } + return $this; + } + + /** + * Override parent method for request emulation during internal call + * + * @return string + */ + public function getMethod() + { + $method = $this->_method; + if (!$method) { + $method = parent::getMethod(); + } + return $method; + } +} diff --git a/app/code/core/Mage/Api2/Model/Request/Interpreter.php b/app/code/core/Mage/Api2/Model/Request/Interpreter.php new file mode 100644 index 0000000000..03322399d8 --- /dev/null +++ b/app/code/core/Mage/Api2/Model/Request/Interpreter.php @@ -0,0 +1,76 @@ + + */ +abstract class Mage_Api2_Model_Request_Interpreter +{ + /** + * Request body interpreters factory + * + * @param string $type + * @return Mage_Api2_Model_Request_Interpreter_Interface + * @throws Exception|Mage_Api2_Exception + */ + public static function factory($type) + { + /** @var $helper Mage_Api2_Helper_Data */ + $helper = Mage::helper('api2/data'); + $adapters = $helper->getRequestInterpreterAdapters(); + + if (empty($adapters) || !is_array($adapters)) { + throw new Exception('Request interpreter adapters is not set.'); + } + + $adapterModel = null; + foreach ($adapters as $item) { + $itemType = $item->type; + if ($itemType == $type) { + $adapterModel = $item->model; + break; + } + } + + if ($adapterModel === null) { + throw new Mage_Api2_Exception( + sprintf('Server can not understand Content-Type HTTP header media type "%s"', $type), + Mage_Api2_Model_Server::HTTP_BAD_REQUEST + ); + } + + $adapter = Mage::getModel($adapterModel); + if (!$adapter) { + throw new Exception(sprintf('Request interpreter adapter "%s" not found.', $type)); + } + + return $adapter; + } +} diff --git a/app/code/core/Mage/Api2/Model/Request/Interpreter/Interface.php b/app/code/core/Mage/Api2/Model/Request/Interpreter/Interface.php new file mode 100644 index 0000000000..91a79ce921 --- /dev/null +++ b/app/code/core/Mage/Api2/Model/Request/Interpreter/Interface.php @@ -0,0 +1,43 @@ + + */ +interface Mage_Api2_Model_Request_Interpreter_Interface +{ + /** + * Parse request body into array of params + * + * @param string $body Posted content from request + * @return array|null Return NULL if content is invalid + */ + public function interpret($body); +} diff --git a/app/code/core/Mage/Api2/Model/Request/Interpreter/Json.php b/app/code/core/Mage/Api2/Model/Request/Interpreter/Json.php new file mode 100644 index 0000000000..c533a8fe24 --- /dev/null +++ b/app/code/core/Mage/Api2/Model/Request/Interpreter/Json.php @@ -0,0 +1,57 @@ + + */ +class Mage_Api2_Model_Request_Interpreter_Json implements Mage_Api2_Model_Request_Interpreter_Interface +{ + /** + * Parse Request body into array of params + * + * @param string $body Posted content from request + * @return array|null Return NULL if content is invalid + * @throws Exception|Mage_Api2_Exception + */ + public function interpret($body) + { + if (!is_string($body)) { + throw new Exception(sprintf('Invalid data type "%s". String expected.', gettype($body))); + } + + $decoded = Zend_Json::decode($body); + + if ($body != 'null' && $decoded === null) { + throw new Mage_Api2_Exception('Decoding error.', Mage_Api2_Model_Server::HTTP_BAD_REQUEST); + } + + return $decoded; + } +} diff --git a/app/code/core/Mage/Api2/Model/Request/Interpreter/Query.php b/app/code/core/Mage/Api2/Model/Request/Interpreter/Query.php new file mode 100644 index 0000000000..90a6bb145f --- /dev/null +++ b/app/code/core/Mage/Api2/Model/Request/Interpreter/Query.php @@ -0,0 +1,77 @@ + + */ +class Mage_Api2_Model_Request_Interpreter_Query implements Mage_Api2_Model_Request_Interpreter_Interface +{ + /** + * URI validate pattern + */ + const URI_VALIDATE_PATTERN = "/^(?:%[[:xdigit:]]{2}|[A-Za-z0-9-_.!~*'()\[\];\/?:@&=+$,])*$/"; + + /** + * Parse request body into array of params + * + * @param string $body Posted content from request + * @return array Return always array + * @throws Exception|Mage_Api2_Exception + */ + public function interpret($body) + { + if (!is_string($body)) { + throw new Exception(sprintf('Invalid data type "%s". String expected.', gettype($body))); + } + + if (!$this->_validateQuery($body)) { + throw new Mage_Api2_Exception( + 'Invalid data type. Check Content-Type.', + Mage_Api2_Model_Server::HTTP_BAD_REQUEST + ); + } + + $data = array(); + parse_str($body, $data); + return $data; + } + + /** + * Returns true if and only if the query string passes validation. + * + * @param string $query The query to validate + * @return boolean + * @link http://www.faqs.org/rfcs/rfc2396.html + */ + protected function _validateQuery($query) + { + return preg_match(self::URI_VALIDATE_PATTERN, $query); + } +} diff --git a/app/code/core/Mage/Api2/Model/Request/Interpreter/Xml.php b/app/code/core/Mage/Api2/Model/Request/Interpreter/Xml.php new file mode 100644 index 0000000000..0c0e45b37c --- /dev/null +++ b/app/code/core/Mage/Api2/Model/Request/Interpreter/Xml.php @@ -0,0 +1,150 @@ + + */ +class Mage_Api2_Model_Request_Interpreter_Xml implements Mage_Api2_Model_Request_Interpreter_Interface +{ + /** + * Default name for item of non-associative array + */ + const ARRAY_NON_ASSOC_ITEM_NAME = 'data_item'; + + /** + * Load error string. + * + * Is null if there was no error while loading + * + * @var string + */ + protected $_loadErrorStr = null; + + /** + * Parse Request body into array of params + * + * @param string $body Posted content from request + * @return array + * @throws Exception|Mage_Api2_Exception + */ + public function interpret($body) + { + if (!is_string($body)) { + throw new Exception(sprintf('Invalid data type "%s". String expected.', gettype($body))); + } + $body = false !== strpos($body, '' . PHP_EOL . $body; + + set_error_handler(array($this, '_loadErrorHandler')); // Warnings and errors are suppressed + $config = simplexml_load_string($body); + restore_error_handler(); + + // Check if there was a error while loading file + if ($this->_loadErrorStr !== null) { + throw new Mage_Api2_Exception('Decoding error.', Mage_Api2_Model_Server::HTTP_BAD_REQUEST); + } + + $xml = $this->_toArray($config); + return $xml; + } + + /** + * Returns an associativearray from a SimpleXMLElement. + * + * @param SimpleXMLElement $xmlObject Convert a SimpleXMLElement into an array + * @return array + */ + protected function _toArray(SimpleXMLElement $xmlObject) + { + $config = array(); + // Search for parent node values + if (count($xmlObject->attributes()) > 0) { + foreach ($xmlObject->attributes() as $key => $value) { + $value = (string)$value; + if (array_key_exists($key, $config)) { + if (!is_array($config[$key])) { + $config[$key] = array($config[$key]); + } + $config[$key][] = $value; + } else { + $config[$key] = $value; + } + } + } + + // Search for children + if (count($xmlObject->children()) > 0) { + foreach ($xmlObject->children() as $key => $value) { + if (count($value->children()) > 0) { + $value = $this->_toArray($value); + } else if (count($value->attributes()) > 0) { + $attributes = $value->attributes(); + if (isset($attributes['value'])) { + $value = (string)$attributes['value']; + } else { + $value = $this->_toArray($value); + } + } else { + $value = (string) $value; + } + if (array_key_exists($key, $config)) { + if (!is_array($config[$key]) || !array_key_exists(0, $config[$key])) { + $config[$key] = array($config[$key]); + } + $config[$key][] = $value; + } else { + if (self::ARRAY_NON_ASSOC_ITEM_NAME != $key) { + $config[$key] = $value; + } else { + $config[] = $value; + } + } + } + } + + return $config; + } + + /** + * Handle any errors from load xml + * + * @param integer $errno + * @param string $errstr + * @param string $errfile + * @param integer $errline + */ + protected function _loadErrorHandler($errno, $errstr, $errfile, $errline) + { + if ($this->_loadErrorStr === null) { + $this->_loadErrorStr = $errstr; + } else { + $this->_loadErrorStr .= (PHP_EOL . $errstr); + } + } +} diff --git a/app/code/core/Mage/Api2/Model/Resource.php b/app/code/core/Mage/Api2/Model/Resource.php new file mode 100644 index 0000000000..938858ffd5 --- /dev/null +++ b/app/code/core/Mage/Api2/Model/Resource.php @@ -0,0 +1,1082 @@ + + * @method string _create() _create(array $filteredData) creation of an entity + * @method void _multiCreate() _multiCreate(array $filteredData) processing and creation of a collection + * @method array _retrieve() retrieving an entity + * @method array _retrieveCollection() retrieving a collection + * @method void _update() _update(array $filteredData) update of an entity + * @method void _multiUpdate() _multiUpdate(array $filteredData) update of a collection + * @method void _delete() deletion of an entity + * @method void _multidelete() _multidelete(array $requestData) deletion of a collection + */ +abstract class Mage_Api2_Model_Resource +{ + /**#@+ + * Action types + */ + const ACTION_TYPE_ENTITY = 'entity'; + const ACTION_TYPE_COLLECTION = 'collection'; + /**#@-*/ + + /**#@+ + * Operations. Resource method names + */ + const OPERATION_CREATE = 'create'; + const OPERATION_RETRIEVE = 'retrieve'; + const OPERATION_UPDATE = 'update'; + const OPERATION_DELETE = 'delete'; + /**#@-*/ + + /**#@+ + * Common operations for attributes + */ + const OPERATION_ATTRIBUTE_READ = 'read'; + const OPERATION_ATTRIBUTE_WRITE = 'write'; + /**#@-*/ + + /**#@+ + * Default error messages + */ + const RESOURCE_NOT_FOUND = 'Resource not found.'; + const RESOURCE_METHOD_NOT_ALLOWED = 'Resource does not support method.'; + const RESOURCE_METHOD_NOT_IMPLEMENTED = 'Resource method not implemented yet.'; + const RESOURCE_INTERNAL_ERROR = 'Resource internal error.'; + const RESOURCE_DATA_PRE_VALIDATION_ERROR = 'Resource data pre-validation error.'; + const RESOURCE_DATA_INVALID = 'Resource data invalid.'; //error while checking data inside method + const RESOURCE_UNKNOWN_ERROR = 'Resource unknown error.'; + const RESOURCE_REQUEST_DATA_INVALID = 'The request data is invalid.'; + /**#@-*/ + + /**#@+ + * Default collection resources error messages + */ + const RESOURCE_COLLECTION_PAGING_ERROR = 'Resource collection paging error.'; + const RESOURCE_COLLECTION_PAGING_LIMIT_ERROR = 'The paging limit exceeds the allowed number.'; + const RESOURCE_COLLECTION_ORDERING_ERROR = 'Resource collection ordering error.'; + const RESOURCE_COLLECTION_FILTERING_ERROR = 'Resource collection filtering error.'; + const RESOURCE_COLLECTION_ATTRIBUTES_ERROR = 'Resource collection including additional attributes error.'; + /**#@-*/ + + /**#@+ + * Default success messages + */ + const RESOURCE_UPDATED_SUCCESSFUL = 'Resource updated successful.'; + /**#@-*/ + + /**#@+ + * Collection page sizes + */ + const PAGE_SIZE_DEFAULT = 10; + const PAGE_SIZE_MAX = 100; + /**#@-*/ + + /** + * Request + * + * @var Mage_Api2_Model_Request + */ + protected $_request; + + /** + * Resource type + * + * @var string + */ + protected $_resourceType; + + /** + * Api type + * + * @var string + */ + protected $_apiType; + + /** + * API Version + * + * @var int + */ + protected $_version = null; + + /** + * Response + * + * @var Zend_Controller_Response_Http + */ + protected $_response; + + /** + * Attribute Filter + * + * @var Mage_Api2_Model_Acl_Filter + */ + protected $_filter; + + /** + * Renderer + * + * @var Mage_Api2_Model_Renderer_Interface + */ + protected $_renderer; + + /** + * Api user + * + * @var Mage_Api2_Model_Auth_User_Abstract + */ + protected $_apiUser; + + /** + * User type + * + * @var string + */ + protected $_userType; + + /** + * One of Mage_Api2_Model_Resource::ACTION_TYPE_... constant + * + * @var string + */ + protected $_actionType; + + /** + * One of Mage_Api2_Model_Resource::OPERATION_... constant + * + * @var string + */ + protected $_operation; + + /** + * If TRUE - no rendering will be done and dispatch will return data. Otherwise, by default + * + * @var bool + */ + protected $_returnData = false; + + /** + * @var Mage_Api2_Model_Multicall + */ + protected $_multicall; + + /** + * Dispatch + * To implement the functionality, you must create a method in the parent one. + * + * Action type is defined in api2.xml in the routes section and depends on entity (single object) + * or collection (several objects). + * + * HTTP_MULTI_STATUS is used for several status codes in the response + */ + public function dispatch() + { + switch ($this->getActionType() . $this->getOperation()) { + /* Create */ + case self::ACTION_TYPE_ENTITY . self::OPERATION_CREATE: + // Creation of objects is possible only when working with collection + $this->_critical(self::RESOURCE_METHOD_NOT_IMPLEMENTED); + break; + case self::ACTION_TYPE_COLLECTION . self::OPERATION_CREATE: + // If no of the methods(multi or single) is implemented, request body is not checked + if (!$this->_checkMethodExist('_create') && !$this->_checkMethodExist('_multiCreate')) { + $this->_critical(self::RESOURCE_METHOD_NOT_IMPLEMENTED); + } + // If one of the methods(multi or single) is implemented, request body must not be empty + $requestData = $this->getRequest()->getBodyParams(); + if (empty($requestData)) { + $this->_critical(self::RESOURCE_REQUEST_DATA_INVALID); + } + // The create action has the dynamic type which depends on data in the request body + if ($this->getRequest()->isAssocArrayInRequestBody()) { + $this->_errorIfMethodNotExist('_create'); + $filteredData = $this->getFilter()->in($requestData); + if (empty($filteredData)) { + $this->_critical(self::RESOURCE_REQUEST_DATA_INVALID); + } + $newItemLocation = $this->_create($filteredData); + $this->getResponse()->setHeader('Location', $newItemLocation); + } else { + $this->_errorIfMethodNotExist('_multiCreate'); + $filteredData = $this->getFilter()->collectionIn($requestData); + $this->_multiCreate($filteredData); + $this->_render($this->getResponse()->getMessages()); + $this->getResponse()->setHttpResponseCode(Mage_Api2_Model_Server::HTTP_MULTI_STATUS); + } + break; + /* Retrieve */ + case self::ACTION_TYPE_ENTITY . self::OPERATION_RETRIEVE: + $this->_errorIfMethodNotExist('_retrieve'); + $retrievedData = $this->_retrieve(); + $filteredData = $this->getFilter()->out($retrievedData); + $this->_render($filteredData); + break; + case self::ACTION_TYPE_COLLECTION . self::OPERATION_RETRIEVE: + $this->_errorIfMethodNotExist('_retrieveCollection'); + $retrievedData = $this->_retrieveCollection(); + $filteredData = $this->getFilter()->collectionOut($retrievedData); + $this->_render($filteredData); + break; + /* Update */ + case self::ACTION_TYPE_ENTITY . self::OPERATION_UPDATE: + $this->_errorIfMethodNotExist('_update'); + $requestData = $this->getRequest()->getBodyParams(); + if (empty($requestData)) { + $this->_critical(self::RESOURCE_REQUEST_DATA_INVALID); + } + $filteredData = $this->getFilter()->in($requestData); + if (empty($filteredData)) { + $this->_critical(self::RESOURCE_REQUEST_DATA_INVALID); + } + $this->_update($filteredData); + break; + case self::ACTION_TYPE_COLLECTION . self::OPERATION_UPDATE: + $this->_errorIfMethodNotExist('_multiUpdate'); + $requestData = $this->getRequest()->getBodyParams(); + if (empty($requestData)) { + $this->_critical(self::RESOURCE_REQUEST_DATA_INVALID); + } + $filteredData = $this->getFilter()->collectionIn($requestData); + $this->_multiUpdate($filteredData); + $this->_render($this->getResponse()->getMessages()); + $this->getResponse()->setHttpResponseCode(Mage_Api2_Model_Server::HTTP_MULTI_STATUS); + break; + /* Delete */ + case self::ACTION_TYPE_ENTITY . self::OPERATION_DELETE: + $this->_errorIfMethodNotExist('_delete'); + $this->_delete(); + break; + case self::ACTION_TYPE_COLLECTION . self::OPERATION_DELETE: + $this->_errorIfMethodNotExist('_multiDelete'); + $requestData = $this->getRequest()->getBodyParams(); + if (empty($requestData)) { + $this->_critical(self::RESOURCE_REQUEST_DATA_INVALID); + } + $this->_multiDelete($requestData); + $this->getResponse()->setHttpResponseCode(Mage_Api2_Model_Server::HTTP_MULTI_STATUS); + break; + default: + $this->_critical(self::RESOURCE_METHOD_NOT_IMPLEMENTED); + break; + } + } + + /** + * Trigger error for not-implemented operations + * + * @param $methodName + */ + protected function _errorIfMethodNotExist($methodName) + { + if (!$this->_checkMethodExist($methodName)) { + $this->_critical(self::RESOURCE_METHOD_NOT_IMPLEMENTED); + } + } + + /** + * Check method exist + * + * @param $methodName + * @return bool + */ + protected function _checkMethodExist($methodName) + { + return method_exists($this, $methodName); + } + + /** + * Get request + * + * @throws Exception + * @return Mage_Api2_Model_Request + */ + public function getRequest() + { + if (!$this->_request) { + throw new Exception('Request is not set.'); + } + return $this->_request; + } + + /** + * Set request + * + * @param Mage_Api2_Model_Request $request + * @return Mage_Api2_Model_Resource + */ + public function setRequest(Mage_Api2_Model_Request $request) + { + $this->setResourceType($request->getResourceType()); + $this->setApiType($request->getApiType()); + $this->_request = $request; + return $this; + } + + /** + * Get resource type + * If not exists get from Request + * + * @return string + */ + public function getResourceType() + { + if (!$this->_resourceType) { + $this->setResourceType($this->getRequest()->getResourceType()); + } + return $this->_resourceType; + } + + /** + * Set resource type + * + * @param string $resourceType + * @return Mage_Api2_Model_Resource + */ + public function setResourceType($resourceType) + { + $this->_resourceType = $resourceType; + return $this; + } + + /** + * Get API type + * If not exists get from Request. + * + * @return string + */ + public function getApiType() + { + if (!$this->_apiType) { + $this->setApiType($this->getRequest()->getApiType()); + } + return $this->_apiType; + } + + /** + * Set API type + * + * @param string $apiType + * @return Mage_Api2_Model_Resource + */ + public function setApiType($apiType) + { + $this->_apiType = $apiType; + return $this; + } + + /** + * Determine version from class name + * + * @return int + */ + public function getVersion() + { + if (null === $this->_version) { + if (preg_match('/^.+([1-9]\d*)$/', get_class($this), $matches) ) { + $this->setVersion($matches[1]); + } else { + throw new Exception('Can not determine version from class name'); + } + } + return $this->_version; + } + + /** + * Set API version + * + * @param int $version + */ + public function setVersion($version) + { + $this->_version = (int)$version; + } + + /** + * Get response + * + * @return Mage_Api2_Model_Response + */ + public function getResponse() + { + if (!$this->_response) { + throw new Exception('Response is not set.'); + } + return $this->_response; + } + + /** + * Set response + * + * @param Mage_Api2_Model_Response $response + */ + public function setResponse(Mage_Api2_Model_Response $response) + { + $this->_response = $response; + } + + /** + * Get filter if not exists create + * + * @return Mage_Api2_Model_Acl_Filter + */ + public function getFilter() + { + if (!$this->_filter) { + /** @var $filter Mage_Api2_Model_Acl_Filter */ + $filter = Mage::getModel('api2/acl_filter', $this); + $this->setFilter($filter); + } + return $this->_filter; + } + + /** + * Set filter + * + * @param Mage_Api2_Model_Acl_Filter $filter + */ + public function setFilter(Mage_Api2_Model_Acl_Filter $filter) + { + $this->_filter = $filter; + } + + /** + * Get renderer if not exists create + * + * @return Mage_Api2_Model_Renderer_Interface + */ + public function getRenderer() + { + if (!$this->_renderer) { + $renderer = Mage_Api2_Model_Renderer::factory($this->getRequest()->getAcceptTypes()); + $this->setRenderer($renderer); + } + + return $this->_renderer; + } + + /** + * Set renderer + * + * @param Mage_Api2_Model_Renderer_Interface $renderer + */ + public function setRenderer(Mage_Api2_Model_Renderer_Interface $renderer) + { + $this->_renderer = $renderer; + } + + /** + * Get user type + * If not exists get from apiUser + * + * @return string + */ + public function getUserType() + { + if (!$this->_userType) { + $this->setUserType($this->getApiUser()->getType()); + } + return $this->_userType; + } + + /** + * Set user type + * + * @param string $userType + * @return Mage_Api2_Model_Resource + */ + public function setUserType($userType) + { + $this->_userType = $userType; + return $this; + } + + /** + * Get API user + * + * @throws Exception + * @return Mage_Api2_Model_Auth_User_Abstract + */ + public function getApiUser() + { + if (!$this->_apiUser) { + throw new Exception('API user is not set.'); + } + return $this->_apiUser; + } + + /** + * Set API user + * + * @param Mage_Api2_Model_Auth_User_Abstract $apiUser + * @return Mage_Api2_Model_Resource + */ + public function setApiUser(Mage_Api2_Model_Auth_User_Abstract $apiUser) + { + $this->_apiUser = $apiUser; + return $this; + } + + /** + * Get action type + * If not exists get from Request + * + * @return string One of Mage_Api2_Model_Resource::ACTION_TYPE_... constant + */ + public function getActionType() + { + if (!$this->_actionType) { + $this->setActionType($this->getRequest()->getActionType()); + } + return $this->_actionType; + } + + /** + * Set route type + * + * @param string $actionType One of Mage_Api2_Model_Resource::ACTION_TYPE_... constant + * @return Mage_Api2_Model_Resource + */ + public function setActionType($actionType) + { + $this->_actionType = $actionType; + return $this; + } + + /** + * Get operation + * If not exists get from Request + * + * @return string One of Mage_Api2_Model_Resource::OPERATION_... constant + */ + public function getOperation() + { + if (!$this->_operation) { + $this->setOperation($this->getRequest()->getOperation()); + } + return $this->_operation; + } + + /** + * Set operation + * + * @param string $operation One of Mage_Api2_Model_Resource::OPERATION_... constant + * @return Mage_Api2_Model_Resource + */ + public function setOperation($operation) + { + $this->_operation = $operation; + return $this; + } + + /** + * Get API2 config + * + * @return Mage_Api2_Model_Config + */ + public function getConfig() + { + return Mage::getSingleton('api2/config'); + } + + /** + * Get working model + * + * @return Mage_Core_Model_Abstract + */ + public function getWorkingModel() + { + return Mage::getModel($this->getConfig()->getResourceWorkingModel($this->getResourceType())); + } + + /** + * Render data using registered Renderer + * + * @param mixed $data + */ + protected function _render($data) + { + $this->getResponse()->setMimeType($this->getRenderer()->getMimeType()) + ->setBody($this->getRenderer()->render($data)); + } + + /** + * Throw exception, critical error - stop execution + * + * @param string $message + * @param int $code + * @throws Mage_Api2_Exception + */ + protected function _critical($message, $code = null) + { + if ($code === null) { + $errors = $this->_getCriticalErrors(); + if (!isset($errors[$message])) { + throw new Exception( + sprintf('Invalid error "%s" or error code missed.', $message), + Mage_Api2_Model_Server::HTTP_INTERNAL_ERROR + ); + } + $code = $errors[$message]; + } + throw new Mage_Api2_Exception($message, $code); + } + + /** + * Retrieve array with critical errors mapped to HTTP codes + * + * @return array + */ + protected function _getCriticalErrors() + { + return array( + '' => Mage_Api2_Model_Server::HTTP_BAD_REQUEST, + self::RESOURCE_NOT_FOUND => Mage_Api2_Model_Server::HTTP_NOT_FOUND, + self::RESOURCE_METHOD_NOT_ALLOWED => Mage_Api2_Model_Server::HTTP_METHOD_NOT_ALLOWED, + self::RESOURCE_METHOD_NOT_IMPLEMENTED => Mage_Api2_Model_Server::HTTP_METHOD_NOT_ALLOWED, + self::RESOURCE_DATA_PRE_VALIDATION_ERROR => Mage_Api2_Model_Server::HTTP_BAD_REQUEST, + self::RESOURCE_INTERNAL_ERROR => Mage_Api2_Model_Server::HTTP_INTERNAL_ERROR, + self::RESOURCE_UNKNOWN_ERROR => Mage_Api2_Model_Server::HTTP_BAD_REQUEST, + self::RESOURCE_REQUEST_DATA_INVALID => Mage_Api2_Model_Server::HTTP_BAD_REQUEST, + self::RESOURCE_COLLECTION_PAGING_ERROR => Mage_Api2_Model_Server::HTTP_BAD_REQUEST, + self::RESOURCE_COLLECTION_PAGING_LIMIT_ERROR => Mage_Api2_Model_Server::HTTP_BAD_REQUEST, + self::RESOURCE_COLLECTION_ORDERING_ERROR => Mage_Api2_Model_Server::HTTP_BAD_REQUEST, + self::RESOURCE_COLLECTION_FILTERING_ERROR => Mage_Api2_Model_Server::HTTP_BAD_REQUEST, + self::RESOURCE_COLLECTION_ATTRIBUTES_ERROR => Mage_Api2_Model_Server::HTTP_BAD_REQUEST, + ); + } + + /** + * Add non-critical error + * + * @param string $message + * @param int $code + * @return Mage_Api2_Model_Resource + */ + protected function _error($message, $code) + { + $this->getResponse()->setException(new Mage_Api2_Exception($message, $code)); + return $this; + } + + /** + * Add success message + * + * @param string $message + * @param int $code + * @param array $params + * @return Mage_Api2_Model_Resource + */ + protected function _successMessage($message, $code, $params = array()) + { + $this->getResponse()->addMessage($message, $code, $params, Mage_Api2_Model_Response::MESSAGE_TYPE_SUCCESS); + return $this; + } + + /** + * Add error message + * + * @param string $message + * @param int $code + * @param array $params + * @return Mage_Api2_Model_Resource + */ + protected function _errorMessage($message, $code, $params = array()) + { + $this->getResponse()->addMessage($message, $code, $params, Mage_Api2_Model_Response::MESSAGE_TYPE_ERROR); + return $this; + } + + /** + * Set navigation parameters and apply filters from URL params + * + * @param Varien_Data_Collection_Db $collection + * @return Mage_Api2_Model_Resource + */ + final protected function _applyCollectionModifiers(Varien_Data_Collection_Db $collection) + { + $pageNumber = $this->getRequest()->getPageNumber(); + if ($pageNumber != abs($pageNumber)) { + $this->_critical(self::RESOURCE_COLLECTION_PAGING_ERROR); + } + + $pageSize = $this->getRequest()->getPageSize(); + if (null == $pageSize) { + $pageSize = self::PAGE_SIZE_DEFAULT; + } else { + if ($pageSize != abs($pageSize) || $pageSize > self::PAGE_SIZE_MAX) { + $this->_critical(self::RESOURCE_COLLECTION_PAGING_LIMIT_ERROR); + } + } + + $orderField = $this->getRequest()->getOrderField(); + + if (null !== $orderField) { + $operation = Mage_Api2_Model_Resource::OPERATION_ATTRIBUTE_READ; + if (!is_string($orderField) + || !array_key_exists($orderField, $this->getAvailableAttributes($this->getUserType(), $operation)) + ) { + $this->_critical(self::RESOURCE_COLLECTION_ORDERING_ERROR); + } + $collection->setOrder($orderField, $this->getRequest()->getOrderDirection()); + } + $collection->setCurPage($pageNumber)->setPageSize($pageSize); + + return $this->_applyFilter($collection); + } + + /** + * Validate filter data and apply it to collection if possible + * + * @param Varien_Data_Collection_Db $collection + * @return Mage_Api2_Model_Resource + */ + protected function _applyFilter(Varien_Data_Collection_Db $collection) + { + $filter = $this->getRequest()->getFilter(); + + if (!$filter) { + return $this; + } + if (!is_array($filter)) { + $this->_critical(self::RESOURCE_COLLECTION_FILTERING_ERROR); + } + if (method_exists($collection, 'addAttributeToFilter')) { + $methodName = 'addAttributeToFilter'; + } elseif (method_exists($collection, 'addFieldToFilter')) { + $methodName = 'addFieldToFilter'; + } else { + return $this; + } + $allowedAttributes = $this->getFilter()->getAllowedAttributes(self::OPERATION_ATTRIBUTE_READ); + + foreach ($filter as $filterEntry) { + if (!is_array($filterEntry) + || !array_key_exists('attribute', $filterEntry) + || !in_array($filterEntry['attribute'], $allowedAttributes) + ) { + $this->_critical(self::RESOURCE_COLLECTION_FILTERING_ERROR); + } + $attributeCode = $filterEntry['attribute']; + + unset($filterEntry['attribute']); + + try { + $collection->$methodName($attributeCode, $filterEntry); + } catch(Exception $e) { + $this->_critical(self::RESOURCE_COLLECTION_FILTERING_ERROR); + } + } + return $this; + } + + /** + * Perform multiple calls to subresources of specified resource + * + * @param string $resourceInstanceId + * @return Mage_Api2_Model_Response + */ + protected function _multicall($resourceInstanceId) + { + if (!$this->_multicall) { + $this->_multicall = Mage::getModel('api2/multicall'); + } + $resourceName = $this->getResourceType(); + return $this->_multicall->call($resourceInstanceId, $resourceName, $this->getRequest()); + } + + /** + * Create model of specified resource and configure it with current object attributes + * + * @param string $resourceId Resource identifier + * @param array $requestParams Parameters to be set to request + * @return Mage_Api2_Model_Resource + */ + protected function _getSubModel($resourceId, array $requestParams) + { + $resourceModel = Mage_Api2_Model_Dispatcher::loadResourceModel( + $this->getConfig()->getResourceModel($resourceId), + $this->getApiType(), + $this->getUserType(), + $this->getVersion() + ); + + /** @var $request Mage_Api2_Model_Request */ + $request = Mage::getModel('api2/request'); + + $request->setParams($requestParams); + + $resourceModel + ->setRequest($request) // request MUST be set first + ->setApiUser($this->getApiUser()) + ->setApiType($this->getApiType()) + ->setResourceType($resourceId) + ->setOperation($this->getOperation()) + ->setReturnData(true); + + return $resourceModel; + } + + /** + * Check ACL permission for specified resource with current other conditions + * + * @param string $resourceId Resource identifier + * @return bool + * @throws Exception + */ + protected function _isSubCallAllowed($resourceId) + { + /** @var $globalAcl Mage_Api2_Model_Acl_Global */ + $globalAcl = Mage::getSingleton('api2/acl_global'); + + try { + return $globalAcl->isAllowed($this->getApiUser(), $resourceId, $this->getOperation()); + } catch (Mage_Api2_Exception $e) { + throw new Exception('Invalid arguments for isAllowed() call'); + } + } + + /** + * Set 'returnData' flag + * + * @param boolean $flag + * @return Mage_Api2_Model_Resource + */ + public function setReturnData($flag) + { + $this->_returnData = $flag; + return $this; + } + + /** + * Get resource location + * + * @param Mage_Core_Model_Abstract $resource + * @return string URL + */ + protected function _getLocation($resource) + { + /* @var $apiTypeRoute Mage_Api2_Model_Route_ApiType */ + $apiTypeRoute = Mage::getModel('api2/route_apiType'); + + $chain = $apiTypeRoute->chain( + new Zend_Controller_Router_Route($this->getConfig()->getRouteWithEntityTypeAction($this->getResourceType())) + ); + $params = array( + 'api_type' => $this->getRequest()->getApiType(), + 'id' => $resource->getId() + ); + $uri = $chain->assemble($params); + + return '/' . $uri; + } + + /** + * Resource specific method to retrieve attributes' codes. May be overriden in child. + * + * @return array + */ + protected function _getResourceAttributes() + { + return array(); + } + + /** + * Get available attributes of API resource + * + * @param string $userType + * @param string $operation + * @return array + */ + public function getAvailableAttributes($userType, $operation) + { + $available = $this->getAvailableAttributesFromConfig(); + $excludedAttrs = $this->getExcludedAttributes($userType, $operation); + $includedAttrs = $this->getIncludedAttributes($userType, $operation); + $entityOnlyAttrs = $this->getEntityOnlyAttributes($userType, $operation); + $resourceAttrs = $this->_getResourceAttributes(); + + // if resource returns not-associative array - attributes' codes only + if (0 === key($resourceAttrs)) { + $resourceAttrs = array_combine($resourceAttrs, $resourceAttrs); + } + foreach ($resourceAttrs as $attrCode => $attrLabel) { + if (!isset($available[$attrCode])) { + $available[$attrCode] = empty($attrLabel) ? $attrCode : $attrLabel; + } + } + foreach (array_keys($available) as $code) { + if (in_array($code, $excludedAttrs) || ($includedAttrs && !in_array($code, $includedAttrs))) { + unset($available[$code]); + } + if (in_array($code, $entityOnlyAttrs)) { + $available[$code] .= ' *'; + } + } + return $available; + } + + /** + * Get excluded attributes for user type + * + * @param string $userType + * @param string $operation + * @return array + */ + public function getExcludedAttributes($userType, $operation) + { + return $this->getConfig()->getResourceExcludedAttributes($this->getResourceType(), $userType, $operation); + } + + /** + * Get forced attributes + * + * @return array + */ + public function getForcedAttributes() + { + return $this->getConfig()->getResourceForcedAttributes($this->getResourceType(), $this->getUserType()); + } + + /** + * Retrieve list of included attributes + * + * @param string $userType API user type + * @param string $operationType Type of operation: one of Mage_Api2_Model_Resource::OPERATION_ATTRIBUTE_... constant + * @return array + */ + public function getIncludedAttributes($userType, $operationType) + { + return $this->getConfig()->getResourceIncludedAttributes($this->getResourceType(), $userType, $operationType); + } + + /** + * Retrieve list of entity only attributes + * + * @param string $userType API user type + * @param string $operationType Type of operation: one of Mage_Api2_Model_Resource::OPERATION_ATTRIBUTE_... constant + * @return array + */ + public function getEntityOnlyAttributes($userType, $operationType) + { + return $this->getConfig()->getResourceEntityOnlyAttributes($this->getResourceType(), $userType, $operationType); + } + + /** + * Get available attributes of API resource from configuration file + * + * @return array + */ + public function getAvailableAttributesFromConfig() + { + return $this->getConfig()->getResourceAttributes($this->getResourceType()); + } + + /** + * Get available attributes of API resource from data base + * + * @return array + */ + public function getDbAttributes() + { + $available = array(); + $workModel = $this->getConfig()->getResourceWorkingModel($this->getResourceType()); + + if ($workModel) { + /* @var $resource Mage_Core_Model_Resource_Db_Abstract */ + $resource = Mage::getResourceModel($workModel); + + if (method_exists($resource, 'getMainTable')) { + $available = array_keys($resource->getReadConnection()->describeTable($resource->getMainTable())); + } + } + return $available; + } + + /** + * Get EAV attributes of working model + * + * @param bool $onlyVisible OPTIONAL Show only the attributes which are visible on frontend + * @param bool $excludeSystem OPTIONAL Exclude attributes marked as system + * @return array + */ + public function getEavAttributes($onlyVisible = false, $excludeSystem = false) + { + $attributes = array(); + $model = $this->getConfig()->getResourceWorkingModel($this->getResourceType()); + + /** @var $entityType Mage_Eav_Model_Entity_Type */ + $entityType = Mage::getModel('eav/entity_type')->load($model, 'entity_model'); + + /** @var $attribute Mage_Eav_Model_Entity_Attribute */ + foreach ($entityType->getAttributeCollection() as $attribute) { + if ($onlyVisible && !$attribute->getIsVisible()) { + continue; + } + if ($excludeSystem && $attribute->getIsSystem()) { + continue; + } + $attributes[$attribute->getAttributeCode()] = $attribute->getFrontendLabel(); + } + + return $attributes; + } + + /** + * Retrieve current store according to request and API user type + * + * @return Mage_Core_Model_Store + */ + protected function _getStore() + { + $store = $this->getRequest()->getParam('store'); + try { + if ($this->getUserType() != Mage_Api2_Model_Auth_User_Admin::USER_TYPE) { + // customer or guest role + if (!$store) { + $store = Mage::app()->getDefaultStoreView(); + } else { + $store = Mage::app()->getStore($store); + } + } else { + // admin role + if (is_null($store)) { + $store = Mage_Catalog_Model_Abstract::DEFAULT_STORE_ID; + } + $store = Mage::app()->getStore($store); + } + } catch (Mage_Core_Model_Store_Exception $e) { + // store does not exist + $this->_critical('Requested store is invalid', Mage_Api2_Model_Server::HTTP_BAD_REQUEST); + } + return $store; + } +} diff --git a/app/code/core/Mage/Api2/Model/Resource/Acl/Filter/Attribute.php b/app/code/core/Mage/Api2/Model/Resource/Acl/Filter/Attribute.php new file mode 100644 index 0000000000..cff1aa8067 --- /dev/null +++ b/app/code/core/Mage/Api2/Model/Resource/Acl/Filter/Attribute.php @@ -0,0 +1,87 @@ + + */ +class Mage_Api2_Model_Resource_Acl_Filter_Attribute extends Mage_Core_Model_Resource_Db_Abstract +{ + /** + * Attribute Filter resource ID "all" + */ + const FILTER_RESOURCE_ALL = 'all'; + + /** + * Initialize resource model + * + * @return void + */ + protected function _construct() + { + $this->_init('api2/acl_attribute', 'entity_id'); + } + + /** + * Get allowed attributes + * + * @param string $userType + * @param string $resourceId + * @param string $operation One of Mage_Api2_Model_Resource::OPERATION_ATTRIBUTE_... constant + * @return string|bool|null + */ + public function getAllowedAttributes($userType, $resourceId, $operation) + { + $select = $this->_getReadAdapter()->select() + ->from($this->getMainTable(), 'allowed_attributes') + ->where('user_type = ?', $userType) + ->where('resource_id = ?', $resourceId) + ->where('operation = ?', $operation); + + return $this->getReadConnection()->fetchOne($select); + } + + /** + * Check if ALL attributes allowed + * + * @param string $userType + * @return bool + */ + public function isAllAttributesAllowed($userType) + { + $resourceId = self::FILTER_RESOURCE_ALL; + + $select = $this->getReadConnection()->select() + ->from($this->getMainTable(), new Zend_Db_Expr('COUNT(*)')) + ->where('user_type = ?', $userType) + ->where('resource_id = ?', $resourceId); + + return ($this->getReadConnection()->fetchOne($select) == 1); + } +} diff --git a/app/code/core/Mage/Api2/Model/Resource/Acl/Filter/Attribute/Collection.php b/app/code/core/Mage/Api2/Model/Resource/Acl/Filter/Attribute/Collection.php new file mode 100644 index 0000000000..2f4c410a3e --- /dev/null +++ b/app/code/core/Mage/Api2/Model/Resource/Acl/Filter/Attribute/Collection.php @@ -0,0 +1,57 @@ + + */ +class Mage_Api2_Model_Resource_Acl_Filter_Attribute_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract +{ + /** + * Initialize collection model + * + * @return void + */ + protected function _construct() + { + $this->_init('api2/acl_filter_attribute'); + } + + /** + * Add filtering by user type + * + * @param string $userType + * @return Mage_Api2_Model_Resource_Acl_Filter_Attribute_Collection + */ + public function addFilterByUserType($userType) + { + $this->addFilter('user_type', $userType, 'public'); + return $this; + } +} diff --git a/app/code/core/Mage/Api2/Model/Resource/Acl/Global/Role.php b/app/code/core/Mage/Api2/Model/Resource/Acl/Global/Role.php new file mode 100644 index 0000000000..fff891c383 --- /dev/null +++ b/app/code/core/Mage/Api2/Model/Resource/Acl/Global/Role.php @@ -0,0 +1,121 @@ + + * @method int getId + * @method string getRoleName + */ +class Mage_Api2_Model_Resource_Acl_Global_Role extends Mage_Core_Model_Resource_Db_Abstract +{ + /** + * Initialize resource model + * + * @return void + */ + protected function _construct() + { + $this->_init('api2/acl_role', 'entity_id'); + } + + /** + * Create/update relation row of admin user to API2 role + * + * @param int $adminId Admin user id + * @param int $roleId API2 role id + * @return Mage_Api2_Model_Resource_Acl_Global_Role + */ + public function saveAdminToRoleRelation($adminId, $roleId) + { + if (Mage_Api2_Model_Acl_Global_Role::ROLE_GUEST_ID == $roleId + || Mage_Api2_Model_Acl_Global_Role::ROLE_CUSTOMER_ID == $roleId + ) { + Mage::throwException( + Mage::helper('api2')->__('The role is a special one and not for assigning it to admin users.') + ); + } + + $read = $this->_getReadAdapter(); + $select = $read->select() + ->from($this->getTable('api2/acl_user'), 'admin_id') + ->where('admin_id = ?', $adminId, Zend_Db::INT_TYPE); + + $write = $this->_getWriteAdapter(); + $table = $this->getTable('api2/acl_user'); + + if (false === $read->fetchOne($select)) { + $write->insert($table, array('admin_id' => $adminId, 'role_id' => $roleId)); + } else { + $write->update($table, array('role_id' => $roleId), array('admin_id = ?' => $adminId)); + } + + return $this; + } + + /** + * delete relation row of admin user to API2 role + * + * @param int $adminId Admin user id + * @param int $roleId API2 role id + * @return Mage_Api2_Model_Resource_Acl_Global_Role + */ + public function deleteAdminToRoleRelation($adminId, $roleId) + { + $write = $this->_getWriteAdapter(); + $table = $this->getTable('api2/acl_user'); + + $where = array( + 'role_id = ?' => $roleId, + 'admin_id = ?' => $adminId + ); + + $write->delete($table, $where); + + return $this; + } + + /** + * Get users + * + * @param Mage_Api2_Model_Acl_Global_Role $role + * @return array + */ + public function getRoleUsers(Mage_Api2_Model_Acl_Global_Role $role) + { + $adapter = $this->_getReadAdapter(); + $select = $adapter->select() + ->from($this->getTable('api2/acl_user')) + ->where('role_id=?', $role->getId()); + + $users = $adapter->fetchCol($select); + + return $users; + } +} diff --git a/app/code/core/Mage/Api2/Model/Resource/Acl/Global/Role/Collection.php b/app/code/core/Mage/Api2/Model/Resource/Acl/Global/Role/Collection.php new file mode 100644 index 0000000000..9efb28dd53 --- /dev/null +++ b/app/code/core/Mage/Api2/Model/Resource/Acl/Global/Role/Collection.php @@ -0,0 +1,63 @@ + + */ +class Mage_Api2_Model_Resource_Acl_Global_Role_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract +{ + /** + * Initialize collection model + * + * @return void + */ + protected function _construct() + { + $this->_init('api2/acl_global_role'); + } + + /** + * Add filter by admin user id and join table with appropriate information + * + * @param int $id Admin user id + * @return Mage_Api2_Model_Resource_Acl_Global_Role_Collection + */ + public function addFilterByAdminId($id) + { + $this->getSelect() + ->joinInner( + array('user' => $this->getTable('api2/acl_user')), + 'main_table.entity_id = user.role_id', + array('admin_id' => 'user.admin_id')) + ->where('user.admin_id = ?', $id, Zend_Db::INT_TYPE); + + return $this; + } +} diff --git a/app/code/core/Mage/Api2/Model/Resource/Acl/Global/Rule.php b/app/code/core/Mage/Api2/Model/Resource/Acl/Global/Rule.php new file mode 100644 index 0000000000..997100961d --- /dev/null +++ b/app/code/core/Mage/Api2/Model/Resource/Acl/Global/Rule.php @@ -0,0 +1,45 @@ + + */ +class Mage_Api2_Model_Resource_Acl_Global_Rule extends Mage_Core_Model_Resource_Db_Abstract +{ + /** + * Initialize resource model + * + * @return void + */ + protected function _construct() + { + $this->_init('api2/acl_rule', 'entity_id'); + } +} diff --git a/app/code/core/Mage/Api2/Model/Resource/Acl/Global/Rule/Collection.php b/app/code/core/Mage/Api2/Model/Resource/Acl/Global/Rule/Collection.php new file mode 100644 index 0000000000..41aa8ac7e3 --- /dev/null +++ b/app/code/core/Mage/Api2/Model/Resource/Acl/Global/Rule/Collection.php @@ -0,0 +1,57 @@ + + */ +class Mage_Api2_Model_Resource_Acl_Global_Rule_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract +{ + /** + * Initialize collection model + * + * @return void + */ + protected function _construct() + { + $this->_init('api2/acl_global_rule'); + } + + /** + * Add filtering by role ID + * + * @param int $roleId + * @return Mage_Api2_Model_Resource_Acl_Global_Rule_Collection + */ + public function addFilterByRoleId($roleId) + { + $this->addFilter('role_id', $roleId, 'public'); + return $this; + } +} diff --git a/app/code/core/Mage/Api2/Model/Resource/Setup.php b/app/code/core/Mage/Api2/Model/Resource/Setup.php new file mode 100644 index 0000000000..2494c610db --- /dev/null +++ b/app/code/core/Mage/Api2/Model/Resource/Setup.php @@ -0,0 +1,36 @@ + + */ +class Mage_Api2_Model_Resource_Setup extends Mage_Core_Model_Resource_Setup +{ +} diff --git a/app/code/core/Mage/Api2/Model/Resource/Validator.php b/app/code/core/Mage/Api2/Model/Resource/Validator.php new file mode 100644 index 0000000000..9e274f31df --- /dev/null +++ b/app/code/core/Mage/Api2/Model/Resource/Validator.php @@ -0,0 +1,102 @@ + + */ +abstract class Mage_Api2_Model_Resource_Validator +{ + /** + * Array of validation failure errors. + * + * @var array + */ + protected $_errors = array(); + + /** + * Set an array of errors + * + * @param array $data + * @return Mage_Api2_Model_Resource_Validator + */ + protected function _setErrors(array $data) + { + $this->_errors = array_values($data); + return $this; + } + + /** + * Add errors + * + * @param array $errors + * @return Mage_Api2_Model_Resource_Validator + */ + protected function _addErrors($errors) + { + foreach ($errors as $error) { + $this->_addError($error); + } + return $this; + } + + /** + * Add error + * + * @param string $error + * @return Mage_Api2_Model_Resource_Validator + */ + protected function _addError($error) + { + $this->_errors[] = $error; + return $this; + } + + /** + * Returns an array of errors that explain why the most recent isValidData() + * call returned false. The array keys are validation failure error identifiers, + * and the array values are the corresponding human-readable error strings. + * + * If isValidData() was never called or if the most recent isValidData() call + * returned true, then this method returns an empty array. + * + * @return array + */ + public function getErrors() + { + return $this->_errors; + } +} diff --git a/app/code/core/Mage/Api2/Model/Resource/Validator/Eav.php b/app/code/core/Mage/Api2/Model/Resource/Validator/Eav.php new file mode 100644 index 0000000000..91fac69963 --- /dev/null +++ b/app/code/core/Mage/Api2/Model/Resource/Validator/Eav.php @@ -0,0 +1,172 @@ + + */ +class Mage_Api2_Model_Resource_Validator_Eav extends Mage_Api2_Model_Resource_Validator +{ + /** + * Config node key of current validator + */ + const CONFIG_NODE_KEY = 'eav'; + + /** + * Form path + * + * @var string + */ + protected $_formPath; + + /** + * Entity model + * + * @var Mage_Core_Model_Abstract + */ + protected $_entity; + + /** + * Form code + * + * @var string + */ + protected $_formCode; + + /** + * Eav form model + * + * @var Mage_Eav_Model_Form + */ + protected $_eavForm; + + /** + * Construct. Set all depends. + * + * Required parameteres for options: + * - resource + * + * @param array $options + * @throws Exception If passed parameter 'resource' is wrong + * @throws Exception If config parameter 'formPath' is empty + * @throws Exception If config parameter 'formCode' is empty + * @throws Exception If config parameter 'entity' is wrong + * @throws Exception If entity is not model + * @throws Exception If eav form is not found + */ + public function __construct($options) + { + if (!isset($options['resource']) || !$options['resource'] instanceof Mage_Api2_Model_Resource) { + throw new Exception("Passed parameter 'resource' is wrong."); + } + $resource = $options['resource']; + $userType = $resource->getUserType(); + + $validationConfig = $resource->getConfig()->getValidationConfig( + $resource->getResourceType(), self::CONFIG_NODE_KEY); + + if (empty($validationConfig[$userType]['form_model'])) { + throw new Exception("Config parameter 'formPath' is empty."); + } + $this->_formPath = $validationConfig[$userType]['form_model']; + + if (empty($validationConfig[$userType]['form_code'])) { + throw new Exception("Config parameter 'formCode' is empty."); + } + $this->_formCode = $validationConfig[$userType]['form_code']; + + if (empty($validationConfig[$userType]['entity_model'])) { + throw new Exception("Config parameter 'entity' is wrong."); + } + $this->_entity = Mage::getModel($validationConfig[$userType]['entity_model']); + if (empty($this->_entity) || !$this->_entity instanceof Mage_Core_Model_Abstract) { + throw new Exception("Entity is not model."); + } + + $this->_eavForm = Mage::getModel($this->_formPath); + if (empty($this->_eavForm) || !$this->_eavForm instanceof Mage_Eav_Model_Form) { + throw new Exception("Eav form '{$this->_formPath}' is not found."); + } + $this->_eavForm->setEntity($this->_entity) + ->setFormCode($this->_formCode) + ->ignoreInvisible(false); + } + + /** + * Filter request data. + * + * @param array $data + * @return array Filtered data + */ + public function filter(array $data) + { + return array_intersect_key($this->_eavForm->extractData($this->_eavForm->prepareRequest($data)), $data); + } + + /** + * Validate entity. + * If the $partial parameter is TRUE, then we validate only those parameters that were passed. + * + * If fails validation, then this method returns false, and + * getErrors() will return an array of errors that explain why the + * validation failed. + * + * @param array $data + * @param bool $partial + * @return bool + */ + public function isValidData(array $data, $partial = false) + { + $errors = array(); + foreach ($this->_eavForm->getAttributes() as $attribute) { + if ($partial && !array_key_exists($attribute->getAttributeCode(), $data)) { + continue; + } + if ($this->_eavForm->ignoreInvisible() && !$attribute->getIsVisible()) { + continue; + } + if (!isset($data[$attribute->getAttributeCode()])) { + $data[$attribute->getAttributeCode()] = null; + } + + $result = Mage_Eav_Model_Attribute_Data::factory($attribute, $this->_eavForm->getEntity()) + ->setExtractedData($data)->validateValue($data[$attribute->getAttributeCode()]); + if ($result !== true) { + $errors = array_merge($errors, $result); + } + } + + if (count($errors)) { + $this->_setErrors($errors); + return false; + } + + return true; + } +} diff --git a/app/code/core/Mage/Api2/Model/Resource/Validator/Fields.php b/app/code/core/Mage/Api2/Model/Resource/Validator/Fields.php new file mode 100644 index 0000000000..6d97e9a828 --- /dev/null +++ b/app/code/core/Mage/Api2/Model/Resource/Validator/Fields.php @@ -0,0 +1,186 @@ + + */ +class Mage_Api2_Model_Resource_Validator_Fields extends Mage_Api2_Model_Resource_Validator +{ + /** + * Config node key of current validator + */ + const CONFIG_NODE_KEY = 'fields'; + + /** + * Resource + * + * @var Mage_Api2_Model_Resource + */ + protected $_resource; + + /** + * List of Validators (Zend_Validate_Interface) + * The key is a field name, a value is validator for this field + * + * @var array + */ + protected $_validators; + + /** + * List of required fields + * + * @var array + */ + protected $_requiredFields; + + /** + * Construct. Set all depends. + * + * Required parameteres for options: + * - resource + * + * @param array $options + * @throws Exception If passed parameter 'resource' is wrong + */ + public function __construct($options) + { + if (!isset($options['resource']) || !$options['resource'] instanceof Mage_Api2_Model_Resource) { + throw new Exception("Passed parameter 'resource' is wrong."); + } + $this->_resource = $options['resource']; + + $validationConfig = $this->_resource->getConfig()->getValidationConfig( + $this->_resource->getResourceType(), self::CONFIG_NODE_KEY); + if (!is_array($validationConfig)) { + $validationConfig = array(); + } + $this->_buildValidatorsChain($validationConfig); + } + + /** + * Build validator chain with config data + * + * @param array $validationConfig + * @throws Exception If validator type is not set + * @throws Exception If validator is not exist + */ + protected function _buildValidatorsChain(array $validationConfig) + { + foreach ($validationConfig as $field => $validatorsConfig) { + if (count($validatorsConfig)) { + $chainForOneField = new Zend_Validate(); + foreach ($validatorsConfig as $validatorName => $validatorConfig) { + // it is required field + if ('required' == $validatorName && 1 == $validatorConfig) { + $this->_requiredFields[] = $field; + continue; + } + // instantiation of the validator class + if (!isset($validatorConfig['type'])) { + throw new Exception("Validator type is not set for {$validatorName}"); + } + $validator = $this->_getValidatorInstance( + $validatorConfig['type'], + !empty($validatorConfig['options']) ? $validatorConfig['options'] : array() + ); + // set custom message + if (isset($validatorConfig['message'])) { + $validator->setMessage($validatorConfig['message']); + } + // add to list of validators + $chainForOneField->addValidator($validator); + } + $this->_validators[$field] = $chainForOneField; + } + } + } + + /** + * Get validator object instance + * Override the method if we need to use not only Zend validators! + * + * @param string $type + * @param array $options + * @return Zend_Validate_Interface + * @throws Exception If validator is not exist + */ + protected function _getValidatorInstance($type, $options) + { + $validatorClass = 'Zend_Validate_' . $type; + if (!class_exists($validatorClass)) { + throw new Exception("Validator {$type} is not exist"); + } + return new $validatorClass($options); + } + + /** + * Validate data. + * If fails validation, then this method returns false, and + * getErrors() will return an array of errors that explain why the + * validation failed. + * + * @param array $data + * @param bool $isPartial + * @return bool + */ + public function isValidData(array $data, $isPartial = false) + { + $isValid = true; + + // required fields + if (!$isPartial && count($this->_requiredFields) > 0) { + $notEmptyValidator = new Zend_Validate_NotEmpty(); + foreach ($this->_requiredFields as $requiredField) { + if (!$notEmptyValidator->isValid(isset($data[$requiredField]) ? $data[$requiredField] : null)) { + $isValid = false; + foreach ($notEmptyValidator->getMessages() as $message) { + $this->_addError(sprintf('%s: %s', $requiredField, $message)); + } + } + } + } + + // fields rules + foreach ($data as $field => $value) { + if (isset($this->_validators[$field])) { + /* @var $validator Zend_Validate_Interface */ + $validator = $this->_validators[$field]; + if (!$validator->isValid($value)) { + $isValid = false; + foreach ($validator->getMessages() as $message) { + $this->_addError(sprintf('%s: %s', $field, $message)); + } + } + } + } + + return $isValid; + } +} diff --git a/app/code/core/Mage/Api2/Model/Response.php b/app/code/core/Mage/Api2/Model/Response.php new file mode 100644 index 0000000000..3a889c69b7 --- /dev/null +++ b/app/code/core/Mage/Api2/Model/Response.php @@ -0,0 +1,114 @@ + + */ +class Mage_Api2_Model_Response extends Zend_Controller_Response_Http +{ + /** + * Character set which must be used in response + */ + const RESPONSE_CHARSET = 'utf-8'; + + /**#@+ + * Default message types + */ + const MESSAGE_TYPE_SUCCESS = 'success'; + const MESSAGE_TYPE_ERROR = 'error'; + const MESSAGE_TYPE_WARNING = 'warning'; + /**#@- */ + + /** + * Messages + * + * @var array + */ + protected $_messages = array(); + + /** + * Set header appropriate to specified MIME type + * + * @param string $mimeType MIME type + * @return Mage_Api2_Model_Response + */ + public function setMimeType($mimeType) + { + return $this->setHeader('Content-Type', "{$mimeType}; charset=" . self::RESPONSE_CHARSET, true); + } + + /** + * Add message to responce + * + * @param string $message + * @param string $code + * @param array $params + * @param string $type + * return Mage_Api2_Model_Response + */ + public function addMessage($message, $code, $params = array(), $type = self::MESSAGE_TYPE_ERROR) + { + $params['message'] = $message; + $params['code'] = $code; + $this->_messages[$type][] = $params; + return $this; + } + + /** + * Has messages + * + * @return bool + */ + public function hasMessages() + { + return (bool)count($this->_messages) > 0; + } + + /** + * Return messages + * + * @return array + */ + public function getMessages() + { + return $this->_messages; + } + + /** + * Clear messages + * + * return Mage_Api2_Model_Response + */ + public function clearMessages() + { + $this->_messages = array(); + return $this; + } +} diff --git a/app/code/core/Mage/Api2/Model/Route/Abstract.php b/app/code/core/Mage/Api2/Model/Route/Abstract.php new file mode 100644 index 0000000000..1f8aef028b --- /dev/null +++ b/app/code/core/Mage/Api2/Model/Route/Abstract.php @@ -0,0 +1,99 @@ + + */ +abstract class Mage_Api2_Model_Route_Abstract extends Zend_Controller_Router_Route +{ + /**#@+ + * Names for Zend_Controller_Router_Route::__construct params + */ + const PARAM_ROUTE = 'route'; + const PARAM_DEFAULTS = 'defaults'; + const PARAM_REQS = 'reqs'; + const PARAM_TRANSLATOR = 'translator'; + const PARAM_LOCALE = 'locale'; + /**#@- */ + + /* + * Default values of parent::__construct() params + * + * @var array + */ + protected $_paramsDefaultValues = array( + self::PARAM_ROUTE => null, + self::PARAM_DEFAULTS => array(), + self::PARAM_REQS => array(), + self::PARAM_TRANSLATOR => null, + self::PARAM_LOCALE => null + ); + + /** + * Process construct param and call parent::__construct() with params + * + * @param array $arguments + */ + public function __construct(array $arguments) + { + parent::__construct( + $this->_getArgumentValue(self::PARAM_ROUTE, $arguments), + $this->_getArgumentValue(self::PARAM_DEFAULTS, $arguments), + $this->_getArgumentValue(self::PARAM_REQS, $arguments), + $this->_getArgumentValue(self::PARAM_TRANSLATOR, $arguments), + $this->_getArgumentValue(self::PARAM_LOCALE, $arguments) + ); + } + + /** + * Retrieve argument value + * + * @param string $name argument name + * @param array $arguments + * @return mixed + */ + protected function _getArgumentValue($name, array $arguments) + { + return isset($arguments[$name]) ? $arguments[$name] : $this->_paramsDefaultValues[$name]; + } + + /** + * Matches a Request with parts defined by a map. Assigns and + * returns an array of variables on a successful match. + * + * @param Mage_Api2_Model_Request $request + * @param boolean $partial Partial path matching + * @return array|bool An array of assigned values or a boolean false on a mismatch + */ + public function match($request, $partial = false) + { + return parent::match(ltrim($request->getPathInfo(), $this->_urlDelimiter), $partial); + } +} diff --git a/app/code/core/Mage/Api2/Model/Route/ApiType.php b/app/code/core/Mage/Api2/Model/Route/ApiType.php new file mode 100644 index 0000000000..7aa20140e6 --- /dev/null +++ b/app/code/core/Mage/Api2/Model/Route/ApiType.php @@ -0,0 +1,57 @@ + + */ +class Mage_Api2_Model_Route_ApiType extends Mage_Api2_Model_Route_Abstract implements Mage_Api2_Model_Route_Interface +{ + /** + * API url template with API type variable + */ + const API_ROUTE = 'api/:api_type'; + + /** + * Prepares the route for mapping by splitting (exploding) it + * to a corresponding atomic parts. These parts are assigned + * a position which is later used for matching and preparing values. + * + * @param string $route Map used to match with later submitted URL path + * @param array $defaults Defaults for map variables with keys as variable names + * @param array $reqs Regular expression requirements for variables (keys as variable names) + * @param Zend_Translate $translator Translator to use for this instance + * @param mixed $locale + */ + public function __construct($route, $defaults = array(), $reqs = array(), Zend_Translate $translator = null, + $locale = null + ) { + parent::__construct(array(Mage_Api2_Model_Route_Abstract::PARAM_ROUTE => self::API_ROUTE)); + } +} diff --git a/app/code/core/Mage/Api2/Model/Route/Interface.php b/app/code/core/Mage/Api2/Model/Route/Interface.php new file mode 100644 index 0000000000..617c6c6f4d --- /dev/null +++ b/app/code/core/Mage/Api2/Model/Route/Interface.php @@ -0,0 +1,45 @@ + + */ +interface Mage_Api2_Model_Route_Interface +{ + /** + * Matches a Request with parts defined by a map. Assigns and + * returns an array of variables on a successful match. + * + * @param Mage_Api2_Model_Request $request + * @param boolean $partial Partial path matching + * @return array|false An array of assigned values or a false on a mismatch + */ + public function match($request, $partial = false); +} diff --git a/app/code/core/Mage/Api2/Model/Route/Rest.php b/app/code/core/Mage/Api2/Model/Route/Rest.php new file mode 100644 index 0000000000..ae8808dc71 --- /dev/null +++ b/app/code/core/Mage/Api2/Model/Route/Rest.php @@ -0,0 +1,36 @@ + + */ +class Mage_Api2_Model_Route_Rest extends Mage_Api2_Model_Route_Abstract implements Mage_Api2_Model_Route_Interface +{ +} diff --git a/app/code/core/Mage/Api2/Model/Router.php b/app/code/core/Mage/Api2/Model/Router.php new file mode 100644 index 0000000000..361ddd2b55 --- /dev/null +++ b/app/code/core/Mage/Api2/Model/Router.php @@ -0,0 +1,122 @@ + + */ +class Mage_Api2_Model_Router +{ + /** + * Routes which are stored in module config files api2.xml + * + * @var array + */ + protected $_routes = array(); + + /** + * Set routes + * + * @param array $routes + * @return Mage_Api2_Model_Router + */ + public function setRoutes(array $routes) + { + $this->_routes = $routes; + + return $this; + } + + /** + * Get routes + * + * @return array + */ + public function getRoutes() + { + return $this->_routes; + } + + /** + * Route the Request, the only responsibility of the class + * Find route that match current URL, set parameters of the route to Request object + * + * @param Mage_Api2_Model_Request $request + * @return Mage_Api2_Model_Request + * @throws Mage_Api2_Exception + */ + public function route(Mage_Api2_Model_Request $request) + { + $isMatched = false; + + /** @var $route Mage_Api2_Model_Route_Interface */ + foreach ($this->getRoutes() as $route) { + if ($params = $route->match($request)) { + $request->setParams($params); + $isMatched = true; + break; + } + } + if (!$isMatched) { + throw new Mage_Api2_Exception('Request does not match any route.', Mage_Api2_Model_Server::HTTP_NOT_FOUND); + } + if (!$request->getResourceType() || !$request->getModel()) { + throw new Mage_Api2_Exception('Matched resource is not properly set.', + Mage_Api2_Model_Server::HTTP_INTERNAL_ERROR); + } + return $request; + } + + /** + * Set API type to request as a result of one pass route + * + * @param Mage_Api2_Model_Request $request + * @param boolean $trimApiTypePath OPTIONAL If TRUE - /api/:api_type part of request path info will be trimmed + * @return Mage_Api2_Model_Router + * @throws Mage_Api2_Exception + */ + public function routeApiType(Mage_Api2_Model_Request $request, $trimApiTypePath = true) + { + /** @var $apiTypeRoute Mage_Api2_Model_Route_ApiType */ + $apiTypeRoute = Mage::getModel('api2/route_apiType'); + + if (!($apiTypeMatch = $apiTypeRoute->match($request, true))) { + throw new Mage_Api2_Exception('Request does not match type route.', Mage_Api2_Model_Server::HTTP_NOT_FOUND); + } + // Trim matched URI path for next routes + if ($trimApiTypePath) { + $matchedPathLength = strlen('/' . ltrim($apiTypeRoute->getMatchedPath(), '/')); + + $request->setPathInfo(substr($request->getPathInfo(), $matchedPathLength)); + } + $request->setParam('api_type', $apiTypeMatch['api_type']); + + return $this; + } +} diff --git a/app/code/core/Mage/Api2/Model/Server.php b/app/code/core/Mage/Api2/Model/Server.php new file mode 100644 index 0000000000..1b33ce2aa8 --- /dev/null +++ b/app/code/core/Mage/Api2/Model/Server.php @@ -0,0 +1,315 @@ + + */ +class Mage_Api2_Model_Server +{ + /** + * Api2 REST type + */ + const API_TYPE_REST = 'rest'; + + /**#@+ + * HTTP Response Codes + */ + const HTTP_OK = 200; + const HTTP_CREATED = 201; + const HTTP_MULTI_STATUS = 207; + const HTTP_BAD_REQUEST = 400; + const HTTP_UNAUTHORIZED = 401; + const HTTP_FORBIDDEN = 403; + const HTTP_NOT_FOUND = 404; + const HTTP_METHOD_NOT_ALLOWED = 405; + const HTTP_NOT_ACCEPTABLE = 406; + const HTTP_INTERNAL_ERROR = 500; + /**#@- */ + + /** + * List of api types + * + * @var array + */ + protected static $_apiTypes = array(self::API_TYPE_REST); + + /** + * @var Mage_Api2_Model_Auth_User_Abstract + */ + protected $_authUser; + + /** + * Run server + */ + public function run() + { + // can not use response object case + try { + /** @var $response Mage_Api2_Model_Response */ + $response = Mage::getSingleton('api2/response'); + } catch (Exception $e) { + Mage::logException($e); + + if (!headers_sent()) { + header('HTTP/1.1 ' . self::HTTP_INTERNAL_ERROR); + } + echo 'Service temporary unavailable'; + return; + } + // can not render errors case + try { + /** @var $request Mage_Api2_Model_Request */ + $request = Mage::getSingleton('api2/request'); + /** @var $renderer Mage_Api2_Model_Renderer_Interface */ + $renderer = Mage_Api2_Model_Renderer::factory($request->getAcceptTypes()); + } catch (Exception $e) { + Mage::logException($e); + + $response->setHttpResponseCode(self::HTTP_INTERNAL_ERROR) + ->setBody('Service temporary unavailable') + ->sendResponse(); + return; + } + // default case + try { + /** @var $apiUser Mage_Api2_Model_Auth_User_Abstract */ + $apiUser = $this->_authenticate($request); + + $this->_route($request) + ->_allow($request, $apiUser) + ->_dispatch($request, $response, $apiUser); + + if ($response->getHttpResponseCode() == self::HTTP_CREATED) { + // TODO: Re-factor this after _renderException refactoring + throw new Mage_Api2_Exception('Resource was partially created', self::HTTP_CREATED); + } + //NOTE: At this moment Renderer already could have some content rendered, so we should replace it + if ($response->isException()) { + throw new Mage_Api2_Exception('Unhandled simple errors.', self::HTTP_INTERNAL_ERROR); + } + } catch (Exception $e) { + Mage::logException($e); + $this->_renderException($e, $renderer, $response); + } + + $response->sendResponse(); + } + + /** + * Make internal call to api + * + * @param Mage_Api2_Model_Request $request + * @param Mage_Api2_Model_Response $response + * @return Mage_Api2_Model_Response + */ + public function internalCall(Mage_Api2_Model_Request $request, Mage_Api2_Model_Response $response) + { + $apiUser = $this->_getAuthUser(); + $this->_route($request) + ->_allow($request, $apiUser) + ->_dispatch($request, $response, $apiUser); + } + + /** + * Authenticate user + * + * @throws Exception + * @param Mage_Api2_Model_Request $request + * @return Mage_Api2_Model_Auth_User_Abstract + */ + protected function _authenticate(Mage_Api2_Model_Request $request) + { + /** @var $authManager Mage_Api2_Model_Auth */ + $authManager = Mage::getModel('api2/auth'); + + $this->_setAuthUser($authManager->authenticate($request)); + return $this->_getAuthUser(); + } + + /** + * Set auth user + * + * @throws Exception + * @param Mage_Api2_Model_Auth_User_Abstract $authUser + * @return Mage_Api2_Model_Server + */ + protected function _setAuthUser(Mage_Api2_Model_Auth_User_Abstract $authUser) + { + $this->_authUser = $authUser; + return $this; + } + + /** + * Retrieve existing auth user + * + * @throws Exception + * @return Mage_Api2_Model_Auth_User_Abstract + */ + protected function _getAuthUser() + { + if (!$this->_authUser) { + throw new Exception("Mage_Api2_Model_Server::internalCall() seems to be executed " + . "before Mage_Api2_Model_Server::run()"); + } + return $this->_authUser; + } + + /** + * Set all routes of the given api type to Route object + * Find route that match current URL, set parameters of the route to Request object + * + * @param Mage_Api2_Model_Request $request + * @return Mage_Api2_Model_Server + */ + protected function _route(Mage_Api2_Model_Request $request) + { + /** @var $router Mage_Api2_Model_Router */ + $router = Mage::getModel('api2/router'); + + $router->routeApiType($request, true) + ->setRoutes($this->_getConfig()->getRoutes($request->getApiType())) + ->route($request); + + return $this; + } + + /** + * Global ACL processing + * + * @param Mage_Api2_Model_Request $request + * @param Mage_Api2_Model_Auth_User_Abstract $apiUser + * @return Mage_Api2_Model_Server + * @throws Mage_Api2_Exception + */ + protected function _allow(Mage_Api2_Model_Request $request, Mage_Api2_Model_Auth_User_Abstract $apiUser) + { + /** @var $globalAcl Mage_Api2_Model_Acl_Global */ + $globalAcl = Mage::getModel('api2/acl_global'); + + if (!$globalAcl->isAllowed($apiUser, $request->getResourceType(), $request->getOperation())) { + throw new Mage_Api2_Exception('Access denied', self::HTTP_FORBIDDEN); + } + return $this; + } + + /** + * Load class file, instantiate resource class, set parameters to the instance, run resource internal dispatch + * method + * + * @param Mage_Api2_Model_Request $request + * @param Mage_Api2_Model_Response $response + * @param Mage_Api2_Model_Auth_User_Abstract $apiUser + * @return Mage_Api2_Model_Server + */ + protected function _dispatch( + Mage_Api2_Model_Request $request, + Mage_Api2_Model_Response $response, + Mage_Api2_Model_Auth_User_Abstract $apiUser + ) + { + /** @var $dispatcher Mage_Api2_Model_Dispatcher */ + $dispatcher = Mage::getModel('api2/dispatcher'); + $dispatcher->setApiUser($apiUser)->dispatch($request, $response); + + return $this; + } + + /** + * Get api2 config instance + * + * @return Mage_Api2_Model_Config + */ + protected function _getConfig() + { + return Mage::getModel('api2/config'); + } + + /** + * Process thrown exception + * Generate and set HTTP response code, error message to Response object + * + * @param Exception $exception + * @param Mage_Api2_Model_Renderer_Interface $renderer + * @param Mage_Api2_Model_Response $response + * @return Mage_Api2_Model_Server + */ + protected function _renderException(Exception $exception, Mage_Api2_Model_Renderer_Interface $renderer, + Mage_Api2_Model_Response $response + ) { + if ($exception instanceof Mage_Api2_Exception && $exception->getCode()) { + $httpCode = $exception->getCode(); + } else { + $httpCode = self::HTTP_INTERNAL_ERROR; + } + try { + //add last error to stack + $response->setException($exception); + + $messages = array(); + + /** @var Exception $exception */ + foreach ($response->getException() as $exception) { + $message = array('code' => $exception->getCode(), 'message' => $exception->getMessage()); + + if (Mage::getIsDeveloperMode()) { + $message['trace'] = $exception->getTraceAsString(); + } + $messages['messages']['error'][] = $message; + } + //set HTTP Code of last error, Content-Type and Body + $response->setBody($renderer->render($messages)); + $response->setHeader('Content-Type', sprintf( + '%s; charset=%s', $renderer->getMimeType(), Mage_Api2_Model_Response::RESPONSE_CHARSET + )); + } catch (Exception $e) { + //tunnelling of 406(Not acceptable) error + $httpCode = $e->getCode() == self::HTTP_NOT_ACCEPTABLE //$e->getCode() can result in one more loop + ? self::HTTP_NOT_ACCEPTABLE // of try..catch + : self::HTTP_INTERNAL_ERROR; + + //if error appeared in "error rendering" process then show it in plain text + $response->setBody($e->getMessage()); + $response->setHeader('Content-Type', 'text/plain; charset=' . Mage_Api2_Model_Response::RESPONSE_CHARSET); + } + $response->setHttpResponseCode($httpCode); + + return $this; + } + + /** + * Retrieve api types + * + * @return array + */ + public static function getApiTypes() + { + return self::$_apiTypes; + } +} diff --git a/app/code/core/Mage/Api2/controllers/Adminhtml/Api2/AttributeController.php b/app/code/core/Mage/Api2/controllers/Adminhtml/Api2/AttributeController.php new file mode 100644 index 0000000000..ac6a4a6cf7 --- /dev/null +++ b/app/code/core/Mage/Api2/controllers/Adminhtml/Api2/AttributeController.php @@ -0,0 +1,148 @@ + + */ +class Mage_Api2_Adminhtml_Api2_AttributeController extends Mage_Adminhtml_Controller_Action +{ + /** + * Show user types grid + */ + public function indexAction() + { + $this->_title($this->__('System')) + ->_title($this->__('Web Services')) + ->_title($this->__('REST Attributes')); + + $this->loadLayout()->_setActiveMenu('system/services/attributes'); + + $this->_addBreadcrumb($this->__('Web services'), $this->__('Web services')) + ->_addBreadcrumb($this->__('REST Attributes'), $this->__('REST Attributes')) + ->_addBreadcrumb($this->__('Attributes'), $this->__('Attributes')); + + $this->renderLayout(); + } + + /** + * Edit role + */ + public function editAction() + { + $this->loadLayout() + ->_setActiveMenu('system/services/attributes'); + + $type = $this->getRequest()->getParam('type'); + + $userTypes = Mage_Api2_Model_Auth_User::getUserTypes(); + if (!isset($userTypes[$type])) { + $this->_getSession()->addError($this->__('User type "%s" not found.', $type)); + $this->_redirect('*/*/'); + return; + } + + $this->_title($this->__('System')) + ->_title($this->__('Web Services')) + ->_title($this->__('REST ACL Attributes')); + + $title = $this->__('Edit %s ACL attribute rules', $userTypes[$type]); + $this->_title($title); + $this->_addBreadcrumb($title, $title); + + $this->renderLayout(); + } + + /** + * Save role + */ + public function saveAction() + { + $request = $this->getRequest(); + + $type = $request->getParam('type'); + + if (!$type) { + $this->_getSession()->addError( + $this->__('User type "%s" no longer exists', $type)); + $this->_redirect('*/*/'); + return; + } + + /** @var $session Mage_Adminhtml_Model_Session */ + $session = $this->_getSession(); + + try { + /** @var $ruleTree Mage_Api2_Model_Acl_Global_Rule_Tree */ + $ruleTree = Mage::getSingleton( + 'api2/acl_global_rule_tree', + array('type' => Mage_Api2_Model_Acl_Global_Rule_Tree::TYPE_ATTRIBUTE) + ); + + /** @var $attribute Mage_Api2_Model_Acl_Filter_Attribute */ + $attribute = Mage::getModel('api2/acl_filter_attribute'); + + /** @var $collection Mage_Api2_Model_Resource_Acl_Filter_Attribute_Collection */ + $collection = $attribute->getCollection(); + $collection->addFilterByUserType($type); + + /** @var $model Mage_Api2_Model_Acl_Filter_Attribute */ + foreach ($collection as $model) { + $model->delete(); + } + + foreach ($ruleTree->getPostResources() as $resourceId => $operations) { + if (Mage_Api2_Model_Acl_Global_Rule::RESOURCE_ALL === $resourceId) { + $attribute->setUserType($type) + ->setResourceId($resourceId) + ->save(); + } else { + foreach ($operations as $operation => $attributes) { + $attribute->setId(null) + ->isObjectNew(true); + + $attribute->setUserType($type) + ->setResourceId($resourceId) + ->setOperation($operation) + ->setAllowedAttributes(implode(',', array_keys($attributes))) + ->save(); + } + } + } + + $session->addSuccess($this->__('The attribute rules were saved.')); + } catch (Mage_Core_Exception $e) { + $session->addError($e->getMessage()); + } catch (Exception $e) { + $session->addException($e, $this->__('An error occurred while saving attribute rules.')); + } + + $this->_redirect('*/*/edit', array('type' => $type)); + } +} diff --git a/app/code/core/Mage/Api2/controllers/Adminhtml/Api2/RoleController.php b/app/code/core/Mage/Api2/controllers/Adminhtml/Api2/RoleController.php new file mode 100644 index 0000000000..451dfe7b5f --- /dev/null +++ b/app/code/core/Mage/Api2/controllers/Adminhtml/Api2/RoleController.php @@ -0,0 +1,340 @@ + + */ +class Mage_Api2_Adminhtml_Api2_RoleController extends Mage_Adminhtml_Controller_Action +{ + /** + * Show grid + */ + public function indexAction() + { + $this->_title($this->__('System')) + ->_title($this->__('Web Services')) + ->_title($this->__('REST Roles')); + + $this->loadLayout()->_setActiveMenu('system/services/roles'); + $this->_addBreadcrumb($this->__('Web services'), $this->__('Web services')); + $this->_addBreadcrumb($this->__('REST Roles'), $this->__('REST Roles')); + $this->_addBreadcrumb($this->__('Roles'), $this->__('Roles')); + + $this->renderLayout(); + } + + /** + * Updating grid by ajax + */ + public function gridAction() + { + $this->loadLayout(); + $this->renderLayout(); + } + + /** + * Updating users grid by ajax + */ + public function usersGridAction() + { + $id = $this->getRequest()->getParam('id', false); + + $this->loadLayout(); + /** @var $grid Mage_Api2_Block_Adminhtml_Roles_Tab_Users */ + $grid = $this->getLayout()->getBlock('adminhtml.role.edit.tab.users'); + $grid->setUsers($this->_getUsers($id)); + + $this->renderLayout(); + } + + /** + * Create new role + */ + public function newAction() + { + $this->_title($this->__('System')) + ->_title($this->__('Web Services')) + ->_title($this->__('Rest Roles')); + + $this->loadLayout()->_setActiveMenu('system/services/roles'); + $this->_addBreadcrumb($this->__('Web services'), $this->__('Web services')); + $this->_addBreadcrumb($this->__('REST Roles'), $this->__('REST Roles')); + $this->_addBreadcrumb($this->__('Roles'), $this->__('Roles')); + + $breadCrumb = $this->__('Add New Role'); + $breadCrumbTitle = $this->__('Add New Role'); + $this->_title($this->__('New Role')); + + $this->_addBreadcrumb($breadCrumb, $breadCrumbTitle); + + $this->renderLayout(); + } + + /** + * Edit role + */ + public function editAction() + { + $id = (int) $this->getRequest()->getParam('id'); + /** @var $role Mage_Api2_Model_Acl_Global_Role */ + $role = Mage::getModel('api2/acl_global_role')->load($id); + + if (!$role->getId()) { + $this->_getSession()->addError($this->__('Role "%s" not found.', $id)); + $this->_redirect('*/*/'); + return; + } + + $this->loadLayout()->_setActiveMenu('system/services/roles'); + + $this->_title($this->__('System')) + ->_title($this->__('Web Services')) + ->_title($this->__('Rest Roles')); + + $breadCrumb = $this->__('Edit Role'); + $breadCrumbTitle = $this->__('Edit Role'); + $this->_title($this->__('Edit Role')); + $this->_addBreadcrumb($breadCrumb, $breadCrumbTitle); + + /** @var $tabs Mage_Api2_Block_Adminhtml_Roles_Tabs */ + $tabs = $this->getLayout()->getBlock('adminhtml.role.edit.tabs'); + $tabs->setRole($role); + /** @var $child Mage_Adminhtml_Block_Template */ + foreach ($tabs->getChild() as $child) { + $child->setData('role', $role); + } + + /** @var $buttons Mage_Api2_Block_Adminhtml_Roles_Buttons */ + $buttons = $this->getLayout()->getBlock('adminhtml.roles.buttons'); + $buttons->setRole($role); + + /** @var $users Mage_Api2_Block_Adminhtml_Roles_Tab_Users */ + $users = $this->getLayout()->getBlock('adminhtml.role.edit.tab.users'); + $users->setUsers($this->_getUsers($id)); + + //$this->getLayout()->getBlock('adminhtml.role.edit.tab.resources')->getResTreeJson(); + //exit; + + $this->renderLayout(); + } + + /** + * Save role + */ + public function saveAction() + { + $request = $this->getRequest(); + + $id = $request->getParam('id', false); + /** @var $role Mage_Api2_Model_Acl_Global_Role */ + $role = Mage::getModel('api2/acl_global_role')->load($id); + + if (!$role->getId() && $id) { + $this->_getSession()->addError( + $this->__('Role "%s" no longer exists', $role->getData('role_name'))); + $this->_redirect('*/*/'); + return; + } + + $roleUsers = $request->getParam('in_role_users', null); + parse_str($roleUsers, $roleUsers); + $roleUsers = array_keys($roleUsers); + + $oldRoleUsers = $this->getRequest()->getParam('in_role_users_old'); + parse_str($oldRoleUsers, $oldRoleUsers); + $oldRoleUsers = array_keys($oldRoleUsers); + + /** @var $session Mage_Adminhtml_Model_Session */ + $session = $this->_getSession(); + + try { + $role->setRoleName($this->getRequest()->getParam('role_name', false)) + ->save(); + + foreach($oldRoleUsers as $oUid) { + $this->_deleteUserFromRole($oUid, $role->getId()); + } + + foreach ($roleUsers as $nRuid) { + $this->_addUserToRole($nRuid, $role->getId()); + } + + /** + * Save rules with resources + */ + /** @var $rule Mage_Api2_Model_Acl_Global_Rule */ + $rule = Mage::getModel('api2/acl_global_rule'); + if ($id) { + $collection = $rule->getCollection(); + $collection->addFilterByRoleId($role->getId()); + + /** @var $model Mage_Api2_Model_Acl_Global_Rule */ + foreach ($collection as $model) { + $model->delete(); + } + } + + /** @var $ruleTree Mage_Api2_Model_Acl_Global_Rule_Tree */ + $ruleTree = Mage::getSingleton( + 'api2/acl_global_rule_tree', + array('type' => Mage_Api2_Model_Acl_Global_Rule_Tree::TYPE_PRIVILEGE) + ); + $resources = $ruleTree->getPostResources(); + $id = $role->getId(); + foreach ($resources as $resourceId => $privileges) { + foreach ($privileges as $privilege => $allow) { + if (!$allow) { + continue; + } + + $rule->setId(null) + ->isObjectNew(true); + + $rule->setRoleId($id) + ->setResourceId($resourceId) + ->setPrivilege($privilege) + ->save(); + } + } + + $session->addSuccess($this->__('The role has been saved.')); + } catch (Mage_Core_Exception $e) { + $session->addError($e->getMessage()); + } catch (Exception $e) { + $session->addException($e, $this->__('An error occurred while saving role.')); + } + + $this->_redirect('*/*/edit', array('id'=>$id)); + } + + /** + * Delete role + */ + public function deleteAction() + { + $id = $this->getRequest()->getParam('id', false); + + try { + /** @var $model Mage_Api2_Model_Acl_Global_Role */ + $model = Mage::getModel("api2/acl_global_role"); + $model->load($id)->delete(); + $this->_getSession()->addSuccess($this->__('Role has been deleted.')); + } catch (Mage_Core_Exception $e) { + $this->_getSession()->addError($e->getMessage()); + } catch (Exception $e) { + $this->_getSession()->addException($e, $this->__('An error occurred while deleting the role.')); + } + + $this->_redirect("*/*/"); + } + + /** + * Check against ACL + * + * @return bool + */ + protected function _isAllowed() + { + /** @var $session Mage_Admin_Model_Session */ + $session = Mage::getSingleton('admin/session'); + return $session->isAllowed('system/api/roles_rest'); + } + + /** + * Get API2 roles ajax grid action + */ + public function rolesGridAction() + { + /** @var $model Mage_Admin_Model_User */ + $model = Mage::getModel('admin/user'); + $model->load($this->getRequest()->getParam('user_id')); + + Mage::register('permissions_user', $model); + $this->getResponse() + ->setBody($this->getLayout()->createBlock('api2/adminhtml_permissions_user_edit_tab_roles')->toHtml()); + } + + /** + * Get users possessing the role + * + * @param int $id + * @return array|mixed + */ + protected function _getUsers($id) + { + if ( $this->getRequest()->getParam('in_role_users') != "" ) { + return $this->getRequest()->getParam('in_role_users'); + } + + /** @var $role Mage_Api2_Model_Acl_Global_Role */ + $role = Mage::getModel('api2/acl_global_role'); + $role->setId($id); + + /** @var $resource Mage_Api2_Model_Resource_Acl_Global_Role */ + $resource = $role->getResource(); + $users = $resource->getRoleUsers($role); + + if (sizeof($users) == 0) { + $users = array(); + } + + return $users; + } + + /** + * Take away user role + * + * @param int $adminId + * @param int $roleId + * @return Mage_Api2_Adminhtml_Api2_RoleController + */ + protected function _deleteUserFromRole($adminId, $roleId) + { + /** @var $resourceModel Mage_Api2_Model_Resource_Acl_Global_Role */ + $resourceModel = Mage::getResourceModel('api2/acl_global_role'); + $resourceModel->deleteAdminToRoleRelation($adminId, $roleId); + return $this; + } + + /** + * Give user a role + * + * @param int $adminId + * @param int $roleId + * @return Mage_Api2_Adminhtml_Api2_RoleController + */ + protected function _addUserToRole($adminId, $roleId) + { + /** @var $resourceModel Mage_Api2_Model_Resource_Acl_Global_Role */ + $resourceModel = Mage::getResourceModel('api2/acl_global_role'); + $resourceModel->saveAdminToRoleRelation($adminId, $roleId); + return $this; + } +} diff --git a/app/code/core/Mage/Api2/etc/adminhtml.xml b/app/code/core/Mage/Api2/etc/adminhtml.xml new file mode 100644 index 0000000000..14995e592a --- /dev/null +++ b/app/code/core/Mage/Api2/etc/adminhtml.xml @@ -0,0 +1,93 @@ + + + + + + + + + + + + + REST - Roles + 30 + + + Add + 10 + + + Edit + 20 + + + Delete + 30 + + + + + REST - Attributes + 40 + + + Edit + 10 + + + + + + + + + + + + + + + + + + REST - Roles + 30 + adminhtml/api2_role + + + REST - Attributes + 40 + adminhtml/api2_attribute + + + + + + + diff --git a/app/code/core/Mage/Api2/etc/config.xml b/app/code/core/Mage/Api2/etc/config.xml new file mode 100644 index 0000000000..1238eda13f --- /dev/null +++ b/app/code/core/Mage/Api2/etc/config.xml @@ -0,0 +1,212 @@ + + + + + + 1.0.0.0 + + + + + + + + Web Services definition files (api2.xml). + CONFIG_API2 + + + + + + Mage_Api2_Model + api2_resource + + + Mage_Api2_Model_Resource + + + api2_acl_role
    +
    + + api2_acl_user
    +
    + + api2_acl_rule
    +
    + + api2_acl_attribute
    +
    +
    +
    +
    + + + Mage_Api2_Block + + + + + Mage_Api2_Helper + + + + + + Mage_Api2 + Mage_Api2_Model_Resource_Setup + + + + + + + + api2/observer + saveAdminToRoleRelation + + + + + + + + api2/auth_adapter_oauth + + 1 + 10 + + + + + api2/auth_user_admin + 1 + + + api2/auth_user_customer + 1 + + + api2/auth_user_guest + 1 + + + + + + + application/json + api2/request_interpreter_json + + + + + text/plain + api2/request_interpreter_query + + + + + application/xml + api2/request_interpreter_xml + + + application/xhtml+xml + api2/request_interpreter_xml + + + text/xml + api2/request_interpreter_xml + + + + + + + + */* + api2/renderer_json + + + application/json + api2/renderer_json + + + + + text/plain + api2/renderer_query + + + + + text/xml + api2/renderer_xml + + + application/xml + api2/renderer_xml + + + application/xhtml+xml + api2/renderer_xml + + + + +
    + + + + + + Mage_Api2_Adminhtml + + + + + + + + + + api2.xml + + + + + + + + api2/observer + catalogAttributeSaveAfter + + + + + +
    diff --git a/app/code/core/Mage/Api2/sql/api2_setup/install-1.0.0.0.php b/app/code/core/Mage/Api2/sql/api2_setup/install-1.0.0.0.php new file mode 100644 index 0000000000..904c45c5e8 --- /dev/null +++ b/app/code/core/Mage/Api2/sql/api2_setup/install-1.0.0.0.php @@ -0,0 +1,183 @@ +startSetup(); + +/** @var $adapter Varien_Db_Adapter_Pdo_Mysql */ +$adapter = $installer->getConnection(); + +/** + * Create table 'api2/acl_role' + */ +$table = $adapter->newTable($installer->getTable('api2/acl_role')) + ->addColumn('entity_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array( + 'identity' => true, + 'unsigned' => true, + 'nullable' => false, + 'primary' => true, + ), 'Entity ID') + ->addColumn('created_at', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null, + array( + 'nullable' => false, + 'default' => Varien_Db_Ddl_Table::TIMESTAMP_INIT + ), 'Created At') + ->addColumn('updated_at', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null, + array( + 'nullable' => true + ), 'Updated At') + ->addColumn('role_name', Varien_Db_Ddl_Table::TYPE_VARCHAR, + 255, array('nullable' => false), 'Name of role') + ->addIndex($installer->getIdxName('api2/acl_role', array('created_at')), array('created_at')) + ->addIndex($installer->getIdxName('api2/acl_role', array('updated_at')), array('updated_at')) + ->setComment('Api2 Global ACL Roles'); +$adapter->createTable($table); + +// Create Guest and Customer User Roles +$adapter->insertMultiple( + $installer->getTable('api2/acl_role'), + array( + array('role_name' => 'Guest'), + array('role_name' => 'Customer') + ) +); + +/** + * Create table 'api2/acl_user' + */ +$table = $adapter->newTable($installer->getTable('api2/acl_user')) + ->addColumn('admin_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array( + 'unsigned' => true, + 'nullable' => false, + ), 'Admin ID') + ->addColumn('role_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array( + 'unsigned' => true, + 'nullable' => false, + ), 'Role ID') + ->addIndex( + $installer->getIdxName( + $installer->getTable('api2/acl_user'), + array('admin_id'), + Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE + ), + array('admin_id'), + array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE)) + ->addForeignKey( + $installer->getFkName('api2/acl_user', 'admin_id', 'admin/user', 'user_id'), + 'admin_id', + $installer->getTable('admin/user'), + 'user_id', + Varien_Db_Ddl_Table::ACTION_CASCADE, + Varien_Db_Ddl_Table::ACTION_CASCADE) + ->addForeignKey( + $installer->getFkName('api2/acl_user', 'role_id', 'api2/acl_role', 'entity_id'), + 'role_id', + $installer->getTable('api2/acl_role'), + 'entity_id', + Varien_Db_Ddl_Table::ACTION_CASCADE, + Varien_Db_Ddl_Table::ACTION_CASCADE) + ->setComment('Api2 Global ACL Users'); +$adapter->createTable($table); + +/** + * Create table 'api2/acl_rule' + */ +$table = $adapter->newTable($installer->getTable('api2/acl_rule')) + ->addColumn('entity_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array( + 'primary' => true, + 'identity' => true, + 'unsigned' => true, + 'nullable' => false, + ), 'Entity ID') + ->addColumn('role_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array( + 'unsigned' => true, + 'nullable' => false, + ), 'Role ID') + ->addColumn('resource_id', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array( + 'nullable' => false + ), 'Resource ID') + ->addColumn('privilege', Varien_Db_Ddl_Table::TYPE_TEXT, 20, array( + 'nullable' => true + ), 'ACL Privilege') + ->addIndex( + $installer->getIdxName( + $installer->getTable('api2/acl_rule'), + array('role_id', 'resource_id', 'privilege'), + Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE + ), + array('role_id', 'resource_id', 'privilege'), + array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE)) + ->addForeignKey( + $installer->getFkName('api2/acl_rule', 'role_id', 'api2/acl_role', 'entity_id'), + 'role_id', + $installer->getTable('api2/acl_role'), + 'entity_id', + Varien_Db_Ddl_Table::ACTION_CASCADE, + Varien_Db_Ddl_Table::ACTION_CASCADE) + ->setComment('Api2 Global ACL Rules'); +$adapter->createTable($table); + +/** +* Create table 'api2/acl_attribute' +*/ +$table = $adapter->newTable($installer->getTable('api2/acl_attribute')) + ->addColumn('entity_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array( + 'identity' => true, + 'unsigned' => true, + 'nullable' => false, + 'primary' => true, + ), 'Entity ID') + ->addColumn('user_type', Varien_Db_Ddl_Table::TYPE_VARCHAR, 20, array( + 'nullable' => false + ), 'Type of user') + ->addColumn('resource_id', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255, array( + 'nullable' => false + ), 'Resource ID') + ->addColumn('operation', Varien_Db_Ddl_Table::TYPE_VARCHAR, 20, array( + 'nullable' => false + ), 'Operation') + ->addColumn('allowed_attributes', Varien_Db_Ddl_Table::TYPE_TEXT, null, array( + 'nullable' => true + ), 'Allowed attributes') + ->addIndex( + $installer->getIdxName('api2/acl_attribute', array('user_type')), + array('user_type')) + ->addIndex( + $installer->getIdxName( + $installer->getTable('api2/acl_attribute'), + array('user_type', 'resource_id', 'operation'), + Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE + ), + array('user_type', 'resource_id', 'operation'), + array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE)) + ->setComment('Api2 Filter ACL Attributes'); +$adapter->createTable($table); + +$installer->endSetup(); diff --git a/app/code/core/Mage/Authorizenet/etc/system.xml b/app/code/core/Mage/Authorizenet/etc/system.xml index e487f8a589..b56b9565bd 100755 --- a/app/code/core/Mage/Authorizenet/etc/system.xml +++ b/app/code/core/Mage/Authorizenet/etc/system.xml @@ -146,6 +146,7 @@ text + validate-email 130 1 1 diff --git a/app/code/core/Mage/Backup/Helper/Data.php b/app/code/core/Mage/Backup/Helper/Data.php index f08d8f23be..41c96cae53 100644 --- a/app/code/core/Mage/Backup/Helper/Data.php +++ b/app/code/core/Mage/Backup/Helper/Data.php @@ -224,7 +224,7 @@ public function getCreateSuccessMessageByType($type) { $messagesMap = array( self::TYPE_SYSTEM_SNAPSHOT => $this->__('The system backup has been created.'), - self::TYPE_SNAPSHOT_WITHOUT_MEDIA => $this->__('The system backup has been created.'), + self::TYPE_SNAPSHOT_WITHOUT_MEDIA => $this->__('The system (excluding Media) backup has been created.'), self::TYPE_MEDIA => $this->__('The database and media backup has been created.'), self::TYPE_DB => $this->__('The database backup has been created.') ); diff --git a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.php b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.php index 9970e7dff5..d7f1d76639 100644 --- a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.php +++ b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.php @@ -33,11 +33,35 @@ */ class Mage_Bundle_Block_Adminhtml_Catalog_Product_Edit_Tab_Bundle_Option extends Mage_Adminhtml_Block_Widget { + /** + * Form element + * + * @var Varien_Data_Form_Element_Abstract|null + */ protected $_element = null; + + /** + * List of customer groups + * + * @deprecated since 1.7.0.0 + * @var array|null + */ protected $_customerGroups = null; + + /** + * List of websites + * + * @deprecated since 1.7.0.0 + * @var array|null + */ protected $_websites = null; - protected $_oprions = null; + /** + * List of bundle product options + * + * @var array|null + */ + protected $_options = null; /** * Bundle option renderer class constructor diff --git a/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Abstract.php b/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Abstract.php index a2810309cd..0b790fbfd3 100644 --- a/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Abstract.php +++ b/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Abstract.php @@ -24,7 +24,6 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - /** * Sales Order Pdf Items renderer * @@ -134,7 +133,9 @@ public function isChildCalculated($item = null) if ($parentItem) { $options = $parentItem->getProductOptions(); if ($options) { - if (isset($options['product_calculations']) && $options['product_calculations'] == Mage_Catalog_Model_Product_Type_Abstract::CALCULATE_CHILD) { + if (isset($options['product_calculations']) && + $options['product_calculations'] == Mage_Catalog_Model_Product_Type_Abstract::CALCULATE_CHILD + ) { return true; } else { return false; @@ -143,7 +144,9 @@ public function isChildCalculated($item = null) } else { $options = $item->getProductOptions(); if ($options) { - if (isset($options['product_calculations']) && $options['product_calculations'] == Mage_Catalog_Model_Product_Type_Abstract::CALCULATE_CHILD) { + if (isset($options['product_calculations']) && + $options['product_calculations'] == Mage_Catalog_Model_Product_Type_Abstract::CALCULATE_CHILD + ) { return false; } else { return true; diff --git a/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Creditmemo.php b/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Creditmemo.php index 4021fc9274..5d2ec976ce 100644 --- a/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Creditmemo.php +++ b/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Creditmemo.php @@ -24,7 +24,6 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - /** * Sales Order Creditmemo Pdf default items renderer * @@ -47,8 +46,8 @@ public function draw() $items = $this->getChilds($item); $_prevOptionId = ''; - $drawItems = array(); - $leftBound = 35; + $drawItems = array(); + $leftBound = 35; $rightBound = 565; foreach ($items as $_item) { @@ -66,7 +65,7 @@ public function draw() if (!isset($drawItems[$optionId])) { $drawItems[$optionId] = array( 'lines' => array(), - 'height' => 10 + 'height' => 15 ); } @@ -75,13 +74,13 @@ public function draw() if ($_prevOptionId != $attributes['option_id']) { $line[0] = array( 'font' => 'italic', - 'text' => Mage::helper('core/string')->str_split($attributes['option_label'],60, true, true), + 'text' => Mage::helper('core/string')->str_split($attributes['option_label'], 38, true, true), 'feed' => $x ); $drawItems[$optionId] = array( 'lines' => array($line), - 'height' => 10 + 'height' => 15 ); $line = array(); @@ -99,7 +98,7 @@ public function draw() } $line[] = array( - 'text' => Mage::helper('core/string')->str_split($name, 60, true, true), + 'text' => Mage::helper('core/string')->str_split($name, 35, true, true), 'feed' => $feed ); @@ -108,7 +107,7 @@ public function draw() // draw SKUs if (!$_item->getOrderItem()->getParentItem()) { $text = array(); - foreach (Mage::helper('core/string')->str_split($item->getSku(), 30) as $part) { + foreach (Mage::helper('core/string')->str_split($item->getSku(), 17) as $part) { $text[] = $part; } $line[] = array( @@ -166,7 +165,9 @@ public function draw() $x += 45; // draw Total(inc) - $text = $order->formatPriceTxt($_item->getRowTotal()+$_item->getTaxAmount()-$_item->getDiscountAmount()); + $text = $order->formatPriceTxt( + $_item->getRowTotal() + $_item->getTaxAmount() - $_item->getDiscountAmount() + ); $line[] = array( 'text' => $text, 'feed' => $rightBound, @@ -186,17 +187,19 @@ public function draw() foreach ($options['options'] as $option) { $lines = array(); $lines[][] = array( - 'text' => Mage::helper('core/string')->str_split(strip_tags($option['label']), 70, true, true), + 'text' => Mage::helper('core/string')->str_split(strip_tags($option['label']), 40, true, true), 'font' => 'italic', 'feed' => $leftBound ); if ($option['value']) { $text = array(); - $_printValue = isset($option['print_value']) ? $option['print_value'] : strip_tags($option['value']); + $_printValue = isset($option['print_value']) + ? $option['print_value'] + : strip_tags($option['value']); $values = explode(', ', $_printValue); foreach ($values as $value) { - foreach (Mage::helper('core/string')->str_split($value, 50, true, true) as $_value) { + foreach (Mage::helper('core/string')->str_split($value, 30, true, true) as $_value) { $text[] = $_value; } } @@ -209,7 +212,7 @@ public function draw() $drawItems[] = array( 'lines' => $lines, - 'height' => 10 + 'height' => 15 ); } } diff --git a/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Invoice.php b/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Invoice.php index 58747a7f30..0439f1a769 100644 --- a/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Invoice.php +++ b/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Invoice.php @@ -24,7 +24,6 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - /** * Sales Order Invoice Pdf default items renderer * @@ -65,7 +64,7 @@ public function draw() if (!isset($drawItems[$optionId])) { $drawItems[$optionId] = array( 'lines' => array(), - 'height' => 10 + 'height' => 15 ); } @@ -73,13 +72,13 @@ public function draw() if ($_prevOptionId != $attributes['option_id']) { $line[0] = array( 'font' => 'italic', - 'text' => Mage::helper('core/string')->str_split($attributes['option_label'], 70, true, true), + 'text' => Mage::helper('core/string')->str_split($attributes['option_label'], 45, true, true), 'feed' => 35 ); $drawItems[$optionId] = array( 'lines' => array($line), - 'height' => 10 + 'height' => 15 ); $line = array(); @@ -97,14 +96,14 @@ public function draw() $name = $_item->getName(); } $line[] = array( - 'text' => Mage::helper('core/string')->str_split($name, 55, true, true), + 'text' => Mage::helper('core/string')->str_split($name, 35, true, true), 'feed' => $feed ); // draw SKUs if (!$_item->getOrderItem()->getParentItem()) { $text = array(); - foreach (Mage::helper('core/string')->str_split($item->getSku(), 30) as $part) { + foreach (Mage::helper('core/string')->str_split($item->getSku(), 17) as $part) { $text[] = $part; } $line[] = array( @@ -155,17 +154,19 @@ public function draw() foreach ($options['options'] as $option) { $lines = array(); $lines[][] = array( - 'text' => Mage::helper('core/string')->str_split(strip_tags($option['label']), 70, true, true), + 'text' => Mage::helper('core/string')->str_split(strip_tags($option['label']), 40, true, true), 'font' => 'italic', 'feed' => 35 ); if ($option['value']) { $text = array(); - $_printValue = isset($option['print_value']) ? $option['print_value'] : strip_tags($option['value']); + $_printValue = isset($option['print_value']) + ? $option['print_value'] + : strip_tags($option['value']); $values = explode(', ', $_printValue); foreach ($values as $value) { - foreach (Mage::helper('core/string')->str_split($value, 50, true, true) as $_value) { + foreach (Mage::helper('core/string')->str_split($value, 30, true, true) as $_value) { $text[] = $_value; } } @@ -178,7 +179,7 @@ public function draw() $drawItems[] = array( 'lines' => $lines, - 'height' => 10 + 'height' => 15 ); } } diff --git a/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Shipment.php b/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Shipment.php index 93d15661f0..af96b79518 100644 --- a/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Shipment.php +++ b/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Shipment.php @@ -24,7 +24,6 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - /** * Sales Order Shipment Pdf items renderer * @@ -66,7 +65,7 @@ public function draw() if (!isset($drawItems[$optionId])) { $drawItems[$optionId] = array( 'lines' => array(), - 'height' => 10 + 'height' => 15 ); } @@ -74,13 +73,13 @@ public function draw() if ($_prevOptionId != $attributes['option_id']) { $line[0] = array( 'font' => 'italic', - 'text' => Mage::helper('core/string')->str_split($attributes['option_label'],60, true, true), + 'text' => Mage::helper('core/string')->str_split($attributes['option_label'], 60, true, true), 'feed' => 60 ); $drawItems[$optionId] = array( 'lines' => array($line), - 'height' => 10 + 'height' => 15 ); $line = array(); @@ -89,7 +88,9 @@ public function draw() } } - if (($this->isShipmentSeparately() && $_item->getParentItem()) || (!$this->isShipmentSeparately() && !$_item->getParentItem())) { + if (($this->isShipmentSeparately() && $_item->getParentItem()) + || (!$this->isShipmentSeparately() && !$_item->getParentItem()) + ) { if (isset($shipItems[$_item->getId()])) { $qty = $shipItems[$_item->getId()]->getQty()*1; } else if ($_item->getIsVirtual()) { @@ -125,7 +126,7 @@ public function draw() // draw SKUs $text = array(); - foreach (Mage::helper('core/string')->str_split($_item->getSku(), 30) as $part) { + foreach (Mage::helper('core/string')->str_split($_item->getSku(), 25) as $part) { $text[] = $part; } $line[] = array( @@ -150,7 +151,9 @@ public function draw() if ($option['value']) { $text = array(); - $_printValue = isset($option['print_value']) ? $option['print_value'] : strip_tags($option['value']); + $_printValue = isset($option['print_value']) + ? $option['print_value'] + : strip_tags($option['value']); $values = explode(', ', $_printValue); foreach ($values as $value) { foreach (Mage::helper('core/string')->str_split($value, 50, true, true) as $_value) { @@ -166,7 +169,7 @@ public function draw() $drawItems[] = array( 'lines' => $lines, - 'height' => 10 + 'height' => 15 ); } } diff --git a/app/code/core/Mage/Captcha/Block/Captcha/Zend.php b/app/code/core/Mage/Captcha/Block/Captcha/Zend.php index ff9bec2da9..cb17ea6d9b 100755 --- a/app/code/core/Mage/Captcha/Block/Captcha/Zend.php +++ b/app/code/core/Mage/Captcha/Block/Captcha/Zend.php @@ -57,8 +57,13 @@ public function getTemplate() */ public function getRefreshUrl() { - $url = Mage::app()->getStore()->isAdmin() ? "adminhtml/refresh/refresh" : "captcha/refresh"; - return Mage::getUrl($url, array('_secure' => Mage::app()->getRequest()->isSecure())); + $isSecure = Mage::app()->getStore()->isAdmin() + ? Mage::app()->getStore()->isAdminUrlSecure() + : Mage::getConfig()->shouldUrlBeSecure(Mage::app()->getRequest()->getPathInfo()); + return Mage::getUrl( + Mage::app()->getStore()->isAdmin() ? 'adminhtml/refresh/refresh' : 'captcha/refresh', + array('_secure' => $isSecure) + ); } /** diff --git a/app/code/core/Mage/Captcha/etc/config.xml b/app/code/core/Mage/Captcha/etc/config.xml index ee3251ded8..0377c43f0e 100755 --- a/app/code/core/Mage/Captcha/etc/config.xml +++ b/app/code/core/Mage/Captcha/etc/config.xml @@ -163,6 +163,13 @@ + + + + captcha + + + zend diff --git a/app/code/core/Mage/Catalog/Block/Product/Abstract.php b/app/code/core/Mage/Catalog/Block/Product/Abstract.php index f2dce13bc7..a4728a51bd 100644 --- a/app/code/core/Mage/Catalog/Block/Product/Abstract.php +++ b/app/code/core/Mage/Catalog/Block/Product/Abstract.php @@ -262,6 +262,7 @@ public function getReviewsSummaryHtml(Mage_Catalog_Model_Product $product, $temp * * @param string $type * @param string $template + * @return string */ public function addReviewSummaryTemplate($type, $template) { @@ -312,9 +313,10 @@ public function getTierPriceTemplate() return $this->getData('tier_price_template'); } /** - * Returns product tierprice block html + * Returns product tier price block html * * @param Mage_Catalog_Model_Product $product + * @return string */ public function getTierPriceHtml($product = null) { @@ -396,8 +398,8 @@ public function getTierPrices($product = null) * to get correct values in different products lists. * E.g. crosssells, upsells, new products, recently viewed * - * @param Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection $collection - * @return Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection + * @param Mage_Catalog_Model_Resource_Product_Collection $collection + * @return Mage_Catalog_Model_Resource_Product_Collection */ protected function _addProductAttributesAndPrices(Mage_Catalog_Model_Resource_Product_Collection $collection) { @@ -496,7 +498,7 @@ public function getColumnCount() * Add row size depends on page layout * * @param string $pageLayout - * @param int $rowSize + * @param int $columnCount * @return Mage_Catalog_Block_Product_List */ public function addColumnCountLayoutDepend($pageLayout, $columnCount) diff --git a/app/code/core/Mage/Catalog/Model/Api2/Product.php b/app/code/core/Mage/Catalog/Model/Api2/Product.php new file mode 100644 index 0000000000..e79bd133c2 --- /dev/null +++ b/app/code/core/Mage/Catalog/Model/Api2/Product.php @@ -0,0 +1,94 @@ + + */ +class Mage_Catalog_Model_Api2_Product extends Mage_Api2_Model_Resource +{ + /** + * Get available attributes of API resource + * + * @param string $userType + * @param string $operation + * @return array + */ + public function getAvailableAttributes($userType, $operation) + { + $attributes = $this->getAvailableAttributesFromConfig(); + /** @var $entityType Mage_Eav_Model_Entity_Type */ + $entityType = Mage::getModel('eav/entity_type')->loadByCode('catalog_product'); + $entityOnlyAttrs = $this->getEntityOnlyAttributes($userType, $operation); + /** @var $attribute Mage_Catalog_Model_Resource_Eav_Attribute */ + foreach ($entityType->getAttributeCollection() as $attribute) { + if ($this->_isAttributeVisible($attribute, $userType)) { + $attributes[$attribute->getAttributeCode()] = $attribute->getFrontendLabel(); + } + } + $excludedAttrs = $this->getExcludedAttributes($userType, $operation); + $includedAttrs = $this->getIncludedAttributes($userType, $operation); + foreach ($attributes as $code => $label) { + if (in_array($code, $excludedAttrs) || ($includedAttrs && !in_array($code, $includedAttrs))) { + unset($attributes[$code]); + } + if (in_array($code, $entityOnlyAttrs)) { + $attributes[$code] .= ' *'; + } + } + + return $attributes; + } + + /** + * Define if attribute should be visible for passed user type + * + * @param Mage_Catalog_Model_Resource_Eav_Attribute $attribute + * @param string $userType + * @return bool + */ + protected function _isAttributeVisible(Mage_Catalog_Model_Resource_Eav_Attribute $attribute, $userType) + { + $isAttributeVisible = false; + if ($userType == Mage_Api2_Model_Auth_User_Admin::USER_TYPE) { + $isAttributeVisible = $attribute->getIsVisible(); + } else { + $systemAttributesForNonAdmin = array( + 'sku', 'name', 'short_description', 'description', 'tier_price', 'meta_title', 'meta_description', + 'meta_keyword', + ); + if ($attribute->getIsUserDefined()) { + $isAttributeVisible = $attribute->getIsVisibleOnFront(); + } else if (in_array($attribute->getAttributeCode(), $systemAttributesForNonAdmin)) { + $isAttributeVisible = true; + } + } + return (bool)$isAttributeVisible; + } +} diff --git a/app/code/core/Mage/Catalog/Model/Api2/Product/Category.php b/app/code/core/Mage/Catalog/Model/Api2/Product/Category.php new file mode 100644 index 0000000000..94bb871d1b --- /dev/null +++ b/app/code/core/Mage/Catalog/Model/Api2/Product/Category.php @@ -0,0 +1,36 @@ + + */ +class Mage_Catalog_Model_Api2_Product_Category extends Mage_Api2_Model_Resource +{ +} diff --git a/app/code/core/Mage/Catalog/Model/Api2/Product/Category/Rest.php b/app/code/core/Mage/Catalog/Model/Api2/Product/Category/Rest.php new file mode 100644 index 0000000000..673b9c6332 --- /dev/null +++ b/app/code/core/Mage/Catalog/Model/Api2/Product/Category/Rest.php @@ -0,0 +1,105 @@ + + */ +abstract class Mage_Catalog_Model_Api2_Product_Category_Rest extends Mage_Catalog_Model_Api2_Product_Rest +{ + /** + * Product category assign is not available + * + * @param array $data + */ + protected function _create(array $data) + { + $this->_critical(self::RESOURCE_METHOD_NOT_ALLOWED); + } + + /** + * Product category update is not available + * + * @param array $data + */ + protected function _update(array $data) + { + $this->_critical(self::RESOURCE_METHOD_NOT_ALLOWED); + } + + /** + * Retrieve product data + * + * @return array + */ + protected function _retrieveCollection() + { + $return = array(); + + foreach ($this->_getCategoryIds() as $categoryId) { + $return[] = array('category_id' => $categoryId); + } + return $return; + } + + /** + * Only admin have permissions for product category unassign + */ + protected function _delete() + { + $this->_critical(self::RESOURCE_METHOD_NOT_ALLOWED); + } + + /** + * Load category by id + * + * @param int $categoryId + * @return Mage_Catalog_Model_Category + */ + protected function _getCategoryById($categoryId) + { + /** @var $category Mage_Catalog_Model_Category */ + $category = Mage::getModel('catalog/category')->setStoreId(0)->load($categoryId); + if (!$category->getId()) { + $this->_critical('Category not found', Mage_Api2_Model_Server::HTTP_NOT_FOUND); + } + + return $category; + } + + /** + * Get assigned categories ids + * + * @return array + */ + protected function _getCategoryIds() + { + return $this->_getProduct()->getCategoryCollection()->addIsActiveFilter()->getAllIds(); + } +} diff --git a/app/code/core/Mage/Catalog/Model/Api2/Product/Category/Rest/Admin/V1.php b/app/code/core/Mage/Catalog/Model/Api2/Product/Category/Rest/Admin/V1.php new file mode 100644 index 0000000000..a7ca806113 --- /dev/null +++ b/app/code/core/Mage/Catalog/Model/Api2/Product/Category/Rest/Admin/V1.php @@ -0,0 +1,146 @@ + + */ +class Mage_Catalog_Model_Api2_Product_Category_Rest_Admin_V1 extends Mage_Catalog_Model_Api2_Product_Category_Rest +{ + /** + * Product category assign + * + * @param array $data + * @return string + */ + protected function _create(array $data) + { + /* @var $validator Mage_Api2_Model_Resource_Validator_Fields */ + $validator = Mage::getResourceModel('api2/validator_fields', array('resource' => $this)); + if (!$validator->isValidData($data)) { + foreach ($validator->getErrors() as $error) { + $this->_error($error, Mage_Api2_Model_Server::HTTP_BAD_REQUEST); + } + $this->_critical(self::RESOURCE_DATA_PRE_VALIDATION_ERROR); + } + + $product = $this->_getProduct(); + $category = $this->_getCategoryById($data['category_id']); + + $categoryIds = $product->getCategoryIds(); + if (!is_array($categoryIds)) { + $categoryIds = array(); + } + if (in_array($category->getId(), $categoryIds)) { + $this->_critical(sprintf('Product #%d is already assigned to category #%d', + $product->getId(), $category->getId()), Mage_Api2_Model_Server::HTTP_BAD_REQUEST); + } + if ($category->getId() == Mage_Catalog_Model_Category::TREE_ROOT_ID) { + $this->_critical('Cannot assign product to tree root category.', Mage_Api2_Model_Server::HTTP_BAD_REQUEST); + } + $categoryIds[] = $category->getId(); + $product->setCategoryIds(implode(',', $categoryIds)); + + try{ + $product->save(); + } catch (Mage_Core_Exception $e) { + $this->_critical($e->getMessage(), Mage_Api2_Model_Server::HTTP_INTERNAL_ERROR); + } catch (Exception $e) { + $this->_critical(self::RESOURCE_INTERNAL_ERROR); + } + + return $this->_getLocation($category); + } + + /** + * Product category unassign + * + * @return bool + */ + protected function _delete() + { + $product = $this->_getProduct(); + $category = $this->_getCategoryById($this->getRequest()->getParam('category_id')); + + $categoryIds = $product->getCategoryIds(); + $categoryToBeDeletedId = array_search($category->getId(), $categoryIds); + if (false === $categoryToBeDeletedId) { + $this->_critical(sprintf('Product #%d isn\'t assigned to category #%d', + $product->getId(), $category->getId()), Mage_Api2_Model_Server::HTTP_BAD_REQUEST); + } + + // delete category + unset($categoryIds[$categoryToBeDeletedId]); + $product->setCategoryIds(implode(',', $categoryIds)); + + try{ + $product->save(); + } catch (Mage_Core_Exception $e) { + $this->_critical($e->getMessage(), Mage_Api2_Model_Server::HTTP_INTERNAL_ERROR); + } catch (Exception $e) { + $this->_critical(self::RESOURCE_INTERNAL_ERROR); + } + + return true; + } + + /** + * Return all assigned categories + * + * @return array + */ + protected function _getCategoryIds() + { + return $this->_getProduct()->getCategoryIds(); + } + + /** + * Get resource location + * + * @param Mage_Core_Model_Abstract $resource + * @return string URL + */ + protected function _getLocation($resource) + { + /** @var $apiTypeRoute Mage_Api2_Model_Route_ApiType */ + $apiTypeRoute = Mage::getModel('api2/route_apiType'); + + $chain = $apiTypeRoute->chain(new Zend_Controller_Router_Route( + $this->getConfig()->getRouteWithEntityTypeAction($this->getResourceType()) + )); + $params = array( + 'api_type' => $this->getRequest()->getApiType(), + 'id' => $this->getRequest()->getParam('id'), + 'category_id' => $resource->getId() + ); + $uri = $chain->assemble($params); + + return '/' . $uri; + } +} diff --git a/app/code/core/Mage/Catalog/Model/Api2/Product/Category/Rest/Customer/V1.php b/app/code/core/Mage/Catalog/Model/Api2/Product/Category/Rest/Customer/V1.php new file mode 100644 index 0000000000..5164eb3867 --- /dev/null +++ b/app/code/core/Mage/Catalog/Model/Api2/Product/Category/Rest/Customer/V1.php @@ -0,0 +1,36 @@ + + */ +class Mage_Catalog_Model_Api2_Product_Category_Rest_Customer_V1 extends Mage_Catalog_Model_Api2_Product_Category_Rest +{ +} diff --git a/app/code/core/Mage/Catalog/Model/Api2/Product/Category/Rest/Guest/V1.php b/app/code/core/Mage/Catalog/Model/Api2/Product/Category/Rest/Guest/V1.php new file mode 100644 index 0000000000..9261cb50b2 --- /dev/null +++ b/app/code/core/Mage/Catalog/Model/Api2/Product/Category/Rest/Guest/V1.php @@ -0,0 +1,36 @@ + + */ +class Mage_Catalog_Model_Api2_Product_Category_Rest_Guest_V1 extends Mage_Catalog_Model_Api2_Product_Category_Rest +{ +} diff --git a/app/code/core/Mage/Catalog/Model/Api2/Product/Image.php b/app/code/core/Mage/Catalog/Model/Api2/Product/Image.php new file mode 100644 index 0000000000..33e9f12a9a --- /dev/null +++ b/app/code/core/Mage/Catalog/Model/Api2/Product/Image.php @@ -0,0 +1,36 @@ + + */ +class Mage_Catalog_Model_Api2_Product_Image extends Mage_Api2_Model_Resource +{ +} diff --git a/app/code/core/Mage/Catalog/Model/Api2/Product/Image/Rest.php b/app/code/core/Mage/Catalog/Model/Api2/Product/Image/Rest.php new file mode 100644 index 0000000000..badc3d7b75 --- /dev/null +++ b/app/code/core/Mage/Catalog/Model/Api2/Product/Image/Rest.php @@ -0,0 +1,221 @@ + + */ +abstract class Mage_Catalog_Model_Api2_Product_Image_Rest extends Mage_Catalog_Model_Api2_Product_Rest +{ + /** + * Attribute code for media gallery + */ + const GALLERY_ATTRIBUTE_CODE = 'media_gallery'; + + /** + * Allowed MIME types for image + * + * @var array + */ + protected $_mimeTypes = array( + 'image/jpeg' => 'jpg', + 'image/gif' => 'gif', + 'image/png' => 'png' + ); + + /** + * Retrieve product image data for customer and guest roles + * + * @throws Mage_Api2_Exception + * @return array + */ + protected function _retrieve() + { + $imageData = array(); + $imageId = (int)$this->getRequest()->getParam('image'); + $galleryData = $this->_getProduct()->getData(self::GALLERY_ATTRIBUTE_CODE); + + if (!isset($galleryData['images']) || !is_array($galleryData['images'])) { + $this->_critical(self::RESOURCE_NOT_FOUND); + } + foreach ($galleryData['images'] as $image) { + if ($image['value_id'] == $imageId && !$image['disabled']) { + $imageData = $this->_formatImageData($image); + break; + } + } + if (empty($imageData)) { + $this->_critical(self::RESOURCE_NOT_FOUND); + } + return $imageData; + } + + /** + * Retrieve product images data for customer and guest + * + * @return array + */ + protected function _retrieveCollection() + { + $images = array(); + $galleryData = $this->_getProduct()->getData(self::GALLERY_ATTRIBUTE_CODE); + if (isset($galleryData['images']) && is_array($galleryData['images'])) { + foreach ($galleryData['images'] as $image) { + if (!$image['disabled']) { + $images[] = $this->_formatImageData($image); + } + } + } + return $images; + } + + /** + * Retrieve media gallery + * + * @throws Mage_Api2_Exception + * @return Mage_Catalog_Model_Product_Attribute_Backend_Media + */ + protected function _getMediaGallery() + { + $attributes = $this->_getProduct()->getTypeInstance(true)->getSetAttributes($this->_getProduct()); + + if (!isset($attributes[self::GALLERY_ATTRIBUTE_CODE]) + || !$attributes[self::GALLERY_ATTRIBUTE_CODE] instanceof Mage_Eav_Model_Entity_Attribute_Abstract + ) { + $this->_critical('Requested product does not support images', Mage_Api2_Model_Server::HTTP_BAD_REQUEST); + } + $galleryAttribute = $attributes[self::GALLERY_ATTRIBUTE_CODE]; + /** @var $mediaGallery Mage_Catalog_Model_Product_Attribute_Backend_Media */ + $mediaGallery = $galleryAttribute->getBackend(); + return $mediaGallery; + } + + /** + * Create image data representation for API + * + * @param array $image + * @return array + */ + protected function _formatImageData($image) + { + $result = array( + 'id' => $image['value_id'], + 'label' => $image['label'], + 'position' => $image['position'], + 'exclude' => $image['disabled'], + 'url' => $this->_getMediaConfig()->getMediaUrl($image['file']), + 'types' => $this->_getImageTypesAssignedToProduct($image['file']) + ); + return $result; + } + + /** + * Retrieve image types assigned to product (base, small, thumbnail) + * + * @param string $imageFile + * @return array + */ + protected function _getImageTypesAssignedToProduct($imageFile) + { + $types = array(); + foreach ($this->_getProduct()->getMediaAttributes() as $attribute) { + if ($this->_getProduct()->getData($attribute->getAttributeCode()) == $imageFile) { + $types[] = $attribute->getAttributeCode(); + } + } + return $types; + } + + /** + * Retrieve media config + * + * @return Mage_Catalog_Model_Product_Media_Config + */ + protected function _getMediaConfig() + { + return Mage::getSingleton('catalog/product_media_config'); + } + + /** + * Create file name from received data + * + * @param array $data + * @return string + */ + protected function _getFileName($data) + { + $fileName = 'image'; + if (isset($data['file_name']) && $data['file_name']) { + $fileName = $data['file_name']; + } + $fileName .= '.' . $this->_getExtensionByMimeType($data['file_mime_type']); + return $fileName; + } + + /** + * Retrieve file extension using MIME type + * + * @throws Mage_Api2_Exception + * @param string $mimeType + * @return string + */ + protected function _getExtensionByMimeType($mimeType) + { + if (!array_key_exists($mimeType, $this->_mimeTypes)) { + $this->_critical('Unsuppoted image MIME type', Mage_Api2_Model_Server::HTTP_BAD_REQUEST); + } + return $this->_mimeTypes[$mimeType]; + } + + /** + * Get file URI by its id. File URI is used by media backend to identify image + * + * @throws Mage_Api2_Exception + * @param int $imageId + * @return string + */ + protected function _getImageFileById($imageId) + { + $file = null; + $mediaGalleryData = $this->_getProduct()->getData('media_gallery'); + if (!isset($mediaGalleryData['images'])) { + $this->_critical(self::RESOURCE_NOT_FOUND); + } + foreach ($mediaGalleryData['images'] as $image) { + if ($image['value_id'] == $imageId) { + $file = $image['file']; + break; + } + } + if (!($file && $this->_getMediaGallery()->getImage($this->_getProduct(), $file))) { + $this->_critical(self::RESOURCE_NOT_FOUND); + } + return $file; + } +} diff --git a/app/code/core/Mage/Catalog/Model/Api2/Product/Image/Rest/Admin/V1.php b/app/code/core/Mage/Catalog/Model/Api2/Product/Image/Rest/Admin/V1.php new file mode 100644 index 0000000000..e0c3a82762 --- /dev/null +++ b/app/code/core/Mage/Catalog/Model/Api2/Product/Image/Rest/Admin/V1.php @@ -0,0 +1,236 @@ + + */ +class Mage_Catalog_Model_Api2_Product_Image_Rest_Admin_V1 extends Mage_Catalog_Model_Api2_Product_Image_Rest +{ + /** + * Product image add + * + * @throws Mage_Api2_Exception + * @param array $data + * @return string + */ + protected function _create(array $data) + { + /* @var $validator Mage_Catalog_Model_Api2_Product_Image_Validator_Image */ + $validator = Mage::getModel('catalog/api2_product_image_validator_image'); + if (!$validator->isValidData($data)) { + foreach ($validator->getErrors() as $error) { + $this->_error($error, Mage_Api2_Model_Server::HTTP_BAD_REQUEST); + } + $this->_critical(self::RESOURCE_DATA_PRE_VALIDATION_ERROR); + } + $imageFileContent = @base64_decode($data['file_content'], true); + if (!$imageFileContent) { + $this->_critical('The image content must be valid base64 encoded data', + Mage_Api2_Model_Server::HTTP_BAD_REQUEST); + } + unset($data['file_content']); + + $apiTempDir = Mage::getBaseDir('var') . DS . 'api' . DS . Mage::getSingleton('api/session')->getSessionId(); + $imageFileName = $this->_getFileName($data); + + try { + $ioAdapter = new Varien_Io_File(); + $ioAdapter->checkAndCreateFolder($apiTempDir); + $ioAdapter->open(array('path' => $apiTempDir)); + $ioAdapter->write($imageFileName, $imageFileContent, 0666); + unset($imageFileContent); + + // try to create Image object to check if image data is valid + try { + new Varien_Image($apiTempDir . DS . $imageFileName); + } catch (Exception $e) { + $ioAdapter->rmdir($apiTempDir, true); + $this->_critical($e->getMessage(), Mage_Api2_Model_Server::HTTP_INTERNAL_ERROR); + } + $product = $this->_getProduct(); + $imageFileUri = $this->_getMediaGallery()->addImage($product, $apiTempDir . DS . $imageFileName); + $ioAdapter->rmdir($apiTempDir, true); + // updateImage() must be called to add image data that is missing after addImage() call + $this->_getMediaGallery()->updateImage($product, $imageFileUri, $data); + + if (isset($data['types'])) { + $this->_getMediaGallery()->setMediaAttribute($product, $data['types'], $imageFileUri); + } + $product->save(); + return $this->_getImageLocation($this->_getCreatedImageId($imageFileUri)); + } catch (Mage_Core_Exception $e) { + $this->_critical($e->getMessage(), Mage_Api2_Model_Server::HTTP_INTERNAL_ERROR); + } catch (Exception $e) { + $this->_critical(self::RESOURCE_UNKNOWN_ERROR); + } + } + + /** + * Get added image ID + * + * @throws Mage_Api2_Exception + * @param string $imageFileUri + * @return int + */ + protected function _getCreatedImageId($imageFileUri) + { + $imageId = null; + + $imageData = Mage::getResourceModel('catalog/product_attribute_backend_media') + ->loadGallery($this->_getProduct(), $this->_getMediaGallery()); + foreach ($imageData as $image) { + if ($image['file'] == $imageFileUri) { + $imageId = $image['value_id']; + break; + } + } + if (!$imageId) { + $this->_critical('Unknown error during image save', Mage_Api2_Model_Server::HTTP_INTERNAL_ERROR); + } + return $imageId; + } + + /** + * Retrieve product images data + * + * @throws Mage_Api2_Exception + * @return array + */ + protected function _retrieve() + { + $result = array(); + $imageId = (int) $this->getRequest()->getParam('image'); + $galleryData = $this->_getProduct()->getData(self::GALLERY_ATTRIBUTE_CODE); + if (!isset($galleryData['images']) || !is_array($galleryData['images'])) { + $this->_critical('Product image not found', Mage_Api2_Model_Server::HTTP_NOT_FOUND); + } + foreach ($galleryData['images'] as &$image) { + if ($image['value_id'] == $imageId) { + $result = $this->_formatImageData($image); + break; + } + } + if (empty($result)) { + $this->_critical('Product image not found', Mage_Api2_Model_Server::HTTP_NOT_FOUND); + } + return $result; + } + + /** + * Update product image + * + * @throws Mage_Api2_Exception + * @param array $data + * @return bool + */ + protected function _update(array $data) + { + $imageId = (int)$this->getRequest()->getParam('image'); + $imageFileUri = $this->_getImageFileById($imageId); + $product = $this->_getProduct(); + $this->_getMediaGallery()->updateImage($product, $imageFileUri, $data); + if (isset($data['types']) && is_array($data['types'])) { + $assignedTypes = $this->_getImageTypesAssignedToProduct($imageFileUri); + $typesToBeCleared = array_diff($assignedTypes, $data['types']); + if (count($typesToBeCleared) > 0) { + $this->_getMediaGallery()->clearMediaAttribute($product, $typesToBeCleared); + } + $this->_getMediaGallery()->setMediaAttribute($product, $data['types'], $imageFileUri); + } + try { + $product->save(); + } catch (Mage_Core_Exception $e) { + $this->_critical($e->getMessage(), Mage_Api2_Model_Server::HTTP_INTERNAL_ERROR); + } catch (Exception $e) { + $this->_critical(self::RESOURCE_INTERNAL_ERROR); + } + } + + /** + * Product image delete + * + * @throws Mage_Api2_Exception + */ + protected function _delete() + { + $imageId = (int)$this->getRequest()->getParam('image'); + $product = $this->_getProduct(); + $imageFileUri = $this->_getImageFileById($imageId); + $this->_getMediaGallery()->removeImage($product, $imageFileUri); + try { + $product->save(); + } catch (Mage_Core_Exception $e) { + $this->_critical($e->getMessage(), Mage_Api2_Model_Server::HTTP_INTERNAL_ERROR); + } catch (Exception $e) { + $this->_critical(self::RESOURCE_INTERNAL_ERROR); + } + } + + /** + * Retrieve product images data + * + * @throws Mage_Api2_Exception + * @return array + */ + protected function _retrieveCollection() + { + $images = array(); + $galleryData = $this->_getProduct()->getData(self::GALLERY_ATTRIBUTE_CODE); + if (isset($galleryData['images']) && is_array($galleryData['images'])) { + foreach ($galleryData['images'] as $image) { + $images[] = $this->_formatImageData($image); + } + } + return $images; + } + + /** + * Get image resource location + * + * @param int $imageId + * @return string URL + */ + protected function _getImageLocation($imageId) + { + /* @var $apiTypeRoute Mage_Api2_Model_Route_ApiType */ + $apiTypeRoute = Mage::getModel('api2/route_apiType'); + + $chain = $apiTypeRoute->chain( + new Zend_Controller_Router_Route($this->getConfig()->getRouteWithEntityTypeAction($this->getResourceType())) + ); + $params = array( + 'api_type' => $this->getRequest()->getApiType(), + 'id' => $this->getRequest()->getParam('id'), + 'image' => $imageId + ); + $uri = $chain->assemble($params); + return '/' . $uri; + } +} diff --git a/app/code/core/Mage/Catalog/Model/Api2/Product/Image/Rest/Customer/V1.php b/app/code/core/Mage/Catalog/Model/Api2/Product/Image/Rest/Customer/V1.php new file mode 100644 index 0000000000..ce8d358139 --- /dev/null +++ b/app/code/core/Mage/Catalog/Model/Api2/Product/Image/Rest/Customer/V1.php @@ -0,0 +1,36 @@ + + */ +class Mage_Catalog_Model_Api2_Product_Image_Rest_Customer_V1 extends Mage_Catalog_Model_Api2_Product_Image_Rest +{ +} diff --git a/app/code/core/Mage/Catalog/Model/Api2/Product/Image/Rest/Guest/V1.php b/app/code/core/Mage/Catalog/Model/Api2/Product/Image/Rest/Guest/V1.php new file mode 100644 index 0000000000..c3e04f1ce6 --- /dev/null +++ b/app/code/core/Mage/Catalog/Model/Api2/Product/Image/Rest/Guest/V1.php @@ -0,0 +1,36 @@ + + */ +class Mage_Catalog_Model_Api2_Product_Image_Rest_Guest_V1 extends Mage_Catalog_Model_Api2_Product_Image_Rest +{ +} diff --git a/app/code/core/Mage/Catalog/Model/Api2/Product/Image/Validator/Image.php b/app/code/core/Mage/Catalog/Model/Api2/Product/Image/Validator/Image.php new file mode 100644 index 0000000000..50888dfd36 --- /dev/null +++ b/app/code/core/Mage/Catalog/Model/Api2/Product/Image/Validator/Image.php @@ -0,0 +1,53 @@ + + */ +class Mage_Catalog_Model_Api2_Product_Image_Validator_Image extends Mage_Api2_Model_Resource_Validator +{ + /** + * Validate data. In case of validation failure return false, + * getErrors() could be used to retrieve list of validation error messages + * + * @param array $data + * @return bool + */ + public function isValidData(array $data) + { + if (!isset($data['file_content']) || !isset($data['file_mime_type']) || empty($data['file_content']) || + empty($data['file_mime_type']) + ) { + $this->_addError('The image is not specified'); + } + + return !count($this->getErrors()); + } +} diff --git a/app/code/core/Mage/Catalog/Model/Api2/Product/Rest.php b/app/code/core/Mage/Catalog/Model/Api2/Product/Rest.php new file mode 100644 index 0000000000..3f7168d8f4 --- /dev/null +++ b/app/code/core/Mage/Catalog/Model/Api2/Product/Rest.php @@ -0,0 +1,400 @@ + + */ +abstract class Mage_Catalog_Model_Api2_Product_Rest extends Mage_Catalog_Model_Api2_Product +{ + /** + * Current loaded product + * + * @var Mage_Catalog_Model_Product + */ + protected $_product; + + /** + * Retrieve product data + * + * @return array + */ + protected function _retrieve() + { + $product = $this->_getProduct(); + + $this->_prepareProductForResponse($product); + return $product->getData(); + } + + /** + * Retrieve list of products + * + * @return array + */ + protected function _retrieveCollection() + { + /** @var $collection Mage_Catalog_Model_Resource_Product_Collection */ + $collection = Mage::getResourceModel('catalog/product_collection'); + $store = $this->_getStore(); + $entityOnlyAttributes = $this->getEntityOnlyAttributes($this->getUserType(), + Mage_Api2_Model_Resource::OPERATION_ATTRIBUTE_READ); + $availableAttributes = array_keys($this->getAvailableAttributes($this->getUserType(), + Mage_Api2_Model_Resource::OPERATION_ATTRIBUTE_READ)); + // available attributes not contain image attribute, but it needed for get image_url + $availableAttributes[] = 'image'; + $collection->addStoreFilter($store->getId()) + ->addPriceData($this->_getCustomerGroupId(), $store->getWebsiteId()) + ->addAttributeToSelect(array_diff($availableAttributes, $entityOnlyAttributes)) + ->addAttributeToFilter('visibility', array( + 'neq' => Mage_Catalog_Model_Product_Visibility::VISIBILITY_NOT_VISIBLE)) + ->addAttributeToFilter('status', array('eq' => Mage_Catalog_Model_Product_Status::STATUS_ENABLED)); + $this->_applyCategoryFilter($collection); + $this->_applyCollectionModifiers($collection); + $products = $collection->load(); + + /** @var Mage_Catalog_Model_Product $product */ + foreach ($products as $product) { + $this->_setProduct($product); + $this->_prepareProductForResponse($product); + } + return $products->toArray(); + } + + /** + * Apply filter by category id + * + * @param Mage_Catalog_Model_Resource_Product_Collection $collection + */ + protected function _applyCategoryFilter(Mage_Catalog_Model_Resource_Product_Collection $collection) + { + $categoryId = $this->getRequest()->getParam('category_id'); + if ($categoryId) { + $category = $this->_getCategoryById($categoryId); + if (!$category->getId()) { + $this->_critical('Category not found.', Mage_Api2_Model_Server::HTTP_BAD_REQUEST); + } + $collection->addCategoryFilter($category); + } + } + + /** + * Add special fields to product get response + * + * @param Mage_Catalog_Model_Product $product + */ + protected function _prepareProductForResponse(Mage_Catalog_Model_Product $product) + { + /** @var $productHelper Mage_Catalog_Helper_Product */ + $productHelper = Mage::helper('catalog/product'); + $productData = $product->getData(); + $product->setWebsiteId($this->_getStore()->getWebsiteId()); + // customer group is required in product for correct prices calculation + $product->setCustomerGroupId($this->_getCustomerGroupId()); + // calculate prices + $finalPrice = $product->getFinalPrice(); + $productData['regular_price_with_tax'] = $this->_applyTaxToPrice($product->getPrice(), true); + $productData['regular_price_without_tax'] = $this->_applyTaxToPrice($product->getPrice(), false); + $productData['final_price_with_tax'] = $this->_applyTaxToPrice($finalPrice, true); + $productData['final_price_without_tax'] = $this->_applyTaxToPrice($finalPrice, false); + + $productData['is_saleable'] = $product->getIsSalable(); + $productData['image_url'] = (string) Mage::helper('catalog/image')->init($product, 'image'); + + if ($this->getActionType() == self::ACTION_TYPE_ENTITY) { + // define URLs + $productData['url'] = $productHelper->getProductUrl($product->getId()); + /** @var $cartHelper Mage_Checkout_Helper_Cart */ + $cartHelper = Mage::helper('checkout/cart'); + $productData['buy_now_url'] = $cartHelper->getAddUrl($product); + + /** @var $stockItem Mage_CatalogInventory_Model_Stock_Item */ + $stockItem = $product->getStockItem(); + if (!$stockItem) { + $stockItem = Mage::getModel('cataloginventory/stock_item'); + $stockItem->loadByProduct($product); + } + $productData['is_in_stock'] = $stockItem->getIsInStock(); + + /** @var $reviewModel Mage_Review_Model_Review */ + $reviewModel = Mage::getModel('review/review'); + $productData['total_reviews_count'] = $reviewModel->getTotalReviews($product->getId(), true, + $this->_getStore()->getId()); + + $productData['tier_price'] = $this->_getTierPrices(); + $productData['has_custom_options'] = count($product->getOptions()) > 0; + } else { + // remove tier price from response + $product->unsetData('tier_price'); + unset($productData['tier_price']); + } + $product->addData($productData); + } + + /** + * Product create only available for admin + * + * @param array $data + */ + protected function _create(array $data) + { + $this->_critical(self::RESOURCE_METHOD_NOT_ALLOWED); + } + + /** + * Product update only available for admin + * + * @param array $data + */ + protected function _update(array $data) + { + $this->_critical(self::RESOURCE_METHOD_NOT_ALLOWED); + } + + /** + * Product delete only available for admin + */ + protected function _delete() + { + $this->_critical(self::RESOURCE_METHOD_NOT_ALLOWED); + } + + /** + * Load product by its SKU or ID provided in request + * + * @return Mage_Catalog_Model_Product + */ + protected function _getProduct() + { + if (is_null($this->_product)) { + $productId = $this->getRequest()->getParam('id'); + /** @var $productHelper Mage_Catalog_Helper_Product */ + $productHelper = Mage::helper('catalog/product'); + $product = $productHelper->getProduct($productId, $this->_getStore()->getId()); + if (!($product->getId())) { + $this->_critical(self::RESOURCE_NOT_FOUND); + } + // check if product belongs to website current + if ($this->getRequest()->getParam('store')) { + $isValidWebsite = in_array($this->_getStore()->getWebsiteId(), $product->getWebsiteIds()); + if (!$isValidWebsite) { + $this->_critical(self::RESOURCE_NOT_FOUND); + } + } + // Check display settings for customers & guests + if ($this->getApiUser()->getType() != Mage_Api2_Model_Auth_User_Admin::USER_TYPE) { + // check if product assigned to any website and can be shown + if ((!Mage::app()->isSingleStoreMode() && !count($product->getWebsiteIds())) + || !$productHelper->canShow($product)) { + $this->_critical(self::RESOURCE_NOT_FOUND); + } + } + $this->_product = $product; + } + return $this->_product; + } + + /** + * Set product + * + * @param Mage_Catalog_Model_Product $product + */ + protected function _setProduct(Mage_Catalog_Model_Product $product) + { + $this->_product = $product; + } + + /** + * Load category by id + * + * @param int $categoryId + * @return Mage_Catalog_Model_Category + */ + protected function _getCategoryById($categoryId) + { + return Mage::getModel('catalog/category')->load($categoryId); + } + + /** + * Get product price with all tax settings processing + * + * @param float $price inputed product price + * @param bool $includingTax return price include tax flag + * @param null|Mage_Customer_Model_Address $shippingAddress + * @param null|Mage_Customer_Model_Address $billingAddress + * @param null|int $ctc customer tax class + * @param bool $priceIncludesTax flag that price parameter contain tax + * @return float + * @see Mage_Tax_Helper_Data::getPrice() + */ + protected function _getPrice($price, $includingTax = null, $shippingAddress = null, + $billingAddress = null, $ctc = null, $priceIncludesTax = null + ) { + $product = $this->_getProduct(); + $store = $this->_getStore(); + + if (is_null($priceIncludesTax)) { + /** @var $config Mage_Tax_Model_Config */ + $config = Mage::getSingleton('tax/config'); + $priceIncludesTax = $config->priceIncludesTax($store) || $config->getNeedUseShippingExcludeTax(); + } + + $percent = $product->getTaxPercent(); + $includingPercent = null; + + $taxClassId = $product->getTaxClassId(); + if (is_null($percent)) { + if ($taxClassId) { + $request = Mage::getSingleton('tax/calculation') + ->getRateRequest($shippingAddress, $billingAddress, $ctc, $store); + $percent = Mage::getSingleton('tax/calculation')->getRate($request->setProductClassId($taxClassId)); + } + } + if ($taxClassId && $priceIncludesTax) { + $request = Mage::getSingleton('tax/calculation')->getRateRequest(false, false, false, $store); + $includingPercent = Mage::getSingleton('tax/calculation') + ->getRate($request->setProductClassId($taxClassId)); + } + + if ($percent === false || is_null($percent)) { + if ($priceIncludesTax && !$includingPercent) { + return $price; + } + } + $product->setTaxPercent($percent); + + if (!is_null($includingTax)) { + if ($priceIncludesTax) { + if ($includingTax) { + /** + * Recalculate price include tax in case of different rates + */ + if ($includingPercent != $percent) { + $price = $this->_calculatePrice($price, $includingPercent, false); + /** + * Using regular rounding. Ex: + * price incl tax = 52.76 + * store tax rate = 19.6% + * customer tax rate= 19% + * + * price excl tax = 52.76 / 1.196 = 44.11371237 ~ 44.11 + * tax = 44.11371237 * 0.19 = 8.381605351 ~ 8.38 + * price incl tax = 52.49531773 ~ 52.50 != 52.49 + * + * that why we need round prices excluding tax before applying tax + * this calculation is used for showing prices on catalog pages + */ + if ($percent != 0) { + $price = Mage::getSingleton('tax/calculation')->round($price); + $price = $this->_calculatePrice($price, $percent, true); + } + } + } else { + $price = $this->_calculatePrice($price, $includingPercent, false); + } + } else { + if ($includingTax) { + $price = $this->_calculatePrice($price, $percent, true); + } + } + } else { + if ($priceIncludesTax) { + if ($includingTax) { + $price = $this->_calculatePrice($price, $includingPercent, false); + $price = $this->_calculatePrice($price, $percent, true); + } else { + $price = $this->_calculatePrice($price, $includingPercent, false); + } + } else { + if ($includingTax) { + $price = $this->_calculatePrice($price, $percent, true); + } + } + } + + return $store->roundPrice($price); + } + + /** + * Calculate price imcluding/excluding tax base on tax rate percent + * + * @param float $price + * @param float $percent + * @param bool $includeTax true - for calculate price including tax and false if price excluding tax + * @return float + */ + protected function _calculatePrice($price, $percent, $includeTax) + { + /** @var $calculator Mage_Tax_Model_Calculation */ + $calculator = Mage::getSingleton('tax/calculation'); + $taxAmount = $calculator->calcTaxAmount($price, $percent, !$includeTax, false); + + return $includeTax ? $price + $taxAmount : $price - $taxAmount; + } + + /** + * Retrive tier prices in special format + * + * @return array + */ + protected function _getTierPrices() + { + $tierPrices = array(); + foreach ($this->_getProduct()->getTierPrice() as $tierPrice) { + $tierPrices[] = array( + 'qty' => $tierPrice['price_qty'], + 'price_with_tax' => $this->_applyTaxToPrice($tierPrice['price']), + 'price_without_tax' => $this->_applyTaxToPrice($tierPrice['price'], false) + ); + } + return $tierPrices; + } + + /** + * Default implementation. May be different for customer/guest/admin role. + * + * @return null + */ + protected function _getCustomerGroupId() + { + return null; + } + + /** + * Default implementation. May be different for customer/guest/admin role. + * + * @param float $price + * @param bool $withTax + * @return float + */ + protected function _applyTaxToPrice($price, $withTax = true) + { + return $price; + } +} diff --git a/app/code/core/Mage/Catalog/Model/Api2/Product/Rest/Admin/V1.php b/app/code/core/Mage/Catalog/Model/Api2/Product/Rest/Admin/V1.php new file mode 100644 index 0000000000..8d2dffa3b4 --- /dev/null +++ b/app/code/core/Mage/Catalog/Model/Api2/Product/Rest/Admin/V1.php @@ -0,0 +1,383 @@ + + */ +class Mage_Catalog_Model_Api2_Product_Rest_Admin_V1 extends Mage_Catalog_Model_Api2_Product_Rest +{ + /** + * The greatest decimal value which could be stored. Corresponds to DECIMAL (12,4) SQL type + */ + const MAX_DECIMAL_VALUE = 99999999.9999; + + /** + * Add special fields to product get response + * + * @param Mage_Catalog_Model_Product $product + */ + protected function _prepareProductForResponse(Mage_Catalog_Model_Product $product) + { + $pricesFilterKeys = array('price_id', 'all_groups', 'website_price'); + $groupPrice = $product->getData('group_price'); + $product->setData('group_price', $this->_filterOutArrayKeys($groupPrice, $pricesFilterKeys, true)); + $tierPrice = $product->getData('tier_price'); + $product->setData('tier_price', $this->_filterOutArrayKeys($tierPrice, $pricesFilterKeys, true)); + + $stockData = $product->getStockItem()->getData(); + $stockDataFilterKeys = array('item_id', 'product_id', 'stock_id', 'low_stock_date', 'type_id', + 'stock_status_changed_auto', 'stock_status_changed_automatically', 'product_name', 'store_id', + 'product_type_id', 'product_status_changed', 'product_changed_websites', + 'use_config_enable_qty_increments'); + $product->setData('stock_data', $this->_filterOutArrayKeys($stockData, $stockDataFilterKeys)); + $product->setData('product_type_name', $product->getTypeId()); + } + + /** + * Remove specified keys from associative or indexed array + * + * @param array $array + * @param array $keys + * @param bool $dropOrigKeys if true - return array as indexed array + * @return array + */ + protected function _filterOutArrayKeys(array $array, array $keys, $dropOrigKeys = false) + { + $isIndexedArray = is_array(reset($array)); + if ($isIndexedArray) { + foreach ($array as &$value) { + if (is_array($value)) { + $value = array_diff_key($value, array_flip($keys)); + } + } + if ($dropOrigKeys) { + $array = array_values($array); + } + unset($value); + } else { + $array = array_diff_key($array, array_flip($keys)); + } + + return $array; + } + + /** + * Retrieve list of products + * + * @return array + */ + protected function _retrieveCollection() + { + /** @var $collection Mage_Catalog_Model_Resource_Product_Collection */ + $collection = Mage::getResourceModel('catalog/product_collection'); + $store = $this->_getStore(); + $collection->setStoreId($store->getId()); + $collection->addAttributeToSelect(array_keys( + $this->getAvailableAttributes($this->getUserType(), Mage_Api2_Model_Resource::OPERATION_ATTRIBUTE_READ) + )); + $this->_applyCategoryFilter($collection); + $this->_applyCollectionModifiers($collection); + $products = $collection->load()->toArray(); + return $products; + } + + /** + * Delete product by its ID + * + * @throws Mage_Api2_Exception + */ + protected function _delete() + { + $product = $this->_getProduct(); + try { + $product->delete(); + } catch (Mage_Core_Exception $e) { + $this->_critical($e->getMessage(), Mage_Api2_Model_Server::HTTP_INTERNAL_ERROR); + } catch (Exception $e) { + $this->_critical(self::RESOURCE_INTERNAL_ERROR); + } + } + + /** + * Create product + * + * @param array $data + * @return string + */ + protected function _create(array $data) + { + /* @var $validator Mage_Catalog_Model_Api2_Product_Validator_Product */ + $validator = Mage::getModel('catalog/api2_product_validator_product', array( + 'operation' => self::OPERATION_CREATE + )); + + if (!$validator->isValidData($data)) { + foreach ($validator->getErrors() as $error) { + $this->_error($error, Mage_Api2_Model_Server::HTTP_BAD_REQUEST); + } + $this->_critical(self::RESOURCE_DATA_PRE_VALIDATION_ERROR); + } + + $type = $data['type_id']; + if ($type !== 'simple') { + $this->_critical("Creation of products with type '$type' is not implemented", + Mage_Api2_Model_Server::HTTP_METHOD_NOT_ALLOWED); + } + $set = $data['attribute_set_id']; + $sku = $data['sku']; + + /** @var $product Mage_Catalog_Model_Product */ + $product = Mage::getModel('catalog/product') + ->setStoreId(Mage_Catalog_Model_Abstract::DEFAULT_STORE_ID) + ->setAttributeSetId($set) + ->setTypeId($type) + ->setSku($sku); + + $this->_prepareDataForSave($product, $data); + try { + $product->validate(); + $product->save(); + $this->_multicall($product->getId()); + } catch (Mage_Eav_Model_Entity_Attribute_Exception $e) { + $this->_critical(sprintf('Invalid attribute "%s": %s', $e->getAttributeCode(), $e->getMessage()), + Mage_Api2_Model_Server::HTTP_BAD_REQUEST); + } catch (Mage_Core_Exception $e) { + $this->_critical($e->getMessage(), Mage_Api2_Model_Server::HTTP_INTERNAL_ERROR); + } catch (Exception $e) { + $this->_critical(self::RESOURCE_UNKNOWN_ERROR); + } + + return $this->_getLocation($product); + } + + /** + * Update product by its ID + * + * @param array $data + */ + protected function _update(array $data) + { + /** @var $product Mage_Catalog_Model_Product */ + $product = $this->_getProduct(); + /* @var $validator Mage_Catalog_Model_Api2_Product_Validator_Product */ + $validator = Mage::getModel('catalog/api2_product_validator_product', array( + 'operation' => self::OPERATION_UPDATE, + 'product' => $product + )); + + if (!$validator->isValidData($data)) { + foreach ($validator->getErrors() as $error) { + $this->_error($error, Mage_Api2_Model_Server::HTTP_BAD_REQUEST); + } + $this->_critical(self::RESOURCE_DATA_PRE_VALIDATION_ERROR); + } + if (isset($data['sku'])) { + $product->setSku($data['sku']); + } + $this->_prepareDataForSave($product, $data); + try { + $product->validate(); + $product->save(); + } catch (Mage_Eav_Model_Entity_Attribute_Exception $e) { + $this->_critical(sprintf('Invalid attribute "%s": %s', $e->getAttributeCode(), $e->getMessage()), + Mage_Api2_Model_Server::HTTP_BAD_REQUEST); + } catch (Mage_Core_Exception $e) { + $this->_critical($e->getMessage(), Mage_Api2_Model_Server::HTTP_INTERNAL_ERROR); + } catch (Exception $e) { + $this->_critical(self::RESOURCE_UNKNOWN_ERROR); + } + } + + /** + * Determine if stock management is enabled + * + * @param array $stockData + * @return bool + */ + protected function _isManageStockEnabled($stockData) + { + if (!(isset($stockData['use_config_manage_stock']) && $stockData['use_config_manage_stock'])) { + $manageStock = isset($stockData['manage_stock']) && $stockData['manage_stock']; + } else { + $manageStock = Mage::getStoreConfig( + Mage_CatalogInventory_Model_Stock_Item::XML_PATH_ITEM . 'manage_stock'); + } + return (bool) $manageStock; + } + + /** + * Check if value from config is used + * + * @param array $data + * @param string $field + * @return bool + */ + protected function _isConfigValueUsed($data, $field) + { + return isset($data["use_config_$field"]) && $data["use_config_$field"]; + } + + /** + * Set additional data before product save + * + * @param Mage_Catalog_Model_Product $product + * @param array $productData + */ + protected function _prepareDataForSave($product, $productData) + { + if (isset($productData['stock_data'])) { + if (!$product->isObjectNew() && !isset($productData['stock_data']['manage_stock'])) { + $productData['stock_data']['manage_stock'] = $product->getStockItem()->getManageStock(); + } + $this->_filterStockData($productData['stock_data']); + } else { + $productData['stock_data'] = array( + 'use_config_manage_stock' => 1, + 'use_config_min_sale_qty' => 1, + 'use_config_max_sale_qty' => 1, + ); + } + $product->setStockData($productData['stock_data']); + // save gift options + $this->_filterConfigValueUsed($productData, array('gift_message_available', 'gift_wrapping_available')); + if (isset($productData['use_config_gift_message_available'])) { + $product->setData('use_config_gift_message_available', $productData['use_config_gift_message_available']); + if (!$productData['use_config_gift_message_available'] + && ($product->getData('gift_message_available') === null)) { + $product->setData('gift_message_available', (int) Mage::getStoreConfig( + Mage_GiftMessage_Helper_Message::XPATH_CONFIG_GIFT_MESSAGE_ALLOW_ITEMS, $product->getStoreId())); + } + } + if (isset($productData['use_config_gift_wrapping_available'])) { + $product->setData('use_config_gift_wrapping_available', + $productData['use_config_gift_wrapping_available']); + if (!$productData['use_config_gift_wrapping_available'] + && ($product->getData('gift_wrapping_available') === null) + ) { + $product->setData('gift_wrapping_available', (int) Mage::getStoreConfig( + Enterprise_GiftWrapping_Helper_Data::XML_PATH_ALLOWED_FOR_ITEMS, $product->getStoreId())); + } + } + + if (isset($productData['website_ids']) && is_array($productData['website_ids'])) { + $product->setWebsiteIds($productData['website_ids']); + } + // Create Permanent Redirect for old URL key + if (!$product->isObjectNew() && isset($productData['url_key']) + && isset($productData['url_key_create_redirect']) + ) { + $product->setData('save_rewrites_history', (bool)$productData['url_key_create_redirect']); + } + /** @var $attribute Mage_Catalog_Model_Resource_Eav_Attribute */ + foreach ($product->getTypeInstance(true)->getEditableAttributes($product) as $attribute) { + //Unset data if object attribute has no value in current store + if (Mage_Catalog_Model_Abstract::DEFAULT_STORE_ID !== (int)$product->getStoreId() + && !$product->getExistsStoreValueFlag($attribute->getAttributeCode()) + && !$attribute->isScopeGlobal() + ) { + $product->setData($attribute->getAttributeCode(), false); + } + + if ($this->_isAllowedAttribute($attribute)) { + if (isset($productData[$attribute->getAttributeCode()])) { + $product->setData( + $attribute->getAttributeCode(), + $productData[$attribute->getAttributeCode()] + ); + } + } + } + } + + /** + * Filter stock data values + * + * @param array $stockData + */ + protected function _filterStockData(&$stockData) + { + $fieldsWithPossibleDefautlValuesInConfig = array('manage_stock', 'min_sale_qty', 'max_sale_qty', 'backorders', + 'qty_increments', 'notify_stock_qty', 'min_qty', 'enable_qty_increments'); + $this->_filterConfigValueUsed($stockData, $fieldsWithPossibleDefautlValuesInConfig); + + if ($this->_isManageStockEnabled($stockData)) { + if (isset($stockData['qty']) && (float)$stockData['qty'] > self::MAX_DECIMAL_VALUE) { + $stockData['qty'] = self::MAX_DECIMAL_VALUE; + } + if (isset($stockData['min_qty']) && (int)$stockData['min_qty'] < 0) { + $stockData['min_qty'] = 0; + } + if (!isset($stockData['is_decimal_divided']) || $stockData['is_qty_decimal'] == 0) { + $stockData['is_decimal_divided'] = 0; + } + } else { + $nonManageStockFields = array('manage_stock', 'use_config_manage_stock', 'min_sale_qty', + 'use_config_min_sale_qty', 'max_sale_qty', 'use_config_max_sale_qty'); + foreach ($stockData as $field => $value) { + if (!in_array($field, $nonManageStockFields)) { + unset($stockData[$field]); + } + } + } + } + + /** + * Filter out fields if Use Config Settings option used + * + * @param array $data + * @param string $fields + */ + protected function _filterConfigValueUsed(&$data, $fields) { + foreach($fields as $field) { + if ($this->_isConfigValueUsed($data, $field)) { + unset($data[$field]); + } + } + } + + /** + * Check if attribute is allowed + * + * @param Mage_Eav_Model_Entity_Attribute_Abstract $attribute + * @param array $attributes + * @return boolean + */ + protected function _isAllowedAttribute($attribute, $attributes = null) + { + $isAllowed = true; + if (is_array($attributes) + && !(in_array($attribute->getAttributeCode(), $attributes) + || in_array($attribute->getAttributeId(), $attributes)) + ) { + $isAllowed = false; + } + return $isAllowed; + } +} diff --git a/app/code/core/Mage/Catalog/Model/Api2/Product/Rest/Customer/V1.php b/app/code/core/Mage/Catalog/Model/Api2/Product/Rest/Customer/V1.php new file mode 100644 index 0000000000..aa9eebaaa4 --- /dev/null +++ b/app/code/core/Mage/Catalog/Model/Api2/Product/Rest/Customer/V1.php @@ -0,0 +1,90 @@ + + */ +class Mage_Catalog_Model_Api2_Product_Rest_Customer_V1 extends Mage_Catalog_Model_Api2_Product_Rest +{ + /** + * Current logged in customer + * + * @var Mage_Customer_Model_Customer + */ + protected $_customer; + + /** + * Get customer group + * + * @return int + */ + protected function _getCustomerGroupId() + { + return $this->_getCustomer()->getGroupId(); + } + + /** + * Define product price with or without taxes + * + * @param float $price + * @param bool $withTax + * @return float + */ + protected function _applyTaxToPrice($price, $withTax = true) + { + $customer = $this->_getCustomer(); + /** @var $session Mage_Customer_Model_Session */ + $session = Mage::getSingleton('customer/session'); + $session->setCustomerId($customer->getId()); + $price = $this->_getPrice($price, $withTax, $customer->getPrimaryShippingAddress(), + $customer->getPrimaryBillingAddress(), $customer->getTaxClassId()); + $session->setCustomerId(null); + + return $price; + } + + /** + * Retrieve current customer + * + * @return Mage_Customer_Model_Customer + */ + protected function _getCustomer() + { + if (is_null($this->_customer)) { + /** @var $customer Mage_Customer_Model_Customer */ + $customer = Mage::getModel('customer/customer')->load($this->getApiUser()->getUserId()); + if (!$customer->getId()) { + $this->_critical('Customer not found.', Mage_Api2_Model_Server::HTTP_INTERNAL_ERROR); + } + $this->_customer = $customer; + } + return $this->_customer; + } +} diff --git a/app/code/core/Mage/Catalog/Model/Api2/Product/Rest/Guest/V1.php b/app/code/core/Mage/Catalog/Model/Api2/Product/Rest/Guest/V1.php new file mode 100644 index 0000000000..91fae6e035 --- /dev/null +++ b/app/code/core/Mage/Catalog/Model/Api2/Product/Rest/Guest/V1.php @@ -0,0 +1,57 @@ + + */ +class Mage_Catalog_Model_Api2_Product_Rest_Guest_V1 extends Mage_Catalog_Model_Api2_Product_Rest +{ + /** + * Get customer group + * + * @return int + */ + protected function _getCustomerGroupId() + { + return Mage_Customer_Model_Group::NOT_LOGGED_IN_ID; + } + + /** + * Define product price with or without taxes + * + * @param float $price + * @param bool $withTax + * @return float + */ + protected function _applyTaxToPrice($price, $withTax = true) + { + return $this->_getPrice($price, $withTax); + } +} diff --git a/app/code/core/Mage/Catalog/Model/Api2/Product/Validator/Product.php b/app/code/core/Mage/Catalog/Model/Api2/Product/Validator/Product.php new file mode 100644 index 0000000000..3dbbcd67ba --- /dev/null +++ b/app/code/core/Mage/Catalog/Model/Api2/Product/Validator/Product.php @@ -0,0 +1,600 @@ + + */ +class Mage_Catalog_Model_Api2_Product_Validator_Product extends Mage_Api2_Model_Resource_Validator +{ + /** + * The greatest decimal value which could be stored. Corresponds to DECIMAL (12,4) SQL type + */ + const MAX_DECIMAL_VALUE = 99999999.9999; + + /** + * Validator product + * + * @var Mage_Catalog_Model_Product + */ + protected $_product = null; + + /** + * Validation operation + * + * @var string + */ + protected $_operation = null; + + public function __construct($options) + { + if (isset($options['product'])) { + if ($options['product'] instanceof Mage_Catalog_Model_Product) { + $this->_product = $options['product']; + } else { + throw new Exception("Passed parameter 'product' is wrong."); + } + } + + if (!isset($options['operation']) || empty($options['operation'])) { + throw new Exception("Passed parameter 'operation' is empty."); + } + $this->_operation = $options['operation']; + } + + /** + * Get validator product + * + * @return Mage_Catalog_Model_Product|null + */ + protected function _getProduct() + { + return $this->_product; + } + + /** + * Is update mode + * + * @return bool + */ + protected function _isUpdate() + { + return $this->_operation == Mage_Api2_Model_Resource::OPERATION_UPDATE; + } + + /** + * Validate product data + * + * @param array $data + * @return bool + */ + public function isValidData(array $data) + { + if ($this->_isUpdate()) { + $product = $this->_getProduct(); + if (!is_null($product) && $product->getId()) { + $data['attribute_set_id'] = $product->getAttributeSetId(); + $data['type_id'] = $product->getTypeId(); + } + } + + try { + $this->_validateProductType($data); + /** @var $productEntity Mage_Eav_Model_Entity_Type */ + $productEntity = Mage::getModel('eav/entity_type')->loadByCode(Mage_Catalog_Model_Product::ENTITY); + $this->_validateAttributeSet($data, $productEntity); + $this->_validateSku($data); + $this->_validateGiftOptions($data); + $this->_validateGroupPrice($data); + $this->_validateTierPrice($data); + $this->_validateStockData($data); + $this->_validateAttributes($data, $productEntity); + $isSatisfied = count($this->getErrors()) == 0; + } catch (Mage_Api2_Exception $e) { + $this->_addError($e->getMessage()); + $isSatisfied = false; + } + + + return $isSatisfied; + } + + /** + * Collect required EAV attributes, validate applicable attributes and validate source attributes values + * + * @param array $data + * @param Mage_Eav_Model_Entity_Type $productEntity + * @return array + */ + protected function _validateAttributes($data, $productEntity) + { + if (!isset($data['attribute_set_id']) || empty($data['attribute_set_id'])) { + $this->_critical('Missing "attribute_set_id" in request.', Mage_Api2_Model_Server::HTTP_BAD_REQUEST); + } + if (!isset($data['type_id']) || empty($data['type_id'])) { + $this->_critical('Missing "type_id" in request.', Mage_Api2_Model_Server::HTTP_BAD_REQUEST); + } + // Validate weight + if (isset($data['weight']) && !empty($data['weight']) && $data['weight'] > 0 + && !Zend_Validate::is($data['weight'], 'Between', array(0, self::MAX_DECIMAL_VALUE))) { + $this->_addError('The "weight" value is not within the specified range.'); + } + // msrp_display_actual_price_type attribute values needs to be a string to pass validation + // see Mage_Catalog_Model_Product_Attribute_Source_Msrp_Type_Price::getAllOptions() + if (isset($data['msrp_display_actual_price_type'])) { + $data['msrp_display_actual_price_type'] = (string) $data['msrp_display_actual_price_type']; + } + $requiredAttributes = array('attribute_set_id'); + $positiveNumberAttributes = array('weight', 'price', 'special_price', 'msrp'); + /** @var $attribute Mage_Catalog_Model_Resource_Eav_Attribute */ + foreach ($productEntity->getAttributeCollection($data['attribute_set_id']) as $attribute) { + $attributeCode = $attribute->getAttributeCode(); + $value = false; + $isSet = false; + if (isset($data[$attribute->getAttributeCode()])) { + $value = $data[$attribute->getAttributeCode()]; + $isSet = true; + } + $applicable = false; + if (!$attribute->getApplyTo() || in_array($data['type_id'], $attribute->getApplyTo())) { + $applicable = true; + } + + if (!$applicable && !$attribute->isStatic() && $isSet) { + $productTypes = Mage_Catalog_Model_Product_Type::getTypes(); + $this->_addError(sprintf('Attribute "%s" is not applicable for product type "%s"', $attributeCode, + $productTypes[$data['type_id']]['label'])); + } + + if ($applicable && $isSet) { + // Validate dropdown attributes + if ($attribute->usesSource() + // skip check when field will be validated later as a required one + && !(empty($value) && $attribute->getIsRequired())) { + $allowedValues = $this->_getAttributeAllowedValues($attribute->getSource()->getAllOptions()); + $useStrictMode = !is_numeric($value); + if (!in_array($value, $allowedValues, $useStrictMode) + && !$this->_isConfigValueUsed($data, $attributeCode)) { + $this->_addError(sprintf('Invalid value for attribute "%s".', $attributeCode)); + } + } + // Validate datetime attributes + if ($attribute->getBackendType() == 'datetime') { + try { + $attribute->getBackend()->formatDate($value); + } catch (Zend_Date_Exception $e) { + $this->_addError(sprintf('Invalid date in the "%s" field.', $attributeCode)); + } + } + // Validate positive number required attributes + if (in_array($attributeCode, $positiveNumberAttributes) && (!empty($value) && $value !== 0) + && (!is_numeric($value) || $value < 0) + ) { + $this->_addError(sprintf('Please enter a number 0 or greater in the "%s" field.', $attributeCode)); + } + } + + if ($applicable && $attribute->getIsRequired() && $attribute->getIsVisible()) { + if (!in_array($attributeCode, $positiveNumberAttributes) || $value !== 0) { + $requiredAttributes[] = $attribute->getAttributeCode(); + } + } + } + + foreach ($requiredAttributes as $key) { + if (!array_key_exists($key, $data)) { + if (!$this->_isUpdate()) { + $this->_addError(sprintf('Missing "%s" in request.', $key)); + continue; + } + } else if (!is_numeric($data[$key]) && empty($data[$key])) { + $this->_addError(sprintf('Empty value for "%s" in request.', $key)); + } + } + } + + /** + * Validate product type + * + * @param array $data + * @return bool + */ + protected function _validateProductType($data) + { + if ($this->_isUpdate()) { + return true; + } + if (!isset($data['type_id']) || empty($data['type_id'])) { + $this->_critical('Missing "type_id" in request.', Mage_Api2_Model_Server::HTTP_BAD_REQUEST); + } + if (!array_key_exists($data['type_id'], Mage_Catalog_Model_Product_Type::getTypes())) { + $this->_critical('Invalid product type.', Mage_Api2_Model_Server::HTTP_BAD_REQUEST); + } + } + + /** + * Validate attribute set + * + * @param array $data + * @param Mage_Eav_Model_Entity_Type $productEntity + * @return bool + */ + protected function _validateAttributeSet($data, $productEntity) + { + if ($this->_isUpdate()) { + return true; + } + if (!isset($data['attribute_set_id']) || empty($data['attribute_set_id'])) { + $this->_critical('Missing "attribute_set_id" in request.', Mage_Api2_Model_Server::HTTP_BAD_REQUEST); + } + /** @var $attributeSet Mage_Eav_Model_Entity_Attribute_Set */ + $attributeSet = Mage::getModel('eav/entity_attribute_set')->load($data['attribute_set_id']); + if (!$attributeSet->getId() || $productEntity->getEntityTypeId() != $attributeSet->getEntityTypeId()) { + $this->_critical('Invalid attribute set.', Mage_Api2_Model_Server::HTTP_BAD_REQUEST); + } + } + + /** + * Validate SKU + * + * @param array $data + * @return bool + */ + protected function _validateSku($data) + { + if ($this->_isUpdate() && !isset($data['sku'])) { + return true; + } + if (!Zend_Validate::is((string)$data['sku'], 'StringLength', array('min' => 0, 'max' => 64))) { + $this->_addError('SKU length should be 64 characters maximum.'); + } + } + + /** + * Validate product gift options data + * + * @param array $data + */ + protected function _validateGiftOptions($data) + { + if (isset($data['gift_wrapping_price'])) { + if (!(is_numeric($data['gift_wrapping_price']) && $data['gift_wrapping_price'] >= 0)) { + $this->_addError('Please enter a number 0 or greater in the "gift_wrapping_price" field.'); + } + } + } + + /** + * Validate Group Price complex attribute + * + * @param array $data + */ + protected function _validateGroupPrice($data) + { + if (isset($data['group_price']) && is_array($data['group_price'])) { + $groupPrices = $data['group_price']; + foreach ($groupPrices as $index => $groupPrice) { + $fieldSet = 'group_price:' . $index; + $this->_validateWebsiteIdForGroupPrice($groupPrice, $fieldSet); + $this->_validateCustomerGroup($groupPrice, $fieldSet); + $this->_validatePositiveNumber($groupPrice, $fieldSet, 'price', true, true); + } + } + } + + /** + * Validate Tier Price complex attribute + * + * @param array $data + */ + protected function _validateTierPrice($data) + { + if (isset($data['tier_price']) && is_array($data['tier_price'])) { + $tierPrices = $data['tier_price']; + foreach ($tierPrices as $index => $tierPrice) { + $fieldSet = 'tier_price:' . $index; + $this->_validateWebsiteIdForGroupPrice($tierPrice, $fieldSet); + $this->_validateCustomerGroup($tierPrice, $fieldSet); + $this->_validatePositiveNumber($tierPrice, $fieldSet, 'price_qty'); + $this->_validatePositiveNumber($tierPrice, $fieldSet, 'price'); + } + } + } + + /** + * Check if website id is appropriate according to price scope settings + * + * @param array $data + * @param string $fieldSet + */ + protected function _validateWebsiteIdForGroupPrice($data, $fieldSet) + { + if (!isset($data['website_id'])) { + $this->_addError(sprintf('The "website_id" value in the "%s" set is a required field.', $fieldSet)); + } else { + /** @var $catalogHelper Mage_Catalog_Helper_Data */ + $catalogHelper = Mage::helper('catalog'); + $website = Mage::getModel('core/website')->load($data['website_id']); + if (is_null($website->getId()) || ($data['website_id'] !== 0 + && $catalogHelper->getPriceScope() == Mage_Catalog_Helper_Data::PRICE_SCOPE_GLOBAL)) { + $this->_addError(sprintf('Invalid "website_id" value in the "%s" set.', $fieldSet)); + } + } + } + + /** + * Validate product inventory data + * + * @param array $data + */ + protected function _validateStockData($data) + { + if (isset($data['stock_data']) && is_array($data['stock_data'])) { + $stockData = $data['stock_data']; + $fieldSet = 'stock_data'; + if (!(isset($stockData['use_config_manage_stock']) && $stockData['use_config_manage_stock'])) { + $this->_validateBoolean($stockData, $fieldSet, 'manage_stock'); + } + if ($this->_isManageStockEnabled($stockData)) { + $this->_validateNumeric($stockData, $fieldSet, 'qty'); + $this->_validatePositiveNumber($stockData, $fieldSet, 'min_qty', false, true, true); + $this->_validateNumeric($stockData, $fieldSet, 'notify_stock_qty', false, true); + $this->_validateBoolean($stockData, $fieldSet, 'is_qty_decimal'); + if (isset($stockData['is_qty_decimal']) && (bool) $stockData['is_qty_decimal'] == true) { + $this->_validateBoolean($stockData, $fieldSet, 'is_decimal_divided'); + } + $this->_validateBoolean($stockData, $fieldSet, 'enable_qty_increments', true); + if (isset($stockData['enable_qty_increments']) && (bool) $stockData['enable_qty_increments'] == true) { + $this->_validatePositiveInteger($stockData, $fieldSet, 'qty_increments', false, true); + } + if (Mage::helper('catalog')->isModuleEnabled('Mage_CatalogInventory')) { + $this->_validateSource($stockData, $fieldSet, 'backorders', + 'cataloginventory/source_backorders', true); + $this->_validateSource($stockData, $fieldSet, 'is_in_stock', 'cataloginventory/source_stock'); + } + } + + $this->_validatePositiveInteger($stockData, $fieldSet, 'min_sale_qty', false, true); + $this->_validatePositiveInteger($stockData, $fieldSet, 'max_sale_qty', false, true); + } + } + + /** + * Determine if stock management is enabled + * + * @param array $stockData + * @return bool + */ + protected function _isManageStockEnabled($stockData) + { + if (!(isset($stockData['use_config_manage_stock']) && $stockData['use_config_manage_stock'])) { + $manageStock = isset($stockData['manage_stock']) && $stockData['manage_stock']; + } else { + $manageStock = Mage::getStoreConfig( + Mage_CatalogInventory_Model_Stock_Item::XML_PATH_ITEM . 'manage_stock'); + } + return (bool) $manageStock; + } + + /** + * Validate Customer Group field + * + * @param string $fieldSet + * @param array $data + */ + protected function _validateCustomerGroup($data, $fieldSet) + { + if (!isset($data['cust_group'])) { + $this->_addError(sprintf('The "cust_group" value in the "%s" set is a required field.', $fieldSet)); + } else { + if (!is_numeric($data['cust_group'])) { + $this->_addError(sprintf('Invalid "cust_group" value in the "%s" set', $fieldSet)); + } else { + $customerGroup = Mage::getModel('customer/group')->load($data['cust_group']); + if (is_null($customerGroup->getId())) { + $this->_addError(sprintf('Invalid "cust_group" value in the "%s" set', $fieldSet)); + } + } + } + } + + /** + * Validate field to be positive number + * + * @param array $data + * @param string $fieldSet + * @param string $field + * @param bool $required + * @param bool $equalsZero + * @param bool $skipIfConfigValueUsed + */ + protected function _validatePositiveNumber($data, $fieldSet, $field, $required = true, $equalsZero = false, + $skipIfConfigValueUsed = false) + { + // in case when 'Use Config Settings' is selected no validation needed + if (!($skipIfConfigValueUsed && $this->_isConfigValueUsed($data, $field))) { + if (!isset($data[$field]) && $required) { + $this->_addError(sprintf('The "%s" value in the "%s" set is a required field.', $field, $fieldSet)); + } + + if (isset($data[$field])) { + $isValid = $equalsZero ? $data[$field] >= 0 : $data[$field] > 0; + if (!(is_numeric($data[$field]) && $isValid)) { + $message = $equalsZero + ? 'Please enter a number 0 or greater in the "%s" field in the "%s" set.' + : 'Please enter a number greater than 0 in the "%s" field in the "%s" set.'; + $this->_addError(sprintf($message, $field, $fieldSet)); + } + } + } + } + + /** + * Validate field to be a positive integer + * + * @param array $data + * @param string $fieldSet + * @param string $field + * @param bool $required + * @param bool $skipIfConfigValueUsed + */ + protected function _validatePositiveInteger($data, $fieldSet, $field, $required = false, + $skipIfConfigValueUsed = false) + { + // in case when 'Use Config Settings' is selected no validation needed + if (!($skipIfConfigValueUsed && $this->_isConfigValueUsed($data, $field))) { + if (!isset($data[$field]) && $required) { + $this->_addError(sprintf('The "%s" value in the "%s" set is a required field.',$field, $fieldSet)); + } + + if (isset($data[$field]) && (!is_int($data[$field]) || $data[$field] < 0)) { + $this->_addError(sprintf('Please use numbers only in the "%s" field in the "%s" set. ' . + 'Please avoid spaces or other characters such as dots or commas.', $field, $fieldSet)); + } + } + } + + /** + * Validate field to be a number + * + * @param array $data + * @param string $fieldSet + * @param string $field + * @param bool $required + * @param bool $skipIfConfigValueUsed + */ + protected function _validateNumeric($data, $fieldSet, $field, $required = false, $skipIfConfigValueUsed = false) + { + // in case when 'Use Config Settings' is selected no validation needed + if (!($skipIfConfigValueUsed && $this->_isConfigValueUsed($data, $field))) { + if (!isset($data[$field]) && $required) { + $this->_addError(sprintf('The "%s" value in the "%s" set is a required field.',$field, $fieldSet)); + } + + if (isset($data[$field]) && !is_numeric($data[$field])) { + $this->_addError(sprintf('Please enter a valid number in the "%s" field in the "%s" set.', + $field, $fieldSet)); + } + } + } + + /** + * Validate dropdown fields value + * + * @param array $data + * @param string $fieldSet + * @param string $field + * @param string $sourceModelName + * @param bool $skipIfConfigValueUsed + */ + protected function _validateSource($data, $fieldSet, $field, $sourceModelName, $skipIfConfigValueUsed = false) + { + // in case when 'Use Config Settings' is selected no validation needed + if (!($skipIfConfigValueUsed && $this->_isConfigValueUsed($data, $field))) { + if (isset($data[$field])) { + $sourceModel = Mage::getSingleton($sourceModelName); + if ($sourceModel) { + $allowedValues = $this->_getAttributeAllowedValues($sourceModel->toOptionArray()); + if (!in_array($data[$field], $allowedValues, true)) { + $this->_addError(sprintf('Invalid "%s" value in the "%s" set.', $field, $fieldSet)); + } + } + } + } + } + + /** + * Validate bolean fields value + * + * @param array $data + * @param string $fieldSet + * @param string $field + * @param bool $skipIfConfigValueUsed + */ + protected function _validateBoolean($data, $fieldSet, $field, $skipIfConfigValueUsed = false) + { + // in case when 'Use Config Settings' is selected no validation needed + if (!($skipIfConfigValueUsed && $this->_isConfigValueUsed($data, $field))) { + if (isset($data[$field])) { + $allowedValues = $this->_getAttributeAllowedValues( + Mage::getSingleton('eav/entity_attribute_source_boolean')->getAllOptions()); + if (!in_array($data[$field], $allowedValues, true)) { + $this->_addError(sprintf('Invalid "%s" value in the "%s" set.', $field, $fieldSet)); + } + } + } + } + + /** + * Retrieve all attribute allowed values from source model in plain array format + * + * @param array $options + * @return array + */ + protected function _getAttributeAllowedValues(array $options) + { + $values = array(); + foreach ($options as $option) { + if (isset($option['value'])) { + $value = $option['value']; + if (is_array($value)) { + $values = array_merge($values, $this->_getAttributeAllowedValues($value)); + } else { + $values[] = $value; + } + } + } + + return $values; + } + + /** + * Check if value from config is used + * + * @param array $data + * @param string $field + * @return bool + */ + protected function _isConfigValueUsed($data, $field) + { + return isset($data["use_config_$field"]) && $data["use_config_$field"]; + } + + /** + * Throw API2 exception + * + * @param string $message + * @param int $code + * @throws Mage_Api2_Exception + */ + protected function _critical($message, $code) + { + throw new Mage_Api2_Exception($message, $code); + } +} diff --git a/app/code/core/Mage/Catalog/Model/Api2/Product/Website.php b/app/code/core/Mage/Catalog/Model/Api2/Product/Website.php new file mode 100644 index 0000000000..a925de9a78 --- /dev/null +++ b/app/code/core/Mage/Catalog/Model/Api2/Product/Website.php @@ -0,0 +1,69 @@ + + */ +class Mage_Catalog_Model_Api2_Product_Website extends Mage_Api2_Model_Resource +{ + /** + * Load product by id + * + * @param int $id + * @throws Mage_Api2_Exception + * @return Mage_Catalog_Model_Product + */ + protected function _loadProductById($id) + { + /* @var $product Mage_Catalog_Model_Product */ + $product = Mage::getModel('catalog/product')->load($id); + if (!$product->getId()) { + $this->_critical(sprintf('Product #%s not found.', $id), Mage_Api2_Model_Server::HTTP_NOT_FOUND); + } + return $product; + } + + /** + * Load website by id + * + * @param int $id + * @throws Mage_Api2_Exception + * @return Mage_Core_Model_Website + */ + protected function _loadWebsiteById($id) + { + /* @var $website Mage_Core_Model_Website */ + $website = Mage::getModel('core/website')->load($id); + if (!$website->getId()) { + $this->_critical(sprintf('Website #%s not found.', $id), Mage_Api2_Model_Server::HTTP_NOT_FOUND); + } + return $website; + } +} diff --git a/app/code/core/Mage/Catalog/Model/Api2/Product/Website/Rest.php b/app/code/core/Mage/Catalog/Model/Api2/Product/Website/Rest.php new file mode 100644 index 0000000000..0f6d0d16fb --- /dev/null +++ b/app/code/core/Mage/Catalog/Model/Api2/Product/Website/Rest.php @@ -0,0 +1,258 @@ + + */ +abstract class Mage_Catalog_Model_Api2_Product_Website_Rest extends Mage_Catalog_Model_Api2_Product_Website +{ + /** + * Product website retrieve is not available + */ + protected function _retrieve() + { + $this->_critical(self::RESOURCE_METHOD_NOT_ALLOWED); + } + + /** + * Get product websites list + * + * @return array + */ + protected function _retrieveCollection() + { + $return = array(); + foreach ($this->_loadProductById($this->getRequest()->getParam('product_id'))->getWebsiteIds() as $websiteId) { + $return[] = array('website_id' => $websiteId); + } + return $return; + } + + /** + * Product website assign + * + * @param array $data + * @return string + */ + protected function _create(array $data) + { + /* @var $product Mage_Catalog_Model_Product */ + $product = $this->_loadProductById($this->getRequest()->getParam('product_id')); + + /* @var $validator Mage_Catalog_Model_Api2_Product_Website_Validator_Admin_Website */ + $validator = Mage::getModel('catalog/api2_product_website_validator_admin_website'); + if (!$validator->isValidDataForWebsiteAssignmentToProduct($product, $data)) { + foreach ($validator->getErrors() as $error) { + $this->_error($error, Mage_Api2_Model_Server::HTTP_BAD_REQUEST); + } + $this->_critical(self::RESOURCE_DATA_PRE_VALIDATION_ERROR); + } + + $websiteIds = $product->getWebsiteIds(); + /* @var $website Mage_Core_Model_Website */ + $website = Mage::getModel('core/website')->load($data['website_id']); + $websiteIds[] = $website->getId(); // Existence of a website is checked in the validator + $product->setWebsiteIds($websiteIds); + + try{ + $product->save(); + + /** + * Do copying data to stores + */ + if (isset($data['copy_to_stores'])) { + foreach ($data['copy_to_stores'] as $storeData) { + Mage::getModel('catalog/product') + ->setStoreId($storeData['store_from']) + ->load($product->getId()) + ->setStoreId($storeData['store_to']) + ->save(); + } + } + + } catch (Mage_Core_Exception $e) { + $this->_critical($e->getMessage(), Mage_Api2_Model_Server::HTTP_INTERNAL_ERROR); + } catch (Exception $e) { + $this->_critical(self::RESOURCE_INTERNAL_ERROR); + } + + return $this->_getLocation($website, $product); + } + + /** + * Product website assign + * + * @param array $data + * @return string + */ + protected function _multiCreate(array $data) + { + /* @var $product Mage_Catalog_Model_Product */ + $product = $this->_loadProductById($this->getRequest()->getParam('product_id')); + $websiteIds = $product->getWebsiteIds(); + foreach ($data as $singleData) { + try { + if (!is_array($singleData)) { + $this->_errorMessage(self::RESOURCE_DATA_INVALID, Mage_Api2_Model_Server::HTTP_BAD_REQUEST); + $this->_critical(self::RESOURCE_DATA_PRE_VALIDATION_ERROR); + } + /* @var $validator Mage_Catalog_Model_Api2_Product_Website_Validator_Admin_Website */ + $validator = Mage::getModel('catalog/api2_product_website_validator_admin_website'); + if (!$validator->isValidDataForWebsiteAssignmentToProduct($product, $singleData)) { + foreach ($validator->getErrors() as $error) { + $this->_errorMessage($error, Mage_Api2_Model_Server::HTTP_BAD_REQUEST, array( + 'website_id' => isset($singleData['website_id']) ? $singleData['website_id'] : null, + 'product_id' => $product->getId(), + )); + } + $this->_critical(self::RESOURCE_DATA_PRE_VALIDATION_ERROR); + } + + /* @var $website Mage_Core_Model_Website */ + $website = Mage::getModel('core/website')->load($singleData['website_id']); + $websiteIds[] = $website->getId(); // Existence of a website is checked in the validator + $product->setWebsiteIds($websiteIds); + + $product->save(); + + /** + * Do copying data to stores + */ + if (isset($singleData['copy_to_stores'])) { + foreach ($singleData['copy_to_stores'] as $storeData) { + Mage::getModel('catalog/product') + ->setStoreId($storeData['store_from']) + ->load($product->getId()) + ->setStoreId($storeData['store_to']) + ->save(); + } + } + + $this->_successMessage( + Mage_Api2_Model_Resource::RESOURCE_UPDATED_SUCCESSFUL, + Mage_Api2_Model_Server::HTTP_OK, + array( + 'website_id' => $website->getId(), + 'product_id' => $product->getId(), + ) + ); + } catch (Mage_Api2_Exception $e) { + // pre-validation errors are already added + if ($e->getMessage() != self::RESOURCE_DATA_PRE_VALIDATION_ERROR) { + $this->_errorMessage( + $e->getMessage(), + $e->getCode(), + array( + 'website_id' => isset($singleData['website_id']) ? $singleData['website_id'] : null, + 'product_id' => $product->getId(), + ) + ); + } + } catch (Exception $e) { + $this->_errorMessage( + Mage_Api2_Model_Resource::RESOURCE_INTERNAL_ERROR, + Mage_Api2_Model_Server::HTTP_INTERNAL_ERROR, + array( + 'website_id' => isset($singleData['website_id']) ? $singleData['website_id'] : null, + 'product_id' => $product->getId(), + ) + ); + } + } + } + + /** + * Product websites update is not available + * + * @param array $data + */ + protected function _update(array $data) + { + $this->_critical(self::RESOURCE_METHOD_NOT_ALLOWED); + } + + /** + * Product website unassign + */ + protected function _delete() + { + /* @var $product Mage_Catalog_Model_Product */ + $product = $this->_loadProductById($this->getRequest()->getParam('product_id')); + + /* @var $website Mage_Core_Model_Website */ + $website = $this->_loadWebsiteById($this->getRequest()->getParam('website_id')); + + /* @var $validator Mage_Catalog_Model_Api2_Product_Website_Validator_Admin_Website */ + $validator = Mage::getModel('catalog/api2_product_website_validator_admin_website'); + if (!$validator->isWebsiteAssignedToProduct($website, $product)) { + foreach ($validator->getErrors() as $error) { + $this->_error($error, Mage_Api2_Model_Server::HTTP_BAD_REQUEST); + } + $this->_critical(self::RESOURCE_DATA_PRE_VALIDATION_ERROR); + } + + $websiteIds = $product->getWebsiteIds(); + // Existence of a key is checked in the validator + unset($websiteIds[array_search($website->getId(), $websiteIds)]); + $product->setWebsiteIds($websiteIds); + + try { + $product->save(); + } catch (Mage_Core_Exception $e) { + $this->_critical($e->getMessage(), Mage_Api2_Model_Server::HTTP_INTERNAL_ERROR); + } catch (Exception $e) { + $this->_critical(self::RESOURCE_INTERNAL_ERROR); + } + } + + /** + * Get resource location + * + * @param Mage_Core_Model_Website $website + * @return string URL + */ + protected function _getLocation($website) + { + /* @var $apiTypeRoute Mage_Api2_Model_Route_ApiType */ + $apiTypeRoute = Mage::getModel('api2/route_apiType'); + + $chain = $apiTypeRoute->chain( + new Zend_Controller_Router_Route($this->getConfig()->getRouteWithEntityTypeAction($this->getResourceType())) + ); + $params = array( + 'api_type' => $this->getRequest()->getApiType(), + 'product_id' => $this->getRequest()->getParam('product_id'), + 'website_id' => $website->getId() + ); + $uri = $chain->assemble($params); + + return '/' . $uri; + } +} diff --git a/app/code/core/Mage/Catalog/Model/Api2/Product/Website/Rest/Admin/V1.php b/app/code/core/Mage/Catalog/Model/Api2/Product/Website/Rest/Admin/V1.php new file mode 100644 index 0000000000..6c65e04c94 --- /dev/null +++ b/app/code/core/Mage/Catalog/Model/Api2/Product/Website/Rest/Admin/V1.php @@ -0,0 +1,36 @@ + + */ +class Mage_Catalog_Model_Api2_Product_Website_Rest_Admin_V1 extends Mage_Catalog_Model_Api2_Product_Website_Rest +{ +} diff --git a/app/code/core/Mage/Catalog/Model/Api2/Product/Website/Validator/Admin/Website.php b/app/code/core/Mage/Catalog/Model/Api2/Product/Website/Validator/Admin/Website.php new file mode 100644 index 0000000000..b2230fcbd3 --- /dev/null +++ b/app/code/core/Mage/Catalog/Model/Api2/Product/Website/Validator/Admin/Website.php @@ -0,0 +1,177 @@ + + */ +class Mage_Catalog_Model_Api2_Product_Website_Validator_Admin_Website extends Mage_Api2_Model_Resource_Validator +{ + /** + * Validate data for website assignment to product. + * If fails validation, then this method returns false, and + * getErrors() will return an array of errors that explain why the + * validation failed. + * + * @param Mage_Catalog_Model_Product $product + * @param array $data + * @return bool + */ + public function isValidDataForWebsiteAssignmentToProduct(Mage_Catalog_Model_Product $product, array $data) + { + // Validate website id + if (!isset($data['website_id']) || !is_numeric($data['website_id'])) { + $this->_addError('Invalid value for "website_id" in request.'); + return false; + } + + // Validate website + /* @var $website Mage_Core_Model_Website */ + $website = Mage::getModel('core/website')->load($data['website_id']); + if (!$website->getId()) { + $this->_addError(sprintf('Website #%d not found.', $data['website_id'])); + return false; + } + + // Validate product to website association + if (in_array($website->getId(), $product->getWebsiteIds())) { + $this->_addError(sprintf('Product #%d is already assigned to website #%d', $product->getId(), + $website->getId())); + return false; + } + + // Validate "Copy To Stores" data and associations + $this->_addErrorsIfCopyToStoresDataIsNotValid($product, $website, $data); + + return !count($this->getErrors()); + } + + /** + * Validate "Copy To Stores" data and associations. + * + * @param Mage_Catalog_Model_Product $product + * @param Mage_Core_Model_Website $website + * @param array $data + * @return \Mage_Catalog_Model_Api2_Product_Website_Validator_Admin_Website + */ + protected function _addErrorsIfCopyToStoresDataIsNotValid($product, $website, $data) + { + if (isset($data['copy_to_stores'])) { + foreach ($data['copy_to_stores'] as $storeData) { + $this->_checkStoreFrom($product, $website, $storeData); + $this->_checkStoreTo($website, $storeData); + } + } + return $this; + } + + /** + * Check if it possible to copy from store "store_from" + * + * @param Mage_Catalog_Model_Product $product + * @param Mage_Core_Model_Website $website + * @param array $storeData + * @return \Mage_Catalog_Model_Api2_Product_Website_Validator_Admin_Website + */ + protected function _checkStoreFrom($product, $website, $storeData) + { + if (!isset($storeData['store_from']) || !is_numeric($storeData['store_from'])) { + $this->_addError(sprintf('Invalid value for "store_from" for the website with ID #%d.', + $website->getId())); + return $this; + } + + // Check if the store with the specified ID (from which we will copy the information) exists + // and if it belongs to the product being edited + $storeFrom = Mage::getModel('core/store')->load($storeData['store_from']); + if (!$storeFrom->getId()) { + $this->_addError(sprintf('Store not found #%d for website #%d.', $storeData['store_from'], + $website->getId())); + return $this; + } + + if (!in_array($storeFrom->getId(), $product->getStoreIds())) { + $this->_addError(sprintf('Store #%d from which we will copy the information does not belong' + . ' to the product #%d being edited.', $storeFrom->getId(), $product->getId())); + } + + return $this; + } + + /** + * Check if it possible to copy into store "store_to" + * + * @param Mage_Core_Model_Website $website + * @param array $storeData + * @return \Mage_Catalog_Model_Api2_Product_Website_Validator_Admin_Website + */ + protected function _checkStoreTo($website, $storeData) + { + if (!isset($storeData['store_to']) || !is_numeric($storeData['store_to'])) { + $this->_addError(sprintf('Invalid value for "store_to" for the website with ID #%d.', + $website->getId())); + return $this; + } + + // Check if the store with the specified ID (to which we will copy the information) exists + // and if it belongs to the website being added + $storeTo = Mage::getModel('core/store')->load($storeData['store_to']); + if (!$storeTo->getId()) { + $this->_addError(sprintf('Store not found #%d for website #%d.', $storeData['store_to'], + $website->getId())); + return $this; + } + + if (!in_array($storeTo->getId(), $website->getStoreIds())) { + $this->_addError(sprintf('Store #%d to which we will copy the information does not belong' + . ' to the website #%d being added.', $storeTo->getId(), $website->getId())); + } + + return $this; + } + + /** + * Validate is valid association for website unassignment from product. + * If fails validation, then this method returns false, and + * getErrors() will return an array of errors that explain why the + * validation failed. + * + * @param Mage_Core_Model_Website $website + * @param Mage_Catalog_Model_Product $product + * @return bool + */ + public function isWebsiteAssignedToProduct(Mage_Core_Model_Website $website, Mage_Catalog_Model_Product $product) + { + if (false === array_search($website->getId(), $product->getWebsiteIds())) { + $this->_addError(sprintf('Product #%d isn\'t assigned to website #%d', $product->getId(), + $website->getId())); + } + return !count($this->getErrors()); + } +} diff --git a/app/code/core/Mage/Catalog/Model/Category/Api.php b/app/code/core/Mage/Catalog/Model/Category/Api.php index cd5c60b1f9..1ca5775e5e 100644 --- a/app/code/core/Mage/Catalog/Model/Category/Api.php +++ b/app/code/core/Mage/Catalog/Model/Category/Api.php @@ -345,8 +345,9 @@ public function update($categoryId, $categoryData, $store = null) } $category->save(); - } - catch (Mage_Core_Exception $e) { + } catch (Mage_Core_Exception $e) { + $this->_fault('data_invalid', $e->getMessage()); + } catch (Mage_Eav_Model_Entity_Attribute_Exception $e) { $this->_fault('data_invalid', $e->getMessage()); } diff --git a/app/code/core/Mage/Catalog/Model/Category/Api/V2.php b/app/code/core/Mage/Catalog/Model/Category/Api/V2.php index 540d0b9719..b05c952521 100644 --- a/app/code/core/Mage/Catalog/Model/Category/Api/V2.php +++ b/app/code/core/Mage/Catalog/Model/Category/Api/V2.php @@ -76,13 +76,14 @@ public function create($parentId, $categoryData, $store = null) { $parent_category = $this->_initCategory($parentId, $store); + /* @var $category Mage_Catalog_Model_Category */ $category = Mage::getModel('catalog/category') ->setStoreId($this->_getStoreId($store)); $category->addData(array('path'=>implode('/',$parent_category->getPathIds()))); $category ->setAttributeSetId($category->getDefaultAttributeSetId()); - /* @var $category Mage_Catalog_Model_Category */ + foreach ($category->getAttributes() as $attribute) { $_attrCode = $attribute->getAttributeCode(); @@ -153,8 +154,9 @@ public function update($categoryId, $categoryData, $store = null) } } $category->save(); - } - catch (Mage_Core_Exception $e) { + } catch (Mage_Core_Exception $e) { + $this->_fault('data_invalid', $e->getMessage()); + } catch (Mage_Eav_Model_Entity_Attribute_Exception $e) { $this->_fault('data_invalid', $e->getMessage()); } diff --git a/app/code/core/Mage/Catalog/Model/Layer/Filter/Price.php b/app/code/core/Mage/Catalog/Model/Layer/Filter/Price.php index 2250423714..4c50ca50a4 100644 --- a/app/code/core/Mage/Catalog/Model/Layer/Filter/Price.php +++ b/app/code/core/Mage/Catalog/Model/Layer/Filter/Price.php @@ -41,18 +41,18 @@ class Mage_Catalog_Model_Layer_Filter_Price extends Mage_Catalog_Model_Layer_Fil /** * XML configuration paths for Price Layered Navigation */ - const XML_PATH_RANGE_CALCULATION = 'catalog/layered_navigation/price_range_calculation'; - const XML_PATH_RANGE_STEP = 'catalog/layered_navigation/price_range_step'; - const XML_PATH_RANGE_MAX_INTERVALS = 'catalog/layered_navigation/price_range_max_intervals'; - const XML_PATH_ONE_PRICE_INTERVAL = 'catalog/layered_navigation/one_price_interval'; - const XML_PATH_INTERVAL_DIVISION_LIMIT = 'catalog/layered_navigation/interval_division_limit'; + const XML_PATH_RANGE_CALCULATION = 'catalog/layered_navigation/price_range_calculation'; + const XML_PATH_RANGE_STEP = 'catalog/layered_navigation/price_range_step'; + const XML_PATH_RANGE_MAX_INTERVALS = 'catalog/layered_navigation/price_range_max_intervals'; + const XML_PATH_ONE_PRICE_INTERVAL = 'catalog/layered_navigation/one_price_interval'; + const XML_PATH_INTERVAL_DIVISION_LIMIT = 'catalog/layered_navigation/interval_division_limit'; /** - * Price layered navigation mode: Automatic, Continuous, Manual + * Price layered navigation modes: Automatic (equalize price ranges), Automatic (equalize product counts), Manual */ - const RANGE_CALCULATION_AUTO = 'auto'; - const RANGE_CALCULATION_IMPROVED = 'improved'; - const RANGE_CALCULATION_MANUAL = 'manual'; + const RANGE_CALCULATION_AUTO = 'auto'; // equalize price ranges + const RANGE_CALCULATION_IMPROVED = 'improved'; // equalize product counts + const RANGE_CALCULATION_MANUAL = 'manual'; /** * Minimal size of the range @@ -265,7 +265,10 @@ protected function _getCalculatedItemsData() /** @var $algorithmModel Mage_Catalog_Model_Layer_Filter_Price_Algorithm */ $algorithmModel = Mage::getSingleton('catalog/layer_filter_price_algorithm'); $collection = $this->getLayer()->getProductCollection(); - if ($collection->getPricesCount() <= $this->getIntervalDivisionLimit()) { + $appliedInterval = $this->getInterval(); + if ($appliedInterval + && $collection->getPricesCount() <= $this->getIntervalDivisionLimit() + ) { return array(); } $algorithmModel->setPricesModel($this)->setStatistics( @@ -274,9 +277,9 @@ protected function _getCalculatedItemsData() $collection->getPriceStandardDeviation(), $collection->getPricesCount() ); - $appliedInterval = $this->getInterval(); + if ($appliedInterval) { - if ($appliedInterval[0] == $appliedInterval[1]) { + if ($appliedInterval[0] == $appliedInterval[1] || $appliedInterval[1] === '0') { return array(); } $algorithmModel->setLimits($appliedInterval[0], $appliedInterval[1]); diff --git a/app/code/core/Mage/Catalog/Model/Product/Api.php b/app/code/core/Mage/Catalog/Model/Product/Api.php index d2a79af58e..39dcdd1c24 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Api.php +++ b/app/code/core/Mage/Catalog/Model/Product/Api.php @@ -268,7 +268,7 @@ protected function _prepareDataForSave($product, $productData) foreach ($product->getTypeInstance(true)->getEditableAttributes($product) as $attribute) { //Unset data if object attribute has no value in current store - if (Mage_Catalog_Model_Abstract::DEFAULT_STORE_ID !== $product->getStoreId() + if (Mage_Catalog_Model_Abstract::DEFAULT_STORE_ID !== (int) $product->getStoreId() && !$product->getExistsStoreValueFlag($attribute->getAttributeCode()) && !$attribute->isScopeGlobal() ) { diff --git a/app/code/core/Mage/Catalog/Model/Product/Api/V2.php b/app/code/core/Mage/Catalog/Model/Product/Api/V2.php index 22d507a401..acdd0ca01b 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Api/V2.php +++ b/app/code/core/Mage/Catalog/Model/Product/Api/V2.php @@ -338,15 +338,18 @@ protected function _prepareDataForSave ($product, $productData) * @param string $fromDate * @param string $toDate * @param string|int $store + * @param string $identifierType OPTIONAL If 'sku' - search product by SKU, if any except for NULL - search by ID, + * otherwise - try to determine identifier type automatically * @return boolean */ - public function setSpecialPrice($productId, $specialPrice = null, $fromDate = null, $toDate = null, $store = null) - { + public function setSpecialPrice($productId, $specialPrice = null, $fromDate = null, $toDate = null, $store = null, + $identifierType = null + ) { $obj = new stdClass(); $obj->special_price = $specialPrice; $obj->special_from_date = $fromDate; $obj->special_to_date = $toDate; - return $this->update($productId, $obj, $store); + return $this->update($productId, $obj, $store, $identifierType); } /** diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Media/Api.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Media/Api.php index e1ab5900d2..33a56d2199 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Media/Api.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Media/Api.php @@ -153,6 +153,16 @@ public function create($productId, $data, $store = null, $identifierType = null) $ioAdapter->write($fileName, $fileContent, 0666); unset($fileContent); + // try to create Image object - it fails with Exception if image is not supported + try { + new Varien_Image($tmpDirectory . DS . $fileName); + } catch (Exception $e) { + // Remove temporary directory + $ioAdapter->rmdir($tmpDirectory, true); + + throw new Mage_Core_Exception($e->getMessage()); + } + // Adding image to gallery $file = $gallery->getBackend()->addImage( $product, diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Tierprice/Api.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Tierprice/Api.php index 79408964cc..bd1f2438d8 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Tierprice/Api.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Tierprice/Api.php @@ -168,13 +168,12 @@ public function prepareTierPrices($product, $tierPrices = null) * Retrieve product * * @param int $productId - * @param string|int $store * @param string $identifierType * @return Mage_Catalog_Model_Product */ protected function _initProduct($productId, $identifierType = null) { - $product = Mage::helper('catalog/product')->getProduct($productId, $this->_getStoreId($store), $identifierType); + $product = Mage::helper('catalog/product')->getProduct($productId, $this->_getStoreId(), $identifierType); if (!$product->getId()) { $this->_fault('product_not_exists'); } diff --git a/app/code/core/Mage/Catalog/Model/Product/Option/Type/Date.php b/app/code/core/Mage/Catalog/Model/Product/Option/Type/Date.php index 98cbce335b..5cdbbb0371 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Option/Type/Date.php +++ b/app/code/core/Mage/Catalog/Model/Product/Option/Type/Date.php @@ -50,7 +50,7 @@ public function validateUserValue($values) $dateValid = true; if ($this->_dateExists()) { if ($this->useCalendar()) { - $dateValid = isset($value['date']) && preg_match('/^[0-9]{1,4}.+[0-9]{1,4}.+[0-9]{1,4}$/', $value['date']); + $dateValid = isset($value['date']) && preg_match('/^\d{1,4}.+\d{1,4}.+\d{1,4}$/', $value['date']); } else { $dateValid = isset($value['day']) && isset($value['month']) && isset($value['year']) && $value['day'] > 0 && $value['month'] > 0 && $value['year'] > 0; @@ -164,10 +164,12 @@ public function getFormattedOptionValue($optionValue) $option = $this->getOption(); if ($this->getOption()->getType() == Mage_Catalog_Model_Product_Option::OPTION_TYPE_DATE) { $format = Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM); - $result = Mage::app()->getLocale()->date($optionValue, Zend_Date::ISO_8601, null, false)->toString($format); + $result = Mage::app()->getLocale()->date($optionValue, Zend_Date::ISO_8601, null, false) + ->toString($format); } elseif ($this->getOption()->getType() == Mage_Catalog_Model_Product_Option::OPTION_TYPE_DATE_TIME) { $format = Mage::app()->getLocale()->getDateTimeFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT); - $result = Mage::app()->getLocale()->date($optionValue, Varien_Date::DATETIME_INTERNAL_FORMAT, null, false)->toString($format); + $result = Mage::app()->getLocale() + ->date($optionValue, Varien_Date::DATETIME_INTERNAL_FORMAT, null, false)->toString($format); } elseif ($this->getOption()->getType() == Mage_Catalog_Model_Product_Option::OPTION_TYPE_TIME) { $date = new Zend_Date($optionValue); $result = date($this->is24hTimeFormat() ? 'H:i' : 'h:i a', $date->getTimestamp()); @@ -216,7 +218,7 @@ public function parseOptionValue($optionValue, $productOptionValues) } $date = new Zend_Date($timestamp); - return $date->toString(Varien_date::DATETIME_INTERNAL_FORMAT); + return $date->toString(Varien_Date::DATETIME_INTERNAL_FORMAT); } /** diff --git a/app/code/core/Mage/Catalog/Model/Product/Option/Value/Api.php b/app/code/core/Mage/Catalog/Model/Product/Option/Value/Api.php index f7fb75cd5e..be1a7dd0cd 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Option/Value/Api.php +++ b/app/code/core/Mage/Catalog/Model/Product/Option/Value/Api.php @@ -187,7 +187,7 @@ public function remove($valueId) } try { - $optionValue->deleteValues($valueId); + $optionValue->delete(); } catch (Mage_Core_Exception $e) { $this->_fault('not_deleted', $e->getMessage()); } diff --git a/app/code/core/Mage/Catalog/Model/Product/Type/Configurable/Price.php b/app/code/core/Mage/Catalog/Model/Product/Type/Configurable/Price.php index f2cfa5ce0e..51d8c6b3fb 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Type/Configurable/Price.php +++ b/app/code/core/Mage/Catalog/Model/Product/Type/Configurable/Price.php @@ -52,7 +52,7 @@ public function getFinalPrice($qty=null, $product) Mage::dispatchEvent('catalog_product_get_final_price', array('product' => $product, 'qty' => $qty)); $finalPrice = $product->getData('final_price'); - $finalPrice += $this->getTotalConfigurableItemsPrice($product, $qty); + $finalPrice += $this->getTotalConfigurableItemsPrice($product, $finalPrice); $finalPrice += $this->_applyOptionsPrice($product, $qty, $basePrice) - $basePrice; $finalPrice = max(0, $finalPrice); @@ -64,10 +64,10 @@ public function getFinalPrice($qty=null, $product) * Get Total price for configurable items * * @param Mage_Catalog_Model_Product $product - * @param null|float $qty + * @param float $finalPrice * @return float */ - public function getTotalConfigurableItemsPrice($product, $qty = null) + public function getTotalConfigurableItemsPrice($product, $finalPrice) { $price = 0.0; @@ -81,7 +81,6 @@ public function getTotalConfigurableItemsPrice($product, $qty = null) $selectedAttributes = unserialize($product->getCustomOption('attributes')->getValue()); } - $basePrice = $this->getBasePrice($product, $qty); foreach ($attributes as $attribute) { $attributeId = $attribute->getProductAttribute()->getId(); $value = $this->_getValueByIndex( @@ -91,7 +90,7 @@ public function getTotalConfigurableItemsPrice($product, $qty = null) $product->setParentId(true); if ($value) { if ($value['pricing_value'] != 0) { - $product->setConfigurablePrice($this->_calcSelectionPrice($value, $basePrice)); + $product->setConfigurablePrice($this->_calcSelectionPrice($value, $finalPrice)); Mage::dispatchEvent( 'catalog_product_type_configurable_price', array('product' => $product) diff --git a/app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Price.php b/app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Price.php index 3d1389560f..5de20a0f03 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Price.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Price.php @@ -37,7 +37,7 @@ class Mage_Catalog_Model_Resource_Layer_Filter_Price extends Mage_Core_Model_Res /** * Minimal possible price */ - const MIN_POSSIBLE_PRICE = .0001; + const MIN_POSSIBLE_PRICE = .01; /** * Initialize connection and define main table name @@ -225,9 +225,9 @@ protected function _getComparingValue($price, $filter, $decrease = true) { $currencyRate = $filter->getLayer()->getProductCollection()->getCurrencyRate(); if ($decrease) { - return round(($price - (self::MIN_POSSIBLE_PRICE / 2)) / $currencyRate, 3); + return ($price - (self::MIN_POSSIBLE_PRICE / 2)) / $currencyRate; } - return round(($price + (self::MIN_POSSIBLE_PRICE / 2)) / $currencyRate, 3); + return ($price + (self::MIN_POSSIBLE_PRICE / 2)) / $currencyRate; } /** @@ -253,14 +253,12 @@ protected function _getFullPriceExpression($filter, $select) public function getCount($filter, $range) { $select = $this->_getSelect($filter); - $priceExpression = $this->_getPriceExpression($filter, $select); - $rate = $filter->getCurrencyRate(); + $priceExpression = $this->_getFullPriceExpression($filter, $select); /** * Check and set correct variable values to prevent SQL-injections */ - $rate = floatval($rate); - $range = floatval($range) / $rate; + $range = floatval($range); if ($range == 0) { $range = 1; } diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Collection.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Collection.php index f3c8b5d4a5..29ac97dbc3 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Collection.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Collection.php @@ -229,7 +229,12 @@ protected function _preparePriceExpressionParameters($select) // prepare response object for event $response = new Varien_Object(); $response->setAdditionalCalculations(array()); - $table = self::INDEX_TABLE_ALIAS; + $tableAliases = array_keys($select->getPart(Zend_Db_Select::FROM)); + if (in_array(self::INDEX_TABLE_ALIAS, $tableAliases)) { + $table = self::INDEX_TABLE_ALIAS; + } else { + $table = reset($tableAliases); + } // prepare event arguments $eventArgs = array( diff --git a/app/code/core/Mage/Catalog/Model/Resource/Setup.php b/app/code/core/Mage/Catalog/Model/Resource/Setup.php index 89fcbfd34e..8bf8f7aa81 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Setup.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Setup.php @@ -353,7 +353,7 @@ public function getDefaultEntities() 'group' => 'Custom Design', ), 'filter_price_range' => array( - 'type' => 'int', + 'type' => 'decimal', 'label' => 'Layered Navigation Price Step', 'input' => 'text', 'required' => false, diff --git a/app/code/core/Mage/Catalog/Model/Resource/Url.php b/app/code/core/Mage/Catalog/Model/Resource/Url.php index 8cedda6d83..67d1690954 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Url.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Url.php @@ -296,11 +296,15 @@ public function prepareRewrites($storeId, $categoryIds = null, $productIds = nul public function saveRewrite($rewriteData, $rewrite) { $adapter = $this->_getWriteAdapter(); + try { + $adapter->insertOnDuplicate($this->getMainTable(), $rewriteData); + } catch (Exception $e) { + Mage::logException($e); + Mage::throwException(Mage::helper('catalog')->__('An error occurred while saving the URL rewrite')); + } + if ($rewrite && $rewrite->getId()) { if ($rewriteData['request_path'] != $rewrite->getRequestPath()) { - $where = array($this->getIdFieldName() . '=?' => $rewrite->getId()); - $adapter->update($this->getMainTable(), $rewriteData, $where); - // Update existing rewrites history and avoid chain redirects $where = array('target_path = ?' => $rewrite->getRequestPath()); if ($rewrite->getStoreId()) { @@ -312,13 +316,6 @@ public function saveRewrite($rewriteData, $rewrite) $where ); } - } else { - try { - $adapter->insert($this->getMainTable(), $rewriteData); - } catch (Exception $e) { - Mage::logException($e); - Mage::throwException(Mage::helper('catalog')->__('An error occurred while saving the URL rewrite')); - } } unset($rewriteData); diff --git a/app/code/core/Mage/Catalog/data/catalog_setup/data-upgrade-1.6.0.0.13-1.6.0.0.14.php b/app/code/core/Mage/Catalog/data/catalog_setup/data-upgrade-1.6.0.0.13-1.6.0.0.14.php new file mode 100644 index 0000000000..ef7f466f27 --- /dev/null +++ b/app/code/core/Mage/Catalog/data/catalog_setup/data-upgrade-1.6.0.0.13-1.6.0.0.14.php @@ -0,0 +1,68 @@ +getConnection(); + +$installer->startSetup(); + +$entityTypeId = $installer->getEntityTypeId(Mage_Catalog_Model_Category::ENTITY); +$attributeId = $installer->getAttributeId($entityTypeId, 'filter_price_range'); +$attributeTableOld = $installer->getAttributeTable($entityTypeId, $attributeId); + +$installer->updateAttribute($entityTypeId, $attributeId, 'backend_type', 'decimal'); + +$attributeTableNew = $installer->getAttributeTable($entityTypeId, $attributeId); + +if ($attributeTableOld != $attributeTableNew) { + $connection->disableTableKeys($attributeTableOld) + ->disableTableKeys($attributeTableNew); + + $select = $connection->select() + ->from($attributeTableOld, array('entity_type_id', 'attribute_id', 'store_id', 'entity_id', 'value')) + ->where('entity_type_id = ?', $entityTypeId) + ->where('attribute_id = ?', $attributeId); + + $query = $select->insertFromSelect($attributeTableNew, + array('entity_type_id', 'attribute_id', 'store_id', 'entity_id', 'value') + ); + + $connection->query($query); + + $connection->delete($attributeTableOld, + $connection->quoteInto('entity_type_id = ?', $entityTypeId) + . $connection->quoteInto(' AND attribute_id = ?', $attributeId) + ); + + $connection->enableTableKeys($attributeTableOld) + ->enableTableKeys($attributeTableNew); +} + +Mage::getModel('index/indexer') + ->getProcessByCode('catalog_category_flat') + ->changeStatus(Mage_Index_Model_Process::STATUS_REQUIRE_REINDEX); + +$installer->endSetup(); diff --git a/app/code/core/Mage/Catalog/etc/api2.xml b/app/code/core/Mage/Catalog/etc/api2.xml new file mode 100644 index 0000000000..950da09805 --- /dev/null +++ b/app/code/core/Mage/Catalog/etc/api2.xml @@ -0,0 +1,370 @@ + + + + + + + Catalog + 30 + + + Product + 50 + + + + + + + catalog_product + catalog/api2_product + catalog/product + Catalog Product + 10 + + + 1 + 1 + 1 + 1 + + + 1 + + + 1 + + + + Product ID + Product Type + Attribute Set + Inventory Data + Default Image + Salability Status + Total Reviews Count + Product URL + Buy Now URL + Has Custom Options + Stock Status + Regular Price With Tax + Regular Price Without Tax + Final Price With Tax + Final Price Without Tax + Use Config Settings for Allow Gift Message + Use Config Settings for Allow Gift Wrapping + Create Permanent Redirect for old URL + + + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + + + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + + + + + + + 1 + 1/ + 1 + 1 + 1 + + + + + 1 + 1 + 1 + 1 + 1 + + + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + + + + + + /products/:id + entity + + + /products/:id/store/:store + entity + + + /products + collection + + + /products/store/:store + collection + + + /products/category/:category_id + collection + + + /products/store/:store/category/:category_id + collection + + + /products/category/:category_id/store/:store + collection + + + 1 + + + catalog_product + catalog/api2_product_category + catalog/category + Product Category + 40 + + + 1 + 1 + 1 + + + 1 + + + 1 + + + + Category ID + + + + /products/:id/categories + collection + + + /products/:id/categories/:category_id + entity + + + + + + 1 + + Int + Please use numbers only in "category_id" field. + + + + + 1 + + + catalog_product + catalog/api2_product_image + Product Image + 70 + + + 1 + 1 + 1 + 1 + + + 1 + + + 1 + + + + ID + File Name + File Content + File MIME Type + + Position + Type + Exclude + URL + + + + + 1 + 1 + 1/ + 1/ + + + + + 1 + 1 + 1/ + 1/ + + + + + 1 + 1 + 1/ + + + 1 + 1 + + + + + + /products/:id/images/:image + entity + + + /products/:id/images/:image/store/:store + entity + + + /products/:id/images + collection + + + /products/:id/images/store/:store + collection + + + 1 + + + catalog_product + catalog/api2_product_website + catalog/product_website + Product Website + 100 + + + 1 + 1 + 1 + + + + + 1 + 1 + + + + + /products/:product_id/websites/:website_id + entity + + + /products/:product_id/websites + collection + + + 1 + + + + diff --git a/app/code/core/Mage/Catalog/etc/config.xml b/app/code/core/Mage/Catalog/etc/config.xml index b206ba92ac..9f49002047 100644 --- a/app/code/core/Mage/Catalog/etc/config.xml +++ b/app/code/core/Mage/Catalog/etc/config.xml @@ -28,7 +28,7 @@ - 1.6.0.0.13 + 1.6.0.0.14 diff --git a/app/code/core/Mage/Catalog/etc/wsdl.xml b/app/code/core/Mage/Catalog/etc/wsdl.xml index 21a67e0cbc..1aba78ee87 100644 --- a/app/code/core/Mage/Catalog/etc/wsdl.xml +++ b/app/code/core/Mage/Catalog/etc/wsdl.xml @@ -198,6 +198,8 @@ + diff --git a/app/code/core/Mage/Catalog/etc/wsi.xml b/app/code/core/Mage/Catalog/etc/wsi.xml index 642606cc51..d3918cf476 100644 --- a/app/code/core/Mage/Catalog/etc/wsi.xml +++ b/app/code/core/Mage/Catalog/etc/wsi.xml @@ -340,7 +340,164 @@
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -524,6 +681,214 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -538,6 +903,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1051,6 +1497,21 @@ + + + + + + + + + + + + + + + @@ -1119,12 +1580,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1311,6 +1880,12 @@ + + + + + + Set_Get current store view @@ -1442,11 +2017,101 @@ + + Add new custom option into product + + + + + Update product custom option + + + + + Get list of available custom option types + + + + + Retrieve list of product custom options + + + + + Get full information about custom option in product + + + + + Remove custom option + + + + + Retrieve custom option values list + + + + + Add new custom option values + + + + + Retrieve custom option value info + + + + + Update custom option value + + + + + Remove value from custom option + + + + + Create product attribute set based on another set + + + + + Remove product attribute set + + + Retrieve product attribute sets + + Add attribute into attribute set + + + + + Remove attribute from attribute set + + + + + Create group within existing attribute set + + + + + Rename existing group + + + + + Remove group from attribute set + + + Retrieve product types @@ -1527,6 +2192,16 @@ + + Create new attribute + + + + + Delete attribute + + + @@ -1737,6 +2412,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1746,6 +2538,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1917,6 +2754,15 @@ + + + + + + + + + diff --git a/app/code/core/Mage/CatalogInventory/Model/Api2/Stock/Item.php b/app/code/core/Mage/CatalogInventory/Model/Api2/Stock/Item.php new file mode 100644 index 0000000000..291079bf04 --- /dev/null +++ b/app/code/core/Mage/CatalogInventory/Model/Api2/Stock/Item.php @@ -0,0 +1,52 @@ + + */ +class Mage_CatalogInventory_Model_Api2_Stock_Item extends Mage_Api2_Model_Resource +{ + /** + * Load stock item by id + * + * @param int $id + * @throws Mage_Api2_Exception + * @return Mage_CatalogInventory_Model_Stock_Item + */ + protected function _loadStockItemById($id) + { + /* @var $stockItem Mage_CatalogInventory_Model_Stock_Item */ + $stockItem = Mage::getModel('cataloginventory/stock_item')->load($id); + if (!$stockItem->getId()) { + $this->_critical(self::RESOURCE_NOT_FOUND); + } + return $stockItem; + } +} diff --git a/app/code/core/Mage/CatalogInventory/Model/Api2/Stock/Item/Rest.php b/app/code/core/Mage/CatalogInventory/Model/Api2/Stock/Item/Rest.php new file mode 100644 index 0000000000..c164d96502 --- /dev/null +++ b/app/code/core/Mage/CatalogInventory/Model/Api2/Stock/Item/Rest.php @@ -0,0 +1,163 @@ + + */ +abstract class Mage_CatalogInventory_Model_Api2_Stock_Item_Rest + extends Mage_CatalogInventory_Model_Api2_Stock_Item +{ + /** + * Retrieve information about specified stock item + * + * @throws Mage_Api2_Exception + * @return array + */ + protected function _retrieve() + { + /* @var $stockItem Mage_CatalogInventory_Model_Stock_Item */ + $stockItem = $this->_loadStockItemById($this->getRequest()->getParam('id')); + return $stockItem->getData(); + } + + /** + * Get stock items list + * + * @return array + */ + protected function _retrieveCollection() + { + $data = $this->_getCollectionForRetrieve()->load()->toArray(); + return isset($data['items']) ? $data['items'] : $data; + } + + /** + * Retrieve stock items collection + * + * @return Mage_CatalogInventory_Model_Resource_Stock_Item_Collection + */ + protected function _getCollectionForRetrieve() + { + /* @var $collection Mage_CatalogInventory_Model_Resource_Stock_Item_Collection */ + $collection = Mage::getResourceModel('cataloginventory/stock_item_collection'); + $this->_applyCollectionModifiers($collection); + return $collection; + } + + /** + * Update specified stock item + * + * @param array $data + * @throws Mage_Api2_Exception + */ + protected function _update(array $data) + { + /* @var $stockItem Mage_CatalogInventory_Model_Stock_Item */ + $stockItem = $this->_loadStockItemById($this->getRequest()->getParam('id')); + + /* @var $validator Mage_CatalogInventory_Model_Api2_Stock_Item_Validator_Item */ + $validator = Mage::getModel('cataloginventory/api2_stock_item_validator_item', array( + 'resource' => $this + )); + + if (!$validator->isValidData($data)) { + foreach ($validator->getErrors() as $error) { + $this->_error($error, Mage_Api2_Model_Server::HTTP_BAD_REQUEST); + } + $this->_critical(self::RESOURCE_DATA_PRE_VALIDATION_ERROR); + } + + $stockItem->addData($data); + try { + $stockItem->save(); + } catch (Mage_Core_Exception $e) { + $this->_error($e->getMessage(), Mage_Api2_Model_Server::HTTP_INTERNAL_ERROR); + } catch (Exception $e) { + $this->_critical(self::RESOURCE_INTERNAL_ERROR); + } + } + + /** + * Update specified stock items + * + * @param array $data + */ + protected function _multiUpdate(array $data) + { + foreach ($data as $itemData) { + try { + if (!is_array($itemData)) { + $this->_errorMessage(self::RESOURCE_DATA_INVALID, Mage_Api2_Model_Server::HTTP_BAD_REQUEST); + $this->_critical(self::RESOURCE_DATA_PRE_VALIDATION_ERROR); + } + + /* @var $validator Mage_CatalogInventory_Model_Api2_Stock_Item_Validator_Item */ + $validator = Mage::getModel('cataloginventory/api2_stock_item_validator_item', array( + 'resource' => $this + )); + if (!$validator->isValidSingleItemDataForMultiUpdate($itemData)) { + foreach ($validator->getErrors() as $error) { + $this->_errorMessage($error, Mage_Api2_Model_Server::HTTP_BAD_REQUEST, array( + 'item_id' => isset($itemData['item_id']) ? $itemData['item_id'] : null + )); + } + $this->_critical(self::RESOURCE_DATA_PRE_VALIDATION_ERROR); + } + + // Existence of a item is checked in the validator + /* @var $stockItem Mage_CatalogInventory_Model_Stock_Item */ + $stockItem = $this->_loadStockItemById($itemData['item_id']); + + unset($itemData['item_id']); // item_id is not for update + $stockItem->addData($itemData); + $stockItem->save(); + + $this->_successMessage(self::RESOURCE_UPDATED_SUCCESSFUL, Mage_Api2_Model_Server::HTTP_OK, array( + 'item_id' => $stockItem->getId() + )); + } catch (Mage_Api2_Exception $e) { + // pre-validation errors are already added + if ($e->getMessage() != self::RESOURCE_DATA_PRE_VALIDATION_ERROR) { + $this->_errorMessage($e->getMessage(), $e->getCode(), array( + 'item_id' => isset($itemData['item_id']) ? $itemData['item_id'] : null + )); + } + } catch (Exception $e) { + $this->_errorMessage( + Mage_Api2_Model_Resource::RESOURCE_INTERNAL_ERROR, + Mage_Api2_Model_Server::HTTP_INTERNAL_ERROR, + array( + 'item_id' => isset($itemData['item_id']) ? $itemData['item_id'] : null + ) + ); + } + } + } +} diff --git a/app/code/core/Mage/CatalogInventory/Model/Api2/Stock/Item/Rest/Admin/V1.php b/app/code/core/Mage/CatalogInventory/Model/Api2/Stock/Item/Rest/Admin/V1.php new file mode 100644 index 0000000000..a88e924713 --- /dev/null +++ b/app/code/core/Mage/CatalogInventory/Model/Api2/Stock/Item/Rest/Admin/V1.php @@ -0,0 +1,36 @@ + + */ +class Mage_CatalogInventory_Model_Api2_Stock_Item_Rest_Admin_V1 extends Mage_CatalogInventory_Model_Api2_Stock_Item_Rest +{ +} diff --git a/app/code/core/Mage/CatalogInventory/Model/Api2/Stock/Item/Validator/Item.php b/app/code/core/Mage/CatalogInventory/Model/Api2/Stock/Item/Validator/Item.php new file mode 100644 index 0000000000..7c502a2576 --- /dev/null +++ b/app/code/core/Mage/CatalogInventory/Model/Api2/Stock/Item/Validator/Item.php @@ -0,0 +1,62 @@ + + */ +class Mage_CatalogInventory_Model_Api2_Stock_Item_Validator_Item extends Mage_Api2_Model_Resource_Validator_Fields +{ + /** + * Validate data. + * If fails validation, then this method returns false, and + * getErrors() will return an array of errors that explain why the + * validation failed. + * + * @param array $data + * @return bool + */ + public function isValidSingleItemDataForMultiUpdate(array $data) + { + // Validate item id + if (!isset($data['item_id']) || !is_numeric($data['item_id'])) { + $this->_addError('Invalid value for "item_id" in request.'); + } else { + // Validate Stock Item + /* @var $stockItem Mage_CatalogInventory_Model_Stock_Item */ + $stockItem = Mage::getModel('cataloginventory/stock_item')->load($data['item_id']); + if (!$stockItem->getId()) { + $this->_addError(sprintf('StockItem #%d not found.', $data['item_id'])); + } else { + parent::isValidData($data); + } + } + return !count($this->getErrors()); + } +} diff --git a/app/code/core/Mage/CatalogInventory/Model/Stock/Item/Api.php b/app/code/core/Mage/CatalogInventory/Model/Stock/Item/Api.php index 0951d78faa..7febf904f2 100644 --- a/app/code/core/Mage/CatalogInventory/Model/Stock/Item/Api.php +++ b/app/code/core/Mage/CatalogInventory/Model/Stock/Item/Api.php @@ -108,6 +108,14 @@ public function update($productId, $data) $stockData['use_config_manage_stock'] = $data['use_config_manage_stock']; } + if (isset($data['use_config_backorders'])) { + $stockData['use_config_backorders'] = $data['use_config_backorders']; + } + + if (isset($data['backorders'])) { + $stockData['backorders'] = $data['backorders']; + } + $product->setStockData($stockData); try { diff --git a/app/code/core/Mage/CatalogInventory/Model/Stock/Item/Api/V2.php b/app/code/core/Mage/CatalogInventory/Model/Stock/Item/Api/V2.php index a8fee164ac..c92982ef45 100644 --- a/app/code/core/Mage/CatalogInventory/Model/Stock/Item/Api/V2.php +++ b/app/code/core/Mage/CatalogInventory/Model/Stock/Item/Api/V2.php @@ -68,6 +68,14 @@ public function update($productId, $data) $stockData['use_config_manage_stock'] = $data->use_config_manage_stock; } + if (isset($data->use_config_backorders)) { + $stockData['use_config_backorders'] = $data->use_config_backorders; + } + + if (isset($data->backorders)) { + $stockData['backorders'] = $data->backorders; + } + $product->setStockData($stockData); try { diff --git a/app/code/core/Mage/CatalogInventory/etc/api2.xml b/app/code/core/Mage/CatalogInventory/etc/api2.xml new file mode 100644 index 0000000000..09b402ba1a --- /dev/null +++ b/app/code/core/Mage/CatalogInventory/etc/api2.xml @@ -0,0 +1,267 @@ + + + + + + + CatalogInventory + 120 + + + + + cataloginventory + cataloginventory/api2_stock_item + cataloginventory/stock_item + Stock Item + + + 1 + 1 + + + + Item ID + Product ID + Stock ID + Qty + Qty for Item's Status to Become Out of Stock + Use Config Settings for Qty for Item's Status to Become Out of Stock + Qty Uses Decimals + Backorders + Use Config Settings for Backorders + Minimum Qty Allowed in Shopping Cart + Use Config Settings for Minimum Qty Allowed in Shopping Cart + Maximum Qty Allowed in Shopping Cart + Use Config Settings for Maximum Qty Allowed in Shopping Cart + Stock Availability + Low Stock Date + Notify for Quantity Below + Use Config Settings for Notify for Quantity Below + Manage Stock + Use Config Settings for Manage Stock + Automatically Return Credit Memo Item to Stock + Use Config Settings for Qty Increments + Qty Increments + Use Config Settings for Enable Qty Increments + Enable Qty Increments + Can Be Divided into Multiple Boxes for Shipping + + + + + 1 + 1 + 1 + 1 + + + + + + 1 + + + + + /stockitems/:id + entity + + + /stockitems + collection + + + + + + + Regex + /^[0,1]$/ + The "manage_stock" field must be set to 0 or 1. + + + + + Regex + /^[0,1]$/ + The "use_config_manage_stock" field must be set to 0 or 1. + + + + 1 + + Between + -99999999.999999999999.9999 + + + + + Float + Please enter a valid number in "min_qty" field + + + Between + 099999999.9999 + + + + + Regex + /^[0,1]$/ + The "use_config_min_qty" field must be set to 0 or 1. + + + + + Regex + /^[0,1]$/ + The "is_qty_decimal" field must be set to 0 or 1. + + + + + Regex + /^[0,1,2]$/ + The "is_qty_decimal" field must be set to 0, 1, or 2. + + + + + Regex + /^[0,1]$/ + The "use_config_backorders" field must be set to 0 or 1. + + + + + Int + Please enter a valid number in "min_sale_qty" field + + + Between + 099999999 + + + + + Regex + /^[0,1]$/ + The "use_config_min_sale_qty" field must be set to 0 or 1. + + + + + Int + Please enter a valid number in "max_sale_qty" field + + + Between + 099999999 + + + + + Regex + /^[0,1]$/ + The "use_config_max_sale_qty" field must be set to 0 or 1. + + + + + Regex + /^[0,1]$/ + The "is_in_stock" field must be set to 0 or 1. + + + + + Float + Please enter a valid number in "notify_stock_qty" field + + + + + Regex + /^[0,1]$/ + The "use_config_notify_stock_qty" field must be set to 0 or 1. + + + + + Regex + /^[0,1]$/ + The "stock_status_changed_auto" field must be set to 0 or 1. + + + + + Regex + /^[0,1]$/ + The "use_config_qty_increments" field must be set to 0 or 1. + + + + + Int + Please use numbers only in "qty_increments" field. Please avoid spaces or other characters such as dots or commas. + + + Between + 099999999 + Please use numbers only in "qty_increments" field. Please avoid spaces or other characters such as dots or commas. + + + + + Regex + /^[0,1]$/ + The "use_config_enable_qty_inc" field must be set to 0 or 1. + + + + + Regex + /^[0,1]$/ + The "enable_qty_increments" field must be set to 0 or 1. + + + + + Regex + /^[0,1]$/ + The "is_decimal_divided" field must be set to 0 or 1. + + + + + 1 + + + + diff --git a/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.4-0.7.5.php b/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.4-0.7.5.php index 6af5ccc275..d5d48de851 100644 --- a/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.4-0.7.5.php +++ b/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.4-0.7.5.php @@ -30,9 +30,8 @@ $installer->startSetup(); $connection = $installer->getConnection(); /* @var $connection Varien_Db_Adapter_Pdo_Mysql */ -$connection->beginTransaction(); -try { - $installer->run(" + +$installer->run(" CREATE TABLE `{$installer->getTable('cataloginventory_stock_status')}` ( `product_id` int(10) unsigned NOT NULL, `website_id` smallint(5) unsigned NOT NULL, @@ -40,17 +39,14 @@ `qty` decimal(12,4) NOT NULL DEFAULT '0.0000', `stock_status` tinyint(3) unsigned NOT NULL, PRIMARY KEY (`product_id`,`website_id`,`stock_id`), - CONSTRAINT `FK_CATALOGINVENTORY_STOCK_STATUS_STOCK` FOREIGN KEY (`stock_id`) REFERENCES `{$installer->getTable('cataloginventory_stock')}` (`stock_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOGINVENTORY_STOCK_STATUS_PRODUCT` FOREIGN KEY (`product_id`) REFERENCES `{$installer->getTable('catalog_product_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `FK_CATALOGINVENTORY_STOCK_STATUS_WEBSITE` FOREIGN KEY (`website_id`) REFERENCES `{$installer->getTable('core_website')}` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE + CONSTRAINT `FK_CATALOGINVENTORY_STOCK_STATUS_STOCK` FOREIGN KEY (`stock_id`) + REFERENCES `{$installer->getTable('cataloginventory_stock')}` (`stock_id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `FK_CATALOGINVENTORY_STOCK_STATUS_PRODUCT` FOREIGN KEY (`product_id`) + REFERENCES `{$installer->getTable('catalog_product_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `FK_CATALOGINVENTORY_STOCK_STATUS_WEBSITE` FOREIGN KEY (`website_id`) + REFERENCES `{$installer->getTable('core_website')}` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; - "); +"); - Mage::getModel('cataloginventory/stock_status')->rebuild(); -} -catch (Exception $e) { - $connection->rollBack(); - throw $e; -} -$connection->commit(); +Mage::getModel('cataloginventory/stock_status')->rebuild(); $installer->endSetup(); diff --git a/app/code/core/Mage/CatalogRule/Helper/Data.php b/app/code/core/Mage/CatalogRule/Helper/Data.php index 9521b57dd1..dad63f790b 100644 --- a/app/code/core/Mage/CatalogRule/Helper/Data.php +++ b/app/code/core/Mage/CatalogRule/Helper/Data.php @@ -37,20 +37,18 @@ class Mage_CatalogRule_Helper_Data extends Mage_Core_Helper_Abstract * @param float $price * @return float|int */ - public function calcPriceRule ($actionOperator, $ruleAmount, $price) + public function calcPriceRule($actionOperator, $ruleAmount, $price) { $priceRule = 0; switch ($actionOperator) { case 'to_fixed': - $priceRule = $ruleAmount; + $priceRule = min($ruleAmount, $price); break; case 'to_percent': $priceRule = $price * $ruleAmount / 100; break; case 'by_fixed': - $priceRule = $price - $ruleAmount; - // Price can not be negative - $priceRule = ($priceRule < 0) ? 0 : $priceRule; + $priceRule = max(0, $price - $ruleAmount); break; case 'by_percent': $priceRule = $price * (1 - $ruleAmount / 100); diff --git a/app/code/core/Mage/CatalogRule/Model/Observer.php b/app/code/core/Mage/CatalogRule/Model/Observer.php index 3d4252a3e3..c0919e937e 100644 --- a/app/code/core/Mage/CatalogRule/Model/Observer.php +++ b/app/code/core/Mage/CatalogRule/Model/Observer.php @@ -149,7 +149,7 @@ public function processAdminFinalPrice($observer) $key = "$date|$wId|$gId|$pId"; } - elseif ($product->getWebsiteId() != null && $product->getCustomerGroupId() != null) { + elseif (!is_null($product->getWebsiteId()) && !is_null($product->getCustomerGroupId())) { $wId = $product->getWebsiteId(); $gId = $product->getCustomerGroupId(); $pId = $product->getId(); diff --git a/app/code/core/Mage/CatalogSearch/Helper/Data.php b/app/code/core/Mage/CatalogSearch/Helper/Data.php index bb3d215b34..4c02d27083 100644 --- a/app/code/core/Mage/CatalogSearch/Helper/Data.php +++ b/app/code/core/Mage/CatalogSearch/Helper/Data.php @@ -103,10 +103,9 @@ public function getQuery() */ public function isMinQueryLength() { - if (Mage::helper('core/string')->strlen($this->getQueryText()) < $this->getMinQueryLength()) { - return true; - } - return false; + $minQueryLength = $this->getMinQueryLength(); + $thisQueryLength = Mage::helper('core/string')->strlen($this->getQueryText()); + return !$thisQueryLength || $minQueryLength !== '' && $thisQueryLength < $minQueryLength; } /** @@ -116,23 +115,19 @@ public function isMinQueryLength() */ public function getQueryText() { - if (is_null($this->_queryText)) { + if (!isset($this->_queryText)) { $this->_queryText = $this->_getRequest()->getParam($this->getQueryParamName()); if ($this->_queryText === null) { $this->_queryText = ''; } else { - if (is_array($this->_queryText)) { - $this->_queryText = null; - } - $this->_queryText = trim($this->_queryText); - $this->_queryText = Mage::helper('core/string')->cleanString($this->_queryText); - - if (Mage::helper('core/string')->strlen($this->_queryText) > $this->getMaxQueryLength()) { - $this->_queryText = Mage::helper('core/string')->substr( - $this->_queryText, - 0, - $this->getMaxQueryLength() - ); + /* @var $stringHelper Mage_Core_Helper_String */ + $stringHelper = Mage::helper('core/string'); + $this->_queryText = is_array($this->_queryText) ? '' + : $stringHelper->cleanString(trim($this->_queryText)); + + $maxQueryLength = $this->getMaxQueryLength(); + if ($maxQueryLength !== '' && $stringHelper->strlen($this->_queryText) > $maxQueryLength) { + $this->_queryText = $stringHelper->substr($this->_queryText, 0, $maxQueryLength); $this->_isMaxLength = true; } } @@ -147,7 +142,7 @@ public function getQueryText() */ public function getEscapedQueryText() { - return $this->htmlEscape($this->getQueryText()); + return $this->escapeHtml($this->getQueryText()); } /** @@ -211,7 +206,7 @@ public function getAdvancedSearchUrl() * Retrieve minimum query length * * @param mixed $store - * @return int + * @return int|string */ public function getMinQueryLength($store = null) { @@ -222,7 +217,7 @@ public function getMinQueryLength($store = null) * Retrieve maximum query length * * @param mixed $store - * @return int + * @return int|string */ public function getMaxQueryLength($store = null) { @@ -283,23 +278,20 @@ public function getNoteMessages() public function checkNotes($store = null) { if ($this->_isMaxLength) { - $this->addNoteMessage($this->__('Maximum Search query length is %s. Your query was cut.', $this->getMaxQueryLength())); + $this->addNoteMessage($this->__('Maximum Search query length is %s. Your query was cut.', $this->getMaxQueryLength())); } - $stringHelper = Mage::helper('core/string'); /* @var $stringHelper Mage_Core_Helper_String */ + $stringHelper = Mage::helper('core/string'); $searchType = Mage::getStoreConfig(Mage_CatalogSearch_Model_Fulltext::XML_PATH_CATALOG_SEARCH_TYPE); - if ($searchType == Mage_CatalogSearch_Model_Fulltext::SEARCH_TYPE_COMBINE || - $searchType == Mage_CatalogSearch_Model_Fulltext::SEARCH_TYPE_LIKE) { - + if ($searchType == Mage_CatalogSearch_Model_Fulltext::SEARCH_TYPE_COMBINE + || $searchType == Mage_CatalogSearch_Model_Fulltext::SEARCH_TYPE_LIKE + ) { $wordsFull = $stringHelper->splitWords($this->getQueryText(), true); $wordsLike = $stringHelper->splitWords($this->getQueryText(), true, $this->getMaxQueryWords()); - if (count($wordsFull) > count($wordsLike)) { - $wordsCut = array_diff($wordsFull, $wordsLike); - - $wordsCut = array_map(array($this, 'htmlEscape'), $wordsCut); + $wordsCut = array_map(array($this, 'escapeHtml'), array_diff($wordsFull, $wordsLike)); $this->addNoteMessage( $this->__('Maximum words count is %1$s. In your search query was cut next part: %2$s.', $this->getMaxQueryWords(), join(' ', $wordsCut)) ); @@ -318,7 +310,7 @@ public function checkNotes($store = null) public function prepareIndexdata($index, $separator = ' ') { $_index = array(); - foreach ($index as $key => $value) { + foreach ($index as $value) { if (!is_array($value)) { $_index[] = $value; } diff --git a/app/code/core/Mage/CatalogSearch/etc/system.xml b/app/code/core/Mage/CatalogSearch/etc/system.xml index 85622ec4ca..1080fa8c36 100644 --- a/app/code/core/Mage/CatalogSearch/etc/system.xml +++ b/app/code/core/Mage/CatalogSearch/etc/system.xml @@ -63,6 +63,7 @@ text + validate-digits 5 1 1 @@ -71,6 +72,7 @@ text + validate-digits 10 1 1 @@ -79,6 +81,7 @@ text + validate-digits 15 1 1 @@ -98,6 +101,7 @@ text + validate-digits 25 1 1 diff --git a/app/code/core/Mage/Checkout/Block/Cart/Abstract.php b/app/code/core/Mage/Checkout/Block/Cart/Abstract.php index 447ab51062..450ed289ba 100644 --- a/app/code/core/Mage/Checkout/Block/Cart/Abstract.php +++ b/app/code/core/Mage/Checkout/Block/Cart/Abstract.php @@ -129,7 +129,7 @@ public function getCustomer() /** * Get checkout session * - * @return Mage_Checkout_Model_session + * @return Mage_Checkout_Model_Session */ public function getCheckout() { diff --git a/app/code/core/Mage/Checkout/Block/Links.php b/app/code/core/Mage/Checkout/Block/Links.php index 219cca37b7..3bc2138960 100644 --- a/app/code/core/Mage/Checkout/Block/Links.php +++ b/app/code/core/Mage/Checkout/Block/Links.php @@ -72,7 +72,11 @@ public function addCheckoutLink() $parentBlock = $this->getParentBlock(); if ($parentBlock && Mage::helper('core')->isModuleOutputEnabled('Mage_Checkout')) { $text = $this->__('Checkout'); - $parentBlock->addLink($text, 'checkout', $text, true, array(), 60, null, 'class="top-link-checkout"'); + $parentBlock->addLink( + $text, 'checkout', $text, + true, array('_secure' => true), 60, null, + 'class="top-link-checkout"' + ); } return $this; } diff --git a/app/code/core/Mage/Checkout/Block/Onepage.php b/app/code/core/Mage/Checkout/Block/Onepage.php index 3a5f91406a..0bf9cab9f3 100644 --- a/app/code/core/Mage/Checkout/Block/Onepage.php +++ b/app/code/core/Mage/Checkout/Block/Onepage.php @@ -54,146 +54,13 @@ public function getSteps() return $steps; } + /** + * Get active step + * + * @return string + */ public function getActiveStep() { return $this->isCustomerLoggedIn() ? 'billing' : 'login'; } - -/* - // ADDRESSES - - public function getAddressesHtmlSelect($address, $type) - { - if ($this->isCustomerLoggedIn()) { - $options = array(); - foreach ($this->getCustomer()->getAddresses() as $a) { - $options[] = array( - 'value'=>$a->getId(), - 'label'=>$a->getStreet(-1).', '.$a->getCity().', '.$a->getRegion().' '.$a->getPostcode(), - ); - } - - $addressId = $address->getId(); - if (empty($addressId)) { - if ($type=='billing') { - $address = $this->getCustomer()->getPrimaryBillingAddress(); - } else { - $address = $this->getCustomer()->getPrimaryShippingAddress(); - } - if ($address) { - $addressId = $address->getId(); - } - } - - $select = $this->getLayout()->createBlock('core/html_select') - ->setName($type.'_address_id') - ->setId($type.'-address-select') - ->setExtraParams('onchange="'.$type.'.newAddress(!this.value)"') - ->setValue($addressId) - ->setOptions($options); - - $select->addOption('', 'New Address'); - - return $select->getHtml(); - } - return ''; - } - - public function getCountryHtmlSelect($address, $type) - { - $select = $this->getLayout()->createBlock('core/html_select') - ->setName($type.'[country_id]') - ->setId($type.':country_id') - ->setTitle(Mage::helper('checkout')->__('Country')) - ->setClass('validate-select') - ->setValue($address->getCountryId()) - ->setOptions($this->getCountryCollection()->toOptionArray()); - - if ($type==='shipping') { - $select->setExtraParams('onchange="shipping.setSameAsBilling(false);"'); - } - - return $select->getHtml(); - } - - - public function getRegionHtmlSelect($address, $type) - { - $select = $this->getLayout()->createBlock('core/html_select') - ->setName($type.'[region]') - ->setId($type.':region') - ->setTitle(Mage::helper('checkout')->__('State/Province')) - ->setClass('required-entry validate-state') - ->setValue($address->getRegionId()) - ->setOptions($this->getRegionCollection()->toOptionArray()); - - return $select->getHtml(); - } - - // LOGIN STEP - - public function getMessages() - { - return Mage::getSingleton('customer/session')->getMessages(true); - } - - public function getLoginPostAction() - { - return Mage::getUrl('customer/account/loginPost', array('_secure'=>true)); - } - - public function getSuccessUrl() - { - return $this->getUrl('* /*');//////////// - } - - public function getErrorUrl() - { - return $this->getUrl('* /*');//////////// - } - - public function getMethod() - { - return $this->getQuote()->getCheckoutMethod(); - } - - public function getMethodData() - { - return $this->getCheckout()->getMethodData(); - } - - // BILLING STEP - - public function getBillingAddress() { - if (!$this->isCustomerLoggedIn()) { - return $this->getQuote()->getBillingAddress(); - } else { - return Mage::getModel('sales/quote_address'); - } - } - - // SHIPPING STEP - - public function getShippingAddress() - { - if (!$this->isCustomerLoggedIn()) { - return $this->getQuote()->getShippingAddress(); - } else { - return Mage::getModel('sales/quote_address'); - } - } - - // PAYMENT STEP - - public function getPayment() - { - $payment = $this->getQuote()->getPayment(); - if (empty($payment)) { - $payment = Mage::getModel('sales/quote_payment'); - } else { - $payment->setCcNumber(null)->setCcCid(null); - } - return $payment; - } - */ } diff --git a/app/code/core/Mage/Checkout/Model/Cart/Product/Api.php b/app/code/core/Mage/Checkout/Model/Cart/Product/Api.php index 1288f787c0..c45a8e5845 100644 --- a/app/code/core/Mage/Checkout/Model/Cart/Product/Api.php +++ b/app/code/core/Mage/Checkout/Model/Cart/Product/Api.php @@ -34,20 +34,15 @@ class Mage_Checkout_Model_Cart_Product_Api extends Mage_Checkout_Model_Api_Resource_Product { + /** + * Base preparation of product data + * + * @param mixed $data + * @return null|array + */ protected function _prepareProductsData($data) { - if (!is_array($data)) { - return null; - } - - $_data = array(); - if (is_array($data) && is_null($data[0])) { - $_data[] = $data; - } else { - $_data = $data; - } - - return $_data; + return is_array($data) ? $data : null; } /** @@ -133,7 +128,8 @@ public function update($quoteId, $productsData, $store=null) } /** @var $quoteItem Mage_Sales_Model_Quote_Item */ - $quoteItem = $this->_getQuoteItemByProduct($quote, $productByItem, $this->_getProductRequest($productItem)); + $quoteItem = $this->_getQuoteItemByProduct($quote, $productByItem, + $this->_getProductRequest($productItem)); if (is_null($quoteItem->getId())) { $errors[] = Mage::helper('checkout')->__("One item of products is not belong any of quote item"); continue; diff --git a/app/code/core/Mage/Checkout/Model/Cart/Product/Api/V2.php b/app/code/core/Mage/Checkout/Model/Cart/Product/Api/V2.php index 691211f6d9..2ff515026b 100644 --- a/app/code/core/Mage/Checkout/Model/Cart/Product/Api/V2.php +++ b/app/code/core/Mage/Checkout/Model/Cart/Product/Api/V2.php @@ -58,18 +58,18 @@ protected function _prepareProductsData($data){ $arr[$key] = $assocArr; } } - $arr = $this->_prepareData($arr); - return parent::_prepareData($arr); + $arr = $this->_prepareProductsData($arr); + return parent::_prepareProductsData($arr); } if (is_array($data)) { foreach ($data as $key => $value) { if (is_object($value) || is_array($value)) { - $data[$key] = $this->_prepareData($value); + $data[$key] = $this->_prepareProductsData($value); } else { $data[$key] = $value; } } - return parent::_prepareData($data); + return parent::_prepareProductsData($data); } return $data; } diff --git a/app/code/core/Mage/Checkout/Model/Type/Onepage.php b/app/code/core/Mage/Checkout/Model/Type/Onepage.php index 0d4bc722a1..e16724a482 100644 --- a/app/code/core/Mage/Checkout/Model/Type/Onepage.php +++ b/app/code/core/Mage/Checkout/Model/Type/Onepage.php @@ -264,7 +264,7 @@ public function saveBilling($data, $customerAddressId) $addressData = $addressForm->extractData($addressForm->prepareRequest($data)); $addressErrors = $addressForm->validateData($addressData); if ($addressErrors !== true) { - return array('error' => 1, 'message' => $addressErrors); + return array('error' => 1, 'message' => array_values($addressErrors)); } $addressForm->compactData($addressData); //unset billing address attributes which were not shown in form diff --git a/app/code/core/Mage/Checkout/etc/config.xml b/app/code/core/Mage/Checkout/etc/config.xml index 8a9d3cb063..84d467d8fb 100644 --- a/app/code/core/Mage/Checkout/etc/config.xml +++ b/app/code/core/Mage/Checkout/etc/config.xml @@ -170,7 +170,6 @@ - /checkout/cart /checkout/onepage /checkout/multishipping diff --git a/app/code/core/Mage/Cms/data/cms_setup/data-upgrade-1.6.0.0.0-1.6.0.0.1.php b/app/code/core/Mage/Cms/data/cms_setup/data-upgrade-1.6.0.0.0-1.6.0.0.1.php index 7e105285c3..be88e876e5 100644 --- a/app/code/core/Mage/Cms/data/cms_setup/data-upgrade-1.6.0.0.0-1.6.0.0.1.php +++ b/app/code/core/Mage/Cms/data/cms_setup/data-upgrade-1.6.0.0.0-1.6.0.0.1.php @@ -148,7 +148,7 @@
    CATEGORY_INFOStores the category info on the page, that allows to display pages more quickly.
    COMPARE
    EXTERNAL_NO_CACHEA flag, which indicates whether caching is disabled or not.
    FRONTEND
    GUEST-VIEWAllows guests to edit their orders.
    LAST_CATEGORY
    NEWMESSAGEIndicates whether a new message has been received.
    NO_CACHEIndicates whether it is allowed to use cache.
    PERSISTENT_SHOPPING_CART
    oauth_consumer
    + + + oauth_token
    +
    + + oauth_nonce
    +
    + + + + + + Mage_OAuth_Block + + + + + Mage_OAuth_Helper + + + + + + Mage_OAuth + Mage_OAuth_Model_Resource_Setup + + + + + + + + oauth/observer + afterCustomerLogin + + + + + + + oauth/observer + afterAdminLogin + + + + + + + oauth/observer + afterAdminLoginFailed + + + + + + + + + + + + Mage_OAuth_Adminhtml + + + + + + + + + + + Mage_OAuth.csv + + + + + + + + oauth.xml + + + + + + + + standard + + Mage_OAuth + oauth + + + + + + + oauth.xml + + + + + + + + Mage_OAuth.csv + + + + + + + + + 100 + 120 + + + general + + + + + diff --git a/app/code/core/Mage/OAuth/etc/system.xml b/app/code/core/Mage/OAuth/etc/system.xml new file mode 100644 index 0000000000..66e678d067 --- /dev/null +++ b/app/code/core/Mage/OAuth/etc/system.xml @@ -0,0 +1,89 @@ + + + + + + + service + text + 300 + 1 + 1 + 1 + + + + text + 300 + 1 + 0 + 0 + + + + text + Integer. Launch cleanup in X OAuth requests. 0 (not recommended) - to disable cleanup + 10 + 1 + 0 + 0 + + + + Cleanup entries older than X minutes. + text + 20 + 1 + 0 + 0 + + + + + + text + 300 + 1 + 1 + 1 + + + + + + + + diff --git a/app/code/core/Mage/OAuth/sql/oauth_setup/install-1.0.0.0.php b/app/code/core/Mage/OAuth/sql/oauth_setup/install-1.0.0.0.php new file mode 100644 index 0000000000..508beb3e4b --- /dev/null +++ b/app/code/core/Mage/OAuth/sql/oauth_setup/install-1.0.0.0.php @@ -0,0 +1,198 @@ +startSetup(); + +/** @var $adapter Varien_Db_Adapter_Pdo_Mysql */ +$adapter = $installer->getConnection(); + +/** + * Create table 'oauth/consumer' + */ +$table = $adapter->newTable($installer->getTable('oauth/consumer')) + ->addColumn('entity_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array( + 'identity' => true, + 'unsigned' => true, + 'nullable' => false, + 'primary' => true, + ), 'Entity Id') + ->addColumn('created_at', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null, array( + 'nullable' => false, + 'default' => Varien_Db_Ddl_Table::TIMESTAMP_INIT + ), 'Created At') + ->addColumn('updated_at', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null, array( + 'nullable' => true + ), 'Updated At') + ->addColumn('name', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255, array( + 'nullable' => false + ), 'Name of consumer') + ->addColumn('key', Varien_Db_Ddl_Table::TYPE_VARCHAR, Mage_OAuth_Model_Consumer::KEY_LENGTH, array( + 'nullable' => false + ), 'Key code') + ->addColumn('secret', Varien_Db_Ddl_Table::TYPE_VARCHAR, Mage_OAuth_Model_Consumer::SECRET_LENGTH, array( + 'nullable' => false + ), 'Secret code') + ->addColumn('callback_url', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255, array(), 'Callback URL') + ->addColumn('rejected_callback_url', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255, array( + 'nullable' => false + ), 'Rejected callback URL') + ->addIndex( + $installer->getIdxName( + $installer->getTable('oauth/consumer'), + array('key'), + Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE + ), + array('key'), + array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE)) + ->addIndex( + $installer->getIdxName( + $installer->getTable('oauth/consumer'), + array('secret'), + Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE + ), + array('secret'), + array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE)) + ->addIndex($installer->getIdxName('oauth/consumer', array('created_at')), array('created_at')) + ->addIndex($installer->getIdxName('oauth/consumer', array('updated_at')), array('updated_at')) + ->setComment('OAuth Consumers'); +$adapter->createTable($table); + +/** + * Create table 'oauth/token' + */ +$table = $adapter->newTable($installer->getTable('oauth/token')) + ->addColumn('entity_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array( + 'identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true, + ), 'Entity ID') + ->addColumn('consumer_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array( + 'unsigned' => true, + 'nullable' => false + ), 'Consumer ID') + ->addColumn('admin_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array( + 'unsigned' => true, + 'nullable' => true + ), 'Admin user ID') + ->addColumn('customer_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array( + 'unsigned' => true, + 'nullable' => true + ), 'Customer user ID') + ->addColumn('type', Varien_Db_Ddl_Table::TYPE_TEXT, 16, array( + 'nullable' => false + ), 'Token Type') + ->addColumn('token', Varien_Db_Ddl_Table::TYPE_TEXT, Mage_OAuth_Model_Token::LENGTH_TOKEN, array( + 'nullable' => false + ), 'Token') + ->addColumn('secret', Varien_Db_Ddl_Table::TYPE_TEXT, Mage_OAuth_Model_Token::LENGTH_SECRET, array( + 'nullable' => false + ), 'Token Secret') + ->addColumn('verifier', Varien_Db_Ddl_Table::TYPE_TEXT, Mage_OAuth_Model_Token::LENGTH_VERIFIER, array( + 'nullable' => true + ), 'Token Verifier') + ->addColumn('callback_url', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array( + 'nullable' => false + ), 'Token Callback URL') + ->addColumn('revoked', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array( + 'unsigned' => true, + 'nullable' => false, + 'default' => 0, + ), 'Is Token revoked') + ->addColumn('authorized', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array( + 'unsigned' => true, + 'nullable' => false, + 'default' => 0, + ), 'Is Token authorized') + ->addColumn('created_at', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null, array( + 'nullable' => false, + 'default' => Varien_Db_Ddl_Table::TIMESTAMP_INIT + ), 'Token creation timestamp') + ->addIndex( + $installer->getIdxName( + $installer->getTable('oauth/token'), + array('consumer_id'), + Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX + ), + array('consumer_id'), + array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX)) + ->addIndex( + $installer->getIdxName( + $installer->getTable('oauth/token'), + array('token'), + Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE + ), + array('token'), + array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE)) + ->addForeignKey( + $installer->getFkName('oauth/token', 'admin_id', $installer->getTable('admin/user'), 'user_id'), + 'admin_id', + $installer->getTable('admin/user'), + 'user_id', + Varien_Db_Ddl_Table::ACTION_CASCADE, + Varien_Db_Ddl_Table::ACTION_CASCADE) + ->addForeignKey( + $installer->getFkName('oauth/token', 'consumer_id', 'oauth/consumer', 'entity_id'), + 'consumer_id', + $installer->getTable('oauth/consumer'), + 'entity_id', + Varien_Db_Ddl_Table::ACTION_CASCADE, + Varien_Db_Ddl_Table::ACTION_CASCADE) + ->addForeignKey( + $installer->getFkName('oauth/token', 'customer_id', $installer->getTable('customer/entity'), 'entity_id'), + 'customer_id', + $installer->getTable('customer/entity'), + 'entity_id', + Varien_Db_Ddl_Table::ACTION_CASCADE, + Varien_Db_Ddl_Table::ACTION_CASCADE) + ->setComment('OAuth Tokens'); +$adapter->createTable($table); + +/** + * Create table 'oauth/nonce + */ +$table = $adapter->newTable($installer->getTable('oauth/nonce')) + ->addColumn('nonce', Varien_Db_Ddl_Table::TYPE_VARCHAR, 32, array( + 'nullable' => false + ), 'Nonce String') + ->addColumn('timestamp', Varien_Db_Ddl_Table::TYPE_INTEGER, 10, array( + 'unsigned' => true, + 'nullable' => false + ), 'Nonce Timestamp') + ->addIndex( + $installer->getIdxName( + $installer->getTable('oauth/nonce'), + array('nonce'), + Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE + ), + array('nonce'), + array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE)) + ->setOption('type', 'MyISAM'); +$adapter->createTable($table); + +$installer->endSetup(); diff --git a/app/code/core/Mage/Page/Block/Html/Notices.php b/app/code/core/Mage/Page/Block/Html/Notices.php index f54c1bac6f..43207bbb4a 100644 --- a/app/code/core/Mage/Page/Block/Html/Notices.php +++ b/app/code/core/Mage/Page/Block/Html/Notices.php @@ -33,10 +33,12 @@ */ class Mage_Page_Block_Html_Notices extends Mage_Core_Block_Template { + /** - * Path to configuration, check is enable cookie restriction mode + * Cookie restriction lifetime configuration path */ - const XML_PATH_COOKIE_RESTRICTION = 'web/cookie/cookie_restriction'; + const XML_PATH_COOKIE_RESTRICTION_LIFETIME = 'web/cookie/cookie_restriction_lifetime'; + /** * Check if noscript notice should be displayed @@ -58,6 +60,16 @@ public function displayDemoNotice() return Mage::getStoreConfig('design/head/demonotice'); } + /** + * Get cookie restriction lifetime (in seconds) + * + * @return int + */ + public function getCookieRestrictionLifetime() + { + return (int)Mage::getStoreConfig(self::XML_PATH_COOKIE_RESTRICTION_LIFETIME); + } + /** * Check if cookie restriction notice should be displayed * @@ -79,28 +91,4 @@ public function getPrivacyPolicyLink() { return Mage::getUrl('privacy-policy-cookie-restriction-mode'); } - - /** - * Return serialzed list of accepted save cookie website - * - * @return string - */ - public function getAcceptedSaveCookiesWebsiteIds() - { - $acceptedSaveCookiesWebsites = $this->_getAcceptedSaveCookiesWebsites(); - $acceptedSaveCookiesWebsites[Mage::app()->getWebsite()->getId()] = 1; - return serialize($acceptedSaveCookiesWebsites); - } - - /** - * Get accepted save cookies websites - * - * @return array - */ - protected function _getAcceptedSaveCookiesWebsites() - { - $serializedList = Mage::getSingleton('core/cookie')->get(Mage_Page_Helper_Data::IS_USER_ALLOWED_SAVE_COOKIE); - $unSerializedList = unserialize($serializedList); - return is_array($unSerializedList) ? $unSerializedList : array(); - } } diff --git a/app/code/core/Mage/Page/Helper/Data.php b/app/code/core/Mage/Page/Helper/Data.php index 9dd649ccaa..d7daefb551 100644 --- a/app/code/core/Mage/Page/Helper/Data.php +++ b/app/code/core/Mage/Page/Helper/Data.php @@ -29,8 +29,5 @@ */ class Mage_Page_Helper_Data extends Mage_Core_Helper_Abstract { - /** - * Cookie name for users who allowed cookie save - */ - const IS_USER_ALLOWED_SAVE_COOKIE = 'user_allowed_save_cookie'; + } diff --git a/app/code/core/Mage/Paygate/etc/system.xml b/app/code/core/Mage/Paygate/etc/system.xml index 8182a54381..e2454d0fb1 100644 --- a/app/code/core/Mage/Paygate/etc/system.xml +++ b/app/code/core/Mage/Paygate/etc/system.xml @@ -86,6 +86,7 @@ text + validate-email 11 1 1 diff --git a/app/code/core/Mage/Payment/Block/Form/Banktransfer.php b/app/code/core/Mage/Payment/Block/Form/Banktransfer.php new file mode 100644 index 0000000000..d506b49db8 --- /dev/null +++ b/app/code/core/Mage/Payment/Block/Form/Banktransfer.php @@ -0,0 +1,62 @@ +setTemplate('payment/form/banktransfer.phtml'); + } + + /** + * Get instructions text from config + * + * @return string + */ + public function getInstructions() + { + if (is_null($this->_instructions)) { + $this->_instructions = $this->getMethod()->getInstructions(); + } + return $this->_instructions; + } + +} diff --git a/app/code/core/Mage/Payment/Block/Form/Cashondelivery.php b/app/code/core/Mage/Payment/Block/Form/Cashondelivery.php new file mode 100644 index 0000000000..85823ac62e --- /dev/null +++ b/app/code/core/Mage/Payment/Block/Form/Cashondelivery.php @@ -0,0 +1,62 @@ +setTemplate('payment/form/cashondelivery.phtml'); + } + + /** + * Get instructions text from config + * + * @return string + */ + public function getInstructions() + { + if (is_null($this->_instructions)) { + $this->_instructions = $this->getMethod()->getInstructions(); + } + return $this->_instructions; + } + +} diff --git a/app/code/core/Mage/Payment/Block/Info/Banktransfer.php b/app/code/core/Mage/Payment/Block/Info/Banktransfer.php new file mode 100644 index 0000000000..324b20d053 --- /dev/null +++ b/app/code/core/Mage/Payment/Block/Info/Banktransfer.php @@ -0,0 +1,61 @@ +setTemplate('payment/info/banktransfer.phtml'); + } + + /** + * Get instructions text from order payment + * (or from config, if instructions are missed in payment) + * + * @return string + */ + public function getInstructions() + { + if (is_null($this->_instructions)) { + $this->_instructions = $this->getInfo()->getAdditionalInformation('instructions'); + if(empty($this->_instructions)) { + $this->_instructions = $this->getMethod()->getInstructions(); + } + } + return $this->_instructions; + } +} diff --git a/app/code/core/Mage/Payment/Model/Info.php b/app/code/core/Mage/Payment/Model/Info.php index 8a1e33594c..97648dc154 100644 --- a/app/code/core/Mage/Payment/Model/Info.php +++ b/app/code/core/Mage/Payment/Model/Info.php @@ -66,21 +66,23 @@ public function getData($key='', $index=null) * Retrieve payment method model object * * @return Mage_Payment_Model_Method_Abstract + * @throws Mage_Core_Exception */ public function getMethodInstance() { if (!$this->hasMethodInstance()) { - if ($method = $this->getMethod()) { - if ($instance = Mage::helper('payment')->getMethodInstance($this->getMethod())) { + if ($this->getMethod()) { + $instance = Mage::helper('payment')->getMethodInstance($this->getMethod()); + if ($instance) { $instance->setInfoInstance($this); $this->setMethodInstance($instance); return $instance; } } - } else { - return $this->_getData('method_instance'); + Mage::throwException(Mage::helper('payment')->__('The requested Payment Method is not available.')); } - Mage::throwException(Mage::helper('payment')->__('Cannot retrieve payment method instance.')); + + return $this->_getData('method_instance'); } /** diff --git a/app/code/core/Mage/Payment/Model/Method/Abstract.php b/app/code/core/Mage/Payment/Model/Method/Abstract.php index 49d46906e7..809c42d991 100644 --- a/app/code/core/Mage/Payment/Model/Method/Abstract.php +++ b/app/code/core/Mage/Payment/Model/Method/Abstract.php @@ -629,14 +629,16 @@ public function prepareSave() * * TODO: payment method instance is not supposed to know about quote * - * @param Mage_Sales_Model_Quote $quote + * @param Mage_Sales_Model_Quote|null $quote * * @return bool */ public function isAvailable($quote = null) { $checkResult = new StdClass; - $checkResult->isAvailable = (bool)(int)$this->getConfigData('active', ($quote ? $quote->getStoreId() : null)); + $isActive = (bool)(int)$this->getConfigData('active', $quote ? $quote->getStoreId() : null); + $checkResult->isAvailable = $isActive; + $checkResult->isDeniedInConfig = !$isActive; // for future use in observers Mage::dispatchEvent('payment_method_is_active', array( 'result' => $checkResult, 'method_instance' => $this, @@ -647,7 +649,7 @@ public function isAvailable($quote = null) if ($checkResult->isAvailable) { $implementsRecurring = $this->canManageRecurringProfiles(); // the $quote->hasRecurringItems() causes big performance impact, thus it has to be called last - if ($quote && (!$implementsRecurring) && $quote->hasRecurringItems()) { + if ($quote && !$implementsRecurring && $quote->hasRecurringItems()) { $checkResult->isAvailable = false; } } @@ -704,7 +706,7 @@ public function getDebugFlag() } /** - * Used to call debug method from not Paymant Method context + * Used to call debug method from not Payment Method context * * @param mixed $debugData */ diff --git a/app/code/core/Mage/Payment/Model/Method/Banktransfer.php b/app/code/core/Mage/Payment/Model/Method/Banktransfer.php new file mode 100644 index 0000000000..b95d054d86 --- /dev/null +++ b/app/code/core/Mage/Payment/Model/Method/Banktransfer.php @@ -0,0 +1,59 @@ +getConfigData('instructions')); + } + +} diff --git a/app/code/core/Mage/Payment/Model/Method/Cashondelivery.php b/app/code/core/Mage/Payment/Model/Method/Cashondelivery.php new file mode 100644 index 0000000000..2e238489a9 --- /dev/null +++ b/app/code/core/Mage/Payment/Model/Method/Cashondelivery.php @@ -0,0 +1,58 @@ +getConfigData('instructions')); + } + +} diff --git a/app/code/core/Mage/Payment/Model/Method/Cc.php b/app/code/core/Mage/Payment/Model/Method/Cc.php index cae20a81bd..f605ae823a 100644 --- a/app/code/core/Mage/Payment/Model/Method/Cc.php +++ b/app/code/core/Mage/Payment/Model/Method/Cc.php @@ -197,7 +197,7 @@ public function getVerificationRegEx() 'SM' => '/^[0-9]{3,4}$/', // Switch or Maestro 'SO' => '/^[0-9]{3,4}$/', // Solo 'OT' => '/^[0-9]{3,4}$/', - 'JCB' => '/^[0-9]{4}$/' //JCB + 'JCB' => '/^[0-9]{3,4}$/' //JCB ); return $verificationExpList; } @@ -271,6 +271,7 @@ public function validateCcNumOther($ccNumber) /** * Check whether there are CC types set in configuration * + * @param Mage_Sales_Model_Quote|null $quote * @return bool */ public function isAvailable($quote = null) diff --git a/app/code/core/Mage/Payment/Model/Method/Free.php b/app/code/core/Mage/Payment/Model/Method/Free.php index a1aada4d73..a55dbef867 100644 --- a/app/code/core/Mage/Payment/Model/Method/Free.php +++ b/app/code/core/Mage/Payment/Model/Method/Free.php @@ -35,7 +35,7 @@ class Mage_Payment_Model_Method_Free extends Mage_Payment_Model_Method_Abstract { /** - * XML Pathes for configuration constants + * XML Paths for configuration constants */ const XML_PATH_PAYMENT_FREE_ACTIVE = 'payment/free/active'; const XML_PATH_PAYMENT_FREE_ORDER_STATUS = 'payment/free/order_status'; @@ -45,7 +45,7 @@ class Mage_Payment_Model_Method_Free extends Mage_Payment_Model_Method_Abstract * Payment Method features * @var bool */ - protected $_canAuthorize = true; + protected $_canAuthorize = true; /** * Payment code name @@ -57,25 +57,22 @@ class Mage_Payment_Model_Method_Free extends Mage_Payment_Model_Method_Abstract /** * Check whether method is available * - * @param Mage_Sales_Model_Quote $quote + * @param Mage_Sales_Model_Quote|null $quote * @return bool */ public function isAvailable($quote = null) { - return parent::isAvailable($quote) && (!empty($quote)) - && (Mage::app()->getStore()->roundPrice($quote->getGrandTotal()) == 0); + return parent::isAvailable($quote) && !empty($quote) + && Mage::app()->getStore()->roundPrice($quote->getGrandTotal()) == 0; } /** - * Get config peyment action + * Get config payment action, do nothing if status is pending * - * @return string + * @return string|null */ public function getConfigPaymentAction() { - if ('pending' == $this->getConfigData('order_status')) { - return null; // do nothing if status pending - } - return parent::getConfigPaymentAction(); + return $this->getConfigData('order_status') == 'pending' ? null : parent::getConfigPaymentAction(); } } diff --git a/app/code/core/Mage/Payment/Model/Observer.php b/app/code/core/Mage/Payment/Model/Observer.php index e95381b3c4..55f119deda 100644 --- a/app/code/core/Mage/Payment/Model/Observer.php +++ b/app/code/core/Mage/Payment/Model/Observer.php @@ -51,8 +51,7 @@ public function salesOrderBeforeSave($observer) return $this; } - if ($order->isCanceled() || - $order->getState() === Mage_Sales_Model_Order::STATE_CLOSED ) { + if ($order->isCanceled() || $order->getState() === Mage_Sales_Model_Order::STATE_CLOSED) { return $this; } /** @@ -108,4 +107,20 @@ public function prepareProductRecurringProfileOptions($observer) } $product->addCustomOption('additional_options', serialize($infoOptions)); } + + /** + * Sets current instructions for bank transfer account + * + * @param Varien_Event_Observer $observer + * @return void + */ + public function beforeOrderPaymentSave(Varien_Event_Observer $observer) + { + /** @var Mage_Sales_Model_Order_Payment $payment */ + $payment = $observer->getEvent()->getPayment(); + if($payment->getMethod() === Mage_Payment_Model_Method_Banktransfer::PAYMENT_METHOD_BANKTRANSFER_CODE) { + $payment->setAdditionalInformation('instructions', + $payment->getMethodInstance()->getInstructions()); + } + } } diff --git a/app/code/core/Mage/Payment/etc/config.xml b/app/code/core/Mage/Payment/etc/config.xml index 28890d5ee7..6d27a94de6 100644 --- a/app/code/core/Mage/Payment/etc/config.xml +++ b/app/code/core/Mage/Payment/etc/config.xml @@ -107,6 +107,14 @@ + + + + payment/observer + beforeOrderPaymentSave + + + @@ -184,6 +192,22 @@ 0 offline + + 0 + payment/method_banktransfer + pending + Bank Transfer Payment + 0 + offline + + + 0 + payment/method_cashondelivery + pending + Cash On Delivery + 0 + offline + diff --git a/app/code/core/Mage/Payment/etc/system.xml b/app/code/core/Mage/Payment/etc/system.xml index 92a059f376..12801c8fca 100644 --- a/app/code/core/Mage/Payment/etc/system.xml +++ b/app/code/core/Mage/Payment/etc/system.xml @@ -445,6 +445,180 @@ + + + text + 5 + 1 + 1 + 1 + + + + select + adminhtml/system_config_source_yesno + 1 + 1 + 1 + 0 + + + <label>Title</label> + <frontend_type>text</frontend_type> + <sort_order>10</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>1</show_in_store> + + + + select + adminhtml/system_config_source_order_status_new + 20 + 1 + 1 + 0 + + + + allowspecific + 50 + adminhtml/system_config_source_payment_allspecificcountries + 1 + 1 + 0 + + + + multiselect + 51 + adminhtml/system_config_source_country + 1 + 1 + 0 + 1 + + + + textarea + 62 + 1 + 1 + 1 + + + + text + 98 + 1 + 1 + 0 + + + + text + 99 + 1 + 1 + 0 + + + + text + 100 + 1 + 1 + 0 + + + + + + text + 5 + 1 + 1 + 1 + + + + select + adminhtml/system_config_source_yesno + 1 + 1 + 1 + 0 + + + <label>Title</label> + <frontend_type>text</frontend_type> + <sort_order>10</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>1</show_in_store> + + + + select + adminhtml/system_config_source_order_status_new + 20 + 1 + 1 + 0 + + + + allowspecific + 50 + adminhtml/system_config_source_payment_allspecificcountries + 1 + 1 + 0 + + + + multiselect + 51 + adminhtml/system_config_source_country + 1 + 1 + 0 + 1 + + + + textarea + 62 + 1 + 1 + 1 + + + + text + 98 + 1 + 1 + 0 + + + + text + 99 + 1 + 1 + 0 + + + + text + 100 + 1 + 1 + 0 + + + diff --git a/app/code/core/Mage/Paypal/Model/Express/Checkout.php b/app/code/core/Mage/Paypal/Model/Express/Checkout.php index ebe6c27dc9..5f02c592ef 100644 --- a/app/code/core/Mage/Paypal/Model/Express/Checkout.php +++ b/app/code/core/Mage/Paypal/Model/Express/Checkout.php @@ -370,6 +370,8 @@ public function returnFromPaypal($token) ->callGetExpressCheckoutDetails(); $quote = $this->_quote; + $this->_ignoreAddressValidation(); + // import billing address $billingAddress = $quote->getBillingAddress(); $exportedBillingAddress = $this->_api->getExportedBillingAddress(); @@ -380,22 +382,7 @@ public function returnFromPaypal($token) $quote->setCustomerLastname($billingAddress->getLastname()); $quote->setCustomerSuffix($billingAddress->getSuffix()); $quote->setCustomerNote($exportedBillingAddress->getData('note')); - foreach ($exportedBillingAddress->getExportedKeys() as $key) { - $oldData = $billingAddress->getDataUsingMethod($key); - $isEmpty = null; - if (is_array($oldData)) { - foreach($oldData as $val) { - if(!empty($val)) { - $isEmpty = false; - break; - } - $isEmpty = true; - } - } - if (empty($oldData) || $isEmpty === true) { - $billingAddress->setDataUsingMethod($key, $exportedBillingAddress->getData($key)); - } - } + $this->_setExportedAddressData($billingAddress, $exportedBillingAddress); // import shipping address $exportedShippingAddress = $this->_api->getExportedShippingAddress(); @@ -403,9 +390,7 @@ public function returnFromPaypal($token) $shippingAddress = $quote->getShippingAddress(); if ($shippingAddress) { if ($exportedShippingAddress) { - foreach ($exportedShippingAddress->getExportedKeys() as $key) { - $shippingAddress->setDataUsingMethod($key, $exportedShippingAddress->getData($key)); - } + $this->_setExportedAddressData($shippingAddress, $exportedShippingAddress); $shippingAddress->setCollectShippingRates(true); $shippingAddress->setSameAsBilling(0); } @@ -424,7 +409,6 @@ public function returnFromPaypal($token) ); } } - $this->_ignoreAddressValidation(); // import payment info $payment = $quote->getPayment(); @@ -623,8 +607,8 @@ private function _ignoreAddressValidation() $this->_quote->getBillingAddress()->setShouldIgnoreValidation(true); if (!$this->_quote->getIsVirtual()) { $this->_quote->getShippingAddress()->setShouldIgnoreValidation(true); - if (!$this->_config->requireBillingAddress && !$this->getCustomerSession()->isLoggedIn()) { - $this->_quote->getBillingAddress()->setSameAsShipping(1); + if (!$this->_config->requireBillingAddress && !$this->_quote->getBillingAddress()->getEmail()) { + $this->_quote->getBillingAddress()->setSameAsBilling(1); } } } @@ -689,6 +673,32 @@ public function getCheckoutMethod() return $this->_quote->getCheckoutMethod(); } + /** + * Sets address data from exported address + * + * @param Mage_Sales_Model_Quote_Address $address + * @param array $exportedAddress + */ + protected function _setExportedAddressData($address, $exportedAddress) + { + foreach ($exportedAddress->getExportedKeys() as $key) { + $oldData = $address->getDataUsingMethod($key); + $isEmpty = null; + if (is_array($oldData)) { + foreach($oldData as $val) { + if(!empty($val)) { + $isEmpty = false; + break; + } + $isEmpty = true; + } + } + if (empty($oldData) || $isEmpty === true) { + $address->setDataUsingMethod($key, $exportedAddress->getData($key)); + } + } + } + /** * Set create billing agreement flag to api call * diff --git a/app/code/core/Mage/Paypal/Model/Hostedpro/Request.php b/app/code/core/Mage/Paypal/Model/Hostedpro/Request.php index 713d943b4c..7f04428006 100644 --- a/app/code/core/Mage/Paypal/Model/Hostedpro/Request.php +++ b/app/code/core/Mage/Paypal/Model/Hostedpro/Request.php @@ -56,7 +56,7 @@ class Mage_Paypal_Model_Hostedpro_Request extends Varien_Object protected $_buttonVarFormat = 'L_BUTTONVAR%d'; /** - * Request Parameters wich dont have to wrap as button vars + * Request Parameters which dont have to wrap as button vars * * @var array */ diff --git a/app/code/core/Mage/Paypal/etc/system.xml b/app/code/core/Mage/Paypal/etc/system.xml index 07fbf8852c..d6333831a6 100644 --- a/app/code/core/Mage/Paypal/etc/system.xml +++ b/app/code/core/Mage/Paypal/etc/system.xml @@ -77,7 +77,7 @@ 1 1 10 - validate-email + validate-email diff --git a/app/code/core/Mage/ProductAlert/Model/Observer.php b/app/code/core/Mage/ProductAlert/Model/Observer.php index 44570d3999..f1882d295d 100644 --- a/app/code/core/Mage/ProductAlert/Model/Observer.php +++ b/app/code/core/Mage/ProductAlert/Model/Observer.php @@ -97,7 +97,7 @@ protected function _getWebsites() * Process price emails * * @param Mage_ProductAlert_Model_Email $email - * @return Mage_productAlert_Model_Observer + * @return Mage_ProductAlert_Model_Observer */ protected function _processPrice(Mage_ProductAlert_Model_Email $email) { @@ -108,7 +108,10 @@ protected function _processPrice(Mage_ProductAlert_Model_Email $email) if (!$website->getDefaultGroup() || !$website->getDefaultGroup()->getDefaultStore()) { continue; } - if (!Mage::getStoreConfig(self::XML_PATH_PRICE_ALLOW, $website->getDefaultGroup()->getDefaultStore()->getId())) { + if (!Mage::getStoreConfig( + self::XML_PATH_PRICE_ALLOW, + $website->getDefaultGroup()->getDefaultStore()->getId() + )) { continue; } try { @@ -182,7 +185,7 @@ protected function _processPrice(Mage_ProductAlert_Model_Email $email) * Process stock emails * * @param Mage_ProductAlert_Model_Email $email - * @return Mage_productAlert_Model_Observer + * @return Mage_ProductAlert_Model_Observer */ protected function _processStock(Mage_ProductAlert_Model_Email $email) { @@ -194,7 +197,10 @@ protected function _processStock(Mage_ProductAlert_Model_Email $email) if (!$website->getDefaultGroup() || !$website->getDefaultGroup()->getDefaultStore()) { continue; } - if (!Mage::getStoreConfig(self::XML_PATH_STOCK_ALLOW, $website->getDefaultGroup()->getDefaultStore()->getId())) { + if (!Mage::getStoreConfig( + self::XML_PATH_STOCK_ALLOW, + $website->getDefaultGroup()->getDefaultStore()->getId() + )) { continue; } try { @@ -232,7 +238,7 @@ protected function _processStock(Mage_ProductAlert_Model_Email $email) $product = Mage::getModel('catalog/product') ->setStoreId($website->getDefaultStore()->getId()) ->load($alert->getProductId()); - /* @var $product Mage_catalog_Model_Product */ + /* @var $product Mage_Catalog_Model_Product */ if (!$product) { continue; } @@ -269,7 +275,7 @@ protected function _processStock(Mage_ProductAlert_Model_Email $email) /** * Send email to administrator if error * - * @return Mage_productAlert_Model_Observer + * @return Mage_ProductAlert_Model_Observer */ protected function _sendErrorEmail() { @@ -302,7 +308,7 @@ protected function _sendErrorEmail() /** * Run process send product alerts * - * @return Mage_productAlert_Model_Observer + * @return Mage_ProductAlert_Model_Observer */ public function process() { diff --git a/app/code/core/Mage/ProductAlert/etc/system.xml b/app/code/core/Mage/ProductAlert/etc/system.xml index 7b327100d5..22cf059094 100644 --- a/app/code/core/Mage/ProductAlert/etc/system.xml +++ b/app/code/core/Mage/ProductAlert/etc/system.xml @@ -114,6 +114,7 @@ text + validate-email 3 1 0 diff --git a/app/code/core/Mage/Reports/Model/Resource/Report/Abstract.php b/app/code/core/Mage/Reports/Model/Resource/Report/Abstract.php index 853ab70c9a..d67ed06853 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Report/Abstract.php +++ b/app/code/core/Mage/Reports/Model/Resource/Report/Abstract.php @@ -105,7 +105,11 @@ protected function _getFlagData($code) */ protected function _truncateTable($table) { - $this->_getWriteAdapter()->truncateTable($table); + if ($this->_getWriteAdapter()->getTransactionLevel() > 0) { + $this->_getWriteAdapter()->delete($table); + } else { + $this->_getWriteAdapter()->truncateTable($table); + } return $this; } diff --git a/app/code/core/Mage/Review/Model/Resource/Review/Status/Collection.php b/app/code/core/Mage/Review/Model/Resource/Review/Status/Collection.php index ebcdd3b711..9088024e0e 100755 --- a/app/code/core/Mage/Review/Model/Resource/Review/Status/Collection.php +++ b/app/code/core/Mage/Review/Model/Resource/Review/Status/Collection.php @@ -24,7 +24,6 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - /** * Review statuses collection * @@ -49,7 +48,7 @@ protected function _construct() { $this->_init('review/review_status'); } - + /** * Convert items array to array for select options * diff --git a/app/code/core/Mage/Review/Model/Review/Status.php b/app/code/core/Mage/Review/Model/Review/Status.php index c3f794eb51..d675e701e0 100644 --- a/app/code/core/Mage/Review/Model/Review/Status.php +++ b/app/code/core/Mage/Review/Model/Review/Status.php @@ -39,5 +39,4 @@ public function __construct() { $this->_init('review/review_status'); } - } diff --git a/app/code/core/Mage/Rss/Block/Catalog/Tag.php b/app/code/core/Mage/Rss/Block/Catalog/Tag.php index 12d90d1512..03cb07bc40 100644 --- a/app/code/core/Mage/Rss/Block/Catalog/Tag.php +++ b/app/code/core/Mage/Rss/Block/Catalog/Tag.php @@ -38,7 +38,8 @@ protected function _construct() /* * setting cache to save the rss for 10 minutes */ - $this->setCacheKey('rss_catalog_tag_'.$this->getStoreId()); + $tagModel = Mage::registry('tag_model'); + $this->setCacheKey('rss_catalog_tag_' . $this->getStoreId() . '_' . $tagModel->getName()); $this->setCacheLifetime(600); } @@ -99,9 +100,10 @@ public function addTaggedItemXml($args) $allowedPriceInRss = $product->getAllowedPriceInRss(); $product->unsetData()->load($args['row']['entity_id']); - $description = ''. - ''. - ' + + + + + + + diff --git a/app/design/frontend/default/iphone/template/checkout/onepage/review/totals.phtml b/app/design/frontend/default/iphone/template/checkout/onepage/review/totals.phtml new file mode 100644 index 0000000000..8d3a0a2992 --- /dev/null +++ b/app/design/frontend/default/iphone/template/checkout/onepage/review/totals.phtml @@ -0,0 +1,47 @@ + +getTotals()): ?> + + + renderTotals(null, $_colspan); ?> + renderTotals('footer', $_colspan); ?> + needDisplayBaseGrandtotal()):?> + + + + + + + diff --git a/app/design/frontend/default/iphone/template/customer/account/navigation.phtml b/app/design/frontend/default/iphone/template/customer/account/navigation.phtml new file mode 100644 index 0000000000..dcd74046ae --- /dev/null +++ b/app/design/frontend/default/iphone/template/customer/account/navigation.phtml @@ -0,0 +1,62 @@ + + +Show() + diff --git a/app/design/frontend/default/iphone/template/customer/form/edit.phtml b/app/design/frontend/default/iphone/template/customer/form/edit.phtml index 544617230b..2075565b65 100644 --- a/app/design/frontend/default/iphone/template/customer/form/edit.phtml +++ b/app/design/frontend/default/iphone/template/customer/form/edit.phtml @@ -24,21 +24,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> - - diff --git a/app/design/frontend/default/iphone/template/customer/form/login.phtml b/app/design/frontend/default/iphone/template/customer/form/login.phtml index aac0e2ac4a..ea69231867 100644 --- a/app/design/frontend/default/iphone/template/customer/form/login.phtml +++ b/app/design/frontend/default/iphone/template/customer/form/login.phtml @@ -40,13 +40,15 @@
    • - +
    • - getChildHtml('form.additional.info'); ?> + isRequired('user_login')): ?> + getChildHtml('captcha') ?> +
    __('Forgot your password?') ?> @@ -118,7 +118,7 @@
    - +
    @@ -160,7 +160,9 @@ - getChildHtml('form.additional.info'); ?> + isRequired('user_create')): ?> + getChildHtml('captcha') ?> + __('Back') ?> diff --git a/app/design/frontend/default/iphone/template/page/html/head.phtml b/app/design/frontend/default/iphone/template/page/html/head.phtml index 7cbdec3679..5baed41a54 100644 --- a/app/design/frontend/default/iphone/template/page/html/head.phtml +++ b/app/design/frontend/default/iphone/template/page/html/head.phtml @@ -34,11 +34,13 @@ - getCssJsHtml() ?> diff --git a/app/design/frontend/default/iphone/template/page/switch/languages.phtml b/app/design/frontend/default/iphone/template/page/switch/languages.phtml index b28ee0ac79..f8a1e9c123 100644 --- a/app/design/frontend/default/iphone/template/page/switch/languages.phtml +++ b/app/design/frontend/default/iphone/template/page/switch/languages.phtml @@ -38,7 +38,7 @@ getStores() as $_lang): ?> getId() == $this->getCurrentStoreId()) ? ' class="selected"' : '' ?> > - htmlEscape($_lang->getName()) ?> + escapeHtml($_lang->getName()) ?> diff --git a/app/design/frontend/default/iphone/template/page/switch/stores.phtml b/app/design/frontend/default/iphone/template/page/switch/stores.phtml index aa5b449fc7..1b2452fc93 100644 --- a/app/design/frontend/default/iphone/template/page/switch/stores.phtml +++ b/app/design/frontend/default/iphone/template/page/switch/stores.phtml @@ -38,7 +38,7 @@ getGroups() as $_group): ?> getId() == $this->getCurrentGroupId()) ? ' class="selected"' : '' ?> > - htmlEscape($_group->getName()) ?> + escapeHtml($_group->getName()) ?> diff --git a/app/design/frontend/default/iphone/template/persistent/checkout/onepage/login.phtml b/app/design/frontend/default/iphone/template/persistent/checkout/onepage/login.phtml index 22da54237f..a5707221f6 100644 --- a/app/design/frontend/default/iphone/template/persistent/checkout/onepage/login.phtml +++ b/app/design/frontend/default/iphone/template/persistent/checkout/onepage/login.phtml @@ -44,7 +44,7 @@
  • - +
  • @@ -53,7 +53,9 @@
  • - getChildHtml('form.additional.info'); ?> + isRequired('user_login')): ?> + getChildHtml('captcha') ?> + getChildHtml('persistent.remember.me'); ?> diff --git a/app/design/frontend/default/iphone/template/persistent/customer/form/login.phtml b/app/design/frontend/default/iphone/template/persistent/customer/form/login.phtml index 33a3c99ffc..45dbf0572c 100644 --- a/app/design/frontend/default/iphone/template/persistent/customer/form/login.phtml +++ b/app/design/frontend/default/iphone/template/persistent/customer/form/login.phtml @@ -49,13 +49,15 @@
    • - +
    • - getChildHtml('form.additional.info'); ?> + isRequired('user_login')): ?> + getChildHtml('captcha') ?> + getChildHtml('persistent.remember.me'); ?>
    getChildHtml('persistent.remember.me.tooltip'); ?>__('Forgot your password?') ?> diff --git a/app/design/frontend/default/iphone/template/persistent/customer/form/register.phtml b/app/design/frontend/default/iphone/template/persistent/customer/form/register.phtml index 47de3674c9..c58de1d999 100644 --- a/app/design/frontend/default/iphone/template/persistent/customer/form/register.phtml +++ b/app/design/frontend/default/iphone/template/persistent/customer/form/register.phtml @@ -56,7 +56,7 @@
  • - +
  • isNewsletterEnabled()): ?> @@ -89,26 +89,26 @@
    - +
    - +
  • - +
  • helper('customer/address')->getStreetLines(); $_i<=$_n; $_i++): ?>
  • - +
  • @@ -116,7 +116,7 @@
    - +
    @@ -130,7 +130,7 @@ $('region_id').setAttribute('defaultValue', "getFormData()->getRegionId() ?>"); //]]> - +
    @@ -138,7 +138,7 @@
    - +
    @@ -164,7 +164,9 @@ - getChildHtml('form.additional.info'); ?> + isRequired('user_create')): ?> + getChildHtml('captcha') ?> + getChildHtml('persistent.remember.me'); ?> diff --git a/app/design/frontend/default/iphone/template/sales/order/items.phtml b/app/design/frontend/default/iphone/template/sales/order/items.phtml index 6b4c5b0bf9..cf5739d6f9 100644 --- a/app/design/frontend/default/iphone/template/sales/order/items.phtml +++ b/app/design/frontend/default/iphone/template/sales/order/items.phtml @@ -42,8 +42,8 @@
    diff --git a/app/design/frontend/default/iphone/template/sendfriend/send.phtml b/app/design/frontend/default/iphone/template/sendfriend/send.phtml index 1d1e2de60a..442ee7e32c 100644 --- a/app/design/frontend/default/iphone/template/sendfriend/send.phtml +++ b/app/design/frontend/default/iphone/template/sendfriend/send.phtml @@ -113,20 +113,20 @@
    - +
    - +
  • - +
  • diff --git a/app/design/frontend/default/iphone/template/shipping/tracking/popup.phtml b/app/design/frontend/default/iphone/template/shipping/tracking/popup.phtml index bde1dadbb4..892cb69a05 100644 --- a/app/design/frontend/default/iphone/template/shipping/tracking/popup.phtml +++ b/app/design/frontend/default/iphone/template/shipping/tracking/popup.phtml @@ -24,8 +24,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> - -getTrackingInfo() ?> +getTrackingInfo() ?>
    @@ -42,12 +41,12 @@
    - + getCarrierTitle()): ?> - + getErrorMessage()): ?> @@ -63,7 +62,7 @@ getUrl()): ?> - + getStatus()): ?> diff --git a/app/design/frontend/default/iphone/template/wishlist/view.phtml b/app/design/frontend/default/iphone/template/wishlist/view.phtml index 6318579b00..63a265a64c 100644 --- a/app/design/frontend/default/iphone/template/wishlist/view.phtml +++ b/app/design/frontend/default/iphone/template/wishlist/view.phtml @@ -41,7 +41,7 @@ $product = $item->getProduct(); $isVisibleProduct = $product->isVisibleInSiteVisibility(); ?> -
  • +
  • canHaveQty()) echo 'class="no-qty"' ?>> <?php echo $this->escapeHtml($product->getName()) ?>

    @@ -53,13 +53,15 @@

    getPriceHtml($product) ?> getDetailsHtml($item) ?> - canHaveQty() && $isVisibleProduct): ?> - __('Qty') ?>: - + + + __('Qty') ?>: + + isSaleable()): ?> - + __('Out of stock') ?> @@ -73,6 +75,9 @@
  • +
  • + __('Remove All')?> +
  • isSaleable()):?>
  • __('Add All to Cart') ?>
  • diff --git a/app/design/frontend/default/modern/template/catalog/product/view.phtml b/app/design/frontend/default/modern/template/catalog/product/view.phtml index c44acf1cd8..832a615d89 100644 --- a/app/design/frontend/default/modern/template/catalog/product/view.phtml +++ b/app/design/frontend/default/modern/template/catalog/product/view.phtml @@ -128,6 +128,13 @@ delete Validation.methods['required-entry']; delete Validation.methods['validate-one-required']; delete Validation.methods['validate-one-required-by-name']; + // Remove custom datetime validators + for (var methodName in Validation.methods) { + if (methodName.match(/^validate-datetime-.*/i)) { + delete Validation.methods[methodName]; + } + } + if (this.validator.validate()) { if (url) { this.form.action = url; diff --git a/app/design/frontend/default/modern/template/checkout/cart.phtml b/app/design/frontend/default/modern/template/checkout/cart.phtml index 342ea8681a..32f7559d04 100644 --- a/app/design/frontend/default/modern/template/checkout/cart.phtml +++ b/app/design/frontend/default/modern/template/checkout/cart.phtml @@ -99,8 +99,30 @@ getContinueShoppingUrl()): ?> - + + @@ -126,6 +148,8 @@
    + + getChildHtml('checkout.cart.extra') ?> getChildHtml('coupon') ?> getIsVirtual()): echo $this->getChildHtml('shipping'); endif; ?>
    diff --git a/app/etc/modules/Mage_Api2.xml b/app/etc/modules/Mage_Api2.xml new file mode 100644 index 0000000000..e329b8230f --- /dev/null +++ b/app/etc/modules/Mage_Api2.xml @@ -0,0 +1,39 @@ + + + + + + true + core + + + + + + + diff --git a/app/etc/modules/Mage_OAuth.xml b/app/etc/modules/Mage_OAuth.xml new file mode 100644 index 0000000000..f4aad0ee37 --- /dev/null +++ b/app/etc/modules/Mage_OAuth.xml @@ -0,0 +1,38 @@ + + + + + + true + core + + + + + + diff --git a/app/locale/en_US/Mage_AdminNotification.csv b/app/locale/en_US/Mage_AdminNotification.csv index b1a36d13a3..42673c2eed 100644 --- a/app/locale/en_US/Mage_AdminNotification.csv +++ b/app/locale/en_US/Mage_AdminNotification.csv @@ -24,6 +24,7 @@ "Unable to proceed. Please, try again.","Unable to proceed. Please, try again." "Update Frequency","Update Frequency" "Use HTTPS to Get Feed","Use HTTPS to Get Feed" +"Wrong message type","Wrong message type" "critical","critical" "major","major" "minor","minor" diff --git a/app/locale/en_US/Mage_Adminhtml.csv b/app/locale/en_US/Mage_Adminhtml.csv index 0d2004beda..8cc67436fe 100644 --- a/app/locale/en_US/Mage_Adminhtml.csv +++ b/app/locale/en_US/Mage_Adminhtml.csv @@ -19,6 +19,7 @@ "(You have to increase php memory_limit before changing this value)","(You have to increase php memory_limit before changing this value)" "(\\t for tab)","(\\t for tab)" "* - If indexing is in progress, it will be killed and new indexing process will start.","* - If indexing is in progress, it will be killed and new indexing process will start." +"* Required Fields","* Required Fields" "- Click on any of the time parts to increase it","- Click on any of the time parts to increase it" "- Hold mouse button on any of the above buttons for faster selection.","- Hold mouse button on any of the above buttons for faster selection." "- Use the %s buttons to select month","- Use the %s buttons to select month" @@ -42,6 +43,7 @@ "2YTD","2YTD" "6 Hours","6 Hours" "

    404 Error

    Page not found.

    ","

    404 Error

    Page not found.

    " +"%s request access to your account","%s request access to your account" "Attention: Captcha is case sensitive.","Attention: Captcha is case sensitive." "A user with the same user name or email aleady exists.","A user with the same user name or email aleady exists." "API Key","API Key" @@ -85,6 +87,7 @@ "Advanced Admin Section","Advanced Admin Section" "Advanced Profiles","Advanced Profiles" "Advanced Section","Advanced Section" +"After authorization application will have access to you account.","After authorization application will have access to you account." "All","All" "All Allowed Countries","All Allowed Countries" "All Cache","All Cache" @@ -146,7 +149,12 @@ "Associated Tags","Associated Tags" "Attribute Set Name:","Attribute Set Name:" "Attributes","Attributes" -"Automatic","Automatic" +"Authorization confirmed","Authorization confirmed" +"Authorize","Authorize" +"Authorize application","Authorize application" +"Authorized OAuth Tokens","Authorized OAuth Tokens" +"Automatic (equalize price ranges)","Automatic (equalize price ranges)" +"Automatic (equalize product counts)","Automatic (equalize product counts)" "Average Order Amount","Average Order Amount" "Average Orders","Average Orders" "BINARY","BINARY" @@ -212,10 +220,12 @@ "Complete","Complete" "Configuration","Configuration" "Confirm New Password","Confirm New Password" +"Confirm token authorization Pop Up for admin","Confirm token authorization Pop Up for admin" +"Confirm token authorization for admin","Confirm token authorization for admin" +"Confirmation Of Authorization","Confirmation Of Authorization" "Confirmed email:","Confirmed email:" "Connect with the Magento Community","Connect with the Magento Community" "Continue","Continue" -"Continuous","Continuous" "Convert to Plain Text","Convert to Plain Text" "Cookie (unsafe)","Cookie (unsafe)" "Country","Country" @@ -379,6 +389,7 @@ "General Section","General Section" "Get Image Base64","Get Image Base64" "Get help for this page","Get help for this page" +"Give the verifier code to application administrator","Give the verifier code to application administrator" "Global Attribute","Global Attribute" "Global Record Search","Global Record Search" "Global Search","Global Search" @@ -484,8 +495,10 @@ "Local Server","Local Server" "Local/Remote Server","Local/Remote Server" "Locale","Locale" +"Log In","Log In" "Log Out","Log Out" "Log in to Admin Panel","Log in to Admin Panel" +"Log in to use %s","Log in to use %s" "Log into Magento Admin Page","Log into Magento Admin Page" "Logged in as %s","Logged in as %s" "Login","Login" @@ -524,6 +537,7 @@ "Most Viewed Products","Most Viewed Products" "Multiple Select","Multiple Select" "My Account","My Account" +"My Applications","My Applications" "N/A","N/A" "NOTICE","NOTICE" "Name","Name" @@ -597,6 +611,9 @@ "Number of Uses","Number of Uses" "Number of Views","Number of Views" "Number of records:","Number of records:" +"OAuth Consumers","OAuth Consumers" +"OAuth authorization for admin","OAuth authorization for admin" +"OAuth authorization simple for admin","OAuth authorization simple for admin" "OK","OK" "Old rate:","Old rate:" "One or more media files failed to be synchronized during the media storages syncronization process. Refer to the log file for details.","One or more media files failed to be synchronized during the media storages syncronization process. Refer to the log file for details." @@ -741,6 +758,7 @@ "Quantity","Quantity" "Queue Refresh","Queue Refresh" "Queued... Cancel","Queued... Cancel" +"REST Roles","REST Roles" "Radio Buttons","Radio Buttons" "Rates","Rates" "Read details","Read details" @@ -760,6 +778,10 @@ "Refresh Statistics","Refresh Statistics" "Region/State","Region/State" "Regular Price:","Regular Price:" +"Reject","Reject" +"Reject token authorization Pop Up for admin","Reject token authorization Pop Up for admin" +"Reject token authorization for admin","Reject token authorization for admin" +"Rejection Of Authorization","Rejection Of Authorization" "Release","Release" "Release Stability","Release Stability" "Release Version","Release Version" @@ -1076,6 +1098,7 @@ "User Role","User Role" "User Roles","User Roles" "User Roles Information","User Roles Information" +"User Type Resources","User Type Resources" "User name","User name" "Users","Users" "VAT Number is Invalid","VAT Number is Invalid" @@ -1089,6 +1112,7 @@ "Variable ID","Variable ID" "Variable Name","Variable Name" "Variable Plain Value","Variable Plain Value" +"Verifier code: %s","Verifier code: %s" "View Actions XML","View Actions XML" "View Full Size","View Full Size" "View Memo","View Memo" diff --git a/app/locale/en_US/Mage_Api.csv b/app/locale/en_US/Mage_Api.csv index 5c6674a0d9..c7352a4a01 100644 --- a/app/locale/en_US/Mage_Api.csv +++ b/app/locale/en_US/Mage_Api.csv @@ -1,4 +1,5 @@ "Access denied.","Access denied." +"Can not find webservice adapter.","Can not find webservice adapter." "Client Session Timeout (sec.)","Client Session Timeout (sec.)" "Default Response Charset","Default Response Charset" "Email","Email" @@ -7,10 +8,10 @@ "Invalid webservice handler specified.","Invalid webservice handler specified." "Magento Core API","Magento Core API" "Magento Core API Section","Magento Core API Section" -"Roles","Roles" +"SOAP/XML-RPC - Roles","SOAP/XML-RPC - Roles" +"SOAP/XML-RPC - Users","SOAP/XML-RPC - Users" "Unable to login.","Unable to login." "User Name","User Name" -"Users","Users" "WS-I Compliance","WS-I Compliance" "Web Services","Web Services" "Your account has been deactivated.","Your account has been deactivated." diff --git a/app/locale/en_US/Mage_Api2.csv b/app/locale/en_US/Mage_Api2.csv new file mode 100644 index 0000000000..be092fd6db --- /dev/null +++ b/app/locale/en_US/Mage_Api2.csv @@ -0,0 +1,203 @@ +"%s","%s" +"ACL Attribute Rules","ACL Attribute Rules" +"ACL Attributes Information","ACL Attributes Information" +"Add","Add" +"Add Admin Role","Add Admin Role" +"Add New Role","Add New Role" +"Address Type","Address Type" +"Admin","Admin" +"Allow","Allow" +"An error occurred while deleting the role.","An error occurred while deleting the role." +"An error occurred while saving attribute rules.","An error occurred while saving attribute rules." +"An error occurred while saving role.","An error occurred while saving role." +"Api Rules Information","Api Rules Information" +"Assigned","Assigned" +"Associate to Website","Associate to Website" +"Attribute Rules Information","Attribute Rules Information" +"Attributes","Attributes" +"Automatically Return Credit Memo Item to Stock","Automatically Return Credit Memo Item to Stock" +"Back","Back" +"Backorders","Backorders" +"Base Currency","Base Currency" +"Base Customer Balance","Base Customer Balance" +"Base Discount","Base Discount" +"Base Discount Amount","Base Discount Amount" +"Base Item Subtotal","Base Item Subtotal" +"Base Item Subtotal Including Tax","Base Item Subtotal Including Tax" +"Base Original Price","Base Original Price" +"Base Price","Base Price" +"Base Price Including Tax","Base Price Including Tax" +"Base Shipping","Base Shipping" +"Base Shipping Discount","Base Shipping Discount" +"Base Shipping Tax","Base Shipping Tax" +"Base Subtotal","Base Subtotal" +"Base Subtotal Including Tax","Base Subtotal Including Tax" +"Base Tax Amount","Base Tax Amount" +"Base Total Due","Base Total Due" +"Base Total Paid","Base Total Paid" +"Base Total Refunded","Base Total Refunded" +"Can Be Divided into Multiple Boxes for Shipping","Can Be Divided into Multiple Boxes for Shipping" +"Canceled Qty","Canceled Qty" +"Catalog","Catalog" +"CatalogInventory","CatalogInventory" +"City","City" +"Company","Company" +"Country","Country" +"Coupon Code","Coupon Code" +"Create","Create" +"Created From","Created From" +"Customer","Customer" +"Customer Address","Customer Address" +"Customer Address ID","Customer Address ID" +"Customer Balance","Customer Balance" +"Customer First Name","Customer First Name" +"Customer ID","Customer ID" +"Customer Last Name","Customer Last Name" +"Customer Middle Name","Customer Middle Name" +"Customer Prefix","Customer Prefix" +"Customer Suffix","Customer Suffix" +"Delete","Delete" +"Deny","Deny" +"Disable automatic group change based on VAT ID","Disable automatic group change based on VAT ID" +"Discount","Discount" +"Discount Amount","Discount Amount" +"Discount Description","Discount Description" +"Edit","Edit" +"Edit %s ACL attribute rules","Edit %s ACL attribute rules" +"Edit Role","Edit Role" +"Edit attribute rules for %s Role","Edit attribute rules for %s Role" +"Email","Email" +"Enable Qty Increments","Enable Qty Increments" +"First Name","First Name" +"Gift Message","Gift Message" +"Grand Total","Grand Total" +"Grand Total to Be Charged","Grand Total to Be Charged" +"Group","Group" +"Guest","Guest" +"ID","ID" +"Invoiced Qty","Invoiced Qty" +"Is Confirmed","Is Confirmed" +"Is Default Billing Address","Is Default Billing Address" +"Is Default Shipping Address","Is Default Shipping Address" +"Item ID","Item ID" +"Item Subtotal","Item Subtotal" +"Item Subtotal Including Tax","Item Subtotal Including Tax" +"Last Logged In","Last Logged In" +"Last Name","Last Name" +"Low Stock Date","Low Stock Date" +"Manage Stock","Manage Stock" +"Maximum Qty Allowed in Shopping Cart","Maximum Qty Allowed in Shopping Cart" +"Minimum Qty Allowed in Shopping Cart","Minimum Qty Allowed in Shopping Cart" +"New Role","New Role" +"Notify for Quantity Below","Notify for Quantity Below" +"OAuth","OAuth" +"Order Addresses","Order Addresses" +"Order Comments","Order Comments" +"Order Currency","Order Currency" +"Order Date","Order Date" +"Order ID","Order ID" +"Order ID (internal)","Order ID (internal)" +"Order Item ID","Order Item ID" +"Order Items","Order Items" +"Order Status","Order Status" +"Ordered Qty","Ordered Qty" +"Orders","Orders" +"Original Price","Original Price" +"Parent Order Item ID","Parent Order Item ID" +"Payment Method","Payment Method" +"Phone Number","Phone Number" +"Placed from IP","Placed from IP" +"Please enter a valid number in ""max_sale_qty"" field","Please enter a valid number in ""max_sale_qty"" field" +"Please enter a valid number in ""min_qty"" field","Please enter a valid number in ""min_qty"" field" +"Please enter a valid number in ""min_sale_qty"" field","Please enter a valid number in ""min_sale_qty"" field" +"Please enter a valid number in ""notify_stock_qty"" field","Please enter a valid number in ""notify_stock_qty"" field" +"Please use numbers only in ""qty_increments"" field. Please avoid spaces or other characters such as dots or commas.","Please use numbers only in ""qty_increments"" field. Please avoid spaces or other characters such as dots or commas." +"Price","Price" +"Price Including Tax","Price Including Tax" +"Product","Product" +"Product ID","Product ID" +"Product and Custom Options Name","Product and Custom Options Name" +"Qty","Qty" +"Qty Increments","Qty Increments" +"Qty Uses Decimals","Qty Uses Decimals" +"Qty for Item's Status to Become Out of Stock","Qty for Item's Status to Become Out of Stock" +"REST - Attributes","REST - Attributes" +"REST - Roles","REST - Roles" +"REST ACL Attributes","REST ACL Attributes" +"REST Attributes","REST Attributes" +"REST Role","REST Role" +"REST Roles","REST Roles" +"REST Roles Information","REST Roles Information" +"Read","Read" +"Refunded Qty","Refunded Qty" +"Rest Roles","Rest Roles" +"Retrieve","Retrieve" +"Role ""%s"" no longer exists","Role ""%s"" no longer exists" +"Role ""%s"" not found.","Role ""%s"" not found." +"Role API Resources","Role API Resources" +"Role Info","Role Info" +"Role Information","Role Information" +"Role Name","Role Name" +"Role Users","Role Users" +"Role has been deleted.","Role has been deleted." +"Roles","Roles" +"SKU","SKU" +"Sales","Sales" +"Save","Save" +"Shipped Qty","Shipped Qty" +"Shipping Amount","Shipping Amount" +"Shipping Discount","Shipping Discount" +"Shipping Including Tax","Shipping Including Tax" +"Shipping Method","Shipping Method" +"Shipping Tax","Shipping Tax" +"State","State" +"Stock Availability","Stock Availability" +"Stock ID","Stock ID" +"Stock Item","Stock Item" +"Store Currency to Order Currency Rate","Store Currency to Order Currency Rate" +"Store Name","Store Name" +"Street","Street" +"Subtotal","Subtotal" +"Subtotal Including Tax","Subtotal Including Tax" +"System","System" +"Tax Amount","Tax Amount" +"Tax Name","Tax Name" +"Tax Percent","Tax Percent" +"Tax Rate","Tax Rate" +"The ""enable_qty_increments"" field must be set to 0 or 1.","The ""enable_qty_increments"" field must be set to 0 or 1." +"The ""is_decimal_divided"" field must be set to 0 or 1.","The ""is_decimal_divided"" field must be set to 0 or 1." +"The ""is_in_stock"" field must be set to 0 or 1.","The ""is_in_stock"" field must be set to 0 or 1." +"The ""is_qty_decimal"" field must be set to 0 or 1.","The ""is_qty_decimal"" field must be set to 0 or 1." +"The ""is_qty_decimal"" field must be set to 0, 1, or 2.","The ""is_qty_decimal"" field must be set to 0, 1, or 2." +"The ""manage_stock"" field must be set to 0 or 1.","The ""manage_stock"" field must be set to 0 or 1." +"The ""stock_status_changed_auto"" field must be set to 0 or 1.","The ""stock_status_changed_auto"" field must be set to 0 or 1." +"The ""use_config_backorders"" field must be set to 0 or 1.","The ""use_config_backorders"" field must be set to 0 or 1." +"The ""use_config_enable_qty_inc"" field must be set to 0 or 1.","The ""use_config_enable_qty_inc"" field must be set to 0 or 1." +"The ""use_config_manage_stock"" field must be set to 0 or 1.","The ""use_config_manage_stock"" field must be set to 0 or 1." +"The ""use_config_max_sale_qty"" field must be set to 0 or 1.","The ""use_config_max_sale_qty"" field must be set to 0 or 1." +"The ""use_config_min_qty"" field must be set to 0 or 1.","The ""use_config_min_qty"" field must be set to 0 or 1." +"The ""use_config_min_sale_qty"" field must be set to 0 or 1.","The ""use_config_min_sale_qty"" field must be set to 0 or 1." +"The ""use_config_notify_stock_qty"" field must be set to 0 or 1.","The ""use_config_notify_stock_qty"" field must be set to 0 or 1." +"The ""use_config_qty_increments"" field must be set to 0 or 1.","The ""use_config_qty_increments"" field must be set to 0 or 1." +"The attribute rules were saved.","The attribute rules were saved." +"The role has been saved.","The role has been saved." +"The role is a special one and not for assigning it to admin users.","The role is a special one and not for assigning it to admin users." +"Total Due","Total Due" +"Total Paid","Total Paid" +"Total Refunded","Total Refunded" +"Update","Update" +"Use Config Settings for Backorders","Use Config Settings for Backorders" +"Use Config Settings for Enable Qty Increments","Use Config Settings for Enable Qty Increments" +"Use Config Settings for Manage Stock","Use Config Settings for Manage Stock" +"Use Config Settings for Maximum Qty Allowed in Shopping Cart","Use Config Settings for Maximum Qty Allowed in Shopping Cart" +"Use Config Settings for Minimum Qty Allowed in Shopping Cart","Use Config Settings for Minimum Qty Allowed in Shopping Cart" +"Use Config Settings for Notify for Quantity Below","Use Config Settings for Notify for Quantity Below" +"Use Config Settings for Qty Increments","Use Config Settings for Qty Increments" +"Use Config Settings for Qty for Item's Status to Become Out of Stock","Use Config Settings for Qty for Item's Status to Become Out of Stock" +"User Type","User Type" +"User type ""%s"" no longer exists","User type ""%s"" no longer exists" +"User type ""%s"" not found.","User type ""%s"" not found." +"Web Services","Web Services" +"Web services","Web services" +"Write","Write" +"ZIP/Postal Code","ZIP/Postal Code" diff --git a/app/locale/en_US/Mage_Backup.csv b/app/locale/en_US/Mage_Backup.csv index 5d3ceb0139..6af5f4f312 100644 --- a/app/locale/en_US/Mage_Backup.csv +++ b/app/locale/en_US/Mage_Backup.csv @@ -28,8 +28,8 @@ "Not enough free space to create backup.","Not enough free space to create backup." "Not enough permissions to create backup.","Not enough permissions to create backup." "Not enough permissions to perform rollback","Not enough permissions to perform rollback" -"Please deselect the sufficient check-box, if you want to continue backup's creation","Please deselect the sufficient check-box, if you want to continue backup's creation" -"Please deselect the sufficient check-box, if you want to continue rollback processing","Please deselect the sufficient check-box, if you want to continue rollback processing" +"Please either unselect the ""Put store on the maintenance mode"" checkbox or update your permissions to proceed with the backup.""","Please either unselect the ""Put store on the maintenance mode"" checkbox or update your permissions to proceed with the backup.""" +"Please either unselect the ""Put store on the maintenance mode"" checkbox or update your permissions to proceed with the rollback.""","Please either unselect the ""Put store on the maintenance mode"" checkbox or update your permissions to proceed with the rollback.""" "Put store on the maintenance mode while backup's creation","Put store on the maintenance mode while backup's creation" "Rollback","Rollback" "Scheduled Backup Settings","Scheduled Backup Settings" @@ -41,10 +41,11 @@ "The database backup has been created.","The database backup has been created." "The file was compressed with Zlib, but this extension is not installed on server.","The file was compressed with Zlib, but this extension is not installed on server." "The selected backup(s) has been deleted.","The selected backup(s) has been deleted." +"The system (excluding Media) backup has been created.","The system (excluding Media) backup has been created." "The system backup has been created.","The system backup has been created." "Time","Time" "Type","Type" "Unable to create backup. Please, try again later.","Unable to create backup. Please, try again later." "Unable to save the cron expression.","Unable to save the cron expression." -"Warning! System couldn't put store on the maintenance mode.","Warning! System couldn't put store on the maintenance mode." "Wrong order of creation for new backup.","Wrong order of creation for new backup." +"You do not have sufficient permissions to enable Maintenance Mode during this operation.","You do not have sufficient permissions to enable Maintenance Mode during this operation." diff --git a/app/locale/en_US/Mage_CatalogSearch.csv b/app/locale/en_US/Mage_CatalogSearch.csv index 9149c0114e..4b34c898f4 100644 --- a/app/locale/en_US/Mage_CatalogSearch.csv +++ b/app/locale/en_US/Mage_CatalogSearch.csv @@ -20,7 +20,7 @@ "List","List" "Maximum Query Length","Maximum Query Length" "Maximum Query Words Count","Maximum Query Words Count" -"Maximum Search query length is %s. Your query was cut.","Maximum Search query length is %s. Your query was cut." +"Maximum Search query length is %s. Your query was cut.","Maximum Search query length is %s. Your query was cut." "Maximum words count is %1$s. In your search query was cut next part: %2$s.","Maximum words count is %1$s. In your search query was cut next part: %2$s." "Minimal Query Length","Minimal Query Length" "Minimum Search query length is %s","Minimum Search query length is %s" diff --git a/app/locale/en_US/Mage_Core.csv b/app/locale/en_US/Mage_Core.csv index 0b437ec81f..8cb81395af 100644 --- a/app/locale/en_US/Mage_Core.csv +++ b/app/locale/en_US/Mage_Core.csv @@ -138,6 +138,7 @@ "General Contact Email","General Contact Email" "General Contact Name","General Contact Name" "General Settings","General Settings" +"Get info about current Magento installation","Get info about current Magento installation" "Global","Global" "HTML Head","HTML Head" "HTML tags are not allowed","HTML tags are not allowed" @@ -148,6 +149,7 @@ "If the current frame position does not cover utmost pages, will render link to current position plus/minus this value.","If the current frame position does not cover utmost pages, will render link to current position plus/minus this value." "Incorrect credit card expiration date.","Incorrect credit card expiration date." "Input type ""%value%"" not found in the input types list.","Input type ""%value%"" not found in the input types list." +"Invalid URL '%value%'.","Invalid URL '%value%'." "Invalid base url type","Invalid base url type" "Invalid block name to set child %s: %s","Invalid block name to set child %s: %s" "Invalid block type: %s","Invalid block type: %s" @@ -171,6 +173,8 @@ "Logo Image","Logo Image" "Logo Image Alt","Logo Image Alt" "Logo Image Src","Logo Image Src" +"Magento info","Magento info" +"Magento info API","Magento info API" "Mail Sending Settings","Mail Sending Settings" "Make sure that base URL ends with '/' (slash), e.g. http://yourdomain/magento/","Make sure that base URL ends with '/' (slash), e.g. http://yourdomain/magento/" "Manage Stores","Manage Stores" @@ -180,7 +184,6 @@ "Merge JavaScript Files","Merge JavaScript Files" "Miscellaneous HTML","Miscellaneous HTML" "Miscellaneous Scripts","Miscellaneous Scripts" -"Model class does not exist: %s.","Model class does not exist: %s." "Model collection resource name is not defined.","Model collection resource name is not defined." "Module ""%1$s"" cannot depend on ""%2$s"".","Module ""%1$s"" cannot depend on ""%2$s""." "Module ""%1$s"" requires module ""%2$s"".","Module ""%1$s"" requires module ""%2$s""." @@ -256,6 +259,7 @@ "Requested file may not include parent directory traversal (""../"", ""..\\ notation)""","Requested file may not include parent directory traversal (""../"", ""..\\ notation)""" "Requested invalid store ""%s""","Requested invalid store ""%s""" "Resource is not set.","Resource is not set." +"Retrieve info about current Magento installation","Retrieve info about current Magento installation" "Retrieve store data","Retrieve store data" "Retrieve store list","Retrieve store list" "Return-Path Email","Return-Path Email" diff --git a/app/locale/en_US/Mage_Customer.csv b/app/locale/en_US/Mage_Customer.csv index 89c8042a56..341036e37f 100644 --- a/app/locale/en_US/Mage_Customer.csv +++ b/app/locale/en_US/Mage_Customer.csv @@ -352,6 +352,7 @@ "Show Prefix","Show Prefix" "Show Suffix","Show Suffix" "Show Tax/VAT Number","Show Tax/VAT Number" +"Show VAT Number on Frontend","Show VAT Number on Frontend" "Sign Up for Newsletter","Sign Up for Newsletter" "Skipping import row, required field ""%s"" is not defined.","Skipping import row, required field ""%s"" is not defined." "Skipping import row, website ""%s"" field does not exist.","Skipping import row, website ""%s"" field does not exist." @@ -360,7 +361,6 @@ "Store","Store" "Store View","Store View" "Street Address","Street Address" -"Street Address ","Street Address " "Street Address %s","Street Address %s" "Subject","Subject" "Submit","Submit" @@ -411,6 +411,7 @@ "This email will be sent instead of default welcome email, after account confirmation.","This email will be sent instead of default welcome email, after account confirmation." "This is My Default %s Address","This is My Default %s Address" "To Cart","To Cart" +"To show VAT number on frontend, set Show VAT Number on Frontend option to Yes.","To show VAT number on frontend, set Show VAT Number on Frontend option to Yes." "Total","Total" "Type","Type" "Unknown","Unknown" diff --git a/app/locale/en_US/Mage_Downloadable.csv b/app/locale/en_US/Mage_Downloadable.csv index 0a37bc44a7..aeb27bcbc8 100644 --- a/app/locale/en_US/Mage_Downloadable.csv +++ b/app/locale/en_US/Mage_Downloadable.csv @@ -2,7 +2,6 @@ "Add New Row","Add New Row" "Add links and samples to downloadable product","Add links and samples to downloadable product" "Alphanumeric, dash and underscore characters are recommended for filenames. Improper characters are replaced with \'_\'.","Alphanumeric, dash and underscore characters are recommended for filenames. Improper characters are replaced with \'_\'." -"An error occurred while getting requested content. Please contact the store owner.","An error occurred while getting requested content. Please contact the store owner." "An error occurred while getting the requested content.","An error occurred while getting the requested content." "An error occurred while getting the requested content. Please contact the store owner.","An error occurred while getting the requested content. Please contact the store owner." "An error occurred while saving the file(s).","An error occurred while saving the file(s)." @@ -69,6 +68,7 @@ "See price before order confirmation.","See price before order confirmation." "Shareable","Shareable" "Shipped","Shipped" +"Sorry, there was an error getting requested content. Please contact the store owner.","Sorry, there was an error getting requested content. Please contact the store owner." "Sort Order","Sort Order" "Start Download","Start Download" "Status","Status" diff --git a/app/locale/en_US/Mage_GoogleCheckout.csv b/app/locale/en_US/Mage_GoogleCheckout.csv index 87b363f9ec..1d0ebde617 100644 --- a/app/locale/en_US/Mage_GoogleCheckout.csv +++ b/app/locale/en_US/Mage_GoogleCheckout.csv @@ -8,7 +8,6 @@ "A virtual item to reflect the discount total","A virtual item to reflect the discount total" "A virtual item to reflect the tax total","A virtual item to reflect the tax total" "AVS Status: %s","AVS Status: %s" -"Add","Add" "Add Shipping Method","Add Shipping Method" "Allowed Methods","Allowed Methods" "Amount: %s","Amount: %s" @@ -109,8 +108,7 @@ "Rate 3 Ship To Applicable Countries","Rate 3 Ship To Applicable Countries" "Rate 3 Ship to Specific Countries","Rate 3 Ship to Specific Countries" "Rate 3 Title","Rate 3 Title" -"Remove","Remove" -"Required for live Google Checkout transactions.","Required for live Google Checkout transactions." +"Required for live Google Checkout transactions. Make sure that this option corresponds to Use Secure URLs in Frontend (""Web"" > ""Secure"").","Required for live Google Checkout transactions. Make sure that this option corresponds to Use Secure URLs in Frontend (""Web"" > ""Secure"")." "Residential","Residential" "Sandbox","Sandbox" "Secure Callback URL","Secure Callback URL" diff --git a/app/locale/en_US/Mage_ImportExport.csv b/app/locale/en_US/Mage_ImportExport.csv index 029ea5d197..cda2066910 100644 --- a/app/locale/en_US/Mage_ImportExport.csv +++ b/app/locale/en_US/Mage_ImportExport.csv @@ -1,20 +1,27 @@ -" in rows: "," in rows: " +"%s file does not exists or is not readable","%s file does not exists or is not readable" "-- Please Select --","-- Please Select --" "Adapter must be an instance of Mage_ImportExport_Model_Import_Adapter_Abstract","Adapter must be an instance of Mage_ImportExport_Model_Import_Adapter_Abstract" +"Adapter object must be an instance of %s","Adapter object must be an instance of %s" "Adapter type must be a non empty string","Adapter type must be a non empty string" +"Begin data validation","Begin data validation" +"Begin export of %s","Begin export of %s" +"Begin import of ""%s"" with ""%s"" behavior","Begin import of ""%s"" with ""%s"" behavior" +"CSV","CSV" "Can not determine attribute filter type","Can not determine attribute filter type" -"Can not find required columns: ","Can not find required columns: " -"Can not get autoincrement value","Can not get autoincrement value" +"Can not find required columns: %s","Can not find required columns: %s" +"Cannot get autoincrement value","Cannot get autoincrement value" "Check Data","Check Data" "Column names have duplicates","Column names have duplicates" "Column names is empty or is not an array","Column names is empty or is not an array" "Column names: ""%s"" are invalid","Column names: ""%s"" are invalid" -"Continue","Continue" +"Customers","Customers" "Data is invalid or file is not uploaded","Data is invalid or file is not uploaded" "Destination directory is not writable","Destination directory is not writable" "Destination file is not writable","Destination file is not writable" "Destination file path must be a string","Destination file path must be a string" -"Entity Attributes","Entity Attributes" +"Done import data validation","Done import data validation" +"Duplicate Unique Attribute for '%s'","Duplicate Unique Attribute for '%s'" +"Entity adapter obejct must be an instance of Mage_ImportExport_Model_Export_Entity_Abstract","Entity adapter obejct must be an instance of Mage_ImportExport_Model_Export_Entity_Abstract" "Entity adapter object must be an instance of Mage_ImportExport_Model_Import_Entity_Abstract","Entity adapter object must be an instance of Mage_ImportExport_Model_Import_Entity_Abstract" "Entity is unknown","Entity is unknown" "Entity type model must be an instance of Mage_ImportExport_Model_Export_Entity_Product_Type_Abstract","Entity type model must be an instance of Mage_ImportExport_Model_Export_Entity_Product_Type_Abstract" @@ -22,23 +29,24 @@ "Error in data structure: behaviors are mixed","Error in data structure: behaviors are mixed" "Error in data structure: entity codes are mixed","Error in data structure: entity codes are mixed" "Export","Export" -"Export FAQ","Export FAQ" -"FAQ","FAQ" +"Export has been done.","Export has been done." +"Exported %s rows.","Exported %s rows." +"File does not contain data.","File does not contain data." "File does not contain data. Please upload another one","File does not contain data. Please upload another one" "File format is unknown","File format is unknown" "File is partially valid, but import is not possible","File is partially valid, but import is not possible" "File is totally invalid. Please fix errors and re-upload file","File is totally invalid. Please fix errors and re-upload file" "File is valid! To start import process press ""Import"" button","File is valid! To start import process press ""Import"" button" "File is valid, but import is not possible","File is valid, but import is not possible" +"File was not uploaded","File was not uploaded" "Header column names already set","Header column names already set" "Import","Import" -"Import / Export FAQ (Frequently Asked Questions)","Import / Export FAQ (Frequently Asked Questions)" -"Import FAQ","Import FAQ" +"Import has been done successfuly.","Import has been done successfuly." "Import successfully done.","Import successfully done." "Import/Export","Import/Export" -"In/Out","In/Out" "Input entity code is not equal to entity adapter code","Input entity code is not equal to entity adapter code" "Invalid entity","Invalid entity" +"Invalid entity model","Invalid entity model" "Invalid file format","Invalid file format" "Invalid parameters","Invalid parameters" "Invalid seek position","Invalid seek position" @@ -51,13 +59,15 @@ "Not implemented yet","Not implemented yet" "Please fix errors and re-upload file","Please fix errors and re-upload file" "Please fix errors and re-upload file or simply press ""Import"" button to skip rows with errors","Please fix errors and re-upload file or simply press ""Import"" button to skip rows with errors" -"Some other FAQ","Some other FAQ" +"Products","Products" "Source file moving failed","Source file moving failed" "Source file path must be a string","Source file path must be a string" "Source is not set","Source is not set" "Status","Status" -"System busy","System busy" "There are no product types available for export","There are no product types available for export" +"There is no data for export","There is no data for export" "Total size of uploadable files must not exceed %s","Total size of uploadable files must not exceed %s" "Uploaded file has no extension","Uploaded file has no extension" -"Validation Results","Validation Results" +"Validation finished successfully","Validation finished successfully" +"in rows","in rows" +"in rows:","in rows:" diff --git a/app/locale/en_US/Mage_Index.csv b/app/locale/en_US/Mage_Index.csv index 4d02a5509c..4de4d3ae35 100644 --- a/app/locale/en_US/Mage_Index.csv +++ b/app/locale/en_US/Mage_Index.csv @@ -6,6 +6,7 @@ "Change Index Mode","Change Index Mode" "Click here to go to Cache Management and refresh cache types.","Click here to go to Cache Management and refresh cache types." "Click here to go to Index Management and rebuild required indexes.","Click here to go to Index Management and rebuild required indexes." +"Delete","Delete" "Description","Description" "Disable","Disable" "Enable","Enable" @@ -32,6 +33,7 @@ "Refresh","Refresh" "Reindex Data","Reindex Data" "Reindex Required","Reindex Required" +"Revoke","Revoke" "Status","Status" "System","System" "The index has been saved.","The index has been saved." diff --git a/app/locale/en_US/Mage_OAuth.csv b/app/locale/en_US/Mage_OAuth.csv new file mode 100644 index 0000000000..1b204f18c9 --- /dev/null +++ b/app/locale/en_US/Mage_OAuth.csv @@ -0,0 +1,111 @@ +"%name% '%value%' is too long. It must has length %min% symbols.","%name% '%value%' is too long. It must has length %min% symbols." +"%name% '%value%' is too short. It must has length %min% symbols.","%name% '%value%' is too short. It must has length %min% symbols." +"%s request access to your account","%s request access to your account" +"Admin","Admin" +"After authorization application will have access to you account.","After authorization application will have access to you account." +"An error occurred on confirm authorize.","An error occurred on confirm authorize." +"An error occurred on delete action.","An error occurred on delete action." +"An error occurred on delete application.","An error occurred on delete application." +"An error occurred on reject authorize.","An error occurred on reject authorize." +"An error occurred on saving consumer data.","An error occurred on saving consumer data." +"An error occurred on update revoke status.","An error occurred on update revoke status." +"An error occurred while deleting the consumer.","An error occurred while deleting the consumer." +"An error occurred.","An error occurred." +"An error occurred. Your authorization request is invalid.","An error occurred. Your authorization request is invalid." +"App Name","App Name" +"Application ""%s"" has been deleted.","Application ""%s"" has been deleted." +"Application ""%s"" has been enabled.","Application ""%s"" has been enabled." +"Application ""%s"" has been revoked.","Application ""%s"" has been revoked." +"Application Name","Application Name" +"Application not found.","Application not found." +"Are you sure you want to delete this application?","Are you sure you want to delete this application?" +"Are you sure you want to disable this application?","Are you sure you want to disable this application?" +"Are you sure you want to enable this application?","Are you sure you want to enable this application?" +"Authorization confirmed.","Authorization confirmed." +"Authorize","Authorize" +"Authorize application","Authorize application" +"Authorized Tokens","Authorized Tokens" +"Callback URL","Callback URL" +"Cleanup Probability","Cleanup Probability" +"Cleanup Settings","Cleanup Settings" +"Confirm OAuth token authorization","Confirm OAuth token authorization" +"Confirm token authorization Pop Up for admin","Confirm token authorization Pop Up for admin" +"Confirm token authorization for admin","Confirm token authorization for admin" +"Confirmation Of Authorization","Confirmation Of Authorization" +"Consumer Information","Consumer Information" +"Consumer Name","Consumer Name" +"Consumers","Consumers" +"Created At","Created At" +"Customer","Customer" +"Customer My Account My OAuth Applications","Customer My Account My OAuth Applications" +"Delete","Delete" +"Disable","Disable" +"Disabled","Disabled" +"Edit","Edit" +"Edit Consumer","Edit Consumer" +"Email","Email" +"Email Address","Email Address" +"Enable","Enable" +"Enabled","Enabled" +"Entry with ID #%s not found.","Entry with ID #%s not found." +"Expiration Period","Expiration Period" +"Give the verifier code to application administrator","Give the verifier code to application administrator" +"ID","ID" +"Invalid Callback URL","Invalid Callback URL" +"Invalid ID parameter.","Invalid ID parameter." +"Invalid Rejected Callback URL","Invalid Rejected Callback URL" +"Invalid entry ID.","Invalid entry ID." +"Invalid revoke status.","Invalid revoke status." +"Key","Key" +"Log in as a customer","Log in as a customer" +"Log in as admin","Log in as admin" +"Log in as customer","Log in as customer" +"Log in to use %s","Log in to use %s" +"Login","Login" +"My Applications","My Applications" +"Name","Name" +"New Consumer","New Consumer" +"OAuth","OAuth" +"OAuth Admin My Apps","OAuth Admin My Apps" +"OAuth Authorized Tokens","OAuth Authorized Tokens" +"OAuth Consumers","OAuth Consumers" +"OAuth authorization for admin","OAuth authorization for admin" +"OAuth authorization for customer","OAuth authorization for customer" +"OAuth authorization simple for admin","OAuth authorization simple for admin" +"Password","Password" +"Permissions","Permissions" +"Please select needed row(s).","Please select needed row(s)." +"Please select revoke status.","Please select revoke status." +"REST - My Apps","REST - My Apps" +"REST - OAuth Authorized Tokens","REST - OAuth Authorized Tokens" +"REST - OAuth Consumers","REST - OAuth Consumers" +"Reject","Reject" +"Reject OAuth token authorization","Reject OAuth token authorization" +"Reject authorization","Reject authorization" +"Reject token authorization Pop Up for admin","Reject token authorization Pop Up for admin" +"Reject token authorization for admin","Reject token authorization for admin" +"Rejected Callback URL","Rejected Callback URL" +"Revoked","Revoked" +"Role Name","Role Name" +"Save","Save" +"Save and Continue Edit","Save and Continue Edit" +"Secret","Secret" +"Selected entries enabled.","Selected entries enabled." +"Selected entries has been deleted.","Selected entries has been deleted." +"Selected entries revoked.","Selected entries revoked." +"Status","Status" +"System","System" +"The application access request is rejected.","The application access request is rejected." +"The consumer has been deleted.","The consumer has been deleted." +"The consumer has been saved.","The consumer has been saved." +"Token Status Change","Token Status Change" +"Token Status Change Email Template","Token Status Change Email Template" +"Unable to find a consumer.","Unable to find a consumer." +"User ID","User ID" +"User Name","User Name" +"User Type","User Type" +"Verifier code: %s","Verifier code: %s" +"You have no applications.","You have no applications." +"deleted","deleted" +"enabled","enabled" +"revoked","revoked" diff --git a/app/locale/en_US/Mage_Page.csv b/app/locale/en_US/Mage_Page.csv index 4c01f55ed9..23b46c72e7 100644 --- a/app/locale/en_US/Mage_Page.csv +++ b/app/locale/en_US/Mage_Page.csv @@ -63,7 +63,7 @@ "Select date","Select date" "Show","Show" "This is a demo store. Any orders placed through this store will not be honored or fulfilled.","This is a demo store. Any orders placed through this store will not be honored or fulfilled." -"This website requires cookies provide all of its features. For more information on what data is contained in the cookies, please see our privacy policy page To accept cookies from this site, please click accept below.","This website requires cookies provide all of its features. For more information on what data is contained in the cookies, please see our privacy policy page To accept cookies from this site, please click accept below." +"This website requires cookies to provide all of its features. For more information on what data is contained in the cookies, please see our Privacy Policy page. To accept cookies from this site, please click the Allow button below.","This website requires cookies to provide all of its features. For more information on what data is contained in the cookies, please see our Privacy Policy page. To accept cookies from this site, please click the Allow button below." "Time selection:","Time selection:" "Time:","Time:" "Welcome, %s!","Welcome, %s!" diff --git a/app/locale/en_US/Mage_Payment.csv b/app/locale/en_US/Mage_Payment.csv index 00cd16d0ea..0a6750e95e 100644 --- a/app/locale/en_US/Mage_Payment.csv +++ b/app/locale/en_US/Mage_Payment.csv @@ -10,19 +10,20 @@ "Auto Bill on Next Cycle","Auto Bill on Next Cycle" "Automatically Invoice All Items","Automatically Invoice All Items" "Automatically bill the outstanding balance amount in the next billing cycle (if there were failed payments).","Automatically bill the outstanding balance amount in the next billing cycle (if there were failed payments)." +"Bank Transfer Payment","Bank Transfer Payment" "Billing Agreement status is not set.","Billing Agreement status is not set." "Billing Amount","Billing Amount" "Billing Frequency","Billing Frequency" "Billing Period","Billing Period" "Billing Period Unit","Billing Period Unit" "Billing period unit is not defined or wrong.","Billing period unit is not defined or wrong." -"Cannot retrieve payment method instance.","Cannot retrieve payment method instance." "Cannot retrieve the payment info model object.","Cannot retrieve the payment info model object." "Cannot retrieve the payment information object instance.","Cannot retrieve the payment information object instance." "Cannot retrieve the payment method code.","Cannot retrieve the payment method code." "Cannot retrieve the payment method model object.","Cannot retrieve the payment method model object." "Capture action is not available.","Capture action is not available." "Card Verification Number","Card Verification Number" +"Cash On Delivery Payment","Cash On Delivery Payment" "Centinel API URL","Centinel API URL" "Check / Money Order","Check / Money Order" "Credit Card Number","Credit Card Number" @@ -41,6 +42,7 @@ "Incorrect credit card expiration date.","Incorrect credit card expiration date." "Initial Fee","Initial Fee" "Initial non-recurring payment amount due immediately upon profile creation.","Initial non-recurring payment amount due immediately upon profile creation." +"Instructions","Instructions" "Internal Reference ID","Internal Reference ID" "Invalid Credit Card Number","Invalid Credit Card Number" "Issue Number","Issue Number" @@ -111,6 +113,7 @@ "The number of billing cycles for payment period.","The number of billing cycles for payment period." "The number of scheduled payments that can fail before the profile is automatically suspended.","The number of scheduled payments that can fail before the profile is automatically suspended." "The payment review action is unavailable.","The payment review action is unavailable." +"The requested Payment Method is not available.","The requested Payment Method is not available." "Title","Title" "Trial Billing Amount","Trial Billing Amount" "Trial Billing Frequency","Trial Billing Frequency" diff --git a/app/locale/en_US/Mage_Sales.csv b/app/locale/en_US/Mage_Sales.csv index c4b16999ba..472fe0d943 100644 --- a/app/locale/en_US/Mage_Sales.csv +++ b/app/locale/en_US/Mage_Sales.csv @@ -201,7 +201,7 @@ "Date Shipped","Date Shipped" "Default Status","Default Status" "Default Template","Default Template" -"Default logo, will be used in PDF and HTML documents.
    (jpeg, tiff, png)","Default logo, will be used in PDF and HTML documents.
    (jpeg, tiff, png)" +"Default logo, will be used in PDF and HTML documents.
    (jpeg, tiff, png) If you see image distortion in PDF, try to use larger image","Default logo, will be used in PDF and HTML documents.
    (jpeg, tiff, png) If you see image distortion in PDF, try to use larger image" "Delete","Delete" "Delete Package","Delete Package" "Denied the payment online.","Denied the payment online." @@ -611,9 +611,7 @@ "Revenue","Revenue" "Row Subtotal","Row Subtotal" "Row Total","Row Total" -"SHIP TO:","SHIP TO:" "SKU","SKU" -"SOLD TO:","SOLD TO:" "Sales","Sales" "Sales Discount","Sales Discount" "Sales Emails","Sales Emails" @@ -655,10 +653,12 @@ "Send Shipment Email Copy Method","Send Shipment Email Copy Method" "Send Shipment Email Copy To","Send Shipment Email Copy To" "Send Tracking Information","Send Tracking Information" +"Send shipment info","Send shipment info" "Set order for existing transactions not allowed","Set order for existing transactions not allowed" "Ship","Ship" "Ship To","Ship To" "Ship to Name","Ship to Name" +"Ship to:","Ship to:" "Shipment","Shipment" "Shipment #","Shipment #" "Shipment #%1$s | %3$s (%2$s)","Shipment #%1$s | %3$s (%2$s)" @@ -692,6 +692,7 @@ "Signed Up From","Signed Up From" "Size","Size" "Sku","Sku" +"Sold to:","Sold to:" "Some of the products below do not have all the required options. Please edit them and configure all the required options.","Some of the products below do not have all the required options. Please edit them and configure all the required options." "Sorry, no quotes are available for this order at this time.","Sorry, no quotes are available for this order at this time." "Source object is not specified.","Source object is not specified." diff --git a/app/locale/en_US/Mage_Tax.csv b/app/locale/en_US/Mage_Tax.csv index a7d4ea42c8..1d78ffbcef 100644 --- a/app/locale/en_US/Mage_Tax.csv +++ b/app/locale/en_US/Mage_Tax.csv @@ -8,7 +8,6 @@ "An error occurred while deleting this rate. Incorrect rate ID.","An error occurred while deleting this rate. Incorrect rate ID." "An error occurred while deleting this tax class.","An error occurred while deleting this tax class." "An error occurred while deleting this tax rule.","An error occurred while deleting this tax rule." -"An error occurred while saving this rate.","An error occurred while saving this rate." "An error occurred while saving this tax class.","An error occurred while saving this tax class." "An error occurred while saving this tax class. A class with the same name","An error occurred while saving this tax class. A class with the same name" "An error occurred while saving this tax rule.","An error occurred while saving this tax rule." @@ -25,7 +24,6 @@ "Class Name","Class Name" "Code","Code" "Country","Country" -"County","County" "Custom price if available","Custom price if available" "Customer Tax Class","Customer Tax Class" "Customer Tax Class Information","Customer Tax Class Information" diff --git a/app/locale/en_US/Mage_Usa.csv b/app/locale/en_US/Mage_Usa.csv index ea2542a98a..c188f917e3 100644 --- a/app/locale/en_US/Mage_Usa.csv +++ b/app/locale/en_US/Mage_Usa.csv @@ -116,6 +116,7 @@ "Height","Height" "Height, width and length should be equal or greater than %s","Height, width and length should be equal or greater than %s" "Home Delivery","Home Delivery" +"Hub ID","Hub ID" "Inches","Inches" "Indirect","Indirect" "International Economy","International Economy" @@ -180,6 +181,7 @@ "Piece Id barcode is missing","Piece Id barcode is missing" "Piece number information is missing","Piece number information is missing" "Please make sure to use only digits here. No dashes are allowed.","Please make sure to use only digits here. No dashes are allowed." +"Please, specify origin country","Please, specify origin country" "Pounds","Pounds" "Priority Mail","Priority Mail" "Priority Overnight","Priority Overnight" @@ -232,6 +234,7 @@ "Station","Station" "Subtotal","Subtotal" "Subtotal With Discount","Subtotal With Discount" +"The field is applicable if the Smart Post method is selected.","The field is applicable if the Smart Post method is selected." "The response is in wrong format.","The response is in wrong format." "There is no available method for selected shipping address.","There is no available method for selected shipping address." "There is no items in this order","There is no items in this order" diff --git a/app/locale/en_US/Mage_XmlConnect.csv b/app/locale/en_US/Mage_XmlConnect.csv index 0ec93c8cc6..df89016e7d 100644 --- a/app/locale/en_US/Mage_XmlConnect.csv +++ b/app/locale/en_US/Mage_XmlConnect.csv @@ -536,7 +536,7 @@ "Store logo that is displayed on copyright page of app. Preferred size: 100px x 100px.","Store logo that is displayed on copyright page of app. Preferred size: 100px x 100px." "Store logo that is displayed on copyright page of app. Preferred size: 200px x 200px.","Store logo that is displayed on copyright page of app. Preferred size: 200px x 200px." "Street Address","Street Address" -"Street Address 2","Street Address 2" +"Street Address %s","Street Address %s" "Submission","Submission" "Submission Fields","Submission Fields" "Submission History","Submission History" diff --git a/app/locale/en_US/template/email/token.html b/app/locale/en_US/template/email/token.html new file mode 100644 index 0000000000..a615f4289a --- /dev/null +++ b/app/locale/en_US/template/email/token.html @@ -0,0 +1,17 @@ +{* This is a comment block + +Available vars in this template: + - $userName User name + - $applicationName Application name + - $status Token new status + +Use vars: {{var var_name}} +*} + + +Hello, {{htmlescape var=$userName}}

    +Your authorization to {{htmlescape var=$applicationName}} has been changed to {{htmlescape var=$status}} by Admin team.

    diff --git a/cron.php b/cron.php index 93fbe465c6..d555fca11a 100644 --- a/cron.php +++ b/cron.php @@ -38,6 +38,8 @@ Mage::app('admin')->setUseSessionInUrl(false); +umask(0); + try { Mage::getConfig()->init()->loadEventObservers('crontab'); Mage::app()->addEventArea('crontab'); diff --git a/downloader/Maged/Controller.php b/downloader/Maged/Controller.php index 50dfe1979a..233051d660 100755 --- a/downloader/Maged/Controller.php +++ b/downloader/Maged/Controller.php @@ -596,7 +596,7 @@ public function model($model = null, $singleton = false) if (is_null($model)) { $class = 'Maged_Model'; } else { - $class = 'Maged_Model_'.str_replace(' ', '_', ucwords(str_replace('_', ' ', $model))); + $class = 'Maged_Model_' . str_replace(' ', '_', ucwords(str_replace('_', ' ', $model))); if (!class_exists($class, false)) { include_once str_replace('_', DIRECTORY_SEPARATOR, $class).'.php'; } @@ -885,7 +885,20 @@ public function startInstall() } if (!empty($_GET['archive_type'])) { - $isSuccess = $this->_createBackup($_GET['archive_type'], $_GET['backup_name']); + + $backupName = $_GET['backup_name']; + $connect = $this->model('connect', true)->connect(); + $isSuccess = true; + + if (!preg_match('/^[a-zA-Z0-9\ ]{0,50}$/', $backupName)) { + $connect->runHtmlConsole('Please use only letters (a-z or A-Z), numbers (0-9) or space in ' + . 'Backup Name field. Other characters are not allowed.'); + $isSuccess = false; + } + + if ($isSuccess) { + $isSuccess = $this->_createBackup($_GET['archive_type'], $_GET['backup_name']); + } if (!$isSuccess) { $this->endInstall(); @@ -981,7 +994,7 @@ public static function getVersionInfo() 'minor' => '7', 'revision' => '0', 'patch' => '0', - 'stability' => 'beta', + 'stability' => 'rc', 'number' => '1', ); } @@ -996,7 +1009,7 @@ public static function getVersionInfo() protected function _createBackup($archiveType, $archiveName){ /** @var $connect Maged_Connect */ $connect = $this->model('connect', true)->connect(); - $connect->runHtmlConsole('Creating data backup...'); + $connect->runHtmlConsole('Creating backup...'); $isSuccess = false; @@ -1066,7 +1079,7 @@ protected function _getCreateBackupSuccessMessageByType($type) { $messagesMap = array( Mage_Backup_Helper_Data::TYPE_SYSTEM_SNAPSHOT => 'System backup has been created', - Mage_Backup_Helper_Data::TYPE_SNAPSHOT_WITHOUT_MEDIA => 'System backup has been created', + Mage_Backup_Helper_Data::TYPE_SNAPSHOT_WITHOUT_MEDIA => 'System (excluding Media) backup has been created', Mage_Backup_Helper_Data::TYPE_MEDIA => 'Database and media backup has been created', Mage_Backup_Helper_Data::TYPE_DB => 'Database backup has been created' ); diff --git a/downloader/lib/Mage/Archive.php b/downloader/lib/Mage/Archive.php index 3e5f5ecfa8..70abdb5be5 100644 --- a/downloader/lib/Mage/Archive.php +++ b/downloader/lib/Mage/Archive.php @@ -84,7 +84,7 @@ protected function _getArchiver($extension) } else { $format = self::DEFAULT_ARCHIVER; } - $class = 'Mage_Archive_'.ucfirst($format); + $class = 'Mage_Archive_' . ucfirst($format); $this->_archiver = new $class(); return $this->_archiver; } diff --git a/downloader/lib/Mage/Backup.php b/downloader/lib/Mage/Backup.php index 88f2f48b43..5dc3c19283 100755 --- a/downloader/lib/Mage/Backup.php +++ b/downloader/lib/Mage/Backup.php @@ -48,7 +48,7 @@ class Mage_Backup */ static public function getBackupInstance($type) { - $class = 'Mage_Backup_' . $type; + $class = 'Mage_Backup_' . ucfirst($type); if (!in_array($type, self::$_allowedBackupTypes) || !class_exists($class, true)){ throw new Mage_Exception('Current implementation not supported this type (' . $type . ') of backup.'); diff --git a/downloader/lib/Mage/Backup/Db.php b/downloader/lib/Mage/Backup/Db.php index 7d49849759..5585ef3eaf 100755 --- a/downloader/lib/Mage/Backup/Db.php +++ b/downloader/lib/Mage/Backup/Db.php @@ -34,7 +34,7 @@ class Mage_Backup_Db extends Mage_Backup_Abstract { /** - * Implementation Rollback functionality for Db + * Implements Rollback functionality for Db * * @return bool */ @@ -48,20 +48,10 @@ public function rollback() $archiveManager = new Mage_Archive(); $source = $archiveManager->unpack($this->getBackupPath(), $this->getBackupsDir()); - $this->getResourceModel()->beginTransaction(); - - $file = fopen($source, "r"); - $query = ''; - while(!feof($file)) { - $line = fgets($file); - $query .= $line; - if ($this->_isLineLastInCommand($line)){ - $this->getResourceModel()->runCommand($query); - $query = ''; - } + $file = new Mage_Backup_Filesystem_Iterator_File($source); + foreach ($file as $statement) { + $this->getResourceModel()->runCommand($statement); } - fclose($file); - $this->getResourceModel()->commitTransaction(); @unlink($source); $this->_lastOperationSucceed = true; @@ -70,7 +60,7 @@ public function rollback() } /** - * Check is line a last in sql command + * Checks whether the line is last in sql command * * @param $line * @return bool @@ -92,9 +82,9 @@ protected function _isLineLastInCommand($line) } /** - * Implementation Create Backup functionality for Db + * Implements Create Backup functionality for Db * - * @return boolean + * @return bool */ public function create() { @@ -124,6 +114,6 @@ public function create() */ public function getType() { - return "db"; + return 'db'; } } diff --git a/downloader/lib/Mage/Backup/Filesystem/Iterator/File.php b/downloader/lib/Mage/Backup/Filesystem/Iterator/File.php new file mode 100644 index 0000000000..cddde3607e --- /dev/null +++ b/downloader/lib/Mage/Backup/Filesystem/Iterator/File.php @@ -0,0 +1,112 @@ + + */ +class Mage_Backup_Filesystem_Iterator_File extends SplFileObject +{ + /** + * The statement that was last read during iteration + * + * @var string + */ + protected $_currentStatement = ''; + + /** + * Return current sql statement + * + * @return string + */ + public function current() + { + return $this->_currentStatement; + } + + /** + * Iterate to next sql statement in file + */ + public function next() + { + $this->_currentStatement = ''; + while (!$this->eof()) { + $line = $this->fgets(); + if (strlen(trim($line))) { + $this->_currentStatement .= $line; + if ($this->_isLineLastInCommand($line)) { + break; + } + } + } + } + + /** + * Return to first statement + */ + public function rewind() + { + parent::rewind(); + $this->next(); + } + + /** + * Check whether provided string is comment + * + * @param string $line + * @return bool + */ + protected function _isComment($line) + { + return $line[0] == '#' || substr($line, 0, 2) == '--'; + } + + /** + * Check is line a last in sql command + * + * @param string $line + * @return bool + */ + protected function _isLineLastInCommand($line) + { + $cleanLine = trim($line); + $lineLength = strlen($cleanLine); + + $returnResult = false; + if ($lineLength > 0) { + $lastSymbolIndex = $lineLength - 1; + if ($cleanLine[$lastSymbolIndex] == ';') { + $returnResult = true; + } + } + + return $returnResult; + } +} diff --git a/downloader/lib/Mage/Backup/Filesystem/Iterator/Filter.php b/downloader/lib/Mage/Backup/Filesystem/Iterator/Filter.php index 40ae6f053b..4b1b413db9 100755 --- a/downloader/lib/Mage/Backup/Filesystem/Iterator/Filter.php +++ b/downloader/lib/Mage/Backup/Filesystem/Iterator/Filter.php @@ -44,7 +44,7 @@ class Mage_Backup_Filesystem_Iterator_Filter extends FilterIterator * Constructor * * @param Iterator $iterator - * @param array $skipFiles + * @param array $filters list of files to skip */ public function __construct(Iterator $iterator, array $filters) { diff --git a/downloader/template/connect/packages.phtml b/downloader/template/connect/packages.phtml index a0a3d812d9..92e6ea8ba5 100644 --- a/downloader/template/connect/packages.phtml +++ b/downloader/template/connect/packages.phtml @@ -32,7 +32,7 @@
    •   - +
    '.$product->getDescription(); + $description = '' + . ' - + - - - - - - helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()): ?> - - - + + - helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()) && !$_item->getNoSubtotal()): ?> - - - helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()) && !$_item->getNoSubtotal()): ?> - - diff --git a/app/design/frontend/default/iphone/template/checkout/cart/noItemsHeader.phtml b/app/design/frontend/default/iphone/template/checkout/cart/noItemsHeader.phtml index 5eb698c227..aca0be04d2 100644 --- a/app/design/frontend/default/iphone/template/checkout/cart/noItemsHeader.phtml +++ b/app/design/frontend/default/iphone/template/checkout/cart/noItemsHeader.phtml @@ -29,7 +29,6 @@
    getMessagesBlock()->getGroupedHtml() ?>

    __('You have no items in your shopping cart.') ?>

    -

    __('Click here to continue shopping.', $this->getContinueShoppingUrl()) ?>

    diff --git a/app/design/frontend/default/iphone/template/checkout/cartheader.phtml b/app/design/frontend/default/iphone/template/checkout/cartheader.phtml index 683bb85a4a..61af0e3b00 100644 --- a/app/design/frontend/default/iphone/template/checkout/cartheader.phtml +++ b/app/design/frontend/default/iphone/template/checkout/cartheader.phtml @@ -55,17 +55,6 @@ - helper('tax')->displayCartBothPrices() ? 2 : 1); ?> - - helper('tax')->displayCartBothPrices()): ?> - - - - - - - - getItems() as $_item): ?> getItemHtml($_item) ?> @@ -74,7 +63,15 @@
    ' + . ''.$product->getDescription(); if ($allowedPriceInRss) { $description .= $this->getPriceHtml($product,true); @@ -111,10 +113,10 @@ public function addTaggedItemXml($args) $rssObj = $args['rssObj']; $data = array( - 'title' => $product->getName(), - 'link' => $product->getProductUrl(), - 'description' => $description, - ); + 'title' => $product->getName(), + 'link' => $product->getProductUrl(), + 'description' => $description, + ); $rssObj->_addEntry($data); } } diff --git a/app/code/core/Mage/Rule/Model/Resource/Abstract.php b/app/code/core/Mage/Rule/Model/Resource/Abstract.php index e0a0ffdced..6899edc40f 100644 --- a/app/code/core/Mage/Rule/Model/Resource/Abstract.php +++ b/app/code/core/Mage/Rule/Model/Resource/Abstract.php @@ -64,15 +64,17 @@ abstract class Mage_Rule_Model_Resource_Abstract extends Mage_Core_Model_Resourc */ public function _beforeSave(Mage_Core_Model_Abstract $object) { - if ($object->getFromDate() instanceof Zend_Date) { - $object->setFromDate($object->getFromDate()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT)); - } else { + $fromDate = $object->getFromDate(); + if ($fromDate instanceof Zend_Date) { + $object->setFromDate($fromDate->toString(Varien_Date::DATETIME_INTERNAL_FORMAT)); + } elseif (!is_string($fromDate) || empty($fromDate)) { $object->setFromDate(null); } - if ($object->getToDate() instanceof Zend_Date) { - $object->setToDate($object->getToDate()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT)); - } else { + $toDate = $object->getToDate(); + if ($toDate instanceof Zend_Date) { + $object->setToDate($toDate->toString(Varien_Date::DATETIME_INTERNAL_FORMAT)); + } elseif (!is_string($toDate) || empty($toDate)) { $object->setToDate(null); } diff --git a/app/code/core/Mage/Sales/Model/Api2/Order.php b/app/code/core/Mage/Sales/Model/Api2/Order.php new file mode 100644 index 0000000000..6fe913a042 --- /dev/null +++ b/app/code/core/Mage/Sales/Model/Api2/Order.php @@ -0,0 +1,318 @@ + + */ +class Mage_Sales_Model_Api2_Order extends Mage_Api2_Model_Resource +{ + /**#@+ + * Parameters' names in config with special ACL meaning + */ + const PARAM_GIFT_MESSAGE = '_gift_message'; + const PARAM_ORDER_COMMENTS = '_order_comments'; + const PARAM_PAYMENT_METHOD = '_payment_method'; + const PARAM_TAX_NAME = '_tax_name'; + const PARAM_TAX_RATE = '_tax_rate'; + /**#@-*/ + + /** + * Add gift message info to select + * + * @param Mage_Sales_Model_Resource_Order_Collection $collection + * @return Mage_Sales_Model_Api2_Order + */ + protected function _addGiftMessageInfo(Mage_Sales_Model_Resource_Order_Collection $collection) + { + $collection->getSelect()->joinLeft( + array('gift_message' => $collection->getTable('giftmessage/message')), + 'main_table.gift_message_id = gift_message.gift_message_id', + array( + 'gift_message_from' => 'gift_message.sender', + 'gift_message_to' => 'gift_message.recipient', + 'gift_message_body' => 'gift_message.message' + ) + ); + + return $this; + } + + /** + * Add order payment method field to select + * + * @param Mage_Sales_Model_Resource_Order_Collection $collection + * @return Mage_Sales_Model_Api2_Order + */ + protected function _addPaymentMethodInfo(Mage_Sales_Model_Resource_Order_Collection $collection) + { + $collection->getSelect()->joinLeft( + array('payment_method' => $collection->getTable('sales/order_payment')), + 'main_table.entity_id = payment_method.parent_id', + array('payment_method' => 'payment_method.method') + ); + + return $this; + } + + /** + * Add order tax information to select + * + * @param Mage_Sales_Model_Resource_Order_Collection $collection + * @return Mage_Sales_Model_Api2_Order + */ + protected function _addTaxInfo(Mage_Sales_Model_Resource_Order_Collection $collection) + { + $taxInfoFields = array(); + + if ($this->_isTaxNameAllowed()) { + $taxInfoFields['tax_name'] = 'order_tax.title'; + } + if ($this->_isTaxRateAllowed()) { + $taxInfoFields['tax_rate'] = 'order_tax.percent'; + } + if ($taxInfoFields) { + $collection->getSelect()->joinLeft( + array('order_tax' => $collection->getTable('sales/order_tax')), + 'main_table.entity_id = order_tax.order_id', + $taxInfoFields + ); + } + return $this; + } + + /** + * Retrieve a list or orders' addresses in a form of [order ID => array of addresses, ...] + * + * @param array $orderIds Orders identifiers + * @return array + */ + protected function _getAddresses(array $orderIds) + { + $addresses = array(); + + if ($this->_isSubCallAllowed('order_addresses')) { + /** @var $addressesFilter Mage_Api2_Model_Acl_Filter */ + $addressesFilter = $this->_getSubModel('order_addresses', array())->getFilter(); + // do addresses request if at least one attribute allowed + if ($addressesFilter->getAllowedAttributes()) { + /* @var $collection Mage_Sales_Model_Resource_Order_Address_Collection */ + $collection = Mage::getResourceModel('sales/order_address_collection'); + + $collection->addAttributeToFilter('parent_id', $orderIds); + + foreach ($collection->getItems() as $item) { + $addresses[$item->getParentId()][] = $addressesFilter->out($item->toArray()); + } + } + } + return $addresses; + } + + /** + * Retrieve collection instance for orders list + * + * @return Mage_Sales_Model_Resource_Order_Collection + */ + protected function _getCollectionForRetrieve() + { + /** @var $collection Mage_Sales_Model_Resource_Order_Collection */ + $collection = Mage::getResourceModel('sales/order_collection'); + + $this->_applyCollectionModifiers($collection); + + return $collection; + } + + /** + * Retrieve collection instance for single order + * + * @param int $orderId Order identifier + * @return Mage_Sales_Model_Resource_Order_Collection + */ + protected function _getCollectionForSingleRetrieve($orderId) + { + /** @var $collection Mage_Sales_Model_Resource_Order_Collection */ + $collection = Mage::getResourceModel('sales/order_collection'); + + return $collection->addFieldToFilter($collection->getResource()->getIdFieldName(), $orderId); + } + + /** + * Retrieve a list or orders' comments in a form of [order ID => array of comments, ...] + * + * @param array $orderIds Orders' identifiers + * @return array + */ + protected function _getComments(array $orderIds) + { + $comments = array(); + + if ($this->_isOrderCommentsAllowed() && $this->_isSubCallAllowed('order_comments')) { + /** @var $commentsFilter Mage_Api2_Model_Acl_Filter */ + $commentsFilter = $this->_getSubModel('order_comments', array())->getFilter(); + // do comments request if at least one attribute allowed + if ($commentsFilter->getAllowedAttributes()) { + foreach ($this->_getCommentsCollection($orderIds)->getItems() as $item) { + $comments[$item->getParentId()][] = $commentsFilter->out($item->toArray()); + } + } + } + return $comments; + } + + /** + * Prepare and return order comments collection + * + * @param array $orderIds Orders' identifiers + * @return Mage_Sales_Model_Resource_Order_Status_History_Collection|Object + */ + protected function _getCommentsCollection(array $orderIds) + { + /* @var $collection Mage_Sales_Model_Resource_Order_Status_History_Collection */ + $collection = Mage::getResourceModel('sales/order_status_history_collection'); + $collection->setOrderFilter($orderIds); + + return $collection; + } + + /** + * Retrieve a list or orders' items in a form of [order ID => array of items, ...] + * + * @param array $orderIds Orders identifiers + * @return array + */ + protected function _getItems(array $orderIds) + { + $items = array(); + + if ($this->_isSubCallAllowed('order_items')) { + /** @var $itemsFilter Mage_Api2_Model_Acl_Filter */ + $itemsFilter = $this->_getSubModel('order_items', array())->getFilter(); + // do items request if at least one attribute allowed + if ($itemsFilter->getAllowedAttributes()) { + /* @var $collection Mage_Sales_Model_Resource_Order_Item_Collection */ + $collection = Mage::getResourceModel('sales/order_item_collection'); + + $collection->addAttributeToFilter('order_id', $orderIds); + + foreach ($collection->getItems() as $item) { + $items[$item->getOrderId()][] = $itemsFilter->out($item->toArray()); + } + } + } + return $items; + } + + /** + * Check gift messages information is allowed + * + * @return bool + */ + public function _isGiftMessageAllowed() + { + return in_array(self::PARAM_GIFT_MESSAGE, $this->getFilter()->getAllowedAttributes()); + } + + /** + * Check order comments information is allowed + * + * @return bool + */ + public function _isOrderCommentsAllowed() + { + return in_array(self::PARAM_ORDER_COMMENTS, $this->getFilter()->getAllowedAttributes()); + } + + /** + * Check payment method information is allowed + * + * @return bool + */ + public function _isPaymentMethodAllowed() + { + return in_array(self::PARAM_PAYMENT_METHOD, $this->getFilter()->getAllowedAttributes()); + } + + /** + * Check tax name information is allowed + * + * @return bool + */ + public function _isTaxNameAllowed() + { + return in_array(self::PARAM_TAX_NAME, $this->getFilter()->getAllowedAttributes()); + } + + /** + * Check tax rate information is allowed + * + * @return bool + */ + public function _isTaxRateAllowed() + { + return in_array(self::PARAM_TAX_RATE, $this->getFilter()->getAllowedAttributes()); + } + + /** + * Get orders list + * + * @return array + */ + protected function _retrieveCollection() + { + $collection = $this->_getCollectionForRetrieve(); + + if ($this->_isPaymentMethodAllowed()) { + $this->_addPaymentMethodInfo($collection); + } + if ($this->_isGiftMessageAllowed()) { + $this->_addGiftMessageInfo($collection); + } + $this->_addTaxInfo($collection); + + $ordersData = array(); + + foreach ($collection->getItems() as $order) { + $ordersData[$order->getId()] = $order->toArray(); + } + if ($ordersData) { + foreach ($this->_getAddresses(array_keys($ordersData)) as $orderId => $addresses) { + $ordersData[$orderId]['addresses'] = $addresses; + } + foreach ($this->_getItems(array_keys($ordersData)) as $orderId => $items) { + $ordersData[$orderId]['order_items'] = $items; + } + foreach ($this->_getComments(array_keys($ordersData)) as $orderId => $comments) { + $ordersData[$orderId]['order_comments'] = $comments; + } + } + return $ordersData; + } +} diff --git a/app/code/core/Mage/Sales/Model/Api2/Order/Address.php b/app/code/core/Mage/Sales/Model/Api2/Order/Address.php new file mode 100644 index 0000000000..a7f5071157 --- /dev/null +++ b/app/code/core/Mage/Sales/Model/Api2/Order/Address.php @@ -0,0 +1,36 @@ + + */ +class Mage_Sales_Model_Api2_Order_Address extends Mage_Api2_Model_Resource +{ +} diff --git a/app/code/core/Mage/Sales/Model/Api2/Order/Address/Rest.php b/app/code/core/Mage/Sales/Model/Api2/Order/Address/Rest.php new file mode 100644 index 0000000000..c433967f49 --- /dev/null +++ b/app/code/core/Mage/Sales/Model/Api2/Order/Address/Rest.php @@ -0,0 +1,92 @@ + + */ +abstract class Mage_Sales_Model_Api2_Order_Address_Rest extends Mage_Sales_Model_Api2_Order_Address +{ + /**#@+ + * Parameters in request used in model (usually specified in route mask) + */ + const PARAM_ORDER_ID = 'order_id'; + const PARAM_ADDRESS_TYPE = 'address_type'; + /**#@-*/ + + /** + * Retrieve order address + * + * @return array + */ + protected function _retrieve() + { + /** @var $address Mage_Sales_Model_Order_Address */ + $address = $this->_getCollectionForRetrieve() + ->addAttributeToFilter('address_type', $this->getRequest()->getParam(self::PARAM_ADDRESS_TYPE)) + ->getFirstItem(); + if (!$address->getId()) { + $this->_critical(self::RESOURCE_NOT_FOUND); + } + return $address->getData(); + } + + /** + * Retrieve order addresses + * + * @return array + */ + protected function _retrieveCollection() + { + $collection = $this->_getCollectionForRetrieve(); + + $this->_applyCollectionModifiers($collection); + $data = $collection->load()->toArray(); + + if (0 == count($data['items'])) { + $this->_critical(self::RESOURCE_NOT_FOUND); + } + + return $data['items']; + } + + /** + * Retrieve collection instances + * + * @return Mage_Sales_Model_Resource_Order_Address_Collection + */ + protected function _getCollectionForRetrieve() + { + /* @var $collection Mage_Sales_Model_Resource_Order_Address_Collection */ + $collection = Mage::getResourceModel('sales/order_address_collection'); + $collection->addAttributeToFilter('parent_id', $this->getRequest()->getParam(self::PARAM_ORDER_ID)); + + return $collection; + } +} diff --git a/app/code/core/Mage/Sales/Model/Api2/Order/Address/Rest/Admin/V1.php b/app/code/core/Mage/Sales/Model/Api2/Order/Address/Rest/Admin/V1.php new file mode 100644 index 0000000000..490087ca96 --- /dev/null +++ b/app/code/core/Mage/Sales/Model/Api2/Order/Address/Rest/Admin/V1.php @@ -0,0 +1,36 @@ + + */ +class Mage_Sales_Model_Api2_Order_Address_Rest_Admin_V1 extends Mage_Sales_Model_Api2_Order_Address_Rest +{ +} diff --git a/app/code/core/Mage/Sales/Model/Api2/Order/Address/Rest/Customer/V1.php b/app/code/core/Mage/Sales/Model/Api2/Order/Address/Rest/Customer/V1.php new file mode 100644 index 0000000000..ab19a11625 --- /dev/null +++ b/app/code/core/Mage/Sales/Model/Api2/Order/Address/Rest/Customer/V1.php @@ -0,0 +1,48 @@ + + */ +class Mage_Sales_Model_Api2_Order_Address_Rest_Customer_V1 extends Mage_Sales_Model_Api2_Order_Address_Rest +{ + /** + * Retrieve collection instances + * + * @return Mage_Sales_Model_Resource_Order_Address_Collection + */ + protected function _getCollectionForRetrieve() + { + $collection = parent::_getCollectionForRetrieve(); + $collection->addAttributeToFilter('customer_id', $this->getApiUser()->getUserId()); + + return $collection; + } +} diff --git a/app/code/core/Mage/Sales/Model/Api2/Order/Comments.php b/app/code/core/Mage/Sales/Model/Api2/Order/Comments.php new file mode 100644 index 0000000000..b7b1ddfd59 --- /dev/null +++ b/app/code/core/Mage/Sales/Model/Api2/Order/Comments.php @@ -0,0 +1,36 @@ + + */ +class Mage_Sales_Model_Api2_Order_Comments extends Mage_Api2_Model_Resource +{ +} diff --git a/app/code/core/Mage/Sales/Model/Api2/Order/Comments/Rest.php b/app/code/core/Mage/Sales/Model/Api2/Order/Comments/Rest.php new file mode 100644 index 0000000000..bfdf308cf4 --- /dev/null +++ b/app/code/core/Mage/Sales/Model/Api2/Order/Comments/Rest.php @@ -0,0 +1,89 @@ + + */ +abstract class Mage_Sales_Model_Api2_Order_Comments_Rest extends Mage_Sales_Model_Api2_Order_Comments +{ + /**#@+ + * Parameters in request used in model (usually specified in route mask) + */ + const PARAM_ORDER_ID = 'id'; + /**#@-*/ + + /** + * Get sales order comments + * + * @return array + */ + protected function _retrieveCollection() + { + $collection = $this->_getCollectionForRetrieve(); + $collection->addFieldToSelect($this->getForcedAttributes()); + + $this->_applyCollectionModifiers($collection); + + $data = $collection->load()->toArray(); + return isset($data['items']) ? $data['items'] : $data; + } + + /** + * Retrieve collection instances + * + * @return Mage_Sales_Model_Resource_Order_Status_History_Collection + */ + protected function _getCollectionForRetrieve() + { + /* @var $collection Mage_Sales_Model_Resource_Order_Status_History_Collection */ + $collection = Mage::getResourceModel('sales/order_status_history_collection'); + $collection->setOrderFilter($this->_loadOrderById($this->getRequest()->getParam(self::PARAM_ORDER_ID))); + + return $collection; + } + + /** + * Load order by id + * + * @param int $id + * @throws Mage_Api2_Exception + * @return Mage_Sales_Model_Order + */ + protected function _loadOrderById($id) + { + /* @var $order Mage_Sales_Model_Order */ + $order = Mage::getModel('sales/order')->load($id); + if (!$order->getId()) { + $this->_critical(self::RESOURCE_NOT_FOUND); + } + + return $order; + } +} diff --git a/app/code/core/Mage/Sales/Model/Api2/Order/Comments/Rest/Admin/V1.php b/app/code/core/Mage/Sales/Model/Api2/Order/Comments/Rest/Admin/V1.php new file mode 100644 index 0000000000..e6e6b45aab --- /dev/null +++ b/app/code/core/Mage/Sales/Model/Api2/Order/Comments/Rest/Admin/V1.php @@ -0,0 +1,36 @@ + + */ +class Mage_Sales_Model_Api2_Order_Comments_Rest_Admin_V1 extends Mage_Sales_Model_Api2_Order_Comments_Rest +{ +} diff --git a/app/code/core/Mage/Sales/Model/Api2/Order/Comments/Rest/Customer/V1.php b/app/code/core/Mage/Sales/Model/Api2/Order/Comments/Rest/Customer/V1.php new file mode 100644 index 0000000000..203d6614ae --- /dev/null +++ b/app/code/core/Mage/Sales/Model/Api2/Order/Comments/Rest/Customer/V1.php @@ -0,0 +1,66 @@ + + */ +class Mage_Sales_Model_Api2_Order_Comments_Rest_Customer_V1 extends Mage_Sales_Model_Api2_Order_Comments_Rest +{ + /** + * Load order by id + * + * @param int $id + * @throws Mage_Api2_Exception + * @return Mage_Sales_Model_Order + */ + protected function _loadOrderById($id) + { + $order = parent::_loadOrderById($id); + + // Check sales order's owner + if ($this->getApiUser()->getUserId() !== $order->getCustomerId()) { + $this->_critical(self::RESOURCE_NOT_FOUND); + } + return $order; + } + + /** + * Retrieve collection instances + * + * @return Mage_Sales_Model_Resource_Order_Status_History_Collection + */ + protected function _getCollectionForRetrieve() + { + $collection = parent::_getCollectionForRetrieve(); + $collection->addFieldToFilter('is_visible_on_front', 1); + + return $collection; + } +} diff --git a/app/code/core/Mage/Sales/Model/Api2/Order/Items.php b/app/code/core/Mage/Sales/Model/Api2/Order/Items.php new file mode 100644 index 0000000000..4497003ba3 --- /dev/null +++ b/app/code/core/Mage/Sales/Model/Api2/Order/Items.php @@ -0,0 +1,36 @@ + + */ +class Mage_Sales_Model_Api2_Order_Items extends Mage_Api2_Model_Resource +{ +} diff --git a/app/code/core/Mage/Sales/Model/Api2/Order/Items/Rest.php b/app/code/core/Mage/Sales/Model/Api2/Order/Items/Rest.php new file mode 100644 index 0000000000..24b3a18e04 --- /dev/null +++ b/app/code/core/Mage/Sales/Model/Api2/Order/Items/Rest.php @@ -0,0 +1,93 @@ + + */ +abstract class Mage_Sales_Model_Api2_Order_Items_Rest extends Mage_Sales_Model_Api2_Order_Items +{ + /**#@+ + * Parameters in request used in model (usually specified in route) + */ + const PARAM_ORDER_ID = 'id'; + /**#@-*/ + + /** + * Get order items list + * + * @return array + */ + protected function _retrieveCollection() + { + $data = array(); + /* @var $item Mage_Sales_Model_Order_Item */ + foreach ($this->_getCollectionForRetrieve() as $item) { + $itemData = $item->getData(); + $itemData['status'] = $item->getStatus(); + $data[] = $itemData; + } + return $data; + } + /** + * Retrieve order items collection + * + * @return Mage_Sales_Model_Resource_Order_Item_Collection + */ + protected function _getCollectionForRetrieve() + { + /* @var $order Mage_Sales_Model_Order */ + $order = $this->_loadOrderById( + $this->getRequest()->getParam(self::PARAM_ORDER_ID) + ); + + /* @var $collection Mage_Sales_Model_Resource_Order_Item_Collection */ + $collection = Mage::getResourceModel('sales/order_item_collection'); + $collection->setOrderFilter($order->getId()); + $this->_applyCollectionModifiers($collection); + return $collection; + } + + /** + * Load order by id + * + * @param int $id + * @throws Mage_Api2_Exception + * @return Mage_Sales_Model_Order + */ + protected function _loadOrderById($id) + { + /* @var $order Mage_Sales_Model_Order */ + $order = Mage::getModel('sales/order')->load($id); + if (!$order->getId()) { + $this->_critical(self::RESOURCE_NOT_FOUND); + } + return $order; + } +} diff --git a/app/code/core/Mage/Sales/Model/Api2/Order/Items/Rest/Admin/V1.php b/app/code/core/Mage/Sales/Model/Api2/Order/Items/Rest/Admin/V1.php new file mode 100644 index 0000000000..eb76e98c6b --- /dev/null +++ b/app/code/core/Mage/Sales/Model/Api2/Order/Items/Rest/Admin/V1.php @@ -0,0 +1,36 @@ + + */ +class Mage_Sales_Model_Api2_Order_Items_Rest_Admin_V1 extends Mage_Sales_Model_Api2_Order_Items_Rest +{ +} diff --git a/app/code/core/Mage/Sales/Model/Api2/Order/Items/Rest/Customer/V1.php b/app/code/core/Mage/Sales/Model/Api2/Order/Items/Rest/Customer/V1.php new file mode 100644 index 0000000000..87404efadd --- /dev/null +++ b/app/code/core/Mage/Sales/Model/Api2/Order/Items/Rest/Customer/V1.php @@ -0,0 +1,56 @@ + + */ +class Mage_Sales_Model_Api2_Order_Items_Rest_Customer_V1 extends Mage_Sales_Model_Api2_Order_Items_Rest +{ + /** + * Load order by id + * + * @param int $id + * @throws Mage_Api2_Exception + * @return Mage_Sales_Model_Order + */ + protected function _loadOrderById($id) + { + /* @var $order Mage_Sales_Model_Order */ + $order = Mage::getModel('sales/order')->load($id); + if (!$order->getId()) { + $this->_critical(self::RESOURCE_NOT_FOUND); + } + // check order owner + if ($this->getApiUser()->getUserId() != $order->getCustomerId()) { + $this->_critical(self::RESOURCE_NOT_FOUND); + } + return $order; + } +} diff --git a/app/code/core/Mage/Sales/Model/Api2/Order/Rest.php b/app/code/core/Mage/Sales/Model/Api2/Order/Rest.php new file mode 100644 index 0000000000..9e1cf0915c --- /dev/null +++ b/app/code/core/Mage/Sales/Model/Api2/Order/Rest.php @@ -0,0 +1,76 @@ + + */ +abstract class Mage_Sales_Model_Api2_Order_Rest extends Mage_Sales_Model_Api2_Order +{ + /** + * Retrieve information about specified order item + * + * @throws Mage_Api2_Exception + * @return array + */ + protected function _retrieve() + { + $orderId = $this->getRequest()->getParam('id'); + $collection = $this->_getCollectionForSingleRetrieve($orderId); + + if ($this->_isPaymentMethodAllowed()) { + $this->_addPaymentMethodInfo($collection); + } + if ($this->_isGiftMessageAllowed()) { + $this->_addGiftMessageInfo($collection); + } + $this->_addTaxInfo($collection); + + $order = $collection->getItemById($orderId); + + if (!$order) { + $this->_critical(self::RESOURCE_NOT_FOUND); + } + $orderData = $order->getData(); + $addresses = $this->_getAddresses(array($orderId)); + $items = $this->_getItems(array($orderId)); + $comments = $this->_getComments(array($orderId)); + + if ($addresses) { + $orderData['addresses'] = $addresses[$orderId]; + } + if ($items) { + $orderData['order_items'] = $items[$orderId]; + } + if ($comments) { + $orderData['order_comments'] = $comments[$orderId]; + } + return $orderData; + } +} diff --git a/app/code/core/Mage/Sales/Model/Api2/Order/Rest/Admin/V1.php b/app/code/core/Mage/Sales/Model/Api2/Order/Rest/Admin/V1.php new file mode 100644 index 0000000000..ea6cf24f49 --- /dev/null +++ b/app/code/core/Mage/Sales/Model/Api2/Order/Rest/Admin/V1.php @@ -0,0 +1,36 @@ + + */ +class Mage_Sales_Model_Api2_Order_Rest_Admin_V1 extends Mage_Sales_Model_Api2_Order_Rest +{ +} diff --git a/app/code/core/Mage/Sales/Model/Api2/Order/Rest/Customer/V1.php b/app/code/core/Mage/Sales/Model/Api2/Order/Rest/Customer/V1.php new file mode 100644 index 0000000000..b0ea2aa571 --- /dev/null +++ b/app/code/core/Mage/Sales/Model/Api2/Order/Rest/Customer/V1.php @@ -0,0 +1,71 @@ + + */ +class Mage_Sales_Model_Api2_Order_Rest_Customer_V1 extends Mage_Sales_Model_Api2_Order_Rest +{ + /** + * Retrieve collection instance for orders + * + * @return Mage_Sales_Model_Resource_Order_Collection + */ + protected function _getCollectionForRetrieve() + { + return parent::_getCollectionForRetrieve()->addAttributeToFilter( + 'customer_id', array('eq' => $this->getApiUser()->getUserId()) + ); + } + + /** + * Retrieve collection instance for single order + * + * @param int $orderId Order identifier + * @return Mage_Sales_Model_Resource_Order_Collection + */ + protected function _getCollectionForSingleRetrieve($orderId) + { + return parent::_getCollectionForSingleRetrieve($orderId)->addAttributeToFilter( + 'customer_id', array('eq' => $this->getApiUser()->getUserId()) + ); + } + + /** + * Prepare and return order comments collection + * + * @param array $orderIds Orders' identifiers + * @return Mage_Sales_Model_Resource_Order_Status_History_Collection|Object + */ + protected function _getCommentsCollection(array $orderIds) + { + return parent::_getCommentsCollection($orderIds)->addFieldToFilter('is_visible_on_front', 1); + } +} diff --git a/app/code/core/Mage/Sales/Model/Order/Api.php b/app/code/core/Mage/Sales/Model/Order/Api.php index 20d19fa42f..a4b7313be1 100644 --- a/app/code/core/Mage/Sales/Model/Order/Api.php +++ b/app/code/core/Mage/Sales/Model/Order/Api.php @@ -73,7 +73,7 @@ public function items($filters = null) //TODO: add full name logic $billingAliasName = 'billing_o_a'; $shippingAliasName = 'shipping_o_a'; - + $collection = Mage::getModel("sales/order")->getCollection() ->addAttributeToSelect('*') ->addAddressFields() @@ -84,7 +84,8 @@ public function items($filters = null) 'billing_lastname', "{{billing_lastname}}", array('billing_lastname'=>"$billingAliasName.lastname") ) ->addExpressionFieldToSelect( - 'shipping_firstname', "{{shipping_firstname}}", array('shipping_firstname'=>"$shippingAliasName.firstname") + 'shipping_firstname', "{{shipping_firstname}}", + array('shipping_firstname'=>"$shippingAliasName.firstname") ) ->addExpressionFieldToSelect( 'shipping_lastname', "{{shipping_lastname}}", array('shipping_lastname'=>"$shippingAliasName.lastname") @@ -92,14 +93,20 @@ public function items($filters = null) ->addExpressionFieldToSelect( 'billing_name', "CONCAT({{billing_firstname}}, ' ', {{billing_lastname}})", - array('billing_firstname'=>"$billingAliasName.firstname", 'billing_lastname'=>"$billingAliasName.lastname") + array( + 'billing_firstname'=>"$billingAliasName.firstname", + 'billing_lastname'=>"$billingAliasName.lastname" + ) ) ->addExpressionFieldToSelect( 'shipping_name', 'CONCAT({{shipping_firstname}}, " ", {{shipping_lastname}})', - array('shipping_firstname'=>"$shippingAliasName.firstname", 'shipping_lastname'=>"$shippingAliasName.lastname") + array( + 'shipping_firstname'=>"$shippingAliasName.firstname", + 'shipping_lastname'=>"$shippingAliasName.lastname" + ) ); - + if (is_array($filters)) { try { foreach ($filters as $field => $value) { @@ -254,13 +261,18 @@ public function cancel($orderIncrementId) { $order = $this->_initOrder($orderIncrementId); + if (Mage_Sales_Model_Order::STATE_CANCELED == $order->getState()) { + $this->_fault('status_not_changed'); + } try { $order->cancel(); $order->save(); } catch (Mage_Core_Exception $e) { $this->_fault('status_not_changed', $e->getMessage()); } - + if (Mage_Sales_Model_Order::STATE_CANCELED != $order->getState()) { + $this->_fault('status_not_changed'); + } return true; } diff --git a/app/code/core/Mage/Sales/Model/Order/Api/V2.php b/app/code/core/Mage/Sales/Model/Order/Api/V2.php index edc26b9bf2..b9900b6f6d 100644 --- a/app/code/core/Mage/Sales/Model/Order/Api/V2.php +++ b/app/code/core/Mage/Sales/Model/Order/Api/V2.php @@ -55,7 +55,9 @@ public function items($filters = null) 'billing_lastname', "{{billing_lastname}}", array('billing_lastname'=>"$billingAliasName.lastname") ) ->addExpressionFieldToSelect( - 'shipping_firstname', "{{shipping_firstname}}", array('shipping_firstname'=>"$shippingAliasName.firstname") + 'shipping_firstname', + "{{shipping_firstname}}", + array('shipping_firstname'=>"$shippingAliasName.firstname") ) ->addExpressionFieldToSelect( 'shipping_lastname', "{{shipping_lastname}}", array('shipping_lastname'=>"$shippingAliasName.lastname") @@ -63,30 +65,40 @@ public function items($filters = null) ->addExpressionFieldToSelect( 'billing_name', "CONCAT({{billing_firstname}}, ' ', {{billing_lastname}})", - array('billing_firstname'=>"$billingAliasName.firstname", 'billing_lastname'=>"$billingAliasName.lastname") + array( + 'billing_firstname'=>"$billingAliasName.firstname", + 'billing_lastname'=>"$billingAliasName.lastname" + ) ) ->addExpressionFieldToSelect( 'shipping_name', 'CONCAT({{shipping_firstname}}, " ", {{shipping_lastname}})', - array('shipping_firstname'=>"$shippingAliasName.firstname", 'shipping_lastname'=>"$shippingAliasName.lastname") + array( + 'shipping_firstname'=>"$shippingAliasName.firstname", + 'shipping_lastname'=>"$shippingAliasName.lastname" + ) ); $preparedFilters = array(); if (isset($filters->filter)) { - foreach ($filters->filter as $_filter) { - $preparedFilters[][$_filter->key] = $_filter->value; + foreach ($filters->filter as $_filterKey => $_filterValue) { + if (is_object($_filterValue)) { + $preparedFilters[][$_filterValue->key] = $_filterValue->value; + } else { + $preparedFilters[][$_filterKey] = $_filterValue; + } } } if (isset($filters->complex_filter)) { - foreach ($filters->complex_filter as $_filter) { + foreach ($filters->complex_filter as $_key => $_filter) { $_value = $_filter->value; if(is_object($_value)) { $preparedFilters[][$_filter->key] = array( $_value->key => $_value->value ); } elseif(is_array($_value)) { - $preparedFilters[][$_filter->key] = array( - $_value['key'] => $_value['value'] + $preparedFilters[][$_key] = array( + $_filter->key => $_value ); } else { $preparedFilters[][$_filter->key] = $_value; diff --git a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Api.php b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Api.php index 5a3a3aef12..b33c87f502 100644 --- a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Api.php +++ b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Api.php @@ -56,9 +56,9 @@ public function __construct() * @param array|null $filter * @return array */ - public function items($filter = null) + public function items($filters = null) { - $filter = $this->_prepareListFilter($filter); + $filter = $this->_prepareListFilter($filters); try { $result = array(); /** @var $creditmemoModel Mage_Sales_Model_Order_Creditmemo */ @@ -115,14 +115,15 @@ public function info($creditmemoIncrementId) foreach ($creditmemo->getCommentsCollection() as $comment) { $result['comments'][] = $this->_getAttributes($comment, 'creditmemo_comment'); } + return $result; } /** * Create new credit memo for order * - * @param string $orderIncrementId - * @param array $data array('qtys' => array('sku1' => qty1, ... , 'skuN' => qtyN), + * @param string $creditmemoIncrementId + * @param array $creditmemoData array('qtys' => array('sku1' => qty1, ... , 'skuN' => qtyN), * 'shipping_amount' => value, 'adjustment_positive' => value, 'adjustment_negative' => value) * @param string|null $comment * @param bool $notifyCustomer @@ -130,23 +131,23 @@ public function info($creditmemoIncrementId) * @param string $refundToStoreCreditAmount * @return string $creditmemoIncrementId */ - public function create($orderIncrementId, $data = null, $comment = null, $notifyCustomer = false, + public function create($creditmemoIncrementId, $creditmemoData = null, $comment = null, $notifyCustomer = false, $includeComment = false, $refundToStoreCreditAmount = null) { /** @var $order Mage_Sales_Model_Order */ - $order = Mage::getModel('sales/order')->load($orderIncrementId, 'increment_id'); + $order = Mage::getModel('sales/order')->load($creditmemoIncrementId, 'increment_id'); if (!$order->getId()) { $this->_fault('order_not_exists'); } if (!$order->canCreditmemo()) { $this->_fault('cannot_create_creditmemo'); } - $data = $this->_prepareCreateData($data); + $creditmemoData = $this->_prepareCreateData($creditmemoData); /** @var $service Mage_Sales_Model_Service_Order */ $service = Mage::getModel('sales/service_order', $order); /** @var $creditmemo Mage_Sales_Model_Order_Creditmemo */ - $creditmemo = $service->prepareCreditmemo($data); + $creditmemo = $service->prepareCreditmemo($creditmemoData); // refund to Store Credit if ($refundToStoreCreditAmount) { diff --git a/app/code/core/Mage/Sales/Model/Order/Invoice/Api/V2.php b/app/code/core/Mage/Sales/Model/Order/Invoice/Api/V2.php index 710e48b508..754c0cf0b6 100644 --- a/app/code/core/Mage/Sales/Model/Order/Invoice/Api/V2.php +++ b/app/code/core/Mage/Sales/Model/Order/Invoice/Api/V2.php @@ -116,16 +116,16 @@ protected function _prepareItemQtyData($data) /** * Create new invoice for order * - * @param string $orderIncrementId + * @param string $invoiceIncrementId * @param array $itemsQty * @param string $comment * @param booleam $email * @param boolean $includeComment * @return string */ - public function create($orderIncrementId, $itemsQty, $comment = null, $email = false, $includeComment = false) + public function create($invoiceIncrementId, $itemsQty, $comment = null, $email = false, $includeComment = false) { - $order = Mage::getModel('sales/order')->loadByIncrementId($orderIncrementId); + $order = Mage::getModel('sales/order')->loadByIncrementId($invoiceIncrementId); $itemsQty = $this->_prepareItemQtyData($itemsQty); /* @var $order Mage_Sales_Model_Order */ /** diff --git a/app/code/core/Mage/Sales/Model/Order/Pdf/Abstract.php b/app/code/core/Mage/Sales/Model/Order/Pdf/Abstract.php index f557e9a682..b16b39c631 100644 --- a/app/code/core/Mage/Sales/Model/Order/Pdf/Abstract.php +++ b/app/code/core/Mage/Sales/Model/Order/Pdf/Abstract.php @@ -24,7 +24,6 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - /** * Sales Order PDF abstract model * @@ -34,7 +33,13 @@ */ abstract class Mage_Sales_Model_Order_Pdf_Abstract extends Varien_Object { + /** + * Y coordinate + * + * @var int + */ public $y; + /** * Item renderers with render type key * @@ -45,9 +50,12 @@ abstract class Mage_Sales_Model_Order_Pdf_Abstract extends Varien_Object */ protected $_renderers = array(); - const XML_PATH_SALES_PDF_INVOICE_PUT_ORDER_ID = 'sales_pdf/invoice/put_order_id'; - const XML_PATH_SALES_PDF_SHIPMENT_PUT_ORDER_ID = 'sales_pdf/shipment/put_order_id'; - const XML_PATH_SALES_PDF_CREDITMEMO_PUT_ORDER_ID = 'sales_pdf/creditmemo/put_order_id'; + /** + * Predefined constants + */ + const XML_PATH_SALES_PDF_INVOICE_PUT_ORDER_ID = 'sales_pdf/invoice/put_order_id'; + const XML_PATH_SALES_PDF_SHIPMENT_PUT_ORDER_ID = 'sales_pdf/shipment/put_order_id'; + const XML_PATH_SALES_PDF_CREDITMEMO_PUT_ORDER_ID = 'sales_pdf/creditmemo/put_order_id'; /** * Zend PDF object @@ -56,6 +64,11 @@ abstract class Mage_Sales_Model_Order_Pdf_Abstract extends Varien_Object */ protected $_pdf; + /** + * Default total model + * + * @var string + */ protected $_defaultTotalModel = 'sales/order_pdf_total_default'; /** @@ -74,9 +87,9 @@ abstract public function getPdf(); * Similar calculations exist inside the layout manager class, but widths are * generally calculated only after determining line fragments. * - * @param string $string - * @param Zend_Pdf_Resource_Font $font - * @param float $fontSize Font size in points + * @param string $string + * @param Zend_Pdf_Resource_Font $font + * @param float $fontSize Font size in points * @return float */ public function widthForStringUsingFontSize($string, $font, $fontSize) @@ -99,12 +112,12 @@ public function widthForStringUsingFontSize($string, $font, $fontSize) /** * Calculate coordinates to draw something in a column aligned to the right * - * @param string $string - * @param int $x - * @param int $columnWidth - * @param Zend_Pdf_Resource_Font $font - * @param int $fontSize - * @param int $padding + * @param string $string + * @param int $x + * @param int $columnWidth + * @param Zend_Pdf_Resource_Font $font + * @param int $fontSize + * @param int $padding * @return int */ public function getAlignRight($string, $x, $columnWidth, Zend_Pdf_Resource_Font $font, $fontSize, $padding = 5) @@ -116,11 +129,11 @@ public function getAlignRight($string, $x, $columnWidth, Zend_Pdf_Resource_Font /** * Calculate coordinates to draw something in a column aligned to the center * - * @param string $string - * @param int $x - * @param int $columnWidth - * @param Zend_Pdf_Resource_Font $font - * @param int $fontSize + * @param string $string + * @param int $x + * @param int $columnWidth + * @param Zend_Pdf_Resource_Font $font + * @param int $fontSize * @return int */ public function getAlignCenter($string, $x, $columnWidth, Zend_Pdf_Resource_Font $font, $fontSize) @@ -129,50 +142,91 @@ public function getAlignCenter($string, $x, $columnWidth, Zend_Pdf_Resource_Font return $x + round(($columnWidth - $width) / 2); } + /** + * Insert logo to pdf page + * + * @param Zend_Pdf_Page $page + * @param null $store + */ protected function insertLogo(&$page, $store = null) { + $this->y = $this->y ? $this->y : 815; $image = Mage::getStoreConfig('sales/identity/logo', $store); if ($image) { $image = Mage::getBaseDir('media') . '/sales/store/logo/' . $image; if (is_file($image)) { - $image = Zend_Pdf_Image::imageWithPath($image); - $page->drawImage($image, 25, 800, 125, 825); + $image = Zend_Pdf_Image::imageWithPath($image); + $top = 830; //top border of the page + $widthLimit = 270; //half of the page width + $heightLimit = 270; //assuming the image is not a "skyscraper" + $width = $image->getPixelWidth(); + $height = $image->getPixelHeight(); + + //preserving aspect ratio (proportions) + $ratio = $width / $height; + if ($ratio > 1 && $width > $widthLimit) { + $width = $widthLimit; + $height = $width / $ratio; + } elseif ($ratio < 1 && $height > $heightLimit) { + $height = $heightLimit; + $width = $height * $ratio; + } elseif ($ratio == 1 && $height > $heightLimit) { + $height = $heightLimit; + $width = $widthLimit; + } + + $y1 = $top - $height; + $y2 = $top; + $x1 = 25; + $x2 = $x1 + $width; + + //coordinates after transformation are rounded by Zend + $page->drawImage($image, $x1, $y1, $x2, $y2); + + $this->y = $y1 - 10; } } - //return $page; } + /** + * Insert address to pdf page + * + * @param Zend_Pdf_Page $page + * @param null $store + */ protected function insertAddress(&$page, $store = null) { $page->setFillColor(new Zend_Pdf_Color_GrayScale(0)); - $this->_setFontRegular($page, 5); - - $page->setLineWidth(0.5); - $page->setLineColor(new Zend_Pdf_Color_GrayScale(0.5)); - $page->drawLine(125, 825, 125, 790); - + $font = $this->_setFontRegular($page, 10); $page->setLineWidth(0); - $this->y = 820; + $this->y = $this->y ? $this->y : 815; + $top = 815; foreach (explode("\n", Mage::getStoreConfig('sales/identity/address', $store)) as $value){ - if ($value!=='') { - $page->drawText(trim(strip_tags($value)), 130, $this->y, 'UTF-8'); - $this->y -=7; + if ($value !== '') { + $value = preg_replace('/]*>/i', "\n", $value); + foreach (Mage::helper('core/string')->str_split($value, 45, true, true) as $_value) { + $page->drawText(trim(strip_tags($_value)), + $this->getAlignRight($_value, 130, 440, $font, 10), + $top, + 'UTF-8'); + $top -= 10; + } } } - //return $page; + $this->y = ($this->y > $top) ? $top : $this->y; } /** * Format address * - * @param string $address + * @param string $address * @return array */ protected function _formatAddress($address) { $return = array(); foreach (explode('|', $address) as $str) { - foreach (Mage::helper('core/string')->str_split($str, 65, true, true) as $part) { + foreach (Mage::helper('core/string')->str_split($str, 45, true, true) as $part) { if (empty($part)) { continue; } @@ -182,6 +236,36 @@ protected function _formatAddress($address) return $return; } + /** + * Calculate address height + * + * @param array $address + * @return int Height + */ + protected function _calcAddressHeight($address) + { + $y = 0; + foreach ($address as $value){ + if ($value !== '') { + $text = array(); + foreach (Mage::helper('core/string')->str_split($value, 55, true, true) as $_value) { + $text[] = $_value; + } + foreach ($text as $part) { + $y += 15; + } + } + } + return $y; + } + + /** + * Insert order to pdf page + * + * @param Zend_Pdf_Page $page + * @param Mage_Sales_Model_Order $obj + * @param bool $putOrderId + */ protected function insertOrder(&$page, $obj, $putOrderId = true) { if ($obj instanceof Mage_Sales_Model_Order) { @@ -192,26 +276,36 @@ protected function insertOrder(&$page, $obj, $putOrderId = true) $order = $shipment->getOrder(); } - /* @var $order Mage_Sales_Model_Order */ - $page->setFillColor(new Zend_Pdf_Color_GrayScale(0.5)); - - $page->drawRectangle(25, 790, 570, 755); + $this->y = $this->y ? $this->y : 815; + $top = $this->y; + $page->setFillColor(new Zend_Pdf_Color_GrayScale(0.45)); + $page->setLineColor(new Zend_Pdf_Color_GrayScale(0.45)); + $page->drawRectangle(25, $top, 570, $top - 55); $page->setFillColor(new Zend_Pdf_Color_GrayScale(1)); - $this->_setFontRegular($page); - + $this->setDocHeaderCoordinates(array(25, $top, 570, $top - 55)); + $this->_setFontRegular($page, 10); if ($putOrderId) { - $page->drawText(Mage::helper('sales')->__('Order # ').$order->getRealOrderId(), 35, 770, 'UTF-8'); + $page->drawText( + Mage::helper('sales')->__('Order # ') . $order->getRealOrderId(), 35, ($top -= 30), 'UTF-8' + ); } - //$page->drawText(Mage::helper('sales')->__('Order Date: ') . date( 'D M j Y', strtotime( $order->getCreatedAt() ) ), 35, 760, 'UTF-8'); - $page->drawText(Mage::helper('sales')->__('Order Date: ') . Mage::helper('core')->formatDate($order->getCreatedAtStoreDate(), 'medium', false), 35, 760, 'UTF-8'); + $page->drawText( + Mage::helper('sales')->__('Order Date: ') . Mage::helper('core')->formatDate( + $order->getCreatedAtStoreDate(), 'medium', false + ), + 35, + ($top -= 15), + 'UTF-8' + ); + $top -= 10; $page->setFillColor(new Zend_Pdf_Color_Rgb(0.93, 0.92, 0.92)); $page->setLineColor(new Zend_Pdf_Color_GrayScale(0.5)); $page->setLineWidth(0.5); - $page->drawRectangle(25, 755, 275, 730); - $page->drawRectangle(275, 755, 570, 730); + $page->drawRectangle(25, $top, 275, ($top - 25)); + $page->drawRectangle(275, $top, 570, ($top - 25)); /* Calculate blocks info */ @@ -235,58 +329,71 @@ protected function insertOrder(&$page, $obj, $putOrderId = true) if (!$order->getIsVirtual()) { /* Shipping Address */ $shippingAddress = $this->_formatAddress($order->getShippingAddress()->format('pdf')); - $shippingMethod = $order->getShippingDescription(); } $page->setFillColor(new Zend_Pdf_Color_GrayScale(0)); - $this->_setFontRegular($page); - $page->drawText(Mage::helper('sales')->__('SOLD TO:'), 35, 740 , 'UTF-8'); + $this->_setFontBold($page, 12); + $page->drawText(Mage::helper('sales')->__('Sold to:'), 35, ($top - 15), 'UTF-8'); if (!$order->getIsVirtual()) { - $page->drawText(Mage::helper('sales')->__('SHIP TO:'), 285, 740 , 'UTF-8'); - } - else { - $page->drawText(Mage::helper('sales')->__('Payment Method:'), 285, 740 , 'UTF-8'); + $page->drawText(Mage::helper('sales')->__('Ship to:'), 285, ($top - 15), 'UTF-8'); + } else { + $page->drawText(Mage::helper('sales')->__('Payment Method:'), 285, ($top - 15), 'UTF-8'); } - if (!$order->getIsVirtual()) { - $y = 730 - (max(count($billingAddress), count($shippingAddress)) * 10 + 5); - } - else { - $y = 730 - (count($billingAddress) * 10 + 5); + $addressesHeight = $this->_calcAddressHeight($billingAddress); + if (isset($shippingAddress)) { + $addressesHeight = max($addressesHeight, $this->_calcAddressHeight($shippingAddress)); } $page->setFillColor(new Zend_Pdf_Color_GrayScale(1)); - $page->drawRectangle(25, 730, 570, $y); + $page->drawRectangle(25, ($top - 25), 570, $top - 33 - $addressesHeight); $page->setFillColor(new Zend_Pdf_Color_GrayScale(0)); - $this->_setFontRegular($page); - $this->y = 720; + $this->_setFontRegular($page, 10); + $this->y = $top - 40; + $addressesStartY = $this->y; foreach ($billingAddress as $value){ - if ($value!=='') { - $page->drawText(strip_tags(ltrim($value)), 35, $this->y, 'UTF-8'); - $this->y -=10; + if ($value !== '') { + $text = array(); + foreach (Mage::helper('core/string')->str_split($value, 45, true, true) as $_value) { + $text[] = $_value; + } + foreach ($text as $part) { + $page->drawText(strip_tags(ltrim($part)), 35, $this->y, 'UTF-8'); + $this->y -= 15; + } } } + $addressesEndY = $this->y; + if (!$order->getIsVirtual()) { - $this->y = 720; + $this->y = $addressesStartY; foreach ($shippingAddress as $value){ if ($value!=='') { - $page->drawText(strip_tags(ltrim($value)), 285, $this->y, 'UTF-8'); - $this->y -=10; + $text = array(); + foreach (Mage::helper('core/string')->str_split($value, 45, true, true) as $_value) { + $text[] = $_value; + } + foreach ($text as $part) { + $page->drawText(strip_tags(ltrim($part)), 285, $this->y, 'UTF-8'); + $this->y -= 15; + } } - } + $addressesEndY = min($addressesEndY, $this->y); + $this->y = $addressesEndY; + $page->setFillColor(new Zend_Pdf_Color_Rgb(0.93, 0.92, 0.92)); $page->setLineWidth(0.5); $page->drawRectangle(25, $this->y, 275, $this->y-25); $page->drawRectangle(275, $this->y, 570, $this->y-25); - $this->y -=15; - $this->_setFontBold($page); + $this->y -= 15; + $this->_setFontBold($page, 12); $page->setFillColor(new Zend_Pdf_Color_GrayScale(0)); $page->drawText(Mage::helper('sales')->__('Payment Method'), 35, $this->y, 'UTF-8'); $page->drawText(Mage::helper('sales')->__('Shipping Method:'), 285, $this->y , 'UTF-8'); @@ -294,36 +401,52 @@ protected function insertOrder(&$page, $obj, $putOrderId = true) $this->y -=10; $page->setFillColor(new Zend_Pdf_Color_GrayScale(1)); - $this->_setFontRegular($page); + $this->_setFontRegular($page, 10); $page->setFillColor(new Zend_Pdf_Color_GrayScale(0)); $paymentLeft = 35; $yPayments = $this->y - 15; } else { - $yPayments = 720; + $yPayments = $addressesStartY; $paymentLeft = 285; } foreach ($payment as $value){ - if (trim($value)!=='') { - $page->drawText(strip_tags(trim($value)), $paymentLeft, $yPayments, 'UTF-8'); - $yPayments -=10; + if (trim($value) != '') { + //Printing "Payment Method" lines + $value = preg_replace('/]*>/i', "\n", $value); + foreach (Mage::helper('core/string')->str_split($value, 45, true, true) as $_value) { + $page->drawText(strip_tags(trim($_value)), $paymentLeft, $yPayments, 'UTF-8'); + $yPayments -= 15; + } } } - if (!$order->getIsVirtual()) { - $this->y -=15; - - $page->drawText($shippingMethod, 285, $this->y, 'UTF-8'); + if ($order->getIsVirtual()) { + // replacement of Shipments-Payments rectangle block + $yPayments = min($addressesEndY, $yPayments); + $page->drawLine(25, ($top - 25), 25, $yPayments); + $page->drawLine(570, ($top - 25), 570, $yPayments); + $page->drawLine(25, $yPayments, 570, $yPayments); - $yShipments = $this->y; + $this->y = $yPayments - 15; + } else { + $topMargin = 15; + $methodStartY = $this->y; + $this->y -= 15; + foreach (Mage::helper('core/string')->str_split($shippingMethod, 45, true, true) as $_value) { + $page->drawText(strip_tags(trim($_value)), 285, $this->y, 'UTF-8'); + $this->y -= 15; + } - $totalShippingChargesText = "(" . Mage::helper('sales')->__('Total Shipping Charges') . " " . $order->formatPriceTxt($order->getShippingAmount()) . ")"; + $yShipments = $this->y; + $totalShippingChargesText = "(" . Mage::helper('sales')->__('Total Shipping Charges') . " " + . $order->formatPriceTxt($order->getShippingAmount()) . ")"; - $page->drawText($totalShippingChargesText, 285, $yShipments-7, 'UTF-8'); - $yShipments -=10; + $page->drawText($totalShippingChargesText, 285, $yShipments - $topMargin, 'UTF-8'); + $yShipments -= $topMargin + 10; $tracks = array(); if ($shipment) { @@ -333,27 +456,24 @@ protected function insertOrder(&$page, $obj, $putOrderId = true) $page->setFillColor(new Zend_Pdf_Color_Rgb(0.93, 0.92, 0.92)); $page->setLineWidth(0.5); $page->drawRectangle(285, $yShipments, 510, $yShipments - 10); - $page->drawLine(380, $yShipments, 380, $yShipments - 10); + $page->drawLine(400, $yShipments, 400, $yShipments - 10); //$page->drawLine(510, $yShipments, 510, $yShipments - 10); - $this->_setFontRegular($page); + $this->_setFontRegular($page, 9); $page->setFillColor(new Zend_Pdf_Color_GrayScale(0)); //$page->drawText(Mage::helper('sales')->__('Carrier'), 290, $yShipments - 7 , 'UTF-8'); $page->drawText(Mage::helper('sales')->__('Title'), 290, $yShipments - 7, 'UTF-8'); - $page->drawText(Mage::helper('sales')->__('Number'), 385, $yShipments - 7, 'UTF-8'); + $page->drawText(Mage::helper('sales')->__('Number'), 410, $yShipments - 7, 'UTF-8'); - $yShipments -=17; - $this->_setFontRegular($page, 6); + $yShipments -= 20; + $this->_setFontRegular($page, 8); foreach ($tracks as $track) { $CarrierCode = $track->getCarrierCode(); - if ($CarrierCode!='custom') - { + if ($CarrierCode != 'custom') { $carrier = Mage::getSingleton('shipping/config')->getCarrierInstance($CarrierCode); $carrierTitle = $carrier->getConfigData('title'); - } - else - { + } else { $carrierTitle = Mage::helper('sales')->__('Custom Value'); } @@ -362,26 +482,48 @@ protected function insertOrder(&$page, $obj, $putOrderId = true) $endOfTitle = strlen($track->getTitle()) > $maxTitleLen ? '...' : ''; $truncatedTitle = substr($track->getTitle(), 0, $maxTitleLen) . $endOfTitle; //$page->drawText($truncatedCarrierTitle, 285, $yShipments , 'UTF-8'); - $page->drawText($truncatedTitle, 300, $yShipments , 'UTF-8'); - $page->drawText($track->getNumber(), 395, $yShipments , 'UTF-8'); - $yShipments -=7; + $page->drawText($truncatedTitle, 292, $yShipments , 'UTF-8'); + $page->drawText($track->getNumber(), 410, $yShipments , 'UTF-8'); + $yShipments -= $topMargin - 5; } } else { - $yShipments -= 7; + $yShipments -= $topMargin - 5; } $currentY = min($yPayments, $yShipments); // replacement of Shipments-Payments rectangle block - $page->drawLine(25, $this->y + 15, 25, $currentY); - $page->drawLine(25, $currentY, 570, $currentY); - $page->drawLine(570, $currentY, 570, $this->y + 15); + $page->drawLine(25, $methodStartY, 25, $currentY); //left + $page->drawLine(25, $currentY, 570, $currentY); //bottom + $page->drawLine(570, $currentY, 570, $methodStartY); //right $this->y = $currentY; $this->y -= 15; } } + /** + * Insert title and number for concrete document type + * + * @param Zend_Pdf_Page $page + * @param string $text + * @return void + */ + public function insertDocumentNumber(Zend_Pdf_Page $page, $text) + { + $page->setFillColor(new Zend_Pdf_Color_GrayScale(1)); + $this->_setFontRegular($page, 10); + $docHeader = $this->getDocHeaderCoordinates(); + $page->drawText($text, 35, $docHeader[1] - 15, 'UTF-8'); + } + + /** + * Sort totals list + * + * @param array $a + * @param array $b + * @return int + */ protected function _sortTotalsList($a, $b) { if (!isset($a['sort_order']) || !isset($b['sort_order'])) { return 0; @@ -394,6 +536,12 @@ protected function _sortTotalsList($a, $b) { return ($a['sort_order'] > $b['sort_order']) ? 1 : -1; } + /** + * Return total list + * + * @param Mage_Sales_Model_Abstract $source + * @return array + */ protected function _getTotalsList($source) { $totals = Mage::getConfig()->getNode('global/pdf/totals')->asArray(); @@ -419,6 +567,13 @@ protected function _getTotalsList($source) return $totalModels; } + /** + * Insert totals to pdf page + * + * @param Zend_Pdf_Page $page + * @param Mage_Sales_Model_Abstract $source + * @return Zend_Pdf_Page + */ protected function insertTotals($page, $source){ $order = $source->getOrder(); $totals = $this->_getTotalsList($source); @@ -431,6 +586,7 @@ protected function insertTotals($page, $source){ ->setSource($source); if ($total->canDisplay()) { + $total->setFontSize(10); foreach ($total->getTotalsForDisplay() as $totalData) { $lineBlock['lines'][] = array( array( @@ -452,10 +608,17 @@ protected function insertTotals($page, $source){ } } + $this->y -= 20; $page = $this->drawLineBlocks($page, array($lineBlock)); return $page; } + /** + * Parse item description + * + * @param Varien_Object $item + * @return array + */ protected function _parseItemDescription($item) { $matches = array(); @@ -469,7 +632,6 @@ protected function _parseItemDescription($item) /** * Before getPdf processing - * */ protected function _beforeGetPdf() { $translate = Mage::getSingleton('core/translate'); @@ -479,7 +641,6 @@ protected function _beforeGetPdf() { /** * After getPdf processing - * */ protected function _afterGetPdf() { $translate = Mage::getSingleton('core/translate'); @@ -487,6 +648,13 @@ protected function _afterGetPdf() { $translate->setTranslateInline(true); } + /** + * Format option value process + * + * @param array|string $value + * @param Mage_Sales_Model_Order $order + * @return string + */ protected function _formatOptionValue($value, $order) { $resultValue = ''; @@ -506,9 +674,14 @@ protected function _formatOptionValue($value, $order) } } + /** + * Initialize renderer process + * + * @param string $type + */ protected function _initRenderer($type) { - $node = Mage::getConfig()->getNode('global/pdf/'.$type); + $node = Mage::getConfig()->getNode('global/pdf/' . $type); foreach ($node->children() as $renderer) { $this->_renderers[$renderer->getName()] = array( 'model' => (string)$renderer, @@ -520,6 +693,7 @@ protected function _initRenderer($type) /** * Retrieve renderer model * + * @param string $type * @throws Mage_Core_Exception * @return Mage_Sales_Model_Order_Pdf_Items_Abstract */ @@ -545,7 +719,7 @@ protected function _getRenderer($type) * * Retrieve renderer model * - * @param string $type + * @param string $type * @return Mage_Sales_Model_Order_Pdf_Items_Abstract */ public function getRenderer($type) @@ -556,9 +730,9 @@ public function getRenderer($type) /** * Draw Item process * - * @param Varien_Object $item - * @param Zend_Pdf_Page $page - * @param Mage_Sales_Model_Order $order + * @param Varien_Object $item + * @param Zend_Pdf_Page $page + * @param Mage_Sales_Model_Order $order * @return Zend_Pdf_Page */ protected function _drawItem(Varien_Object $item, Zend_Pdf_Page $page, Mage_Sales_Model_Order $order) @@ -576,6 +750,13 @@ protected function _drawItem(Varien_Object $item, Zend_Pdf_Page $page, Mage_Sale return $renderer->getPage(); } + /** + * Set font as regular + * + * @param Zend_Pdf_Page $object + * @param int $size + * @return Zend_Pdf_Resource_Font + */ protected function _setFontRegular($object, $size = 7) { $font = Zend_Pdf_Font::fontWithPath(Mage::getBaseDir() . '/lib/LinLibertineFont/LinLibertine_Re-4.4.1.ttf'); @@ -583,6 +764,13 @@ protected function _setFontRegular($object, $size = 7) return $font; } + /** + * Set font as bold + * + * @param Zend_Pdf_Page $object + * @param int $size + * @return Zend_Pdf_Resource_Font + */ protected function _setFontBold($object, $size = 7) { $font = Zend_Pdf_Font::fontWithPath(Mage::getBaseDir() . '/lib/LinLibertineFont/LinLibertine_Bd-2.8.1.ttf'); @@ -590,6 +778,13 @@ protected function _setFontBold($object, $size = 7) return $font; } + /** + * Set font as italic + * + * @param Zend_Pdf_Page $object + * @param int $size + * @return Zend_Pdf_Resource_Font + */ protected function _setFontItalic($object, $size = 7) { $font = Zend_Pdf_Font::fontWithPath(Mage::getBaseDir() . '/lib/LinLibertineFont/LinLibertine_It-2.8.2.ttf'); @@ -600,7 +795,7 @@ protected function _setFontItalic($object, $size = 7) /** * Set PDF object * - * @param Zend_Pdf $pdf + * @param Zend_Pdf $pdf * @return Mage_Sales_Model_Order_Pdf_Abstract */ protected function _setPdf(Zend_Pdf $pdf) @@ -627,7 +822,7 @@ protected function _getPdf() /** * Create new page and assign to PDF object * - * @param array $settings + * @param array $settings * @return Zend_Pdf_Page */ public function newPage(array $settings = array()) @@ -659,9 +854,9 @@ public function newPage(array $settings = array()) * align string; text align (also see feed parametr), optional left, right * height int;line spacing (default 10) * - * @param Zend_Pdf_Page $page - * @param array $draw - * @param array $pageSettings + * @param Zend_Pdf_Page $page + * @param array $draw + * @param array $pageSettings * @throws Mage_Core_Exception * @return Zend_Pdf_Page */ @@ -702,12 +897,11 @@ public function drawLineBlocks(Zend_Pdf_Page $page, array $draw, array $pageSett foreach ($lines as $line) { $maxHeight = 0; foreach ($line as $column) { - $fontSize = empty($column['font_size']) ? 7 : $column['font_size']; + $fontSize = empty($column['font_size']) ? 10 : $column['font_size']; if (!empty($column['font_file'])) { $font = Zend_Pdf_Font::fontWithPath($column['font_file']); $page->setFont($font, $fontSize); - } - else { + } else { $fontStyle = empty($column['font']) ? 'regular' : $column['font']; switch ($fontStyle) { case 'bold': diff --git a/app/code/core/Mage/Sales/Model/Order/Pdf/Creditmemo.php b/app/code/core/Mage/Sales/Model/Order/Pdf/Creditmemo.php index ddbf5c12cc..75487b9cc7 100644 --- a/app/code/core/Mage/Sales/Model/Order/Pdf/Creditmemo.php +++ b/app/code/core/Mage/Sales/Model/Order/Pdf/Creditmemo.php @@ -34,6 +34,84 @@ */ class Mage_Sales_Model_Order_Pdf_Creditmemo extends Mage_Sales_Model_Order_Pdf_Abstract { + /** + * Draw table header for product items + * + * @param Zend_Pdf_Page $page + * @return void + */ + protected function _drawHeader(Zend_Pdf_Page $page) + { + $this->_setFontRegular($page, 10); + $page->setFillColor(new Zend_Pdf_Color_RGB(0.93, 0.92, 0.92)); + $page->setLineColor(new Zend_Pdf_Color_GrayScale(0.5)); + $page->setLineWidth(0.5); + $page->drawRectangle(25, $this->y, 570, $this->y - 30); + $this->y -= 10; + $page->setFillColor(new Zend_Pdf_Color_RGB(0, 0, 0)); + + //columns headers + $lines[0][] = array( + 'text' => Mage::helper('sales')->__('Products'), + 'feed' => 35, + ); + + $lines[0][] = array( + 'text' => Mage::helper('core/string')->str_split(Mage::helper('sales')->__('SKU'), 12, true, true), + 'feed' => 255, + 'align' => 'right' + ); + + $lines[0][] = array( + 'text' => Mage::helper('core/string')->str_split(Mage::helper('sales')->__('Total (ex)'), 12, true, true), + 'feed' => 330, + 'align' => 'right', + //'width' => 50, + ); + + $lines[0][] = array( + 'text' => Mage::helper('core/string')->str_split(Mage::helper('sales')->__('Discount'), 12, true, true), + 'feed' => 380, + 'align' => 'right', + //'width' => 50, + ); + + $lines[0][] = array( + 'text' => Mage::helper('core/string')->str_split(Mage::helper('sales')->__('Qty'), 12, true, true), + 'feed' => 445, + 'align' => 'right', + //'width' => 30, + ); + + $lines[0][] = array( + 'text' => Mage::helper('core/string')->str_split(Mage::helper('sales')->__('Tax'), 12, true, true), + 'feed' => 495, + 'align' => 'right', + //'width' => 45, + ); + + $lines[0][] = array( + 'text' => Mage::helper('core/string')->str_split(Mage::helper('sales')->__('Total (inc)'), 12, true, true), + 'feed' => 565, + 'align' => 'right' + ); + + $lineBlock = array( + 'lines' => $lines, + 'height' => 10 + ); + + $this->drawLineBlocks($page, array($lineBlock), array('table_header' => true)); + $page->setFillColor(new Zend_Pdf_Color_GrayScale(0)); + $this->y -= 20; + } + + /** + * Return PDF document + * + * @param array $creditmemos + * @return Zend_Pdf + */ public function getPdf($creditmemos = array()) { $this->_beforeGetPdf(); @@ -49,116 +127,56 @@ public function getPdf($creditmemos = array()) Mage::app()->getLocale()->emulate($creditmemo->getStoreId()); Mage::app()->setCurrentStore($creditmemo->getStoreId()); } - $page = $pdf->newPage(Zend_Pdf_Page::SIZE_A4); - $pdf->pages[] = $page; - + $page = $this->newPage(); $order = $creditmemo->getOrder(); - /* Add image */ $this->insertLogo($page, $creditmemo->getStore()); - /* Add address */ $this->insertAddress($page, $creditmemo->getStore()); - /* Add head */ - $this->insertOrder($page, $order, Mage::getStoreConfigFlag(self::XML_PATH_SALES_PDF_CREDITMEMO_PUT_ORDER_ID, $order->getStoreId())); - - $page->setFillColor(new Zend_Pdf_Color_GrayScale(1)); - $this->_setFontRegular($page); - $page->drawText(Mage::helper('sales')->__('Credit Memo # ') . $creditmemo->getIncrementId(), 35, 780, 'UTF-8'); - + $this->insertOrder( + $page, + $order, + Mage::getStoreConfigFlag(self::XML_PATH_SALES_PDF_CREDITMEMO_PUT_ORDER_ID, $order->getStoreId()) + ); + /* Add document text and number */ + $this->insertDocumentNumber( + $page, + Mage::helper('sales')->__('Credit Memo # ') . $creditmemo->getIncrementId() + ); /* Add table head */ - $page->setFillColor(new Zend_Pdf_Color_RGB(0.93, 0.92, 0.92)); - $page->setLineColor(new Zend_Pdf_Color_GrayScale(0.5)); - $page->setLineWidth(0.5); - $page->drawRectangle(25, $this->y, 570, $this->y-15); - $this->y -=10; - $page->setFillColor(new Zend_Pdf_Color_RGB(0.4, 0.4, 0.4)); $this->_drawHeader($page); - $this->y -=15; - - $page->setFillColor(new Zend_Pdf_Color_GrayScale(0)); - /* Add body */ foreach ($creditmemo->getAllItems() as $item){ if ($item->getOrderItem()->getParentItem()) { continue; } - - if ($this->y<20) { - $page = $this->newPage(array('table_header' => true)); - } - /* Draw item */ - $page = $this->_drawItem($item, $page, $order); + $this->_drawItem($item, $page, $order); + $page = end($pdf->pages); } - /* Add totals */ - $page = $this->insertTotals($page, $creditmemo); + $this->insertTotals($page, $creditmemo); } - $this->_afterGetPdf(); - if ($creditmemo->getStoreId()) { Mage::app()->getLocale()->revert(); } return $pdf; } - protected function _drawHeader(Zend_Pdf_Page $page) - { - $font = $page->getFont(); - $size = $page->getFontSize(); - - $page->drawText(Mage::helper('sales')->__('Products'), $x = 35, $this->y, 'UTF-8'); - $x += 220; - - $page->drawText(Mage::helper('sales')->__('SKU'), $x, $this->y, 'UTF-8'); - $x += 100; - - $text = Mage::helper('sales')->__('Total (ex)'); - $page->drawText($text, $this->getAlignRight($text, $x, 50, $font, $size), $this->y, 'UTF-8'); - $x += 50; - - $text = Mage::helper('sales')->__('Discount'); - $page->drawText($text, $this->getAlignRight($text, $x, 50, $font, $size), $this->y, 'UTF-8'); - $x += 50; - - $text = Mage::helper('sales')->__('Qty'); - $page->drawText($text, $this->getAlignCenter($text, $x, 30, $font, $size), $this->y, 'UTF-8'); - $x += 30; - - $text = Mage::helper('sales')->__('Tax'); - $page->drawText($text, $this->getAlignRight($text, $x, 45, $font, $size, 10), $this->y, 'UTF-8'); - $x += 45; - - $text = Mage::helper('sales')->__('Total (inc)'); - $page->drawText($text, $this->getAlignRight($text, $x, 570 - $x, $font, $size), $this->y, 'UTF-8'); - } - /** * Create new page and assign to PDF object * - * @param array $settings + * @param array $settings * @return Zend_Pdf_Page */ public function newPage(array $settings = array()) { $page = parent::newPage($settings); - if (!empty($settings['table_header'])) { - $this->_setFontRegular($page); - $page->setFillColor(new Zend_Pdf_Color_RGB(0.93, 0.92, 0.92)); - $page->setLineColor(new Zend_Pdf_Color_GrayScale(0.5)); - $page->setLineWidth(0.5); - $page->drawRectangle(25, $this->y, 570, $this->y-15); - $this->y -=10; - $page->setFillColor(new Zend_Pdf_Color_RGB(0.4, 0.4, 0.4)); $this->_drawHeader($page); - $page->setFillColor(new Zend_Pdf_Color_GrayScale(0)); - $this->y -=20; } - return $page; } } diff --git a/app/code/core/Mage/Sales/Model/Order/Pdf/Invoice.php b/app/code/core/Mage/Sales/Model/Order/Pdf/Invoice.php index 2612b60fc0..3577c9bffc 100644 --- a/app/code/core/Mage/Sales/Model/Order/Pdf/Invoice.php +++ b/app/code/core/Mage/Sales/Model/Order/Pdf/Invoice.php @@ -24,7 +24,6 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - /** * Sales Order Invoice PDF model * @@ -34,6 +33,75 @@ */ class Mage_Sales_Model_Order_Pdf_Invoice extends Mage_Sales_Model_Order_Pdf_Abstract { + /** + * Draw header for item table + * + * @param Zend_Pdf_Page $page + * @return void + */ + protected function _drawHeader(Zend_Pdf_Page $page) + { + /* Add table head */ + $this->_setFontRegular($page, 10); + $page->setFillColor(new Zend_Pdf_Color_RGB(0.93, 0.92, 0.92)); + $page->setLineColor(new Zend_Pdf_Color_GrayScale(0.5)); + $page->setLineWidth(0.5); + $page->drawRectangle(25, $this->y, 570, $this->y -15); + $this->y -= 10; + $page->setFillColor(new Zend_Pdf_Color_RGB(0, 0, 0)); + + //columns headers + $lines[0][] = array( + 'text' => Mage::helper('sales')->__('Products'), + 'feed' => 35 + ); + + $lines[0][] = array( + 'text' => Mage::helper('sales')->__('SKU'), + 'feed' => 290, + 'align' => 'right' + ); + + $lines[0][] = array( + 'text' => Mage::helper('sales')->__('Qty'), + 'feed' => 435, + 'align' => 'right' + ); + + $lines[0][] = array( + 'text' => Mage::helper('sales')->__('Price'), + 'feed' => 360, + 'align' => 'right' + ); + + $lines[0][] = array( + 'text' => Mage::helper('sales')->__('Tax'), + 'feed' => 495, + 'align' => 'right' + ); + + $lines[0][] = array( + 'text' => Mage::helper('sales')->__('Subtotal'), + 'feed' => 565, + 'align' => 'right' + ); + + $lineBlock = array( + 'lines' => $lines, + 'height' => 5 + ); + + $this->drawLineBlocks($page, array($lineBlock), array('table_header' => true)); + $page->setFillColor(new Zend_Pdf_Color_GrayScale(0)); + $this->y -= 20; + } + + /** + * Return PDF document + * + * @param array $invoices + * @return Zend_Pdf + */ public function getPdf($invoices = array()) { $this->_beforeGetPdf(); @@ -49,77 +117,48 @@ public function getPdf($invoices = array()) Mage::app()->getLocale()->emulate($invoice->getStoreId()); Mage::app()->setCurrentStore($invoice->getStoreId()); } - $page = $pdf->newPage(Zend_Pdf_Page::SIZE_A4); - $pdf->pages[] = $page; - + $page = $this->newPage(); $order = $invoice->getOrder(); - /* Add image */ $this->insertLogo($page, $invoice->getStore()); - /* Add address */ $this->insertAddress($page, $invoice->getStore()); - /* Add head */ - $this->insertOrder($page, $order, Mage::getStoreConfigFlag(self::XML_PATH_SALES_PDF_INVOICE_PUT_ORDER_ID, $order->getStoreId())); - - - $page->setFillColor(new Zend_Pdf_Color_GrayScale(1)); - $this->_setFontRegular($page); - $page->drawText(Mage::helper('sales')->__('Invoice # ') . $invoice->getIncrementId(), 35, 780, 'UTF-8'); - + $this->insertOrder( + $page, + $order, + Mage::getStoreConfigFlag(self::XML_PATH_SALES_PDF_INVOICE_PUT_ORDER_ID, $order->getStoreId()) + ); + /* Add document text and number */ + $this->insertDocumentNumber( + $page, + Mage::helper('sales')->__('Invoice # ') . $invoice->getIncrementId() + ); /* Add table */ - $page->setFillColor(new Zend_Pdf_Color_RGB(0.93, 0.92, 0.92)); - $page->setLineColor(new Zend_Pdf_Color_GrayScale(0.5)); - $page->setLineWidth(0.5); - - $page->drawRectangle(25, $this->y, 570, $this->y -15); - $this->y -=10; - - /* Add table head */ - $page->setFillColor(new Zend_Pdf_Color_RGB(0.4, 0.4, 0.4)); - $page->drawText(Mage::helper('sales')->__('Products'), 35, $this->y, 'UTF-8'); - $page->drawText(Mage::helper('sales')->__('SKU'), 255, $this->y, 'UTF-8'); - $page->drawText(Mage::helper('sales')->__('Price'), 380, $this->y, 'UTF-8'); - $page->drawText(Mage::helper('sales')->__('Qty'), 430, $this->y, 'UTF-8'); - $page->drawText(Mage::helper('sales')->__('Tax'), 480, $this->y, 'UTF-8'); - $page->drawText(Mage::helper('sales')->__('Subtotal'), 535, $this->y, 'UTF-8'); - - $this->y -=15; - - $page->setFillColor(new Zend_Pdf_Color_GrayScale(0)); - + $this->_drawHeader($page); /* Add body */ foreach ($invoice->getAllItems() as $item){ if ($item->getOrderItem()->getParentItem()) { continue; } - - if ($this->y < 15) { - $page = $this->newPage(array('table_header' => true)); - } - /* Draw item */ - $page = $this->_drawItem($item, $page, $order); + $this->_drawItem($item, $page, $order); + $page = end($pdf->pages); } - /* Add totals */ - $page = $this->insertTotals($page, $invoice); - + $this->insertTotals($page, $invoice); if ($invoice->getStoreId()) { Mage::app()->getLocale()->revert(); } } - $this->_afterGetPdf(); - return $pdf; } /** * Create new page and assign to PDF object * - * @param array $settings + * @param array $settings * @return Zend_Pdf_Page */ public function newPage(array $settings = array()) @@ -128,27 +167,9 @@ public function newPage(array $settings = array()) $page = $this->_getPdf()->newPage(Zend_Pdf_Page::SIZE_A4); $this->_getPdf()->pages[] = $page; $this->y = 800; - if (!empty($settings['table_header'])) { - $this->_setFontRegular($page); - $page->setFillColor(new Zend_Pdf_Color_RGB(0.93, 0.92, 0.92)); - $page->setLineColor(new Zend_Pdf_Color_GrayScale(0.5)); - $page->setLineWidth(0.5); - $page->drawRectangle(25, $this->y, 570, $this->y-15); - $this->y -=10; - - $page->setFillColor(new Zend_Pdf_Color_RGB(0.4, 0.4, 0.4)); - $page->drawText(Mage::helper('sales')->__('Product'), 35, $this->y, 'UTF-8'); - $page->drawText(Mage::helper('sales')->__('SKU'), 255, $this->y, 'UTF-8'); - $page->drawText(Mage::helper('sales')->__('Price'), 380, $this->y, 'UTF-8'); - $page->drawText(Mage::helper('sales')->__('Qty'), 430, $this->y, 'UTF-8'); - $page->drawText(Mage::helper('sales')->__('Tax'), 480, $this->y, 'UTF-8'); - $page->drawText(Mage::helper('sales')->__('Subtotal'), 535, $this->y, 'UTF-8'); - - $page->setFillColor(new Zend_Pdf_Color_GrayScale(0)); - $this->y -=20; + $this->_drawHeader($page); } - return $page; } } diff --git a/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Abstract.php b/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Abstract.php index 86cfec3526..034de55e13 100644 --- a/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Abstract.php +++ b/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Abstract.php @@ -24,7 +24,6 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - /** * Sales Order Pdf Items renderer Abstract * @@ -72,7 +71,7 @@ abstract class Mage_Sales_Model_Order_Pdf_Items_Abstract extends Mage_Core_Model /** * Set order model * - * @param Mage_Sales_Model_Order $order + * @param Mage_Sales_Model_Order $order * @return Mage_Sales_Model_Order_Pdf_Items_Abstract */ public function setOrder(Mage_Sales_Model_Order $order) @@ -84,7 +83,7 @@ public function setOrder(Mage_Sales_Model_Order $order) /** * Set Source model * - * @param Mage_Core_Model_Abstract $source + * @param Mage_Core_Model_Abstract $source * @return Mage_Sales_Model_Order_Pdf_Items_Abstract */ public function setSource(Mage_Core_Model_Abstract $source) @@ -96,7 +95,7 @@ public function setSource(Mage_Core_Model_Abstract $source) /** * Set item object * - * @param Varien_Object $item + * @param Varien_Object $item * @return Mage_Sales_Model_Order_Pdf_Items_Abstract */ public function setItem(Varien_Object $item) @@ -108,7 +107,7 @@ public function setItem(Varien_Object $item) /** * Set Pdf model * - * @param Mage_Sales_Model_Order_Pdf_Abstract $pdf + * @param Mage_Sales_Model_Order_Pdf_Abstract $pdf * @return Mage_Sales_Model_Order_Pdf_Items_Abstract */ public function setPdf(Mage_Sales_Model_Order_Pdf_Abstract $pdf) @@ -120,7 +119,7 @@ public function setPdf(Mage_Sales_Model_Order_Pdf_Abstract $pdf) /** * Set current page * - * @param Zend_Pdf_Page $page + * @param Zend_Pdf_Page $page * @return Mage_Sales_Model_Order_Pdf_Items_Abstract */ public function setPage(Zend_Pdf_Page $page) @@ -205,6 +204,12 @@ public function getPage() */ abstract public function draw(); + /** + * Format option value process + * + * @param $value + * @return string + */ protected function _formatOptionValue($value) { $order = $this->getOrder(); @@ -283,6 +288,11 @@ public function getItemPricesForDisplay() return $prices; } + /** + * Retrieve item options + * + * @return array + */ public function getItemOptions() { $result = array(); if ($options = $this->getItem()->getOrderItem()->getProductOptions()) { @@ -299,6 +309,12 @@ public function getItemOptions() { return $result; } + /** + * Set font as regular + * + * @param int $size + * @return Zend_Pdf_Resource_Font + */ protected function _setFontRegular($size = 7) { $font = Zend_Pdf_Font::fontWithPath(Mage::getBaseDir() . '/lib/LinLibertineFont/LinLibertine_Re-4.4.1.ttf'); @@ -306,6 +322,12 @@ protected function _setFontRegular($size = 7) return $font; } + /** + * Set font as bold + * + * @param int $size + * @return Zend_Pdf_Resource_Font + */ protected function _setFontBold($size = 7) { $font = Zend_Pdf_Font::fontWithPath(Mage::getBaseDir() . '/lib/LinLibertineFont/LinLibertine_Bd-2.8.1.ttf'); @@ -313,6 +335,12 @@ protected function _setFontBold($size = 7) return $font; } + /** + * Set font as italic + * + * @param int $size + * @return Zend_Pdf_Resource_Font + */ protected function _setFontItalic($size = 7) { $font = Zend_Pdf_Font::fontWithPath(Mage::getBaseDir() . '/lib/LinLibertineFont/LinLibertine_It-2.8.2.ttf'); @@ -320,6 +348,12 @@ protected function _setFontItalic($size = 7) return $font; } + /** + * Return item Sku + * + * @param $item + * @return mixed + */ public function getSku($item) { if ($item->getOrderItem()->getProductOptionByCode('simple_sku')) diff --git a/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Creditmemo/Default.php b/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Creditmemo/Default.php index bfeb865886..8109869768 100644 --- a/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Creditmemo/Default.php +++ b/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Creditmemo/Default.php @@ -24,7 +24,6 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - /** * Sales Order Creditmemo Pdf default items renderer * @@ -34,6 +33,9 @@ */ class Mage_Sales_Model_Order_Pdf_Items_Creditmemo_Default extends Mage_Sales_Model_Order_Pdf_Items_Abstract { + /** + * Draw process + */ public function draw() { $order = $this->getOrder(); @@ -42,24 +44,19 @@ public function draw() $page = $this->getPage(); $lines = array(); - $leftBound = 35; - $rightBound = 565; - - $x = $leftBound; // draw Product name $lines[0] = array(array( - 'text' => Mage::helper('core/string')->str_split($item->getName(), 60, true, true), - 'feed' => $x, + 'text' => Mage::helper('core/string')->str_split($item->getName(), 35, true, true), + 'feed' => 35, )); - $x += 220; // draw SKU $lines[0][] = array( - 'text' => Mage::helper('core/string')->str_split($this->getSku($item), 25), - 'feed' => $x + 'text' => Mage::helper('core/string')->str_split($this->getSku($item), 17), + 'feed' => 255, + 'align' => 'right' ); - $x += 100; // draw Total (ex) $i = 0; $prices = $this->getItemPricesForDisplay(); @@ -68,7 +65,7 @@ public function draw() // draw Subtotal label $lines[$i][] = array( 'text' => $priceData['label'], - 'feed' => $x, + 'feed' => 330, 'align' => 'right', 'width' => 50, ); @@ -77,51 +74,43 @@ public function draw() // draw Subtotal $lines[$i][] = array( 'text' => $priceData['subtotal'], - 'feed' => $x, + 'feed' => 330, 'font' => 'bold', 'align' => 'right', - 'width' => 50, ); $i++; } - $x += 50; // draw Discount $lines[0][] = array( 'text' => $order->formatPriceTxt(-$item->getDiscountAmount()), - 'feed' => $x, + 'feed' => 380, 'font' => 'bold', - 'align' => 'right', - 'width' => 50, + 'align' => 'right' ); - $x += 50; // draw QTY $lines[0][] = array( - 'text' => $item->getQty()*1, - 'feed' => $x, + 'text' => $item->getQty() * 1, + 'feed' => 445, 'font' => 'bold', - 'align' => 'center', - 'width' => 30, + 'align' => 'right', ); - $x += 30; // draw Tax $lines[0][] = array( 'text' => $order->formatPriceTxt($item->getTaxAmount()), - 'feed' => $x, + 'feed' => 495, 'font' => 'bold', - 'align' => 'right', - 'width' => 45, + 'align' => 'right' ); - $x += 45; // draw Subtotal $subtotal = $item->getRowTotal() + $item->getTaxAmount() + $item->getHiddenTaxAmount() - $item->getDiscountAmount(); $lines[0][] = array( 'text' => $order->formatPriceTxt($subtotal), - 'feed' => $rightBound, + 'feed' => 565, 'font' => 'bold', 'align' => 'right' ); @@ -132,23 +121,23 @@ public function draw() foreach ($options as $option) { // draw options label $lines[][] = array( - 'text' => Mage::helper('core/string')->str_split(strip_tags($option['label']), 70, true, true), + 'text' => Mage::helper('core/string')->str_split(strip_tags($option['label']), 40, true, true), 'font' => 'italic', - 'feed' => $leftBound + 'feed' => 35 ); // draw options value $_printValue = isset($option['print_value']) ? $option['print_value'] : strip_tags($option['value']); $lines[][] = array( - 'text' => Mage::helper('core/string')->str_split($_printValue, 50, true, true), - 'feed' => $leftBound + 5 + 'text' => Mage::helper('core/string')->str_split($_printValue, 30, true, true), + 'feed' => 40 ); } } $lineBlock = array( 'lines' => $lines, - 'height' => 10 + 'height' => 20 ); $page = $pdf->drawLineBlocks($page, array($lineBlock), array('table_header' => true)); diff --git a/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Creditmemo/Grouped.php b/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Creditmemo/Grouped.php index 2133347a7e..498a2ecf31 100644 --- a/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Creditmemo/Grouped.php +++ b/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Creditmemo/Grouped.php @@ -24,7 +24,6 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - /** * Sales Order Creditmemo Pdf grouped items renderer * @@ -34,6 +33,9 @@ */ class Mage_Sales_Model_Order_Pdf_Items_Creditmemo_Grouped extends Mage_Sales_Model_Order_Pdf_Items_Creditmemo_Default { + /** + * Draw process + */ public function draw() { $type = $this->getItem()->getOrderItem()->getRealProductType(); diff --git a/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Invoice/Default.php b/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Invoice/Default.php index b174967038..54e94d14ae 100644 --- a/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Invoice/Default.php +++ b/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Invoice/Default.php @@ -24,7 +24,6 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - /** * Sales Order Invoice Pdf default items renderer * @@ -36,7 +35,6 @@ class Mage_Sales_Model_Order_Pdf_Items_Invoice_Default extends Mage_Sales_Model_ { /** * Draw item line - * */ public function draw() { @@ -48,20 +46,22 @@ public function draw() // draw Product name $lines[0] = array(array( - 'text' => Mage::helper('core/string')->str_split($item->getName(), 60, true, true), + 'text' => Mage::helper('core/string')->str_split($item->getName(), 35, true, true), 'feed' => 35, )); // draw SKU $lines[0][] = array( - 'text' => Mage::helper('core/string')->str_split($this->getSku($item), 25), - 'feed' => 255 + 'text' => Mage::helper('core/string')->str_split($this->getSku($item), 17), + 'feed' => 290, + 'align' => 'right' ); // draw QTY $lines[0][] = array( - 'text' => $item->getQty()*1, - 'feed' => 435 + 'text' => $item->getQty() * 1, + 'feed' => 435, + 'align' => 'right' ); // draw item Prices @@ -72,13 +72,13 @@ public function draw() // draw Price label $lines[$i][] = array( 'text' => $priceData['label'], - 'feed' => 395, + 'feed' => 360, 'align' => 'right' ); // draw Subtotal label $lines[$i][] = array( 'text' => $priceData['label'], - 'feed' => 565, + 'feed' => 530, 'align' => 'right' ); $i++; @@ -86,14 +86,14 @@ public function draw() // draw Price $lines[$i][] = array( 'text' => $priceData['price'], - 'feed' => 395, + 'feed' => 360, 'font' => 'bold', 'align' => 'right' ); // draw Subtotal $lines[$i][] = array( 'text' => $priceData['subtotal'], - 'feed' => 565, + 'feed' => 530, 'font' => 'bold', 'align' => 'right' ); @@ -114,7 +114,7 @@ public function draw() foreach ($options as $option) { // draw options label $lines[][] = array( - 'text' => Mage::helper('core/string')->str_split(strip_tags($option['label']), 70, true, true), + 'text' => Mage::helper('core/string')->str_split(strip_tags($option['label']), 40, true, true), 'font' => 'italic', 'feed' => 35 ); @@ -128,7 +128,7 @@ public function draw() $values = explode(', ', $_printValue); foreach ($values as $value) { $lines[][] = array( - 'text' => Mage::helper('core/string')->str_split($value, 50, true, true), + 'text' => Mage::helper('core/string')->str_split($value, 30, true, true), 'feed' => 40 ); } @@ -138,7 +138,7 @@ public function draw() $lineBlock = array( 'lines' => $lines, - 'height' => 10 + 'height' => 20 ); $page = $pdf->drawLineBlocks($page, array($lineBlock), array('table_header' => true)); diff --git a/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Invoice/Grouped.php b/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Invoice/Grouped.php index 71d764fe76..fb857a01a2 100644 --- a/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Invoice/Grouped.php +++ b/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Invoice/Grouped.php @@ -24,7 +24,6 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - /** * Sales Order Invoice Pdf grouped items renderer * @@ -34,6 +33,9 @@ */ class Mage_Sales_Model_Order_Pdf_Items_Invoice_Grouped extends Mage_Sales_Model_Order_Pdf_Items_Invoice_Default { + /** + * Draw process + */ public function draw() { $type = $this->getItem()->getOrderItem()->getRealProductType(); diff --git a/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Shipment/Default.php b/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Shipment/Default.php index 1eb83eeee7..d58b3d99d3 100644 --- a/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Shipment/Default.php +++ b/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Shipment/Default.php @@ -24,7 +24,6 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - /** * Sales Order Shipment Pdf default items renderer * @@ -36,7 +35,6 @@ class Mage_Sales_Model_Order_Pdf_Items_Shipment_Default extends Mage_Sales_Model { /** * Draw item line - * */ public function draw() { @@ -48,7 +46,7 @@ public function draw() // draw Product name $lines[0] = array(array( 'text' => Mage::helper('core/string')->str_split($item->getName(), 60, true, true), - 'feed' => 60, + 'feed' => 100, )); // draw QTY @@ -60,7 +58,8 @@ public function draw() // draw SKU $lines[0][] = array( 'text' => Mage::helper('core/string')->str_split($this->getSku($item), 25), - 'feed' => 440 + 'feed' => 565, + 'align' => 'right' ); // Custom options @@ -71,17 +70,19 @@ public function draw() $lines[][] = array( 'text' => Mage::helper('core/string')->str_split(strip_tags($option['label']), 70, true, true), 'font' => 'italic', - 'feed' => 60 + 'feed' => 110 ); // draw options value if ($option['value']) { - $_printValue = isset($option['print_value']) ? $option['print_value'] : strip_tags($option['value']); + $_printValue = isset($option['print_value']) + ? $option['print_value'] + : strip_tags($option['value']); $values = explode(', ', $_printValue); foreach ($values as $value) { $lines[][] = array( 'text' => Mage::helper('core/string')->str_split($value, 50, true, true), - 'feed' => 65 + 'feed' => 115 ); } } @@ -90,7 +91,7 @@ public function draw() $lineBlock = array( 'lines' => $lines, - 'height' => 10 + 'height' => 20 ); $page = $pdf->drawLineBlocks($page, array($lineBlock), array('table_header' => true)); diff --git a/app/code/core/Mage/Sales/Model/Order/Pdf/Shipment.php b/app/code/core/Mage/Sales/Model/Order/Pdf/Shipment.php index 84eded40d3..af39db094f 100644 --- a/app/code/core/Mage/Sales/Model/Order/Pdf/Shipment.php +++ b/app/code/core/Mage/Sales/Model/Order/Pdf/Shipment.php @@ -24,7 +24,6 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - /** * Sales Order Shipment PDF model * @@ -34,6 +33,56 @@ */ class Mage_Sales_Model_Order_Pdf_Shipment extends Mage_Sales_Model_Order_Pdf_Abstract { + /** + * Draw table header for product items + * + * @param Zend_Pdf_Page $page + * @return void + */ + protected function _drawHeader(Zend_Pdf_Page $page) + { + /* Add table head */ + $this->_setFontRegular($page, 10); + $page->setFillColor(new Zend_Pdf_Color_RGB(0.93, 0.92, 0.92)); + $page->setLineColor(new Zend_Pdf_Color_GrayScale(0.5)); + $page->setLineWidth(0.5); + $page->drawRectangle(25, $this->y, 570, $this->y-15); + $this->y -= 10; + $page->setFillColor(new Zend_Pdf_Color_RGB(0, 0, 0)); + + //columns headers + $lines[0][] = array( + 'text' => Mage::helper('sales')->__('Products'), + 'feed' => 100, + ); + + $lines[0][] = array( + 'text' => Mage::helper('sales')->__('Qty'), + 'feed' => 35 + ); + + $lines[0][] = array( + 'text' => Mage::helper('sales')->__('SKU'), + 'feed' => 565, + 'align' => 'right' + ); + + $lineBlock = array( + 'lines' => $lines, + 'height' => 10 + ); + + $this->drawLineBlocks($page, array($lineBlock), array('table_header' => true)); + $page->setFillColor(new Zend_Pdf_Color_GrayScale(0)); + $this->y -= 20; + } + + /** + * Return PDF document + * + * @param array $shipments + * @return Zend_Pdf + */ public function getPdf($shipments = array()) { $this->_beforeGetPdf(); @@ -48,59 +97,36 @@ public function getPdf($shipments = array()) Mage::app()->getLocale()->emulate($shipment->getStoreId()); Mage::app()->setCurrentStore($shipment->getStoreId()); } - $page = $pdf->newPage(Zend_Pdf_Page::SIZE_A4); - $pdf->pages[] = $page; - + $page = $this->newPage(); $order = $shipment->getOrder(); - /* Add image */ $this->insertLogo($page, $shipment->getStore()); - /* Add address */ $this->insertAddress($page, $shipment->getStore()); - /* Add head */ - $this->insertOrder($page, $shipment, Mage::getStoreConfigFlag(self::XML_PATH_SALES_PDF_SHIPMENT_PUT_ORDER_ID, $order->getStoreId())); - - $page->setFillColor(new Zend_Pdf_Color_GrayScale(1)); - $this->_setFontRegular($page); - $page->drawText(Mage::helper('sales')->__('Packingslip # ') . $shipment->getIncrementId(), 35, 780, 'UTF-8'); - + $this->insertOrder( + $page, + $shipment, + Mage::getStoreConfigFlag(self::XML_PATH_SALES_PDF_SHIPMENT_PUT_ORDER_ID, $order->getStoreId()) + ); + /* Add document text and number */ + $this->insertDocumentNumber( + $page, + Mage::helper('sales')->__('Packingslip # ') . $shipment->getIncrementId() + ); /* Add table */ - $page->setFillColor(new Zend_Pdf_Color_RGB(0.93, 0.92, 0.92)); - $page->setLineColor(new Zend_Pdf_Color_GrayScale(0.5)); - $page->setLineWidth(0.5); - - - /* Add table head */ - $page->drawRectangle(25, $this->y, 570, $this->y-15); - $this->y -=10; - $page->setFillColor(new Zend_Pdf_Color_RGB(0.4, 0.4, 0.4)); - $page->drawText(Mage::helper('sales')->__('Qty'), 35, $this->y, 'UTF-8'); - $page->drawText(Mage::helper('sales')->__('Products'), 60, $this->y, 'UTF-8'); - $page->drawText(Mage::helper('sales')->__('SKU'), 470, $this->y, 'UTF-8'); - - $this->y -=15; - - $page->setFillColor(new Zend_Pdf_Color_GrayScale(0)); - + $this->_drawHeader($page); /* Add body */ - foreach ($shipment->getAllItems() as $item){ + foreach ($shipment->getAllItems() as $item) { if ($item->getOrderItem()->getParentItem()) { continue; } - - if ($this->y<15) { - $page = $this->newPage(array('table_header' => true)); - } - /* Draw item */ - $page = $this->_drawItem($item, $page, $order); + $this->_drawItem($item, $page, $order); + $page = end($pdf->pages); } } - $this->_afterGetPdf(); - if ($shipment->getStoreId()) { Mage::app()->getLocale()->revert(); } @@ -110,7 +136,7 @@ public function getPdf($shipments = array()) /** * Create new page and assign to PDF object * - * @param array $settings + * @param array $settings * @return Zend_Pdf_Page */ public function newPage(array $settings = array()) @@ -119,24 +145,9 @@ public function newPage(array $settings = array()) $page = $this->_getPdf()->newPage(Zend_Pdf_Page::SIZE_A4); $this->_getPdf()->pages[] = $page; $this->y = 800; - if (!empty($settings['table_header'])) { - $this->_setFontRegular($page); - $page->setFillColor(new Zend_Pdf_Color_RGB(0.93, 0.92, 0.92)); - $page->setLineColor(new Zend_Pdf_Color_GrayScale(0.5)); - $page->setLineWidth(0.5); - $page->drawRectangle(25, $this->y, 570, $this->y-15); - $this->y -=10; - - $page->setFillColor(new Zend_Pdf_Color_RGB(0.4, 0.4, 0.4)); - $page->drawText(Mage::helper('sales')->__('Qty'), 35, $this->y, 'UTF-8'); - $page->drawText(Mage::helper('sales')->__('Products'), 60, $this->y, 'UTF-8'); - $page->drawText(Mage::helper('sales')->__('SKU'), 470, $this->y, 'UTF-8'); - - $page->setFillColor(new Zend_Pdf_Color_GrayScale(0)); - $this->y -=20; + $this->_drawHeader($page); } - return $page; } } diff --git a/app/code/core/Mage/Sales/Model/Order/Pdf/Shipment/Packaging.php b/app/code/core/Mage/Sales/Model/Order/Pdf/Shipment/Packaging.php index f2c4e40d7d..e69488135e 100644 --- a/app/code/core/Mage/Sales/Model/Order/Pdf/Shipment/Packaging.php +++ b/app/code/core/Mage/Sales/Model/Order/Pdf/Shipment/Packaging.php @@ -24,7 +24,6 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - /** * Sales Order Shipment PDF model * @@ -37,7 +36,7 @@ class Mage_Sales_Model_Order_Pdf_Shipment_Packaging extends Mage_Sales_Model_Ord /** * Format pdf file * - * @param null $shipment + * @param null $shipment * @return Zend_Pdf */ public function getPdf($shipment = null) @@ -46,8 +45,8 @@ public function getPdf($shipment = null) $this->_initRenderer('shipment'); $pdf = new Zend_Pdf(); - $page = $pdf->newPage(Zend_Pdf_Page::SIZE_A4); - $pdf->pages[] = $page; + $this->_setPdf($pdf); + $page = $this->newPage(); if ($shipment->getStoreId()) { Mage::app()->getLocale()->emulate($shipment->getStoreId()); @@ -71,7 +70,7 @@ public function getPdf($shipment = null) /** * Draw header block * - * @param Zend_Pdf_Page $page + * @param Zend_Pdf_Page $page * @return Mage_Sales_Model_Order_Pdf_Shipment_Packaging */ protected function _drawHeaderBlock(Zend_Pdf_Page $page) { @@ -89,7 +88,7 @@ protected function _drawHeaderBlock(Zend_Pdf_Page $page) { /** * Draw packages block * - * @param Zend_Pdf_Page $page + * @param Zend_Pdf_Page $page * @return Mage_Sales_Model_Order_Pdf_Shipment_Packaging */ protected function _drawPackageBlock(Zend_Pdf_Page $page) diff --git a/app/code/core/Mage/Sales/Model/Order/Pdf/Total/Default.php b/app/code/core/Mage/Sales/Model/Order/Pdf/Total/Default.php index d83a239a67..d92f0d460f 100644 --- a/app/code/core/Mage/Sales/Model/Order/Pdf/Total/Default.php +++ b/app/code/core/Mage/Sales/Model/Order/Pdf/Total/Default.php @@ -24,6 +24,13 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +/** + * Sales Order Total PDF model + * + * @category Mage + * @package Mage_Sales + * @author Magento Core Team + */ class Mage_Sales_Model_Order_Pdf_Total_Default extends Varien_Object { /** diff --git a/app/code/core/Mage/Sales/Model/Order/Shipment/Api.php b/app/code/core/Mage/Sales/Model/Order/Shipment/Api.php index 68ada16a84..73673bb8d4 100644 --- a/app/code/core/Mage/Sales/Model/Order/Shipment/Api.php +++ b/app/code/core/Mage/Sales/Model/Order/Shipment/Api.php @@ -131,8 +131,9 @@ public function info($shipmentIncrementId) * @param boolean $includeComment * @return string */ - public function create($orderIncrementId, $itemsQty = array(), $comment = null, $email = false, $includeComment = false) - { + public function create($orderIncrementId, $itemsQty = array(), $comment = null, $email = false, + $includeComment = false + ) { $order = Mage::getModel('sales/order')->loadByIncrementId($orderIncrementId); /** @@ -244,6 +245,39 @@ public function removeTrack($shipmentIncrementId, $trackId) return true; } + /** + * Send email with shipment data to customer + * + * @param string $shipmentIncrementId + * @param string $comment + * @return bool + */ + public function sendInfo($shipmentIncrementId, $comment = '') + { + /* @var $shipment Mage_Sales_Model_Order_Shipment */ + $shipment = Mage::getModel('sales/order_shipment')->loadByIncrementId($shipmentIncrementId); + + if (!$shipment->getId()) { + $this->_fault('not_exists'); + } + + try { + $shipment->sendEmail(true, $comment) + ->setEmailSent(true) + ->save(); + $historyItem = Mage::getResourceModel('sales/order_status_history_collection') + ->getUnnotifiedForInstance($shipment, Mage_Sales_Model_Order_Shipment::HISTORY_ENTITY_NAME); + if ($historyItem) { + $historyItem->setIsCustomerNotified(1); + $historyItem->save(); + } + } catch (Mage_Core_Exception $e) { + $this->_fault('data_invalid', $e->getMessage()); + } + + return true; + } + /** * Retrieve tracking number info * diff --git a/app/code/core/Mage/Sales/Model/Quote/Payment.php b/app/code/core/Mage/Sales/Model/Quote/Payment.php index 796c8aae77..be4db0c55d 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Payment.php +++ b/app/code/core/Mage/Sales/Model/Quote/Payment.php @@ -142,7 +142,7 @@ public function importData(array $data) $method = $this->getMethodInstance(); /** - * Payment avalability related with quote totals. + * Payment availability related with quote totals. * We have recollect quote totals before checking */ $this->getQuote()->collectTotals(); diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Bestsellers.php b/app/code/core/Mage/Sales/Model/Resource/Report/Bestsellers.php index 25937f694a..10eb1117bb 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Report/Bestsellers.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report/Bestsellers.php @@ -228,9 +228,9 @@ public function aggregate($from = null, $to = null) 'period' => 'period', 'store_id' => new Zend_Db_Expr(Mage_Core_Model_App::ADMIN_STORE_ID), 'product_id' => 'product_id', - 'product_name' => new Zend_Db_expr('MIN(product_name)'), - 'product_price' => new Zend_Db_expr('MIN(product_price)'), - 'qty_ordered' => new Zend_Db_expr('SUM(qty_ordered)'), + 'product_name' => new Zend_Db_Expr('MIN(product_name)'), + 'product_price' => new Zend_Db_Expr('MIN(product_price)'), + 'qty_ordered' => new Zend_Db_Expr('SUM(qty_ordered)'), ); $select->reset(); diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Invoiced.php b/app/code/core/Mage/Sales/Model/Resource/Report/Invoiced.php index 90c30e8014..813455b0a2 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Report/Invoiced.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report/Invoiced.php @@ -104,13 +104,13 @@ protected function _aggregateByInvoiceCreatedAt($from, $to) 'period' => $periodExpr, 'store_id' => 'order_table.store_id', 'order_status' => 'order_table.status', - 'orders_count' => new Zend_Db_expr('COUNT(order_table.entity_id)'), - 'orders_invoiced' => new Zend_Db_expr('COUNT(order_table.entity_id)'), - 'invoiced' => new Zend_Db_expr('SUM(order_table.base_total_invoiced' + 'orders_count' => new Zend_Db_Expr('COUNT(order_table.entity_id)'), + 'orders_invoiced' => new Zend_Db_Expr('COUNT(order_table.entity_id)'), + 'invoiced' => new Zend_Db_Expr('SUM(order_table.base_total_invoiced' . ' * order_table.base_to_global_rate)'), - 'invoiced_captured' => new Zend_Db_expr('SUM(order_table.base_total_paid' + 'invoiced_captured' => new Zend_Db_Expr('SUM(order_table.base_total_paid' . ' * order_table.base_to_global_rate)'), - 'invoiced_not_captured' => new Zend_Db_expr( + 'invoiced_not_captured' => new Zend_Db_Expr( 'SUM((order_table.base_total_invoiced - order_table.base_total_paid)' . ' * order_table.base_to_global_rate)') ); @@ -151,11 +151,11 @@ protected function _aggregateByInvoiceCreatedAt($from, $to) 'period' => 'period', 'store_id' => new Zend_Db_Expr(Mage_Core_Model_App::ADMIN_STORE_ID), 'order_status' => 'order_status', - 'orders_count' => new Zend_Db_expr('SUM(orders_count)'), - 'orders_invoiced' => new Zend_Db_expr('SUM(orders_invoiced)'), - 'invoiced' => new Zend_Db_expr('SUM(invoiced)'), - 'invoiced_captured' => new Zend_Db_expr('SUM(invoiced_captured)'), - 'invoiced_not_captured' => new Zend_Db_expr('SUM(invoiced_not_captured)') + 'orders_count' => new Zend_Db_Expr('SUM(orders_count)'), + 'orders_invoiced' => new Zend_Db_Expr('SUM(orders_invoiced)'), + 'invoiced' => new Zend_Db_Expr('SUM(invoiced)'), + 'invoiced_captured' => new Zend_Db_Expr('SUM(invoiced_captured)'), + 'invoiced_not_captured' => new Zend_Db_Expr('SUM(invoiced_not_captured)') ); $select @@ -267,11 +267,11 @@ protected function _aggregateByOrderCreatedAt($from, $to) 'period' => 'period', 'store_id' => new Zend_Db_Expr(Mage_Core_Model_App::ADMIN_STORE_ID), 'order_status' => 'order_status', - 'orders_count' => new Zend_Db_expr('SUM(orders_count)'), - 'orders_invoiced' => new Zend_Db_expr('SUM(orders_invoiced)'), - 'invoiced' => new Zend_Db_expr('SUM(invoiced)'), - 'invoiced_captured' => new Zend_Db_expr('SUM(invoiced_captured)'), - 'invoiced_not_captured' => new Zend_Db_expr('SUM(invoiced_not_captured)') + 'orders_count' => new Zend_Db_Expr('SUM(orders_count)'), + 'orders_invoiced' => new Zend_Db_Expr('SUM(orders_invoiced)'), + 'invoiced' => new Zend_Db_Expr('SUM(invoiced)'), + 'invoiced_captured' => new Zend_Db_Expr('SUM(invoiced_captured)'), + 'invoiced_not_captured' => new Zend_Db_Expr('SUM(invoiced_not_captured)') ); $select->from($table, $columns) diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Order/Createdat.php b/app/code/core/Mage/Sales/Model/Resource/Report/Order/Createdat.php index c21da52fd1..2274cd58bd 100644 --- a/app/code/core/Mage/Sales/Model/Resource/Report/Order/Createdat.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report/Order/Createdat.php @@ -202,8 +202,8 @@ protected function _aggregateByField($aggregationField, $from, $to) $qtyCanceledExpr = $adapter->getIfNullSql('qty_canceled', 0); $cols = array( 'order_id' => 'order_id', - 'total_qty_ordered' => new Zend_Db_expr("SUM(qty_ordered - {$qtyCanceledExpr})"), - 'total_qty_invoiced' => new Zend_Db_expr('SUM(qty_invoiced)'), + 'total_qty_ordered' => new Zend_Db_Expr("SUM(qty_ordered - {$qtyCanceledExpr})"), + 'total_qty_invoiced' => new Zend_Db_Expr('SUM(qty_invoiced)'), ); $selectOrderItem->from($this->getTable('sales/order_item'), $cols) ->where('parent_item_id IS NULL') @@ -230,7 +230,7 @@ protected function _aggregateByField($aggregationField, $from, $to) // setup all columns to select SUM() except period, store_id and order_status foreach ($columns as $k => $v) { - $columns[$k] = new Zend_Db_expr('SUM(' . $k . ')'); + $columns[$k] = new Zend_Db_Expr('SUM(' . $k . ')'); } $columns['period'] = 'period'; $columns['store_id'] = new Zend_Db_Expr(Mage_Core_Model_App::ADMIN_STORE_ID); diff --git a/app/code/core/Mage/Sales/etc/api.xml b/app/code/core/Mage/Sales/etc/api.xml index f4a47abfb6..5f0f65d02a 100644 --- a/app/code/core/Mage/Sales/etc/api.xml +++ b/app/code/core/Mage/Sales/etc/api.xml @@ -92,6 +92,10 @@ Retrieve shipment information sales/order/shipment/info + + Send shipment info + sales/order/shipment/send + Create new shipment for order sales/order/shipment/create @@ -320,6 +324,9 @@ Retrieve shipment info + + Send shipment info + Order invoice diff --git a/app/code/core/Mage/Sales/etc/api2.xml b/app/code/core/Mage/Sales/etc/api2.xml new file mode 100644 index 0000000000..3fceda27f6 --- /dev/null +++ b/app/code/core/Mage/Sales/etc/api2.xml @@ -0,0 +1,304 @@ + + + + + + + Sales + 130 + + + + + sales + 10 + sales/api2_order + Orders + + + 1 + + + 1 + + + + + /orders/:id + entity + + + /orders + collection + + + + Order ID (internal) + Order ID + Order Date + Order Status + Shipping Method + <_payment_method>Payment Method + Base Currency + Order Currency + Store Name + Placed from IP + Store Currency to Order Currency Rate + Subtotal + Subtotal Including Tax + Discount + Grand Total to Be Charged + Grand Total + Shipping Amount + Shipping Including Tax + Shipping Tax + Tax Amount + <_tax_name>Tax Name + <_tax_rate>Tax Rate + Coupon Code + Base Discount + Base Subtotal + Base Shipping + Base Shipping Tax + Base Tax Amount + Total Paid + Base Total Paid + Total Refunded + Base Total Refunded + Base Subtotal Including Tax + Base Total Due + Total Due + Shipping Discount + Base Shipping Discount + Discount Description + Customer Balance + Base Customer Balance + <_gift_message>Gift Message + <_order_comments>Order Comments + Customer ID + + + + + 1 + 1 + 1 + 1 + 1 + <_payment_method>1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + <_tax_name>1 + <_tax_rate>1 + <_gift_message>1 + <_order_comments>1 + + + + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + + + 1 + + + orders + 30 + sales/api2_order_items + sales/order_item + Order Items + + + 1 + + + 1 + + + + Order Item ID + Product and Custom Options Name + Parent Order Item ID + SKU + Price + Price Including Tax + Ordered Qty + Invoiced Qty + Shipped Qty + Canceled Qty + Refunded Qty + Item Subtotal + Item Subtotal Including Tax + Base Price + Original Price + Base Original Price + Base Price Including Tax + Tax Percent + Tax Amount + Base Tax Amount + Discount Amount + Base Discount Amount + Base Item Subtotal + Base Item Subtotal Including Tax + + + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + + + + + + /orders/:id/items + collection + + + 1 + + + orders + 40 + sales/api2_order_address + sales/order_address + Order Addresses + + + 1 + + + 1 + + + + + /orders/:order_id/addresses/:address_type + entity + + + /orders/:order_id/addresses + collection + + + 1 + + Customer Last Name + Customer First Name + Customer Middle Name + Customer Prefix + Customer Suffix + Company + Street + City + State + ZIP/Postal Code + Country + Phone Number + Address Type + Email + + + + orders + 60 + sales/api2_order_comments + sales/order_status_history + Order Comments + + + 1 + + + 1 + + + + + 1 + 1 + 1 + 1 + 1 + + + 1 + 1 + + + + + /orders/:id/comments + collection + + + 1 + + + + diff --git a/app/code/core/Mage/Sales/etc/system.xml b/app/code/core/Mage/Sales/etc/system.xml index 0622812922..4f5dd1c623 100644 --- a/app/code/core/Mage/Sales/etc/system.xml +++ b/app/code/core/Mage/Sales/etc/system.xml @@ -148,7 +148,7 @@ 1 1 1 - Default logo, will be used in PDF and HTML documents.<br />(jpeg, tiff, png) + Default logo, will be used in PDF and HTML documents.<br />(jpeg, tiff, png) If you see image distortion in PDF, try to use larger image diff --git a/app/code/core/Mage/Sales/etc/wsdl.xml b/app/code/core/Mage/Sales/etc/wsdl.xml index 9c14c2e519..969eeb42c1 100644 --- a/app/code/core/Mage/Sales/etc/wsdl.xml +++ b/app/code/core/Mage/Sales/etc/wsdl.xml @@ -825,7 +825,7 @@ - + @@ -847,6 +847,14 @@ + + + + + + + + @@ -885,7 +893,7 @@ - + @@ -921,7 +929,7 @@ - + @@ -1017,6 +1025,11 @@ + + Send shipment info + + + Remove tracking number @@ -1189,6 +1202,15 @@ + + + + + + + + + diff --git a/app/code/core/Mage/Sales/etc/wsi.xml b/app/code/core/Mage/Sales/etc/wsi.xml index afb499ffe6..5ed29468d1 100644 --- a/app/code/core/Mage/Sales/etc/wsi.xml +++ b/app/code/core/Mage/Sales/etc/wsi.xml @@ -907,6 +907,22 @@ + + + + + + + + + + + + + + + + @@ -1209,6 +1225,12 @@ + + + + + + @@ -1348,6 +1370,11 @@ + + Send shipment info + + + Retrieve list of allowed carriers for order @@ -1524,6 +1551,15 @@ + + + + + + + + + diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.26-0.9.27.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.26-0.9.27.php index f5d066c3b8..efec25d2c8 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.26-0.9.27.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.26-0.9.27.php @@ -29,11 +29,16 @@ $installer = $this; /* @var $installer Mage_Sales_Model_Mysql4_Setup */ -$installer->getConnection()->beginTransaction(); -$installer->getConnection()->addColumn($this->getTable('sales/quote'), 'global_currency_code', 'varchar(255) NULL AFTER `store_to_quote_rate`'); -$installer->getConnection()->addColumn($this->getTable('sales/quote'), 'base_to_quote_rate', 'decimal(12,4) NULL AFTER `store_to_quote_rate`'); -$installer->getConnection()->addColumn($this->getTable('sales/quote'), 'base_to_global_rate', 'decimal(12,4) NULL AFTER `store_to_quote_rate`'); +$installer->getConnection()->addColumn( + $this->getTable('sales/quote'), 'global_currency_code', 'varchar(255) NULL AFTER `store_to_quote_rate`' +); +$installer->getConnection()->addColumn( + $this->getTable('sales/quote'), 'base_to_quote_rate', 'decimal(12,4) NULL AFTER `store_to_quote_rate`' +); +$installer->getConnection()->addColumn( + $this->getTable('sales/quote'), 'base_to_global_rate', 'decimal(12,4) NULL AFTER `store_to_quote_rate`' +); $installer->addAttribute('quote', 'global_currency_code', array('type'=>'static')); $installer->addAttribute('quote', 'base_to_global_rate', array('type'=>'static')); @@ -66,100 +71,110 @@ $invoiceEntityType['entity_type_id'] => $invoiceEntityType, $creditmemoEntityType['entity_type_id'] => $creditmemoEntityType); -foreach ($entityTypes as $typeId => $entity) { - - $globalCurrencyCode = $installer->getAttribute($typeId, 'global_currency_code'); - if ($globalCurrencyCode['backend_type'] == 'static') { - $globalCurrencyCodeTable = $this->getTable($entity['entity_table']); - } else { - $globalCurrencyCodeTable = $this->getTable($entity['entity_table']) . '_' . $globalCurrencyCode['backend_type']; - } - - $baseCurrencyCode = $installer->getAttribute($typeId, 'base_currency_code'); - if ($baseCurrencyCode['backend_type'] == 'static') { - $baseCurrencyCodeTable = $this->getTable($entity['entity_table']); - } else { - $baseCurrencyCodeTable = $this->getTable($entity['entity_table']) . '_' . $baseCurrencyCode['backend_type']; - } - - $storeCurrencyCode = $installer->getAttribute($typeId, 'store_currency_code'); - if ($storeCurrencyCode['backend_type'] == 'static') { - $storeCurrencyCodeTable = $this->getTable($entity['entity_table']); - } else { - $storeCurrencyCodeTable = $this->getTable($entity['entity_table']) . '_' . $storeCurrencyCode['backend_type']; - } - - $baseToGlobalRate = $installer->getAttribute($typeId, 'base_to_global_rate'); - if ($baseToGlobalRate['backend_type'] == 'static') { - $baseToGlobalRateTable = $this->getTable($entity['entity_table']); - } else { - $baseToGlobalRateTable = $this->getTable($entity['entity_table']) . '_' . $baseToGlobalRate['backend_type']; - } - - $storeToBaseRate = $installer->getAttribute($typeId, 'store_to_base_rate'); - if ($storeToBaseRate['backend_type'] == 'static') { - $storeToBaseRateTable = $this->getTable($entity['entity_table']); - } else { - $storeToBaseRateTable = $this->getTable($entity['entity_table']) . '_' . $storeToBaseRate['backend_type']; - } - - $baseToOrderRate = $installer->getAttribute($typeId, 'base_to_order_rate'); - if ($baseToOrderRate['backend_type'] == 'static') { - $baseToOrderRateTable = $this->getTable($entity['entity_table']); - } else { - $baseToOrderRateTable = $this->getTable($entity['entity_table']) . '_' . $baseToOrderRate['backend_type']; - } - - $storeToOrderRate = $installer->getAttribute($typeId, 'store_to_order_rate'); - if ($storeToOrderRate['backend_type'] == 'static') { - $storeToOrderRateTable = $this->getTable($entity['entity_table']); - } else { - $storeToOrderRateTable = $this->getTable($entity['entity_table']) . '_' . $storeToOrderRate['backend_type']; +try { + $installer->getConnection()->beginTransaction(); + + foreach ($entityTypes as $typeId => $entity) { + + $globalCurrencyCode = $installer->getAttribute($typeId, 'global_currency_code'); + if ($globalCurrencyCode['backend_type'] == 'static') { + $globalCurrencyCodeTable = $this->getTable($entity['entity_table']); + } else { + $globalCurrencyCodeTable = $this->getTable($entity['entity_table']) . '_' + . $globalCurrencyCode['backend_type']; + } + + $baseCurrencyCode = $installer->getAttribute($typeId, 'base_currency_code'); + if ($baseCurrencyCode['backend_type'] == 'static') { + $baseCurrencyCodeTable = $this->getTable($entity['entity_table']); + } else { + $baseCurrencyCodeTable = $this->getTable($entity['entity_table']) . '_' + . $baseCurrencyCode['backend_type']; + } + + $storeCurrencyCode = $installer->getAttribute($typeId, 'store_currency_code'); + if ($storeCurrencyCode['backend_type'] == 'static') { + $storeCurrencyCodeTable = $this->getTable($entity['entity_table']); + } else { + $storeCurrencyCodeTable = $this->getTable($entity['entity_table']) . '_' + . $storeCurrencyCode['backend_type']; + } + + $baseToGlobalRate = $installer->getAttribute($typeId, 'base_to_global_rate'); + if ($baseToGlobalRate['backend_type'] == 'static') { + $baseToGlobalRateTable = $this->getTable($entity['entity_table']); + } else { + $baseToGlobalRateTable = $this->getTable($entity['entity_table']) . '_' . $baseToGlobalRate['backend_type']; + } + + $storeToBaseRate = $installer->getAttribute($typeId, 'store_to_base_rate'); + if ($storeToBaseRate['backend_type'] == 'static') { + $storeToBaseRateTable = $this->getTable($entity['entity_table']); + } else { + $storeToBaseRateTable = $this->getTable($entity['entity_table']) . '_' . $storeToBaseRate['backend_type']; + } + + $baseToOrderRate = $installer->getAttribute($typeId, 'base_to_order_rate'); + if ($baseToOrderRate['backend_type'] == 'static') { + $baseToOrderRateTable = $this->getTable($entity['entity_table']); + } else { + $baseToOrderRateTable = $this->getTable($entity['entity_table']) . '_' . $baseToOrderRate['backend_type']; + } + + $storeToOrderRate = $installer->getAttribute($typeId, 'store_to_order_rate'); + if ($storeToOrderRate['backend_type'] == 'static') { + $storeToOrderRateTable = $this->getTable($entity['entity_table']); + } else { + $storeToOrderRateTable = $this->getTable($entity['entity_table']) . '_' . $storeToOrderRate['backend_type']; + } + //////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + //copy data from base_currency_code into global_currency_code + $query = 'INSERT INTO `' . $globalCurrencyCodeTable . + '` (`entity_type_id`, `attribute_id`, `entity_id`, `value`) SELECT `entity_type_id`, "' . + $globalCurrencyCode['attribute_id'] . '" as `attribute_id`, `entity_id`, `value` FROM `' . + $baseCurrencyCodeTable . '` WHERE `attribute_id` = ' . $baseCurrencyCode['attribute_id'] . ';'; + + //echo $query . "
    "; + $installer->getConnection()->query($query); + + //delete old data in base_currency_code + $query = 'DELETE FROM `' . $baseCurrencyCodeTable . '` WHERE `attribute_id` = ' + . $baseCurrencyCode['attribute_id'] . ';'; + + //echo $query . "
    "; + $installer->getConnection()->query($query); + + //copy data from store_currency_code into base_currency_code + $query = 'INSERT INTO `' . $baseCurrencyCodeTable . + '` (`entity_type_id`, `attribute_id`, `entity_id`, `value`) SELECT `entity_type_id`, "' . + $baseCurrencyCode['attribute_id'] . '" as `attribute_id`, `entity_id`, `value` FROM `' . + $storeCurrencyCodeTable . '` WHERE `attribute_id` = ' . $storeCurrencyCode['attribute_id'] . ';'; + + //echo $query . "
    "; + $installer->getConnection()->query($query); + + //copy data from store_to_base_rate into base_to_global_rate + $query = 'INSERT INTO `' . $baseToGlobalRateTable . + '` (`entity_type_id`, `attribute_id`, `entity_id`, `value`) SELECT `entity_type_id`, "' . + $baseToGlobalRate['attribute_id'] . '" as `attribute_id`, `entity_id`, `value` FROM `' . + $storeToBaseRateTable . '` WHERE `attribute_id` = ' . $storeToBaseRate['attribute_id'] . ';'; + + //echo $query . "
    "; + $installer->getConnection()->query($query); + + //copy data from store_to_order_rate into base_to_order_rate + $query = 'INSERT INTO `' . $baseToOrderRateTable . + '` (`entity_type_id`, `attribute_id`, `entity_id`, `value`) SELECT `entity_type_id`, "' . + $baseToOrderRate['attribute_id'] . '" as `attribute_id`, `entity_id`, `value` FROM `' . + $storeToOrderRateTable . '` WHERE `attribute_id` = ' . $storeToOrderRate['attribute_id'] . ';'; + + //echo $query . "
    "; + $installer->getConnection()->query($query); } - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - //copy data from base_currency_code into global_currency_code - $query = 'INSERT INTO `' . $globalCurrencyCodeTable . - '` (`entity_type_id`, `attribute_id`, `entity_id`, `value`) SELECT `entity_type_id`, "' . - $globalCurrencyCode['attribute_id'] . '" as `attribute_id`, `entity_id`, `value` FROM `' . - $baseCurrencyCodeTable . '` WHERE `attribute_id` = ' . $baseCurrencyCode['attribute_id'] . ';'; - - //echo $query . "
    "; - $installer->getConnection()->query($query); - - //delete old data in base_currency_code - $query = 'DELETE FROM `' . $baseCurrencyCodeTable . '` WHERE `attribute_id` = ' . $baseCurrencyCode['attribute_id'] . ';'; - - //echo $query . "
    "; - $installer->getConnection()->query($query); - - //copy data from store_currency_code into base_currency_code - $query = 'INSERT INTO `' . $baseCurrencyCodeTable . - '` (`entity_type_id`, `attribute_id`, `entity_id`, `value`) SELECT `entity_type_id`, "' . - $baseCurrencyCode['attribute_id'] . '" as `attribute_id`, `entity_id`, `value` FROM `' . - $storeCurrencyCodeTable . '` WHERE `attribute_id` = ' . $storeCurrencyCode['attribute_id'] . ';'; - - //echo $query . "
    "; - $installer->getConnection()->query($query); - - //copy data from store_to_base_rate into base_to_global_rate - $query = 'INSERT INTO `' . $baseToGlobalRateTable . - '` (`entity_type_id`, `attribute_id`, `entity_id`, `value`) SELECT `entity_type_id`, "' . - $baseToGlobalRate['attribute_id'] . '" as `attribute_id`, `entity_id`, `value` FROM `' . - $storeToBaseRateTable . '` WHERE `attribute_id` = ' . $storeToBaseRate['attribute_id'] . ';'; - - //echo $query . "
    "; - $installer->getConnection()->query($query); - - //copy data from store_to_order_rate into base_to_order_rate - $query = 'INSERT INTO `' . $baseToOrderRateTable . - '` (`entity_type_id`, `attribute_id`, `entity_id`, `value`) SELECT `entity_type_id`, "' . - $baseToOrderRate['attribute_id'] . '" as `attribute_id`, `entity_id`, `value` FROM `' . - $storeToOrderRateTable . '` WHERE `attribute_id` = ' . $storeToOrderRate['attribute_id'] . ';'; - - //echo $query . "
    "; - $installer->getConnection()->query($query); + $installer->getConnection()->commit(); +} catch(Exception $e) { + $installer->getConnection()->rollBack(); + throw $e; } - -$installer->getConnection()->commit(); diff --git a/app/code/core/Mage/SalesRule/etc/adminhtml.xml b/app/code/core/Mage/SalesRule/etc/adminhtml.xml index 640138f558..d814bc4190 100644 --- a/app/code/core/Mage/SalesRule/etc/adminhtml.xml +++ b/app/code/core/Mage/SalesRule/etc/adminhtml.xml @@ -48,19 +48,19 @@ - - - - - - Shopping Cart Price Rules - - - - - + + + + + + Shopping Cart Price Rules + + + + + - + diff --git a/app/code/core/Mage/Shipping/Model/Carrier/Abstract.php b/app/code/core/Mage/Shipping/Model/Carrier/Abstract.php index ea5ff0b909..d69cf15f09 100644 --- a/app/code/core/Mage/Shipping/Model/Carrier/Abstract.php +++ b/app/code/core/Mage/Shipping/Model/Carrier/Abstract.php @@ -556,7 +556,7 @@ public function getDebugFlag() } /** - * Used to call debug method from not Paymant Method context + * Used to call debug method from not Payment Method context * * @param mixed $debugData */ diff --git a/app/code/core/Mage/Sitemap/etc/system.xml b/app/code/core/Mage/Sitemap/etc/system.xml index 50e6b07c68..be560a6efc 100644 --- a/app/code/core/Mage/Sitemap/etc/system.xml +++ b/app/code/core/Mage/Sitemap/etc/system.xml @@ -143,6 +143,7 @@ text + validate-email 5 1 1 diff --git a/app/code/core/Mage/Tag/Model/Api/V2.php b/app/code/core/Mage/Tag/Model/Api/V2.php index 454b8a58fd..129bad78e2 100644 --- a/app/code/core/Mage/Tag/Model/Api/V2.php +++ b/app/code/core/Mage/Tag/Model/Api/V2.php @@ -46,7 +46,7 @@ public function items($productId, $store) foreach ($result as $key => $tag) { $result[$key] = Mage::helper('api')->wsiArrayPacker($tag); } - return $result; + return array_values($result); } /** diff --git a/app/code/core/Mage/Tag/Model/Resource/Popular/Collection.php b/app/code/core/Mage/Tag/Model/Resource/Popular/Collection.php index a466ef3eae..3f2d02dba9 100755 --- a/app/code/core/Mage/Tag/Model/Resource/Popular/Collection.php +++ b/app/code/core/Mage/Tag/Model/Resource/Popular/Collection.php @@ -105,4 +105,22 @@ public function limit($limit) $this->getSelect()->limit($limit); return $this; } + + /** + * Get SQL for get record count + * + * @return Varien_Db_Select + */ + public function getSelectCountSql() + { + $this->_renderFilters(); + $select = clone $this->getSelect(); + $select->reset(Zend_Db_Select::ORDER); + $select->reset(Zend_Db_Select::LIMIT_COUNT); + $select->reset(Zend_Db_Select::LIMIT_OFFSET); + + $countSelect = $this->getConnection()->select(); + $countSelect->from(array('a' => $select), 'COUNT(popularity)'); + return $countSelect; + } } diff --git a/app/code/core/Mage/Tax/Model/Calculation/Rate.php b/app/code/core/Mage/Tax/Model/Calculation/Rate.php index e0c8f3ded0..06182a451b 100644 --- a/app/code/core/Mage/Tax/Model/Calculation/Rate.php +++ b/app/code/core/Mage/Tax/Model/Calculation/Rate.php @@ -71,10 +71,9 @@ protected function _construct() protected function _beforeSave() { if ($this->getZipIsRange()) { - $zipFrom = (strlen($this->getZipFrom()) > 10) ? substr($this->getZipFrom(), 0, 10) : $this->getZipFrom(); - $zipTo = (strlen($this->getZipTo()) > 10) ? substr($this->getZipTo(), 0, 10) : $this->getZipTo(); - - $this->setTaxPostcode("{$zipFrom}-{$zipTo}"); + $zipFrom = substr($this->getZipFrom(), 0, 9); + $zipTo = substr($this->getZipTo(), 0, 9); + $this->setTaxPostcode($zipFrom . '-' . $zipTo); } else { $taxPostCode = $this->getTaxPostcode(); diff --git a/app/code/core/Mage/Tax/Model/Resource/Calculation.php b/app/code/core/Mage/Tax/Model/Resource/Calculation.php index 2a38f6cd18..1d83d49e87 100755 --- a/app/code/core/Mage/Tax/Model/Resource/Calculation.php +++ b/app/code/core/Mage/Tax/Model/Resource/Calculation.php @@ -415,7 +415,7 @@ public function getRatesByCustomerTaxClass($customerTaxClass, $productTaxClass = $adapter->quoteInto('calc_table.customer_tax_class_id = ?', $customerTaxClassId), ); - if ($productTaxClass) { + if ($productTaxClass !== null) { $productTaxClassId = (int)$productTaxClass; $calcJoinConditions[] = $adapter->quoteInto('calc_table.product_tax_class_id = ?', $productTaxClassId); } @@ -426,13 +426,13 @@ public function getRatesByCustomerTaxClass($customerTaxClass, $productTaxClass = array('main_table' => $this->getTable('tax/tax_calculation_rate')), array('country' => 'tax_country_id', 'region_id' => 'tax_region_id', 'postcode' => 'tax_postcode')) ->joinInner( - array('calc_table' => $this->getTable('tax/tax_calculation')), - implode(' AND ', $calcJoinConditions), - array('product_class' => 'calc_table.product_tax_class_id')) + array('calc_table' => $this->getTable('tax/tax_calculation')), + implode(' AND ', $calcJoinConditions), + array('product_class' => 'calc_table.product_tax_class_id')) ->joinLeft( - array('state_table' => $this->getTable('directory/country_region')), - 'state_table.region_id = main_table.tax_region_id', - array('region_code' => 'state_table.code')) + array('state_table' => $this->getTable('directory/country_region')), + 'state_table.region_id = main_table.tax_region_id', + array('region_code' => 'state_table.code')) ->distinct(true); $CSP = $adapter->fetchAll($selectCSP); diff --git a/app/code/core/Mage/Usa/Helper/Data.php b/app/code/core/Mage/Usa/Helper/Data.php index 8818068929..615f743378 100644 --- a/app/code/core/Mage/Usa/Helper/Data.php +++ b/app/code/core/Mage/Usa/Helper/Data.php @@ -109,26 +109,27 @@ public function getMeasureDimensionName($key) */ public function displayGirthValue($shippingMethod) { - if (in_array($shippingMethod, array('usps_Priority Mail International', - 'usps_Priority Mail International Small Flat Rate Box', - 'usps_Priority Mail International Medium Flat Rate Box', - 'usps_Priority Mail International Large Flat Rate Box', - 'usps_Priority Mail International Flat Rate Envelope', - 'usps_Express Mail International Flat Rate Envelope', - 'usps_Express Mail Hold For Pickup', - 'usps_Express Mail International', - 'usps_First-Class Mail International Package', - 'usps_First-Class Mail International Large Envelope', - 'usps_First-Class Mail International', - 'usps_Global Express Guaranteed (GXG)', - 'usps_USPS GXG Envelopes', - 'usps_Global Express Guaranteed Non-Document Non-Rectangular', - 'usps_Media Mail', - 'usps_Parcel Post', - 'usps_Express Mail', - 'usps_Priority Mail' - ) - )) { + if (in_array($shippingMethod, array( + 'usps_Priority Mail International', + 'usps_Priority Mail International Small Flat Rate Box', + 'usps_Priority Mail International Medium Flat Rate Box', + 'usps_Priority Mail International Large Flat Rate Box', + 'usps_Priority Mail International Flat Rate Envelope', + 'usps_Express Mail International Flat Rate Envelope', + 'usps_Express Mail Hold For Pickup', + 'usps_Express Mail International', + 'usps_First-Class Mail International Package', + 'usps_First-Class Mail International Parcel', + 'usps_First-Class Mail International Large Envelope', + 'usps_First-Class Mail International', + 'usps_Global Express Guaranteed (GXG)', + 'usps_USPS GXG Envelopes', + 'usps_Global Express Guaranteed Non-Document Non-Rectangular', + 'usps_Media Mail', + 'usps_Parcel Post', + 'usps_Express Mail', + 'usps_Priority Mail' + ))) { return true; } else { return false; diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International.php index dc49ba2328..6aed24fbd4 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International.php @@ -153,6 +153,13 @@ class Mage_Usa_Model_Shipping_Carrier_Dhl_International 'contentdesc' => array('code' => 'dhl_content_desc', 'setCode' => 'content_desc') ); + /** + * Flag that shows if shipping is domestic + * + * @var bool + */ + protected $_isDomestic = false; + /** * Dhl International Class constructor * @@ -381,16 +388,21 @@ public function getAllowedMethods() { $contentType = $this->getConfigData('content_type'); $allowedMethods = array(); - switch ($contentType) { - case self::DHL_CONTENT_TYPE_DOC: - $allowedMethods = explode(',', $this->getConfigData('doc_methods')); - break; - - case self::DHL_CONTENT_TYPE_NON_DOC: - $allowedMethods = explode(',', $this->getConfigData('nondoc_methods')); - break; - default: - Mage::throwException(Mage::helper('usa')->__('Wrong Content Type.')); + if ($this->_isDomestic) { + $allowedMethods = array_merge(explode(',', $this->getConfigData('doc_methods')), + explode(',', $this->getConfigData('nondoc_methods')) + ); + } else { + switch ($contentType) { + case self::DHL_CONTENT_TYPE_DOC: + $allowedMethods = explode(',', $this->getConfigData('doc_methods')); + break; + case self::DHL_CONTENT_TYPE_NON_DOC: + $allowedMethods = explode(',', $this->getConfigData('nondoc_methods')); + break; + default: + Mage::throwException(Mage::helper('usa')->__('Wrong Content Type.')); + } } $methods = array(); foreach ($allowedMethods as $method) { @@ -469,47 +481,54 @@ public function getCode($type, $code = '') */ public function getDhlProducts($doc) { + $docType = array( + '2' => Mage::helper('usa')->__('Easy shop'), + '5' => Mage::helper('usa')->__('Sprintline'), + '6' => Mage::helper('usa')->__('Secureline'), + '7' => Mage::helper('usa')->__('Express easy'), + '9' => Mage::helper('usa')->__('Europack'), + 'B' => Mage::helper('usa')->__('Break bulk express'), + 'C' => Mage::helper('usa')->__('Medical express'), + 'D' => Mage::helper('usa')->__('Express worldwide'), // product content code: DOX + 'U' => Mage::helper('usa')->__('Express worldwide'), // product content code: ECX + 'K' => Mage::helper('usa')->__('Express 9:00'), + 'L' => Mage::helper('usa')->__('Express 10:30'), + 'G' => Mage::helper('usa')->__('Domestic economy select'), + 'W' => Mage::helper('usa')->__('Economy select'), + 'I' => Mage::helper('usa')->__('Break bulk economy'), + 'N' => Mage::helper('usa')->__('Domestic express'), + 'O' => Mage::helper('usa')->__('Others'), + 'R' => Mage::helper('usa')->__('Globalmail business'), + 'S' => Mage::helper('usa')->__('Same day'), + 'T' => Mage::helper('usa')->__('Express 12:00'), + 'X' => Mage::helper('usa')->__('Express envelope'), + ); + + $nonDocType = array( + '1' => Mage::helper('usa')->__('Customer services'), + '3' => Mage::helper('usa')->__('Easy shop'), + '4' => Mage::helper('usa')->__('Jetline'), + '8' => Mage::helper('usa')->__('Express easy'), + 'P' => Mage::helper('usa')->__('Express worldwide'), + 'Q' => Mage::helper('usa')->__('Medical express'), + 'E' => Mage::helper('usa')->__('Express 9:00'), + 'F' => Mage::helper('usa')->__('Freight worldwide'), + 'H' => Mage::helper('usa')->__('Economy select'), + 'J' => Mage::helper('usa')->__('Jumbo box'), + 'M' => Mage::helper('usa')->__('Express 10:30'), + 'V' => Mage::helper('usa')->__('Europack'), + 'Y' => Mage::helper('usa')->__('Express 12:00'), + ); + + if ($this->_isDomestic) { + return $docType + $nonDocType; + } if ($doc == self::DHL_CONTENT_TYPE_DOC) { // Documents shipping - return array( - '2' => Mage::helper('usa')->__('Easy shop'), - '5' => Mage::helper('usa')->__('Sprintline'), - '6' => Mage::helper('usa')->__('Secureline'), - '7' => Mage::helper('usa')->__('Express easy'), - '9' => Mage::helper('usa')->__('Europack'), - 'B' => Mage::helper('usa')->__('Break bulk express'), - 'C' => Mage::helper('usa')->__('Medical express'), - 'D' => Mage::helper('usa')->__('Express worldwide'), // product content code: DOX - 'U' => Mage::helper('usa')->__('Express worldwide'), // product content code: ECX - 'K' => Mage::helper('usa')->__('Express 9:00'), - 'L' => Mage::helper('usa')->__('Express 10:30'), - 'G' => Mage::helper('usa')->__('Domestic economy select'), - 'W' => Mage::helper('usa')->__('Economy select'), - 'I' => Mage::helper('usa')->__('Break bulk economy'), - 'N' => Mage::helper('usa')->__('Domestic express'), - 'O' => Mage::helper('usa')->__('Others'), - 'R' => Mage::helper('usa')->__('Globalmail business'), - 'S' => Mage::helper('usa')->__('Same day'), - 'T' => Mage::helper('usa')->__('Express 12:00'), - 'X' => Mage::helper('usa')->__('Express envelope'), - ); + return $docType; } else { // Services for shipping non-documents cargo - return array( - '1' => Mage::helper('usa')->__('Customer services'), - '3' => Mage::helper('usa')->__('Easy shop'), - '4' => Mage::helper('usa')->__('Jetline'), - '8' => Mage::helper('usa')->__('Express easy'), - 'P' => Mage::helper('usa')->__('Express worldwide'), - 'Q' => Mage::helper('usa')->__('Medical express'), - 'E' => Mage::helper('usa')->__('Express 9:00'), - 'F' => Mage::helper('usa')->__('Freight worldwide'), - 'H' => Mage::helper('usa')->__('Economy select'), - 'J' => Mage::helper('usa')->__('Jumbo box'), - 'M' => Mage::helper('usa')->__('Express 10:30'), - 'V' => Mage::helper('usa')->__('Europack'), - 'Y' => Mage::helper('usa')->__('Express 12:00'), - ); + return $nonDocType; } } @@ -810,7 +829,9 @@ protected function _getQuotes() $nodeTo->addChild('Postalcode', $rawRequest->getDestPostal()); $nodeTo->addChild('City', $rawRequest->getDestCity()); - if ($this->getConfigData('content_type') == self::DHL_CONTENT_TYPE_NON_DOC) { + $this->_checkDomesticStatus($rawRequest->getOrigCountryId(), $rawRequest->getDestCountryId()); + + if ($this->getConfigData('content_type') == self::DHL_CONTENT_TYPE_NON_DOC && !$this->_isDomestic) { // IsDutiable flag and Dutiable node indicates that cargo is not a documentation $nodeBkgDetails->addChild('IsDutiable', 'Y'); $nodeDutiable = $nodeGetQuote->addChild('Dutiable'); @@ -1079,10 +1100,17 @@ protected function _doShipmentRequest(Varien_Object $request) public function proccessAdditionalValidation(Mage_Shipping_Model_Rate_Request $request) { //Skip by item validation if there is no items in request - if(!count($this->getAllItems($request))) { + if (!count($this->getAllItems($request))) { $this->_errors[] = Mage::helper('usa')->__('There is no items in this order'); } + $countryParams = $this->getCountryParams( + Mage::getStoreConfig(Mage_Shipping_Model_Shipping::XML_PATH_STORE_COUNTRY_ID, $this->getStore()) + ); + if (!$countryParams->getData()) { + $this->_errors[] = Mage::helper('usa')->__('Please, specify origin country'); + } + if (!empty($this->_errors)) { return $this->_showError(); } @@ -1277,8 +1305,12 @@ protected function _doRequest() $nodeCommodity = $xml->addChild('Commodity', '', ''); $nodeCommodity->addChild('CommodityCode', '1'); + $this->_checkDomesticStatus($rawRequest->getShipperAddressCountryCode(), + $rawRequest->getRecipientAddressCountryCode() + ); + /* Dutiable */ - if ($this->getConfigData('content_type') == self::DHL_CONTENT_TYPE_NON_DOC) { + if ($this->getConfigData('content_type') == self::DHL_CONTENT_TYPE_NON_DOC && !$this->_isDomestic) { $nodeDutiable = $xml->addChild('Dutiable', '', ''); $nodeDutiable->addChild('DeclaredValue', sprintf("%.2F", $rawRequest->getOrderShipment()->getOrder()->getSubtotal()) @@ -1678,4 +1710,26 @@ public function requestToShipment(Mage_Shipping_Model_Shipment_Request $request) return $response; } + + /** + * Check if shipping is domestic + * + * @param string $origCountryCode + * @param string $destCountryCode + * @return bool + */ + protected function _checkDomesticStatus($origCountryCode, $destCountryCode) + { + $this->_isDomestic = false; + + $origCountry = (string)$this->getCountryParams($origCountryCode)->name; + $destCountry = (string)$this->getCountryParams($destCountryCode)->name; + $isDomestic = (string)$this->getCountryParams($destCountryCode)->domestic; + + if ($origCountry == $destCountry && $isDomestic) { + $this->_isDomestic = true; + } + + return $this->_isDomestic; + } } diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php index afc97a8200..604f1fadb0 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php @@ -43,6 +43,20 @@ class Mage_Usa_Model_Shipping_Carrier_Fedex */ const CODE = 'fedex'; + /** + * Purpose of rate request + * + * @var string + */ + const RATE_REQUEST_GENERAL = 'general'; + + /** + * Purpose of rate request + * + * @var string + */ + const RATE_REQUEST_SMARTPOST = 'SMART_POST'; + /** * Code of the carrier * @@ -167,10 +181,9 @@ public function collectRates(Mage_Shipping_Model_Rate_Request $request) if (!$this->getConfigFlag($this->_activeFlag)) { return false; } - $this->setRequest($request); - $this->_result = $this->_getQuotes(); + $this->_getQuotes(); $this->_updateFreeMethodQuote($request); @@ -294,11 +307,12 @@ public function getVersionInfo() } /** - * Do remote request for and handle errors + * Forming request for rate estimation depending to the purpose * - * @return Mage_Shipping_Model_Rate_Result + * @param string $purpose + * @return array */ - protected function _getQuotes() + protected function _formRateRequest($purpose) { $r = $this->_rawRequest; $ratesRequest = array( @@ -356,15 +370,37 @@ protected function _getQuotes() 'Value' => (float)$r->getWeight(), 'Units' => 'LB' ), - 'InsuredValue' => array( - 'Amount' => $r->getValue(), - 'Currency' => $this->getCurrencyCode() - ), 'GroupPackageCount' => 1, ) ) ) ); + + if ($purpose == self::RATE_REQUEST_GENERAL) { + $ratesRequest['RequestedShipment']['RequestedPackageLineItems'][0]['InsuredValue'] = array( + 'Amount' => $r->getValue(), + 'Currency' => $this->getCurrencyCode() + ); + } else if ($purpose == self::RATE_REQUEST_SMARTPOST) { + $ratesRequest['RequestedShipment']['ServiceType'] = self::RATE_REQUEST_SMARTPOST; + $ratesRequest['RequestedShipment']['SmartPostDetail'] = array( + 'Indicia' => ((float)$r->getWeight() >= 1) ? 'PARCEL_SELECT' : 'PRESORTED_STANDARD', + 'HubId' => $this->getConfigData('smartpost_hubid') + ); + } + + return $ratesRequest; + } + + /** + * Makes remote request to the carrier and returns a response + * + * @param string $purpose + * @return mixed + */ + protected function _doRatesRequest($purpose) + { + $ratesRequest = $this->_formRateRequest($purpose); $requestString = serialize($ratesRequest); $response = $this->_getCachedQuotes($requestString); $debugData = array('request' => $ratesRequest); @@ -383,7 +419,33 @@ protected function _getQuotes() $debugData['result'] = $response; } $this->_debug($debugData); - return $this->_prepareRateResponse($response); + return $response; + } + + /** + * Do remote request for and handle errors + * + * @return Mage_Shipping_Model_Rate_Result + */ + protected function _getQuotes() + { + $this->_result = Mage::getModel('shipping/rate_result'); + // make separate request for Smart Post method + $allowedMethods = explode(',', $this->getConfigData('allowed_methods')); + if (in_array(self::RATE_REQUEST_SMARTPOST, $allowedMethods)) { + $response = $this->_doRatesRequest(self::RATE_REQUEST_SMARTPOST); + $preparedSmartpost = $this->_prepareRateResponse($response); + if (!$preparedSmartpost->getError()) { + $this->_result->append($preparedSmartpost); + } + } + // make general request for all methods + $response = $this->_doRatesRequest(self::RATE_REQUEST_GENERAL); + $preparedGeneral = $this->_prepareRateResponse($response); + if (!$preparedGeneral->getError() || ($this->_result->getError() && $preparedGeneral->getError())) { + $this->_result->append($preparedGeneral); + } + return $this->_result; } /** @@ -1208,7 +1270,7 @@ protected function _getAuthDetails() ), 'Version' => array( 'ServiceId' => 'ship', - 'Major' => '9', + 'Major' => '10', 'Intermediate' => '0', 'Minor' => '0' ) diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Mode.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Mode.php new file mode 100644 index 0000000000..ba786f9878 --- /dev/null +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Mode.php @@ -0,0 +1,44 @@ + + */ +class Mage_Usa_Model_Shipping_Carrier_Ups_Source_Mode +{ + public function toOptionArray() + { + return array( + array('value' => '1', 'label' => Mage::helper('usa')->__('Live')), + array('value' => '0', 'label' => Mage::helper('usa')->__('Development')), + ); + } +} diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps.php index 98c45df50a..a268101a10 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps.php @@ -648,6 +648,7 @@ public function getCode($type, $code='') 'Priority Mail International', 'First-Class Mail International Package', 'First-Class Mail International Large Envelope', + 'First-Class Mail International Parcel', ) ) ) @@ -706,6 +707,7 @@ public function getCode($type, $code='') 'Express Mail International', 'Priority Mail International', 'First-Class Mail International Package', + 'First-Class Mail International Parcel', ) ) ) @@ -728,6 +730,7 @@ public function getCode($type, $code='') 'Express Mail International', 'Priority Mail International', 'First-Class Mail International Package', + 'First-Class Mail International Parcel', ) ) ) @@ -1197,7 +1200,9 @@ protected function _getCountryName($countryId) */ protected function _filterServiceName($name) { - $name = (string)preg_replace(array('~<[^/!][^>]+>.*]+>~sU', '~\ + + + + + + + + + + + + + diff --git a/app/design/adminhtml/default/default/layout/api2.xml b/app/design/adminhtml/default/default/layout/api2.xml new file mode 100644 index 0000000000..ba5f3f5389 --- /dev/null +++ b/app/design/adminhtml/default/default/layout/api2.xml @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + api2_role_section_info + adminhtml.role.edit.tab.info + + + api2_role_section_resources + adminhtml.role.edit.tab.resources + + + + + + + + + 1 + + + + + + + + + + + + api2_role_section_info + adminhtml.role.edit.tab.info + + + api2_role_section_resources + adminhtml.role.edit.tab.resources + + + roleUsersGrid + adminhtml.role.edit.tab.users + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + + api2_roles_section + adminhtml.permissions.user.edit.tab.roles + roles_section + + + + + + + + + + + + + + + + + + + + api2_attribute_section_resources + api2.attribute.tab.resource + + + + + + + + + + + 1 + + + + + diff --git a/app/design/adminhtml/default/default/layout/oauth.xml b/app/design/adminhtml/default/default/layout/oauth.xml new file mode 100644 index 0000000000..652e9897ef --- /dev/null +++ b/app/design/adminhtml/default/default/layout/oauth.xml @@ -0,0 +1,169 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/design/adminhtml/default/default/template/api/roleinfo.phtml b/app/design/adminhtml/default/default/template/api/roleinfo.phtml index 053723aeba..f41a0001ba 100644 --- a/app/design/adminhtml/default/default/template/api/roleinfo.phtml +++ b/app/design/adminhtml/default/default/template/api/roleinfo.phtml @@ -23,11 +23,13 @@ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ +/** @var $this Mage_Adminhtml_Block_Api_Tab_Roleinfo */ + ?>
    - + - + @@ -62,7 +62,7 @@ - + getParentItem()): ?> @@ -355,7 +355,7 @@ getItemOptions()): ?>
    -
    htmlEscape($_option['label']) ?>
    +
    escapeHtml($_option['label']) ?>
    getPrintStatus()): ?> getFormatedOptionValue($_option) ?> class="truncated"> @@ -363,19 +363,19 @@
    -
    htmlEscape($_option['label']) ?>
    +
    escapeHtml($_option['label']) ?>
    -
    htmlEscape( (isset($_option['print_value']) ? $_option['print_value'] : $_option['value']) ) ?>
    +
    escapeHtml( (isset($_option['print_value']) ? $_option['print_value'] : $_option['value']) ) ?>
    - htmlEscape($_item->getDescription()) ?> + escapeHtml($_item->getDescription()) ?> helper('giftmessage/message')->getIsMessagesAvailable('order_item', $parentItem) && $parentItem->getGiftMessageId()): ?> __('Gift Message') ?> diff --git a/app/design/frontend/default/iphone/template/catalog/product/compare/list.phtml b/app/design/frontend/default/iphone/template/catalog/product/compare/list.phtml index 27def95c51..a143621fe0 100644 --- a/app/design/frontend/default/iphone/template/catalog/product/compare/list.phtml +++ b/app/design/frontend/default/iphone/template/catalog/product/compare/list.phtml @@ -63,7 +63,7 @@ helper('wishlist')->isAllow()) : ?> @@ -85,7 +85,7 @@ getPriceHtml($_item, true, '-compare-list-' . $_attribute->getCode()) ?> - <?php echo $this->htmlEscape($_item->getName()) ?> + <?php echo $this->escapeHtml($_item->getName()) ?>getProductAttributeValue($_item, $_attribute),0,10); @@ -116,7 +116,7 @@ helper('wishlist')->isAllow()) : ?> diff --git a/app/design/frontend/default/iphone/template/catalog/product/gallery.phtml b/app/design/frontend/default/iphone/template/catalog/product/gallery.phtml index 8c9a9a5da4..3abe86c1b7 100644 --- a/app/design/frontend/default/iphone/template/catalog/product/gallery.phtml +++ b/app/design/frontend/default/iphone/template/catalog/product/gallery.phtml @@ -37,11 +37,11 @@ -
    count() ?> @@ -174,25 +151,9 @@
    diff --git a/app/design/frontend/default/iphone/template/catalog/product/list/upsell.phtml b/app/design/frontend/default/iphone/template/catalog/product/list/upsell.phtml index 625ae23c42..2ee353c52a 100644 --- a/app/design/frontend/default/iphone/template/catalog/product/list/upsell.phtml +++ b/app/design/frontend/default/iphone/template/catalog/product/list/upsell.phtml @@ -37,9 +37,9 @@ getColumnCount();$_j++): ?> getIterableItem()): ?> ->
  • - -
    <?php echo $this->htmlEscape($_link->getName()) ?>
    -
    htmlEscape($_link->getName()) ?>
    +
    +
    <?php echo $this->escapeHtml($_link->getName()) ?>
    +
    escapeHtml($_link->getName()) ?>
    getPriceHtml($_link, true, '-upsell') ?>
    diff --git a/app/design/frontend/default/iphone/template/catalog/product/price.phtml b/app/design/frontend/default/iphone/template/catalog/product/price.phtml deleted file mode 100644 index b257084cb3..0000000000 --- a/app/design/frontend/default/iphone/template/catalog/product/price.phtml +++ /dev/null @@ -1,412 +0,0 @@ - - - -helper('core'); - $_weeeHelper = $this->helper('weee'); - $_taxHelper = $this->helper('tax'); - /* @var $_coreHelper Mage_Core_Helper_Data */ - /* @var $_weeeHelper Mage_Weee_Helper_Data */ - /* @var $_taxHelper Mage_Tax_Helper_Data */ - - $_product = $this->getProduct(); - $_id = $_product->getId(); - $_weeeSeparator = ''; - $_simplePricesTax = ($_taxHelper->displayPriceIncludingTax() || $_taxHelper->displayBothPrices()); - $_minimalPriceValue = $_product->getMinimalPrice(); - $_minimalPrice = $_taxHelper->getPrice($_product, $_minimalPriceValue, $_simplePricesTax); -?> - -isGrouped()): ?> - getAmountForDisplay($_product); ?> - typeOfDisplay($_product, array(1,2,4))): ?> - getAmount($_product); ?> - getProductWeeeAttributesForDisplay($_product); ?> - - -
    - getPrice($_product, $_product->getPrice()) ?> - getPrice($_product, $_product->getPrice(), $_simplePricesTax) ?> - getPrice($_product, $_product->getFinalPrice()) ?> - getPrice($_product, $_product->getFinalPrice(), true) ?> - getPriceDisplayType(); ?> - = $_price): ?> - displayBothPrices()): ?> - typeOfDisplay($_product, 0)): // including ?> - - helper('tax')->__('Excl. Tax:') ?> - - currency($_price + $_weeeTaxAmount, true, false) ?> - - - - helper('tax')->__('Incl. Tax:') ?> - - currency($_finalPriceInclTax + $_weeeTaxAmount, true, false) ?> - - - typeOfDisplay($_product, 1)): // incl. + weee ?> - - helper('tax')->__('Excl. Tax:') ?> - - currency($_price + $_weeeTaxAmount, true, false) ?> - - - - helper('tax')->__('Incl. Tax:') ?> - - currency($_finalPriceInclTax + $_weeeTaxAmount, true, false) ?> - - ( - - - getName(); ?>: currency($_weeeTaxAttribute->getAmount(), true, true); ?> - - - ) - - typeOfDisplay($_product, 4)): // incl. + weee ?> - - helper('tax')->__('Excl. Tax:') ?> - - currency($_price + $_weeeTaxAmount, true, false) ?> - - - - helper('tax')->__('Incl. Tax:') ?> - - currency($_finalPriceInclTax + $_weeeTaxAmount, true, false) ?> - - ( - - - getName(); ?>: currency($_weeeTaxAttribute->getAmount() + $_weeeTaxAttribute->getTaxAmount(), true, true); ?> - - - ) - - typeOfDisplay($_product, 2)): // excl. + weee + final ?> - - helper('tax')->__('Excl. Tax:') ?> - - currency($_price, true, false) ?> - - - - - getName(); ?>: currency($_weeeTaxAttribute->getAmount(), true, true); ?> - - - - helper('tax')->__('Incl. Tax:') ?> - - currency($_finalPriceInclTax + $_weeeTaxAmount, true, false) ?> - - - - - helper('tax')->__('Excl. Tax:') ?> - - currency($_price, true, false) ?> - - currency($_price, true, false) ?> - - currency($_finalPrice, true, false) ?> - - - - - helper('tax')->__('Incl. Tax:') ?> - - currency($_finalPriceInclTax, true, false) ?> - - - - - typeOfDisplay($_product, 0)): // including ?> - - currency($_price + $_weeeTaxAmount,true,true) ?> - - typeOfDisplay($_product, 1)): // incl. + weee ?> - - currency($_price + $_weeeTaxAmount,true,true) ?> - - ( - - - getName(); ?>: currency($_weeeTaxAttribute->getAmount(), true, true); ?> - - - ) - typeOfDisplay($_product, 4)): // incl. + weee ?> - - currency($_price + $_weeeTaxAmount,true,true) ?> - - ( - - - getName(); ?>: currency($_weeeTaxAttribute->getAmount() + $_weeeTaxAttribute->getTaxAmount(), true, true); ?> - - - ) - typeOfDisplay($_product, 2)): // excl. + weee + final ?> - currency($_price,true,true) ?>
    - - - getName(); ?>: currency($_weeeTaxAttribute->getAmount(), true, true); ?> - - - - currency($_price + $_weeeTaxAmount,true,true) ?> - - - - currency($_price,true,true) ?> - - - - - getOriginalAmount($_product); ?> - - typeOfDisplay($_product, 0)): // including ?> - displayBothPrices()): ?> -

    - __('Special Price:') ?> - - __('Excl. Tax:') ?> - - currency($_finalPrice + $_weeeTaxAmount, true, false) ?> - - - - __('Incl. Tax:') ?> - - currency($_finalPriceInclTax + $_weeeTaxAmount, true, false) ?> - - -

    - -

    - __('Special Price:') ?> - - currency($_finalPrice + $_weeeTaxAmount, true, false) ?> - -

    - -

    - __('Regular Price:') ?> - - currency($_regularPrice + $_originalWeeeTaxAmount, true, false) ?> - -

    - - typeOfDisplay($_product, 1)): // incl. + weee ?> -

    - __('Special Price:') ?> - - __('Excl. Tax:') ?> - - currency($_finalPrice + $_weeeTaxAmount, true, false) ?> - - - ( - - - getName(); ?>: currency($_weeeTaxAttribute->getAmount(), true, true); ?> - - - ) - - __('Incl. Tax:') ?> - - currency($_finalPriceInclTax + $_weeeTaxAmount, true, false) ?> - - -

    -

    - __('Regular Price:') ?> - - currency($_regularPrice + $_originalWeeeTaxAmount, true, false) ?> - -

    - typeOfDisplay($_product, 4)): // incl. + weee ?> -

    - __('Special Price:') ?> - - __('Excl. Tax:') ?> - - currency($_finalPrice + $_weeeTaxAmount, true, false) ?> - - - ( - - - getName(); ?>: currency($_weeeTaxAttribute->getAmount() + $_weeeTaxAttribute->getTaxAmount(), true, true); ?> - - - ) - - helper('tax')->__('Incl. Tax:') ?> - - currency($_finalPriceInclTax + $_weeeTaxAmount, true, false) ?> - - -

    -

    - __('Regular Price:') ?> - - currency($_regularPrice + $_originalWeeeTaxAmount, true, false) ?> - -

    - typeOfDisplay($_product, 2)): // excl. + weee + final ?> -

    - __('Special Price:') ?> - - __('Excl. Tax:') ?> - - currency($_finalPrice, true, false) ?> - - - - - getName(); ?>: currency($_weeeTaxAttribute->getAmount(), true, true); ?> - - - - helper('tax')->__('Incl. Tax:') ?> - - currency($_finalPriceInclTax + $_weeeTaxAmount, true, false) ?> - - -

    -

    - __('Regular Price:') ?> - - currency($_regularPrice, true, false) ?> - -

    - - displayBothPrices()): ?> -

    - __('Special Price:') ?> - - __('Excl. Tax:') ?> - - currency($_finalPrice, true, false) ?> - - - - helper('tax')->__('Incl. Tax:') ?> - - currency($_finalPriceInclTax, true, false) ?> - - -

    - -

    - __('Special Price:') ?> - - currency($_finalPrice, true, false) ?> - -

    - -

    - __('Regular Price:') ?> - - currency($_regularPrice, true, false) ?> - -

    - - - - - getDisplayMinimalPrice() && $_minimalPriceValue && $_minimalPriceValue < $_product->getFinalPrice()): ?> - - - typeOfDisplay($_product, array(0, 1, 4))): ?> - - - - getUseLinkForAsLowAs()):?> - - - - __('As low as:') ?> - - currency($_minimalPriceDisplayValue, true, false) ?> - - getUseLinkForAsLowAs()):?> - - - - getDisplayMinimalPrice() && $_minimalPrice && $_minimalPrice < $_finalPrice): */ ?> -
    - -isGrouped()): */ ?> - getPrice($_product, $_minimalPriceValue, $includingTax = null); - $_inclTax = $_taxHelper->getPrice($_product, $_minimalPriceValue, $includingTax = true); - ?> - getDisplayMinimalPrice() && $_minimalPriceValue): ?> -
    -

    - __('Starting at:') ?> - displayBothPrices()): ?> - - helper('tax')->__('Excl. Tax:') ?> - - currency($_exclTax, true, false) ?> - - - - helper('tax')->__('Incl. Tax:') ?> - - currency($_inclTax, true, false) ?> - - - - displayPriceIncludingTax()) { - $_showPrice = $_exclTax; - } - ?> - - currency($_showPrice, true, false) ?> - - -

    -
    - getDisplayMinimalPrice() && $_minimalPrice): */ ?> -isGrouped()): */ ?> diff --git a/app/design/frontend/default/iphone/template/catalog/product/view.phtml b/app/design/frontend/default/iphone/template/catalog/product/view.phtml index 1a13808fff..d26c70ac27 100644 --- a/app/design/frontend/default/iphone/template/catalog/product/view.phtml +++ b/app/design/frontend/default/iphone/template/catalog/product/view.phtml @@ -62,7 +62,7 @@ - isSaleable() && $this->hasOptions()):?> + isSaleable() && $this->hasOptions() && $this->getChildChildHtml('container1')):?> getChildChildHtml('container1', '', true, true) ?> hasOptions() && $_product->getTypeId() != Mage_Catalog_Model_Product_Type_Grouped::TYPE_CODE) :?> @@ -92,6 +92,7 @@ + getChildHtml('giftcard_form'); ?> isSaleable() && $this->hasOptions()):?> getChildChildHtml('container2', '', true, true) ?> @@ -118,12 +119,16 @@ } var e = null; try { - var originalImg = $$('.product-image-wrap .product-image img')[0]; - originalImg.up('.product-image-wrap').insert(originalImg.clone().addClassName('cloned')); - setTimeout(function () {$$('.cloned')[0].setStyle({'webkitTransform' : 'translate3d(' + (document.body.offsetWidth - 190) + 'px, -150px, 2px) scale(0) rotate(200deg)'});}, 1); - $$('.product-image-wrap .cloned')[0].observe('webkitTransitionEnd', function(e) { + if ( window.WebKitCSSMatrix ) { + var originalImg = $$('.product-image-wrap .product-image img')[0]; + originalImg.up('.product-image-wrap').insert(originalImg.clone().addClassName('cloned')); + setTimeout(function () {$$('.cloned')[0].setStyle({'webkitTransform' : 'translate3d(' + (document.body.offsetWidth - 190) + 'px, -150px, 2px) scale(0) rotate(200deg)'});}, 1); + $$('.product-image-wrap .cloned')[0].observe('webkitTransitionEnd', function(e) { + this.form.submit(); + }.bind(this)); + } else { this.form.submit(); - }.bind(this)); + } } catch (e) { } this.form.action = oldUrl; @@ -143,6 +148,13 @@ delete Validation.methods['required-entry']; delete Validation.methods['validate-one-required']; delete Validation.methods['validate-one-required-by-name']; + // Remove custom datetime validators + for (var methodName in Validation.methods) { + if (methodName.match(/^validate-datetime-.*/i)) { + delete Validation.methods[methodName]; + } + } + if (this.validator.validate()) { if (url) { this.form.action = url; diff --git a/app/design/frontend/default/iphone/template/catalog/product/view/addto.phtml b/app/design/frontend/default/iphone/template/catalog/product/view/addto.phtml index deb987f000..ade2b97026 100644 --- a/app/design/frontend/default/iphone/template/catalog/product/view/addto.phtml +++ b/app/design/frontend/default/iphone/template/catalog/product/view/addto.phtml @@ -29,7 +29,7 @@ helper('wishlist')->getAddUrl($_product); ?>
      helper('wishlist')->isAllow()) : ?> -
    • __('Add to Wishlist') ?>
    • +
    • __('Add to Wishlist') ?>
    • helper('catalog/product_compare')->getAddUrl($_product); diff --git a/app/design/frontend/default/iphone/template/catalog/product/view/addtocartbottom.phtml b/app/design/frontend/default/iphone/template/catalog/product/view/addtocartbottom.phtml new file mode 100644 index 0000000000..35565a8eab --- /dev/null +++ b/app/design/frontend/default/iphone/template/catalog/product/view/addtocartbottom.phtml @@ -0,0 +1,38 @@ + +getProduct(); ?> +__('Add to Cart'); ?> +isSaleable()): ?> +
      + isGrouped()): ?> + + + +
      + + getChildHtml('', true, true) ?> + diff --git a/app/design/frontend/default/iphone/template/catalog/product/view/addtowishlist.phtml b/app/design/frontend/default/iphone/template/catalog/product/view/addtowishlist.phtml index 4723d53d14..985b7dedd2 100644 --- a/app/design/frontend/default/iphone/template/catalog/product/view/addtowishlist.phtml +++ b/app/design/frontend/default/iphone/template/catalog/product/view/addtowishlist.phtml @@ -28,4 +28,4 @@ ?> getProduct(); ?> helper('wishlist')->getAddUrl($_product); ?> -__('Add to Wishlist') ?> +__('Add to Wishlist') ?> diff --git a/app/design/frontend/default/iphone/template/catalog/product/view/description.phtml b/app/design/frontend/default/iphone/template/catalog/product/view/description.phtml new file mode 100644 index 0000000000..8ca6a7ea11 --- /dev/null +++ b/app/design/frontend/default/iphone/template/catalog/product/view/description.phtml @@ -0,0 +1,39 @@ + +getProduct()->getDescription(); ?> + +

      __('Details') ?>

      +
      + helper('catalog/output')->productAttribute($this->getProduct(), $_description, 'description') ?> +
      + diff --git a/app/design/frontend/default/iphone/template/catalog/product/view/media.phtml b/app/design/frontend/default/iphone/template/catalog/product/view/media.phtml index 67df011c85..e8f0369e1b 100644 --- a/app/design/frontend/default/iphone/template/catalog/product/view/media.phtml +++ b/app/design/frontend/default/iphone/template/catalog/product/view/media.phtml @@ -41,13 +41,13 @@
      • getGalleryUrl($_image).'">'.$this->htmlEscape($this->getImageLabel()).''; + $_img = ''.$this->escapeHtml($this->getImageLabel()).''; echo $_helper->productAttribute($_product, $_img, 'image'); ?>
      • <?php echo $this->htmlEscape($_image->getLabel()) ?>
      • <?php echo $this->escapeHtml($_image->getLabel()) ?>
      diff --git a/app/design/frontend/default/iphone/template/catalog/product/view/options/wrapper.phtml b/app/design/frontend/default/iphone/template/catalog/product/view/options/wrapper.phtml new file mode 100644 index 0000000000..b1271eb641 --- /dev/null +++ b/app/design/frontend/default/iphone/template/catalog/product/view/options/wrapper.phtml @@ -0,0 +1,29 @@ + +
      + getChildHtml('', true, true);?> +
      diff --git a/app/design/frontend/default/iphone/template/catalog/product/view/options/wrapper/bottom.phtml b/app/design/frontend/default/iphone/template/catalog/product/view/options/wrapper/bottom.phtml new file mode 100644 index 0000000000..af832f2e34 --- /dev/null +++ b/app/design/frontend/default/iphone/template/catalog/product/view/options/wrapper/bottom.phtml @@ -0,0 +1,32 @@ + +
      + hasRequiredOptions()):?> +

      __('* Required Fields') ?>

      + + getChildHtml('', true, true);?> +
      diff --git a/app/design/frontend/default/iphone/template/catalog/product/view/type/grouped_grid.phtml b/app/design/frontend/default/iphone/template/catalog/product/view/type/grouped_grid.phtml index 2092560c92..680da900b5 100644 --- a/app/design/frontend/default/iphone/template/catalog/product/view/type/grouped_grid.phtml +++ b/app/design/frontend/default/iphone/template/catalog/product/view/type/grouped_grid.phtml @@ -47,7 +47,7 @@ $this->setPreconfiguredValue(); ?> helper('tax')->getPrice($_item, $_item->getFinalPrice(), true) ?>
  • - + getCanShowProductPrice($_product)): ?> - helper('tax')->displayCartBothPrices() ? 2 : 1); ?> - - helper('tax')->displayCartBothPrices()): ?> - - - - - - - - getItems() as $_item): ?> getItemHtml($_item) ?> @@ -72,7 +61,15 @@

    getRoleId() > 0 ) ? ($this->__('Edit Role') . " '{$this->getRoleInfo()->getRoleName()}'") : $this->__('Add New Role') ?>

    getRoleId() > 0 ) ? ($this->__('Edit Role') . " '{$this->escapeHtml($this->getRoleInfo()->getRoleName())}'") : $this->__('Add New Role') ?>

    getBackButtonHtml() ?> getResetButtonHtml() ?> diff --git a/app/design/adminhtml/default/default/template/api2/attribute/buttons.phtml b/app/design/adminhtml/default/default/template/api2/attribute/buttons.phtml new file mode 100644 index 0000000000..94cd70bc9a --- /dev/null +++ b/app/design/adminhtml/default/default/template/api2/attribute/buttons.phtml @@ -0,0 +1,53 @@ + +
    + + + + + +
    +

    + getCaption() ?> +

    +
    + getBackButtonHtml() ?> + getResetButtonHtml() ?> + getDeleteButtonHtml() ?> + getSaveButtonHtml() ?> +
    +
    +
    + getBlockHtml('formkey')?> +
    + diff --git a/app/design/adminhtml/default/default/template/api2/attribute/resource.phtml b/app/design/adminhtml/default/default/template/api2/attribute/resource.phtml new file mode 100644 index 0000000000..e875cdf058 --- /dev/null +++ b/app/design/adminhtml/default/default/template/api2/attribute/resource.phtml @@ -0,0 +1,158 @@ + + + + +getChildHtml(); ?> + +
    +
    +

    __('User Type Resources') ?>

    +
    + +
    + + + + + + + + +
    +
    +
    + hasEntityOnlyAttributes()): ?> +
    + * This attribute data will be returned for a single resource only. + +
    + +
    +
    + + diff --git a/app/design/adminhtml/default/default/template/api2/permissions/user/edit/tab/roles/js.phtml b/app/design/adminhtml/default/default/template/api2/permissions/user/edit/tab/roles/js.phtml new file mode 100644 index 0000000000..a6b6a66dd6 --- /dev/null +++ b/app/design/adminhtml/default/default/template/api2/permissions/user/edit/tab/roles/js.phtml @@ -0,0 +1,59 @@ + + + diff --git a/app/design/adminhtml/default/default/template/api2/role/buttons.phtml b/app/design/adminhtml/default/default/template/api2/role/buttons.phtml new file mode 100644 index 0000000000..32cbd38ae8 --- /dev/null +++ b/app/design/adminhtml/default/default/template/api2/role/buttons.phtml @@ -0,0 +1,52 @@ + + +
    + + + + + +
    +

    + getCaption() ?> +

    +
    + getBackButtonHtml() ?> + getResetButtonHtml() ?> + getDeleteButtonHtml() ?> + getSaveButtonHtml() ?> +
    +
    +
    + getBlockHtml('formkey')?> +
    + diff --git a/app/design/adminhtml/default/default/template/api2/role/users_grid_js.phtml b/app/design/adminhtml/default/default/template/api2/role/users_grid_js.phtml new file mode 100644 index 0000000000..43f18ea8d2 --- /dev/null +++ b/app/design/adminhtml/default/default/template/api2/role/users_grid_js.phtml @@ -0,0 +1,122 @@ + + diff --git a/app/design/adminhtml/default/default/template/captcha/zend.phtml b/app/design/adminhtml/default/default/template/captcha/zend.phtml index c826680ebf..76cbb40d12 100644 --- a/app/design/adminhtml/default/default/template/captcha/zend.phtml +++ b/app/design/adminhtml/default/default/template/captcha/zend.phtml @@ -45,7 +45,6 @@ + + + +
    + + diff --git a/app/design/adminhtml/default/default/template/oauth/authorize/head-simple.phtml b/app/design/adminhtml/default/default/template/oauth/authorize/head-simple.phtml new file mode 100644 index 0000000000..c6a3688b3b --- /dev/null +++ b/app/design/adminhtml/default/default/template/oauth/authorize/head-simple.phtml @@ -0,0 +1,50 @@ + + +<?php echo htmlspecialchars(html_entity_decode($this->getTitle())) ?> + + + + + +getChildHtml() ?> diff --git a/app/design/adminhtml/default/default/template/oauth/authorize/reject-simple.phtml b/app/design/adminhtml/default/default/template/oauth/authorize/reject-simple.phtml new file mode 100644 index 0000000000..35c74574ed --- /dev/null +++ b/app/design/adminhtml/default/default/template/oauth/authorize/reject-simple.phtml @@ -0,0 +1,48 @@ + + diff --git a/app/design/adminhtml/default/default/template/oauth/authorize/reject.phtml b/app/design/adminhtml/default/default/template/oauth/authorize/reject.phtml new file mode 100644 index 0000000000..3dc35b239f --- /dev/null +++ b/app/design/adminhtml/default/default/template/oauth/authorize/reject.phtml @@ -0,0 +1,44 @@ + + + + diff --git a/app/design/adminhtml/default/default/template/oauth/authorize/simple-css.phtml b/app/design/adminhtml/default/default/template/oauth/authorize/simple-css.phtml new file mode 100644 index 0000000000..61dfcb2647 --- /dev/null +++ b/app/design/adminhtml/default/default/template/oauth/authorize/simple-css.phtml @@ -0,0 +1,251 @@ + +getSkinUrl(null, array('_area' => 'adminhtml', '_package' => 'default')); +?> + diff --git a/app/design/adminhtml/default/default/template/page/menu.phtml b/app/design/adminhtml/default/default/template/page/menu.phtml index fc99e8cc5c..6d0476d65e 100644 --- a/app/design/adminhtml/default/default/template/page/menu.phtml +++ b/app/design/adminhtml/default/default/template/page/menu.phtml @@ -25,25 +25,12 @@ */ ?> + @@ -93,7 +97,7 @@
    - +
    @@ -107,13 +111,13 @@
    - +
    - +
    @@ -122,7 +126,7 @@
  • - getAddress()->getSameAsShipping()):?>checked="checked"/> + getAddress()->getSameAsBilling()):?>checked="checked"/>
    @@ -135,7 +139,7 @@ diff --git a/app/design/frontend/base/default/template/paypal/express/review/shipping/method.phtml b/app/design/frontend/base/default/template/paypal/express/review/shipping/method.phtml index 90ccee3391..ef2044928b 100644 --- a/app/design/frontend/base/default/template/paypal/express/review/shipping/method.phtml +++ b/app/design/frontend/base/default/template/paypal/express/review/shipping/method.phtml @@ -25,29 +25,29 @@ */ /** @var $this Mage_Paypal_Block_Express_Review */ ?> +
    getCanEditShippingMethod() || !$this->getCurrentShippingRate()):?> - getShippingRateGroups()):?> - getCurrentShippingRate(); ?> -
    - + + + + $rates):?> + + + - - -
    - -

    __('Sorry, no quotes are available for this order at this time.') ?>

    - + + + + +

    __('Sorry, no quotes are available for this order at this time.') ?>

    +

    renderShippingRateOption($this->getCurrentShippingRate())?>

    +
    + diff --git a/app/design/frontend/base/default/template/persistent/checkout/onepage/billing.phtml b/app/design/frontend/base/default/template/persistent/checkout/onepage/billing.phtml index c7be928bf0..da76c684f6 100644 --- a/app/design/frontend/base/default/template/persistent/checkout/onepage/billing.phtml +++ b/app/design/frontend/base/default/template/persistent/checkout/onepage/billing.phtml @@ -45,42 +45,46 @@
    - +
    isCustomerLoggedIn()): ?>
    - +
    - +
  • + helper('customer/address')->getAttributeValidationClass('street'); ?>
  • - +
  • - helper('customer/address')->getStreetLines(); $_i<=$_n; $_i++): ?> + + helper('customer/address')->getStreetLines(); $_i <= $_n; $_i++): ?>
  • - +
  • - + + helper('customer/address')->isVatAttributeVisible()) : ?>
  • - +
  • +
  • - +
    @@ -94,7 +98,7 @@ $('billing:region_id').setAttribute('defaultValue', "getAddress()->getRegionId() ?>"); //]]> - +
  • @@ -102,7 +106,7 @@
    - +
    @@ -116,13 +120,13 @@
    - +
    - +
    @@ -209,12 +213,11 @@ if ($('onepage-guest-register-button')) { Event.observe($('onepage-guest-register-button'), 'click', function(event) { var billingRememberMe = $('co-billing-form').select('#remember-me-box'); - if(billingRememberMe.length > 0) { - billingRememberMe = $(billingRememberMe[0].parentNode); + if (billingRememberMe.length > 0) { if ($('login:guest') && $('login:guest').checked) { - billingRememberMe.hide(); + billingRememberMe[0].hide(); } else if ($('login:register') && ($('login:register').checked || $('login:register').type == 'hidden')) { - billingRememberMe.show(); + billingRememberMe[0].show(); } } }); diff --git a/app/design/frontend/base/default/template/persistent/customer/form/register.phtml b/app/design/frontend/base/default/template/persistent/customer/form/register.phtml index 91d23b4148..cebc4ac035 100644 --- a/app/design/frontend/base/default/template/persistent/customer/form/register.phtml +++ b/app/design/frontend/base/default/template/persistent/customer/form/register.phtml @@ -50,7 +50,7 @@
  • - +
  • isNewsletterEnabled()): ?> @@ -84,34 +84,36 @@
    - +
    - +
    + helper('customer/address')->getAttributeValidationClass('street'); ?>
  • - +
  • - helper('customer/address')->getStreetLines(); $_i<=$_n; $_i++): ?> + + helper('customer/address')->getStreetLines(); $_i <= $_n; $_i++): ?>
  • - +
  • - +
  • - +
    @@ -125,7 +127,7 @@ $('region_id').setAttribute('defaultValue', "getFormData()->getRegionId() ?>"); //]]> - +
  • @@ -133,7 +135,7 @@
    - +
    diff --git a/app/design/frontend/base/default/template/persistent/remember_me.phtml b/app/design/frontend/base/default/template/persistent/remember_me.phtml index 5b4c846e99..5c731f4375 100644 --- a/app/design/frontend/base/default/template/persistent/remember_me.phtml +++ b/app/design/frontend/base/default/template/persistent/remember_me.phtml @@ -28,8 +28,8 @@ /** * Customer "Remember Me" template * + * @var $this Mage_Persistent_Block_Form_Remember */ -/** @var $this Mage_Persistent_Block_Form_Remember */ ?>
  • getRandomString(10); ?> diff --git a/app/design/frontend/base/default/template/wishlist/render/item/price_msrp_item.phtml b/app/design/frontend/base/default/template/wishlist/render/item/price_msrp_item.phtml index 456ad21f47..6796894c68 100644 --- a/app/design/frontend/base/default/template/wishlist/render/item/price_msrp_item.phtml +++ b/app/design/frontend/base/default/template/wishlist/render/item/price_msrp_item.phtml @@ -85,7 +85,7 @@ "getName() ?>", $(""), '', - "getAddToCartUrl() ?>" + "isSalable() ? $_product->getAddToCartUrl() : '' ?>" ); diff --git a/app/design/frontend/default/iphone/layout/bundle.xml b/app/design/frontend/default/iphone/layout/bundle.xml new file mode 100644 index 0000000000..ff56e92fcb --- /dev/null +++ b/app/design/frontend/default/iphone/layout/bundle.xml @@ -0,0 +1,386 @@ + + + + + + + + + bundlebundle/catalog_product_price + + + + + + bundlebundle/catalog_product_price + + + + + + bundlebundle/catalog_product_price + + + + + + bundlebundle/catalog_product_price + + + + + + bundlebundle/catalog_product_price + + + + + + bundlebundle/catalog_product_price + + + + + + bundlebundle/catalog_product_price + + + + + + bundlebundle/catalog_product_price + + + + + + bundlebundle/checkout_cart_item_renderer + + + bundlebundle/catalog_product_price + + + bundlebundle/catalog_product_price + + + + + + bundlebundle/catalog_product_configuration + + + + + + bundlebundle/catalog_product_price + + + + + + + + + bundlebundle/catalog_product_price + bundle4 + + + + + + + + bundlebundle/checkout_cart_item_renderer + + + + + + + + bundlebundle/checkout_cart_item_renderer + + + bundlebundle/catalog_product_price + + + + + + + + bundlebundle/checkout_cart_item_renderer + + + + + + bundlebundle/checkout_cart_item_renderer + + + + + + bundlebundle/checkout_cart_item_renderer + + + bundlebundle/checkout_cart_item_renderer + + + + + + bundlebundle/checkout_cart_item_renderer + + + + + + bundlebundle/checkout_cart_item_renderer + + + + + bundlebundle/checkout_cart_item_renderer + + + + + + bundlebundle/checkout_cart_item_renderer + + + + + bundlebundle/checkout_cart_item_renderer + + + + + + + + + skin_jsjs/bundle.js + + + + bundlebundle/catalog_product_price + + catalog/product/price_msrp_item.phtml + + + + + + selectbundle/catalog_product_view_type_bundle_option_select + multibundle/catalog_product_view_type_bundle_option_multi + radiobundle/catalog_product_view_type_bundle_option_radio + checkboxbundle/catalog_product_view_type_bundle_option_checkbox + + product.info.bundle.options + + + + + + + + bundlebundle/catalog_product_price + + + + + + bundlebundle/sales_order_items_renderer + + + + + + bundlebundle/sales_order_items_renderer + + + + + + bundlebundle/sales_order_items_renderer + + + + + + bundlebundle/sales_order_items_renderer + + + + + + + + bundlebundle/sales_order_items_renderer + + + + + + bundlebundle/sales_order_items_renderer + + + + + + bundlebundle/sales_order_items_renderer + + + + + + bundlebundle/sales_order_items_renderer + + + + + + + bundlebundle/sales_order_items_renderer + + + + + + bundlebundle/sales_order_items_renderer + + + + + + bundlebundle/sales_order_items_renderer + + + + + + bundlebundle/sales_order_items_renderer + + + + + + bundlebundle/sales_order_items_renderer + + + + + + bundlebundle/sales_order_items_renderer + + + + + + bundlebundle/sales_order_items_renderer + + + + + + bundlebundle/sales_order_items_renderer + + + + + + + bundlebundle/sales_order_items_renderer + + + + + + bundlebundle/sales_order_items_renderer + + + + + + + bundlebundle/sales_order_items_renderer + + + + + + bundlebundle/sales_order_items_renderer + + + + + + + bundlebundle/catalog_product_price + + + + + bundlebundle/catalog_product_price + + + + + bundlebundle/catalog_product_price + + + diff --git a/app/design/frontend/default/iphone/layout/catalog.xml b/app/design/frontend/default/iphone/layout/catalog.xml index 656f3473c2..31326b28b9 100644 --- a/app/design/frontend/default/iphone/layout/catalog.xml +++ b/app/design/frontend/default/iphone/layout/catalog.xml @@ -44,6 +44,9 @@ Default layout, loads most of the pages + + + @@ -65,11 +68,11 @@ Default layout, loads most of the pages - + - + @@ -220,6 +223,7 @@ Product view + @@ -240,7 +244,7 @@ Product view product.tierprices - product.info.addtocart + product.info.addtocart.bottom product.info.addto diff --git a/app/design/frontend/default/iphone/layout/checkout.xml b/app/design/frontend/default/iphone/layout/checkout.xml index bb723a1556..941e3cc532 100644 --- a/app/design/frontend/default/iphone/layout/checkout.xml +++ b/app/design/frontend/default/iphone/layout/checkout.xml @@ -322,6 +322,14 @@ One page checkout main layout 1 + + + mage/captcha.js + + user_login + 230 + 50 + @@ -347,12 +355,6 @@ One page checkout progress block - - - - - - - + + + + mage/captcha.js + + user_forgotpassword + 230 + 50 + + @@ -198,18 +224,12 @@ Customer account pages, rendered for all tabs in dashboard - + accountcustomer/account/ account_editcustomer/account/edit/ address_bookcustomer/address/ - - simplecheckout/cart_item_renderer - groupedcheckout/cart_item_renderer_grouped - configurablecheckout/cart_item_renderer_configurable - - diff --git a/app/design/frontend/default/iphone/layout/page.xml b/app/design/frontend/default/iphone/layout/page.xml index e5a957550a..5dceaacc5b 100644 --- a/app/design/frontend/default/iphone/layout/page.xml +++ b/app/design/frontend/default/iphone/layout/page.xml @@ -49,6 +49,7 @@ Default layout, loads most of the pages skin_jsjs/iphone.js skin_jsjs/dnd.js + skin_jsjs/modernizr.js @@ -65,7 +66,6 @@ Default layout, loads most of the pages - diff --git a/app/design/frontend/default/iphone/layout/persistent.xml b/app/design/frontend/default/iphone/layout/persistent.xml index 427223b3a0..2f8403aaba 100644 --- a/app/design/frontend/default/iphone/layout/persistent.xml +++ b/app/design/frontend/default/iphone/layout/persistent.xml @@ -38,6 +38,14 @@ + + + mage/captcha.js + + user_login + 230 + 50 + @@ -46,6 +54,14 @@ + + + mage/captcha.js + + user_create + 230 + 50 + @@ -53,6 +69,14 @@ + + + mage/captcha.js + + user_login + 230 + 50 + diff --git a/app/design/frontend/default/iphone/layout/sales/billing_agreement.xml b/app/design/frontend/default/iphone/layout/sales/billing_agreement.xml new file mode 100644 index 0000000000..2e0f5efbd9 --- /dev/null +++ b/app/design/frontend/default/iphone/layout/sales/billing_agreement.xml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + billing_agreementssales/billing_agreement/ + + + diff --git a/app/design/frontend/default/iphone/layout/sales/recurring_profile.xml b/app/design/frontend/default/iphone/layout/sales/recurring_profile.xml new file mode 100644 index 0000000000..c4adba0bc9 --- /dev/null +++ b/app/design/frontend/default/iphone/layout/sales/recurring_profile.xml @@ -0,0 +1,171 @@ + + + + + + recurring_profilessales/recurring_profile/ + + + + + + + + + + + + + There are no recurring profiles yet. + recurring_profile_list_view + + + + + + + + + + + + + 1 + + info_tabs + Profile Information + view + + + + info_tabs + Related Orders + orders + + + + + + + + + + + 1 + + + + + info_blocks_row_1 + 1 + Reference + + + + info_blocks_row_1 + 2 + Purchased Item + + + + info_blocks_row_2 + 1 + Profile Schedule + + + + info_blocks_row_2 + 2 + Profile Payments + + + + info_blocks_row_3 + 1 + Billing Address + + + shipping + + info_blocks_row_3 + 2 + Shipping Address + + + + + + + + + + + 1 + + + + + Orders Based on This Profile + There are no orders yet. + info-box + border:0 + + + + + + diff --git a/app/design/frontend/default/iphone/template/bundle/catalog/product/view/type/bundle.phtml b/app/design/frontend/default/iphone/template/bundle/catalog/product/view/type/bundle.phtml new file mode 100644 index 0000000000..e782ad5d27 --- /dev/null +++ b/app/design/frontend/default/iphone/template/bundle/catalog/product/view/type/bundle.phtml @@ -0,0 +1,45 @@ + +getProduct() ?> + +isSaleable()): ?> + + +isAvailable()): ?> +

    helper('catalog')->__('Availability:') ?> helper('catalog')->__('In stock') ?>

    + +

    helper('catalog')->__('Availability:') ?> helper('catalog')->__('Out of stock') ?>

    + +
    + getPriceHtml($_product) ?> +
    +getChildHtml('bundle_prices') ?> diff --git a/app/design/frontend/default/iphone/template/bundle/sales/order/items/renderer.phtml b/app/design/frontend/default/iphone/template/bundle/sales/order/items/renderer.phtml index 5a71eae303..9dfa291f2d 100644 --- a/app/design/frontend/default/iphone/template/bundle/sales/order/items/renderer.phtml +++ b/app/design/frontend/default/iphone/template/bundle/sales/order/items/renderer.phtml @@ -52,7 +52,7 @@ getParentItem()): ?>
  • __('Product Name') ?>

    htmlEscape($_item->getName()) ?>

    escapeHtml($_item->getName()) ?>

    __('SKU') ?>htmlEscape(Mage::helper('core/string')->splitInjection($_item->getSku())) ?>escapeHtml(Mage::helper('core/string')->splitInjection($_item->getSku())) ?>
    htmlEscape($_item->getName()) ?>escapeHtml($_item->getName()) ?> getCanShowProductPrice($_item)): ?> diff --git a/app/design/frontend/default/iphone/template/checkout/cart.phtml b/app/design/frontend/default/iphone/template/checkout/cart.phtml index 505f53678f..48afcefef6 100644 --- a/app/design/frontend/default/iphone/template/checkout/cart.phtml +++ b/app/design/frontend/default/iphone/template/checkout/cart.phtml @@ -53,17 +53,6 @@
    helper('tax')->getIncExcTaxLabel(false) ?>helper('tax')->getIncExcTaxLabel(true) ?>helper('tax')->getIncExcTaxLabel(false) ?>helper('tax')->getIncExcTaxLabel(true) ?>
    - getChildHtml('coupon') ?> + + +
    + getChildHtml('coupon') ?> + getChildHtml('giftcards') ?> +
    +
    hasProductUrl()):?><?php echo $this->htmlEscape($this->getProductName()) ?>hasProductUrl()):?>hasProductUrl()):?><?php echo $this->escapeHtml($this->getProductName()) ?>hasProductUrl()):?>

    hasProductUrl()):?> - htmlEscape($this->getProductName()) ?> + escapeHtml($this->getProductName()) ?> - htmlEscape($this->getProductName()) ?> + escapeHtml($this->getProductName()) ?>

    getOptionList()):?>
    getFormatedOptionValue($_option) ?> -
    htmlEscape($_option['label']) ?>
    +
    escapeHtml($_option['label']) ?>
    class="truncated">
    -
    htmlEscape($_option['label']) ?>
    +
    escapeHtml($_option['label']) ?>
    @@ -62,50 +62,8 @@ getProductAdditionalInformationBlock()):?> setItem($_item)->toHtml() ?> - helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()): ?> - typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - - - - - typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - helper('checkout')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?> - - helper('checkout')->formatPrice($_item->getCalculationPrice()) ?> - - - getApplied($_item)): ?> - - typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> -
    - __('Total'); ?>: helper('checkout')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?> -
    - - - -
    helper('tax')->displayCartBothPrices()): ?> colspan="2"> + __('See price before order confirmation.'); ?> getId(); ?> @@ -114,65 +72,111 @@ Catalog.Map.addHelpLink($(''), "__("What's this?") ?>"); - - helper('checkout')->getPriceInclTax($_item); ?> - typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - - - - typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - helper('checkout')->formatPrice($_incl+$_item->getWeeeTaxAppliedAmount()); ?> - - helper('checkout')->formatPrice($_incl-$_item->getWeeeTaxDisposition()) ?> - + helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()): ?> + helper('tax')->displayCartBothPrices()): ?> + helper('tax')->getIncExcText(false) ?> + + typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + + + + + typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + helper('checkout')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?> + + helper('checkout')->formatPrice($_item->getCalculationPrice()) ?> + + + + getApplied($_item)): ?> + + typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> +
    + __('Total'); ?>: helper('checkout')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?> +
    + + -
    - getApplied($_item)): ?> + - - typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> -
    - __('Total incl. tax'); ?>: helper('checkout')->formatPrice($_incl+$_item->getWeeeTaxAppliedAmount()); ?> -
    + typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + helper('checkout')->formatPrice($_incl+$_item->getWeeeTaxAppliedAmount()); ?> + + helper('checkout')->formatPrice($_incl-$_item->getWeeeTaxDisposition()) ?> + + +
    + getApplied($_item)): ?> + + + + typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> +
    + __('Total incl. tax'); ?>: helper('checkout')->formatPrice($_incl+$_item->getWeeeTaxAppliedAmount()); ?> +
    + + - -
    __('Qty'); ?> - typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - - - + + helper('tax')->displayCartBothPrices()): ?> + helper('tax')->getIncExcText(false) ?> + helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()): ?> + typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + + + + + -- @@ -183,78 +187,81 @@ - - getApplied($_item)): ?> + + getApplied($_item)): ?> - - typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> -
    - __('Total'); ?>: helper('checkout')->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?> -
    -
    - helper('checkout')->getSubtotalInclTax($_item); ?> - typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - - - - - - -- + helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()): ?> + helper('tax')->displayCartBothPrices()): ?> + helper('tax')->getIncExcText(true) ?> + + helper('checkout')->getSubtotalInclTax($_item); ?> + typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + - typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - helper('checkout')->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?> - - helper('checkout')->formatPrice($_incl-$_item->getWeeeTaxRowDisposition()) ?> - + - - getApplied($_item)): ?> - + - typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> -
    - __('Total incl. tax'); ?>: helper('checkout')->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?> + getApplied($_item)): ?> + + + typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> +
    + __('Total incl. tax'); ?>: helper('checkout')->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?> +
    +
    <?php echo $this->__('Remove item')?>
    helper('tax')->getIncExcTaxLabel(false) ?>helper('tax')->getIncExcTaxLabel(true) ?>helper('tax')->getIncExcTaxLabel(false) ?>helper('tax')->getIncExcTaxLabel(true) ?>
    - getChildHtml('coupon') ?> + + +
    + getChildHtml('coupon') ?> + getChildHtml('giftcards') ?> +
    +

    escapeHtml($this->getProductName()) ?>

    + getOptionList()):?> +
    + + getFormatedOptionValue($_option) ?> +
    escapeHtml($_option['label']) ?>
    + class="truncated"> + +
    +
    +
    escapeHtml($_option['label']) ?>
    +
    +
    +
    + + + +
    + + getProductAdditionalInformationBlock()):?> + setItem($_item)->toHtml() ?> + +
    + helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()): ?> + typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + + + + + + typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + helper('checkout')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?> + + helper('checkout')->formatPrice($_item->getCalculationPrice()) ?> + + + + + + getApplied($_item)): ?> + + + + typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> +
    + __('Total'); ?>:
    helper('checkout')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?>
    +
    + + + + helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()): ?> + helper('tax')->displayCartBothPrices()): ?> + helper('tax')->getIncExcText(true) ?> + + helper('checkout')->getPriceInclTax($_item); ?> + typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + + + + + + typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + helper('checkout')->formatPrice($_incl+$_item->getWeeeTaxAppliedAmount()); ?> + + helper('checkout')->formatPrice($_incl-$_item->getWeeeTaxDisposition()) ?> + + + + getApplied($_item)): ?> + + + + typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> +
    + __('Total incl. tax'); ?>:
    helper('checkout')->formatPrice($_incl+$_item->getWeeeTaxAppliedAmount()); ?>
    +
    + + +
    getQty() ?> + helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()): ?> + typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + + + + + + typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + helper('checkout')->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?> + + helper('checkout')->formatPrice($_item->getRowTotal()) ?> + + + + getApplied($_item)): ?> + + + + typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> +
    + __('Total'); ?>:
    helper('checkout')->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?>
    +
    + + + + helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()): ?> + helper('tax')->displayCartBothPrices()): ?> + helper('tax')->getIncExcText(true) ?> + + helper('checkout')->getSubtotalInclTax($_item); ?> + typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + + + + + + typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + helper('checkout')->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?> + + helper('checkout')->formatPrice($_incl-$_item->getWeeeTaxRowDisposition()) ?> + + + + + + getApplied($_item)): ?> + + + + typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> +
    + __('Total incl. tax'); ?>:
    helper('checkout')->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?>
    +
    + + +
    + helper('sales')->__('Your credit card will be charged for') ?> + + displayBaseGrandtotal() ?> +
    __('Close') ?>
    -
    __('From:') ?> htmlEscape($_giftMessage->getRecipient()) ?>
    -
    __('To:') ?> htmlEscape($_giftMessage->getSender()) ?>
    +
    __('From:') ?> escapeHtml($_giftMessage->getRecipient()) ?>
    +
    __('To:') ?> escapeHtml($_giftMessage->getSender()) ?>
    helper('giftmessage/message')->getEscapedGiftMessage($_item) ?>
    __('Tracking Number:'); ?>escapeHtml($track->getTracking()); ?>getTracking(); ?>
    __('Carrier:'); ?>escapeHtml($track->getCarrierTitle()); ?>getCarrierTitle(); ?>
    __('Track:'); ?>escapeHtml($track->getUrl()); ?>getUrl(); ?>
    @@ -53,11 +53,16 @@ -
    diff --git a/downloader/template/footer.phtml b/downloader/template/footer.phtml index 248c39ef46..372e7e15cf 100755 --- a/downloader/template/footer.phtml +++ b/downloader/template/footer.phtml @@ -33,7 +33,7 @@ - Magento is a trademark of Magento, Inc. Copyright © 2012 Magento Inc. + Magento is a trademark of Magento, Inc. Copyright © 2010 Magento Inc.

    diff --git a/errors/design.xml b/errors/design.xml index 0bb645d8ad..70b7f11c8c 100644 --- a/errors/design.xml +++ b/errors/design.xml @@ -20,11 +20,11 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage - * @package errors + * @package Errors * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ --> default - \ No newline at end of file + diff --git a/js/mage/adminhtml/product/composite/configure.js b/js/mage/adminhtml/product/composite/configure.js index f3d245fc96..5de34ff9c7 100644 --- a/js/mage/adminhtml/product/composite/configure.js +++ b/js/mage/adminhtml/product/composite/configure.js @@ -585,7 +585,7 @@ ProductConfigure.prototype = { var patternFlat = null; var replacement = null; var replacementFlat = null - var scopeArr = blockItem.id.match(/.*\[\w+\]\[(\w+)\]$/); + var scopeArr = blockItem.id.match(/.*\[\w+\]\[([^\]\s]+)\]$/); var itemId = scopeArr[1]; if (method == 'current_confirmed_to_form') { pattern = RegExp('(\\w+)(\\[?)'); @@ -718,7 +718,7 @@ ProductConfigure.prototype = { this.blockFormConfirmed.update(); this.blockConfirmed.childElements().each(function(blockItem) { - var scopeArr = blockItem.id.match(/.*\[(\w+)\]\[(\w+)\]$/); + var scopeArr = blockItem.id.match(/.*\[(\w+)\]\[([^\]\s]+)\]$/); var listType = scopeArr[1]; var itemId = scopeArr[2]; if (allowedListTypes[listType] && (!this.itemsFilter[listType] @@ -731,7 +731,7 @@ ProductConfigure.prototype = { case 'form_confirmed_to_confirmed': var listInfo = this.listTypes[this.current.listType]; this.blockFormConfirmed.childElements().each(function(blockItem) { - var scopeArr = blockItem.id.match(/.*\[(\w+)\]\[(\w+)\]$/); + var scopeArr = blockItem.id.match(/.*\[(\w+)\]\[([^\]\s]+)\]$/); var listType = scopeArr[1]; _renameFields(method, blockItem, listInfo.complexTypes ? listType : null); this.blockConfirmed.insert(blockItem); diff --git a/js/mage/adminhtml/variables.js b/js/mage/adminhtml/variables.js index cf9ffd27bd..15f8e49ea8 100644 --- a/js/mage/adminhtml/variables.js +++ b/js/mage/adminhtml/variables.js @@ -106,7 +106,7 @@ var Variables = { }, prepareVariableRow: function(varValue, varLabel) { var value = (varValue).replace(/"/g, '"').replace(/'/g, '\\''); - var content = '' + varLabel + ''; + var content = '' + varLabel + ''; return content; }, insertVariable: function(value) { diff --git a/js/mage/captcha.js b/js/mage/captcha.js index 7d90c3117e..9f595f32f6 100644 --- a/js/mage/captcha.js +++ b/js/mage/captcha.js @@ -51,19 +51,19 @@ Captcha.prototype = { } }; -document.observe('billing-request:completed', function(event){ - if (window.checkout !== undefined){ +document.observe('billing-request:completed', function(event) { + if (typeof window.checkout != 'undefined') { if (window.checkout.method == 'guest' && $('guest_checkout')){ - window.captcha_guest_checkout.refresh() + $('guest_checkout').captcha.refresh() } - if (window.checkout !== undefined && window.checkout.method== 'register' && $('register_during_checkout')){ - window.captcha_register_during_checkout.refresh() + if (window.checkout.method == 'register' && $('register_during_checkout')){ + $('register_during_checkout').captcha.refresh() } } }); -document.observe('login:setMethod', function(event){ +document.observe('login:setMethod', function(event) { switch(event.memo.method){ case 'guest': if ($('register_during_checkout')) { diff --git a/js/prototype/validation.js b/js/prototype/validation.js index fe52526127..a2dad07dce 100644 --- a/js/prototype/validation.js +++ b/js/prototype/validation.js @@ -841,11 +841,11 @@ function parseNumber(v) } /** - * Hash with credit card types wich can be simply extended in payment modules + * Hash with credit card types which can be simply extended in payment modules * 0 - regexp for card number * 1 - regexp for cvn * 2 - check or not credit card number trough Luhn algorithm by - * function validateCreditCard wich you can find above in this file + * function validateCreditCard which you can find above in this file */ Validation.creditCartTypes = $H({ // 'SS': [new RegExp('^((6759[0-9]{12})|(5018|5020|5038|6304|6759|6761|6763[0-9]{12,19})|(49[013][1356][0-9]{12})|(6333[0-9]{12})|(6334[0-4]\d{11})|(633110[0-9]{10})|(564182[0-9]{10}))([0-9]{2,3})?$'), new RegExp('^([0-9]{3}|[0-9]{4})?$'), true], @@ -855,6 +855,6 @@ Validation.creditCartTypes = $H({ 'MC': [new RegExp('^5[1-5][0-9]{14}$'), new RegExp('^[0-9]{3}$'), true], 'AE': [new RegExp('^3[47][0-9]{13}$'), new RegExp('^[0-9]{4}$'), true], 'DI': [new RegExp('^6011[0-9]{12}$'), new RegExp('^[0-9]{3}$'), true], - 'JCB': [new RegExp('^(3[0-9]{15}|(2131|1800)[0-9]{11})$'), new RegExp('^[0-9]{4}$'), true], + 'JCB': [new RegExp('^(3[0-9]{15}|(2131|1800)[0-9]{11})$'), new RegExp('^[0-9]{3,4}$'), true], 'OT': [false, new RegExp('^([0-9]{3}|[0-9]{4})?$'), false] }); diff --git a/lib/Mage/Backup.php b/lib/Mage/Backup.php index d13986ae33..c1d481a494 100644 --- a/lib/Mage/Backup.php +++ b/lib/Mage/Backup.php @@ -48,7 +48,7 @@ class Mage_Backup */ static public function getBackupInstance($type) { - $class = 'Mage_Backup_' . $type; + $class = 'Mage_Backup_' . ucfirst($type); if (!in_array($type, self::$_allowedBackupTypes) || !class_exists($class, true)){ throw new Mage_Exception('Current implementation not supported this type (' . $type . ') of backup.'); diff --git a/lib/Mage/Backup/Db.php b/lib/Mage/Backup/Db.php index df3c2c8331..baece22ae1 100644 --- a/lib/Mage/Backup/Db.php +++ b/lib/Mage/Backup/Db.php @@ -34,7 +34,7 @@ class Mage_Backup_Db extends Mage_Backup_Abstract { /** - * Implementation Rollback functionality for Db + * Implements Rollback functionality for Db * * @return bool */ @@ -48,20 +48,10 @@ public function rollback() $archiveManager = new Mage_Archive(); $source = $archiveManager->unpack($this->getBackupPath(), $this->getBackupsDir()); - $this->getResourceModel()->beginTransaction(); - - $file = fopen($source, "r"); - $query = ''; - while(!feof($file)) { - $line = fgets($file); - $query .= $line; - if ($this->_isLineLastInCommand($line)){ - $this->getResourceModel()->runCommand($query); - $query = ''; - } + $file = new Mage_Backup_Filesystem_Iterator_File($source); + foreach ($file as $statement) { + $this->getResourceModel()->runCommand($statement); } - fclose($file); - $this->getResourceModel()->commitTransaction(); @unlink($source); $this->_lastOperationSucceed = true; @@ -70,7 +60,7 @@ public function rollback() } /** - * Check is line a last in sql command + * Checks whether the line is last in sql command * * @param $line * @return bool @@ -92,9 +82,9 @@ protected function _isLineLastInCommand($line) } /** - * Implementation Create Backup functionality for Db + * Implements Create Backup functionality for Db * - * @return boolean + * @return bool */ public function create() { @@ -124,6 +114,6 @@ public function create() */ public function getType() { - return "db"; + return 'db'; } } diff --git a/lib/Mage/Backup/Filesystem/Iterator/File.php b/lib/Mage/Backup/Filesystem/Iterator/File.php new file mode 100644 index 0000000000..5e48a9fd69 --- /dev/null +++ b/lib/Mage/Backup/Filesystem/Iterator/File.php @@ -0,0 +1,112 @@ + + */ +class Mage_Backup_Filesystem_Iterator_File extends SplFileObject +{ + /** + * The statement that was last read during iteration + * + * @var string + */ + protected $_currentStatement = ''; + + /** + * Return current sql statement + * + * @return string + */ + public function current() + { + return $this->_currentStatement; + } + + /** + * Iterate to next sql statement in file + */ + public function next() + { + $this->_currentStatement = ''; + while (!$this->eof()) { + $line = $this->fgets(); + if (strlen(trim($line))) { + $this->_currentStatement .= $line; + if ($this->_isLineLastInCommand($line)) { + break; + } + } + } + } + + /** + * Return to first statement + */ + public function rewind() + { + parent::rewind(); + $this->next(); + } + + /** + * Check whether provided string is comment + * + * @param string $line + * @return bool + */ + protected function _isComment($line) + { + return $line[0] == '#' || substr($line, 0, 2) == '--'; + } + + /** + * Check is line a last in sql command + * + * @param string $line + * @return bool + */ + protected function _isLineLastInCommand($line) + { + $cleanLine = trim($line); + $lineLength = strlen($cleanLine); + + $returnResult = false; + if ($lineLength > 0) { + $lastSymbolIndex = $lineLength - 1; + if ($cleanLine[$lastSymbolIndex] == ';') { + $returnResult = true; + } + } + + return $returnResult; + } +} diff --git a/lib/Mage/Backup/Filesystem/Iterator/Filter.php b/lib/Mage/Backup/Filesystem/Iterator/Filter.php index ec42031cfa..8fb432f94c 100644 --- a/lib/Mage/Backup/Filesystem/Iterator/Filter.php +++ b/lib/Mage/Backup/Filesystem/Iterator/Filter.php @@ -44,7 +44,7 @@ class Mage_Backup_Filesystem_Iterator_Filter extends FilterIterator * Constructor * * @param Iterator $iterator - * @param array $skipFiles + * @param array $filters list of files to skip */ public function __construct(Iterator $iterator, array $filters) { diff --git a/lib/Mage/Connect/Packager.php b/lib/Mage/Connect/Packager.php index a85fe51045..0a498d730e 100644 --- a/lib/Mage/Connect/Packager.php +++ b/lib/Mage/Connect/Packager.php @@ -34,14 +34,11 @@ class Mage_Connect_Packager { - /** * Constructor - * @param Mage_connect_Config $config */ public function __construct() { - } /** @@ -340,7 +337,7 @@ public function getRemoteModifiedFiles($chanName, $package, $cacheObj, $ftp) * @param string/array $channels * @param Mage_Connect_Singleconfig $cacheObject * @param Mage_Connect_Rest $restObj optional - * @param bool $checkConflicts + * @param bool $checkConflicts * @return array */ public function getUpgradesList($channels, $cacheObject, $configObj, $restObj = null, $checkConflicts = false) @@ -449,10 +446,10 @@ public function getUninstallList($chanName, $package, $cache, $config, $withDeps //print "Processing outer: {$keyOuter} \n"; $hash[$keyOuter] = array ( - 'name' => $package, - 'channel' => $chanName, - 'version' => $version, - 'packages' => $dependencies, + 'name' => $package, + 'channel' => $chanName, + 'version' => $version, + 'packages' => $dependencies, ); if($withDepsRecursive) { @@ -473,7 +470,6 @@ public function getUninstallList($chanName, $package, $cache, $config, $withDeps } } catch (Exception $e) { - //$this->_failed[] = array('name'=>$package, 'channel'=>$chanName, 'max'=>$versionMax, 'min'=>$versionMin, 'reason'=>$e->getMessage()); } $level--; @@ -496,9 +492,9 @@ public function getUninstallList($chanName, $package, $cache, $config, $withDeps * @param mixed $versionMin * @return mixed */ - public function getDependenciesList( $chanName, $package, $cache, $config, $versionMax = false, $versionMin = false, $withDepsRecursive = true, $forceRemote = false) - { - + public function getDependenciesList($chanName, $package, $cache, $config, $versionMax = false, $versionMin = false, + $withDepsRecursive = true, $forceRemote = false + ) { static $level = 0; static $_depsHash = array(); static $_deps = array(); @@ -530,12 +526,12 @@ public function getDependenciesList( $chanName, $package, $cache, $config, $vers //print "Processing outer: {$keyOuter} \n"; $_depsHash[$keyOuter] = array ( - 'name' => $package, - 'channel' => $chanName, - 'downloaded_version' => $version, - 'min' => $versionMin, - 'max' => $versionMax, - 'packages' => $dependencies, + 'name' => $package, + 'channel' => $chanName, + 'downloaded_version' => $version, + 'min' => $versionMin, + 'max' => $versionMax, + 'packages' => $dependencies, ); if($withDepsRecursive) { @@ -580,7 +576,13 @@ public function getDependenciesList( $chanName, $package, $cache, $config, $vers if(!$cache->hasVersionRangeIntersect($pMin,$pMax, $hasMin, $hasMax)) { $reason = "Detected {$pName} conflict of versions: {$hasMin}-{$hasMax} and {$pMin}-{$pMax}"; unset($_depsHash[$keyInner]); - $_failed[] = array('name'=>$pName, 'channel'=>$pChannel, 'max'=>$pMax, 'min'=>$pMin, 'reason'=>$reason); + $_failed[] = array( + 'name' => $pName, + 'channel' => $pChannel, + 'max' => $pMax, + 'min' => $pMin, + 'reason' => $reason + ); continue; } $newMaxIsLess = version_compare($pMax, $hasMax, "<"); @@ -594,24 +596,27 @@ public function getDependenciesList( $chanName, $package, $cache, $config, $vers } } } catch (Exception $e) { - $_failed[] = array('name'=>$package, 'channel'=>$chanName, 'max'=>$versionMax, 'min'=>$versionMin, 'reason'=>$e->getMessage()); + $_failed[] = array( + 'name' => $package, + 'channel' => $chanName, + 'max' => $versionMax, + 'min' => $versionMin, + 'reason' => $e->getMessage() + ); } - - + $level--; if($level == 0) { $out = $this->processDepsHash($_depsHash); - $deps = $_deps; + $deps = $_deps; $failed = $_failed; $_depsHash = array(); $_deps = array(); - $_failed = array(); - return array('deps' => $deps, 'result' => $out, 'failed'=> $failed); + $_failed = array(); + return array('deps' => $deps, 'result' => $out, 'failed'=> $failed); } - } - /** * Process dependencies hash * Makes topological sorting and gives operation order list @@ -658,5 +663,4 @@ protected function processDepsHash(&$depsHash, $sortReverse = true) unset($graph, $nodes); return $out; } - -} \ No newline at end of file +} diff --git a/lib/Varien/Db/Adapter/Interface.php b/lib/Varien/Db/Adapter/Interface.php index 02a5d03345..07cbfb144a 100644 --- a/lib/Varien/Db/Adapter/Interface.php +++ b/lib/Varien/Db/Adapter/Interface.php @@ -992,4 +992,11 @@ public function decodeVarbinary($value); * @return string */ public function getSuggestedZeroDate(); + + /** + * Get adapter transaction level state. Return 0 if all transactions are complete + * + * @return int + */ + public function getTransactionLevel(); } diff --git a/skin/adminhtml/default/default/boxes.css b/skin/adminhtml/default/default/boxes.css index e0ea7e525a..c6a8939d7a 100644 --- a/skin/adminhtml/default/default/boxes.css +++ b/skin/adminhtml/default/default/boxes.css @@ -385,10 +385,6 @@ select.multiselect option { padding:3px 4px; border-bottom:1px solid #ddd; .columns .form-list { width:auto; } .columns .form-list td.value { width:280px; padding-right:5px !important; } -.columns .form-list td.value { white-space:nowrap; } -.columns .form-list td.value > * { white-space:normal; } -.columns .form-list td.value > strong, -.columns .form-list td.value > button { display:block; } .columns .form-list td.value .next-toinput { width:75px; display:inline; margin-right:5px; } .columns .form-list td.value .next-toselect input.input-text { width:195px!important; display:inline; } @@ -471,6 +467,8 @@ button.disabled:hover, button.disabled:active { border-color:#777 #505050 #505050 #777; background:#919191 url(images/btn_bg-disabled.gif) 0 0 repeat-x; color:#fff; cursor:default; opacity:.8; -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=20)"; } button.add.disabled span { background-image:url(images/add_btn_icon-disabled.gif); } +button.loading > span { padding-left:20px; background-image: url(images/btn_loading-icon.gif) !important;} + button.icon-btn { width:32px !important; } button.icon-btn span { text-indent:-999em; display:block; width:16px; padding:0; overflow:hidden; } @@ -481,14 +479,18 @@ button.icon-btn span { text-indent:-999em; display:block; width:16px; padding:0; /* SWITCHER *******************************************************************************/ .switcher { margin-bottom:10px; border:1px solid #cddddd; background:#e7efef; padding:10px; } -.side-col .switcher select { width:100%; } +.side-col .switcher { padding-right:26px; } +.side-col .switcher label { display:block; } +.side-col .switcher .link-store-scope { float:right; margin-right:-19px; margin-left:3px; } +.side-col .switcher select { width:100%; float:left; } /*.side-col .switcher { margin-right:20px; margin-bottom:20px; }*/ .catalog-categories .side-col .switcher { margin-right:0; margin-bottom:15px; } -.link-storeScope { display:inline-block; vertical-align:middle; margin:0 0 1px; width:16px; height:16px; background:url(images/i_question-mark.png) 0 0 no-repeat; text-decoration:none !important; text-indent:-999em; overflow:hidden; } -.form-list td.value .link-storeScope { vertical-align:top; margin-top:6px; } -.storeScope .link-storeScope { float:left; margin-right:10px; } -.storeScope .tree-storeScope { float:left; padding:7px 10px; border:1px dotted #dedede; } -.storeScope table.stores-tree { float:left; width:auto !important; } +.link-store-scope { display:inline-block; vertical-align:middle; margin:0 0 1px; width:16px; height:16px; background:url(images/i_question-mark.png) 0 0 no-repeat; text-decoration:none !important; text-indent:-999em; overflow:hidden; } +.store-scope .link-store-scope { float:left; margin-right:10px; } +.store-scope .tree-store-scope { float:left; padding:7px 10px; border:1px dotted #dedede; } +.store-scope table.stores-tree { float:left; width:auto !important; } +.form-list td.value .store-scope { white-space:nowrap; } +.form-list td.value .link-store-scope { float:none; margin-right:0; vertical-align:top; margin-top:6px; } /* SPACE @@ -1039,6 +1041,7 @@ ul.tabs a.paypal-section:hover span { background:url(images/paypal_section.png) .x-tree-node-ct { overflow:hidden; } /* Product - Websites */ +.website-name .checkbox { vertical-align:top; margin-top:2px; } .webiste-groups { padding:10px 20px; } .group-stores { padding:2px 10px; } @@ -1515,6 +1518,7 @@ ul.super-product-attributes { padding-left:15px; } .normal { font-weight:normal !important; } /* Clear */ /* This keeps our HTML free of buncha clearing elements */ +.side-col .switcher:after, .message-popup .message-popup-head:after, .message-popup .message-popup-content .message:after, .login-form .form-buttons:after, @@ -1547,4 +1551,4 @@ div.actions:after, .files .row:after, .files-wide .row:after, .grid tr.filter .range .range-line:after, -.storeScope:after { display:block; clear:both; content:"."; font-size:0; line-height:0; height:0; overflow:hidden; } +.store-scope:after { display:block; clear:both; content:"."; font-size:0; line-height:0; height:0; overflow:hidden; } diff --git a/skin/adminhtml/default/default/iestyles.css b/skin/adminhtml/default/default/iestyles.css index 7129a47bfb..0f07d2ff7a 100644 --- a/skin/adminhtml/default/default/iestyles.css +++ b/skin/adminhtml/default/default/iestyles.css @@ -60,7 +60,7 @@ ul.tabs li a, .centinel .authentication, .paypal-payment-notice, .product-options .options-list li, -.storeScope { zoom:1; } +.store-scope { zoom:1; } .clear { display:block; clear:both; height:0; font-size:0; line-height:0; overflow:hidden; } diff --git a/skin/adminhtml/default/default/images/btn_loading-icon.gif b/skin/adminhtml/default/default/images/btn_loading-icon.gif new file mode 100644 index 0000000000000000000000000000000000000000..7735ef6e5798b95dff4bb9620eaf72c326b5037b GIT binary patch literal 847 zcmZ?wbhEHb6krfw_`<-jc=6)@|Nk#ty7cACm*>u%`~Ca(hYue%ZrphA;K6U-zFoe2 z`R2`=Yu2nee*F0M?c1L`d2;{$eFjp1;(u;G*N|Xm#{gF&Jp*P&pkBp)QqD!Gi6yBi z3gww4848J6i4{5di79%Sd1?6!ia%L6xqzy4K(>G!$-o+*pwO3+Id7?fNRFabOTwzP zGenL}lrnAjz;?5vA-b2vhAFc(V4^@PV`uB4zBQUU4W3ay7O5nC*yS;4fdgv-pu5*<>|Hn(-{gjt4u>v0=H?uP};XReTu;fv2}|U_B&<^oL6>a z;I;`cH(Wp`0?>!bpC@SC67kUDIuanlsk@}z@V#*(mzDEr zL+>pfElm&EJoIL$+}v2nz#*{j;u+Q(S=@S!;Vuq$_#zn=8F+Atwdxr3IbGrE%NFo@ z_Le8q-n5*VrA8&2H%616ryHxKL6Bf=P?*AGD00+cMYFRU+Zyp>+1*WZ7!{qKB-k@F zZfDvzLD{v*qRJ^Sq9J*A?xHeoA*F>1FAptFXiRA14Ru>4S#(E|Z)w46&ChB78?agf z@*6PrRygpu8VVdbDUlm1aeSwQN6&?}8yf5aT`VR{3ePokB$l};CVDVL1kd1T%r#xI zl`+Z1V+$L@s-1~RI$V9K4F$$x$w!nosQ=)7qr`4vW*(rX6`|jt(bKDf)zWyVr5-?! zaV&E%VK}tun4^;CM2-!!7AA1m<+ZYU8mM$g^vZdgZ{qdPVL#ZZThgr6)a)uHBCzDJ t?!|-^9SH}RehL_Na!72L?$FQYY@WfPZ^)9y8l&0Wqo&AU4N9J1002xz6F~p~ literal 0 HcmV?d00001 diff --git a/skin/adminhtml/default/default/images/login_box_bg_auth.jpg b/skin/adminhtml/default/default/images/login_box_bg_auth.jpg new file mode 100644 index 0000000000000000000000000000000000000000..8f7f13689d0914ef2aa95b2de791e53308d76b0a GIT binary patch literal 51012 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 NXJCb */ /* Tier Prices */ -.tier-prices { margin:10px 0; padding:10px; background-color:#f4f7f7; border:1px solid #dadddd; } -.tier-prices li { line-height:1.4; background:url(../images/i_tier.gif) no-repeat 0 3px; padding:2px 0 2px 10px; color:#424242; } +.product-pricing, +.tier-prices { margin:10px 0; padding:10px; background-color:#f4f7f7; border:1px solid #dadddd; color:#424242; } +.tier-prices li { line-height:1.4; background:url(../images/i_tier.gif) no-repeat 0 3px; padding:2px 0 2px 10px; } .tier-prices .benefit { font-style:italic; font-weight:bold; color:#2f2f2f; } .tier-prices .price { font-weight:bold; color:#2f2f2f; } @@ -1022,8 +1023,9 @@ std ul, .product-options p.required { position:absolute; right:20px; top:20px; } .product-options-bottom { background-color:#fafaec; padding:15px 20px; border:1px solid #e4e4e4; border-top:0; } -.product-options-bottom .tier-prices { margin:0; padding:0 0 10px; border:0; background:0; } -.product-options-bottom .tier-prices li { background:0; padding:2px 0; color:#e26703; } +.product-options-bottom .product-pricing, +.product-options-bottom .tier-prices { margin:0; padding:0 0 10px; border:0; background:0; color:#e26703; } +.product-options-bottom .tier-prices li { background:0; padding:2px 0; } .product-options-bottom .tier-prices .price, .product-options-bottom .tier-prices .benefit { color:#e26703; } .product-options-bottom .price-box { float:left; margin:0; padding:0; } diff --git a/skin/frontend/default/default/css/styles.css b/skin/frontend/default/default/css/styles.css index 4ea30890db..0ef097e419 100644 --- a/skin/frontend/default/default/css/styles.css +++ b/skin/frontend/default/default/css/styles.css @@ -949,8 +949,9 @@ tr.summary-details-excluded { font-style:italic; } /********** Product Prices > */ /* Tier Prices */ -.tier-prices { margin:10px 0; padding:10px; background-color:#f4f7f7; border:1px solid #dadddd; } -.tier-prices li { line-height:1.4; background:url(../images/i_tier.gif) no-repeat 0 3px; padding:2px 0 2px 10px; color:#424242; } +.product-pricing, +.tier-prices { margin:10px 0; padding:10px; background-color:#f4f7f7; border:1px solid #dadddd; color:#424242; } +.tier-prices li { line-height:1.4; background:url(../images/i_tier.gif) no-repeat 0 3px; padding:2px 0 2px 10px; } .tier-prices .benefit { font-style:italic; font-weight:bold; color:#2f2f2f; } .tier-prices .price { font-weight:bold; color:#2f2f2f; } @@ -1053,8 +1054,9 @@ tr.summary-details-excluded { font-style:italic; } .product-options p.required { position:absolute; right:20px; top:20px; } .product-options-bottom { background-color:#fffada; padding:15px 20px; border:1px solid #e4e4e4; border-top:0; } -.product-options-bottom .tier-prices { margin:0; padding:0 0 10px; border:0; background:0; } -.product-options-bottom .tier-prices li { background:0; padding:2px 0; color:#e26703; } +.product-options-bottom .product-pricing, +.product-options-bottom .tier-prices { margin:0; padding:0 0 10px; border:0; background:0; color:#e26703; } +.product-options-bottom .tier-prices li { background:0; padding:2px 0; } .product-options-bottom .tier-prices .price, .product-options-bottom .tier-prices .benefit { color:#e26703; } .product-options-bottom .price-box { float:left; margin:0; padding:0; } diff --git a/skin/frontend/default/iphone/css/iphone.css b/skin/frontend/default/iphone/css/iphone.css index 48d22e6d88..61e82e03a4 100644 --- a/skin/frontend/default/iphone/css/iphone.css +++ b/skin/frontend/default/iphone/css/iphone.css @@ -44,19 +44,31 @@ body { background:#fefefe; font:12px/18px HelveticaNeue, Helvetica, sans-serif; h1 { font-size:14px; font-weight:bold; line-height:14px; text-align:center; } h2 { font-size:12px; font-weight:normal; line-height:20px; } +button:active { position:relative; top:1px; left:1px; } + legend { display:none; } .messages .notice-msg, +.messages .error-msg, .messages .success-msg { background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #FFE38D), color-stop(100%, #FFD040)); - padding:10px; + background:-o-linear-gradient(top, #FFE38D 0%, #FFD040 100%); + padding:5px; color:#222; font-weight:bold; text-shadow:0 1px 0 #eee; -webkit-box-shadow:0 3px 3px #ccc; + box-shadow:0 3px 3px #ccc; +} +.messages .error-msg { + color:#fff; + background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #ee5f5b), color-stop(100%, #c43c35)); + background-image:-o-linear-gradient(top, #ee5f5b 0%, #c43c35 100%); + text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25); } .messages .success-msg { background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #62c462), color-stop(100%, #57a957)); + background-image:-o-linear-gradient(top, #62c462 0%, #57a957 100%); border:solid #3D773D; border-width:1px 0; color:#fff; @@ -64,17 +76,23 @@ legend { display:none; } margin-bottom:10px; } +.no-display { display:none; } +.nobr { white-space:nowrap; } + /* Header -----------------------------*/ body > header { - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#999999), color-stop(50%,#504f50), color-stop(51%,#282728), color-stop(100%,#110f0f)); - background: -webkit-linear-gradient(top, #999999 0%,#504f50 50%,#282728 51%,#110f0f 100%); - background-color:#666; + background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0%,#999999), color-stop(50%,#504f50), color-stop(51%,#282728), color-stop(100%,#110f0f)); + background-image:-webkit-linear-gradient(top, #999999 0%,#504f50 50%,#282728 51%,#110f0f 100%); + background-image:-o-linear-gradient(top, #999999 0%, #504f50 50%,#282728 51%, #110f0f 100%); + background-color:#222; + box-sizing:border-box; display:table; padding:5px; position:relative; width:100%; -webkit-box-shadow:0 3px 3px rgba(0, 0, 0, 0.25); + box-shadow:0 3px 3px rgba(0, 0, 0, 0.25); z-index:100; height:34px; -webkit-user-select:none; @@ -86,6 +104,7 @@ body > header { body > header.no-shadow { -webkit-box-shadow:none; + box-shadow:none; } .cart-wrap { @@ -98,8 +117,15 @@ body > header.no-shadow { z-index:99; visibility:hidden; -webkit-box-shadow:0 0 5px rgba(0, 0, 0, 0.5); + box-shadow:0 0 5px rgba(0, 0, 0, 0.5); -webkit-transform:translate3d(0, -100%, 0); } +.cart-wrap:after { + content:''; + display:block; + position:absolute; + margin-top:44px; +} .cart-wrap .cart-shared { margin:0; @@ -123,6 +149,7 @@ body > header.no-shadow { position:relative; z-index:1; -webkit-box-shadow:inset 0 0 3px rgba(0, 0, 0, 0.25); + box-shadow:inset 0 0 3px rgba(0, 0, 0, 0.25); } .cart-wrap-content .page-title { @@ -130,6 +157,7 @@ body > header.no-shadow { border:none; margin:0 -10px 0; -webkit-box-shadow:none; + box-shadow:none; } .cart-wrap-content .cart-empty { @@ -146,10 +174,6 @@ body > header.no-shadow { margin:0; } -.cart-wrap-content .cart-shared .cart-table tr:last-child td { - border:0; -} - .cart-wrap-content .cart-footer .checkout-types li button { padding:5px 10px; } @@ -158,7 +182,10 @@ body > header .store-logo, body > header .menu-wrapper { display:table-cell; vertical-align:middle; - width:50%; + width:70%; +} +body > header .store-logo { + width:30%; } body > header .store-logo img { @@ -192,13 +219,19 @@ body > header dd { width:100%; margin-top:44px; visibility:hidden; - -webkit-transform:translate3d(0, -100%, -1px); -webkit-box-sizing:border-box; + box-sizing:border-box; -webkit-transition:-webkit-transform 250ms ease-out; } +@media all and (-webkit-transform-3d) { + body > header dd { -webkit-transform:translate3d(0, -100%, -1px); } +} + body > header dd.search-box { - background:-webkit-gradient(linear, 0 0, 0 100%, from(#333), to(#000)); + background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#333), to(#000)); + background-image:-o-linear-gradient(top, #333 0%, #000 100%); + background-color:#333; border-top:1px solid #666; padding:7px 5px; -webkit-transition:-webkit-transfrom 300ms linear; @@ -209,14 +242,20 @@ body > header dd.search-box input { outline:none; background:url(../images/search_icon.png) no-repeat 8px 7px #fff; -webkit-background-size:14px 14px; + background-size:14px 14px; -webkit-background-origin:padding-box; + background-origin:padding-box; padding:5px 10px 5px 25px; margin:0; width:100%; border-radius:14px; + -webkit-box-sizing:border-box; + box-sizing:border-box; -webkit-border-radius:14px; + border-radius:14px; -webkit-appearance:none; -webkit-box-shadow:inset 0 1px 3px #000; + box-shadow:inset 0 1px 3px #000; } body > header dt a { @@ -239,6 +278,7 @@ body > header dt.active span:first-child { border-top-left-radius:5px; border-top-right-radius:5px; -webkit-background-clip:padding-box; + background-clip:padding-box; } body > header dt.search > a { @@ -279,7 +319,7 @@ body > header dt.active span:first-child { body > header dt.cart > span:nth-child(2), body > header .badge { - background:-webkit-gradient( + background-image:-webkit-gradient( linear, 0 0, 0 100%, @@ -288,6 +328,7 @@ body > header .badge { color-stop(0.6, #e75159), color-stop(0, #f6bec1) ); + background-image:-o-linear-gradient(top, #f6bec1 0%, #e75159 60%, #e1262f 62%, #af0002 100%); border:2px solid #fff; border-radius:15px; display:inline-block; @@ -300,7 +341,9 @@ body > header .badge { right:-5px; top:-5px; -webkit-box-shadow:0 3px 3px rgba(0, 0, 0, 0.5); + box-shadow:0 3px 3px rgba(0, 0, 0, 0.5); -webkit-background-clip:padding-box; + background-clip:padding-box; z-index:100; } @@ -326,7 +369,8 @@ body > header dd.menu-box { } body > header dd.menu-box a { - background:-webkit-gradient(linear,0 0,0 100%,from(#333),to(#000)); + background-image:-webkit-gradient(linear,0 0,0 100%,from(#333),to(#000)); + background-image:-o-linear-gradient(top, #333 0%, #000 100%); border-bottom:2px solid #585858; color:#fff; padding:10px; @@ -350,9 +394,11 @@ body > header dd.menu-box .badge { left:0; position:relative; -webkit-box-shadow:0 3px 3px rgba(0, 0, 0, 0.5), inset 0 3px 3px rgba(255, 255, 255, 0.35); + box-shadow:0 3px 3px rgba(0, 0, 0, 0.5), inset 0 3px 3px rgba(255, 255, 255, 0.35); } body > header dd.menu-box .links a:hover { -webkit-box-shadow:inset 0 8px 8px rgba(0, 0, 0, .75); + box-shadow:inset 0 8px 8px rgba(0, 0, 0, .75); } body > header dd.menu-box .welcome-msg { @@ -362,6 +408,7 @@ body > header dd.menu-box .welcome-msg { padding:10px; text-shadow:0 -1px 0 #000; -webkit-box-shadow:inset 0 -2px 2px rgba(0, 0, 0, 0.35); + box-shadow:inset 0 -2px 2px rgba(0, 0, 0, 0.35); } body > header dd.menu-box .welcome-msg a { @@ -379,6 +426,7 @@ body > header dd.menu-box ol { margin:5px; padding:5px; -webkit-box-shadow:inset 0 0 3px #000; + box-shadow:inset 0 0 3px #000; } body > header dd.menu-box ol li a { @@ -402,7 +450,12 @@ body > header dd.menu-box ol li.selected a { /* Navigation -----------------------------*/ -body > nav { background:-webkit-gradient(linear, 0 0, 0 100%, from(#1a1a1a), to(#000)); border-bottom:5px solid #3a3a3a; padding:10px 5px 0; } +body > nav { + background:-webkit-gradient(linear, 0 0, 0 100%, from(#1a1a1a), to(#000)); + background:-o-linear-gradient(top, #1a1a1a 0%, #000 100%); + border-bottom:5px solid #3a3a3a; + padding:10px 5px 0; +} body > nav a { color:#fff; display:block; padding:9px 2px 7px; position:relative; font-size:16px; } body > nav ul { @@ -443,6 +496,7 @@ body > nav span { right:-5px; top:-5px; -webkit-box-shadow:0 3px 3px #000; + box-shadow:0 3px 3px #000; } body > nav .active { @@ -470,7 +524,8 @@ body > nav .active a { /* Footer -----------------------------*/ body > footer { - background:-webkit-gradient(linear, 0 0, 0 100%, from(#f6f6f6), to(#fff)); + background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#f6f6f6), to(#fff)); + background-image:-o-linear-gradient(top, #f3f3f3 0%, #fff 100%); min-height:100px; padding:10px; } @@ -504,6 +559,7 @@ body > footer select { } body > footer p { border-top:1px solid rgba(204, 204, 204, 0.3); color:#999; font-size:12px; margin:8px -10px 0; line-height:14px; padding:8px 10px 0; text-align:center; } +.form-subscribe .form-subscribe-header { display:none; } /* Content -----------------------------*/ @@ -526,11 +582,12 @@ body > section > .category-image img { min-width:100%; } overflow:hidden; margin:0 0 -1px; padding:0 0 1px; + position:relative; width:9000px; -webkit-transform:translate3d(0, 0, 0); - -webkit-transition:-webkit-transform 250ms linear; - -webkit-backface-visibility:hidden; - -webkit-perspective:1000; + -webkit-transition:-webkit-transform 250ms linear; + -o-transition:-o-transform 250ms linear; + transition:transform 250ms linear; } #nav-container ul > li > ul { display:none; } #nav-container:after { content: "."; display: block; clear: both; visibility: hidden; line-height: 0; height: 0; } @@ -543,19 +600,26 @@ body > section > .category-image img { min-width:100%; } margin:-5px 10px 0; position:absolute; } -#nav-container li a { background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#eee)); display:block; } +#nav-container li a { + background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#eee)); + background:-o-linear-gradient(top, #fff 0, #eee 100%); + display:block; +} #nav-container li a span { background:url(../images/i_arrow_small.png) no-repeat right; - display:block; - padding:10px; + display:block; + padding:10px; -webkit-background-size:8px 12px; + background-size:8px 12px; -webkit-background-origin:content-box; + background-origin:content-box; } /* Form-list -----------------------------*/ .form-list li { margin-bottom:8px; } +.form-list input.input-text, .form-list input[type="text"], .form-list input[type="password"], .form-list input[type="email"] { @@ -569,13 +633,31 @@ body > section > .category-image img { min-width:100%; } width:100%; -webkit-appearance:none; -webkit-box-sizing:border-box; + box-sizing:border-box; -webkit-box-shadow:inset 1px 1px 1px rgba(0, 0, 0, 0.1); + box-shadow:inset 1px 1px 1px rgba(0, 0, 0, 0.1); } .form-list input[type="text"]::-webkit-input-placeholder, .form-list input[type="password"]::-webkit-input-placeholder, .form-list input[type="email"]::-webkit-input-placeholder { color:#444; } +.form-list textarea { + border:1px solid; + border-color:#8e8e8e #e1e1e1 #e1e1e1 #8e8e8e; + border-radius:5px; + padding:5px; + font-size:18px; + height:100px; + width:100%; + resize:vertical; + -webkit-appearance:none; + -webkit-box-sizing:border-box; + box-sizing:border-box; + -webkit-box-shadow:inset 1px 1px 1px rgba(0, 0, 0, 0.1); + box-shadow:inset 1px 1px 1px rgba(0, 0, 0, 0.1); +} input[type="submit"] { background:-webkit-gradient(linear, 0 0, 0 100%, from(#fdfdfd), to(#dbdbdb)); + background:-o-linear-gradient(top, #fdfdfd 0%, #dbdbdb 100%); border:1px solid #dbdbdb; border-radius:10px; font-size:16px; @@ -587,7 +669,9 @@ input[type="submit"] { vertical-align:middle; -webkit-appearance:none; -webkit-box-shadow:0 1px 1px #8a8a8a; + box-shadow:0 1px 1px #8a8a8a; -webkit-background-clip:padding-box; + background-clip:padding-box; } input[type="checkbox"] { background:url(../images/bg_checkbox.png) no-repeat 0 0; @@ -603,7 +687,7 @@ input[type="checkbox"] { input[type="checkbox"]:checked { background-position:0 -19px; } -select { +select, .select-multiple { background:url(../images/i_dropdown.png) no-repeat right #fefefe; border:1px solid; border-color:#e1e1e1; @@ -612,8 +696,130 @@ select { font-size:15px; padding:3px 30px 3px 7px; -webkit-appearance:none; + -moz-appearance:none; + appearance:none; -webkit-box-sizing:border-box; - } + -moz-box-sizing:border-box; + box-sizing:border-box; +} +.select-multiple { + max-width:100%; + overflow:hidden; + text-overflow:ellipsis; + white-space:nowrap; + position:relative; +} +.select-multiple-wrap { + position:relative; +} +.select-multiple-options-wrap { + background:#fefefe; + border:1px solid #a2a2a2; + border-radius:2px; + position:absolute; + top:0; + left:0; + right:0; + visibility:hidden; + -webkit-box-shadow:0 0 3px rgba(0, 0, 0, 0.35); + box-shadow:0 0 3px rgba(0, 0, 0, 0.35); + -webkit-tap-highlight-color:rgba(0,0,0,0); + z-index:1; +} +.select-multiple-options-wrap .select-heading { + background:-webkit-gradient(linear, 0 0, 0 100%, from(#eee), to(#d4d4d4)); + background:-o-linear-gradient(top, #eee 0%, #d4d4d4 100%); + border-bottom:1px solid #a2a2a2; + color:#444; + font-weight:bold; + font-size:13px; + text-transform:uppercase; + text-shadow:0 1px 0 #fff; + padding:5px; + white-space:nowrap; + overflow:hidden; + text-overflow:ellipsis; +} +.select-multiple-options-wrap .select-close { + background:-webkit-gradient(linear, 0 0, 0 100%, from(#eee), to(#bbb)); + background:-o-linear-gradient(top, #eee 0%, #bbb 100%); + border:1px solid #a2a2a2; + cursor:pointer; + color:#222; + -webkit-border-radius:4px; + -moz-border-radius:4px; + border-radius:4px; + font-size:12px; + display:inline-block; + margin-right:8px; + line-height:20px; + text-align:center; + height:20px; + width:20px; + -webkit-box-shadow:0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow:0 1px 2px rgba(0, 0, 0, 0.05); +} +.select-multiple .selected-counter { + background:-webkit-gradient(linear, 0 0, 0 100%, from(#ebebeb), to(#fff)); + background:-o-linear-gradient(top, #ebebeb 0%, #bbb 100%); + border-left:1px solid #c2c2c2; + color:#4d4d4d; + display:inline-block; + font-size:12px; + font-weight:bold; + line-height:23px; + text-shadow:0 1px 0 #fff; + padding:0 8px; + position:absolute; + top:0; + bottom:0; + right:25px; +} +.select-multiple .selected-counter:before { + background:-webkit-gradient(linear, 0 0, 100% 0, color-stop(0.05, rgba(255, 255, 255, 0.5)), color-stop(1, rgb(255, 255, 255))); + content:''; + position:absolute; + left:-41px; + top:0; + bottom:0; + width:40px; +} +.select-multiple-options { + list-style:none; + margin:0 auto; + padding:0; +} +.select-multiple-options li { + border-bottom:1px solid #ccc; + cursor:pointer; + margin:0; + padding:5px 5px 5px 33px; + position:relative; + -webkit-transition:background 300ms linear; +} +.select-multiple-options li:after { + content:''; + display:block; + background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAAKCAYAAABv7tTEAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYxIDY0LjE0MDk0OSwgMjAxMC8xMi8wNy0xMDo1NzowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNS4xIFdpbmRvd3MiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RDAxRDg0NzcxQjdEMTFFMUE1RjVCOUQyODJGQTNDMEMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RDAxRDg0NzgxQjdEMTFFMUE1RjVCOUQyODJGQTNDMEMiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpEMDFEODQ3NTFCN0QxMUUxQTVGNUI5RDI4MkZBM0MwQyIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpEMDFEODQ3NjFCN0QxMUUxQTVGNUI5RDI4MkZBM0MwQyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pv02V7QAAABZSURBVHjalM5BDoAwCATAfUXj/7/Dbzx43QppCW0U5bAh0AwUJPEnItIA8K4lcCqyFMFlfRXo3B/m4AsY8n8GmIF56dhhBgyNzREyA44e4CtYUIQZ0HQBBgCyITMDEAMA1AAAAABJRU5ErkJggg==) no-repeat 0 0; + height:10px; + width:13px; + position:absolute; + top:9px; + left:10px; + opacity:0.2; +} +.select-multiple-options li.active:after { + opacity:1; +} +.select-multiple-options li:last-child { + border-bottom:none; +} +.select-multiple-options li + li { + border-top:1px linear #fff; +} +.select-multiple-options .active { + background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#e5e5e5)); +} input[type="text"] { background:#fefefe; border:1px solid; @@ -625,7 +831,9 @@ input[type="text"] { width:100%; -webkit-appearance:none; -webkit-box-sizing:border-box; + box-sizing:border-box; -webkit-box-shadow:inset 1px 1px 1px rgba(0, 0, 0, 0.1); + box-shadow:inset 1px 1px 1px rgba(0, 0, 0, 0.1); } .send-friend { @@ -635,6 +843,7 @@ input[type="text"] { padding:9px; border-radius:2px 2px 5px 5px; background:-webkit-gradient(linear, 0 0, 0 100%,color-stop(0, #FCFDFD), color-stop(0.8, #EEEEEE), color-stop(1, #E8E9E9)); + background:-o-linear-gradient(top, #FCFDFD 0%, #eee 80%, #E8E9E9 100%); } .send-friend h2 { @@ -663,7 +872,9 @@ input[type="text"] { width:100%; -webkit-appearance:none; -webkit-box-sizing:border-box; + box-sizing:border-box; -webkit-box-shadow:inset 1px 1px 1px rgba(0, 0, 0, 0.1); + box-shadow:inset 1px 1px 1px rgba(0, 0, 0, 0.1); } .send-friend .field { @@ -681,7 +892,7 @@ input[type="text"] { padding-top:10px; } -#add_recipient_button { +.send-friend #add_recipient_button { float:right; } @@ -693,42 +904,50 @@ input[type="text"] { #add_recipient_button button, .send-friend .btn-remove { + font-family:Arial; margin:0; - padding:2px 8px 4px; + padding:3px 6px; border:1px solid #CECECE; border-radius:2px; background:-webkit-gradient(linear, 0 0, 0 100%, from(#FEFEFE), to(#EEE)); + background:-o-linear-gradient(top, #fefefe 0%, #eee 100%); text-transform: small-caps; color:#333; font-size:24px; - line-height:18px; - padding:0 5px 6px; + line-height:20px; text-shadow:0 1px 0 #fff; -webkit-box-shadow:0 0 5px #ccc; + box-shadow:0 0 5px #ccc; } .send-friend .btn-remove { background:-webkit-gradient(linear, 0 0, 0 100%, from(#e4776f), to(#d83a2e)); + background:-o-linear-gradient(top, #e4776f 0%, #d83a2e 100%); color:#fff; border:none; border-left:1px solid #ccc; border-radius:0 5px 5px 0; - padding:6px 8px 10px; + padding:5px 8px 8px; text-shadow:0 1px 0 #333; -webkit-box-shadow:none; + box-shadow:none; width:initial; height:initial; } .send-friend button[type="submit"] { background:-webkit-gradient(linear, 0 0, 0 100%, from(#F39823), to(#F37221)); + background:-o-linear-gradient(top, #F39823 0%, #F37221 100%); padding:5px 20px; font-size:14px; color:#FFF; border:1px solid #FFF; border-radius:5px; + text-shadow:0 1px 2px rgba(0, 0, 0, 0.25); -webkit-box-shadow:0 3px 3px 0 #9F9F9F; + box-shadow:0 3px 3px 0 #9F9F9F; -webkit-background-clip:padding-box; + background-clip:padding-box; } #max_recipient_message { @@ -760,22 +979,75 @@ input[type="text"] { .login-box { margin:0 -10px -10px; padding:10px; } .login-box form h2, .login-box .new-users h2 { font-size:16px; line-height:16px; font-weight:bold; margin:0 0 10px; color:#333; } -.login-box form { display:block; border:1px solid #D1D1D1; margin:-6px -7px -7px; padding:9px; border-radius:2px 2px 5px 5px; background:-webkit-gradient(linear, 0 0, 0 100%,color-stop(0, #FCFDFD), color-stop(0.8, #EEEEEE), color-stop(1, #E8E9E9)); } +.login-box form { + display:block; + border:1px solid #D1D1D1; + margin:-6px -7px -7px; + padding:9px; + border-radius:2px 2px 5px 5px; + background:-webkit-gradient(linear, 0 0, 0 100%,color-stop(0, #FCFDFD), color-stop(0.8, #eee), color-stop(1, #E8E9E9)); + background:-o-linear-gradient(top, #FCFDFD 0%, #eee 80%, #E8E9E9 100%); +} .login-box form:after { content: "."; display: block; clear: both; visibility: hidden; line-height: 0; height: 0; } .login-box form label { display:block; padding:0 0 3px; font-weight:bold; color:#5E5E5E; } .login-box form > a { font-weight:bold; color:#F4641E; } .login-box form .login-button { margin:7px 0 0; } -.login-box form .login-button input { padding:5px 20px; background:-webkit-gradient(linear, 0 0, 0 100%, from(#F39823), to(#F37221)); font-size:14px; color:#FFF; border:1px solid #FFF; border-radius:5px; -webkit-box-shadow:0 3px 3px 0 #9F9F9F; -webkit-background-clip:padding-box; } +.login-box form .login-button input { + padding:5px 20px; + background:-webkit-gradient(linear, 0 0, 0 100%, from(#F39823), to(#F37221)); + background:-o-linear-gradient(top, #F39823 0%, #F37221 100%); + font-size:14px; + color:#FFF; + border:1px solid #FFF; + border-radius:5px; + -webkit-box-shadow:0 3px 3px 0 #9f9f9f; + box-shadow:0 3px 3px 0 #9f9f9f; + -webkit-background-clip:padding-box; + background-clip:padding-box; + text-shadow:0 1px 2px rgba(0, 0, 0, 0.25); +} .login-box .required { font-size:12px; line-height:16px; margin:8px 0 0; } .login-box .registered-users { margin:0 0 10px; } .login-box .registered-users input[type="submit"] + a { text-decoration:underline; vertical-align:middle; } -.login-box .registered-users h1 { display:none; background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#ccc)); border:solid #999; border-width:1px 0; border-top-color:#ccc; text-shadow:0 1px 0 #fff; margin:0 -10px 10px; padding:10px; -webkit-box-shadow:0 3px 3px #eee; } +.login-box .registered-users h1 { display:none; background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#ccc)); border:solid #999; border-width:1px 0; border-top-color:#ccc; text-shadow:0 1px 0 #fff; margin:0 -10px 10px; padding:10px; -webkit-box-shadow:0 3px 3px #eee; box-shadow:0 3px 3px #eee; } .login-box .new-users { display:block; border:1px solid #D1D1D1; margin:-6px -7px -7px; padding:9px; border-radius:2px 2px 5px 5px; background:-webkit-gradient(linear, 0 0, 0 100%,color-stop(0, #FCFDFD), color-stop(0.8, #EEEEEE), color-stop(1, #E8E9E9)); } .login-box .new-users p { padding:9px 0 0; } -.login-box .new-users input[type="submit"] { padding:5px 20px; background:-webkit-gradient(linear, 0 0, 0 100%, from(#F39823), to(#F37221)); font-size:14px; color:#FFF; border:1px solid #FFF; border-radius:5px; -webkit-box-shadow:0 3px 3px 0 #9F9F9F; -webkit-background-clip:padding-box; } -.messages { margin:-11px -10px 10px; } -.customer-account-login .messages .error-msg { background:-webkit-gradient(linear, left top, left bottom, color-stop(0%,#f85032), color-stop(50%,#f16f5c), color-stop(51%,#f6290c), color-stop(71%,#f02f17), color-stop(100%,#e73827)); color:#fff; padding:10px; font-size:16px; font-weight:bold; text-align:center; text-shadow:0 1px #222; } -.customer-account-logoutsuccess .page-title { background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#ccc)); border:solid #999; border-width:1px 0; border-top-color:#ccc; margin:0 -10px 10px; padding:10px; } +.login-box .new-users input[type="submit"] { + padding:5px 20px; + background:-webkit-gradient(linear, 0 0, 0 100%, from(#F39823), to(#F37221)); + background:-o-linear-gradient(top, #F39823 0%, #F37221 100%); + font-size:14px; + color:#FFF; + border:1px solid #FFF; + border-radius:5px; + -webkit-box-shadow:0 3px 3px 0 #9F9F9F; + box-shadow:0 3px 3px 0 #9F9F9F; + -webkit-background-clip:padding-box; + background-clip:padding-box; + text-shadow:0 1px 2px rgba(0, 0, 0, 0.25); +} +.customer-account-login .messages { margin:-10px -10px 10px; } +.customer-account-login .messages .error-msg { + background:-webkit-gradient(linear, left top, left bottom, color-stop(0%,#f85032), color-stop(50%,#f16f5c), color-stop(51%,#f6290c), color-stop(71%,#f02f17), color-stop(100%,#e73827)); + background:-o-linear-gradient(top, #f85032 0%, #f16f5c 50%, #f6290c 51%, #f02f17 71%, #e73827 100%); + color:#fff; + padding:10px; + font-size:16px; + font-weight:bold; + text-align:center; + text-shadow:0 1px #222; + -webkit-box-shadow:none; + box-shadow:none; +} +.customer-account-logoutsuccess .page-title { + background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#ccc)); + background:-o-linear-gradient(top, #fff 0%, #ccc 100%); + border:solid #999; + border-width:1px 0; + border-top-color:#ccc; + margin:0 -10px 10px; + padding:10px; +} #remember-me-box a { font-weight:bold; border-bottom:1px dashed; } @@ -795,7 +1067,9 @@ input[type="text"] { width:220px; text-shadow:0 -1px 1px rgba(0, 0, 0, 0.8); -webkit-box-shadow:0 2px 14px rgba(0, 0, 0, 0.5); + box-shadow:0 2px 14px rgba(0, 0, 0, 0.5); -webkit-background-clip:padding-box; + background-clip:padding-box; } #remember-me-popup h3 { margin-bottom:5px; text-align:center; } #window-overlay, @@ -811,7 +1085,9 @@ input[type="text"] { padding:5px 15px; text-align:center !important; -webkit-box-shadow:0 1px 0 rgba(255, 255, 255, 0.25), inset 0 1px 0 rgba(0, 0, 0, 0.75); + box-shadow:0 1px 0 rgba(255, 255, 255, 0.25), inset 0 1px 0 rgba(0, 0, 0, 0.75); -webkit-background-clip:padding-box; + background-clip:padding-box; } /* Forgot password @@ -819,12 +1095,14 @@ input[type="text"] { .forgot-password { margin:-10px; padding:10px; color:#333; } .forgot-password h1 { background: -webkit-gradient(linear, 0 0, 0 100%, from(white), to(#CCC)); + background:-o-linear-gradient(top, #fff 0%, #ccc 100%); border: solid #999; border-top-color: #CCC; text-shadow: 0 1px 0 white; margin:0 -10px; padding: 10px; -webkit-box-shadow: 0 3px 3px #eee; + box-shadow: 0 3px 3px #eee; border-width: 1px 0; } .forgot-password a { float:left; font-size:12px; } @@ -841,42 +1119,56 @@ input[type="text"] { width:100%; -webkit-appearance:none; -webkit-box-sizing:border-box; + box-sizing:border-box; -webkit-box-shadow:inset 1px 1px 1px rgba(0, 0, 0, 0.1); + box-shadow:inset 1px 1px 1px rgba(0, 0, 0, 0.1); } .forgot-password form { display:block; border:1px solid #D1D1D1; margin:3px -7px -7px; padding:9px 9px 30px; border-radius:2px 2px 5px 5px; background:-webkit-gradient(linear, 0 0, 0 100%,color-stop(0, #FCFDFD), color-stop(0.8, #EEEEEE), color-stop(1, #E8E9E9)); } .forgot-password form:after { content: "."; display:block; clear:both; visibility:hidden; line-height:0; height:0; } -.forgot-password input[type="submit"] { margin:5px 0 0; padding:5px 20px; background:-webkit-gradient(linear, 0 0, 0 100%, from(#F39823), to(#F37221)); font-size:14px; color:#FFF; border:1px solid #FFF; border-radius:5px; -webkit-box-shadow:0 3px 3px 0 #9F9F9F; } +.forgot-password input[type="submit"] { + background:-webkit-gradient(linear, 0 0, 0 100%, from(#F39823), to(#F37221)); + background:-o-linear-gradient(top, #F39823 0%, #F37221 100%); + margin:5px 0 0; + padding:5px 20px; + font-size:14px; + color:#FFF; + border:1px solid #FFF; + border-radius:5px; + -webkit-box-shadow:0 3px 3px 0 #9F9F9F; + box-shadow:0 3px 3px 0 #9F9F9F; + text-shadow:0 1px 2px rgba(0, 0, 0, 0.25); +} /* New Customer -----------------------------*/ .new-customer { margin:0 -10px -10px; padding:10px; color:#333; } -.new-customer h1 { background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#ccc)); border:solid #999; border-width:1px 0; border-top-color:#ccc; text-shadow:0 1px 0 #fff; margin:0 -10px 10px; padding:10px; -webkit-box-shadow:0 3px 3px #eee; } +.new-customer h1 { background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#ccc)); background:-o-linear-gradient(top, #fff 0%, #ccc 100%); border:solid #999; border-width:1px 0; border-top-color:#ccc; text-shadow:0 1px 0 #fff; margin:0 -10px 10px; padding:10px; -webkit-box-shadow:0 3px 3px #eee; box-shadow:0 3px 3px #eee; } .new-customer h2 { font-size:16px; line-height:16px; font-weight:bold; margin:0 0 7px 0; color:#333; } -.new-customer form { display:block; border:1px solid #D1D1D1; margin:-6px -7px -7px; padding:9px; border-radius:2px 2px 5px 5px; background:-webkit-gradient(linear, 0 0, 0 100%,color-stop(0, #FCFDFD), color-stop(0.8, #EEEEEE), color-stop(1, #E8E9E9)); } +.new-customer form { display:block; border:1px solid #D1D1D1; margin:-6px -7px -7px; padding:9px; border-radius:2px 2px 5px 5px; background:-webkit-gradient(linear, 0 0, 0 100%,color-stop(0, #FCFDFD), color-stop(0.8, #EEEEEE), color-stop(1, #E8E9E9)); background:-o-linear-gradient(top, #FCFDFD 0%, #eee 80%, #E8E9E9 100%); } .new-customer form:after { content: "."; display:block; clear:both; visibility:hidden; line-height:0; height:0; } .new-customer form label { font-weight:bold; } .new-customer form label em { display:none; } .new-customer .personal-information { border-bottom:1px solid #ccc; padding:0 0 10px; } .new-customer .personal-information .field { margin-bottom:8px; } .new-customer .login-information { border-top:1px solid #fff; padding-top:10px; } -.new-customer .login-information input[type="submit"] { margin:0; padding:5px 20px; background:-webkit-gradient(linear, 0 0, 0 100%, from(#F39823), to(#F37221)); font-size:14px; color:#FFF; border:1px solid #FFF; border-radius:5px; -webkit-box-shadow:0 3px 3px 0 #9F9F9F; } -.new-customer .login-information > a { float:left; display:block; padding:5px 20px; background:-webkit-gradient(linear, 0 0, 0 100%, from(#F39823), to(#F37221)); font-size:14px; color:#FFF; border:1px solid #FFF; border-radius:5px; -webkit-box-shadow:0 3px 3px 0 #9F9F9F; } +.new-customer .login-information input[type="submit"], +.new-customer .login-information > a { padding:5px 20px; background:-webkit-gradient(linear, 0 0, 0 100%, from(#F39823), to(#F37221)); background:-o-linear-gradient(top, #F39823 0%, #F37221 100%); font-size:14px; color:#FFF; border:1px solid #FFF; border-radius:5px; -webkit-box-shadow:0 3px 3px 0 #9F9F9F; box-shadow:0 3px 3px 0 #9F9F9F; text-shadow:0 1px 2px rgba(0, 0, 0, 0.25); } +.new-customer .login-information input[type="submit"] { margin:0; } +.new-customer .login-information > a { float:left; display:block; } /* Edit Account Settings -----------------------------*/ -.account-edit { - display:block; - padding:9px; - border-radius:2px 2px 5px 5px; - background:-webkit-gradient(linear, 0 0, 0 100%,color-stop(0, #FCFDFD), color-stop(0.8, #EEEEEE), color-stop(1, #E8E9E9)); - margin:0 0 -10px; - padding:10px 0 16px; - -webkit-box-shadow:inset 0 -3px 3px #ccc; -} +.account-edit {} /* Breadcrumbs -----------------------------*/ -.breadcrumbs { background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#e5e5e5)); border-bottom:1px solid #ccc; height:40px; margin:0 -10px 0; } +.breadcrumbs { + background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#e5e5e5)); + background:-o-linear-gradient(top, #fff 0%, #e5e5e5 100%); + border-bottom:1px solid #ccc; + height:40px; + margin:0 -10px 0; +} .breadcrumbs ul { padding:10px; line-height:20px; position:relative; } .breadcrumbs ul a { color:#666; } .breadcrumbs ul span, @@ -884,61 +1176,36 @@ input[type="text"] { .breadcrumbs ul li.home, .catalog-product-view .breadcrumbs li:nth-last-child(2), .catalog-category-view .breadcrumbs li:nth-last-child(2), -.review-product-list .breadcrumbs li:nth-last-child(2) { top:7px; left:20px; position:absolute; } +.review-product-list .breadcrumbs li:nth-last-child(2) { display:none; top:7px; left:20px; position:absolute; } .breadcrumbs ul li:last-child { display:block; font-size:16px; font-weight:bold; text-align:center; text-shadow:0 1px 0 #fff; margin:0 auto; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; width:50%; } /* Back Button -----------------------------*/ -.catalog-product-view .breadcrumbs .home, -.catalog-category-view .breadcrumbs .home, -.review-product-list .breadcrumbs .home { - display:none; -} -.catalog-product-view .breadcrumbs li:nth-last-child(2), -.catalog-category-view .breadcrumbs li:nth-last-child(2), -.review-product-list .breadcrumbs li:nth-last-child(2) { - display:block; -} -.breadcrumbs ul li.home:before, -#nav-container li.subcategory-header .button-wrap:before, -.catalog-product-view .breadcrumbs li:nth-last-child(2):before, -.catalog-category-view .breadcrumbs li:nth-last-child(2):before, -.review-product-list .breadcrumbs li:nth-last-child(2):before, -.my-account .product-review .buttons-set .back-link:before, -.review-customer-index .buttons-set .back-link:before, -.customer-address-form .buttons-set .back-link:before { +#nav-container li.subcategory-header .button-wrap:before { content:''; - background:-webkit-gradient(linear, left top, right bottom, color-stop(0.10, #eee), color-stop(0.28, #e2e2e2), color-stop(0.9, #c4c4c4)); - border:1px solid #b3b3b3; - height:17px; - width:17px; + background:url(../images/bg_button.png) no-repeat left top; + -webkit-background-size:100px 28px; + background-size:100px 28px; + height:28px; + width:28px; position:absolute; - top:4px; - left:-10px; + top:0; + left:-13px; z-index:2; - -webkit-transform:rotate(45deg); -} -.breadcrumbs ul li.home a, -#nav-container li.subcategory-header button, -.catalog-product-view .breadcrumbs li:nth-last-child(2) a, -.catalog-category-view .breadcrumbs li:nth-last-child(2) a, -.review-product-list .breadcrumbs li:nth-last-child(2) a, -.my-account .product-review .buttons-set .back-link a, -.review-customer-index .buttons-set .back-link a, -.customer-address-form .buttons-set .back-link a { +} +#nav-container li.subcategory-header button { color:#2f2f2f; + background:url(../images/bg_button.png) no-repeat right top; + background-size:100px 28px; display:inline-block; - font-size:10px; + font-size:11px; + text-shadow:0 1px 0 rgba(255, 255, 255, 0.5); line-height:15px; margin:0 ; - padding:5px 5px 5px 0; + padding:6px 9px 7px 2px; position:relative; - border:solid #b3b3b3; - border-width:1px 1px 1px 0; - border-top-right-radius:5px; - border-bottom-right-radius:5px; + border:none; font-weight:bold; - background:-webkit-gradient(linear, 0 0, 0 100%, color-stop(0.10, #eee), color-stop(0.28, #e2e2e2), color-stop(0.9, #c4c4c4)); z-index:3; -webkit-appearance:none; max-width:50px; @@ -951,7 +1218,6 @@ input[type="text"] { .catalogsearch-result-index .breadcrumbs:first-child { display:none; } .catalogsearch-result-index .note-msg { padding:10px 0 0; } - /* Catalog List -----------------------------*/ section .category-title { display:none; } @@ -1094,6 +1360,7 @@ section .category-title { display:none; } .toolbar .sort-by select, .toolbar .limiter select { background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#dedede)); + background:-o-linear-gradient(top, #fff 0%, #dedede 100%); border:1px solid #bbb; border-radius:4px; color:#707070; @@ -1103,7 +1370,9 @@ section .category-title { display:none; } line-height:17px; vertical-align:middle; -webkit-box-shadow:0 0 5px rgba(0, 0, 0, 0.15); + box-shadow:0 0 5px rgba(0, 0, 0, 0.15); -webkit-background-clip:padding-box; + background-clip:padding-box; } .toolbar .limiter select { vertical-align:baseline; @@ -1132,6 +1401,7 @@ section .category-title { display:none; } .toolbar .grid, .toolbar .list { background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#dedede)); + background:-o-linear-gradient(top, #fff 0%, #dedede 100%); border:1px solid #bbb; border-radius:5px; display:inline-block; @@ -1143,7 +1413,9 @@ section .category-title { display:none; } width:27px; text-indent:-999em; -webkit-box-shadow:0 0 5px rgba(0, 0, 0, 0.15); + box-shadow:0 0 5px rgba(0, 0, 0, 0.15); -webkit-background-clip:padding-box; + background-clip:padding-box; } .toolbar .grid:after, .toolbar .list:after { @@ -1220,11 +1492,16 @@ section .category-title { display:none; } .c-list > li > a { background:url(../images/i_arrow_small.png) no-repeat right #fff; -webkit-background-size:8px 12px; + background-size:8px 12px; -webkit-background-origin:content-box; + background-origin:content-box; color:#2f2f2f; display:block; padding:10px; + -webkit-user-select:none; + user-select:none; -webkit-touch-callout:none; + touch-callout:none; -webkit-tap-highlight-color:rgba(0,0,0,0); } .c-list > li > a:after { @@ -1244,16 +1521,50 @@ section .category-title { display:none; } width:100%; z-index:0; -webkit-box-sizing:border-box; + box-sizing:border-box; +} + +.csstransforms .c-list li > .actions { + -moz-transform:translate(-100%, 0); + -webkit-transform:translate(-100%, 0); + -o-transform:translate(-100%, 0); + transform:translate(-100%, 0); +} + +.csstransforms .c-list > li.animated > .actions { + -moz-transition:all .5s linear; + -webkit-transition:all .5s linear; + -o-transition:all .5s linear; + transition:all .5s linear; + -moz-transform:translate(0, 0); + -webkit-transform:translate(0, 0); + -o-transform:translate(0, 0); + transform:translate(0, 0); +} + +.csstransforms .c-list > li.end-animation > .actions { + -moz-transition:all .5s linear; + -webkit-transition:all .5s linear; + -o-transition:all .5s linear; + transition:all .5s linear; + -moz-transform:translate(-100%, 0); + -webkit-transform:translate(-100%, 0); + -o-transform:translate(-100%, 0); + transform:translate(-100%, 0); +} + +.csstransforms3d .c-list li > .actions { -webkit-perspective:1000; -webkit-backface-visibility:hidden; -webkit-transform:translateX(-100%); } -.c-list > li.animated > .actions { + +.csstransforms3d .c-list > li.animated > .actions { -webkit-animation:bounce 500ms; -webkit-transform:translateX(0); } -.c-list > li.end-animation > .actions { +.csstransforms3d .c-list > li.end-animation > .actions { -webkit-transition:all 250ms linear; -webkit-transform:translateX(-100%); } @@ -1272,35 +1583,42 @@ section .category-title { display:none; } border:1px solid; border-color:#ddd #d4d4d4 #ccc; border-radius:2px; + display:table; background:-webkit-gradient(linear, 0 0, 0 100%, from(#F1F1F1), to(#E0DFE0)); - padding:3px 3px 0; - height:68px; + background:-o-linear-gradient(top, #F1F1F1 0%, #E0DFE0 100%); + width:100%; + height:73px; -webkit-box-shadow:0 0 3px rgba(0, 0, 0, 0.1); + box-shadow:0 0 3px rgba(0, 0, 0, 0.1); } @media(orientation:landscape) { .c-list li > .actions ul { - padding-top:10px; - height:61px; } } .c-list li > .actions ul li { - display:inline-block; - width:20%; + display:table-cell; text-align:center; line-height:1; } -.c-list li > .actions ul li:first-child, -.c-list li > .actions ul li:last-child { - width:17%; -} .c-list li > .actions ul li a { + display:inline-block; + padding:3px; + max-width:44px; font-size:10px; color:#4B4B4B; + text-shadow:0 1px 0 #fff; } -.c-list li > .actions a { +.c-list li > .actions i { + display:inline-block; + border-radius:2px; + margin-bottom:2px; + height:37px; + width:37px; + clear:both; + border:1px solid #cdcdcd; } .c-list li > .actions .i-view-details i { @@ -1323,22 +1641,14 @@ section .category-title { display:none; } background:url(../images/i_add_to_wishlist.png) no-repeat #fff top; } -.c-list li > .actions i { - display:block; - height:37px; - width:37px; - margin:0 auto; - clear:both; - border:1px solid #cdcdcd; -} .c-list h1 { font-size:16px; font-weight:bold; } .c-list .cloned-wrap, -.c-grid .cloned-wrap { position:absolute; padding:10px; } +.c-grid .cloned-wrap { position:absolute; padding:10px; opacity:0; } .c-list .cloned-wrap .product-image img, -.c-grid .cloned-wrap .product-image img { -webkit-box-shadow:none; } +.c-grid .cloned-wrap .product-image img { -webkit-box-shadow:none; box-shadow:none; } .c-list .product-image { float:left; margin-right:10px; -webkit-transform:translate3d(0,0,0); } .c-list .product-image img, -.c-grid .product-image img { background:#fff; border:1px solid #ccc; border-radius:1px; padding:3px; -webkit-box-shadow:0 1px 5px rgba(0,0,0,0.28); } +.c-grid .product-image img { background:#fff; border:1px solid #ccc; border-radius:1px; padding:3px; -webkit-box-shadow:0 1px 5px rgba(0,0,0,0.28); box-shadow:0 1px 5px rgba(0,0,0,0.28); } .c-list .product-shop { overflow:hidden; padding-right:30px; } .c-list .product-shop h1 { font-size:14px; font-weight:bold; text-align:left; margin:5px 0 7px; } .c-list .product-shop .price-box { font-size:11px; margin:0 0 5px; } @@ -1347,6 +1657,7 @@ section .category-title { display:none; } background:#eee; display:table; border-collapse:collapse; + border-spacing:0; margin:-1px 0 0; width:100%; -webkit-tap-highlight-color:rgba(0,0,0,0); @@ -1356,16 +1667,22 @@ section .category-title { display:none; } } .c-grid .cell { background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#eee)); + background:-o-linear-gradient(top, #fff 0%, #eee 100%); display:table-cell; + position:relative; border:1px solid #ccc; vertical-align:top; width:50%; } .c-grid.ready .cell { - background:url(data:image/png;base64,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); + background:#ccc; -webkit-box-shadow:inset 0 -10px 10px rgba(0, 0, 0, 0.25), inset 0 10px 10px rgba(0, 0, 0, 0.25), inset -10px 0 10px rgba(0, 0, 0, 0.25), inset 10px 0 10px rgba(0, 0, 0, 0.25); + box-shadow:inset 0 -10px 10px rgba(0, 0, 0, 0.25), inset 0 10px 10px rgba(0, 0, 0, 0.25), inset -10px 0 10px rgba(0, 0, 0, 0.25), inset 10px 0 10px rgba(0, 0, 0, 0.25); -webkit-touch-callout:none; } +@media all and (-webkit-transform-3d) { + .c-grid.ready .cell { background:url(data:image/png;base64,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); } +} .c-grid .position-wrap { position:relative; } @@ -1395,14 +1712,11 @@ section .category-title { display:none; } display:inline-block; height:100%; width:100%; - -webkit-transform-style:preserve-3d; - -webkit-transition:ease-in-out 600ms; } .c-grid .flip-block .wrap { padding:15px 10px 10px;; } .c-grid .flip-block.active { - -webkit-transform:rotateY(180deg); } .c-grid .cloned-wrap { top:0; @@ -1431,11 +1745,9 @@ section .category-title { display:none; } 100% { -webkit-transform:rotate(3deg) skew(1deg) scale(1.2); } } -.c-grid .flip-block.active .i-flip { - -webkit-transform:rotate(360deg); -} .c-grid .flip-block .front { background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#eee)); + background:-o-linear-gradient(top, #fff 0%, #eee 100%); } .c-grid .flip-block .front, .c-grid .flip-block .back { @@ -1447,8 +1759,23 @@ section .category-title { display:none; } } .c-grid .flip-block .back { background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#eee)); + background:-o-linear-gradient(top, #fff 0%, #eee 100%); position:absolute; - -webkit-transform:rotateY(180deg) translate3d(0, 0, 1px); +} +.c-grid .flip-block.active .back { + z-index:1; +} +@media all and (-webkit-transform-3d) { + .c-grid .flip-block { + -webkit-transform-style:preserve-3d; + -webkit-transition:ease-in-out 600ms; + } + .c-grid .flip-block.active { + -webkit-transform:rotateY(180deg); + } + .c-grid .flip-block .back { + -webkit-transform:rotateY(180deg) translate3d(0, 0, 1px); + } } .c-grid .back-face { padding:10px; } .c-grid .back-face .rating-box { display:inline-block; } @@ -1458,6 +1785,7 @@ section .category-title { display:none; } .c-grid .back-face .price-box .special-price .price { font-weight:bold; } .c-grid .back-face .add-to-cart { background:-webkit-gradient(linear, 0 0, 0 100%, from(#F39823), to(#F37221)); + background:-o-linear-gradient(top, #F39823 0%, #F37221 100%); border:1px solid #fff; border-radius:5px; color:#fff; @@ -1467,7 +1795,9 @@ section .category-title { display:none; } padding:5px 10px; text-shadow:0 1px 0 #999; -webkit-box-shadow:0 3px 3px 0 #9F9F9F; + box-shadow:0 3px 3px 0 #9F9F9F; -webkit-background-clip:padding-box; + background-clip:padding-box; } .c-grid .back-face .rating-links .separator, .c-grid .back-face .rating-links .separator + a { @@ -1486,6 +1816,9 @@ section .category-title { display:none; } .catalog-product-view .messages { margin:0 -10px 0; } .product-view { padding:0 0 0; } .product-shop { padding:8px 0 0; } +.product-shop a { color:#fb6b36; text-decoration:underline; } +.product-shop .item-options { margin:0 0 10px; } +.product-shop .item-options dt { font-weight:bold; } .product-shop .product-image-and-actions { float:left; margin:0 10px 0 0; } .product-shop .product-image-wrap { position:relative; max-width:150px; } .product-shop .product-image { position:relative; } @@ -1494,7 +1827,9 @@ section .category-title { display:none; } display:block; background:url(../images/search_icon.png) no-repeat 0 0; -webkit-background-size:14px 14px; + background-size:14px 14px; -webkit-background-origin:padding-box; + background-origin:padding-box; position:absolute; top:7px; right:7px; @@ -1502,16 +1837,13 @@ section .category-title { display:none; } width:14px; z-index:1; } -.product-shop .product-image-wrap img { -webkit-border-radius:1px; -webkit-box-shadow:0 0 3px #D1D1D1; -webkit-transition:-webkit-transform ease-in 300ms; position:relative; } +.product-shop .product-image-wrap img { -webkit-border-radius:1px; -webkit-box-shadow:0 0 3px #D1D1D1; box-shadow:0 0 3px #D1D1D1; -webkit-transition:-webkit-transform ease-in 300ms; position:relative; } .product-shop .product-image-wrap img.animate { z-index:101; } .product-shop .product-image-wrap img.cloned { position:absolute; top:0; left:0; } .product-shop .product-image .carousel-items li { padding:2px 2px 0; } .product-shop .product-image .more-views { padding:3px 0 0 0; } .product-shop .wrap:before, .product-shop .wrap:after { content: ""; display: table; } .product-shop .wrap:after { clear:both; } -.product-shop >.product-actions { - margin-bottom:10px; -} .product-view .add-to-links, @@ -1537,20 +1869,43 @@ section .category-title { display:none; } .product-essential .product-options input[type=text]:disabled { background:#ddd; } .product-essential .product-options .qty-holder { display:block; margin:5px 0 0; } .product-essential .product-options .options-list li { padding:10px 0 0; } +.product-essential .product-options .options-list a { color:#fb6b36; text-decoration:underline; } -.product-essential .product-options-bottom .price-box { float:right; width:50%; } +.product-essential .product-options-bottom { background:#fefefe; position:relative; } +.product-essential .product-options-bottom .required { margin:10px 0; } +.product-essential .product-options-bottom .price-box { float:right; max-width:50%; } .product-essential .product-options-bottom .price-box .price-as-configured { text-align:right; } .product-essential .product-options-bottom .price-box .price-as-configured .price { display:block; font-size:18px; line-height:26px; text-shadow:0 1px 0 #fff; text-align:right; } -.product-essential .product-options-bottom .add-to-cart { float:left; width:50%; margin:0 0 15px; } -.product-essential .product-options-bottom .add-to-cart label { display:inline-block; font-size:14px; font-weight:bold; margin-bottom:50px; } -.product-essential .product-options-bottom .add-to-cart input[type=text] { display:inline-block; margin-bottom:10px; width:40px; font-size:12px; } -.product-essential .product-options-bottom .add-to-cart button { display:block; float:right; margin:50px -100% 0 0; padding:5px 20px; background:-webkit-gradient(linear, 0 0, 0 100%, from(#F39823), to(#F37221)); font-size:14px; color:#FFF; border:1px solid #FFF; border-radius:5px; -webkit-box-shadow:0 3px 3px 0 #9F9F9F; } +.product-essential .product-options-bottom .add-to-cart { float:left; width:50%; } +.product-essential .product-options-bottom .add-to-cart label { display:inline-block; font-size:14px; font-weight:bold; vertical-align:middle; } +.product-essential .product-options-bottom .add-to-cart input[type=text] { display:inline-block; width:40px; font-size:12px; vertical-align:middle; } +.product-essential .product-options-bottom button { + display:block; + padding:5px 20px; + background:-webkit-gradient(linear, 0 0, 0 100%, from(#F39823), to(#F37221)); + background:-o-linear-gradient(top, #F39823 0%, #F37221 100%); + font-size:14px; + color:#FFF; + clear:both; + float:right; + border:1px solid #FFF; + border-radius:5px; + margin:10px 0; + text-shadow:0 1px 2px rgba(0, 0, 0, 0.25); + -webkit-box-shadow:0 3px 3px 0 #9F9F9F; + box-shadow:0 3px 3px 0 #9F9F9F; +} .product-shop .price-box { overflow:hidden; } .product-shop .price-box .price-label { vertical-align:baseline; } .product-shop .price-box .old-price { color:#ccc; } .product-shop .price-box .special-price .price-label { color:#222; } .product-shop .price-box .special-price .price { font-weight:bold; } + .price-box .price-excluding-tax, + .price-box .price-including-tax { display:block; } + .price-box .price-excluding-tax .label, + .price-box .price-including-tax .label { font-weight:bold; } + .product-shop .product-desc { display:table;} .product-shop .product-desc .ratings { overflow:hidden; } .product-shop .product-desc .ratings, @@ -1558,28 +1913,32 @@ section .category-title { display:none; } .rating-box { background:url(../images/i_star_black.png) repeat-x center left; background-size:15px 15px; width:75px; height:15px; margin:3px 0; } .rating-box .rating { height:15px; background:url(../images/i_star.png) repeat-x center left; background-size:15px 15px; } -.product-shop .product-options-bottom .price-box { font-size:14px; font-weight:bold; text-align:right; } +.product-shop .product-options-bottom .price-box { font-size:14px; text-align:right; } +.product-shop .product-options-bottom .price-box .price { font-weight:bold; } .product-shop .product-options-bottom .add-to-cart label, .product-shop .product-options-bottom .add-to-cart input[type=text] { vertical-align:middle; margin:0; } -.product-shop .product-options-bottom .add-to-cart button { margin:30px -100% 0 0; } -.product-shop .product-options-bottom .product-actions { margin-bottom:10px; } +.product-shop .product-options-bottom .product-actions { margin:5px 0 10px; } .product-shop .product-options-bottom .product-actions li { display:table-cell; } .product-shop .add-to-cart-box { padding:5px 0; } .product-shop .add-to-cart-box label { vertical-align:middle; } -.product-shop .add-to-cart-box .qty { border:1px solid #ccc; border-radius:3px; font-size:12px; font-weight:bold; margin:0 0 0 5px; padding:4px 5px; -webkit-appearance:none; -webkit-background-clip:padding-box; width:35px; -webkit-box-sizing:content-box; vertical-align:middle; } +.product-shop .add-to-cart-box .qty { border:1px solid #ccc; border-radius:3px; font-size:12px; font-weight:bold; margin:0 0 0 5px; padding:4px 5px; -webkit-appearance:none; -webkit-background-clip:padding-box; background-clip:padding-box; width:35px; -webkit-box-sizing:content-box; box-sizing:content-box; vertical-align:middle; } .product-shop .add-to-cart-box button { clear:both; display:block; margin:0; padding:5px 20px; background:-webkit-gradient(linear, 0 0, 0 100%, from(#F39823), to(#F37221)); + background:-o-linear-gradient(top, #F39823 0%, #F37221 100%); font-size:14px; color:#FFF; border:1px solid #FFF; border-radius:5px; + text-shadow:0 1px 2px rgba(0, 0, 0, 0.25); -webkit-box-shadow:0 3px 3px 0 #9F9F9F; + box-shadow:0 3px 3px 0 #9F9F9F; -webkit-background-clip:padding-box; + background-clip:padding-box; } .product-shop .add-to-cart-box input + button { margin-top:10px; } @media (orientation: landscape) { @@ -1587,10 +1946,44 @@ section .category-title { display:none; } } .product-shop .product-image-and-actions .actions { margin:15px 0 0; } -.product-shop .product-image-and-actions .actions a { display:block; text-align:center; width:100px; margin:5px 0 0; padding:4px 10px; background:-webkit-gradient(linear, 0 0, 0 100%, from(#FFF), to(#C1C3C4)); font-size:12px; font-weight:bold; color:#636363; border:1px solid #FFF; border-radius:5px; -webkit-box-shadow:0 0 3px 0 #9F9F9F; } +.product-shop .product-image-and-actions .actions a { display:block; text-align:center; width:100px; margin:5px 0 0; padding:4px 10px; background:-webkit-gradient(linear, 0 0, 0 100%, from(#FFF), to(#C1C3C4)); background:-o-linear-gradient(top, #FFF 0%, #C1C3C4 100%); font-size:12px; font-weight:bold; color:#636363; border:1px solid #FFF; border-radius:5px; -webkit-box-shadow:0 0 3px 0 #9F9F9F; box-shadow:0 0 3px 0 #9F9F9F; } .product-shop .product-image-and-actions .actions a:last-child { margin:5px 0 10px; } -#product-options-wrapper { margin:10px 0; padding:5px 10px; border:1px solid #FFF; border-radius:5px; background:-webkit-gradient(linear, 0 0, 0 100%, from(#F6F6F6), to(#C5C5C5)); -webkit-box-shadow:0 0 3px 0 #9F9F9F; } +#product-options-wrapper dl, .giftcard-send-form { + background:-webkit-gradient(linear, 0 0, 0 100%, from(#F6F6F6), to(#C5C5C5)); + background:-o-linear-gradient(top, #F6F6F6 0%, #C5C5C5 100%); + margin:10px 0; + padding:5px 10px; + border:1px solid #FFF; + border-radius:5px; + -webkit-box-shadow:0 0 3px 0 #9F9F9F; + box-shadow:0 0 3px 0 #9F9F9F; +} + +/* +.product-essential .product-options dt label { font-size:14px; font-weight:bold; } +.product-essential .product-options dt label em { float:left; margin:0 4px 0 0; color:#F9721F; } +.product-essential .product-options dd { border-bottom:1px solid #bbb; padding:0 0 10px; } +.product-essential .product-options dd + dt { border-top:1px solid rgba(255, 255, 255, 0.75); padding:10px 0 0; } +.product-essential .product-options dd:last-child { border:none; } +.product-essential .product-options select { width:100%; } +.product-essential .product-options input[type=text] { font-size:12px; width:20%; } +.product-essential .product-options input[type=text]:disabled { background:#ddd; } +.product-essential .product-options .qty-holder { display:block; margin:5px 0 0; } +.product-essential .product-options .options-list li { padding:10px 0 0; } +*/ + +.giftcard-send-form em { color:#f9721f; margin:0 4px 0 0; } +.giftcard-send-form label { display:block; font-size:14px; font-weight:bold; margin:0 0 2px; } +.giftcard-send-form select { font-size:18px; width:100%; } +.giftcard-send-form li { border-bottom:1px solid #bbb; margin:0; padding:0 0 8px; } +.giftcard-send-form li + li { border-top:1px solid rgba(255, 255, 255, 0.75); padding:8px 0 0; } +.giftcard-send-form li:last-child { border-bottom:none; } +.giftcard-send-form .field { margin-bottom:8px; } +.giftcard-send-form .gift-card-amount-field { padding:0; } +.giftcard-send-form .notice { text-align:right; } +.giftcard-send-form .notice span { float:left; font-size:11px; display:block; } +.giftcard-send-form .notice span:last-child { float:none; } #product-attribute-specs-table { width:100%; border-collapse:collapse; } #product-attribute-specs-table th, @@ -1601,6 +1994,7 @@ section .category-title { display:none; } .grouped-items-table { border:1px solid #ccc; font-size:11px; line-height:13px; margin:0 0 5px; -webkit-border-radius:5px; } .grouped-items-table th { background:-webkit-gradient(linear, 0 0, 0 100%, from(#f6f6f6), to(#ccc)); + background:-o-linear-gradient(top, #f6f6f6 0%, #ccc 100%); border-bottom:1px solid #bbb; padding:2px 2px 3px; } @@ -1615,7 +2009,10 @@ section .category-title { display:none; } padding:5px 10px 10px; margin:10px 0 0; border-radius:5px; - background:-webkit-gradient(linear, 0 0, 0 100%, from(#F6F6F6), to(#C5C5C5)); -webkit-box-shadow:0 0 3px 0 #9F9F9F; + background:-webkit-gradient(linear, 0 0, 0 100%, from(#f6f6f6), to(#c5c5c5)); + background:-o-linear-gradient(top, #f6f6f6 0%, #c5c5c5 100%); + -webkit-box-shadow:0 0 3px 0 #9F9F9F; + box-shadow:0 0 3px 0 #9F9F9F; } .product-shop .grouped-grid .add-to-cart-box { @@ -1645,7 +2042,9 @@ section .category-title { display:none; } width:25px; -webkit-appearance:none; -webkit-background-clip:padding-box; + background-clip:padding-box; -webkit-box-sizing:content-box; + box-sizing:content-box; } .catalog-product-gallery .product-gallery { @@ -1670,6 +2069,7 @@ section .category-title { display:none; } .catalog-product-gallery .product-gallery li img { vertical-align:bottom; -webkit-box-shadow:0 0 6px rgba(0, 0, 0, 0.25); + box-shadow:0 0 6px rgba(0, 0, 0, 0.25); } .catalog-product-gallery .product-gallery .prev, .catalog-product-gallery .product-gallery .next { @@ -1689,6 +2089,7 @@ section .category-title { display:none; } .catalog-product-gallery .add-to-cart { background:-webkit-gradient(linear, 0 0, 0 100%, from(#F39823), to(#F37221)); + background:-o-linear-gradient(top, #F39823 0%, #F37221 100%); display:inline-block; padding:4px 7px 5px; font-size:12px; @@ -1698,12 +2099,22 @@ section .category-title { display:none; } position:absolute; top:50px; right:5px; + text-shadow:0 1px 2px rgba(0, 0, 0, 0.25); -webkit-background-clip:padding-box; } .product-collateral { clear:both; } +.product-collateral .box-description { padding:10px 0 0; } .product-collateral .box-additional h2 { margin:0 0 10px; } -.product-collateral .collateral-box { padding:5px 10px; border:1px solid #FFF; border-radius:5px; background:-webkit-gradient(linear, 0 0, 0 100%, from(#F6F6F6), to(#C5C5C5)); -webkit-box-shadow:0 0 3px 0 #9F9F9F; } +.product-collateral .collateral-box { + background:-webkit-gradient(linear, 0 0, 0 100%, from(#F6F6F6), to(#C5C5C5)); + background:-o-linear-gradient(top, #F6F6F6 0%, #C5C5C5 100%); + padding:5px 10px; + border:1px solid #FFF; + border-radius:5px; + -webkit-box-shadow:0 0 3px 0 #9F9F9F; + box-shadow:0 0 3px 0 #9F9F9F; +} .product-collateral h2, .product-collateral h4 { font-size:14px; font-weight:bold; } .product-specs { font-size:14px; text-align:justify; word-spacing:-0.2ex; } @@ -1713,6 +2124,7 @@ section .category-title { display:none; } .up-sell-box .prev, .up-sell-box .next { background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#dcdcdc)); + background:-o-linear-gradient(top, #fff 0%, #dcdcdc 100%); border:1px solid #bebebe; display:block; position:absolute; @@ -1721,6 +2133,7 @@ section .category-title { display:none; } height:24px; width:24px; -webkit-border-radius:5px; + border-radius:5px; z-index:1; } .up-sell-box .prev.disabled, @@ -1731,9 +2144,12 @@ section .category-title { display:none; } .up-sell-box .prev:after { border-top:5px solid transparent; border-right:10px solid #000; border-bottom:5px solid transparent; right:8px; } .up-sell-box .next:after { border-top:5px solid transparent; border-left:10px solid #000; border-bottom:5px solid transparent; left:8px; } .carousel-wrap { overflow:hidden; position:relative; width:100%; } - .carousel-wrap .carousel-items { white-space:nowrap; -webkit-transition:all 150ms linear; -webkit-transform:translateX(0); -webkit-perspective:1000; -webkit-backface-visibility:hidden; } - .carousel-wrap li { display:inline-block; vertical-align:top; padding:0 5px; white-space:normal; -webkit-box-sizing:border-box; } - .up-sell-box .product-image { background:#fff; display:inline-block; padding:3px; border:1px solid #ccc; -webkit-box-shadow:0 1px 2px #999; text-align:center; } + .carousel-wrap .carousel-items { white-space:nowrap; -webkit-transition:all 150ms linear; -moz-transition:all 250ms linear; -o-transition:all 250ms linear; transition:all 250ms linear; } + @media all and (-webkit-transform-3d) { + .carousel-wrap .carousel-items { -webkit-transform:translateX(0); -webkit-perspective:1000; -webkit-backface-visibility:hidden; } + } + .carousel-wrap li { display:inline-block; vertical-align:top; padding:0 5px; white-space:normal; -webkit-box-sizing:border-box; box-sizing:border-box; } + .up-sell-box .product-image { background:#fff; display:inline-block; padding:3px; border:1px solid #ccc; -webkit-box-shadow:0 1px 2px #999; box-shadow:0 1px 2px #999; text-align:center; } .up-sell-box .up-sell h5 { font-size:12px; line-height:17px; margin:5px 0; } .up-sell-box .up-sell .price-box { font-size:12px; line-height:17px; } .up-sell li .price-box { font-weight:bold; } @@ -1757,6 +2173,7 @@ section .category-title { display:none; } .compare-clear-all, .compare-back-link a { background:-webkit-gradient(linear, 0 0, 0 100%, from(#ddd), to(#eee)); + background:-o-linear-gradient(top, #ddd 0%, #eee 100%); color:#000; text-shadow:1px 1px 0 #fff; display:inline-block; @@ -1770,7 +2187,8 @@ section .category-title { display:none; } } .compare-clear-all { color:#fff; - background:-webkit-gradient(linear, left top, left bottom, color-stop(0%,#f85032), color-stop(50%,#f16f5c), color-stop(51%,#f6290c), color-stop(71%,#f02f17), color-stop(100%,#e73827)); + background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #f85032), color-stop(50%, #f16f5c), color-stop(51%, #f6290c), color-stop(71%, #f02f17), color-stop(100%, #e73827)); + background:-o-linear-gradient(top, #f85032 0%, #f16f5c 50%, #f6290c 51%, #f02f17 71%, #e73827 100%); border:1px solid #777; border-radius:5px; display:inline-block; @@ -1783,6 +2201,7 @@ section .category-title { display:none; } .compare-back-link:before { content:''; background:-webkit-gradient(linear, 0 0, 0 100%, from(#ddd), to(#eee)); + background:-o-linear-gradient(top, #ddd 0%, #eee 100%); border:1px solid #999; height:18px; width:18px; @@ -1796,11 +2215,12 @@ section .category-title { display:none; } .compare-table th, .compare-table td { background:#fff; border:1px solid #ccc; padding:5px 15px; vertical-align:top; } .compare-table td a { color:#fb6b36; } -.compare-table th { background:url(../images/fabric.jpg) repeat; border:none; -webkit-box-shadow:inset -3px 0 3px -3px #ccc; text-shadow:1px 1px 1px #fff; text-align:left; position:relative; padding:5px 10px 5px 10px; } +.compare-table th { background:url(../images/fabric.jpg) repeat; border:none; -webkit-box-shadow:inset -3px 0 3px -3px #ccc; box-shadow:inset -3px 0 3px -3px #ccc; text-shadow:1px 1px 1px #fff; text-align:left; position:relative; padding:5px 10px 5px 10px; } .compare-table tr:nth-child(even) td { background:#f6f6f6; } .compare-table .move-left, .compare-table .move-right { background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#eee)); + background:-o-linear-gradient(top, #fff 0%, #eee 100%); border:1px solid #c4c4c4; border-radius:5px; display:inline-block; @@ -1809,6 +2229,7 @@ section .category-title { display:none; } height:16px; width:10px; -webkit-box-shadow:0 0 2px rgba(0, 0, 0, 0.15); + box-shadow:0 0 2px rgba(0, 0, 0, 0.15); } .compare-table .move-left:after, .compare-table .move-right:after { content:''; position:absolute; top:8px; z-index:2; font-size:0; line-height:0; width:0; } @@ -1838,9 +2259,19 @@ section .category-title { display:none; } -webkit-transition:-webkit-transform 300ms linear; -webkit-transform:translate3d(0, 0, 5px) !important; } -.compare-table .collapsible .nobr { background:-webkit-gradient(linear, 0 0, 0 100%, from(#f6f6f6), to(#bbb)); border:1px solid #aaa; border-radius:7px; -webkit-box-shadow:inset 0 1px 3px rgba(0, 0, 0, 0.15), 0 1px 0 #fff; } +.compare-table .collapsible .nobr { + background:-webkit-gradient(linear, 0 0, 0 100%, from(#f6f6f6), to(#bbb)); + background:-o-linear-gradient(top, #f6f6f6 0%, #bbb 100%); + border:1px solid #aaa; + border-radius:7px; + -webkit-box-shadow:inset 0 1px 3px rgba(0, 0, 0, 0.15), 0 1px 0 #fff; + box-shadow:inset 0 1px 3px rgba(0, 0, 0, 0.15), 0 1px 0 #fff; +} .compare-table .collapsible .nobr:active, -.compare-table .collapsible.collapsed .nobr { background:-webkit-gradient(linear, 0 0, 0 100%, from(#ddd), to(#ccc)); } +.compare-table .collapsible.collapsed .nobr { + background:-webkit-gradient(linear, 0 0, 0 100%, from(#ddd), to(#ccc)); + background:-o-linear-gradient(top, #ddd 0%, #ccc 100%); +} .compare-table .collapsible .nobr:before { content:''; background:url(../images/i_arrow_white.png) no-repeat 0 0; @@ -1861,6 +2292,7 @@ section .category-title { display:none; } .compare-table .product-name a { color:#000; } .compare-table .btn-cart { background:-webkit-gradient(linear, 0 0, 0 100%, from(#F39823), to(#F37221)); + background:-o-linear-gradient(top, #F39823 0%, #F37221 100%); border:1px solid #fff; border-radius:5px; color:#fff; @@ -1869,12 +2301,14 @@ section .category-title { display:none; } margin-left:-2px; margin-bottom:7px; padding:5px 10px; - text-shadow:0 1px 0 #999; + text-shadow:0 1px 2px rgba(0, 0, 0, 0.25); -webkit-box-shadow:0 3px 3px 0 #9F9F9F; + box-shadow:0 3px 3px 0 #9F9F9F; -webkit-background-clip:padding-box; + background-clip:padding-box; } .compare-table .btn-remove { -webkit-transform:translate3d(0, 0, 0); } -.compare-table .product-image { background:#fff; display:inline-block; margin:4px 0 10px; padding:3px; position:relative; border:1px solid #ccc; -webkit-box-shadow:0 1px 2px #ccc; text-align:center; } +.compare-table .product-image { background:#fff; display:inline-block; margin:4px 0 10px; padding:3px; position:relative; border:1px solid #ccc; -webkit-box-shadow:0 1px 2px #ccc; box-shadow:0 1px 2px #ccc; text-align:center; } .compare-table .product-image img {} .compare-table .loader { background:url(../images/loader.gif) no-repeat center rgba(0, 0, 0, 0.05); background-size:20px 20px; float:right; height:20px; width:20px; } @@ -1914,26 +2348,58 @@ section .category-title { display:none; } width:100%; -webkit-appearance:none; -webkit-box-sizing:border-box; + box-sizing:border-box; -webkit-box-shadow:inset 1px 1px 1px rgba(0, 0, 0, 0.1); + box-shadow:inset 1px 1px 1px rgba(0, 0, 0, 0.1); } .review-product-list .pager, .review-product-list .form-add h2, .review-product-list .form-add h3, .review-product-list .form-add h4 em { display:none; } -.review-product-list .form-add h4 { background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#e5e5e5)); border-bottom:1px solid #ccc; border-radius:5px 5px 0 0; margin:0 -10px 0; padding:10px; text-shadow:1px 1px #fff; } -.review-product-list .form-add { background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#eee)); border:1px solid #ccc; margin:10px 0 5px; padding:0 10px 15px; border-radius:5px; -webkit-box-shadow:0 1px 3px #ccc; } +.review-product-list .form-add h4 { + background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#e5e5e5)); + background:-o-linear-gradient(top, #fff 0%, #e5e5e5 100%); + border-bottom:1px solid #ccc; + border-radius:5px 5px 0 0; + margin:0 -10px 0; + padding:10px; + text-shadow:1px 1px #fff; +} +.review-product-list .form-add { + background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#eee)); + background:-o-linear-gradient(top, #fff 0%, #eee 100%); + border:1px solid #ccc; + margin:10px 0 5px; + padding:0 10px 15px; + border-radius:5px; + -webkit-box-shadow:0 1px 3px #ccc; + box-shadow:0 1px 3px #ccc; +} .review-product-list .form-add .form-list li:nth-child(2) { margin:15px 0 0; } .review-product-list .box-reviews h2 { margin-bottom:6px; } +.review-product-list .box-reviews dl { border-radius:5px; padding:10px 10px 0; -webkit-box-shadow:0 1px 3px #ccc; box-shadow:0 1px 3px #ccc; } .review-product-list .box-reviews dt { padding:0 0 5px; } +.review-product-list .box-reviews dt a, +.review-product-list .box-reviews dt h3 { display:block; font-size:13px; font-weight:bold; } +.review-product-list .box-reviews dd { overflow:hidden; } +.review-product-list .box-reviews dd:last-child { border:none; padding:0 0 10px; } +.review-product-list .box-reviews dd .date { color:#666; font-size:11px; display:block; } +@media(orientation:landscape) { + .review-product-list .box-reviews dd table { + float:right; + margin:-3px 0 0 10px; + } +} .review-product-list .ratings-table { border-spacing:0; } .review-product-list .ratings-table th { padding-right:5px; } -#customer-reviews small { font-size:12px; } .review-table-wrap { padding:10px 0 0; } +.review-product-list .box-reviews dd + dt:before, .review-table-wrap:after { content:''; background:-webkit-gradient(linear, left top, right top, color-stop(0%,#fff), color-stop(25%,#ccc), color-stop(75%,#ccc), color-stop(100%,#fff)); + background:-o-linear-gradient(top, #fff 0%, #ccc 22%, #fff 100%); display:block; height:1px; width:100%; @@ -1953,21 +2419,25 @@ section .category-title { display:none; } #product-review-table tbody td input { background:url(../images/i_star.png) no-repeat center; border:none; background-size:15px 15px; display:inline-block; height:25px; width:25px; opacity:0.25; margin:0; -webkit-appearance:none; -webkit-transition:all 100ms ease-in-out; } #product-review-table tbody td input:checked, #product-review-table tbody td.checked input { opacity:1; } -.review-product-list .buttons-set button { padding:5px 10px; background:-webkit-gradient(linear, 0 0, 0 100%, from(#F39823), to(#F37221)); font-size:14px; font-weight:bold; color:#FFF; border:1px solid #FFF; border-radius:5px; -webkit-box-shadow:0 3px 3px 0 #9F9F9F; } +.review-product-list .buttons-set button { + padding:5px 10px; + background:-webkit-gradient(linear, 0 0, 0 100%, from(#F39823), to(#F37221)); + background:-o-linear-gradient(top, #F39823 0%, #F37221 100%); + font-size:14px; + color:#FFF; + border:1px solid #FFF; + border-radius:5px; + -webkit-box-shadow:0 3px 3px 0 #9F9F9F; + box-shadow:0 3px 3px 0 #9F9F9F; + text-shadow:0 1px 2px rgba(0, 0, 0, 0.25); +} /* Product Review Page -----------------------------*/ -.my-account .product-review { padding:10px 10px 0; } -.my-account .product-review .page-title, -.review-customer-index .my-account .page-title, -.customer-address-form .page-title { background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#e5e5e5)); border:none; border-bottom:1px solid #ccc; height:20px; margin:-10px -10px 10px; -webkit-box-shadow:none; } -.my-account .product-review .page-title h1, -.review-customer-index .page-title h1, -.customer-address-form .page-title h1 { font-size:16px; line-height:20px; } .my-account .product-review .product-img-box {} .my-account .product-review .product-img-box > * { display:none; } .my-account .product-review .product-img-box > a { display:block; float:left; margin-right:10px; } -.my-account .product-review .product-img-box img { -webkit-border-radius:1px; -webkit-box-shadow:0 0 3px #D1D1D1; } +.my-account .product-review .product-img-box img { -webkit-border-radius:1px; -webkit-box-shadow:0 0 3px #D1D1D1; box-shadow:0 0 3px #D1D1D1; } .my-account .product-review .product-details h2 { font-size:16px; font-weight:bold; line-height:1.3; margin:0; } .my-account .product-review .product-details h3 { font-size:13px; margin:2px 0; } .my-account .product-review .product-details dl { clear:left; padding:10px 0 0; } @@ -1987,11 +2457,19 @@ section .category-title { display:none; } .customer-address-form .buttons-set .back-link small { display:none; } .review-customer-index section[role="main"] { padding-bottom:0; } -.review-customer-index .my-account .page-title { margin:0; } -.review-customer-index .pager { background:-webkit-gradient(linear, 0 0, 0 100%, from(#fefefe), to(#eee)); overflow:hidden; padding:5px 10px; text-align:right; } +.review-customer-index .my-account .page-title { margin-bottom:0; } +.review-customer-index .pager { + background:-webkit-gradient(linear, 0 0, 0 100%, from(#fefefe), to(#eee)); + background:-o-linear-gradient(top, #fefefe 0%, #eee 100%); + overflow:hidden; + margin:0 -10px; + padding:5px 10px; + text-align:right; +} .review-customer-index .pager .amount { float:left; line-height:30px; } .review-customer-index .pager select { width:60px; } -.review-customer-index table { font-size:14px; line-height:16px; border-collapse:collapse; width:100%; } +.review-customer-index .my-reviews-table-wrap { margin:0 -10px; } +.review-customer-index table { font-size:12px; line-height:16px; border-collapse:collapse; width:100%; } .review-customer-index table th, .review-customer-index table td { border:solid #eee; border-width:1px 0; padding:7px 5px; } .review-customer-index table td { vertical-align:top; } @@ -2004,12 +2482,31 @@ section .category-title { display:none; } /* Cart -----------------------------*/ .cart-shared { margin:0 0 -10px; } -.cart-shared .page-title { background:#eee; border:solid #ccc; border-width:1px 0; margin:0 -10px 10px; padding:10px; text-align:left; -webkit-box-shadow:none; } +.cart-shared .page-title { background:#eee; border:solid #ccc; border-width:1px 0; margin:0 -10px 10px; padding:10px; text-align:left; -webkit-box-shadow:none; box-shadow:none; } .cart-shared .page-title h1 { display:block; margin:0 auto; line-height:30px; text-shadow:0 1px 1px #fff; text-align:center; } .cart-shared .page-title a { background:#ccc; border:1px solid #bbb; display:block; float:left; margin:-30px 0 0; font-size:11px; font-weight:bold; padding:5px 10px; -webkit-border-radius:4px; text-shadow:none; } - +.cart-shared .label, +.cart-shared .weee .price { display:block; font-weight:bold; white-space:nowrap; } .cart-shared .messages { margin:10px 0 7px; } .cart-shared fieldset { border-bottom:1px solid #ccc; margin:0 -10px; padding:0 10px 5px; } +.remove-all-button { display:none; padding:10px 5px 15px; text-align:center; } +.remove-all-button a { + background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #ee5f5b), color-stop(100%, #c43c35)); + background:-o-linear-gradient(top, #ee5f5b 0%, #c43c35 100%); + border:1px solid #fff; + color:#fff; + font-weight:bold; + border-radius:5px; + display:inline-block; + padding:5px 0; + width:100%; + -webkit-box-shadow:0 3px 3px 0 #9f9f9f; + box-shadow:0 3px 3px 0 #9f9f9f; + text-shadow:0 -1px 2px rgba(0, 0, 0, 0.25); +} +.cart-shared .remove-all-button { border-bottom:1px solid #eae8ea; } +.my-wishlist .remove-all-button { float:left; padding:0 8px 0 0; } +.my-wishlist .remove-all-button a { font-size:11px; padding:5px; box-sizing:border-box; -webkit-box-sizing:border-box; } .cart-table-wrap { position:relative; @@ -2042,7 +2539,8 @@ section .category-title { display:none; } .cart-table-wrap.grouped-items .cart-table .item-options, .cart-table-wrap.grouped-items .cart-table .item-qty, .cart-table-wrap.grouped-items .cart-table .cart-price, -.cart-table-wrap.grouped-items .cart-table .price-box { +.cart-table-wrap.grouped-items .cart-table .price-box, +.cart-table-wrap.grouped-items .cart-table .label { display:none; } @@ -2055,18 +2553,28 @@ section .category-title { display:none; } .cart-shared .cart-table th { background:#ddd; font-weight:normal; } .cart-shared .cart-table th:first-child { -webkit-border-top-left-radius:5px; } .cart-shared .cart-table th:last-child { -webkit-border-top-right-radius:5px; } +.cart-shared .cart-table tr:last-child td { border:0; } .cart-shared .cart-table .odd { background:#eee; } .cart-shared .cart-table td b + input { vertical-align:middle; } .cart-shared .cart-table td input { border:1px solid #ccc; border-radius:3px; font-size:12px; font-weight:bold; margin:0 0 0 10px; padding:4px 5px; -webkit-appearance:none; -webkit-background-clip:padding-box; width:25px; -webkit-box-sizing:content-box; } .cart-shared .cart-table tfoot td { padding:0; vertical-align:top; } -.cart-shared .cart-table tfoot button { background:-webkit-gradient(linear, 0 0, 0 100%, from(#333), to(#111)); border:none; color:#fff; font-size:13px; font-weight:bold; padding:8px 10px; text-shadow:0 1px 0 #000; -webkit-border-radius:0 0 5px 5px; width:100%; } +.cart-shared .cart-table tfoot button { + background:-webkit-gradient(linear, 0 0, 0 100%, from(#333), to(#111)); + background:-o-linear-gradient(top, #333 0%, #111 100%); + border:none; + color:#fff; + font-size:13px; + font-weight:bold; + padding:8px 10px; + text-shadow:0 1px 0 #000; + -webkit-border-radius:0 0 5px 5px; + width:100%; +} .cart-shared .cart-table tbody td { vertical-align:top; } .cart-shared .cart-table .product-name { margin:0 0 10px; } .cart-shared .cart-table .product-name a { font-size:12px; color:#2f2f2f; } -.cart-shared .cart-table .product-image img { border:1px solid #FFF; -webkit-box-shadow:1px 1px 3px 0 #ccc; } -.cart-shared .cart-table .item-remove, -.btn-remove, -.item-remove { +.cart-shared .cart-table .product-image img { border:1px solid #FFF; -webkit-box-shadow:1px 1px 3px 0 #ccc; box-shadow:1px 1px 3px 0 #ccc; } +.cart-shared .cart-table .item-remove, .btn-remove, .item-remove { background:#e10000; border-radius:8px; display:block; @@ -2078,6 +2586,14 @@ section .category-title { display:none; } width:10px; -webkit-background-clip:padding-box; } +.cart-shared .totals .btn-remove { + background:none; + padding:0; + height:auto; + width:auto; + top:3px; + margin-left:2px; +} .cart-shared .cart-table .item-remove:before, .btn-remove:before, .item-remove:before { @@ -2085,6 +2601,7 @@ section .category-title { display:none; } background:#fff; border-radius:9px; -webkit-box-shadow:0 0 6px #888; + box-shadow:0 0 6px #888; display:block; position:absolute; top:-2px; @@ -2101,22 +2618,103 @@ section .category-title { display:none; } .cart-shared .totals table { border-spacing:0; font-size:12px; width:100%; } .cart-shared .totals td { padding:2px; } -.cart-shared .discount { font-size:12px; margin:0 -10px 20px; padding:10px 15px 15px; } -.cart-shared .discount h2 { font-size:12px; font-weight:bold; margin:0; text-shadow:0 1px 0 #fff; } +.cart-shared .totals .summary-total td[colspan="1"] { text-align:right; } +.cart-shared .totals .summary-collapse { cursor:pointer; text-decoration:underline; } +.cart-shared .discount, +.cart-shared .giftcard { font-size:12px; margin:0 -10px 20px; padding:10px 15px 15px; } +.cart-shared .giftcard a, +.cart-shared .discount a { display:inline-block; padding:5px 0; text-decoration:underline; } +.cart-shared .discount h2, +.cart-shared .giftcard h2 { font-size:12px; font-weight:bold; margin:0; text-shadow:0 1px 0 #fff; } +.cart-shared .giftcard label, .cart-shared .discount label { display:none; } +.cart-shared .giftcard .input-box, .cart-shared .discount .input-box { display:inline-block; } -.cart-shared .discount .input-box input { border:1px solid #CAC8C8; border-radius:2px; font-size:11px; line-height:1; padding:5px 10px; -webkit-appearance:none; width:140px; -webkit-box-shadow:inset 0 1px 2px #ccc; -webkit-background-clip:padding-box; } -.cart-shared .discount .buttons-set { display:inline-block; } -.cart-shared .discount .buttons-set button { padding:5px 10px; background:-webkit-gradient(linear, 0 0, 0 100%, from(#E2E2E2), to(#9D9D9D)); font-size:11px; font-weight:bold; color:#FFF; border:1px solid #FFF; border-radius:5px; -webkit-box-shadow:0 3px 3px 0 #9F9F9F; -webkit-background-clip:padding-box; } -.cart-shared .checkout-types { float:right; } +.cart-shared .giftcard .input-box input, +.cart-shared .discount .input-box input { + border:1px solid #CAC8C8; + border-radius:2px; + font-size:11px; + line-height:1; + padding:5px 10px; + width:140px; + -webkit-appearance:none; + appearance:none; + -webkit-box-shadow:inset 0 1px 2px #ccc; + box-shadow:inset 0 1px 2px #ccc; + -webkit-background-clip:padding-box; + background-clip:padding-box; +} +.cart-shared .discount + .giftcard { margin-top:-30px; } +.cart-shared .discount .buttons-set { display:inline-block; vertical-align:top; margin:-1px 0 0; } +.cart-shared .giftcard button, +.cart-shared .discount .buttons-set button { + background:-webkit-gradient(linear, 0 0, 0 100%, from(#E2E2E2), to(#9D9D9D)); + background:-o-linear-gradient(top, #E2E2E2 0%, #9D9D9D 100%); + border:1px solid #FFF; + border-radius:5px; + color:#fff; + font-size:11px; + font-weight:bold; + margin:0; + padding:6px 10px; + vertical-align:top; + -webkit-box-shadow:0 3px 3px 0 #9F9F9F; + box-shadow:0 3px 3px 0 #9F9F9F; + -webkit-background-clip:padding-box; + background-clip:padding-box; + text-shadow:0 -1px 2px rgba(0, 0, 0, 0.25); +} +.cart-shared .checkout-types { float:right; width:65%; } .cart-shared .checkout-types li { text-align:right; } .cart-shared .checkout-types li:first-child {margin:0 0 10px; } -.cart-shared .checkout-types li button { clear:both; display:block; float:right; margin:10px 0; padding:5px 20px; background:-webkit-gradient(linear, 0 0, 0 100%, from(#F39823), to(#F37221)); font-size:14px; font-weight:bold; color:#FFF; border:1px solid #FFF; border-radius:5px; -webkit-box-shadow:0 3px 3px 0 #9F9F9F; -webkit-background-clip:padding-box; } -#update-cart { float:left; margin:10px 0; padding:5px 10px; background:-webkit-gradient(linear, 0 0, 0 100%, from(#E2E2E2), to(#9D9D9D)); font-size:14px; font-weight:bold; color:#FFF; border:1px solid #FFF; border-radius:5px; -webkit-box-shadow:0 3px 3px 0 #9F9F9F; -webkit-background-clip:padding-box; } +.cart-shared .checkout-types li button { + background:-webkit-gradient(linear, 0 0, 0 100%, from(#F39823), to(#F37221)); + background:-o-linear-gradient(top, #F39823 0%, #F37221 100%); + clear:both; + display:block; + float:right; + margin:10px 0; + padding:5px 20px; + font-size:14px; + font-weight:bold; + color:#FFF; + border:1px solid #FFF; + border-radius:5px; + -webkit-box-shadow:0 3px 3px 0 #9F9F9F; + box-shadow:0 3px 3px 0 #9F9F9F; + -webkit-background-clip:padding-box; + background-clip:padding-box; + text-shadow:0 1px 2px rgba(0, 0, 0, 0.25); +} +#update-cart { + background:-webkit-gradient(linear, 0 0, 0 100%, from(#E2E2E2), to(#9D9D9D)); + background:-o-linear-gradient(top, #E2E2E2 0%, #9D9D9D 100%); + float:left; + margin:10px 0; + padding:5px 10px; + font-size:14px; + font-weight:bold; + color:#FFF; + border:1px solid #FFF; + border-radius:5px; + -webkit-box-shadow:0 3px 3px 0 #9F9F9F; + box-shadow:0 3px 3px 0 #9F9F9F; + -webkit-background-clip:padding-box; + background-clip:padding-box; + text-shadow:0 -1px 2px rgba(0, 0, 0, 0.25); +} .cart-shared .checkout-types .paypal-or { color:#333; display:block; padding:0 0 5px; text-shadow:0 0 1px #fff; } .cart-shared .checkout-types li:nth-child(3) > a { display:inline-block; margin:10px 0 0; padding:10px; } -.cart-shared .cart-footer { margin:0 -10px; padding:10px; background:-webkit-gradient(linear, 0 0, 0 100%, from(#FDFDFD), to(#CFD0D1)); -webkit-box-shadow: 0px 0px 10px 0px #222; } +.cart-shared .cart-footer { + background:-webkit-gradient(linear, 0 0, 0 100%, from(#FDFDFD), to(#CFD0D1)); + background:-o-linear-gradient(top, #FDFDFD 0%, #CFD0D1 100%); + margin:0 -10px; + padding:10px; + -webkit-box-shadow: 0px 0px 10px 0px #222; + box-shadow: 0px 0px 10px 0px #222; +} .cart-shared .cart-footer:after { content:"."; display:block; clear:both; visibility:hidden; line-height:0; height:0; } .checkout-agreements { @@ -2134,6 +2732,7 @@ section .category-title { display:none; } max-height:250px; overflow:auto; -webkit-box-shadow:inset 0 0 3px #000; + box-shadow:inset 0 0 3px #000; } .checkout-agreements .agree { @@ -2145,56 +2744,135 @@ section .category-title { display:none; } .a-center { text-align:center; } .a-right { text-align:right; } -.page-title { background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#ccc)); border:solid #999; border-width:1px 0; border-top-color:#ccc; text-shadow:0 1px 0 #fff; margin:0 -10px 10px; padding:10px; -webkit-box-shadow:0 3px 3px #eee; } +.page-title { + background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#ccc)); + background:-o-linear-gradient(top, #fff 0%, #ccc 100%); + border:solid #999; + border-width:1px 0; + border-top-color:#ccc; + text-shadow:0 1px 0 #fff; + margin:0 -10px 10px; + padding:10px; + -webkit-box-shadow:0 3px 3px #eee; + box-shadow:0 3px 3px #eee; +} /* User account -----------------------------*/ -.my-account { margin:0 -10px; } -.my-account .messages { padding:10px 10px 0; } -.my-account .messages .success-msg { margin:-10px 0 0; } +.show-links { position:absolute; top:53px; left:10px; z-index:99; } +.my-account { margin:0; } +.my-account .messages { margin:-10px -10px 10px; padding:0; } +.my-account .messages .success-msg { margin-bottom:0; } .my-account .messages .success-msg a { color:#fff; } -.my-account .breadcrumbs { margin:0; } - +.my-account .breadcrumbs {} +.my-account .welcome-msg { margin:0 0 10px; } -.customer-account-index .my-account .messages { margin:10px 0 -10px; padding:0; } +.customer-account-index .my-account .messages { margin:0; padding:0; } +.my-account .box { margin-bottom:10px; } .my-account .box-account { background:#fff; padding:0 0 10px; } -.my-account .box-info { padding-bottom:0; } -.my-account .box-info .box-head { margin-bottom:0; } -.my-account .box-info .box-title { padding:5px 10px; } -.my-account .box-info .box-content { padding:10px; } -.my-account .box-info .col2-set:nth-child(3) .col-1, -.my-account .box-info .col2-set:nth-child(3) .col-2 { display:inline-block; vertical-align:top; width:49%; } -.my-account .box-content p a {} -.my-account .box-reviews .number { display:none; } - -.my-account .page-title { background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#ccc)); border:solid #999; border-width:1px 0; border-top-color:#ccc; text-shadow:0 1px 0 #fff; padding:10px; -webkit-box-shadow:0 3px 3px #eee; margin:0; } - -.my-account .box-head { background:-webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffb76b), color-stop(50%,#ffa73d), color-stop(51%,#ff7c00), color-stop(100%,#ff7f04)); border-bottom:1px solid #999; margin:0 0 10px; padding:7px 10px 8px; position:relative; } -.my-account .box-head a { background:-webkit-gradient(linear, 0 0, 0 100%, from(#eee), to(#fff)); font-weight:bold; position:absolute; padding:2px 10px; top:3px; right:5px; -webkit-border-radius:4px; -webkit-box-shadow:inset 0 0 2px #000; text-shadow:0 1px 0 #fff; } +.my-account .info-box { padding-bottom:0; } +.my-account .info-box .box-head { margin-bottom:0; } +.my-account .info-box .box-title { padding:5px 10px; } +.my-account .info-box .box-content { border:1px solid #aaa; padding:10px; margin:0 0 10px; } +.my-account .info-box .col2-set:nth-child(3) .col-1, +.my-account .info-box .col2-set:nth-child(3) .col-2 { display:inline-block; vertical-align:top; width:49%; } +.my-account .box-content a { text-decoration:underline; } +.my-account .dashboard .reviews ol { list-style:none; margin:0; padding:0; } +.my-account .dashboard .reviews .number { float:left; margin:0 10px 0 0; } +.my-account .dashboard .reviews .details { display:table; } +.my-account .dashboard .reviews .details p { display:inline; vertical-align:middle; } +.my-account .dashboard .reviews .details .rating-box { display:inline-block; vertical-align:middle; margin:0; } + +.my-account .my-wishlist { margin:0 -10px; } + +.my-account .page-title { + background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#ccc)); + background:-o-linear-gradient(top, #fff 0%, #ccc 100%); + border:solid #999; + border-width:1px 0; + border-top-color:#ccc; + margin:0 -10px 10px; + padding:10px; + -webkit-box-shadow:0 3px 3px #eee; + box-shadow:0 3px 3px #eee; + text-shadow:0 1px 0 #fff; +} + +.my-account .box-head { + background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #ffb76b), color-stop(50%, #ffa73d), color-stop(51%, #ff7c00), color-stop(100%, #ff7f04)); + background:-o-linear-gradient(top, #ffb76b 0%, #ffa73d 50%, #ff7c00 51%, #ff7f04 100%); + border-bottom:1px solid #999; + padding:7px 10px 8px; + position:relative; +} +.my-account .box-head a { + background:-webkit-gradient(linear, 0 0, 0 100%, from(#eee), to(#fff)); + background:-o-linear-gradient(top, #eee 0%, #fff 100%); + font-weight:bold; + position:absolute; + padding:2px 10px; + top:3px; + right:5px; + -webkit-border-radius:4px; + border-radius:4px; + -webkit-box-shadow:inset 0 0 2px #000; + box-shadow:inset 0 0 2px #000; + text-shadow:0 1px 0 #fff; +} .my-account .box-head h2 { color:#f6f6f6; font-weight:bold; text-shadow:0 0 3px #333; line-height:1; } -.my-account .box-recent .data-table { border-spacing:0; margin:-10px 0; width:100%; } +.my-account .box-recent .data-table { border-spacing:0; width:100%; } .my-account .box-recent .data-table th, .my-account .box-recent .data-table td { padding:2px 5px; } -.my-account .box-recent .data-table th { background:-webkit-gradient(linear, 0 0, 0 100%, from(#eee), to(#ccc)); border-bottom:1px solid #aaa; text-shadow:0 1px 0 #fff; } -.my-account .box-recent .data-table tr:nth-child(odd) { background:#f6f6f6; } -.my-account .box-recent .data-table tr td:first-child a { display:block; background:-webkit-gradient(linear, 0 0, 0 100%, from(#eee), to(#fff)); font-weight:bold; margin:4px 0; padding:2px 10px; -webkit-border-radius:4px; -webkit-box-shadow:inset 0 0 2px #000; text-shadow:0 1px 0 #fff; } +.my-account .box-recent .data-table th { + background:-webkit-gradient(linear, 0 0, 0 100%, from(#eee), to(#ccc)); + background:-o-linear-gradient(top, #eee 0%, #ccc 100%); + border-bottom:1px solid #aaa; + text-shadow:0 1px 0 #fff; +} +.my-account .box-recent .data-table tr:nth-child(odd) { background:#f6f6f6; } +.my-account .box-recent .data-table tr td:nth-child(3) { text-align:center; } +.my-account .box-recent .data-table tr td:first-child a { + display:block; + background:-webkit-gradient(linear, 0 0, 0 100%, from(#eee), to(#fff)); + background:-o-linear-gradient(top, #eee 0%, #fff 100%); + font-weight:bold; + margin:4px 0; + padding:2px 10px; + -webkit-border-radius:4px; + border-radius:4px; + -webkit-box-shadow:inset 0 0 2px #000; + box-shadow:inset 0 0 2px #000; + text-shadow:0 1px 0 #fff; +} -.my-account .box-title { background:-webkit-gradient(linear, 0 0, 0 100%, from(#eee), to(#ccc)); border-top:1px solid #bbb; border-bottom:1px solid #aaa; font-size:14px; text-shadow:0 1px 0 #fff; position:relative; } -.my-account .box-title a { position:absolute; top:5px; right:5px; } +.my-account .box-title { + background:-webkit-gradient(linear, 0 0, 0 100%, from(#eee), to(#ccc)); + background:-o-linear-gradient(top, #eee 0%, #ccc 100%); + border:1px solid; + border-color:#bbb #aaa; + color:#333; + font-size:13px; + text-shadow:0 1px 0 #fff; + position:relative; +} +.my-account .box-title .separator { display:none; } +.my-account .box-title a { position:absolute; top:5px; right:5px; text-decoration:underline; } .my-account .box-title h3 { display:inline-block; } .my-account .box-content h4 {} .my-account .col2-set .col-1, .my-account .col2-set .col-2 {} .my-account .col2-set .col-1:last-child, -.my-account .col2-set .col-2:last-child { -} -.my-account .back-link { float:left; margin:0 15px 0 0; } +.my-account .col2-set .col-2:last-child {} +.my-account .sub-title, +.my-account .legend { color:#333; font-size:15px; font-weight:bold; margin:0 0 5px; text-shadow:0 1px 0 #ddd; } +.my-account .back-link { display:none; float:left; margin:0 15px 0 0; } .my-account .input-box select { font-size:16px; } -.my-account .buttons-set { clear:both; } +.my-account .buttons-set, +.my-account .buttons-set2 { clear:both; text-align:center; } .my-account .buttons-set:after { content:"."; display:block; @@ -2203,11 +2881,11 @@ section .category-title { display:none; } line-height:0; height:0; } -.my-account .welcome-msg, .my-account label em, .my-account .buttons-set .required, -.my-account label[for="street_1"], -.my-account h2.legend { display:none; } +.my-account label[for="street_1"] { display:none; } + +.my-account .storecredit .account-balance { margin:0 0 10px; } .sales-order-view .my-account { margin:0; @@ -2216,6 +2894,7 @@ section .category-title { display:none; } border-collapse:collapse; margin:10px 0 15px; -webkit-box-shadow:0 3px 6px #ccc; + box-shadow:0 3px 6px #ccc; } .sales-order-view #my-orders-table th, .sales-order-view #my-orders-table td { @@ -2247,6 +2926,7 @@ section .category-title { display:none; } .sales-order-view #my-orders-table tbody tr:first-child th, .sales-order-view #my-orders-table tbody tr:first-child th + td { background:-webkit-gradient(linear, 0 0, 0 100%, from(#f6f6f6), to(#ddd)); + background:-o-linear-gradient(top, #f6f6f6 0%, #ddd 100%); display:table-cell; padding:5px; font-weight:normal; @@ -2302,12 +2982,18 @@ section .category-title { display:none; } .sales-order-history .data-table { border-spacing:0; margin:-10px 0 0 0; width:100%; } .sales-order-history .data-table th, .sales-order-history .data-table td { padding:2px 5px; } -.sales-order-history .data-table th { background:-webkit-gradient(linear, 0 0, 0 100%, from(#eee), to(#ccc)); border-bottom:1px solid #aaa; text-shadow:0 1px 0 #fff; } +.sales-order-history .data-table th { + background:-webkit-gradient(linear, 0 0, 0 100%, from(#eee), to(#ccc)); + background:-o-linear-gradient(top, #eee 0%, #ccc 100%); + border-bottom:1px solid #aaa; + text-shadow:0 1px 0 #fff; +} .sales-order-history .data-table th:nth-child(4) { width:20%; text-align:left; } .sales-order-history .data-table tr:nth-child(odd) { background:#f6f6f6; } .sales-order-history .amount { display:none; } .sales-order-history .pager { - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#FFB76B), color-stop(50%,#FFA73D), color-stop(51%,#FF7C00), color-stop(100%,#FF7F04)); + background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #FFB76B), color-stop(50%, #FFA73D), color-stop(51%, #FF7C00), color-stop(100%, #FF7F04)); + background:-o-linear-gradient(top, #FFB76B 0%, #FFA73D 50%, #FF7C00 51%, #FF7F04 100%); border-bottom: 1px solid #999; margin: 0 0 10px; padding: 7px 10px 8px; @@ -2316,6 +3002,7 @@ section .category-title { display:none; } text-shadow: 0 0 3px #333; line-height: 1; text-align:right; + overflow:hidden; } .sales-order-history .limiter { float:left; @@ -2329,7 +3016,8 @@ section .category-title { display:none; } padding: 5px 10px; border: 1px solid #CECECE; border-radius: 5px; - background: -webkit-gradient(linear, 0 0, 0 100%, from(#FEFEFE), to(#EEE)); + background: -webkit-gradient(linear, 0 0, 0 100%, from(#fefefe), to(#eee)); + background:-o-linear-gradient(top, #fefefe 0%, #eee 100%); font-size: 16px; text-transform: small-caps; } @@ -2338,59 +3026,57 @@ section .category-title { display:none; } padding: 5px 10px; border: 1px solid #CECECE; border-radius: 5px; - background: -webkit-gradient(linear, 0 0, 0 100%, from(#FEFEFE), to(#EEE)); + background: -webkit-gradient(linear, 0 0, 0 100%, from(#fefefe), to(#eee)); + background:-o-linear-gradient(top, #fefefe 0%, #eee 100%); font-size: 16px; text-transform: small-caps; } -.customer-account-edit form, -.customer-address-form form { padding:0 10px; } -.customer-address-form form .buttons-set { padding:10px 0; } -.customer-account-edit select, -.customer-address-form form select { border:1px solid; border-color:#8e8e8e #e1e1e1 #e1e1e1 #8e8e8e; border-radius:5px; font-size:18px; padding:5px 30px 5px 5px; width:100%; margin:0; } -.customer-account-edit .field label, -.customer-address-form form .field label, -.customer-address-form form .wide label { color:#5e5e5e; display:block; font-size:12px; line-height:16px; margin:8px 0 0; padding:0 0 3px; font-weight:bold; } -.customer-account-edit .buttons-set button[type=submit], -.customer-address-form form .buttons-set button[type=submit] { - display:block; - margin:0; - padding:5px 20px; + +.my-account form label, +.my-account form .field label, +.my-account form .wide label { color:#5e5e5e; display:block; font-size:12px; line-height:16px; margin:8px 0 0; padding:0 0 3px; font-weight:bold; } +.my-account form .buttons-set { padding:10px 0; } +.my-account .form-list label { display:block; margin:5px 0 2px 0; } +.my-account .form-list select { border:1px solid; border-color:#8e8e8e #e1e1e1 #e1e1e1 #8e8e8e; border-radius:5px; font-size:18px; padding:5px 30px 5px 5px; width:100%; margin:0; } +.my-account .form-list .control .checkbox + label, +.my-account .form-list .control .input-box + label { display:inline; margin-left:2px; vertical-align:middle; } +.my-account button { + display:inline-block; background:-webkit-gradient(linear, 0 0, 0 100%, from(#F39823), to(#F37221)); - font-size:14px; + background:-o-linear-gradient(top, #F39823 0%, #F37221 100%); color:#FFF; + font-size:14px; border:1px solid #FFF; border-radius:5px; + margin:0; + padding:5px 10px; + vertical-align:top; -webkit-box-shadow:0 3px 3px 0 #9F9F9F; -} -.customer-account-edit .customer-name label { display:block; margin:5px 0 2px 0; } -.newsletter-manage-index .my-account form { padding:10px 10px 0; } -.newsletter-manage-index .my-account .buttons-set button[type=submit] { - float:right; - padding: 5px 10px; - border: 1px solid #CECECE; - border-radius: 5px; - background: -webkit-gradient(linear, 0 0, 0 100%, from(#FEFEFE), to(#EEE)); - font-size: 16px; - text-transform: small-caps; + box-shadow:0 3px 3px 0 #9F9F9F; + text-shadow:0 1px 2px rgba(0, 0, 0, 0.25); } .newsletter-manage-index .my-account .back-link a { display:block; padding: 5px 10px; border: 1px solid #CECECE; border-radius: 5px; - background: -webkit-gradient(linear, 0 0, 0 100%, from(#FEFEFE), to(#EEE)); + background: -webkit-gradient(linear, 0 0, 0 100%, from(#fefefe), to(#eee)); + background:-o-linear-gradient(top, #fefefe 0%, #eee 100%); font-size: 16px; text-transform: small-caps; } .customer-address-index .page-title h1 { float:left; padding:5px 0 0 0; } .customer-address-index .page-title button { float:right; - background: -webkit-gradient(linear, 0 0, 0 100%, from(#EEE), to(white)); + background: -webkit-gradient(linear, 0 0, 0 100%, from(#eee), to(#fff)); + background:-o-linear-gradient(top, #eee 0%, #fff 100%); font-weight: bold; padding: 6px 10px; border:0; -webkit-border-radius: 4px; + border-radius: 4px; -webkit-box-shadow: inset 0 0 2px #000; + box-shadow: inset 0 0 2px #000; text-shadow: 0 1px 0 white; } .customer-address-index .page-title:after { @@ -2401,28 +3087,26 @@ section .category-title { display:none; } line-height: 0; height: 0; } -.customer-address-index .addresses-list { padding:0 10px; } -.customer-address-index .addresses-list ol { - list-style:none; - margin:0; - padding:10px 0; -} - .customer-address-index .addresses-list ol li { - display:inline-block; - vertical-align:top; - width:45%; - } +.customer-address-index .addresses-list {} +.customer-address-index .addresses-list ol { list-style:none; margin:0; padding:0; } +.customer-address-index .addresses-list ol li {} .customer-address-index .back-link a { display:block; margin:0 0 0 10px; padding: 5px 10px; border: 1px solid #CECECE; border-radius: 5px; - background: -webkit-gradient(linear, 0 0, 0 100%, from(#FEFEFE), to(#EEE)); + background: -webkit-gradient(linear, 0 0, 0 100%, from(#fefefe), to(#eee)); + background:-o-linear-gradient(top, #fefefe 0%, #eee 100%); font-size: 16px; text-transform: small-caps; } +.block-account { margin:0; padding:0; position:absolute; width:100%; left:-100%; z-index:100; -webkit-box-shadow:0 3px 3px rgba(0, 0, 0, .25) } +.block-account .block-title { display:none; } +.block-account li { background:#eee; border-bottom:1px solid #ccc; padding:10px 10px 10px 100px; } +.block-account .back { background:#333; color:#fff; padding:10px; position:absolute; top:0; bottom:0; left:0; width:60px; } + /* Order -----------------------------*/ @@ -2443,13 +3127,15 @@ section .category-title { display:none; } .sales-order-shipment .page-title a, .sales-order-view .page-title a { float:right; - background: -webkit-gradient(linear, 0 0, 0 100%, from(#EEE), to(white)); + background:-webkit-gradient(linear, 0 0, 0 100%, from(#eee), to(#fff)); + background:-o-linear-gradient(top, #eee 0%, #fff 100%); font-weight: bold; margin:0 0 0 10px; padding: 6px 10px; border:0; -webkit-border-radius: 4px; -webkit-box-shadow: inset 0 0 2px #000; + box-shadow: inset 0 0 2px #000; text-shadow: 0 1px 0 white; } .sales-order-view .page-title .link-print { @@ -2479,7 +3165,8 @@ section .category-title { display:none; } padding: 5px 10px; border: 1px solid #CECECE; border-radius: 5px; - background: -webkit-gradient(linear, 0 0, 0 100%, from(#FEFEFE), to(#EEE)); + background: -webkit-gradient(linear, 0 0, 0 100%, from(#fefefe), to(#eee)); + background:-o-linear-gradient(top, #fefefe 0%, #eee 100%); font-size: 16px; text-transform: small-caps; } @@ -2525,9 +3212,10 @@ section .category-title { display:none; } .sales-order-view .order-info dd ul li a { display:block; padding: 5px 10px; - border: 1px solid #CECECE; + border: 1px solid #cecece; border-radius: 5px; - background: -webkit-gradient(linear, 0 0, 0 100%, from(#FEFEFE), to(#EEE)); + background: -webkit-gradient(linear, 0 0, 0 100%, from(#fefefe), to(#eee)); + background:-o-linear-gradient(top, #fefefe 0%, #eee 100%); font-size: 16px; text-transform: small-caps; } @@ -2538,15 +3226,52 @@ section .category-title { display:none; } /* Wishlist -----------------------------*/ -.my-wishlist h1 { background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#ccc)); border:solid #999; border-width:1px 0; border-top-color:#ccc; margin:0 0 10px; padding:10px; } +.my-wishlist h1 { + background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#ccc)); + background:-o-linear-gradient(top, #fff 0%, #ccc 100%); + border:solid #999; + border-width:1px 0; + border-top-color:#ccc; + margin:0 0 10px; + padding:10px; +} .my-wishlist h2 { font-weight:bold; line-height:16px; } -.my-wishlist .buttons-set { margin:10px 0 -10px; padding: 10px; background:-webkit-gradient(linear, 0 0, 0 100%, from(#FDFDFD), to(#CFD0D1)); -webkit-box-shadow:0px 0px 10px 0px #222; } +.my-wishlist .buttons-set { + background:-webkit-gradient(linear, 0 0, 0 100%, from(#fdfdfd), to(#cfd0d1)); + background:-o-linear-gradient(top, #fdfdfd 0%, #cfd0d1 100%); + margin:10px 0 -10px; + padding: 10px; + -webkit-box-shadow:0px 0px 10px 0px rgba(0, 0, 0, .25); + box-shadow:0px 0px 10px 0px rgba(0, 0, 0, .25); +} .my-wishlist .buttons-set:after { content:"."; display:block; clear:both; visibility:hidden; line-height:0; height:0; } -.my-wishlist .buttons-set li:first-child { float:left; } +.my-wishlist .buttons-set li { float:left; } +.my-wishlist .buttons-set li:first-child { padding:0 8px 0 0; } .my-wishlist .buttons-set li:last-child { float:right; } -.my-wishlist .buttons-set li .add-all-to-cart { text-align:right; padding:5px 10px; background:-webkit-gradient(linear, 0 0, 0 100%, from(#F39823), to(#F37221)); font-size:11px; font-weight:bold; color:#FFF; border:1px solid #FFF; border-radius:5px; -webkit-box-shadow:0 3px 3px 0 #9F9F9F; } +.my-wishlist .buttons-set li .add-all-to-cart, +.my-wishlist .buttons-set li .btn-share { + text-align:right; + padding:5px 10px; + background:-webkit-gradient(linear, 0 0, 0 100%, from(#F39823), to(#F37221)); + background:-o-linear-gradient(top, #f39823 0%, #f37221 100%); + font-size:11px; + font-weight:bold; + color:#fff; + border:1px solid #fff; + border-radius:5px; + -webkit-box-shadow:0 3px 3px 0 #9f9f9f; + box-shadow:0 3px 3px 0 #9f9f9f; + text-shadow:0 1px 2px rgba(0, 0, 0, 0.25); +} +.my-wishlist .buttons-set li .btn-share { + margin:0; + line-height:18px; + -webkit-appearance:none; + appearance:none; +} .my-wishlist .buttons-set li .update-wishlist { - background:-webkit-gradient(linear, 0 0, 0 100%, from(#E2E2E2), to(#9D9D9D)); + background:-webkit-gradient(linear, 0 0, 0 100%, from(#e2e2e2), to(#9d9d9d)); + background:-o-linear-gradient(top, #e2e2e2 0%, #9d9d9d 100%); color:#fff; border:1px solid #fff; border-radius:5px; @@ -2557,35 +3282,61 @@ section .category-title { display:none; } font-weight:bold; line-height:18px; -webkit-box-shadow:0 3px 3px 0 #9F9F9F; + box-shadow:0 3px 3px 0 #9F9F9F; + text-shadow:0 -1px 2px rgba(0, 0, 0, 0.25); -webkit-appearance:none; + appearance:none; } .my-wishlist .buttons-set li span { display:inline-block; } -#wishlist-list { margin:-10px 0 0; } +#wishlist-list { margin:-10px 0 0; min-height:200px; } #wishlist-list li > a { float:left; padding:10px; } -#wishlist-list li > a img { border:1px solid #FFF; -webkit-box-shadow:1px 1px 3px 0 #ccc; } +#wishlist-list li > a img { border:1px solid #FFF; -webkit-box-shadow:1px 1px 3px 0 #ccc; box-shadow:1px 1px 3px 0 #ccc; } #wishlist-list li { border-bottom:1px solid #CCC; position:relative; min-height:80px; } #wishlist-list li:last-child { border-bottom:0; } -#wishlist-list li, #wishlist-list .wishlist-item { overflow:hidden; } -#wishlist-list .wishlist-item { padding:10px; } +#wishlist-list .wishlist-item { padding:10px; position:relative; } #wishlist-list .wishlist-item .price-box { margin:0 0 5px; } +#wishlist-list li.no-qty .qty-holder { display:none; } #wishlist-list .qty { width:25px; margin:-2px 0 0; padding:2px 3px; border-radius:5px; font-size:12px; } #wishlist-list button { margin:0; padding:0; border:0; } -#wishlist-list button.btn-cart { position:absolute; right:10px; bottom:10px; text-align:right; margin:0; padding:5px 10px; background:-webkit-gradient(linear, 0 0, 0 100%, from(#F39823), to(#F37221)); font-size:11px; font-weight:bold; color:#FFF; border:1px solid #FFF; border-radius:5px; -webkit-box-shadow:0 3px 3px 0 #9F9F9F; } -#wishlist-list .edit-wishlist-item { background:-webkit-gradient(linear, 0 0, 0 100%, from(#ff9822), to(#f30)); border-radius:5px; color:#fff; display:inline-block; font-size:16px; padding:7px 15px; text-shadow:0 1px 1px #111; -webkit-box-shadow:0 0 1px #000; } -#wishlist-list tr { border-bottom:1px solid #CCC; } -#wishlist-list tr:last-child { border-bottom:0; } +#wishlist-list button.btn-cart { + background:-webkit-gradient(linear, 0 0, 0 100%, from(#f39823), to(#f37221)); + background:-o-linear-gradient(top, #f39823 0%, #f37221 100%); + text-align:right; + margin:0; + padding:5px 10px; + font-size:11px; + font-weight:bold; + color:#FFF; + border:1px solid #FFF; + border-radius:5px; + -webkit-box-shadow:0 3px 3px 0 #9F9F9F; + box-shadow:0 3px 3px 0 #9F9F9F; + text-shadow:0 1px 2px rgba(0, 0, 0, 0.25); +} +#wishlist-list .wishlist-item button.btn-cart { + position:absolute; + bottom:10px; + right:10px; +} +#wishlist-list .edit-wishlist-item { + background:-webkit-gradient(linear, 0 0, 0 100%, from(#ff9822), to(#f30)); + background:-o-linear-gradient(top, #ff9822 0%, #f30 100%); + border-radius:5px; + color:#fff; + display:inline-block; + font-size:16px; + padding:7px 15px; + -webkit-box-shadow:0 0 1px #000; + box-shadow:0 0 1px #000; + text-shadow:0 1px 1px #111; +} #wishlist-list a.btn-remove {} #wishlist-list a.btn-remove img { vertical-align:top; } #wishlist-list a.btn-edit { - background:-webkit-gradient( - linear, - 0 0, - 0 100%, - color-stop(1, #F5D605), - color-stop(0, #FF9D05) - ); + background:-webkit-gradient(linear, 0 0, 0 100%, color-stop(1, #f5d605), color-stop(0, #ff9d05)); + background:-o-linear-gradient(top, #ff9d05 0%, #f5d605 100%); font-family:Arial Rounded MT Bold; border:2px solid #fff; border-radius:15px; @@ -2600,7 +3351,33 @@ section .category-title { display:none; } text-shadow:0 1px 1px #999; vertical-align:middle; -webkit-box-shadow:0 0 5px rgba(0, 0, 0, 0.25); + box-shadow:0 0 5px rgba(0, 0, 0, 0.25); -webkit-background-clip:padding-box; + background-clip:padding-box; +} +#wishlist-list .add-to { + color:#666; + display:inline-block; + line-height:1.1; + margin:10px 0 10px 10px; + border-bottom:1px dashed; +} +#wishlist-list .gift-registry-select { + display:inline-block; + vertical-align:top; + text-align:center; +} +#wishlist-list .btn-gift-registry { + padding:10px; +} +#wishlist-list .btn-gift-registry select { + font-size:13px; +} +#wishlist-list .btn-gift-registry strong { + display:block; +} + +#wishlist-list .btn-gift-registry button.btn-cart { } .wishlist-wrap { position:relative; } .wishlist-wrap.grouped-items #wishlist-list li { min-height:initial; position:static; } @@ -2615,8 +3392,10 @@ section .category-title { display:none; } .wishlist-wrap.grouped-items b, .wishlist-wrap.grouped-items button, .wishlist-wrap.grouped-items input, +.wishlist-wrap.grouped-items .add-to, .wishlist-wrap.grouped-items .btn-remove, -.wishlist-wrap.grouped-items .btn-edit { +.wishlist-wrap.grouped-items .btn-edit, +.wishlist-wrap.grouped-items .btn-gift-registry { display:none !important; } .wishlist-wrap.grouped-items #wishlist-list .wishlist-item { @@ -2635,6 +3414,21 @@ section .category-title { display:none; } left:0; } +.giftregistry-table-wrap { margin:-10px -10px 10px; } +.giftregistry-table-wrap table { border-spacing:0; border-collapse:collapse; width:100%; } +.giftregistry-table-wrap th { background:#f6f6f6; text-align:left; white-space:nowrap; } +.giftregistry-table-wrap th, +.giftregistry-table-wrap td { border:1px solid #ddd; padding:5px 7px; } +.giftregistry-table-wrap td { vertical-align:top; } +.giftregistry-table-wrap td[colspan="2"] { background:-webkit-gradient(linear, 0 0, 0 100%, from(#eee), to(#ddd)); border-bottom-color:#ccc; text-align:center; text-shadow:0 1px 0 #fff; } +.giftregistry-table-wrap td .separator { color:#666; margin:0 2px; vertical-align:baseline; } + +.data-table-gift-registry-wrap { margin:-10px -10px 0; } +.data-table-gift-registry { border-spacing:0; border-collapse:collapse; margin:0 0 10px; width:100%; } +.data-table-gift-registry th { background:#f6f6f6; vertical-align:top; } +.data-table-gift-registry th, +.data-table-gift-registry td { border:1px solid #eee; padding:5px 10px; text-align:left; } +.data-table-gift-registry tr:nth-child(even) td { background:#f9f9f9; } /* Checkout -----------------------------*/ @@ -2642,40 +3436,66 @@ section .category-title { display:none; } margin:0 -10px 0 !important; } -.checkout-onepage-index .page-title { background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#ccc)); border:solid #999; border-width:1px 0; border-top-color:#ccc; margin:0 -10px 10px; padding:10px; } -#checkoutSteps { margin:-7px; padding:0; list-style:none; -webkit-box-shadow:3px -3px 2px 0 #F0F0F0; color:#636363; } +.checkout-onepage-index .page-title { + background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#ccc)); + background:-o-linear-gradient(top, #fff 0%, #ccc 100%); + border:solid #999; + border-width:1px 0; + border-top-color:#ccc; + margin:0 -10px 10px; + padding:10px; +} +#checkoutSteps { margin:-7px; padding:0; list-style:none; -webkit-box-shadow:3px -3px 2px 0 #F0F0F0; box-shadow:3px -3px 2px 0 #F0F0F0; color:#636363; } #checkoutSteps .step-title h2 { font-size:16px; font-weight:bold; } #checkoutSteps select { border:1px solid; border-color:#8e8e8e #e1e1e1 #e1e1e1 #8e8e8e; border-radius:5px; font-size:18px; padding:5px 30px 5px 5px; } #checkoutSteps li { margin:0 0 3px; } -#checkoutSteps li .step-title { margin:-1px 0 0 0; padding:5px 10px; border:1px solid #CECECE; border-radius:2px; background: -webkit-gradient(linear, 0 0, 0 100%, from(#FEFEFE), to(#EEE)); } +#checkoutSteps li .step-title { + background: -webkit-gradient(linear, 0 0, 0 100%, from(#fefefe), to(#eee)); + background:-o-linear-gradient(top, #fefefe 0%, #eee 100%); + margin:-1px 0 0 0; + padding:5px 10px; + border:1px solid #CECECE; + border-radius:2px; +} #checkoutSteps li.allow .step-title { + background:-webkit-gradient(linear, 0 0, 0 100%, from(#fbfbfb), to(#d1d3d4)); + background:-o-linear-gradient(top, #fbfbfb 0%, #d1d3d4 100%); margin:-1px 0 0 0; padding:5px 10px; - border:1px solid #C6C6C6; + border:1px solid #c6c6c6; border-radius:2px; - background:-webkit-gradient(linear, 0 0, 0 100%, from(#FBFBFB), to(#D1D3D4)); } -#checkoutSteps li.active .step-title { background:-webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffa84c), color-stop(100%,#ff7b0d)); color:#fff; text-shadow:0 -1px 0 #ff7b0d; } +#checkoutSteps li.active .step-title { + background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #ffa84c), color-stop(100%, #ff7b0d)); + background:-o-linear-gradient(top, #ffa84c 0%, #ff7b0d 100%); + color:#fff; + text-shadow:0 -1px 0 #ff7b0d; +} #checkoutSteps li .step-title a { display:none; } #checkoutSteps li .step { + background: -webkit-gradient(linear, 0 0, 0 100%, from(#eee), to(#fefefe)); + background:-o-linear-gradient(top, #eee 0%, #fefefe 100%); margin:-1px 0 10px; padding:10px; border-radius:2px; - background: -webkit-gradient(linear, 0 0, 0 100%, from(#EEE), to(#FEFEFE)); border:1px solid #CECECE; } #checkoutSteps li .step select { width:100%; } #checkoutSteps li .step .input-box .v-fix { display:inline-block; width:49%; } -#checkoutSteps li .step .input-box .v-fix .year { width:70px; } +#checkoutSteps li .step .input-box .v-fix .year { width:auto; } #checkoutSteps li .step .input-box .cvv-what-is-this { display:inline-block; vertical-align:top; margin:0 0 0 5px; font-size:13px; color:#F4641E; } #checkoutSteps li .step .tool-tip .btn-close { padding:0 0 5px 0; text-align:right; font-size:13px; } #checkoutSteps li .step .tool-tip .btn-close a { color:#DF2327; } #checkoutSteps li .step .tool-tip .tool-tip-content img { width:100%; } +#checkoutSteps li .step .control .input-box { display:inline; } #checkoutSteps li .step input[type="radio"] { vertical-align:top; } #checkoutSteps li .step .sp-methods dt { font-weight:bold; } +#checkoutSteps li .step .sp-methods + div { padding:10px 0 0; } #checkoutSteps li .step .please-wait { margin:0 0 0 10px; } #checkoutSteps li .step .please-wait img { vertical-align:middle; } #checkoutSteps li .step fieldset .required em { margin:0 5px 0 0; color:#F4641E; } +#checkoutSteps li .step .buttons-set { padding:10px 0 0; } +#checkoutSteps #customerbalance_placer { padding:0 0 10px; } #checkoutSteps li .step .buttons-set:after { content:"."; display:block; @@ -2694,25 +3514,57 @@ section .category-title { display:none; } #checkoutSteps li .step .gift-messages-form .product-name { font-size:14px; } #checkoutSteps li .step .buttons-set .required { padding:0 0 10px; color:#F4641E; font-weight:bold; } #checkoutSteps li .step .back-link { float:left; } -#checkoutSteps li .step .back-link a {display:block; padding:5px 10px; background:-webkit-gradient(linear, 0 0, 0 100%, from(#F39823), to(#F37221)); font-size:11px; font-weight:bold; color:#FFF; border:1px solid #FFF; border-radius:5px; -webkit-box-shadow:0 3px 3px 0 #9F9F9F; } +#checkoutSteps li .step .back-link a { + background:-webkit-gradient(linear, 0 0, 0 100%, from(#f39823), to(#f37221)); + background:-o-linear-gradient(top, #f39823 0%, #f37221 100%); + display:block; + padding:5px 10px; + font-size:11px; + font-weight:bold; + color:#FFF; + border:1px solid #FFF; + border-radius:5px; + -webkit-box-shadow:0 3px 3px 0 #9F9F9F; + box-shadow:0 3px 3px 0 #9F9F9F; + text-shadow:0 1px 2px rgba(0, 0, 0, 0.25); +} #checkoutSteps li .step-title h2 { display:block; } #checkoutSteps li.allow .step-title h2 { background:url(../images/bg_checkout_step_passed.png) no-repeat center right; } #checkoutSteps li.active .step-title h2 { background:none !important; } #checkoutSteps li .step-title .number { display:none; } #checkoutSteps .form-list .field label, #checkoutSteps .form-list .wide label { padding:0; font-weight:bold; } -#checkoutSteps li .step .buttons-set button { float:right; padding:5px 10px; background:-webkit-gradient(linear, 0 0, 0 100%, from(#F39823), to(#F37221)); font-size:14px; font-weight:bold; color:#FFF; border:1px solid #FFF; border-radius:5px; -webkit-box-shadow:0 3px 3px 0 #9F9F9F; -webkit-background-clip:padding-box; } +#checkoutSteps li .step .buttons-set button { + background:-webkit-gradient(linear, 0 0, 0 100%, from(#f39823), to(#f37221)); + background:-o-linear-gradient(top, #f39823 0%, #f37221 100%); + float:right; + padding:5px 10px; + font-size:14px; + font-weight:bold; + color:#fff; + border:1px solid #FFF; + border-radius:5px; + -webkit-box-shadow:0 3px 3px 0 #9F9F9F; + box-shadow:0 3px 3px 0 #9F9F9F; + -webkit-background-clip:padding-box; + background-clip:padding-box; + text-shadow:0 1px 2px rgba(0, 0, 0, 0.25); +} #checkoutSteps .validation-advice { color:#F4641E; } #checkoutSteps .back-link small { display:none; } #co-payment-form dd, #checkoutSteps li .step dd { margin:0; padding:0; } #opc-billing .step .required em { display:none; } -#checkout-review-table { width:100%; font-size:12px; } +#checkout-review-table { border-spacing:0; width:100%; font-size:12px; } #checkout-review-table th { background:#909090; color:#FFF; } #checkout-review-table th:first-child { text-align:left; } #checkout-review-table tr.odd td { background:#EEE; } #checkout-review-table th, #checkout-review-table td { padding:2px 5px; } +#checkout-review-table td { vertical-align:top; } +#checkout-review-table td.last { text-align:right; } +#checkout-review-table .label { white-space:nowrap; } +#checkout-review-table .cart-price { font-weight:bold; } #checkout-review-submit .buttons-set:after { content:"."; display:block; @@ -2732,6 +3584,7 @@ section .category-title { display:none; } #checkout-review-submit .buttons-set .f-left a { display:block; background:-webkit-gradient(linear, 0 0, 0 100%, from(#333), to(#111)); + background:-o-linear-gradient(top, #333 0%, #111 100%); border:none; color:white; font-size:13px; @@ -2741,6 +3594,7 @@ section .category-title { display:none; } padding:8px 10px; text-shadow:0 1px 0 black; -webkit-border-radius:5px; + border-radius:5px; } #checkout-step-login .checkout-login { border-bottom:1px solid #ccc; @@ -2773,10 +3627,69 @@ section .category-title { display:none; } vertical-align:middle; } +.add-gift-message, +.gift-message-form { + margin:10px 0 20px; +} + +.add-gift-message h3, +.gift-message-form h4 { + margin:0 0 5px; +} + +.gift-message-form p { + margin:0 0 8px; +} + +.gift-message-form .product-image { + margin:0 0 2px; +} + +.gift-message-form .product-image img { + -webkit-box-shadow:0 1px 2px #999; + box-shadow:0 1px 2px #999; +} + +.gift-message-form ol { + list-style:none; + margin:0 0 10px; + padding:0; +} + +.gift-message-form .gift-item:after { + content:""; + display:table; +} +.gift-message-form .gift-item:after { + clear:both; +} + +.gift-message-form .number { + display:none; +} + +.gift-message-form .form-list { + clear:both; + border-bottom:1px solid #ccc; + margin:0 0 10px; + padding:10px 0; +} + +.gift-message-form .product-img-box { + float:left; + margin-right:10px; +} + +.extra-options-container { clear:both; } + /* Sitemap -----------------------------*/ .sitemap { margin:-1px -10px -10px; } -.sitemap li { background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#eee)); border-top:1px solid #ccc; } +.sitemap li { + background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#eee)); + background:-o-linear-gradient(top, #fff 0%, #eee 100%); + border-top:1px solid #ccc; +} .sitemap li a { background:url(../images/i_arrow_small.png) no-repeat 96% 50%; background-size:8px 12px; display:block; padding:10px; font-size:16px; } .catalog-seo-sitemap-category .page-title { display:none; } .catalog-seo-sitemap-category .page-sitemap .pager, @@ -2795,18 +3708,43 @@ section .category-title { display:none; } .catalogsearch-term-popular .tags-list li { display:inline-block; padding:0 10px; line-height:2; font-size:16px; } -/* Contact us +/* Contact us, Share Wishlist -----------------------------*/ .contacts-index-index .page-title { display:none; } .contacts-index-index .fieldset h2 { display:none; } .contacts-index-index .messages { margin:0 -10px 0; } -.contacts-index-index form { display:block; border:1px solid #D1D1D1; margin:2px -7px -7px; padding:9px; border-radius:2px 2px 5px 5px; background:-webkit-gradient(linear, 0 0, 0 100%,color-stop(0, #FCFDFD), color-stop(0.8, #EEEEEE), color-stop(1, #E8E9E9)); } -.contacts-index-index label { color:#5E5E5E; font-weight:bold; } -.contacts-index-index label em { margin:0 3px 0 0; color:#F4641E; } +.contacts-index-index section form, +.wishlist-index-share section form { + background:-webkit-gradient(linear, 0 0, 0 100%,color-stop(0, #FCFDFD), color-stop(0.8, #eee), color-stop(1, #e8e9e9)); + background:-o-linear-gradient(top, #fcfdfd 0%, #eee 80%, #e8e9e9 100%); + display:block; + border:1px solid #d1d1d1; + margin:2px -7px -7px; + padding:9px; + border-radius:2px 2px 5px 5px; +} +.wishlist-index-share section form { margin:2px 3px -7px; } +.contacts-index-index label, +.wishlist-index-share label { color:#5E5E5E; font-weight:bold; } +.contacts-index-index label em, +.wishlist-index-share label em { display:inline; margin:0 3px 0 0; color:#F4641E; } .contacts-index-index textarea { width:99%; height:200px; } .contacts-index-index .fields .field { margin:0 0 8px 0; } -.contacts-index-index .buttons-set .required { float:right; font-size:12px; font-weight:bold; color:#F4641E; } -.contacts-index-index .buttons-set button { padding:5px 10px; background:-webkit-gradient(linear, 0 0, 0 100%, from(#F39823), to(#F37221)); font-size:12px; color:#FFF; border:1px solid #FFF; border-radius:5px; -webkit-box-shadow:0 3px 3px 0 #9F9F9F; } +.contacts-index-index .buttons-set .required, +.wishlist-index-share .buttons-set .required { float:right; font-size:12px; font-weight:bold; color:#F4641E; display:block; } +.contacts-index-index .buttons-set button, +.wishlist-index-share .buttons-set button { + background:-webkit-gradient(linear, 0 0, 0 100%, from(#f39823), to(#f37221)); + background:-o-linear-gradient(top, #f39823 0%, #f37221 100%); + padding:5px 10px; + font-size:12px; + color:#fff; + border:1px solid #fff; + border-radius:5px; + -webkit-box-shadow:0 3px 3px 0 #9f9f9f; + box-shadow:0 3px 3px 0 #9f9f9f; + text-shadow:0 1px 2px rgba(0, 0, 0, 0.25); +} /* Advanced search @@ -2820,14 +3758,15 @@ section .category-title { display:none; } padding:5px 10px; border:1px solid #CECECE; border-radius:2px; - background:-webkit-gradient(linear, 0 0, 0 100%, from(#FEFEFE), to(#EEE)); + background:-webkit-gradient(linear, 0 0, 0 100%, from(#fefefe), to(#eee)); + background:-o-linear-gradient(top, #fefefe 0%, #eee 100%); font-size:16px; } -#advanced-search-list li:nth-last-child(-n+3) { +#advanced-search-list > li:nth-last-child(-n+3) { display:inline-block; width:32%; } -#advanced-search-list li:nth-last-child(-n+3) select { +#advanced-search-list > li:nth-last-child(-n+3) select { width:100%; } diff --git a/skin/frontend/default/iphone/images/bg_button.png b/skin/frontend/default/iphone/images/bg_button.png new file mode 100644 index 0000000000000000000000000000000000000000..fa1b0ceeb3d5322d41df878ead3adbf4e3d6379d GIT binary patch literal 2558 zcmaJ@e>{`>9^aN zxs)V_i1MT2QcgKKw}j3*E>h7shrBAfk4|;&AGiB`y`Ja$7R{9;Lcp`5h&j!j+7_xq#%MW5J!LjOT>!;IUrA< zjOziN5r}0NAvaJS$o8i4#UdLLBrqF+aCTKlc>EYp4n%-aLWqW$Zn=R0gaR67 zw*wo`mN39*;r2u+xGT|z%TJ8qQv?`S7rQoChdGv5<_apkY4hQsME^G7bZL zgveuPm_LgOWcvXOu@nRxuy|WOo^Fo?=hg3J~!GJdQxb;mNiHJk^0r#S?%} z4FkJL1(8$^)AN%TJfmTv<#GuXhf7FEz$VyX#nLDofkL6+@I)MuXbU53WlBiSQ`kbX z^`8}(po}jSO5{Q@1S~1?BE<1>8V0WP&n<`~Ut}TKr(=Q-45#2pa0D!VX-l7hZ1(?$ zibP+~GC2qQtKR=9EaNIAAdUmd#PL!-d~uQMm#idIh7{z<#Zs@L7L(3Z zJbqCu^4_)E?2d0((*dLxvQAj%ufIKWKYsIuRJV!rbaO(ld%@Z0$O2%#OAjH1+;^JgMTc!Q&4&<%7AA zA@_T<4=&>eM{EjC>mZ-&(%E zZ*X*Vu}>6Unm6YJ>0=K@Zd9C(B2Ck5lGCe)7q^F}E4i18?%HJckEk-uY`2(RV z8SD$S^;fQ>U%!RCxi2GWEHBSEvi^~xHAP)hvo*2`wcIK$1mH2H{m8h~LBlt_&iQA( zD*=`F4>2rMsZmVj{$LISVatpdlc*bRHm9%5&nrT2

    P=bCdFB%x@M@{xXK)`{lWw zoh|9PZTcHB(S~4TWb;t$#BJ@x!(J5;*fTp?qtm!tu61|c)$;OkEst&6T5hF{*gQRP zxOi2&=Ehr=@t{tIl@*OPJnW#8>iXN6{?NW6L$q_?`GD%td%e9fBQ4a^X^av|Tj!GO zc=W+Na~Ci4nl<{P$oJ^bI~6%i^IOX9oAqdS3`NaYAk4cM{{DkSYjP_ky#=;r23p2h z`E%VJh=GJniR z*FUN`o|}6snu0*<=<2Gt#)stBLZGai9N9a=GrgJLBX8!@nSw3{kw|ohWnC-zfJ7)d zuF1xqpm-)#CeC)gco9n=9bMK9$W-_G`kYgyM_O~s%F1d*kFPGT z&_-c1vd;0nk{(PBsMmIMbkxkO2l6H+CzY3qzdO<>8k*Y~6*azDL-G(&D{^^n8 zfsv7vzZV8&Pd&WI=t=kQ@9Q&YNm*!KziE^Drg~$+o3@}|>21Sx{5$U~EG$Zn!O7Xz zu;&y$a4=64{v@i%yK;*QnD^}_pFU-4!gOd)S65f{-o1MrY)*R_olG6nKhR@$r1LdD zF7CAt-S}{U2Y^1Q7qVe^cz8?zd6&DLA_e;2wfV=5>u;VPc{$W*=~q2yIyqD0i>j)v z4VzK0SlMpRlX{@W>7sMz?&V}tUW^b`_lgT(%vN1V%qj6I+r=6xS6o-RmtMIz)OA)&CWAicP^Zp{b_8>H0z9C w6TZ)+y=g_bww*^@kp?>$Gk%@gw`d%WIJ8C65T05hUiu?rdH66dxre9!2kEsgH2?qr literal 0 HcmV?d00001 diff --git a/skin/frontend/default/iphone/js/iphone.js b/skin/frontend/default/iphone/js/iphone.js index 48418ecda3..fd15c7cc48 100644 --- a/skin/frontend/default/iphone/js/iphone.js +++ b/skin/frontend/default/iphone/js/iphone.js @@ -26,6 +26,52 @@ // Homepage categories and subcategories slider document.observe("dom:loaded", function() { + function handler(position) { + var lat = position.coords.latitude, + lng = position.coords.longitude; + + //alert(latitude + ' ' + longitude); + + var geocoder = new google.maps.Geocoder(); + + function codeLatLng() { + var latlng = new google.maps.LatLng(lat, lng); + geocoder.geocode({'latLng': latlng}, function(results, status) { + if (status == google.maps.GeocoderStatus.OK) { + if (results[0]) { + alert(results[0].formatted_address); + } + } else { + alert("Geocoder failed due to: " + status); + } + }); + } + + //codeLatLng(); + + } + + if ( navigator.geolocation ) { + //navigator.geolocation.getCurrentPosition(handler); + } + + if ( $('giftregistry-table') ) { + $('giftregistry-table').wrap('div', { 'class' : 'giftregistry-table-wrap' }); + } + + if ( $('my-reviews-table') ) { + $('my-reviews-table').wrap('div', { 'class' : 'my-reviews-table-wrap' }); + } + + var transformPref = Modernizr.prefixed('transform'); + + function supportsTouchCallout () { + var div = document.createElement('div'), + supports = div.style['webkitTouchCallout'] !== undefined || div.style['touchCallout'] !== undefined; + + return supports + } + $$('input[name=qty], input[name*=super_group], input[name*=qty]').each(function (el) { var defaultValue = el.value; el.observe('focus', function () { @@ -52,12 +98,78 @@ document.observe("dom:loaded", function() { }); } + function is_touch_device() { + try { + document.createEvent("TouchEvent"); + return true; + } catch (e) { + return false; + } + } + + var touch = is_touch_device(); + + $$('select[multiple]').each(function (select) { + var select_options = new Element('ol', {'class': 'select-multiple-options'}).wrap('div', { 'class' : 'select-multiple-options-wrap' }), + selected; + + select.wrap('div', { 'class': 'select-multiple-wrap' }); + select.select('option').each(function(option) { + select_options.down().insert({ bottom : new Element('li', { 'class' : 'select-option', 'data-option-value' : option.value }).update(option.text) }); + }); + + select_options.insert({ top : new Element('div', { 'class' : 'select-heading' }).update('Choose options...').insert({ top : new Element('span', { 'class' : 'select-close' }).update('x') }) }); + + var closeSelect = function() { + select_options.setStyle({ 'visibility' : 'hidden' }); + selected = []; + select.select('option').each(function (option) { + if (option.selected) { + selected.push(option.text) + } + }); + + if (selected.size() > 0) { + select.previous().update('' + selected.join(', ')).addClassName('filled'); + select.previous().select('span')[0].update(selected.size()); + } else { + select.previous().update('Choose options...').removeClassName('filled'); + } + document.stopObserving('click', closeSelect); + } + + select_options.select('.select-close')[0].observe('click', closeSelect ); + + select_options.on('click', '.select-option', function(e, elem) { + var option = select.select('option[value=' + elem.readAttribute('data-option-value') + ']')[0]; + elem.toggleClassName('active'); + if (option.selected) { + option.selected = false + } else { + option.selected = true; + } + if (typeof bundle !== 'undefined') bundle.changeSelection(select); + }); + + select.insert({ before : select_options }); + select.insert({ + before: new Element('div', {'class': 'select-multiple'}).update("Choose options...").observe('click', function(e) { + select.previous('.select-multiple-options-wrap').setStyle({ 'visibility' : 'visible' }).observe('click', function(e) { + e.stopPropagation(); + }); + setTimeout(function() { + document.observe('click', closeSelect) + }, 1); + }) + }); + select.setStyle({ 'visibility' : 'hidden', 'position' : 'absolute' }); + }); + var supportsOrientationChange = "onorientationchange" in window, orientationEvent = supportsOrientationChange ? "orientationchange" : "resize"; Event.observe(window, orientationEvent, function() { - var orientation, - page; + var orientation, page, transformValue = {}; switch(window.orientation){ case 0: @@ -84,7 +196,12 @@ document.observe("dom:loaded", function() { sliderPosition = (sliderPosition + viewportWidth*page) - document.body.offsetWidth*page; viewportWidth = document.body.offsetWidth; - $("nav-container").setStyle({"-webkit-transform" : "translate3d(" + sliderPosition + "px, 0, 0)"}); + if ( Modernizr.csstransforms3d ) { + transformValue[transformPref] = "translate3d(" + sliderPosition + "px, 0, 0)"; + } else if ( Modernizr.csstransforms ) { + transformValue[transformPref] = "translate(" + sliderPosition + "px, 0)"; + } + $("nav-container").setStyle(transformValue); if ( upSellCarousel ) { if (orientation === 'landscape') { @@ -101,12 +218,21 @@ document.observe("dom:loaded", function() { var groupItems = Class.create({ initialize: function (handle, removeHandle, photos, form) { + var that = this; this.handle = handle; this.removeHandle = removeHandle; this.photos = this.handle.select(photos); if ( this.photos.size() < 2 ) { return } + if ( !('ongesturestart' in window) && this.photos.size() > 1 ) { + $$('.remove-all-button').each(function(btn) { + btn.setStyle({ 'display' : 'block' }).observe('click', function(e) { + e.preventDefault(); + that.removeAll(); + }); + }); + } this.form = form; this.removeHandle.observe('click', this.removeAll.bind(this)); @@ -157,7 +283,7 @@ document.observe("dom:loaded", function() { } if ( $$('.wishlist-wrap')[0] ) { - var wishlistGroup = new groupItems($$('.wishlist-wrap')[0], $('remove-all-wishlist'), 'li > a', $('wishlist-view-form')); + var wishlistGroup = new groupItems($$('.wishlist-wrap')[0], $('remove-all-wishlist'), '#wishlist-list li > a', $('wishlist-view-form')); } if ( $$('#remember-me-box a')[0] ) { @@ -185,8 +311,11 @@ document.observe("dom:loaded", function() { }); } + //alert(Modernizr.prefixed('transform')); + // Home Page Slider + //alert(transformPref); var sliderPosition = 0, viewportWidth = document.body.offsetWidth, last, @@ -201,6 +330,8 @@ document.observe("dom:loaded", function() { sliderLink.observe('click', function(e) { + var transformValue = {} + homeLink.hasClassName('disabled') ? homeLink.removeClassName('disabled') : ''; if (last) { @@ -228,7 +359,12 @@ document.observe("dom:loaded", function() { if (diff && diff < 200) { return } - $("nav-container").setStyle({"-webkit-transform" : "translate3d(" + (document.body.offsetWidth + sliderPosition) + "px, 0, 0)"}); + if ( Modernizr.csstransforms3d ) { + transformValue[transformPref] = "translate3d(" + (document.body.offsetWidth + sliderPosition) + "px, 0, 0)"; + } else if ( Modernizr.csstransforms ) { + transformValue[transformPref] = "translate(" + (document.body.offsetWidth + sliderPosition) + "px, 0)"; + } + $("nav-container").setStyle(transformValue); sliderPosition = sliderPosition + document.body.offsetWidth; setTimeout(function() { $$("#nav-container > ul:last-child")[0].remove(); $("nav-container").setStyle({'height' : 'auto'}) }, 250) }); @@ -237,7 +373,18 @@ document.observe("dom:loaded", function() { $("nav-container").insert(this.clonedSubmenuList.setStyle({'width' : document.body.offsetWidth + 'px'})); $('nav-container').setStyle({'height' : this.clonedSubmenuList.getHeight() + 'px'}); - $("nav-container").setStyle({"-webkit-transform" : "translate3d(" + (sliderPosition - document.body.offsetWidth) + "px, 0, 0)"}); + + if ( Modernizr.csstransforms3d ) { + + transformValue[transformPref] = "translate3d(" + (sliderPosition - document.body.offsetWidth) + "px, 0, 0)"; + + } else if ( Modernizr.csstransforms ) { + + transformValue[transformPref] = "translate(" + (sliderPosition - document.body.offsetWidth) + "px, 0)"; + + } + + $("nav-container").setStyle(transformValue); sliderPosition = sliderPosition - document.body.offsetWidth; e.preventDefault(); @@ -245,7 +392,19 @@ document.observe("dom:loaded", function() { }; }); + function getSupportedProp(proparray){ + var root = document.documentElement; + for ( var i = 0; i < proparray.length; i++ ) { + if ( typeof root.style[proparray[i]] === "string") { + return proparray[i]; + } + } + } + function NoClickDelay(el) { + if ( getSupportedProp(['OTransform']) ) { + return + } this.element = typeof el == 'object' ? el : document.getElementById(el); if( window.Touch ) this.element.addEventListener('touchstart', this, false); } @@ -296,24 +455,51 @@ document.observe("dom:loaded", function() { new NoClickDelay(document.getElementById('nav')); } + var supports3d = window.WebKitCSSMatrix ? true : false; + + //alert(Modernizr.csstransforms3d); + //alert(Modernizr.csstransforms); + //iPhone header menu $$('dt.dropdown a').each(function (elem) { elem.observe('click', function(e) { - var parent = elem.up(); + var parent = elem.up(), transformValue = {}; if (parent.hasClassName('active')) { parent.removeClassName('active'); $$('#menu dd').each(function(elem) { - elem.setStyle({'webkitTransform' : 'translate3d(0, -100%, -1px)'}); + + if ( Modernizr.csstransforms3d ) { + transformValue[transformPref] = 'translate3d(0, -100%, -1px)'; + } else if ( Modernizr.csstransforms ) { + transformValue[transformPref] = 'translate3d(0, -100%)'; + transformValue['visibility'] = 'hidden'; + } + + elem.setStyle(transformValue); }) - } - else { + } else { $$('#menu dt').each(function (elem){ elem.removeClassName('active'); - elem.next('dd').setStyle({'webkitTransform' : 'translate3d(0, -100%, -1px)'}); + + if ( Modernizr.csstransforms3d ) { + transformValue[transformPref] = 'translate3d(0, -100%, -1px)'; + } else if ( Modernizr.csstransforms ) { + transformValue[transformPref] = 'translate3d(0, -100%)'; + transformValue['visibility'] = 'hidden'; + } + + elem.next('dd').setStyle(transformValue); }); parent.addClassName('active'); - parent.next().setStyle({'webkitTransform' : 'translate3d(0, 0, -1px)', 'visibility' : 'visible'}); + if ( Modernizr.csstransforms3d ) { + transformValue[transformPref] = 'translate3d(0, 0%, -1px)'; + transformValue['visibility'] = 'visible'; + } else if ( Modernizr.csstransforms ) { + transformValue[transformPref] = 'translate3d(0, 0%)'; + transformValue['visibility'] = 'visible'; + } + parent.next().setStyle(transformValue); if ( cartDrag ) { cartDrag.cartHide(); } @@ -346,7 +532,7 @@ document.observe("dom:loaded", function() { elem.innerHTML = elem.innerHTML.replace(/\((\d+)\)/, '$1') }) - $$('.top-link-cart')[0].up().remove(); + //$$('.top-link-cart')[0].up().remove(); var sum = 0; $$('.menu-box .badge').each(function (badge) { @@ -398,6 +584,7 @@ document.observe("dom:loaded", function() { this.carousel = carousel; this.items = itemsContainer.addClassName('carousel-items'); + this.itemsWrap = this.items.wrap('div', {'class' : 'carousel-items-wrap'}); this.itemsLength = this.items.childElements().size(); this.counter = this.carousel.insert(new Element('div', {'class' : 'counter'})).select('.counter')[0]; this.controls = carousel.select('.controls')[0]; @@ -410,9 +597,9 @@ document.observe("dom:loaded", function() { this.nextButton.observe('click', this.moveRight.bind(this)); this.prevButton.observe('click', this.moveLeft.bind(this)); - this.items.observe('touchstart', this.touchStart.bind(this)); - this.items.observe('touchmove', this.touchMove.bind(this)); - this.items.observe('touchend', this.touchEnd.bind(this)); + this.itemsWrap.observe('touchstart', this.touchStart.bind(this)); + this.itemsWrap.observe('touchmove', this.touchMove.bind(this)); + this.itemsWrap.observe('touchend', this.touchEnd.bind(this)); }, init: function () { this.itemPos = 0; @@ -426,11 +613,15 @@ document.observe("dom:loaded", function() { return this; }, resize: function(visibleElements) { + var transformValue = {}; this.options.visibleElements = visibleElements; this.counter.childElements().invoke('remove'); - this.items.setStyle({ - '-webkit-transform': 'translateX(' + 0 + '%)' - }); + if ( Modernizr.csstransforms3d ) { + transformValue[transformPref] = 'translateX(' + 0 + '%)'; + } else if ( Modernizr.csstransforms ) { + transformValue[transformPref] = 'translate(' + 0 + '%, 0)'; + } + this.items.setStyle(transformValue); this.prevButton.addClassName('disabled'); this.nextButton.removeClassName('disabled'); this.init(); @@ -460,11 +651,16 @@ document.observe("dom:loaded", function() { }, moveRight: function (e) { if(Math.abs(this.itemPos) < this.lastItemPos) { + var transformValue = {}; this.itemPos -= 100/this.options.visibleElements * this.options.visibleElements; - this.items.setStyle({ - 'position': 'relative', - '-webkit-transform': 'translateX(' + this.itemPos + '%)' - }); + if ( Modernizr.csstransforms3d ) { + transformValue[transformPref] = 'translateX(' + this.itemPos + '%)'; + transformValue['position'] = 'relative'; + } else if ( Modernizr.csstransforms ) { + transformValue[transformPref] = 'translate(' + this.itemPos + '%, 0)'; + transformValue['position'] = 'relative'; + } + this.items.setStyle(transformValue); if (Math.abs(this.itemPos) >= this.lastItemPos) { this.nextButton.addClassName('disabled'); } @@ -477,11 +673,16 @@ document.observe("dom:loaded", function() { }, moveLeft: function (e) { if (this.itemPos !== 0) { + var transformValue = {}; this.itemPos += 100/this.options.visibleElements * this.options.visibleElements; - this.items.setStyle({ - 'position': 'relative', - '-webkit-transform': 'translateX(' + this.itemPos + '%)' - }); + if ( Modernizr.csstransforms3d ) { + transformValue[transformPref] = 'translateX(' + this.itemPos + '%)'; + transformValue['position'] = 'relative'; + } else if ( Modernizr.csstransforms ) { + transformValue[transformPref] = 'translate(' + this.itemPos + '%, 0)'; + transformValue['position'] = 'relative'; + } + this.items.setStyle(transformValue); if(this.itemPos === 0) { this.prevButton.addClassName('disabled'); @@ -637,18 +838,27 @@ document.observe("dom:loaded", function() { this.startMin = this.headerHeight - this.minHeight; this.startMax = this.headerHeight - this.maxHeight; this.visible = false; - this.empty = this.cartHolder.hasClassName('cart-empty') ? true : false; + this.empty = this.cartHolder.hasClassName('cart-empty'); this.range = 0; this.originalCoord = { x: 0, y: 0 }; this.finalCoord = { x: 0, y: 0 }; - this.cart.observe('touchstart', this.touchStart.bind(this)); - this.cart.observe('touchmove', this.touchMove.bind(this)); - this.cart.observe('touchend', this.touchEnd.bind(this)); + if ( Modernizr.touch ) { + this.cart.observe('touchstart', this.touchStart.bind(this)); + this.cart.observe('touchmove', this.touchMove.bind(this)); + this.cart.observe('touchend', this.touchEnd.bind(this)); + } else { + this.cart.observe('click', this.toggleView.bind(this)); + } + this.cartHolder.observe('webkitTransitionEnd', this.transitionEnd.bind(this)); - this.cartHolder.setStyle({'webkitTransform':'translate3d(0,' + this.startMax + 'px, 0)'}); + if ( supports3d ) { + this.cartHolder.setStyle({'webkitTransform':'translate3d(0,' + this.startMax + 'px, 0)'}); + } else { + this.cartHolder.setStyle({'OTransform':'translate(0,' + this.startMax + 'px)'}); + } setTimeout(function () { this.cartHolder.setStyle({'visibility': 'visible'}); }.bind(this), 100); @@ -657,11 +867,19 @@ document.observe("dom:loaded", function() { touchStart : function (e) { e.preventDefault(); + var transformValue = {}; + $$('#menu dt.active').each(function(elem) { elem.removeClassName('active'); }); $$('#menu dd').each(function(elem) { - elem.setStyle({'webkitTransform' : 'translate3d(0, -100%, -1px)'}); + if ( Modernizr.csstransforms3d ) { + transformValue[transformPref] = 'translate3d(0, -100%, -1px)'; + } else if ( Modernizr.csstransforms ) { + transformValue[transformPref] = 'translate3d(0, -100%)'; + transformValue['visibility'] = 'hidden'; + } + elem.setStyle(transformValue); }); this.originalCoord.x = event.targetTouches[0].pageX; @@ -674,6 +892,8 @@ document.observe("dom:loaded", function() { return } + var transformValue = {}; + if ( Math.abs(this.finalCoord.y - this.originalCoord.y) > 1 && this.finalCoord.y - this.originalCoord.y < 3 ) { this.cartHolder.removeClassName('animate').addClassName('cart-short'); } @@ -691,10 +911,17 @@ document.observe("dom:loaded", function() { this.visible = true; } - this.cartHolder.setStyle({'webkitTransform':'translate3d(0,' + this.range + 'px, 0)'}) + if ( Modernizr.csstransforms3d ) { + transformValue[transformPref] = 'translate3d(0,' + this.range + 'px, 0)'; + } else if ( Modernizr.csstransforms ) { + transformValue[transformPref] = 'translate(0,' + this.range + 'px)'; + } + + this.cartHolder.setStyle(transformValue); }, touchEnd : function (e) { e.preventDefault(); + var transformValue = {}; if ( Math.abs(this.originalCoord.y - this.finalCoord.y ? this.finalCoord.y : 0) < 10 && Math.abs(this.originalCoord.x - this.finalCoord.x ? this.finalCoord.x : 0) < 10 ) { if ( this.visible ) { this.cartHide(); @@ -702,28 +929,70 @@ document.observe("dom:loaded", function() { this.cartShow(); } } - if ( this.range + this.minHeight < (this.minHeight) && this.cartHolder.hasClassName('cart-short') && !this.empty ) { - this.cartHolder.addClassName('animate').setStyle({'webkitTransform':'translate3d(0,' + this.startMin + 'px, 0)'}); + if ( this.minHeight - this.headerHeight + this.range < (this.minHeight) && this.cartHolder.hasClassName('cart-short') && !this.empty ) { + if ( Modernizr.csstransforms3d ) { + transformValue[transformPref] = 'translate3d(0,' + this.startMin + 'px, 0)'; + } else if ( Modernizr.csstransforms ) { + transformValue[transformPref] = 'translate(0,' + this.startMin + 'px)'; + } + this.cartHolder.addClassName('animate').setStyle(transformValue); } }, cartHide : function () { + var transformValue = {}; this.cart.removeClassName('active'); - this.cartHolder.setStyle({'webkitTransform':'translate3d(0,' + this.startMax + 'px, 0)', 'top': '0px'}); + if ( Modernizr.csstransforms3d ) { + transformValue[transformPref] = 'translate3d(0,' + this.startMax + 'px, 0)'; + transformValue['top'] = '0px'; + } else if ( Modernizr.csstransforms ) { + transformValue[transformPref] = 'translate(0,' + this.startMax + 'px)'; + transformValue['top'] = '0px'; + } + this.cartHolder.setStyle(transformValue); this.visible = false; }, cartShow : function () { + var transformValue = {}; this.visible = true; this.cart.addClassName('active'); - this.cartHolder.removeClassName('cart-short').setStyle({'webkitTransform':'translate3d(0,' + this.startMax + 'px, 0)'}); - this.cartHolder.addClassName('animate').setStyle({'webkitTransform':'translate3d(0,' + this.headerHeight + 'px, 0)'}); + if ( Modernizr.csstransforms3d ) { + transformValue[transformPref] = 'translate3d(0,' + this.startMax + 'px, 0)'; + this.cartHolder.removeClassName('cart-short').setStyle(transformValue); + + transformValue[transformPref] = 'translate3d(0,' + this.headerHeight + 'px, 0)'; + this.cartHolder.addClassName('animate').setStyle(transformValue); + + } else if ( Modernizr.csstransforms ) { + transformValue[transformPref] = 'translate(0,' + this.startMax + 'px)'; + this.cartHolder.removeClassName('cart-short').setStyle(transformValue); + + transformValue[transformPref] = 'translate(0,' + this.headerHeight + 'px)'; + this.cartHolder.addClassName('animate').setStyle(transformValue); + } }, transitionEnd : function (e) { + var transformValue = {}; if ( this.visible ) { - this.cartHolder.removeClassName('animate').setStyle({'webkitTransform': 'translate3d(0, ' + (this.headerHeight-1) + 'px, 0)', 'top': '1px'}); + if ( Modernizr.csstransforms3d ) { + transformValue[transformPref] = 'translate3d(0, ' + (this.headerHeight-1) + 'px, 0)'; + transformValue['top'] = '1px'; + this.cartHolder.removeClassName('animate').setStyle(transformValue); + } else if ( Modernizr.csstransforms ) { + transformValue[transformPref] = 'translate(0, ' + (this.headerHeight-1) + 'px)'; + transformValue['top'] = '1px'; + this.cartHolder.removeClassName('animate').setStyle(transformValue); + } setTimeout(function () { this.cartHolder.addClassName('animate') }.bind(this), 100); } + }, + toggleView : function (e) { + if ( this.visible ) { + this.cartHide(); + } else { + this.cartShow(); + } } }); @@ -806,7 +1075,7 @@ document.observe("dom:loaded", function() { this.items = gallery.select('img'); this.itemsLength = this.items.size(); this.pos = 0; - this.step = 100/this.itemsLength; + this.step = (100/this.itemsLength).toFixed(2) * 1; this.lastPos = this.step * this.itemsLength; this.originalCoord = { x: 0, y: 0 }; this.finalCoord = { x: 0, y: 0 }; @@ -840,7 +1109,6 @@ document.observe("dom:loaded", function() { } }, moveRight: function (elem) { - //alert('move right'); if (this.pos !== this.lastPos - this.step) { @@ -852,10 +1120,17 @@ document.observe("dom:loaded", function() { this.scale = 1.0; this.pos += this.step; - this.wrap.setStyle({ - 'webkitTransition' : '300ms linear', - 'webkitTransform' : 'translate3d(' + this.pos*-1 + '%, 0, 0)' - }); + + var transformValue = {}; + if ( Modernizr.csstransforms3d ) { + this.wrap.setStyle({ + 'webkitTransition' : '300ms linear', + 'webkitTransform' : 'translate3d(' + this.pos*-1 + '%, 0, 0)' + }); + } else if ( Modernizr.csstransforms ) { + transformValue[transformPref] = 'translate(' + this.pos*-1 + '%, 0)'; + this.wrap.setStyle(transformValue); + } this.counter.select('.active')[0].removeClassName('active').next().addClassName('active'); @@ -873,10 +1148,18 @@ document.observe("dom:loaded", function() { this.scale = 1.0; this.pos -= this.step; - this.wrap.setStyle({ - 'webkitTransition' : '300ms linear', - 'webkitTransform' : 'translate3d(' + this.pos*-1 + '%, 0, 0)' - }); + + var transformValue = {}; + if ( Modernizr.csstransforms3d ) { + this.wrap.setStyle({ + 'webkitTransition' : '300ms linear', + 'webkitTransform' : 'translate3d(' + this.pos*-1 + '%, 0, 0)' + }); + } else if ( Modernizr.csstransforms ) { + transformValue[transformPref] = 'translate(' + this.pos*-1 + '%, 0)'; + this.wrap.setStyle(transformValue); + } + this.counter.select('.active')[0].removeClassName('active').previous().addClassName('active'); } @@ -985,10 +1268,10 @@ document.observe("dom:loaded", function() { changeX = this.originalCoord.x - this.finalCoord.x, changeY = this.originalCoord.y - this.finalCoord.y; - if(changeX > this.options.threshold.x && Math.abs(changeY) < 30 && timeDelta < 200) { + if(changeX > this.options.threshold.x && Math.abs(changeY) < 40 && timeDelta < 300) { this.moveRight($this); } - if(changeX < this.options.threshold.x * -1 && Math.abs(changeY) < 30 && timeDelta < 200) { + if(changeX < this.options.threshold.x * -1 && Math.abs(changeY) < 40 && timeDelta < 300) { this.moveLeft($this); } @@ -1041,4 +1324,54 @@ document.observe("dom:loaded", function() { }, }); + if ( $$('.c-list') && supportsTouchCallout() ) { + + $$('.c-list .product-image').each(function(n) { + var parent = n.up('a'), + clone = n.up().clone(true).addClassName('cloned'); + parent.insert(clone.wrap('div', {'class' : 'cloned-wrap'})); + + new webkit_draggable(clone.up(), { handle : clone.select('.product-image')[0], revert : true, scroll : true, onStart : function(r, e) { + r.setStyle({'opacity':'100'}).down('.wrap').addClassName('drop-start'); + }, + onEnd : function(r, e) { + r.setStyle({'opacity':'0'}).down('.wrap').removeClassName('drop-start'); + } + }); + }); + webkit_drop.add($('menu'), + { + onDrop : function(elem, e) { e.preventDefault(); setLocation(elem.up('li').down('.actions li:last-child a').readAttribute('href')); elem.remove(); }, + onOver : function(elem, e) { e.preventDefault(); elem.down().addClassName('to-cart-animate'); }, + onOut : function(elem) { elem.down().removeClassName('to-cart-animate'); } + }); + + } + + if ( $('c-grid') && supportsTouchCallout() ) { + + $$('.c-grid .cloned-wrap').each(function(n) { + new webkit_draggable(n, { handle : n.up('.cell').select('.product-image')[1], revert : true, scroll : true, onStart : function(r, e) { + r.setStyle({'opacity':'100', 'visibility':'visible'}).down('.wrap').addClassName('drop-start'); + }, + onEnd : function(r, e) { + r.setStyle({'opacity':'0', 'visibility':'hidden'}).down('.wrap').removeClassName('drop-start'); + } + }); + }); + webkit_drop.add($('menu'), + { + onDrop : function(elem, e) { e.preventDefault(); setLocation(elem.up('.cell').down('.add-to-cart').readAttribute('href')); elem.remove(); }, + onOver : function(elem, e) { e.preventDefault(); elem.down('.wrap').addClassName('to-cart-animate'); }, + onOut : function(elem) { elem.down('.wrap').removeClassName('to-cart-animate'); } + }); + + } + + if ( $('customer-reviews') ) { + $('customer-reviews').select('dt > a').each(function (a) { + a.replace('

    ' + a.innerHTML + '

    '); + }); + } + }); diff --git a/skin/frontend/default/iphone/js/modernizr.js b/skin/frontend/default/iphone/js/modernizr.js new file mode 100644 index 0000000000..3d88b168bd --- /dev/null +++ b/skin/frontend/default/iphone/js/modernizr.js @@ -0,0 +1,28 @@ +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category design + * @package default_iphone + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +/* Modernizr 2.0.6 (Custom Build) | MIT & BSD + * Build: http://www.modernizr.com/download/#-csstransforms-csstransforms3d-cssclasses-prefixed-teststyles-testprop-testallprops-prefixes-domprefixes + */ +;window.Modernizr=function(a,b,c){function C(a,b){var c=a.charAt(0).toUpperCase()+a.substr(1),d=(a+" "+o.join(c+" ")+c).split(" ");return B(d,b)}function B(a,b){for(var d in a)if(k[a[d]]!==c)return b=="pfx"?a[d]:!0;return!1}function A(a,b){return!!~(""+a).indexOf(b)}function z(a,b){return typeof a===b}function y(a,b){return x(n.join(a+";")+(b||""))}function x(a){k.cssText=a}var d="2.0.6",e={},f=!0,g=b.documentElement,h=b.head||b.getElementsByTagName("head")[0],i="modernizr",j=b.createElement(i),k=j.style,l,m=Object.prototype.toString,n=" -webkit- -moz- -o- -ms- -khtml- ".split(" "),o="Webkit Moz O ms Khtml".split(" "),p={},q={},r={},s=[],t=function(a,c,d,e){var f,h,j,k=b.createElement("div");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:i+(d+1),k.appendChild(j);f=["­",""].join(""),k.id=i,k.innerHTML+=f,g.appendChild(k),h=c(k,a),k.parentNode.removeChild(k);return!!h},u,v={}.hasOwnProperty,w;!z(v,c)&&!z(v.call,c)?w=function(a,b){return v.call(a,b)}:w=function(a,b){return b in a&&z(a.constructor.prototype[b],c)};var D=function(a,c){var d=a.join(""),f=c.length;t(d,function(a,c){var d=b.styleSheets[b.styleSheets.length-1],g=d.cssRules&&d.cssRules[0]?d.cssRules[0].cssText:d.cssText||"",h=a.childNodes,i={};while(f--)i[h[f].id]=h[f];e.csstransforms3d=i.csstransforms3d.offsetLeft===9},f,c)}([,["@media (",n.join("transform-3d),("),i,")","{#csstransforms3d{left:9px;position:absolute}}"].join("")],[,"csstransforms3d"]);p.csstransforms=function(){return!!B(["transformProperty","WebkitTransform","MozTransform","OTransform","msTransform"])},p.csstransforms3d=function(){var a=!!B(["perspectiveProperty","WebkitPerspective","MozPerspective","OPerspective","msPerspective"]);a&&"webkitPerspective"in g.style&&(a=e.csstransforms3d);return a};for(var E in p)w(p,E)&&(u=E.toLowerCase(),e[u]=p[E](),s.push((e[u]?"":"no-")+u));x(""),j=l=null,e._version=d,e._prefixes=n,e._domPrefixes=o,e.testProp=function(a){return B([a])},e.testAllProps=C,e.testStyles=t,e.prefixed=function(a){return C(a,"pfx")},g.className=g.className.replace(/\bno-js\b/,"")+(f?" js "+s.join(" "):"");return e}(this,this.document); diff --git a/skin/frontend/default/modern/css/styles.css b/skin/frontend/default/modern/css/styles.css index 327bc4a8a8..e36cb288a8 100644 --- a/skin/frontend/default/modern/css/styles.css +++ b/skin/frontend/default/modern/css/styles.css @@ -885,9 +885,10 @@ tr.summary-details-excluded { font-style:italic; } .price-box-bundle { padding:0 0 10px 0; } .price-box-bundle .price-box { margin:0 !important; padding:0 !important; } .price-box-bundle .price { color:#222; } -f/********** Product Prices > */ +/********** Product Prices > */ /* Tier Prices */ +.product-pricing, .tier-prices { margin:10px 0; padding:10px; background:#f4f9ea; border:1px solid #ddd; } .tier-prices .benefit { font-style:italic; font-weight:bold; } .tier-prices .price { font-weight:bold;; } @@ -990,6 +991,7 @@ f/********** Product Prices > */ .product-options p.required { position:absolute; right:15px; top:10px; } .product-options-bottom { background-color:#f6f6f6; padding:15px 20px; border:1px solid #e4e4e4; border-top:0; } +.product-options-bottom .product-pricing, .product-options-bottom .tier-prices { margin:0; padding:0 0 10px; border:0; background:0; } .product-options-bottom .price-box { float:left; margin:0; } .product-options-bottom .add-to-links { clear:both; padding:5px 0 0; text-align:right; } diff --git a/var/package/Interface_Adminhtml_Default-1.7.0.0-beta1.xml b/var/package/Interface_Adminhtml_Default-1.7.0.0-beta1.xml deleted file mode 100644 index b426f77266..0000000000 --- a/var/package/Interface_Adminhtml_Default-1.7.0.0-beta1.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - Interface_Adminhtml_Default - 1.7.0.0-beta1 - beta - AFL v3.0 - community - - Default interface for Adminhtml - Default interface for Adminhtml - 1.7.0.0-beta1 - Magento Core Teamcorecore@magentocommerce.com - 2012-03-02 - - - - 5.2.06.0.0Mage_Core_Adminhtmlcommunity1.7.0.0-beta11.8.0.0Lib_Js_Extcommunity1.7.0.0-beta11.8.0.0 - diff --git a/var/package/Interface_Adminhtml_Default-1.7.0.0-rc1.xml b/var/package/Interface_Adminhtml_Default-1.7.0.0-rc1.xml new file mode 100644 index 0000000000..9c7b14d7c0 --- /dev/null +++ b/var/package/Interface_Adminhtml_Default-1.7.0.0-rc1.xml @@ -0,0 +1,18 @@ + + + Interface_Adminhtml_Default + 1.7.0.0-rc1 + beta + AFL v3.0 + community + + Default interface for Adminhtml + Default interface for Adminhtml + 1.7.0.0-rc1 + Magento Core Teamcorecore@magentocommerce.com + 2012-03-28 + + + + 5.2.06.0.0Mage_Core_Adminhtmlcommunity1.7.0.0-rc11.8.0.0Lib_Js_Extcommunity1.7.0.0-rc11.8.0.0 + diff --git a/var/package/Interface_Frontend_Base_Default-1.7.0.0-beta1.xml b/var/package/Interface_Frontend_Base_Default-1.7.0.0-beta1.xml deleted file mode 100644 index 41970bc47a..0000000000 --- a/var/package/Interface_Frontend_Base_Default-1.7.0.0-beta1.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - Interface_Frontend_Base_Default - 1.7.0.0-beta1 - beta - AFL v3.0 - community - - This is a Magento themes base - This is a Magento themes base - 1.7.0.0-beta1 - Magento Core Teamcorecore@magentocommerce.com - 2012-03-02 - - - - 5.2.06.0.0Mage_Core_Modulescommunity1.7.0.0-beta11.8.0.0 - diff --git a/var/package/Interface_Frontend_Base_Default-1.7.0.0-rc1.xml b/var/package/Interface_Frontend_Base_Default-1.7.0.0-rc1.xml new file mode 100644 index 0000000000..45514c63cd --- /dev/null +++ b/var/package/Interface_Frontend_Base_Default-1.7.0.0-rc1.xml @@ -0,0 +1,18 @@ + + + Interface_Frontend_Base_Default + 1.7.0.0-rc1 + beta + AFL v3.0 + community + + This is a Magento themes base + This is a Magento themes base + 1.7.0.0-rc1 + Magento Core Teamcorecore@magentocommerce.com + 2012-03-28 + + + + 5.2.06.0.0Mage_Core_Modulescommunity1.7.0.0-rc11.8.0.0 + diff --git a/var/package/Interface_Frontend_Default-1.7.0.0-beta1.xml b/var/package/Interface_Frontend_Default-1.7.0.0-rc1.xml similarity index 97% rename from var/package/Interface_Frontend_Default-1.7.0.0-beta1.xml rename to var/package/Interface_Frontend_Default-1.7.0.0-rc1.xml index 3b3074543a..5a25fdb015 100644 --- a/var/package/Interface_Frontend_Default-1.7.0.0-beta1.xml +++ b/var/package/Interface_Frontend_Default-1.7.0.0-rc1.xml @@ -1,18 +1,18 @@ Interface_Frontend_Default - 1.7.0.0-beta1 + 1.7.0.0-rc1 beta AFL v3.0 community Default interface for Frontend Default interface for Frontend - 1.7.0.0-beta1 + 1.7.0.0-rc1 Magento Core Teamcorecore@magentocommerce.com - 2012-03-02 - - + 2012-03-28 + + - 5.2.06.0.0Mage_Core_Modulescommunity1.7.0.0-beta11.8.0.0 + 5.2.06.0.0Mage_Core_Modulescommunity1.7.0.0-rc11.8.0.0 diff --git a/var/package/Interface_Install_Default-1.7.0.0-beta1.xml b/var/package/Interface_Install_Default-1.7.0.0-rc1.xml similarity index 94% rename from var/package/Interface_Install_Default-1.7.0.0-beta1.xml rename to var/package/Interface_Install_Default-1.7.0.0-rc1.xml index 1bc7104f52..341fc09c92 100644 --- a/var/package/Interface_Install_Default-1.7.0.0-beta1.xml +++ b/var/package/Interface_Install_Default-1.7.0.0-rc1.xml @@ -1,18 +1,18 @@ Interface_Install_Default - 1.7.0.0-beta1 + 1.7.0.0-rc1 beta AFL v3.0 community Default interface for Install Default interface for Install - 1.7.0.0-beta1 + 1.7.0.0-rc1 Magento Core Teamcorecore@magentocommerce.com - 2012-03-02 - + 2012-03-28 + - 5.2.06.0.0Mage_Core_Modulescommunity1.7.0.0-beta11.8.0.0 + 5.2.06.0.0Mage_Core_Modulescommunity1.7.0.0-rc11.8.0.0 diff --git a/var/package/Lib_Js_Calendar-1.51.1.1-beta1.xml b/var/package/Lib_Js_Calendar-1.51.1.1-rc1.xml similarity index 95% rename from var/package/Lib_Js_Calendar-1.51.1.1-beta1.xml rename to var/package/Lib_Js_Calendar-1.51.1.1-rc1.xml index 651b520a09..645fe7780e 100644 --- a/var/package/Lib_Js_Calendar-1.51.1.1-beta1.xml +++ b/var/package/Lib_Js_Calendar-1.51.1.1-rc1.xml @@ -1,17 +1,17 @@ Lib_Js_Calendar - 1.51.1.1-beta1 + 1.51.1.1-rc1 beta Mixed community Javascript Calendar for Magento Javascript Calendar for Magento - 1.51.1.1-beta1 + 1.51.1.1-rc1 Magento Core Teamcorecore@magentocommerce.com - 2012-03-02 - + 2012-03-28 + 5.2.06.0.0 diff --git a/var/package/Lib_Js_Ext-1.7.0.0-beta1.xml b/var/package/Lib_Js_Ext-1.7.0.0-rc1.xml similarity index 99% rename from var/package/Lib_Js_Ext-1.7.0.0-beta1.xml rename to var/package/Lib_Js_Ext-1.7.0.0-rc1.xml index 161101c963..5816e2628f 100644 --- a/var/package/Lib_Js_Ext-1.7.0.0-beta1.xml +++ b/var/package/Lib_Js_Ext-1.7.0.0-rc1.xml @@ -1,17 +1,17 @@ Lib_Js_Ext - 1.7.0.0-beta1 + 1.7.0.0-rc1 beta Mixed community Extjs Javascript Libraries for Magento Extjs Javascript Libraries for Magento - 1.7.0.0-beta1 + 1.7.0.0-rc1 Magento Core Teamcorecore@magentocommerce.com - 2012-03-02 - + 2012-03-28 + 5.2.06.0.0 diff --git a/var/package/Lib_Js_Mage-1.7.0.0-beta1.xml b/var/package/Lib_Js_Mage-1.7.0.0-rc1.xml similarity index 90% rename from var/package/Lib_Js_Mage-1.7.0.0-beta1.xml rename to var/package/Lib_Js_Mage-1.7.0.0-rc1.xml index 36ee3f595f..241af8f9e6 100644 --- a/var/package/Lib_Js_Mage-1.7.0.0-beta1.xml +++ b/var/package/Lib_Js_Mage-1.7.0.0-rc1.xml @@ -1,18 +1,18 @@ Lib_Js_Mage - 1.7.0.0-beta1 + 1.7.0.0-rc1 beta Mixed community Javascript Libraries for Magento Javascript Libraries for Magento - 1.7.0.0-beta1 + 1.7.0.0-rc1 Magento Core Teamcorecore@magentocommerce.com - 2012-03-02 - - + 2012-03-28 + + - 5.2.06.0.0Lib_Js_Prototypecommunity1.7.0.0-beta11.7.1.0 + 5.2.06.0.0Lib_Js_Prototypecommunity1.7.0.0-rc11.7.1.0 diff --git a/var/package/Lib_Js_Prototype-1.7.0.0.3-beta1.xml b/var/package/Lib_Js_Prototype-1.7.0.0.3-rc1.xml similarity index 98% rename from var/package/Lib_Js_Prototype-1.7.0.0.3-beta1.xml rename to var/package/Lib_Js_Prototype-1.7.0.0.3-rc1.xml index 22d5e57d17..19558cbaf3 100644 --- a/var/package/Lib_Js_Prototype-1.7.0.0.3-beta1.xml +++ b/var/package/Lib_Js_Prototype-1.7.0.0.3-rc1.xml @@ -1,18 +1,18 @@ Lib_Js_Prototype - 1.7.0.0.3-beta1 + 1.7.0.0.3-rc1 beta Mixed community Prototype and Scriptaculous Javascript Libraries for Magento Prototype and Scriptaculous Javascript Libraries for Magento - 1.7.0.0.3-beta1 + 1.7.0.0.3-rc1 Magento Core Teamcorecore@magentocommerce.com - 2012-03-02 - - + 2012-03-28 + + 5.2.06.0.0 diff --git a/var/package/Lib_Js_TinyMCE-3.4.7.0-beta1.xml b/var/package/Lib_Js_TinyMCE-3.4.7.0-rc1.xml similarity index 99% rename from var/package/Lib_Js_TinyMCE-3.4.7.0-beta1.xml rename to var/package/Lib_Js_TinyMCE-3.4.7.0-rc1.xml index e09b7838fb..3a9e52920f 100644 --- a/var/package/Lib_Js_TinyMCE-3.4.7.0-beta1.xml +++ b/var/package/Lib_Js_TinyMCE-3.4.7.0-rc1.xml @@ -1,17 +1,17 @@ Lib_Js_TinyMCE - 3.4.7.0-beta1 + 3.4.7.0-rc1 beta Mixed community TinyMCE Javascript Libraries for Magento TinyMCE Javascript Libraries for Magento - 3.4.7.0-beta1 + 3.4.7.0-rc1 Magento Core Teamcorecore@magentocommerce.com - 2012-03-02 - + 2012-03-28 + 5.2.06.0.0 diff --git a/var/package/Lib_LinLibertineFont-2.8.14.1-beta1.xml b/var/package/Lib_LinLibertineFont-2.8.14.1-rc1.xml similarity index 92% rename from var/package/Lib_LinLibertineFont-2.8.14.1-beta1.xml rename to var/package/Lib_LinLibertineFont-2.8.14.1-rc1.xml index a2e3421cd9..36fa661b1c 100644 --- a/var/package/Lib_LinLibertineFont-2.8.14.1-beta1.xml +++ b/var/package/Lib_LinLibertineFont-2.8.14.1-rc1.xml @@ -1,17 +1,17 @@ Lib_LinLibertineFont - 2.8.14.1-beta1 + 2.8.14.1-rc1 beta GPL community Libertine Open Fonts Project fonts for PDF print-outs Libertine Open Fonts Project fonts for PDF print-outs - 2.8.14.1-beta1 + 2.8.14.1-rc1 Magento Core Teamcorecore@magentocommerce.com - 2012-03-02 - + 2012-03-28 + 5.2.06.0.0 diff --git a/var/package/Lib_Mage-1.7.0.0-beta1.xml b/var/package/Lib_Mage-1.7.0.0-beta1.xml deleted file mode 100644 index 94cab07c6f..0000000000 --- a/var/package/Lib_Mage-1.7.0.0-beta1.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - Lib_Mage - 1.7.0.0-beta1 - beta - OSL v3.0 - community - - Mage Library - Mage Library - 1.7.0.0-beta1 - Magento Core Teamcorecore@magentocommerce.com - 2012-03-02 - - - - 5.2.06.0.0 - diff --git a/var/package/Lib_Mage-1.7.0.0-rc1.xml b/var/package/Lib_Mage-1.7.0.0-rc1.xml new file mode 100644 index 0000000000..4623bc80de --- /dev/null +++ b/var/package/Lib_Mage-1.7.0.0-rc1.xml @@ -0,0 +1,18 @@ + + + Lib_Mage + 1.7.0.0-rc1 + beta + OSL v3.0 + community + + Mage Library + Mage Library + 1.7.0.0-rc1 + Magento Core Teamcorecore@magentocommerce.com + 2012-03-28 + + + + 5.2.06.0.0 + diff --git a/var/package/Lib_Varien-1.7.0.0-beta1.xml b/var/package/Lib_Varien-1.7.0.0-rc1.xml similarity index 98% rename from var/package/Lib_Varien-1.7.0.0-beta1.xml rename to var/package/Lib_Varien-1.7.0.0-rc1.xml index 83808f43e5..d606856351 100644 --- a/var/package/Lib_Varien-1.7.0.0-beta1.xml +++ b/var/package/Lib_Varien-1.7.0.0-rc1.xml @@ -1,18 +1,18 @@ Lib_Varien - 1.7.0.0-beta1 + 1.7.0.0-rc1 beta OSL v3.0 community Varien Library Varien Library - 1.7.0.0-beta1 + 1.7.0.0-rc1 Magento Core Teamcorecore@magentocommerce.com - 2012-03-02 - - + 2012-03-28 + + 5.2.06.0.0Lib_ZFcommunity1.11.1.01.12.0.0PDOSPLcurlSimpleXMLdomgdiconvpdo_mysqlmcryptpcreReflectionsession diff --git a/var/package/Mage_All_Latest-1.7.0.0-beta1.xml b/var/package/Mage_All_Latest-1.7.0.0-beta1.xml deleted file mode 100644 index f79ddc2e01..0000000000 --- a/var/package/Mage_All_Latest-1.7.0.0-beta1.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - Mage_All_Latest - 1.7.0.0-beta1 - beta - OSL v3.0 - community - - Metapackage for latest Magento 1.7.0.0-beta1 release - Metapackage for latest Magento 1.7.0.0-beta1 release - 1.7.0.0-beta1 - Magento Core Teamcorecore@magentocommerce.com - 2012-03-02 - - - - 5.2.06.0.0Mage_Core_Modulescommunity1.7.0.0-beta11.7.0.0-beta1Mage_Core_Adminhtmlcommunity1.7.0.0-beta11.7.0.0-beta1Interface_Adminhtml_Defaultcommunity1.7.0.0-beta11.7.0.0-beta1Interface_Frontend_Defaultcommunity1.7.0.0-beta11.7.0.0-beta1Interface_Install_Defaultcommunity1.7.0.0-beta11.7.0.0-beta1Mage_Downloadercommunity1.7.0.0-beta11.7.0.0-beta1Mage_Centinelcommunity1.7.0.0-beta11.7.0.0-beta1Interface_Frontend_Base_Defaultcommunity1.7.0.0-beta11.7.0.0-beta1Phoenix_Moneybookerscommunity1.3.1-beta11.3.1-beta1Mage_Compilercommunity1.7.0.0-beta11.7.0.0-beta1Magento_Mobilecommunity1.6.0.0.22.11.7.0.0 - diff --git a/var/package/Mage_All_Latest-1.7.0.0-rc1.xml b/var/package/Mage_All_Latest-1.7.0.0-rc1.xml new file mode 100644 index 0000000000..ad8c5fd7a9 --- /dev/null +++ b/var/package/Mage_All_Latest-1.7.0.0-rc1.xml @@ -0,0 +1,18 @@ + + + Mage_All_Latest + 1.7.0.0-rc1 + beta + OSL v3.0 + community + + Metapackage for latest Magento 1.7.0.0-rc1 release + Metapackage for latest Magento 1.7.0.0-rc1 release + 1.7.0.0-rc1 + Magento Core Teamcorecore@magentocommerce.com + 2012-03-28 + + + + 5.2.06.0.0Mage_Core_Modulescommunity1.7.0.0-rc11.7.0.0-rc1Mage_Core_Adminhtmlcommunity1.7.0.0-rc11.7.0.0-rc1Interface_Adminhtml_Defaultcommunity1.7.0.0-rc11.7.0.0-rc1Interface_Frontend_Defaultcommunity1.7.0.0-rc11.7.0.0-rc1Interface_Install_Defaultcommunity1.7.0.0-rc11.7.0.0-rc1Mage_Downloadercommunity1.7.0.0-rc11.7.0.0-rc1Mage_Centinelcommunity1.7.0.0-rc11.7.0.0-rc1Interface_Frontend_Base_Defaultcommunity1.7.0.0-rc11.7.0.0-rc1Phoenix_Moneybookerscommunity1.3.1-rc11.3.1-rc1Mage_Compilercommunity1.7.0.0-rc11.7.0.0-rc1Magento_Mobilecommunity1.6.0.0.22.11.7.0.0 + diff --git a/var/package/Mage_Centinel-1.7.0.0-beta1.xml b/var/package/Mage_Centinel-1.7.0.0-rc1.xml similarity index 95% rename from var/package/Mage_Centinel-1.7.0.0-beta1.xml rename to var/package/Mage_Centinel-1.7.0.0-rc1.xml index b663321573..3c17b357ca 100644 --- a/var/package/Mage_Centinel-1.7.0.0-beta1.xml +++ b/var/package/Mage_Centinel-1.7.0.0-rc1.xml @@ -1,18 +1,18 @@ Mage_Centinel - 1.7.0.0-beta1 + 1.7.0.0-rc1 beta mixed community 3D Secure Card Validation An integration with Cardinalcommerce Centinel service. Provides option to validate Visa and Mastercard cards for eliminating possible fraudlent order placement attempts. Adds information about Electronic Commerce Identifier, that designates liability for chargeback. - 1.7.0.0-beta1 + 1.7.0.0-rc1 Magento Core Teamcorecore@magentocommerce.com - 2012-03-02 - + 2012-03-28 + - 5.2.06.0.0Mage_Core_Modulescommunity1.7.0.0-beta11.8.0.0 + 5.2.06.0.0Mage_Core_Modulescommunity1.7.0.0-rc11.8.0.0 diff --git a/var/package/Mage_Compiler-1.7.0.0-beta1.xml b/var/package/Mage_Compiler-1.7.0.0-rc1.xml similarity index 83% rename from var/package/Mage_Compiler-1.7.0.0-beta1.xml rename to var/package/Mage_Compiler-1.7.0.0-rc1.xml index 033f43fb2a..9f93794203 100644 --- a/var/package/Mage_Compiler-1.7.0.0-beta1.xml +++ b/var/package/Mage_Compiler-1.7.0.0-rc1.xml @@ -1,18 +1,18 @@ Mage_Compiler - 1.7.0.0-beta1 + 1.7.0.0-rc1 beta OSL v3.0 community This module compiles all files of a Magento installation and creates a single include path to increase performance This module compiles all files of a Magento installation and creates a single include path to increase performance - 1.7.0.0-beta1 + 1.7.0.0-rc1 Magento Core Teamcorecore@magentocommerce.com - 2012-03-02 - - + 2012-03-28 + + - 5.2.06.0.0Mage_Core_Modulescommunity1.7.0.0-beta11.8.0.0Mage_Core_Adminhtmlcommunity1.7.0.0-beta11.8.0.0 + 5.2.06.0.0Mage_Core_Modulescommunity1.7.0.0-rc11.8.0.0Mage_Core_Adminhtmlcommunity1.7.0.0-rc11.8.0.0 diff --git a/var/package/Mage_Core_Adminhtml-1.7.0.0-beta1.xml b/var/package/Mage_Core_Adminhtml-1.7.0.0-rc1.xml similarity index 53% rename from var/package/Mage_Core_Adminhtml-1.7.0.0-beta1.xml rename to var/package/Mage_Core_Adminhtml-1.7.0.0-rc1.xml index 8a9e60e3aa..b056dc39eb 100644 --- a/var/package/Mage_Core_Adminhtml-1.7.0.0-beta1.xml +++ b/var/package/Mage_Core_Adminhtml-1.7.0.0-rc1.xml @@ -1,18 +1,18 @@ Mage_Core_Adminhtml - 1.7.0.0-beta1 + 1.7.0.0-rc1 beta OSL v3.0 community Magento Administration Panel Magento Administration Panel - 1.7.0.0-beta1 + 1.7.0.0-rc1 Magento Core Teamcorecore@magentocommerce.com - 2012-03-02 - - + 2012-03-28 + + - 5.2.06.0.0Mage_Core_Modulescommunity1.7.0.0-beta11.8.0.0Lib_Js_Calendarcommunity1.51.1.1-beta11.52Lib_Js_Extcommunity1.7.0.0-beta11.8.0.0Lib_LinLibertineFontcommunity2.8.14.1-beta12.9.0.0Lib_Js_TinyMCEcommunity3.4.7.0-beta13.5.0.0 + 5.2.06.0.0Mage_Core_Modulescommunity1.7.0.0-rc11.8.0.0Lib_Js_Calendarcommunity1.51.1.1-rc11.52Lib_Js_Extcommunity1.7.0.0-rc11.8.0.0Lib_LinLibertineFontcommunity2.8.14.1-rc12.9.0.0Lib_Js_TinyMCEcommunity3.4.7.0-rc13.5.0.0 diff --git a/var/package/Mage_Core_Modules-1.7.0.0-beta1.xml b/var/package/Mage_Core_Modules-1.7.0.0-beta1.xml deleted file mode 100644 index 2a111fa123..0000000000 --- a/var/package/Mage_Core_Modules-1.7.0.0-beta1.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - Mage_Core_Modules - 1.7.0.0-beta1 - beta - OSL v3.0 - community - - Collection of Magento Core Modules - Collection of Magento Core Modules - 1.7.0.0-beta1 - Magento Core Teamcorecore@magentocommerce.com - 2012-03-02 - - - - 5.2.06.0.0Lib_Variencommunity1.7.0.0-beta11.8.0.0Lib_Google_Checkoutcommunity1.5.0.01.5.1.0Lib_Js_Calendarcommunity1.51.1.1-beta11.52Lib_Js_Magecommunity1.7.0.0-beta11.8.0.0Lib_Js_Prototypecommunity1.7.0.0.3-beta11.7.1.0Lib_Phpseclibcommunity1.5.0.01.5.1.0Mage_Locale_en_UScommunity1.7.0.0-beta11.8.0.0Lib_Magecommunity1.7.0.0-beta11.8.0.0 - diff --git a/var/package/Mage_Core_Modules-1.7.0.0-rc1.xml b/var/package/Mage_Core_Modules-1.7.0.0-rc1.xml new file mode 100644 index 0000000000..a83b8ed36e --- /dev/null +++ b/var/package/Mage_Core_Modules-1.7.0.0-rc1.xml @@ -0,0 +1,18 @@ + + + Mage_Core_Modules + 1.7.0.0-rc1 + beta + OSL v3.0 + community + + Collection of Magento Core Modules + Collection of Magento Core Modules + 1.7.0.0-rc1 + Magento Core Teamcorecore@magentocommerce.com + 2012-03-28 + + + + 5.2.06.0.0Lib_Variencommunity1.7.0.0-rc11.8.0.0Lib_Google_Checkoutcommunity1.5.0.01.5.1.0Lib_Js_Calendarcommunity1.51.1.1-rc11.52Lib_Js_Magecommunity1.7.0.0-rc11.8.0.0Lib_Js_Prototypecommunity1.7.0.0.3-rc11.7.1.0Lib_Phpseclibcommunity1.5.0.01.5.1.0Mage_Locale_en_UScommunity1.7.0.0-rc11.8.0.0Lib_Magecommunity1.7.0.0-rc11.8.0.0 + diff --git a/var/package/Mage_Downloader-1.7.0.0-beta1.xml b/var/package/Mage_Downloader-1.7.0.0-rc1.xml similarity index 52% rename from var/package/Mage_Downloader-1.7.0.0-beta1.xml rename to var/package/Mage_Downloader-1.7.0.0-rc1.xml index f959f5c8fd..1f745139c2 100644 --- a/var/package/Mage_Downloader-1.7.0.0-beta1.xml +++ b/var/package/Mage_Downloader-1.7.0.0-rc1.xml @@ -1,18 +1,18 @@ Mage_Downloader - 1.7.0.0-beta1 + 1.7.0.0-rc1 beta OSL v3.0 community Magento Downloader Magento Downloader - 1.7.0.0-beta1 + 1.7.0.0-rc1 Magento Core Teamcorecore@magentocommerce.com - 2012-03-02 - - + 2012-03-28 + + 5.2.06.0.0 diff --git a/var/package/Mage_Locale_en_US-1.7.0.0-beta1.xml b/var/package/Mage_Locale_en_US-1.7.0.0-beta1.xml deleted file mode 100644 index 7f9adf0b85..0000000000 --- a/var/package/Mage_Locale_en_US-1.7.0.0-beta1.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - Mage_Locale_en_US - 1.7.0.0-beta1 - beta - OSL v3.0 - community - - en_US locale - en_US locale - 1.7.0.0-beta1 - Magento Core Teamcorecore@magentocommerce.com - 2012-03-02 - - - - 5.2.06.0.0 - diff --git a/var/package/Mage_Locale_en_US-1.7.0.0-rc1.xml b/var/package/Mage_Locale_en_US-1.7.0.0-rc1.xml new file mode 100644 index 0000000000..dda5a10b1d --- /dev/null +++ b/var/package/Mage_Locale_en_US-1.7.0.0-rc1.xml @@ -0,0 +1,18 @@ + + + Mage_Locale_en_US + 1.7.0.0-rc1 + beta + OSL v3.0 + community + + en_US locale + en_US locale + 1.7.0.0-rc1 + Magento Core Teamcorecore@magentocommerce.com + 2012-03-28 + + + + 5.2.06.0.0 + diff --git a/var/package/Phoenix_Moneybookers-1.3.1-beta1.xml b/var/package/Phoenix_Moneybookers-1.3.1-rc1.xml similarity index 97% rename from var/package/Phoenix_Moneybookers-1.3.1-beta1.xml rename to var/package/Phoenix_Moneybookers-1.3.1-rc1.xml index ec593113b6..cb258741a5 100644 --- a/var/package/Phoenix_Moneybookers-1.3.1-beta1.xml +++ b/var/package/Phoenix_Moneybookers-1.3.1-rc1.xml @@ -1,7 +1,7 @@ Phoenix_Moneybookers - 1.3.1-beta1 + 1.3.1-rc1 beta mixed community @@ -25,11 +25,11 @@ Przelewy24 - Poland Sofortüberweisung - Germany Nordea Solo - Finland Moneybookers eWallet - 1.3.1-beta1 + 1.3.1-rc1 Magento Core Teamcorecore@magentocommerce.com - 2012-03-02 - + 2012-03-28 + - 5.2.06.0.0Mage_Core_Modulescommunity1.7.0.0-beta11.8.0.0 + 5.2.06.0.0Mage_Core_Modulescommunity1.7.0.0-rc11.8.0.0 From 3254aefbb8dcc94b54470e9836cf39959aae18e9 Mon Sep 17 00:00:00 2001 From: Lee Saferite Date: Tue, 24 Apr 2012 12:19:20 -0700 Subject: [PATCH 4/4] Import Magento Release 1.7.0.0 --- .htaccess | 7 + RELEASE_NOTES.txt | 588 +- app/Mage.php | 4 +- ....6.1.0.php => upgrade-1.6.0.0-1.6.1.0.php} | 0 .../Model/Resource/Inbox.php | 8 +- .../Form/Renderer/Fieldset/Element.php | 2 +- .../Sales/Order/Create/Totals/Shipping.php | 9 +- .../controllers/Customer/GroupController.php | 17 +- .../Permissions/UserController.php | 18 +- .../Mage/Api/Model/Server/Adapter/Soap.php | 45 +- app/code/core/Mage/Api/etc/config.xml | 1 + app/code/core/Mage/Api/etc/system.xml | 10 + .../Block/Adminhtml/Attribute/Edit/Form.php | 4 +- .../core/Mage/Api2/Block/Adminhtml/Roles.php | 4 +- .../Mage/Api2/Block/Adminhtml/Roles/Grid.php | 6 +- .../Mage/Api2/Model/Auth/Adapter/Oauth.php | 6 +- app/code/core/Mage/Api2/Model/Config.php | 8 +- .../Api2/Model/Resource/Validator/Eav.php | 95 +- .../core/Mage/Bundle/Model/Product/Type.php | 10 - .../core/Mage/Captcha/Block/Captcha/Zend.php | 5 +- .../Catalog/Model/Api2/Product/Image/Rest.php | 1 + .../Api2/Product/Image/Rest/Admin/V1.php | 3 +- .../Mage/Catalog/Model/Api2/Product/Rest.php | 14 +- .../Model/Api2/Product/Rest/Admin/V1.php | 16 +- .../Model/Api2/Product/Validator/Product.php | 40 +- app/code/core/Mage/Catalog/Model/Category.php | 2 +- .../core/Mage/Catalog/Model/Category/Api.php | 4 + app/code/core/Mage/Catalog/Model/Product.php | 2 +- .../core/Mage/Catalog/Model/Product/Api.php | 5 + .../Mage/Catalog/Model/Product/Api/V2.php | 5 + .../Mage/Catalog/Model/Product/Status.php | 2 +- .../Catalog/Model/Product/Type/Abstract.php | 10 - .../Model/Resource/Layer/Filter/Price.php | 3 +- .../controllers/Product/CompareController.php | 5 +- app/code/core/Mage/Catalog/etc/api2.xml | 16 +- .../CatalogInventory/Block/Qtyincrements.php | 3 - .../CatalogInventory/Model/Stock/Item.php | 41 +- .../Mage/Checkout/Block/Cart/Shipping.php | 2 +- .../Mage/Checkout/Block/Onepage/Abstract.php | 2 +- .../data-upgrade-1.6.0.0.0-1.6.0.0.1.php | 12 +- .../Mage/Core/Controller/Varien/Front.php | 8 +- .../Core/Controller/Varien/Router/Admin.php | 8 +- .../Controller/Varien/Router/Standard.php | 8 +- app/code/core/Mage/Core/Helper/Cookie.php | 15 + .../Mage/Core/Model/File/Storage/Database.php | 12 + .../Mage/Core/Model/Resource/Db/Abstract.php | 4 +- .../core/Mage/Core/Model/Translate/Inline.php | 16 +- app/code/core/Mage/Core/etc/system.xml | 3 +- .../Customer/Model/Api2/Customer/Address.php | 21 +- .../Model/Api2/Customer/Address/Rest.php | 12 +- .../Model/Api2/Customer/Address/Validator.php | 83 +- .../Customer/Model/Api2/Customer/Rest.php | 16 +- .../Sales/Order/Pdf/Items/Creditmemo.php | 87 +- .../Model/Sales/Order/Pdf/Items/Invoice.php | 28 +- .../core/Mage/OAuth/Block/Authorize/Style.php | 47 - .../Block/Adminhtml/Oauth}/Admin/Token.php | 8 +- .../Adminhtml/Oauth}/Admin/Token/Grid.php | 16 +- .../Block/Adminhtml/Oauth}/Authorize.php | 24 +- .../Adminhtml/Oauth}/Authorize/Button.php | 10 +- .../Adminhtml/Oauth}/AuthorizedTokens.php | 8 +- .../Oauth}/AuthorizedTokens/Grid.php | 24 +- .../Block/Adminhtml/Oauth}/Consumer.php | 8 +- .../Block/Adminhtml/Oauth}/Consumer/Edit.php | 12 +- .../Adminhtml/Oauth}/Consumer/Edit/Form.php | 12 +- .../Block/Adminhtml/Oauth}/Consumer/Grid.php | 12 +- .../Mage/{OAuth => Oauth}/Block/Authorize.php | 12 +- .../Block/Authorize/Abstract.php | 24 +- .../Block/Authorize/Button.php | 6 +- .../Block/Authorize/ButtonBaseAbstract.php | 6 +- .../Block/AuthorizeBaseAbstract.php | 6 +- .../Block/Customer/Token/List.php | 24 +- .../core/Mage/{OAuth => Oauth}/Exception.php | 6 +- .../Mage/{OAuth => Oauth}/Helper/Data.php | 85 +- .../Mage/{OAuth => Oauth}/Model/Consumer.php | 36 +- .../Model/Consumer/Validator/KeyLength.php | 12 +- .../Mage/{OAuth => Oauth}/Model/Nonce.php | 18 +- .../Mage/{OAuth => Oauth}/Model/Observer.php | 74 +- .../Model/Resource/Consumer.php | 6 +- .../Model/Resource/Consumer/Collection.php | 6 +- .../{OAuth => Oauth}/Model/Resource/Nonce.php | 6 +- .../Model/Resource/Nonce/Collection.php | 6 +- .../{OAuth => Oauth}/Model/Resource/Setup.php | 6 +- .../{OAuth => Oauth}/Model/Resource/Token.php | 12 +- .../Model/Resource/Token/Collection.php | 20 +- .../Mage/{OAuth => Oauth}/Model/Server.php | 52 +- .../Mage/{OAuth => Oauth}/Model/Token.php | 64 +- .../Oauth}/Admin/TokenController.php | 20 +- .../Adminhtml/Oauth}/AuthorizeController.php | 93 +- .../Oauth}/AuthorizedTokensController.php | 24 +- .../Adminhtml/Oauth}/ConsumerController.php | 22 +- .../controllers/AuthorizeController.php | 68 +- .../controllers/Customer/TokenController.php | 20 +- .../controllers/InitiateController.php | 8 +- .../controllers/TokenController.php | 8 +- .../Mage/{OAuth => Oauth}/etc/adminhtml.xml | 8 +- .../core/Mage/{OAuth => Oauth}/etc/config.xml | 38 +- .../core/Mage/{OAuth => Oauth}/etc/system.xml | 2 +- .../sql/oauth_setup/install-1.0.0.0.php | 14 +- .../core/Mage/Page/Block/Html/Notices.php | 29 - .../core/Mage/Page/Block/Template/Links.php | 4 +- app/code/core/Mage/Page/etc/config.xml | 2 +- .../Paygate/Block/Authorizenet/Form/Cc.php | 2 +- app/code/core/Mage/Paygate/etc/config.xml | 3 + .../Mage/Payment/Block/Form/Container.php | 2 +- app/code/core/Mage/Sales/Model/Api2/Order.php | 12 +- .../Api2/Order/{Comments.php => Comment.php} | 2 +- .../Api2/Order/{Comments => Comment}/Rest.php | 2 +- .../{Comments => Comment}/Rest/Admin/V1.php | 2 +- .../Rest/Customer/V1.php | 2 +- .../Model/Api2/Order/{Items.php => Item.php} | 2 +- .../Model/Api2/Order/{Items => Item}/Rest.php | 2 +- .../Order/{Items => Item}/Rest/Admin/V1.php | 2 +- .../{Items => Item}/Rest/Customer/V1.php | 2 +- .../Model/Order/Invoice/Total/Discount.php | 5 +- .../Order/Pdf/Items/Creditmemo/Default.php | 34 +- .../Model/Order/Pdf/Items/Invoice/Default.php | 10 +- app/code/core/Mage/Sales/Model/Quote.php | 2 +- .../Mage/Sales/Model/Quote/Item/Abstract.php | 16 - app/code/core/Mage/Sales/etc/api2.xml | 32 +- .../Mage/SalesRule/Model/Quote/Discount.php | 4 +- .../Mage/Shipping/Model/Carrier/Abstract.php | 4 +- .../core/Mage/Tax/Block/Checkout/Shipping.php | 6 +- .../Usa/Model/Shipping/Carrier/Abstract.php | 10 +- .../Shipping/Carrier/Dhl/International.php | 26 +- .../Model/Shipping/Carrier/Dhl/Label/Pdf.php | 18 +- .../Carrier/Dhl/Label/Pdf/PageBuilder.php | 47 +- .../Widget/Instance/Edit/Tab/Settings.php | 18 +- .../Wishlist/controllers/IndexController.php | 2 +- .../default/default/layout/oauth.xml | 133 +- .../sales/order/view/items/renderer.phtml | 4 +- .../catalog/product/tab/inventory.phtml | 81 +- .../template/currencysymbol/grid.phtml | 2 +- .../default/default/template/empty.phtml | 5 +- .../oauth/authorize/button-simple.phtml | 4 +- .../template/oauth/authorize/button.phtml | 6 +- .../oauth/authorize/confirm-simple.phtml | 2 +- .../template/oauth/authorize/confirm.phtml | 2 +- .../oauth/authorize/form/login-simple.phtml | 6 +- .../template/oauth/authorize/form/login.phtml | 6 +- .../oauth/authorize/head-simple.phtml | 6 +- .../oauth/authorize/reject-simple.phtml | 9 +- .../template/oauth/authorize/reject.phtml | 2 +- .../template/oauth/authorize/simple-css.phtml | 251 - .../sales/order/create/items/grid.phtml | 4 +- .../sales/order/creditmemo/create/form.phtml | 2 +- .../sales/order/creditmemo/view/form.phtml | 2 +- .../sales/order/invoice/create/form.phtml | 2 +- .../sales/order/invoice/view/form.phtml | 2 +- .../sales/order/shipment/create/form.phtml | 2 +- .../sales/order/shipment/tracking/info.phtml | 2 +- .../sales/order/shipment/view/form.phtml | 2 +- .../template/sales/order/view/info.phtml | 2 +- .../system/currency/rate/matrix.phtml | 2 +- .../default/template/widget/instance/js.phtml | 18 +- .../frontend/base/default/layout/catalog.xml | 18 - .../frontend/base/default/layout/oauth.xml | 124 +- .../frontend/base/default/layout/wishlist.xml | 30 +- .../base/default/template/captcha/zend.phtml | 2 +- .../base/default/template/checkout/cart.phtml | 4 +- .../checkout/onepage/payment/methods.phtml | 2 +- .../template/checkout/onepage/progress.phtml | 2 +- .../default/template/checkout/success.phtml | 2 +- .../oauth/authorize/button-simple.phtml | 62 + .../template/oauth/authorize/button.phtml | 4 +- .../oauth/authorize/confirm-simple.phtml | 52 + .../template/oauth/authorize/confirm.phtml | 2 +- .../oauth/authorize/form/login-simple.phtml | 75 + .../template/oauth/authorize/form/login.phtml | 2 +- .../oauth/authorize/head-simple.phtml | 4 +- .../oauth/authorize/reject-simple.phtml} | 25 +- .../template/oauth/authorize/reject.phtml | 2 +- .../template/oauth/customer/token/list.phtml | 4 +- .../default/template/page/html/notices.phtml | 10 +- .../express/review/shipping/method.phtml | 2 +- .../template/paypaluk/express/review.phtml | 2 +- .../template/sales/order/details.phtml | 2 +- .../default/template/sales/order/print.phtml | 2 +- .../sales/order/print/creditmemo.phtml | 2 +- .../template/sales/order/print/invoice.phtml | 2 +- .../template/sales/order/trackinginfo.phtml | 7 +- .../frontend/default/iphone/layout/bundle.xml | 8 +- .../default/iphone/layout/catalog.xml | 97 +- .../default/iphone/layout/catalogsearch.xml | 47 +- .../default/iphone/layout/checkout.xml | 37 +- .../frontend/default/iphone/layout/cms.xml | 6 + .../default/iphone/layout/contacts.xml | 20 +- .../default/iphone/layout/customer.xml | 94 +- .../default/iphone/layout/newsletter.xml | 68 + .../frontend/default/iphone/layout/page.xml | 86 +- .../default/iphone/layout/persistent.xml | 95 - .../frontend/default/iphone/layout/review.xml | 21 +- .../frontend/default/iphone/layout/rss.xml | 100 + .../frontend/default/iphone/layout/sales.xml | 507 ++ .../iphone/layout/sales/billing_agreement.xml | 1 + .../default/iphone/layout/sendfriend.xml | 2 +- .../frontend/default/iphone/layout/tag.xml | 27 +- .../default/iphone/layout/wishlist.xml | 140 + .../default/iphone/locale/en_US/translate.csv | 7 - .../template/catalog/category/view.phtml | 70 + .../iphone/template/catalog/layer/view.phtml | 23 +- .../template/catalog/navigation/top.phtml | 3 - .../catalog/product/compare/list.phtml | 258 - .../catalog/product/compare/sidebar.phtml | 68 - .../template/catalog/product/gallery.phtml | 38 +- .../template/catalog/product/list.phtml | 153 +- .../catalog/product/list/toolbar.phtml | 45 +- .../catalog/product/list/upsell.phtml | 42 +- .../template/catalog/product/price.phtml | 428 ++ ...addtocartbottom.phtml => price_msrp.phtml} | 29 +- ...ddtocart.phtml => price_msrp_noform.phtml} | 29 +- .../template/catalog/product/view.phtml | 145 +- .../template/catalog/product/view/addto.phtml | 21 +- .../template/catalog/product/view/media.phtml | 6 +- .../product/view/type/grouped_grid.phtml | 76 - .../template/catalogsearch/form.mini.phtml | 9 +- .../template/catalogsearch/result.phtml | 24 - .../iphone/template/checkout/cart.phtml | 98 +- .../template/checkout/cart/coupon.phtml | 59 - .../template/checkout/cart/item/default.phtml | 438 +- .../template/checkout/cart/sidebar.phtml | 79 - .../iphone/template/checkout/cartheader.phtml | 100 - .../template/checkout/onepage/login.phtml | 123 - .../checkout/onepage/review/info.phtml | 25 +- .../checkout/onepage/review/item.phtml | 401 +- .../checkout/onepage/review/totals.phtml | 2 +- .../iphone/template/checkout/success.phtml | 66 + .../customer/account/dashboard/address.phtml | 45 + .../customer/account/navigation.phtml | 46 +- .../template/customer/address/book.phtml | 107 + .../iphone/template/customer/form/edit.phtml | 115 - .../customer/form/forgotpassword.phtml | 49 - .../iphone/template/customer/form/login.phtml | 84 +- .../template/customer/form/register.phtml | 180 - .../checkout/cart/item/default.phtml | 302 + .../checkout/onepage/review/item.phtml | 254 + .../downloadable/customer/products/list.phtml | 60 + .../items/renderer/downloadable.phtml | 325 ++ .../invoice/items/renderer/downloadable.phtml | 320 ++ .../order/items/renderer/downloadable.phtml | 335 ++ .../template/newsletter/subscribe.phtml | 49 + .../iphone/template/page/1column.phtml | 6 +- .../iphone/template/page/html/footer.phtml | 2 +- .../iphone/template/page/html/header.phtml | 33 +- .../template/links.phtml} | 29 +- .../template/paypal/express/review.phtml | 171 + .../express/review/details.phtml} | 21 +- .../persistent/checkout/onepage/login.phtml | 67 +- .../persistent/customer/form/login.phtml | 91 +- .../persistent/customer/form/register.phtml | 191 - .../persistent/remember_me_tooltip.phtml | 61 + .../template/review/customer/list.phtml | 58 + .../sales/billing/agreement/view.phtml | 110 + .../template/sales/billing/agreements.phtml | 98 + .../sales/order/creditmemo/items.phtml | 44 + .../creditmemo/items/renderer/default.phtml | 322 ++ .../iphone/template/sales/order/history.phtml | 65 +- .../template/sales/order/invoice/items.phtml | 44 + .../invoice/items/renderer/default.phtml | 312 + .../iphone/template/sales/order/items.phtml | 38 +- .../sales/order/items/renderer/default.phtml | 331 ++ .../iphone/template/sales/order/recent.phtml | 19 +- .../iphone/template/sales/order/totals.phtml | 4 +- .../iphone/template/sendfriend/send.phtml | 148 - .../default/iphone/template/tag/list.phtml | 18 +- .../iphone/template/tax/order/tax.phtml | 81 + .../template/wishlist/item/column/cart.phtml | 52 + .../item/column/image.phtml} | 16 +- .../template/wishlist/item/column/info.phtml | 39 + .../item/configure/addto.phtml} | 19 +- .../iphone/template/wishlist/item/list.phtml | 56 + .../iphone/template/wishlist/shared.phtml | 73 + .../iphone/template/wishlist/view.phtml | 136 +- .../default/modern/layout/catalog.xml | 18 - .../default/modern/layout/customer.xml | 23 + .../default/modern/layout/wishlist.xml | 45 +- .../modern/template/checkout/cart.phtml | 4 +- app/etc/modules/Mage_Api2.xml | 2 +- .../{Mage_OAuth.xml => Mage_Oauth.xml} | 6 +- app/locale/en_US/Mage_Adminhtml.csv | 2 +- app/locale/en_US/Mage_Api.csv | 1 + app/locale/en_US/Mage_Api2.csv | 32 + app/locale/en_US/Mage_Catalog.csv | 1 - app/locale/en_US/Mage_Checkout.csv | 2 +- app/locale/en_US/Mage_Core.csv | 1 + app/locale/en_US/Mage_ImportExport.csv | 36 +- .../en_US/{Mage_OAuth.csv => Mage_Oauth.csv} | 9 +- app/locale/en_US/Mage_Page.csv | 2 +- app/locale/en_US/Mage_Payment.csv | 1 - app/locale/en_US/Mage_Usa.csv | 3 + app/locale/en_US/Mage_Widget.csv | 1 - app/locale/en_US/Mage_Wishlist.csv | 2 +- downloader/Maged/Controller.php | 4 +- downloader/template/footer.phtml | 2 +- downloader/template/install/footer.phtml | 2 +- errors/default/page.phtml | 2 +- .../adminhtml/product/composite/configure.js | 6 +- js/mage/captcha.js | 30 +- lib/Varien/Db/Adapter/Interface.php | 5 + lib/Varien/Db/Adapter/Pdo/Mysql.php | 2 +- .../default/default/oauth-simple.css | 239 + skin/frontend/base/default/images/cvv.gif | Bin 18112 -> 19277 bytes .../base/default/js/checkout/review.js | 4 +- skin/frontend/default/blank/images/cvv.gif | Bin 18112 -> 19277 bytes skin/frontend/default/blue/css/styles.css | 2 + .../default/default/css/oauth-simple.css | 239 + skin/frontend/default/default/css/styles.css | 5 +- skin/frontend/default/default/images/cvv.gif | Bin 18112 -> 19277 bytes skin/frontend/default/iphone/css/custom.css | 65 + skin/frontend/default/iphone/css/iphone.css | 5060 ++++++----------- .../default/iphone/images/arrow_left.png | Bin 0 -> 1101 bytes .../iphone/images/arrow_left_retina.png | Bin 0 -> 1156 bytes .../default/iphone/images/arrow_right.png | Bin 0 -> 1102 bytes .../iphone/images/arrow_right_retina.png | Bin 0 -> 1175 bytes .../default/iphone/images/bg_back_btn.png | Bin 0 -> 1220 bytes .../iphone/images/bg_back_btn_retina.png | Bin 0 -> 1538 bytes .../default/iphone/images/bg_breadcrumb.png | Bin 2864 -> 0 bytes .../iphone/images/bg_breadcrumb_active.png | Bin 2840 -> 0 bytes .../default/iphone/images/bg_button.png | Bin 2558 -> 0 bytes .../default/iphone/images/bg_divider.png | Bin 0 -> 995 bytes .../default/iphone/images/bg_divider_dark.png | Bin 0 -> 1147 bytes .../iphone/images/bg_divider_dark_retina.png | Bin 0 -> 1153 bytes .../iphone/images/bg_divider_retina.png | Bin 0 -> 1019 bytes .../default/iphone/images/bg_drop.jpg | Bin 12907 -> 0 bytes .../default/iphone/images/bg_gradient.png | Bin 0 -> 1094 bytes .../iphone/images/bg_gradient_retina.png | Bin 0 -> 1096 bytes .../default/iphone/images/bg_nav_brd.png | Bin 259 -> 0 bytes .../iphone/images/bg_nav_brd_inactive.png | Bin 869 -> 0 bytes .../frontend/default/iphone/images/bg_qty.png | Bin 283 -> 0 bytes .../default/iphone/images/bg_rating_star.png | Bin 1081 -> 0 bytes .../default/iphone/images/bg_shadow.png | Bin 0 -> 1100 bytes .../iphone/images/bg_shadow_retina.png | Bin 0 -> 1089 bytes .../default/iphone/images/btn_edit.png | Bin 0 -> 1321 bytes .../default/iphone/images/btn_edit_retina.png | Bin 0 -> 1421 bytes .../default/iphone/images/btn_remove.png | Bin 0 -> 1185 bytes .../iphone/images/btn_remove_retina.png | Bin 0 -> 1319 bytes .../default/iphone/images/btn_trash.gif | Bin 1353 -> 0 bytes .../default/iphone/images/btn_trash.png | Bin 1227 -> 0 bytes .../default/iphone/images/custom/arrow.png | Bin 0 -> 1037 bytes .../iphone/images/custom/arrow_retina.png | Bin 0 -> 1088 bytes .../iphone/images/custom/bg_header.png | Bin 0 -> 13919 bytes .../iphone/images/custom/bg_header_retina.png | Bin 0 -> 57132 bytes .../default/iphone/images/custom/bg_logo.png | Bin 0 -> 2793 bytes .../iphone/images/custom/bg_logo_retina.png | Bin 0 -> 5850 bytes .../frontend/default/iphone/images/fabric.jpg | Bin 57452 -> 0 bytes skin/frontend/default/iphone/images/flip.png | Bin 3124 -> 0 bytes .../default/iphone/images/front_banner.png | Bin 7355 -> 0 bytes skin/frontend/default/iphone/images/grid.png | Bin 946 -> 0 bytes .../default/iphone/images/i_add_to_cart.png | Bin 1345 -> 0 bytes .../iphone/images/i_add_to_wishlist.png | Bin 1240 -> 0 bytes .../default/iphone/images/i_arrow.png | Bin 240 -> 0 bytes .../default/iphone/images/i_arrow_small.png | Bin 1304 -> 0 bytes .../default/iphone/images/i_arrow_white.png | Bin 1134 -> 0 bytes .../frontend/default/iphone/images/i_cart.png | Bin 0 -> 1604 bytes .../default/iphone/images/i_cart_retina.png | Bin 0 -> 1686 bytes .../default/iphone/images/i_dropdown.png | Bin 1081 -> 1109 bytes .../iphone/images/i_dropdown_retina.png | Bin 0 -> 1204 bytes .../default/iphone/images/i_gallery.png | Bin 1129 -> 0 bytes .../frontend/default/iphone/images/i_menu.png | Bin 0 -> 1053 bytes .../default/iphone/images/i_menu_arrow.png | Bin 1036 -> 0 bytes .../default/iphone/images/i_menu_cart.png | Bin 1155 -> 0 bytes .../default/iphone/images/i_menu_retina.png | Bin 0 -> 1030 bytes .../default/iphone/images/i_menu_search.png | Bin 1602 -> 0 bytes .../default/iphone/images/i_search.png | Bin 408 -> 1244 bytes .../default/iphone/images/i_search_retina.png | Bin 0 -> 1409 bytes .../frontend/default/iphone/images/i_star.png | Bin 4117 -> 1705 bytes .../default/iphone/images/i_star_black.png | Bin 3540 -> 0 bytes .../default/iphone/images/i_star_blank.png | Bin 0 -> 1905 bytes .../iphone/images/i_star_blank_retina.png | Bin 0 -> 2427 bytes .../default/iphone/images/i_star_retina.png | Bin 0 -> 2054 bytes .../default/iphone/images/i_tell_a_friend.png | Bin 1865 -> 0 bytes .../default/iphone/images/i_view_details.png | Bin 1694 -> 0 bytes .../frontend/default/iphone/images/i_zoom.png | Bin 0 -> 1228 bytes .../default/iphone/images/i_zoom_retina.png | Bin 0 -> 1399 bytes skin/frontend/default/iphone/images/list.png | Bin 946 -> 0 bytes skin/frontend/default/iphone/images/logo.png | Bin 3660 -> 0 bytes .../media/cell_phone_landing_banner1.jpg | Bin 0 -> 21259 bytes .../frontend/default/iphone/images/nav_bg.png | Bin 958 -> 0 bytes .../default/iphone/images/nextlabel.png | Bin 1374 -> 0 bytes .../default/iphone/images/prevlabel.png | Bin 1241 -> 0 bytes .../default/iphone/images/search_icon.png | Bin 1663 -> 0 bytes skin/frontend/default/iphone/js/iphone.js | 618 +- skin/frontend/default/modern/css/styles.css | 4 +- skin/frontend/default/modern/images/cvv.gif | Bin 18112 -> 19277 bytes ...nterface_Adminhtml_Default-1.7.0.0-rc1.xml | 18 - .../Interface_Adminhtml_Default-1.7.0.0.xml | 18 + ...terface_Frontend_Base_Default-1.7.0.0.xml} | 14 +- ...Interface_Frontend_Default-1.7.0.0-rc1.xml | 18 - .../Interface_Frontend_Default-1.7.0.0.xml | 18 + ... => Interface_Install_Default-1.7.0.0.xml} | 12 +- var/package/Lib_Google_Checkout-1.5.0.0.xml | 6 +- ...1-rc1.xml => Lib_Js_Calendar-1.51.1.1.xml} | 10 +- ...1.7.0.0-rc1.xml => Lib_Js_Ext-1.7.0.0.xml} | 10 +- ....7.0.0-rc1.xml => Lib_Js_Mage-1.7.0.0.xml} | 14 +- ...rc1.xml => Lib_Js_Prototype-1.7.0.0.3.xml} | 10 +- ...7.0-rc1.xml => Lib_Js_TinyMCE-3.4.7.0.xml} | 10 +- ....xml => Lib_LinLibertineFont-2.8.14.1.xml} | 10 +- ...e-1.7.0.0-rc1.xml => Lib_Mage-1.7.0.0.xml} | 10 +- var/package/Lib_Phpseclib-1.5.0.0.xml | 4 +- ...1.7.0.0-rc1.xml => Lib_Varien-1.7.0.0.xml} | 12 +- var/package/Lib_ZF-1.11.1.0.xml | 6 +- var/package/Lib_ZF_Locale-1.11.1.0.xml | 4 +- var/package/Mage_All_Latest-1.7.0.0-rc1.xml | 18 - var/package/Mage_All_Latest-1.7.0.0.xml | 18 + ....0.0-rc1.xml => Mage_Centinel-1.7.0.0.xml} | 12 +- ....0.0-rc1.xml => Mage_Compiler-1.7.0.0.xml} | 12 +- ...c1.xml => Mage_Core_Adminhtml-1.7.0.0.xml} | 14 +- var/package/Mage_Core_Modules-1.7.0.0-rc1.xml | 18 - var/package/Mage_Core_Modules-1.7.0.0.xml | 18 + ....0-rc1.xml => Mage_Downloader-1.7.0.0.xml} | 12 +- ...-rc1.xml => Mage_Locale_en_US-1.7.0.0.xml} | 12 +- ....1.xml => Magento_Mobile-1.7.0.0.22.1.xml} | 9 +- ...rc1.xml => Phoenix_Moneybookers-1.3.1.xml} | 12 +- 412 files changed, 11036 insertions(+), 8707 deletions(-) rename app/code/core/Mage/Admin/sql/admin_setup/{mysql4-upgrade-1.6.0.0-1.6.1.0.php => upgrade-1.6.0.0-1.6.1.0.php} (100%) delete mode 100644 app/code/core/Mage/OAuth/Block/Authorize/Style.php rename app/code/core/Mage/{OAuth/Block/Adminhtml/OAuth => Oauth/Block/Adminhtml/Oauth}/Admin/Token.php (88%) rename app/code/core/Mage/{OAuth/Block/Adminhtml/OAuth => Oauth/Block/Adminhtml/Oauth}/Admin/Token/Grid.php (90%) rename app/code/core/Mage/{OAuth/Block/Adminhtml/OAuth => Oauth/Block/Adminhtml/Oauth}/Authorize.php (81%) rename app/code/core/Mage/{OAuth/Block/Adminhtml/OAuth => Oauth/Block/Adminhtml/Oauth}/Authorize/Button.php (83%) rename app/code/core/Mage/{OAuth/Block/Adminhtml/OAuth => Oauth/Block/Adminhtml/Oauth}/AuthorizedTokens.php (88%) rename app/code/core/Mage/{OAuth/Block/Adminhtml/OAuth => Oauth/Block/Adminhtml/Oauth}/AuthorizedTokens/Grid.php (90%) rename app/code/core/Mage/{OAuth/Block/Adminhtml/OAuth => Oauth/Block/Adminhtml/Oauth}/Consumer.php (90%) rename app/code/core/Mage/{OAuth/Block/Adminhtml/OAuth => Oauth/Block/Adminhtml/Oauth}/Consumer/Edit.php (91%) rename app/code/core/Mage/{OAuth/Block/Adminhtml/OAuth => Oauth/Block/Adminhtml/Oauth}/Consumer/Edit/Form.php (93%) rename app/code/core/Mage/{OAuth/Block/Adminhtml/OAuth => Oauth/Block/Adminhtml/Oauth}/Consumer/Grid.php (91%) rename app/code/core/Mage/{OAuth => Oauth}/Block/Authorize.php (87%) rename app/code/core/Mage/{OAuth => Oauth}/Block/Authorize/Abstract.php (81%) rename app/code/core/Mage/{OAuth => Oauth}/Block/Authorize/Button.php (92%) rename app/code/core/Mage/{OAuth => Oauth}/Block/Authorize/ButtonBaseAbstract.php (91%) rename app/code/core/Mage/{OAuth => Oauth}/Block/AuthorizeBaseAbstract.php (92%) rename app/code/core/Mage/{OAuth => Oauth}/Block/Customer/Token/List.php (86%) rename app/code/core/Mage/{OAuth => Oauth}/Exception.php (90%) rename app/code/core/Mage/{OAuth => Oauth}/Helper/Data.php (74%) rename app/code/core/Mage/{OAuth => Oauth}/Model/Consumer.php (76%) rename app/code/core/Mage/{OAuth => Oauth}/Model/Consumer/Validator/KeyLength.php (92%) rename app/code/core/Mage/{OAuth => Oauth}/Model/Nonce.php (78%) rename app/code/core/Mage/{OAuth => Oauth}/Model/Observer.php (53%) rename app/code/core/Mage/{OAuth => Oauth}/Model/Resource/Consumer.php (91%) rename app/code/core/Mage/{OAuth => Oauth}/Model/Resource/Consumer/Collection.php (91%) rename app/code/core/Mage/{OAuth => Oauth}/Model/Resource/Nonce.php (93%) rename app/code/core/Mage/{OAuth => Oauth}/Model/Resource/Nonce/Collection.php (91%) rename app/code/core/Mage/{OAuth => Oauth}/Model/Resource/Setup.php (90%) rename app/code/core/Mage/{OAuth => Oauth}/Model/Resource/Token.php (90%) rename app/code/core/Mage/{OAuth => Oauth}/Model/Resource/Token/Collection.php (85%) rename app/code/core/Mage/{OAuth => Oauth}/Model/Server.php (95%) rename app/code/core/Mage/{OAuth => Oauth}/Model/Token.php (81%) rename app/code/core/Mage/{OAuth/controllers/Adminhtml/OAuth => Oauth/controllers/Adminhtml/Oauth}/Admin/TokenController.php (90%) rename app/code/core/Mage/{OAuth/controllers/Adminhtml/OAuth => Oauth/controllers/Adminhtml/Oauth}/AuthorizeController.php (69%) rename app/code/core/Mage/{OAuth/controllers/Adminhtml/OAuth => Oauth/controllers/Adminhtml/Oauth}/AuthorizedTokensController.php (90%) rename app/code/core/Mage/{OAuth/controllers/Adminhtml/OAuth => Oauth/controllers/Adminhtml/Oauth}/ConsumerController.php (93%) rename app/code/core/Mage/{OAuth => Oauth}/controllers/AuthorizeController.php (80%) rename app/code/core/Mage/{OAuth => Oauth}/controllers/Customer/TokenController.php (91%) rename app/code/core/Mage/{OAuth => Oauth}/controllers/InitiateController.php (90%) rename app/code/core/Mage/{OAuth => Oauth}/controllers/TokenController.php (90%) rename app/code/core/Mage/{OAuth => Oauth}/etc/adminhtml.xml (95%) rename app/code/core/Mage/{OAuth => Oauth}/etc/config.xml (85%) rename app/code/core/Mage/{OAuth => Oauth}/etc/system.xml (99%) rename app/code/core/Mage/{OAuth => Oauth}/sql/oauth_setup/install-1.0.0.0.php (96%) rename app/code/core/Mage/Sales/Model/Api2/Order/{Comments.php => Comment.php} (93%) rename app/code/core/Mage/Sales/Model/Api2/Order/{Comments => Comment}/Rest.php (96%) rename app/code/core/Mage/Sales/Model/Api2/Order/{Comments => Comment}/Rest/Admin/V1.php (91%) rename app/code/core/Mage/Sales/Model/Api2/Order/{Comments => Comment}/Rest/Customer/V1.php (94%) rename app/code/core/Mage/Sales/Model/Api2/Order/{Items.php => Item.php} (93%) rename app/code/core/Mage/Sales/Model/Api2/Order/{Items => Item}/Rest.php (96%) rename app/code/core/Mage/Sales/Model/Api2/Order/{Items => Item}/Rest/Admin/V1.php (91%) rename app/code/core/Mage/Sales/Model/Api2/Order/{Items => Item}/Rest/Customer/V1.php (94%) delete mode 100644 app/design/adminhtml/default/default/template/oauth/authorize/simple-css.phtml create mode 100644 app/design/frontend/base/default/template/oauth/authorize/button-simple.phtml create mode 100644 app/design/frontend/base/default/template/oauth/authorize/confirm-simple.phtml create mode 100644 app/design/frontend/base/default/template/oauth/authorize/form/login-simple.phtml rename app/design/frontend/{default/iphone/template/checkout/cart/noItemsHeader.phtml => base/default/template/oauth/authorize/reject-simple.phtml} (59%) create mode 100644 app/design/frontend/default/iphone/layout/newsletter.xml delete mode 100644 app/design/frontend/default/iphone/layout/persistent.xml create mode 100644 app/design/frontend/default/iphone/layout/rss.xml create mode 100644 app/design/frontend/default/iphone/layout/sales.xml create mode 100644 app/design/frontend/default/iphone/layout/wishlist.xml create mode 100644 app/design/frontend/default/iphone/template/catalog/category/view.phtml delete mode 100644 app/design/frontend/default/iphone/template/catalog/product/compare/list.phtml delete mode 100644 app/design/frontend/default/iphone/template/catalog/product/compare/sidebar.phtml create mode 100644 app/design/frontend/default/iphone/template/catalog/product/price.phtml rename app/design/frontend/default/iphone/template/catalog/product/{view/addtocartbottom.phtml => price_msrp.phtml} (58%) rename app/design/frontend/default/iphone/template/catalog/product/{view/addtocart.phtml => price_msrp_noform.phtml} (57%) delete mode 100644 app/design/frontend/default/iphone/template/catalog/product/view/type/grouped_grid.phtml delete mode 100644 app/design/frontend/default/iphone/template/checkout/cart/coupon.phtml delete mode 100644 app/design/frontend/default/iphone/template/checkout/cart/sidebar.phtml delete mode 100644 app/design/frontend/default/iphone/template/checkout/cartheader.phtml delete mode 100644 app/design/frontend/default/iphone/template/checkout/onepage/login.phtml create mode 100644 app/design/frontend/default/iphone/template/checkout/success.phtml create mode 100644 app/design/frontend/default/iphone/template/customer/account/dashboard/address.phtml create mode 100644 app/design/frontend/default/iphone/template/customer/address/book.phtml delete mode 100644 app/design/frontend/default/iphone/template/customer/form/edit.phtml delete mode 100644 app/design/frontend/default/iphone/template/customer/form/forgotpassword.phtml delete mode 100644 app/design/frontend/default/iphone/template/customer/form/register.phtml create mode 100644 app/design/frontend/default/iphone/template/downloadable/checkout/cart/item/default.phtml create mode 100644 app/design/frontend/default/iphone/template/downloadable/checkout/onepage/review/item.phtml create mode 100644 app/design/frontend/default/iphone/template/downloadable/customer/products/list.phtml create mode 100644 app/design/frontend/default/iphone/template/downloadable/sales/order/creditmemo/items/renderer/downloadable.phtml create mode 100644 app/design/frontend/default/iphone/template/downloadable/sales/order/invoice/items/renderer/downloadable.phtml create mode 100644 app/design/frontend/default/iphone/template/downloadable/sales/order/items/renderer/downloadable.phtml create mode 100644 app/design/frontend/default/iphone/template/newsletter/subscribe.phtml rename app/design/frontend/default/iphone/template/{catalog/product/view/type/grouped.phtml => page/template/links.phtml} (51%) create mode 100644 app/design/frontend/default/iphone/template/paypal/express/review.phtml rename app/design/frontend/default/iphone/template/{catalog/product/view/addtowishlist.phtml => paypal/express/review/details.phtml} (66%) delete mode 100644 app/design/frontend/default/iphone/template/persistent/customer/form/register.phtml create mode 100644 app/design/frontend/default/iphone/template/persistent/remember_me_tooltip.phtml create mode 100644 app/design/frontend/default/iphone/template/review/customer/list.phtml create mode 100644 app/design/frontend/default/iphone/template/sales/billing/agreement/view.phtml create mode 100644 app/design/frontend/default/iphone/template/sales/billing/agreements.phtml create mode 100644 app/design/frontend/default/iphone/template/sales/order/creditmemo/items.phtml create mode 100644 app/design/frontend/default/iphone/template/sales/order/creditmemo/items/renderer/default.phtml create mode 100644 app/design/frontend/default/iphone/template/sales/order/invoice/items.phtml create mode 100644 app/design/frontend/default/iphone/template/sales/order/invoice/items/renderer/default.phtml create mode 100644 app/design/frontend/default/iphone/template/sales/order/items/renderer/default.phtml delete mode 100644 app/design/frontend/default/iphone/template/sendfriend/send.phtml create mode 100644 app/design/frontend/default/iphone/template/tax/order/tax.phtml create mode 100644 app/design/frontend/default/iphone/template/wishlist/item/column/cart.phtml rename app/design/frontend/default/iphone/template/{catalog/product/view/options/wrapper/bottom.phtml => wishlist/item/column/image.phtml} (60%) create mode 100644 app/design/frontend/default/iphone/template/wishlist/item/column/info.phtml rename app/design/frontend/default/iphone/template/{catalog/product/view/description.phtml => wishlist/item/configure/addto.phtml} (69%) create mode 100644 app/design/frontend/default/iphone/template/wishlist/item/list.phtml create mode 100644 app/design/frontend/default/iphone/template/wishlist/shared.phtml rename app/etc/modules/{Mage_OAuth.xml => Mage_Oauth.xml} (94%) rename app/locale/en_US/{Mage_OAuth.csv => Mage_Oauth.csv} (92%) create mode 100644 skin/adminhtml/default/default/oauth-simple.css create mode 100644 skin/frontend/default/default/css/oauth-simple.css create mode 100644 skin/frontend/default/iphone/css/custom.css create mode 100644 skin/frontend/default/iphone/images/arrow_left.png create mode 100644 skin/frontend/default/iphone/images/arrow_left_retina.png create mode 100644 skin/frontend/default/iphone/images/arrow_right.png create mode 100644 skin/frontend/default/iphone/images/arrow_right_retina.png create mode 100644 skin/frontend/default/iphone/images/bg_back_btn.png create mode 100644 skin/frontend/default/iphone/images/bg_back_btn_retina.png delete mode 100644 skin/frontend/default/iphone/images/bg_breadcrumb.png delete mode 100644 skin/frontend/default/iphone/images/bg_breadcrumb_active.png delete mode 100644 skin/frontend/default/iphone/images/bg_button.png create mode 100644 skin/frontend/default/iphone/images/bg_divider.png create mode 100644 skin/frontend/default/iphone/images/bg_divider_dark.png create mode 100644 skin/frontend/default/iphone/images/bg_divider_dark_retina.png create mode 100644 skin/frontend/default/iphone/images/bg_divider_retina.png delete mode 100644 skin/frontend/default/iphone/images/bg_drop.jpg create mode 100644 skin/frontend/default/iphone/images/bg_gradient.png create mode 100644 skin/frontend/default/iphone/images/bg_gradient_retina.png delete mode 100644 skin/frontend/default/iphone/images/bg_nav_brd.png delete mode 100644 skin/frontend/default/iphone/images/bg_nav_brd_inactive.png delete mode 100644 skin/frontend/default/iphone/images/bg_qty.png delete mode 100644 skin/frontend/default/iphone/images/bg_rating_star.png create mode 100644 skin/frontend/default/iphone/images/bg_shadow.png create mode 100644 skin/frontend/default/iphone/images/bg_shadow_retina.png create mode 100644 skin/frontend/default/iphone/images/btn_edit.png create mode 100644 skin/frontend/default/iphone/images/btn_edit_retina.png create mode 100644 skin/frontend/default/iphone/images/btn_remove.png create mode 100644 skin/frontend/default/iphone/images/btn_remove_retina.png delete mode 100644 skin/frontend/default/iphone/images/btn_trash.gif delete mode 100644 skin/frontend/default/iphone/images/btn_trash.png create mode 100644 skin/frontend/default/iphone/images/custom/arrow.png create mode 100644 skin/frontend/default/iphone/images/custom/arrow_retina.png create mode 100644 skin/frontend/default/iphone/images/custom/bg_header.png create mode 100644 skin/frontend/default/iphone/images/custom/bg_header_retina.png create mode 100644 skin/frontend/default/iphone/images/custom/bg_logo.png create mode 100644 skin/frontend/default/iphone/images/custom/bg_logo_retina.png delete mode 100644 skin/frontend/default/iphone/images/fabric.jpg delete mode 100644 skin/frontend/default/iphone/images/flip.png delete mode 100644 skin/frontend/default/iphone/images/front_banner.png delete mode 100644 skin/frontend/default/iphone/images/grid.png delete mode 100644 skin/frontend/default/iphone/images/i_add_to_cart.png delete mode 100644 skin/frontend/default/iphone/images/i_add_to_wishlist.png delete mode 100644 skin/frontend/default/iphone/images/i_arrow.png delete mode 100644 skin/frontend/default/iphone/images/i_arrow_small.png delete mode 100644 skin/frontend/default/iphone/images/i_arrow_white.png create mode 100644 skin/frontend/default/iphone/images/i_cart.png create mode 100644 skin/frontend/default/iphone/images/i_cart_retina.png create mode 100644 skin/frontend/default/iphone/images/i_dropdown_retina.png delete mode 100644 skin/frontend/default/iphone/images/i_gallery.png create mode 100644 skin/frontend/default/iphone/images/i_menu.png delete mode 100644 skin/frontend/default/iphone/images/i_menu_arrow.png delete mode 100644 skin/frontend/default/iphone/images/i_menu_cart.png create mode 100644 skin/frontend/default/iphone/images/i_menu_retina.png delete mode 100644 skin/frontend/default/iphone/images/i_menu_search.png create mode 100644 skin/frontend/default/iphone/images/i_search_retina.png delete mode 100644 skin/frontend/default/iphone/images/i_star_black.png create mode 100644 skin/frontend/default/iphone/images/i_star_blank.png create mode 100644 skin/frontend/default/iphone/images/i_star_blank_retina.png create mode 100644 skin/frontend/default/iphone/images/i_star_retina.png delete mode 100644 skin/frontend/default/iphone/images/i_tell_a_friend.png delete mode 100644 skin/frontend/default/iphone/images/i_view_details.png create mode 100644 skin/frontend/default/iphone/images/i_zoom.png create mode 100644 skin/frontend/default/iphone/images/i_zoom_retina.png delete mode 100644 skin/frontend/default/iphone/images/list.png delete mode 100644 skin/frontend/default/iphone/images/logo.png create mode 100644 skin/frontend/default/iphone/images/media/cell_phone_landing_banner1.jpg delete mode 100644 skin/frontend/default/iphone/images/nav_bg.png delete mode 100644 skin/frontend/default/iphone/images/nextlabel.png delete mode 100644 skin/frontend/default/iphone/images/prevlabel.png delete mode 100644 skin/frontend/default/iphone/images/search_icon.png delete mode 100644 var/package/Interface_Adminhtml_Default-1.7.0.0-rc1.xml create mode 100644 var/package/Interface_Adminhtml_Default-1.7.0.0.xml rename var/package/{Interface_Frontend_Base_Default-1.7.0.0-rc1.xml => Interface_Frontend_Base_Default-1.7.0.0.xml} (52%) delete mode 100644 var/package/Interface_Frontend_Default-1.7.0.0-rc1.xml create mode 100644 var/package/Interface_Frontend_Default-1.7.0.0.xml rename var/package/{Interface_Install_Default-1.7.0.0-rc1.xml => Interface_Install_Default-1.7.0.0.xml} (93%) rename var/package/{Lib_Js_Calendar-1.51.1.1-rc1.xml => Lib_Js_Calendar-1.51.1.1.xml} (94%) rename var/package/{Lib_Js_Ext-1.7.0.0-rc1.xml => Lib_Js_Ext-1.7.0.0.xml} (99%) rename var/package/{Lib_Js_Mage-1.7.0.0-rc1.xml => Lib_Js_Mage-1.7.0.0.xml} (91%) rename var/package/{Lib_Js_Prototype-1.7.0.0.3-rc1.xml => Lib_Js_Prototype-1.7.0.0.3.xml} (98%) rename var/package/{Lib_Js_TinyMCE-3.4.7.0-rc1.xml => Lib_Js_TinyMCE-3.4.7.0.xml} (99%) rename var/package/{Lib_LinLibertineFont-2.8.14.1-rc1.xml => Lib_LinLibertineFont-2.8.14.1.xml} (90%) rename var/package/{Lib_Mage-1.7.0.0-rc1.xml => Lib_Mage-1.7.0.0.xml} (97%) rename var/package/{Lib_Varien-1.7.0.0-rc1.xml => Lib_Varien-1.7.0.0.xml} (97%) delete mode 100644 var/package/Mage_All_Latest-1.7.0.0-rc1.xml create mode 100644 var/package/Mage_All_Latest-1.7.0.0.xml rename var/package/{Mage_Centinel-1.7.0.0-rc1.xml => Mage_Centinel-1.7.0.0.xml} (95%) rename var/package/{Mage_Compiler-1.7.0.0-rc1.xml => Mage_Compiler-1.7.0.0.xml} (87%) rename var/package/{Mage_Core_Adminhtml-1.7.0.0-rc1.xml => Mage_Core_Adminhtml-1.7.0.0.xml} (98%) delete mode 100644 var/package/Mage_Core_Modules-1.7.0.0-rc1.xml create mode 100644 var/package/Mage_Core_Modules-1.7.0.0.xml rename var/package/{Mage_Downloader-1.7.0.0-rc1.xml => Mage_Downloader-1.7.0.0.xml} (95%) rename var/package/{Mage_Locale_en_US-1.7.0.0-rc1.xml => Mage_Locale_en_US-1.7.0.0.xml} (86%) rename var/package/{Magento_Mobile-1.6.0.0.22.1.xml => Magento_Mobile-1.7.0.0.22.1.xml} (99%) rename var/package/{Phoenix_Moneybookers-1.3.1-rc1.xml => Phoenix_Moneybookers-1.3.1.xml} (97%) diff --git a/.htaccess b/.htaccess index 2ea2a09ca8..60e17952c8 100644 --- a/.htaccess +++ b/.htaccess @@ -144,6 +144,13 @@ RewriteCond %{REQUEST_METHOD} ^TRAC[EK] RewriteRule .* - [L,R=405] +############################################ +## redirect for mobile user agents + + #RewriteCond %{REQUEST_URI} !^/mobiledirectoryhere/.*$ + #RewriteCond %{HTTP_USER_AGENT} "android|blackberry|ipad|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile" [NC] + #RewriteRule ^(.*)$ /mobiledirectoryhere/ [L,R=302] + ############################################ ## always send 404 on missing files in these folders diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt index b54e748dbc..b9dd15ad63 100644 --- a/RELEASE_NOTES.txt +++ b/RELEASE_NOTES.txt @@ -1,3 +1,588 @@ +==== 1.7.0.0 ==== + +=== Major Highlights === +Optimized Layered Navigation for pricing +Added CAPTCHA support for admin and customer users +Added different base price per customer group +Added auto generation of coupon codes +Improved the basic Backup and Rollback functionality +Added EU VAT ID validation service integration +Implemented DHL for Europe +Added REST API +Mobile theme was redesigned +Implemented the frontend Cookie Restriction functionality (EU cookie law compliance) +Added the Cash On Delivery and Bank Transfer payment methods + +=== Improvements === +XmlConnect package release v22.1 +Upgraded TinyMCE to v3.4.7 +Added the ability to translate action array parameter nodes in the layout.xml +Added the support for using custom currency symbols +Added the functionality for cleaning old cache files by cron tasks +Refactored rules-based modules +Improved customer address handling for PayPal Express checkout +Added the ability to customize a store logo in emails from an admin +Refactored the escaping functionality used for translations +Added the ability to turn off/on IP tracking (e.g. 'Placed from IP', displayed on the order-related pages in the backend) +Provided the logic for disabling ACL resources in configuration files +Added additional placeholders for extension developers + +=== Changes === +Added support for "memcached" PHP extension +The js/scriptaculous/dragdrop.js library is upgraded to version 1.9.0 +Files in .jpg format are allowed to be used for a favicon +Added the ability to extend the list of attributes in the SELECT query for categories loaded via Mage_Catalog_Model_Resource_Category_Flat::_loadNodes() +Added changes to lib/Varien/Http/Adapter/Curl.php to provide interface for setting different cURL options +Displaying State or Province can be optional for any country +Added the ability to get Magento type from Mage.php + +=== Fixes === +Fixed: Impossible to reset Customer Password via link in Forgot Password email template +Fixed: Reference to non-existing class Mage_Catalog_Block_Seo_Searchterm +Fixed: System can't find page by the URL when Payflow Link PayPal payment method used +Fixed: Grammar issues reported by community +Fixed: Layout is broken for PDF documents, values are overlapped +Fixed: Admin Notifications in backend should not appear again after it been removed or marked as read +Fixed: Reference and contents information is absent in the shipping label for DHL +Fixed: Include commented rewrite rules to .htaccess +Fixed: Shopping Cart is cleared after pressing "Enter" +Fixed: Group Name of "Not Logged IN" Customer Groups is removed automatically after saving +Fixed: Not possible to assign one picture to two products (Media Storage = Database) +Fixed: Exception in shop when accessed by Googlebot +Fixed: SLI for DHL used credentials only from the default configuration scope +Fixed: Old copyright data and system version exist in page footer +Fixed: CMS widgets: Required validation for drop-down "Type" and "Design Package/Theme" +Fixed: On "New Widget Instance" page, drop-down "Type" doesn't have required validation +Fixed: Auto-redirect to Base URL = Yes with correct behavior may cause problems when secure URL is hardcoded +Fixed: Enable Qty Increments on global config has higher priority than product config +Fixed: Short open tag in app/design/adminhtml/default/default/template/currencysymbol/grid.phtml +Fixed: UPS, FedEx and DHL methods should work if zip code from/to isn't required +Fixed: No ability to cancel Partial Authorization checkout with Authorize.net in the frontend +Fixed: Incorrect displaying of the "New User" page +Fixed: Multiple warnings in system.log after running compilation process +Fixed: Session is lost while redirecting from secure to unsecure URL +Fixed: Redirect to base URL should consider full request URI string +Fixed: Product name with <> processed incorrect during creation order in backend +Fixed: FedEx SmartPost method doesn't appears in rate request +Fixed: 3 and 4 digits CVV should be accepted for JCB cards +Fixed: Google Checkout tax isn't applied to Bundle product +Fixed: FPT is not considered by Google Checkout +Fixed: An error occurred during second Customer authorization fail +Fixed: Property declaration typo in Mage_Bundle_Adminhtml_Catalog_Product_Edit_Tab_Bundle_Option +Fixed: Product is not shown in the Catalog when it is Out of Stock and Display Out of Stock Products = Yes +Fixed: Impossible download downloadable product (problem with secure link) +Fixed: Wrong letter case in class names may cause malfunction when Compiler is enabled +Fixed: Incorrect invoice amount in order with FPT +Fixed: Attributes not connected to any product of selected category display in layered navigation +Fixed: No feedback on creating attribute set in IE9 and IE8 +Fixed: Unexpected breaking import process leads to creation phantom data into database +Fixed: Two of the same FedEx option show instead of one +Fixed: Notification for Google contains link that cover large area and blocked user work +Fixed: Possible to create user role with empty name if it starts with "less than" sign +Fixed: Impossible to use Clear Shopping Cart button in IE7 +Fixed: Impossible create product with one FPT price for all State/Province +Fixed: 'Interval Division Limit' affects to global displaying of Layered Navigation +Fixed: Shipping method must be recalculated on Order Review page if Transfer Shipping Options is enabled +Fixed: Issue with different secure/unsecure URL cause session data lost +Fixed: Can't save option Country in Store Information Tab +Fixed: Rule date information has been missed after using Product Rule or Shopping Cart Price Rule +Fixed: Billing/Shipping address algorithm for PayPal Express checkout works incorrect +Fixed: Error during quick search +Fixed: Block "Description" on Catalog Price Rule page has incorrect size +Fixed: Search doesn't work if Maximum Query Length field is empty +Fixed: The Tags Product RSS doesn't update information after changing tag +Fixed: Customer Attributes and Customer Address Attributes validation +Fixed: Issue with final price calculation for Configurable product with sub products +Fixed: Blank page after customer registration with enabled compilation +Fixed: "Place Order" button must be enabled if all required fields passed the validation on PayPal Express Checkout +Fixed: Products quantity displays incorrect in price ranges after import (rounding problem) +Fixed: Layout issue in shopping cart on frontend (IE8) +Fixed: Impossible to assign user to the role if he is assigned to another role +Fixed: 'Total records found' on Reports -> Tags -> Popular page shows wrong quantity of records +Fixed: Unable to refresh lifetime statistics +Fixed: After changing Price Navigation Step calculation from Automatic(eq price range) to Automatic(eq prod count) the category is loaded very slowly +Fixed: No ability to create Shipping Label (in case with USPS First-Class Mail International Parcel method) +Fixed: It is impossible to create Shipping Label for FedEx +Fixed: Redirect Customer to Account Dashboard after Logging is in enabled and doesn't work for Wishlist +Fixed: No ability to edit values using mass actions for product in IE8, IE9 +Fixed: Wrong message during checkout process in Inline Translate mode +Fixed: Default country is selected in Shipping Address during Admin order creation +Fixed: The Static block widget doesn't displayed on the Product View Extra hint for bundle product +Fixed: Bunch of W3C validation errors on frontend while using inline translate +Fixed: Product's association to root category is lost after export/import +Fixed: WYSIWYG Editor: Page is scrolled to the top after inserting variables +Fixed: Incorrect Backup/Rollback message +Fixed: FedEx Free shipping doesn't work correctly +Fixed: Configurable product displaying double price when choosing option +Fixed: Impossible to configure Admin User Emails for store view scope +Fixed: Long payment method data is printed improperly in PDF invoice +Fixed: Impossibility of changing the Rating Value title for store view in existing Rating Value with filled the Rating Value title for store view +Fixed: Trademark symbol not showing up +Fixed: Add "Delivery Option" for FedEx Configurations +Fixed: Saving product takes long time +Fixed: Notice message disappear after clearing cache +Fixed: Products qty displays incorrect in price ranges after import (rounding problem) +Fixed: Images in CSS fail when merging CSS files +Fixed: Mass action update of any attributes resets multi-select attributes to NULL +Fixed: Move CSS from Prototype Windows plug-in to the backend skin +Fixed: DB adapter should check transaction level in case of DDL query +Fixed: When Payment method additional info contains double quote it is displayed as '"' in invoice PDF +Fixed: Incorrect Unit Price(Excl. Tax) in the Shopping Cart Grid after changing currency +Fixed: Incorrect total quantity of records and pagination doesn't work on Reports->Reviews->Products Reviews page +Fixed: Incorrect title of All Reviews for product page +Fixed: Invalid message in shopping cart when trying to add products amount more than allowed +Fixed: Layered Navigation: Icon "Previous" should be appear only on sub-intervals level +Fixed: Processing error occurred when big numeric value is entered to an browser URL +Fixed: Issue with credit memo for multiple bundled products (order status is Processing) +Fixed: Customer group has to be emulated even if customer is sticky assigned to the group +Fixed: "Customs Value" isn't represented in store base currency +Fixed: Layered Navigation: After clicking on interval $0.00, should be filtered and displayed products with price 0.00 +Fixed: Absence of redirecting to the grid page after saving Role/User +Fixed: Incorrect logic of assignment of unique ID in Varien_Data_Collection +Fixed: Problems with sorting actions +Fixed: When product is set to be not available for selling checkout is still possible depending on its position in cart +Fixed: Impossibility of creating new order with "Reorder" button when Out of stock or disabled products had been ordered +Fixed: "Online Minute Interval" customer configuration option should have global scope +Fixed: Unable to translate Active/Inactive in promotions grid +Fixed: Response headers contains 500 error during frontend pages browsing +Fixed: Add additional button to PayPal Redirect Page +Fixed: Category Permissions: if "Display Product Price" is set to "No" the page toolbar is absent +Fixed: Layered navigation options have wrong order in backend +Fixed: The "Remember Me" check box with the "What's this?" link should be located below the "Forgot Your Password?" link +Fixed: Warning message is absent, when "Recovery Link Expiration Period" is specified within the correct range +Fixed: PayPal HSS (Website Payment Pro Hosted Solutions) France doesn't work +Fixed: Remove email from Billing address section of the PayPal Express Order Review page +Fixed: It is available enter negative digits in the "Layered Navigation Price Step" (on Category page) +Fixed: First/Last Name algorithm for PayPal Express checkout +Fixed: Asterisk isn't imported in Zip/Post Code field +Fixed: Some strings are not translated in widgets +Fixed: Session isn't stored between secure and unsecure URLs when they are located in different paths of the same domain (no SID in request) +Fixed: "USPS First Class International Parcel" will not show up as an option for customers during checkout +Fixed: UPS, FedEx and DHL methods should work if zip code from / to isn't required +Fixed: Issue when trying to create an order from the backend without selecting the state/province +Fixed: HTTP error when uploading images from a MacOS with shockwave flash 11.1.102.55 +Fixed: UPS Configuration "All Methods" should be selected by default +Fixed: Cannot create a product review through backend +Fixed: Typos in Role Permission tree +Fixed: WYSIWYG button layout issue on product page +Fixed: Require Customer's Billing Address is missing option "For Virtual Quotes Only" +Fixed: Errors appears on Design Configuration page if transactional email's logo image and/or favicon files were deleted +Fixed: State/Province value is reset after page reload on some forms +Fixed: Cannot access backend after switching on and switching off "Use Custom Admin URL" +Fixed: "Unsubscribe Selected" and "Delete Selected Problems" buttons don't work +Fixed: After selecting shipping from dropdown system doesn't update order data automatically on PayPal Express Order Review page +Fixed: Buttons on the backend order page don't have titles +Fixed: ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION error in Chrome browser +Fixed: Changes related with Apply and Discount Amount options for sub item, applied after clicking "Save Rule" button +Fixed: Invalid Timezone error for Asia/Calcutta when changing default country to India +Fixed: Sorting by position doesn't work for up-sells and related products +Fixed: Absent validation for "Only X left Threshold" field +Fixed: Shipping method calculation based on default shipping address instead of 'Same as billing' setting in backend +Fixed: There is no validation of the field "Handling Fee" that allows number less than zero in UPS shipping method +Fixed: Product name with "<>" processed incorrect during creation order in backend +Fixed: Billing Address Line is always blank if "REQUIREBILLING = 1" for PayPal Express +Fixed: Configuration->Inventory->Qty Increment isn't validated properly +Fixed: Absent message about not enough quantity for bundle and configurable products +Fixed: Wrong behavior of split buttons in IE8 +Fixed: Warning message appears after unselecting user in the Role Users grid +Fixed: Incorrect total weight calculation in external shipping methods for products with decimal Qty Increments +Fixed: Tax calculation is incorrect if configurable product mixed up with other composite products in the shopping cart for Store Tax != Customer Tax +Fixed: Products qty displays wrong in layered navigation after changing currency +Fixed: Billing address fields are editable if "Same as shipping" selected on the PayPal Express order review page +Fixed: Incorrect location of "Clear All" link +Fixed: Incorrect price for bundle fixed product with custom option % and catalog price rule applied +Fixed: Import/Export: Append Complex Data works incorrect for customer's address and product's customs data +Fixed: Discount changes subtotal when FPT is active +Fixed: There is no ability to specify backup's name +Fixed: Multi selections fields for website scope settings are greyed out +Fixed: Persistent Shopping Cart: After deleting customers via backend, on frontend customer should be logout completely +Fixed: Incorrect logic during dividing products into multiple boxes for shipping +Fixed: Polls are not working properly in case with different domains for http and https +Fixed: "Block Reference" drop-down contains wrong list of options for frontend Apps types with Products +Fixed: "Wrong store specified" appears on order creation page +Fixed: Customer can't continue Checkout process after selecting Billing Address +Fixed: Refresh Statistics gone from Reports Role +Fixed: USPS shipping label is printed with "SAMPLE - DO NOT MAIL" sign +Fixed: Shipping methods are not refreshed after Update Order Data is pressed on PayPal Express Order Review page +Fixed: Product still invisible in frontend after required re-index +Fixed: JS error on configurable products +Fixed: Configurable product missing name in error message when exceeding quantity during order +Fixed: Added Display Product Count on the Layout Navigation +Fixed: "FedEx Priority Overnight" shipping method isn't calculated correctly +Fixed: Incorrect product price for Bundle products with fixed prices in the shopping cart +Fixed: "Ship Bundle Items" for bundle product works incorrect +Fixed: Impossible to expand settings accordions on the "Design Settings Editor" tab of Theme Customization page under IE7 +Fixed: Impossibility to configure Bundle product with Disabled status and create new order with it in the backend +Fixed: Customer email isn't saved in Account Information field +Fixed: Unable to sort products by price +Fixed: Errors during creating/extracting "tar" archive with symbolic links +Fixed: Wrong message text in "Manage Coupon" tab on Shopping Cart Price Rule page +Fixed: 404 page not found error occurs when "Default Store" value is changed for Main Website +Fixed: Unable to import products if Catalog price rule enabled +Fixed: Partial Re-index isn't done for product saved in backend +Fixed: Catalog Price Rule: "Save and Apply" action leads to apply ALL rules, but it have to apply only specified rule +Fixed: Tax isn't recalculated on PayPal Express +Fixed: Backup Name field should allow entering only a limited number of characters +Fixed: In the "Subtotal" row of "Coupons Usage Report" displayed amounts for all Shopping Cart Price Rule in the system +Fixed: Shipping address isn't passed to Magento from PayPal +Fixed: Store view isn't changed when customer subscribes for newsletters +Fixed: Shopping Cart Price Rules are not marked after creating Coupons Usage Report +Fixed: Change buttons structure in prototype/windows.js to match general adminhtml buttons structure +Fixed: Wrong error message on Create New Order page in backend +Fixed: Impossible to configure order of displaying rating values in the frontend +Fixed: Incoming Message in Admin Part has the superfluous symbol '\' +Fixed: Numerous issues with promotions on complex products +Fixed: Recipient Postal-State Mismatch error seen on Shipping Label with FedEx +Fixed: Text messages "This is a required fields." are displayed in the hidden FTP section +Fixed: Incorrect popup on Manage Coupon Codes tab in Shopping Cart Price Rule +Fixed: Layered navigation work incorrect if attribute values defined on Store View level +Fixed: Checking import file returns blank page +Fixed: Change the VAT Number format before sending to VAT ID Validation service +Fixed: Simple products with configured customs options displayed in wishlist incorrectly +Fixed: Incorrect text message for product for which there is no enough quantity in stock +Fixed: Setting float Qty Increments is possible, but doesn't work +Fixed: SQL error during checkout when customers register at checkout and orders a nominal item +Fixed: Iframe for gateway isn't reloaded on the Payment information tab +Fixed: Incorrect behavior after placing order from backend in FF9 +Fixed: Catalog price rule skips conditions specified and applies to all products in the catalog +Fixed: Price rule is applying to individual items in bundle when price is set to Dynamic +Fixed: Impossible to save payment method configurations on the Default Config scope +Fixed: "There has been an error processing your request" message is display if not CSV file was selected to import +Fixed: Wrong reindex product attributes after bundle product save +Fixed: Add Products button absent during creating order from backend +Fixed: "All methods" should be selected by default in configuration section "Allowed Methods" for UPS +Fixed: Redirect to base URL issue +Fixed: Added Backup sorting by name possibility +Fixed: Fix grammar mistakes +Fixed: Notifications are not shown if URL Rewrite used +Fixed: "Stop Further Rules Processing" option doesn't work +Fixed: Admin cannot un-assign product from the tag if already approved tag was added to the product by customer +Fixed: Inaccuracy calculation could be 10% for FedEx International Ground shipping +Fixed: Incorrect price calculation of configurable product with custom options (resolved conflicts) +Fixed: Wrong currency displayed in Recently Viewed Product App +Fixed: Tabs are grayed on admin dashboard +Fixed: JS validation for product weight attribute doesn't work +Fixed: Group Price attribute is present as text field using the mass update action +Fixed: Shopping Cart Price Rule isn't applied to Not Logged In Customers +Fixed: "Sign up for our newsletter" text appearing twice +Fixed: Newsletter problem report grid on backend throws Exception +Fixed: Special price doesn't work for Bundles with Dynamic price +Fixed: My Orders block disappears in My Account pages when Reorder functionality is disabled +Fixed: Search doesn't work in Backups grid +Fixed: Re-index "Catalog URL Rewrites" works extremely slowly +Fixed: Checkbox state is preserved for "Put store on the maintenance mode while rollback processing" +Fixed: UPS Configuration All Methods Should Be Selected by Default +Fixed: Rollback fails if database backup was performed after product import +Fixed: Incorrect behavior with 10-digit Zip code, after creating new Tax Rate +Fixed: Configurable attributes that used for create configurable product should not be applied to that product +Fixed: Default group has to be used if customer selects address without VAT number +Fixed: No ability to create Shopping Cart Price Rule +Fixed: Layout issue appears in IE9 on the export grids +Fixed: Issue when trying to view the order using a specific admin user +Fixed: System messages are not displayed at CMS pages and appears only when another message will be invoked +Fixed: On the frontend Search doesn't work properly if search value is 0 (null) +Fixed: The size of the columns in Backup grid is changed if no records were found +Fixed: Maintenance flag isn't deleted if rollback fails with not enough permissions error +Fixed: Customer's group isn't changed if his billing address modified within backend +Added Add a message and the link in the mini shopping cart, when the cart is empty +Fixed: On Edit Shipping Address page button "Validate VAT Number" should be hidden +Fixed: Fatal error when try to ship order with Flat Rate shipping method +- fixed potentially problematic chaining involved getShippingCarrier method +Fixed: No ability to open PDF file with Label +Fixed: Incorrect final price for configurable products if several custom options used +Fixed: "Length", "Width" and "Height" fields on "Create Packages" pop up are active, when "Documents" type is selected in IE7 and IE9 +Fixed: HTTP 500 error on frontend for bundle fixed with percent options enabled for sub-products +Fixed: Shipment created on Magento side doesn't send to Google side for Merchant Calculated shipping +- added check for process only Google Checkout internal methods +Fixed: PDF files for invoices and credit memos are not displaying Including Tax Price +Fixed: Default value that was specified in system settings doesn't presented in Code Format drop-down on Manage Coupon Codes tab +Fixed: Qty wipes out to 0 when no qty column is included on import +Fixed: Broken controls makeup is observed after resizing window when customer's page is opened on the backend +Fixed: Values don't fit to "Date Fields Order" drop-downs in "Date & Time Custom Options" on the Catalog page +Fixed: Processing error appears for products with "Qty Uses Decimals" = No and enabled DHL International +Fixed: Apply Tax to FPT setting doesn't seem to work for products with Fixed Product Taxes +Fixed: Apply Coupon Code textbox doesn't fit in the Apply Coupon Code channel on the backend after reducing the browser window +Fixed: Tax and Shipping amounts aren't showing on the merchant reports for Websites Payments Pro PayFlow Edition +Fixed: Incorrect error popup on Manage Coupon Codes tab in Shopping Cart Price Rule +Fixed: No ability to create Shipping Label with New DHL shipping methods +Fixed: Indexing update on save takes too long for large catalog_product_entity_int tables +Fixed: VAT ID group validation takes Default configuration on order creation from backend +Fixed: Pagination isn't shown on My Product Reviews page when items count exceeds the "Show per page" setting +Fixed: Inline translation missing for customer account information labels +Fixed: Corrupted text if drag attribute on Manage Attribute Sets page (IE8) +Fixed: Wrong calculation price of Bundle product with Fixed price, when special price is configured +Fixed: Error Message isn't displayed during unsuccessful Shipping Label creation +Fixed: Unverified redirect is possible in Checkout controller +Fixed: Customer group in not validated again on checkout if Tax Calculation Based on = Shipping Address +Fixed: "Clear All" link doesn't work +Fixed: Wrong message appears when products quantity is updated in the Shopping Cart with enabled Qty Increments setting +Fixed: Created On field on Manage Coupon Codes grid shows incorrect date/time +Fixed: Incorrect price calculation of configurable product with custom options +Fixed: Manage Products > Custom options: Should be possible to enter negative price for custom option of 'Date' type +Fixed: HTTP 500 Internal Server Error on Admin Forgot Password page +Fixed: CSV/Excel XML export doesn't work on Sales->Invoices if filter by Selected=Yes is used +Fixed: "Same As Billing Address" check-box doesn't work +Fixed: Impossible to enter zero in the base price field for customer groups +Fixed: Group Price attribute position on the Prices tab is incorrect +Fixed: Add new column to the grid with number of used coupons +Fixed: Custom options are not stored when downloadable product is duplicated +Fixed: Broken logic for "Zero Subtotal Checkout" order statuses +Fixed: Coupon codes generation fails when trying to generate large amount of codes +Fixed: PayFlow Link: Using "Pay with PayPal" and selected shipping method that is greater than 0 doesn't process order +Fixed: User have to stay on Add New Rule page if error appears on save shopping cart price rule +Fixed: "Automatically Invoice All Items" should be inactive, when were selected "New Order Status: Pending" in "Zero Subtotal Checkout" settings +Fixed: When enormous request in search fields on the front end 414 error appears +Fixed: JS error on edit Shopping Cart Price Rule Page +Fixed: Clear Shopping Cart button add selected item to Items Ordered if check box "Add to Order" is selected +Fixed: "Clear Shopping Cart" button must be located to the left to "Update Shopping Cart" button +Fixed: Export of Group Price data doesn't work +Fixed: Incorrect translation messages definitions +Fixed: Error message isn't displayed if currency exchange rate not found (in case with DHL Int) +Fixed: User role with partial access can't edit attributes of configurable products +Fixed: Letter "n" missed in the word "handling" +Fixed: Buttons don't react for pressing on the "Widget Options" section in Insert Widget window +Fixed: Regular price displays incorrect +Fixed: {{base_url}} in (un)secure_url doesn't work since 1.6.1 +Fixed: Product selection field gets cleared out with recently added products from latest page +Fixed: "Change" button while checkout doesn't work +Fixed: MySQL BIGINT field type is wrongly casted to integer +Fixed: Magento Connect Manager proceed with installation of extension if error appears on database backup +Fixed: "Set product as New from/to Date" works excluding selected dates +Fixed: Function fireEvent from lib/varien/js.js does not work in IE9 +Fixed: Searching with first and last name has no results +Fixed: CMS Pages: Error in IE7 when select CMS page +Fixed: White screen appears instead of 404 Error Page when going to review a product which doesn't exist +Fixed: "Maximum Package Weight" option works incorrect in case with decimal Qty in shopping Cart +Fixed: Unable to create tables for new EAV entity via SQL upgrade script +Fixed: Customer group isn't revalidated on checkout if Enable Automatic Assignment to Customer Group = Yes +Fixed: Mistake in PayPal Payments Advanced field set title +Fixed: Zero Subtotal Checkout payment method is used, when it is disabled in settings +Fixed: Some info lost from address when customer sets this address as default for shipping +Fixed: Incorrect calculation logic during distribution products between several pieces (in case with DHL) +Fixed: No ability to get shipping rates from US to another country (in case with DHL) +Fixed: Incorrect calculation of pieces weight (in case with Bundle Product) +Fixed: Product Flat Data index causes replication lag on MySQL master/slave model +Fixed: Exception is shown, when admin user provides filtration of Newsletter problem reports by Subscriber +Fixed: Typo in JavaScript error message +Fixed: Unable to do mass action update for products +Fixed: Error Message isn't displayed if currency exchange rate not found (in case with DHL) +Fixed: Weight field is absent during Quick simple product creation +Fixed: correct helper resolving +Fixed: Shipping methods are shown twice in DHLs shipping quote +Fixed: Unable to translate shipping and billing forms on the order creation page +Fixed: Drop-down attribute with layered navigation filter doesn't work with value is set to 0 +Fixed: Free Shipping options don't work (in case with DHL) +Fixed: Handling Fee doesn't applied Per Package +Fixed: Free Shipping options works incorrect +Fixed: WYSIWYG Editor: It's impossible insert Widget to CMS page content +Fixed: Customer's group is not changed if his billing address modified within backend +Fixed: Wrong behavior and exception while using invalid image +Fixed: Uninformative error message during saving two nodes with the same parameter URL Key +Fixed: Unable to change order addresses in the admin panel +Fixed: PayPal Express always uses default billing address from customer account +Fixed: Unable to place order if customer selects Register on checkout +Fixed: Performance Issue: Most Viewed product reports on large amount of items +Fixed: In "Customer Addresses" block before and after of State name is located symbols "," +Fixed: Lightbox 2.5 with IE7 returns JS error on the page +Fixed: Unable to change customer status (confirmed/not confirmed) when customer logged in +Fixed: Incorrect notification for empty field during creation catalog price rules +Fixed: Unable to save product with non-checked multiple select attribute +Fixed: Package Size setting for DHL +Fixed: No Input Validation for Catalog Fields +Fixed: Row Total Calculation in Refund +Fixed: "Maximum number of price intervals" should be written with capital letters +Fixed: Divide Order Weight options for DHL +Fixed: Impossible to create new customer in the backend +Fixed: Catalog data-upgrade-1.6.0.0.4-1.6.0.0.5.php is extremely slow +Fixed: Mage_Catalog_Helper_Product::getProduct() doesn't load product by its SKU +Fixed: Preview Template doesn't work correctly +Fixed: Some options of Bundle Product disappeared from the Invoice PDF +Fixed: "Allow Countries" affects on "Country of Manufacture" attribute +Fixed: Some phrases are not translated +Fixed: Incorrect Ordered Qty in Order (in case with decimal qty) +Fixed: Trademark character isn't being displayed properly in the PDF invoice +Fixed: Can't search transactions by order_id in manager.paypal.com +Fixed: Inline Translation: Grid headers are displayed incorrect on the Tag Edit page +Fixed: "Create Extension Package" page becomes broken after compilation +Fixed: Price including tax isn't displayed for some kinds of bundle products +Fixed: Layered navigation for prices displays incorrect price ranges in manual mode +Fixed: Pager works wrong with float page number +Fixed: Incorrect foreign key for EAV entity tables +Fixed: Misprint in downloader/lib/Mage/Connect/Command/Install.php +Fixed: URL Rewrites must be case-sensitive +Fixed: Unable to install package via uploader if author name contains dash +Fixed: Invoice subtotals for cases with partial invoice and discount +Fixed: Catalog URL Rewrites works incorrectly on creating categories +Fixed: New Oder Status setting, specified for payment method works incorrectly when only virtual products are present in Order +Fixed: Rounding issue in catalog and product view if price includes tax +Fixed: Wrong status of catalog event is displayed by editing catalog event +Fixed: Role Resources are not saved +Fixed: "Qty for Item's Status to Become Out of Stock" option works incorrect +Fixed: XML parser works incorrect +Fixed: Mage_Reports_Model_Mysql4_Product_Index_Abstract must be declared abstract +Fixed: "Date & Time" and "Time" custom options becomes required when editing product +Fixed: Unable to cancel an order for an expired Authorize.net authorization +Fixed: Custom options are not stored when downloadable product is duplicated +Fixed: "Cannot initialize the indexer process" error during Mass "Reindex Data" Action +Fixed: Search by new attribute fails, attribute is not shown in layered navigation +Fixed: Exception when "Price Navigation Step Calculation" set to "Manual" mode and FPT enabled +Fixed: WPPHS: Cancel URL doesn't work as should be +Fixed: Error about insufficient permissions is not appears on database backup creation +Fixed: After rollback admin doesn't redirected to the Log in to Admin Panel page +Fixed: Database Backup must not include indexer table data +Fixed: Scheduled Backup creation/failure isn't logged +Fixed: Deleting backup while it is used by another process +Fixed: Opening *.tar files causes an error "There are no trailing zero-filled records" +Fixed: Unable to search by "Time" and "No" in Backups table +Fixed: Backups are deleted without confirmation +Fixed: Reports must be excluded from database snapshot backup +Fixed: There are no products in filtering results, if step calculation in automatic mode +Fixed: No validation for "Default Price Navigation Step" +Fixed: "Back" button doesn't work on the Create New Order page +Fixed: Incorrect logic of Token expiration in Two Step Password Reset flow +Fixed: Tag
    is present in tool-tip for field "Number of results (For the last time placed)" on the Edit Search page +Fixed: Unnecessary hard code in Magento Extension +Fixed: Wrong logic in Mage_Core_Model_Resource_Db_Collection_Abstract::join() +Fixed: Description and Short Description are displayed incorrectly for products added with WYSIWYG +Fixed: Adding product to the cart from the product review page leads to 404 page +Fixed: Special symbols in Sort Order field +Fixed: Text is wrong displayed with enabled Inline translation for Admin on backend +Fixed: Inline Translation: Unable to translate some customer information +Fixed: Useless colon on frontend login page +Fixed: Unable to continue checkout for product with zero price and non-zero shipping price +Fixed: Import news_from_date field is configured poorly. It is not accepting the data from file +Fixed: When updating product data through import, attributes that have a value cannot be assigned a new value that is empty +Fixed: Unable to replace non-complex data for products with empty values during import +Fixed: "Wrong order ID" exception in PayPal Express module under heavy load +Fixed: Tax is applying on the order when creating it in the admin panel for a Customer Group with no taxes +Fixed: Issue with retrieving order statuses for array of states +Fixed: Wrong calculation product price with custom option type = Field and Fixed price +Fixed: Back ordered downloadable product is not available even when it is set to be be accessible when order status is Pending +Fixed: Missing column "position" at table catalog_category_anc_products_index_tmp +Fixed: Incorrect behavior of "Save in address book" option during admin Order creation for a new customer +- refactored Mage_Adminhtml_Model_Sales_Order_Create::_prepareCustomer() +Fixed: Terms and Conditions is named differently on different pages +Fixed: "Apply" and "Discount Amount" fields appear twice in the Catalog Price Rule +Fixed: Poll shows incorrect percentage +Fixed: Added validation ability for admin configuration forms +Fixed: UPS XML misprint +Fixed: Misprint in uploading files form +Fixed: Unnecessary check boxes for gift options +Fixed: Wrong resource section declaration in Mage_Tag module +Fixed: "Customers Submitted this Tag" section doesn't update when customer has deleted tag from his account +Fixed: Correct product in category position +Fixed: Unable to create folder in Media Storage +Fixed: Translation with single quotes breaks JavaScript +Fixed: Out of memory error with hundreds of thousands of coupons attached to a single sales rule +Fixed: Unable to translate buttons and tabs on the "Manage Category" page +Fixed: Product Categories Tree doesn't expand in Manage Products page +Fixed: Incorrect products qty returns to stock after refund for configurable product +Fixed: Swf Uploader problems with cross domain Flash Player Policy +Fixed: Unable to translate "Layout Updates" block on create/edit widget page +Fixed: IE7: "Remember Me" checkbox visible on billing information step +Fixed: CMS WYSIWYG Editor - widget is inserted as new while editing in IE8 +Fixed: Currency code doesn't correspond to the amount in reports +Fixed: Mage_Adminhtml_Block_Sales_Order_View_Tab_History::getFullHistory() doesn't use unique keys for each message +Fixed: Scope labels are shown without translate wrapper +Fixed: Wrong parameters handling in Core Helper formatDate() +Fixed: Apostrophe in store name breaks Google Analytics tracking +Fixed: Customer attribute prefix is not shown on frontend +Fixed: Incorrect rounding for product with custom options (percent price) +Fixed: Invoicing only part of products results in wrong totals calculation +Fixed: Incorrect Row Total Calculation in Refund +- fixed rounding issues for partial Invoice and Refund +- refactored delta rounding +Fixed: Filter by "Allow Countries" not working for Customer Address Form in the backend +- checking added for set country to be in available list +Fixed: There are sql-installs with empty string used as defaults for table columns, while column is not null able +Fixed: Unable to translate "Note" in "Product Stock Options" +Fixed: Various warning are displayed after creating shipment for 0 items +Fixed: Invalid content in Content-header in the top of page during scrolling during order creation +Fixed: "Online invoice" button present in backend when using Zero Subtotal Checkout +Fixed: String cast type in in_array function +Fixed: Newsletter template content should not disappear when "Show" / "Hide Editor" button was clicked +Fixed: Import feature doesn't validate whether super_products_sku is existing or not +Fixed: Cannot place order with downloadable product and discount code using Paypal Express payment method +Fixed: Product still out of stock after Stock Status reindex +Fixed: Save catalog price rule gives trace if full reindex has already started +Fixed: Reindex requires notification is not shown for Stock Status when stock is updated for several products using Mass Action +Fixed: Incorrect FedEx's shipping rates (in case with non-US country origin) +Fixed: After partial reindex MSRP value is not applied (not viewed) in catalog during mass update action +Fixed: Wrong stock reindex on catalog if partial reindex done after full reindex started +Fixed: In error message string "already exists." written twice, when trying to save Product Tax Class with the same name +Fixed: Slow checkout with non-flushed cache +Fixed: Bundle product total is incorrect in Customization block +Fixed: Special price isn't considered for bundle dynamic products in "Your Customization" block +Fixed: Situation when any amount of duplicate reindex process can be running at one time +Fixed: Error with Advanced Search (in case with Date Attribute) +Fixed: Product Flat Data index isn't marked as "Reindex Required" after importing products when Flat Catalog is enabled +Fixed: User can't change root category for the store +Fixed: JS error causes the overwrite of Title field in PayPal Advanced configuration +Fixed: Mass action doesn't partially reindex catalog for product name/description +Fixed: Remove hint about $1 auth amount from informational message text (PayflowLink configuration) +Fixed: Mass action doesn't partially reindex catalog for product prices +Fixed: PayPal Payments Advanced works with $0 Auth instead of Full Auth +Fixed: Impossible to place Order using "Pay with PayPal" button from PayPal Payments Advanced iframe +Fixed: Mass action doesn't partially reindex catalog search for product if searchable attribute was updated +Fixed: "Please wait" AJAX screen doesn't appear in the middle of the page +Fixed: Checkout link on frontend is always referenced as http +Fixed: GET request is incorrectly formed during category creation +- adjusted assertion to determine last viewed store +Fixed: Display of Tier Pricing with Configurable Products +- added functionality to dynamically update tier prices accordingly to chosen product configuration +Fixed: Google Analytics e-commerce tracking not working +Fixed: URL key isn't used when product is saved +Fixed: Added validation class to 'Qty increments' +Fixed: Entered from admin customer date 1970 (or less) is saved as 2070 (or less) +Fixed: cUrl resource must be closed after checking it for errors, not before +Fixed: Exception while products mass update attributes in backend +Fixed: No ability to reindex Catalog URL Rewrites, error is shown +Fixed: Package with Core dependency +Fixed: Stock Availability isn't updated if 1: Run Price Reindex 2: Update Stock Availability on product with mass action/single product +Fixed: Blank page instead shopping cart page when compilation and PSC are enabled +Fixed: Unable to save redirect URL with special characters in search terms +Fixed: Attribute Set field should have client-side validation and appropriate information message +Fixed: "Localhost" isn't a valid domain name for installation +Fixed: Iframe for PayPal Payments Advanced is not loaded +Fixed: Retain the selected tab on editing CMS page +Fixed: Payflow Link Express Checkout (pay with PayPal button) payment +Fixed: Wrong number of reindex options is displayed +Fixed: Wrong phpDocs for Varien_Db_Select +Fixed: JavaScript calendar date range +- fixed JS calendar behavior to use 4-digits year format +Fixed: Performance issue connected with sales rules on adding product to cart +Fixed: DHL same error message appears several times +Fixed: Item Status says "Mixed" when an order has been completed, should say "Shipped" +Fixed: Product option title is absent in backend order page +Fixed: Incorrect items number during multi shipping checkout +Fixed: User name displays differently in the unsuccessful message and in the text field label (log in form) +Fixed: If one or more indexers have Update Required = Yes and all Status = READY for all indexers than there is no notification for user to do reindex action +Fixed: No space between Address line 1 and line 2 in Shipping Label (in case with FedEx) +Fixed: JS works depends on the position attributes of the product +Fixed: Char set encoding is out-of-date in Settlement reports +Fixed: Settlement reports can't be downloaded if in merchant's account 'Settlement file' is set to 6.0 version +Fixed: Unable to login when secure and unsecure URLs are different +Fixed: Customer session lost when using different domain/subdomain names for secure and unsecure URLs +Fixed: "Most Viewed" reports ignore Store View switcher +Fixed: Long FPT name (and product name) doesn't fit into "My cart" block +Fixed: Paypal IPN post back failure +Fixed: Customer was unable to receive newsletters when it was created via backend +Fixed: Wrong Comments History in notification of order creation/cancellation +Fixed: Non escaped string causes javascript error +Fixed: Unable to view pictures during product editing +Fixed: Ampersand is saved incorrect in attribute label +Fixed: IE8: JS error appears after pressing 'Add new rule' in catalog price rules menu +Fixed: Exception after sorting newsletter queue +Fixed: Customer is not able to log in from URL without "www" in some cases +Fixed: SQL error on category view with enabled and configured FPT +Fixed: Automatic reindexing based on matched events doesn't change "Status" and "Last Run" columns at process list grid +Fixed: Performance issue with Magento Compiler + APC results in too many I/O calls +Fixed: Website Administrator is able to change default values +Fixed: Some of wishlist blocks and templates still treat the collection of wishlist items as collection of products +Fixed: Unnecessary comments in "Share Wishlist" email + + + ==== 1.7.0.0-rc1 ==== === Major Highlights === @@ -27,7 +612,7 @@ Provided logic to disable ACL resources through configuration files Added additional placeholders for extensions developers === Changes === -Added "Cache On Delivery" and "Bank Transfer" payment methods +Added "Cash On Delivery" and "Bank Transfer" payment methods Support for "memcached" PHP extension was added Library js/scriptaculous/dragdrop.js is upgraded to version 1.9.0 Image file of "jpg" type are allowed for favicon @@ -1364,7 +1949,6 @@ Fixed Import feature doesn't validate whether super_products_sku is existing or - ==== 1.6.x-devel-131783 ==== === Major Highlights === diff --git a/app/Mage.php b/app/Mage.php index 8736004b52..3dafad03a4 100644 --- a/app/Mage.php +++ b/app/Mage.php @@ -171,8 +171,8 @@ public static function getVersionInfo() 'minor' => '7', 'revision' => '0', 'patch' => '0', - 'stability' => 'rc', - 'number' => '1', + 'stability' => '', + 'number' => '', ); } diff --git a/app/code/core/Mage/Admin/sql/admin_setup/mysql4-upgrade-1.6.0.0-1.6.1.0.php b/app/code/core/Mage/Admin/sql/admin_setup/upgrade-1.6.0.0-1.6.1.0.php similarity index 100% rename from app/code/core/Mage/Admin/sql/admin_setup/mysql4-upgrade-1.6.0.0-1.6.1.0.php rename to app/code/core/Mage/Admin/sql/admin_setup/upgrade-1.6.0.0-1.6.1.0.php diff --git a/app/code/core/Mage/AdminNotification/Model/Resource/Inbox.php b/app/code/core/Mage/AdminNotification/Model/Resource/Inbox.php index 1ddb1b2f54..5c75cec142 100755 --- a/app/code/core/Mage/AdminNotification/Model/Resource/Inbox.php +++ b/app/code/core/Mage/AdminNotification/Model/Resource/Inbox.php @@ -101,7 +101,13 @@ public function parse(Mage_AdminNotification_Model_Inbox $object, array $data) foreach ($data as $item) { $select = $adapter->select() ->from($this->getMainTable()) - ->where('url=?', $item['url']); + ->where('title = ?', $item['title']); + + if (empty($item['url'])) { + $select->where('url IS NULL'); + } else { + $select->where('url = ?', $item['url']); + } if (isset($item['internal'])) { $row = false; diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Form/Renderer/Fieldset/Element.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Form/Renderer/Fieldset/Element.php index 33de152188..bd7bf96474 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Form/Renderer/Fieldset/Element.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Form/Renderer/Fieldset/Element.php @@ -160,7 +160,7 @@ public function getElementLabelHtml() { $element = $this->getElement(); $label = $element->getLabel(); - if (empty($label)) { + if (!empty($label)) { $element->setLabel($this->__($label)); } return $element->getLabelHtml(); diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Shipping.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Shipping.php index b4be25c478..f014593d32 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Shipping.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Shipping.php @@ -30,12 +30,13 @@ * @author Magento Core Team */ -class Mage_Adminhtml_Block_Sales_Order_Create_Totals_Shipping extends Mage_Adminhtml_Block_Sales_Order_Create_Totals_Default +class Mage_Adminhtml_Block_Sales_Order_Create_Totals_Shipping + extends Mage_Adminhtml_Block_Sales_Order_Create_Totals_Default { protected $_template = 'sales/order/create/totals/shipping.phtml'; /** - * Check if we need display shipping include and exlude tax + * Check if we need display shipping include and exclude tax * * @return bool */ @@ -82,7 +83,7 @@ public function getShippingExcludeTax() */ public function getIncludeTaxLabel() { - return $this->helper('tax')->__('Shipping Incl. Tax (%s)', $this->getTotal()->getAddress()->getShippingDescription()); + return $this->helper('tax')->__('Shipping Incl. Tax (%s)', $this->escapeHtml($this->getTotal()->getAddress()->getShippingDescription())); } /** @@ -92,6 +93,6 @@ public function getIncludeTaxLabel() */ public function getExcludeTaxLabel() { - return $this->helper('tax')->__('Shipping Excl. Tax (%s)', $this->getTotal()->getAddress()->getShippingDescription()); + return $this->helper('tax')->__('Shipping Excl. Tax (%s)', $this->escapeHtml($this->getTotal()->getAddress()->getShippingDescription())); } } diff --git a/app/code/core/Mage/Adminhtml/controllers/Customer/GroupController.php b/app/code/core/Mage/Adminhtml/controllers/Customer/GroupController.php index 9f3eec68ea..2b0716ab12 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Customer/GroupController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Customer/GroupController.php @@ -102,14 +102,20 @@ public function saveAction() $customerGroup = Mage::getModel('customer/group'); $id = $this->getRequest()->getParam('id'); if (!is_null($id)) { - $customerGroup->load($id); + $customerGroup->load((int)$id); } - if ($taxClass = $this->getRequest()->getParam('tax_class')) { + $taxClass = (int)$this->getRequest()->getParam('tax_class'); + + if ($taxClass) { try { - $customerGroup->setCode($this->getRequest()->getParam('code')) - ->setTaxClassId($taxClass) - ->save(); + $customerGroupCode = (string)$this->getRequest()->getParam('code'); + + if (!empty($customerGroupCode)) { + $customerGroup->setCode($customerGroupCode); + } + + $customerGroup->setTaxClassId($taxClass)->save(); Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('customer')->__('The customer group has been saved.')); $this->getResponse()->setRedirect($this->getUrl('*/customer_group')); return; @@ -122,7 +128,6 @@ public function saveAction() } else { $this->_forward('new'); } - } /** diff --git a/app/code/core/Mage/Adminhtml/controllers/Permissions/UserController.php b/app/code/core/Mage/Adminhtml/controllers/Permissions/UserController.php index d2051269b2..b1cacfccae 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Permissions/UserController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Permissions/UserController.php @@ -87,19 +87,11 @@ public function editAction() $breadcrumb = $this->__('New User'); } $this->_initAction() - ->_addBreadcrumb($breadcrumb, $breadcrumb) - ->_addContent( - $this->getLayout() - ->createBlock('adminhtml/permissions_user_edit') - ->setData('action', $this->getUrl('*/permissions_user/save')) - ) - ->_addLeft($this->getLayout()->createBlock('adminhtml/permissions_user_edit_tabs')); - - $this->_addJs( - $this->getLayout() - ->createBlock('adminhtml/template') - ->setTemplate('permissions/user_roles_grid_js.phtml') - ); + ->_addBreadcrumb($breadcrumb, $breadcrumb); + + $this->getLayout()->getBlock('adminhtml.permissions.user.edit') + ->setData('action', $this->getUrl('*/permissions_user/save')); + $this->renderLayout(); } diff --git a/app/code/core/Mage/Api/Model/Server/Adapter/Soap.php b/app/code/core/Mage/Api/Model/Server/Adapter/Soap.php index abc69335bf..627bdd8f1c 100644 --- a/app/code/core/Mage/Api/Model/Server/Adapter/Soap.php +++ b/app/code/core/Mage/Api/Model/Server/Adapter/Soap.php @@ -64,7 +64,7 @@ public function getHandler() return $this->getData('handler'); } - /** + /** * Set webservice api controller * * @param Mage_Api_Controller_Action $controller @@ -103,12 +103,11 @@ public function getController() */ public function run() { - $apiConfigCharset = Mage::getStoreConfig("api/config/charset"); if ($this->getController()->getRequest()->getParam('wsdl') !== null) { // Generating wsdl content from template - $io = new Varien_Io_File(); + $io = new Varien_Io_File(); $io->open(array('path'=>Mage::getModuleDir('etc', 'Mage_Api'))); $wsdlContent = $io->read('wsdl.xml'); @@ -121,14 +120,11 @@ public function run() unset($queryParams['wsdl']); } - $wsdlConfig->setUrl( - htmlspecialchars(Mage::getUrl('*/*/*', array('_query'=>$queryParams) )) - ); + $wsdlConfig->setUrl(htmlspecialchars(Mage::getUrl('*/*/*', array('_query'=>$queryParams)))); $wsdlConfig->setName('Magento'); $wsdlConfig->setHandler($this->getHandler()); - $template->setVariables(array('wsdl'=>$wsdlConfig)); - + $template->setVariables(array('wsdl' => $wsdlConfig)); $this->getController()->getResponse() ->clearHeaders() @@ -188,9 +184,9 @@ public function fault($code, $message) } /** - * Check whether Soap extension is loaded + * Check whether Soap extension is loaded * - * @return boolean + * @return boolean */ protected function _extensionLoaded() { @@ -206,18 +202,18 @@ protected function _extensionLoaded() protected function getWsdlUrl($params = null, $withAuth = true) { $urlModel = Mage::getModel('core/url') - ->setUseSession(false); + ->setUseSession(false); $wsdlUrl = $params !== null - ? $urlModel->getUrl('*/*/*', array('_current' => true, '_query' => $params)) - : $urlModel->getUrl('*/*/*'); + ? $urlModel->getUrl('*/*/*', array('_current' => true, '_query' => $params)) + : $urlModel->getUrl('*/*/*'); if( $withAuth ) { $phpAuthUser = $this->getController()->getRequest()->getServer('PHP_AUTH_USER', false); $phpAuthPw = $this->getController()->getRequest()->getServer('PHP_AUTH_PW', false); if ($phpAuthUser && $phpAuthPw) { - $wsdlUrl = sprintf("http://%s:%s@%s", $phpAuthUser, $phpAuthPw, str_replace('http://', '', $wsdlUrl ) ); + $wsdlUrl = sprintf("http://%s:%s@%s", $phpAuthUser, $phpAuthPw, str_replace('http://', '', $wsdlUrl )); } } @@ -233,24 +229,31 @@ protected function getWsdlUrl($params = null, $withAuth = true) protected function _instantiateServer() { $apiConfigCharset = Mage::getStoreConfig('api/config/charset'); - ini_set('soap.wsdl_cache_enabled', '0'); + $wsdlCacheEnabled = (bool) Mage::getStoreConfig('api/config/wsdl_cache_enabled'); + + if ($wsdlCacheEnabled) { + ini_set('soap.wsdl_cache_enabled', '1'); + } else { + ini_set('soap.wsdl_cache_enabled', '0'); + } + $tries = 0; do { $retry = false; try { - $this->_soap = new Zend_Soap_Server( - $this->getWsdlUrl(array("wsdl" => 1)), array('encoding' => $apiConfigCharset) - ); + $this->_soap = new Zend_Soap_Server($this->getWsdlUrl(array("wsdl" => 1)), + array('encoding' => $apiConfigCharset)); } catch (SoapFault $e) { - $importMessage = "can't import schema from 'http://schemas.xmlsoap.org/soap/encoding/'"; - if (false !== strpos($e->getMessage(), $importMessage)) { + if (false !== strpos($e->getMessage(), + "can't import schema from 'http://schemas.xmlsoap.org/soap/encoding/'") + ) { $retry = true; sleep(1); } else { throw $e; } $tries++; - } + } } while ($retry && $tries < 5); use_soap_error_handler(false); $this->_soap diff --git a/app/code/core/Mage/Api/etc/config.xml b/app/code/core/Mage/Api/etc/config.xml index 695d6d6ae9..eceac462b9 100644 --- a/app/code/core/Mage/Api/etc/config.xml +++ b/app/code/core/Mage/Api/etc/config.xml @@ -123,6 +123,7 @@ UTF-8 3600 0 + 0 diff --git a/app/code/core/Mage/Api/etc/system.xml b/app/code/core/Mage/Api/etc/system.xml index 6e37ba6db0..0e1a2e80f5 100644 --- a/app/code/core/Mage/Api/etc/system.xml +++ b/app/code/core/Mage/Api/etc/system.xml @@ -70,6 +70,16 @@ 1 1 + + + select + adminhtml/system_config_source_yesno + adminhtml/system_config_backend_store + 40 + 1 + 1 + 1 + diff --git a/app/code/core/Mage/Api2/Block/Adminhtml/Attribute/Edit/Form.php b/app/code/core/Mage/Api2/Block/Adminhtml/Attribute/Edit/Form.php index b917c9340f..29973a1d7a 100644 --- a/app/code/core/Mage/Api2/Block/Adminhtml/Attribute/Edit/Form.php +++ b/app/code/core/Mage/Api2/Block/Adminhtml/Attribute/Edit/Form.php @@ -26,10 +26,10 @@ /** - * OAuth consumer edit form block + * Attribute edit form block * * @category Mage - * @package Mage_OAuth + * @package Mage_Api2 * @author Magento Core Team */ class Mage_Api2_Block_Adminhtml_Attribute_Edit_Form extends Mage_Adminhtml_Block_Widget_Form diff --git a/app/code/core/Mage/Api2/Block/Adminhtml/Roles.php b/app/code/core/Mage/Api2/Block/Adminhtml/Roles.php index 3e69348fd6..40cbd00050 100644 --- a/app/code/core/Mage/Api2/Block/Adminhtml/Roles.php +++ b/app/code/core/Mage/Api2/Block/Adminhtml/Roles.php @@ -25,10 +25,10 @@ */ /** - * OAuth consumers grid container block + * Roles grid container block * * @category Mage - * @package Mage_OAuth + * @package Mage_Api2 * @author Magento Core Team */ class Mage_Api2_Block_Adminhtml_Roles extends Mage_Adminhtml_Block_Widget_Grid_Container diff --git a/app/code/core/Mage/Api2/Block/Adminhtml/Roles/Grid.php b/app/code/core/Mage/Api2/Block/Adminhtml/Roles/Grid.php index 0807b6b9a2..c920b856c4 100644 --- a/app/code/core/Mage/Api2/Block/Adminhtml/Roles/Grid.php +++ b/app/code/core/Mage/Api2/Block/Adminhtml/Roles/Grid.php @@ -25,10 +25,10 @@ */ /** - * OAuth Consumer grid block + * Roles grid block * * @category Mage - * @package Mage_OAuth + * @package Mage_Api2 * @author Magento Core Team */ class Mage_Api2_Block_Adminhtml_Roles_Grid extends Mage_Adminhtml_Block_Widget_Grid @@ -126,7 +126,7 @@ public function getRowUrl($row) * Decorate 'User Type' column * * @param string $renderedValue Rendered value - * @param Mage_OAuth_Model_Token $row + * @param Mage_Api2_Model_Acl_Global_Role $row * @param Mage_Adminhtml_Block_Widget_Grid_Column $column * @param bool $isExport * @return string diff --git a/app/code/core/Mage/Api2/Model/Auth/Adapter/Oauth.php b/app/code/core/Mage/Api2/Model/Auth/Adapter/Oauth.php index c8a437bb26..feccb16ab9 100644 --- a/app/code/core/Mage/Api2/Model/Auth/Adapter/Oauth.php +++ b/app/code/core/Mage/Api2/Model/Auth/Adapter/Oauth.php @@ -43,15 +43,15 @@ class Mage_Api2_Model_Auth_Adapter_Oauth extends Mage_Api2_Model_Auth_Adapter_Ab */ public function getUserParams(Mage_Api2_Model_Request $request) { - /** @var $oauthServer Mage_OAuth_Model_Server */ - $oauthServer = Mage::getModel('oAuth/server', $request); + /** @var $oauthServer Mage_Oauth_Model_Server */ + $oauthServer = Mage::getModel('oauth/server', $request); $userParamsObj = (object) array('type' => null, 'id' => null); try { $token = $oauthServer->checkAccessRequest(); $userType = $token->getUserType(); - if (Mage_OAuth_Model_Token::USER_TYPE_ADMIN == $userType) { + if (Mage_Oauth_Model_Token::USER_TYPE_ADMIN == $userType) { $userParamsObj->id = $token->getAdminId(); } else { $userParamsObj->id = $token->getCustomerId(); diff --git a/app/code/core/Mage/Api2/Model/Config.php b/app/code/core/Mage/Api2/Model/Config.php index 89048609cc..76655459e1 100644 --- a/app/code/core/Mage/Api2/Model/Config.php +++ b/app/code/core/Mage/Api2/Model/Config.php @@ -232,7 +232,7 @@ public function getResource($node) public function getResourceAttributes($node) { $attributes = $this->getNode('resources/' . $node . '/attributes'); - return $attributes ? (array) $attributes : array(); + return $attributes ? $attributes->asCanonicalArray() : array(); } /** @@ -385,7 +385,7 @@ public function getResourceModel($node) public function getResourceUserPrivileges($resource, $userType) { $attributes = $this->getNode('resources/' . $resource . '/privileges/' . $userType); - return $attributes ? (array)$attributes : array(); + return $attributes ? $attributes->asCanonicalArray() : array(); } /** @@ -397,7 +397,7 @@ public function getResourceUserPrivileges($resource, $userType) public function getResourceSubresources($node) { $subresources = $this->getNode('resources/' . $node . '/subresources'); - return $subresources ? (array)$subresources : array(); + return $subresources ? $subresources->asCanonicalArray() : array(); } /** @@ -410,7 +410,7 @@ public function getResourceSubresources($node) public function getValidationConfig($resourceType, $validatorType) { $config = $this->getNode('resources/' . $resourceType . '/validators/' . $validatorType); - return $config ? $config->asArray() : array(); + return $config ? $config->asCanonicalArray() : array(); } /** diff --git a/app/code/core/Mage/Api2/Model/Resource/Validator/Eav.php b/app/code/core/Mage/Api2/Model/Resource/Validator/Eav.php index 91fac69963..36d0c8ff9a 100644 --- a/app/code/core/Mage/Api2/Model/Resource/Validator/Eav.php +++ b/app/code/core/Mage/Api2/Model/Resource/Validator/Eav.php @@ -118,6 +118,47 @@ public function __construct($options) ->ignoreInvisible(false); } + /** + * Validate attribute value for attributes with source models + * + * @param Mage_Eav_Model_Entity_Attribute_Abstract $attribute + * @param mixed $attrValue + * @return array|bool + */ + protected function _validateAttributeWithSource(Mage_Eav_Model_Entity_Attribute_Abstract $attribute, $attrValue) + { + $errors = array(); + + // validate attributes with source models + if (null !== $attrValue && $attribute->getSourceModel()) { + if ('multiselect' !== $attribute->getFrontendInput() && is_array($attrValue)) { + return array('Invalid value type for ' . $attribute->getAttributeCode()); + } + $possibleValues = $attribute->getSource()->getAllOptions(false); + + foreach ((array) $attrValue as $value) { + if (is_scalar($value)) { + $value = (string) $value; + $isValid = false; + foreach ($possibleValues as $optionData) { + // comparison without types check is performed only when both values are numeric + $useStrictMode = !(is_numeric($value) && is_numeric($optionData['value'])); + $isValid = $useStrictMode ? $value === $optionData['value'] : $value == $optionData['value']; + if ($isValid) { + break; + } + } + if (!$isValid) { + $errors[] = 'Invalid value "' . $value . '" for '. $attribute->getAttributeCode(); + } + } else { + $errors[] = 'Invalid value type for ' . $attribute->getAttributeCode(); + } + } + } + return $errors ? $errors : true; + } + /** * Filter request data. * @@ -151,22 +192,58 @@ public function isValidData(array $data, $partial = false) if ($this->_eavForm->ignoreInvisible() && !$attribute->getIsVisible()) { continue; } - if (!isset($data[$attribute->getAttributeCode()])) { - $data[$attribute->getAttributeCode()] = null; - } + $attrValue = isset($data[$attribute->getAttributeCode()]) ? $data[$attribute->getAttributeCode()] : null; $result = Mage_Eav_Model_Attribute_Data::factory($attribute, $this->_eavForm->getEntity()) - ->setExtractedData($data)->validateValue($data[$attribute->getAttributeCode()]); + ->setExtractedData($data) + ->validateValue($attrValue); + if ($result !== true) { $errors = array_merge($errors, $result); + } else { + $result = $this->_validateAttributeWithSource($attribute, $attrValue); + + if (true !== $result) { + $errors = array_merge($errors, $result); + } } } + $this->_setErrors($errors); - if (count($errors)) { - $this->_setErrors($errors); - return false; - } + return $errors ? false : true; + } - return true; + /** + * Returns an array of errors + * + * @return array + */ + public function getErrors() + { + // business asked to avoid additional validation message, so we filter it here + $errors = array(); + $helper = Mage::helper('eav'); + $requiredAttrs = array(); + $isRequiredRE = '/^' . str_replace('%s', '(.+)', preg_quote($helper->__('"%s" is a required value.'))). '$/'; + $greaterThanRE = '/^' . str_replace( + '%s', '(.+)', preg_quote($helper->__('"%s" length must be equal or greater than %s characters.')) + ) . '$/'; + + // find all required attributes labels + foreach ($this->_errors as $error) { + if (preg_match($isRequiredRE, $error, $matches)) { + $requiredAttrs[$matches[1]] = true; + } + } + // exclude additional messages for required attributes been failed + foreach ($this->_errors as $error) { + if (preg_match($isRequiredRE, $error) + || !preg_match($greaterThanRE, $error, $matches) + || !isset($requiredAttrs[$matches[1]]) + ) { + $errors[] = $error; + } + } + return $errors; } } diff --git a/app/code/core/Mage/Bundle/Model/Product/Type.php b/app/code/core/Mage/Bundle/Model/Product/Type.php index 04a37b8a71..2f718961d9 100644 --- a/app/code/core/Mage/Bundle/Model/Product/Type.php +++ b/app/code/core/Mage/Bundle/Model/Product/Type.php @@ -901,16 +901,6 @@ public function getForceChildItemQtyChanges($product = null) return true; } - /** - * Force apply discount for parent item - * - * @return bool - */ - public function getForceApplyDiscountToParentItem() - { - return true; - } - /** * Retrieve additional searchable data from type instance * Using based on product id and store_id data diff --git a/app/code/core/Mage/Captcha/Block/Captcha/Zend.php b/app/code/core/Mage/Captcha/Block/Captcha/Zend.php index cb17ea6d9b..31b03f6257 100755 --- a/app/code/core/Mage/Captcha/Block/Captcha/Zend.php +++ b/app/code/core/Mage/Captcha/Block/Captcha/Zend.php @@ -57,12 +57,9 @@ public function getTemplate() */ public function getRefreshUrl() { - $isSecure = Mage::app()->getStore()->isAdmin() - ? Mage::app()->getStore()->isAdminUrlSecure() - : Mage::getConfig()->shouldUrlBeSecure(Mage::app()->getRequest()->getPathInfo()); return Mage::getUrl( Mage::app()->getStore()->isAdmin() ? 'adminhtml/refresh/refresh' : 'captcha/refresh', - array('_secure' => $isSecure) + array('_secure' => Mage::app()->getStore()->isCurrentlySecure()) ); } diff --git a/app/code/core/Mage/Catalog/Model/Api2/Product/Image/Rest.php b/app/code/core/Mage/Catalog/Model/Api2/Product/Image/Rest.php index badc3d7b75..850fa6cfd9 100644 --- a/app/code/core/Mage/Catalog/Model/Api2/Product/Image/Rest.php +++ b/app/code/core/Mage/Catalog/Model/Api2/Product/Image/Rest.php @@ -44,6 +44,7 @@ abstract class Mage_Catalog_Model_Api2_Product_Image_Rest extends Mage_Catalog_M * @var array */ protected $_mimeTypes = array( + 'image/jpg' => 'jpg', 'image/jpeg' => 'jpg', 'image/gif' => 'gif', 'image/png' => 'png' diff --git a/app/code/core/Mage/Catalog/Model/Api2/Product/Image/Rest/Admin/V1.php b/app/code/core/Mage/Catalog/Model/Api2/Product/Image/Rest/Admin/V1.php index e0c3a82762..9109796eba 100644 --- a/app/code/core/Mage/Catalog/Model/Api2/Product/Image/Rest/Admin/V1.php +++ b/app/code/core/Mage/Catalog/Model/Api2/Product/Image/Rest/Admin/V1.php @@ -75,7 +75,8 @@ protected function _create(array $data) $this->_critical($e->getMessage(), Mage_Api2_Model_Server::HTTP_INTERNAL_ERROR); } $product = $this->_getProduct(); - $imageFileUri = $this->_getMediaGallery()->addImage($product, $apiTempDir . DS . $imageFileName); + $imageFileUri = $this->_getMediaGallery() + ->addImage($product, $apiTempDir . DS . $imageFileName, null, false, false); $ioAdapter->rmdir($apiTempDir, true); // updateImage() must be called to add image data that is missing after addImage() call $this->_getMediaGallery()->updateImage($product, $imageFileUri, $data); diff --git a/app/code/core/Mage/Catalog/Model/Api2/Product/Rest.php b/app/code/core/Mage/Catalog/Model/Api2/Product/Rest.php index 3f7168d8f4..59d3cae02c 100644 --- a/app/code/core/Mage/Catalog/Model/Api2/Product/Rest.php +++ b/app/code/core/Mage/Catalog/Model/Api2/Product/Rest.php @@ -73,7 +73,7 @@ protected function _retrieveCollection() ->addPriceData($this->_getCustomerGroupId(), $store->getWebsiteId()) ->addAttributeToSelect(array_diff($availableAttributes, $entityOnlyAttributes)) ->addAttributeToFilter('visibility', array( - 'neq' => Mage_Catalog_Model_Product_Visibility::VISIBILITY_NOT_VISIBLE)) + 'neq' => Mage_Catalog_Model_Product_Visibility::VISIBILITY_NOT_VISIBLE)) ->addAttributeToFilter('status', array('eq' => Mage_Catalog_Model_Product_Status::STATUS_ENABLED)); $this->_applyCategoryFilter($collection); $this->_applyCollectionModifiers($collection); @@ -125,7 +125,7 @@ protected function _prepareProductForResponse(Mage_Catalog_Model_Product $produc $productData['final_price_without_tax'] = $this->_applyTaxToPrice($finalPrice, false); $productData['is_saleable'] = $product->getIsSalable(); - $productData['image_url'] = (string) Mage::helper('catalog/image')->init($product, 'image'); + $productData['image_url'] = (string)Mage::helper('catalog/image')->init($product, 'image'); if ($this->getActionType() == self::ACTION_TYPE_ENTITY) { // define URLs @@ -201,7 +201,7 @@ protected function _getProduct() $this->_critical(self::RESOURCE_NOT_FOUND); } // check if product belongs to website current - if ($this->getRequest()->getParam('store')) { + if ($this->_getStore()->getId()) { $isValidWebsite = in_array($this->_getStore()->getWebsiteId(), $product->getWebsiteIds()); if (!$isValidWebsite) { $this->_critical(self::RESOURCE_NOT_FOUND); @@ -211,7 +211,8 @@ protected function _getProduct() if ($this->getApiUser()->getType() != Mage_Api2_Model_Auth_User_Admin::USER_TYPE) { // check if product assigned to any website and can be shown if ((!Mage::app()->isSingleStoreMode() && !count($product->getWebsiteIds())) - || !$productHelper->canShow($product)) { + || !$productHelper->canShow($product) + ) { $this->_critical(self::RESOURCE_NOT_FOUND); } } @@ -254,8 +255,9 @@ protected function _getCategoryById($categoryId) * @see Mage_Tax_Helper_Data::getPrice() */ protected function _getPrice($price, $includingTax = null, $shippingAddress = null, - $billingAddress = null, $ctc = null, $priceIncludesTax = null - ) { + $billingAddress = null, $ctc = null, $priceIncludesTax = null + ) + { $product = $this->_getProduct(); $store = $this->_getStore(); diff --git a/app/code/core/Mage/Catalog/Model/Api2/Product/Rest/Admin/V1.php b/app/code/core/Mage/Catalog/Model/Api2/Product/Rest/Admin/V1.php index 8d2dffa3b4..03e48edf18 100644 --- a/app/code/core/Mage/Catalog/Model/Api2/Product/Rest/Admin/V1.php +++ b/app/code/core/Mage/Catalog/Model/Api2/Product/Rest/Admin/V1.php @@ -160,6 +160,11 @@ protected function _create(array $data) ->setTypeId($type) ->setSku($sku); + foreach ($product->getMediaAttributes() as $mediaAttribute) { + $mediaAttrCode = $mediaAttribute->getAttributeCode(); + $product->setData($mediaAttrCode, 'no_selection'); + } + $this->_prepareDataForSave($product, $data); try { $product->validate(); @@ -201,6 +206,9 @@ protected function _update(array $data) if (isset($data['sku'])) { $product->setSku($data['sku']); } + // attribute set and product type cannot be updated + unset($data['attribute_set_id']); + unset($data['type_id']); $this->_prepareDataForSave($product, $data); try { $product->validate(); @@ -276,13 +284,13 @@ protected function _prepareDataForSave($product, $productData) } } if (isset($productData['use_config_gift_wrapping_available'])) { - $product->setData('use_config_gift_wrapping_available', - $productData['use_config_gift_wrapping_available']); + $product->setData('use_config_gift_wrapping_available', $productData['use_config_gift_wrapping_available']); if (!$productData['use_config_gift_wrapping_available'] && ($product->getData('gift_wrapping_available') === null) ) { - $product->setData('gift_wrapping_available', (int) Mage::getStoreConfig( - Enterprise_GiftWrapping_Helper_Data::XML_PATH_ALLOWED_FOR_ITEMS, $product->getStoreId())); + $xmlPathGiftWrappingAvailable = 'sales/gift_options/wrapping_allow_items'; + $product->setData('gift_wrapping_available', (int)Mage::getStoreConfig( + $xmlPathGiftWrappingAvailable, $product->getStoreId())); } } diff --git a/app/code/core/Mage/Catalog/Model/Api2/Product/Validator/Product.php b/app/code/core/Mage/Catalog/Model/Api2/Product/Validator/Product.php index 3dbbcd67ba..869d42dd6d 100644 --- a/app/code/core/Mage/Catalog/Model/Api2/Product/Validator/Product.php +++ b/app/code/core/Mage/Catalog/Model/Api2/Product/Validator/Product.php @@ -178,10 +178,17 @@ protected function _validateAttributes($data, $productEntity) // skip check when field will be validated later as a required one && !(empty($value) && $attribute->getIsRequired())) { $allowedValues = $this->_getAttributeAllowedValues($attribute->getSource()->getAllOptions()); - $useStrictMode = !is_numeric($value); - if (!in_array($value, $allowedValues, $useStrictMode) - && !$this->_isConfigValueUsed($data, $attributeCode)) { - $this->_addError(sprintf('Invalid value for attribute "%s".', $attributeCode)); + if (!is_array($value)) { + // make validation of select and multiselect identical + $value = array($value); + } + foreach ($value as $selectValue) { + $useStrictMode = !is_numeric($selectValue); + if (!in_array($selectValue, $allowedValues, $useStrictMode) + && !$this->_isConfigValueUsed($data, $attributeCode)) { + $this->_addError(sprintf('Invalid value "%s" for attribute "%s".', + $selectValue, $attributeCode)); + } } } // Validate datetime attributes @@ -341,8 +348,9 @@ protected function _validateWebsiteIdForGroupPrice($data, $fieldSet) /** @var $catalogHelper Mage_Catalog_Helper_Data */ $catalogHelper = Mage::helper('catalog'); $website = Mage::getModel('core/website')->load($data['website_id']); - if (is_null($website->getId()) || ($data['website_id'] !== 0 - && $catalogHelper->getPriceScope() == Mage_Catalog_Helper_Data::PRICE_SCOPE_GLOBAL)) { + $isAllWebsitesValue = is_numeric($data['website_id']) && ($data['website_id'] == 0); + $isGlobalPriceScope = (int)$catalogHelper->getPriceScope() == Mage_Catalog_Helper_Data::PRICE_SCOPE_GLOBAL; + if (is_null($website->getId()) || ($isGlobalPriceScope && !$isAllWebsitesValue)) { $this->_addError(sprintf('Invalid "website_id" value in the "%s" set.', $fieldSet)); } } @@ -371,7 +379,7 @@ protected function _validateStockData($data) } $this->_validateBoolean($stockData, $fieldSet, 'enable_qty_increments', true); if (isset($stockData['enable_qty_increments']) && (bool) $stockData['enable_qty_increments'] == true) { - $this->_validatePositiveInteger($stockData, $fieldSet, 'qty_increments', false, true); + $this->_validatePositiveNumeric($stockData, $fieldSet, 'qty_increments', false, true); } if (Mage::helper('catalog')->isModuleEnabled('Mage_CatalogInventory')) { $this->_validateSource($stockData, $fieldSet, 'backorders', @@ -380,8 +388,8 @@ protected function _validateStockData($data) } } - $this->_validatePositiveInteger($stockData, $fieldSet, 'min_sale_qty', false, true); - $this->_validatePositiveInteger($stockData, $fieldSet, 'max_sale_qty', false, true); + $this->_validatePositiveNumeric($stockData, $fieldSet, 'min_sale_qty', false, true); + $this->_validatePositiveNumeric($stockData, $fieldSet, 'max_sale_qty', false, true); } } @@ -456,7 +464,7 @@ protected function _validatePositiveNumber($data, $fieldSet, $field, $required = } /** - * Validate field to be a positive integer + * Validate field to be a positive number * * @param array $data * @param string $fieldSet @@ -464,7 +472,7 @@ protected function _validatePositiveNumber($data, $fieldSet, $field, $required = * @param bool $required * @param bool $skipIfConfigValueUsed */ - protected function _validatePositiveInteger($data, $fieldSet, $field, $required = false, + protected function _validatePositiveNumeric($data, $fieldSet, $field, $required = false, $skipIfConfigValueUsed = false) { // in case when 'Use Config Settings' is selected no validation needed @@ -473,9 +481,9 @@ protected function _validatePositiveInteger($data, $fieldSet, $field, $required $this->_addError(sprintf('The "%s" value in the "%s" set is a required field.',$field, $fieldSet)); } - if (isset($data[$field]) && (!is_int($data[$field]) || $data[$field] < 0)) { + if (isset($data[$field]) && (!is_numeric($data[$field]) || $data[$field] < 0)) { $this->_addError(sprintf('Please use numbers only in the "%s" field in the "%s" set. ' . - 'Please avoid spaces or other characters such as dots or commas.', $field, $fieldSet)); + 'Please avoid spaces or other non numeric characters.', $field, $fieldSet)); } } } @@ -521,7 +529,8 @@ protected function _validateSource($data, $fieldSet, $field, $sourceModelName, $ $sourceModel = Mage::getSingleton($sourceModelName); if ($sourceModel) { $allowedValues = $this->_getAttributeAllowedValues($sourceModel->toOptionArray()); - if (!in_array($data[$field], $allowedValues, true)) { + $useStrictMode = !is_numeric($data[$field]); + if (!in_array($data[$field], $allowedValues, $useStrictMode)) { $this->_addError(sprintf('Invalid "%s" value in the "%s" set.', $field, $fieldSet)); } } @@ -544,7 +553,8 @@ protected function _validateBoolean($data, $fieldSet, $field, $skipIfConfigValue if (isset($data[$field])) { $allowedValues = $this->_getAttributeAllowedValues( Mage::getSingleton('eav/entity_attribute_source_boolean')->getAllOptions()); - if (!in_array($data[$field], $allowedValues, true)) { + $useStrictMode = !is_numeric($data[$field]); + if (!in_array($data[$field], $allowedValues, $useStrictMode)) { $this->_addError(sprintf('Invalid "%s" value in the "%s" set.', $field, $fieldSet)); } } diff --git a/app/code/core/Mage/Catalog/Model/Category.php b/app/code/core/Mage/Catalog/Model/Category.php index 90baa36883..835eca27e5 100644 --- a/app/code/core/Mage/Catalog/Model/Category.php +++ b/app/code/core/Mage/Catalog/Model/Category.php @@ -737,7 +737,7 @@ public function getRequestPath() } /** - * Retrieve Name data wraper + * Retrieve Name data wrapper * * @return string */ diff --git a/app/code/core/Mage/Catalog/Model/Category/Api.php b/app/code/core/Mage/Catalog/Model/Category/Api.php index 1ca5775e5e..673ce88e50 100644 --- a/app/code/core/Mage/Catalog/Model/Category/Api.php +++ b/app/code/core/Mage/Catalog/Model/Category/Api.php @@ -394,6 +394,10 @@ public function move($categoryId, $parentId, $afterId = null) */ public function delete($categoryId) { + if (Mage_Catalog_Model_Category::TREE_ROOT_ID == $categoryId) { + $this->_fault('not_deleted', 'Cannot remove the system category.'); + } + $category = $this->_initCategory($categoryId); try { diff --git a/app/code/core/Mage/Catalog/Model/Product.php b/app/code/core/Mage/Catalog/Model/Product.php index 418c502fad..2b6cecb7e6 100644 --- a/app/code/core/Mage/Catalog/Model/Product.php +++ b/app/code/core/Mage/Catalog/Model/Product.php @@ -1337,7 +1337,7 @@ public function getIsSalable() /** * Check is a virtual product - * Data helper wraper + * Data helper wrapper * * @return bool */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Api.php b/app/code/core/Mage/Catalog/Model/Product/Api.php index 39dcdd1c24..43afdf4a49 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Api.php +++ b/app/code/core/Mage/Catalog/Model/Product/Api.php @@ -187,6 +187,11 @@ public function create($type, $set, $sku, $productData, $store = null) $product->setStockData(array('use_config_manage_stock' => 0)); } + foreach ($product->getMediaAttributes() as $mediaAttribute) { + $mediaAttrCode = $mediaAttribute->getAttributeCode(); + $product->setData($mediaAttrCode, 'no_selection'); + } + $this->_prepareDataForSave($product, $productData); try { diff --git a/app/code/core/Mage/Catalog/Model/Product/Api/V2.php b/app/code/core/Mage/Catalog/Model/Product/Api/V2.php index acdd0ca01b..239ccf724a 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Api/V2.php +++ b/app/code/core/Mage/Catalog/Model/Product/Api/V2.php @@ -182,6 +182,11 @@ public function create($type, $set, $sku, $productData, $store = null) $product->setStockData($_stockData); } + foreach ($product->getMediaAttributes() as $mediaAttribute) { + $mediaAttrCode = $mediaAttribute->getAttributeCode(); + $product->setData($mediaAttrCode, 'no_selection'); + } + $this->_prepareDataForSave($product, $productData); try { diff --git a/app/code/core/Mage/Catalog/Model/Product/Status.php b/app/code/core/Mage/Catalog/Model/Product/Status.php index 04fac9bdbe..a2f6175383 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Status.php +++ b/app/code/core/Mage/Catalog/Model/Product/Status.php @@ -63,7 +63,7 @@ protected function _construct() } /** - * Retrieve resource model wraper + * Retrieve resource model wrapper * * @return Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Status */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Type/Abstract.php b/app/code/core/Mage/Catalog/Model/Product/Type/Abstract.php index 5c9c4b06c4..329edc44cc 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Type/Abstract.php +++ b/app/code/core/Mage/Catalog/Model/Product/Type/Abstract.php @@ -863,16 +863,6 @@ public function getForceChildItemQtyChanges($product = null) return false; } - /** - * Force apply discount for parent item - * - * @return bool - */ - public function getForceApplyDiscountToParentItem() - { - return false; - } - /** * Prepare Quote Item Quantity * diff --git a/app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Price.php b/app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Price.php index 5de20a0f03..544c5494f8 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Price.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Price.php @@ -285,7 +285,8 @@ public function getCount($filter, $range) */ public function applyFilterToCollection($filter, $range, $index) { - $priceExpr = $this->_getPriceExpression($filter); + $select = $filter->getLayer()->getProductCollection()->getSelect(); + $priceExpr = $this->_getPriceExpression($filter, $select); $filter->getLayer()->getProductCollection() ->getSelect() ->where($priceExpr . ' >= ' . $this->_getComparingValue(($range * ($index - 1)), $filter)) diff --git a/app/code/core/Mage/Catalog/controllers/Product/CompareController.php b/app/code/core/Mage/Catalog/controllers/Product/CompareController.php index 9354b2c2cc..5855daab76 100644 --- a/app/code/core/Mage/Catalog/controllers/Product/CompareController.php +++ b/app/code/core/Mage/Catalog/controllers/Product/CompareController.php @@ -74,7 +74,10 @@ public function indexAction() */ public function addAction() { - if ($productId = (int) $this->getRequest()->getParam('product')) { + $productId = (int) $this->getRequest()->getParam('product'); + if ($productId + && (Mage::getSingleton('log/visitor')->getId() || Mage::getSingleton('customer/session')->isLoggedIn()) + ) { $product = Mage::getModel('catalog/product') ->setStoreId(Mage::app()->getStore()->getId()) ->load($productId); diff --git a/app/code/core/Mage/Catalog/etc/api2.xml b/app/code/core/Mage/Catalog/etc/api2.xml index 950da09805..87d549a968 100644 --- a/app/code/core/Mage/Catalog/etc/api2.xml +++ b/app/code/core/Mage/Catalog/etc/api2.xml @@ -40,7 +40,7 @@ - + catalog_product catalog/api2_product catalog/product @@ -60,7 +60,7 @@ 1 - + Product ID Product Type Attribute Set @@ -210,7 +210,7 @@ 1 - + catalog_product catalog/api2_product_category catalog/category @@ -229,7 +229,7 @@ 1 - + Category ID @@ -246,7 +246,7 @@ 1 - + Int Please use numbers only in "category_id" field. @@ -255,7 +255,7 @@ 1 - + catalog_product catalog/api2_product_image Product Image @@ -274,7 +274,7 @@ 1 - + ID File Name File Content @@ -334,7 +334,7 @@ 1 - + catalog_product catalog/api2_product_website catalog/product_website diff --git a/app/code/core/Mage/CatalogInventory/Block/Qtyincrements.php b/app/code/core/Mage/CatalogInventory/Block/Qtyincrements.php index 9b31c74fb9..4fca1e8423 100644 --- a/app/code/core/Mage/CatalogInventory/Block/Qtyincrements.php +++ b/app/code/core/Mage/CatalogInventory/Block/Qtyincrements.php @@ -70,9 +70,6 @@ public function getProductQtyIncrements() { if ($this->_qtyIncrements === null) { $this->_qtyIncrements = $this->_getProduct()->getStockItem()->getQtyIncrements(); - if (!$this->_qtyIncrements) { - $this->_qtyIncrements = $this->_getProduct()->getStockItem()->getDefaultQtyIncrements(); - } if (!$this->_getProduct()->isSaleable()) { $this->_qtyIncrements = false; } diff --git a/app/code/core/Mage/CatalogInventory/Model/Stock/Item.php b/app/code/core/Mage/CatalogInventory/Model/Stock/Item.php index 5ed9d1cac0..0b7d017412 100644 --- a/app/code/core/Mage/CatalogInventory/Model/Stock/Item.php +++ b/app/code/core/Mage/CatalogInventory/Model/Stock/Item.php @@ -170,7 +170,7 @@ public function getStockId() } /** - * Retrieve Product Id data wraper + * Retrieve Product Id data wrapper * * @return int */ @@ -365,47 +365,44 @@ public function getNotifyStockQty() */ public function getEnableQtyIncrements() { - if ($this->getUseConfigEnableQtyIncrements()) { - return Mage::getStoreConfigFlag(self::XML_PATH_ENABLE_QTY_INCREMENTS); - } - return (bool) $this->getData('enable_qty_increments'); + return $this->getUseConfigEnableQtyIncrements() + ? Mage::getStoreConfigFlag(self::XML_PATH_ENABLE_QTY_INCREMENTS) + : (bool)$this->getData('enable_qty_increments'); } /** - * Retrieve Quantity Increments data wraper + * Retrieve Quantity Increments data wrapper * * @return float|false */ public function getQtyIncrements() { if ($this->_qtyIncrements === null) { - $this->_qtyIncrements = false; if ($this->getEnableQtyIncrements()) { - if ($this->getUseConfigQtyIncrements()) { - $this->_qtyIncrements = Mage::getStoreConfig(self::XML_PATH_QTY_INCREMENTS); - } else { - $this->_qtyIncrements = $this->getData('qty_increments'); - } - $this->_qtyIncrements = (float)$this->_qtyIncrements; + $this->_qtyIncrements = (float)($this->getUseConfigQtyIncrements() + ? Mage::getStoreConfig(self::XML_PATH_QTY_INCREMENTS) + : $this->getData('qty_increments')); if ($this->_qtyIncrements <= 0) { $this->_qtyIncrements = false; } + } else { + $this->_qtyIncrements = false; } } return $this->_qtyIncrements; } /** - * Retrieve Default Quantity Increments data wraper + * Retrieve Default Quantity Increments data wrapper * + * @deprecated since 1.7.0.0 * @return int|false */ public function getDefaultQtyIncrements() { - if (Mage::getStoreConfigFlag(self::XML_PATH_ENABLE_QTY_INCREMENTS)) { - return (int) Mage::getStoreConfig(self::XML_PATH_QTY_INCREMENTS); - } - return false; + return Mage::getStoreConfigFlag(self::XML_PATH_ENABLE_QTY_INCREMENTS) + ? (int)Mage::getStoreConfig(self::XML_PATH_QTY_INCREMENTS) + : false; } /** @@ -422,7 +419,7 @@ public function getBackorders() } /** - * Retrieve Manage Stock data wraper + * Retrieve Manage Stock data wrapper * * @return int */ @@ -572,7 +569,6 @@ public function checkQuoteItemQty($qty, $summaryQty, $origQty = 0) } $result->addData($this->checkQtyIncrements($qty)->getData()); - if ($result->getHasError()) { return $result; } @@ -639,7 +635,6 @@ public function checkQuoteItemQty($qty, $summaryQty, $origQty = 0) $this->setOrderedItems($qty + (int)$this->getOrderedItems()); } } - // no return intentionally } return $result; @@ -659,10 +654,6 @@ public function checkQtyIncrements($qty) } $qtyIncrements = $this->getQtyIncrements(); - if (!$qtyIncrements){ - $qtyIncrements = $this->getDefaultQtyIncrements(); - } - if ($qtyIncrements && (Mage::helper('core')->getExactDivision($qty, $qtyIncrements) != 0)) { $result->setHasError(true) ->setQuoteMessage( diff --git a/app/code/core/Mage/Checkout/Block/Cart/Shipping.php b/app/code/core/Mage/Checkout/Block/Cart/Shipping.php index ddf32624e0..51d2ee226a 100644 --- a/app/code/core/Mage/Checkout/Block/Cart/Shipping.php +++ b/app/code/core/Mage/Checkout/Block/Cart/Shipping.php @@ -257,7 +257,7 @@ public function isCityRequired() public function isZipCodeRequired() { foreach ($this->getCarriers() as $carrier) { - if ($carrier->isZipCodeRequired()) { + if ($carrier->isZipCodeRequired($this->getEstimateCountryId())) { return true; } } diff --git a/app/code/core/Mage/Checkout/Block/Onepage/Abstract.php b/app/code/core/Mage/Checkout/Block/Onepage/Abstract.php index 0ff811b2f3..c463b3254d 100644 --- a/app/code/core/Mage/Checkout/Block/Onepage/Abstract.php +++ b/app/code/core/Mage/Checkout/Block/Onepage/Abstract.php @@ -159,7 +159,7 @@ public function getCountryHtmlSelect($type) ->setValue($countryId) ->setOptions($this->getCountryOptions()); if ($type === 'shipping') { - $select->setExtraParams('onchange="shipping.setSameAsBilling(false);"'); + $select->setExtraParams('onchange="if(window.shipping)shipping.setSameAsBilling(false);"'); } return $select->getHtml(); diff --git a/app/code/core/Mage/Cms/data/cms_setup/data-upgrade-1.6.0.0.0-1.6.0.0.1.php b/app/code/core/Mage/Cms/data/cms_setup/data-upgrade-1.6.0.0.0-1.6.0.0.1.php index be88e876e5..32588aebdc 100644 --- a/app/code/core/Mage/Cms/data/cms_setup/data-upgrade-1.6.0.0.0-1.6.0.0.1.php +++ b/app/code/core/Mage/Cms/data/cms_setup/data-upgrade-1.6.0.0.0-1.6.0.0.1.php @@ -26,11 +26,9 @@ $pageContent = << - - Please replace this text with you Privacy Policy. - Please add any additional cookies your website uses below (e.g., Google Analytics) - +

    + Please replace this text with you Privacy Policy. + Please add any additional cookies your website uses below (e.g., Google Analytics)

    This privacy policy sets out how {{config path="general/store_information/name"}} uses and protects any information @@ -170,6 +168,10 @@

    CUSTOMER_INFO An encrypted version of the customer group you belong to.
    CUSTOMER_SEGMENT_IDSStores the Customer Segment ID
    EXTERNAL_NO_CACHE A flag, which indicates whether caching is disabled or not.
    oauth_consumer
    @@ -54,31 +54,31 @@ - Mage_OAuth_Block + Mage_Oauth_Block - Mage_OAuth_Helper + Mage_Oauth_Helper - Mage_OAuth - Mage_OAuth_Model_Resource_Setup + Mage_Oauth + Mage_Oauth_Model_Resource_Setup - + oauth/observer afterCustomerLogin - + @@ -111,7 +111,7 @@ - Mage_OAuth_Adminhtml + Mage_Oauth_Adminhtml @@ -120,11 +120,11 @@ - + - Mage_OAuth.csv + Mage_Oauth.csv - + @@ -140,7 +140,7 @@ standard - Mage_OAuth + Mage_Oauth oauth @@ -154,11 +154,11 @@ - + - Mage_OAuth.csv + Mage_Oauth.csv - + diff --git a/app/code/core/Mage/OAuth/etc/system.xml b/app/code/core/Mage/Oauth/etc/system.xml similarity index 99% rename from app/code/core/Mage/OAuth/etc/system.xml rename to app/code/core/Mage/Oauth/etc/system.xml index 66e678d067..112690c73b 100644 --- a/app/code/core/Mage/OAuth/etc/system.xml +++ b/app/code/core/Mage/Oauth/etc/system.xml @@ -20,7 +20,7 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/OAuth/sql/oauth_setup/install-1.0.0.0.php b/app/code/core/Mage/Oauth/sql/oauth_setup/install-1.0.0.0.php similarity index 96% rename from app/code/core/Mage/OAuth/sql/oauth_setup/install-1.0.0.0.php rename to app/code/core/Mage/Oauth/sql/oauth_setup/install-1.0.0.0.php index 508beb3e4b..08d435fc39 100644 --- a/app/code/core/Mage/OAuth/sql/oauth_setup/install-1.0.0.0.php +++ b/app/code/core/Mage/Oauth/sql/oauth_setup/install-1.0.0.0.php @@ -19,14 +19,14 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage - * @package Mage_OAuth + * @package Mage_Oauth * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** * Installation of OAuth module tables */ -/** @var $install Mage_OAuth_Model_Resource_Setup */ +/** @var $install Mage_Oauth_Model_Resource_Setup */ $installer = $this; $installer->startSetup(); @@ -54,10 +54,10 @@ ->addColumn('name', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255, array( 'nullable' => false ), 'Name of consumer') - ->addColumn('key', Varien_Db_Ddl_Table::TYPE_VARCHAR, Mage_OAuth_Model_Consumer::KEY_LENGTH, array( + ->addColumn('key', Varien_Db_Ddl_Table::TYPE_VARCHAR, Mage_Oauth_Model_Consumer::KEY_LENGTH, array( 'nullable' => false ), 'Key code') - ->addColumn('secret', Varien_Db_Ddl_Table::TYPE_VARCHAR, Mage_OAuth_Model_Consumer::SECRET_LENGTH, array( + ->addColumn('secret', Varien_Db_Ddl_Table::TYPE_VARCHAR, Mage_Oauth_Model_Consumer::SECRET_LENGTH, array( 'nullable' => false ), 'Secret code') ->addColumn('callback_url', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255, array(), 'Callback URL') @@ -107,13 +107,13 @@ ->addColumn('type', Varien_Db_Ddl_Table::TYPE_TEXT, 16, array( 'nullable' => false ), 'Token Type') - ->addColumn('token', Varien_Db_Ddl_Table::TYPE_TEXT, Mage_OAuth_Model_Token::LENGTH_TOKEN, array( + ->addColumn('token', Varien_Db_Ddl_Table::TYPE_TEXT, Mage_Oauth_Model_Token::LENGTH_TOKEN, array( 'nullable' => false ), 'Token') - ->addColumn('secret', Varien_Db_Ddl_Table::TYPE_TEXT, Mage_OAuth_Model_Token::LENGTH_SECRET, array( + ->addColumn('secret', Varien_Db_Ddl_Table::TYPE_TEXT, Mage_Oauth_Model_Token::LENGTH_SECRET, array( 'nullable' => false ), 'Token Secret') - ->addColumn('verifier', Varien_Db_Ddl_Table::TYPE_TEXT, Mage_OAuth_Model_Token::LENGTH_VERIFIER, array( + ->addColumn('verifier', Varien_Db_Ddl_Table::TYPE_TEXT, Mage_Oauth_Model_Token::LENGTH_VERIFIER, array( 'nullable' => true ), 'Token Verifier') ->addColumn('callback_url', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array( diff --git a/app/code/core/Mage/Page/Block/Html/Notices.php b/app/code/core/Mage/Page/Block/Html/Notices.php index 43207bbb4a..0ee78c2d25 100644 --- a/app/code/core/Mage/Page/Block/Html/Notices.php +++ b/app/code/core/Mage/Page/Block/Html/Notices.php @@ -33,13 +33,6 @@ */ class Mage_Page_Block_Html_Notices extends Mage_Core_Block_Template { - - /** - * Cookie restriction lifetime configuration path - */ - const XML_PATH_COOKIE_RESTRICTION_LIFETIME = 'web/cookie/cookie_restriction_lifetime'; - - /** * Check if noscript notice should be displayed * @@ -60,28 +53,6 @@ public function displayDemoNotice() return Mage::getStoreConfig('design/head/demonotice'); } - /** - * Get cookie restriction lifetime (in seconds) - * - * @return int - */ - public function getCookieRestrictionLifetime() - { - return (int)Mage::getStoreConfig(self::XML_PATH_COOKIE_RESTRICTION_LIFETIME); - } - - /** - * Check if cookie restriction notice should be displayed - * - * @return bool - */ - public function displayCookieRestrictionNotice() - { - $acceptedSaveCookiesWebsites = $this->_getAcceptedSaveCookiesWebsites(); - return Mage::getStoreConfig(self::XML_PATH_COOKIE_RESTRICTION) && - empty($acceptedSaveCookiesWebsites[Mage::app()->getWebsite()->getId()]); - } - /** * Get Link to cookie restriction privacy policy page * diff --git a/app/code/core/Mage/Page/Block/Template/Links.php b/app/code/core/Mage/Page/Block/Template/Links.php index 5982224128..a7f4b09add 100644 --- a/app/code/core/Mage/Page/Block/Template/Links.php +++ b/app/code/core/Mage/Page/Block/Template/Links.php @@ -115,7 +115,9 @@ public function addLink($label, $url='', $title='', $prepare=false, $urlParams=a public function addLinkBlock($blockName) { $block = $this->getLayout()->getBlock($blockName); - $this->_links[$this->_getNewPosition((int)$block->getPosition())] = $block; + if ($block) { + $this->_links[$this->_getNewPosition((int)$block->getPosition())] = $block; + } return $this; } diff --git a/app/code/core/Mage/Page/etc/config.xml b/app/code/core/Mage/Page/etc/config.xml index 06bf6fd2ff..eb075a4fd8 100644 --- a/app/code/core/Mage/Page/etc/config.xml +++ b/app/code/core/Mage/Page/etc/config.xml @@ -129,7 +129,7 @@ Default welcome msg!
    - &copy; 2008 Magento Demo Store. All Rights Reserved. + &copy; 2012 Magento Demo Store. All Rights Reserved.
    diff --git a/app/code/core/Mage/Paygate/Block/Authorizenet/Form/Cc.php b/app/code/core/Mage/Paygate/Block/Authorizenet/Form/Cc.php index 2c78280062..db856895a5 100644 --- a/app/code/core/Mage/Paygate/Block/Authorizenet/Form/Cc.php +++ b/app/code/core/Mage/Paygate/Block/Authorizenet/Form/Cc.php @@ -67,7 +67,7 @@ public function getCardsBlock() */ public function getCancelUrl() { - return $this->getUrl('paygate/authorizenet_payment/cancel', array('_secure' => true)); + return $this->getUrl('paygate/authorizenet_payment/cancel'); } /** diff --git a/app/code/core/Mage/Paygate/etc/config.xml b/app/code/core/Mage/Paygate/etc/config.xml index 180e02b21d..7e244cd959 100644 --- a/app/code/core/Mage/Paygate/etc/config.xml +++ b/app/code/core/Mage/Paygate/etc/config.xml @@ -67,6 +67,9 @@
    + + /paygate/authorizenet_payment + diff --git a/app/code/core/Mage/Payment/Block/Form/Container.php b/app/code/core/Mage/Payment/Block/Form/Container.php index 665f092bb8..9d15385732 100644 --- a/app/code/core/Mage/Payment/Block/Form/Container.php +++ b/app/code/core/Mage/Payment/Block/Form/Container.php @@ -57,7 +57,7 @@ protected function _canUseMethod($method) return false; } - if (!$method->canUseForCurrency(Mage::app()->getStore()->getBaseCurrencyCode())) { + if (!$method->canUseForCurrency($this->getQuote()->getStore()->getBaseCurrencyCode())) { return false; } diff --git a/app/code/core/Mage/Sales/Model/Api2/Order.php b/app/code/core/Mage/Sales/Model/Api2/Order.php index 6fe913a042..590e1b8bb5 100644 --- a/app/code/core/Mage/Sales/Model/Api2/Order.php +++ b/app/code/core/Mage/Sales/Model/Api2/Order.php @@ -117,9 +117,9 @@ protected function _getAddresses(array $orderIds) { $addresses = array(); - if ($this->_isSubCallAllowed('order_addresses')) { + if ($this->_isSubCallAllowed('order_address')) { /** @var $addressesFilter Mage_Api2_Model_Acl_Filter */ - $addressesFilter = $this->_getSubModel('order_addresses', array())->getFilter(); + $addressesFilter = $this->_getSubModel('order_address', array())->getFilter(); // do addresses request if at least one attribute allowed if ($addressesFilter->getAllowedAttributes()) { /* @var $collection Mage_Sales_Model_Resource_Order_Address_Collection */ @@ -174,9 +174,9 @@ protected function _getComments(array $orderIds) { $comments = array(); - if ($this->_isOrderCommentsAllowed() && $this->_isSubCallAllowed('order_comments')) { + if ($this->_isOrderCommentsAllowed() && $this->_isSubCallAllowed('order_comment')) { /** @var $commentsFilter Mage_Api2_Model_Acl_Filter */ - $commentsFilter = $this->_getSubModel('order_comments', array())->getFilter(); + $commentsFilter = $this->_getSubModel('order_comment', array())->getFilter(); // do comments request if at least one attribute allowed if ($commentsFilter->getAllowedAttributes()) { foreach ($this->_getCommentsCollection($orderIds)->getItems() as $item) { @@ -212,9 +212,9 @@ protected function _getItems(array $orderIds) { $items = array(); - if ($this->_isSubCallAllowed('order_items')) { + if ($this->_isSubCallAllowed('order_item')) { /** @var $itemsFilter Mage_Api2_Model_Acl_Filter */ - $itemsFilter = $this->_getSubModel('order_items', array())->getFilter(); + $itemsFilter = $this->_getSubModel('order_item', array())->getFilter(); // do items request if at least one attribute allowed if ($itemsFilter->getAllowedAttributes()) { /* @var $collection Mage_Sales_Model_Resource_Order_Item_Collection */ diff --git a/app/code/core/Mage/Sales/Model/Api2/Order/Comments.php b/app/code/core/Mage/Sales/Model/Api2/Order/Comment.php similarity index 93% rename from app/code/core/Mage/Sales/Model/Api2/Order/Comments.php rename to app/code/core/Mage/Sales/Model/Api2/Order/Comment.php index b7b1ddfd59..1aefe36b0c 100644 --- a/app/code/core/Mage/Sales/Model/Api2/Order/Comments.php +++ b/app/code/core/Mage/Sales/Model/Api2/Order/Comment.php @@ -31,6 +31,6 @@ * @package Mage_Sales * @author Magento Core Team */ -class Mage_Sales_Model_Api2_Order_Comments extends Mage_Api2_Model_Resource +class Mage_Sales_Model_Api2_Order_Comment extends Mage_Api2_Model_Resource { } diff --git a/app/code/core/Mage/Sales/Model/Api2/Order/Comments/Rest.php b/app/code/core/Mage/Sales/Model/Api2/Order/Comment/Rest.php similarity index 96% rename from app/code/core/Mage/Sales/Model/Api2/Order/Comments/Rest.php rename to app/code/core/Mage/Sales/Model/Api2/Order/Comment/Rest.php index bfdf308cf4..d7149d12da 100644 --- a/app/code/core/Mage/Sales/Model/Api2/Order/Comments/Rest.php +++ b/app/code/core/Mage/Sales/Model/Api2/Order/Comment/Rest.php @@ -31,7 +31,7 @@ * @package Mage_Sales * @author Magento Core Team */ -abstract class Mage_Sales_Model_Api2_Order_Comments_Rest extends Mage_Sales_Model_Api2_Order_Comments +abstract class Mage_Sales_Model_Api2_Order_Comment_Rest extends Mage_Sales_Model_Api2_Order_Comment { /**#@+ * Parameters in request used in model (usually specified in route mask) diff --git a/app/code/core/Mage/Sales/Model/Api2/Order/Comments/Rest/Admin/V1.php b/app/code/core/Mage/Sales/Model/Api2/Order/Comment/Rest/Admin/V1.php similarity index 91% rename from app/code/core/Mage/Sales/Model/Api2/Order/Comments/Rest/Admin/V1.php rename to app/code/core/Mage/Sales/Model/Api2/Order/Comment/Rest/Admin/V1.php index e6e6b45aab..22656cb0a1 100644 --- a/app/code/core/Mage/Sales/Model/Api2/Order/Comments/Rest/Admin/V1.php +++ b/app/code/core/Mage/Sales/Model/Api2/Order/Comment/Rest/Admin/V1.php @@ -31,6 +31,6 @@ * @package Mage_Sales * @author Magento Core Team */ -class Mage_Sales_Model_Api2_Order_Comments_Rest_Admin_V1 extends Mage_Sales_Model_Api2_Order_Comments_Rest +class Mage_Sales_Model_Api2_Order_Comment_Rest_Admin_V1 extends Mage_Sales_Model_Api2_Order_Comment_Rest { } diff --git a/app/code/core/Mage/Sales/Model/Api2/Order/Comments/Rest/Customer/V1.php b/app/code/core/Mage/Sales/Model/Api2/Order/Comment/Rest/Customer/V1.php similarity index 94% rename from app/code/core/Mage/Sales/Model/Api2/Order/Comments/Rest/Customer/V1.php rename to app/code/core/Mage/Sales/Model/Api2/Order/Comment/Rest/Customer/V1.php index 203d6614ae..4c4ede2df5 100644 --- a/app/code/core/Mage/Sales/Model/Api2/Order/Comments/Rest/Customer/V1.php +++ b/app/code/core/Mage/Sales/Model/Api2/Order/Comment/Rest/Customer/V1.php @@ -31,7 +31,7 @@ * @package Mage_Sales * @author Magento Core Team */ -class Mage_Sales_Model_Api2_Order_Comments_Rest_Customer_V1 extends Mage_Sales_Model_Api2_Order_Comments_Rest +class Mage_Sales_Model_Api2_Order_Comment_Rest_Customer_V1 extends Mage_Sales_Model_Api2_Order_Comment_Rest { /** * Load order by id diff --git a/app/code/core/Mage/Sales/Model/Api2/Order/Items.php b/app/code/core/Mage/Sales/Model/Api2/Order/Item.php similarity index 93% rename from app/code/core/Mage/Sales/Model/Api2/Order/Items.php rename to app/code/core/Mage/Sales/Model/Api2/Order/Item.php index 4497003ba3..25428ab0a5 100644 --- a/app/code/core/Mage/Sales/Model/Api2/Order/Items.php +++ b/app/code/core/Mage/Sales/Model/Api2/Order/Item.php @@ -31,6 +31,6 @@ * @package Mage_Sales * @author Magento Core Team */ -class Mage_Sales_Model_Api2_Order_Items extends Mage_Api2_Model_Resource +class Mage_Sales_Model_Api2_Order_Item extends Mage_Api2_Model_Resource { } diff --git a/app/code/core/Mage/Sales/Model/Api2/Order/Items/Rest.php b/app/code/core/Mage/Sales/Model/Api2/Order/Item/Rest.php similarity index 96% rename from app/code/core/Mage/Sales/Model/Api2/Order/Items/Rest.php rename to app/code/core/Mage/Sales/Model/Api2/Order/Item/Rest.php index 24b3a18e04..724724aa67 100644 --- a/app/code/core/Mage/Sales/Model/Api2/Order/Items/Rest.php +++ b/app/code/core/Mage/Sales/Model/Api2/Order/Item/Rest.php @@ -31,7 +31,7 @@ * @package Mage_Sales * @author Magento Core Team */ -abstract class Mage_Sales_Model_Api2_Order_Items_Rest extends Mage_Sales_Model_Api2_Order_Items +abstract class Mage_Sales_Model_Api2_Order_Item_Rest extends Mage_Sales_Model_Api2_Order_Item { /**#@+ * Parameters in request used in model (usually specified in route) diff --git a/app/code/core/Mage/Sales/Model/Api2/Order/Items/Rest/Admin/V1.php b/app/code/core/Mage/Sales/Model/Api2/Order/Item/Rest/Admin/V1.php similarity index 91% rename from app/code/core/Mage/Sales/Model/Api2/Order/Items/Rest/Admin/V1.php rename to app/code/core/Mage/Sales/Model/Api2/Order/Item/Rest/Admin/V1.php index eb76e98c6b..5006d7cfa9 100644 --- a/app/code/core/Mage/Sales/Model/Api2/Order/Items/Rest/Admin/V1.php +++ b/app/code/core/Mage/Sales/Model/Api2/Order/Item/Rest/Admin/V1.php @@ -31,6 +31,6 @@ * @package Mage_Sales * @author Magento Core Team */ -class Mage_Sales_Model_Api2_Order_Items_Rest_Admin_V1 extends Mage_Sales_Model_Api2_Order_Items_Rest +class Mage_Sales_Model_Api2_Order_Item_Rest_Admin_V1 extends Mage_Sales_Model_Api2_Order_Item_Rest { } diff --git a/app/code/core/Mage/Sales/Model/Api2/Order/Items/Rest/Customer/V1.php b/app/code/core/Mage/Sales/Model/Api2/Order/Item/Rest/Customer/V1.php similarity index 94% rename from app/code/core/Mage/Sales/Model/Api2/Order/Items/Rest/Customer/V1.php rename to app/code/core/Mage/Sales/Model/Api2/Order/Item/Rest/Customer/V1.php index 87404efadd..765faec03a 100644 --- a/app/code/core/Mage/Sales/Model/Api2/Order/Items/Rest/Customer/V1.php +++ b/app/code/core/Mage/Sales/Model/Api2/Order/Item/Rest/Customer/V1.php @@ -31,7 +31,7 @@ * @package Mage_Sales * @author Magento Core Team */ -class Mage_Sales_Model_Api2_Order_Items_Rest_Customer_V1 extends Mage_Sales_Model_Api2_Order_Items_Rest +class Mage_Sales_Model_Api2_Order_Item_Rest_Customer_V1 extends Mage_Sales_Model_Api2_Order_Item_Rest { /** * Load order by id diff --git a/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Discount.php b/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Discount.php index da63378919..fafd10decb 100644 --- a/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Discount.php +++ b/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Discount.php @@ -55,10 +55,7 @@ public function collect(Mage_Sales_Model_Order_Invoice $invoice) /** @var $item Mage_Sales_Model_Order_Invoice_Item */ foreach ($invoice->getAllItems() as $item) { $orderItem = $item->getOrderItem(); - $parentOrderItem = $orderItem->getParentItem(); - if (($orderItem->isDummy() && !$orderItem->getForceApplyDiscountToParentItem()) - || ($parentOrderItem && $orderItem->getForceApplyDiscountToParentItem()) - ) { + if ($orderItem->isDummy()) { continue; } diff --git a/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Creditmemo/Default.php b/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Creditmemo/Default.php index 8109869768..8fa03f39f8 100644 --- a/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Creditmemo/Default.php +++ b/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Creditmemo/Default.php @@ -58,28 +58,12 @@ public function draw() ); // draw Total (ex) - $i = 0; - $prices = $this->getItemPricesForDisplay(); - foreach ($prices as $priceData){ - if (isset($priceData['label'])) { - // draw Subtotal label - $lines[$i][] = array( - 'text' => $priceData['label'], - 'feed' => 330, - 'align' => 'right', - 'width' => 50, - ); - $i++; - } - // draw Subtotal - $lines[$i][] = array( - 'text' => $priceData['subtotal'], - 'feed' => 330, - 'font' => 'bold', - 'align' => 'right', - ); - $i++; - } + $lines[0][] = array( + 'text' => $order->formatPriceTxt($item->getRowTotal()), + 'feed' => 330, + 'font' => 'bold', + 'align' => 'right', + ); // draw Discount $lines[0][] = array( @@ -105,9 +89,9 @@ public function draw() 'align' => 'right' ); - // draw Subtotal - $subtotal = $item->getRowTotal() - + $item->getTaxAmount() + $item->getHiddenTaxAmount() - $item->getDiscountAmount(); + // draw Total (inc) + $subtotal = $item->getRowTotal() + $item->getTaxAmount() + $item->getHiddenTaxAmount() + - $item->getDiscountAmount(); $lines[0][] = array( 'text' => $order->formatPriceTxt($subtotal), 'feed' => 565, diff --git a/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Invoice/Default.php b/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Invoice/Default.php index 54e94d14ae..4052f59e62 100644 --- a/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Invoice/Default.php +++ b/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Invoice/Default.php @@ -67,18 +67,20 @@ public function draw() // draw item Prices $i = 0; $prices = $this->getItemPricesForDisplay(); + $feedPrice = 395; + $feedSubtotal = $feedPrice + 170; foreach ($prices as $priceData){ if (isset($priceData['label'])) { // draw Price label $lines[$i][] = array( 'text' => $priceData['label'], - 'feed' => 360, + 'feed' => $feedPrice, 'align' => 'right' ); // draw Subtotal label $lines[$i][] = array( 'text' => $priceData['label'], - 'feed' => 530, + 'feed' => $feedSubtotal, 'align' => 'right' ); $i++; @@ -86,14 +88,14 @@ public function draw() // draw Price $lines[$i][] = array( 'text' => $priceData['price'], - 'feed' => 360, + 'feed' => $feedPrice, 'font' => 'bold', 'align' => 'right' ); // draw Subtotal $lines[$i][] = array( 'text' => $priceData['subtotal'], - 'feed' => 530, + 'feed' => $feedSubtotal, 'font' => 'bold', 'align' => 'right' ); diff --git a/app/code/core/Mage/Sales/Model/Quote.php b/app/code/core/Mage/Sales/Model/Quote.php index b60891b2dc..8325c20144 100644 --- a/app/code/core/Mage/Sales/Model/Quote.php +++ b/app/code/core/Mage/Sales/Model/Quote.php @@ -933,7 +933,7 @@ public function addProductAdvanced(Mage_Catalog_Model_Product $product, $request if (!$parentItem) { $parentItem = $item; } - if ($parentItem && $candidate->getParentProductId() && !$item->getId()) { + if ($parentItem && $candidate->getParentProductId()) { $item->setParentItem($parentItem); } diff --git a/app/code/core/Mage/Sales/Model/Quote/Item/Abstract.php b/app/code/core/Mage/Sales/Model/Quote/Item/Abstract.php index 4aa20f19e6..eeab9d5c41 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Item/Abstract.php +++ b/app/code/core/Mage/Sales/Model/Quote/Item/Abstract.php @@ -559,22 +559,6 @@ public function isChildrenCalculated() return false; } - /** - * Check if force discount apply to parent item - * - * @return bool - */ - public function getForceApplyDiscountToParentItem() - { - if ($this->getParentItem()) { - $product = $this->getParentItem()->getProduct(); - } else { - $product = $this->getProduct(); - } - - return $product->getTypeInstance()->getForceApplyDiscountToParentItem(); - } - /** * Checking can we ship product separatelly (each child separately) * or each parent product item can be shipped only like one item diff --git a/app/code/core/Mage/Sales/etc/api2.xml b/app/code/core/Mage/Sales/etc/api2.xml index 3fceda27f6..84c3458934 100644 --- a/app/code/core/Mage/Sales/etc/api2.xml +++ b/app/code/core/Mage/Sales/etc/api2.xml @@ -31,10 +31,16 @@ Sales 130 + + + Order + 150 + + - + sales 10 sales/api2_order @@ -154,11 +160,11 @@ 1 - - - orders + + + sales_order 30 - sales/api2_order_items + sales/api2_order_item sales/order_item Order Items @@ -221,9 +227,9 @@ 1 - - - orders + + + sales_order 40 sales/api2_order_address sales/order_address @@ -263,11 +269,11 @@ Address Type Email - - - orders + + + sales_order 60 - sales/api2_order_comments + sales/api2_order_comment sales/order_status_history Order Comments @@ -298,7 +304,7 @@ 1 - + diff --git a/app/code/core/Mage/SalesRule/Model/Quote/Discount.php b/app/code/core/Mage/SalesRule/Model/Quote/Discount.php index fb51963241..7b3f68eb1a 100644 --- a/app/code/core/Mage/SalesRule/Model/Quote/Discount.php +++ b/app/code/core/Mage/SalesRule/Model/Quote/Discount.php @@ -85,9 +85,7 @@ public function collect(Mage_Sales_Model_Quote_Address $address) $eventArgs['item'] = $item; Mage::dispatchEvent('sales_quote_address_discount_item', $eventArgs); - if ($item->getHasChildren() && $item->isChildrenCalculated() - && !$item->getForceApplyDiscountToParentItem() - ) { + if ($item->getHasChildren() && $item->isChildrenCalculated()) { foreach ($item->getChildren() as $child) { $this->_calculator->process($child); $eventArgs['item'] = $child; diff --git a/app/code/core/Mage/Shipping/Model/Carrier/Abstract.php b/app/code/core/Mage/Shipping/Model/Carrier/Abstract.php index d69cf15f09..619b323fef 100644 --- a/app/code/core/Mage/Shipping/Model/Carrier/Abstract.php +++ b/app/code/core/Mage/Shipping/Model/Carrier/Abstract.php @@ -523,10 +523,10 @@ public function isCityRequired() /** * Determine whether zip-code is required for the country of destination * - * @param Mage_Shipping_Model_Rate_Request|null $request + * @param string|null $countryId * @return bool */ - public function isZipCodeRequired(Mage_Shipping_Model_Rate_Request $request = null) + public function isZipCodeRequired($countryId = null) { return false; } diff --git a/app/code/core/Mage/Tax/Block/Checkout/Shipping.php b/app/code/core/Mage/Tax/Block/Checkout/Shipping.php index d580fd9edc..9e5daabf44 100644 --- a/app/code/core/Mage/Tax/Block/Checkout/Shipping.php +++ b/app/code/core/Mage/Tax/Block/Checkout/Shipping.php @@ -35,7 +35,7 @@ class Mage_Tax_Block_Checkout_Shipping extends Mage_Checkout_Block_Total_Default protected $_template = 'tax/checkout/shipping.phtml'; /** - * Check if we need display shipping include and exlude tax + * Check if we need display shipping include and exclude tax * * @return bool */ @@ -81,7 +81,7 @@ public function getShippingExcludeTax() */ public function getIncludeTaxLabel() { - return $this->helper('tax')->__('Shipping Incl. Tax (%s)', $this->getTotal()->getAddress()->getShippingDescription()); + return $this->helper('tax')->__('Shipping Incl. Tax (%s)', $this->escapeHtml($this->getTotal()->getAddress()->getShippingDescription())); } /** @@ -91,6 +91,6 @@ public function getIncludeTaxLabel() */ public function getExcludeTaxLabel() { - return $this->helper('tax')->__('Shipping Excl. Tax (%s)', $this->getTotal()->getAddress()->getShippingDescription()); + return $this->helper('tax')->__('Shipping Excl. Tax (%s)', $this->escapeHtml($this->getTotal()->getAddress()->getShippingDescription())); } } diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Abstract.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Abstract.php index fb202e190d..a6f3871b79 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Abstract.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Abstract.php @@ -110,13 +110,13 @@ public function isCityRequired() /** * Determine whether zip-code is required for the country of destination * - * @param Mage_Shipping_Model_Rate_Request|null $request + * @param string|null $countryId * @return bool */ - public function isZipCodeRequired(Mage_Shipping_Model_Rate_Request $request = null) + public function isZipCodeRequired($countryId = null) { - if ($request instanceof Mage_Shipping_Model_Rate_Request) { - return !Mage::helper('directory')->isZipCodeOptional($request->getDestCountryId()); + if ($countryId != null) { + return !Mage::helper('directory')->isZipCodeOptional($countryId); } return true; } @@ -207,7 +207,7 @@ public function proccessAdditionalValidation(Mage_Shipping_Model_Rate_Request $r } } - if (!$errorMsg && !$request->getDestPostcode() && $this->isZipCodeRequired($request)) { + if (!$errorMsg && !$request->getDestPostcode() && $this->isZipCodeRequired($request->getDestCountryId())) { $errorMsg = Mage::helper('shipping')->__('This shipping method is not available, please specify ZIP-code'); } diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International.php index 6aed24fbd4..06bf2f55c1 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International.php @@ -101,13 +101,6 @@ class Mage_Usa_Model_Shipping_Carrier_Dhl_International */ protected $_rates = array(); - /** - * Store Id - * - * @var int|null - */ - protected $_storeId = null; - /** * Carrier's code * @@ -184,7 +177,7 @@ protected function _getDefaultValue($origValue, $pathToValue) if (!$origValue) { $origValue = Mage::getStoreConfig( $pathToValue, - $this->_storeId + $this->getStore() ); } @@ -204,7 +197,7 @@ public function collectRates(Mage_Shipping_Model_Rate_Request $request) } $requestDhl = clone $request; - $this->_storeId = $requestDhl->getStoreId(); + $this->setStore($requestDhl->getStoreId()); $origCompanyName = $this->_getDefaultValue( $requestDhl->getOrigCompanyName(), @@ -290,7 +283,7 @@ protected function _addParams($requestObject) public function setRequest(Varien_Object $request) { $this->_request = $request; - $this->_storeId = $request->getStoreId(); + $this->setStore($request->getStoreId()); $requestObject = new Varien_Object(); @@ -916,7 +909,10 @@ protected function _parseResponse($response) $result->setTrackingNumber((string)$xml->AirwayBillNumber); try { /* @var $pdf Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf */ - $pdf = Mage::getModel('usa/shipping_carrier_dhl_label_pdf', array('info' => $xml)); + $pdf = Mage::getModel( + 'usa/shipping_carrier_dhl_label_pdf', + array('info' => $xml, 'request' => $this->_request) + ); $result->setShippingLabelContent($pdf->render()); } catch (Exception $e) { Mage::throwException(Mage::helper('usa')->__($e->getMessage())); @@ -1105,7 +1101,7 @@ public function proccessAdditionalValidation(Mage_Shipping_Model_Rate_Request $r } $countryParams = $this->getCountryParams( - Mage::getStoreConfig(Mage_Shipping_Model_Shipping::XML_PATH_STORE_COUNTRY_ID, $this->getStore()) + Mage::getStoreConfig(Mage_Shipping_Model_Shipping::XML_PATH_STORE_COUNTRY_ID, $request->getStoreId()) ); if (!$countryParams->getData()) { $this->_errors[] = Mage::helper('usa')->__('Please, specify origin country'); @@ -1412,7 +1408,7 @@ protected function _shipmentDetails($xml, $rawRequest, $originRegion = '') $i = 0; foreach ($rawRequest->getPackages() as $package) { $nodePiece = $nodePieces->addChild('Piece', '', ''); - $packageType = 'DC'; + $packageType = 'EE'; if ($package['params']['container'] == self::DHL_CONTENT_TYPE_NON_DOC) { $packageType = 'CP'; } @@ -1447,7 +1443,7 @@ protected function _shipmentDetails($xml, $rawRequest, $originRegion = '') $nodeShipmentDetails->addChild('LocalProductCode', $rawRequest->getShippingMethod()); $nodeShipmentDetails->addChild('Date', Mage::getModel('core/date')->date('Y-m-d')); - $nodeShipmentDetails->addChild('Contents', 'DHL Parcel TEST'); + $nodeShipmentDetails->addChild('Contents', 'DHL Parcel'); /* * The DoorTo Element defines the type of delivery service that applies to the shipment. * The valid values are DD (Door to Door), DA (Door to Airport) , AA and DC (Door to @@ -1485,7 +1481,7 @@ protected function _shipmentDetails($xml, $rawRequest, $originRegion = '') */ $nodeShipmentDetails->addChild('DoorTo', 'DD'); $nodeShipmentDetails->addChild('Date', Mage::getModel('core/date')->date('Y-m-d')); - $nodeShipmentDetails->addChild('Contents', 'DHL Parcel TEST'); + $nodeShipmentDetails->addChild('Contents', 'DHL Parcel'); } } diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf.php index f4582b44bc..3157c1abf5 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf.php @@ -34,10 +34,19 @@ class Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf { /** + * Label Information + * * @var SimpleXMLElement */ protected $_info; + /** + * Shipment Request + * + * @var Mage_Shipping_Model_Shipment_Request + */ + protected $_request; + /** * Dhl International Label Creation Class constructor * @@ -45,7 +54,8 @@ class Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf */ public function __construct(array $arguments) { - $this->_info = $arguments['info']; + $this->_info = $arguments['info']; + $this->_request = $arguments['request']; } /** @@ -77,7 +87,7 @@ public function render() ) ->addServiceFeaturesCodes() ->addDeliveryDateCode() - ->addShipmentInformation() + ->addShipmentInformation($this->_request->getOrderShipment()) ->addDateInfo($this->_info->ShipmentDate) ->addWeightInfo((string)$this->_info->ChargeableWeight, (string)$this->_info->WeightUnit) ->addWaybillBarcode((string)$this->_info->AirwayBillNumber, (string)$this->_info->Barcodes->AWBBarCode) @@ -88,16 +98,20 @@ public function render() ) ->addBorder(); + $packages = array_values($this->_request->getPackages()); + $i = 0; foreach ($this->_info->Pieces->Piece as $piece) { $page = new Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_Page($template); $pdfBuilder->setPage($page) ->addPieceNumber((int)$piece->PieceNumber, (int)$this->_info->Piece) + ->addContentInfo($packages[$i]) ->addPieceIdBarcode( (string)$piece->DataIdentifier, (string)$piece->LicensePlate, (string)$piece->LicensePlateBarCode ); array_push($pdf->pages, $page); + $i++; } return $pdf->render(); } diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf/PageBuilder.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf/PageBuilder.php index de9ca8bf1c..6c7c34a9c9 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf/PageBuilder.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf/PageBuilder.php @@ -190,7 +190,8 @@ public function addProductContentCode($code) $this->_page->saveGS(); $codes = array( 'TDK' => 0, 'TDE' => 1, 'TDL' => 0, 'TDM' => 1, 'TDT' => 0, - 'TDY' => 1, 'XPD' => 0, 'DOX' => 0, 'WPX' => 1, 'DOM' => 0 + 'TDY' => 1, 'XPD' => 0, 'DOX' => 0, 'WPX' => 1, 'ECX' => 0, + 'DOM' => 0 ); if (!key_exists($code, $codes)) { throw new InvalidArgumentException(Mage::helper('usa')->__('Product content code is invalid')); @@ -454,12 +455,22 @@ public function addDeliveryDateCode() /** * Add Shipment Information * - * @return Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_PageBuilder + * @param Mage_Sales_Model_Order_Shipment $data + * @return Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_Page + * @throws Exception */ - public function addShipmentInformation() + public function addShipmentInformation($data) { $this->_page->saveGS(); + $this->_page->setFont($this->_fontNormal, 6); + $refCode = $data->getOrder()->getIncrementId(); + if (!$refCode) { + throw new InvalidArgumentException(Mage::helper('usa')->__('Reference code is missing')); + } + $this->_page->drawText('Ref Code: ' . Mage::helper('usa')->__('Order #%s', $refCode), $this->_x(8), + $this->_y(224) + ); $this->_page->restoreGS(); return $this; } @@ -510,6 +521,36 @@ public function addWeightInfo($weight, $unit) return $this; } + /** + * Add Content: Shipment Description + * + * @param array $package + * @return Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_PageBuilder + * @throws Exception + */ + public function addContentInfo($package) + { + $this->_page->saveGS(); + $this->_page->setFont($this->_fontNormal, 6); + if (empty($package)) { + throw new InvalidArgumentException(Mage::helper('usa')->__('Package content is missing')); + } + + $x = 225; + $y = 300; + $this->_page->drawText('Content: ', $this->_x($x), $this->_y($y)); + $i = 0; + foreach ($package['items'] as $item) { + $i++; + $this->_page->drawText(substr($item['name'], 0, 20), $this->_x($x), $this->_y($y += 6)); + if ($i == 12) { + break; + } + } + $this->_page->restoreGS(); + return $this; + } + /** * Add Waybill Barcode * diff --git a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Settings.php b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Settings.php index 82918d606c..ef409e9d78 100644 --- a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Settings.php +++ b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Settings.php @@ -112,18 +112,18 @@ protected function _prepareForm() $this->_addElementTypes($fieldset); $fieldset->addField('type', 'select', array( - 'name' => 'type', - 'label' => Mage::helper('widget')->__('Type'), - 'title' => Mage::helper('widget')->__('Type'), - 'class' => '', - 'values' => $this->getTypesOptionsArray() + 'name' => 'type', + 'label' => Mage::helper('widget')->__('Type'), + 'title' => Mage::helper('widget')->__('Type'), + 'required' => true, + 'values' => $this->getTypesOptionsArray() )); $fieldset->addField('package_theme', 'select', array( - 'name' => 'package_theme', - 'label' => Mage::helper('widget')->__('Design Package/Theme'), - 'title' => Mage::helper('widget')->__('Design Package/Theme'), - 'required' => false, + 'name' => 'package_theme', + 'label' => Mage::helper('widget')->__('Design Package/Theme'), + 'title' => Mage::helper('widget')->__('Design Package/Theme'), + 'required' => true, 'values' => $this->getPackegeThemeOptionsArray() )); $continueButton = $this->getLayout() diff --git a/app/code/core/Mage/Wishlist/controllers/IndexController.php b/app/code/core/Mage/Wishlist/controllers/IndexController.php index ca92d79e83..c750064633 100644 --- a/app/code/core/Mage/Wishlist/controllers/IndexController.php +++ b/app/code/core/Mage/Wishlist/controllers/IndexController.php @@ -212,7 +212,7 @@ public function addAction() Mage::helper('wishlist')->calculate(); - $message = $this->__('%1$s has been added to your wishlist. Click here to continue shopping', $product->getName(), Mage::helper('core')->escapeUrl($referer)); + $message = $this->__('%1$s has been added to your wishlist. Click here to continue shopping.', $product->getName(), Mage::helper('core')->escapeUrl($referer)); $session->addSuccess($message); } catch (Mage_Core_Exception $e) { diff --git a/app/design/adminhtml/default/default/layout/oauth.xml b/app/design/adminhtml/default/default/layout/oauth.xml index 652e9897ef..efd53a346c 100644 --- a/app/design/adminhtml/default/default/layout/oauth.xml +++ b/app/design/adminhtml/default/default/layout/oauth.xml @@ -29,27 +29,27 @@ - + - + - - + + - - + + @@ -58,112 +58,137 @@ - + - + - - - - - + + + + - + - - + + jsscriptaculous/controls.js + jsprototype/window.js + jsscriptaculous/builder.js + jsscriptaculous/dragdrop.js + jsscriptaculous/controls.js + jsscriptaculous/slider.js + jslib/ccard.js + jsvarien/js.js + jsmage/adminhtml/hash.js + jsmage/adminhtml/events.js + jsmage/adminhtml/loader.js + jsmage/adminhtml/grid.js + jsmage/adminhtml/tabs.js + jsmage/adminhtml/accordion.js + + jsmage/adminhtml/uploader.js + jsmage/adminhtml/product.js + jsmage/adminhtml/rules.js + jsmage/adminhtml/wysiwyg/tiny_mce/setup.js + jslib/ds-sleight.js + jsvarien/iehover-fix.js + + cssprint.css + js_csscalendar/calendar-win2k-1.css + js_cssextjs/resources/css/ext-all.css + js_cssextjs/resources/css/ytheme-magento.css + skin_cssmenu.css + jscalendar/calendar.js + jscalendar/calendar-setup.js + jsextjs/fix-defer-before.js + jsextjs/ext-tree.js + jsextjs/fix-defer.js + jsextjs/ext-tree-checkbox.js + + + + + + + + oauth-simple.css + + + + + + + + - - - - - + + + - - - - - - - - - - - + + + + - - - - - + - - - - + + + - - - - - - - + - - - - + + - + - + diff --git a/app/design/adminhtml/default/default/template/bundle/sales/order/view/items/renderer.phtml b/app/design/adminhtml/default/default/template/bundle/sales/order/view/items/renderer.phtml index eb36d73398..08392a4117 100644 --- a/app/design/adminhtml/default/default/template/bundle/sales/order/view/items/renderer.phtml +++ b/app/design/adminhtml/default/default/template/bundle/sales/order/view/items/renderer.phtml @@ -364,8 +364,8 @@ canShowPriceInfo($_item)): ?> displayPrices( - $_item->getBaseRowTotal() - $_item->getBaseDiscountAmount() + $_item->getBaseTaxAmount() + $_item->getBaseWeeeTaxAppliedRowAmount(), - $_item->getRowTotal() - $_item->getDiscountAmount() + $_item->getTaxAmount() + $_item->getWeeeTaxAppliedRowAmount() + max(0, $_item->getBaseRowTotal() - $_item->getBaseDiscountAmount() + $_item->getBaseTaxAmount() + $_item->getBaseWeeeTaxAppliedRowAmount()), + max(0, $_item->getRowTotal() - $_item->getDiscountAmount() + $_item->getTaxAmount() + $_item->getWeeeTaxAppliedRowAmount()) ); ?>   diff --git a/app/design/adminhtml/default/default/template/catalog/product/tab/inventory.phtml b/app/design/adminhtml/default/default/template/catalog/product/tab/inventory.phtml index 35636cd9a4..50b8cab0ac 100644 --- a/app/design/adminhtml/default/default/template/catalog/product/tab/inventory.phtml +++ b/app/design/adminhtml/default/default/template/catalog/product/tab/inventory.phtml @@ -184,62 +184,55 @@ __('[GLOBAL]') ?> - -
    -
    +//]]> + diff --git a/app/design/adminhtml/default/default/template/currencysymbol/grid.phtml b/app/design/adminhtml/default/default/template/currencysymbol/grid.phtml index 4059edcbef..4d76b23ca3 100644 --- a/app/design/adminhtml/default/default/template/currencysymbol/grid.phtml +++ b/app/design/adminhtml/default/default/template/currencysymbol/grid.phtml @@ -74,7 +74,7 @@ - + diff --git a/app/design/adminhtml/default/default/template/empty.phtml b/app/design/adminhtml/default/default/template/empty.phtml index 7bffae91ee..abb9049b99 100644 --- a/app/design/adminhtml/default/default/template/empty.phtml +++ b/app/design/adminhtml/default/default/template/empty.phtml @@ -27,12 +27,13 @@ -getChildHtml('head') ?> +getChild('head')->unsetChildren(); ?> +getChildHtml('head'); ?>
    getChildHtml('after_body_start') ?> - getChildHtml('global_messages') ?> + getChildHtml('global_notices') ?> getChildHtml('content') ?> getChildHtml('before_body_end') ?>
    diff --git a/app/design/adminhtml/default/default/template/oauth/authorize/button-simple.phtml b/app/design/adminhtml/default/default/template/oauth/authorize/button-simple.phtml index 8e8bf8c9c2..92d213cd50 100644 --- a/app/design/adminhtml/default/default/template/oauth/authorize/button-simple.phtml +++ b/app/design/adminhtml/default/default/template/oauth/authorize/button-simple.phtml @@ -28,7 +28,7 @@ /** * "Grant Access" button * - * @var $this Mage_OAuth_Block_Authorize_ButtonBaseAbstract + * @var $this Mage_Oauth_Block_Authorize_ButtonBaseAbstract */ $logo = $this->getSkinUrl('images/logo-large.gif', array('_area' => 'adminhtml', '_package' => 'default')); ?> @@ -43,7 +43,7 @@ $logo = $this->getSkinUrl('images/logo-large.gif', array('_area' => 'adminhtml', getMessagesBlock()->getGroupedHtml() ?> getHasException()) : ?> -

    __('%s request access to your account', $this->escapeHtml($this->getConsumer()->getName())); ?>

    +

    __('%s requests access to your account', $this->escapeHtml($this->getConsumer()->getName())); ?>

    __('After authorization application will have access to you account.'); ?>

    diff --git a/app/design/adminhtml/default/default/template/oauth/authorize/button.phtml b/app/design/adminhtml/default/default/template/oauth/authorize/button.phtml index cdccf65c66..5ce217e145 100644 --- a/app/design/adminhtml/default/default/template/oauth/authorize/button.phtml +++ b/app/design/adminhtml/default/default/template/oauth/authorize/button.phtml @@ -27,10 +27,10 @@ /** * "Grant Access" button * - * @see Mage_OAuth_Block_Authorize + * @see Mage_Oauth_Block_Authorize */ -/** @var $this Mage_OAuth_Block_Adminhtml_OAuth_Authorize_Button */ +/** @var $this Mage_Oauth_Block_Adminhtml_Oauth_Authorize_Button */ ?>
    - getShippingDescription() ?> + escapeHtml($_order->getShippingDescription()) ?> helper('sales')->__('Total Shipping Charges'); ?>: helper('tax')->displayShippingPriceIncludingTax()): ?> diff --git a/app/design/adminhtml/default/default/template/sales/order/invoice/create/form.phtml b/app/design/adminhtml/default/default/template/sales/order/invoice/create/form.phtml index e86cac3c84..fb529065a4 100644 --- a/app/design/adminhtml/default/default/template/sales/order/invoice/create/form.phtml +++ b/app/design/adminhtml/default/default/template/sales/order/invoice/create/form.phtml @@ -53,7 +53,7 @@
    - getShippingDescription() ?> + escapeHtml($_order->getShippingDescription()) ?> helper('sales')->__('Total Shipping Charges'); ?>: helper('tax')->displayShippingPriceIncludingTax()): ?> diff --git a/app/design/adminhtml/default/default/template/sales/order/invoice/view/form.phtml b/app/design/adminhtml/default/default/template/sales/order/invoice/view/form.phtml index 417e0a1a36..72cda127ab 100644 --- a/app/design/adminhtml/default/default/template/sales/order/invoice/view/form.phtml +++ b/app/design/adminhtml/default/default/template/sales/order/invoice/view/form.phtml @@ -51,7 +51,7 @@

    helper('sales')->__('Shipping Information') ?>

    - getShippingDescription() ?> + escapeHtml($_order->getShippingDescription()) ?> helper('sales')->__('Total Shipping Charges'); ?>: helper('tax')->displayShippingPriceIncludingTax()): ?> diff --git a/app/design/adminhtml/default/default/template/sales/order/shipment/create/form.phtml b/app/design/adminhtml/default/default/template/sales/order/shipment/create/form.phtml index df21370ec7..49fdba97b4 100644 --- a/app/design/adminhtml/default/default/template/sales/order/shipment/create/form.phtml +++ b/app/design/adminhtml/default/default/template/sales/order/shipment/create/form.phtml @@ -50,7 +50,7 @@
    - getShippingDescription() ?> + escapeHtml($_order->getShippingDescription()) ?> helper('sales')->__('Total Shipping Charges'); ?>: helper('tax')->displayShippingPriceIncludingTax()): ?> diff --git a/app/design/adminhtml/default/default/template/sales/order/shipment/tracking/info.phtml b/app/design/adminhtml/default/default/template/sales/order/shipment/tracking/info.phtml index e134686dba..1c49cbc403 100644 --- a/app/design/adminhtml/default/default/template/sales/order/shipment/tracking/info.phtml +++ b/app/design/adminhtml/default/default/template/sales/order/shipment/tracking/info.phtml @@ -30,7 +30,7 @@ getTrackingInfo()->getErrorMessage() ?> getTrackingInfo()->getUrl()): ?> - Please, visit for more info: trackingInfo->getCarrierTitle() ?>
    + Please, visit for more info: escapeHtml($this->trackingInfo->getCarrierTitle()) ?>
    getTrackingInfo()->getStatus()): ?> diff --git a/app/design/adminhtml/default/default/template/sales/order/shipment/view/form.phtml b/app/design/adminhtml/default/default/template/sales/order/shipment/view/form.phtml index 43ceb73c4c..a378f6064d 100644 --- a/app/design/adminhtml/default/default/template/sales/order/shipment/view/form.phtml +++ b/app/design/adminhtml/default/default/template/sales/order/shipment/view/form.phtml @@ -51,7 +51,7 @@ __('Track this shipment') ?>
    - getShippingDescription() ?> + escapeHtml($_order->getShippingDescription()) ?> helper('sales')->__('Total Shipping Charges'); ?>: helper('tax')->displayShippingPriceIncludingTax()): ?> diff --git a/app/design/adminhtml/default/default/template/sales/order/view/info.phtml b/app/design/adminhtml/default/default/template/sales/order/view/info.phtml index dee4af9c34..817d371e7d 100644 --- a/app/design/adminhtml/default/default/template/sales/order/view/info.phtml +++ b/app/design/adminhtml/default/default/template/sales/order/view/info.phtml @@ -84,7 +84,7 @@ $orderStoreDate = $this->formatDate($_order->getCreatedAtStoreDate(), 'medium', getRemoteIp() && $this->shouldDisplayCustomerIp()): ?> - getRemoteIp(); echo ($_order->getXForwardedFor())?' (' . $_order->getXForwardedFor() . ')':''; ?> + getRemoteIp(); echo ($_order->getXForwardedFor())?' (' . $this->escapeHtml($_order->getXForwardedFor()) . ')':''; ?> getGlobalCurrencyCode() != $_order->getBaseCurrencyCode()): ?> diff --git a/app/design/adminhtml/default/default/template/system/currency/rate/matrix.phtml b/app/design/adminhtml/default/default/template/system/currency/rate/matrix.phtml index 2e2961304c..6d6a516260 100644 --- a/app/design/adminhtml/default/default/template/system/currency/rate/matrix.phtml +++ b/app/design/adminhtml/default/default/template/system/currency/rate/matrix.phtml @@ -53,7 +53,7 @@ $_rates = ( $_newRates ) ? $_newRates : $_oldRates;
    __('Old rate:') ?> - + /> diff --git a/app/design/adminhtml/default/default/template/widget/instance/js.phtml b/app/design/adminhtml/default/default/template/widget/instance/js.phtml index cbe89a5667..6d3e39eac2 100644 --- a/app/design/adminhtml/default/default/template/widget/instance/js.phtml +++ b/app/design/adminhtml/default/default/template/widget/instance/js.phtml @@ -27,22 +27,22 @@ diff --git a/app/design/frontend/base/default/layout/catalog.xml b/app/design/frontend/base/default/layout/catalog.xml index 5cbf8ca318..0c1c5f2e4f 100644 --- a/app/design/frontend/base/default/layout/catalog.xml +++ b/app/design/frontend/base/default/layout/catalog.xml @@ -415,22 +415,4 @@ SEO Site Map Categories Sitemap - - - - - - - - - - - - - - - - diff --git a/app/design/frontend/base/default/layout/oauth.xml b/app/design/frontend/base/default/layout/oauth.xml index 6c1cb7bce4..3088e837df 100644 --- a/app/design/frontend/base/default/layout/oauth.xml +++ b/app/design/frontend/base/default/layout/oauth.xml @@ -26,127 +26,91 @@ */ --> - - - - - - - - - - - - - - + - - - - + + jslib/ccard.js + jsscriptaculous/controls.js + jsscriptaculous/builder.js + jsscriptaculous/dragdrop.js + jsscriptaculous/controls.js + jsscriptaculous/slider.js + jsvarien/js.js + jsvarien/menu.js + + + + + + + css/oauth-simple.css + + + + + + + + + + + + + - - - - - - - + - - - - - - - - - + + + + + - - - - - - - - - - - - - - - - + - - - - - - - - - + + + - - - - - - + - - - - - - - - - - - + - - - - + + diff --git a/app/design/frontend/base/default/layout/wishlist.xml b/app/design/frontend/base/default/layout/wishlist.xml index 8b608c84f6..a4e7e7f738 100644 --- a/app/design/frontend/base/default/layout/wishlist.xml +++ b/app/design/frontend/base/default/layout/wishlist.xml @@ -33,15 +33,14 @@ Default layout, loads most of the pages --> - - + wishlist_link - + @@ -61,7 +60,6 @@ Customer account home dashboard layout --> - wishlist @@ -74,14 +72,14 @@ Wishlist pages - + My Wishlist - + Product Details and Comment @@ -91,14 +89,14 @@ Wishlist pages Add to Cart - + - + - - - + + + @@ -110,9 +108,9 @@ Wishlist pages - + - + wishlist_customer_sidebar @@ -121,9 +119,9 @@ Wishlist pages - + - + product.info.addto @@ -135,7 +133,7 @@ Wishlist pages - + diff --git a/app/design/frontend/base/default/template/captcha/zend.phtml b/app/design/frontend/base/default/template/captcha/zend.phtml index b47e5d8867..640a8fa25c 100644 --- a/app/design/frontend/base/default/template/captcha/zend.phtml +++ b/app/design/frontend/base/default/template/captcha/zend.phtml @@ -36,7 +36,7 @@
  • - <?php echo $this->__('Reload captcha') ?> + <?php echo $this->__('Reload captcha') ?> isCaseSensitive()) :?>
    diff --git a/app/design/frontend/base/default/template/checkout/cart.phtml b/app/design/frontend/base/default/template/checkout/cart.phtml index 7fae64865b..4a0d62d3db 100644 --- a/app/design/frontend/base/default/template/checkout/cart.phtml +++ b/app/design/frontend/base/default/template/checkout/cart.phtml @@ -99,8 +99,8 @@ getContinueShoppingUrl()): ?> - - + + + - - - - - - - - - images/media/col_left_callout.jpg - Our customer service is available 24/7. Call us at (555) 555-0123. - checkout/cart - - - - - images/media/col_right_callout.jpg - Keep your eyes open for our special Back to School items and save A LOT! + + + top_callout - - Site Map - - + + - + - - - @@ -94,11 +76,6 @@ Category default layout listall --> - empty6 - one_column5 - two_columns_left4 - two_columns_right4 - three_columns3 product_list_toolbar @@ -140,18 +117,10 @@ Category layered navigation layout product_list_toolbar - + - - - - - - - - @@ -223,12 +192,12 @@ Product view - + @@ -244,8 +213,7 @@ Product view product.tierprices - product.info.addtocart.bottom - product.info.addto + product.info.addtocart @@ -264,9 +232,6 @@ Product view container2ifEquals0alias_in_layoutoptions_container - - - - + @@ -348,6 +311,7 @@ Product additional images gallery popup + product-gallery-view @@ -380,25 +344,6 @@ SEO Site Map Site Map - - - - home - - - Home - / - - - - categories - - - Categories - - - - Categories @@ -446,22 +391,4 @@ SEO Site Map Categories Sitemap - - - - - - - - - - - - - - - - diff --git a/app/design/frontend/default/iphone/layout/catalogsearch.xml b/app/design/frontend/default/iphone/layout/catalogsearch.xml index c0fae3e2bf..18dba8c391 100644 --- a/app/design/frontend/default/iphone/layout/catalogsearch.xml +++ b/app/design/frontend/default/iphone/layout/catalogsearch.xml @@ -32,18 +32,6 @@ - - - - - Search Terms - - - - - Advanced Search - - @@ -52,7 +40,6 @@ - @@ -60,17 +47,13 @@ - empty6 - one_column5 - two_columns_left4 - two_columns_right4 - three_columns3 product_list_toolbar + @@ -81,6 +64,7 @@ + Advanced Search js_csscalendar/calendar-win2k-1.css jscalendar/calendar.js jscalendar/calendar-setup.js @@ -100,7 +84,7 @@ Advanced search results - + @@ -108,11 +92,6 @@ Advanced search results - empty6 - one_column5 - two_columns_left4 - two_columns_right4 - three_columns3 product_list_toolbar @@ -127,28 +106,14 @@ Advanced search results + + Search Terms + - - - home - - - Home - / - - - - categories - - - Categories - - - diff --git a/app/design/frontend/default/iphone/layout/checkout.xml b/app/design/frontend/default/iphone/layout/checkout.xml index 941e3cc532..a00bca6c13 100644 --- a/app/design/frontend/default/iphone/layout/checkout.xml +++ b/app/design/frontend/default/iphone/layout/checkout.xml @@ -33,23 +33,13 @@ Default layout, loads most of the pages --> + - - - - simplecheckout/cart_item_renderer - groupedcheckout/cart_item_renderer_grouped - configurablecheckout/cart_item_renderer_configurable - - - - - @@ -60,9 +50,6 @@ Default layout, loads most of the pages - - topCart - checkout/cart.phtml @@ -84,12 +71,9 @@ Default layout, loads most of the pages - - - @@ -307,14 +291,6 @@ One page checkout main layout - - - - - checkout-progress-wrapper - - - @@ -322,14 +298,6 @@ One page checkout main layout 1 - - - mage/captcha.js - - user_login - 230 - 50 - @@ -355,6 +323,7 @@ One page checkout progress block + - - Log Out100 + + Log Out2 + @@ -68,11 +72,9 @@ Load this update on every page when customer is logged out --> - - - Log In100 + + Log In1 + @@ -91,16 +93,7 @@ Layout for customer login page - - - - mage/captcha.js - - user_login - 230 - 50 - - + @@ -140,14 +133,6 @@ New customer registration - - - mage/captcha.js - - user_create - 230 - 50 - @@ -157,25 +142,42 @@ New customer registration + + Forgot Your Password + Password forgotten - - - - mage/captcha.js - - user_forgotpassword - 230 - 50 - - + + + + + + + + + Reset a Password + + + + + + + + Reset a Password + + + + + + + @@ -217,21 +219,21 @@ Customer account pages, rendered for all tabs in dashboard - - - - my-account - - - - - + + + 20 accountcustomer/account/ account_editcustomer/account/edit/ address_bookcustomer/address/ - + customer_account_navigation + + + + + my-account + @@ -283,5 +285,5 @@ Customer account address edit page - + diff --git a/app/design/frontend/default/iphone/layout/newsletter.xml b/app/design/frontend/default/iphone/layout/newsletter.xml new file mode 100644 index 0000000000..2cec4f7e3c --- /dev/null +++ b/app/design/frontend/default/iphone/layout/newsletter.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + newsletternewsletter/manage/ + + + + + + + + + + + 1 + + + + + + diff --git a/app/design/frontend/default/iphone/layout/page.xml b/app/design/frontend/default/iphone/layout/page.xml index 5dceaacc5b..a0ec67bc20 100644 --- a/app/design/frontend/default/iphone/layout/page.xml +++ b/app/design/frontend/default/iphone/layout/page.xml @@ -33,8 +33,8 @@ Default layout, loads most of the pages + - css/iphone.css @@ -47,11 +47,15 @@ Default layout, loads most of the pages + + + + skin_jsjs/modernizr.js skin_jsjs/iphone.js skin_jsjs/dnd.js - skin_jsjs/modernizr.js - + css/iphone.css + css/custom.css @@ -61,61 +65,42 @@ Default layout, loads most of the pages + - - + + top-container - - checkout/cartheader.phtml - checkout/cart/noItemsHeader.phtml - - simplecheckout/cart_item_renderer - groupedcheckout/cart_item_renderer_grouped - configurablecheckout/cart_item_renderer_configurable - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + bottom-container + @@ -127,13 +112,38 @@ Default layout, loads most of the pages - + + + + + + + + + + + + + css/styles.css + skin_csscss/styles-ie.csslt IE 8 + css/print.cssmedia="print" + + + + + + + + + + 1 + empty @@ -143,6 +153,7 @@ Default layout, loads most of the pages 1 + one_column @@ -152,6 +163,7 @@ Default layout, loads most of the pages 1 + two_columns_left @@ -161,6 +173,7 @@ Default layout, loads most of the pages 1 + two_columns_right @@ -170,6 +183,7 @@ Default layout, loads most of the pages 1 + three_columns diff --git a/app/design/frontend/default/iphone/layout/persistent.xml b/app/design/frontend/default/iphone/layout/persistent.xml deleted file mode 100644 index 2f8403aaba..0000000000 --- a/app/design/frontend/default/iphone/layout/persistent.xml +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - + + + + + + Add to Cart + + + + + + Product Details and Comment + + + + + + + + + + + + wishlist_customer_sidebar + + + + + + + + + + + + wishlist_customer_sidebar + + + + + + + + + + + product.info.addto + product.info.addto + + + + + + + + + + + diff --git a/app/design/frontend/default/iphone/locale/en_US/translate.csv b/app/design/frontend/default/iphone/locale/en_US/translate.csv index 5caac30b89..e69de29bb2 100644 --- a/app/design/frontend/default/iphone/locale/en_US/translate.csv +++ b/app/design/frontend/default/iphone/locale/en_US/translate.csv @@ -1,7 +0,0 @@ -"My Account","Account" -"My Wishlist","Wishlist" -"My Wishlist (%d item)","Wishlist (%d)" -"My Wishlist (%d items)","Wishlist (%d)" -"My Cart","Cart" -"My Cart (%s item)","Cart (%s)" -"My Cart (%s items)","Cart (%s)" \ No newline at end of file diff --git a/app/design/frontend/default/iphone/template/catalog/category/view.phtml b/app/design/frontend/default/iphone/template/catalog/category/view.phtml new file mode 100644 index 0000000000..69af215c95 --- /dev/null +++ b/app/design/frontend/default/iphone/template/catalog/category/view.phtml @@ -0,0 +1,70 @@ + + +helper('catalog/output'); + $_category = $this->getCurrentCategory(); + $_categoryTitle = '

    '.$_helper->categoryAttribute($_category, $_category->getName(), 'name').'

    '; + $_imgUrl = $_category->getImageUrl(); + $_imgHtml = ''; + if ($_imgUrl) { + $_imgHtml = '

    '.$this->escapeHtml($_category->getName()).'

    '; + $_imgHtml = $_helper->categoryAttribute($_category, $_imgHtml, 'image'); + } +?> +getMessagesBlock()->toHtml() ?> +
    + + + + + getCurrentCategory()->getDescription()): ?> +
    + categoryAttribute($_category, $_description, 'description') ?> +
    + + + isContentMode()): ?> + + getCmsBlockHtml() ?> + + isMixedMode()): ?> + getCmsBlockHtml() ?> + + getProductListHtml() ?> + + + + getProductListHtml() ?> + +
    diff --git a/app/design/frontend/default/iphone/template/catalog/layer/view.phtml b/app/design/frontend/default/iphone/template/catalog/layer/view.phtml index 9d57c48577..7ed0fa57ed 100644 --- a/app/design/frontend/default/iphone/template/catalog/layer/view.phtml +++ b/app/design/frontend/default/iphone/template/catalog/layer/view.phtml @@ -32,23 +32,24 @@ */ ?> canShowBlock()): ?> -
    -
    -

    __('Shop By') ?>

    -
    - getStateHtml() ?> - canShowOptions()): ?> - getFilters() ?> - +
    + getStateHtml() ?> + getLayer()->getState()->getFilters()): ?> + + +
    + canShowOptions()): ?> +

    __('Shop By') ?>

    + getFilters() ?> + getItemsCount()): ?>
    __($_filter->getName()) ?>
    getHtml() ?>
    - - -
    + +
    diff --git a/app/design/frontend/default/iphone/template/catalog/navigation/top.phtml b/app/design/frontend/default/iphone/template/catalog/navigation/top.phtml index a48fa28b19..55396da099 100644 --- a/app/design/frontend/default/iphone/template/catalog/navigation/top.phtml +++ b/app/design/frontend/default/iphone/template/catalog/navigation/top.phtml @@ -39,9 +39,6 @@ * string If specified wraps children list in div with this class */ ?> -
    - <?php echo $this->__('Front Banner')?> -
    renderCategoriesMenuHtml(0,'level-top') ?>
  • - __('Clear All') ?> - __('Compare Products') ?> __('(%d)', $_helper->getItemCount()) ?> -
  • - - diff --git a/app/design/frontend/default/iphone/template/catalog/product/gallery.phtml b/app/design/frontend/default/iphone/template/catalog/product/gallery.phtml index 3abe86c1b7..4d1b7360ea 100644 --- a/app/design/frontend/default/iphone/template/catalog/product/gallery.phtml +++ b/app/design/frontend/default/iphone/template/catalog/product/gallery.phtml @@ -26,29 +26,21 @@ ?> helper('catalog/output'); ?> getProduct(); ?> -
    - - Add to Cart - -
    -
    -
    + + - + + + +
    diff --git a/app/design/frontend/default/iphone/template/catalog/product/list/toolbar.phtml b/app/design/frontend/default/iphone/template/catalog/product/list/toolbar.phtml index dc8a9aebec..6c3b6749b3 100644 --- a/app/design/frontend/default/iphone/template/catalog/product/list/toolbar.phtml +++ b/app/design/frontend/default/iphone/template/catalog/product/list/toolbar.phtml @@ -49,50 +49,23 @@ isExpanded() ): ?>
    - - getAvailableOrders() as $_key=>$_order): ?> - getCurrentDirection() == 'desc'): ?> -   - -   - +
    -isExpanded() ): ?> -
    -
    - - __('per page') ?> -
    - isEnabledViewSwitcher() ): ?> -

    - getModes(); ?> - 1): ?> - - getModes() as $_code=>$_label): ?> - isModeActive($_code)): ?> -   - -   - - - -

    -
    - - diff --git a/app/design/frontend/default/iphone/template/catalog/product/list/upsell.phtml b/app/design/frontend/default/iphone/template/catalog/product/list/upsell.phtml index 2ee353c52a..d5f0dbe6b4 100644 --- a/app/design/frontend/default/iphone/template/catalog/product/list/upsell.phtml +++ b/app/design/frontend/default/iphone/template/catalog/product/list/upsell.phtml @@ -25,29 +25,23 @@ */ ?> getItemCollection()->getItems())): ?> -
    -
    - __('Remove All')?> + getChildHtml('shopping.cart.table.after'); ?> +
    + getChildHtml('crosssell') ?> +
    + + getChildHtml('checkout.cart.extra') ?> + getChildHtml('checkout_cart_widget') ?> + getChildHtml('coupon') ?> + getChildHtml('giftcards') ?> + getChildHtml('giftregistry.cart.link') ?> +
    + getIsVirtual()): echo $this->getChildHtml('shipping'); endif; ?>
    - -
    - getChildHtml('coupon') ?> - getChildHtml('giftcards') ?> +
    + getChildHtml('totals'); ?>
    + hasError()): ?> +
      + getMethods('methods') as $method): ?> + getMethodHtml($method); ?> + +
    • + + +
    + - -
    diff --git a/app/design/frontend/default/iphone/template/checkout/cart/coupon.phtml b/app/design/frontend/default/iphone/template/checkout/cart/coupon.phtml deleted file mode 100644 index b84c860898..0000000000 --- a/app/design/frontend/default/iphone/template/checkout/cart/coupon.phtml +++ /dev/null @@ -1,59 +0,0 @@ - -
    -

    __('Discount Codes') ?>

    -
    -
    - - -
    - -
    -
    - -
    - getCouponCode())): ?> - __('Cancel Coupon') ?> - -
    -
    - -
    diff --git a/app/design/frontend/default/iphone/template/checkout/cart/item/default.phtml b/app/design/frontend/default/iphone/template/checkout/cart/item/default.phtml index f13db782b9..23ed75295c 100644 --- a/app/design/frontend/default/iphone/template/checkout/cart/item/default.phtml +++ b/app/design/frontend/default/iphone/template/checkout/cart/item/default.phtml @@ -24,11 +24,40 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> -getItem()?> -canApplyMsrp($_item->getProduct(), Mage_Catalog_Model_Product_Attribute_Source_Msrp_Type::TYPE_BEFORE_ORDER_CONFIRM); ?> +getItem(); +$isVisibleProduct = $_item->getProduct()->isVisibleInSiteVisibility(); +$canApplyMsrp = Mage::helper('catalog')->canApplyMsrp($_item->getProduct(), Mage_Catalog_Model_Product_Attribute_Source_Msrp_Type::TYPE_BEFORE_ORDER_CONFIRM); +$messages = $this->getMessages(); +$_options = $this->getOptionList(); +?> + + + + + +

    * escapeHtml($message['text']) ?>

    + + + + - hasProductUrl()):?><?php echo $this->escapeHtml($this->getProductName()) ?>hasProductUrl()):?> + + hasProductUrl()):?> + <?php echo $this->escapeHtml($this->getProductName()) ?>hasProductUrl()):?> + + + getOptionList()): ?> +

    __('Edit') ?>

    + + + + + + + __('Remove item')?> +

    hasProductUrl()):?> escapeHtml($this->getProductName()) ?> @@ -36,233 +65,240 @@ escapeHtml($this->getProductName()) ?>

    - getOptionList()):?> -
    - - getFormatedOptionValue($_option) ?> -
    escapeHtml($_option['label']) ?>
    - class="truncated"> - -
    -
    -
    escapeHtml($_option['label']) ?>
    -
    -
    -
    - - - -
    - - getMessages()): ?> - -

    *

    - - - getProductAdditionalInformationBlock()):?> - setItem($_item)->toHtml() ?> + + getProductAdditionalInformationBlock(); ?> + + setItem($_item)->toHtml() ?> - - - __('See price before order confirmation.'); ?> - getId(); ?> - __("What's this?"); ?> - - - +
    - helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()): ?> - helper('tax')->displayCartBothPrices()): ?> - helper('tax')->getIncExcText(false) ?> - - typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - - +
    + + getQty() == 1) echo ' style="display:none;"' ?>>× +
    + +
    getQty() == 1) echo ' style="display:none;"' ?>> + + - - typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - helper('checkout')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?> - - helper('checkout')->formatPrice($_item->getCalculationPrice()) ?> + __('See price before order confirmation.'); ?> + getId(); ?> + __("What's this?"); ?> + + + + + helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()): ?> + + typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + + + + + typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + helper('checkout')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?> + + helper('checkout')->formatPrice($_item->getCalculationPrice()) ?> + + + + + + getApplied($_item)): ?> + + + + typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> +
    + __('Total'); ?>: helper('checkout')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?> +
    + + + -
    - - getApplied($_item)): ?> - - typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> -
    - __('Total'); ?>: helper('checkout')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?> -
    + + typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + helper('checkout')->formatPrice($_incl+$_item->getWeeeTaxAppliedAmount()); ?> + + helper('checkout')->formatPrice($_incl-$_item->getWeeeTaxDisposition()) ?> + + + + getApplied($_item)): ?> + + + + typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> +
    + __('Total incl. tax'); ?>: helper('checkout')->formatPrice($_incl+$_item->getWeeeTaxAppliedAmount()); ?> +
    + + + - +
    - helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()): ?> - helper('tax')->displayCartBothPrices()): ?> - helper('tax')->getIncExcText(true) ?> - - helper('checkout')->getPriceInclTax($_item); ?> - typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - - - - +
    - typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - helper('checkout')->formatPrice($_incl+$_item->getWeeeTaxAppliedAmount()); ?> + helper('tax')->displayCartPriceExclTax() && !$_item->getNoSubtotal()): ?> + + typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + - helper('checkout')->formatPrice($_incl-$_item->getWeeeTaxDisposition()) ?> + - - getApplied($_item)): ?> - - - typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> -
    - __('Total incl. tax'); ?>: helper('checkout')->formatPrice($_incl+$_item->getWeeeTaxAppliedAmount()); ?> + + getApplied($_item)): ?> + + + + typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> +
    + __('Total'); ?>: helper('checkout')->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?> +
    + - - - - + - - __('Qty'); ?> - - - helper('tax')->displayCartBothPrices()): ?> - helper('tax')->getIncExcText(false) ?> - + helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()) && !$_item->getNoSubtotal()): ?> - helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()): ?> - typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - - - - - - - -- - - typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - helper('checkout')->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?> - - helper('checkout')->formatPrice($_item->getRowTotal()) ?> - - - - - getApplied($_item)): ?> - - - typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> -
    - __('Total'); ?>: helper('checkout')->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?> -
    - + + -- + + typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + helper('checkout')->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?> + + helper('checkout')->formatPrice($_incl-$_item->getWeeeTaxRowDisposition()) ?> + + - - +
    - helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()): ?> - helper('tax')->displayCartBothPrices()): ?> - helper('tax')->getIncExcText(true) ?> - - helper('checkout')->getSubtotalInclTax($_item); ?> - typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - - - - - - -- - - typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - helper('checkout')->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?> - - helper('checkout')->formatPrice($_incl-$_item->getWeeeTaxRowDisposition()) ?> - - - - - getApplied($_item)): ?> - - typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> -
    - __('Total incl. tax'); ?>: helper('checkout')->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?> -
    - - + +
    + +
    + - - <?php echo $this->__('Remove item')?> + + + + + Show Options + + diff --git a/app/design/frontend/default/iphone/template/checkout/cart/sidebar.phtml b/app/design/frontend/default/iphone/template/checkout/cart/sidebar.phtml deleted file mode 100644 index 068d258a3d..0000000000 --- a/app/design/frontend/default/iphone/template/checkout/cart/sidebar.phtml +++ /dev/null @@ -1,79 +0,0 @@ - -getIsNeedToDisplaySideBar()):?> -getSummaryCount() ?> -
    -
    - getRecentItems() ?> - -
      - - getItemHtml($_item) ?> - -
    - - -

    __('You have no items in your shopping cart.') ?>

    - - - 0): ?> -
    -
    - -

    __('There is 1 item in your cart.', $this->getUrl('checkout/cart')) ?>

    - -

    __('There are %s items in your cart.', $this->getUrl('checkout/cart'), $_cartQty) ?>

    - -

    - canApplyMsrp()): ?> - __('ORDER TOTAL WILL BE DISPLAYED BEFORE YOU SUBMIT THE ORDER'); ?> - - __('Cart Subtotal:') ?> formatPrice($this->getSubtotal()) ?> - getSubtotalInclTax()): ?> -
    (formatPrice($_subtotalInclTax) ?> getIncExcText(true) ?>) - - -

    -
    - isPossibleOnepageCheckout()): ?> -
    - getChildHtml('extra_actions') ?> - -
    - -
    - -
    -
    - diff --git a/app/design/frontend/default/iphone/template/checkout/cartheader.phtml b/app/design/frontend/default/iphone/template/checkout/cartheader.phtml deleted file mode 100644 index 61af0e3b00..0000000000 --- a/app/design/frontend/default/iphone/template/checkout/cartheader.phtml +++ /dev/null @@ -1,100 +0,0 @@ - - -
    -
    -
    - - getMessagesBlock()->getGroupedHtml() ?> - getChildHtml('form_before') ?> -
    -
    - <?php echo $this->__('Remove All')?> - - - - - - - - - - getItems() as $_item): ?> - getItemHtml($_item) ?> - - -
    -
    -
    - - -
    - getChildHtml('coupon') ?> - getChildHtml('giftcards') ?> -
    - - - - -
    -
    -
    diff --git a/app/design/frontend/default/iphone/template/checkout/onepage/login.phtml b/app/design/frontend/default/iphone/template/checkout/onepage/login.phtml deleted file mode 100644 index 11873ab678..0000000000 --- a/app/design/frontend/default/iphone/template/checkout/onepage/login.phtml +++ /dev/null @@ -1,123 +0,0 @@ - -
    - getChildHtml('login_before')?> -
    -

    getQuote()->isAllowedGuestCheckout() ): ?>__('Checkout as a Guest or Register') ?>__('Register to Create an Account') ?>

    - getQuote()->isAllowedGuestCheckout() ): ?> -

    __('Register with us for future convenience:') ?>

    - -

    __('Register and save time!') ?>
    - __('Register with us for future convenience:') ?>

    -
      -
    • __('Fast and easy check out') ?>
    • -
    • __('Easy access to your order history and status') ?>
    • -
    - - getQuote()->isAllowedGuestCheckout() ): ?> -
      - getQuote()->isAllowedGuestCheckout() ): ?> -
    • - getQuote()->getCheckoutMethod()==Mage_Checkout_Model_Type_Onepage::METHOD_GUEST): ?> checked="checked" class="radio" /> -
    • - -
    • - getQuote()->getCheckoutMethod()==Mage_Checkout_Model_Type_Onepage::METHOD_REGISTER || !$this->getQuote()->isAllowedGuestCheckout()): ?> checked="checked" class="radio" /> -
    • -
    -

    __('Register and save time!') ?>

    -

    __('Register with us for future convenience:') ?>

    -
      -
    • __('Fast and easy check out') ?>
    • -
    • __('Easy access to your order history and status') ?>
    • -
    - - - -
    -
    -

    __('Login') ?>

    - getMessagesBlock()->getGroupedHtml() ?> -
    -
    -

    __('Already registered?') ?>

    -

    __('Please log in below:') ?>

    -
      -
    • - -
      - -
      -
    • -
    • - -
      - -
      -
    • - isRequired('user_login')): ?> - getChildHtml('captcha') ?> - -
    -
    -
    -
    -
    -
    -
    -
    -

     

    - -
    -
    -
    -
    -

    __('* Required Fields') ?>

    - __('Forgot your password?') ?> - -
    -
    -
    - diff --git a/app/design/frontend/default/iphone/template/checkout/onepage/review/info.phtml b/app/design/frontend/default/iphone/template/checkout/onepage/review/info.phtml index 16839f6cd1..23141d1f0b 100644 --- a/app/design/frontend/default/iphone/template/checkout/onepage/review/info.phtml +++ b/app/design/frontend/default/iphone/template/checkout/onepage/review/info.phtml @@ -26,41 +26,22 @@ ?> getChildHtml('items_before'); ?>
    - - - - - +
    + getChildHtml('totals'); ?> - - - + - helper('tax')->displayCartBothPrices()): ?> - - - getChildHtml('totals'); ?> - getItems() as $_item): ?> getItemHtml($_item)?> -
    __('Product Name') ?>__('Price') ?>__('Qty') ?>__('Subtotal') ?>__('Subtotal') ?>
    getChildHtml('items_after'); ?> diff --git a/app/design/frontend/default/iphone/template/checkout/onepage/review/item.phtml b/app/design/frontend/default/iphone/template/checkout/onepage/review/item.phtml index 9e74ac12cb..e271bd3851 100644 --- a/app/design/frontend/default/iphone/template/checkout/onepage/review/item.phtml +++ b/app/design/frontend/default/iphone/template/checkout/onepage/review/item.phtml @@ -25,217 +25,220 @@ */ ?> getItem()?> - -

    escapeHtml($this->getProductName()) ?>

    - getOptionList()):?> -
    - - getFormatedOptionValue($_option) ?> -
    escapeHtml($_option['label']) ?>
    - class="truncated"> - -
    -
    -
    escapeHtml($_option['label']) ?>
    -
    -
    -
    - - - -
    - - getProductAdditionalInformationBlock()):?> - setItem($_item)->toHtml() ?> - - - - helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()): ?> - typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - - - - - - typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - helper('checkout')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?> - - helper('checkout')->formatPrice($_item->getCalculationPrice()) ?> - - - - - - getApplied($_item)): ?> - - - typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> -
    - __('Total'); ?>:
    helper('checkout')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?>
    -
    - - - - helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()): ?> - helper('tax')->displayCartBothPrices()): ?> - helper('tax')->getIncExcText(true) ?> - - helper('checkout')->getPriceInclTax($_item); ?> - typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - - - - - - typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - helper('checkout')->formatPrice($_incl+$_item->getWeeeTaxAppliedAmount()); ?> - - helper('checkout')->formatPrice($_incl-$_item->getWeeeTaxDisposition()) ?> + typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + helper('checkout')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?> + + helper('checkout')->formatPrice($_item->getCalculationPrice()) ?> + + + + + + getApplied($_item)): ?> + + + + typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> +
    + __('Total'); ?>:
    helper('checkout')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?>
    +
    + + - -
    - getApplied($_item)): ?> - - - typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> -
    - __('Total incl. tax'); ?>:
    helper('checkout')->formatPrice($_incl+$_item->getWeeeTaxAppliedAmount()); ?>
    -
    - - - - - getQty() ?> - - helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()): ?> - typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - - - - - - typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - helper('checkout')->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?> - - helper('checkout')->formatPrice($_item->getRowTotal()) ?> + typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + helper('checkout')->formatPrice($_incl+$_item->getWeeeTaxAppliedAmount()); ?> + + helper('checkout')->formatPrice($_incl-$_item->getWeeeTaxDisposition()) ?> + + + + getApplied($_item)): ?> + + + + typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> +
    + __('Total incl. tax'); ?>:
    helper('checkout')->formatPrice($_incl+$_item->getWeeeTaxAppliedAmount()); ?>
    +
    + + - -
    - getApplied($_item)): ?> - - - typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> -
    - __('Total'); ?>:
    helper('checkout')->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?>
    -
    - - - - helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()): ?> - helper('tax')->displayCartBothPrices()): ?> - helper('tax')->getIncExcText(true) ?> - - helper('checkout')->getSubtotalInclTax($_item); ?> - typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - - - - - - typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - helper('checkout')->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?> - - helper('checkout')->formatPrice($_incl-$_item->getWeeeTaxRowDisposition()) ?> + typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + helper('checkout')->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?> + + helper('checkout')->formatPrice($_item->getRowTotal()) ?> + + + + getApplied($_item)): ?> + + + + typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> +
    + __('Total'); ?>:
    helper('checkout')->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?>
    +
    + + -
    - + helper('tax')->displayCartPriceInclTax()): ?> - getApplied($_item)): ?> - - - typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> -
    - __('Total incl. tax'); ?>:
    helper('checkout')->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?>
    -
    + typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + helper('checkout')->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?> + + helper('checkout')->formatPrice($_incl-$_item->getWeeeTaxRowDisposition()) ?> + + +
    + + + getApplied($_item)): ?> + + + + typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> +
    + __('Total incl. tax'); ?>:
    helper('checkout')->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?>
    +
    + + - - - - + + + diff --git a/app/design/frontend/default/iphone/template/checkout/onepage/review/totals.phtml b/app/design/frontend/default/iphone/template/checkout/onepage/review/totals.phtml index 8d3a0a2992..ec51879096 100644 --- a/app/design/frontend/default/iphone/template/checkout/onepage/review/totals.phtml +++ b/app/design/frontend/default/iphone/template/checkout/onepage/review/totals.phtml @@ -30,7 +30,7 @@ ?> getTotals()): ?> - + renderTotals(null, $_colspan); ?> renderTotals('footer', $_colspan); ?> needDisplayBaseGrandtotal()):?> diff --git a/app/design/frontend/default/iphone/template/checkout/success.phtml b/app/design/frontend/default/iphone/template/checkout/success.phtml new file mode 100644 index 0000000000..741725b9df --- /dev/null +++ b/app/design/frontend/default/iphone/template/checkout/success.phtml @@ -0,0 +1,66 @@ + +
    +

    __('Your order has been received') ?>

    +
    +
    + getMessagesBlock()->getGroupedHtml() ?> +

    __('Thank you for your purchase!') ?>

    + + getOrderId()):?> + getCanViewOrder()) :?> +

    __('Your order # is: %s.', sprintf('%s', $this->escapeHtml($this->getViewOrderUrl()), $this->escapeHtml($this->getOrderId()))) ?>

    + +

    __('Your order # is: %s.', $this->escapeHtml($this->getOrderId())) ?>

    + +

    __('You will receive an order confirmation email with details of your order and a link to track its progress.') ?>

    + getCanViewOrder() && $this->getCanPrintOrder()) :?> +

    + __('Click here to print a copy of your order confirmation.', $this->getPrintUrl()) ?> + getChildHtml() ?> +

    + + + + getAgreementRefId()): ?> +

    __('Your billing agreement # is: %s.', sprintf('%s', $this->escapeHtml($this->getAgreementUrl()), $this->escapeHtml($this->getAgreementRefId())))?>

    + + + getRecurringProfiles()):?> +

    __('Your recurring payment profiles:'); ?>

    +
      + + getCanViewProfiles() ? sprintf('%s', $this->escapeHtml($this->getProfileUrl($profile)), $this->escapeHtml($this->getObjectData($profile, 'reference_id'))) : $this->escapeHtml($this->getObjectData($profile, 'reference_id')));?> +
    • __('Payment profile # %s: "%s".', $profileIdHtml, $this->escapeHtml($this->getObjectData($profile, 'schedule_description')))?>
    • + +
    + + +
    + +
    +
    diff --git a/app/design/frontend/default/iphone/template/customer/account/dashboard/address.phtml b/app/design/frontend/default/iphone/template/customer/account/dashboard/address.phtml new file mode 100644 index 0000000000..4246c41255 --- /dev/null +++ b/app/design/frontend/default/iphone/template/customer/account/dashboard/address.phtml @@ -0,0 +1,45 @@ + +
    +

    __('Address Book') ?> | __('Manage Addresses') ?>

    +
    +
    +

    __('Default Billing Address') ?> | __('Edit') ?>

    +
    + getPrimaryBillingAddressHtml() ?> +
    +
    +
    +
    +
    +

    __('Default Shipping Address') ?> | __('Edit') ?>

    +
    + getPrimaryShippingAddressHtml() ?> +
    +
    +
    +
    diff --git a/app/design/frontend/default/iphone/template/customer/account/navigation.phtml b/app/design/frontend/default/iphone/template/customer/account/navigation.phtml index dcd74046ae..acd581e4c3 100644 --- a/app/design/frontend/default/iphone/template/customer/account/navigation.phtml +++ b/app/design/frontend/default/iphone/template/customer/account/navigation.phtml @@ -24,39 +24,13 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> - -Show() - +getLinks(); ?> + + + + isActive($_link)): ?> + + + + + diff --git a/app/design/frontend/default/iphone/template/customer/address/book.phtml b/app/design/frontend/default/iphone/template/customer/address/book.phtml new file mode 100644 index 0000000000..e12bd7e491 --- /dev/null +++ b/app/design/frontend/default/iphone/template/customer/address/book.phtml @@ -0,0 +1,107 @@ + + +
    +

    __('Address Book') ?>

    + +
    +getMessagesBlock()->getGroupedHtml() ?> +
    +
    +

    __('Default Addresses') ?>

    +
      + getCustomer()->getDefaultBilling()): ?> +
    1. +

      __('Default Billing Address') ?> | __('Edit') ?>

      +
      + getAddressHtml(Mage::getSingleton('customer/session')->getCustomer()->getAddressById($_pAddsses)) ?> +
      +
    2. + +
    3. +

      __('Default Billing Address') ?>

      +

      __('You have no default billing address in your address book.') ?>

      +
    4. + + + getCustomer()->getDefaultShipping()): ?> +
    5. +

      __('Default Shipping Address') ?> | __('Edit') ?>

      +
      + getAddressHtml(Mage::getSingleton('customer/session')->getCustomer()->getAddressById($_pAddsses)) ?> +
      +
    6. + +
    7. +

      __('Default Shipping Address') ?>

      +

      __('You have no default shipping address in your address book.') ?>

      +
    8. + +
    +
    +
    +

    __('Additional Address Entries') ?>

    +
      + getAdditionalAddresses()): ?> + +
    1. +
      + getAddressHtml($_address) ?>
      +
      +

      + __('Edit Address') ?> + | + __('Delete Address') ?> +

      +
    2. + + +
    3. +

      __('You have no additional address entries in your address book.') ?>

      +
    4. + +
    +
    +
    + + diff --git a/app/design/frontend/default/iphone/template/customer/form/edit.phtml b/app/design/frontend/default/iphone/template/customer/form/edit.phtml deleted file mode 100644 index 2075565b65..0000000000 --- a/app/design/frontend/default/iphone/template/customer/form/edit.phtml +++ /dev/null @@ -1,115 +0,0 @@ - -
    -

    __('Edit Account Information') ?>

    -
    - - diff --git a/app/design/frontend/default/iphone/template/customer/form/forgotpassword.phtml b/app/design/frontend/default/iphone/template/customer/form/forgotpassword.phtml deleted file mode 100644 index ba354c0da6..0000000000 --- a/app/design/frontend/default/iphone/template/customer/form/forgotpassword.phtml +++ /dev/null @@ -1,49 +0,0 @@ - -
    -

    - __('Back to Login') ?> - __('Retrieve Password') ?> -

    - getMessagesBlock()->getGroupedHtml() ?> -
    -

    __('Retrieve your password here') ?>

    - - - isRequired('user_forgotpassword')): ?> -
      - getChildHtml('captcha') ?> -
    - - -
    -
    - diff --git a/app/design/frontend/default/iphone/template/customer/form/login.phtml b/app/design/frontend/default/iphone/template/customer/form/login.phtml index ea69231867..a6d2ac1f71 100644 --- a/app/design/frontend/default/iphone/template/customer/form/login.phtml +++ b/app/design/frontend/default/iphone/template/customer/form/login.phtml @@ -31,39 +31,55 @@ * @see Mage_Customer_Block_Form_Login */ ?> -
    - - - - diff --git a/app/design/frontend/default/iphone/template/persistent/remember_me_tooltip.phtml b/app/design/frontend/default/iphone/template/persistent/remember_me_tooltip.phtml new file mode 100644 index 0000000000..61757370f8 --- /dev/null +++ b/app/design/frontend/default/iphone/template/persistent/remember_me_tooltip.phtml @@ -0,0 +1,61 @@ + + + + + diff --git a/app/design/frontend/default/iphone/template/review/customer/list.phtml b/app/design/frontend/default/iphone/template/review/customer/list.phtml new file mode 100644 index 0000000000..0af80dea8c --- /dev/null +++ b/app/design/frontend/default/iphone/template/review/customer/list.phtml @@ -0,0 +1,58 @@ + +
    +

    __('My Product Reviews') ?>

    +
    +
    + getMessagesBlock()->getGroupedHtml() ?> + getCollection() && $this->count()): ?> + getToolbarHtml() ?> +
      + getCollection() as $_review): ?> +
    1. +
      +
      +

      escapeHtml($_review->getName()) ?>

      + (dateFormat($_review->getReviewCreatedAt()); ?>) +
      + getSum()): ?> +
      +
      +
      +
      +
      + +
      helper('review')->getDetailHtml($_review->getDetail()) ?>
      +
      __('View Details') ?>
      +
      +
    2. + +
    + +

    __('You have submitted no reviews.') ?>

    + +
    diff --git a/app/design/frontend/default/iphone/template/sales/billing/agreement/view.phtml b/app/design/frontend/default/iphone/template/sales/billing/agreement/view.phtml new file mode 100644 index 0000000000..48097bf143 --- /dev/null +++ b/app/design/frontend/default/iphone/template/sales/billing/agreement/view.phtml @@ -0,0 +1,110 @@ + + +
    +

    __('Billing Agreement # %s', $this->escapeHtml($this->getReferenceId())) ?>

    + getCanCancel()): ?> + __('Cancel') ?> + +
    +getMessagesBlock()->getGroupedHtml() ?> +
    +
    +

    __('Agreement Information') ?>

    +
    + + + + + + + + + + + + + + + getAgreementUpdatedAt()): ?> + + + + + + + + + + +
    __('Reference ID:') ?>escapeHtml($this->getReferenceId()); ?>
    __('Status:') ?>getAgreementStatus() ?>
    __('Created:') ?>escapeHtml($this->getAgreementCreatedAt()) ?>
    __('Updated:') ?>escapeHtml($this->getAgreementUpdatedAt()); ?>
    __('Payment Method:') ?>getPaymentMethodTitle() ?>
    +
    +
    + getRelatedOrders() ?> + 0): ?> + getChildHtml('pager'); ?> +

    __('Related Orders') ?>

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    diff --git a/app/design/frontend/default/iphone/template/sales/billing/agreements.phtml b/app/design/frontend/default/iphone/template/sales/billing/agreements.phtml new file mode 100644 index 0000000000..dfc6159622 --- /dev/null +++ b/app/design/frontend/default/iphone/template/sales/billing/agreements.phtml @@ -0,0 +1,98 @@ + + +
    +

    __('Billing Agreements') ?>

    +
    + +getMessagesBlock()->getGroupedHtml() ?> + +
    + getBillingAgreements(); ?> + 0): ?> + getChildHtml('pager'); ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    __('Reference ID'); ?>
    getItemValue($item, 'reference_id') ?>
    __('Status'); ?>
    getItemValue($item, 'status') ?>
    __('Created At'); ?>
    getItemValue($item, 'created_at') ?>
    __('Updated At'); ?>
    getItemValue($item, 'updated_at') ?>
    __('Payment Method'); ?>
    getItemValue($item, 'payment_method_label') ?>
    __('View') ?>
    + +

    __('There are no billing agreements yet.')?>

    + + + getWizardPaymentMethodOptions() ?> + +
    +

    __('New Billing Agreement') ?>

    +
    +
    +

    __('You will be redirected to the payment system website.') ?>

    +
      +
    • + + +
    • +
    +
    +
    +
    + + + +
    diff --git a/app/design/frontend/default/iphone/template/sales/order/creditmemo/items.phtml b/app/design/frontend/default/iphone/template/sales/order/creditmemo/items.phtml new file mode 100644 index 0000000000..544704feae --- /dev/null +++ b/app/design/frontend/default/iphone/template/sales/order/creditmemo/items.phtml @@ -0,0 +1,44 @@ + +getOrder() ?> + +getCreditmemosCollection() as $_creditmemo): ?> +

    __('Refund #') ?>getIncrementId(); ?> | __('Print Refund') ?>

    +

    __('Items Refunded') ?>

    + + + getTotalsHtml($_creditmemo);?> + + getAllItems(); ?> + + + getOrderItem()->getParentItem()) continue; ?> + getItemHtml($_item) ?> + +
    +getCommentsHtml($_creditmemo)?> + diff --git a/app/design/frontend/default/iphone/template/sales/order/creditmemo/items/renderer/default.phtml b/app/design/frontend/default/iphone/template/sales/order/creditmemo/items/renderer/default.phtml new file mode 100644 index 0000000000..6afb31d308 --- /dev/null +++ b/app/design/frontend/default/iphone/template/sales/order/creditmemo/items/renderer/default.phtml @@ -0,0 +1,322 @@ + +getItem() ?> +getItem()->getOrderItem()->getOrder() ?> + + + __('Product Name') ?> +

    escapeHtml($_item->getName()) ?>

    + getItemOptions()): ?> +
    + +
    escapeHtml($_option['label']) ?>
    + getPrintStatus()): ?> + getFormatedOptionValue($_option) ?> + class="truncated"> + +
    +
    +
    escapeHtml($_option['label']) ?>
    +
    +
    +
    + + + +
    escapeHtml( (isset($_option['print_value']) ? $_option['print_value'] : $_option['value']) ) ?>
    + + +
    + + getProductAdditionalInformationBlock(); ?> + + setItem($_item->getOrderItem())->toHtml(); ?> + + escapeHtml($_item->getDescription()) ?> + helper('giftmessage/message')->getIsMessagesAvailable('order_item', $_item->getOrderItem()) && $_item->getGiftMessageId()): ?> + __('Gift Message') ?> + + + + + __('SKU') ?> + escapeHtml(Mage::helper('core/string')->splitInjection($this->getSku())) ?> + + __('Price') ?> + + helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?> + + helper('tax')->displaySalesBothPrices()): ?> + typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + + + __('Excl. Tax'); ?>: + typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + + + + typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + + + + + + typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + getOrder()->formatPrice($this->getItem()->getPrice()+$this->getItem()->getWeeeTaxAppliedAmount()+$this->getItem()->getWeeeTaxDisposition()); ?> + + getOrder()->formatPrice($this->getItem()->getPrice()) ?> + + + + + + getApplied($this->getItem())): ?> + + + + typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + + __('Total'); ?>:
    getOrder()->formatPrice($this->getItem()->getPrice()+$this->getItem()->getWeeeTaxAppliedAmount()+$this->getItem()->getWeeeTaxDisposition()); ?>
    +
    + + +
    +
    + + helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?> + + helper('tax')->displaySalesBothPrices()): ?> + typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + + + __('Incl. Tax'); ?>: + typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + + + + helper('checkout')->getPriceInclTax($this->getItem()); ?> + typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + + + + + + typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedAmount()); ?> + + getOrder()->formatPrice($_incl-$this->getItem()->getWeeeTaxDisposition()) ?> + + + + + + getApplied($this->getItem())): ?> + + + + typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + + __('Total incl. tax'); ?>:
    getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedAmount()); ?>
    +
    + + +
    + + + + + __('Qty') ?> + getQty()*1 ?> + + + __('Subtotal') ?> + + helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?> + + helper('tax')->displaySalesBothPrices()): ?> + typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + + + __('Excl. Tax'); ?>: + typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + + + + typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + + + + + + typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + getOrder()->formatPrice($this->getItem()->getRowTotal()+$this->getItem()->getWeeeTaxAppliedRowAmount()+$this->getItem()->getWeeeTaxRowDisposition()); ?> + + getOrder()->formatPrice($this->getItem()->getRowTotal()) ?> + + + + + + getApplied($this->getItem())): ?> + + + + typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + + __('Total'); ?>:
    getOrder()->formatPrice($this->getItem()->getRowTotal()+$this->getItem()->getWeeeTaxAppliedRowAmount()+$this->getItem()->getWeeeTaxRowDisposition()); ?>
    +
    + + +
    +
    + + helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?> + + helper('tax')->displaySalesBothPrices()): ?> + typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + + + __('Incl. Tax'); ?>: + typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + + + + helper('checkout')->getSubtotalInclTax($this->getItem()); ?> + typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + + + + + typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedRowAmount()); ?> + + getOrder()->formatPrice($_incl-$this->getItem()->getWeeeTaxRowDisposition()) ?> + + + + + + getApplied($this->getItem())): ?> + + + + typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + + __('Total incl. tax'); ?>:
    getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedRowAmount()); ?>
    +
    + + + + + +
    + + + + + __('Discount Amount') ?> + formatPrice(-$_item->getDiscountAmount()) ?> + + + __('Row Total') ?> + + formatPrice($_item->getRowTotal()-$_item->getDiscountAmount()+$_item->getTaxAmount()+$_item->getWeeeTaxAppliedRowAmount()) ?> + + + diff --git a/app/design/frontend/default/iphone/template/sales/order/history.phtml b/app/design/frontend/default/iphone/template/sales/order/history.phtml index eb38f82e98..a6bf965eb2 100644 --- a/app/design/frontend/default/iphone/template/sales/order/history.phtml +++ b/app/design/frontend/default/iphone/template/sales/order/history.phtml @@ -24,42 +24,37 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> -getMessagesBlock()->getGroupedHtml() ?> getOrders(); ?>

    __('My Orders') ?>

    -getPagerHtml(); ?> -getSize()): ?> - - - - - - - - - - - - - - - - - - - - - - - - - - -
    __('Order #') ?>__('Date') ?>__('Order Total') ?>__('Order Status') ?> 
    getRealOrderId() ?>formatDate($_order->getCreatedAtStoreDate()) ?>formatPrice($_order->getGrandTotal()) ?>getStatusLabel() ?>
    - -getPagerHtml(); ?> - -

    __('You have placed no orders.'); ?>

    - +
    + getMessagesBlock()->getGroupedHtml() ?> + getChildHtml('info');?> + getPagerHtml(); ?> + getSize()): ?> + + + + + + + + + + + + + + + + + + + + +
    __('Order #') ?>__('Date') ?>__('Total') ?>__('Status') ?>
    getRealOrderId() ?>formatDate($_order->getCreatedAtStoreDate()) ?>formatPrice($_order->getGrandTotal()) ?>getStatusLabel() ?>
    + +

    __('You have placed no orders.'); ?>

    + +
    diff --git a/app/design/frontend/default/iphone/template/sales/order/invoice/items.phtml b/app/design/frontend/default/iphone/template/sales/order/invoice/items.phtml new file mode 100644 index 0000000000..e817192a17 --- /dev/null +++ b/app/design/frontend/default/iphone/template/sales/order/invoice/items.phtml @@ -0,0 +1,44 @@ + +getOrder() ?> + +getInvoiceCollection() as $_invoice): ?> +

    __('Invoice #') ?>getIncrementId(); ?> | __('Print Invoice') ?>

    +

    __('Items Invoiced') ?>

    + + + getInvoiceTotalsHtml($_invoice)?> + + getAllItems(); ?> + + + getOrderItem()->getParentItem()) continue; ?> + getItemHtml($_item) ?> + +
    +getInvoiceCommentsHtml($_invoice)?> + diff --git a/app/design/frontend/default/iphone/template/sales/order/invoice/items/renderer/default.phtml b/app/design/frontend/default/iphone/template/sales/order/invoice/items/renderer/default.phtml new file mode 100644 index 0000000000..4670faab8c --- /dev/null +++ b/app/design/frontend/default/iphone/template/sales/order/invoice/items/renderer/default.phtml @@ -0,0 +1,312 @@ + +getItem() ?> +getItem()->getOrderItem()->getOrder() ?> + + + __('Product Name') ?> +

    escapeHtml($_item->getName()) ?>

    + getItemOptions()): ?> +
    + +
    escapeHtml($_option['label']) ?>
    + getPrintStatus()): ?> + getFormatedOptionValue($_option) ?> + class="truncated"> + + +
    +
    +
    escapeHtml($_option['label']) ?>
    +
    +
    +
    + + + +
    escapeHtml( (isset($_option['print_value']) ? $_option['print_value'] : $_option['value']) ) ?>
    + + +
    + + getProductAdditionalInformationBlock(); ?> + + setItem($_item->getOrderItem())->toHtml(); ?> + + escapeHtml($_item->getDescription()) ?> + helper('giftmessage/message')->getIsMessagesAvailable('order_item', $_item->getOrderItem()) && $_item->getGiftMessageId()): ?> + __('Gift Message') ?> + + + + __('SKU') ?> + escapeHtml(Mage::helper('core/string')->splitInjection($this->getSku())) ?> + + __('Price') ?> + + helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?> + + helper('tax')->displaySalesBothPrices()): ?> + typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + + + __('Excl. Tax'); ?>: + typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + + + + typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + + + + + + typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + getOrder()->formatPrice($this->getItem()->getPrice()+$this->getItem()->getWeeeTaxAppliedAmount()+$this->getItem()->getWeeeTaxDisposition()); ?> + + getOrder()->formatPrice($this->getItem()->getPrice()) ?> + + + + + + getApplied($this->getItem())): ?> + + + + typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + + __('Total'); ?>:
    getOrder()->formatPrice($this->getItem()->getPrice()+$this->getItem()->getWeeeTaxAppliedAmount()+$this->getItem()->getWeeeTaxDisposition()); ?>
    +
    + + +
    +
    + + helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?> + + helper('tax')->displaySalesBothPrices()): ?> + typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + + + __('Incl. Tax'); ?>: + typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + + + + helper('checkout')->getPriceInclTax($this->getItem()); ?> + typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + + + + + + typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedAmount()); ?> + + getOrder()->formatPrice($_incl-$this->getItem()->getWeeeTaxDisposition()) ?> + + + + + + getApplied($this->getItem())): ?> + + + + typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + + __('Total incl. tax'); ?>:
    getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedAmount()); ?>
    +
    + + +
    + + + + + __('Qty Invoiced') ?> + getQty()*1 ?> + + + __('Subtotal') ?> + + helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?> + + helper('tax')->displaySalesBothPrices()): ?> + typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + + + __('Excl. Tax'); ?>: + typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + + + + typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + + + + + + typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + getOrder()->formatPrice($this->getItem()->getRowTotal()+$this->getItem()->getWeeeTaxAppliedRowAmount()+$this->getItem()->getWeeeTaxRowDisposition()); ?> + + getOrder()->formatPrice($this->getItem()->getRowTotal()) ?> + + + + + + getApplied($this->getItem())): ?> + + + + typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + + __('Total'); ?>:
    getOrder()->formatPrice($this->getItem()->getRowTotal()+$this->getItem()->getWeeeTaxAppliedRowAmount()+$this->getItem()->getWeeeTaxRowDisposition()); ?>
    +
    + + +
    +
    + + helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?> + + helper('tax')->displaySalesBothPrices()): ?> + typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + + + __('Incl. Tax'); ?>: + typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + + + + helper('checkout')->getSubtotalInclTax($this->getItem()); ?> + typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + + + + + typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedRowAmount()); ?> + + getOrder()->formatPrice($_incl-$this->getItem()->getWeeeTaxRowDisposition()) ?> + + + + + + getApplied($this->getItem())): ?> + + + + typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + + __('Total incl. tax'); ?>:
    getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedRowAmount()); ?>
    +
    + + + + + +
    + + + + diff --git a/app/design/frontend/default/iphone/template/sales/order/items.phtml b/app/design/frontend/default/iphone/template/sales/order/items.phtml index cf5739d6f9..ac00c81698 100644 --- a/app/design/frontend/default/iphone/template/sales/order/items.phtml +++ b/app/design/frontend/default/iphone/template/sales/order/items.phtml @@ -25,7 +25,7 @@ */ ?> getOrder() ?> - +
    getChildHtml('order_totals') ?> @@ -34,40 +34,6 @@ count(); ?> getParentItem()) continue; ?> - - getItemHtml($_item) ?> - helper('giftmessage/message')->getIsMessagesAvailable('order_item', $_item) && $_item->getGiftMessageId()): ?> - - helper('giftmessage/message')->getGiftMessageForEntity($_item); ?> - - - - + getItemHtml($_item) ?>
    - diff --git a/app/design/frontend/default/iphone/template/sales/order/items/renderer/default.phtml b/app/design/frontend/default/iphone/template/sales/order/items/renderer/default.phtml new file mode 100644 index 0000000000..bf624bb42e --- /dev/null +++ b/app/design/frontend/default/iphone/template/sales/order/items/renderer/default.phtml @@ -0,0 +1,331 @@ + +getItem(); + $_options = $this->getItemOptions(); +?> + + + __('Product Name') ?> +

    escapeHtml($_item->getName()) ?>

    + +
    + +
    escapeHtml($_option['label']) ?>
    + getPrintStatus()): ?> + getFormatedOptionValue($_option) ?> + class="truncated"> + + +
    +
    +
    escapeHtml($_option['label']) ?>
    +
    +
    +
    + + + +
    + escapeHtml( (isset($_option['print_value']) ? $_option['print_value'] : $_option['value']) )) ?> +
    + + +
    + + getProductAdditionalInformationBlock(); ?> + + setItem($_item)->toHtml(); ?> + + escapeHtml($_item->getDescription()) ?> + helper('giftmessage/message')->getIsMessagesAvailable('order_item', $_item) && $_item->getGiftMessageId()): ?> + __('Gift Message') ?> + + + + + __('SKU') ?> + escapeHtml(Mage::helper('core/string')->splitInjection($this->getSku())) ?> + + __('Price') ?> + + helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?> + + helper('tax')->displaySalesBothPrices()): ?> + typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + + + __('Excl. Tax'); ?>: + typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + + + + typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + + + + + + typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + getOrder()->formatPrice($this->getItem()->getPrice()+$this->getItem()->getWeeeTaxAppliedAmount()+$this->getItem()->getWeeeTaxDisposition()); ?> + + getOrder()->formatPrice($this->getItem()->getPrice()) ?> + + + + + + getApplied($this->getItem())): ?> + + + + typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + + __('Total'); ?>:
    getOrder()->formatPrice($this->getItem()->getPrice()+$this->getItem()->getWeeeTaxAppliedAmount()+$this->getItem()->getWeeeTaxDisposition()); ?>
    +
    + + +
    +
    + + helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?> + + helper('tax')->displaySalesBothPrices()): ?> + typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + + + __('Incl. Tax'); ?>: + typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + + + + helper('checkout')->getPriceInclTax($this->getItem()); ?> + typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + + + + + + typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedAmount()); ?> + + getOrder()->formatPrice($_incl-$this->getItem()->getWeeeTaxDisposition()) ?> + + + + + + getApplied($this->getItem())): ?> + + + + typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + + __('Total incl. tax'); ?>:
    getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedAmount()); ?>
    +
    + + +
    + + + + + __('Qty') ?> + + + getItem()->getQtyOrdered() > 0): ?> + __('Ordered'); ?>: getItem()->getQtyOrdered()*1 ?>
    + + getItem()->getQtyShipped() > 0): ?> + __('Shipped'); ?>: getItem()->getQtyShipped()*1 ?>
    + + getItem()->getQtyCanceled() > 0): ?> + __('Canceled'); ?>: getItem()->getQtyCanceled()*1 ?>
    + + getItem()->getQtyRefunded() > 0): ?> + __('Refunded'); ?>: getItem()->getQtyRefunded()*1 ?>
    + +
    + + + __('Subtotal') ?> + + helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?> + + helper('tax')->displaySalesBothPrices()): ?> + typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + + + __('Excl. Tax'); ?>: + typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + + + + typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + + + + + + typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + getOrder()->formatPrice($this->getItem()->getRowTotal()+$this->getItem()->getWeeeTaxAppliedRowAmount()+$this->getItem()->getWeeeTaxRowDisposition()); ?> + + getOrder()->formatPrice($this->getItem()->getRowTotal()) ?> + + + + + + getApplied($this->getItem())): ?> + + + + typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + + __('Total'); ?>:
    getOrder()->formatPrice($this->getItem()->getRowTotal()+$this->getItem()->getWeeeTaxAppliedRowAmount()+$this->getItem()->getWeeeTaxRowDisposition()); ?>
    +
    + + +
    +
    + + helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?> + + helper('tax')->displaySalesBothPrices()): ?> + typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + + + __('Incl. Tax'); ?>: + typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + + + + helper('checkout')->getSubtotalInclTax($this->getItem()); ?> + typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + + + + + typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedRowAmount()); ?> + + getOrder()->formatPrice($_incl-$this->getItem()->getWeeeTaxRowDisposition()) ?> + + + + + + getApplied($this->getItem())): ?> + + + + typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + + __('Total incl. tax'); ?>:
    getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedRowAmount()); ?>
    +
    + + + + + +
    + + + + diff --git a/app/design/frontend/default/iphone/template/sales/order/recent.phtml b/app/design/frontend/default/iphone/template/sales/order/recent.phtml index 36aa40b80b..3f546b0466 100644 --- a/app/design/frontend/default/iphone/template/sales/order/recent.phtml +++ b/app/design/frontend/default/iphone/template/sales/order/recent.phtml @@ -24,30 +24,25 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> - diff --git a/errors/default/page.phtml b/errors/default/page.phtml index 01bd06ba1a..db6a89e532 100644 --- a/errors/default/page.phtml +++ b/errors/default/page.phtml @@ -52,7 +52,7 @@ diff --git a/js/mage/adminhtml/product/composite/configure.js b/js/mage/adminhtml/product/composite/configure.js index 5de34ff9c7..9491b2e0ee 100644 --- a/js/mage/adminhtml/product/composite/configure.js +++ b/js/mage/adminhtml/product/composite/configure.js @@ -585,7 +585,7 @@ ProductConfigure.prototype = { var patternFlat = null; var replacement = null; var replacementFlat = null - var scopeArr = blockItem.id.match(/.*\[\w+\]\[([^\]\s]+)\]$/); + var scopeArr = blockItem.id.match(/.*\[\w+\]\[([^\]]+)\]$/); var itemId = scopeArr[1]; if (method == 'current_confirmed_to_form') { pattern = RegExp('(\\w+)(\\[?)'); @@ -718,7 +718,7 @@ ProductConfigure.prototype = { this.blockFormConfirmed.update(); this.blockConfirmed.childElements().each(function(blockItem) { - var scopeArr = blockItem.id.match(/.*\[(\w+)\]\[([^\]\s]+)\]$/); + var scopeArr = blockItem.id.match(/.*\[(\w+)\]\[([^\]]+)\]$/); var listType = scopeArr[1]; var itemId = scopeArr[2]; if (allowedListTypes[listType] && (!this.itemsFilter[listType] @@ -731,7 +731,7 @@ ProductConfigure.prototype = { case 'form_confirmed_to_confirmed': var listInfo = this.listTypes[this.current.listType]; this.blockFormConfirmed.childElements().each(function(blockItem) { - var scopeArr = blockItem.id.match(/.*\[(\w+)\]\[([^\]\s]+)\]$/); + var scopeArr = blockItem.id.match(/.*\[(\w+)\]\[([^\]]+)\]$/); var listType = scopeArr[1]; _renameFields(method, blockItem, listInfo.complexTypes ? listType : null); this.blockConfirmed.insert(blockItem); diff --git a/js/mage/captcha.js b/js/mage/captcha.js index 9f595f32f6..7e7ca1eac0 100644 --- a/js/mage/captcha.js +++ b/js/mage/captcha.js @@ -64,24 +64,24 @@ document.observe('billing-request:completed', function(event) { document.observe('login:setMethod', function(event) { - switch(event.memo.method){ - case 'guest': - if ($('register_during_checkout')) { - $('captcha-input-box-register_during_checkout').hide(); - $('captcha-image-box-register_during_checkout').hide(); - $('captcha-input-box-guest_checkout').show(); - $('captcha-image-box-guest_checkout').show(); + var switchCaptchaElement = function(shown, hidden) { + var inputPrefix = 'captcha-input-box-', imagePrefix = 'captcha-image-box-'; + if ($(inputPrefix + hidden)) { + $(inputPrefix + hidden).hide(); + $(imagePrefix + hidden).hide(); + } + if ($(inputPrefix + shown)) { + $(inputPrefix + shown).show(); + $(imagePrefix + shown).show(); + } + }; - } + switch (event.memo.method) { + case 'guest': + switchCaptchaElement('guest_checkout', 'register_during_checkout'); break; case 'register': - if ($('guest_checkout')) { - $('captcha-input-box-guest_checkout').hide(); - $('captcha-image-box-guest_checkout').hide(); - $('captcha-input-box-register_during_checkout').show(); - $('captcha-image-box-register_during_checkout').show(); - - } + switchCaptchaElement('register_during_checkout', 'guest_checkout'); break; } }); diff --git a/lib/Varien/Db/Adapter/Interface.php b/lib/Varien/Db/Adapter/Interface.php index 07cbfb144a..ca9706c999 100644 --- a/lib/Varien/Db/Adapter/Interface.php +++ b/lib/Varien/Db/Adapter/Interface.php @@ -58,6 +58,11 @@ interface Varien_Db_Adapter_Interface const INTERVAL_MONTH = 'MONTHS'; const INTERVAL_YEAR = 'YEARS'; + /** + * Error message for DDL query in transactions + */ + const ERROR_DDL_MESSAGE = 'DDL statements are not allowed in transactions'; + /** * Begin new DB transaction for connection * diff --git a/lib/Varien/Db/Adapter/Pdo/Mysql.php b/lib/Varien/Db/Adapter/Pdo/Mysql.php index 257efefc00..d5e9db67a7 100644 --- a/lib/Varien/Db/Adapter/Pdo/Mysql.php +++ b/lib/Varien/Db/Adapter/Pdo/Mysql.php @@ -396,7 +396,7 @@ protected function _checkDdlTransaction($sql) if (is_string($sql) && $this->getTransactionLevel() > 0) { $startSql = strtolower(substr(ltrim($sql), 0, 3)); if (in_array($startSql, $this->_ddlRoutines)) { - throw new Zend_Db_Adapter_Exception('DDL statements are not allowed in transactions'); + trigger_error(Varien_Db_Adapter_Interface::ERROR_DDL_MESSAGE, E_USER_ERROR); } } } diff --git a/skin/adminhtml/default/default/oauth-simple.css b/skin/adminhtml/default/default/oauth-simple.css new file mode 100644 index 0000000000..abc19e2734 --- /dev/null +++ b/skin/adminhtml/default/default/oauth-simple.css @@ -0,0 +1,239 @@ +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category design + * @package base_default + * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ + + /* Reset ================================================================================= */ +* { margin:0; padding:0; } +body { background:#496778 50% 0 repeat-y; font:12px/1.55 Arial, Helvetica, sans-serif; color:#2f2f2f; text-align:center; } +img { border:0; vertical-align:top; } +a { color:#1e7ec8; text-decoration:underline; } +a:hover { text-decoration:none; } +:focus { outline:0; } + +/* Headings */ +h1,h2,h3, +h4,h5,h6 { margin:0 0 5px; line-height:1.35; color:#0a263c; } +h1 { font-size:20px; font-weight:normal; } +h2 { font-size:18px; font-weight:normal; } +h3 { font-size:16px; font-weight:bold; } +h4 { font-size:14px; font-weight:bold; } +h5 { font-size:12px; font-weight:bold; } +h6 { font-size:11px; font-weight:bold; } + +/* Forms */ +form { display:inline; } +fieldset { border:0; } +legend { display:none; } + +/* Table */ +table { border:0; /*border-collapse:collapse;*/ border-spacing:0; empty-cells:show; font-size:100%; } +caption,th,td { vertical-align:top; text-align:left; font-weight:normal; } + +/* Content */ +p { margin:0 0 10px; } +strong { font-weight:bold; } +address { font-style:normal; line-height:1.35; } +cite { font-style:normal; } +q, +blockquote { quotes:none; } +q:before, +q:after { content:''; } +small,big { font-size:1em; } +/*sup { font-size:1em; vertical-align:top; }*/ + +/* Lists */ +ul,ol { list-style:none; } + +/* Tools */ +.hidden { display:block !important; border:0 !important; margin:0 !important; padding:0 !important; font-size:0 !important; line-height:0 !important; width:0 !important; height:0 !important; overflow:hidden !important; } +.nobr { white-space:nowrap !important; } +.wrap { white-space:normal !important; } +.a-left { text-align:left !important; } +.a-center { text-align:center !important; } +.a-right { text-align:right !important; } +.v-top { vertical-align:top; } +.v-middle { vertical-align:middle; } +.f-left, +.left { float:left !important; } +.f-right, +.right { float:right !important; } +.f-none { float:none !important; } +.f-fix { float:left; width:100%; } +.no-display { display:none; } +.no-margin { margin:0 !important; } +.no-padding { padding:0 !important; } +.no-bg { background:none !important; } +/* ======================================================================================= */ + +/* Default styles ======================================================================== */ +/* boxes.css*/ +.notification-global { + background: url("./images/error_msg_icon.gif") no-repeat scroll 27px 5px #FFF9E9; + border-bottom: 1px solid #EEE2BE; + border-top: 1px solid #EEE2BE; + color: #444444; + font-size: 11px; + line-height: 16px; + margin: 0 0 -3px; + padding: 5px 27px 5px 47px; + position: relative; +} +.notification-global-notice { + background-image: url("./images/note_msg_icon.gif"); +} +.notification-global .label { + color: #EB5E00; +} +.notification-global .clickable { + cursor: pointer; +} +.notification-global span.critical { + color: #D20000; +} +.notification-global a:hover { + text-decoration: none; +} +.error, a.error span, .required, .validation-advice { + color: #D40707 !important; + font-weight: bold !important; +} +.notice { + color: #EA7601; +} +.messages ul { + border: 0 none !important; +} +.messages li { + font-size: 0.95em !important; + font-weight: bold !important; + margin-bottom: 11px !important; + min-height: 23px !important; + padding: 8px 8px 2px 32px !important; +} +.messages ul li { + border: 0 none !important; + margin: 0 0 3px !important; + padding: 0 !important; +} +.error-msg { + background: url("./images/error_msg_icon.gif") no-repeat scroll 10px 10px #FAEBE7 !important; + border: 1px solid #F16048 !important; + color: #DF280A !important; +} +.success-msg { + background: url("./images/success_msg_icon.gif") no-repeat scroll 10px 10px #EFF5EA !important; + border: 1px solid #95A486 !important; + color: #3D6611 !important; +} +.notice-msg { + background: url("./images/note_msg_icon.gif") no-repeat scroll 10px 10px #FFFBF0 !important; + border: 1px solid #FFD967 !important; + color: #3D6611 !important; +} +.warning-msg { + background: url("./images/warning_msg_icon.gif") no-repeat scroll 10px 10px #E6E6E6 !important; + border: 1px solid #666E73 !important; + color: #000000 !important; +} + +button:hover, .form-button:hover { + background: url("./images/btn_over_bg.gif") repeat-x scroll 0 0 #F77C16; +} +button:active, .form-button:active { + background: url("./images/btn_on_bg.gif") repeat-x scroll 0 0 #F77C16; +} +button span { + background-position: 0 50%; + background-repeat: no-repeat; + line-height: 1.35em; +} +button span span { + background: none repeat scroll 0 0 transparent !important; + display: inline !important; + margin: 0 !important; + padding: 0 !important; +} + + +input.input-text, textarea, select { + background: none repeat scroll 0 0 #FFFFFF; + border-color: #AAAAAA #C8C8C8 #C8C8C8 #AAAAAA; + border-style: solid; + border-width: 1px; + font: 12px arial,helvetica,sans-serif; +} +input.input-text, textarea { + padding: 2px; +} +button, .form-button { + background: url("./images/btn_bg.gif") repeat-x scroll 0 100% #FFAC47; + border-color: #ED6502 #A04300 #A04300 #ED6502; + border-style: solid; + border-width: 1px; + color: #FFFFFF; + cursor: pointer; + font: bold 12px arial,helvetica,sans-serif; + padding: 0 7px 1px; + text-align: center !important; + white-space: nowrap; +} +/* ======================================================================================= */ + + +*, html {text-align: left;} + +h1 { + color: #D12C01; + font-size: 22px; + font-weight: normal; + margin: 0; + text-align: left; +} + +h2 { + color: #444444; + font: 16px Arial,Helvetica,sans-serif; + margin: 0 0 5px; + text-align: left; +} + +body, +.main-container, +.header-container {background: none;} + +.header-simple {height: 60px; text-align: left; padding: 10px 10px 0 10px; border-bottom: 1px solid #CFCFCF;} +.header-top img {height: 60px;} + +.login-box > div {padding: 10px;} +.page-title {margin-bottom: 0; border-bottom: 1px solid #CFCFCF;} + +.form-box {border-bottom: 1px solid #CFCFCF;} +.form-box .fieldset, .form-box fieldset {width: 320px; margin: 0 auto;} + +.input-box {margin-bottom: 10px;} +.input-box label {width: 95px; font-weight: bold; display: block; float: left; text-align: right; padding-right: 10px;} +.input-box input {width: 209px;} + +.required {font-weight: normal; color: #D40707 !important; font-size: 11px;} +.form-buttons {text-align: right;} diff --git a/skin/frontend/base/default/images/cvv.gif b/skin/frontend/base/default/images/cvv.gif index 6d6e9f2907839d58c27ec8de8644f30fc8b4467c..6d49784489f2ea812202191c5f4d065b0686bb93 100644 GIT binary patch literal 19277 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 diff --git a/skin/frontend/base/default/js/checkout/review.js b/skin/frontend/base/default/js/checkout/review.js index 20a51f5f15..bc3a8439a7 100644 --- a/skin/frontend/base/default/js/checkout/review.js +++ b/skin/frontend/base/default/js/checkout/review.js @@ -197,7 +197,7 @@ OrderReviewController.prototype = { var newId = el.id.replace('shipping:','billing:'); if (newId && $(newId) && $(newId).type != 'hidden') { $(newId).value = el.value; - $(newId).setAttribute('readonly', 'readonly'); + $(newId).setAttribute('readOnly', 'readonly'); $(newId).addClassName('local-validation'); $(newId).setStyle({opacity:.5}); $(newId).disable(); @@ -219,7 +219,7 @@ OrderReviewController.prototype = { this._clearValidation('billing'); } else { $$('[id^="billing:"]').invoke('enable'); - $$('[id^="billing:"]').invoke('removeAttribute', 'readonly'); + $$('[id^="billing:"]').each(function(el){el.removeAttribute("readOnly");}); $$('[id^="billing:"]').invoke('removeClassName', 'local-validation'); $$('[id^="billing:"]').invoke('setStyle', {opacity:1}); } diff --git a/skin/frontend/default/blank/images/cvv.gif b/skin/frontend/default/blank/images/cvv.gif index 6d6e9f2907839d58c27ec8de8644f30fc8b4467c..6d49784489f2ea812202191c5f4d065b0686bb93 100644 GIT binary patch literal 19277 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 diff --git a/skin/frontend/default/blue/css/styles.css b/skin/frontend/default/blue/css/styles.css index c5226c7c5f..f9df3bbac2 100644 --- a/skin/frontend/default/blue/css/styles.css +++ b/skin/frontend/default/blue/css/styles.css @@ -1160,6 +1160,8 @@ std ul, .cart-table .item-msg { margin:5px 0; font-size:11px; font-weight:bold; color:#df280a; } .cart-table tfoot td { padding:5px 10px; } .cart-table .btn-continue { float:left; } +.cart-table .btn-update { float:right; margin-left:10px; } +.cart-table .btn-empty { float:right; } /* Shopping Cart Collateral boxes */ .cart .cart-collaterals { padding:25px 0 0; } diff --git a/skin/frontend/default/default/css/oauth-simple.css b/skin/frontend/default/default/css/oauth-simple.css new file mode 100644 index 0000000000..87f7e41fcb --- /dev/null +++ b/skin/frontend/default/default/css/oauth-simple.css @@ -0,0 +1,239 @@ +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category design + * @package default_default + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ + + /* Reset ================================================================================= */ +* { margin:0; padding:0; } +body { background:#496778 50% 0 repeat-y; font:12px/1.55 Arial, Helvetica, sans-serif; color:#2f2f2f; text-align:center; } +img { border:0; vertical-align:top; } +a { color:#1e7ec8; text-decoration:underline; } +a:hover { text-decoration:none; } +:focus { outline:0; } + +/* Headings */ +h1,h2,h3, +h4,h5,h6 { margin:0 0 5px; line-height:1.35; color:#0a263c; } +h1 { font-size:20px; font-weight:normal; } +h2 { font-size:18px; font-weight:normal; } +h3 { font-size:16px; font-weight:bold; } +h4 { font-size:14px; font-weight:bold; } +h5 { font-size:12px; font-weight:bold; } +h6 { font-size:11px; font-weight:bold; } + +/* Forms */ +form { display:inline; } +fieldset { border:0; } +legend { display:none; } + +/* Table */ +table { border:0; /*border-collapse:collapse;*/ border-spacing:0; empty-cells:show; font-size:100%; } +caption,th,td { vertical-align:top; text-align:left; font-weight:normal; } + +/* Content */ +p { margin:0 0 10px; } +strong { font-weight:bold; } +address { font-style:normal; line-height:1.35; } +cite { font-style:normal; } +q, +blockquote { quotes:none; } +q:before, +q:after { content:''; } +small,big { font-size:1em; } +/*sup { font-size:1em; vertical-align:top; }*/ + +/* Lists */ +ul,ol { list-style:none; } + +/* Tools */ +.hidden { display:block !important; border:0 !important; margin:0 !important; padding:0 !important; font-size:0 !important; line-height:0 !important; width:0 !important; height:0 !important; overflow:hidden !important; } +.nobr { white-space:nowrap !important; } +.wrap { white-space:normal !important; } +.a-left { text-align:left !important; } +.a-center { text-align:center !important; } +.a-right { text-align:right !important; } +.v-top { vertical-align:top; } +.v-middle { vertical-align:middle; } +.f-left, +.left { float:left !important; } +.f-right, +.right { float:right !important; } +.f-none { float:none !important; } +.f-fix { float:left; width:100%; } +.no-display { display:none; } +.no-margin { margin:0 !important; } +.no-padding { padding:0 !important; } +.no-bg { background:none !important; } +/* ======================================================================================= */ + +/* Default styles ======================================================================== */ +/* boxes.css*/ +.notification-global { + background: url("./../images/error_msg_icon.gif") no-repeat scroll 27px 5px #FFF9E9; + border-bottom: 1px solid #EEE2BE; + border-top: 1px solid #EEE2BE; + color: #444444; + font-size: 11px; + line-height: 16px; + margin: 0 0 -3px; + padding: 5px 27px 5px 47px; + position: relative; +} +.notification-global-notice { + background-image: url("./../images/note_msg_icon.gif"); +} +.notification-global .label { + color: #EB5E00; +} +.notification-global .clickable { + cursor: pointer; +} +.notification-global span.critical { + color: #D20000; +} +.notification-global a:hover { + text-decoration: none; +} +.error, a.error span, .required, .validation-advice { + color: #D40707 !important; + font-weight: bold !important; +} +.notice { + color: #EA7601; +} +.messages ul { + border: 0 none !important; +} +.messages li { + font-size: 0.95em !important; + font-weight: bold !important; + margin-bottom: 11px !important; + min-height: 23px !important; + padding: 8px 8px 2px 32px !important; +} +.messages ul li { + border: 0 none !important; + margin: 0 0 3px !important; + padding: 0 !important; +} +.error-msg { + background: url("./../images/error_msg_icon.gif") no-repeat scroll 10px 10px #FAEBE7 !important; + border: 1px solid #F16048 !important; + color: #DF280A !important; +} +.success-msg { + background: url("./../images/success_msg_icon.gif") no-repeat scroll 10px 10px #EFF5EA !important; + border: 1px solid #95A486 !important; + color: #3D6611 !important; +} +.notice-msg { + background: url("./../images/note_msg_icon.gif") no-repeat scroll 10px 10px #FFFBF0 !important; + border: 1px solid #FFD967 !important; + color: #3D6611 !important; +} +.warning-msg { + background: url("./../images/warning_msg_icon.gif") no-repeat scroll 10px 10px #E6E6E6 !important; + border: 1px solid #666E73 !important; + color: #000000 !important; +} + +button:hover, .form-button:hover { + background: #F77C16; +} +button:active, .form-button:active { + background: #F77C16; +} +button span { + background-position: 0 50%; + background-repeat: no-repeat; + line-height: 1.35em; +} +button span span { + background: none repeat scroll 0 0 transparent !important; + display: inline !important; + margin: 0 !important; + padding: 0 !important; +} + + +input.input-text, textarea, select { + background: none repeat scroll 0 0 #FFFFFF; + border-color: #AAAAAA #C8C8C8 #C8C8C8 #AAAAAA; + border-style: solid; + border-width: 1px; + font: 12px arial,helvetica,sans-serif; +} +input.input-text, textarea { + padding: 2px; +} +button, .form-button { + background: #FFAC47; + border-color: #ED6502 #A04300 #A04300 #ED6502; + border-style: solid; + border-width: 1px; + color: #FFFFFF; + cursor: pointer; + font: bold 12px arial,helvetica,sans-serif; + padding: 0 7px 1px; + text-align: center !important; + white-space: nowrap; +} +/* ======================================================================================= */ + + +*, html {text-align: left;} + +h1 { + color: #D12C01; + font-size: 22px; + font-weight: normal; + margin: 0; + text-align: left; +} + +h2 { + color: #444444; + font: 16px Arial,Helvetica,sans-serif; + margin: 0 0 5px; + text-align: left; +} + +body, +.main-container, +.header-container {background: none;} + +.header-simple {height: 60px; text-align: left; padding: 10px 10px 0 10px; border-bottom: 1px solid #CFCFCF;} +.header-top img {height: 60px;} + +.login-box > div {padding: 10px;} +.page-title {margin-bottom: 0; border-bottom: 1px solid #CFCFCF;} + +.form-box {border-bottom: 1px solid #CFCFCF;} +.form-box .fieldset, .form-box fieldset {width: 320px; margin: 0 auto;} + +.input-box {margin-bottom: 10px;} +.input-box label {width: 95px; font-weight: bold; display: block; float: left; text-align: right; padding-right: 10px;} +.input-box input {width: 209px;} + +.required {font-weight: normal; color: #D40707 !important; font-size: 11px;} +.form-buttons {text-align: right;} diff --git a/skin/frontend/default/default/css/styles.css b/skin/frontend/default/default/css/styles.css index 0ef097e419..428f2fba45 100644 --- a/skin/frontend/default/default/css/styles.css +++ b/skin/frontend/default/default/css/styles.css @@ -189,7 +189,6 @@ input.input-text:focus,select:focus,textarea:focus { background-color:#edf7fd; } .form-list li.additional-row .btn-remove { float:right; margin:5px 0 0; } .form-list .input-range input.input-text { width:74px; } - .form-list-narrow li { margin-bottom:0; } .form-list-narrow li .input-box { margin-bottom:6px; } .form-list-narrow li.wide .input-box { width:260px; } @@ -1193,8 +1192,12 @@ tr.summary-details-excluded { font-style:italic; } .cart-table .item-msg { margin:5px 0; font-size:11px; font-weight:bold; color:#df280a; } .cart-table tfoot td { padding:5px 10px; } .cart-table .btn-continue { float:left; } +.cart-table .btn-empty span, .cart-table .btn-continue span, .cart-table .btn-update span { border-color:#406a83; background:#618499; } +.cart-table .btn-update, +.cart-table .btn-empty { float:right; } +.cart-table .btn-update { margin-left:10px; } /* Shopping Cart Collateral boxes */ .cart .cart-collaterals { padding:25px 0 0; } diff --git a/skin/frontend/default/default/images/cvv.gif b/skin/frontend/default/default/images/cvv.gif index 6d6e9f2907839d58c27ec8de8644f30fc8b4467c..6d49784489f2ea812202191c5f4d065b0686bb93 100644 GIT binary patch literal 19277 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 diff --git a/skin/frontend/default/iphone/css/custom.css b/skin/frontend/default/iphone/css/custom.css new file mode 100644 index 0000000000..1af327df4b --- /dev/null +++ b/skin/frontend/default/iphone/css/custom.css @@ -0,0 +1,65 @@ +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category design + * @package default_iphone + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +/* Theme options */ + +/* Links Color */ +a { color:#1394ca; } + +/* Main color */ +body > header, +body > footer ul, +body > address.copyright { background-color:#e76212; } + +/* Button Color */ +.map-popup-checkout button, +.more-button, +.btn-checkout, +.account-login button, +.add-to-links > li > a, +.cart-table tfoot button, +.opc .buttons-set button, +.checkout-success button, +.box-reviews .buttons-set button, +.my-account .form-buttons button, +#contactForm .buttons-set button, +.giftregistry .buttons-set button, +.wishlist-view .buttons-set button, +.send-to-friend .buttons-set button, +.account-create .buttons-set button, +.add-to-links > li .split-button strong, +.catalog-product-gallery .buttons-set a, +.my-account .my-rewards .buttons-set button, +.my-account .my-wishlist .buttons-set button, +.product-view .product-shop .add-to-box button, +.popup-block .block-content .buttons-set button, +.customer-account-forgotpassword .buttons-set button, +.product-view .product-options-bottom .add-to-cart button, +.my-account .billing-agreements .box-content .form-list select + button { background-color:#e76212; } + +/* Main Page Navigation links color */ +#nav-container li a { color:#111; } + +/* Buttons background color */ +.form-subscribe button { background:green; } diff --git a/skin/frontend/default/iphone/css/iphone.css b/skin/frontend/default/iphone/css/iphone.css index 61e82e03a4..e93231b460 100644 --- a/skin/frontend/default/iphone/css/iphone.css +++ b/skin/frontend/default/iphone/css/iphone.css @@ -31,70 +31,247 @@ form, fieldset, ul, li, dl, dt, dd { background:transparent; border:0; font-size:100%; margin:0; outline:0; padding:0; vertical-align:baseline; } img { vertical-align:bottom; } ul { list-style:none; } -a { color:#000; text-decoration:none; } -input, select { font-size:14px; vertical-align:middle; } +a { color:#1394ca; text-decoration:none; } /* Page -----------------------------*/ -html { -webkit-text-size-adjust:none; } +html { -webkit-text-size-adjust:none; overflow-y:scroll; } html, body { height:100%; } -body { background:#fefefe; font:12px/18px HelveticaNeue, Helvetica, sans-serif; min-height:100%; } -h1 { font-size:14px; font-weight:bold; line-height:14px; text-align:center; } -h2 { font-size:12px; font-weight:normal; line-height:20px; } - -button:active { position:relative; top:1px; left:1px; } +body { background:#fff; font:15px/18px HelveticaNeue, Helvetica, sans-serif; min-height:100%; } legend { display:none; } -.messages .notice-msg, -.messages .error-msg, -.messages .success-msg { - background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #FFE38D), color-stop(100%, #FFD040)); - background:-o-linear-gradient(top, #FFE38D 0%, #FFD040 100%); +.std { clear:both; margin:10px 0; } + +.a-left { text-align:left; } +.a-center { text-align:center; } +.a-right { text-align:right; } + +.global-site-notice { background:#444; border-bottom:1px solid #333; color:#fff; font-size:13px; padding:10px; text-shadow:0 1px 0 #111; } +.global-site-notice p { margin:0 0 10px; } +.global-site-notice a { color:#f90; text-decoration:underline; text-shadow:none; } +.global-site-notice .actions { text-align:center; } +.global-site-notice .actions button { background:none; border:1px solid #ccc; color:#fff; cursor:pointer; padding:5px 10px; text-shadow:0 1px 0 #333; } + +input.input-text, +input[type="text"], +input[type="password"], +input[type="email"] { + background:#fff; + border:1px solid #e4e4e4; + border-radius:2px; + font-size:15px; + margin:0; + padding:5px; + width:100%; + -webkit-appearance:none; + -webkit-box-sizing:border-box; + box-sizing:border-box; + -webkit-box-shadow:inset 1px 1px 3px rgba(0, 0, 0, .05); + -moz-box-shadow:inset 1px 1px 3px rgba(0, 0, 0, .05); + box-shadow:inset 1px 1px 3px rgba(0, 0, 0, .05); +} + +textarea { + border:1px solid; + border-color:#e4e4e4; + border-radius:2px; padding:5px; - color:#222; + font:15px/18px HelveticaNeue, Helvetica, sans-serif; + height:100px; + width:100%; + resize:vertical; + -webkit-appearance:none; + -webkit-box-sizing:border-box; + box-sizing:border-box; + -webkit-box-shadow:inset 1px 1px 3px rgba(0, 0, 0, .05); + -moz-box-shadow:inset 1px 1px 3px rgba(0, 0, 0, .05); + box-shadow:inset 1px 1px 3px rgba(0, 0, 0, .05); +} + + +select, .select-multiple { + background:url(../images/i_dropdown.png) no-repeat right #fefefe; + border:1px solid #e4e4e4; + -webkit-border-radius:2px; + -moz-border-radius:2px; + border-radius:2px; + color:#333; + font:15px/18px HelveticaNeue, Helvetica, sans-serif; + padding:5px 30px 5px 5px; + width:100%; + -webkit-appearance:none; + -moz-appearance:none; + appearance:none; + -webkit-box-sizing:border-box; + -moz-box-sizing:border-box; + box-sizing:border-box; + -webkit-box-shadow:inset 1px 1px 1px rgba(0, 0, 0, .1); + -moz-box-shadow:inset 1px 1px 1px rgba(0, 0, 0, .1); + box-shadow:inset 1px 1px 1px rgba(0, 0, 0, .1); +} +select:disabled { background:#f5f5f5; } +.select-multiple-wrap { position:relative; } +.select-multiple { max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; position:relative; } +.select-multiple-options-wrap { + background:#fff; + border:1px solid #e4e4e4; + border-radius:2px; + position:absolute; + top:-5px; + left:-5px; + right:-5px; + visibility:hidden; + -webkit-box-shadow:0 3px 6px rgba(0, 0, 0, .25); + -moz-box-shadow:0 3px 6px rgba(0, 0, 0, .25); + box-shadow:0 3px 6px rgba(0, 0, 0, .25); + z-index:1; +} +.select-multiple-options-wrap .select-heading { + border-bottom:1px solid #e4e4e4; + color:#424242; font-weight:bold; - text-shadow:0 1px 0 #eee; - -webkit-box-shadow:0 3px 3px #ccc; - box-shadow:0 3px 3px #ccc; + font-size:15px; + line-height:20px; + padding:10px; + white-space:nowrap; + overflow:hidden; + text-overflow:ellipsis; } -.messages .error-msg { - color:#fff; - background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #ee5f5b), color-stop(100%, #c43c35)); - background-image:-o-linear-gradient(top, #ee5f5b 0%, #c43c35 100%); - text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25); -} -.messages .success-msg { - background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #62c462), color-stop(100%, #57a957)); - background-image:-o-linear-gradient(top, #62c462 0%, #57a957 100%); - border:solid #3D773D; - border-width:1px 0; - color:#fff; - text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25); - margin-bottom:10px; +.select-multiple-options-wrap .select-close { + cursor:pointer; + color:#999; + display:inline-block; + float:right; + font-size:18px; + line-height:1; + text-align:center; + height:20px; + width:20px; +} +.select-multiple .selected-counter { + background:#fff; + color:#999; + display:inline-block; + font-size:12px; + font-weight:bold; + padding:2px 5px 5px 10px; + position:absolute; + top:3px; + bottom:0; + right:25px; +} +.select-multiple-options { + list-style:none; + margin:0 auto; + padding:0; +} +.select-multiple-options li { + border-bottom:1px solid #e4e4e4; + cursor:pointer; + margin:0 !important; + padding:10px 10px 10px 38px; + position:relative; +} +.select-multiple-options li.active { + background:#f5f5f5; +} +.select-multiple-options li:after { + content:''; + display:block; + background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAAKCAYAAABv7tTEAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYxIDY0LjE0MDk0OSwgMjAxMC8xMi8wNy0xMDo1NzowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNS4xIFdpbmRvd3MiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RDAxRDg0NzcxQjdEMTFFMUE1RjVCOUQyODJGQTNDMEMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RDAxRDg0NzgxQjdEMTFFMUE1RjVCOUQyODJGQTNDMEMiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpEMDFEODQ3NTFCN0QxMUUxQTVGNUI5RDI4MkZBM0MwQyIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpEMDFEODQ3NjFCN0QxMUUxQTVGNUI5RDI4MkZBM0MwQyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pv02V7QAAABZSURBVHjalM5BDoAwCATAfUXj/7/Dbzx43QppCW0U5bAh0AwUJPEnItIA8K4lcCqyFMFlfRXo3B/m4AsY8n8GmIF56dhhBgyNzREyA44e4CtYUIQZ0HQBBgCyITMDEAMA1AAAAABJRU5ErkJggg==) no-repeat 0 0; + height:10px; + width:13px; + position:absolute; + top:15px; + left:15px; + opacity:0.2; +} +.select-multiple-options li.active:after { + opacity:1; +} +.select-multiple-options li:last-child { + border-bottom:none; +} +.select-multiple-options li + li { + border-top:1px linear #fff; } +.pager select { width:auto; } + +a.btn-remove, + .btn-remove2 { background:url(../images/btn_remove.png) no-repeat center; display:inline-block; overflow:hidden; text-indent:-100%; height:25px; width:25px; } +a.link-edit { background:url(../images/btn_edit.png) no-repeat left; display:inline-block; font-size:11px; font-weight:normal; line-height:18px; padding:0 0 0 23px; } + +.reward-message, +.messages .note-msg, +.messages .error-msg, +.messages .notice-msg, +.messages .success-msg { background:#444; color:#fff; padding:10px; text-shadow:0 1px 0 #111; } + .no-display { display:none; } .nobr { white-space:nowrap; } +.window-overlay { display:none; } + +.map-popup, +.popup-block, +.remember-me-popup { + background:#fcfcfc; + position:absolute; + left:15px !important; + right:15px !important; + margin:-18px 0 0; + padding:15px; + -webkit-box-shadow:0 2px 6px rgba(0, 0, 0, .25); + -moz-box-shadow:0 2px 6px rgba(0, 0, 0, .25); + box-shadow:0 2px 6px rgba(0, 0, 0, .25); +} +.popup-block { background:#fff; display:none; position:fixed; top:50%; left:50%; margin:-60px 0 0 -140px; width:250px; } +.popup-block .form-list { margin:0 0 15px; } +.popup-block .block-title { display:none; } +.popup-block .buttons-set button { display:inline-block !important; margin-right:1px !important; width:49% !important; } +.popup-block.active { display:block; } + +.map-popup-close { float:right; } +.map-popup-heading, +.map-popup-checkout, +.map-popup-price { margin:0 0 10px; } +.map-popup-price .special-price .price-label { color:#222; } +.map-popup-price .special-price .price { font-weight:bold; } + +.remember-me-popup-body { line-height:20px; } +.remember-me-popup-close { + background:#fff; + border:1px solid #e4e4e4; + color:#424242; + display:block; + margin:15px auto 0; + text-align:center; + font-weight:bold; + font-variant:small-caps; + text-transform:lowercase; + text-shadow:0 -1px 0 #eee; + padding:5px 10px; + width:100px; + -webkit-box-shadow:0 1px 2px rgba(0, 0, 0, .1); + -moz-box-shadow:0 1px 2px rgba(0, 0, 0, .1); + box-shadow:0 1px 2px rgba(0, 0, 0, .1); } + +#remember-me-box a { font-weight:bold; border-bottom:1px dashed; } + /* Header -----------------------------*/ body > header { - background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0%,#999999), color-stop(50%,#504f50), color-stop(51%,#282728), color-stop(100%,#110f0f)); - background-image:-webkit-linear-gradient(top, #999999 0%,#504f50 50%,#282728 51%,#110f0f 100%); - background-image:-o-linear-gradient(top, #999999 0%, #504f50 50%,#282728 51%, #110f0f 100%); - background-color:#222; + background:url(../images/bg_gradient.png) repeat-x 0 0; /* Theme color1 */ box-sizing:border-box; display:table; - padding:5px; position:relative; width:100%; - -webkit-box-shadow:0 3px 3px rgba(0, 0, 0, 0.25); - box-shadow:0 3px 3px rgba(0, 0, 0, 0.25); - z-index:100; - height:34px; + height:45px; + z-index:102; -webkit-user-select:none; -webkit-transform:translate3d(0, 0, 1px); -webkit-transform-style:preserve-3d; @@ -107,89 +284,25 @@ body > header.no-shadow { box-shadow:none; } -.cart-wrap { - background:#111; - position:absolute; - top:0; - left:0; - right:0; - padding:2px; - z-index:99; - visibility:hidden; - -webkit-box-shadow:0 0 5px rgba(0, 0, 0, 0.5); - box-shadow:0 0 5px rgba(0, 0, 0, 0.5); - -webkit-transform:translate3d(0, -100%, 0); -} -.cart-wrap:after { - content:''; - display:block; - position:absolute; - margin-top:44px; -} - -.cart-wrap .cart-shared { - margin:0; -} - -.cart-wrap.animate { - -webkit-backface-visibility:hidden; - -webkit-transition:-webkit-transform 300ms ease-out; -} - -.cart-wrap.cart-short .cart-wrap-content #discount-coupon-form, -.cart-wrap.cart-short .cart-wrap-content .cart-footer { - display:none; -} - -.cart-wrap-content { - background:#fefefe; - color:#222; - padding:5px 10px 0; - overflow:hidden; - position:relative; - z-index:1; - -webkit-box-shadow:inset 0 0 3px rgba(0, 0, 0, 0.25); - box-shadow:inset 0 0 3px rgba(0, 0, 0, 0.25); -} - -.cart-wrap-content .page-title { - background:none; - border:none; - margin:0 -10px 0; - -webkit-box-shadow:none; - box-shadow:none; -} - -.cart-wrap-content .cart-empty { - text-align:center; - padding-bottom:5px; -} +.global-site-notice { -webkit-transform:translate3d(0, 0, 1px); } -.cart-wrap-content .breadcrumbs, -.cart-wrap-content .messages { - display:none; -} +.cart-empty { padding:15px; } -.cart-wrap-content .cart-shared .cart-table { - margin:0; +.header-bg { + background:url(../images/custom/bg_header.png) no-repeat center #fff; + height:45px; + -webkit-user-select:none; + -webkit-transform:translate3d(0, 0, 1px); + -webkit-transform-style:preserve-3d; + -webkit-tap-highlight-color:rgba(0,0,0,0); + -webkit-touch-callout:none; } -.cart-wrap-content .cart-footer .checkout-types li button { - padding:5px 10px; -} +.header-bg .header-logo { background:url(../images/custom/bg_logo.png) no-repeat 0 0; display:block; height:45px; position:absolute; width:100%; } -body > header .store-logo, body > header .menu-wrapper { - display:table-cell; - vertical-align:middle; - width:70%; -} -body > header .store-logo { - width:30%; -} - -body > header .store-logo img { - height:34px; + display:table; + width:100%; } body > header .menu-wrapper { @@ -197,26 +310,25 @@ body > header .menu-wrapper { } body > header dl { - display:table; - float:right; - background:rgba(0,0,0,0.2); - border:1px solid #666; - border-radius:5px; - white-space:nowrap; + display:table-cell; + min-width:100px; + width:100px; + vertical-align:top; } body > header dt, body > header dd { - display:inline-block; + display:block; } +body > header dt { background:url(../images/bg_divider.png) no-repeat right; float:left; padding:0 1px 0 0; height:45px; text-indent:-100%; width:49px; } + body > header dd { position:absolute; top:0; left:0; padding:10px; white-space:normal; - width:100%; margin-top:44px; visibility:hidden; -webkit-box-sizing:border-box; @@ -228,151 +340,98 @@ body > header dd { body > header dd { -webkit-transform:translate3d(0, -100%, -1px); } } -body > header dd.search-box { - background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#333), to(#000)); - background-image:-o-linear-gradient(top, #333 0%, #000 100%); - background-color:#333; - border-top:1px solid #666; - padding:7px 5px; - -webkit-transition:-webkit-transfrom 300ms linear; +body > header .search { + display:table-cell; + padding:5px 15px; + vertical-align:middle; +} + +input[type="search"]::-webkit-search-decoration, +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-results-button, +input[type="search"]::-webkit-search-results-decoration { + display: none; } -body > header dd.search-box input { +body > header .search input { + background:url(../images/i_search.png) no-repeat 8px 6px #fff; border:none; + box-sizing:border-box; + color:#949494; outline:none; - background:url(../images/search_icon.png) no-repeat 8px 7px #fff; - -webkit-background-size:14px 14px; - background-size:14px 14px; - -webkit-background-origin:padding-box; - background-origin:padding-box; - padding:5px 10px 5px 25px; + font-size:18px; + line-height:1; margin:0; + padding:4px 5px 4px 30px; width:100%; - border-radius:14px; - -webkit-box-sizing:border-box; - box-sizing:border-box; - -webkit-border-radius:14px; - border-radius:14px; + + border-radius:15px; + -webkit-appearance:none; - -webkit-box-shadow:inset 0 1px 3px #000; - box-shadow:inset 0 1px 3px #000; + appearance:none; + + -webkit-box-shadow:inset 0 1px 1px #555; + -moz-box-shadow:inset 0 1px 1px #555; + box-shadow:inset 0 1px 1px #555; } -body > header dt a { - color:#fff; - text-decoration:none; - display:inline-block; - line-height:32px; - padding:0 25px; +.search-autocomplete { + background:#333; } - -body > header dt.active a, -body > header dt.active span:first-child { - background-color:#333; - border:solid #666; - border-width:1px 1px 0; - margin:-1px -1px -8px; - padding:1px 25px 8px; - position:relative; - line-height:30px; - border-top-left-radius:5px; - border-top-right-radius:5px; - -webkit-background-clip:padding-box; - background-clip:padding-box; +.search-autocomplete li { + color:#fff; + font-size:14px; + padding:5px; } +.search-autocomplete li + li { border-bottom:1px solid #999; } +.search-autocomplete .amount { background:#fff; border-radius:15px; color:#111; display:inline-block; font-size:8px; margin-right:10px; padding:0 5px; vertical-align:middle; } -body > header dt.search > a { - background-image:url(../images/i_menu_search.png); - background-position:18px 10px; - background-repeat:no-repeat; - text-indent:-999em; -} +body > header dt a {} -body > header dt.cart:before, -body > header dt.cart:after { - content:''; - display:inline-block; - vertical-align:middle; - height:20px; - width:1px; - background:#666; -} +body > header dt.cart-icon { position:relative; white-space:nowrap; overflow:hidden; } +body > header dt.cart-icon > a { background:url(../images/i_cart.png) no-repeat center; display:block; height:45px; } -body > header dt.cart { - position:relative; -} +body > header dt.menu > a { background:url(../images/i_menu.png) no-repeat center; display:block; height:45px; position:relative; } -body > header dt.cart > span:first-child { - display:inline-block; - line-height:32px; - width:50px; - background-image:url(../images/i_menu_cart.png); - background-position:center 10px; - background-repeat:no-repeat; - text-indent:-999em; -} -body > header dt.active span:first-child { - margin:-1px -6px -7px; - padding:0 30px 7px; - width:0; -} +body > header dt.cart-icon.active > a, +body > header dt.menu.active > a { background-color:rgba(0, 0, 0, .10); } -body > header dt.cart > span:nth-child(2), +body > header dt.cart-icon > span:nth-child(2), body > header .badge { - background-image:-webkit-gradient( - linear, - 0 0, - 0 100%, - color-stop(1, #af0002), - color-stop(0.62, #e1262f), - color-stop(0.6, #e75159), - color-stop(0, #f6bec1) - ); - background-image:-o-linear-gradient(top, #f6bec1 0%, #e75159 60%, #e1262f 62%, #af0002 100%); - border:2px solid #fff; - border-radius:15px; + background:none; display:inline-block; color:#fff; - font-size:14px; + height:auto; + font-size:12px; font-weight:bold; line-height:14px; - padding:0 4px 2px; position:absolute; - right:-5px; - top:-5px; - -webkit-box-shadow:0 3px 3px rgba(0, 0, 0, 0.5); - box-shadow:0 3px 3px rgba(0, 0, 0, 0.5); - -webkit-background-clip:padding-box; - background-clip:padding-box; + text-indent:0; + right:4px; + top:4px; z-index:100; + text-shadow:0 1px 0 #444; } + body > header dt.menu .badge { top:1px; right:5px; } -body > header dt.menu > a { - background-image:none; - text-shadow:0 -1px 0 rgba(0, 0, 0, 0.8); - font-size:12px; - font-weight:bold; - position:relative; -} - body > header dd.menu-box { - background:#000; - border-top:1px solid #666; - color:#fff; padding:0; -webkit-transition:-webkit-transfrom 300ms linear; + -webkit-box-shadow:3px 3px 3px rgba(0, 0, 0, .2); + -moz-box-shadow:3px 3px 3px rgba(0, 0, 0, .2); + box-shadow:3px 3px 3px rgba(0, 0, 0, .2); } -body > header dd.menu-box a { - background-image:-webkit-gradient(linear,0 0,0 100%,from(#333),to(#000)); - background-image:-o-linear-gradient(top, #333 0%, #000 100%); - border-bottom:2px solid #585858; - color:#fff; +body > header dd.menu-box a, +body > header dd.menu-box strong { + background-color:rgba(255, 255, 255, .92) !important; + color:#444444; + font-size:18px; padding:10px; display:block; } @@ -396,10 +455,6 @@ body > header dd.menu-box .badge { -webkit-box-shadow:0 3px 3px rgba(0, 0, 0, 0.5), inset 0 3px 3px rgba(255, 255, 255, 0.35); box-shadow:0 3px 3px rgba(0, 0, 0, 0.5), inset 0 3px 3px rgba(255, 255, 255, 0.35); } -body > header dd.menu-box .links a:hover { - -webkit-box-shadow:inset 0 8px 8px rgba(0, 0, 0, .75); - box-shadow:inset 0 8px 8px rgba(0, 0, 0, .75); -} body > header dd.menu-box .welcome-msg { background:url(../images/bg_drop.jpg) repeat-x 0 0; @@ -511,76 +566,65 @@ body > nav .active a { text-shadow:0 1px 1px #ccc; } - -/* Search Block +/* Footer -----------------------------*/ -/* -.search-box { background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#f5f5f5)); margin:-5px 0 0; padding:8px 10px; } -.search-box span { background:#fff; border-radius:15px; display:inline-block; -webkit-box-shadow:inset 0 1px 3px rgba( 0, 0, 0, 0.5 ); position:relative; width:100%; } -.search-box input { background:url(../images/i_search.png) no-repeat 7px 5px; border:none; font-size:16px; padding-left:25px; width:100%; -webkit-appearance:none; } -*/ - - -/* Footer ------------------------------*/ -body > footer { - background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#f6f6f6), to(#fff)); - background-image:-o-linear-gradient(top, #f3f3f3 0%, #fff 100%); - min-height:100px; - padding:10px; -} - -body > footer { padding:10px; } -body > footer ul { - font-size:12px; - text-align:center; - } - body > footer ul li { - display:inline; - margin:0 2px; - } - body > footer ul li a { - display:inline-block; - padding:2px; - } - - -body > footer select { - background:url(../images/i_dropdown.png) no-repeat right #fefefe; - border:1px solid; - border-color:#e1e1e1; - border-radius:2px; - color:#333; - font-size:15px; - padding:3px 20px 3px 7px; - width:49%; +body > footer { min-height:100px; } +body > address.copyright { color:#fff; line-height:18px; padding:15px; } +body > address.copyright .logo { float:left; margin:0 10px 0 0; } +body > footer ul { line-height:27px; padding:10px 15px 0; overflow:hidden; } +body > footer ul + ul { padding:0 15px 10px; } +body > footer ul li { box-sizing:border-box; float:left; width:50%; } +body > footer ul li a { color:#fff; display:inline-block; padding:2px; } + +.block-subscribe { padding:10px 15px; } +.block-subscribe .block-title { display:none; } +.block-subscribe .form-subscribe-header { margin:0 0 5px; padding-left:12px; } +.block-subscribe .input-box { display:inline-block; vertical-align:top; width:60%; } +.block-subscribe .input-box input { border-radius:15px; border-color:#ccc; font-size:18px; padding:5px 10px; } +.block-subscribe .validation-advice { padding:10px 0 0 12px; width:150%; } +.block-subscribe .actions { display:inline-block; vertical-align:top; width:38%; } +.block-subscribe button { + border:none; + -webkit-border-radius:20px; + -moz-border-radius:20px; + border-radius:20px; + color:#fff; + font-size:18px; + padding:5px 10px; + vertical-align:top; + -webkit-appearance:none; - -webkit-box-sizing:border-box; + appearance:none; } -body > footer p { border-top:1px solid rgba(204, 204, 204, 0.3); color:#999; font-size:12px; margin:8px -10px 0; line-height:14px; padding:8px 10px 0; text-align:center; } - -.form-subscribe .form-subscribe-header { display:none; } /* Content -----------------------------*/ -body > section { border-bottom:1px solid #ccc; padding:0 10px 10px; } body > section:before, body > section:after { content: ""; display: table; } body > section:after { clear:both; } body > section img { max-width:100%; } body > section > .category-image { margin:0 -10px; } body > section > .category-image img { min-width:100%; } +body > section > .std, +body > section > form > .fieldset { margin:0; padding:15px; } +body > section > form > .buttons-set { padding:15px; } +body > section > form > .buttons-set p.required { font-size:10px; line-height:12px; margin:10px 0; text-align:right; } +body > section > form > .required { padding:15px; } +body > section > form > .fieldset h2 { color:#424242; font-size:18px; line-height:22px; margin:0 0 15px; } + +.front-banner { + text-align:center; +} +.page-sitemap { padding:15px; } +.page-sitemap .page-title { display:none; } /* Categories -----------------------------*/ .nav-wrap { overflow:hidden; - margin:0 -10px -10px; } #nav-container { - background:url(../images/nav_bg.png) repeat 0 0; overflow:hidden; - margin:0 0 -1px; padding:0 0 1px; position:relative; width:9000px; @@ -591,3238 +635,1472 @@ body > section > .category-image img { min-width:100%; } } #nav-container ul > li > ul { display:none; } #nav-container:after { content: "."; display: block; clear: both; visibility: hidden; line-height: 0; height: 0; } -#nav-container ul { font-size:16px; margin:0; width:100%; float:left; } -#nav-container li { border-top:1px solid #ccc; } -#nav-container li:last-child { border-top:1px solid #ccc; } -#nav-container li.subcategory-header { padding:10px; background:#E8E8E8; text-align:center; font-weight:bold; } -#nav-container li.subcategory-header .button-wrap { - float:left; - margin:-5px 10px 0; - position:absolute; +#nav-container ul { font-size:21px; margin:0; width:100%; float:left; } +#nav-container li.subcategory-header { background:url(../images/bg_gradient.png) repeat-x 0 0 #d9d9d9; height:28px; padding:6px 10px; text-align:center; font-weight:bold; } +#nav-container li.subcategory-header span { color:#414141; line-height:28px; } +#nav-container li.subcategory-header .button-wrap { float:left; position:absolute; } +#nav-container li.subcategory-header .button-wrap button { + background:url(../images/bg_back_btn.png) no-repeat right top; + border:none; + height:27px; + width:47px; + color:#fff; + display:inline-block; + font-size:11px; + font-weight:bold; + line-height:27px; + margin:0; + padding:0 0 0 7px; + position:relative; + z-index:3; + -webkit-appearance:none; + appearance:none; } #nav-container li a { - background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#eee)); - background:-o-linear-gradient(top, #fff 0, #eee 100%); + background-color:#fff !important; display:block; } #nav-container li a span { - background:url(../images/i_arrow_small.png) no-repeat right; + background:url(../images/custom/arrow.png) no-repeat right; display:block; - padding:10px; - -webkit-background-size:8px 12px; - background-size:8px 12px; + line-height:20px; + padding:10px 15px; -webkit-background-origin:content-box; - background-origin:content-box; + background-origin:content-box; } /* Form-list -----------------------------*/ -.form-list li { margin-bottom:8px; } -.form-list input.input-text, -.form-list input[type="text"], -.form-list input[type="password"], -.form-list input[type="email"] { - background:#fefefe; - border:1px solid; - border-color:#8e8e8e #e1e1e1 #e1e1e1 #8e8e8e; - border-radius:5px; - font-size:18px; - margin:0; - padding:5px; - width:100%; - -webkit-appearance:none; - -webkit-box-sizing:border-box; - box-sizing:border-box; - -webkit-box-shadow:inset 1px 1px 1px rgba(0, 0, 0, 0.1); - box-shadow:inset 1px 1px 1px rgba(0, 0, 0, 0.1); -} +.form-list li { margin:0 0 15px; } +.form-list li:last-child { margin:0; } +.form-list label { color:#424242; display:block; font-weight:bold; margin:0 0 2px; } +.form-list label em { color:#f9721f; margin-right:2px; } +.form-list .field { margin:0 0 15px; } +.form-list .field:last-child { margin:0; } +.form-list .add-row .btn-remove { float:right; } +.form-list .add-row .btn-remove a { vertical-align:top; } +.form-list .control .input-box { vertical-align:top; } +.form-list .control .input-box, +.form-list .control label { display:inline-block; } +.form-list .control label { max-width:90%; } +.form-list .validation-advice { font-size:14px; padding:2px 0; } +.form-list img[src*="calendar.gif"] { position:absolute; padding:7px; } +.form-list input.datetime-picker { padding-left:30px; } +.form-list input[type="radio"] + label { display:inline-block; } .form-list input[type="text"]::-webkit-input-placeholder, .form-list input[type="password"]::-webkit-input-placeholder, .form-list input[type="email"]::-webkit-input-placeholder { color:#444; } -.form-list textarea { - border:1px solid; - border-color:#8e8e8e #e1e1e1 #e1e1e1 #8e8e8e; - border-radius:5px; - padding:5px; - font-size:18px; - height:100px; - width:100%; - resize:vertical; - -webkit-appearance:none; - -webkit-box-sizing:border-box; - box-sizing:border-box; - -webkit-box-shadow:inset 1px 1px 1px rgba(0, 0, 0, 0.1); - box-shadow:inset 1px 1px 1px rgba(0, 0, 0, 0.1); -} -input[type="submit"] { - background:-webkit-gradient(linear, 0 0, 0 100%, from(#fdfdfd), to(#dbdbdb)); - background:-o-linear-gradient(top, #fdfdfd 0%, #dbdbdb 100%); - border:1px solid #dbdbdb; - border-radius:10px; - font-size:16px; - font-weight:normal; - margin:0; - padding:8px 5px; - text-transform:small-caps; - text-shadow:0 0 1px #fff; - vertical-align:middle; - -webkit-appearance:none; - -webkit-box-shadow:0 1px 1px #8a8a8a; - box-shadow:0 1px 1px #8a8a8a; - -webkit-background-clip:padding-box; - background-clip:padding-box; -} +/*--------------------------*/ input[type="checkbox"] { background:url(../images/bg_checkbox.png) no-repeat 0 0; - border:1px solid; - border-color:#8e8e8e #e1e1e1 #e1e1e1 #8e8e8e; + border:1px solid #e4e4e4; border-radius:2px; - height:20px; margin:0 3px 0 0; - vertical-align:top; + height:20px; width:20px; + vertical-align:top; -webkit-appearance:none; } input[type="checkbox"]:checked { background-position:0 -19px; } -select, .select-multiple { - background:url(../images/i_dropdown.png) no-repeat right #fefefe; - border:1px solid; - border-color:#e1e1e1; - border-radius:2px; - color:#333; - font-size:15px; - padding:3px 30px 3px 7px; - -webkit-appearance:none; - -moz-appearance:none; - appearance:none; - -webkit-box-sizing:border-box; - -moz-box-sizing:border-box; - box-sizing:border-box; + +/* Account +-----------------------------*/ +.account-login .col-1, +.account-login .col-2, +.account-create .fieldset, +.customer-account-forgotpassword .fieldset, +.customer-account-logoutsuccess .page-title + p { padding:15px; } +.account-login h2, +.account-login .legend, +.account-create .legend { color:#424242; font-size:18px; font-weight:bold; margin:0 0 15px; } +.account-login .legend + p { display:none; } +.account-login p.required, +.account-create p.required, +.customer-account-forgotpassword p.required { font-size:10px; line-height:12px; margin:10px 0 0; text-align:right; } +.account-create p.required, +.customer-account-forgotpassword p.required { padding:0 15px 15px; } + +.account-create .buttons-set, +.customer-account-forgotpassword .buttons-set { padding:0 15px 15px; } +.account-create .buttons-set .back-link, +.customer-account-forgotpassword .buttons-set .back-link { display:none; } + +.customer-account-forgotpassword .fieldset p { margin:0 0 10px; } + +/* Captcha +-----------------------------*/ +.captcha-image { position:relative; } +.captcha-image .captcha-img { border:1px solid #e1e1e1; border-radius:5px; -moz-border-radius:5px; -webkit-border-radius:5px; } +.captcha-reload { position:absolute; top:5px; left:0; padding:10px; } + +/* Breadcrumbs +-----------------------------*/ +.breadcrumbs { display:none; } +.product-tags-list .page-title h1, +.catalogsearch-result-index .page-title h1 { padding-right:55px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; } +.catalogsearch-result-index .page-title h1 { padding-right:85px; } + +.page-title { + background-color:#fff !important; + color:#424242; + height:25px; + margin:0; + padding:10px 15px; } -.select-multiple { - max-width:100%; + +.page-title h1 { + font-size:18px; + line-height:25px; + text-align:left; overflow:hidden; - text-overflow:ellipsis; white-space:nowrap; - position:relative; + text-overflow:ellipsis; +} + +/* Catalog List +-----------------------------*/ +.category-description { display:none; margin:0; padding:10px; } + +.more { padding:15px 10px; text-align:center; } +.more-button { background:url(../images/bg_gradient.png) repeat-x #1394ca center; color:#fff; font-size:21px; line-height:25px; display:inline-block; padding:5px 25px; position:relative; vertical-align:top; } +.more-button.loading:before { background:url(../images/loader.gif) no-repeat center; background-size:24px 24px; content:''; display:inline-block; height:24px; width:24px; left:-30px; position:absolute; } + +.filters-block ol, +.filters-block li, +.filters-block dl, +.filters-block dt, +.filters-block dd { + margin:0; + padding:0; +} + +.filters-block-wrap {} + +.filters-block { color:#424242; margin:0; padding:10px 10px 15px; } +.filters-block dl { display:inline-block; vertical-align:top; width:49%; } + +@media(orientation:landscape) { + .filters-block dl { width:33%; } } -.select-multiple-wrap { + +.filters-block dt { color:#424242; font-weight:bold; margin:8px 0 0; } +.filters-block h3 { color:#424242; font-size:18px; line-height:20px; } +.filters-block .currently { color:#424242; } +.filters-block .actions { margin:0 0 18px; } +.filters-block .currently .block-subtitle { font-weight:bold; font-size:18px; line-height:20px; margin:5px 0 8px; } +.filters-block .currently .btn-remove { height:20px; width:20px; vertical-align:top; } +.filters-block .currently li { line-height:20px; } +.filters-block dd {} +.filters-block ol { list-style:none; line-height:17px; width:99%; } +.filters-block li { padding:9px 0; } +.filters-block a { color:#1394ca; font-weight:bold; } + +.toolbar { + font-size:12px; + padding:7px 5px 3px; + height:35px; + overflow:hidden; + text-align:right; position:relative; + top:-45px; + margin:0 0 -45px; } -.select-multiple-options-wrap { - background:#fefefe; - border:1px solid #a2a2a2; - border-radius:2px; - position:absolute; - top:0; - left:0; - right:0; - visibility:hidden; - -webkit-box-shadow:0 0 3px rgba(0, 0, 0, 0.35); - box-shadow:0 0 3px rgba(0, 0, 0, 0.35); - -webkit-tap-highlight-color:rgba(0,0,0,0); - z-index:1; +.toolbar .pager, +.toolbar .pager .amount, +.toolbar .pager .pages, +.toolbar .limiter { + float:right; } -.select-multiple-options-wrap .select-heading { - background:-webkit-gradient(linear, 0 0, 0 100%, from(#eee), to(#d4d4d4)); - background:-o-linear-gradient(top, #eee 0%, #d4d4d4 100%); - border-bottom:1px solid #a2a2a2; - color:#444; +.toolbar .amount, +.toolbar .view-mode { + line-height:23px; + padding:0 4px; +} +.toolbar .view-mode label { font-weight:bold; - font-size:13px; - text-transform:uppercase; - text-shadow:0 1px 0 #fff; - padding:5px; - white-space:nowrap; - overflow:hidden; - text-overflow:ellipsis; + position:relative; + top:1px; + vertical-align:middle; } -.select-multiple-options-wrap .select-close { - background:-webkit-gradient(linear, 0 0, 0 100%, from(#eee), to(#bbb)); - background:-o-linear-gradient(top, #eee 0%, #bbb 100%); - border:1px solid #a2a2a2; - cursor:pointer; - color:#222; - -webkit-border-radius:4px; - -moz-border-radius:4px; +.toolbar .pager { display:none; } +.toolbar .pager .pages strong { + margin-right:5px; + vertical-align:middle; +} +.toolbar .pager .pages select +.toolbar .limiter select { + background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#dedede)); + background:-o-linear-gradient(top, #fff 0%, #dedede 100%); + border:1px solid #bbb; border-radius:4px; + color:#707070; + margin:0; + padding:5px 10px; font-size:12px; - display:inline-block; - margin-right:8px; - line-height:20px; - text-align:center; - height:20px; - width:20px; - -webkit-box-shadow:0 1px 2px rgba(0, 0, 0, 0.05); - box-shadow:0 1px 2px rgba(0, 0, 0, 0.05); + line-height:17px; + vertical-align:middle; + -webkit-box-shadow:0 0 5px rgba(0, 0, 0, 0.15); + box-shadow:0 0 5px rgba(0, 0, 0, 0.15); + -webkit-background-clip:padding-box; + background-clip:padding-box; } -.select-multiple .selected-counter { - background:-webkit-gradient(linear, 0 0, 0 100%, from(#ebebeb), to(#fff)); - background:-o-linear-gradient(top, #ebebeb 0%, #bbb 100%); - border-left:1px solid #c2c2c2; - color:#4d4d4d; - display:inline-block; - font-size:12px; - font-weight:bold; - line-height:23px; - text-shadow:0 1px 0 #fff; - padding:0 8px; - position:absolute; - top:0; - bottom:0; - right:25px; +.toolbar .limiter select { + vertical-align:baseline; } -.select-multiple .selected-counter:before { - background:-webkit-gradient(linear, 0 0, 100% 0, color-stop(0.05, rgba(255, 255, 255, 0.5)), color-stop(1, rgb(255, 255, 255))); - content:''; +.toolbar .sort-by-wrap { position:absolute; - left:-41px; - top:0; - bottom:0; - width:40px; + top:7px; + right:5px; } -.select-multiple-options { - list-style:none; - margin:0 auto; - padding:0; +.toolbar .sort-by select { + background:none; + border:none; + margin:0; + padding:4px 5px 5px; + opacity:0; + width:50px; + max-width:50px; + vertical-align:middle; } -.select-multiple-options li { - border-bottom:1px solid #ccc; - cursor:pointer; +.toolbar .sort-by > label { + background:url(../images/bg_gradient.png) repeat-x 0 0 #4c4c4c; + background-size:1px 30px; + color:#fff; + display:inline-block; + font-size:14px; + font-weight:bold; + line-height:30px; + padding:0 11px; + text-align:center; + vertical-align:middle; + width:28px; + -webkit-border-radius:5px; + -moz-border-radius:5px; + border-radius:5px; + -webkit-box-shadow:0 0 5px rgba(0, 0, 0, 0.15); + box-shadow:0 0 5px rgba(0, 0, 0, 0.15); +} + +.toolbar .order { + background:url(../images/bg_gradient.png) repeat-x 0 0 #4c4c4c; + background-size:1px 30px; + display:inline-block; + vertical-align:top; + border-radius:5px; + vertical-align:top; + text-align:center; margin:0; - padding:5px 5px 5px 33px; position:relative; - -webkit-transition:background 300ms linear; + line-height:30px; + height:30px; + width:30px; + text-indent:-999em; + -webkit-box-shadow:0 0 5px rgba(0, 0, 0, 0.15); + box-shadow:0 0 5px rgba(0, 0, 0, 0.15); } -.select-multiple-options li:after { +.toolbar .order:after { content:''; - display:block; - background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAAKCAYAAABv7tTEAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYxIDY0LjE0MDk0OSwgMjAxMC8xMi8wNy0xMDo1NzowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNS4xIFdpbmRvd3MiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RDAxRDg0NzcxQjdEMTFFMUE1RjVCOUQyODJGQTNDMEMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RDAxRDg0NzgxQjdEMTFFMUE1RjVCOUQyODJGQTNDMEMiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpEMDFEODQ3NTFCN0QxMUUxQTVGNUI5RDI4MkZBM0MwQyIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpEMDFEODQ3NjFCN0QxMUUxQTVGNUI5RDI4MkZBM0MwQyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pv02V7QAAABZSURBVHjalM5BDoAwCATAfUXj/7/Dbzx43QppCW0U5bAh0AwUJPEnItIA8K4lcCqyFMFlfRXo3B/m4AsY8n8GmIF56dhhBgyNzREyA44e4CtYUIQZ0HQBBgCyITMDEAMA1AAAAABJRU5ErkJggg==) no-repeat 0 0; - height:10px; - width:13px; position:absolute; - top:9px; - left:10px; - opacity:0.2; + top:10px; + z-index:2; + font-size:0; + line-height:0; + width:0; } -.select-multiple-options li.active:after { - opacity:1; +.toolbar .order.asc:after { + border-left:5px solid transparent; + border-right:5px solid transparent; + border-bottom:10px solid #fff; + right:10px; } -.select-multiple-options li:last-child { - border-bottom:none; +.toolbar .order.desc:after { + border-left:5px solid transparent; + border-right:5px solid transparent; + border-top:10px solid #fff; + right:10px; } -.select-multiple-options li + li { - border-top:1px linear #fff; -} -.select-multiple-options .active { - background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#e5e5e5)); -} -input[type="text"] { - background:#fefefe; - border:1px solid; - border-color:#8e8e8e #e1e1e1 #e1e1e1 #8e8e8e; - border-radius:2px; - font-size:18px; - margin:0; - padding:5px; - width:100%; - -webkit-appearance:none; - -webkit-box-sizing:border-box; - box-sizing:border-box; - -webkit-box-shadow:inset 1px 1px 1px rgba(0, 0, 0, 0.1); - box-shadow:inset 1px 1px 1px rgba(0, 0, 0, 0.1); -} - -.send-friend { - display:block; - border:1px solid #D1D1D1; - margin:3px -7px -7px; - padding:9px; - border-radius:2px 2px 5px 5px; - background:-webkit-gradient(linear, 0 0, 0 100%,color-stop(0, #FCFDFD), color-stop(0.8, #EEEEEE), color-stop(1, #E8E9E9)); - background:-o-linear-gradient(top, #FCFDFD 0%, #eee 80%, #E8E9E9 100%); -} - -.send-friend h2 { - font-size:16px; line-height:16px; font-weight:bold; margin:0 0 5px; color:#333; -} - -.send-friend label { - display:block; - font-size:14px; - padding:0 0 3px; - font-weight:bold; - color:#5E5E5E; -} - -.send-friend label em { - display:none; -} - -.send-friend textarea { - border:1px solid; - border-color:#8e8e8e #e1e1e1 #e1e1e1 #8e8e8e; - border-radius:5px; - padding:5px; - font-size:18px; - height:100px; - width:100%; - -webkit-appearance:none; - -webkit-box-sizing:border-box; - box-sizing:border-box; - -webkit-box-shadow:inset 1px 1px 1px rgba(0, 0, 0, 0.1); - box-shadow:inset 1px 1px 1px rgba(0, 0, 0, 0.1); -} - -.send-friend .field { - margin:0 0 6px; -} - -.send-friend .additional-row { - border-top:1px solid #ccc; - position:relative; - margin:16px 0 0; - padding:10px 0 0; -} - -.send-friend .sender-fieldset { - padding-top:10px; -} - -.send-friend #add_recipient_button { - float:right; -} - -.send-friend .btn-remove { - position:absolute; - top:31px; - right:0; -} - -#add_recipient_button button, -.send-friend .btn-remove { - font-family:Arial; - margin:0; - padding:3px 6px; - border:1px solid #CECECE; - border-radius:2px; - background:-webkit-gradient(linear, 0 0, 0 100%, from(#FEFEFE), to(#EEE)); - background:-o-linear-gradient(top, #fefefe 0%, #eee 100%); - text-transform: small-caps; - color:#333; - font-size:24px; - line-height:20px; - text-shadow:0 1px 0 #fff; - -webkit-box-shadow:0 0 5px #ccc; - box-shadow:0 0 5px #ccc; -} - -.send-friend .btn-remove { - background:-webkit-gradient(linear, 0 0, 0 100%, from(#e4776f), to(#d83a2e)); - background:-o-linear-gradient(top, #e4776f 0%, #d83a2e 100%); - color:#fff; - border:none; - border-left:1px solid #ccc; - border-radius:0 5px 5px 0; - padding:5px 8px 8px; - text-shadow:0 1px 0 #333; - -webkit-box-shadow:none; - box-shadow:none; - width:initial; - height:initial; -} - -.send-friend button[type="submit"] { - background:-webkit-gradient(linear, 0 0, 0 100%, from(#F39823), to(#F37221)); - background:-o-linear-gradient(top, #F39823 0%, #F37221 100%); - padding:5px 20px; - font-size:14px; - color:#FFF; - border:1px solid #FFF; - border-radius:5px; - text-shadow:0 1px 2px rgba(0, 0, 0, 0.25); - -webkit-box-shadow:0 3px 3px 0 #9F9F9F; - box-shadow:0 3px 3px 0 #9F9F9F; - -webkit-background-clip:padding-box; - background-clip:padding-box; -} - -#max_recipient_message { - padding:10px 0; - font-size:16px; - font-weight:bold; -} - -/* Account Create ------------------------------*/ -.account-create h2 { - font-size:16px; - font-weight:bold; - margin:0 0 4px; -} -.account-create .form-list label { - font-weight:bold; -} -.account-create .form-list label em { - display:none; -} -.account-create .form-list .control .input-box { - display:inline-block; - vertical-align:middle; -} - -/* Account ------------------------------*/ -.login-box { margin:0 -10px -10px; padding:10px; } -.login-box form h2, -.login-box .new-users h2 { font-size:16px; line-height:16px; font-weight:bold; margin:0 0 10px; color:#333; } -.login-box form { - display:block; - border:1px solid #D1D1D1; - margin:-6px -7px -7px; - padding:9px; - border-radius:2px 2px 5px 5px; - background:-webkit-gradient(linear, 0 0, 0 100%,color-stop(0, #FCFDFD), color-stop(0.8, #eee), color-stop(1, #E8E9E9)); - background:-o-linear-gradient(top, #FCFDFD 0%, #eee 80%, #E8E9E9 100%); -} -.login-box form:after { content: "."; display: block; clear: both; visibility: hidden; line-height: 0; height: 0; } -.login-box form label { display:block; padding:0 0 3px; font-weight:bold; color:#5E5E5E; } -.login-box form > a { font-weight:bold; color:#F4641E; } -.login-box form .login-button { margin:7px 0 0; } -.login-box form .login-button input { - padding:5px 20px; - background:-webkit-gradient(linear, 0 0, 0 100%, from(#F39823), to(#F37221)); - background:-o-linear-gradient(top, #F39823 0%, #F37221 100%); - font-size:14px; - color:#FFF; - border:1px solid #FFF; - border-radius:5px; - -webkit-box-shadow:0 3px 3px 0 #9f9f9f; - box-shadow:0 3px 3px 0 #9f9f9f; - -webkit-background-clip:padding-box; - background-clip:padding-box; - text-shadow:0 1px 2px rgba(0, 0, 0, 0.25); -} -.login-box .required { font-size:12px; line-height:16px; margin:8px 0 0; } -.login-box .registered-users { margin:0 0 10px; } -.login-box .registered-users input[type="submit"] + a { text-decoration:underline; vertical-align:middle; } -.login-box .registered-users h1 { display:none; background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#ccc)); border:solid #999; border-width:1px 0; border-top-color:#ccc; text-shadow:0 1px 0 #fff; margin:0 -10px 10px; padding:10px; -webkit-box-shadow:0 3px 3px #eee; box-shadow:0 3px 3px #eee; } -.login-box .new-users { display:block; border:1px solid #D1D1D1; margin:-6px -7px -7px; padding:9px; border-radius:2px 2px 5px 5px; background:-webkit-gradient(linear, 0 0, 0 100%,color-stop(0, #FCFDFD), color-stop(0.8, #EEEEEE), color-stop(1, #E8E9E9)); } -.login-box .new-users p { padding:9px 0 0; } -.login-box .new-users input[type="submit"] { - padding:5px 20px; - background:-webkit-gradient(linear, 0 0, 0 100%, from(#F39823), to(#F37221)); - background:-o-linear-gradient(top, #F39823 0%, #F37221 100%); - font-size:14px; - color:#FFF; - border:1px solid #FFF; - border-radius:5px; - -webkit-box-shadow:0 3px 3px 0 #9F9F9F; - box-shadow:0 3px 3px 0 #9F9F9F; - -webkit-background-clip:padding-box; - background-clip:padding-box; - text-shadow:0 1px 2px rgba(0, 0, 0, 0.25); -} -.customer-account-login .messages { margin:-10px -10px 10px; } -.customer-account-login .messages .error-msg { - background:-webkit-gradient(linear, left top, left bottom, color-stop(0%,#f85032), color-stop(50%,#f16f5c), color-stop(51%,#f6290c), color-stop(71%,#f02f17), color-stop(100%,#e73827)); - background:-o-linear-gradient(top, #f85032 0%, #f16f5c 50%, #f6290c 51%, #f02f17 71%, #e73827 100%); - color:#fff; - padding:10px; - font-size:16px; - font-weight:bold; - text-align:center; - text-shadow:0 1px #222; - -webkit-box-shadow:none; - box-shadow:none; -} -.customer-account-logoutsuccess .page-title { - background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#ccc)); - background:-o-linear-gradient(top, #fff 0%, #ccc 100%); - border:solid #999; - border-width:1px 0; - border-top-color:#ccc; - margin:0 -10px 10px; - padding:10px; -} - - -#remember-me-box a { font-weight:bold; border-bottom:1px dashed; } -#remember-me-box label { display:inline; margin-right:10px; } -#remember-me-popup { - background-position:top center; - background-image:-webkit-gradient(radial, center -99%, 125, center -99%, 200, from(#fff), to(#0c1e4d)); - border:2px solid rgba(255, 255, 255, 0.95); - border-radius:7px; - font-size:14px; - color:#fff; - font-weight:bold; - position:absolute; - top:50%; left:50%; - margin:-25% 0 0 -120px; - padding:10px; - width:220px; - text-shadow:0 -1px 1px rgba(0, 0, 0, 0.8); - -webkit-box-shadow:0 2px 14px rgba(0, 0, 0, 0.5); - box-shadow:0 2px 14px rgba(0, 0, 0, 0.5); - -webkit-background-clip:padding-box; - background-clip:padding-box; -} -#remember-me-popup h3 { margin-bottom:5px; text-align:center; } -#window-overlay, -.remember-me-popup-close { display:none; } -.remember-me-popup-body .remember-me-popup-close-button { text-align:center !important; } -.remember-me-popup-body .remember-me-popup-close { - background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #757d90), color-stop(50%, #343f5c), color-stop(51%, #162344), color-stop(100%, #232f4e)); - color:#fff; - border:1px solid #131e3a; - border-radius:5px; - display:inline-block; - margin:10px 0 0; - padding:5px 15px; - text-align:center !important; - -webkit-box-shadow:0 1px 0 rgba(255, 255, 255, 0.25), inset 0 1px 0 rgba(0, 0, 0, 0.75); - box-shadow:0 1px 0 rgba(255, 255, 255, 0.25), inset 0 1px 0 rgba(0, 0, 0, 0.75); - -webkit-background-clip:padding-box; - background-clip:padding-box; -} - -/* Forgot password ------------------------------*/ -.forgot-password { margin:-10px; padding:10px; color:#333; } -.forgot-password h1 { - background: -webkit-gradient(linear, 0 0, 0 100%, from(white), to(#CCC)); - background:-o-linear-gradient(top, #fff 0%, #ccc 100%); - border: solid #999; - border-top-color: #CCC; - text-shadow: 0 1px 0 white; - margin:0 -10px; - padding: 10px; - -webkit-box-shadow: 0 3px 3px #eee; - box-shadow: 0 3px 3px #eee; - border-width: 1px 0; -} -.forgot-password a { float:left; font-size:12px; } -.forgot-password h2 { font-size:16px; font-weight:bold; padding:0 0 0 5px; margin:0 0 7px; } -.forgot-password label { padding:0 0 0 5px; font-weight:bold; } -.forgot-password input[type="email"] { - background:#fefefe; - border:1px solid; - border-color:#8e8e8e #e1e1e1 #e1e1e1 #8e8e8e; - border-radius:2px; - font-size:18px; - margin:3x 0 8px; - padding:5px; - width:100%; - -webkit-appearance:none; - -webkit-box-sizing:border-box; - box-sizing:border-box; - -webkit-box-shadow:inset 1px 1px 1px rgba(0, 0, 0, 0.1); - box-shadow:inset 1px 1px 1px rgba(0, 0, 0, 0.1); -} -.forgot-password form { display:block; border:1px solid #D1D1D1; margin:3px -7px -7px; padding:9px 9px 30px; border-radius:2px 2px 5px 5px; background:-webkit-gradient(linear, 0 0, 0 100%,color-stop(0, #FCFDFD), color-stop(0.8, #EEEEEE), color-stop(1, #E8E9E9)); } -.forgot-password form:after { content: "."; display:block; clear:both; visibility:hidden; line-height:0; height:0; } -.forgot-password input[type="submit"] { - background:-webkit-gradient(linear, 0 0, 0 100%, from(#F39823), to(#F37221)); - background:-o-linear-gradient(top, #F39823 0%, #F37221 100%); - margin:5px 0 0; - padding:5px 20px; - font-size:14px; - color:#FFF; - border:1px solid #FFF; - border-radius:5px; - -webkit-box-shadow:0 3px 3px 0 #9F9F9F; - box-shadow:0 3px 3px 0 #9F9F9F; - text-shadow:0 1px 2px rgba(0, 0, 0, 0.25); -} - -/* New Customer ------------------------------*/ -.new-customer { margin:0 -10px -10px; padding:10px; color:#333; } -.new-customer h1 { background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#ccc)); background:-o-linear-gradient(top, #fff 0%, #ccc 100%); border:solid #999; border-width:1px 0; border-top-color:#ccc; text-shadow:0 1px 0 #fff; margin:0 -10px 10px; padding:10px; -webkit-box-shadow:0 3px 3px #eee; box-shadow:0 3px 3px #eee; } -.new-customer h2 { font-size:16px; line-height:16px; font-weight:bold; margin:0 0 7px 0; color:#333; } -.new-customer form { display:block; border:1px solid #D1D1D1; margin:-6px -7px -7px; padding:9px; border-radius:2px 2px 5px 5px; background:-webkit-gradient(linear, 0 0, 0 100%,color-stop(0, #FCFDFD), color-stop(0.8, #EEEEEE), color-stop(1, #E8E9E9)); background:-o-linear-gradient(top, #FCFDFD 0%, #eee 80%, #E8E9E9 100%); } -.new-customer form:after { content: "."; display:block; clear:both; visibility:hidden; line-height:0; height:0; } -.new-customer form label { font-weight:bold; } -.new-customer form label em { display:none; } -.new-customer .personal-information { border-bottom:1px solid #ccc; padding:0 0 10px; } -.new-customer .personal-information .field { margin-bottom:8px; } -.new-customer .login-information { border-top:1px solid #fff; padding-top:10px; } -.new-customer .login-information input[type="submit"], -.new-customer .login-information > a { padding:5px 20px; background:-webkit-gradient(linear, 0 0, 0 100%, from(#F39823), to(#F37221)); background:-o-linear-gradient(top, #F39823 0%, #F37221 100%); font-size:14px; color:#FFF; border:1px solid #FFF; border-radius:5px; -webkit-box-shadow:0 3px 3px 0 #9F9F9F; box-shadow:0 3px 3px 0 #9F9F9F; text-shadow:0 1px 2px rgba(0, 0, 0, 0.25); } -.new-customer .login-information input[type="submit"] { margin:0; } -.new-customer .login-information > a { float:left; display:block; } - -/* Edit Account Settings ------------------------------*/ -.account-edit {} - -/* Breadcrumbs ------------------------------*/ -.breadcrumbs { - background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#e5e5e5)); - background:-o-linear-gradient(top, #fff 0%, #e5e5e5 100%); - border-bottom:1px solid #ccc; - height:40px; - margin:0 -10px 0; -} -.breadcrumbs ul { padding:10px; line-height:20px; position:relative; } -.breadcrumbs ul a { color:#666; } -.breadcrumbs ul span, -.breadcrumbs ul li[class*="category"] { display:none; } -.breadcrumbs ul li.home, -.catalog-product-view .breadcrumbs li:nth-last-child(2), -.catalog-category-view .breadcrumbs li:nth-last-child(2), -.review-product-list .breadcrumbs li:nth-last-child(2) { display:none; top:7px; left:20px; position:absolute; } -.breadcrumbs ul li:last-child { display:block; font-size:16px; font-weight:bold; text-align:center; text-shadow:0 1px 0 #fff; margin:0 auto; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; width:50%; } - -/* Back Button ------------------------------*/ -#nav-container li.subcategory-header .button-wrap:before { - content:''; - background:url(../images/bg_button.png) no-repeat left top; - -webkit-background-size:100px 28px; - background-size:100px 28px; - height:28px; - width:28px; - position:absolute; - top:0; - left:-13px; - z-index:2; -} -#nav-container li.subcategory-header button { - color:#2f2f2f; - background:url(../images/bg_button.png) no-repeat right top; - background-size:100px 28px; - display:inline-block; - font-size:11px; - text-shadow:0 1px 0 rgba(255, 255, 255, 0.5); - line-height:15px; - margin:0 ; - padding:6px 9px 7px 2px; - position:relative; - border:none; - font-weight:bold; - z-index:3; - -webkit-appearance:none; - max-width:50px; - overflow:hidden; - white-space:nowrap; - text-overflow:ellipsis; -} - -.catalogsearch-result-index .page-title { display:none; } -.catalogsearch-result-index .breadcrumbs:first-child { display:none; } -.catalogsearch-result-index .note-msg { padding:10px 0 0; } - -/* Catalog List ------------------------------*/ -section .category-title { display:none; } - -.filters-block ol, -.filters-block li, -.filters-block dl, -.filters-block dt, -.filters-block dd { - margin:0; - padding:0; -} - -.filters-block-wrap { -} - -.filters-block { - background:url(../images/fabric.jpg) no-repeat 0 0; - border-top:1px solid #ccc; - font-size:13px; - margin:10px -10px -10px; - padding:10px 10px 15px; -} - -.filters-block dl { - display:inline-block; - vertical-align:top; - width:49%; -} - -@media(orientation:landscape) { - .filters-block dl { - width:33%; - } -} - -.filters-block dt { - color:#555; - font-size:13px; - font-weight:bold; - text-shadow:0 1px 0 #f6f6f6; - text-transform:uppercase; - margin:8px 0 0; -} - -.filters-block h3 { - color:#444; - font-size:15px; - text-shadow:0 1px 0 #f6f6f6; -} - -.filters-block .currently { - position:relative; - z-index:2; -} - -.filters-block .currently .block-subtitle { - color:#555; - font-weight:bold; - font-size:13px; - text-shadow:0 1px 0 #f6f6f6; - text-transform:uppercase; - margin:5px 0 0; -} - -.filters-block .currently .btn-remove { - background-image:url(../images/btn_trash.png); - background-size:10px 10px; - background-repeat:no-repeat; - background-position:center; - float:none; - display:inline-block; - vertical-align:middle; - top:-2px; - text-indent:-999em; - margin-right:2px; -} - -.filters-block .currently .actions { - float:right; - margin:-24px 0 0; -} - -.filters-block .currently ol { - font-size:14px; - line-height:16px; -} - -.filters-block .currently li { - padding:5px 0; -} - - -.filters-block dd { -} - -.filters-block ol { - list-style:none; -} - -.filters-block li { - text-shadow:0 1px 0 #f6f6f6; -} - -.filters-block a { - color:#fb6b36; -} -.toolbar { - background:#d7d7d7; - color:#707070; - border-bottom:1px solid #a0a0a0; - font-size:12px; - margin:1px -10px 0; - padding:5px; - overflow:hidden; - text-shadow:0 1px 0 #fff; -} -.toolbar .pager, -.toolbar .pager .amount, -.toolbar .pager .pages, -.toolbar .limiter { - float:right; -} -.toolbar .amount, -.toolbar .view-mode { - line-height:23px; - padding:0 4px; -} -.toolbar .view-mode label { - font-weight:bold; - position:relative; - top:1px; - vertical-align:middle; -} -.toolbar .pager .pages strong { - margin-right:5px; - vertical-align:middle; -} -.toolbar .pager .pages select, -.toolbar .sort-by select, -.toolbar .limiter select { - background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#dedede)); - background:-o-linear-gradient(top, #fff 0%, #dedede 100%); - border:1px solid #bbb; - border-radius:4px; - color:#707070; - margin:0; - padding:5px 10px; - font-size:12px; - line-height:17px; - vertical-align:middle; - -webkit-box-shadow:0 0 5px rgba(0, 0, 0, 0.15); - box-shadow:0 0 5px rgba(0, 0, 0, 0.15); - -webkit-background-clip:padding-box; - background-clip:padding-box; -} -.toolbar .limiter select { - vertical-align:baseline; -} -.toolbar .sort-by select { - font-weight:bold; - padding:5px 10px 5px 51px; - vertical-align:middle; -} -.toolbar .sort-by select:after { - content:'1'; -} -.toolbar .sort-by > label { - position:absolute; - margin:6px 0 0 8px; - vertical-align:middle; -} -.toolbar .sort-by > a, -.toolbar .sort-by > a img { - vertical-align:middle; -} -.toolbar .prev-page, -.toolbar .next-page, -.toolbar .order, -.toolbar .order, -.toolbar .grid, -.toolbar .list { - background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#dedede)); - background:-o-linear-gradient(top, #fff 0%, #dedede 100%); - border:1px solid #bbb; - border-radius:5px; - display:inline-block; - vertical-align:top; - text-align:center; - line-height:23px; - position:relative; - height:27px; - width:27px; - text-indent:-999em; - -webkit-box-shadow:0 0 5px rgba(0, 0, 0, 0.15); - box-shadow:0 0 5px rgba(0, 0, 0, 0.15); - -webkit-background-clip:padding-box; - background-clip:padding-box; -} -.toolbar .grid:after, -.toolbar .list:after { - background:url(../images/grid.png) no-repeat 0 0; - content:''; - display:inline-block; - position:absolute; - top:8px; - left:8px; - height:11px; - width:11px; -} -.toolbar .list:after { - background:url(../images/list.png) no-repeat 0 0; -} -.toolbar .prev-page.disabled, -.toolbar .next-page.disabled, -.toolbar .grid.disabled, -.toolbar .list.disabled { - opacity:0.5; -} -.toolbar .prev-page:after, -.toolbar .next-page:after, -.toolbar .order:after { - content:''; - position:absolute; - top:9px; - z-index:2; - font-size:0; - line-height:0; - width:0; -} -.toolbar .prev-page:after { - border-top:5px solid transparent; - border-right:10px solid #000; - border-bottom:5px solid transparent; - right:9px; -} - -.toolbar .next-page:after { - border-top:5px solid transparent; - border-left:10px solid #000; - border-bottom:5px solid transparent; - left:10px; -} -.toolbar .order.asc:after { - border-left:5px solid transparent; - border-right:5px solid transparent; - border-bottom:10px solid #000; - right:9px; -} -.toolbar .order.desc:after { - border-left:5px solid transparent; - border-right:5px solid transparent; - border-top:10px solid #000; - right:9px; -} -.toolbar a { - color:#707070; -} -.toolbar .sort-order img { - vertical-align:top; -} - -.category-products { - margin:0 -10px -10px; -} - -.c-list > li { - position:relative; - border-bottom:1px solid #ebe9eb; -} -.c-list > li:last-child { display:block; border-bottom:none; } -.c-list > li > a { - background:url(../images/i_arrow_small.png) no-repeat right #fff; - -webkit-background-size:8px 12px; - background-size:8px 12px; - -webkit-background-origin:content-box; - background-origin:content-box; - color:#2f2f2f; - display:block; - padding:10px; - -webkit-user-select:none; - user-select:none; - -webkit-touch-callout:none; - touch-callout:none; - -webkit-tap-highlight-color:rgba(0,0,0,0); -} -.c-list > li > a:after { - content:"."; - display:block; - clear:both; - visibility:hidden; - line-height:0; - height:0; -} -.c-list li > .actions { - padding:0 5px 0 90px; - position:absolute; - left:0; - top:10px; - bottom:10px; - width:100%; - z-index:0; - -webkit-box-sizing:border-box; - box-sizing:border-box; -} - -.csstransforms .c-list li > .actions { - -moz-transform:translate(-100%, 0); - -webkit-transform:translate(-100%, 0); - -o-transform:translate(-100%, 0); - transform:translate(-100%, 0); -} - -.csstransforms .c-list > li.animated > .actions { - -moz-transition:all .5s linear; - -webkit-transition:all .5s linear; - -o-transition:all .5s linear; - transition:all .5s linear; - -moz-transform:translate(0, 0); - -webkit-transform:translate(0, 0); - -o-transform:translate(0, 0); - transform:translate(0, 0); -} - -.csstransforms .c-list > li.end-animation > .actions { - -moz-transition:all .5s linear; - -webkit-transition:all .5s linear; - -o-transition:all .5s linear; - transition:all .5s linear; - -moz-transform:translate(-100%, 0); - -webkit-transform:translate(-100%, 0); - -o-transform:translate(-100%, 0); - transform:translate(-100%, 0); -} - -.csstransforms3d .c-list li > .actions { - -webkit-perspective:1000; - -webkit-backface-visibility:hidden; - -webkit-transform:translateX(-100%); -} - -.csstransforms3d .c-list > li.animated > .actions { - -webkit-animation:bounce 500ms; - -webkit-transform:translateX(0); -} - -.csstransforms3d .c-list > li.end-animation > .actions { - -webkit-transition:all 250ms linear; - -webkit-transform:translateX(-100%); -} - -@-webkit-keyframes bounce { - 0% { -webkit-transform:translateX(-100%); - -webkit-animation-timing-function:ease-in; } - - 50% { -webkit-transform:translateX(10%); - -webkit-animation-timing-function:ease-out; } - - 100% { -webkit-transform:translateX(0); } -} - -.c-list li > .actions ul { - border:1px solid; - border-color:#ddd #d4d4d4 #ccc; - border-radius:2px; - display:table; - background:-webkit-gradient(linear, 0 0, 0 100%, from(#F1F1F1), to(#E0DFE0)); - background:-o-linear-gradient(top, #F1F1F1 0%, #E0DFE0 100%); - width:100%; - height:73px; - -webkit-box-shadow:0 0 3px rgba(0, 0, 0, 0.1); - box-shadow:0 0 3px rgba(0, 0, 0, 0.1); -} - -@media(orientation:landscape) { - .c-list li > .actions ul { - } -} - -.c-list li > .actions ul li { - display:table-cell; - text-align:center; - line-height:1; -} -.c-list li > .actions ul li a { - display:inline-block; - padding:3px; - max-width:44px; - font-size:10px; - color:#4B4B4B; - text-shadow:0 1px 0 #fff; -} - -.c-list li > .actions i { - display:inline-block; - border-radius:2px; - margin-bottom:2px; - height:37px; - width:37px; - clear:both; - border:1px solid #cdcdcd; -} - -.c-list li > .actions .i-view-details i { - background:url(../images/i_view_details.png) no-repeat #fff top; -} - -.c-list li > .actions .i-add-to-cart i { - background:url(../images/i_add_to_cart.png) no-repeat #fff top; -} - -.c-list li > .actions .i-view-gallery i { - background:url(../images/i_gallery.png) no-repeat #fff top; -} - -.c-list li > .actions .i-send-friend i { - background:url(../images/i_tell_a_friend.png) no-repeat #fff top; -} - -.c-list li > .actions .i-send-wishlist i { - background:url(../images/i_add_to_wishlist.png) no-repeat #fff top; -} - -.c-list h1 { font-size:16px; font-weight:bold; } -.c-list .cloned-wrap, -.c-grid .cloned-wrap { position:absolute; padding:10px; opacity:0; } -.c-list .cloned-wrap .product-image img, -.c-grid .cloned-wrap .product-image img { -webkit-box-shadow:none; box-shadow:none; } -.c-list .product-image { float:left; margin-right:10px; -webkit-transform:translate3d(0,0,0); } -.c-list .product-image img, -.c-grid .product-image img { background:#fff; border:1px solid #ccc; border-radius:1px; padding:3px; -webkit-box-shadow:0 1px 5px rgba(0,0,0,0.28); box-shadow:0 1px 5px rgba(0,0,0,0.28); } -.c-list .product-shop { overflow:hidden; padding-right:30px; } -.c-list .product-shop h1 { font-size:14px; font-weight:bold; text-align:left; margin:5px 0 7px; } -.c-list .product-shop .price-box { font-size:11px; margin:0 0 5px; } - -.c-grid { - background:#eee; - display:table; - border-collapse:collapse; - border-spacing:0; - margin:-1px 0 0; - width:100%; - -webkit-tap-highlight-color:rgba(0,0,0,0); -} -.c-grid .row { - display:table-row; -} -.c-grid .cell { - background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#eee)); - background:-o-linear-gradient(top, #fff 0%, #eee 100%); - display:table-cell; - position:relative; - border:1px solid #ccc; - vertical-align:top; - width:50%; -} -.c-grid.ready .cell { - background:#ccc; - -webkit-box-shadow:inset 0 -10px 10px rgba(0, 0, 0, 0.25), inset 0 10px 10px rgba(0, 0, 0, 0.25), inset -10px 0 10px rgba(0, 0, 0, 0.25), inset 10px 0 10px rgba(0, 0, 0, 0.25); - box-shadow:inset 0 -10px 10px rgba(0, 0, 0, 0.25), inset 0 10px 10px rgba(0, 0, 0, 0.25), inset -10px 0 10px rgba(0, 0, 0, 0.25), inset 10px 0 10px rgba(0, 0, 0, 0.25); - -webkit-touch-callout:none; -} -@media all and (-webkit-transform-3d) { - .c-grid.ready .cell { background:url(data:image/png;base64,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); } -} -.c-grid .position-wrap { - position:relative; -} -.c-grid .row .cell:first-child { border-left:0; } -.c-grid .row .cell:last-child { border-right:0; } -.c-grid .row:last-child .cell { - border-bottom:0; -} -.c-grid .row .cell:only-child { - border-right:1px solid #ccc; -} -.c-grid .i-flip { - background:url(../images/flip.png) no-repeat 25px 10px; - background-size:15px 15px; - margin-left:-50px; - float:right; - height:50px; - width:50px; - position:relative; - z-index:1; - -webkit-backface-visibility:hidden; -} -.c-grid .flip-block-wrap { - -webkit-perspective:1000; -} -.c-grid .flip-block { - display:inline-block; - height:100%; - width:100%; -} -.c-grid .flip-block .wrap { - padding:15px 10px 10px;; -} -.c-grid .flip-block.active { -} -.c-grid .cloned-wrap { - top:0; - left:0; - height:100%; - width:100%; - opacity:0; - padding:0; -} -.c-grid .cloned-wrap .wrap { - padding:15px 10px 10px; - -webkit-transition:-webkit-transform linear 200ms; -} - -.to-cart-animate { - -webkit-animation:bounce-rotate 200ms infinite -} - -.drop-start { -webkit-transform:scale(1.2); opacity:0.9; } - -@-webkit-keyframes bounce-rotate { - 0% { -webkit-transform:rotate(3deg) skew(1deg) scale(1.2); } - 25% { -webkit-transform:rotate(0) skew(0) scale(1.2); } - 50% { -webkit-transform:rotate(-3deg) skew(-1deg) scale(1.2); } - 75% { -webkit-transform:rotate(0) skew(0) scale(1.2); } - 100% { -webkit-transform:rotate(3deg) skew(1deg) scale(1.2); } -} - -.c-grid .flip-block .front { - background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#eee)); - background:-o-linear-gradient(top, #fff 0%, #eee 100%); -} -.c-grid .flip-block .front, -.c-grid .flip-block .back { - display:inline-block; - height:100%; - width:100%; - position:relative; - -webkit-backface-visibility:hidden; -} -.c-grid .flip-block .back { - background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#eee)); - background:-o-linear-gradient(top, #fff 0%, #eee 100%); - position:absolute; -} -.c-grid .flip-block.active .back { - z-index:1; -} -@media all and (-webkit-transform-3d) { - .c-grid .flip-block { - -webkit-transform-style:preserve-3d; - -webkit-transition:ease-in-out 600ms; - } - .c-grid .flip-block.active { - -webkit-transform:rotateY(180deg); - } - .c-grid .flip-block .back { - -webkit-transform:rotateY(180deg) translate3d(0, 0, 1px); - } -} -.c-grid .back-face { padding:10px; } -.c-grid .back-face .rating-box { display:inline-block; } -.c-grid .back-face .rating-links { margin:-2px 0 2px; } -.c-grid .back-face .rating-links a { color:#fb6b36; text-decoration:underline; } -.c-grid .back-face .price-box { font-size:12px; margin:5px 0 10px; } -.c-grid .back-face .price-box .special-price .price { font-weight:bold; } -.c-grid .back-face .add-to-cart { - background:-webkit-gradient(linear, 0 0, 0 100%, from(#F39823), to(#F37221)); - background:-o-linear-gradient(top, #F39823 0%, #F37221 100%); - border:1px solid #fff; - border-radius:5px; - color:#fff; - font-size:11px; - font-weight:bold; - margin-left:-2px; - padding:5px 10px; - text-shadow:0 1px 0 #999; - -webkit-box-shadow:0 3px 3px 0 #9F9F9F; - box-shadow:0 3px 3px 0 #9F9F9F; - -webkit-background-clip:padding-box; - background-clip:padding-box; -} -.c-grid .back-face .rating-links .separator, -.c-grid .back-face .rating-links .separator + a { - display:none; -} -.c-grid .product-shop, -.c-grid .product-image { - text-align:center; -} -.c-grid .product-shop h1 { - margin-bottom:5px; -} - -/* Product Info Box ------------------------------*/ -.catalog-product-view .messages { margin:0 -10px 0; } -.product-view { padding:0 0 0; } -.product-shop { padding:8px 0 0; } -.product-shop a { color:#fb6b36; text-decoration:underline; } -.product-shop .item-options { margin:0 0 10px; } -.product-shop .item-options dt { font-weight:bold; } -.product-shop .product-image-and-actions { float:left; margin:0 10px 0 0; } -.product-shop .product-image-wrap { position:relative; max-width:150px; } -.product-shop .product-image { position:relative; } -.product-shop .product-image:before { - content:''; - display:block; - background:url(../images/search_icon.png) no-repeat 0 0; - -webkit-background-size:14px 14px; - background-size:14px 14px; - -webkit-background-origin:padding-box; - background-origin:padding-box; - position:absolute; - top:7px; - right:7px; - height:14px; - width:14px; - z-index:1; -} -.product-shop .product-image-wrap img { -webkit-border-radius:1px; -webkit-box-shadow:0 0 3px #D1D1D1; box-shadow:0 0 3px #D1D1D1; -webkit-transition:-webkit-transform ease-in 300ms; position:relative; } -.product-shop .product-image-wrap img.animate { z-index:101; } -.product-shop .product-image-wrap img.cloned { position:absolute; top:0; left:0; } -.product-shop .product-image .carousel-items li { padding:2px 2px 0; } -.product-shop .product-image .more-views { padding:3px 0 0 0; } -.product-shop .wrap:before, .product-shop .wrap:after { content: ""; display: table; } -.product-shop .wrap:after { clear:both; } - - -.product-view .add-to-links, -.product-actions { display:table; overflow:hidden; margin:5px 0 0; padding:5px 0; width:100%; text-align:center; } -.product-view .add-to-links li, -.product-actions li { display:table-cell; text-align:center; line-height:1; } -.product-view .add-to-links li + li, -.product-actions li + li { border-left:1px solid #fb6b36; } -.product-view .add-to-links li a, -.product-actions li a { color:#fb6b36; font-weight:bold; text-decoration:none; } -.product-view .add-to-links .separator { display:none; } -.product-essential p.required { color:#F9721F; } -.product-essential h1 { font-size:16px; text-align:left; font-weight:bold; margin-bottom:0; line-height:1.3; } -.product-essential .availability { color:#3b3b3b; font-size:13px; font-weight:bold; margin:0 0 3px; } -.product-essential .availability span { font-weight:normal; } -.product-essential .product-options dt label { font-size:14px; font-weight:bold; } -.product-essential .product-options dt label em { float:left; margin:0 4px 0 0; color:#F9721F; } -.product-essential .product-options dd { border-bottom:1px solid #bbb; padding:0 0 10px; } -.product-essential .product-options dd + dt { border-top:1px solid rgba(255, 255, 255, 0.75); padding:10px 0 0; } -.product-essential .product-options dd:last-child { border:none; } -.product-essential .product-options select { width:100%; } -.product-essential .product-options input[type=text] { font-size:12px; width:20%; } -.product-essential .product-options input[type=text]:disabled { background:#ddd; } -.product-essential .product-options .qty-holder { display:block; margin:5px 0 0; } -.product-essential .product-options .options-list li { padding:10px 0 0; } -.product-essential .product-options .options-list a { color:#fb6b36; text-decoration:underline; } - -.product-essential .product-options-bottom { background:#fefefe; position:relative; } -.product-essential .product-options-bottom .required { margin:10px 0; } -.product-essential .product-options-bottom .price-box { float:right; max-width:50%; } -.product-essential .product-options-bottom .price-box .price-as-configured { text-align:right; } -.product-essential .product-options-bottom .price-box .price-as-configured .price { display:block; font-size:18px; line-height:26px; text-shadow:0 1px 0 #fff; text-align:right; } -.product-essential .product-options-bottom .add-to-cart { float:left; width:50%; } -.product-essential .product-options-bottom .add-to-cart label { display:inline-block; font-size:14px; font-weight:bold; vertical-align:middle; } -.product-essential .product-options-bottom .add-to-cart input[type=text] { display:inline-block; width:40px; font-size:12px; vertical-align:middle; } -.product-essential .product-options-bottom button { - display:block; - padding:5px 20px; - background:-webkit-gradient(linear, 0 0, 0 100%, from(#F39823), to(#F37221)); - background:-o-linear-gradient(top, #F39823 0%, #F37221 100%); - font-size:14px; - color:#FFF; - clear:both; - float:right; - border:1px solid #FFF; - border-radius:5px; - margin:10px 0; - text-shadow:0 1px 2px rgba(0, 0, 0, 0.25); - -webkit-box-shadow:0 3px 3px 0 #9F9F9F; - box-shadow:0 3px 3px 0 #9F9F9F; -} -.product-shop .price-box { overflow:hidden; } - .product-shop .price-box .price-label { vertical-align:baseline; } - .product-shop .price-box .old-price { color:#ccc; } - .product-shop .price-box .special-price .price-label { color:#222; } - .product-shop .price-box .special-price .price { font-weight:bold; } - - .price-box .price-excluding-tax, - .price-box .price-including-tax { display:block; } - .price-box .price-excluding-tax .label, - .price-box .price-including-tax .label { font-weight:bold; } - -.product-shop .product-desc { display:table;} -.product-shop .product-desc .ratings { overflow:hidden; } -.product-shop .product-desc .ratings, -.product-shop .product-desc .ratings a { color:#FB6B36; } -.rating-box { background:url(../images/i_star_black.png) repeat-x center left; background-size:15px 15px; width:75px; height:15px; margin:3px 0; } -.rating-box .rating { height:15px; background:url(../images/i_star.png) repeat-x center left; background-size:15px 15px; } - -.product-shop .product-options-bottom .price-box { font-size:14px; text-align:right; } -.product-shop .product-options-bottom .price-box .price { font-weight:bold; } -.product-shop .product-options-bottom .add-to-cart label, -.product-shop .product-options-bottom .add-to-cart input[type=text] { vertical-align:middle; margin:0; } -.product-shop .product-options-bottom .product-actions { margin:5px 0 10px; } -.product-shop .product-options-bottom .product-actions li { display:table-cell; } - -.product-shop .add-to-cart-box { padding:5px 0; } -.product-shop .add-to-cart-box label { vertical-align:middle; } -.product-shop .add-to-cart-box .qty { border:1px solid #ccc; border-radius:3px; font-size:12px; font-weight:bold; margin:0 0 0 5px; padding:4px 5px; -webkit-appearance:none; -webkit-background-clip:padding-box; background-clip:padding-box; width:35px; -webkit-box-sizing:content-box; box-sizing:content-box; vertical-align:middle; } -.product-shop .add-to-cart-box button { - clear:both; - display:block; - margin:0; - padding:5px 20px; - background:-webkit-gradient(linear, 0 0, 0 100%, from(#F39823), to(#F37221)); - background:-o-linear-gradient(top, #F39823 0%, #F37221 100%); - font-size:14px; - color:#FFF; - border:1px solid #FFF; - border-radius:5px; - text-shadow:0 1px 2px rgba(0, 0, 0, 0.25); - -webkit-box-shadow:0 3px 3px 0 #9F9F9F; - box-shadow:0 3px 3px 0 #9F9F9F; - -webkit-background-clip:padding-box; - background-clip:padding-box; -} -.product-shop .add-to-cart-box input + button { margin-top:10px; } -@media (orientation: landscape) { - .product-shop .add-to-cart-box button { clear:none; display:inline-block; margin:0 0 0 10px; } -} - -.product-shop .product-image-and-actions .actions { margin:15px 0 0; } -.product-shop .product-image-and-actions .actions a { display:block; text-align:center; width:100px; margin:5px 0 0; padding:4px 10px; background:-webkit-gradient(linear, 0 0, 0 100%, from(#FFF), to(#C1C3C4)); background:-o-linear-gradient(top, #FFF 0%, #C1C3C4 100%); font-size:12px; font-weight:bold; color:#636363; border:1px solid #FFF; border-radius:5px; -webkit-box-shadow:0 0 3px 0 #9F9F9F; box-shadow:0 0 3px 0 #9F9F9F; } -.product-shop .product-image-and-actions .actions a:last-child { margin:5px 0 10px; } - -#product-options-wrapper dl, .giftcard-send-form { - background:-webkit-gradient(linear, 0 0, 0 100%, from(#F6F6F6), to(#C5C5C5)); - background:-o-linear-gradient(top, #F6F6F6 0%, #C5C5C5 100%); - margin:10px 0; - padding:5px 10px; - border:1px solid #FFF; - border-radius:5px; - -webkit-box-shadow:0 0 3px 0 #9F9F9F; - box-shadow:0 0 3px 0 #9F9F9F; -} - -/* -.product-essential .product-options dt label { font-size:14px; font-weight:bold; } -.product-essential .product-options dt label em { float:left; margin:0 4px 0 0; color:#F9721F; } -.product-essential .product-options dd { border-bottom:1px solid #bbb; padding:0 0 10px; } -.product-essential .product-options dd + dt { border-top:1px solid rgba(255, 255, 255, 0.75); padding:10px 0 0; } -.product-essential .product-options dd:last-child { border:none; } -.product-essential .product-options select { width:100%; } -.product-essential .product-options input[type=text] { font-size:12px; width:20%; } -.product-essential .product-options input[type=text]:disabled { background:#ddd; } -.product-essential .product-options .qty-holder { display:block; margin:5px 0 0; } -.product-essential .product-options .options-list li { padding:10px 0 0; } -*/ - -.giftcard-send-form em { color:#f9721f; margin:0 4px 0 0; } -.giftcard-send-form label { display:block; font-size:14px; font-weight:bold; margin:0 0 2px; } -.giftcard-send-form select { font-size:18px; width:100%; } -.giftcard-send-form li { border-bottom:1px solid #bbb; margin:0; padding:0 0 8px; } -.giftcard-send-form li + li { border-top:1px solid rgba(255, 255, 255, 0.75); padding:8px 0 0; } -.giftcard-send-form li:last-child { border-bottom:none; } -.giftcard-send-form .field { margin-bottom:8px; } -.giftcard-send-form .gift-card-amount-field { padding:0; } -.giftcard-send-form .notice { text-align:right; } -.giftcard-send-form .notice span { float:left; font-size:11px; display:block; } -.giftcard-send-form .notice span:last-child { float:none; } - -#product-attribute-specs-table { width:100%; border-collapse:collapse; } -#product-attribute-specs-table th, -#product-attribute-specs-table td { padding:2px; vertical-align:middle; text-align:left !important; } -#product-attribute-specs-table tr:nth-child(odd) td, -#product-attribute-specs-table tr:nth-child(odd) th { background:#f6f6f6; } - -.grouped-items-table { border:1px solid #ccc; font-size:11px; line-height:13px; margin:0 0 5px; -webkit-border-radius:5px; } -.grouped-items-table th { - background:-webkit-gradient(linear, 0 0, 0 100%, from(#f6f6f6), to(#ccc)); - background:-o-linear-gradient(top, #f6f6f6 0%, #ccc 100%); - border-bottom:1px solid #bbb; - padding:2px 2px 3px; -} -.grouped-items-table td { border-bottom:1px solid #ccc; vertical-align:top; } -.grouped-items-table input { width:20px; } -.grouped-items-table .price-box { margin:0; } -.grouped-items-table .price-excluding-tax, -.grouped-items-table .price-including-tax { display:block; } - -.product-shop .grouped-grid { - border:1px solid #fff; - padding:5px 10px 10px; - margin:10px 0 0; - border-radius:5px; - background:-webkit-gradient(linear, 0 0, 0 100%, from(#f6f6f6), to(#c5c5c5)); - background:-o-linear-gradient(top, #f6f6f6 0%, #c5c5c5 100%); - -webkit-box-shadow:0 0 3px 0 #9F9F9F; - box-shadow:0 0 3px 0 #9F9F9F; -} - -.product-shop .grouped-grid .add-to-cart-box { - padding:5px 0 2px; - text-align:right; -} - -.product-shop .grouped-grid .add-to-cart-box button { - display:inline-block; -} - -.product-shop .grouped-items-table { border:none; border-spacing:0; font-size:12px; margin:0; -webkit-border-radius:0; width:100%; } -.product-shop .grouped-items-table th, -.product-shop .grouped-items-table td { padding:5px 0; } -.product-shop .grouped-items-table th { background:none; border:none; text-align:left; } -.product-shop .grouped-items-table td { background:none; border:none; border-top:1px solid rgba(255, 255, 255, 0.75); border-bottom:1px solid #bbb; text-align:left; vertical-align:middle; } -.product-shop .grouped-items-table tr:first-child td { border-top:none; } -.product-shop .grouped-items-table tr:last-child td { border-bottom:none; } - -.product-shop .grouped-items-table input.qty { - border:1px solid #bababa; - border-radius:3px; - font-size:12px; - font-weight:bold; - padding:4px 5px; - vertical-align:middle; - width:25px; - -webkit-appearance:none; - -webkit-background-clip:padding-box; - background-clip:padding-box; - -webkit-box-sizing:content-box; - box-sizing:content-box; -} - -.catalog-product-gallery .product-gallery { - padding:10px 0 0; - position:relative; - overflow:hidden; - height:300px; - width:100%; -} - -.catalog-product-gallery .product-gallery ul { - display:table; - width:200%; -} -.catalog-product-gallery .product-gallery li { - display:table-cell; - padding:0; - text-align:center; - overflow:hidden; - max-width:100%; -} -.catalog-product-gallery .product-gallery li img { - vertical-align:bottom; - -webkit-box-shadow:0 0 6px rgba(0, 0, 0, 0.25); - box-shadow:0 0 6px rgba(0, 0, 0, 0.25); -} -.catalog-product-gallery .product-gallery .prev, -.catalog-product-gallery .product-gallery .next { - display:none; - position:absolute; - top:10px; - bottom:25px; - z-index:10; - width:50%; -} -.catalog-product-gallery .product-gallery .prev { - left:0; -} -.catalog-product-gallery .product-gallery .next { - left:50%; -} - -.catalog-product-gallery .add-to-cart { - background:-webkit-gradient(linear, 0 0, 0 100%, from(#F39823), to(#F37221)); - background:-o-linear-gradient(top, #F39823 0%, #F37221 100%); - display:inline-block; - padding:4px 7px 5px; - font-size:12px; - color:#FFF; - border:1px solid #FFF; - border-radius:5px; - position:absolute; - top:50px; - right:5px; - text-shadow:0 1px 2px rgba(0, 0, 0, 0.25); - -webkit-background-clip:padding-box; -} - -.product-collateral { clear:both; } -.product-collateral .box-description { padding:10px 0 0; } -.product-collateral .box-additional h2 { margin:0 0 10px; } -.product-collateral .collateral-box { - background:-webkit-gradient(linear, 0 0, 0 100%, from(#F6F6F6), to(#C5C5C5)); - background:-o-linear-gradient(top, #F6F6F6 0%, #C5C5C5 100%); - padding:5px 10px; - border:1px solid #FFF; - border-radius:5px; - -webkit-box-shadow:0 0 3px 0 #9F9F9F; - box-shadow:0 0 3px 0 #9F9F9F; -} -.product-collateral h2, -.product-collateral h4 { font-size:14px; font-weight:bold; } -.product-specs { font-size:14px; text-align:justify; word-spacing:-0.2ex; } - - .up-sell-box { position:relative; } - .up-sell-box .up-sell-heading { font-size:13px; line-height:24px; height:24px; font-weight:bold; margin:0; padding:5px 0 10px; text-shadow:0 1px 0 #fff; } - .up-sell-box .prev, - .up-sell-box .next { - background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#dcdcdc)); - background:-o-linear-gradient(top, #fff 0%, #dcdcdc 100%); - border:1px solid #bebebe; - display:block; - position:absolute; - top:5px; - right:5px; - height:24px; - width:24px; - -webkit-border-radius:5px; - border-radius:5px; - z-index:1; - } - .up-sell-box .prev.disabled, - .up-sell-box .next.disabled { opacity:0.5; } - .up-sell-box .prev:after, - .up-sell-box .next:after { content:''; position:absolute; top:7px; z-index:2; font-size:0; line-height:0; width:0; } - .up-sell-box .prev { right:35px; } - .up-sell-box .prev:after { border-top:5px solid transparent; border-right:10px solid #000; border-bottom:5px solid transparent; right:8px; } - .up-sell-box .next:after { border-top:5px solid transparent; border-left:10px solid #000; border-bottom:5px solid transparent; left:8px; } - .carousel-wrap { overflow:hidden; position:relative; width:100%; } - .carousel-wrap .carousel-items { white-space:nowrap; -webkit-transition:all 150ms linear; -moz-transition:all 250ms linear; -o-transition:all 250ms linear; transition:all 250ms linear; } - @media all and (-webkit-transform-3d) { - .carousel-wrap .carousel-items { -webkit-transform:translateX(0); -webkit-perspective:1000; -webkit-backface-visibility:hidden; } - } - .carousel-wrap li { display:inline-block; vertical-align:top; padding:0 5px; white-space:normal; -webkit-box-sizing:border-box; box-sizing:border-box; } - .up-sell-box .product-image { background:#fff; display:inline-block; padding:3px; border:1px solid #ccc; -webkit-box-shadow:0 1px 2px #999; box-shadow:0 1px 2px #999; text-align:center; } - .up-sell-box .up-sell h5 { font-size:12px; line-height:17px; margin:5px 0; } - .up-sell-box .up-sell .price-box { font-size:12px; line-height:17px; } - .up-sell li .price-box { font-weight:bold; } - - .counter { padding:5px 0 0; text-align:center; } - .counter span { margin:0 2px; } - .counter span:before { content:'\2022'; color:#ddd; font-size:20px; display:inline-block; -webkit-text-stroke:1px #ddd; } - .counter span.active:before { color:#fff; } - -.collateral-box { margin:16px 0 0; } - .collateral-box .tags-list { font-size:12px; padding:10px; } - .collateral-box .tags-list a { font-weight:bold; color:#F4641E; } - .collateral-box .tags-list span { margin-right:5px; } - - -.compare-back-link { - position:absolute; - padding:0 0 0 10px; - z-index:10; -} -.compare-clear-all, -.compare-back-link a { - background:-webkit-gradient(linear, 0 0, 0 100%, from(#ddd), to(#eee)); - background:-o-linear-gradient(top, #ddd 0%, #eee 100%); - color:#000; - text-shadow:1px 1px 0 #fff; - display:inline-block; - border:1px solid #999; - border-left:0; - padding:5px 10px 5px 5px; - -webkit-border-radius:0 5px 5px 0; - position:relative; - z-index:4; - -webkit-transform:scale(0.95); -} -.compare-clear-all { - color:#fff; - background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #f85032), color-stop(50%, #f16f5c), color-stop(51%, #f6290c), color-stop(71%, #f02f17), color-stop(100%, #e73827)); - background:-o-linear-gradient(top, #f85032 0%, #f16f5c 50%, #f6290c 51%, #f02f17 71%, #e73827 100%); - border:1px solid #777; - border-radius:5px; - display:inline-block; - font-weight:normal; - padding:5px 10px; - margin-left:60px; - position:static; - text-shadow:0 1px 0 #000; -} -.compare-back-link:before { - content:''; - background:-webkit-gradient(linear, 0 0, 0 100%, from(#ddd), to(#eee)); - background:-o-linear-gradient(top, #ddd 0%, #eee 100%); - border:1px solid #999; - height:18px; - width:18px; - position:absolute; - top:5px; - left:1px; - -webkit-transform:rotate(45deg) scale(1.001); - z-index:3; -} -.compare-table { border-collapse:collapse; border-spacing:0; table-layout:fixed; -webkit-backface-visibility:hidden; } -.compare-table th, -.compare-table td { background:#fff; border:1px solid #ccc; padding:5px 15px; vertical-align:top; } -.compare-table td a { color:#fb6b36; } -.compare-table th { background:url(../images/fabric.jpg) repeat; border:none; -webkit-box-shadow:inset -3px 0 3px -3px #ccc; box-shadow:inset -3px 0 3px -3px #ccc; text-shadow:1px 1px 1px #fff; text-align:left; position:relative; padding:5px 10px 5px 10px; } -.compare-table tr:nth-child(even) td { background:#f6f6f6; } -.compare-table .move-left, -.compare-table .move-right { - background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#eee)); - background:-o-linear-gradient(top, #fff 0%, #eee 100%); - border:1px solid #c4c4c4; - border-radius:5px; - display:inline-block; - padding:5px 10px; - position:relative; - height:16px; - width:10px; - -webkit-box-shadow:0 0 2px rgba(0, 0, 0, 0.15); - box-shadow:0 0 2px rgba(0, 0, 0, 0.15); -} -.compare-table .move-left:after, -.compare-table .move-right:after { content:''; position:absolute; top:8px; z-index:2; font-size:0; line-height:0; width:0; } -.compare-table .move-left:after { border-top:5px solid transparent; border-right:10px solid #888; border-bottom:5px solid transparent; right:11px; } -.compare-table .move-right:after { border-top:5px solid transparent; border-left:10px solid #888; border-bottom:5px solid transparent; left:11px; } -.compare-table .move-right { - float:right; -} -.compare-table.hide-controls .moved-right .move-right, -.compare-table.hide-controls .moved-right .move-left, -.compare-table.hide-controls .moved-left .move-right, -.compare-table.hide-controls .moved-left .move-left { - visibility:hidden; -} -.compare-table .nobr { display:block; padding:1px 20px 1px 10px; white-space:nowrap; position:relative; text-shadow:1px 1px 0 #fff; } -.compare-table .product-shop-row td:last-child .move-right, -.compare-table .product-shop-row td:nth-child(2) .move-left { visibility:hidden; } -.compare-table .product-shop-row td:only-of-type .move-left, -.compare-table .product-shop-row td:only-of-type .move-right { display:none; } -.compare-table .move-right-animation, -.compare-table .move-left-animation { - -webkit-transition:-webkit-transform 300ms linear; - -webkit-transform:translate3d(0, 0, -5px) !important; -} -.compare-table .move-right-animation-scale, -.compare-table .move-left-animation-scale { - -webkit-transition:-webkit-transform 300ms linear; - -webkit-transform:translate3d(0, 0, 5px) !important; -} -.compare-table .collapsible .nobr { - background:-webkit-gradient(linear, 0 0, 0 100%, from(#f6f6f6), to(#bbb)); - background:-o-linear-gradient(top, #f6f6f6 0%, #bbb 100%); - border:1px solid #aaa; - border-radius:7px; - -webkit-box-shadow:inset 0 1px 3px rgba(0, 0, 0, 0.15), 0 1px 0 #fff; - box-shadow:inset 0 1px 3px rgba(0, 0, 0, 0.15), 0 1px 0 #fff; -} -.compare-table .collapsible .nobr:active, -.compare-table .collapsible.collapsed .nobr { - background:-webkit-gradient(linear, 0 0, 0 100%, from(#ddd), to(#ccc)); - background:-o-linear-gradient(top, #ddd 0%, #ccc 100%); -} -.compare-table .collapsible .nobr:before { - content:''; - background:url(../images/i_arrow_white.png) no-repeat 0 0; - background-size:10px 10px; - height:10px; - width:10px; - display:inline-block; - margin-left:-15px; - position:absolute; - top:5px; - left:100%; - -webkit-transition:all 300ms linear; - -webkit-transform:rotate(180deg); -} -.compare-table .collapsible.collapsed .nobr:before { -webkit-transform:rotate(0deg); } -.compare-table .collapsed .content { height:18px; max-width:125px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; } -.compare-table .product-name { font-size:13px; font-weight:bold; line-height:16px; margin:0 10px 5px 0; overflow:hidden; } -.compare-table .product-name a { color:#000; } -.compare-table .btn-cart { - background:-webkit-gradient(linear, 0 0, 0 100%, from(#F39823), to(#F37221)); - background:-o-linear-gradient(top, #F39823 0%, #F37221 100%); - border:1px solid #fff; - border-radius:5px; - color:#fff; - font-size:11px; - font-weight:bold; - margin-left:-2px; - margin-bottom:7px; - padding:5px 10px; - text-shadow:0 1px 2px rgba(0, 0, 0, 0.25); - -webkit-box-shadow:0 3px 3px 0 #9F9F9F; - box-shadow:0 3px 3px 0 #9F9F9F; - -webkit-background-clip:padding-box; - background-clip:padding-box; -} -.compare-table .btn-remove { -webkit-transform:translate3d(0, 0, 0); } -.compare-table .product-image { background:#fff; display:inline-block; margin:4px 0 10px; padding:3px; position:relative; border:1px solid #ccc; -webkit-box-shadow:0 1px 2px #ccc; box-shadow:0 1px 2px #ccc; text-align:center; } -.compare-table .product-image img {} -.compare-table .loader { background:url(../images/loader.gif) no-repeat center rgba(0, 0, 0, 0.05); background-size:20px 20px; float:right; height:20px; width:20px; } - -@-webkit-keyframes rotate { - from { - -webkit-transform: rotate(0deg); - } - to { - -webkit-transform: rotate(360deg); - } -} -.compare-table .btn-remove:before { - background:initial; -} -.compare-table .rotate { - -webkit-animation-name: rotate; - -webkit-animation-duration: 1s; - -webkit-animation-iteration-count: infinite; - -webkit-animation-timing-function: linear; -} - -/* Product review ------------------------------*/ -.review-product-list {} -.review-product-list .breadcrumbs .product { display:none; } -.review-product-list label { display:inline-block; font-weight:bold; padding:0 0 5px; } -.review-product-list label em { margin:0 5px 0 0; color: #F4641E; } -.review-product-list .rating-box { width:75px; height:15px; margin:3px 0; } -.review-product-list .rating-box .rating { height:15px; } -.review-product-list textarea { - border:1px solid; - border-color:#8e8e8e #e1e1e1 #e1e1e1 #8e8e8e; - border-radius:5px; - padding:5px; - font-size:18px; - height:100px; - width:100%; - -webkit-appearance:none; - -webkit-box-sizing:border-box; - box-sizing:border-box; - -webkit-box-shadow:inset 1px 1px 1px rgba(0, 0, 0, 0.1); - box-shadow:inset 1px 1px 1px rgba(0, 0, 0, 0.1); -} -.review-product-list .pager, -.review-product-list .form-add h2, -.review-product-list .form-add h3, -.review-product-list .form-add h4 em { display:none; } -.review-product-list .form-add h4 { - background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#e5e5e5)); - background:-o-linear-gradient(top, #fff 0%, #e5e5e5 100%); - border-bottom:1px solid #ccc; - border-radius:5px 5px 0 0; - margin:0 -10px 0; - padding:10px; - text-shadow:1px 1px #fff; -} -.review-product-list .form-add { - background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#eee)); - background:-o-linear-gradient(top, #fff 0%, #eee 100%); - border:1px solid #ccc; - margin:10px 0 5px; - padding:0 10px 15px; - border-radius:5px; - -webkit-box-shadow:0 1px 3px #ccc; - box-shadow:0 1px 3px #ccc; -} -.review-product-list .form-add .form-list li:nth-child(2) { margin:15px 0 0; } -.review-product-list .box-reviews h2 { margin-bottom:6px; } -.review-product-list .box-reviews dl { border-radius:5px; padding:10px 10px 0; -webkit-box-shadow:0 1px 3px #ccc; box-shadow:0 1px 3px #ccc; } -.review-product-list .box-reviews dt { padding:0 0 5px; } -.review-product-list .box-reviews dt a, -.review-product-list .box-reviews dt h3 { display:block; font-size:13px; font-weight:bold; } -.review-product-list .box-reviews dd { overflow:hidden; } -.review-product-list .box-reviews dd:last-child { border:none; padding:0 0 10px; } -.review-product-list .box-reviews dd .date { color:#666; font-size:11px; display:block; } -@media(orientation:landscape) { - .review-product-list .box-reviews dd table { - float:right; - margin:-3px 0 0 10px; - } -} -.review-product-list .ratings-table { border-spacing:0; } -.review-product-list .ratings-table th { padding-right:5px; } -.review-table-wrap { - padding:10px 0 0; -} -.review-product-list .box-reviews dd + dt:before, -.review-table-wrap:after { - content:''; - background:-webkit-gradient(linear, left top, right top, color-stop(0%,#fff), color-stop(25%,#ccc), color-stop(75%,#ccc), color-stop(100%,#fff)); - background:-o-linear-gradient(top, #fff 0%, #ccc 22%, #fff 100%); - display:block; - height:1px; - width:100%; - margin:10px 0; - } -#product-review-table { border-spacing:0; margin:0; width:100%; -webkit-tap-highlight-color:rgba(0,0,0,0); } -#product-review-table thead th { display:none; font-size:0; line-height:0; vertical-align:top; } -#product-review-table thead th span { display:none; } -#product-review-table thead th:before { content:''; display:inline-block; font-size:12px; line-height:1; vertical-align:middle; } -#product-review-table thead th:nth-child(2):before { content:'1'; } -#product-review-table thead th:nth-child(3):before { content:'2'; } -#product-review-table thead th:nth-child(4):before { content:'3'; } -#product-review-table thead th:nth-child(5):before { content:'4'; } -#product-review-table thead th:nth-child(6):before { content:'5'; } -#product-review-table tbody th { font-size:13px; text-align:left; width:30px; } -#product-review-table tbody td { text-align:center; } -#product-review-table tbody td input { background:url(../images/i_star.png) no-repeat center; border:none; background-size:15px 15px; display:inline-block; height:25px; width:25px; opacity:0.25; margin:0; -webkit-appearance:none; -webkit-transition:all 100ms ease-in-out; } -#product-review-table tbody td input:checked, -#product-review-table tbody td.checked input { opacity:1; } -.review-product-list .buttons-set button { - padding:5px 10px; - background:-webkit-gradient(linear, 0 0, 0 100%, from(#F39823), to(#F37221)); - background:-o-linear-gradient(top, #F39823 0%, #F37221 100%); - font-size:14px; - color:#FFF; - border:1px solid #FFF; - border-radius:5px; - -webkit-box-shadow:0 3px 3px 0 #9F9F9F; - box-shadow:0 3px 3px 0 #9F9F9F; - text-shadow:0 1px 2px rgba(0, 0, 0, 0.25); -} - -/* Product Review Page ------------------------------*/ -.my-account .product-review .product-img-box {} -.my-account .product-review .product-img-box > * { display:none; } -.my-account .product-review .product-img-box > a { display:block; float:left; margin-right:10px; } -.my-account .product-review .product-img-box img { -webkit-border-radius:1px; -webkit-box-shadow:0 0 3px #D1D1D1; box-shadow:0 0 3px #D1D1D1; } -.my-account .product-review .product-details h2 { font-size:16px; font-weight:bold; line-height:1.3; margin:0; } -.my-account .product-review .product-details h3 { font-size:13px; margin:2px 0; } -.my-account .product-review .product-details dl { clear:left; padding:10px 0 0; } -.my-account .product-review .product-details dt { font-weight:bold; } -.my-account .product-review .ratings-table, -.review-product-list .ratings-table { border-collapse:collapse; margin:0 0 5px; border-spacing:0; } -.my-account .product-review .ratings-table th, -.review-product-list .ratings-table { color:#222; line-height:1; text-align:left; padding:4px 5px 4px 0; } -.my-account .product-review .buttons-set, -.review-customer-index .buttons-set, -.customer-address-form .back-link { position:absolute; top:51px; left:20px; } -.my-account .product-review .buttons-set .back-link, -.review-customer-index .buttons-set .back-link, -.customer-address-form .buttons-set .back-link { float:none; padding:0; } -.my-account .product-review .buttons-set .back-link small, -.review-customer-index .buttons-set .back-link small, -.customer-address-form .buttons-set .back-link small { display:none; } - -.review-customer-index section[role="main"] { padding-bottom:0; } -.review-customer-index .my-account .page-title { margin-bottom:0; } -.review-customer-index .pager { - background:-webkit-gradient(linear, 0 0, 0 100%, from(#fefefe), to(#eee)); - background:-o-linear-gradient(top, #fefefe 0%, #eee 100%); - overflow:hidden; - margin:0 -10px; - padding:5px 10px; - text-align:right; -} -.review-customer-index .pager .amount { float:left; line-height:30px; } -.review-customer-index .pager select { width:60px; } -.review-customer-index .my-reviews-table-wrap { margin:0 -10px; } -.review-customer-index table { font-size:12px; line-height:16px; border-collapse:collapse; width:100%; } -.review-customer-index table th, -.review-customer-index table td { border:solid #eee; border-width:1px 0; padding:7px 5px; } -.review-customer-index table td { vertical-align:top; } -.review-customer-index table tr:first-child td { border-top:1px solid #ccc; } -.review-customer-index table tr:last-child td { border-bottom:1px solid #ccc; } -.review-customer-index table tr td:last-child { text-align:center; width:100px; } -.review-customer-index table h2 { font-size:14px; font-weight:bold; line-height:16px; } - - -/* Cart ------------------------------*/ -.cart-shared { margin:0 0 -10px; } -.cart-shared .page-title { background:#eee; border:solid #ccc; border-width:1px 0; margin:0 -10px 10px; padding:10px; text-align:left; -webkit-box-shadow:none; box-shadow:none; } -.cart-shared .page-title h1 { display:block; margin:0 auto; line-height:30px; text-shadow:0 1px 1px #fff; text-align:center; } -.cart-shared .page-title a { background:#ccc; border:1px solid #bbb; display:block; float:left; margin:-30px 0 0; font-size:11px; font-weight:bold; padding:5px 10px; -webkit-border-radius:4px; text-shadow:none; } -.cart-shared .label, -.cart-shared .weee .price { display:block; font-weight:bold; white-space:nowrap; } -.cart-shared .messages { margin:10px 0 7px; } -.cart-shared fieldset { border-bottom:1px solid #ccc; margin:0 -10px; padding:0 10px 5px; } -.remove-all-button { display:none; padding:10px 5px 15px; text-align:center; } -.remove-all-button a { - background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #ee5f5b), color-stop(100%, #c43c35)); - background:-o-linear-gradient(top, #ee5f5b 0%, #c43c35 100%); - border:1px solid #fff; - color:#fff; - font-weight:bold; - border-radius:5px; - display:inline-block; - padding:5px 0; - width:100%; - -webkit-box-shadow:0 3px 3px 0 #9f9f9f; - box-shadow:0 3px 3px 0 #9f9f9f; - text-shadow:0 -1px 2px rgba(0, 0, 0, 0.25); +.toolbar a { + color:#707070; } -.cart-shared .remove-all-button { border-bottom:1px solid #eae8ea; } -.my-wishlist .remove-all-button { float:left; padding:0 8px 0 0; } -.my-wishlist .remove-all-button a { font-size:11px; padding:5px; box-sizing:border-box; -webkit-box-sizing:border-box; } -.cart-table-wrap { +.c-list > li { + background-color:#fff !important; + color:#424242; position:relative; + border-bottom:1px solid #ebe9eb; } -.cart-table-wrap .item-remove { - display:none; - position:absolute; - top:9px; - right:10px; -} -.cart-table-wrap.grouped-items { - padding:0 0 20px; -} -.cart-table-wrap.grouped-items .item-remove { - display:block; -} -.cart-table-wrap.grouped-items .cart-table .product-image { - position:absolute; - top:10px; - left:0; -} -.cart-table-wrap.grouped-items .cart-table td { - border:0; - padding:7px 7px 0 0; -} -.cart-table-wrap.grouped-items .cart-table .product-name { - margin:0; -} -.cart-table-wrap.grouped-items .cart-table td:last-child, -.cart-table-wrap.grouped-items .cart-table .item-options, -.cart-table-wrap.grouped-items .cart-table .item-qty, -.cart-table-wrap.grouped-items .cart-table .cart-price, -.cart-table-wrap.grouped-items .cart-table .price-box, -.cart-table-wrap.grouped-items .cart-table .label { - display:none; -} - -.cart-shared .cart-table { margin:3px 0 0; width:100%; } -.cart-shared .cart-table, -.cart-shared .cart-table .product-name { font-size:12px; } -.cart-shared .cart-table th, -.cart-shared .cart-table td { border-bottom:1px solid #EAE8EA; font-size:11px; padding:7px 7px 14px 0; } -.cart-shared .cart-table td:last-child { padding-right:0; } -.cart-shared .cart-table th { background:#ddd; font-weight:normal; } -.cart-shared .cart-table th:first-child { -webkit-border-top-left-radius:5px; } -.cart-shared .cart-table th:last-child { -webkit-border-top-right-radius:5px; } -.cart-shared .cart-table tr:last-child td { border:0; } -.cart-shared .cart-table .odd { background:#eee; } -.cart-shared .cart-table td b + input { vertical-align:middle; } -.cart-shared .cart-table td input { border:1px solid #ccc; border-radius:3px; font-size:12px; font-weight:bold; margin:0 0 0 10px; padding:4px 5px; -webkit-appearance:none; -webkit-background-clip:padding-box; width:25px; -webkit-box-sizing:content-box; } -.cart-shared .cart-table tfoot td { padding:0; vertical-align:top; } -.cart-shared .cart-table tfoot button { - background:-webkit-gradient(linear, 0 0, 0 100%, from(#333), to(#111)); - background:-o-linear-gradient(top, #333 0%, #111 100%); - border:none; - color:#fff; - font-size:13px; - font-weight:bold; - padding:8px 10px; - text-shadow:0 1px 0 #000; - -webkit-border-radius:0 0 5px 5px; - width:100%; -} -.cart-shared .cart-table tbody td { vertical-align:top; } -.cart-shared .cart-table .product-name { margin:0 0 10px; } -.cart-shared .cart-table .product-name a { font-size:12px; color:#2f2f2f; } -.cart-shared .cart-table .product-image img { border:1px solid #FFF; -webkit-box-shadow:1px 1px 3px 0 #ccc; box-shadow:1px 1px 3px 0 #ccc; } -.cart-shared .cart-table .item-remove, .btn-remove, .item-remove { - background:#e10000; - border-radius:8px; +.c-list > li:last-child { display:block; border-bottom:none; } +.c-list > li > a { + background:url(../images/custom/arrow.png) no-repeat right; + -webkit-background-origin:content-box; + background-origin:content-box; + color:#2f2f2f; display:block; - float:right; - position:relative; - top:2px; - padding:3px; - height:10px; - width:10px; - -webkit-background-clip:padding-box; -} -.cart-shared .totals .btn-remove { - background:none; - padding:0; - height:auto; - width:auto; - top:3px; - margin-left:2px; + padding:10px; + -webkit-user-select:none; + user-select:none; + -webkit-touch-callout:none; + touch-callout:none; + -webkit-tap-highlight-color:rgba(0,0,0,0); } -.cart-shared .cart-table .item-remove:before, -.btn-remove:before, -.item-remove:before { - content:''; - background:#fff; - border-radius:9px; - -webkit-box-shadow:0 0 6px #888; - box-shadow:0 0 6px #888; +.c-list > li > a:after { + content:"."; display:block; - position:absolute; - top:-2px; - left:-2px; - height:20px; - width:20px; - z-index:-1; -} -.cart-shared .cart-table .item-remove img, -.btn-remove img, -.item-remove img { vertical-align:top; } - -.cart-shared .cart-table .product-name { font-size:11px; line-height:13px; font-weight:bold; } - -.cart-shared .totals table { border-spacing:0; font-size:12px; width:100%; } -.cart-shared .totals td { padding:2px; } -.cart-shared .totals .summary-total td[colspan="1"] { text-align:right; } -.cart-shared .totals .summary-collapse { cursor:pointer; text-decoration:underline; } -.cart-shared .discount, -.cart-shared .giftcard { font-size:12px; margin:0 -10px 20px; padding:10px 15px 15px; } -.cart-shared .giftcard a, -.cart-shared .discount a { display:inline-block; padding:5px 0; text-decoration:underline; } -.cart-shared .discount h2, -.cart-shared .giftcard h2 { font-size:12px; font-weight:bold; margin:0; text-shadow:0 1px 0 #fff; } -.cart-shared .giftcard label, -.cart-shared .discount label { display:none; } -.cart-shared .giftcard .input-box, -.cart-shared .discount .input-box { display:inline-block; } -.cart-shared .giftcard .input-box input, -.cart-shared .discount .input-box input { - border:1px solid #CAC8C8; - border-radius:2px; - font-size:11px; - line-height:1; - padding:5px 10px; - width:140px; - -webkit-appearance:none; - appearance:none; - -webkit-box-shadow:inset 0 1px 2px #ccc; - box-shadow:inset 0 1px 2px #ccc; - -webkit-background-clip:padding-box; - background-clip:padding-box; -} -.cart-shared .discount + .giftcard { margin-top:-30px; } -.cart-shared .discount .buttons-set { display:inline-block; vertical-align:top; margin:-1px 0 0; } -.cart-shared .giftcard button, -.cart-shared .discount .buttons-set button { - background:-webkit-gradient(linear, 0 0, 0 100%, from(#E2E2E2), to(#9D9D9D)); - background:-o-linear-gradient(top, #E2E2E2 0%, #9D9D9D 100%); - border:1px solid #FFF; - border-radius:5px; - color:#fff; - font-size:11px; - font-weight:bold; - margin:0; - padding:6px 10px; - vertical-align:top; - -webkit-box-shadow:0 3px 3px 0 #9F9F9F; - box-shadow:0 3px 3px 0 #9F9F9F; - -webkit-background-clip:padding-box; - background-clip:padding-box; - text-shadow:0 -1px 2px rgba(0, 0, 0, 0.25); -} -.cart-shared .checkout-types { float:right; width:65%; } -.cart-shared .checkout-types li { text-align:right; } -.cart-shared .checkout-types li:first-child {margin:0 0 10px; } -.cart-shared .checkout-types li button { - background:-webkit-gradient(linear, 0 0, 0 100%, from(#F39823), to(#F37221)); - background:-o-linear-gradient(top, #F39823 0%, #F37221 100%); clear:both; - display:block; - float:right; - margin:10px 0; - padding:5px 20px; - font-size:14px; - font-weight:bold; - color:#FFF; - border:1px solid #FFF; - border-radius:5px; - -webkit-box-shadow:0 3px 3px 0 #9F9F9F; - box-shadow:0 3px 3px 0 #9F9F9F; - -webkit-background-clip:padding-box; - background-clip:padding-box; - text-shadow:0 1px 2px rgba(0, 0, 0, 0.25); -} -#update-cart { - background:-webkit-gradient(linear, 0 0, 0 100%, from(#E2E2E2), to(#9D9D9D)); - background:-o-linear-gradient(top, #E2E2E2 0%, #9D9D9D 100%); - float:left; - margin:10px 0; - padding:5px 10px; - font-size:14px; - font-weight:bold; - color:#FFF; - border:1px solid #FFF; - border-radius:5px; - -webkit-box-shadow:0 3px 3px 0 #9F9F9F; - box-shadow:0 3px 3px 0 #9F9F9F; - -webkit-background-clip:padding-box; - background-clip:padding-box; - text-shadow:0 -1px 2px rgba(0, 0, 0, 0.25); -} -.cart-shared .checkout-types .paypal-or { color:#333; display:block; padding:0 0 5px; text-shadow:0 0 1px #fff; } -.cart-shared .checkout-types li:nth-child(3) > a { display:inline-block; margin:10px 0 0; padding:10px; } - -.cart-shared .cart-footer { - background:-webkit-gradient(linear, 0 0, 0 100%, from(#FDFDFD), to(#CFD0D1)); - background:-o-linear-gradient(top, #FDFDFD 0%, #CFD0D1 100%); - margin:0 -10px; - padding:10px; - -webkit-box-shadow: 0px 0px 10px 0px #222; - box-shadow: 0px 0px 10px 0px #222; -} -.cart-shared .cart-footer:after { content:"."; display:block; clear:both; visibility:hidden; line-height:0; height:0; } - -.checkout-agreements { - list-style:none; - margin:0; - padding:0; + visibility:hidden; + line-height:0; + height:0; } -.checkout-agreements .agreement-content { - background:#fff; - border-radius:2px; - -webkit-border-radius:5px; - margin:10px 0; - padding:10px; - max-height:250px; - overflow:auto; - -webkit-box-shadow:inset 0 0 3px #000; - box-shadow:inset 0 0 3px #000; -} +.c-list h1 { font-size:16px; line-height:20px; font-weight:bold; } +.c-list .cloned-wrap { position:absolute; padding:10px; opacity:0; } +.c-list .cloned-wrap .product-image img { -webkit-box-shadow:none; box-shadow:none; } +.c-list .product-image { float:left; margin-right:10px; -webkit-transform:translate3d(0,0,0); } +.c-list .product-shop { overflow:hidden; padding:0 30px 0 0; } +.c-list .product-shop h1 { font-weight:bold; text-align:left; margin:0 0 7px; } +.c-list .product-shop .price-box { margin:0 0 5px; } -.checkout-agreements .agree { - margin:10px 0; +.to-cart-animate { + -webkit-animation:bounce-rotate 200ms infinite } -.std { clear:both; margin:10px 0; } -.a-left { text-align:left; } -.a-center { text-align:center; } -.a-right { text-align:right; } +.drop-start { -webkit-transform:scale(1.2); opacity:0.9; } -.page-title { - background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#ccc)); - background:-o-linear-gradient(top, #fff 0%, #ccc 100%); - border:solid #999; - border-width:1px 0; - border-top-color:#ccc; - text-shadow:0 1px 0 #fff; - margin:0 -10px 10px; - padding:10px; - -webkit-box-shadow:0 3px 3px #eee; - box-shadow:0 3px 3px #eee; +@-webkit-keyframes bounce-rotate { + 0% { -webkit-transform:rotate(3deg) skew(1deg) scale(1.2); } + 25% { -webkit-transform:rotate(0) skew(0) scale(1.2); } + 50% { -webkit-transform:rotate(-3deg) skew(-1deg) scale(1.2); } + 75% { -webkit-transform:rotate(0) skew(0) scale(1.2); } + 100% { -webkit-transform:rotate(3deg) skew(1deg) scale(1.2); } } - -/* User account +/* Product Info Box -----------------------------*/ -.show-links { position:absolute; top:53px; left:10px; z-index:99; } -.my-account { margin:0; } -.my-account .messages { margin:-10px -10px 10px; padding:0; } -.my-account .messages .success-msg { margin-bottom:0; } -.my-account .messages .success-msg a { color:#fff; } -.my-account .breadcrumbs {} -.my-account .welcome-msg { margin:0 0 10px; } - -.customer-account-index .my-account .messages { margin:0; padding:0; } - -.my-account .box { margin-bottom:10px; } -.my-account .box-account { background:#fff; padding:0 0 10px; } -.my-account .info-box { padding-bottom:0; } -.my-account .info-box .box-head { margin-bottom:0; } -.my-account .info-box .box-title { padding:5px 10px; } -.my-account .info-box .box-content { border:1px solid #aaa; padding:10px; margin:0 0 10px; } -.my-account .info-box .col2-set:nth-child(3) .col-1, -.my-account .info-box .col2-set:nth-child(3) .col-2 { display:inline-block; vertical-align:top; width:49%; } -.my-account .box-content a { text-decoration:underline; } -.my-account .dashboard .reviews ol { list-style:none; margin:0; padding:0; } -.my-account .dashboard .reviews .number { float:left; margin:0 10px 0 0; } -.my-account .dashboard .reviews .details { display:table; } -.my-account .dashboard .reviews .details p { display:inline; vertical-align:middle; } -.my-account .dashboard .reviews .details .rating-box { display:inline-block; vertical-align:middle; margin:0; } - -.my-account .my-wishlist { margin:0 -10px; } - -.my-account .page-title { - background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#ccc)); - background:-o-linear-gradient(top, #fff 0%, #ccc 100%); - border:solid #999; - border-width:1px 0; - border-top-color:#ccc; - margin:0 -10px 10px; - padding:10px; - -webkit-box-shadow:0 3px 3px #eee; - box-shadow:0 3px 3px #eee; - text-shadow:0 1px 0 #fff; -} - -.my-account .box-head { - background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #ffb76b), color-stop(50%, #ffa73d), color-stop(51%, #ff7c00), color-stop(100%, #ff7f04)); - background:-o-linear-gradient(top, #ffb76b 0%, #ffa73d 50%, #ff7c00 51%, #ff7f04 100%); - border-bottom:1px solid #999; - padding:7px 10px 8px; - position:relative; -} -.my-account .box-head a { - background:-webkit-gradient(linear, 0 0, 0 100%, from(#eee), to(#fff)); - background:-o-linear-gradient(top, #eee 0%, #fff 100%); - font-weight:bold; - position:absolute; - padding:2px 10px; - top:3px; - right:5px; - -webkit-border-radius:4px; - border-radius:4px; - -webkit-box-shadow:inset 0 0 2px #000; - box-shadow:inset 0 0 2px #000; - text-shadow:0 1px 0 #fff; -} -.my-account .box-head h2 { color:#f6f6f6; font-weight:bold; text-shadow:0 0 3px #333; line-height:1; } -.my-account .box-recent .data-table { border-spacing:0; width:100%; } -.my-account .box-recent .data-table th, -.my-account .box-recent .data-table td { padding:2px 5px; } -.my-account .box-recent .data-table th { - background:-webkit-gradient(linear, 0 0, 0 100%, from(#eee), to(#ccc)); - background:-o-linear-gradient(top, #eee 0%, #ccc 100%); - border-bottom:1px solid #aaa; - text-shadow:0 1px 0 #fff; -} -.my-account .box-recent .data-table tr:nth-child(odd) { background:#f6f6f6; } -.my-account .box-recent .data-table tr td:nth-child(3) { text-align:center; } -.my-account .box-recent .data-table tr td:first-child a { - display:block; - background:-webkit-gradient(linear, 0 0, 0 100%, from(#eee), to(#fff)); - background:-o-linear-gradient(top, #eee 0%, #fff 100%); - font-weight:bold; - margin:4px 0; - padding:2px 10px; - -webkit-border-radius:4px; - border-radius:4px; - -webkit-box-shadow:inset 0 0 2px #000; - box-shadow:inset 0 0 2px #000; - text-shadow:0 1px 0 #fff; -} +.price-box .price-including-tax, +.price-box .price-excluding-tax { display:block; } +.price-box .price-including-tax .price { font-weight:bold; } + +.product-view {} +.product-view .product-name h1 { color:#424242; font-size:18px; font-weight:bold; text-align:left; line-height:20px; margin:0 0 9px; } +.product-view .product-image-wrap { padding:10px; position:relative; } +.product-view .product-image { position:relative;; } +.product-view .product-image li { text-align:center; } +.product-view .product-image li a { display:block; } + +.product-view .product-image-wrap img { position:relative; } +.product-view .product-image-wrap img.cloned { position:absolute; top:10px; left:50%; margin:0 0 0 -72px; -webkit-transition:all ease-in 400ms; -moz-transition:all ease-in 400ms; -o-transition:all ease-in 400ms; transition:all ease-in 400ms; } +.product-view .product-image-wrap img.animate { z-index:101; } + +.product-view .product-shop { padding:15px; } +.product-view .product-shop .buttons-set { margin:10px 0 0; } +.product-view .product-shop .product-main-info .price-box { color:#424242; font-size:18px; line-height:26px; margin:10px 0; } +.product-view .product-shop .product-main-info .price-box-bundle .price-box {} +.product-view .product-shop .product-main-info .item-options { margin:10px 0 0; } +.product-view .product-shop .product-main-info .item-options dt { color:#424242; font-style:15px; font-weight:bold; } +.product-view .product-shop .product-main-info + .options-container-small { margin:15px 0 0; } + +.product-view .product-shop .availability { color:#424242; font-size:13px; font-weight:bold; margin:0 0 9px; } +.product-view .product-shop .availability span { font-weight:normal; } +.product-view .product-shop .tier-prices { margin:10px 0; } + +.product-view .product-shop .add-to-box {} +.product-view .product-shop .add-to-box .qty, +.product-view .product-shop .add-to-box label { display:none; } +.product-view .price-box .price-label { vertical-align:baseline; } +.product-view .price-box .old-price { color:#ccc; } +.product-view .price-box .special-price .price-label { color:#222; } +.product-view .price-box .special-price .price { font-weight:bold; } + +.product-view .add-to-cart label[for="qty"], +.product-view .add-to-cart input.qty { display:none; } + +.product-view .product-img-box .product-image:before { background:url(../images/i_zoom.png) no-repeat 0 0; content:''; display:block; position:absolute; top:15px; right:25px; height:14px; width:14px; } +.product-view .product-img-box .controls .prev, +.product-view .product-img-box .controls .next { height:auto; top:40px; bottom:40px; width:auto; z-index:101; } +.product-view .product-img-box .controls .prev { left:0; right:80%; } +.product-view .product-img-box .controls .next { left:80%; right:0; } + +.product-view .short-description { margin:0; padding:15px; } + +.product-view .product-add-to { padding:0 15px 15px; } + +.send-friend .fieldset, +.send-friend .buttons-set { padding:15px; } +.send-friend .buttons-set .back-link { display:none; } +.send-friend .fieldset .btn-remove { float:right; position:relative; top:-4px; right:-4px; } +.send-friend .fieldset .legend { color:#424242; font-size:18px; margin:0 0 10px; } +.send-friend #max_recipient_message, +.send-friend #add_recipient_button { margin:10px 0 0; } -.my-account .box-title { - background:-webkit-gradient(linear, 0 0, 0 100%, from(#eee), to(#ccc)); - background:-o-linear-gradient(top, #eee 0%, #ccc 100%); - border:1px solid; - border-color:#bbb #aaa; - color:#333; - font-size:13px; - text-shadow:0 1px 0 #fff; - position:relative; -} -.my-account .box-title .separator { display:none; } -.my-account .box-title a { position:absolute; top:5px; right:5px; text-decoration:underline; } -.my-account .box-title h3 { display:inline-block; } +.product-collateral { clear:both; } +.product-collateral .box-collateral { padding:15px; } -.my-account .box-content h4 {} -.my-account .col2-set .col-1, -.my-account .col2-set .col-2 {} -.my-account .col2-set .col-1:last-child, -.my-account .col2-set .col-2:last-child {} -.my-account .sub-title, -.my-account .legend { color:#333; font-size:15px; font-weight:bold; margin:0 0 5px; text-shadow:0 1px 0 #ddd; } -.my-account .back-link { display:none; float:left; margin:0 15px 0 0; } -.my-account .input-box select { font-size:16px; } -.my-account .buttons-set, -.my-account .buttons-set2 { clear:both; text-align:center; } -.my-account .buttons-set:after { - content:"."; - display:block; - clear:both; - visibility:hidden; - line-height:0; - height:0; -} -.my-account label em, -.my-account .buttons-set .required, -.my-account label[for="street_1"] { display:none; } +.product-collateral .box-additional { background:none; padding:0; } +.product-collateral .box-additional h2 { display:none; } +.product-collateral .box-additional .data-table { color:#424242; border-collapse:collapse; width:100%; } +.product-collateral .box-additional .data-table th, +.product-collateral .box-additional .data-table td { padding:15px; text-align:left !important; vertical-align:top; } +.product-collateral .box-additional .data-table th { font-weight:bold; } -.my-account .storecredit .account-balance { margin:0 0 10px; } +.rating-box { background:url(../images/i_star_blank.png) repeat-x center left; height:18px; width:100px; } +.rating-box .rating { height:18px; background:url(../images/i_star.png) repeat-x center left; } -.sales-order-view .my-account { - margin:0; -} -.sales-order-view #my-orders-table { - border-collapse:collapse; - margin:10px 0 15px; - -webkit-box-shadow:0 3px 6px #ccc; - box-shadow:0 3px 6px #ccc; -} -.sales-order-view #my-orders-table th, -.sales-order-view #my-orders-table td { - background:#fff; - text-align:left; - vertical-align:top; -} -.sales-order-view #my-orders-table th { - color:#222; - width:33%; -} -.sales-order-view #my-orders-table .product-name { - font-weight:normal; -} -.sales-order-view #my-orders-table tbody.collapsed tr, -.sales-order-view #my-orders-table tbody.collapsed td dl { - display:none; -} -.sales-order-view #my-orders-table tbody tr:first-child { - display:table-row; -} -.sales-order-view #my-orders-table tbody { - border:1px solid #ccc; -} -.sales-order-view #my-orders-table tbody tr:first-child { - border:1px solid #ccc; - border-bottom-color:#bbb; -} -.sales-order-view #my-orders-table tbody tr:first-child th, -.sales-order-view #my-orders-table tbody tr:first-child th + td { - background:-webkit-gradient(linear, 0 0, 0 100%, from(#f6f6f6), to(#ddd)); - background:-o-linear-gradient(top, #f6f6f6 0%, #ddd 100%); - display:table-cell; - padding:5px; - font-weight:normal; - text-shadow:0 -1px 0 #fff; -} -.sales-order-view #my-orders-table tbody tr:first-child th + td { - padding-right:30px !important; -} -.sales-order-view #my-orders-table tbody tr:first-child th + td:before { - background:url(../images/i_arrow.png) no-repeat 0 0; - background-size:12px 12px; - content:''; - display:block; - height:12px; - width:12px; - margin:2px 0 0; - position:absolute; - right:17px; - -webkit-transform:scaleY(-1); -} -.sales-order-view #my-orders-table tbody.collapsed tr:first-child th + td:before { - -webkit-transform:scaleY(1); -} -.sales-order-view #my-orders-table tr:nth-child(even) th, -.sales-order-view #my-orders-table tr:nth-child(even) td { -} -.sales-order-view #my-orders-table td[colspan="2"] { - color:#808080; - font-size:12px; - padding:10px 0 0; - font-weight:bold; - text-transform:uppercase; - text-shadow:0 -1px 0 #fff; -} -.sales-order-view #my-orders-table td[colspan="2"] .option-label { - padding:5px 10px 0 5px; -} -.sales-order-view #my-orders-table tfoot tr:first-child th, -.sales-order-view #my-orders-table tfoot tr:first-child td { - padding-top:10px; -} -.sales-order-view #my-orders-table tfoot tr:last-child th, -.sales-order-view #my-orders-table tfoot tr:last-child td { - padding-bottom:10px; -} -.sales-order-view #my-orders-table tfoot th, -.sales-order-view #my-orders-table tfoot td { - border:0; -} +.product-view .rating-box { margin:0 0 10px; } +.product-view .rating-links { color:#666; text-align:right; } +.product-view .rating-links a { color:#1394ca; display:inline-block; text-decoration:underline; } +.product-view .rating-links a:first-child { float:left; margin-right:10px; } +.product-view .rating-links .separator { display:none; } -.sales-order-view .box .box-content { padding:10px; } - -.sales-order-history .data-table { border-spacing:0; margin:-10px 0 0 0; width:100%; } -.sales-order-history .data-table th, -.sales-order-history .data-table td { padding:2px 5px; } -.sales-order-history .data-table th { - background:-webkit-gradient(linear, 0 0, 0 100%, from(#eee), to(#ccc)); - background:-o-linear-gradient(top, #eee 0%, #ccc 100%); - border-bottom:1px solid #aaa; - text-shadow:0 1px 0 #fff; -} -.sales-order-history .data-table th:nth-child(4) { width:20%; text-align:left; } -.sales-order-history .data-table tr:nth-child(odd) { background:#f6f6f6; } -.sales-order-history .amount { display:none; } -.sales-order-history .pager { - background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #FFB76B), color-stop(50%, #FFA73D), color-stop(51%, #FF7C00), color-stop(100%, #FF7F04)); - background:-o-linear-gradient(top, #FFB76B 0%, #FFA73D 50%, #FF7C00 51%, #FF7F04 100%); - border-bottom: 1px solid #999; - margin: 0 0 10px; - padding: 7px 10px 8px; - color: #F6F6F6; - font-weight: bold; - text-shadow: 0 0 3px #333; - line-height: 1; - text-align:right; - overflow:hidden; -} -.sales-order-history .limiter { - float:left; -} -.sales-order-history .limiter select, -.sales-order-history .pages select { - padding:3px 30px 3px 7px; -} -.sales-order-history .back-link a { - margin-left: 10px; - padding: 5px 10px; - border: 1px solid #CECECE; - border-radius: 5px; - background: -webkit-gradient(linear, 0 0, 0 100%, from(#fefefe), to(#eee)); - background:-o-linear-gradient(top, #fefefe 0%, #eee 100%); - font-size: 16px; - text-transform: small-caps; -} -.customer-account-edit .buttons-set a { - display:block; - padding: 5px 10px; - border: 1px solid #CECECE; - border-radius: 5px; - background: -webkit-gradient(linear, 0 0, 0 100%, from(#fefefe), to(#eee)); - background:-o-linear-gradient(top, #fefefe 0%, #eee 100%); - font-size: 16px; - text-transform: small-caps; -} - -.my-account form label, -.my-account form .field label, -.my-account form .wide label { color:#5e5e5e; display:block; font-size:12px; line-height:16px; margin:8px 0 0; padding:0 0 3px; font-weight:bold; } -.my-account form .buttons-set { padding:10px 0; } -.my-account .form-list label { display:block; margin:5px 0 2px 0; } -.my-account .form-list select { border:1px solid; border-color:#8e8e8e #e1e1e1 #e1e1e1 #8e8e8e; border-radius:5px; font-size:18px; padding:5px 30px 5px 5px; width:100%; margin:0; } -.my-account .form-list .control .checkbox + label, -.my-account .form-list .control .input-box + label { display:inline; margin-left:2px; vertical-align:middle; } -.my-account button { - display:inline-block; - background:-webkit-gradient(linear, 0 0, 0 100%, from(#F39823), to(#F37221)); - background:-o-linear-gradient(top, #F39823 0%, #F37221 100%); - color:#FFF; - font-size:14px; - border:1px solid #FFF; - border-radius:5px; - margin:0; - padding:5px 10px; - vertical-align:top; - -webkit-box-shadow:0 3px 3px 0 #9F9F9F; - box-shadow:0 3px 3px 0 #9F9F9F; - text-shadow:0 1px 2px rgba(0, 0, 0, 0.25); -} -.newsletter-manage-index .my-account .back-link a { - display:block; - padding: 5px 10px; - border: 1px solid #CECECE; - border-radius: 5px; - background: -webkit-gradient(linear, 0 0, 0 100%, from(#fefefe), to(#eee)); - background:-o-linear-gradient(top, #fefefe 0%, #eee 100%); - font-size: 16px; - text-transform: small-caps; -} -.customer-address-index .page-title h1 { float:left; padding:5px 0 0 0; } -.customer-address-index .page-title button { - float:right; - background: -webkit-gradient(linear, 0 0, 0 100%, from(#eee), to(#fff)); - background:-o-linear-gradient(top, #eee 0%, #fff 100%); - font-weight: bold; - padding: 6px 10px; - border:0; - -webkit-border-radius: 4px; - border-radius: 4px; - -webkit-box-shadow: inset 0 0 2px #000; - box-shadow: inset 0 0 2px #000; - text-shadow: 0 1px 0 white; -} -.customer-address-index .page-title:after { - content: "."; - display: block; - clear: both; - visibility: hidden; - line-height: 0; - height: 0; -} -.customer-address-index .addresses-list {} -.customer-address-index .addresses-list ol { list-style:none; margin:0; padding:0; } -.customer-address-index .addresses-list ol li {} -.customer-address-index .back-link a { - display:block; - margin:0 0 0 10px; - padding: 5px 10px; - border: 1px solid #CECECE; - border-radius: 5px; - background: -webkit-gradient(linear, 0 0, 0 100%, from(#fefefe), to(#eee)); - background:-o-linear-gradient(top, #fefefe 0%, #eee 100%); - font-size: 16px; - text-transform: small-caps; -} +.product-view .box-description .std { margin:0; } -.block-account { margin:0; padding:0; position:absolute; width:100%; left:-100%; z-index:100; -webkit-box-shadow:0 3px 3px rgba(0, 0, 0, .25) } -.block-account .block-title { display:none; } -.block-account li { background:#eee; border-bottom:1px solid #ccc; padding:10px 10px 10px 100px; } -.block-account .back { background:#333; color:#fff; padding:10px; position:absolute; top:0; bottom:0; left:0; width:60px; } +.product-view .product-shop .add-to-box button, +.product-view .product-options-bottom .add-to-cart button { background:url(../images/bg_gradient.png) repeat-x 0 0 #1394ca; color:#fff; font-size:24px; display:block; border:0; height:45px; line-height:45px; margin:15px 0 0; padding:0; -webkit-appearance:none; appearance:none; text-shadow:0 -1px 0 rgba(0, 0, 0, .45); width:100%; } +.product-view .product-options-bottom .add-to-cart + .add-to-links { margin:10px 0 0; } +.product-view .product-options-bottom .add-to-cart + .add-to-links li:first-child a { width:100%; } +.paypal-logo { text-align:center; } +.paypal-or { display:block; padding:10px 0; text-align:center; } -/* Order ------------------------------*/ -.sales-order-invoice .my-account, -.sales-order-shipment .my-account, -.sales-order-creditmemo -.sales-order-view .my-account { padding:0 10px; } -.sales-order-invoice .page-title, -.sales-order-shipment .page-title, -.sales-order-view .page-title { margin:0 -10px; } -.sales-order-invoice .page-title span, -.sales-order-shipmente .page-title span, -.sales-order-view .page-title span { display:none; } -.sales-order-invoice .page-title h1, -.sales-order-shipment .page-title h1, -.sales-order-view .page-title h1 { float:left; padding:3px 0 0; } -.sales-order-invoice .page-title a, -.sales-order-shipment .page-title a, -.sales-order-view .page-title a { - float:right; - background:-webkit-gradient(linear, 0 0, 0 100%, from(#eee), to(#fff)); - background:-o-linear-gradient(top, #eee 0%, #fff 100%); - font-weight: bold; - margin:0 0 0 10px; - padding: 6px 10px; - border:0; - -webkit-border-radius: 4px; - -webkit-box-shadow: inset 0 0 2px #000; - box-shadow: inset 0 0 2px #000; - text-shadow: 0 1px 0 white; -} -.sales-order-view .page-title .link-print { - display:none; -} -.sales-order-invoice .page-title:after, -.sales-order-shipment .page-title:after, -.sales-order-view .page-title:after { - content: "."; - display: block; - clear: both; - visibility: hidden; - line-height: 0; - height: 0; -} -.sales-order-invoice .box .box-title, -.sales-order-shipment .box .box-title, -.sales-order-view .box .box-title { margin:0 -10px; padding:3px 10px; } -.sales-order-invoice .box .box-content, -.sales-order-shipment .box .box-content, -.sales-order-view .box .box-content { padding:10px 0; } -.sales-order-invoice .back-link a, -.sales-order-shipment .back-link a, -.sales-order-view .back-link a { - display:block; - margin:0 0 10px; - padding: 5px 10px; - border: 1px solid #CECECE; - border-radius: 5px; - background: -webkit-gradient(linear, 0 0, 0 100%, from(#fefefe), to(#eee)); - background:-o-linear-gradient(top, #fefefe 0%, #eee 100%); - font-size: 16px; - text-transform: small-caps; -} -.sales-order-invoice .order-details .data-table, -.sales-order-shipment .order-details .data-table, -.sales-order-view .order-details .data-table { width:100%; font-size:12px; } -.sales-order-invoice .order-details .data-table th, -.sales-order-shipment .order-details .data-table th, -.sales-order-view .order-details .data-table th { background:#909090; color:#FFF; } -.sales-order-invoice .order-details .data-table th:first-child, -.sales-order-shipment .order-details .data-table th:first-child, -.sales-order-view .order-details .data-table th:first-child { text-align:left; } -.sales-order-invoice .order-details .data-table th:nth-child(4), -.sales-order-shipment .order-details .data-table th:nth-child(4), -.sales-order-view .order-details .data-table th:nth-child(4) { width:20% } -.sales-order-invoice .order-details .data-table .even tr td, -.sales-order-shipment .order-details .data-table .even tr td, -.sales-order-view .order-details .data-table .even tr td { background:#EEE; } -.sales-order-invoice .order-details .data-table th, -.sales-order-invoice .order-details .data-table td, -.sales-order-shipment .order-details .data-table th, -.sales-order-shipment .order-details .data-table td, -.sales-order-view .order-details .data-table th, -.sales-order-view .order-details .data-table td { padding:2px 5px; } -.sales-order-invoice .order-info dt, -.sales-order-shipment .order-info dt, -.sales-order-view .order-info dt { display:none; } -.sales-order-invoice .order-info dd, -.sales-order-shipment .order-info dd, -.sales-order-view .order-info dd { margin:0; } -.sales-order-invoice .order-info dd ul, -.sales-order-shipment .order-info dd ul, -.sales-order-view .order-info dd ul { float:left; } -.sales-order-invoice .order-info dd ul li, -.sales-order-shipment .order-info dd ul li, -.sales-order-view .order-info dd ul li { - display:inline-block; - margin:0 10px 10px 0; - font-size: 16px; -} -.sales-order-invoice .order-info dd ul li a, -.sales-order-shipment .order-info dd ul li a, -.sales-order-view .order-info dd ul li a { - display:block; - padding: 5px 10px; - border: 1px solid #cecece; - border-radius: 5px; - background: -webkit-gradient(linear, 0 0, 0 100%, from(#fefefe), to(#eee)); - background:-o-linear-gradient(top, #fefefe 0%, #eee 100%); - font-size: 16px; - text-transform: small-caps; -} -.sales-order-invoice .order-date, -.sales-order-shipment .order-date, -.sales-order-view .order-date { display:inline-block; padding:6px 0 15px 0; font-size: 16px; } +/* Carousel */ +.carousel-wrap {} +.carousel-wrap li { display:inline-block; vertical-align:top; white-space:normal; } +.carousel-wrap .box-title { max-width:80%; } +.carousel-wrap .ratings { display:none; } +.carousel-wrap .carousel-items { white-space:nowrap; -webkit-transition:all 150ms linear; -moz-transition:all 250ms linear; -o-transition:all 250ms linear; transition:all 250ms linear; } +.carousel-wrap .carousel-items-wrap { overflow:hidden; } -/* Wishlist ------------------------------*/ -.my-wishlist h1 { - background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#ccc)); - background:-o-linear-gradient(top, #fff 0%, #ccc 100%); - border:solid #999; - border-width:1px 0; - border-top-color:#ccc; - margin:0 0 10px; - padding:10px; -} -.my-wishlist h2 { font-weight:bold; line-height:16px; } -.my-wishlist .buttons-set { - background:-webkit-gradient(linear, 0 0, 0 100%, from(#fdfdfd), to(#cfd0d1)); - background:-o-linear-gradient(top, #fdfdfd 0%, #cfd0d1 100%); - margin:10px 0 -10px; - padding: 10px; - -webkit-box-shadow:0px 0px 10px 0px rgba(0, 0, 0, .25); - box-shadow:0px 0px 10px 0px rgba(0, 0, 0, .25); -} -.my-wishlist .buttons-set:after { content:"."; display:block; clear:both; visibility:hidden; line-height:0; height:0; } -.my-wishlist .buttons-set li { float:left; } -.my-wishlist .buttons-set li:first-child { padding:0 8px 0 0; } -.my-wishlist .buttons-set li:last-child { float:right; } -.my-wishlist .buttons-set li .add-all-to-cart, -.my-wishlist .buttons-set li .btn-share { - text-align:right; - padding:5px 10px; - background:-webkit-gradient(linear, 0 0, 0 100%, from(#F39823), to(#F37221)); - background:-o-linear-gradient(top, #f39823 0%, #f37221 100%); - font-size:11px; - font-weight:bold; - color:#fff; - border:1px solid #fff; - border-radius:5px; - -webkit-box-shadow:0 3px 3px 0 #9f9f9f; - box-shadow:0 3px 3px 0 #9f9f9f; - text-shadow:0 1px 2px rgba(0, 0, 0, 0.25); -} -.my-wishlist .buttons-set li .btn-share { - margin:0; - line-height:18px; - -webkit-appearance:none; - appearance:none; -} -.my-wishlist .buttons-set li .update-wishlist { - background:-webkit-gradient(linear, 0 0, 0 100%, from(#e2e2e2), to(#9d9d9d)); - background:-o-linear-gradient(top, #e2e2e2 0%, #9d9d9d 100%); - color:#fff; - border:1px solid #fff; - border-radius:5px; - margin:0; - padding:5px 10px; - float:left; - font-size:11px; - font-weight:bold; - line-height:18px; - -webkit-box-shadow:0 3px 3px 0 #9F9F9F; - box-shadow:0 3px 3px 0 #9F9F9F; - text-shadow:0 -1px 2px rgba(0, 0, 0, 0.25); - -webkit-appearance:none; - appearance:none; -} -.my-wishlist .buttons-set li span { display:inline-block; } - -#wishlist-list { margin:-10px 0 0; min-height:200px; } -#wishlist-list li > a { float:left; padding:10px; } -#wishlist-list li > a img { border:1px solid #FFF; -webkit-box-shadow:1px 1px 3px 0 #ccc; box-shadow:1px 1px 3px 0 #ccc; } -#wishlist-list li { border-bottom:1px solid #CCC; position:relative; min-height:80px; } -#wishlist-list li:last-child { border-bottom:0; } -#wishlist-list .wishlist-item { overflow:hidden; } -#wishlist-list .wishlist-item { padding:10px; position:relative; } -#wishlist-list .wishlist-item .price-box { margin:0 0 5px; } -#wishlist-list li.no-qty .qty-holder { display:none; } -#wishlist-list .qty { width:25px; margin:-2px 0 0; padding:2px 3px; border-radius:5px; font-size:12px; } -#wishlist-list button { margin:0; padding:0; border:0; } -#wishlist-list button.btn-cart { - background:-webkit-gradient(linear, 0 0, 0 100%, from(#f39823), to(#f37221)); - background:-o-linear-gradient(top, #f39823 0%, #f37221 100%); - text-align:right; +@media all and (-webkit-transform-3d) { +.carousel-wrap .carousel-items { -webkit-transform:translateX(0); -webkit-perspective:1000; -webkit-backface-visibility:hidden; } +} + +.box-up-sell { position:relative; padding:15px; } +.box-up-sell h2 { color:#424242; font-size:18px; font-weight:bold; line-height:25px; margin:0 0 10px; } +.box-up-sell .item { color:#424242; font-size:15px; line-height:18px; } +.box-up-sell .item a { color:#424242; } +.box-up-sell .item h3 { max-height:36px; margin:0 0 5px; overflow:hidden; text-overflow:ellipsis; width:100%; } +.box-up-sell .item img { margin:0 0 5px; } +.box-up-sell .price-box .price { font-weight:bold; } +.box-up-sell .product-image {} +.box-up-sell .controls { background:url(../images/bg_divider_dark.png) no-repeat center; position:absolute; top:15px; right:15px; height:24px; width:49px; } + +.controls .prev, +.controls .next { display:block; position:absolute; top:0; right:0; height:24px; width:24px; } +.controls .prev { background:url(../images/arrow_left.png) no-repeat center; } +.controls .next { background:url(../images/arrow_right.png) no-repeat center; } +.controls .prev.disabled, +.controls .next.disabled { opacity:.25; } +.controls .prev { right:25px; } + +.counter { padding:5px 0 0; text-align:center; } +.counter span { margin:0 2px; } +.counter span:before { content:'\2022'; color:#ddd; font-size:20px; display:inline-block; -webkit-text-stroke:1px #ddd; } +.counter span.active:before { color:#fff; } + +.product-shop .grouped-items-table { border:none; border-spacing:0; font-size:15px; margin:0; -webkit-border-radius:0; width:100%; } +.product-shop .grouped-items-table th, +.product-shop .grouped-items-table td { padding:5px 0; } +.product-shop .grouped-items-table th { display:none; } +.product-shop .grouped-items-table td { background:none; border:none; border-bottom:1px solid #e4e4e4; text-align:left; vertical-align:middle; } +.product-shop .grouped-items-table tr:last-child td { border-bottom:none; } +.product-shop .grouped-items-table input.qty { text-align:center; width:40px; } + +/* ------------ */ + +.product-view .box-tags { padding:15px; } +.product-view .box-tags a { color:#1394ca; display:inline-block; font-weight:bold; } +.product-view .box-tags li { display:inline; margin-right:10px; } +.product-view .box-tags h2 { color:#424242; font-size:18px; font-weight:bold; margin:0 0 10px; } +.product-view .box-tags h3, +.product-view .form-add-tags { display:none; } + +/* ------------ */ + +.add-to-links { display:table; font-size:12px; margin:0; position:relative; width:100%; text-align:center; } +.add-to-links > li { display:table-cell; text-align:center; line-height:1; vertical-align:top; } +.add-to-links > li > a, +.add-to-links > li .split-button strong { background:url(../images/bg_gradient.png) repeat-x 0 0 #1394ca; background-size:auto 30px; color:#fff; display:inline-block; font-weight:normal; height:30px; line-height:30px; text-shadow:0 -1px 0 rgba(0, 0, 0, .45); width:99.5%; } +.add-to-links > li .split-button strong + a { display:block; height:30px; margin:0 0 -30px; position:relative; top:-30px; overflow:hidden; text-indent:-200%; } +.add-to-links > li .split-button.active .list-container { display:block; } +.add-to-links > li .split-button .list-container { border:1px solid #e4e4e4; display:none; position:absolute; top:0; left:0; text-align:left; } +.add-to-links > li .split-button .list-container li { background:#fff; border-bottom:1px solid #e4e4e4; height:30px; line-height:30px; padding:0 10px; box-shadow:0 0 3px rgba(0, 0, 0, .15); } +.add-to-links > li .split-button .list-container li:last-child { border:none; } +.add-to-links > li .split-button .list-container .new { background:#e4e4e4; color:#424242; text-shadow:0 1px 0 #fff; } +.add-to-links > li .split-button .list-container .new:before { content:'+'; display:inline-block; margin-right:5px; } +.add-to-links .separator { display:none; } + +.product-view .options-container-big .product-options { padding:15px; } +.product-view .options-container-big .product-options-bottom { padding:0 15px 15px; } +.product-view .options-container-small .product-options {} +.product-view .options-container-small .product-options-bottom .price-box, +.product-view .options-container-small .product-options-bottom .price-box { display:none; } + +.product-view .product-options dt { margin:0 0 10px; } +.product-view .product-options dt label { color:#424242; font-size:15px; font-weight:bold; } +.product-view .product-options dt label em { color:#f9721f; margin-right:5px; } +.product-view .product-options dd { font-size:14px; border-bottom:1px solid #ccc; padding:0 0 15px; } +.product-view .product-options dd + dt { padding:15px 0 0; } +.product-view .product-options dd:last-child { border:none; padding:0; } +.product-view .product-options dd:last-child .input-box { margin:0; } +.product-view .product-options select { width:100%; } +.product-view .product-options input.qty { width:20%; } +.product-view .product-options input.qty:disabled { background:#f5f5f5; } +.product-view .product-options .input-box { margin:0 0 10px; } +.product-view .product-options .qty-holder { display:block; margin:5px 0 0; } +.product-view .product-options .qty-holder label, +.product-view .product-options .qty-holder label + input { vertical-align:middle; } +.product-view .product-options .options-list {} +.product-view .product-options .options-list li { margin:0 0 8px; } +.product-view .product-options .options-list li:last-child { margin:0; } +.product-view .product-options .options-list input, +.product-view .product-options .options-list input + label, +.product-view .product-options .options-list input + .label { vertical-align:middle; } +.product-view .product-options .options-list input { float:left; margin-right:10px; } +.product-view .product-options .options-list input + label, +.product-view .product-options .options-list input + .label { display:table; } +.product-view .product-options .options-list a { text-decoration:underline; } + +.giftcard-send-form { padding:15px 0 0; } +.giftcard-send-form em { color:#f9721f; } +.giftcard-send-form label { color:#424242; display:block; font-size:15px; font-weight:bold; } +.giftcard-send-form .gift-card-amount-field { padding:0; } + +.giftcard-amount-form .notice { padding:5px 0 10px; text-align:right; } +.giftcard-amount-form .notice span { float:left; font-size:12px; display:block; } +.giftcard-amount-form .notice span:last-child { float:none; } + +.product-view .product-options-bottom .required { font-size:10px; line-height:12px; margin:10px 0 0; text-align:right; } +.product-view .product-options-bottom .price-box { color:#424242; font-size:18px; line-height:24px; } + +.catalog-product-gallery .buttons-set { padding:10px; } +.catalog-product-gallery .buttons-set a { text-align:center; } +.catalog-product-gallery .product-gallery { background-color:#fff !important; padding:10px 0 0; position:relative; overflow:hidden; height:300px; width:100%; } +.catalog-product-gallery .product-gallery .prev, +.catalog-product-gallery .product-gallery .next { background-color:#fff; background-position:center; border:1px solid #e4e4e4; border-radius:100%; box-shadow:0 0 3px rgba(0, 0, 0, .15); top:50%; z-index:101; } +.catalog-product-gallery .product-gallery .prev { right:80%; } +.catalog-product-gallery .product-gallery .next { left:80%; } +.catalog-product-gallery .product-gallery ul { display:table; width:200%; } +.catalog-product-gallery .product-gallery li { display:table-cell; padding:0; text-align:center; overflow:hidden; max-width:100%; } +.catalog-product-gallery .product-gallery li img { vertical-align:bottom; } + +.catalog-product-gallery .add-to-cart {} + +/* Catalog Search */ + +.catalogsearch-result-index .note-msg { padding:15px; } + +/* Product review +-----------------------------*/ + +.product-review { padding:15px; } +.product-review .product-img-box { text-align:center; } + +.box-reviews .box-title, +.box-reviews .box-content .product-name { display:none; } +.box-reviews .box-content { padding:15px; } +.box-reviews .form-list { margin:0 0 10px; } +.box-reviews p.required { font-size:10px; line-height:12px; margin:10px 0 0; text-align:right; } +.box-reviews .form-add h4 { display:none; } + +#product-reviews-list { display:none; } +#customer-reviews:target #product-reviews-list { display:block; } + +.ratings-table { margin:0 0 10px; } +.ratings-table th, +.ratings-table td.label { color:#424242; font-weight:bold; text-align:left; } +.ratings-table th, +.ratings-table td { padding:3px 15px 5px 0; } +.ratings-table td { vertical-align:middle; } + +#product-review-table { margin:10px 0; } +#product-review-table thead th { display:none; } +#product-review-table tbody th { color:#424242; text-align:left; padding:0 5px 5px 0; } +#product-review-table tbody td input { background:url(../images/i_star.png) no-repeat center; border:none; display:inline-block; height:18px; width:20px; opacity:0.25; margin:0; -webkit-appearance:none; -webkit-transition:all 100ms ease-in-out; } +#product-review-table tbody td input:checked, +#product-review-table tbody td.checked input { opacity:1; } + +.review-product-list .breadcrumbs .product { display:none; } +.review-product-list label { display:inline-block; font-weight:bold; padding:0 0 5px; } +.review-product-list label em { margin:0 5px 0 0; color: #F4641E; } +.review-product-list .pager { display:none; } + +.product-view .box-reviews { padding:15px; } +.product-view .box-reviews h2 { color:#424242; font-size:18px; margin:0 0 15px; } +.product-view .box-reviews h3 { margin:10px 0; } +.product-view .box-reviews dl { margin:0 0 15px; } +.product-view .box-reviews dt { color:#666; font-size:12px; margin:0 0 10px; } +.product-view .box-reviews dt h3 { color:#424242; display:inline; font-size:15px; } +.product-view .box-reviews dd { margin:0 0 20px; } +.product-view .box-reviews dd:last-child { margin:0; } +.product-view .box-reviews dd .date { color:#666; font-size:11px; display:block; } +.product-view .box-reviews dd + dt { border-top:1px solid #e4e4e4; padding:20px 0 0; } + +.review-product-page .product-review, +.review-product-page .product-essential { display:none; } + +/* User account +-----------------------------*/ +.my-account {} +.my-account .breadcrumbs {} + +.account-links a, +.account-links strong { padding-left:30px !important; } + +.my-account .page-title {} +.my-account .page-title.title-buttons { height:auto; } +.my-account .page-title.title-buttons h1 { display:inline; white-space:normal; } +.my-account .page-title.title-buttons button { + background:none; + border:none; + color:#424242; + display:inline; + float:right; + font-size:15px; + font-weight:normal; margin:0; - padding:5px 10px; - font-size:11px; - font-weight:bold; - color:#FFF; - border:1px solid #FFF; - border-radius:5px; - -webkit-box-shadow:0 3px 3px 0 #9F9F9F; - box-shadow:0 3px 3px 0 #9F9F9F; - text-shadow:0 1px 2px rgba(0, 0, 0, 0.25); -} -#wishlist-list .wishlist-item button.btn-cart { - position:absolute; - bottom:10px; - right:10px; + padding:5px; + text-decoration:underline; } -#wishlist-list .edit-wishlist-item { - background:-webkit-gradient(linear, 0 0, 0 100%, from(#ff9822), to(#f30)); - background:-o-linear-gradient(top, #ff9822 0%, #f30 100%); - border-radius:5px; +.my-account .box-head, +.my-account .sub-title, +.my-account .table-caption { color:#424242; font-size:18px; line-height:22px; margin:0 0 15px; } +.my-account .welcome-msg { margin:-10px 0 0; padding:0 15px 15px; } +.my-account .welcome-msg p { display:none; } +.my-account .welcome-msg .sub-title { font-weight:normal; margin:0; } +.my-account .messages + .welcome-msg { margin:15px 0 0; } + +.cart-collaterals, +.my-account > p, +.my-account > .col2-set, +.my-account > .order-info, +.my-account .fieldset, +.my-account .my-rewards, +.my-account .box-account, +.my-account .storecredit, +.my-account .order-history, +.my-account .order-details, +.my-account .review-history, +.my-account .giftregistry > p, +.my-account .recent-orders > p, +.my-account .review-history > p, +.my-account .recurring-profiles, +.my-account .billing-agreements, +.my-account .dashboard .reviews, +.my-account .order-page .order-info, +.my-account .order-page .order-date, +.my-account .product-review .product-details, +.my-account .dashboard .recent-orders, +.my-account .review-history .list-item, +.my-account .product-review .product-img-box, +.my-account .downloadable-products-history > p, +.my-account .downloadable-products-history .list-item { padding:15px; } + +.my-account .box, +.my-account .info-box { margin:0 0 10px; } +.my-account .box .box-title, +.my-account .info-box .box-title, +.my-account .order-history .pager, +.my-account .review-history .pager { background:url(../images/bg_gradient.png) repeat-x center #7f7f7f; color:#fff; height:30px; line-height:30px; padding:5px 8px; } +.my-account .box .box-title a, +.my-account .info-box .box-title a, +.my-account .recent-orders table a, +.my-account .order-history table a { + background:#3f3e3f; + -webkit-border-radius:5px; + -moz-border-radius:5px; + border-radius:5px; color:#fff; display:inline-block; - font-size:16px; - padding:7px 15px; - -webkit-box-shadow:0 0 1px #000; - box-shadow:0 0 1px #000; - text-shadow:0 1px 1px #111; -} -#wishlist-list a.btn-remove {} -#wishlist-list a.btn-remove img { vertical-align:top; } -#wishlist-list a.btn-edit { - background:-webkit-gradient(linear, 0 0, 0 100%, color-stop(1, #f5d605), color-stop(0, #ff9d05)); - background:-o-linear-gradient(top, #ff9d05 0%, #f5d605 100%); - font-family:Arial Rounded MT Bold; - border:2px solid #fff; - border-radius:15px; float:right; - display:inline-block; - color:#fff; - font-size:14px; + font-size:11px; font-weight:bold; - line-height:14px; - margin-right:5px; - padding:0 5px 2px; - text-shadow:0 1px 1px #999; - vertical-align:middle; - -webkit-box-shadow:0 0 5px rgba(0, 0, 0, 0.25); - box-shadow:0 0 5px rgba(0, 0, 0, 0.25); - -webkit-background-clip:padding-box; - background-clip:padding-box; -} -#wishlist-list .add-to { - color:#666; - display:inline-block; - line-height:1.1; - margin:10px 0 10px 10px; - border-bottom:1px dashed; -} -#wishlist-list .gift-registry-select { + line-height:11px; + padding:9px 15px; +} +.my-account .box .box-title h3 { display:inline; } + +.my-account .info-table th, +.my-account .info-table td { text-align:left; padding:2px; vertical-align:top; } +.my-account .box-content table { border-spacing:0; margin:10px 0; } +.my-account .box-content table th, +.my-account .box-content table td { padding:2px 5px 2px 0; text-align:left; vertical-align:top; } + +.my-account .order-history .pager, +.my-account .review-history .pager { height:auto; line-height:34px; text-align:right; } +.my-account .order-history .pager .amount, +.my-account .review-history .pager .amount { float:left; } +.my-account .info-box .box-title .separator { display:none; } +.my-account .box .box-content, +.my-account .info-box .box-content { padding:10px 5px; } +.my-account .info-box .box-content a {} + +.my-account .fieldset > .fieldset { background:none; padding:0; } +.my-account .fieldset > .fieldset + .fieldset { margin:15px 0; } +.my-account .fieldset > .fieldset > .buttons-set { padding:15px 0; } +.my-account .fieldset h2, +.my-account .fieldset h2.legend { color:#424242; font-size:18px; line-height:22px; margin:0 0 15px; } +.my-account form > .buttons-set { padding:15px; } +.my-account form > .buttons-set button + button { margin:10px 0 0 !important; } +.my-account .back-link { display:none; } +.my-account p.required { font-size:10px; line-height:12px; padding:0 15px 15px; text-align:right; } +.my-account > .buttons-set { padding:15px; } + +.my-account .dashboard > .sub-title { padding:15px 15px 0; margin:0; } +.my-account .dashboard > .sub-title + .col2-set { background:none; } +.my-account .dashboard .box .box-title:before, +.my-account .dashboard .info-box .box-title:before { + background:rgba(0, 0, 0, .5); + border-radius:5px; + content:'+'; + font-family:Arial; display:inline-block; - vertical-align:top; + line-height:15px; + padding:5px 0; text-align:center; + margin:2px 5px 0 0; + vertical-align:top; + width:20px; } -#wishlist-list .btn-gift-registry { - padding:10px; -} -#wishlist-list .btn-gift-registry select { - font-size:13px; -} -#wishlist-list .btn-gift-registry strong { - display:block; -} +.my-account .dashboard .box .box-title.collapsed:before, +.my-account .dashboard .info-box .box-title.collapsed:before { content:'−'; } +.my-account .dashboard .box-reviews ol { list-style:none; padding:0; } +.my-account .dashboard .box-reviews li + li { margin:10px 0 0; } +.my-account .dashboard .box-reviews .number { float:left; margin:0 10px 0 0; } +.my-account .dashboard .box-reviews .details { display:table; width:90%; } +.my-account .dashboard .box-reviews .details p { display:inline-block; vertical-align:middle; } +.my-account .dashboard .box-reviews .details .rating-box { display:inline-block; vertical-align:middle; } + +.my-account .dashboard .recent-orders .box-content { padding:0; } + +.my-account .order-details .data-table + .order-additional { margin:15px 0 0; } + +/* My Orders */ +.my-account .recent-orders .pager, +.my-account .recent-orders + .buttons-set { display:none; } + +/* My Downloadable Products, My Reviews */ +.my-account .review-history { padding:0; } + +.my-account .downloadable-products-history .list, +.my-account .review-history .list { color:#424242; font-size:12px; list-style:none; margin:0; padding:0; } +.my-account .downloadable-products-history .list-item, +.my-account .review-history .list-item { margin:0; } +.my-account .downloadable-products-history .list-item dt, +.my-account .review-history .list-item dt { font-size:15px; line-height:18px; font-weight:bold; margin:0 0 10px; } +.my-account .downloadable-products-history .pager, +.my-account .review-history .pager { display:none; } + +.my-account .review-history .list-item h2 { display:inline; } +.my-account .review-history .list-item dd { padding:5px 0; } +.my-account .review-history .list-item .date { font-size:12px; } + +.my-account .review-history table { border-collapse:collapse; } +.my-account .review-history table td { padding:4px; vertical-align:top; } +.my-account .review-history table td .rating-box { margin:0 0 10px; } + +.my-account .recent-orders table, +.my-account .order-history table { border-collapse:collapse; color:#4c4c4c; font-size:12px; width:100%; } +.my-account .recent-orders th, +.my-account .order-history table th, +.my-account .recent-orders td, +.my-account .order-history table td { padding:4px; text-align:left; vertical-align:middle; } +.my-account .recent-orders th, +.my-account .order-history table th { font-weight:bold; padding:11px 8px; } +.my-account .recent-orders td a, +.my-account .order-history td a { font-size:12px; float:none; padding:6px 8px; } + +/* My Billing Agreements */ +.billing-agreement-view .my-account .page-title { height:auto; } +.billing-agreement-view .my-account .page-title h1 { display:block; margin:0 0 10px; white-space:normal; } +.billing-agreement-view .my-account .page-title h1 span { display:block; } + +.my-account .billing-agreements > p { padding:15px; } +.my-account .billing-agreements .box-content > p + .form-list { margin:10px 0 0; } +.my-account .billing-agreements .box-content .form-list select { margin:0 0 15px; } -#wishlist-list .btn-gift-registry button.btn-cart { -} -.wishlist-wrap { position:relative; } -.wishlist-wrap.grouped-items #wishlist-list li { min-height:initial; position:static; } -.wishlist-wrap .remove-all { display:none; top:12px; right:10px; } -.wishlist-index-index .my-account > a { display:none; } +.my-account .box-recent .data-table { border-spacing:0; width:100%; } +.my-account .box-recent .data-table th, +.my-account .box-recent .data-table td { padding:2px 5px; } +.my-account .box-recent .data-table th {} +.my-account .box-recent .data-table tr:nth-child(odd) {} +.my-account .box-recent .data-table tr td:nth-child(3) {} +.my-account .box-recent .data-table tr td:first-child a {} + +.my-account .order-details .data-table { border-collapse:collapse; width:100%; } +.my-account .order-details .data-table th, +.my-account .order-details .data-table td { padding:10px; text-align:left; vertical-align:top; } +.my-account .order-details .data-table tbody tr:first-child { } +.my-account .order-details .data-table tbody th, +.my-account .order-details .data-table tbody td { border-bottom:1px solid #e4e4e4; } +.my-account .order-details .data-table tfoot { background:#f5f5f5; } + +.my-account .product-review { padding:0; } +.my-account .product-review .ratings { text-align:center; } +.my-account .product-review .ratings .rating-box { display:inline-block; padding:15px 0; } +.my-account .product-review .ratings .rating-links { color:#424242; } +.my-account .product-review .product-details .product-name { color:#424242; font-size:18px; font-weight:bold; line-height:22px; margin:0 0 15px; } +.my-account .product-review .product-details .date, +.my-account .product-review .product-img-box > p, +.my-account .product-review .product-details .product-name + strong { display:none; } -.wishlist-wrap.grouped-items .remove-all { - display:block; -} -.wishlist-wrap.grouped-items .price-box, -.wishlist-wrap.grouped-items .truncated, -.wishlist-wrap.grouped-items b, -.wishlist-wrap.grouped-items button, -.wishlist-wrap.grouped-items input, -.wishlist-wrap.grouped-items .add-to, -.wishlist-wrap.grouped-items .btn-remove, -.wishlist-wrap.grouped-items .btn-edit, -.wishlist-wrap.grouped-items .btn-gift-registry { - display:none !important; -} -.wishlist-wrap.grouped-items #wishlist-list .wishlist-item { - padding:10px 0 0; -} -.wishlist-wrap.grouped-items #wishlist-list li { - border:0; - padding:3px 0 0 77px; -} -.wishlist-wrap.grouped-items #wishlist-list li:last-child { - padding-bottom:15px; -} -.wishlist-wrap.grouped-items #wishlist-list li > a { - position:absolute; - top:0; - left:0; -} +.my-account .storecredit .account-balance { margin:0 0 10px; } -.giftregistry-table-wrap { margin:-10px -10px 10px; } -.giftregistry-table-wrap table { border-spacing:0; border-collapse:collapse; width:100%; } -.giftregistry-table-wrap th { background:#f6f6f6; text-align:left; white-space:nowrap; } -.giftregistry-table-wrap th, -.giftregistry-table-wrap td { border:1px solid #ddd; padding:5px 7px; } -.giftregistry-table-wrap td { vertical-align:top; } -.giftregistry-table-wrap td[colspan="2"] { background:-webkit-gradient(linear, 0 0, 0 100%, from(#eee), to(#ddd)); border-bottom-color:#ccc; text-align:center; text-shadow:0 1px 0 #fff; } -.giftregistry-table-wrap td .separator { color:#666; margin:0 2px; vertical-align:baseline; } +.customer-address-index .addresses-list ol { list-style:none; margin:0; padding:0; } -.data-table-gift-registry-wrap { margin:-10px -10px 0; } -.data-table-gift-registry { border-spacing:0; border-collapse:collapse; margin:0 0 10px; width:100%; } -.data-table-gift-registry th { background:#f6f6f6; vertical-align:top; } -.data-table-gift-registry th, -.data-table-gift-registry td { border:1px solid #eee; padding:5px 10px; text-align:left; } -.data-table-gift-registry tr:nth-child(even) td { background:#f9f9f9; } +.my-account .my-rewards .info-box { position:relative; } +.my-account .my-rewards .info-box .box-content { padding-bottom:50px; } +.my-account .my-rewards .info-box .box-title a { position:absolute; bottom:10px; left:5px; } -/* Checkout +/* Order -----------------------------*/ -.checkout-cart-index .messages { - margin:0 -10px 0 !important; -} +.my-account .order-page .order-info {} -.checkout-onepage-index .page-title { - background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#ccc)); - background:-o-linear-gradient(top, #fff 0%, #ccc 100%); - border:solid #999; - border-width:1px 0; - border-top-color:#ccc; - margin:0 -10px 10px; - padding:10px; -} -#checkoutSteps { margin:-7px; padding:0; list-style:none; -webkit-box-shadow:3px -3px 2px 0 #F0F0F0; box-shadow:3px -3px 2px 0 #F0F0F0; color:#636363; } -#checkoutSteps .step-title h2 { font-size:16px; font-weight:bold; } -#checkoutSteps select { border:1px solid; border-color:#8e8e8e #e1e1e1 #e1e1e1 #8e8e8e; border-radius:5px; font-size:18px; padding:5px 30px 5px 5px; } -#checkoutSteps li { margin:0 0 3px; } -#checkoutSteps li .step-title { - background: -webkit-gradient(linear, 0 0, 0 100%, from(#fefefe), to(#eee)); - background:-o-linear-gradient(top, #fefefe 0%, #eee 100%); - margin:-1px 0 0 0; - padding:5px 10px; - border:1px solid #CECECE; - border-radius:2px; -} -#checkoutSteps li.allow .step-title { - background:-webkit-gradient(linear, 0 0, 0 100%, from(#fbfbfb), to(#d1d3d4)); - background:-o-linear-gradient(top, #fbfbfb 0%, #d1d3d4 100%); - margin:-1px 0 0 0; - padding:5px 10px; - border:1px solid #c6c6c6; - border-radius:2px; -} -#checkoutSteps li.active .step-title { - background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #ffa84c), color-stop(100%, #ff7b0d)); - background:-o-linear-gradient(top, #ffa84c 0%, #ff7b0d 100%); - color:#fff; - text-shadow:0 -1px 0 #ff7b0d; -} -#checkoutSteps li .step-title a { display:none; } -#checkoutSteps li .step { - background: -webkit-gradient(linear, 0 0, 0 100%, from(#eee), to(#fefefe)); - background:-o-linear-gradient(top, #eee 0%, #fefefe 100%); - margin:-1px 0 10px; - padding:10px; +/* Wishlist +-----------------------------*/ +.my-wishlist .data-table { border-spacing:0; border-collapse:collapse; width:100%; } +.my-wishlist .data-table th, +.my-wishlist .data-table td { padding:15px; text-align:left; vertical-align:top; } +.my-wishlist .data-table tr { } +.my-wishlist .data-table .select { display:none; } +.my-wishlist .data-table .btn-remove { float:right; } +.my-wishlist .data-table .product-name { font-size:18px; margin:3px 0 10px; } +.my-wishlist .data-table .product-image { float:left; margin:0 10px 10px 0; } +.my-wishlist .data-table .product-image img { display:block; margin:0 0 10px; } +.my-wishlist .data-table .price-box { margin:10px 0; } +.my-wishlist .data-table .comment { clear:left; margin:10px 0 0; } +.my-wishlist .data-table .btn-cart { background:transparent; border:none; color:#1394ca; font-size:15px; height:16px; display:inline-block; margin:0 5px; padding:0; text-decoration:underline; -webkit-appearance:none; vertical-align:middle; } +.my-wishlist .data-table .added-on { font-size:11px; } +.my-wishlist .data-table .qty { vertical-align:middle; width:50px; } +.my-wishlist .buttons-set { padding:15px 15px 10px; } +.my-wishlist .buttons-set:empty, +.my-wishlist .wishlist-empty + .buttons-set { display:none; } +.my-wishlist .buttons-set button { margin:10px 0 !important; } + +.my-wishlist .cart-cell { display:table; margin:0 0 10px; } +.my-wishlist .item-manage { display:table; } +.my-wishlist .item-manage .split-button { + background:#ececec; + border:1px solid; + border-color:#e4e4e4 #e4e4e4 #dcdcdc; border-radius:2px; - border:1px solid #CECECE; -} -#checkoutSteps li .step select { width:100%; } -#checkoutSteps li .step .input-box .v-fix { display:inline-block; width:49%; } -#checkoutSteps li .step .input-box .v-fix .year { width:auto; } -#checkoutSteps li .step .input-box .cvv-what-is-this { display:inline-block; vertical-align:top; margin:0 0 0 5px; font-size:13px; color:#F4641E; } -#checkoutSteps li .step .tool-tip .btn-close { padding:0 0 5px 0; text-align:right; font-size:13px; } -#checkoutSteps li .step .tool-tip .btn-close a { color:#DF2327; } -#checkoutSteps li .step .tool-tip .tool-tip-content img { width:100%; } -#checkoutSteps li .step .control .input-box { display:inline; } -#checkoutSteps li .step input[type="radio"] { vertical-align:top; } -#checkoutSteps li .step .sp-methods dt { font-weight:bold; } -#checkoutSteps li .step .sp-methods + div { padding:10px 0 0; } -#checkoutSteps li .step .please-wait { margin:0 0 0 10px; } -#checkoutSteps li .step .please-wait img { vertical-align:middle; } -#checkoutSteps li .step fieldset .required em { margin:0 5px 0 0; color:#F4641E; } -#checkoutSteps li .step .buttons-set { padding:10px 0 0; } -#checkoutSteps #customerbalance_placer { padding:0 0 10px; } -#checkoutSteps li .step .buttons-set:after { - content:"."; - display:block; - clear:both; - visibility:hidden; - line-height:0; - height:0; -} -#checkoutSteps li .step .gift-messages, -#checkoutSteps li .step .gift-messages-form { margin:0 0 5px; } -#checkoutSteps li .step .gift-messages h3, -#checkoutSteps li .step .gift-messages-form h4 { margin:0 0 3px; } -#checkoutSteps li .step .gift-messages-form ol { list-style:none; margin:0; padding:0; } -#checkoutSteps li .step .gift-messages-form ol .input-box textarea { width:98%; } -#checkoutSteps li .step .gift-messages-form .inner-box p { display:none; } -#checkoutSteps li .step .gift-messages-form .product-name { font-size:14px; } -#checkoutSteps li .step .buttons-set .required { padding:0 0 10px; color:#F4641E; font-weight:bold; } -#checkoutSteps li .step .back-link { float:left; } -#checkoutSteps li .step .back-link a { - background:-webkit-gradient(linear, 0 0, 0 100%, from(#f39823), to(#f37221)); - background:-o-linear-gradient(top, #f39823 0%, #f37221 100%); - display:block; - padding:5px 10px; - font-size:11px; - font-weight:bold; - color:#FFF; - border:1px solid #FFF; - border-radius:5px; - -webkit-box-shadow:0 3px 3px 0 #9F9F9F; - box-shadow:0 3px 3px 0 #9F9F9F; - text-shadow:0 1px 2px rgba(0, 0, 0, 0.25); -} -#checkoutSteps li .step-title h2 { display:block; } -#checkoutSteps li.allow .step-title h2 { background:url(../images/bg_checkout_step_passed.png) no-repeat center right; } -#checkoutSteps li.active .step-title h2 { background:none !important; } -#checkoutSteps li .step-title .number { display:none; } -#checkoutSteps .form-list .field label, -#checkoutSteps .form-list .wide label { padding:0; font-weight:bold; } -#checkoutSteps li .step .buttons-set button { - background:-webkit-gradient(linear, 0 0, 0 100%, from(#f39823), to(#f37221)); - background:-o-linear-gradient(top, #f39823 0%, #f37221 100%); - float:right; - padding:5px 10px; - font-size:14px; - font-weight:bold; - color:#fff; - border:1px solid #FFF; - border-radius:5px; - -webkit-box-shadow:0 3px 3px 0 #9F9F9F; - box-shadow:0 3px 3px 0 #9F9F9F; - -webkit-background-clip:padding-box; - background-clip:padding-box; - text-shadow:0 1px 2px rgba(0, 0, 0, 0.25); -} -#checkoutSteps .validation-advice { color:#F4641E; } -#checkoutSteps .back-link small { display:none; } -#co-payment-form dd, -#checkoutSteps li .step dd { margin:0; padding:0; } -#opc-billing .step .required em { display:none; } -#checkout-review-table { border-spacing:0; width:100%; font-size:12px; } -#checkout-review-table th { background:#909090; color:#FFF; } -#checkout-review-table th:first-child { text-align:left; } -#checkout-review-table tr.odd td { background:#EEE; } -#checkout-review-table th, -#checkout-review-table td { padding:2px 5px; } -#checkout-review-table td { vertical-align:top; } -#checkout-review-table td.last { text-align:right; } -#checkout-review-table .label { white-space:nowrap; } -#checkout-review-table .cart-price { font-weight:bold; } -#checkout-review-submit .buttons-set:after { - content:"."; - display:block; - clear:both; - visibility:hidden; - line-height:0; - height:0; + color:#555; + margin:0 0 10px; + box-shadow:0 1px 3px #eee; + position:relative; } -#checkout-review-submit .buttons-set button { float:right; } - -#checkout-review-submit .buttons-set .f-left { - float:left; +.my-wishlist .item-manage .split-button .list-container { + background:#fff; + border:1px solid #e4e4e4; font-size:12px; + display:none; + top:100%; + right:0; position:absolute; - margin:-16px 0 0; -} -#checkout-review-submit .buttons-set .f-left a { - display:block; - background:-webkit-gradient(linear, 0 0, 0 100%, from(#333), to(#111)); - background:-o-linear-gradient(top, #333 0%, #111 100%); - border:none; - color:white; - font-size:13px; - line-height:1; - font-weight:bold; margin:2px 0 0; - padding:8px 10px; - text-shadow:0 1px 0 black; - -webkit-border-radius:5px; - border-radius:5px; -} -#checkout-step-login .checkout-login { - border-bottom:1px solid #ccc; - padding:0 0 12px; -} -#checkout-step-login .checkout-register { - border-top:1px solid #fff; - padding:10px 0 0; -} -#checkoutSteps #checkout-step-login .checkout-login h4, -#checkoutSteps #checkout-step-login .checkout-register h3 { - font-size:16px; - text-shadow:0 1px 0 #fff; - margin:0; + min-width:100%; + white-space:nowrap; + z-index:10; + box-shadow:0 0 6px rgba(0, 0, 0, .15); } -#checkoutSteps #checkout-step-login .checkout-login p, -#checkoutSteps #checkout-step-login .checkout-register p { - margin:0 0 4px; +.my-wishlist .item-manage .split-button .list-container li { + border-bottom:1px solid #e4e4e4; + color:#1394ca; + padding:8px; } -#checkoutSteps #checkout-step-login .checkout-login label { - font-weight:bold; +.my-wishlist .item-manage .split-button .list-container li:last-child { + border-bottom:none; } -#checkoutSteps #checkout-step-login .checkout-login .buttons-set button { - float:none; - margin:6px 10px 2px 0; +.my-wishlist .item-manage .split-button .list-container li.new { background:#e4e4e4; color:#424242; text-shadow:0 1px 0 #fff; } +.my-wishlist .item-manage .split-button .list-container li.new:before { content:'+'; display:inline-block; margin-right:5px; } + +.my-wishlist .item-manage .split-button strong { background:#fff; border-radius:2px; display:block; border-right:1px solid #e4e4e4; font-size:12px; margin:0 25px 0 0; padding:5px 10px 5px 10px; } +.my-wishlist .item-manage .split-button strong:after { + content:''; + position:absolute; + border-left:3px solid transparent; + border-right:3px solid transparent; + border-top:6px solid #555; + position:absolute; + font-size:0; + line-height:0; + width:0; + top:11px; + right:11px; + z-index:2; } -#checkoutSteps #checkout-step-login .checkout-register .control input[type=radio] { - height:20px; +.my-wishlist .item-manage .split-button strong + a { display:block; text-align:center; line-height:28px; overflow:hidden; position:absolute; top:0; left:0; right:0; text-indent:-200%; } + +.my-wishlist .truncated .details { display:none; } +.my-wishlist .truncated .item-options p { font-weight:bold; margin:10px 0; } + +.wishlist-empty { padding:0 15px 15px; } + +.item-manage .split-button {} +.item-manage .split-button .change { text-decoration:underline; } +.item-manage .split-button.active .change { color:#424242; text-decoration:none; } +.item-manage .split-button.active .list-container { display:block; } + +.item-options { font-size:13px; } +.item-options .price { font-weight:bold; } +.item-options dt { color:#424242; font-weight:bold; margin:0 0 2px; } +.item-options dd + dt { margin:12px 0 0; } + +.wishlist-management { padding:15px; } +.wishlist-management .sub-title h2 { display:inline-block; line-height:18px; position:relative; } +.wishlist-management .sub-title .item-count { margin:0 5px; } +.wishlist-management .table-caption .label { display:inline-block; vertical-align:top; } + +#wishlists-move, +#wishlists-copy { display:none; } +#wishlists-select { display:inline-block; position:relative; } +#wishlists-select + p { margin:10px 0 0; } +#wishlists-select.active .list-container { display:block; } +#wishlists-select .list-container { background:#fff; border:1px solid #e4e4e4; display:none; margin:5px 0 0; position:absolute; white-space:nowrap; box-shadow:0 2px 6px rgba(0, 0, 0, .25); } +#wishlists-select .list-container li { border-bottom:1px solid #e4e4e4; } +#wishlists-select .list-container li:last-child { border-bottom:none; } +#wishlists-select .list-container li a { display:block; padding:5px 10px; } +#wishlists-select .list-container li.new { background:#e4e4e4; color:#424242; padding:5px 10px; text-shadow:0 1px 0 #fff; } +#wishlists-select .list-container li.new:before { content:'+'; display:inline-block; margin-right:5px; } + +/* Gift Card Account */ +.my-account .giftcardaccount .error-msg { background:#333; color:#fff; padding:15px; text-shadow:0 1px 0 #111; } +.my-account .giftcardaccount .please-wait { position:absolute; top:103px; left:103px; } +.my-account .giftcardaccount .buttons-set button:last-child { margin:10px 0 0 !important; }} + +/* Cart +-----------------------------*/ +.cart .page-title.title-buttons { height:auto; padding:0; } +.cart .page-title.title-buttons h1 { padding:10px 15px; } +.cart .page-title.title-buttons .checkout-types { padding:15px; } + +.cart-table { border-spacing:0; border-collapse:collapse; width:100%; } +.cart-table td { padding:10px; vertical-align:top; } +.cart-table td:first-child { width:75px; } +.cart-table .price-box { display:table; width:100%; } +.cart-table .cart-price-box { display:table-cell; text-align:left; vertical-align:middle; } +.cart-table .cart-price-box .cart-price { font-size:12px; display:block; } +.cart-table .cart-price-box .cart-price + .cart-price { margin:5px 0 0; padding:5px 0 0; } +.cart-table .cart-price-box + .cart-price-box { margin-left:10px; text-align:right; } +.cart-table .cart-price-box + .cart-price-box .cart-price { color:#424242; font-size:15px; font-weight:bold; } +.cart-table .qty-wrap { display:table-cell; vertical-align:top; width:55px; } +.cart-table .qty { font-size:13px; text-align:center; vertical-align:middle; width:35px; } +.cart-table .qty + span { font-size:12px; margin:0 2px; vertical-align:middle; } +.cart-table .gift-registry-name { font-size:12px; margin:-12px 0 10px; } +.cart-table .btn-remove { float:right; position:relative; top:0; right:-5px; } +.cart-table .messages td { background-color:#444 !important; color:#fff; font-size:12px; padding:0 10px 10px; text-shadow:0 1px 0 #111; } +.cart-table .messages p { margin:10px 0 0; } +.cart-table .product-image { display:block; margin:0 0 10px; vertical-align:top; } +.cart-table .product-name { color:#424242; font-size:18px; line-height:22px; margin:0 0 15px; } +.cart-table .product-name a { color:#424242; } + +.cart-table tfoot button + button { margin:10px 0 0; } + +.cart-table .downloadable { margin:10px 0 0; } +.cart-table .product-options td { background:none; padding:0; } +.cart-table .product-options .toggle { color:#1394ca; cursor:pointer; display:inline-block; margin:10px; } +.cart-table .product-options .item-options { padding:10px; } + +.cart-table .toggle { font-size:13px; display:inline-block; } + +.cart-collaterals h2 { color:#424242; font-size:15px; font-weight:normal; line-height:18px; margin:0 0 5px; } +.cart-collaterals label { display:none; } +.cart-collaterals button { background:none; color:#1394ca; display:inline-block; border:0; font-size:15px; margin:0; padding:5px; text-decoration:underline; vertical-align:middle; } +.cart-collaterals button + button { padding:5px 0; } +.cart-collaterals .v-fix { display:inline-block; margin-right:5px; vertical-align:middle; width:60%; } +.cart-collaterals .v-fix + button { vertical-align:top; } + +.cart-collaterals .discount { margin:0 0 10px; } +.cart-collaterals .giftcard .error-msg, +.cart-collaterals .giftcard .please-wait { display:block; font-size:12px; line-height:15px; margin:0 0 5px; } +.cart-collaterals .btn-gift-registry { margin:10px 0 0; } + +.cart .totals, +.cart .checkout-types { padding:15px; } +.cart .checkout-types a { font-size:12px; display:block; margin:5px 0 0; padding:5px; text-decoration:underline; } +.cart .checkout-types li { margin:0 0 10px; text-align:center; } +.cart .checkout-types li .paypal-or { padding:5px 0; } + +.cart .totals table { border-spacing:0; border-collapse:collapse; font-size:13px; width:100%; } +.cart .totals table th, +.cart .totals table td { padding:5px; } +.cart .totals table .price { white-space:nowrap; } +.cart .totals table .btn-remove { height:20px; width:20px; vertical-align:bottom; } +.cart .totals table .btn-remove img { display:none; } +.cart .totals table .summary-total .summary-collapse { display:inline-block; border-bottom:1px dashed; } +.cart .totals table .summary-total .summary-collapse:before { content:'+'; display:inline-block; margin-right:5px; } +.cart .totals table .summary-total.show-details .summary-collapse:before { content:'-'; } + +.failed-products { border-bottom:1px solid #eae8ea; margin:10px 0 0; padding:0 0 10px; } +.failed-products h2 { font-weight:bold; } +.failed-products .cart-table thead { display:none; } + +.checkout-success, +.paypal-review-order { padding:15px; } +.paypal-review-order select { width:100% !important; } +.paypal-review-order .sub-title { color:#424242; font-size:18px; line-height:22px; margin:0 0 15px; } +.paypal-review-order .legend { font-size:16px; line-height:20px; margin:15px 0; } +.paypal-review-order .info-set { margin:0 0 15px; } +.paypal-review-order .buttons-set button + button { margin:10px 0 0; } +.paypal-review-order .buttons-set .please-wait { display:block; font-size:12px; padding:10px; text-align:center; } + +.paypal-review-order .data-table { border:1px solid #eee; border-spacing:0; border-collapse:collapse; font-size:13px; margin:15px 0; width:100%; } +.paypal-review-order .data-table tfoot { background:#eee; } +.paypal-review-order .data-table th { text-align:left; } +.paypal-review-order .data-table th:last-child { text-align:right; } +.paypal-review-order .data-table th { border-bottom:1px solid #eee; padding:5px; } +.paypal-review-order .data-table td { border-bottom:1px solid #eee; padding:5px; vertical-align:top; } + +.checkout-success .sub-title { color:#424242; font-size:18px; line-height:22px; margin:0 0 15px; } +.checkout-success p { margin:10px 0; } + +/* Checkout +-----------------------------*/ +.opc { list-style:none; margin:0; padding:10px 10px 0; } + +.opc p.required { font-size:10px; line-height:12px; margin:10px 0; text-align:right; } +.opc .back-link { display:none; } +.opc .v-middle { vertical-align:middle; } +.opc .please-wait { display:block; font-size:12px; padding:10px; text-align:center; } + +.opc .step-title { background:url(../images/bg_gradient.png) repeat-x center #7f7f7f; color:#fff; height:30px; line-height:30px; padding:5px 8px; } +.opc .step-title h2 { font-size:15px; font-weight:bold; } +.opc .step-title a, +.opc .step-title .number { display:none; } + +.opc .step { background-color:#fff !important; padding:10px; position:relative; } +.opc .step .form-list { margin:0 0 15px; } + +.opc .section { margin:0 0 10px; opacity:.5; } +.opc .section.allow.active { opacity:1; } +.opc .section.allow .step-title h2:before { + background:rgba(0, 0, 0, .5); + border-radius:5px; + content:'+'; + font-family:Arial; + display:inline-block; + line-height:15px; + padding:5px 0; + text-align:center; + margin:2px 5px 0 0; + vertical-align:top; width:20px; - vertical-align:middle; } +.opc .section.allow.active .step-title h2:before { display:none; } -.add-gift-message, -.gift-message-form { - margin:10px 0 20px; -} +.checkout-onepage-payment-additional-giftcardaccount { margin:15px 0; } -.add-gift-message h3, -.gift-message-form h4 { - margin:0 0 5px; -} +#checkout-step-login h4 { color:#424242; margin:0 0 10px; } +#checkout-step-login p { font-size:14px; margin:0 0 10px; } -.gift-message-form p { - margin:0 0 8px; -} +.opc .sp-methods > dt { color:#424242; font-size:15px; font-weight:bold; line-height:18px; margin:0 0 10px; } +.opc .sp-methods > dd + dt { margin:10px 0; } -.gift-message-form .product-image { - margin:0 0 2px; -} +.opc .tool-tip { background:#fff; position:absolute; padding:10px; -webkit-box-shadow:0 0 10px rgba(0, 0, 0, .5); } +.opc .tool-tip .btn-close { padding:0 0 15px 0; text-align:right; font-size:13px; } +.opc .tool-tip .btn-close a { color:#DF2327; } +.opc .tool-tip .tool-tip-content img { width:100%; } -.gift-message-form .product-image img { - -webkit-box-shadow:0 1px 2px #999; - box-shadow:0 1px 2px #999; -} +.opc .cvv-what-is-this { border-bottom:1px dashed; display:inline-block; margin:5px 5px 0; font-size:13px; vertical-align:top; } -.gift-message-form ol { - list-style:none; - margin:0 0 10px; - padding:0; -} +.opc li:last-child .step { padding:0; } -.gift-message-form .gift-item:after { - content:""; - display:table; -} -.gift-message-form .gift-item:after { - clear:both; -} +#checkoutSteps li .step .input-box .v-fix { display:inline-block; width:49%; } +#checkoutSteps li .step .input-box .v-fix .year { width:auto; } -.gift-message-form .number { - display:none; -} +.tool-tip .btn-close { padding:0 0 5px 0; text-align:right; font-size:13px; } +.tool-tip .btn-close a { color:#DF2327; } +.tool-tip .tool-tip-content img { width:100%; } -.gift-message-form .form-list { - clear:both; - border-bottom:1px solid #ccc; - margin:0 0 10px; - padding:10px 0; -} +.opc .order-review .data-table { font-size:13px; border-spacing:0; border-collapse:collapse; margin:0 0 15px; width:100%; } +.opc .order-review .data-table thead tr, +.opc .order-review .data-table tbody tr:first-child { text-align:left; } +.opc .order-review .data-table tbody tr:last-child td:last-child { font-weight:bold; } +.opc .order-review .data-table th { text-align:left; } +.opc .order-review .data-table th:last-child { float:right; } +.opc .order-review .data-table th, +.opc .order-review .data-table td { padding:5px; } +.opc .order-review .data-table tfoot { background:#eee; } +.opc .order-review .data-table tfoot th { font-weight:normal; text-align:right; } +.opc .order-review .data-table .product-name { color:#424242; } +.opc .order-review .data-table .item-options { font-size:12px; margin:10px 0 0; } -.gift-message-form .product-img-box { - float:left; - margin-right:10px; -} +.checkout-review-table { padding:0; } -.extra-options-container { clear:both; } +.opc .order-review .buttons-set > p { margin:15px 0; } -/* Sitemap ------------------------------*/ -.sitemap { margin:-1px -10px -10px; } -.sitemap li { - background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#eee)); - background:-o-linear-gradient(top, #fff 0%, #eee 100%); - border-top:1px solid #ccc; -} -.sitemap li a { background:url(../images/i_arrow_small.png) no-repeat 96% 50%; background-size:8px 12px; display:block; padding:10px; font-size:16px; } -.catalog-seo-sitemap-category .page-title { display:none; } -.catalog-seo-sitemap-category .page-sitemap .pager, -.catalog-seo-sitemap-category section .links, -#sitemap_top_links { display:none; } - -/* Returns ------------------------------*/ -.sales-guest-form .page-title { display:none; } -.sales-guest-form .breadcrumbs { margin:0 -10px 10px; } +#checkoutSteps #customerbalance_placer { padding:0 0 10px; } +.opc .gift-messages, +.opc .gift-messages-form { margin:10px 0 20px; } -/* Search terms ------------------------------*/ -.catalogsearch-term-popular .page-title { display:none; } -.catalogsearch-term-popular .tags-list li { display:inline-block; padding:0 10px; line-height:2; font-size:16px; } +.opc .gift-message-form .price, +.opc .gift-wrapping-form label { font-weight:bold; } +.opc .gift-wrapping-form label { color:#424242; } +.opc .gift-options-for-order { border:1px solid #e4e4e4; border-radius:2px; box-shadow:0 0 3px rgba(0, 0, 0, .15); margin:10px 0; padding:10px; } +.opc .gift-options-for-order div > a { display:inline-block; margin:10px 0 0; } +.opc .gift-options-for-order .fieldset { margin:10px 0 0; } -/* Contact us, Share Wishlist ------------------------------*/ -.contacts-index-index .page-title { display:none; } -.contacts-index-index .fieldset h2 { display:none; } -.contacts-index-index .messages { margin:0 -10px 0; } -.contacts-index-index section form, -.wishlist-index-share section form { - background:-webkit-gradient(linear, 0 0, 0 100%,color-stop(0, #FCFDFD), color-stop(0.8, #eee), color-stop(1, #e8e9e9)); - background:-o-linear-gradient(top, #fcfdfd 0%, #eee 80%, #e8e9e9 100%); - display:block; - border:1px solid #d1d1d1; - margin:2px -7px -7px; - padding:9px; - border-radius:2px 2px 5px 5px; -} -.wishlist-index-share section form { margin:2px 3px -7px; } -.contacts-index-index label, -.wishlist-index-share label { color:#5E5E5E; font-weight:bold; } -.contacts-index-index label em, -.wishlist-index-share label em { display:inline; margin:0 3px 0 0; color:#F4641E; } -.contacts-index-index textarea { width:99%; height:200px; } -.contacts-index-index .fields .field { margin:0 0 8px 0; } -.contacts-index-index .buttons-set .required, -.wishlist-index-share .buttons-set .required { float:right; font-size:12px; font-weight:bold; color:#F4641E; display:block; } -.contacts-index-index .buttons-set button, -.wishlist-index-share .buttons-set button { - background:-webkit-gradient(linear, 0 0, 0 100%, from(#f39823), to(#f37221)); - background:-o-linear-gradient(top, #f39823 0%, #f37221 100%); - padding:5px 10px; - font-size:12px; - color:#fff; - border:1px solid #fff; - border-radius:5px; - -webkit-box-shadow:0 3px 3px 0 #9f9f9f; - box-shadow:0 3px 3px 0 #9f9f9f; - text-shadow:0 1px 2px rgba(0, 0, 0, 0.25); -} +.opc .gift-wrapping-design { padding:10px 0 0; overflow:hidden; } +.opc .gift-wrapping-design .image-box { float:left; margin:0 10px 10px 0; } +.opc .gift-messages h3, +.opc .gift-messages-form h4 { color:#424242; font-weight:bold; line-height:18px; margin:0 0 10px; } +.opc .gift-messages-form p { margin:0 0 10px; } +.opc .gift-messages-form ol { list-style:none; margin:0 0 10px; padding:0; } -/* Advanced search ------------------------------*/ -.catalogsearch-advanced-index .breadcrumbs { margin-bottom:10px; } -.catalogsearch-advanced-index .page-title { display:none; } -.catalogsearch-advanced-index .advanced-search h2.legend { display:none; } -.catalogsearch-advanced-index .input-range { font-size:16px; } -.catalogsearch-advanced-index .input-range input { width:40%; } -.catalogsearch-advanced-index button[type=submit] { - padding:5px 10px; - border:1px solid #CECECE; - border-radius:2px; - background:-webkit-gradient(linear, 0 0, 0 100%, from(#fefefe), to(#eee)); - background:-o-linear-gradient(top, #fefefe 0%, #eee 100%); - font-size:16px; -} -#advanced-search-list > li:nth-last-child(-n+3) { - display:inline-block; - width:32%; -} -#advanced-search-list > li:nth-last-child(-n+3) select { - width:100%; -} +.opc .gift-messages-form .number { display:none; } +.opc .gift-messages-form .product-image { margin:0 0 2px; } +.opc .gift-messages-form .product-name { color:#424242; margin:0 0 10px; } + +.extra-options-container { clear:both; } +.checkout-agreements { border:1px solid #e4e4e4; list-style:none; padding:10px; } +.checkout-agreements .agree { font-weight:bold; margin:10px 0 0; text-align:center; } +.checkout-agreements .agree input, +.checkout-agreements .agree label { margin-right:10px; vertical-align:middle; } -/* Contact us +/* Advanced search -----------------------------*/ +.catalogsearch-advanced-result .search-summary, +.catalogsearch-advanced-result .page-title + p { display:none; } +.catalogsearch-advanced-result .toolbar { top:-100px; } -/* +.catalogsearch-advanced-index .fieldset, +.catalogsearch-advanced-index .buttons-set { padding:15px; } +.catalogsearch-advanced-index .fieldset .legend { color:#424242; font-size:18px; line-height:22px; margin:0 0 15px; } -.sendfriend-product-send .page-title { background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#ccc)); border:solid #999; border-width:1px 0; border-top-color:#ccc; margin:0 -10px 10px; padding:10px; } -.sendfriend-product-send .fieldset h2.legend { font-size:18px; margin:0 0 5px; } -.sendfriend-product-send textarea { width:99%; height:200px; } -.sendfriend-product-send label em { margin:0 3px 0 0; color:#E23130; } -.sendfriend-product-send .validation-advice { color:#E23130; } -.sendfriend-product-send .fields .field { clear:both; } -.sendfriend-product-send .buttons-set { padding:40px 0 0 0; position:relative; } -.sendfriend-product-send .buttons-set:after { - content:"."; +/* CMS */ +.cms-home .std { display:none; } +.cms-home section { padding-bottom:0; } + +.std ul, +.std ol, +.std dl, +.std p, +.std address, +.std blockquote, +.std table { margin-bottom:1em; } +.std ul { list-style:disc outside; padding-left:1.5em; } +.std ol { list-style:decimal outside; padding-left:1.5em; } +.std ul ul { list-style-type:circle; } +.std ul ul, +.std ol ol, +.std ul ol, +.std ol ul { margin:.5em 0; } +.std dt { font-weight:bold; } +.std dd { padding:0 0 0 1.5em; } +.std blockquote { font-style:italic; padding:0 0 0 1.5em; } +.std address { font-style:normal; } +.std b, +.std strong { font-weight:bold; } +.std i, +.std em { font-style:italic; } +.std hr { margin:1.5em 0; color:#d9d9d9; } +.std table { width:100%; max-width:100%; } +.std table thead { background:#e8e8e8; } +.std table th { background:#f7f7f7; word-break:break-word; font-weight:bold; } +.std table thead th { background:#e8e8e8; font-weight:bold; } +.std table th, +.std table td { padding:2px 4px; border:1px solid #d9d9d9; } +.std table[border="0"] { border-width:0; } +.std table[border="0"] th, +.std table[border="0"] td { border-width:0; } + +ul.disc li { padding-left:10px; background:url(../images/bkg_bulletsm.gif) no-repeat 0 0.5em; } +.std ul.disc li { padding-left:0; background:none; } + + +/* Common Buttons Design */ + +.btn-checkout, +.account-login button, +.cart-table tfoot button, +.opc .buttons-set button, +.checkout-success button, +.box-reviews .buttons-set button, +.my-account form > .buttons-set button, +#contactForm .buttons-set button, +.giftregistry .buttons-set button, +.wishlist-view .buttons-set button, +.send-to-friend .buttons-set button, +.account-create .buttons-set button, +.catalog-product-gallery .buttons-set a, +.my-account .my-rewards .buttons-set button, +.my-account .my-wishlist .buttons-set button, +.popup-block .block-content .buttons-set button, +.customer-account-forgotpassword .buttons-set button, +.my-account .billing-agreements .box-content .form-list select + button { + background:url(../images/bg_gradient.png) repeat-x center; + color:#fff; + font-size:21px; display:block; - clear:both; - visibility:hidden; - line-height:0; - height:0; -} -.sendfriend-product-send .back-link { float:left; } -.sendfriend-product-send .back-link a { display:block; } -.sendfriend-product-send .buttons-set button { float:right; } -.sendfriend-product-send .back-link a, -.sendfriend-product-send .buttons-set button { + border:0; + height:35px; + line-height:35px; margin:0; - padding: 5px 10px; - border: 1px solid #CECECE; - border-radius: 2px; - background: -webkit-gradient(linear, 0 0, 0 100%, from(#FEFEFE), to(#EEE)); - font-size: 16px; - text-transform: small-caps; -} -.sendfriend-product-send .btn-remove { - float:right; - display:block; - margin:0 0 10px; - padding: 5px 10px; - border: 1px solid #CECECE; - border-radius: 2px; - background: -webkit-gradient(linear, 0 0, 0 100%, from(#FEFEFE), to(#EEE)); - font-size: 16px; - text-transform: small-caps; + padding:0; + -webkit-appearance:none; + appearance:none; + text-shadow:0 -1px 0 rgba(0, 0, 0, .45); + width:100%; } -#add_recipient_button button { position:absolute; top:0px; right:0; } -*/ - -.cms-home .std { display:none; } -.cms-home section { padding-bottom:0; } +/* Theme options */ + +/* Custom colors */ +/* Main color */ +body > header, +body > footer ul, +body > address.copyright { background-color:#e76212; } + +.map-popup-checkout button, +.more-button, +.btn-checkout, +.account-login button, +.add-to-links > li > a, +.cart-table tfoot button, +.opc .buttons-set button, +.checkout-success button, +.box-reviews .buttons-set button, +.my-account form > .buttons-set button, +#contactForm .buttons-set button, +.giftregistry .buttons-set button, +.wishlist-view .buttons-set button, +.send-to-friend .buttons-set button, +.account-create .buttons-set button, +.add-to-links > li .split-button strong, +.catalog-product-gallery .buttons-set a, +.my-account .my-rewards .buttons-set button, +.my-account .my-wishlist .buttons-set button, +.product-view .product-shop .add-to-box button, +.popup-block .block-content .buttons-set button, +.customer-account-forgotpassword .buttons-set button, +.product-view .product-options-bottom .add-to-cart button, +.my-account .billing-agreements .box-content .form-list select + button { background-color:#e76212; } + +/* Links color */ +#nav-container li a { color:#111; } + +/* Buttons background color */ +.block-subscribe button { background:green; } + +body > header dd.menu-box a, +body > header dd.menu-box strong, +#nav-container li a, +.page-title, +.c-list > li, +.catalog-product-gallery .product-gallery, +.cart-table .messages td, +.opc .step, +.cart-empty, +body > section > form > .fieldset, +.account-login .col-1, +.account-login .col-2, +.account-create .fieldset, +.customer-account-forgotpassword .fieldset, +.customer-account-logoutsuccess .page-title + p, +.more, +.filters-block, +.product-view .product-shop, +.product-view .short-description, +.send-friend .fieldset, +.send-friend .buttons-set, +.product-collateral .box-collateral, +.product-collateral .box-additional .data-table th, +.product-collateral .box-additional .data-table td, +.box-up-sell, +.product-view .box-tags, +.product-view .options-container-big .product-options, +.catalog-product-gallery .buttons-set, +.catalogsearch-result-index .note-msg, +.product-review, +.box-reviews .box-content, +.cart-collaterals, +.my-account > p, +.my-account > .col2-set, +.my-account > .order-info, +.my-account .fieldset, +.my-account .my-rewards, +.my-account .box-account, +.my-account .storecredit, +.my-account .order-history, +.my-account .order-details, +.my-account .review-history, +.my-account .giftregistry > p, +.my-account .recent-orders > p, +.my-account .review-history > p, +.my-account .recurring-profiles, +.my-account .billing-agreements, +.my-account .dashboard .reviews, +.my-account .order-page .order-info, +.my-account .order-page .order-date, +.my-account .product-review .product-details, +.my-account .dashboard .recent-orders, +.my-account .review-history .list-item, +.my-account .product-review .product-img-box, +.my-account .downloadable-products-history > p, +.my-account .downloadable-products-history .list-item, +.my-account .info-box .box-content, +.my-account .dashboard > .sub-title, +.my-account .review-history table td, +.my-account .recent-orders th, +.my-account .order-history table th, +.my-account .recent-orders td, +.my-account .order-history table td, +.my-account .order-details .data-table tbody tr:first-child, +.my-wishlist .data-table tr, +.my-wishlist .buttons-set, +.cart-table td, +.cart-table .product-options .item-options, +.cart .totals, +.cart .checkout-types, +.checkout-success, +.paypal-review-order, +.paypal-review-order .data-table, +.opc, +.opc .order-review .data-table thead tr, +.opc .order-review .data-table tbody tr:first-child { background:url(../images/bg_shadow.png) repeat-x 0 0; } + +@media +only screen and (-webkit-min-device-pixel-ratio: 1.5), +only screen and (-o-min-device-pixel-ratio: 3/2), +only screen and (min--moz-device-pixel-ratio: 1.5), +only screen and (min-device-pixel-ratio: 1.5) { + + #nav-container li.subcategory-header { background-image:url(../images/bg_gradient_retina.png); background-size:auto 45px; } + #nav-container li.subcategory-header .button-wrap button { background-image:url(../images/bg_back_btn_retina.png); background-size:47px 27px; } + + #nav-container li a span, + .c-list > li > a { background-image:url(../images/custom/arrow_retina.png); background-size:7px 12px; } + + body > header dt { background-image:url(../images/bg_divider_retina.png); background-size:1px 45px; } + body > header dt.menu a { background-image:url(../images/i_menu_retina.png); background-size:50%; } + body > header dt.cart-icon a { background-image:url(../images/i_cart_retina.png); background-size:50%; } + body > header { background-image:url(../images/bg_gradient_retina.png); background-size:auto 45px; } + body > header .search input { background-image:url(../images/i_search_retina.png); background-size:17px 17px; } + .header-bg { background:url(../images/custom/bg_header_retina.png) no-repeat center; background-size:auto 45px; } + .header-bg .header-logo { background-image:url(../images/custom/bg_logo_retina.png); background-size:45px 45px; } + + .toolbar .sort-by > label { background-image:url(../images/bg_gradient_retina.png); } -.front-banner { - padding:20px 0; - text-align:center; + body > header dd.menu-box a { background-image:url(../images/bg_shadow_retina.png); background-size:1px 40px; } + + .rating-box { background-image:url(../images/i_star_blank_retina.png); background-size:20px 18px; } + .rating-box .rating, + #product-review-table tbody td input { background-image:url(../images/i_star_retina.png); background-size:20px 18px; } + + .controls { background-image:url(../images/bg_divider_dark_retina.png); background-size:1px 30px; } + .controls .prev { background-image:url(../images/arrow_left_retina.png); background-size:7px 12px; } + .controls .next { background-image:url(../images/arrow_right_retina.png); background-size:7px 12px; } + + select, .select-multiple { background-image:url(../images/i_dropdown_retina.png); background-size:30px auto; } + + a.btn-remove, .btn-remove2 { background-image:url(../images/btn_remove_retina.png); background-size:11px 11px; } + a.link-edit { background-image:url(../images/btn_edit_retina.png); background-size:18px 18px; } + + .product-view .product-img-box .product-image:before { background-image:url(../images/i_zoom_retina.png); background-size:14px 14px; } + + .map-popup-checkout button, + .btn-checkout, + .account-login button, + .cart-table tfoot button, + .opc .buttons-set button, + .checkout-success button, + .box-reviews .buttons-set button, + .my-account form > .buttons-set button, + #contactForm .buttons-set button, + .giftregistry .buttons-set button, + .wishlist-view .buttons-set button, + .send-to-friend .buttons-set button, + .account-create .buttons-set button, + .my-account .my-rewards .buttons-set button, + .my-account .my-wishlist .buttons-set button, + .popup-block .block-content .buttons-set button, + .customer-account-forgotpassword .buttons-set button, + .my-account .billing-agreements .box-content .form-list select + button { + background-size:1px 35px; + } + + body > header dd.menu-box a, + body > header dd.menu-box strong, + #nav-container li a, + .page-title, + .c-list > li, + .catalog-product-gallery .product-gallery, + .cart-table .messages td, + .opc .step, + .cart-empty, + body > section > form > .fieldset, + .account-login .col-1, + .account-login .col-2, + .account-create .fieldset, + .customer-account-forgotpassword .fieldset, + .customer-account-logoutsuccess .page-title + p, + .more, + .filters-block, + .product-view .product-shop, + .product-view .short-description, + .send-friend .fieldset, + .send-friend .buttons-set, + .product-collateral .box-collateral, + .product-collateral .box-additional .data-table th, + .product-collateral .box-additional .data-table td, + .box-up-sell, + .product-view .box-tags, + .product-view .options-container-big .product-options, + .catalog-product-gallery .buttons-set, + .catalogsearch-result-index .note-msg, + .product-review, + .box-reviews .box-content, + .cart-collaterals, + .my-account > p, + .my-account > .col2-set, + .my-account > .order-info, + .my-account .fieldset, + .my-account .my-rewards, + .my-account .box-account, + .my-account .storecredit, + .my-account .order-history, + .my-account .order-details, + .my-account .review-history, + .my-account .giftregistry > p, + .my-account .recent-orders > p, + .my-account .review-history > p, + .my-account .recurring-profiles, + .my-account .billing-agreements, + .my-account .dashboard .reviews, + .my-account .order-page .order-info, + .my-account .order-page .order-date, + .my-account .product-review .product-details, + .my-account .dashboard .recent-orders, + .my-account .review-history .list-item, + .my-account .product-review .product-img-box, + .my-account .downloadable-products-history > p, + .my-account .downloadable-products-history .list-item, + .my-account .info-box .box-content, + .my-account .dashboard > .sub-title, + .my-account .review-history table td, + .my-account .recent-orders th, + .my-account .order-history table th, + .my-account .recent-orders td, + .my-account .order-history table td, + .my-account .order-details .data-table tbody tr:first-child, + .my-wishlist .data-table tr, + .my-wishlist .buttons-set, + .cart-table td, + .cart-table .product-options .item-options, + .cart .totals, + .cart .checkout-types, + .checkout-success, + .paypal-review-order, + .paypal-review-order .data-table, + .opc, + .opc .order-review .data-table thead tr, + .opc .order-review .data-table tbody tr:first-child { background-image:url(../images/bg_shadow_retina.png); background-size:1px 40px; } + } diff --git a/skin/frontend/default/iphone/images/arrow_left.png b/skin/frontend/default/iphone/images/arrow_left.png new file mode 100644 index 0000000000000000000000000000000000000000..b4fbf068570fe0ad61e8bb8c6fceee7792eb98c2 GIT binary patch literal 1101 zcmaJ=U27v%7@jnxErr^+)~{ORFkRM_ZD!_7^U)a-n{+1KW--~4hBhKfCo`w%(9WE3 z=G3G`ibe|YN`+;&7iC+$5W%Hl1uyKv?n3rr#b4l^6~PNdiueJFdZuk!FN_0c&Iix) zywCfd_q;uwzueb5*vl|XUv^3@(7A_>hkCl`|J>}$*Xi^m$&|w zNwU=GaSE1mDrJbUSvAR01YZ?n_FiCHE>F$y{>A?5qFYC_d;H~T+tSTx<0G4PyGz@;{^C0U z`XugU)pW7;b$LtjE(8ZdUFA4;!#W#IlJ^gNd zd+Jv)2run@obG*$IUKmS{ZymEd^)h#5&DQZ_;&j9Sm?JP9Nw#clG+M1`S<@60H@9} z9XED%|L*@T{#Jb`c|M&^Jo@E&U-R}z>EMGv<7&rY46JvD=9!mnvd{cneD0e6z_XdW Jx;rsn{|BFNUP=G} literal 0 HcmV?d00001 diff --git a/skin/frontend/default/iphone/images/arrow_left_retina.png b/skin/frontend/default/iphone/images/arrow_left_retina.png new file mode 100644 index 0000000000000000000000000000000000000000..b3e5d4987269afcf28f5f6a5bf3a4acf9b6dbfc4 GIT binary patch literal 1156 zcmeAS@N?(olHy`uVBq!ia0vp@KrGI|1|%;mJK6}OBuiW)N`mv#O3D+9QW+dm@{>{( zJaZG%Q-e|yQz{EjrrIztFe_z-M3hAM`dB6B=jtVb)aX^@765fKFxc2v6eK2Rr0UTq__OB&@Hb09I0xZL0)vRD^GUf^&XRs)DJWfo`&anW2K2iJqZ} zfu)J1j)IYap@F`kk-mYsuAzaIskxPbp#l^r0c|TvNwW%aaf8|g1^l#~=$>Fbx5 zm+O@q>*W`v>l<2HTIw4Z=^Gj80#)c1SLT%@R_NvxE5l51Ni9w;$}A|!%+FH*nV6WA zUs__T1av9H3%LbwWAlok!2}F2{ffi_eM3D1ke6TzeSPsO&CP|YE-nd5MYtEM!Nnn! z1*!T$sm1xFMajU3OH&3}Rbb^@l$uzQUlfv`p92fUfQ>bTzbeHFvbIFgJBE zGH^C=Gc||lb;(aI%}vcKf$2>_=rzHq7nBro3xGDeq!wkCrKY$Q<>xAZy=;|<+bxDT z&4cPq!R;0!oO<b-rIhy@x@-o3A(`w4-7k2`*^zRZBevUcFS?tuOueBWcjgk_g6AMaO#)6$?-DT zq4I@uo9nMRJ6LaNEL$&j-KE}XNx$Tjjq^8%>+ak3#JVZ|UFWYo=Kpr~?qlL%xTLs$ UoAp`2W1w=u)78&qol`;+0LFZU$N&HU literal 0 HcmV?d00001 diff --git a/skin/frontend/default/iphone/images/arrow_right.png b/skin/frontend/default/iphone/images/arrow_right.png new file mode 100644 index 0000000000000000000000000000000000000000..27235ae43b8a52e98f6a990b027cb0e6403dee21 GIT binary patch literal 1102 zcmaJ=TSyd97#He+s>8?uFAUT8VQaw$92+~GtL~{(F)2g z*hBduy%hBlL==_v=!0ZvDTD<*^%6xUJw;&{z1W$}wI13A&YTP1_x<1hpZ{ELX*yO? zTv<#IL`kecOyIc)k8MSp@P9{J=QTXJP&9>FVGqhkCLqEJ>;_~^lhPmoBxQJD9@G&; zA*Ci$C>3uMWT?@SgQ0EBz-)r3J8T=0+y@ZZ4brL}qP|Q`Q>3bdsCIvxjT;frt2T_7 zpmn4vDUbBYyh0tWC+lnh3upjIq^+gHdW3{{bUhZ{g{WSH41r-X znGBur($GvZ9MAI%>tQ?|H%7RvVI4`fTetS+6hvUjrfMJ+>ZGG6b;CgvqOjB7DQL!q ztZuEB2^Wm9C4=E;)=4P`jK}{E)wB(?g%aS8-+u~Q$zcO931GoNQ^pt9v)2h_2oV!V z2%1R<`*T%n>4gYdz0e>dt$vy#+f`kG87qsA$Ay?~AxW1(Obk(2fmT&T2=Y;u^@^Tg zZB*pAD94L|V8j<;MX#^cjSqC(?Iv#P!s`<>eiAb=F`TsD zo_IaEwLq$P{&gx+<5HgdC~RD~MV^1z9USX#3@jaRRa8HW)m-oBn3$!`uN_HEoGW;D zZ+T^<{`=k4%<8V2rxyKlwT-*W`Uf&^?CK9=Wk0X_!|$)$|5$!Q zy7;JNlwqd7`O{~%$4=~TURqcyovl1HF*&(5+kCcwcs;l0jxyeM+j-%!Xp{KhNZ05u DK+SDg literal 0 HcmV?d00001 diff --git a/skin/frontend/default/iphone/images/arrow_right_retina.png b/skin/frontend/default/iphone/images/arrow_right_retina.png new file mode 100644 index 0000000000000000000000000000000000000000..3f6145078b374b76aa43166fdff23641de025c87 GIT binary patch literal 1175 zcmeAS@N?(olHy`uVBq!ia0vp@KrGI|1|%;mJK6}OBuiW)N`mv#O3D+9QW+dm@{>{( zJaZG%Q-e|yQz{EjrrIztFe_z-M3hAM`dB6B=jtVb)aX^@765fKFxc2v6eK2Rr0UTq__OB&@Hb09I0xZL0)vRD^GUf^&XRs)DJWfo`&anW2K2iJqZ} zfu)J1j)IYap@F`kk-mYsuAzaIskxPbp#l^r0c|TvNwW%aaf8|g1^l#~=$>Fbx5 zm+O@q>*W`v>l<2HTIw4Z=^Gj80#)c1SLT%@R_NvxE5l51Ni9w;$}A|!%+FH*nV6WA zUs__T1av9H3%LbwWAlok!2}F2{ffi_eM3D1ke6TzeSPsO&CP|YE-nd5MYtEM!Nnn! z1*!T$sm1xFMajU3OH&3}Rbb^@l$uzQUlfv`p92fUfQP!raMg0_@sL=p*0#=~dV>GClpQ^3 z{rRbrZav;SFO>JwO0{RNrzk$su6Y`G&0MLpO-;q-=P7AX=CgG-*T|hO3hfhJ`RMZJ z-BkuDG1FGF^YoVWbUZ$~L7MOWvu$08PjAeq*nV1|{feTe(5ZheGNOHYC7gHfE`PuK q`>yWR6F+aISO4eueE$9m?E?%98aw?BW2M_bMTMuUpUXO@geCw3N1R{) literal 0 HcmV?d00001 diff --git a/skin/frontend/default/iphone/images/bg_back_btn.png b/skin/frontend/default/iphone/images/bg_back_btn.png new file mode 100644 index 0000000000000000000000000000000000000000..7b55e92b560a6dd9374616ea053f4f534a39d87b GIT binary patch literal 1220 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

    P=bCdFB%x@M@{xXK)`{lWw zoh|9PZTcHB(S~4TWb;t$#BJ@x!(J5;*fTp?qtm!tu61|c)$;OkEst&6T5hF{*gQRP zxOi2&=Ehr=@t{tIl@*OPJnW#8>iXN6{?NW6L$q_?`GD%td%e9fBQ4a^X^av|Tj!GO zc=W+Na~Ci4nl<{P$oJ^bI~6%i^IOX9oAqdS3`NaYAk4cM{{DkSYjP_ky#=;r23p2h z`E%VJh=GJniR z*FUN`o|}6snu0*<=<2Gt#)stBLZGai9N9a=GrgJLBX8!@nSw3{kw|ohWnC-zfJ7)d zuF1xqpm-)#CeC)gco9n=9bMK9$W-_G`kYgyM_O~s%F1d*kFPGT z&_-c1vd;0nk{(PBsMmIMbkxkO2l6H+CzY3qzdO<>8k*Y~6*azDL-G(&D{^^n8 zfsv7vzZV8&Pd&WI=t=kQ@9Q&YNm*!KziE^Drg~$+o3@}|>21Sx{5$U~EG$Zn!O7Xz zu;&y$a4=64{v@i%yK;*QnD^}_pFU-4!gOd)S65f{-o1MrY)*R_olG6nKhR@$r1LdD zF7CAt-S}{U2Y^1Q7qVe^cz8?zd6&DLA_e;2wfV=5>u;VPc{$W*=~q2yIyqD0i>j)v z4VzK0SlMpRlX{@W>7sMz?&V}tUW^b`_lgT(%vN1V%qj6I+r=6xS6o-RmtMIz)OA)&CWAicP^Zp{b_8>H0z9C w6TZ)+y=g_bww*^@kp?>$Gk%@gw`d%WIJ8C65T05hUiu?rdH66dxre9!2kEsgH2?qr diff --git a/skin/frontend/default/iphone/images/bg_divider.png b/skin/frontend/default/iphone/images/bg_divider.png new file mode 100644 index 0000000000000000000000000000000000000000..c60164a93497b912a1925e1b8ba89613946a569b GIT binary patch literal 995 zcmaJ=O=}ZD7~WDSwc3J;N+ZI!1y5#YHqA$O=~~llKO)^w(_n)lbh|rgmUeg6-HF+x zAjOM{2QMOeklI@hA|3?=FA54C3zmYvz=PF;p8S|ilhlK8VRk-vp67kuciy=(o15zI zi}Z0E*PoqM^K9;7Bih@;{$#c54Vwn(M3K&s60PbU=F%ov#2{pcp3tZh;#uO~#CCgFxFE3y7z%mtnKA|Da&ET>%UH9-@ zJy$U5%Z6m~W9PtVATt3QQym2MisQ?H!Z&nfwhoUW4;m1E$jHrGO>ce zKzE@ipfIHtP}BYowe2?Ar+K{Z_n*Rkq2^+k$3Cfe2D`Y@P#DUUGal9{@d|{jw5m8; zCY1PP;)2XvLJ+~c<(Q=EH}IM!XC0sFj)AkP!ZQWIvP@ZukEF*@YCIK>4~yc2I5L?= zQX-j3s*)5NPG?$Nl^7KpJG8|$_qmyl+^`jFmqk{wXI;nUq(^MfNLjWzdyzWoHMwSI zFX@h4$jrd-V*k46))DKTaM^BKwrMv$c38K2tgUZ+`}C7NiTSLWE(AO3hpB-zbV$8; zw0`i%*qN(aPuAZ)uSKqWFZQ0UlpdU)dGu~$EfOhj+#2ZF-KjlRFKiZ$eLnSS_x8z4 t+Y28@?jAn=@cyrR-MJTACl0K0-Q4Ea!OKThe?JYMU3Ma;J{w=S`3EgjIurl^ literal 0 HcmV?d00001 diff --git a/skin/frontend/default/iphone/images/bg_divider_dark.png b/skin/frontend/default/iphone/images/bg_divider_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..3155c6e84b0cd6f4f837512150467d148b28eea5 GIT binary patch literal 1147 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 diff --git a/skin/frontend/default/iphone/images/bg_gradient.png b/skin/frontend/default/iphone/images/bg_gradient.png new file mode 100644 index 0000000000000000000000000000000000000000..c33eeb213004d68f4615b4fcf42ebb983b678302 GIT binary patch literal 1094 zcmb7DU2D@&7|w7?84LtL(5tiTQj?sMk7fz0BOk3Rm^r$FyeaZ8suWY$P>m9mBdUWDvn6pCC#h@AcecZx+czEy~Z*ttV_ffk;JKiHRAhGC| zHewN{49#(yTSe*zLrg&z_oJl7|N8Wq2T@q#pJ*QRQU?#B?V}9u9qqJ(qhVl#{MG}o zS(uC<#?%KzJW6u2sPR)?lkLlEi3d{?I;`<$PIbIp;E)UhO@u-Ks|Zw85vkBnjr%}` z2uetnpe`V2YPty#m_0mG%fg=7avL)(cB=6MN>fvkCXPVwT{5OMo_Tr}LY%gu{($BS@+6-ni=|B}{8U0Bl(MN! z8Q&b`c~>LicwwE>7Cv|WQvSSsm}04gb282XR>j`>1*xlrO2b(Ursrov%&OS%M>(GU z@I3P|b3RJ^kxPPcj1$^)Yy5Z|g{Go9vgW8z*A1l(5wf7J*t%o8vemE+U6~VH1Trl# zWLVu+E!}WrT}3uRb!2N6Y}mG@Dw?Y~RdtSSCOP$!0GFaAHaf?mE3u}NVV{z$O~`28 zO}hg^Nj@McaP~Cd`9YMF=d#p{n}zD)EP95+Mn+;V&AJ&~qOZzT3s$WDO0xq literal 0 HcmV?d00001 diff --git a/skin/frontend/default/iphone/images/bg_gradient_retina.png b/skin/frontend/default/iphone/images/bg_gradient_retina.png new file mode 100644 index 0000000000000000000000000000000000000000..abefea993aac5cc68caa2814de830922e83bcbf3 GIT binary patch literal 1096 zcmb7D&ui0A9FN-&H@1Ta;yi^6JlW*EG;NyDI@u6p6g*Eoi|A4D;N3sKtN(%XrE9kxWMCk9Kl1&2KHr}&_ZoLM)^4tG9Jf*5F`I0? z#NJ0&F0=3SarqNlHmTL2Ez+YC6l1RHkuK)z0qWx>M&9(vH(chp<#&F&Lp#o{?vg-6 znT?nR5kqrac{`1eJH(Xl;=UhNgx?=O3%u`Dga-u&IFW$|{?0*+TL+D{doXl0PuRZ0 zms6b)1ehW|4Mt(2rxjtwtFwJ}EeZV0gbpjhiBlbCk2gq+`GN>?E+|62sEAMjnxft2 zWdMN$WeKP`2=s!g1IW)GfvLq_Pj8y`T#KD5!hq69m!!#LB2MxmiTe`NG))4sB+EHw zkxQl_MQJWfwiXN~PTbg!s82#ZV?SLo_mpI}UJ2>t;n5k9|+iD~4P!6rieF-U1L-fts(WM$MF~c1=_B3xe}N zrX_j|s{&}*YAvrSum+(8OPW@#sU@{kQf<>PtOd3nCKQD(&O|e;e}_6CHKWI!U`Xcc$|xqg_Pvr;o|7OIJ3|0(wDm<0SR>$?9BeMK%-L9uE9TZY9F zgc<~zVL>1l^R{UkvM|Sb|D7<2c_L+9cCPCdSFDw@?dc4$!|4>_kQFUvGxkgA-DmSD z)y--<{n_3Bvh?Tp_{Z0kw;!(VK7Tk^X{;)Tn@6u+zrS(qy4YB~^#ZMPOY7YCXUlKY QW7^7QyKXhiquT!AU-HRRLI3~& literal 0 HcmV?d00001 diff --git a/skin/frontend/default/iphone/images/bg_nav_brd.png b/skin/frontend/default/iphone/images/bg_nav_brd.png deleted file mode 100644 index 229016e862823c14021888b3ec17093e6136dfe8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 259 zcmeAS@N?(olHy`uVBq!ia0vp^3P7yH!3HGlHr@UYq*&4&eH|GX)}JtE?Rp91OP07s zlmzFem6RtIr7}3Ce%xSv=@zZEnX*%?#zYON94Ne_6Ac^ZTKX z)AsxSW(l~P#c-kb7oWj~*k9S^H$~mkGX2aVm$b&!Fig%BvJL8z0osND56l~M4wXG) vKE=^+i9JM+;rOyYymL!Ze!p0Dn?-_Q!?rBWeJK|ng4BDu`njxgN@xNAUie=q diff --git a/skin/frontend/default/iphone/images/bg_nav_brd_inactive.png b/skin/frontend/default/iphone/images/bg_nav_brd_inactive.png deleted file mode 100644 index 4c9a05c893074586ec48296550a6821a728235c8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 869 zcmV-r1DgDaP) zb>7d)?sz;7yWMVi#&P^O48!N!?e;$2ZxW`J`|I^OwASw5+UGl0?t^Z@#d-<&ufY2j z`yYvuG?&X|829`ALKwoo1j6@to&)wOnIxR=TofX>&IA+Ae4f0Xz@}A^!SxpyuSz_Z^4GCV$XwmPQ2-4l%rJ&`K7HzsWmK4cg}zBu+8JdY^OrrD>w-m2CoQu!jpQ{h&+2e_JnN> ztgTkf5G_gQ!^q3V8CJKSDny3FuDtg{sVY_lByE^n~9%;RA))-MezR8+)^W zhV?q_wAI(Wq?+aB6t}J$MNU7?!H1!6BYf8r1(flG)wOOwc=ebltGVJ_PJ!H6-BpH$q zXNo*Ph2_Cj63R0F5A+erJ0r`O4U1=6e_E3WQ+PGM&*$^QeyiVm1MA(CWZ*O-j-KIe zQ7;58aOXU-pB3 vOy0)kYju;UGW}nQ_I_dt+?4tIuK)u8Q=d50UyL3-00000NkvXXu0mjfg?^e- diff --git a/skin/frontend/default/iphone/images/bg_qty.png b/skin/frontend/default/iphone/images/bg_qty.png deleted file mode 100644 index af5b07c25df496fd70d21f954397935dfe30bd39..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 283 zcmeAS@N?(olHy`uVBq!ia0vp^!ayv-!3HGrL)l7z6id3JuOkD)`V;1?T`z%r$r9Iy zlHmNblJdl&R0hYC{G?O`&)mfH)S%SFl*+=BsWw1GYdu{YLn>}1{rUgjo_Q;SFtaEl zcSk}>ii)SO-u(x~Gld0q2OSoRRrtqnbk~h935Rd+2(v!Atza8aBdz7ODKW>PhUcV$ zgdN+|!`TwbGaOtTSOtukKSnC-V@Q4N^if}7UWY!@1>VJxIea;bme%n(Fj)rt;xJ)y zaA57&yYNlt5*9U$U;as+QVNECMZ#}wRhr*ToSmV0%J0Xene0>UIp$a`&RUduP~CFD dOCE&-3?JU_tLaM&e+YCqgQu&X%Q~loCIDhKV$A>m diff --git a/skin/frontend/default/iphone/images/bg_rating_star.png b/skin/frontend/default/iphone/images/bg_rating_star.png deleted file mode 100644 index dd3da542867283363e06a19adb420621801f4dab..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1081 zcmaJ=TSyd97@n}pVpz}C%QQatpgWg!XKg1}S$DjwII^t^uF-?z%+Vcm=1enZFWO5A z+65~pP3JpD#(BCMy*ArYSflSy>JNSRR>T}9S#CIZmPo|2~>UT%u~=r zQ5B4lN~5&WEosnXRS&}!Oq;MNs;Q-5tJ(-a^dJ~EtO)b{;R-_=dW7i{6<)DpAY*in zJD_*GC#8*#XkndcX{MVB5)m)~Qt5&@YPnJ&!ffeEWbGYu47~+GBN1lXR9Z>UG3WqV zWO={FhXgtlWQ8Cf4u>^ACAzR|O zd_K?S8(8QJb3!;A=J)^?2>1!Y?~YkWE%+_BrlcSPS91&-8PK9VMRgEnQG_8*w^K0f z9a+mQmWdRME2uUnu)LR238*OlhnnUN+C@pQ>-V3+ZfeX1ToSl2>uBWShHAV}wiI)K zilCE%aI{p#LSdPP>C`wUBmd3Ou1C{o;Vk!oomE=L%mz#4`wg=4{BAlxcO z17d?9wDD0n7L10X$J;}ps2C815?6*=)&v$RarIqps4UlO1=A*xW#AY&ptn2Fq_!M3XqI|m*?=SCH!FxKe&#+yutGs{BjAef5a1Ac=0^`^$p*d!nd;c z(LA2)!uThCzluM-#!nXT!r0?yw^xXGA}&W$g?FhJ{fEx+zP*X*Wq3ckv3WoYPUf0@ zS1I{gZlQi-_UK#ub>h_T>e*veSJpo-)JJ|3gcz--%%L=Wv=q}l(BR9dE;gb#q_0a9&26p|!gRgj<;}+fq%@%DrTe?R= z!Od-iEQ}eNaMzryb+4s>D@_kzu%1n(YgH@&02r}_NG z1F)Xyj3C6+1z9+VQa!8iV_u!@^J|d@V-wo1@TX3-oE>121Or8Y1rL@GC=~@%gj!Ks z0}@0~M3M;A0)o1t>JWj+!!xzS-`5+KJ<(#P3g4qN)RJUtB|j2l6>N7EU3lunYx(k5nZEFuAl z$=D{3Z;Eo9%MoEXvrcIPpE-Xaf7(2ZvDm;V873a9;{NJ6smq0O!$}Of<0gH~s%X1| z6pw#6j{b-_A4KlJBHl2>5v^MlemD$#T`roEViuvQYH|%CWI$D}s%F)a47;kS@|55_ zkZB1%!&+6V49iAYElM^*HDs8wR5caFRBb3%4SR~MM=5n959gveHaNqomtu7@!7e39 zlaRr*n|6AHlC(!+VD2gc0((K^lTn(NnsKvGEt~|;ux}?M1mmph!3Fw7sbs*CQG>RG zN@avJ1U0jUpj47=%Q7W?g7yD9VIuQH%)9Jd*G;cjE9cwU46(y(3US1WmarLndbfUu z&8J+qjAr(u({8tq{rOub#+N6}`L(|{w&23Gdmp|(zxjIk8|DsP{60BZ`TTPZaP!x> Wm0wGH%hJ2Y`Fz)F+t!z$p6C61+1P)uwz{z@2*O%@&usGb z3V$2dR`~blr@O!Svd(I4c0hY<;>1L#c(hAEJ#hM@NgVI!>1VPn2v^_wtu|}h4|SIY zl9Sm;X%KO=AZ+iZk>d^t16|Vh!?O7M-Fp%EURgXW+Q^O!GVu3~V{&l3-*S(KuI7om zJ77E2IYB^}1JYm=CVE;Hr@T7fXV*{!Qxi5Ui>FSt?FKMtOh8dWc^8#1C@B(Fkfvxk zAR~+*mLXE}80ke-M;Oc=k*mdCPj8ymOpBk&;()P8hj22PNRxs@<37Zira>e_S;=H_PI9?0b4aG3275AXU{0HH2{msfDU)R86^JRW-FRCpZt} zT9U`HhNf9Y!7@}uwlJ-~4aAom1jU3RYP=2yIxv+ZJr_+c@HB;-Yl`HbEF_T@XD z&wF*V(n?RdolfUfZ|TP0%7@)tZuI2G^_5(1`StVluS+*KZwt$Jgx2F*J12iW!fdGP LwSDtVwe#X1D5p>_ literal 0 HcmV?d00001 diff --git a/skin/frontend/default/iphone/images/btn_edit.png b/skin/frontend/default/iphone/images/btn_edit.png new file mode 100644 index 0000000000000000000000000000000000000000..8e3b3f7d145c74cf2ca426cdf2d42992253ab2c9 GIT binary patch literal 1321 zcmb7EZD<>19KWV$yV+@xD%K)9FR~A6axcl{dS}lxxl3G}sWlBO;E-MKo+d|fFTJ~% z7tyx+*6CBnzeuFH0s)`U%{s+qm&HQOV@?2u<6xww)BX=lp&7 z?R3Qicna7?(UM^mN4#64wij{@8!>Q6$;ty*#kf?kLH!_^VfF zbW9W|Ax4P|$%+iq#3ppxk#rfjqApgwhZVQQa)JdU$FS0dQD}D4V9sz1J7<`vFhu)F zbib-AM#*+d4Y^^cBCymqffBb24XtOLQ}3fs2jdhI3q^x8MTB}uvX>#_B0~h?0vQa@ zp$OK%D*roSIP?T}yKGC>HMd|ZyVK1(1Q(mP5a_UI7QAC;ZtE8jq@^<cmPP`UN~#Kco4y<_WZ3+-0dH*?Dy<3H;i7soT6XXXdOSGm=$ z`B3*8p@Wl1cR#=S(QGH*KeJxzQTQuM=+m{u3mtQ9pS7{X%t8-YoyqOHbnG`dTbpkC z^#fF^{;_-PPUY{ll^;${js6vxJHIb6xx4Vwksjm5mB`$+%ZuTMpPN1;A3hq~;XI+) d$j3{FrvvewF8z5T&++chD-jzIKaUVO9bf#${^Kp}!8oEN=5&F4PE_~npM&~1#-P#B^Sq_8*|7X0-)OOqHX z2JBds#Z9=wEC`CFEefb?DfjwY>ixC=R$PP@Mj1#D0-AtELk*J3MD5rHF9YZLHjbei zCR)86d+e0YU4gQ)0#J*Q$oCUg61AF*q?xdpZFwj~kOWRrI6>!=1Y@BYf=EmNnz~Icshi1yX~UyJ7$=Pcu58%o@ok~p?%ffg(6+Uz zdB79rpUSU#o5KM2099^M{IH6(h8GAw9VuqNYX*jCMV50Im*F1ZM12NU?&i283Pc@aW0#S zwOVMFg-93auR4kc75XY2T2!N^P&s??$79?hwe@#v>m_m+zaEU4ShxH zYdx=J8OBy#nH}wo+s9x>t8TvY_pNZk*$=N@U4H-5jP`-JtXH26lCv$%r^wG61lfK3)k0DgIPCLvXxJS>G+Pu zJ6HBbujbg+|9bPimlykEj}DBST39O?2RU;knKPYZeboc$^|!FYN6z^84_c@4j`R+9 zzxWMxc{PqzMlaM{oG3VbZQ%`mt_XKII`{Su=gd>_zo$MEeJN#%%`A-{7RUN~=G#6l zoJpQv{5+>~fB*M`ZAsN-XIE2y9Sz;TDNjBU<{#bg{7AvbQ}evbUJ lw0Ldx&!JYsbkRv90Wo;zZ+!OKV5a_qEOV7}=bXph{SRQ%`#k^v literal 0 HcmV?d00001 diff --git a/skin/frontend/default/iphone/images/btn_remove.png b/skin/frontend/default/iphone/images/btn_remove.png new file mode 100644 index 0000000000000000000000000000000000000000..fd22fdc6b64242756fc18e063bd3e73d2bc6d430 GIT binary patch literal 1185 zcmaJ>ZD`zN9FGp?sH+UN)%698neNjrd2%nkCf=>yCB5sxQqJqKR&d%}@?0C*|O{fL^pdfBzZYq-^vuNS+sd zzu*7uM_y0&C7YYtnh1huPW6fzyguZ;>(=7$kz<8zcxiQd2AzJCcM7rviI|FVkWA_F zFw8(%E$;aeMhIdJrDX@5L1`ziAf1*y4DISBW)noD+cjln6gp%M4r@k~x^?CpMQUo4 z8VE^1G6guI^_DEyU+T*$rBQ`bsqP(Q#O1Mo4jq|v^)bWd-6*xJ%j3Ow%~0er#2JlJ zcas{F(xiYaNQP+OQ$Qz6b_QuS2)H1(o%911Fsz>eVIK?lP?!fSx$;mrnx*FXjF?!7 zg-=mx#BofXVG4x;T?o*~8fI9I;~3y){C*!s`0S$L$ga<@x7HOzXe*XxIvO%aPf^aH zaVJXQOz)PUo2#;hz0xM!FvgWlhNXd5QXMEs{}0vmRkZD7;JtkRQ`pWHO~_=Rjm9kn z4=%se3uW?x1!V_WS%k*wT}+Q42iYUYB!&JE&5{F}p`wDljF%)nW!R2vC@>{PDXc(i zn#y+x@lZS%?g7QOmIR_6vAN;u5(4CjO);F>Rk06H_?#mSwS~(WD#20 z3s6m1NGF#|=C#JT2o3dCxN75E#D-i3C&PGy{nw!DSJ*w?cGb4{uxfm0V7FV?)`bfl zy##UJ=9C!Ax>s_M_O{Zl%im=t%Y?gsX<>JZoJ{%_XLdduKRDUdb@Hw1-wS_iys$X` zd;9s>J9AHO+PmgZ^&s;geH=y=TmF<;P>s96tNm?CgA{d&5$(R;_K`c&K(_?$U#M zYWun3?b;K*4{Oge&k}cHzg{!)*RSW&&z*j=EJ)2WbDaStef6Vqd2-^BN^EH1;{#jX y7#lNR2Gj2zJ=pQh&FyIZ*15Ioh4*qB$Z29`oBgvtKJl&h(@6F7iO1tZFZ~0QHKhFj literal 0 HcmV?d00001 diff --git a/skin/frontend/default/iphone/images/btn_remove_retina.png b/skin/frontend/default/iphone/images/btn_remove_retina.png new file mode 100644 index 0000000000000000000000000000000000000000..d8ca6b8ecd61287c893d53fb13d82dbdccaac9a4 GIT binary patch literal 1319 zcmeAS@N?(olHy`uVBq!ia0vp^Vj#@H1|*Mc$*~4fk|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*9U+n3Xa^B1$5BeXNr6bM+EIYV;~{3xK*A7;Nk-3KEmEQ%e+* zQqwc@Y?a>c-mj#PnPRIHZt82`Ti~3Uk?B!Ylp0*+7m{3+ootz+WN)WnQ(*-(AUCxn zQK2F?C$HG5!d3}vt`(3C64qBz04piUwpD^SD#ABF!8yMuRl!uxKsVXI%uvD1M9IxIyg#@@$ndN=gc>^!3Zj z%k|2Q_413-^$jg8E%gnI^o@*kfhu&1EAvVcD|GXUm0>2hq!uR^WfqiV=I1GZOiWD5 zFD$Tv3bSNU;+l1ennz|zM-B0$V)JVzP|XC=H|jx7ncO3BHWAB;NpiyW)Z+ZoqGVvir744~DzI`cN=+=uFAB-e&w+(vKt_H^esM;Afr4|esh*)icxGNo zet9uiy|1s8XI^nhVqS8pr;Du;&;-5A%oHnQGc#Zq8=06pI~y1px*9sU7#lenIhvZ7 zyPCNfn7Y99y5uL9=BDPA!1Sgd^qS(-3rY&P1wfl!Qj0RnQd8WD@^clyUbf1_?G_`P z=0WwQ;C72KPQCg-$LND17Ac}(Lcr7mV#1RxkONQnsd>QEUIa|m=lIrgFfcIA_H=O! zskrqf)HdHSP@>NC$to}9m#@r1H!AXknRWK|o;`5kApZyXo}k6|71+G96?m@x$XJ>g z>KQEDEH?f0+TYh~oo?;0yLD;h`69n_Cx1UV`P=5b#SpWYMTqrhpmn% zwEEb!XoGBje%`%#PK@nl(gkPLLhioPKjq%bwuhzp!z_;j`{MW?=am;9HMXhT>vGk{ zGFT(w=u@Ti@-XePOPNn1!$LmZlDYoppXJZRw|&2DPct_9`RA0(dU=6)$EBMa1>#nR zq@-q>KCygP&TRDVtHZjhewU3Te6BwfPzic@p1oyl$bxsD4@MhtaxE6@vym(M_n<(h z|B=?`9~U`(KmBAA)D*ZkChy<{KdrBO<@}XezL)*JvqJKvQgTe~DWM4fcih@s literal 0 HcmV?d00001 diff --git a/skin/frontend/default/iphone/images/btn_trash.gif b/skin/frontend/default/iphone/images/btn_trash.gif deleted file mode 100644 index 8784187ef1f2ffa7a9d8afaa3a24e9702ef8a6c2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1353 zcmZ?wbhEHbs{B7gLAIFY;-@g5cwDcoR&LVOC1Fx149FSLnD0yb6rCND^qhT149KUPy*Ukl#*r@w&$amzVPg@)As;uP=V3xw&xF#U(+h2=`(& zxHzP;AXPsowK%`DC^;3VTp46lft7PnYGO%#QAmD%4lEP{GV)9Ei!<^I6r6)i^$Zol zGxJjN%ZtJ4eSNJw^NLFn^O93NU2K(rCg^2mrdXMqI~zEPQCg-$LND17Ac}(Lcr7mV#1RxkONQnsd>QEUIa|mjQ{`r{qy_R z&mZ5vef{$J)5j0*-@SeF`qj%9&!0Vg^7zri2lwyYy>t84%^TORUA=Po(!~qs&z(JU z`qar2$B!L7a`@1}1N-;w-Lrew&K=vgZQZhY)5ZeMTG_VdAT{+ zS(zE>X{jm6Nr?&Zaj`McQIQehVWAaT^(&LO$~K5RTX6=MFn{|Ss7_5NeOW=Q4wJwK>>a~ULI~PP7Zc9Ru*O^ zMg|7OpDf^FM+ZcL$~y)&FNcZg%357&b9vN7K8f(pn&5aPv5cirfFtmWfu!Q00~$dF vj;uuw5Ao>sFgtNPPB3%f2+&aY5i*05O;L>9RbD`mU!FlQMTkMfk--`O6h+iL diff --git a/skin/frontend/default/iphone/images/btn_trash.png b/skin/frontend/default/iphone/images/btn_trash.png deleted file mode 100644 index 43d00f17d8552113ff1ecaab7ab7e26286ac9c82..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1227 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 T@WcF{U%up|lq74!O@jUp1gMBI literal 0 HcmV?d00001 diff --git a/skin/frontend/default/iphone/images/custom/bg_header_retina.png b/skin/frontend/default/iphone/images/custom/bg_header_retina.png new file mode 100644 index 0000000000000000000000000000000000000000..b0f03f0159556c1921eebf61e9d8c4a85267863d GIT binary patch literal 57132 zcmaI6V{~P~w>=u$wr$(CZTloAwv$fBw$ZU|+qRQV(s8=`#CZL??|<)mAKrcY!``cE z%sJPpRclm@U8ADaRAiA62oS))z>wwTq%^?5AVU7x25=Dn-WBOUtbZST4{1FQO&1#v zZ*wtZs}<4L1tlXYws*fao00IL1u3yOrguI%%%*Kw6?RC^K-M-^i$EY^mDZ2x1tag zArtZu_$L6c_An>&0XR9k3-}0A{Fko4Kl?x3tQ2Jb1@Ukcrue^u(oeHS$#lJ}Z?;!wy|0C<{{(sW+FJY`c=0H|<7PkKk>A!)>%K!gR z0N{Vn?j9P}|4+RCpTh21zCdeM4QqE7PdCed6K6yDA6GyDNjGbA4;MEr7Z<1h&Z3%~ zi-(K5oePjmQj?oZ+1%3J`9JOd!YeBa$UD1xm^)iq%S#DU{8M1Dx3>}y=aS@PXOouU zmEhuGXP0K@XP1(ZWaE^Skz$kKmFDFBZ?2S!r6<7J+2g;tR{z75Vf$aX|0x9k@SkTX zYd3o@YbzNy7XaCR4Ozhce~(4#f7SaxT&w>z7HR4KmCO1s7}ozx?Eh<`|GVp7_58>D zpR)be_@BbJcK%oGZvVtx$wwl za(Lk6fSlzb^-+P(V}1*G&V5 zFz2ky86LhR5~0`F2dl{V>q0UQ1;F5R^6JxZ=1q13b=K(1D7esfVDR<)gYl_wPc&%Y z>|^AqFyQl~LN)lw_v4M*>0|K2U-j$v{^$M8eRkZ}GG zCH+}{GVuCoM8;n6u58!GhDlecfxSor4MzltZ8jU8pjByOQKN&;es)mxQ!Egk`c86> ztl>)`C~VZ2iG^HD@Zc=i%!_fFfCh;g!&r>PYgkqS~Z zYTtOHdOf2~x4~N>sHm1z#7DQJV9P-0Bj@Twbi=r+Av7w|g`n+L!n7^OL(24N^oQvk zF6cDzRi-oOIpRsVr;*;yF=mxBinitRWB8olJs22@Nl5e<+10-nm=4pB=*)#fL^7eL z>R(oH?so&~5ouNZ-S7-N3O%9V6iN)3W@X~=yUH{m#yk+hmHgFbF2 z1RP)ob$WS<4CMkps&>C>yep%!6OTTQZ+qc(M|{&8AveAzzB<1G)=erhxt%Th7HZGE_A1_n z2JZGE3F8HgI$BvqAEv@Ko`O6oXjM&3c{@nD(fzsII4cY5aP{BDKJ0H*P7V`X{X~ z(KYpyc2s*f`Pk>zYhb<=NN_0r_h?T^1-Kr*E58+|X z5)snE2EU`%9c`Mi@0Q%J-P@Zff0Ka^mu-D4=prrJb7!3qH71>;C*A#53BOzGi9>o) zNN9|73uySBeV~D6#{z4-^&35z(jOjf(Z@Wt`9FoOS{r>@-5#Jtb`3B+AL134pA(|5 zxP7`@%d7lqJgxPx0s>{p9rVgTN9)G-uh@6zd$7C^-g*6PaF>-s{9%D~&nM-O!{eXf zLk#c(IqPj$BKQTVB+NwVBfkmbuGv+* zUuDX@Hq!kw@-3ClkIX;r4`0^F4NlViGplF(>J*5-b0??O|C3y*ASn22$ zi;Z33ynzY>qw7nPhi<;^0?~egOUY&E21dh|pWhm()}Fq1e&OD4I{KSVY9^ZvjUm$4 zOLjka5iYf;jz64a>AHe({ zZ;TVJE0?UdgzgWJ>)q8AV5aUL9lpR|6Vae5l3^RYjUJNB*ZunC#)1vRI!9p{&weAx zpC_-Gh(F|r_n&g1GK}xHEQkX$16_Ih3qPOf9aB|nL0v&3{U3IwA`h`yIw+3%=O=1c z{>DGW2101zxnWSE&2+guO!NAlU%@ihq^0uB$6*dM(?k5|YrM?!aX_dA2eO8Zw@SjA zok0SM>$))}H*KaWf8DR_re)*s9c4Qh;E4oX3ZM0Cp4n<0x@}AggLUk$wVCUAQMfJi zj@up@QZ}ju1}AD6B4G8ak#0TnIu$*CU9$JI`qzCceT3)PWuMp1m!ev(Zbe}FtL;>5 zWT<=hSu=Qox%DKv#@oy*W;mvdp#UTS+d z5}}Ccj-->>+eg`RFUL(?P9o6OQi?TXK3nZlTVKherI}2m-ExH9Ur2mXJ>*ypMCU9B z*9Msp!!pR?kacry}EF)S6d zzqSb9>e*WyWbR7433c0Tp|y)9cIu2s;t7UoV;5|0@~Zv(XwS~hJr_bp^tFFkvc2jVSq=-tbxtPPd|L zUf8i?qYuhzg~ z+ED1ge|Y{_3a=GbCqxG8a`<%_cP%XJge!2>P?A55VL8x@w27T@< zkbXV?+<#M}d=S_Z1s$1tzs+dMGBWgpAqG{nB_mJ`Wsejv)R4gm)m){(#`Jh%bYebN z-(iJ)zw`mDx?vqBoOBoAIk}B!{V5koLRdGzxC%)CdE82-&glSPhmS(wsP}7l^1E>U zzFtKu^KDsM>i(|JY~;lXN>nBB@j<1M{Q?*{OzlyIRQlZ_SV;nR-}BMH4e<79J)WO@ zza~cmIbfNzu(JeYnMSMiaC5Zl$OZLJg34H0U-P)qUwTK{-qxB6@x8d{{Y8pgCR5Wr zp{oUCtzp@)FCZ&0B0X`7Os*EZvddKVo`Idt^r~35brU?_DxB)_VH;FkXhL$>|5gI1 z;SKYi&W)CLb^hwU5z!cw>TJegOG7Hzhe<<&S@cy|3mSfNF1T!lVpz=Hus-BMD=@)6(yjiX`ddQwz2xJXAWV8~ z#@q1O_V?DcSKigcV%Y|X;O4hAtRIZ0OSzIA!!_qPtydGLqdoOx^Tof}xyde5OLU%~ zWH?L=OdAe{5NZc%{}3i-wMUkE|1|U|4BdiD2x<=U4ir>fskFR&LpxB$=7n*Ji&VNX zL9DI|lodpM)54jlC#)7dRW+!lB}3_MXVtoP?h~%`da(S%)*kuGn>sH4nuk~Z>60#v zdA^1CeSk+Yez?(x)$5TD9*EYBSvTX1+s7g*CULD4eRmFz#`Q*ac*4DDX`Wckvj^W< zh5WQXeY>z=t@Y*r?giQPB4$6qNLRBCz;hy1z99=eymDtZX} zHblq;c}5X|PX##wB^I7ISpI#WTQ&T!W6TaAzN81OZ+yHZ^yi{xVJT^#82Izv?jR#8 z$xd4s=_(f=17wW=S5KKr|AmS#z^ijSh zF?hbA2CqJKq3d-07{Lj2H5qWfa$oHeov55|3uNXZqy0{4}YBfr(M z=pvISgMu9&Xk$Ulriyx!q)bD|BGtUyaoj^ZW}FV`%*@Dkcg_M|2R#aTAipLpUsJ zh)!QrTtAS4a5(EQ8;G?+n{`FXot4@VkV>k84nSu-DXLM>G*+dZya?AqDL(LX)8cWR zA8INXEHE%{5kOp0VCx+`Y$Hr+nt(BalfE|Vs^v6aCq0tuFI4=xk6Ji*uV|>@9ts;F ziE8@*nI8lZ`InzhP;CrNUBU~51np{j$9Wgh&EApx;M3d8B-E={Jk;zP*LsNcu2FX2 zj-59kSk3E6t837=p4cASSX?x2WoY+^=hiZo$H}=j3n0%^9qJaA7p!FMsMMJ6vs}$~ zm9DO@`bkXoOY5d7Xp>|s1Z5kcK87fdwX~g!tzfjzgKgwBORA484GwK7Q235jekVl;8Oc{QN&x`GX zm%EEB9?>Sd@h6E2zGPZ)S)f%Mx4cy?|Kdg716}h6tjyGVYb8<%+xIsPew2{Wj zY+*++NV*ky638wqwDS44>iwVYO|l*{LXY67;gpBa?Kp?xZZhdX+J1;2#zqvM@(t^J z(0O9h=fWDawD{KECse1yi`UP>gKuc>P)fSe0OsJ<=uQI@Y3o~^e}5rE#`hdbjl|4{ zSg}KhLc{o7hG_LK`V%~7!&fUdo~POdSR}DAS3yG_w|(5YRmH51Vwhedzj_Tccrvd= z8x?m>hjaKgC33AAjYoXNbJUvTpI)-t^vwebdkDR5BE~;(P8uyOxqeSygF*5>)%U9) zEKByO;y4^tmQXn{P5S$$L|bhhU%PU74Z448WIMqamzsrH-)7Wws0^}p)Fceg5x!E8 zRzo7RyTx|6(55U z=#K{2a$EdrMraF94~02uSo4nj%83dVsA4O<$U)+~c0(!+&k8E*{_-^@l@Ho>L3i(M zY|tpv{x#4q6j#eC#k;~1-U`rk$QJ9a778!zll}% zqdPh=3u=pDZI%~!9^D5N{)~3f4dQE76 z99>OqIgvO_>ESyuH8UuimV#XaM$~+bQqt^WY~h^ zi)S3essRRRlN;F&!lCB>p52o7gHPwoUXu;@0xMKAgex%M~O!vlv)bXx4=3C{Xu%;(mdOPd|5$jPh9iH`_fE$8Pj_DuQW|XT!?p%r-(y$Wwg>%juzXNp@TG-}w zNUr$LLu|i86K?%2BnveAzJhg0b$KPb^q|&;7D0Y%`p zWOg{#xS=$bm>@MofGupqf7y(krO-f%$ryU`%#Y2Nr~VC(T0zm<96`*!gb%V*;j);1 z?&A|xLv=CZHcFUGVUZ@z;<_m&9CYJgK5>f3Pmn-MP$iyVs+(G5s)Sw~APHk7AaI#> zv_bZFooVah++a+Khc_OB;qW`GObvg3eXr%Ix~d(G`d z9{jtU({7Zf?Tnr`9cWbq@(wHuvoeT!N#4kk28Ek#W2Z0^hUqb#qvRxY;yF*UYw|ji znc7Y7FqH;NbubHeLTENj?;~J@5DEZ8JX)fLZ7C}!YxlP63XhDz3f_yHi|U;4kSwLE z&vqPUmaOGvXDcKx8Ri!g>>C1Xx|wGzf3s0w7(9df+{Y%LVw83uaTE4AYNS9-D89C) zEY38Rc9B1ro97~=Ue&$RQ>3@>zjMx9(GNdQ?___xaEJ5Hq=SG-mjV4kwn!GfpCqtL zg=ylYgUnLKD#){axbJ9TNX^TGP+3Tf#8Cl>3^Ex0PZ0zY#DkvNvHNV&z-qksjlap) zgl=|Q@KbP1Y*R@P%zX=Uz3cOr+N6y?N#?Xnzk-CLn|#4*+FXmy3=eY)B-D#BKn>m5 zCGHKbk(k|+>q;5FS!0#+i^3WJ<#ac-;!{BKC1l8I{458cE_rP{58@ygbs1V~Q5uX> z4Nt_Z`FiZy2dSH4WnWw^loAGQY(e0fnw2r%iF zgwG*IE_T-|o@xb_ZKoZa-EpX2IlULpd**yZSsa^W#2MeDQcw!NJ4$ zJiC~G0?gRTC1&`>#1I^Oj;|eKUu;fDz5mt2u?qj&T)jxGGZ$*Wbt+v`#h{g4hDM8n zM2qfR?$rf_Tv~vZtCs{OPenUHdo_*pV9w0jSPbH79Xubd9Q|q8M}i0s^u(BqDvtw; z5!zv{C;c(?*&V(%0+TOMu*a_zi0%9`fW>xB%4PAHJznq5ymA{nwp>4sn@=-64c?Bb zsD~<3pfsNVw#sq6pyxoyf$DG0yF5i$E?E*RCz9`GJ8F`-FfU>}Md{K9&{?AteBsPn zEcG{=?x}M{J3tp4*20%IP6*Lj?OWv_yC(B6^C8hZOVv_WMPW~%z?*?Ff~!pB zU8a+Yti*}G))_Ks51U3yik+$Qxrb9%-kE_hz*PnJ2TlV!V?vY3b@U~ZuSq4Y(56qa z==uBFN$%Hg&wyIyXkxstz`i@dj)Tu?l@VIe3oKT$#{LbkPK25te$_)SAP&c)^qw4r z5E)*=k;OwoV`djO@8-Q@Sn7Q4Fi-4G*L!L<5OVbfr{Ov6SxI>llchX1jXKeojnUZ7 z>d|;1lJMB^X3F<_IhV0_!JY2n0%az?BqkG*_f)DStdOQm6`p6(I{GP?S;_aHq(hp& zV%xVzv!S=P6Ea!p6r>vGH(K`taZcwg%15o4jgV(>u%lg%g=4u>CK4?UG%R=Y zPnsmNwBEKa`RP)Q$ySZI=x_`3rN&l$Qnb=v!#wjAic^ezels0+lpc5{pQic~XSeee zRD9dQ{l-d=Q#mkE9udX7(qxFls|77@HtMhZ_JiM3%^CwnYc@h>Z;SQKh}QYbD%4H}PRC@GHs*Er+WQvfD&bxerNC{*J`Yz$+X-GlS%PLvt+g$-Vu~F+4k4g ziJB}N%Vu~_;v)&d5F!eJo*3LOXkHZa#-*)n zTbhONzFe*nZW522E>Y%UC@2$7ir$Dx$dC&x;*K?!w1?eGXT;sq{cBoOTjS@?lz%aUxc~Fkp{(()|XrvJI<}LoYdZG4ogjRF7yAoU%KUvOh5{7 ztwG=RAqS_`>2VYqmDT>V{h@>bZPHDKsh_>g4tYFWVqJ3Ub4>y-+>9yrlhXA4$(U$T zb&yVV_|~gx%?m(D?_TX3jGNjw9W6U|mWOcmcxrba^X`$Ta{^Kqx?5qK3vj)s z8dqGLG806xa!>Eus|B`EZ+i0Qmid6WhL|&uUo<9n)xG>yV>Wm1WP7`7?=)8{mDP5} zWQSi~{Q=hyHlvJh{t!*VJZe|%_Ps_lL3P>6$($x_bCX>*_TRCm*L@dC#SqcN=5$A4 zqDb(7zB49K8-Rf4Vk;i7&D|P_fHnm{SbmoJBM>ETy-Z_dBfH~R3O?o(Dg1S6F*mj> zz;jgTH4{5SgXnM`m!afNF}m>A`*SYvH7Kx9wJUPVHT|yb{by<5lXWWmi*^|H6I!Yb zTxe)<#Mw7tPXQp-Uq4i@Zo;PQ=FXiqO@D@DSozS>M9j3IqjkJn9NmfHcIR&5w(v!x z(0*A-jvQ|Ubm9w_n2-H^*(CBwUdOr39M(G99`y9pR+%z|JY+seUrJ;EHPo2za+;4Z z;$oKpcE4ZICI)>t?VcM7d7%Dv&Y_TD_u3i?A6aNrlR+R)hTz3@Xd8Opn%dn!-iuQY zyk56V+}}&K>x3K?|3B$Xh-sQ<-2+EXstOM)wXI9#dgP^yMXWenrbTP8hPL3p$Ym2` zY7Z@~{L`iMtNUN+%;+Z-q=ld$qB-CPt>}wt;+tTtvzaN;$u)L=XQ=(P5gqrE8kH)w zmfr)(wP#_RBfvV2;qomUeDMW!KDG!!Of)*oVI1L@$hM_NFKR135Kwd`{|0cJrd%c) z;~O`L4MtmxW3-$e@{Ikm2Q^kqnlQ0ZRm#&tTp5$(y_mnwpeL*hC$g&Wc_pDD#o0MB zZ)SXVU@m2GF$m&rm?E6C?duPF6RBH@bG@cZNS4x;Imf5>_bVJue@lR$u0P0l{p9tTq;hElsATpxCAP>^`~n8B?CS8Qv2c zPg7&YqwKXMF6TCkK;5I@=iW(J3ryl(I#1wTJ`!~m0Yc-xDG#8N* z)#CC>>1oE%#MR(exI0LeAZ6oQEXx6#bl%+=gdBU)e<-m zn{isu@X}w1?0l8m*oh12+1N|U-cjQI@{8H<8CZi7Vy0craQ)>bkWfrJC&?FyX#Z)^ zB?rIScWT3cyB?)evQpRW^IIj5s@N$ml^5L#iQgFv3YH=8>yNQuvVK8&b9$WcY`3KG zqubm3G5x+nf0_CziSc!gK)XY)O-F+cWu+CskQh!3t4~Z9^{J68R(v~uw@ZT!TSn(d zYYaNsWv3o>ogq8;!~Xpl=5uIM0$G6MzA$SW!3S3#lBgp}DXdJ|X&UL8{u^G}XoI9p z)5baqHmtS#&uFqG_~PoLw=Wy!HF@NE*Mzj(z?imYI5!Ed5)nySQwMYv+)G+;zTmgvm>w0IGU72nFAZM@PU5khG3fdw@EBp%=}HyKh| zN@_WN%eM;9HrQYmkIUGT*k#B|CcS0};a-az48PHcSJo<38${Ak3TaDcEk5@D+za+x zDA*F5npsRHLJuVPV;7W{=ahqfw!}eNttY0ZZELVweJ`FZoXLyr*6TU zh&xbGoc$Pd^MY;Y+=i=X05^&mOrnRiwn-SaCLVV!!IXf_FHGgx>t7X5a3>Fwk}Fke zEI8ZG_A5-?C&kFE$eVLR4f?^M&ZxF9aO7yBT#ghYddMX#kLK9WI1E{-QCj!)ik)em z_j9YzLw46|Fjn+Ox#V)xD~ounTJ2ZOqIv6B!QSx(j$xr}6BT@U`!z`m>)Zay<@dyP zGKGEa_rcWt>bFvd*LPNzlZruKO#*vkbAlEwUk$zQ>gsz07=A5}*=cYcgOgY|?Moi6 zL&AIh>esZ4ej}F2_waw|sLsiWZS@ICHQeO8%V)$8CK_pKolt2i27cUEu%yyflEmH? zRifK5tnc&c`zZNmM|e@*qUBz=NkGKJEvdUtW0tLM-Cu%`U{Yxo~Btibxt~VB&-CP~}A_^yZp1 zVKYVlZK-7^JEoCd=Y-0>4@;(ch~mj^>q*z$t-bnf@P_H+3{F0xL=px#8~praN)r6C zRS@B6@s>1fN%lvPz0iG!6F(mJaf>)hGF5=b`# z%fdr;f=uAhzI_PJb;$8Ug_>+}Ffju)hpLqwIr^@dOzeC`omSgtLUD8@L_z9oQhvV+ zIo?qDg?d|L<5cxQEsG6u-h7L&Lh%}I%NlP-mS5$z&B~oJSfF33(HJz-aQp*{1Lh7+>=iV5xppkaosk;GWGhWKZKE^%Az_Ngj!;`_;TCKK}}?F8~{(Y)bVk5kVp#OEm%AGj&68+ zJ*y0?bBMiww-b=yN0JP|QrQ z)SPGD6ay1)NW765w5Qn&%h++l$bjrWA$z`GXxeKAV)mgsCy7II4;; zl#>V%U)?Am{iG5zyBA9BeDZ_4m9TU}5g`Tgp=&auKw4l&IiIK%CbouCr580KVjR|P zeV8>gn#Pre!m|{#m6uFS`nOdoIv6Hx&yk!YQCCTOuSH^NYPcpfqR*|=o_H43Xv%x^ zss#R~9FCD0C8x|63gjF-hwpoLM!%tIY4n(O&9UDZ|AGE&xo;kl;uZ~(g~=zi3mqWo zl7&gUnM}$&1DtztK`?uY-*$)V^tiJbAXoVlEkQ@wIHG`#f?v)?4uVW9k1a;2CGIc$ z)FZDZy0R9G9+OTqEQ)P;wwX2Z)>Lq6`dPD~QZR1gO9>!02{~Mus={1k`Njd_45gny zskbgto1QJ`6S0V_(Dio;_3b=j-C|p& z3`*yHi#8dRWawkS18c9HkfLh&%>>ik3{GWw6nHPHUe(=vP28xXh$@kt?beI>6usHG zd3n;KXC4xCLsSoYwujL@BL!lA@6J;R*r~#Kmv%xbaY3LWnJUaDa-#a*zy8Z0d$7uu zDVJ*36`|RSLoB@&4|OhC`drt?@cf(^4GQ!0s8y>#ft|4gu6e!t-o+>P&__uY4nqsP zeu4V8W)GN3?ZyivsDiV+0q|&(SINhe|@dm z94P3sxdvxxD70i=2B>~*=8M8#CT}~VEkqu^fN51!& z?M$7dOHIm6_%$4UN5r=cJD$7#1(t9@VRdJYG}4L&fYO%}j}P2gwQv%VcG&`w!i*W6 z%q~fUITk*4say9Uf(zXh@pLJKnOLE1>kQAjeyxP~nxWDSn`YMCqnHerlMzx8okfXh zGGT!!&%K&ou`7RaSx-j%gRGxMiUiXOBK^T#0~5JY!mIe(9a#`}808xP;vG0&*riqY z%-UDSOktndIjdemJE8JmE6&h$Q*9O%>-HCCY9NOyWavtPlderkVZpJGJ@MrQ@jI1Z z_~C^s3X>h5d_TBoDDCg+fIHeAF&qyk%)(t1L~@)e)uT>8i)8e^Sv`hhtfCbD4rcuE zzy{)yZ1YPdVp2s_RTfV8Ck}a!0ui}012^CKJqp^jnYH9~!^-IoAf@V7D|H=hBj6=SYVc-V2ns*@=gXxEATpT{ z3|}|o{(6;4-irbdVptIa=JoAayGj#q!tB}!D2UtqrA?rGwBQzTcB?4H;=PLM3nfqR z7*LCf@Jea0*wvHout=#-!FJ-$Db`nOqYXPa3)L_pYdVAq`oWh)<}@avs{l8v^?S5b zovlkt_uPVrtYjP`?Gu*4G|j{R+J6%e)P zWl#}e-M-h3Gy*WnS^4Il@ed;I&3~WD+uURel_*~?_u%==cn5#nH}y{ z#4!HGCmf>2Bl=|0q=UXln3WP=?o8#8l zR;B7MB!uE)mfZuXOj!S*xaF*%!$lo4lp&Sg9@g7F+imE+7m&tHUffeoTlS)au&ux1 zg5mKY*!M@_dU<6!;Z}q;^im7Z>K|{vzgw+4&&DiRs%hSs<|lBYyVEw#1;RQ*uGHlN z61^Y?HOFA1ijH4MnfP!L(T6Bc)6U|{{*5F?z*~5n_lr)^sm-(Tr$CCqKjSf(H0HW7 zeIv~a3D4DH=$fQuBIY6oH$7oeff(Mh5!IDwOPT-)=!yghi+=nvbX6jZJ{LiF13kQa zJm2af(5HWq(RM17D>?o$xKhbsS5;|tQa%g}rg8S{FpuM?!wP5Y_9EWacI%xT3kQVq zOHa>MCx=SsqFS^B?3ycHTpV0ja#(({H}|9pjVhSza`>X zH7aXu1=&NR$TW`?d3tB)z#soj;pZ~vb6!UD*|s4mRg@Q@9~DV^HVx<8)SmmALv)Z2 zXK<}_DMYB@K?9lk{B6L+vSeuk&~t<9sIh!fMf>=^jgxigiKolpHs@P$>o>I+%b1s< zD)Gc0>4FpQ-JsJhUd0Hx{R(xdqMYeYMX*lV;7g0d~IS@aTLHC%N=)t z?*uqcj(_u<q!h(mIZ5jW69&Mvz~;5MxMO8AQ&26lQY1@K&7Op}z zv&?665zZii`HVgonPsJ(flf`gL|+tMHfR3r_-EIn7SVCEpalhxZl&JSOW3rH(=(9aQyTcOhIvR&n|JXfsb6xoK%;jqxz^;=0?U8zE3z` zqb8Cwsf+IC3M!>PDU>L7q6h%b-fu*JCVa()c#P&ZhChc1cwSsShT(+6cXPJ*+qpcd zMUSXFnMm%VLPm*j2i|nG$yg&cz3WBUi}KaVtX4dsH9z1LQltmZPIC7vGuB-BnEFnOq50{^J)E0JHJN0vu%WQ`IMKcnqTX%wDBm3 zUDSdk zn{^&C!MHtX)oD`URW1NpFn0|rA8z$1hh4Lo*1Px-5B}!SG2h(7@2^8Wc}rUOgTEl@ zi?kr<7jj#>FBB13dLxm=!*1eptw9>4;K}}yRg=Os+U0NRKf4h8Dlp({s*((68Qb3R z@4nFfkB_m2i3wGWhe4ocjUAQ*(T-?-_4ckrHOlm)vsGV{?wEb?cOJLKJS^YI3%Fw+ zY^c8i6Ow{n3>jf+_GQftk5$)uVR#>tPyBu&VXKgWDLFe~4t z3h&IsGh=#Bp#UMY)|WZ3{c;9FPA(;S*+avVraG>^ZB7>K*Iqa&&)6U%Ir?-GQZGAs zr!9{U#v2)i;oe}3(Q8*Xai+KpMXzMjd5<3g-5{&i78xnX{@v!wBH}&C!6&jLbou^* zJ?YBfBUR02ZbrYI>SX6CtAtGgWq3>T;WIcMdG1lhal?aFjA4-(#pMLA{m>j@R$Y`g zVW|L)@(%Cf3aC1%X9tO=zC8NsMS5-`Tv`(#UO%LOQGZt!>}1|ioB310__>1`V^dg^ zdum7GngVWqm}`*O54@CN5MHL9XyM6kzPU4DQ=0%>gQyhp`J?8mu-u`VeBL4u7);%X zpz(&M{OsnG~=&hc`&#_A=?+m^L{L7VJp}x1&C7o(@aPzd3i@(HDJlzJ zFje^(Ju>M?J6*e^qmzh-nu%0DoA-27ZJ9hJJBF7er3<0$7Eq9;> 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 il><_?fieGo0R{lj8_M}cqZRf50000?if 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 literal 0 HcmV?d00001 diff --git a/skin/frontend/default/iphone/images/custom/bg_logo_retina.png b/skin/frontend/default/iphone/images/custom/bg_logo_retina.png new file mode 100644 index 0000000000000000000000000000000000000000..4d3acdb2f7c3eca4787b88b6a440c078d5318fd2 GIT binary patch literal 5850 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 MqJ~1r6HEX90VCeir~m)} literal 0 HcmV?d00001 diff --git a/skin/frontend/default/iphone/images/fabric.jpg b/skin/frontend/default/iphone/images/fabric.jpg deleted file mode 100644 index afbf8e478d4d15a48870b1e4e30c2af2e26ca349..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 57452 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 diff --git a/skin/frontend/default/iphone/images/flip.png b/skin/frontend/default/iphone/images/flip.png deleted file mode 100644 index bf4d9ab58b0d13524268bf811e99ececc9814617..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3124 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

    Ax!>AP}0 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 N^K|udS?83{1OS%Q<%R$N diff --git a/skin/frontend/default/iphone/images/i_add_to_wishlist.png b/skin/frontend/default/iphone/images/i_add_to_wishlist.png deleted file mode 100644 index 4713a7b1d9b3e54ab3a08f0b264bbf9da48e50a7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1240 zcmeAS@N?(olHy`uVBq!ia0vp^svyk41|*NpQ(y*Ck|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*9U+n3Xa^B1$5BeXNr6bM+EIYV;~{3xK*A7;Nk-3KEmEQ%e+* zQqwc@Y?a>c-mj#PnPRIHZt82`Ti~3Uk?B!Ylp0*+7m{3+ootz+WN)WnQ(*-(AUCxn zQK2F?C$HG5!d3}vt`(3C64qBz04piUwpD^SD#ABF!8yMuRl!uxKsVXI%uvD1M9IxIyg#@@$ndN=gc>^!3Zj z%k|2Q_413-^$jg8E%gnI^o@*kfhu&1EAvVcD|GXUm0>2hq!uR^WfqiV=I1GZOiWD5 zFD$Tv3bSNU;+l1ennz|zM-B0$V)JVzP|XC=H|jx7ncO3BHWAB;NpiyW)Z+ZoqGVvir744~DzI`cN=+=uFAB-e&w+(vKt_H^esM;Afr4|esh*)icxGNo zet9uiy|1s8XI^nhVqS8pr;Du;&;-5A%oHmZa~CsbH$x{!GgA{oLstVQV*^(gGe=8f zS0@(}GdD|^UYGpj(%jU%5}4i;gkEQydO=Acw*Y9fOKMSOS!#+~QGTuh*vnR#xZPrj z(>$o&6x?oc#Hm*w=oo!a#3DsBObD2IKumbD1#;jCKQ#}S+KYh6y74OCJ_ZIxA5Ry@ zkcwMLfByfsKb*kq!_zF#W0iF!Q29`xPK$_vkx|o?Bg`Aw1-b(=?n^7&V?4s$=z39p zlkCx>N2f{&3I^t-rKue}e*Cy!XSZGLuP>jktPEbJ9kwQcxoG+1w<~7Mn89RiZCxqw z`~LoV5msS-e*WE)Cr`HF=JsZE?K3hm3R-f-@Wz=X8onDhZ{Gax@9*iW`j}>VPF&nk z7~ti_rEFAxZjR;u%vrxraH@JaPg}6~-=Ck(n-)HKAz3OCD-#+Qch1AZzp&7-ZPvMS z=l(NG1x=Y{Y$E&h_xJpgg?}TaSPBI-AC-C48sh5O%DihJQ%*xVgu=$(p`e5$LYS;LyOx5SqGTN5Ss@pFw4fr>mdKI;Vst E0F+FvvH$=8 diff --git a/skin/frontend/default/iphone/images/i_arrow.png b/skin/frontend/default/iphone/images/i_arrow.png deleted file mode 100644 index 3e08a331e5e3a2553c01793a36633f80ea63daae..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 240 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz$r9IylHmNblJdl&R0hYC{G?O` z&)mfH)S%SFl*+=BsWw1GlRRA~)xptcKfP#Q);M@HjQ@(f^aRgrZA#Hr@tZ>YZ z6L*>wj#xcEb261vp@D(PkGY54rsK4H{jH9>EFZ*`j%7F8*lrGHDXI!InVYV)-hv3iPV5T!ln|7Ebv{W1|XNc-}xHX%}i)Bf%2?Jx} m)c4NQ|1+})I2_PDz|c44yJOe8U}fi7AzZCsS=07?_nZLn2Bde0{8v^K*7iAWdWaj57fJ{tG z$}cUkRRX#c;)UD-xUqS~&|m@vn0`fKfxe-h0mw@*g}%P{mFDKcRTq~8r6Sym)!^cg z%7Rq=pw#00(xPNw#HA^NtSYc_E=o--$uA1Y&(DE{Vn9ZINq%ugeu08>u&JJ*LU?9g zN`84USiP^Wm1kaYNn&1ds;7&s63_&_%*+%kCj)bHGbbZ+OJ^rDLqk^s3l|e3Cr1ls zBU2*-V-rUwm|mCsATTyALtl;P{bldG)xGXdO%EgvITPB2|qOtnA(eg$(q;jp&tVSV~?kc zV@SoVo+;?dp- zbj3+Z*4z_ymmZPWZ@2v1i_*K*>3+4dtl#hXy!ZLM>T}$|&5l>R7O>?#v_5e#X=175 znZuGL()-ph3EA*I-gU2GU5rc8tZi@R^w_L#JsacVly%|MdrpyvKjj82?jIhXdLYyG z@aCiS&808Sgf-{RXi-0H{WVH>wZ}c5&-Z^Z#Vus+>iI5ofz7;1XSKtEi8y_TWAzl7@n*eYHCVC#o9pOWCRt{ojJ2^Htvwkn%&8m0XHn0r3v*xXJ<~5A(=Vj z%t>~#_+X4zygUUe*s2i`G$QFk3!w?^Ln&!|6TIR>DA`t8sr3p0LC?f&>_fK$Gv~th zegEZrXHKL$c2!r^RWS@xt+Y!SIs*Uwppt&wLg57+J|%74q!ag$yy_sPRmV956jSX* z8KmmN`+r5v46}+gvfZRRwOiD%$*Deu^Gutv8Kybz*{ar$2*{yc!-}y_e)y3Eh8|

    D=GuS+E2l{W11k zQr)RENMZ+pMh*rw7!g1u%n4x_4M#r*At*pz2=TBfC_u5XNrVDeepnjK(R;*}q> zxSmaZC|gWANF~_GVmwglV!96#?Dk#oHH!!?#|w z?l~4&9EUI7JYq(w>f2|(tsmL7TH3k#bu}1;$Nw4IkeSPg(`)a4^Zfb5U(?MmIc4_h z*7GoSVCbUw`{Lk*D=jx0hG#zeJHAj+^K4;Yi(LF_??LzH?Bd4xb>rJE1g@Vs+t5|< zMe@bAeN}-xniHFwkjzm}V!7PwM0HalPi3bMnJK>#kfn uGIsX6$%A}OnOb)`zPYxhV!UF8S;g$DSI%F)c67r311N1B(v8HvLvI1jhk3&Q diff --git a/skin/frontend/default/iphone/images/i_cart.png b/skin/frontend/default/iphone/images/i_cart.png new file mode 100644 index 0000000000000000000000000000000000000000..c6e08527ab47b769604c3f241fcf8770d0cdd458 GIT binary patch literal 1604 zcmaJ>drT8|94|$AMJH~66J?$!IzecAebR=4rKPmQBD6JhZPb_;Mz7D^=|Ik7Gw-XI?@;=3-_dp@x&#p6}D0!zm&S`$nX=&>{ykfPcQSPpCT zdE2kR(Ik>5h$vOKO16Qg!%&LWjiFdkBf%z-qGPQ_tu713fiyS+G4R3B78?j4dOn!S zlF?*FA)JXw@=dTJKS`;}&(d-AU~CK!ZRHUHD2!_XE1GRE^Q?SuN|#6M-PcqQn1bM0 zeDGCLDp@ih#7r>2qR=9BG&TgVnG}dg<1)Ds0G$TWs1Th><3vI<9*e`HLBR9_646Zh zbe>!!o{mMF_+TcE8+lZ!#bTjY7!=HuL4~+nE|o^7(&>=|BGQ~^z_r#$gL&1Af(SP2 zOo$OjFazLL)TUuMI3FZ3eN_T#oRu}0r`tp{jB3>ysSt(cE@=iRll?ywMQ71wTn@j^ z_dkWr$~+@XmBVH%$D|_$m%hp!%E%L%U@eZBlo*yh)5YXW49Cowm=O>vSQH3IMGSh( zVxGdwWIUSili7*&HS$hM;&TN)#6rFQ#*75QEKvgsd5^ z2-D@DumPXp>R)p?b8_8QK#fFX5o|(oVZGRdp}brrPcfy|-+wT@aMB}9w;QbsN=yz#ir1j0 z&lZNFBJ`%{dEccfwJvL!*`c`Gd}nm0^R{_J7gRQIxMygWNCdXI#>Zp53NLs!sfT^U ze7no#8WVrg+&8kgNiA!w`DI&^`01`?G>`BRJZiaOXlN+0@B*;qU}{nO#sw=T1e*Gu zddK*>lz_iGIy#gQLC?r7CkIW`#po}Ql0 zB)guzx$oAkTTezuor>pgoZDfws$O&@Z!hpITJg~7L=faLK9N`OL$LbLNL$UNd4czu zo12y3p-1`qhOe$<1Rt*nFToJRXZ1;VUxHQd~T zdzJMVtGm6ty%~ojMStb*N=Vy6F7FU(G@8Q=4Gl-)Y7cJJXm*gd9x2(ox0}Xfigw#x zHZT|4vt8)g0Qtz1C-`#q?$HxB5VcBm@Pxds=Xy+ZY)D85|3HLC%CnO7U6%qqLa>dK zG3dJqj~_W4dlJ8_@EhVHZ`C;F-?<#pao6uBkMpD(K>E?6{fknIi=+<5Y2Vuq&VNQ; ZKq}R>DKu9c8ux!)8lNQkF7Evg{{cM7bkzU= literal 0 HcmV?d00001 diff --git a/skin/frontend/default/iphone/images/i_cart_retina.png b/skin/frontend/default/iphone/images/i_cart_retina.png new file mode 100644 index 0000000000000000000000000000000000000000..02b9475a900a1f4d2b84f56d671f42585d9b90fc GIT binary patch literal 1686 zcmeAS@N?(olHy`uVBq!ia0vp^dO)nh!3HFy3cGB8lw^r(L`iUdT1k0gQ7VIDN`6wR zf@f}GdTLN=VoGJ<$yA^sW~I!Kh>{3jAFJg2T)jk)8oi3#0-$aN1{?c|g2d$P)DnfH z)bz|eTc!8A_bVx6rr0WloBA5~7C5J7WO`H;r3P2|g(O#HCtIc{+1n}DR9FEG$W1Lt zRH(?!$t$+1uvG$^YXxM3g!Ppaz)DK8ZIvL7itr6kaLzAERWQ{v&`mZlGgL4$(K9qL zur#sMQ7|$vG|)FR(l;>IH8ij?HMcS_RDc2{plwAdX;wilZcw{`JX@uVl9B=|ef{$C za=mh6z5JqdeM3u2OML?)eIp}XpbFjM%Dj@q3f;V7Wta&rsl~}fnFS@8`FRQ;6BCp2 zOG|8(fG&l2A-4c-Y+f-mn1BJMUy)d#Z>VPg@)As;uP=V3xw&xF#U(+h2=`(&xHzP; zAXPsowK%`DC>a=WY04n03ap%qQWHz^i$e1Ab6}wukda@KU!0L&px_*As%NMWo|%`D zUtSDW@9S&jnO9trn3tUD>0+w{G(j&jGsViy($vt&($(19#L&&q(AChw$-vOrz|s)N zb#gW`aD?e~$xklLP0cHT=}kfCHNmMDloWCcfHu3N7G;*DrnnX5=PH1`Y?X=IErvMF zgX&Ge?G_`Pdi8;h(Fa8=QbfaqfT;(>geO}d2cGa#^MI+n2$-zp&G%aYa|@TJi(^Q| ztt&JAJA?vdj^AI?dFod`Um`d6!nwDcqvLjQl%4k0Es3y-ymYlVMci7VVq-9~ce~l% zmi9?Zx)YWhP!)<&oTd;aa;itg*t9gLq<;OfRN?#Yq{~b0)jWL8lRxjX-TV9R|K5}4 z`+HUBMx}wQ)Oy_w&pQlXR?O=!-F^4lgat8r-`SowN2_f2)meXi_ZE2*vATC3E6y3R z^3|8|Yl?Iqt+;mJVuHa6d6qa0k!^~*XNrDM{?Y!}!aQbP!(4^bEw|tDO+Q`A{OOv+ zjOm4a0k1_jD*0$lKDp+c;5^j?r!axTN{x%-)_)I}`ao@Rrtj1T3xXD3Jh4(xX6D(n zI3TZ7;`RP39DOW~70bK|7GIPIQ?<~zpS9I)6AN$gdvjikOBp8LBbmyr=BoA?UD(+4 zH=*UX)DiF3#ZzX!zMA#bQ2WB}MBSxpd8S^yy4UojhU zsjuoW=X#vH^9lE%LUnu3I-iwPbe-&yR;G7$qULs|h0%{s9TF9+p3Nsye@E$ONMYb4QJJdGx-0io*wi&vDGPSGhgTe~DWM4f DX8nu( literal 0 HcmV?d00001 diff --git a/skin/frontend/default/iphone/images/i_dropdown.png b/skin/frontend/default/iphone/images/i_dropdown.png index 7298fc9a696b43819a3411220564fe49601188e4..27ba94c73e40f3ccb4105caaa902057cc8e505db 100644 GIT binary patch delta 467 zcmdnVag{@{Gr-TCmrII^fq{Y7)59eQNXr2+KL;C-{Jg7v&PGL5rWi9P12bb&M<;Vj zCv!tXS3^rP6JtkXXH!QL16LOlM@J=virfNUUn`gV@3r6L64^lAI%i@bvs8|3EXFT^fxmzGvxC|Z2^C#M|&OK^s1?| z9NFAh!6vYsaifxH^DOZWd!~&x0{JYD*c8&(l7c7jH(Ic+ddDlUIq>qMtqyOPj-)RT zyT<%6QQ=-1=aDLhKhhnm8!QAm@`J1k8+A&VA6W+MQx)KLdVE#5<96c@{7P zBXdJTR|6*l7iT9YLrV)YBPRnR6H6t9irfNUUn`gV~nrG+@^wC;R7srr_TS;$TzwYks zOg)^RX2@!NI|^jZ(cLA|zUNXI<4=aN_>{`i;B0XU>%D z-~I3J@8t^@dNF>va(cRcqsjzc5k>nqjk8QmP3PO!^CdES#=LUBeEq|T+sX@LWOMy{ mwmog@+3j{#iIagvf?`KM4%?)5;IGkCiCxvX3YS>` diff --git a/skin/frontend/default/iphone/images/i_dropdown_retina.png b/skin/frontend/default/iphone/images/i_dropdown_retina.png new file mode 100644 index 0000000000000000000000000000000000000000..5d0188c2ad4947805dd93a696d8a09b46c319acc GIT binary patch literal 1204 zcmeAS@N?(olHy`uVBq!ia0vp^Hb5-L!3HD?X4LuvDajJoh?3y^w370~qErUQl>DSr z1<%~X^wgl##FWaylc_)*%u1Od5hW46K32*3xq68pHF_1f1wh?E1MMpc5|gu2OB9k) z(=+pImEP~(ucVNfVyhHx>TBRz;GCL~=}}db8eHWUl3bOYY?-2DZ>L~WVFffGH?<^D zp&~aYuh^=>Rtapb6_5=Q)>l#hD=EpgRf0Gw!Z$#{Ilm}X!Bo#cH`&0^~=l4 z^~#O)@{7{-4J|D#^$m>ljf`}GDs+o0^GXscbn}XpVJ5hw7AF^F7L;V>=P7_pOiaoz zEwNPsx)kDt+yc06!V;*iRM zRQ;gT;{4L0WMIUlDTAykuyQU+O)SYT3dzsUfrVl~Mt(_taYlZDf^)E`o}of`W?o8u zc`;bMudkJ7UU5lcUUI6Zi>(sS1ij466e}}RV>4qHb3=1WCv!tXS3^r9XJa=v69X4F zLnCt|Hz$~0m;B_?+|;}hnBEkGUL%}(K}jLE0BEyIYEfocYKmJ?ey#%8%T}2<-D2j3 z(>$o&6x?nxz^PXs=oo!a#3DsBObD2IKumbD1#;jCKQ#}S+KYh6nmfC3HvFZQ+$%DKF%r_m}6Pl}3)0?JdiLO6d z;H#&S+yCYCfB7wS4WDi1uX^#b&*SKRjXiA^hnpVjCkj_g z5s2nW_;`A*m{xUWsi;8YtYuqW^ExJYuCC_Wxm;0u&FV`lzMh+B5tp^0d^^wOODo>3 zN!D>-x7L05 z>e%6g!XoZ!=64%*2y<7n=0)1DT{v|7q2mWtIk0EIUfP{y&dA14Z`rutnmhb2s2uTh L^>bP0l+XkKM(UWX literal 0 HcmV?d00001 diff --git a/skin/frontend/default/iphone/images/i_gallery.png b/skin/frontend/default/iphone/images/i_gallery.png deleted file mode 100644 index e1d0deacf1e75e08b19a66bb82d41980d1ecbd44..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1129 zcmaJ>TWHi+7>-n{TkN8uipe|Q+t4N_Ca0Zg zkySeEF16rO)jo*@sTHk?`r-wB&?*ZeR7IrVgD;BLU5cptw4T&X^}*RdaxQ$|_g~I; z(i?BsSX{KUh+&xG*d`@G$5Q{DQ%Jv~$3X!dmXO*MX~fMWt+|Ma7`O?6n5DI#1k#MI zeSe`!hACjpWQwHJdP&C?r}-EzV>y(~FqPFAN7LI70ZpjIv}N}1Yd2Y78Zx^rtO}|V zMXlzhZWlFnHzf7$HeEE>>MBr~k*I)$hz2rNyX{FCnVr;?=-l7tSuhD9Z8G~MsgxQA zQS2fR=7fMQltWM+;$TP+L*iNx6rjMvATLw|pdf`SBmsh{ho#Y6qghHQbyKnEN@iOL zaU`Bkr_)?|9f#c(9*UyK3qd{@3{XVC>#~WK3D{mqPC-GQ?wSrUu?>7htqFG!nWdS2 zDZz54Wo>V&O|)TrMss+`34TdApsM~q)Uu}09!a3D`F>Z}OLjSkPaqF>xH>(!<`O@Y zBSl@L5$q;0ZqIcw-iitKTCoG7jbRRgZKiGDv^R-YRVikBM6-1iQ)HGZaHeTUP^?p6 zMYudt9u7fROB)V@5f}+ZLp5S;9fUcqg7ppy*(Ap`zH%$_a(ydU4vnlJ*X%?_or^6n zS+Zp2&n1*sZ;ET=&n29f%hP0d|6sp4=-d`{k3XHZEnQ3-AKBFHF17U!r`L4SEAcd@ zM3R~DHv{UASupSSJ3UKOelb_^0+K&fIR{Naxt9$0sLBM$I7pxL|fwb79Yh zIfJ)`ZbZv^*x~W3qg4#E$2_;M?Qo}j`|!*cJCCf(!ot(>vHFqMhtBWEW%tGY`n@B? z)!Ff~Gk1^oT{+OZtZ(or`uCqZ1J5QV-VT0Pv8ccQ;_%%ev*^^|^RBA*S2p+J-8cF_ z{daF+Wa}1m=i}<^^}>nud*&|c+ww(J%L2j9I)Tzv36 p9{6o#yk>?xYyQH>u9JT<1x)GLv6b5&-S>YXOsuv+Iajl{=QH2KdyN19 diff --git a/skin/frontend/default/iphone/images/i_menu.png b/skin/frontend/default/iphone/images/i_menu.png new file mode 100644 index 0000000000000000000000000000000000000000..9263c5fffe53e90f4975e48271cc128d81a9798c GIT binary patch literal 1053 zcmaJ=O=}ZT6df%{trlyceuLvwiiKuA(xfqC(l*IV+Ng;o2{!7clbP3KY-iqd=EY0{ zB32R1MyhUH=*lh%D&npvh*S|b!Gb9E4|JtPx=?q%Nt4utap2AS;GA>Mz3;x;V~LUW zwnJ?MLA1w4g(RN$;nC5$1OGd}-RZ&8K_q5S3QnS;WC9|jz$_qRnv?@cAStsmA3%U0 zS|~N0L7DhjUWOViIT+g349q5oz>sZ7@)SU17UWbtNUgtoO_8b+q{h8*Hf}^fUL7r& zAXQ4F<+{d04;4-$%Mxj%7GE!}?qt%X@u1%aOH@!qH4+l1~cJS}eQ^Qh9_7o?(i` zB3 zrXifJS8*&45w!BqAR{R+&5`4(uE3&I#mD1(Ot+Av%OEBMDXc)Ns={+(Sd4I@$LHZ9 z94B&Nk2@5OMo;>DA{S*NY@I7Wxu5|Z)w#+R*V~lqw1Q^f$O16cD?o{wP$R1;^J;T1 z?xuP*uF~8~e^V}l%`ncz{&msyBiudCveCA9(`bC4<8C)`Tj%rn3VssvF(H(;S3lid z*?D8QLnzYGmJplySeVJYy?SBf^6A5i;b7P5T1Xeql;N!x9q35!i>q=_+MyE~-|?9Q?~(89&y z!KjJRBL@#0Jb3cr!GlpT=>a_%j%qyc4;Z2cO`70rX^RKzCbRP+@4fGR-+c2RJu}(g zJJ?H6RDWtp&XD;e8Qncy7*a3Y6iQ301!2U1ZTH^F_RbOBE0LLlH zM;qB3&MDK9hD=8FFihFB37ewEC(5>}EkO+OaKW%5^!L~AXkh3OdM>1JiXDeVV`{^J zvl}y6ZDUCjb$a4D7%xjiz=T)@WpmkbrE-L>>q=zp9kVp3L-10BJ~EY4(jbl;2to`O z(6|vEj071z$caJm8W1?1V|jt)!U3L>LSc#HLF1!IG)FH;89CXAMRpOoh_NlPY^hXY zO2Z6t7Fb>sMV1p-K?o2;z+JbnS`Jw5P*XvMuI3mvHjo88MKzCBafBvLk5Vx0maOGA z%0vprmQ|bO8O}?o2~?E-Lrt@Vc5wzC`~9b|n_agdn}IG`bu@Bug&{ALEyW$EV&r5I zT5eV`T|^kUMP!5cY>45(oMGvxg~O7ZMiHl!+IC{*F`svNcVWlR@;(ItMQ>ly4@jd{rG3?3waWilpM{LKj&+Q zhj-5Sd~x8P>^vCgn%+58eYyEd^ra7KhkkqT{^iZBjuSsR4%VL6tS8iYKYOqDX>@PL zR~_5lAKTozSm?a!XXU;5zUr;*+J*F^zTKNb=Sp|>{f$clzvmave)_swd8VG;UDU

    DSr z1<%~X^wgl##FWaylc_cg49rTIArU1JzCKpT`MG+DAT@dwxdlMo3=B5*6$OdO*{LN8 zNvY|XdA3ULckfqH$V{%1*XSQL?vFu&J;D8jzb> zlBiITo0C^;Rbi_HHrEQs1_|pcDS(xfWZNo192Makpx~Tel&WB=XP}#GU}mUbW};_k zVqj@vsiRh+i#(Mch>H3D2mX`VkM*2oZxQ#zd*q`*i_F@Av`lL zCBM8Ftlrnx$}_LHBrz{J)zigR321^|W@d_&qouQxld-v(rIC}Pp`ojRg{z67rJ;*~ zv9Y7Mld+2*(J3ovn(~mttdZN0qkX~Ox$iU z!D${;ZwhX=nBvr{4|I$^C}NQ!8YToxJs>7L*#bH6grAxROzlO$WZmpvHVK#|zI(bj zhE&{2`t$$4J+o>9XUB8qkLDWtSdVOSIKy=$hsD6!Lza8O4~8S}8)ry%gf>=~3)Hts z`JMPQnMXmN!O&iSoB89)|4SN`4WjLsK1M6VIVB1FaVdZ1rtr_JiSf+~HXD{lwki@E zIKj&a!#zkN#hn5y5+8f5QwxPdSn3_Qnds8SO_|`vRo>k|!QM za3f{`{5?R5`WSVAvJ5u#>fx+QhW-% z-!J@SG1|b}!OygjiLZV$)5ju(dmKmRyqM(UP$MSQanFKh0`nvL0MkbdjBE^+UM304 So~8$YiUm(sKbLh*2~7aI?R=a7 diff --git a/skin/frontend/default/iphone/images/i_menu_retina.png b/skin/frontend/default/iphone/images/i_menu_retina.png new file mode 100644 index 0000000000000000000000000000000000000000..fe77744ba35b0f117012aaff08917da1e561cc84 GIT binary patch literal 1030 zcmaJ=O=#0l9FL5ZIabeZyTt4u=$fy#D-ErqOR}wEYV9g33}IRF+J-H8F?n0lUfc(Q zI@nQ$+fl*O*bbsF#wMPG34$Q%#G8kKB3`}dOV@TDtbv#J{*T}9_y2tNvzf7AcV9O_ z5W)1gl*9XFyvVKq{;xh->cCqsk_%`87EwiY0Flz+3?S2{S^_zs>ebt?L4qJUC?j7$ z1?8HcL6cT}4DFdVW)nnW*t1n_79es4lng6L{n*{7NJCFjlTn3LY!Q@=@tOlBYMH!N zo7LhvHGG9kcmftM0a8iNoU>fPOHy@R0iXSAh9c__G@GPOf+{FkQiKj5qcj`R*ddM_ ziqKqyjYr~xB+qgz!|@Co3vsLvjR`DAHa-e_bM&H+lSUi9u$83B2-yO|R4Ns^5~iV3 zVz_ub&agbg^C64~xm63PUdVC>nhFwdHOH`#0WH#3RA=BkN>Vt|lN3z5C2P5jGU0+T zo@z53&H5=dfr|2fsA;y)F3N$^c>gKv=BqYfa=?Z2j)ogo9PnM)g6IGhK_?I4T(gSV zGDOfVLz@&QqBKWN8kP<#ZXK^ELfUeXYH1)XB`K^x8-_0M;dq4QMLrhcM2?fWR2W+$ z@=#2c!!a?%HMtVh=1pLsCRab@hTC%eQ7~=nSptr+0Q6A@nq)m?!Dt@~+g7i^)!WCy zwdFE67{+hxUyW{F;py>@t+B;MYw&@Er`^G0y-<4k6+ekuT1w@;Pv73}1Q*#J=|=xf zV3qBf^12>QpL>paMv7-I^gn)(`E~Khox9&RH$E1rpZ8wq+t1|A-SzCj^37LUzvcDX z+UMSmZE@h;7kcH*;f8gvywrKLe>8U7ci8zhc(7Jk5d%|KtH*)C^M&ob{>@7tt}mV; W_VnJwE#>8V|7E7-jI=c}z5E9`hD(kB literal 0 HcmV?d00001 diff --git a/skin/frontend/default/iphone/images/i_menu_search.png b/skin/frontend/default/iphone/images/i_menu_search.png deleted file mode 100644 index 64ffaa430213e755d12dadfce5a1bce8e614927b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1602 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 literal 0 HcmV?d00001 diff --git a/skin/frontend/default/iphone/images/i_star.png b/skin/frontend/default/iphone/images/i_star.png index 6998d82b8089f5eaf47199592ffebeec91f96196..1b6389315045410160ba5e6d3c42a5e0200bf084 100644 GIT binary patch delta 1068 zcmbQLu##7?Gr-TCmrII^fq{Y7)59eQNQ(fm5Cn;%{NcqaqP&$wDi2Xec$(f-)H{jQiOb=TZ?>XH`C(Tkws^d z1m?tEJ67jk&ug1L#k8&S(zK|El475iCuh&E^DjF$!SVWym)hP&X3SUGeq3Dm=`4I3;7yarAvyReEDJFze6VuR$1h&UE8D?5gnDAnN@b< zEys*Tqo_Qs_kLY*`X^6DO;2D>wT#g0C}d}l`E@nO&gXyXj)V1=7}styVEP*c7^JK<(fTEz}^i+9&7Uc7nDskX>vv&B`rw*U7| z&srn$!*ou$&(~v0lP11<$=7$iTPbA0V<*E1-f!QrQViud^>le;Ahd^6WnRs!RkNqSD$0kF+|z?z9_(2M<7Z9Te1G-|PX;Hx z6MBl1gB9+)eWrH$QCh5Zy+NOz`PYoBH@lB|Tt0qO?Q2=5y_@t#rRBODH{;!k)CApk zq}4hduya~A^{b)Dxdkt@J2ziTKl5u<)QPM0rpt3|C%129cD{R1^V&oKrvFl*#gEdL zoO_V^^HE<5hoIIAo~K$fpVvH_X|smiW$(Nr*_U6hb^GqJ%YP)bvLi+nA^N{(GHD|b~@`;b8Bo~y<@{Et69zt&%~8W^EAWES1YD( zoirnF_ar9!i6+x+cXB7)y&w@cP4dbI-4oAk??1~uG^v&A-8PB6Yg_iL=h)k+yXmLy a0fwhBYrVKW%k=^a00vK2KbLh*2~7YKUDCDy delta 3499 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 eM)%pZ4k}OSQ1j4tX~ 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 P|5--*m-Q-iuSER^p5<0S diff --git a/skin/frontend/default/iphone/images/i_star_blank.png b/skin/frontend/default/iphone/images/i_star_blank.png new file mode 100644 index 0000000000000000000000000000000000000000..44ada0fad1b6ae7d902cf957f870a3b6c249f9a9 GIT binary patch literal 1905 zcmeAS@N?(olHy`uVBq!ia0vp^B0wy}!3HFwFZ>e#Qj#UE5hcO-X(i=}MX3yqDfvmM z3ZA)%>8U}fi7AzZCsS=07?_nZLn2Bde0{8v^K*7iAWdWaj57fJ{tG z$}cUkRRX#c;)UD-xUqS~&|m@vn0`fKfxe-h0mw@*g}%P{mFDKcRTq~8r6Sym)!^cg z%7Rq=pw#00(xPNw#HA^NtSYc_E=o--$uA1Y&(DE{Vn9ZINq%ugeu08>u&JJ*LU?9g zN`84USiP^Wm1kaYNn&1ds;7&s63_&_%*+%kXBTs0Lvs@oa|;&(Lqk_XCqqXAH)A6U z3lj@7O9M9xm|mCsATTyNI^3>DC zF{I*FPDpe{OsGig^TPK&X-2}vbN9^Z%=MT(Lo8YK;*})BEcvM42lyS=Ha&8$>k6@V z`QpFoLA$~?=ZzX%PT8yNe=Xz)%01e#R-#9O@%wz^)Mm*!<$7H{_b zUh%iM^taa&&-bipO5oYY-@?nLDB*BF>Wg=gO#;U~_NVfU(Q)ZtG;W=pzW0FJ>Vu8n z>vpkqvSsE@N-%Y3_lulvFh5Ro;%&9(TJjenz49}eUM>>;W3cVg{Ok5#+^&Ay81nVO zPp)-A0jK!CZ=Lo1yZT|xq^kBb4GZU!-!^!Z^(JUDyj~y`pvl!$mlSmO@>TO4%W^Y# zIA6Xii;<67KlM(+|FlEW;w2J0yS)3jI1k^ReP@g8#fP;ox}>W+WKM_MSj_96eOPb- z+m67}KCM2dn;$o9v)!kC$C{_?wL#F`*x9G1-JYzw+c8q=?<=LnYW3$H=sf(r@9}Oi z#h`Z#>!2u98$&> zKJCiK`RS+Cnc5~j{Mw;e*K_LC?oJ75j`ubk_a?P$lC4_A%jL=8`g7~;zMpJ#O8vyG!F63( zU~L!Yjm^O)>P+&M)?5GGrmAGEQ6Ic%p}&b3*Olt}=earo-!CV&Z!fVt|84iTxsF#Y zefb^-%;Wkr`|Q)Tn=`*gO%Bv7JHm6sNv18~`fZQ6Q#XH<_8n5p=T%tPCh%HPXz%Qm zw|L&Yc^|N}K9Q%VQT^J1nA&I?I9|>}7Ai3oER6L#kAK z^8J55SP`(1FXUWJ+nn+VJQAC3 z`3CQfyYcGU3FU`Z+(h=*akq9RPZ!s%zcb;H*ViZQ@2y{cj-HiQ&vAF|+uQ%nq)$qj zx03z!HG?IQtGD~>J0~vC7Q7u}TP$;P=jnK>Gd2$l&a_y#pEE1h@vSRgk^Jz`!EGxF zy}cuH^ds&CUNpFTXUUJPuYT*?)RFJyI%@PeJpOD%k$iehTdaD2&`JKi6XwmYkEsgV zw)SR4m$0>LRxERytGDj`+9~@}uFTN8nYEnhf1Bag{|D9Oy+8VQZ?h5?%F&UW+SBky cI`^M&0)zgC-I;A!vfx_K)78&qol`;+0LTLX82|tP literal 0 HcmV?d00001 diff --git a/skin/frontend/default/iphone/images/i_star_blank_retina.png b/skin/frontend/default/iphone/images/i_star_blank_retina.png new file mode 100644 index 0000000000000000000000000000000000000000..00168b0609a7370d34090481d25fc1d160f7f58b GIT binary patch literal 2427 zcmaJ@dpwi-AAe?UDd8ldi=9bH*~Q#8Et`#u=DMPs)NIc*>^?SIgt>;(jc{BNN=_l9 z3td!4A>~J*qe!QVoXq9uCzbe3C!OCPzkbi_^*rCp>-~OzZtp*yG#{_6x;myh008Jx z+{u2b)l&7EYip{$ud(h`s>MX?8YuSXvBVO(5Cn)!UI+-IaOk0+A4q3L3tGX=004!v zX@TNE>NXsM$3f8NF$gJ#uVMqhW@jm%&Ikv^un;hm&BepV8gIa1Y$hHaU`It!`6O^3 z+g&CE{bgP>hAf^?@q{4E4uP^}pzP5wds_tB7KOFNZi3mM&?qF@28nX8Mx$_c4mcDV_Vt0Qq6wKS zoFCckYb@0X58o#i^KnR|L?S^*FbJM76p6-Su}G8+(#FPGg|HSybH#M2HCJT5pg;yi z3?Z8@X7jkPc}02%FH($$t1|t&1P=e3ELZfkO{#_=rF1?LjX=$pv;d@1|38$&`GyvW z{lI_n{hz`jS~MR-`hg-|q>!N+9Lsz@6dy+tf^;!YNaOJ$7P{!Ok0<7d_VM^IlD{1S z4GUm%nLLT;3!X~FQMe*8oy!0zWISA@fMBzkIFh}M1IZRma&RQ0&}dh*Bhkji1&bj% zV(n25B$DF-m&{{CazL(lfy?}dOa3l*-U=MPDl!=qvZFwzn~=wWeJL5o{(dgR@9KT! zGQXdT%Xhg*RWiu=!T#5v7p_$9ncsf1t?Ka2_#jv1cA?7F1JkrD0MHntkcl*DUwZ&M zg0|go3-5$O&>p9t#cKY^h_yPHMZO-MP7&)28D{W_l%qDu`VfVMrmwlD;>U?YGidwe zE*m{*?v`Pxi#mO>oAlJrq7%7dHKQ7sS9#&*`zt$Q%5#Q~kMh(_hbtl5x7Rlx-=X-q6jf(3^vQE^;oQn5rJZ~An!23QcsZ+kUr;$|qHolwUAD7-1231tk3XoE3O(St)@TYwG+RY{>6 z(j5KIy^F7E%kk&8#;?&X94PEI&FFfJO6=PLypn0LtO$-LFFsqcZhw7B!)J!_zV_kAdAg^#DMvU4fxA3m z{Ruh5OJ{9mMIzL#WYYB2gUgURzUJA?iqddBTtovOZWu!K{tFv9q}Mn0m+v z0@WgqzZ0?gSl48VAg0RK)I3e!Z-?`N^NlZN^O#*n4=6i>f4F-6ghRHL58i<=Xyg-^ zP>Wq9Rk*P&t3K8wN`rA-D|2gi^g6GQxGf*KB(kb2`WP6Hbi88D&2Xsui7&fNHqm31 zlC|v=v&oUk3dlI9s4*%oH_7)5r%#kwd7BWHdEX-g<0Zb6ZHgj~r_;K(Lh}jDYBPt8 zL))SFt+wzWXAqbe$C)1j%!o*c{k!g{)Zj41;DoYxrvKO!-a&HZ^o2@U&$arl(ROT; zgYoYck78?66$TjjbITa@mcb+U^{+im-YFYfkNwx;o2B_b3Ws055oOh{xV+!#<#R%I zdFiVH=x;=KH@$>n2S_@Q7EqGoO&tGisXMILGAi-FEsEJxS4c#VGIy&!mzPYR32yG& zS~RpfeciUnTtJX<4pSmDLQSx2vOJSHP-~sQ|l3#Fdr4 zrfD{5b03_Rtl6bEQ8d}qv0D>9D99NEsNZ6 zCyu1=`U8N}am)6PkuZvkgXDd8ank;r7)aTG#3^gM+0c#IG3%w6k$h3>)j3{|s7|I)W0u}m|XKm0y=sy6Ino_#2G(Ev}Yw_P}Em!&eDyknPz+?@X%qPTjIt6cUb{0HW$^H=}? literal 0 HcmV?d00001 diff --git a/skin/frontend/default/iphone/images/i_star_retina.png b/skin/frontend/default/iphone/images/i_star_retina.png new file mode 100644 index 0000000000000000000000000000000000000000..38991f643996ff9d3fc9ddca3cda599b8908c81c GIT binary patch literal 2054 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 TzSkF6e{P{c^F=2EmTmY4C86`f diff --git a/skin/frontend/default/iphone/images/i_view_details.png b/skin/frontend/default/iphone/images/i_view_details.png deleted file mode 100644 index ab4f3745209ff81e404c4fea30cefec634a69d1e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1694 zcmeAS@N?(olHy`uVBq!ia0vp^svyk41|*NpQ(y*Ck|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*9U+n3Xa^B1$5BeXNr6bM+EIYV;~{3xK*A7;Nk-3KEmEQ%e+* zQqwc@Y?a>c-mj#PnPRIHZt82`Ti~3Uk?B!Ylp0*+7m{3+ootz+WN)WnQ(*-(AUCxn zQK2F?C$HG5!d3}vt`(3C64qBz04piUwpD^SD#ABF!8yMuRl!uxKsVXI%uvD1M9IxIyg#@@$ndN=gc>^!3Zj z%k|2Q_413-^$jg8E%gnI^o@*kfhu&1EAvVcD|GXUm0>2hq!uR^WfqiV=I1GZOiWD5 zFD$Tv3bSNU;+l1ennz|zM-B0$V)JVzP|XC=H|jx7ncO3BHWAB;NpiyW)Z+ZoqGVvir744~DzI`cN=+=uFAB-e&w+(vKt_H^esM;Afr4|esh*)icxGNo zet9uiy|1s8XI^nhVqS8pr;Du;&;-5A%oHm(Ll+}w7Xu?lGgA{oLstU}BUf_^7c&bp zCu0{gCo^N1UYGpj(%jU%5}4i;gkEEudO=Acw*Y9fOKMSOS!#+~QGTuh*vnR#xZPra z(>$o&6x?nx#Hm*w=oo!a#3DsBObD2IKumbD1#;jCKQ#}S+KYh6x^`3kLSSwY@^on_KZVoe-FTI@64b}Cr(aQpRXISA>sD-_xDdbHhSv1b9QufojZH>Z0W>F zlO8z-mkD(IZup@yC7dddp2Wet&*{}h%axk&TXg!}mM)euJG*_J z4&8q%D=IAN|NlG7aCp9bz1`>M=jUgwu&T|NHIpyZxZz1d);ZC^qvoygJWx)<;p>x3MTb zGjpZDg$aipoVQ%KbhLe`_w+CZSv%p`acODKzRZ|0!!M!Z!(z)9QWtb?zkBztTx4qS z&!0bq97>Nj)VQWpChV%(QvUwlSBGa>ORD%n zkcw|ig=(E^1p|JD+Ejmg^WG#|RYgth7Q@Pu4ml1748HgwkN#oSyX%1Rq z9geA!xk7&M3Cw4Dbo7AOp~6+$m%GhA3{L7R7Q4xsw#cvwBrwExt^IDdDNhDeV|cpy KxvXl3^w)^1&PVosU-?Y zsp*+{wo31J?^jaDOtDo8H}y5}EpSfF$n>ZxN)4{^3rViZPPR-@vbR&PsjvbXkegbP zs8ErclUHn2VXFi-*9yo63F|8hm3bwJ6}oxF$}kgLQj3#|G7CyF^YauyCMG83 zmzLNn0bL65LT&-v*t}wBFaZNhzap_f-%!s0jxuc7dn~|xp zfwP;VshK5AuSMv>2~2MaLa!T6y`ZF!TL84#CABECEH%ZgC_h&L>}9J=+-`Bk zX&zK>3U0T!;MA)Rbc{YIVv!;mCIn19ASOK70y*%6pPC0u?M1+3z46pVCk6&a2TvEr zkcwM9muxj$6J?Hnd~DHe9m#Vlx?CxUO+Qt^=uVJ}7>}Ep{&pU!Iq(1HKlA?=f2z4(F7j5wl|AOkV}b4) z#Yzuf%{(F)HSrjWSU`KM&)?}8)@L3{T=iHeuzJP8ZTm`Hh1Dmz+RI(+ko2uNsxZ%R z?Wg}jw>Pvg=_E%a&)vXwWMfm*6!y+}limk5O$;#oTGSSOR{PSO`_uhR9?MLX2!ABB zYD1q`&11!wRlFsOIn8$*VP99!YxE_NUH{>c$UVvN+%Xx;c~wf<4P}>F)VQtQ@6LPU zieLGP0OzI+T}CgC27h3llclgyTl1*&F@qNUv)Kn4?`{{5y7+4T^o*3!R72V1)1^h+ s+Jz2tw_1Fhb4PjcyIcQf{}N1K@IT{P8L}p07N~sjboFyt=akR{0FjER(*OVf literal 0 HcmV?d00001 diff --git a/skin/frontend/default/iphone/images/i_zoom_retina.png b/skin/frontend/default/iphone/images/i_zoom_retina.png new file mode 100644 index 0000000000000000000000000000000000000000..3a8572dd95ce82d680b3fa4cd9f107d7523b0248 GIT binary patch literal 1399 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 diff --git a/skin/frontend/default/iphone/images/media/cell_phone_landing_banner1.jpg b/skin/frontend/default/iphone/images/media/cell_phone_landing_banner1.jpg new file mode 100644 index 0000000000000000000000000000000000000000..8c123db9fc9ae06d52e470fa80d6b75be3b994bb GIT binary patch literal 21259 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≶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 literal 0 HcmV?d00001 diff --git a/skin/frontend/default/iphone/images/nav_bg.png b/skin/frontend/default/iphone/images/nav_bg.png deleted file mode 100644 index aee684388218459956669f04a8c45e04fd67e8ee..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 958 zcmaJ=J#5oJ7&Wj|6)D{)2*k-9Scvb=jhontTcvSABh^)uMrzpV*w@5L>@)U-IFS%i zHwN}jY%n1f#Kh16gvx|iS&?95Vx^qZIAtJMI^U1pd*A!M`|fFd_kL#a=As}7ncB9| z;PWLu?k-&B|I*RhUwpd3DlN80582QPiBNKAn}C{Ubx4C)&gkJMQWS(MqT6h-mbs(Z z)RU|PBgJ08*@95qj04N=5eC|%3IrXFq8G8X_C+xSE6tv~ox+M#Cnh{j`epE@d?8(g2kA6bXZU z*LUbJn&3@StN9VLe4Eq^UE~Uq>pGgO7IF$M$wuDT!nlG8<*j_BTq($ve05zhN-5W% z_P`@POS#SkcWo{=X$3Ffkqr{MkBCzZsRt%0Ywmn6Xs+Ir>&*9p=W-!81CxvW>!Q;m z-aW~3*0y{zYkcDKZV!1|zj?8g;ZH)Y8Kq|YwOxq5Uwwb_6@q st^V7eB0Zd+0t+H#p-a0t?189*e&;S4c diff --git a/skin/frontend/default/iphone/images/nextlabel.png b/skin/frontend/default/iphone/images/nextlabel.png deleted file mode 100644 index 6d6a47bb7e841089352cd8a6bba30d7d2f443451..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1374 zcmV-k1)=(hP);5N1jwA6oS27)hom@+7VkR;2M4KcC}J zytugd3J3lYdwn1xCbJ5NP`=K}%GyduNZ`4-xf~wy=SX#RHAf^k_PC3WkN?69*y0`H zT2uiz>3ae!Dk|a#AAgC|*VprihzOpXoP2?6%EaC-W*L7kR0{6?{{GFev9V;#x3{+~ zZrIh;#ogWA`RwehRp6?sDjppj%|k*$e#PE?A{Ig0ie4u;_dD2PXd}U(iSkX zoFg{~l)JgPeJ;W*H{GKI>fqq;$=%(Z9}HPTLxar%M`E$;>})A}Es3Y6Co3r_k)CgF zZ$HByXAx0Jl+XZx{)lwvt*xzA!)ETSEsqx$7rB?07e_sx%Ve@>0W5`B4Sl6hC{_># zn|JkGU}P|t%jKk>Qr?(AHPF{CE-sg9wVI!toYGnwsneB7RAaT0^iS`Bt2Bi1k*`Kg9$o7lmi8&H zgp>cYL1+lNQa)PO@0ppI63Za-Ud%E?9F>)o*XX^(s~`Ql_i_y|fsjaPLV`F0s1Ar0Vwqbty4a+BDir~z=0gEg)V*b(NKGt$_a^9e3HEnHe zY;SLmHX*`&60EPUk2Nxx3~9)o12>re7g%h z5`YhevnQuPD76tUs4vvp*VorSFE8&6h&~7%MoL>mL4R;?us1a|HMg*^u!^N)=z##! zJv9y5oO=ZexeC>YNGOGk)L29fUI?Ibs{7~8y%r~Yao>&tP+^vQ1_7-9uM@tt-!cwn g-@WL!%-;eG04298Loyd$8s@28fQ7Ah+%qrAL4DkvzRs;Vk#Z*Ql;!NF5J z=1F5?<2U?3X}!W1LVtdBetv$L$z*y_TU$%<@$rxfUM860yj%Ipn=vsl&y7YSA$dGrytTDOTCJAW z*VkSCzPGnWcs!+~q>xUho50;#SqW#X3`R1vgOm^pIygAEkPv4C+!3#?t`gq|(pRwd zmP{;%wVd8J0|Ntp<4xn^<6aYbBIU&;6&V>x0RaKuOKX*O*J>0Bg;A|mpM-^l(f0QC zl@Rjc@(K?RCqF;G-?3jW4HTqWrBZnxAY|^95!%mj4g351zrdMWGLwb55wLOuKTvgb z^_3CwIy^jN*Ahba2Ip=|sT8%T3knLF)o3(A=FYFCrlvE5s6U@dh|jQ#@tF>U*po;f z8X7vmKe)1#U&|8bOx)AcF~bhcE) z6iJi^LK~;|&d$!25ic(r2J>eLnS$jFG>{Twdd4=?`c zoV}t>fq1-V0_}|TQgjV(i9IP&LP7!+7Z)Eukt$@Js+<)`2NaZ+mRfUiaxT$ z{r!E)%E}UL5yJm7d(v5v9NG&cLk2BvZEf$^&6n*mHk(a!8CXaS4GlX`qe|Qzb6$HL zT?V*^CcKDQ=#+&YpFa1~ii!#x;`J2^R- zy1TnY8Q5o}+1Xh!Be6`fb)5Or)6-VytqFJJ0AE}*vM8L0Xk}&Pzon%m z8Xg{|=H_Nm3UzgLVo;l!nj-xE|Kj4}-$PRuYAM>V)she;Ku}|7AV^DAs+drexFu00000NkvXXu0mjf D95ptv diff --git a/skin/frontend/default/iphone/images/search_icon.png b/skin/frontend/default/iphone/images/search_icon.png deleted file mode 100644 index 2bc66c97af59e1adfc172af467bbe5a7c3bf347c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1663 zcmaJ?drT8|94~Z&R(WK&@le?1hz=RFy+VN=6eukP#3Djnv4Zw!589R9oxNi%IL074 zAYz7sIHy)rP*Egq+9(kOwv2%&bMjDesKhZQ;@mXO2OI2)!1l-3C3n9^KA+F`^+~QQ zIVsMG<;7w!7)}ZCk`#JfZhIFx&|jm|-70$Vq+-*kR6L6^Ax4xT(%_jWkYGTv(G(QX zJ8-{H*5Hy>?h=?*1h+2)A_(+EKY zU&fUYVpOY(&o`o}`AKqhzFsZRfKib^gc+s<3@C*FWIh1QV}MN&$;5LhAxLNXx CyS9YZK4~-F(U*AVsmXJ%>rez|A!h3b7+!ELI273 zKZQwo9)WUFP!i8Is_DUH`PxDeu-J$q6mFE`c+PAWleIX7lUker#HoBX1SoWv1~-w@ zc$o}Nz(@+g)M$c42+|5{olXNwp&G|QFX z>RbbgQL|jlKV0d&T$>dP1RYs|8g(C{8mSRC0MjMIy7_Yv&#O1X)y$uZWL_?ZPKIL} z?7s#*dqum)ww<#reV8*oiqUR2(zYHxEH7s;?4Kq`L~`@sx$2FjGGys@&jloWpXVv| zFfQ_T=wkXfRCa$;&g($^e0~<`EM0+_KGGwS)y-Q|;x1S4I(Jm;^MyX|;P0+Ne&V^S zdw!p~G1d3gBhJK{?Dzi~`)FdkW$Lc-;YR(Vc>g_5>;qWGik_(!_%TyOOPZN@^y2v9 zcki8dzn*D#qob%r#q_iDjZWWRBXg{52a_GKB6Upxx465_F4%c<7?hrS~RSx59z$NX`yfDpW{!;tVQ~JV0=P=ei7l`kQ)5L zl2>CF;pTZ`*pKl{+Tik|LrGQlL?kr0n6MvrP_(&Za4NNB-C|Y`V}F&)uVc_n$1h?I z6uoU2`_xi*+^V`H&`d4FpzyH;ijnncTkD#0_vx4Ic^KWkLRB^3(w1A%BdV}i$C}2& z4<0{I*yFHWdA8aozv=cyx3{XV2K3`Ks(S25u75+5GRlk(e0#Dty1jJoJKfuwR-G*F zxf9W0J?rYE*}b8V*_vMLy|R3f_k(l;D@_|Q5`HnG*wkh^eXBy@6hqjZxQ<(X+j@!j zGVx3o#j1|84$9Nsd)A*J85*rjtSETQdr`07!N>e#O24di)>keav)kL3?U>$`RT6b7 z@`7@xRXJ30C-l_NhWo^(Rp0x|yxlu{x2-HEm1jH;*{eqmAK#VQ=-G8-vL+*F8!6hE zWVK$fsF_hGSKU8Qaur5)UPgAsZ1PPXI6A>9XsLP(gKK+3N(OGaod3XB*x&uCAok!o zul)7+l_}XyzTWD!g=|Q=@`JnSlipXQ%0}0uzNtg)iTv?euSqlEn)AFxf7;otWJ14J zrHs9OY|`w!B=uu(3@Cv6H&-dJCl@TIpVu|4UU#c&B6CXcM@FN)^O@0mwO?loN9s2p zy*gf&_tNUzzd|^e1$rowE{7`PL gR7TZ}7QW%ZXl`vdciVk?mhG325St`vj8PT;4ZF*Mj{pDw diff --git a/skin/frontend/default/iphone/js/iphone.js b/skin/frontend/default/iphone/js/iphone.js index fd15c7cc48..1adeb1a0cc 100644 --- a/skin/frontend/default/iphone/js/iphone.js +++ b/skin/frontend/default/iphone/js/iphone.js @@ -26,6 +26,15 @@ // Homepage categories and subcategories slider document.observe("dom:loaded", function() { + transEndEventNames = { + 'WebkitTransition' : 'webkitTransitionEnd', + 'MozTransition' : 'transitionend', + 'OTransition' : 'oTransitionEnd', + 'msTransition' : 'MSTransitionEnd', + 'transition' : 'transitionend' + }, + transEndEventName = transEndEventNames[ Modernizr.prefixed('transition') ]; + function handler(position) { var lat = position.coords.latitude, lng = position.coords.longitude; @@ -51,17 +60,102 @@ document.observe("dom:loaded", function() { } - if ( navigator.geolocation ) { - //navigator.geolocation.getCurrentPosition(handler); + var loadMore = Class.create({ + initialize: function (list, href, pattern) { + var that = this; + + this.list = list; + this.list.insert({ after : '

    '}); + this.href = href.readAttribute('href'); + this.button = $('more_button'); + this.holder = new Element('div', { 'class': 'response-holder' }); + + this.button.observe('click', function () { + if ( !that.button.hasClassName('loading') ) { + new Ajax.Request(that.href, { + onCreate: function () { + that.button.addClassName('loading'); + }, + onComplete: function(response) { + if (200 == response.status) { + that.holder.update(response.responseText).select(pattern).each(function(elem) { + that.list.insert({ bottom : elem }); + }); + that.href = that.holder.select('.next-page')[0].readAttribute('href'); + that.button.removeClassName('loading'); + if ( !that.href ) { + that.button.up().remove(); + } + } + + } + }); + } + }); + } + }); + + if ( $$('.c-list')[0] && $$('.next-page')[0] ) { + var loadMoreCategory = new loadMore( + $$('.c-list')[0], + $$('.next-page')[0], + '.c-list > li' + ) + } + + if ( $$('.downloadable-products-history .list')[0] && $$('.next-page')[0] ) { + var loadMoreCategory = new loadMore( + $$('.downloadable-products-history .list')[0], + $$('.next-page')[0], + '.downloadable-products-history .list > li' + ) } + + if ( $$('.review-history .list')[0] && $$('.next-page')[0] ) { + var loadMoreCategory = new loadMore( + $$('.review-history .list')[0], + $$('.next-page')[0], + '.review-history .list > li' + ) + } + + if ( $$('.recent-orders .data-table')[0] && $$('.next-page')[0] ) { + var loadMoreCategory = new loadMore( + $$('.recent-orders .data-table')[0], + $$('.next-page')[0], + '.recent-orders .data-table tbody > tr' + ) + } + + //-----------------------------// - if ( $('giftregistry-table') ) { - $('giftregistry-table').wrap('div', { 'class' : 'giftregistry-table-wrap' }); + $$('label[for]').each(function(label) { + label.observe('click', function() {}); + }); + + $$('input.validate-email').each(function (input) { + input.writeAttribute('type', 'email'); + }); + + $$('.form-list img[src*="calendar.gif"]').each(function (img) { + img.up().insert({ 'top' : img }); + }); + + if ( navigator.geolocation ) { + //navigator.geolocation.getCurrentPosition(handler); } if ( $('my-reviews-table') ) { $('my-reviews-table').wrap('div', { 'class' : 'my-reviews-table-wrap' }); } + + $$('.my-account .dashboard .box-title').each(function (elem) { + elem.observe('click', function (e) { + if ( e.target.hasClassName('box-title') ) { + this.toggleClassName('collapsed').next().toggle(); + } + }).next().hide(); + }); var transformPref = Modernizr.prefixed('transform'); @@ -118,7 +212,7 @@ document.observe("dom:loaded", function() { select_options.down().insert({ bottom : new Element('li', { 'class' : 'select-option', 'data-option-value' : option.value }).update(option.text) }); }); - select_options.insert({ top : new Element('div', { 'class' : 'select-heading' }).update('Choose options...').insert({ top : new Element('span', { 'class' : 'select-close' }).update('x') }) }); + select_options.insert({ top : new Element('div', { 'class' : 'select-heading' }).update('Choose options...').insert({ top : new Element('span', { 'class' : 'select-close' }).update('×') }) }); var closeSelect = function() { select_options.setStyle({ 'visibility' : 'hidden' }); @@ -216,101 +310,6 @@ document.observe("dom:loaded", function() { }); - var groupItems = Class.create({ - initialize: function (handle, removeHandle, photos, form) { - var that = this; - this.handle = handle; - this.removeHandle = removeHandle; - this.photos = this.handle.select(photos); - if ( this.photos.size() < 2 ) { - return - } - if ( !('ongesturestart' in window) && this.photos.size() > 1 ) { - $$('.remove-all-button').each(function(btn) { - btn.setStyle({ 'display' : 'block' }).observe('click', function(e) { - e.preventDefault(); - that.removeAll(); - }); - }); - } - this.form = form; - - this.removeHandle.observe('click', this.removeAll.bind(this)); - this.handle.observe('gesturestart', this.gestureStart.bind(this)); - this.handle.observe('gestureend', this.gestureEnd.bind(this)); - }, - removeAll: function () { - this.handle.select('input[name*=qty]').each(function (input) { - input.writeAttribute('value', 0); - }); - this.form.submit(); - }, - gestureStart: function (e) { - e.preventDefault(); - }, - gestureEnd: function (e) { - if ( e.scale < 1 ) { - this.handle.addClassName('grouped-items'); - this.shuffleImages(); - } - else { - this.handle.removeClassName('grouped-items'); - this.unShuffle(); - } - }, - shuffleImages: function () { - this.photos.each(function (photo, i) { - if ( i % 2 ) { - photo.setStyle({'webkitTransform':'rotate(' + (Math.floor(Math.random()*12) + 6) + 'deg)', 'zIndex' : i }); - } else { - photo.setStyle({'webkitTransform':'rotate(-' + (Math.floor(Math.random()*12) + 6) + 'deg)', 'zIndex' : i }); - } - }, this); - }, - unShuffle: function () { - this.photos.each(function (photo, i) { - photo.setStyle({'webkitTransform':'rotate(0)', 'zIndex' : '0' }); - }); - } - }); - - if ( $$('section .cart-table-wrap')[0] ) { - var cartGroup = new groupItems($$('section .cart-table-wrap')[0], $('remove-all'), '.product-image img', $('shopping-cart-form')); - } - - if ( $$('.cart-table-wrap')[0] ) { - var cartHeaderGroup = new groupItems($$('.cart-table-wrap')[0], $('remove-all'), '.product-image img', $('shopping-cart-form')); - } - - if ( $$('.wishlist-wrap')[0] ) { - var wishlistGroup = new groupItems($$('.wishlist-wrap')[0], $('remove-all-wishlist'), '#wishlist-list li > a', $('wishlist-view-form')); - } - - if ( $$('#remember-me-box a')[0] ) { - $$('#remember-me-box a')[0].observe('click', function(e) { - $('remember-me-popup').setStyle({'top' : e.pointerY() + 'px'}); - }); - } - - // Home Link Actions - - var homeLink = $('home-link'); - - if ( homeLink ) { - if ($$('body')[0].hasClassName('cms-index-index')) { - $('home-link').addClassName('disabled'); - } - - homeLink.observe('click', function (e) { - if ( cartDrag && cartDrag.visible ) { - cartDrag.cartHide(); - } - if (homeLink.hasClassName('disabled')) { - e.preventDefault(); - } - }); - } - //alert(Modernizr.prefixed('transform')); // Home Page Slider @@ -325,14 +324,14 @@ document.observe("dom:loaded", function() { $$("#nav a").each(function(sliderLink) { if (sliderLink.next(0) !== undefined) { - sliderLink.href = "#"; sliderLink.clonedSubmenuList = sliderLink.next(0); sliderLink.observe('click', function(e) { + e.preventDefault(); var transformValue = {} - homeLink.hasClassName('disabled') ? homeLink.removeClassName('disabled') : ''; + //homeLink.hasClassName('disabled') ? homeLink.removeClassName('disabled') : ''; if (last) { diff = e.timeStamp - last @@ -350,6 +349,7 @@ document.observe("dom:loaded", function() { this.clonedSubmenuList.insert({ top: subcategoryHeader }); + subcategoryHeader.insert({ after : new Element('li').update('All Products') }); this.clonedSubmenuList.firstDescendant().firstDescendant().observe('click', function(e) { if (last) { @@ -387,7 +387,6 @@ document.observe("dom:loaded", function() { $("nav-container").setStyle(transformValue); sliderPosition = sliderPosition - document.body.offsetWidth; - e.preventDefault(); }); }; }); @@ -455,43 +454,37 @@ document.observe("dom:loaded", function() { new NoClickDelay(document.getElementById('nav')); } - var supports3d = window.WebKitCSSMatrix ? true : false; - - //alert(Modernizr.csstransforms3d); - //alert(Modernizr.csstransforms); - - //iPhone header menu - $$('dt.dropdown a').each(function (elem) { - elem.observe('click', function(e) { - var parent = elem.up(), transformValue = {}; + + $$('dt.menu a')[0].observe('click', function(e) { + var parent = this.up(), transformValue = {}; if (parent.hasClassName('active')) { parent.removeClassName('active'); - $$('#menu dd').each(function(elem) { - if ( Modernizr.csstransforms3d ) { - transformValue[transformPref] = 'translate3d(0, -100%, -1px)'; - } else if ( Modernizr.csstransforms ) { - transformValue[transformPref] = 'translate3d(0, -100%)'; - transformValue['visibility'] = 'hidden'; - } + if ( Modernizr.csstransforms3d ) { + transformValue[transformPref] = 'translate3d(0, -100%, -1px)'; + } else if ( Modernizr.csstransforms ) { + transformValue[transformPref] = 'translate3d(0, -100%)'; + transformValue['visibility'] = 'hidden'; + } + + $$('.menu-box')[0].setStyle(transformValue); - elem.setStyle(transformValue); - }) } else { - $$('#menu dt').each(function (elem){ - elem.removeClassName('active'); - - if ( Modernizr.csstransforms3d ) { - transformValue[transformPref] = 'translate3d(0, -100%, -1px)'; - } else if ( Modernizr.csstransforms ) { - transformValue[transformPref] = 'translate3d(0, -100%)'; - transformValue['visibility'] = 'hidden'; - } - elem.next('dd').setStyle(transformValue); - }); + this.removeClassName('active'); + + if ( Modernizr.csstransforms3d ) { + transformValue[transformPref] = 'translate3d(0, -100%, -1px)'; + } else if ( Modernizr.csstransforms ) { + transformValue[transformPref] = 'translate3d(0, -100%)'; + transformValue['visibility'] = 'hidden'; + } + + $$('.menu-box')[0].setStyle(transformValue); + parent.addClassName('active'); + if ( Modernizr.csstransforms3d ) { transformValue[transformPref] = 'translate3d(0, 0%, -1px)'; transformValue['visibility'] = 'visible'; @@ -500,48 +493,20 @@ document.observe("dom:loaded", function() { transformValue['visibility'] = 'visible'; } parent.next().setStyle(transformValue); - if ( cartDrag ) { - cartDrag.cartHide(); - } }; e.preventDefault(); }); - }) - - if ( $$('.top-link-cart')[0] ) { - $$('.top-link-cart')[0].observe('click', function (e) { - if ( cartDrag ) { - cartDrag.cartShow(); - $$('#menu dt.menu')[0].removeClassName('active'); - $$('#menu dd.menu-box')[0].setStyle({'webkitTransform' : 'translate3d(0, -100%, -1px)'}) - e.preventDefault(); - } - }); - } if ( $('menu') ) { $('menu').select('dd').each(function (elem) { elem.observe('webkitTransitionEnd', function (e) { if ( !elem.previous().hasClassName('active') ) { elem.setStyle({'visibility' : 'hidden'}); + } else { + elem.setStyle({'top' : '1px'}); } }); }); - - $$('.menu-box')[0].select('a').each(function(elem) { - elem.innerHTML = elem.innerHTML.replace(/\((\d+)\)/, '$1') - }) - - //$$('.top-link-cart')[0].up().remove(); - - var sum = 0; - $$('.menu-box .badge').each(function (badge) { - sum += parseInt(badge.readAttribute('data-value')); - }); - if (sum) { - $$('dt.menu')[0].insert({ bottom : new Element('span', { 'class' : 'badge' }).update(sum) }); - } - } //iPhone header menu switchers @@ -587,9 +552,9 @@ document.observe("dom:loaded", function() { this.itemsWrap = this.items.wrap('div', {'class' : 'carousel-items-wrap'}); this.itemsLength = this.items.childElements().size(); this.counter = this.carousel.insert(new Element('div', {'class' : 'counter'})).select('.counter')[0]; - this.controls = carousel.select('.controls')[0]; - this.prevButton = carousel.select('.prev')[0]; - this.nextButton = carousel.select('.next')[0]; + this.controls = carousel.select('.controls')[0] || this.carousel.insert({ top: new Element('div', { 'class' : 'controls'}) }).select('.controls')[0]; + this.prevButton = carousel.select('.prev')[0] || this.controls.insert({ top: new Element('span', { 'class' : 'prev'}) }).select('.prev')[0].addClassName('disabled'); + this.nextButton = carousel.select('.next')[0] || this.controls.insert({ top: new Element('span', { 'class' : 'next'}) }).select('.next')[0]; this.originalCoord = { x: 0, y: 0 }; this.finalCoord = { x: 0, y: 0 }; @@ -724,8 +689,8 @@ document.observe("dom:loaded", function() { } }); - if ( $$('.carousel')[0] ) { - var upSellCarousel = new Carousel($$('.carousel')[0], $$('.carousel-items')[0], { + if ( $$('.box-up-sell')[0] ) { + var upSellCarousel = new Carousel($$('.box-up-sell')[0], $$('.products-grid')[0], { visibleElements: 2, preventDefaultEvents: true }).init(); @@ -740,8 +705,8 @@ document.observe("dom:loaded", function() { } */ - if ( $$('.product-shop .product-image li').size() > 1 ) { - var productGallery = new Carousel($$('.product-shop .product-image')[0], $$('.product-image ul')[0], { + if ( $$('.product-view .product-image li').size() > 1 ) { + var productGallery = new Carousel($$('.product-view .product-image')[0], $$('.product-image ul')[0], { visibleElements: 1, preventDefaults: false }).init(); @@ -825,239 +790,6 @@ document.observe("dom:loaded", function() { */ - var cartDragClass = Class.create({ - initialize: function (elem, options) { - this.options = Object.extend({ - }, options || {}); - - this.cart = elem; - this.cartHolder = $$('.cart-wrap')[0].addClassName('cart-short'); - this.minHeight = this.cartHolder.getDimensions().height; - this.maxHeight = this.cartHolder.removeClassName('cart-short').getDimensions().height; - this.headerHeight = $$('body > header')[0].getDimensions().height, - this.startMin = this.headerHeight - this.minHeight; - this.startMax = this.headerHeight - this.maxHeight; - this.visible = false; - this.empty = this.cartHolder.hasClassName('cart-empty'); - - this.range = 0; - this.originalCoord = { x: 0, y: 0 }; - this.finalCoord = { x: 0, y: 0 }; - - if ( Modernizr.touch ) { - this.cart.observe('touchstart', this.touchStart.bind(this)); - this.cart.observe('touchmove', this.touchMove.bind(this)); - this.cart.observe('touchend', this.touchEnd.bind(this)); - } else { - this.cart.observe('click', this.toggleView.bind(this)); - } - - this.cartHolder.observe('webkitTransitionEnd', this.transitionEnd.bind(this)); - - if ( supports3d ) { - this.cartHolder.setStyle({'webkitTransform':'translate3d(0,' + this.startMax + 'px, 0)'}); - } else { - this.cartHolder.setStyle({'OTransform':'translate(0,' + this.startMax + 'px)'}); - } - setTimeout(function () { - this.cartHolder.setStyle({'visibility': 'visible'}); - }.bind(this), 100); - - }, - touchStart : function (e) { - e.preventDefault(); - - var transformValue = {}; - - $$('#menu dt.active').each(function(elem) { - elem.removeClassName('active'); - }); - $$('#menu dd').each(function(elem) { - if ( Modernizr.csstransforms3d ) { - transformValue[transformPref] = 'translate3d(0, -100%, -1px)'; - } else if ( Modernizr.csstransforms ) { - transformValue[transformPref] = 'translate3d(0, -100%)'; - transformValue['visibility'] = 'hidden'; - } - elem.setStyle(transformValue); - }); - - this.originalCoord.x = event.targetTouches[0].pageX; - this.originalCoord.y = event.targetTouches[0].pageY; - this.finalCoord.x = 0; - this.finalCoord.y = 0; - }, - touchMove : function (e) { - if ( this.visible ) { - return - } - - var transformValue = {}; - - if ( Math.abs(this.finalCoord.y - this.originalCoord.y) > 1 && this.finalCoord.y - this.originalCoord.y < 3 ) { - this.cartHolder.removeClassName('animate').addClassName('cart-short'); - } - - e.preventDefault(); - - this.finalCoord.x = e.targetTouches[0].pageX; - this.finalCoord.y = e.targetTouches[0].pageY; - - this.range = (this.startMin + this.finalCoord.y - this.originalCoord.y); - if ( (this.minHeight + this.headerHeight - this.range) < this.minHeight || Math.abs(this.finalCoord.y - this.originalCoord.y) > document.viewport.getHeight()/2 ) { - this.range = this.headerHeight; - this.cart.addClassName('active'); - this.cartHolder.removeClassName('cart-short').addClassName('animate'); - this.visible = true; - } - - if ( Modernizr.csstransforms3d ) { - transformValue[transformPref] = 'translate3d(0,' + this.range + 'px, 0)'; - } else if ( Modernizr.csstransforms ) { - transformValue[transformPref] = 'translate(0,' + this.range + 'px)'; - } - - this.cartHolder.setStyle(transformValue); - }, - touchEnd : function (e) { - e.preventDefault(); - var transformValue = {}; - if ( Math.abs(this.originalCoord.y - this.finalCoord.y ? this.finalCoord.y : 0) < 10 && Math.abs(this.originalCoord.x - this.finalCoord.x ? this.finalCoord.x : 0) < 10 ) { - if ( this.visible ) { - this.cartHide(); - } else { - this.cartShow(); - } - } - if ( this.minHeight - this.headerHeight + this.range < (this.minHeight) && this.cartHolder.hasClassName('cart-short') && !this.empty ) { - if ( Modernizr.csstransforms3d ) { - transformValue[transformPref] = 'translate3d(0,' + this.startMin + 'px, 0)'; - } else if ( Modernizr.csstransforms ) { - transformValue[transformPref] = 'translate(0,' + this.startMin + 'px)'; - } - this.cartHolder.addClassName('animate').setStyle(transformValue); - } - }, - cartHide : function () { - var transformValue = {}; - this.cart.removeClassName('active'); - if ( Modernizr.csstransforms3d ) { - transformValue[transformPref] = 'translate3d(0,' + this.startMax + 'px, 0)'; - transformValue['top'] = '0px'; - } else if ( Modernizr.csstransforms ) { - transformValue[transformPref] = 'translate(0,' + this.startMax + 'px)'; - transformValue['top'] = '0px'; - } - this.cartHolder.setStyle(transformValue); - this.visible = false; - }, - cartShow : function () { - var transformValue = {}; - this.visible = true; - this.cart.addClassName('active'); - if ( Modernizr.csstransforms3d ) { - transformValue[transformPref] = 'translate3d(0,' + this.startMax + 'px, 0)'; - this.cartHolder.removeClassName('cart-short').setStyle(transformValue); - - transformValue[transformPref] = 'translate3d(0,' + this.headerHeight + 'px, 0)'; - this.cartHolder.addClassName('animate').setStyle(transformValue); - - } else if ( Modernizr.csstransforms ) { - transformValue[transformPref] = 'translate(0,' + this.startMax + 'px)'; - this.cartHolder.removeClassName('cart-short').setStyle(transformValue); - - transformValue[transformPref] = 'translate(0,' + this.headerHeight + 'px)'; - this.cartHolder.addClassName('animate').setStyle(transformValue); - } - }, - transitionEnd : function (e) { - var transformValue = {}; - if ( this.visible ) { - if ( Modernizr.csstransforms3d ) { - transformValue[transformPref] = 'translate3d(0, ' + (this.headerHeight-1) + 'px, 0)'; - transformValue['top'] = '1px'; - this.cartHolder.removeClassName('animate').setStyle(transformValue); - } else if ( Modernizr.csstransforms ) { - transformValue[transformPref] = 'translate(0, ' + (this.headerHeight-1) + 'px)'; - transformValue['top'] = '1px'; - this.cartHolder.removeClassName('animate').setStyle(transformValue); - } - setTimeout(function () { - this.cartHolder.addClassName('animate') - }.bind(this), 100); - } - }, - toggleView : function (e) { - if ( this.visible ) { - this.cartHide(); - } else { - this.cartShow(); - } - } - }); - - if ( $$('.cart-wrap')[0] ) { - var cartDrag = new cartDragClass($$('dt.cart')[0]); - } - - if ( $$('.c-list')[0] ) { - $$('.c-list > li').each( function (item) { - new Swipe(item, - function() { - item.removeClassName('animated').addClassName('end-animation'); - }, - function() { - if ( !item.hasClassName('animated') ) { - $$('.c-list > li.animated').invoke('removeClassName', 'animated').invoke('addClassName', 'end-animation'); - item.addClassName('animated').removeClassName('end-animation'); - } - } - ); - }); - } - - /* - if ( $$('.product-view')[0] ) { - new Swipe($$('.product-view')[0], - function(e) { - if ( !$(e.target).up('.carousel-items') ) { - alert(1); - } - }, - function(e) { - if ( !$(e.target).up('.carousel-items') ) { - alert(2); - } - } - ); - } - */ - - /* - - $$('#product-gallery img').each(function (img) { - img.observe('gesturestart', function (e) { - e.preventDefault(); - }); - img.observe('gesturechange', function (e) { - e.preventDefault(); - img.setStyle({ - 'webkitTransition' : '0ms linear', - 'webkitTransform' : 'scale3d(' + e.scale + ', ' + e.scale + ', 1)', - }); - }); - img.observe('gestureend', function (e) { - if ( e.scale < 1 ) { - img.setStyle({ - 'webkitTransition' : '300ms linear', - 'webkitTransform' : 'scale3d(1, 1, 1)' - }); - } - }); - }); - - */ - zoomGallery = Class.create({ initialize: function (gallery, options) { this.options = Object.extend({ @@ -1069,6 +801,9 @@ document.observe("dom:loaded", function() { this.gallery = gallery; this.counter = this.gallery.insert({after : new Element('div', {'class' : 'counter'})}).next(); + this.controls = gallery.select('.controls')[0] || this.gallery.insert({ bottom: new Element('div', { 'class' : 'controls'}) }).select('.controls')[0]; + this.prevButton = gallery.select('.prev')[0] || this.controls.insert({ top: new Element('span', { 'class' : 'prev'}) }).select('.prev')[0].addClassName('disabled'); + this.nextButton = gallery.select('.next')[0] || this.controls.insert({ top: new Element('span', { 'class' : 'next'}) }).select('.next')[0]; this.wrap = this.gallery.down(); this.scale = 1.0; this.dimensions; @@ -1081,6 +816,13 @@ document.observe("dom:loaded", function() { this.finalCoord = { x: 0, y: 0 }; this.offset = { x: 0, y: 0 }; this.ret = { x: 0, y: 0 }; + + this.nextButton.observe('click', this.moveRight.bind(this)); + this.prevButton.observe('click', this.moveLeft.bind(this)); + + if (this.itemsLength < 2) { + this.controls.hide(); + } this.items.each(function (item) { item.observe('touchstart', this.touchStart.bind(this)); @@ -1111,11 +853,20 @@ document.observe("dom:loaded", function() { moveRight: function (elem) { if (this.pos !== this.lastPos - this.step) { - - elem.setStyle({ - 'webkitTransition' : '300ms linear', - 'webkitTransform' : 'scale3d(1, 1, 1)' - }); + + if(elem == event) { + this.items.each(function (elm) { + elm.setStyle({ + 'webkitTransition' : '300ms linear', + 'webkitTransform' : 'scale3d(1, 1, 1)' + }); + }); + } else { + elem.setStyle({ + 'webkitTransition' : '300ms linear', + 'webkitTransform' : 'scale3d(1, 1, 1)' + }); + } this.scale = 1.0; @@ -1131,6 +882,14 @@ document.observe("dom:loaded", function() { transformValue[transformPref] = 'translate(' + this.pos*-1 + '%, 0)'; this.wrap.setStyle(transformValue); } + + if (this.pos == this.lastPos - this.step) { + this.nextButton.addClassName('disabled'); + } + + if (this.prevButton.hasClassName('disabled')) { + this.prevButton.removeClassName('disabled'); + }; this.counter.select('.active')[0].removeClassName('active').next().addClassName('active'); @@ -1140,10 +899,19 @@ document.observe("dom:loaded", function() { if (this.pos !== 0) { - elem.setStyle({ - 'webkitTransition' : '300ms linear', - 'webkitTransform' : 'scale3d(1, 1, 1)' - }); + if(elem == event) { + this.items.each(function (elm) { + elm.setStyle({ + 'webkitTransition' : '300ms linear', + 'webkitTransform' : 'scale3d(1, 1, 1)' + }); + }); + } else { + elem.setStyle({ + 'webkitTransition' : '300ms linear', + 'webkitTransform' : 'scale3d(1, 1, 1)' + }); + } this.scale = 1.0; @@ -1159,6 +927,14 @@ document.observe("dom:loaded", function() { transformValue[transformPref] = 'translate(' + this.pos*-1 + '%, 0)'; this.wrap.setStyle(transformValue); } + + if (this.pos == 0) { + this.prevButton.addClassName('disabled'); + } + + if (this.nextButton.hasClassName('disabled')) { + this.nextButton.removeClassName('disabled'); + }; this.counter.select('.active')[0].removeClassName('active').previous().addClassName('active'); @@ -1348,26 +1124,6 @@ document.observe("dom:loaded", function() { } - if ( $('c-grid') && supportsTouchCallout() ) { - - $$('.c-grid .cloned-wrap').each(function(n) { - new webkit_draggable(n, { handle : n.up('.cell').select('.product-image')[1], revert : true, scroll : true, onStart : function(r, e) { - r.setStyle({'opacity':'100', 'visibility':'visible'}).down('.wrap').addClassName('drop-start'); - }, - onEnd : function(r, e) { - r.setStyle({'opacity':'0', 'visibility':'hidden'}).down('.wrap').removeClassName('drop-start'); - } - }); - }); - webkit_drop.add($('menu'), - { - onDrop : function(elem, e) { e.preventDefault(); setLocation(elem.up('.cell').down('.add-to-cart').readAttribute('href')); elem.remove(); }, - onOver : function(elem, e) { e.preventDefault(); elem.down('.wrap').addClassName('to-cart-animate'); }, - onOut : function(elem) { elem.down('.wrap').removeClassName('to-cart-animate'); } - }); - - } - if ( $('customer-reviews') ) { $('customer-reviews').select('dt > a').each(function (a) { a.replace('

    ' + a.innerHTML + '

    '); diff --git a/skin/frontend/default/modern/css/styles.css b/skin/frontend/default/modern/css/styles.css index e36cb288a8..82f0f7e07f 100644 --- a/skin/frontend/default/modern/css/styles.css +++ b/skin/frontend/default/modern/css/styles.css @@ -1136,7 +1136,9 @@ tr.summary-details-excluded { font-style:italic; } .cart-table .btn-continue { float:left; } .cart-table .btn-continue span { background:none; padding:0; font:normal 11px/25px Arial, Helvetica, sans-serif; color:#4f8100; text-transform:none; text-decoration:underline; } .cart-table .btn-continue:hover span { text-decoration:none; } -.cart-table .btn-update span {} +.cart-table .btn-update, +.cart-table .btn-empty { float:right; } +.cart-table .btn-update { margin-left:7px; } /* Shopping Cart Collateral boxes */ .cart .cart-collaterals { padding:25px 0 0; } diff --git a/skin/frontend/default/modern/images/cvv.gif b/skin/frontend/default/modern/images/cvv.gif index 6d6e9f2907839d58c27ec8de8644f30fc8b4467c..6d49784489f2ea812202191c5f4d065b0686bb93 100644 GIT binary patch literal 19277 zcmaI7XEY!#OR$-qL*Pri|9cjVw9*+BWf^61kr*Z zdW&8rh#KbRckch3dq3QB_lLFDTKlc*Eo(i`diQNzZ8>@CFTer7F&VI<$LrzYVQ6UB z-roMH?`KqMPR6VJ+Lq4yKDke$QVJ^Sb8~YA?%;T|o(kQI<-HxmqwRn5ZggT|;@JEe zpKeHM)>}b?$eV^yH&F@*ekDG2EWcjZh6sR9%|qBYo=^Ce$o&LSX>`~3>Eh~ol$@r3 zmfzEe_*WI5q?B|40KlI=f9B`sk$j?yiwlZcCbDS5@bK{Z?(dUJo0bvvtE;ObCJ9^H z+m-=YoxOv5dwZ&?s3S53i;L^n#;fZ2c6}SkD(D)Vm={Ew^bGyz9vstl$XML`&7$gXQy+KF zEq!|GXY1GD^5z~BY?@^tA?;m*f}&zdVe4bR*RqC~&;6s)W(lUw0cnKNs!s!NtBL1- zFFX2w*!w>l9-Ek1SXNMTSliq&$G)g-AKIE*{4qWM>-X8u*~O9BH4)8_ACoinodZcp zN!~s_n^y}Tb zcPr~#qPloORaa?4Z(T#v(YsWMyTLPSdlNH@76Iwi)z#xGyPI32pEGltQiu&jCLVR{ zO*OyoKNlu{PEU1ry)J1f`PlWq)b!x+__U+W+ByKG=k<4P!p6oXD(;1tNrJV#b8tw= zySm=U@aNyYeS7shJ|QUJ@^D{NGr~6zKQ_PlJUT7xd0lo>us!?k0Bkt&9xD$HxzKc7AQ^X!|k+0)bH4F=R4%=kWAj%SEO#H!wnKTKii6dn>61 zV6AOk?R}9p_KwaT%G`S`?c7LbJ7sP&X#R)OStrQb{(g|5iEWUpt-Kw#stQsm zKq0^#>u&FBjSO&i^YBp!Q0BI_^R%&7_}Bl>v^Y2Nzd(FlmATda^8xuEo*JIs_DE?l zl&CFA28EQ75RmiFLsC-oAB3n+pogz@fT)KL&wo?UwD+;~ zcEMKoq~*<`oD$I z(3I7Zm6njul91Dql~R|J(vU$(-qKK$m;G;CO;6jW?)DzO|BY++|KMuB;fYpTmRw-=w|Wo$am7jrFzFUn|Q?iwpB} zvors)(!X5xV{CNf`|!}xSC-kz`BUp{wrb`aa!T0gZkH#IiYf2{jZTT@+CS@FKS zthA)K=v`q!ejXwBZO)tQ*RQfNGhU{rrKTh&CB8^_9v>GQ6a6d-9~prQ4+{+m4hjtL z_j~H=XTMYb{^tj$(K5?# z^%alnBuZuqJ9`t`TLKO?XTLR6&9~#gR2=$^)r(!R(CJ0qhJ_j>Czk8NYE8AjzGdCP zs52FQSR2YIj^!|TU6(#ua=#qb+5B;9qRO%7twBru&Xl6}*4#i#g9ir@PsM5YFJCYB zqzT_OEN(hj8!k}f)aZ>7dhMIUH#gYYa=f?Db%U(ZorS!rn;=_hN|YKR z{dN$yOzE6MSXS&(dS0nH>vPez_51{jK_lB2a?!nAiHb*!)>>}}-Yc)&>Ngyo#EtC_ zNjk|n7Y7BsVfgjd*f=i#rI}6B>x{FfHBSJb=Ow8Q>{4jT{_%m+N5OFxc86|o&X_x7K^wYtX za5UxCuyZtxZDH@6@ttr#o()(w=$s2VChr{2>iSQ zyb?s=aXK$(S9!Yn#=r8EiV!1qwq6*s+qqFvTzR(nzF{s%r24Da`F8cS>O&0!fy(pU zVA0EyJ)+`U%^TkLJ^s#Q3Jf)@^~+kF9SpaKT^x?Jpj)=Cp`c6?2X3W<@%4W;_ZJv&hHxSa;&Aq2u1Uy-sX;Bh`8MUqKpU>4}ohgob-LI zKe#R)+H0E&xkqY4v|++nEG&Orows_{Z-o{b38>4?~u`ON@q=n<6(~OGbxq*2mEk&dj3qJt=F3+*Y=?;ITNeb!FFPTbzDDQAK@Twp0AoW;w z;QYb;$4Lt-0#~`>0xHuIx!j1Xo!5sF+9a>{5(*V&dj}sBRma6Q+JhyhVpPz1nOLb( zoe2OG^_dAF2z3HdJQ~iI*(F%tFEJkYYSbdnC;{ns}Sn{cDx$Vm>(+kImJj7@T?t}nho?gvp zh=Wx6dhuB-J(_S?)~NJLDxKMvXlTmILHd@;&+eO+HBT6b|43+>J@RWv>TebGkd=M% zJm@`>K~GiK@wfTQv*UIEZ8Z+41Zy`mXoWklxlOms9tX*`HB{_92o1jZl(gK*GFTlg z+rLN~eA0!4)yP54CLr17t`yR&cr%g56r=Q=^ywtqn{K6QQ77GUgEfir2^3d2Pd=ly zz2Z~4ZJ1kFJmzWMBwPbMbbn#})hMwxU1A2pNpad|abtfX(bNvcdHUreUq|ZI5j#ue zz&Fd%}2S!2w&O4yWBnL)qawvx;T?EsxPR zDs{!G7aK;;&%PDOz{|wnxtN}_ey%iRdv80ivDo`+ya$$DVOu_9am{WbWAjf{aqA+6 z$7Av{|Iz!jfgO8+%%nknc%3kxyGwR9=eP=6{fC^Ll)x9$q_-a$+6U^fbapf8LdQ+T zIUXey*|PwD*})|Pto=}n+YvLoZN6|X^t^fg?zt>cpe1ZhZHU{V?g77 zQpU9_6?gydiZJ<3Q=i$O_e(xv7~`&akCumXYOuZwYfsal|KP#f^S^6oy5`{+!^8X= z7wcLRUEE5@s3O~?4dvM8v0}qNWo8%D=0nZn4TFCwZD*-axi$UHZJycw)N49-Tc#!k zkLp`;*7Y2NM%QScmQP>o-aBrdYoYbq@p4>-Sr}^k}G_`O#@izS6h#w#q&FNpZ<;f+n9$lP`tVJ1=&y@plS4=nF96 z^21PJT=+>QI0OqdTY$)5!t)m3e)I@W0Cgq?CxnGk283HwgS3;usu+lVHOP<umogS4bn)4im~7rCd0Lo!G9>8#q?0bnuoh!z=q^ukPHET zGy#pqPw53-A*{nL?qH9 zj=n+}0}xsmDmPrXB>|#Jq>vg0={LscFT@D}@FpyHAtLn15pqlsdwd)0G7M6!2BnsO z>M`&Wg^6|50b7#5`WT2dAnwmsXeK%;SSMU-;YG1g_(MXt-Y`gy023yG zd3&JyI^j+_$$!is4CW9sLYzf)+@Zj87XpN0!8gt9sRg+taC|Kx6ZT@7`$gLt)Do4h z5eV0mPcOixYs68P$5Q(dVYg4gD}paWOVTyv5v9rLdK*-w$Bp%0UxnMROI5{#iS#S)#Wxd92O2I=)CC1rtMB!exm(A$BOZ6sI>I%dHkz>I)(%3lJ3^4EhE zd($GB!$);e<*{%g5ytx}ySX&mjTBj$obB-n>Vks2NRBd0&Xyr$_bkA*st1z3lv132QDT zS@lDo+Ux1$oA6Q+ED{OV0#JKC%;%rVYs2J!J_Q@Uf~umy{6TR3AZRfIns<{~~{#>X~_|Oe5$tAo*QGi*1WVB z71c(FG>$DbB$UZxz%Pi9!e$VZwL(9(G;Q;RpAp0vmCzydzFMy|03NCKsI(aXT92=k zuC5FhDml_Bc^2<{qpTzmo#~0A9xcV4mEnS#K<8zp;Hmc^Mg;xps%zI1v`9tdv#Jbu z(b*IzkR|dwAnNS(^D~#YVp3HMASV(>UD#A5lUy7$1qv{)rfR9uXs+tPz}bUSkik$5 z`dWeVDw%~+Y4Y^@vomlaDJ$tF+}Q~Ffke%Qs?&U2r+uex2t_r9#v=j%tVW>QSm1`j z$6Zz*5^L2xzmn$El25V}#Q;Pb0O5wt87ob)y94$jLhSD3Xb;D{Sb*HAu2*pZ6Nrcy zA|elfXccVm7A|$&O1ZNDfi%~fyTC)fHAsC}Vk>VsQ`kaTvgG%dv; z&*_023&01$erC@Ys$2}BzONxf6A4$sIJZj}MV#4LOQvc_pFlzS2L#{%*1x8Tt&^)@#UkqcCjMoo4% z;l7`$ssYc#egA^zP5BJcx}Zg#5xv|Zqp9EEhIV^E?}#YIv8LcDRXz8=T^ z9&Gn>hn_o@eN-VB4E)Wvd{tzlKI)ZZNSEAp3R18uj~<~)O4kD9x1qrzdSK1|{2=+4 zl1dN_B*E!GaLt1eI(qG?x< zUG4Pw#aI9W)2)gEc+uxck*K8qg58w5YXcB&C_vaY{VMEL(;Ddx#ey$xNh+JD^LgA7+Tjat`Uz#(vgG=ojgOe7X6`OsLC{2pd>{cw(tC z(VzSJ^F@geBYg-bf!dHB5Kd2_L4;MIC`E$k(iUh%&Jf|md@z=#YIrc5kQz-7SpN&Y zf&}!DQh+4jj4t(lfAaZz>NYH3A$jQhFO??|u|T4rVIMl^&(}C7bWtMK`tzxfzy%bo z3kgAmqWmh-rSTXNccYVdtxq8?@73=9fVLb{ANVXv8Ut=N`CQM?v>ekXQWV`7(;udpUHIaK zq6~2QY!^z|0HD1}g0|^alzyPwr`wV4DePjd>1CaU`g4oF<_i?qIaZ%ia z{3JZ)f~smbJEDTxyLGgRKwZ!aNh2bfFDCE&vsgLgAbVbMXEsrENQwv{U@2ozb^gKd zPuU}Rp)Lip{Dl@%CZ@dVH|XLR=(1;~1W^9h=%-s`DI&9zQm;p*-kCNuf{f}HZus)F$gAJiBbCFJH7lcJ=cuDeP4Yp@)6|igmn-48p^47iku; zG+JotIeNfV+_f|`bwJ8SD3^5dH6R}eQhf<=qL0+3rvM`&A;PmU)dP^}tybFR(OK$G zbEP2!$P3K&*ydL7Ea(uW!#o6d`Fw&DyvLi13^~mTDJ38%ad0ChqP&Ayg5*>bvdfSFf)8%MR09 zq5#CvAn9;n0UAW}nF!&UqE2{1c!z{YSHoH9w>ZQ%t||1roO992-@HUo2L7g6#BAn> z{Vp8@^6rMvk_i;mZB*>nDej;kcjyb%5D59c@y@{m^`V1!v3yN(a$8@-+rEPaB0{Mh z)UR^rh8##F!i<#;gY@3Zx96Cv9$rCHt4+~}4pV!QU=zrCQPLl!d78XQ&}SsjRs3*v zq4W-x4#RomiGgbo0CUxQ&f&+R$fNGcBWuoFJv8<4FdQuQGYFC3hNV$EL+t-W91hbU z*$d-o5ef64>#F|Dq)pE7#paAfx7x**VH*+F`+`Z=u9B!Ojp!B^&a~)h7jc{Z*88o? zQ@_@LK{%K{b*i~|eGD=`clwXIDveswX|F*W-RYq)05OXBdzUVMba?gq&_R9W0d(fb zoUHoCe4aY*C&(m((*5$V`|ZKV-NW{FkXkdya0ubH15YF(dWSAV(U1@fSpz+|LQVf7 zy^dum0pH3@m}K*|Tc^opX5ce)>p*Z)I9|C!xj6YdfNd;kV&vDI zED8I;!iS8jEMf9bcUOLnuH7Z5Jwv$LjIQ4cXOnAuvr?;bKm3mngd~8Ql=c*RIl{!S zta-Z{vql|PVAq4F(_pP_hHMUq)_E<pDHw9IfDQ-`_oso_vq_67-CG zg~$8aG+&FR!5i%+v;HO2^Qq)JT62-BIoB$bmOezknPnO;cq71b-{Wr6l?{K=ycaE> z)!g6Hw_06Qcbn_@#-!3lKK)%zn*8xzv|(`j>__vY_EMHd4Ra4HElqdfS-o2X8{xyH}*YSchzH`TI} zn*s&Tr)M4X51Z`aYLi&IE)Fj$vCs7WBCcqcxA$E1gv#rTOC3v2-D5W|mwP}vjf@AJ zdy}_D`+pDL_c4$;y|<@dcyvHfrV4=IykRLNzGUAKJl2?+Q zAvd}2eWHE9GopdlI5gskoqQgvD{c=?=VJ@Cea%Q0t|-w7v+{cW$O2lOOlh z7z*!k8@fv;%AJ@;j@%dhcJ(`-gRf?shKGIEm`3=I^!pJ`T6I61US@SOggB(^>v_~j z(aNdB2G|)Tb|Rhicl)AzW(!8#4lD!0gVJVS7bbk|4?r#Tm9w7xIi6=-McFKH$2z6w z(NJ(qHt1gUJ6W99d%R>#H@{%i6>~M(&E{F=!po#?HrIfKyX=AB4sOY!Nd_YY8HxMz zN5)xj4K|16RA)BR!HSqk?8(H}NA_8^FRz6)a;eR5=Pz4{_GhuaE0IullI8%CPh5Py z8)WhYwY=?}4d_bre^O-|KbZbUKh9&Gu@V-LI0Dg?8N1`ezcbN_T(%V_obP7C86!-Y zn7HR+KZ+7~U>YI9^G)EE%D0mDxW=)b**SwZgyL_06unGo#0hG&A|Muf4nIl z0AsFy#`zZBkgz@MH_$~964LWomK-v0np~sv^Si&*-~I2`?7rL4$gf-s4v1Urok*MQ zCTq~|hQ4O}%m+znCp{|uch5oliK4~<`LrKqLa5j*ej z>%y`uYE#9UR_=U?rSzj#Pqzg`8Iq8C_atouaP)lQepmGF)q)un7NJ7AO=*u3y))E% ze<5YKdNVQBso8G5d=b69*05Wz?4)>DTO)OxSiKpPr1GK6i(hHUha}49Sp^aaB|sVr z^owhgd9XwJ9<6i&WI-f?m3`r>%u)WEH4|HfofCjs>L`orA>c~iLl7N~2!1+-R#YPm z2Ik+-fnF7WZ$BKy9UbH{@RbObP4@WM-+Rt0bze34H#B)^iRzNRh#h?fwOGmHyGZWP z^|}{tqqkh>N7TCWsf6zFn?tH>G=*w+GSsrM?pmGO2CHdGni}9wVdwfy@gAgc@+LQn zyfuYPBx1z$P)ZPwDmAPy>K8#@eOHEbzH@i;nRHztqdd(94-xSrlRux|eua3wBdyzM zRXUlk5v(I0K_NYt$BdlCtF#R7obpN!(gsk_LC!w?=(!?Rf05(WkzoVv!1 z^T{00(i?adSVxv?3ca)l`C-ljD)SoYjYM9_ps9eO0Wd?HFH0!N?FIuEWltE8hV^7y zmx>BB@iv`l?M;RAN3ZW13dT{%7Ie&Z07_JV8jBxRgZnKa78PL4Xf+Aez3qkH9*Jxz zLxQ;o^mD&cJBw61V62DL@eiW%nC>ooMMi(8`l}AS7CPCh_<1q9V84sDu5nKY7V-0P z2}CR}i4ueNCmFcebOxM&n4%OwGZBVIr^jOvJFCWT!Pvj4-^?yjsVYRk)a_bHZ)Unu zoI_(Y;kT#?S)2tvB?nlKpU?SS7>2*S3>=Q(KsYt3ZM0VJ$Z4@YRyM2c_9=p-64)=sJA?7?~#`?wSV@tvGxNxBjln4xJ93?i}D4 zL+3U8FWS0L7lrtFuz{7`x>fGI7lxtAcF7U!azLmLV<#g<&|hNOljfwQka7REMpJ97 z-zR*%^(dw5bX!I@nUOM-qiP+4R-<_eG{iW0vfC_)cJ6ExpeYwEK>40ws; z`sEn#3WeJw*kv?MjXpYQj8d@?pCXmSAJB7cD@r*_HXMmJUDpyhX*Phj+{ZMS;v4i` zp51s8$JQ@P0oTi8)5{mpD^Suaa+VH*`a*C_SZ z!M`BMlm6kEkK}XdvMcD6eoFm?&u{*DQ(@2B>Yg-{YE+K_p&AV8iA(2&kY$a8rLekL ze}z5@K`VWvwXt#jH*Ov=s=2P~zBu-|IqkHY8YZ^q~v5I3&8u9G?2n z&k_m;AX_ntXuf;uLaxIjYJz;wZ^okR2rHWrgY}r(=s`m{Alaeho*{aW#R4pji!+h~ z>TX8eBPgXRMBGE-4SOOi34>YHgM$b0%*rO3G<_V6ohU*S2V4)*2o~`*$xn#Vqwmv6 z9^=*T)B2+RD8Ph54u8(pr~jo>0^WCvs4fD*Qz`eQ@#sA;=)ApSa{qye!JkN!jvmVB zfnMXV#KHrk7e6Gj9%$2m!Iy|O+yCcXT~hBaASu!0@A1*l$tsnf?ur`US0P*dGWFzuUxDPA-0P~!mQ2&xbGK;;O(Ka~27U`J)36bjbB zU207j52u+tij1VhQ97)f>6(Mt_(~rcnV}|OQHQ-`USX4MeUlfn=7~GzNf+kHJLXyl zh~|Uwo!IXMg1uc=q8UY=aUDeB+$mrFsLTlcne`|C4Smgn*l3?0lsUg1=ElM*mSX%* z9uoK-73@4L{38DL!4!dB;tEfmCVfmMU!G(-rFy_a-I7U7!ZWVvM-H70ThtG0MIV1q zeq47knIify;*D4&8;=x_r->aQ5&8J})yD}2k6ULSx9vPmww$(ee|#_aaSILIo1E#U zis{a0lQs{9XD%Wm1%Bu#D0TZG5GxH3}d6!ze_DB^Zeh?*^Ai{ zAafGn((+i;;>12%z7In)hoRlY&|PBaX{{MJtgnb!GpblK8CuhF{A3KnNWPkbx5ZJe z&LHZisaEN#jI7z`tQmKqg4i!A$#|MZfd0v%$~xY?6T&;WzztgxsK!yDmQ+yD0t?n0 z88$Qo92LnLIS$|@MyZZq#8j5txovLNmuR^xlGkZ8SrQk?Io6*mtQ%Vw(Y@BfZMI5- z7;OOFbTY~s4VG`j>7en}lToIVco@mzzpjM@;X^<@LX zGaKoDW$zWYu01d~AN@6dXV?})~YE93U(QomR9RrBAUGuWdBrIpG)9LU2Vy_>g z_QOBeeMUWpM^{E&F<%*c&0{>gbi>?++rz<%-}>I?DEas(A?7dCF#H4B73xHY&08K@ z<`uiQJa_TGu4Md@>HhVo-u^IoSz^TgAI<1;$KW={kU_`LImfVF$8d*6y%V`;Mh7bN zY7oDZ=6Yuk49r`y<{-8n?a&x==}3;RbfTjF5>y!_(Crkx>_A0?pyeVH!f^Nud}RHd zXvH;jwG)+*qebNt|J|9)BZ|N<${+{lH-pYO^=mk>jkF_YDh!0id_A@v7gHJaEX@fq z>0H$26d|_$BFrU8Y@L?HIag*qy^=e_Z{yYF>#R%efYtohesS3zE+163g4-gB`PXlt zovD!PNz4_AVw(kqE(K3q>KvRC>v1g1>Y}8jezMR{XuJ4yI{eTo!URYCPg<2VDo}Hr{eLrFCz14z8Eg1ET%b-)Xyy?QX}4)lB1licQ^Ssl5bfu~{fM6+PggC52@d&(%-5e#f=w5PC%ziL@Xb^y#Kx+%s& zKt$->EU-ubB#;L(;7W-pi8AiNOX-x;?2+hH8P^kc3Gl5eeQx3FNmN5#?DJkb+ELaE z6O74GdKjF}iC0H6KBdb;DF6fmfSr`RH8BA3fPHHch@;(moBs}vA`pcEa8h`44S8r! z!eD3s51ltz8w2>UH1SBzl#0AZ9TOL0_wfdWmu^-=%(gB@P!^*j%s}vApf@4KdR-?| zDrI?mlE#Qw`D*WZXvacy?jCG~9qP>Q>NI-j#2oSp?CZ}TYPVz2J%@MNca4U8@8llp zXZpejhdKej(2XRyyE^CwA0;~9%t;@{5qHJ?Y*qd2?jEsm zJ~X#-W67D5pKzluj(RlVqcZW-IVKH7dK%DyXY{qb@zu+o)8AX%-)F+hA;!niYWx)u zWI^z;0C+tj9t5=iaXpUl_lyhLa|z>Iz&7mq&;>+ro_OE&Cnx^NL_#dqqpm`{ERj)$ zNIco)Ddl59X!JG1aHD`|@!w&40gLZEmY@NVoPnw0fxcDw4ikcx&#ct}U}Ged^IJe> zcwi+BST-QAAvFROa9Vy4kQ;85y!IqTHZWg2sG!{gzvmf64lMFKQ=>UM`4dl*6;xIg zRNfx+ekiD7KB#gpsEQm^O&46l8C=_NmU8tRb?@|{Ur;^WQHXGGV^VNaZg6u|aLd=T z4|L~sciW$O1h@O2Z+!~x;0);$59!)F`$Tcx%GuNI8B#<(W|RZ<=7#iDg?wud=^qLi zm=77;3mMA&OHp0Gk&5Rb;GT{YQ6z^TlEHAJ3vWs8KDtnv;UXTvJswi=Pr5jY033OA z;$md)LZBq{`vh)0GbB*&VmcgTYksj*6)Hs=HI(`Hi~r-VRhNk|A-p|dJM&??dtrOz zFcMw(Z_e<2aq>0=MCt@|mlS1*gH;|z{yByS<8a%>?X)H2le?qmLzj#I_}!1hfU;;v zDvZ}-HNeFQ+8Gy3Gl3@7@#hyCnm3d3A#FHjr0RZ)hj$#cxaBzCl47p*iy2 zIgOuHi0rq&z45`3n&C3~im1z>;7FlfrlkAk;mxrU<6`5AD<9%b7$gjh);IqMPgdJ} zO%-)L5}B&A>_Bb)c*!6oc(YZdaM+cOMUalz90FoC=B!Fyn!{*b1DVGs1IX8l0ACR1 z+J*G~U%*;}man17Kl}zx4-SV2CT1TzcFv@?C+}2v6ImY!n~gO4AM6?g z4a_xoaY2iXGE-ja6s|-)TR9fSbaXwRxG0muPJFe#8J2Uf(#;{54SeW~UW~r_J;FCz zd*?FO<>&s|Xq9LCP4{Uduk+nKa=Qod`_*f#-aUB{5>I!4a44tr@f*yfyUeV$rRWHS z6aB(sbi{CS1G~MYsJ0#-ci+7$P*-#wN3cR`%%hOwUOAo@(h4uFOdkUqd6JZi%sX*R zCZOnRPiF3MKm*@38hCN53+6{*)zsK5SMLFOP+i;BZ?9>xQeHQI%wJEAd7Rx_(=C(L zSYxA~Uw6Wtp#D=%Am{0L%(A<}S))L1JMibrtHUC-FqW4rk2shLEuy)6hLxKhrh7@K z=e&I4esh8?dKb8AW}{9KjqyhAXI*vkUf_4$>DaiR;MaU6^j`MK%VkQs$spm%rp;#I zs@AhJ;pz^At1t^6dKe8Z)IoGq{8C%`#g0+3-m0O&b?{c=q_?)> zbH?)VYu~Sj^_Uq%92?#HngwuvoaFn8vdX^uJ;lb zc-#%)6S(qnTf1rP(Qn+4>3fOW;!-WH!aTntYr2Pz;7%MGq}lZ7aDWT)k2+Wrdequ?uO*dZ=D&dC{Y^LyL%BNp42FVhHF+K zYOp2ll?aKI+Hq~yo|liqn!dg?s+H$^iB^kyQXgs9+h6ZeDZln^x$Lwekl~yBI)+Gl zwzg)xkK4`;W;oky$lev>A!K6E+4s$8#(wBhLh7X~ZPlJrk5F?Qarn{OQ?Y1VUFl`f zOab;9N%nt_yQ=YH33@MQJ4NT-h+D1po1V!?Njy zCG_|@mT2C6bhI>YKZ5Ub?xnX5)1~~EaL8XSdc2?}kdhqncgDR73F2x=$P6#*A74fc`moJwx- zbTK7gmG^6s8ibZw>2*FX->ebTpV4F;r`Hk*SoC7~q;_w_h$@_Si7Iti>$r?XMe0p* zg6KAcH9j@|b`Rj1Yqb@3GB8?xTq4Hb4&i}BetS4lOU|hO#3$xc`pt5`HnZ(79}55P zs(buOa)!pWBwU)7*{+JdRNBLBlGNSB!W|o-?j+(Ip}Ayk!sLrG0A?AowTJ zDPC=k`D(Cz9!|OPQ#f0_q<58to=9BjQ0V@L+{?cLXm@9Q47bmNJ~jjw980as+esUC z@Rgt6i0S&6I?J2tXrYxABXyH>#vi2HqAvGnqWL4^E3hj@nn>#BLF#OqEP6Nj0Wx}$ zb@@E@R>}wdci*ktBB)&4G{Os+SkfM5LZ6MQ`IL>l+m*Vh%r0b7AoQbjzqX`JY4dq% z^H{}rO{q?x(1R|a@tU)-vewU=!AcRvm9-B_pOBUHIFvf#RFLJBeyze!4$3B4_diyJ zT?k{q!jm0W>Z|>sD;Pd6YTn%_dOKHPyRB2x0;Nd$?8#K?Tjf6oyz4)_z1X&%<~2uS zxfv2JzDgM4Mtf>a!_)ZmxDBz?7CP#5gnt#GKIPN1`&Vlsa=L&&MZYS2P&xbQhWXkbegm}#MW0eWk)YX3*M#Bep00a2rI zM(c~x%p#P5kl)Uc@%`~VE|7TR@)c%nC|PML1qYh3rjrejNU#-IzCPO6Ez>5E=<|M= z{h;xy%4JQGDnr`cg#g;uI%w!N#(MXXhoOR`4U$WtU@&UxGi{U1`0)Ohs87?kCzq00 zT_URzX{X;#V|7)U-%uFx5^q#A?im_M09^x?ukttEdVBDGP5Gc{DD3hU0W7+%#@IX@ zt#X(*z`*DOm>NVNKc~K$SqWr8vTvZJif&bG82B`gz8(CKFHc-oeLMv?z}>oQ^nDmy z*9Ev5ApPD}bnD@0^LTxmbfr(lmgPb7MBC-ls&5Qw-ZPIF$BADgxJ5U14gb}8V5O@I zM0cF;w@i(<9hE;D0NPAX0T3shkaY46qlt(uXjMhFd9-5p>4%ot-7wit%c6UMqb+ks zm9o+{>NNh}kPJ&t{N5yS;e#1JEx=UeIvFcTK5NRoB!SARrRuJY@d~C64+8)$hn)s)}=R)hzp2B2T*r%%Jt=nb- zEk8%!`qh=U?r1u;OfQEW6@F{oRfuVsJ$T~#X{&XQXRT!(9PZmp)kZ>6d|G5o^8PH` z_B-LJ!YwxO({zon{fsq_U*c7POSNw?}HNyCzMK8fvgFkI!ZK>T9kzUpxw zS=pa&IBCbH{d|tB@~;T>@^@PM-&IxBv(c){KiRoAB;;?O@Kq;-KejmEZdbiLs3Kn+ zw3Da(RVj#8e+M{if98_eksy8oNQ`g{Bmly4A$6USQEz~f1n3ha%mD*#%RSLrfNcv;^!&z3I8co8Yj@yBPry%z(Ki?!Ue<}k{-qdUR|Kw zC(w-$==t-mEOE+W$($4bz_GOT@t+0iFblXC7qbJ`iLSM(k~Ne10t3g;RTr-7E?fY+ zuA@L}Rl6<`7VE1)Gb|Z-Y>36{MO;jk);F51frDI}uXC?2;I1bi0dip0AZr;cn!}s( z>LrF#W{HN@hD&{si$9+`+WN=m#iN^Opc^-BA@JB)9VUpTVFn8Lao%J`GnivoojL`W z0JQI|fOcpgj`OCA`mwVOs~w2#6ZiR54O)(+>)o0X>s&q7HplElepo*Fr5aZuH`%$9 z-y>g8fg60r&84!)qR*%$JXNZ35EkmoqmmZ5rC>d1zcwooQ=@rJ`232#p2sRHtM9`Ri(We2p9@iOQU zkD3RM?2~+12OPg3K)!G3NO^^`Z29P2#4T@5WX3#a*t}jCr-HYgPUNyCbB9KTo!(KG zY>*X$pzSfxhIP1rj|~Shj}$!u8`Q376mhFWb1EAyt1zppW_9RZa@|ejJw3J2XDU>a z%s<&#mUZYner2cocID`!-El>sxwjQVa^Zt8D}y6j*aFTXl}|L4S5K(m;S}%PqK?O@ zT&9Qu>fOAPP#*DaZnncNV}5|#lnsMHuRI6k*|fu8*9=|H(bZd&sq zjb?J8{Ud${2Y`I@GEjt9$Ae!ktVsU|ELd-g^e(b>h_v3fQ!R9mW3`7dMQUuWI;}1r z+w+?rX*k65ID)tx&v;x_iY&u8O>OM7x$RC<3Tzy3l8;usGdiBCJD7+G=!6xCb=x}) z+A1D(*~#$OIH3RWVjH$M^qyDg1X?u<7(VLsex!~By>p0M6OnO*ZSw|LW&Fi;h%g`tw9G`F786mcWcIZ?C4%=Q=a)JeLD{`P6yo)uO9XyZtR7RE!N0wEZ zmj#&AK^Dc=aW>bP(ELmte$Dy8%sAUHb=8$M0W5!#pB1oi{pkp=95aY^*p^F<%&!xf zYqsl%J94rR!r9l_Feo_*D->a)tt52Td~Gb$Uw6p92BJMUEw;`G}%5#_!T zJs+w4PIYP7(Z&hsT_O;)6zT1x3RuB&tjcl#XtDf>+BZ)Ym%WUg`9oGUFS!(#&>}EC z3y)lzFc2+{+XS?6l;?7?h_mhc73tuDOkK_hvbwJ#Xri}K+3bk+uwsaEy3{SZnwndF zgtvLZZ`iq#BUGfAv02)e@2bFK9m(C0x+0{v5)}FCevp-B8+V+{mh2RnyV1{8C0@8} zd=u!#*=}rC$h}@B=wuNTi9;3p?guHZJI)9aBaaY$z7w@{LPVM!Iq`mpOG6U58O0i zF5e?pzWbGz&h3mzx{GW&7jfVcINVe}Rdxl+lDI(s654=s!+t|>!B33Z5>_ayab44-RRPDzIRssI*cc&)1^TO?Y4yD zU&1~0+Y%_L3V!VZjOAXwEDUZFjIOo4NOTJ6cIOY_?d&Y9RpCG8D+WO-KXX(p>~5dE z*!^;y=cRYKSL$jct7uE@a(SdvXtelf(68swHgU$~W2-x|+67U4+{%Oby$*r{rY`P5 zdjd>q=Z_p|825ggE~(LOpOpTKl&y}`5@q9?a!*QK%8Kh>ldI~^P$xy(CsUPXN5W_7 z6&h_T!Fo4aGPXq|Jv`1x|Bh=GZDM0Cr6;s&1P*L||czd!nRFVwIXFF55BtIWE0 zgl(!7YrT|ZYP#BNf}4vEUyHP4R8#o4D;jT1fxI;nw-+|O7#@4szZQu|6=iFWkr*lb zzXF^IWABZfl%^gD|cc!o1$FKWi0>y;VYJEH7g@Hmt`*Z zaw;ohF5_kn_k%X0MnVE%ECO*rlkXGT;6U46LZ4ryKJ)=L^iLG@4SKIcha^G+Aw^4? zML)D}Vsl2nvA`zpNT0L_b~KZHG)lL$=$7=0u(V6hbo!}u_R%y>`=3qkgiPnOPlMl1 z3+7J`wfY5hPZRY}2lb>PHB$%d4x4mSM|EHpqf}Ql^2W4PXSG1Xbj2ODR-d#{livUg zzzU4t0t7%mj5YXefh>qMS*KqBECBay!4`Di7L>L4<$x<}pDg@A9c;l~r{4gywffQZ zT;p~6Er1Rzpi*~Z`K`bJU^ zZ(k0iKyioP0Hi=&|A7DufGebc`3*pE0HEtYh7UKXV|NaCcM2>vs%wF7mwKxAHlU}#ACP#g|AF`EKrVcDc zyL}t`qxVCyFS}C$S3XU&^oi0<`?g$NbFKyk%#2&ga0+_xx`I{cR8Z z3KTuyBmJ~5ebetdc=x-^U-zt6{di;lz1DO6cYl30>-lLI;{d<_)B8DY>j1-}wc59S z9iTOLZ#;RQJ#fRoc#AxH&vxb8^=vOd(=WO0$2`olzTn^ddqepOxB~FEe(R?|V0%1% z=e^RyzzQfk<->fxBe%_)xYci8h6}pwYr$`uedsrMSC3zGm$l8O{_59x#lQaXw?5qe zyxiNh?bm(o6E=?{y(|F40xdaU)PVs*hn9Xi0`%)QAceye10F^cpu?fV6|M@x=!eiD z$P}(ZD%9bzUka2CPp(jTav{cr9$}`WC@Uh2h!y+&ISE6H$B7w<7A-1a#DsrKnKpIG zRDw~du5upS!Z0L8kbhF7&_WUaB*darR}jUSODDylHd(H8SSOc&TptY{Trkt2Shiwy z2*|iX%SnSDWs1D}(IiThL}3E`up!sS;!n3)01&dK{MzUs8pdGq)ZOx2u<8a^4h}e{Syl*=T6fq)|&e>ZYS{i31A=yFUtYC!Z7;7uN?Za&MlZQTdbgdwg}2Pip0|C zu3QxA&c5@|J1VL5bkwo`J*l=B0LYR2bBI3s@DoWt&iG4VNC^QHZ~y`^GEgl96}&DZ zpd5sdNsT5`&c%o@6ws9oJIt!55J&v3M2}AND8&_NQY_5)Vw_Q?8rQm!DD`$c?K1=G zsAIaKR;)vdI<&$FQLgG(0VJ0KBTAsIMp~e?uBvnh(?7Iektj(s@-!j8D3qv9z!KF0 zut8bGw2lEll4VsbIAfDBlyve4B0^dGu1+lpy=#C(S=*FP97X$+SwNHB)1gC+ovqOn z9*xv1nK;$LQdc_Fw6jh>Wl&UyNCoiA3RC?Q(N+=l2v%7!q7_kFNz65*#d`H>PE>gk zw$Ne~Juulmb8PnipB{~RZ-6HM8eoeRIFp#lesY*dVvQOuDhD9_`|&*}1&p@gh>e1n zC?Mf8*<$zx5U^v1I(}I~k3W7ncI~d_+ z75=R0ha;YNi;6EUS!0K1zB%NFMpm(8haXZhFCe4!FJ`e@mKjI^8D8P$9CBuOWR`#C zIirnh9-42rk4_qGhLx;3SwE$Ax?q=1O2}-+C7+z~$}PX#a>b+mb85^bOyO}>Js+L) z(oH{IbIwm!@gP?sUmfVNmxP?o-l$Q{L=(RPyrXd5QZ_7;S6b5LmS=@hdI>Y4tdx^AO28=D*T{R zSO`QT9ubL2RN@kuNJAm&Xc?^-!4#=jMJrwri&@m-7P;6(FMbh>VHD#S$#}(9EMthJ ziDDVq*hV+L5sq<`V;0XCHB>BP0(sQq9{JcuKmHMrffVE*30X)(9ukp>RAe8Qfr>Pe Z=8lUHl;k8SSxHM?5|e*yJpXQUG0D-5)=GtgNj3{JCHs+sduw zx4*yt=g%K;aq-x^x9jWcyuwmC79Nv}8#%?@-QQ+@{W}r58#g#QQ{C}J#xzOSKH)W~ z@ypDww49f`YMz3(qe@FlbF15$KMo(1rv2Rbr>JGjtsUT-SQedKB`9$-I3&a&B-cMW zjZZ&J=24ni=-ay1?#8Y!0=FU>d%uOGRgBHAYCC0ZJ&=4%C>6XD^KE=uT1jtudRo!I zPR%k#LSEC7(0I%H_4fAm&fzJ)0iHx6?dGP5gN~S^7beBYBux=6gcil5Q zp7%tjzx*>hJN4sdIJ%8=-rinZ{cc?Z5YP+q^72YaNm14JYVsLO!(I)H9^0FNE_M4Xe{;%K7aLGMGlWhZ2kNjWsd>%~-3Y?mpNH1;5DsQuV zN)*uy$;^LM*YR~@WF#>r{ql8z@#QUJT>8k5)rG}hlM~}J(^Ipne*0= zFMXdzzAP-9nVAt(^IzTgbA?NMckgg)exsu46R)OERDAOM{QUCBP{+X7OA@)E>3wb6 z7g4=PTSu48sqZh!Tlw@udwY8)r)DC;6T3c-exI3_(kF=N$B3DvaI53)c^7*7_=G(x zXzm;99vm5-`6XtYBxs0tadYR@3qkQIiQG@>`ZQ$iU2;WQHz6TGP|cWC)oF9?r$u1K z^78VBY-q>Vsb*Ka8QR;-&YWI51KG5Xr5SYJlScDh!BgVCgJ;MJRn zTAS{K>jsTgQ}xcHm6n5z)sGs)#Ae&J4I(;P19vxm3^vuyciF98u2VlC`Cs5|*S;C;+Ya8F>9&RRRq%;3q z)Fl(=pV2=&By|lb?p<-0e@8dZu?a3S%*Pjgd%YNXxV~ECcJVPT4==r9vXI=(SWjTsY2{SCc9=}!+l=sV)E5SIX%+5um@u(=yr-eWUe(OD?d5`vFQB-LklPP=6HM)Lf4M%|SS?Mm8Ido`apXFh zy{doP_!AUo;<{eSq}|W+GT%-Xu6$!paHG%|CbUL8y4*7V>Vmg&tq3Md8JNvyQYOO7 znpY~{*o+R#JbX67IW$Qj^#vvdRJ&Zkpk~^GV=!)y{y(Yr{{25`7}O zpQR_p$deA)9tTs-uajkw?oEFVW^jF?a5DL*mUS{AqVc+y^rZo2dwF0Qm}YNX!utAC>4cqc4!>umS6j=1vgF;g#P zMB`}6>Cg6nzlz)4vEuFHrb##Cke~R!D(!x4`ul!wJ3H+BY|lPCcnkdpy(2wpVK)gM zJtEt(lRHA6K2u+~RtUaq*1r2*G_?QG{LZY7+O?j)5fSBuut!bG@oQi0vk^M--ZnXK z8qkx7D-nq98&ME07YFJjTbgTYm>d!->Dm)&~i@5%ommABZDvvAy^1M?s-~@qu?aDPn3`;`eS)YaB(ZR?4S{`2Pc0 z7~)l7H=;Ocx}uR8uh_fg-e0}B9g{i8x#BDZs0KmhWi@zN+jOrkl@ZJBU z#}I;#=CXmZ+cx*vCDaB|Zx>5~-pi?>Q&NYe9QLHkb${Hbdn8N~dznWe`F73Ql-#OP zx%UcCMyo|gN52~Lz4b3QV{WiLU3ZW_lDp#>qmiP4cnoI8P{8_VJNiu#Jf$sL$Ns9c z_eZHhNtOXwC##`cd}P^fiNcqO2U6h^v*Q@0D+4$QyO)0&mJrmb(NBhair=#J$%}lt z9oSNzDI8)a@BI*;Y~G1dI4Whkt3M*LjD<>lA?Q;Dkt5jm%AXmmO|lLc?t-&!9N5h4` zSaW^2KK%e#d{^G1S!ombdaPc?@70}XS7VCogG!UjZ)m<%Qr~dsO1ga@u6@1Asnx{n z-F4=-@$Y8ruFOmhef)}JZ}{zKnppAK^Wfd1&8q4CgDFQ!jLFktUJDluxtn9CyYH%K zxAH8gXBM5R9qe`P_YTf_C6>adtf?=Y0@}v22#^4VJ$-|JL&@E?S0ZTWN z!?vszPyY!w83+Hv5A)~6K0a?|hB8@-F^QUT2ZQq$Cx;yXnuLcN+JI_7qzCr35!d-= z4*liY7Ye*Q|K>edutTw&^^;=cKL11qA9Z8UZ{xH?P!TZyPJtD3_2(-K%%jX*vKb_( zAlpM~>j4n=(A$)N&-Qd*$vw#1Z&M$%*_FPZ{3wz2C=jl*6s_z3$ZhRy#%n`I+5kwu z#!%fv0$XFr^{Gz1lz$$6!w%6(PfhRE)V-KsTNDnsL-}CN?)}OA+pnAahlAU+yO7+6 zD^d9mOwfQEySmu(N7G6*Qbvx^jnfs zL-Bj+b!B_o5qO1kjab3D$!_3i+h)USCfW_7*r2fzv{WT+k*nd`>F;Fb8&xd)n-7Cq z0(~3b)qRZFoRSQfpjzKA4ZHr^H6U;@LAdd4vgM{@aO>3IK6e9>%fsOA%=Fp{ypiek z9}llq2biVbG@~8GyuC-GYdCC84ohM%e zjDf|r6aE$lW~@zh$_?4!#LqZr!$-S0=Un48k{6jNcb*QK4DDpK<~#C}t)o?Cz0>Tc zmodfD*ZqffU!I<=V(D6jV{h*jT{~aXy>s$y6_;!*zqEcSE(le2d%yD0`GzSxYP@M^ zzb5#6)BFzpvzwt$-r==Xj?woc6GI1$t>=GmayLf{F7{dsu5Si@Jss;DI;>4B2xfot zerhVo|5=6dR@|MoMV7)qZVPU(-?KKUqT8SkkLET);ivQWA02c)YTc&XR9e!xb25_G zzM2x-w#Z|MA)m*U@Jo5(q9<3apZz}M5c(~CngUHf+IowLPjl%xJTVgHgP z;IwA;`)@iYVUeGIc!>jgp{VB~vex!(ljT11w??i!i`Zvj&D+VL}=kO_g|L<;^t7+{SYdBg&ZBLDXcnnEHJf{3=Wi8u&AgCqcD`nZ#TsH48v zqgZ%62IP(bG2+AF64WR>x`7p7WrYrsV~+b^R(Q0#5hRKTm7$M1c#N-iMp#aUIUR(Z z^2O9>$NaF1>5PpzdYp8yN~ME=9UY=BH`BX1Urco1S=GbkMj@!)QG^U1a&j z94-T-4C2C-$>HS^KskVFBLaL!s6FR!SLf72QwWn81Wt~x9gaWHNhIP?!hl~UCBVB;E)TPlPf}K3B6z)7C@hlBo^XpFJ-} zzaXM(ae!VfB8LcdvdMNQWob`AoVMe&6#$}5zK2bF+fV;j21N6%~S&*VCh9!@oPHZP>sJuu#7Dd2OHaH0dL)NO`y^2$3FmL5f-? z<*kwPig8ex;XIN&O2&wK43AzjqHdjnydXY%K}4oa=6$Fr08_|$j6`T4wqS#p*>(kJ zn}VPx^SIXv+Hkq86`5;zxF(QUONI?j<>8Pol}Y(vEcyjKu!=)}eww%Np4g#RFqvCG zG)gbWBv3`ZOqHfb?mth|n=CtqckJ$*UZEQEvrcJOx2v00CE+ zKoBr!QzT#xk+Fe2(4`efK+BfLLa+%aiF|<;sCG~hoD5T5pyJers*`90TqDayVp3P#}qRrdDgZ zwit`x$a~He41gr+1P5!^C_ts$Y1LUJphKVgT#wcrOJi$<@-}MF4sOtOYbd3Mh1f*W zG=l?dpuI%Urun<=n?5@?Ywu^3x7L-n%Yg?M;5iF$O`C%8PtTl$fkYhI$*rJ%JN5+@ zEjQeVO+bfXpiUU5-2%Krx5?L_!h_*hb1qnoLwO4~ zJvV3qV-e~LP3l;L6$Ws!ft9Y8kLRX9NC@*6%`uA994?K^+ld9j&@m!3#|EXD*U+5T zT55xGdV~7V7czl`RHULz4g4Rzd8gd_Zcb9NJDbXTvMDVQ?enI^g}M?v+~Q>LMw7nG z3QJpI&}2*zjQ6EZQ;0*=(*qf9jhX^kB?ceXFtJX+2guEM5Kxu4P&A$!SrZJ6n`v|q zhK=EoW4QNDiV5|Yw9~crHGHJU%!jDd_bHX7wivjr4Qigc1WHqqNQ&Z`qGn=)p@ZaZ-3a5XbNCJUL1@!=pG!6VO9w~-` zqVUM&ZFo4g`Mc;Azp@&`hHV!10D?bv*J3rdyu^z#V=U z6=2{W$UXJgev7kSF%-?6Dx{b`jrTB8Eg$hwB82ZO`hqb=__wX7A?qSN%sI8SMg;Cm z4_m}P6lV+JHtJSTs(zY;N+dsfXxPn@)2(3$UB>6Q<#*So_UKoA77If6>E%Au@BWVv zzs92V$;fz{p3lFFAUO0r5h`i`x{QS*NC*%X`V9vYJE46{LW^CcMJyEIBl_u=HuZBw!9nvuDwLP6N#$fxAgx&)Y!y7-%;hpi}<3|GP-*+N+Q2@b%wC zbw=>+R2m{ZZ5ng*QJ4e8yu^Nk77vHg zV9eWrOG%^LOEl6rIJs|hIWbgeb#M(2>IYwpB* z%41Chk-ADf`4T|GAW~*{M*Zek`ND+82ap~G3%_Pll@khE#S(l0B$$lMPn~?8Jgz}I zu}Yj!EJwzF0Darei?p2FO74lWe6fmysgq`&he8sK8p@42e3i#ovGCMeU%@zZSSrHF zsNty_ti5%lsKB-44_}%4w229i<~2k-1ES#fG@DVtRm{u>IdD|#vkZlZj7KxeMv(6o zGZ3Iu(rTte4{BnF;1O8*VVJwC5TW{VNqZ4!*!Hv2CG@#`+>*<)ZC zLGFkmkINX%m|D$v|EUZRU82yUyxvUgDgf42kZX9_cq}v@J1KebYZ*H^R)9cYmatg( zDmGVZW>9j7+V>?AK?1)kK<-j-G>TUNeWQkaqnYQ#(aydR()tK{yM2WStJWr6An|L! zTWVejIvIeb6;I2GXL$_J1ioDlRg+26foLzl>b79w5)t(z1eH((O!0@)@E6$WW`|hI zSSYIfq9PZMdV&8vj`|%M1|0)_LnM+kacC}~)YQclF9E#2-p}VoP>bR}-i!Jz7+K}HphhgYzSojJX zpmn+lS%4pIZTA5`;Wz2XI5c+>;$k79G5+xcNaK(-Bo~>QYzq?7di?lhOlQ#&&joo|< zROKu6kky_h_KOY{YHYC=;##FRUtn&%=LgVeOv52Kls*x zUg&=#W}DVd^*|qskfDdSlK;9D9zw7O{X+-#s)gkM%{&nay*(8ol%y#^r*V~bkBzo( z7|x|!lC%X+Q3bA92Z+*dau)toKmP2lcu_x=R#W0!<=LhZ zC7kS4yZ@ke|Fy&mh|R}%{Q2EyzZLJCYjd2nNtCn!`|1nhI=KHB$l1Iqa4!{kOh*r5 zM$!zx8k>#VstaHD=-J?AHK{FOh3|RTq<>FfW`87Jb0j5 zPB2D2u(fn}Zs^%;{QYyF;~wnVGweqi%XnSCyS9qwW5h>SqBG5nQx((;C8}n39*L!2 z6JrvDDO@U%HoCdnD!uL-P$9dN5is{^B}9&27;;yNK84Kq27!k#H^(tJ-DrjhVxreH zB5Bb>BQe}rX7Xd6sb-qI*gd1g82sBPMglwz2^>=c=Uz9WTDL*OS&4yIN*+DX{IlMB@^X@Q>*M5@x=jKcXWpjOe_#77Xrk~Mn=`7FzXOLm@ZcUt>;(6+T=@@HR| z8$!vHw}k$#8rR;%;NK2Np*dQmC{$^)8M4yiw%x8B{4~5*?DSaftCI?!UK`b6kb?g6 zvl#>J9Z6SmFf=mm&7^F_bZ-cJXHUj%CWci?Qh=2kW3$q z({|)pzfQ8IQDpcsHw&OB*FMC%h@(-80OGN6`!Xc2_0#JdtOAs13tu{$K8=?K8FI=b z1-c+%&1ZW?ld_w(bOxn}?&)TJb+$!`%U5$E8GN4;(x7+aGizA%>S^$PT8PXw zOQVtg#>3}W^eH#$Id~n16`U{v6@DgWl#X@X5i-&jI*ZCEHH1@zs7F6|xx?QqT`HQ~ zWdMg3r%C-I@G4(nx`p0N@8#i>`kK=#li>J#)NolQET@N=V!@qy1t_{!W7`+P^A8;` zjJ+na(5?8HkUAj|!O-gxC991|#g)KsexK6zUwMm+R(h;5o0DKd97R-2Y71=#!UH`u zULIIHR%9?A@>phi1*Iy-3I-X4*f6AREZVW$DK864DuQs!Xu{9#8X}V#ATc@Gh9}>E z%&T0C{by17yf$$;QE#ui8@a$EI#FR&ui))*g36xAQ4ysgel%;Pz9q<5DD_nd_dbc~qpC|5aWLtp&Ky_`yE(8IV-mjd-i)RO!vCC{<9hXvp=DY408 z%fg(=_^9U>b}$dkh^yMJ5m9^?P~lOOxE(2(l?Ov%yx#wjeoL@VyWE%linBe9b}A%J z-K0*X8h`WEjfm&4;)bYv5Io_hw%H|((ySjb+>!><%X5K5i!w^hY4(~A3<#Nz1-fZc!uVp>W*?eg7pdX0qHwOtQmyS!Zw97 zXN*I+AI!x#JSRzZKC=;C`GKb7%dEd;>lWfXN{9^k->aGN z)U*sVVWHmHoNm;OC!iqvI@ferE?N?EcU7KTM%d?ttd*m`anV21&7CLtpPS+CG|(@; z{EVMGE5|dZ{783DRD?~GsfTD8+9`ZJ))Nj!@q;x_&UBbV1LNA88*vyB)JZ3-Vby?Rs?k~iJbB`}D z1UBcMCp$4L6R9r7)v3bh3C37%SOs2-%IM`zCQAsc7dWC>N&QEdKARVB))q1x_6g4h zt$}rRJCv=~!=GVR7Q-HqJ}-G)pJYDrD(Ryv7iM zCrt%9+5O*kCVMy@MorPIz^Te{hyJpk#5r_Wc6We}MBwF@NZ~&vpcVi3;d~y_0FcCPHL+Vcw-5 zPJ3|+WYFABgBJ^=@ufVAq6x7$KsHBq+$YEJ>z>UIW6zml7GkoQLRMrRw|vcR-+f6r zn^)(TA2|>8ojO&do$$JOe4oKjCoAlL?a$ix9~v<*-31l}-6n-S4A_@j>Y|d^VOVBE zVZk;@*eSN>$=Yi)HZR4#Pn7jzrSg%0Bl{z0h>g6?c(^oNds0!fnTk4u%rdE1gaeqH z$?&KqK~^ZEG(1qFtn*Q)AOfZwh<#8l9^M?SmWroliwfzEZv`ut(JSv$t8*Ggvms)1 z8NuI66F$5R=%&k`u#i+!CP?A*2ft8w39|P!K*M7z0rv^i(p4W*Pcu zT?CA&yq!YGQz?F<^7@U+%iZ^{mf8us?Z!aIlvIbpncQAIgtMx}?}_T64HRty`V=X{ zz#4@#qI!YV)Z!`Ab^ys3wG!9hOwNjcaE#khtovy^mAk|P)(BKT0cS4cgN;JTf23Ix zVikGMMv5?%PH=Vm$k|UNgKc_}2RciPvQE8`tq!)WQX69;u*gS<;G5uNRR$c@^)scg zYwE5%%25VXSDm>EM|-abw1*Eighxhi*SAMVfl%8`?t5|u{RAu{VIjC7rx-Lt-7Hcr zzh3-azURGiN%!y8?pM_E%F7!6b~SdXd(<3M^-jtIY$GM*h3$fXt0l;oGXai3Jc_JI zAr5Qa_66=}Vu`FDA4w4I>>=T}=;wP#BsL=5@R?`1?v*?+6G<){17W7u=3s5L5omP` zlrzhdyKP6f-WJck+=LL&FILhoG1M=$&@a;*kjw!oN`gfN2KXgn+?ruaHwUhes){u0 z-?YU9ISjKimi7SX_XY(VdP->01t-iScB1@vkA`AA6yW%&x#(%=@F!7IaqZbaZ^ zB3|}0ABw)Ew5p-jw-15+{HCNCkwXZX9Blq=&_&ZzW~{HS#H3+?l5CE4HIgyOi+Dh$ zGE0A#zGFE28<1rEGP3s$bgA);BsTpw5{1wzM8r5P!INoFDHfk#29S9k6a^_C_0n0- zM2$Wl*_ty1|F3@T=3eHWHOOH@xGL9xT#J_TvL^m7$J-fY~58{y^@JkSc1P0V_ z%1o?;E7$>OKfXo;HZd5%kTX!~4rK~d=5hY|F$7$qq_Q6Z(uu=g8vgL3ez3I1pjfk4 zQXo*vuc zRh=Tbzzcc^y1YcNoa(cpAiA7NG6(FJ8uPm<{tu1v+tj<-9%Ds@1X06CAzeaI6pUw~ zOHWJxzyDydZwC*o=z}SGSOPh0icU3s zMFeW>L|#Y(D-Y ze*IyZ=)-j7hiM)>iq2z?_tDoZ6EciNOwBrVCF-Eq$(*>Ut)ho{AEzWX;u(XX<~F8< zi0N0CQRZtxVa~8(<>^un^P5eT_T`c%CCPs{Y+X! zWm^9{+Btgo;rpX@M~fG_V;mM^T^}qyf0_NPY;nb7YWcav%_p;c*Ngk9e&i5mO9A?) z7M9~4mJ^|tlgXA-1(ws*mNOqLXTMnf_+dHmU}|>Xf|3>ZaP%GW+jUE3AEpq!u zG7sbV8Y4n*k(}&{BJGjx!+0*0MMY;S6nzOjyFG>fpp18DG0B_fYVVwSn=PBH&Gj$~ z_Vz~{VwW&mcB&Wl^y6R#8-h)LG|Mm*EiQ_sKib9y#3TUp(AY9y!D#9j&Qv=FRuI}A zBy41d_58^i2vSGKXfN0aE|V-+L6+qW90*%2zU3F14q8sjHmPFro!mbqoS*nXnF;5@0=;sG?AmL>O4m%Fb16<+6$vio~t6uy`M8 z%aH1*3A5EPb5e9&(Ts6YM7?|D^wXkj$$I6NmDMvP*U{MU;-L88r& z_}(>UlCvhRIcW&?>ZR+m+s-k}E^owKVupZBv5lA*7m*k1FUDQocDmeXSruP&$=!CT z^mJ=FSmh^eM2AIWdlI5$*GITq%KTl+JzXopHgnn6nFGO9S!-ECYnkl7dm1;h%G|YRvY^lXTQ+OfD0-nnKdaE&> z*MsSTwtjy&cZc1!e0v1?d*Qi__WH-}wIk-WtKzkH0pga801rot3`cVWx*iP0rk-x4 zdq!}`J8;y2T`xc_2b`h;QEa+iU~$~v6auG>m*o+5zXqUEb=Vez9?23ya=aM&V~={d zh4FWFB)2&bo}aS-9eJq6a3sSvL9JZQXS*%O46GR!^S2nPL7Q{< z01o`aVd%U$>Hf0zM-zSl+Sn)#9F$vJgh%52-Dwcg}yuEV4Y@P`9n{GKHq=-(7)|_2C+N5aKF2+ zed%feqeI`n+I~iVeQ&|{4Jm|M0nkT{5W2qISfxD`ijQVCQqAk1`ozA>b3j}C8a&XK zW7!ie;pgP#|2W*=8Sb6=!S7Se-9O)VhgJRwE$m}C_H4fT-_(n=E6l!P)_HU5AICF) zKkER0uR~1Xfnu${^9Lk{M3k~z6q8q!YF~i$p?^5(FlQm4jy;e{`*6!YAnHzF^y7d) zahydV(nlhSA{f}obV%is1C|^%$+d~p%{f}yi;XJ`WabY{yEFI4YA(_`Fw^>JR(OC& z(Lu`9g=?~K27xGbgk);%(>#tDX#q&yvo|nZNZx!)nt0Hu^6|f0$63}vWnMvlJp;kv zfyISEl{&^Heb#TWpz8Ucn!iD{lpqpa@LP`HI`QCo)!>FZ!SAe3YfPsa#M5&oepMC* zJFLnzb_BP54gN46-2V5pHXyhm_VghAaf|p_%j)fpJ0TyfLwdbJ>fmSfEN4;DAp?a$ zk*k1xf5?~lkfFaJUnwEObfMokLPx|yzj#F`fw?RtV%%}BJzXO{e}!2h2$MRmd8R|g zIwCzKVUz>e82re2nsWpn?tI~K=wbk5?#{U)@%(cw|Kwq)Tt9s3aoAkAy`seV=j^kV z>X0q|<3TT~ZMyJ(9N|0S;k&Bgdw0V3t-}xC6jUGqJq%G!jd=_VLQ}()StICy@H0pp zO|^Oausv>=o&Zr;yL+ExCTtL3o_WRA=xZuHjkpt1jdQS9SHs+LOo~e*ov>#m&|s{c z$eSgk6PU)`H$=|A8L$%a9MgVI97h|^}TA>eWCFxOLzbG zCuFKvce}ncQMUt;=?2${I*(10Dun1>kL%N{rC*atQ){{O&x`dQ264}3ymN4@;%&Xt zKv|}}+gMzRN~-_Gde6jwv(N7F^6B^TTyHG}tTVu}SlXZ_rYdlV6 z$Ev+s%+Ify$ZRik#l9H==hRpl^wqC_m+ZOAY3U@&z~{#LWan4VCv_E(#=5B#2e|5u z=iI*0oK$tnS0bj-xbd1*N@Vh>%Ej5qp~3ert(9IqNO=r_d?h>EQhcpw@cQwZqdL`8 zzOZ(88sX=dIbCOD?gd88p&=c2v@(` z>Cb$|CjC~p_QT1EFsT!zDDw8>)!^SXT&xW0AgW8=E{L|u$DeX^;}&{rJ~Ly~Gd^79 z`x6&^iTs;w!|@TBE#JJ;&2dUHn8jr-f&7NIMfy2a)GcBRU0rKC%FU=w_E#jG-en7k zdkB6*k}6bcmedVb6?xkYGtDP`WKwk(?lav-V$9AHlq5g#CZ2UsYm~c#8%8|yDBVT6 zbLkuOj%^Z=wdPf=Z(iN{k6C`%D1GgHWus0}lSzZ_`A5XwveMrg^GRWKX5GKRJ4paM zWc7X_=80~%YZ6|E`y%y57lt;Ri?98SM1TwI?Fy^h-1n%~9$?ZmE{Fdy54tS>_vCo> z)tkA^)wYvN_qEbQqu}+D`bSz!O_4A0>!jWGlQ#2=IZb76yK29?7K-1ErV8W!XmHbp zL^MzF>84(~#)T=>xe-+L{L+;y%y%;4J`Ew`Dw0Pg8p$EBuP5;^$D>`fDdR5X;`rdv zMaO*=?aTANHF%g32F#R$4H2ldri{EG=PV}b#*yJ2+aD2Uw#rNvV8Js36np9dMAFv= z+P+2>T0T_UtDqC?z;WCw12pJlxmc2NU{~rENSsx};lP>gJ*fO;un;LuTZxO2p&x4^ z`s^t-e&JroT`Gn)I|QpcD|fX6mtl_kq#igs z9xB;pqt{`iK}RUp2}j%&(lq44Km_~Mc3k7nyluvF;98}+H&_GvyDo>O0s~LCk@}sH zSI_SHtLpYSUQ34C>8=&Dp2H45*V7f($b|_sXu?i!$?57ZYNP(ULx6r zCW0nu(ut=|VnBwkDrkmH>$LJX0=94`bY*r06C!Ug_?=Ox$(Rod5gH~iHV|RIc%_op z4b9Y;1XtvH_*nmekTgRaop{2%t3;UTnfm4IW+tsKZ@*bz>gI4Y(zwBM0ursmr|CY$ z3(Hr+?=FA^pX1f0qy@hvml=nho>{9F?tG18d{?fmEOd{MJ8UP`aGUmA(75=j@oO5H z3X=~)CiOy}OBw4cq=Q_IyIcAyWJ@c}m4(em^^I%Lqi^;o-y#h@3YnItWeScCcZ*jI zSAE!dR~vRNYy%OV>||^t#VCu|F}<1mc?j+G5`8EKe`y3NOz7R6wFWQ5J%v;A!V;>;XmlIgP17E$aq{uQS)BAqStk_%2KbIInenMGOf!L3y&*(@tEc{0wrP+zUM19^5 zT3txybc?LqNPqv?Nk!_#Xw`~jYd7B(>#lUzlL$)^u>(s0XpG+`I?KQM8g?N?gov)G zF|`cGs7MzvRj+ADwR}r9iMn;k)>);mlkINSPDUmu-mItV+sg~-at+aqyXhxiQ?nvV zsK2=A3Um*t5y+aRHgvi+#PP;&e^d>TWSkq>y9exn#LM5S}f*Qq-wc-zvJe(g4Oads#17t$ z3jB6ZRh-U!e9%z;W7Ew`arWoMLG$Q;a%ZjL+z<4A+wS@5fBW?dx&Lj0GO7HE6jxd- zXg}z5Q|hcf8azPtFVZB^s%li|eny*-Q;7^K7j4 zYv@oL*5api^L zLU(Z~vEdgN6jcC51ke~zg7x{Q&hwvz7kVa?%S4C@2C7YjX3c~6h{xYS)W%((WEPB3qdsgRA>d8Ebp9{>&GPbN=Jmde7*2i=!Ueo{Gc zGWox{^77TuC*V??HR}Q7Qk2@U?JIN^8>;Blb@o?R>o_mBaI*DsUXi?WeeMYtLXR}*YUm`EzQ!| zTQ2%(sE8FOUl^NEmNhL-LxR~x+=?4CZYMg97h=Xp`A0~-wC2v@JaK{CEGm}kAsjs+ z$l^2@ydgKe2}hrbWrrzCryshIWNt(Yx9W>|cIQahUV>~0LG`4Nf4WB?&0acaRyt)~ zn7G6)PgGju29??0lqAbV6s!MdM!w)8E0xGD0HVDhv~xFVFH-V^s1yW2$IT-HyOq1< z)ee>vi#XK6I*+J$*sGQ$Q$w&KPQ{QE9=V_;ZAKe)l_k~)o~pPK?F4I0 zR|hr;yj(9x-Z@e(pM3POMAo_V=%*UiwVNHv&0_4RnvZ>u@QZ!cj#dK8*1UZD$sRk$ zg@*E|yaaAWKolEG4Z%*TV_4HgK+*e`uH-Ld{(ruHiA@Tx{e`2A?23I2*&@Xedr^Em z<*2H;tm#DgW#a$K)SMSW6o!t49S+sz=-&TOheMf}GJ~wHmyf^Rh5LQmzUg8qqCG&!f0VkZn^7 z9$yVTh*Vw#%$SR1>6cNOJZdA{a)I3}xX7@BZkAbYxdnXqVy8s7Oy<2g}wk^nmsyt{*YS3~U9!fF8Xq4}pTxlXls2oc=| z36%NR=~evnYdMMaFed@!mL;=ZH7)kn3GB{^=FS;i<#GO{cMl>>CGoiZb&=m$NRO+?kn3h|k+rFqKz~|=_M%8GTI88kRnX#QSQ*#nk-oO9U#aXoMcx`D zSt0o`d$u$FVlh{Ik)wy~MjBV;*RuIil%PERm*EO;|HdL}`&a*n$DOW?qo*2^Tx*jf zqC<;SRSDMBmDVvTeD}RQ#KWo|ga4dbR`)8G;L*S5(PH1iggnFqR1Y={Pbk%sLHzYA zRlQe5M_iD-iTI+v$Di@ zifT`otCMf?{~ZxgUL?$;*3(|{>9wzqsQ>kO$(QxgNi3yw8(sc=OFTJ_M|-Ptajqn= zy>oYfCy;sNVcD;vsoDn#ypUPDEHMw|xn;e%MZ>Erx+lDTXg(G2@6<4gnrQ^&{!I^u zh}ZPOS~JjB+~q=!XI5ka2TT_ic} z8w`u8ai5rUykReqAIKsX;dU^Rf*l_i^GJg~_v%fYuuaHSq5|EX= zODqv~%wlf1FHbwhktguk9!N=mwZUc9#OQiukJJN|f| zAbY5WJR=e+om%Pcuk@@?rLRz#jwqH_eDdDs*h5OLuwFf{P&u#uxO7*he)m+_SCwW@?hvH>x=?wk zUb~h<^|bzss^KWQ;q$@6_Hl}{gKK`l>2X6IJ^!YxwD4nn3nfnf?Oyr4 zf7BV^&rRm|{O%Eie1*pE76fD@9;iA@kv$fCX9mG?0RE~xAh70p;C}&*266cSIgq=z zWCwO>3&0-$0GFRZKledn9k1NoN&IZkW%jzc*; zZ*^DuGyjspNK~b9s|zHIz#^mA7~K(E*kx^_F+}mxuY7-?*6rHJX?9Jgm7CwE3IIxtI5Y ze)~D2k6%&axvy_}h|6@J|M@%wIyMh_kQ+Lp_kp5Ext+TvdahroSG$hSc6S@Ks*4|! z`?^dQwxydN97sEg8#RCp-|KwKe-XQ;RilBe{VWwUI9&9g4K1&-F|< zJh#vFxA#N1=X=BNc(wC4x>x*@*LA!5x|Q>HUC(>H%lp0mbG{S&ruX~52mHW4c{m&V zXwyN$gSq(4L(4yWR!6*wPkg$Q^Tq3TIRn7PV{^x&b)(NX*0x^|(80~?xD@dCTnF_@ z8@ss6w%5P7_yK{cNBNU4{Ji(Wq?cb%bNi7qxqch@W?2%YdPQxd_Rae@VC6mCwy_!cEx`K987v& zr+;AM{`e&U0Bpd*0|Wv(fBwMv)2~mGeh3xz>C-RCLj(%@!I47eOp-rz9!Bi<2SL9x zB^Ck+nQ$S>g&#vgL;&ESN|X~>F7(*v+d_^Yfe^F^a%E7V{pwhN@egTIrAwJMZCYoj zPy|z{9$ZOt;RXZ(fc7ETum42Mh7?xGFuH&< zKmd@Gay!XfpcthH=+nCTO3=z5LhmPqrsbA50el{rwnT5vpivVwS{lFrmpZM#$Clgc zwLfB;Eu`B1xDBP;g4(UO-+~*Cj^g4%E(qm@O3OK&qML3q+^#!M0PVQ*4m|NfBF{YZ z8Y8Qwh1k=qHTWu1=>M{q>U*#R{PgSTz^FzOkSPK~%kU+uuA&No{A#)oCb9bY27$O% z`sR$O<~c~aF8e^>597d^YRss{lnkzB>wH7=xaP9dODh0?5}<^s&X5958bO2a zAvn662Y?-GylI{;rGx_jI{8EGNF*(NszCLMgfhw?rWCHq$*|ONAuhcH^9(V`G_%hv zi$rLvg)W-v&FUONY|bp}6cf)TL*mm6(+c!eB0d@;fuEg_|kzn4lTA4 zGW7Q3mR)`s=9py`t=fRCHF@TgSDu;Yo_+qAV3IAxS!OuC(Fo|Im0sFsp=}nB=%SBy zlIg0gzM9gSOU9b(uDxE`>8AmV`s=dIK0CCq10);mw%zVpZLu+Zo9?>3j@vZ5_1+t7 zt>qq@@4y9@8E>c99vtz+gDU**YZZSSa%xGtIr7RQXT0&lE#JIt%m?Hg^uRrrTl3IO z$9nXnNE%$-hKZa_~3;fp7`R8KOTAB{f0fsB6>DFFchI}ozYJOBUy diff --git a/var/package/Interface_Adminhtml_Default-1.7.0.0-rc1.xml b/var/package/Interface_Adminhtml_Default-1.7.0.0-rc1.xml deleted file mode 100644 index 9c7b14d7c0..0000000000 --- a/var/package/Interface_Adminhtml_Default-1.7.0.0-rc1.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - Interface_Adminhtml_Default - 1.7.0.0-rc1 - beta - AFL v3.0 - community - - Default interface for Adminhtml - Default interface for Adminhtml - 1.7.0.0-rc1 - Magento Core Teamcorecore@magentocommerce.com - 2012-03-28 - - - - 5.2.06.0.0Mage_Core_Adminhtmlcommunity1.7.0.0-rc11.8.0.0Lib_Js_Extcommunity1.7.0.0-rc11.8.0.0 - diff --git a/var/package/Interface_Adminhtml_Default-1.7.0.0.xml b/var/package/Interface_Adminhtml_Default-1.7.0.0.xml new file mode 100644 index 0000000000..26a2790016 --- /dev/null +++ b/var/package/Interface_Adminhtml_Default-1.7.0.0.xml @@ -0,0 +1,18 @@ + + + Interface_Adminhtml_Default + 1.7.0.0 + stable + AFL v3.0 + community + + Default interface for Adminhtml + Default interface for Adminhtml + 1.7.0.0 + Magento Core Teamcorecore@magentocommerce.com + 2012-04-20 + + + + 5.2.06.0.0Mage_Core_Adminhtmlcommunity1.7.0.01.8.0.0Lib_Js_Extcommunity1.7.0.01.8.0.0 + diff --git a/var/package/Interface_Frontend_Base_Default-1.7.0.0-rc1.xml b/var/package/Interface_Frontend_Base_Default-1.7.0.0.xml similarity index 52% rename from var/package/Interface_Frontend_Base_Default-1.7.0.0-rc1.xml rename to var/package/Interface_Frontend_Base_Default-1.7.0.0.xml index 45514c63cd..cd8cc64d52 100644 --- a/var/package/Interface_Frontend_Base_Default-1.7.0.0-rc1.xml +++ b/var/package/Interface_Frontend_Base_Default-1.7.0.0.xml @@ -1,18 +1,18 @@ Interface_Frontend_Base_Default - 1.7.0.0-rc1 - beta + 1.7.0.0 + stable AFL v3.0 community This is a Magento themes base This is a Magento themes base - 1.7.0.0-rc1 + 1.7.0.0 Magento Core Teamcorecore@magentocommerce.com - 2012-03-28 - - + 2012-04-20 + + - 5.2.06.0.0Mage_Core_Modulescommunity1.7.0.0-rc11.8.0.0 + 5.2.06.0.0Mage_Core_Modulescommunity1.7.0.01.8.0.0 diff --git a/var/package/Interface_Frontend_Default-1.7.0.0-rc1.xml b/var/package/Interface_Frontend_Default-1.7.0.0-rc1.xml deleted file mode 100644 index 5a25fdb015..0000000000 --- a/var/package/Interface_Frontend_Default-1.7.0.0-rc1.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - Interface_Frontend_Default - 1.7.0.0-rc1 - beta - AFL v3.0 - community - - Default interface for Frontend - Default interface for Frontend - 1.7.0.0-rc1 - Magento Core Teamcorecore@magentocommerce.com - 2012-03-28 - - - - 5.2.06.0.0Mage_Core_Modulescommunity1.7.0.0-rc11.8.0.0 - diff --git a/var/package/Interface_Frontend_Default-1.7.0.0.xml b/var/package/Interface_Frontend_Default-1.7.0.0.xml new file mode 100644 index 0000000000..3932bfffdc --- /dev/null +++ b/var/package/Interface_Frontend_Default-1.7.0.0.xml @@ -0,0 +1,18 @@ + + + Interface_Frontend_Default + 1.7.0.0 + stable + AFL v3.0 + community + + Default interface for Frontend + Default interface for Frontend + 1.7.0.0 + Magento Core Teamcorecore@magentocommerce.com + 2012-04-20 + + + + 5.2.06.0.0Mage_Core_Modulescommunity1.7.0.01.8.0.0 + diff --git a/var/package/Interface_Install_Default-1.7.0.0-rc1.xml b/var/package/Interface_Install_Default-1.7.0.0.xml similarity index 93% rename from var/package/Interface_Install_Default-1.7.0.0-rc1.xml rename to var/package/Interface_Install_Default-1.7.0.0.xml index 341fc09c92..a1db0e8d52 100644 --- a/var/package/Interface_Install_Default-1.7.0.0-rc1.xml +++ b/var/package/Interface_Install_Default-1.7.0.0.xml @@ -1,18 +1,18 @@ Interface_Install_Default - 1.7.0.0-rc1 - beta + 1.7.0.0 + stable AFL v3.0 community Default interface for Install Default interface for Install - 1.7.0.0-rc1 + 1.7.0.0 Magento Core Teamcorecore@magentocommerce.com - 2012-03-28 - + 2012-04-20 + - 5.2.06.0.0Mage_Core_Modulescommunity1.7.0.0-rc11.8.0.0 + 5.2.06.0.0Mage_Core_Modulescommunity1.7.0.01.8.0.0 diff --git a/var/package/Lib_Google_Checkout-1.5.0.0.xml b/var/package/Lib_Google_Checkout-1.5.0.0.xml index 591ef813d3..4e5c39d1a9 100644 --- a/var/package/Lib_Google_Checkout-1.5.0.0.xml +++ b/var/package/Lib_Google_Checkout-1.5.0.0.xml @@ -10,9 +10,9 @@ Google Checkout Library 1.5.0.0 Magento Core Teamcorecore@magentocommerce.com - 2011-07-11 - - + 2011-02-08 + + 5.2.06.0.0 diff --git a/var/package/Lib_Js_Calendar-1.51.1.1-rc1.xml b/var/package/Lib_Js_Calendar-1.51.1.1.xml similarity index 94% rename from var/package/Lib_Js_Calendar-1.51.1.1-rc1.xml rename to var/package/Lib_Js_Calendar-1.51.1.1.xml index 645fe7780e..2fbe13e02d 100644 --- a/var/package/Lib_Js_Calendar-1.51.1.1-rc1.xml +++ b/var/package/Lib_Js_Calendar-1.51.1.1.xml @@ -1,17 +1,17 @@ Lib_Js_Calendar - 1.51.1.1-rc1 - beta + 1.51.1.1 + stable Mixed community Javascript Calendar for Magento Javascript Calendar for Magento - 1.51.1.1-rc1 + 1.51.1.1 Magento Core Teamcorecore@magentocommerce.com - 2012-03-28 - + 2012-04-20 + 5.2.06.0.0 diff --git a/var/package/Lib_Js_Ext-1.7.0.0-rc1.xml b/var/package/Lib_Js_Ext-1.7.0.0.xml similarity index 99% rename from var/package/Lib_Js_Ext-1.7.0.0-rc1.xml rename to var/package/Lib_Js_Ext-1.7.0.0.xml index 5816e2628f..eefb1847c9 100644 --- a/var/package/Lib_Js_Ext-1.7.0.0-rc1.xml +++ b/var/package/Lib_Js_Ext-1.7.0.0.xml @@ -1,17 +1,17 @@ Lib_Js_Ext - 1.7.0.0-rc1 - beta + 1.7.0.0 + stable Mixed community Extjs Javascript Libraries for Magento Extjs Javascript Libraries for Magento - 1.7.0.0-rc1 + 1.7.0.0 Magento Core Teamcorecore@magentocommerce.com - 2012-03-28 - + 2012-04-20 + 5.2.06.0.0 diff --git a/var/package/Lib_Js_Mage-1.7.0.0-rc1.xml b/var/package/Lib_Js_Mage-1.7.0.0.xml similarity index 91% rename from var/package/Lib_Js_Mage-1.7.0.0-rc1.xml rename to var/package/Lib_Js_Mage-1.7.0.0.xml index 241af8f9e6..9ec121ae83 100644 --- a/var/package/Lib_Js_Mage-1.7.0.0-rc1.xml +++ b/var/package/Lib_Js_Mage-1.7.0.0.xml @@ -1,18 +1,18 @@ Lib_Js_Mage - 1.7.0.0-rc1 - beta + 1.7.0.0 + stable Mixed community Javascript Libraries for Magento Javascript Libraries for Magento - 1.7.0.0-rc1 + 1.7.0.0 Magento Core Teamcorecore@magentocommerce.com - 2012-03-28 - - + 2012-04-20 + + - 5.2.06.0.0Lib_Js_Prototypecommunity1.7.0.0-rc11.7.1.0 + 5.2.06.0.0Lib_Js_Prototypecommunity1.7.0.0.31.7.1.0 diff --git a/var/package/Lib_Js_Prototype-1.7.0.0.3-rc1.xml b/var/package/Lib_Js_Prototype-1.7.0.0.3.xml similarity index 98% rename from var/package/Lib_Js_Prototype-1.7.0.0.3-rc1.xml rename to var/package/Lib_Js_Prototype-1.7.0.0.3.xml index 19558cbaf3..4968045c3d 100644 --- a/var/package/Lib_Js_Prototype-1.7.0.0.3-rc1.xml +++ b/var/package/Lib_Js_Prototype-1.7.0.0.3.xml @@ -1,17 +1,17 @@ Lib_Js_Prototype - 1.7.0.0.3-rc1 - beta + 1.7.0.0.3 + stable Mixed community Prototype and Scriptaculous Javascript Libraries for Magento Prototype and Scriptaculous Javascript Libraries for Magento - 1.7.0.0.3-rc1 + 1.7.0.0.3 Magento Core Teamcorecore@magentocommerce.com - 2012-03-28 - + 2012-04-20 + 5.2.06.0.0 diff --git a/var/package/Lib_Js_TinyMCE-3.4.7.0-rc1.xml b/var/package/Lib_Js_TinyMCE-3.4.7.0.xml similarity index 99% rename from var/package/Lib_Js_TinyMCE-3.4.7.0-rc1.xml rename to var/package/Lib_Js_TinyMCE-3.4.7.0.xml index 3a9e52920f..2c1fb5373f 100644 --- a/var/package/Lib_Js_TinyMCE-3.4.7.0-rc1.xml +++ b/var/package/Lib_Js_TinyMCE-3.4.7.0.xml @@ -1,17 +1,17 @@ Lib_Js_TinyMCE - 3.4.7.0-rc1 - beta + 3.4.7.0 + stable Mixed community TinyMCE Javascript Libraries for Magento TinyMCE Javascript Libraries for Magento - 3.4.7.0-rc1 + 3.4.7.0 Magento Core Teamcorecore@magentocommerce.com - 2012-03-28 - + 2012-04-20 + 5.2.06.0.0 diff --git a/var/package/Lib_LinLibertineFont-2.8.14.1-rc1.xml b/var/package/Lib_LinLibertineFont-2.8.14.1.xml similarity index 90% rename from var/package/Lib_LinLibertineFont-2.8.14.1-rc1.xml rename to var/package/Lib_LinLibertineFont-2.8.14.1.xml index 36fa661b1c..99403763b4 100644 --- a/var/package/Lib_LinLibertineFont-2.8.14.1-rc1.xml +++ b/var/package/Lib_LinLibertineFont-2.8.14.1.xml @@ -1,17 +1,17 @@ Lib_LinLibertineFont - 2.8.14.1-rc1 - beta + 2.8.14.1 + stable GPL community Libertine Open Fonts Project fonts for PDF print-outs Libertine Open Fonts Project fonts for PDF print-outs - 2.8.14.1-rc1 + 2.8.14.1 Magento Core Teamcorecore@magentocommerce.com - 2012-03-28 - + 2012-04-20 + 5.2.06.0.0 diff --git a/var/package/Lib_Mage-1.7.0.0-rc1.xml b/var/package/Lib_Mage-1.7.0.0.xml similarity index 97% rename from var/package/Lib_Mage-1.7.0.0-rc1.xml rename to var/package/Lib_Mage-1.7.0.0.xml index 4623bc80de..436bfa6d84 100644 --- a/var/package/Lib_Mage-1.7.0.0-rc1.xml +++ b/var/package/Lib_Mage-1.7.0.0.xml @@ -1,17 +1,17 @@ Lib_Mage - 1.7.0.0-rc1 - beta + 1.7.0.0 + stable OSL v3.0 community Mage Library Mage Library - 1.7.0.0-rc1 + 1.7.0.0 Magento Core Teamcorecore@magentocommerce.com - 2012-03-28 - + 2012-04-20 + 5.2.06.0.0 diff --git a/var/package/Lib_Phpseclib-1.5.0.0.xml b/var/package/Lib_Phpseclib-1.5.0.0.xml index 61d4a388d2..2f58c9b422 100644 --- a/var/package/Lib_Phpseclib-1.5.0.0.xml +++ b/var/package/Lib_Phpseclib-1.5.0.0.xml @@ -10,8 +10,8 @@ Phpseclib Library 1.5.0.0 Magento Core Teamcorecore@magentocommerce.com - 2011-07-11 - + 2011-02-08 + 5.2.06.0.0 diff --git a/var/package/Lib_Varien-1.7.0.0-rc1.xml b/var/package/Lib_Varien-1.7.0.0.xml similarity index 97% rename from var/package/Lib_Varien-1.7.0.0-rc1.xml rename to var/package/Lib_Varien-1.7.0.0.xml index d606856351..e099c6be5f 100644 --- a/var/package/Lib_Varien-1.7.0.0-rc1.xml +++ b/var/package/Lib_Varien-1.7.0.0.xml @@ -1,18 +1,18 @@ Lib_Varien - 1.7.0.0-rc1 - beta + 1.7.0.0 + stable OSL v3.0 community Varien Library Varien Library - 1.7.0.0-rc1 + 1.7.0.0 Magento Core Teamcorecore@magentocommerce.com - 2012-03-28 - - + 2012-04-20 + + 5.2.06.0.0Lib_ZFcommunity1.11.1.01.12.0.0PDOSPLcurlSimpleXMLdomgdiconvpdo_mysqlmcryptpcreReflectionsession diff --git a/var/package/Lib_ZF-1.11.1.0.xml b/var/package/Lib_ZF-1.11.1.0.xml index f16497d690..49b49a0e1f 100644 --- a/var/package/Lib_ZF-1.11.1.0.xml +++ b/var/package/Lib_ZF-1.11.1.0.xml @@ -10,9 +10,9 @@ Zend Framework 1.11.1.0 Magento Core Teamcorecore@magentocommerce.com - 2011-06-15 - + 2011-02-08 + - 5.2.06.0.0Lib_ZF_Localecommunity1.11.1.01.12.0.0 + 5.2.06.0.0Lib_ZF_Localecommunity1.11.1.01.11.1.0 diff --git a/var/package/Lib_ZF_Locale-1.11.1.0.xml b/var/package/Lib_ZF_Locale-1.11.1.0.xml index b542af603b..8473907728 100644 --- a/var/package/Lib_ZF_Locale-1.11.1.0.xml +++ b/var/package/Lib_ZF_Locale-1.11.1.0.xml @@ -11,8 +11,8 @@ splitted from ZF to avoid memory overruns during installation and upgrades 1.11.1.0 Magento Core Teamcorecore@magentocommerce.com - 2011-06-15 - + 2011-02-08 + 5.2.06.0.0 diff --git a/var/package/Mage_All_Latest-1.7.0.0-rc1.xml b/var/package/Mage_All_Latest-1.7.0.0-rc1.xml deleted file mode 100644 index ad8c5fd7a9..0000000000 --- a/var/package/Mage_All_Latest-1.7.0.0-rc1.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - Mage_All_Latest - 1.7.0.0-rc1 - beta - OSL v3.0 - community - - Metapackage for latest Magento 1.7.0.0-rc1 release - Metapackage for latest Magento 1.7.0.0-rc1 release - 1.7.0.0-rc1 - Magento Core Teamcorecore@magentocommerce.com - 2012-03-28 - - - - 5.2.06.0.0Mage_Core_Modulescommunity1.7.0.0-rc11.7.0.0-rc1Mage_Core_Adminhtmlcommunity1.7.0.0-rc11.7.0.0-rc1Interface_Adminhtml_Defaultcommunity1.7.0.0-rc11.7.0.0-rc1Interface_Frontend_Defaultcommunity1.7.0.0-rc11.7.0.0-rc1Interface_Install_Defaultcommunity1.7.0.0-rc11.7.0.0-rc1Mage_Downloadercommunity1.7.0.0-rc11.7.0.0-rc1Mage_Centinelcommunity1.7.0.0-rc11.7.0.0-rc1Interface_Frontend_Base_Defaultcommunity1.7.0.0-rc11.7.0.0-rc1Phoenix_Moneybookerscommunity1.3.1-rc11.3.1-rc1Mage_Compilercommunity1.7.0.0-rc11.7.0.0-rc1Magento_Mobilecommunity1.6.0.0.22.11.7.0.0 - diff --git a/var/package/Mage_All_Latest-1.7.0.0.xml b/var/package/Mage_All_Latest-1.7.0.0.xml new file mode 100644 index 0000000000..39c3110752 --- /dev/null +++ b/var/package/Mage_All_Latest-1.7.0.0.xml @@ -0,0 +1,18 @@ + + + Mage_All_Latest + 1.7.0.0 + stable + OSL v3.0 + community + + Metapackage for latest Magento 1.7.0.0 release + Metapackage for latest Magento 1.7.0.0 release + 1.7.0.0 + Magento Core Teamcorecore@magentocommerce.com + 2012-04-20 + + + + 5.2.06.0.0Mage_Core_Modulescommunity1.7.0.01.7.0.0Mage_Core_Adminhtmlcommunity1.7.0.01.7.0.0Interface_Adminhtml_Defaultcommunity1.7.0.01.7.0.0Interface_Frontend_Defaultcommunity1.7.0.01.7.0.0Interface_Install_Defaultcommunity1.7.0.01.7.0.0Mage_Downloadercommunity1.7.0.01.7.0.1Mage_Centinelcommunity1.7.0.01.7.0.0Interface_Frontend_Base_Defaultcommunity1.7.0.01.7.0.0Phoenix_Moneybookerscommunity1.3.11.3.1Mage_Compilercommunity1.7.0.01.7.0.0Magento_Mobilecommunity1.7.0.0.22.11.7.0.1 + diff --git a/var/package/Mage_Centinel-1.7.0.0-rc1.xml b/var/package/Mage_Centinel-1.7.0.0.xml similarity index 95% rename from var/package/Mage_Centinel-1.7.0.0-rc1.xml rename to var/package/Mage_Centinel-1.7.0.0.xml index 3c17b357ca..d9023a9ece 100644 --- a/var/package/Mage_Centinel-1.7.0.0-rc1.xml +++ b/var/package/Mage_Centinel-1.7.0.0.xml @@ -1,18 +1,18 @@ Mage_Centinel - 1.7.0.0-rc1 - beta + 1.7.0.0 + stable mixed community 3D Secure Card Validation An integration with Cardinalcommerce Centinel service. Provides option to validate Visa and Mastercard cards for eliminating possible fraudlent order placement attempts. Adds information about Electronic Commerce Identifier, that designates liability for chargeback. - 1.7.0.0-rc1 + 1.7.0.0 Magento Core Teamcorecore@magentocommerce.com - 2012-03-28 - + 2012-04-20 + - 5.2.06.0.0Mage_Core_Modulescommunity1.7.0.0-rc11.8.0.0 + 5.2.06.0.0Mage_Core_Modulescommunity1.7.0.01.8.0.0 diff --git a/var/package/Mage_Compiler-1.7.0.0-rc1.xml b/var/package/Mage_Compiler-1.7.0.0.xml similarity index 87% rename from var/package/Mage_Compiler-1.7.0.0-rc1.xml rename to var/package/Mage_Compiler-1.7.0.0.xml index 9f93794203..d723eaefb2 100644 --- a/var/package/Mage_Compiler-1.7.0.0-rc1.xml +++ b/var/package/Mage_Compiler-1.7.0.0.xml @@ -1,18 +1,18 @@ Mage_Compiler - 1.7.0.0-rc1 - beta + 1.7.0.0 + stable OSL v3.0 community This module compiles all files of a Magento installation and creates a single include path to increase performance This module compiles all files of a Magento installation and creates a single include path to increase performance - 1.7.0.0-rc1 + 1.7.0.0 Magento Core Teamcorecore@magentocommerce.com - 2012-03-28 - + 2012-04-20 + - 5.2.06.0.0Mage_Core_Modulescommunity1.7.0.0-rc11.8.0.0Mage_Core_Adminhtmlcommunity1.7.0.0-rc11.8.0.0 + 5.2.06.0.0Mage_Core_Modulescommunity1.7.0.01.8.0.0Mage_Core_Adminhtmlcommunity1.7.0.01.8.0.0 diff --git a/var/package/Mage_Core_Adminhtml-1.7.0.0-rc1.xml b/var/package/Mage_Core_Adminhtml-1.7.0.0.xml similarity index 98% rename from var/package/Mage_Core_Adminhtml-1.7.0.0-rc1.xml rename to var/package/Mage_Core_Adminhtml-1.7.0.0.xml index b056dc39eb..97698b13e9 100644 --- a/var/package/Mage_Core_Adminhtml-1.7.0.0-rc1.xml +++ b/var/package/Mage_Core_Adminhtml-1.7.0.0.xml @@ -1,18 +1,18 @@ Mage_Core_Adminhtml - 1.7.0.0-rc1 - beta + 1.7.0.0 + stable OSL v3.0 community Magento Administration Panel Magento Administration Panel - 1.7.0.0-rc1 + 1.7.0.0 Magento Core Teamcorecore@magentocommerce.com - 2012-03-28 - - + 2012-04-20 + + - 5.2.06.0.0Mage_Core_Modulescommunity1.7.0.0-rc11.8.0.0Lib_Js_Calendarcommunity1.51.1.1-rc11.52Lib_Js_Extcommunity1.7.0.0-rc11.8.0.0Lib_LinLibertineFontcommunity2.8.14.1-rc12.9.0.0Lib_Js_TinyMCEcommunity3.4.7.0-rc13.5.0.0 + 5.2.06.0.0Mage_Core_Modulescommunity1.7.0.01.8.0.0Lib_Js_Calendarcommunity1.51.1.11.52Lib_Js_Extcommunity1.7.0.01.8.0.0Lib_LinLibertineFontcommunity2.8.14.12.9.0.0Lib_Js_TinyMCEcommunity3.4.7.03.5.0.0 diff --git a/var/package/Mage_Core_Modules-1.7.0.0-rc1.xml b/var/package/Mage_Core_Modules-1.7.0.0-rc1.xml deleted file mode 100644 index a83b8ed36e..0000000000 --- a/var/package/Mage_Core_Modules-1.7.0.0-rc1.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - Mage_Core_Modules - 1.7.0.0-rc1 - beta - OSL v3.0 - community - - Collection of Magento Core Modules - Collection of Magento Core Modules - 1.7.0.0-rc1 - Magento Core Teamcorecore@magentocommerce.com - 2012-03-28 - - - - 5.2.06.0.0Lib_Variencommunity1.7.0.0-rc11.8.0.0Lib_Google_Checkoutcommunity1.5.0.01.5.1.0Lib_Js_Calendarcommunity1.51.1.1-rc11.52Lib_Js_Magecommunity1.7.0.0-rc11.8.0.0Lib_Js_Prototypecommunity1.7.0.0.3-rc11.7.1.0Lib_Phpseclibcommunity1.5.0.01.5.1.0Mage_Locale_en_UScommunity1.7.0.0-rc11.8.0.0Lib_Magecommunity1.7.0.0-rc11.8.0.0 - diff --git a/var/package/Mage_Core_Modules-1.7.0.0.xml b/var/package/Mage_Core_Modules-1.7.0.0.xml new file mode 100644 index 0000000000..393299895b --- /dev/null +++ b/var/package/Mage_Core_Modules-1.7.0.0.xml @@ -0,0 +1,18 @@ + + + Mage_Core_Modules + 1.7.0.0 + stable + OSL v3.0 + community + + Collection of Magento Core Modules + Collection of Magento Core Modules + 1.7.0.0 + Magento Core Teamcorecore@magentocommerce.com + 2012-04-20 + + + + 5.2.06.0.0Lib_Variencommunity1.7.0.01.8.0.0Lib_Google_Checkoutcommunity1.5.0.01.5.1.0Lib_Js_Calendarcommunity1.51.1.11.52Lib_Js_Magecommunity1.7.0.01.8.0.0Lib_Js_Prototypecommunity1.7.0.0.31.7.1.0Lib_Phpseclibcommunity1.5.0.01.5.1.0Mage_Locale_en_UScommunity1.7.0.01.8.0.0Lib_Magecommunity1.7.0.01.8.0.0 + diff --git a/var/package/Mage_Downloader-1.7.0.0-rc1.xml b/var/package/Mage_Downloader-1.7.0.0.xml similarity index 95% rename from var/package/Mage_Downloader-1.7.0.0-rc1.xml rename to var/package/Mage_Downloader-1.7.0.0.xml index 1f745139c2..c904769d55 100644 --- a/var/package/Mage_Downloader-1.7.0.0-rc1.xml +++ b/var/package/Mage_Downloader-1.7.0.0.xml @@ -1,18 +1,18 @@ Mage_Downloader - 1.7.0.0-rc1 - beta + 1.7.0.0 + stable OSL v3.0 community Magento Downloader Magento Downloader - 1.7.0.0-rc1 + 1.7.0.0 Magento Core Teamcorecore@magentocommerce.com - 2012-03-28 - - + 2012-04-20 + + 5.2.06.0.0 diff --git a/var/package/Mage_Locale_en_US-1.7.0.0-rc1.xml b/var/package/Mage_Locale_en_US-1.7.0.0.xml similarity index 86% rename from var/package/Mage_Locale_en_US-1.7.0.0-rc1.xml rename to var/package/Mage_Locale_en_US-1.7.0.0.xml index dda5a10b1d..5db258a149 100644 --- a/var/package/Mage_Locale_en_US-1.7.0.0-rc1.xml +++ b/var/package/Mage_Locale_en_US-1.7.0.0.xml @@ -1,18 +1,18 @@ Mage_Locale_en_US - 1.7.0.0-rc1 - beta + 1.7.0.0 + stable OSL v3.0 community en_US locale en_US locale - 1.7.0.0-rc1 + 1.7.0.0 Magento Core Teamcorecore@magentocommerce.com - 2012-03-28 - - + 2012-04-20 + + 5.2.06.0.0 diff --git a/var/package/Magento_Mobile-1.6.0.0.22.1.xml b/var/package/Magento_Mobile-1.7.0.0.22.1.xml similarity index 99% rename from var/package/Magento_Mobile-1.6.0.0.22.1.xml rename to var/package/Magento_Mobile-1.7.0.0.22.1.xml index 53cb15b44a..24130fb7f8 100644 --- a/var/package/Magento_Mobile-1.6.0.0.22.1.xml +++ b/var/package/Magento_Mobile-1.7.0.0.22.1.xml @@ -1,19 +1,18 @@ Magento_Mobile - 1.6.0.0.22.1 + 1.7.0.0.22.1 stable mixed community Magento Mobile Xml Interface An integration magento with mobile applications (e.g. iPhone, Android, iPad) - 1.6.0.0.22.1 version of package -internal svn revision #121425 + 1.7.0.0.22.1 version of package internal svn revision #121425 Magento Core Teamcorecore@magentocommerce.com - 2011-12-29 + 2012-04-10 - 5.2.06.0.0Mage_Core_Modulescommunity1.6.0.01.7.0.0 + 5.2.06.0.0Mage_Core_Modulescommunity1.7.0.01.7.1.0 diff --git a/var/package/Phoenix_Moneybookers-1.3.1-rc1.xml b/var/package/Phoenix_Moneybookers-1.3.1.xml similarity index 97% rename from var/package/Phoenix_Moneybookers-1.3.1-rc1.xml rename to var/package/Phoenix_Moneybookers-1.3.1.xml index cb258741a5..afc3e49a12 100644 --- a/var/package/Phoenix_Moneybookers-1.3.1-rc1.xml +++ b/var/package/Phoenix_Moneybookers-1.3.1.xml @@ -1,8 +1,8 @@ Phoenix_Moneybookers - 1.3.1-rc1 - beta + 1.3.1 + stable mixed community @@ -25,11 +25,11 @@ Przelewy24 - Poland Sofortüberweisung - Germany Nordea Solo - Finland Moneybookers eWallet - 1.3.1-rc1 + 1.3.1 Magento Core Teamcorecore@magentocommerce.com - 2012-03-28 - + 2012-04-20 + - 5.2.06.0.0Mage_Core_Modulescommunity1.7.0.0-rc11.8.0.0 + 5.2.06.0.0Mage_Core_Modulescommunity1.7.0.01.8.0.0